CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 13 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 DeadROC_duringRun::dir, m_data, m_file, and m_tree.

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

dtor

Definition at line 29 of file TB06TreeH2.cc.

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

29  {
30  std::cout << "[TB06TreeH2][dtor] saving TTree " << m_tree->GetName() << " with " << m_tree->GetEntries() << " entries"
31  << " on file: " << m_file->GetName() << std::endl;
32 
33  m_file->Write();
34  delete m_tree;
35  m_file->Close();
36  delete m_file;
37  delete m_data;
38 }
TClonesArray * m_data
Definition: TB06TreeH2.h:81
TTree * m_tree
Definition: TB06TreeH2.h:79
tuple cout
Definition: gather_cfg.py:144
TFile * m_file
Definition: TB06TreeH2.h:78

Member Function Documentation

void TB06TreeH2::check ( )

Definition at line 220 of file TB06TreeH2.cc.

References TB06RecoH2::convFactor, gather_cfg::cout, mps_splice::entry, PVValHelper::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.

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

Definition at line 210 of file TB06TreeH2.cc.

References PVValHelper::eta, and phi.

Referenced by MatrixReader.MatrixReader::__init__(), data_sources.json_list::__next__(), and MatrixReader.MatrixReader::showRaw().

210  {
211  for (int eta = 0; eta < 11; ++eta) {
212  for (int phi = 0; phi < 21; ++phi) {
213  crystal[eta][phi] = -999.;
214  }
215  }
216 }
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 43 of file TB06TreeH2.cc.

References TB06RecoH2::beamEnergy, TB06RecoH2::BH1_, TB06RecoH2::BH2_, TB06RecoH2::BH3_, TB06RecoH2::BH4_, TB06RecoH2::CK1_, TB06RecoH2::CK2_, TB06RecoH2::CK3_, TB06RecoH2::convFactor, mps_splice::entry, PVValHelper::eta, TB06RecoH2::event, edmPickEvents::event, TB06RecoH2::localMap, m_data, m_tree, TB06RecoH2::MEXTLenergy, TB06RecoH2::MEXTLeta, TB06RecoH2::MEXTLindex, TB06RecoH2::MEXTLphi, phi, TB06RecoH2::reset(), TB06RecoH2::run, submitPVValidationJobs::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_.

94  {
95  m_data->Clear();
96  TB06RecoH2 *entry = static_cast<TB06RecoH2 *>(m_data->AddrAt(0));
97 
98  entry->reset();
99  // reset (entry->myCalibrationMap) ;
100 
101  entry->tableIsMoving = tableIsMoving;
102  entry->run = run;
103  entry->event = event;
104  entry->S6ADC = S6adc;
105 
106  entry->MEXTLindex = icMax;
107  entry->MEXTLeta = ietaMax;
108  entry->MEXTLphi = iphiMax;
109  entry->MEXTLenergy = ampl[24];
110  entry->beamEnergy = beamEnergy;
111 
112  for (int eta = 0; eta < 7; ++eta)
113  for (int phi = 0; phi < 7; ++phi) {
114  // FIXME capire l'orientamento di phi!
115  // FIXME capire se eta, phi iniziano da 1 o da 0
116  entry->localMap[eta][phi] = ampl[eta * 7 + phi];
117  }
118 
119  //[Edgar] S1 uncleaned, uncalibrated energy
120  entry->S1uncalib_ = ampl[24];
121 
122  //[Edgar] S25 uncleaned, uncalibrated energy
123  for (int eta = 1; eta < 6; ++eta)
124  for (int phi = 1; phi < 6; ++phi) {
125  entry->S25uncalib_ += entry->localMap[eta][phi];
126  }
127 
128  //[Edgar] S49 uncleaned, uncalibrated energy
129  for (int eta = 0; eta < 7; ++eta)
130  for (int phi = 0; phi < 7; ++phi) {
131  entry->S49uncalib_ += entry->localMap[eta][phi];
132  }
133 
134  //[Edgar] S9 uncleaned, uncalibrated energy
135  for (int eta = 2; eta < 5; ++eta)
136  for (int phi = 2; phi < 5; ++phi) {
137  entry->S9uncalib_ += entry->localMap[eta][phi];
138  }
139 
140  entry->xHodo = xhodo;
141  entry->yHodo = yhodo;
142  entry->xSlopeHodo = xslope;
143  entry->ySlopeHodo = yslope;
144  entry->xQualityHodo = xquality;
145  entry->yQualityHodo = yquality;
146  entry->wcAXo_ = wcAXo;
147  entry->wcAYo_ = wcAYo;
148  entry->wcBXo_ = wcBXo;
149  entry->wcBYo_ = wcBYo;
150  entry->wcCXo_ = wcCXo;
151  entry->wcCYo_ = wcCYo;
152  entry->xwA_ = xwA;
153  entry->ywA_ = ywA;
154  entry->xwB_ = xwB;
155  entry->ywB_ = ywB;
156  entry->xwC_ = xwC;
157  entry->ywC_ = ywC;
158  entry->S1adc_ = S1adc;
159  entry->S2adc_ = S2adc;
160  entry->S3adc_ = S3adc;
161  entry->S4adc_ = S4adc;
162  entry->VM1_ = VM1;
163  entry->VM2_ = VM2;
164  entry->VM3_ = VM3;
165  entry->VM4_ = VM4;
166  entry->VM5_ = VM5;
167  entry->VM6_ = VM6;
168  entry->VM7_ = VM7;
169  entry->VM8_ = VM8;
170  entry->VMF_ = VMF;
171  entry->VMB_ = VMB;
172  entry->CK1_ = CK1;
173  entry->CK2_ = CK2;
174  entry->CK3_ = CK3;
175  entry->BH1_ = BH1;
176  entry->BH2_ = BH2;
177  entry->BH3_ = BH3;
178  entry->BH4_ = BH4;
179  entry->TOF1S_ = TOF1S;
180  entry->TOF2S_ = TOF2S;
181  entry->TOF1J_ = TOF1J;
182  entry->TOF2J_ = TOF2J;
183 
184  entry->convFactor = 0.;
185 
186  /*
187  // loop over the 5x5 see (1)
188  for (int xtal=0 ; xtal<25 ; ++xtal)
189  {
190  int ieta = xtal/5 + 3 ;
191  int iphi = xtal%5 + 8 ;
192  entry->myCalibrationMap[ieta][iphi] = ampl[xtal] ;
193  } // loop over the 5x5
194 
195  entry->electron_Tr_Pmag_ = beamEnergy ;
196 
197  entry->centralCrystalEta_ = ietaMax ;
198  entry->centralCrystalPhi_ = iphiMax ;
199  entry->centralCrystalEnergy_ = ampl[12] ;
200 
201  // this is a trick
202  entry->electron_Tr_Peta_ = xhodo ;
203  entry->electron_Tr_Pphi_ = yhodo ;
204  */
205  m_tree->Fill();
206 }
Float_t TOF1S_
Definition: TB06RecoH2.h:103
float ywA_
Definition: TB06RecoH2.h:70
TClonesArray * m_data
Definition: TB06TreeH2.h:81
Float_t CK1_
Definition: TB06RecoH2.h:94
Float_t S1adc_
Definition: TB06RecoH2.h:75
int wcBXo_
Definition: TB06RecoH2.h:65
float ywB_
Definition: TB06RecoH2.h:72
Float_t TOF2S_
Definition: TB06RecoH2.h:104
Float_t BH2_
Definition: TB06RecoH2.h:99
float ywC_
Definition: TB06RecoH2.h:74
Float_t S9uncalib_
Definition: TB06RecoH2.h:61
int wcCYo_
Definition: TB06RecoH2.h:68
Float_t TOF1J_
Definition: TB06RecoH2.h:105
int wcCXo_
Definition: TB06RecoH2.h:67
Float_t xSlopeHodo
hodoscope x slope (eta)
Definition: TB06RecoH2.h:48
Int_t S6ADC
ADC output of the S6 integrated signal.
Definition: TB06RecoH2.h:19
Float_t yHodo
hodoscope y coord (phi)
Definition: TB06RecoH2.h:44
Float_t xHodo
hodoscope x coord (eta)
Definition: TB06RecoH2.h:42
void reset()
set all the values to 0
Definition: TB06RecoH2.cc:8
Int_t MEXTLeta
most energetic crystal eta
Definition: TB06RecoH2.h:24
Float_t S3adc_
Definition: TB06RecoH2.h:77
Int_t tableIsMoving
if the table is moving
Definition: TB06RecoH2.h:17
Float_t VM8_
Definition: TB06RecoH2.h:89
Float_t S4adc_
Definition: TB06RecoH2.h:78
Int_t event
event number
Definition: TB06RecoH2.h:15
float xwC_
Definition: TB06RecoH2.h:73
Float_t VM3_
Definition: TB06RecoH2.h:84
Float_t MEXTLenergy
most energetic crystal energy
Definition: TB06RecoH2.h:28
float xwB_
Definition: TB06RecoH2.h:71
Float_t ySlopeHodo
hodoscope y slope (eta)
Definition: TB06RecoH2.h:50
int wcAXo_
Definition: TB06RecoH2.h:63
Float_t VM5_
Definition: TB06RecoH2.h:86
float xwA_
Definition: TB06RecoH2.h:69
Float_t S49uncalib_
Definition: TB06RecoH2.h:60
Float_t CK2_
Definition: TB06RecoH2.h:95
Float_t S2adc_
Definition: TB06RecoH2.h:76
Float_t S1uncalib_
Definition: TB06RecoH2.h:58
Float_t S25uncalib_
Definition: TB06RecoH2.h:59
Float_t VM7_
Definition: TB06RecoH2.h:88
Float_t VMF_
Definition: TB06RecoH2.h:90
Int_t MEXTLphi
most energetic crystal phi
Definition: TB06RecoH2.h:26
Float_t VM4_
Definition: TB06RecoH2.h:85
Float_t VMB_
Definition: TB06RecoH2.h:91
Float_t convFactor
conversion factor from ADC to GeV used
Definition: TB06RecoH2.h:109
Float_t BH1_
Definition: TB06RecoH2.h:98
Float_t BH3_
Definition: TB06RecoH2.h:100
TTree * m_tree
Definition: TB06TreeH2.h:79
Float_t VM2_
Definition: TB06RecoH2.h:83
Float_t yQualityHodo
hodoscope y quality (eta)
Definition: TB06RecoH2.h:54
Int_t run
run number
Definition: TB06RecoH2.h:13
Float_t xQualityHodo
hodoscope x quality (eta)
Definition: TB06RecoH2.h:52
int wcAYo_
Definition: TB06RecoH2.h:64
list entry
Definition: mps_splice.py:68
Float_t CK3_
Definition: TB06RecoH2.h:96
Float_t VM6_
Definition: TB06RecoH2.h:87
Float_t BH4_
Definition: TB06RecoH2.h:101
Float_t VM1_
Definition: TB06RecoH2.h:82
Int_t MEXTLindex
most energetic crystal index
Definition: TB06RecoH2.h:22
Float_t localMap[7][7]
energy in 7x7 xtals around the most energetic one
Definition: TB06RecoH2.h:33
int wcBYo_
Definition: TB06RecoH2.h:66
Float_t TOF2J_
Definition: TB06RecoH2.h:106
Float_t beamEnergy
energy of the beam
Definition: TB06RecoH2.h:30

Member Data Documentation

TClonesArray* TB06TreeH2::m_data
private

Definition at line 81 of file TB06TreeH2.h.

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

int TB06TreeH2::m_dataSize
private

Definition at line 82 of file TB06TreeH2.h.

TFile* TB06TreeH2::m_file
private

Definition at line 78 of file TB06TreeH2.h.

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

TTree* TB06TreeH2::m_tree
private

Definition at line 79 of file TB06TreeH2.h.

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