StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrgHTWriter.cxx
1 // $Id: StjTrgHTWriter.cxx,v 1.4 2008/09/21 19:11:40 tai Exp $
2 #include "StjTrgHTWriter.h"
3 
4 #include "StjTrg.h"
5 
6 #include <TTree.h>
7 
8 #include <vector>
9 
10 ClassImp(StjTrgHTWriter)
11 
12 using namespace std;
13 
14 void StjTrgHTWriter::createBranch_trgSpecific(TTree* tree)
15 {
16  tree->Branch("nTowers" , &_nTowers , "nTowers/I" );
17  tree->Branch("towerId" , _towerId , "towerId[nTowers]/I");
18  tree->Branch("towerEt" , _towerEt , "towerEt[nTowers]/D");
19  tree->Branch("towerDsmAdc" , _towerDsmAdc , "towerDsmAdc[nTowers]/I");
20  tree->Branch("towerAdc" , _towerAdc , "towerAdc[nTowers]/i");
21  tree->Branch("towerEnergy" , _towerEnergy , "towerEnergy[nTowers]/D");
22 }
23 
24 void StjTrgHTWriter::fillBranch_trgSpecific()
25 {
26  vector<int> towers = _trg->towers();
27  vector<int> towerDsmAdc = _trg->towerDsmAdc();
28  vector<unsigned int> towerAdc = _trg->towerAdc();
29  vector<double> towerEnergy = _trg->towerEnergy();
30  vector<double> towerEt = _trg->towerEt();
31 
32  _nTowers = towers.size();
33 
34  for(int i = 0; i < _nTowers; ++i) {
35  _towerId[i] = towers[i];
36  _towerDsmAdc[i] = towerDsmAdc[i];
37  _towerAdc[i] = towerAdc[i];
38  _towerEnergy[i] = towerEnergy[i];
39  _towerEt[i] = towerEt[i];
40  }
41 }