CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TB06TreeH2 Class Reference

#include <TB06TreeH2.h>

Public Member Functions

void check ()
 
void reset (float crystal[11][21])
 
void store (const int &tableIsMoving, const int &run, const int &event, const int &S6adc, const double &xhodo, const double &yhodo, const double &xslope, const double &yslope, const double &xquality, const double &yquality, const int &icMax, const int &ietaMax, const int &iphiMax, const double &beamEnergy, const double ampl[49], const int &wcAXo, const int &wcAYo, const int &wcBXo, const int &wcBYo, const int &wcCXo, const int &wcCYo, const double &xwA, const double &ywA, const double &xwB, const double &ywB, const double &xwC, const double &ywC, const float &S1adc, const float &S2adc, const float &S3adc, const float &S4adc, const float &VM1, const float &VM2, const float &VM3, const float &VM4, const float &VM5, const float &VM6, const float &VM7, const float &VM8, const float &VMF, const float &VMB, const float &CK1, const float &CK2, const float &CK3, const float &BH1, const float &BH2, const float &BH3, const float &BH4, const float &TOF1S, const float &TOF2S, const float &TOF1J, const float &TOF2J)
 to be called at each loop More...
 
 TB06TreeH2 (const std::string &fileName="TB06Tree.root", const std::string &treeName="Analysis")
 ctor More...
 
 ~TB06TreeH2 ()
 dtor More...
 

Private Attributes

TClonesArray * m_data
 
int m_dataSize
 
TFile * m_file
 
TTree * m_tree
 

Detailed Description

Definition at line 14 of file TB06TreeH2.h.

Constructor & Destructor Documentation

TB06TreeH2::TB06TreeH2 ( const std::string &  fileName = "TB06Tree.root",
const std::string &  treeName = "Analysis" 
)

ctor

Definition at line 9 of file TB06TreeH2.cc.

References dir, m_data, m_file, and m_tree.

10  :
11  m_file (0), m_tree (0), m_data (0), m_dataSize (0)
12 {
13  TDirectory *dir = gDirectory ;
14  m_file = new TFile (fileName.c_str (),"RECREATE") ;
15  m_file->cd () ;
16  m_tree = new TTree (treeName.c_str(),"Analysis tree") ;
17  m_tree->SetAutoSave (10000000) ;
18  dir->cd () ;
19 
20  // m_tree->cd () ;
21  m_data = new TClonesArray (TB06RecoH2::Class (), 1) ;
22  m_data->ExpandCreateFast (1) ;
23 
24  // m_tree->Branch ("EGCO", &m_data, 64000, 2) ;
25  m_tree->Branch ("TB06O", &m_data, 64000, 2) ;
26  m_tree->Print () ;
27 
28 }
TClonesArray * m_data
Definition: TB06TreeH2.h:59
int m_dataSize
Definition: TB06TreeH2.h:60
TTree * m_tree
Definition: TB06TreeH2.h:57
dbl *** dir
Definition: mlp_gen.cc:35
TFile * m_file
Definition: TB06TreeH2.h:56
TB06TreeH2::~TB06TreeH2 ( )

dtor

Definition at line 33 of file TB06TreeH2.cc.

References gather_cfg::cout, m_data, m_file, and m_tree.

34 {
35  std::cout << "[TB06TreeH2][dtor] saving TTree " << m_tree->GetName ()
36  << " with " << m_tree->GetEntries () << " entries"
37  << " on file: " << m_file->GetName () << std::endl ;
38 
39  m_file->Write () ;
40  delete m_tree ;
41  m_file->Close () ;
42  delete m_file ;
43  delete m_data ;
44 }
TClonesArray * m_data
Definition: TB06TreeH2.h:59
TTree * m_tree
Definition: TB06TreeH2.h:57
tuple cout
Definition: gather_cfg.py:121
TFile * m_file
Definition: TB06TreeH2.h:56

Member Function Documentation

void TB06TreeH2::check ( )

Definition at line 216 of file TB06TreeH2.cc.

References TB06RecoH2::convFactor, gather_cfg::cout, eta, TB06RecoH2::event, TB06RecoH2::localMap, m_data, TB06RecoH2::MEXTLenergy, TB06RecoH2::MEXTLeta, TB06RecoH2::MEXTLphi, phi, TB06RecoH2::run, TB06RecoH2::tableIsMoving, TB06RecoH2::xHodo, TB06RecoH2::xQualityHodo, TB06RecoH2::xSlopeHodo, TB06RecoH2::yHodo, TB06RecoH2::yQualityHodo, and TB06RecoH2::ySlopeHodo.

217 {
218  TB06RecoH2 * entry = static_cast<TB06RecoH2*> (m_data->AddrAt (0)) ;
219 
220  std::cout << "[TB06TreeH2][check]reading . . . \n" ;
221  std::cout << "[TB06TreeH2][check] entry->run: " << entry->run << "\n" ;
222  std::cout << "[TB06TreeH2][check] entry->event: " << entry->event << "\n" ;
223  std::cout << "[TB06TreeH2][check] entry->tableIsMoving: " << entry->tableIsMoving << "\n" ;
224  std::cout << "[TB06TreeH2][check] entry->MEXTLeta: " << entry->MEXTLeta << "\n" ;
225  std::cout << "[TB06TreeH2][check] entry->MEXTLphi: " << entry->MEXTLphi << "\n" ;
226  std::cout << "[TB06TreeH2][check] entry->MEXTLenergy: " << entry->MEXTLenergy << "\n" ;
227 
228  for (int eta = 0 ; eta<7 ; ++eta)
229  for (int phi = 0 ; phi<7 ; ++phi)
230  std::cout << "[TB06TreeH2][check] entry->localMap[" << eta
231  << "][" << phi << "]: "
232  << entry->localMap[eta][phi] << "\n" ;
233 
234  std::cout << "[TB06TreeH2][check] entry->xHodo: " << entry->xHodo << "\n" ;
235  std::cout << "[TB06TreeH2][check] entry->yHodo: " << entry->yHodo << "\n" ;
236  std::cout << "[TB06TreeH2][check] entry->xSlopeHodo: " << entry->xSlopeHodo << "\n" ;
237  std::cout << "[TB06TreeH2][check] entry->ySlopeHodo: " << entry->ySlopeHodo << "\n" ;
238  std::cout << "[TB06TreeH2][check] entry->xQualityHodo: " << entry->xQualityHodo << "\n" ;
239  std::cout << "[TB06TreeH2][check] entry->yQualityHodo: " << entry->yQualityHodo << "\n" ;
240  std::cout << "[TB06TreeH2][check] entry->convFactor: " << entry->convFactor << "\n" ;
241 
242  /* to be implemented with the right variables
243  std::cout << "[TB06TreeH2][check] ------------------------" << std::endl ;
244  std::cout << "[TB06TreeH2][check] " << entry->variable_name << std::endl ;
245  */
246 }
TClonesArray * m_data
Definition: TB06TreeH2.h:59
Float_t xSlopeHodo
hodoscope x slope (eta)
Definition: TB06RecoH2.h:50
Float_t yHodo
hodoscope y coord (phi)
Definition: TB06RecoH2.h:46
Float_t xHodo
hodoscope x coord (eta)
Definition: TB06RecoH2.h:44
Int_t MEXTLeta
most energetic crystal eta
Definition: TB06RecoH2.h:26
Int_t tableIsMoving
if the table is moving
Definition: TB06RecoH2.h:19
Int_t event
event number
Definition: TB06RecoH2.h:17
Float_t MEXTLenergy
most energetic crystal energy
Definition: TB06RecoH2.h:30
Float_t ySlopeHodo
hodoscope y slope (eta)
Definition: TB06RecoH2.h:52
Int_t MEXTLphi
most energetic crystal phi
Definition: TB06RecoH2.h:28
Float_t convFactor
conversion factor from ADC to GeV used
Definition: TB06RecoH2.h:111
Float_t yQualityHodo
hodoscope y quality (eta)
Definition: TB06RecoH2.h:56
Int_t run
run number
Definition: TB06RecoH2.h:15
Float_t xQualityHodo
hodoscope x quality (eta)
Definition: TB06RecoH2.h:54
tuple cout
Definition: gather_cfg.py:121
Float_t localMap[7][7]
energy in 7x7 xtals around the most energetic one
Definition: TB06RecoH2.h:35
void TB06TreeH2::reset ( float  crystal[11][21])

Definition at line 201 of file TB06TreeH2.cc.

References eta, and phi.

Referenced by MatrixReader.MatrixReader::__init__(), and MatrixReader.MatrixReader::showRaw().

202 {
203  for (int eta =0 ; eta<11 ; ++eta)
204  {
205  for (int phi =0 ; phi<21 ; ++phi)
206  {
207  crystal[eta][phi] = -999. ;
208  }
209  }
210 }
void TB06TreeH2::store ( const int &  tableIsMoving,
const int &  run,
const int &  event,
const int &  S6adc,
const double &  xhodo,
const double &  yhodo,
const double &  xslope,
const double &  yslope,
const double &  xquality,
const double &  yquality,
const int &  icMax,
const int &  ietaMax,
const int &  iphiMax,
const double &  beamEnergy,
const double  ampl[49],
const int &  wcAXo,
const int &  wcAYo,
const int &  wcBXo,
const int &  wcBYo,
const int &  wcCXo,
const int &  wcCYo,
const double &  xwA,
const double &  ywA,
const double &  xwB,
const double &  ywB,
const double &  xwC,
const double &  ywC,
const float &  S1adc,
const float &  S2adc,
const float &  S3adc,
const float &  S4adc,
const float &  VM1,
const float &  VM2,
const float &  VM3,
const float &  VM4,
const float &  VM5,
const float &  VM6,
const float &  VM7,
const float &  VM8,
const float &  VMF,
const float &  VMB,
const float &  CK1,
const float &  CK2,
const float &  CK3,
const float &  BH1,
const float &  BH2,
const float &  BH3,
const float &  BH4,
const float &  TOF1S,
const float &  TOF2S,
const float &  TOF1J,
const float &  TOF2J 
)

to be called at each loop

Definition at line 50 of file TB06TreeH2.cc.

References TB06RecoH2::beamEnergy, TB06RecoH2::BH1_, TB06RecoH2::BH2_, TB06RecoH2::BH3_, TB06RecoH2::BH4_, TB06RecoH2::CK1_, TB06RecoH2::CK2_, TB06RecoH2::CK3_, TB06RecoH2::convFactor, eta, TB06RecoH2::event, event(), TB06RecoH2::localMap, m_data, m_tree, TB06RecoH2::MEXTLenergy, TB06RecoH2::MEXTLeta, TB06RecoH2::MEXTLindex, TB06RecoH2::MEXTLphi, phi, TB06RecoH2::reset(), TB06RecoH2::run, DTTTrigCorrFirst::run, TB06RecoH2::S1adc_, TB06RecoH2::S1uncalib_, TB06RecoH2::S25uncalib_, TB06RecoH2::S2adc_, TB06RecoH2::S3adc_, TB06RecoH2::S49uncalib_, TB06RecoH2::S4adc_, TB06RecoH2::S6ADC, TB06RecoH2::S9uncalib_, TB06RecoH2::tableIsMoving, TB06RecoH2::TOF1J_, TB06RecoH2::TOF1S_, TB06RecoH2::TOF2J_, TB06RecoH2::TOF2S_, TB06RecoH2::VM1_, TB06RecoH2::VM2_, TB06RecoH2::VM3_, TB06RecoH2::VM4_, TB06RecoH2::VM5_, TB06RecoH2::VM6_, TB06RecoH2::VM7_, TB06RecoH2::VM8_, TB06RecoH2::VMB_, TB06RecoH2::VMF_, TB06RecoH2::wcAXo_, TB06RecoH2::wcAYo_, TB06RecoH2::wcBXo_, TB06RecoH2::wcBYo_, TB06RecoH2::wcCXo_, TB06RecoH2::wcCYo_, TB06RecoH2::xHodo, TB06RecoH2::xQualityHodo, TB06RecoH2::xSlopeHodo, TB06RecoH2::xwA_, TB06RecoH2::xwB_, TB06RecoH2::xwC_, TB06RecoH2::yHodo, TB06RecoH2::yQualityHodo, TB06RecoH2::ySlopeHodo, TB06RecoH2::ywA_, TB06RecoH2::ywB_, and TB06RecoH2::ywC_.

78 {
79 
80  m_data->Clear () ;
81  TB06RecoH2 * entry = static_cast<TB06RecoH2*> (m_data->AddrAt (0)) ;
82 
83  entry->reset () ;
84  // reset (entry->myCalibrationMap) ;
85 
86  entry->tableIsMoving = tableIsMoving ;
87  entry->run = run ;
88  entry->event = event ;
89  entry->S6ADC = S6adc ;
90 
91  entry->MEXTLindex = icMax ;
92  entry->MEXTLeta = ietaMax ;
93  entry->MEXTLphi = iphiMax ;
94  entry->MEXTLenergy = ampl[24] ;
95  entry->beamEnergy = beamEnergy ;
96 
97  for (int eta = 0 ; eta<7 ; ++eta)
98  for (int phi = 0 ; phi<7 ; ++phi)
99  {
100  // FIXME capire l'orientamento di phi!
101  // FIXME capire se eta, phi iniziano da 1 o da 0
102  entry->localMap[eta][phi] = ampl[eta*7+phi] ;
103  }
104 
105  //[Edgar] S1 uncleaned, uncalibrated energy
106  entry->S1uncalib_ = ampl[24];
107 
108  //[Edgar] S25 uncleaned, uncalibrated energy
109  for (int eta = 1 ; eta<6 ; ++eta)
110  for (int phi = 1 ; phi<6 ; ++phi)
111  {
112  entry->S25uncalib_ += entry->localMap[eta][phi] ;
113  }
114 
115  //[Edgar] S49 uncleaned, uncalibrated energy
116  for (int eta = 0 ; eta<7 ; ++eta)
117  for (int phi = 0 ; phi<7 ; ++phi)
118  {
119  entry->S49uncalib_ += entry->localMap[eta][phi] ;
120  }
121 
122  //[Edgar] S9 uncleaned, uncalibrated energy
123  for (int eta = 2 ; eta<5 ; ++eta)
124  for (int phi = 2 ; phi<5 ; ++phi)
125  {
126  entry->S9uncalib_ += entry->localMap[eta][phi] ;
127  }
128 
129  entry->xHodo = xhodo ;
130  entry->yHodo = yhodo ;
131  entry->xSlopeHodo = xslope ;
132  entry->ySlopeHodo = yslope ;
133  entry->xQualityHodo = xquality ;
134  entry->yQualityHodo = yquality ;
135  entry->wcAXo_ = wcAXo;
136  entry->wcAYo_ = wcAYo;
137  entry->wcBXo_ = wcBXo;
138  entry->wcBYo_ = wcBYo;
139  entry->wcCXo_ = wcCXo;
140  entry->wcCYo_ = wcCYo;
141  entry->xwA_ = xwA;
142  entry->ywA_ = ywA;
143  entry->xwB_ = xwB;
144  entry->ywB_ = ywB;
145  entry->xwC_ = xwC;
146  entry->ywC_ = ywC;
147  entry->S1adc_ = S1adc;
148  entry->S2adc_ = S2adc;
149  entry->S3adc_ = S3adc;
150  entry->S4adc_ = S4adc;
151  entry->VM1_ = VM1;
152  entry->VM2_ = VM2;
153  entry->VM3_ = VM3;
154  entry->VM4_ = VM4;
155  entry->VM5_ = VM5;
156  entry->VM6_ = VM6;
157  entry->VM7_ = VM7;
158  entry->VM8_ = VM8;
159  entry->VMF_ = VMF;
160  entry->VMB_ = VMB;
161  entry->CK1_ = CK1;
162  entry->CK2_ = CK2;
163  entry->CK3_ = CK3;
164  entry->BH1_ = BH1;
165  entry->BH2_ = BH2;
166  entry->BH3_ = BH3;
167  entry->BH4_ = BH4;
168  entry->TOF1S_ = TOF1S;
169  entry->TOF2S_ = TOF2S;
170  entry->TOF1J_ = TOF1J;
171  entry->TOF2J_ = TOF2J;
172 
173  entry->convFactor = 0. ;
174 
175  /*
176  // loop over the 5x5 see (1)
177  for (int xtal=0 ; xtal<25 ; ++xtal)
178  {
179  int ieta = xtal/5 + 3 ;
180  int iphi = xtal%5 + 8 ;
181  entry->myCalibrationMap[ieta][iphi] = ampl[xtal] ;
182  } // loop over the 5x5
183 
184  entry->electron_Tr_Pmag_ = beamEnergy ;
185 
186  entry->centralCrystalEta_ = ietaMax ;
187  entry->centralCrystalPhi_ = iphiMax ;
188  entry->centralCrystalEnergy_ = ampl[12] ;
189 
190  // this is a trick
191  entry->electron_Tr_Peta_ = xhodo ;
192  entry->electron_Tr_Pphi_ = yhodo ;
193  */
194  m_tree->Fill () ;
195 }
Float_t TOF1S_
Definition: TB06RecoH2.h:105
float ywA_
Definition: TB06RecoH2.h:72
TClonesArray * m_data
Definition: TB06TreeH2.h:59
Float_t CK1_
Definition: TB06RecoH2.h:96
Float_t S1adc_
Definition: TB06RecoH2.h:77
int wcBXo_
Definition: TB06RecoH2.h:67
float ywB_
Definition: TB06RecoH2.h:74
Float_t TOF2S_
Definition: TB06RecoH2.h:106
Float_t BH2_
Definition: TB06RecoH2.h:101
float ywC_
Definition: TB06RecoH2.h:76
Float_t S9uncalib_
Definition: TB06RecoH2.h:63
int wcCYo_
Definition: TB06RecoH2.h:70
Float_t TOF1J_
Definition: TB06RecoH2.h:107
int wcCXo_
Definition: TB06RecoH2.h:69
Float_t xSlopeHodo
hodoscope x slope (eta)
Definition: TB06RecoH2.h:50
Int_t S6ADC
ADC output of the S6 integrated signal.
Definition: TB06RecoH2.h:21
Float_t yHodo
hodoscope y coord (phi)
Definition: TB06RecoH2.h:46
Float_t xHodo
hodoscope x coord (eta)
Definition: TB06RecoH2.h:44
void reset()
set all the values to 0
Definition: TB06RecoH2.cc:8
Int_t MEXTLeta
most energetic crystal eta
Definition: TB06RecoH2.h:26
Float_t S3adc_
Definition: TB06RecoH2.h:79
Int_t tableIsMoving
if the table is moving
Definition: TB06RecoH2.h:19
Float_t VM8_
Definition: TB06RecoH2.h:91
Float_t S4adc_
Definition: TB06RecoH2.h:80
Int_t event
event number
Definition: TB06RecoH2.h:17
float xwC_
Definition: TB06RecoH2.h:75
Float_t VM3_
Definition: TB06RecoH2.h:86
Float_t MEXTLenergy
most energetic crystal energy
Definition: TB06RecoH2.h:30
float xwB_
Definition: TB06RecoH2.h:73
Float_t ySlopeHodo
hodoscope y slope (eta)
Definition: TB06RecoH2.h:52
int wcAXo_
Definition: TB06RecoH2.h:65
Float_t VM5_
Definition: TB06RecoH2.h:88
float xwA_
Definition: TB06RecoH2.h:71
Float_t S49uncalib_
Definition: TB06RecoH2.h:62
Float_t CK2_
Definition: TB06RecoH2.h:97
Float_t S2adc_
Definition: TB06RecoH2.h:78
Float_t S1uncalib_
Definition: TB06RecoH2.h:60
Float_t S25uncalib_
Definition: TB06RecoH2.h:61
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Float_t VM7_
Definition: TB06RecoH2.h:90
Float_t VMF_
Definition: TB06RecoH2.h:92
Int_t MEXTLphi
most energetic crystal phi
Definition: TB06RecoH2.h:28
Float_t VM4_
Definition: TB06RecoH2.h:87
Float_t VMB_
Definition: TB06RecoH2.h:93
Float_t convFactor
conversion factor from ADC to GeV used
Definition: TB06RecoH2.h:111
Float_t BH1_
Definition: TB06RecoH2.h:100
Float_t BH3_
Definition: TB06RecoH2.h:102
TTree * m_tree
Definition: TB06TreeH2.h:57
Float_t VM2_
Definition: TB06RecoH2.h:85
Float_t yQualityHodo
hodoscope y quality (eta)
Definition: TB06RecoH2.h:56
Int_t run
run number
Definition: TB06RecoH2.h:15
Float_t xQualityHodo
hodoscope x quality (eta)
Definition: TB06RecoH2.h:54
int wcAYo_
Definition: TB06RecoH2.h:66
Float_t CK3_
Definition: TB06RecoH2.h:98
Float_t VM6_
Definition: TB06RecoH2.h:89
Float_t BH4_
Definition: TB06RecoH2.h:103
Float_t VM1_
Definition: TB06RecoH2.h:84
Int_t MEXTLindex
most energetic crystal index
Definition: TB06RecoH2.h:24
Float_t localMap[7][7]
energy in 7x7 xtals around the most energetic one
Definition: TB06RecoH2.h:35
int wcBYo_
Definition: TB06RecoH2.h:68
Float_t TOF2J_
Definition: TB06RecoH2.h:108
Float_t beamEnergy
energy of the beam
Definition: TB06RecoH2.h:32

Member Data Documentation

TClonesArray* TB06TreeH2::m_data
private

Definition at line 59 of file TB06TreeH2.h.

Referenced by check(), store(), TB06TreeH2(), and ~TB06TreeH2().

int TB06TreeH2::m_dataSize
private

Definition at line 60 of file TB06TreeH2.h.

TFile* TB06TreeH2::m_file
private

Definition at line 56 of file TB06TreeH2.h.

Referenced by TB06TreeH2(), and ~TB06TreeH2().

TTree* TB06TreeH2::m_tree
private

Definition at line 57 of file TB06TreeH2.h.

Referenced by store(), TB06TreeH2(), and ~TB06TreeH2().