StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrgJPWriter.cxx
1 // $Id: StjTrgJPWriter.cxx,v 1.4 2008/09/21 19:11:40 tai Exp $
2 #include "StjTrgJPWriter.h"
3 
4 #include "StjTrg.h"
5 
6 #include <TTree.h>
7 
8 #include <vector>
9 
10 ClassImp(StjTrgJPWriter)
11 
12 using namespace std;
13 
14 void StjTrgJPWriter::createBranch_trgSpecific(TTree* tree)
15 {
16  tree->Branch("nJetPatches" , &_nJetPatches , "nJetPatches/I" );
17  tree->Branch("jetPatchId" , _jetPatchId , "jetPatchId[nJetPatches]/I");
18  tree->Branch("jetPatchEt" , _jetPatchEt , "jetPatchEt[nJetPatches]/D");
19  tree->Branch("jetPatchDsmAdc" , _jetPatchDsmAdc , "jetPatchDsmAdc[nJetPatches]/I");
20  tree->Branch("jetPatchAdc" , _jetPatchAdc , "jetPatchAdc[nJetPatches]/i");
21  tree->Branch("jetPatchEnergy" , _jetPatchEnergy , "jetPatchEnergy[nJetPatches]/D");
22 }
23 
24 void StjTrgJPWriter::fillBranch_trgSpecific()
25 {
26  vector<int> jps = _trg->jetPatches();
27  vector<int> jetPatchDsmAdc = _trg->jetPatchDsmAdc();
28  vector<unsigned int> jetPatchAdc = _trg->jetPatchAdc();
29  vector<double> jetPatchEnergy = _trg->jetPatchEnergy();
30  vector<double> jetPatchEt = _trg->jetPatchEt();
31 
32  _nJetPatches = jps.size();
33 
34  for(int i = 0; i < _nJetPatches; ++i) {
35  _jetPatchId[i] = jps[i];
36  _jetPatchDsmAdc[i] = jetPatchDsmAdc[i];
37  _jetPatchAdc[i] = jetPatchAdc[i];
38  _jetPatchEnergy[i] = jetPatchEnergy[i];
39  _jetPatchEt[i] = jetPatchEt[i];
40  }
41 }