CMS 3D CMS Logo

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::TB06TreeH2 ( const std::string &  fileName = "TB06Tree.root",
const std::string &  treeName = "Analysis" 
)

ctor

Definition at line 8 of file TB06TreeH2.cc.

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

References HLT_FULL_cff::Class, DeadROC_duringRun::dir, MillePedeFileConverter_cfg::fileName, m_data, m_file, and m_tree.

◆ ~TB06TreeH2()

TB06TreeH2::~TB06TreeH2 ( )

dtor

Definition at line 28 of file TB06TreeH2.cc.

28  {
29  std::cout << "[TB06TreeH2][dtor] saving TTree " << m_tree->GetName() << " with " << m_tree->GetEntries() << " entries"
30  << " on file: " << m_file->GetName() << std::endl;
31 
32  m_file->Write();
33  delete m_tree;
34  m_file->Close();
35  delete m_file;
36  delete m_data;
37 }

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

Member Function Documentation

◆ check()

void TB06TreeH2::check ( )

Definition at line 219 of file TB06TreeH2.cc.

219  {
220  TB06RecoH2 *entry = static_cast<TB06RecoH2 *>(m_data->AddrAt(0));
221 
222  std::cout << "[TB06TreeH2][check]reading . . . \n";
223  std::cout << "[TB06TreeH2][check] entry->run: " << entry->run << "\n";
224  std::cout << "[TB06TreeH2][check] entry->event: " << entry->event << "\n";
225  std::cout << "[TB06TreeH2][check] entry->tableIsMoving: " << entry->tableIsMoving << "\n";
226  std::cout << "[TB06TreeH2][check] entry->MEXTLeta: " << entry->MEXTLeta << "\n";
227  std::cout << "[TB06TreeH2][check] entry->MEXTLphi: " << entry->MEXTLphi << "\n";
228  std::cout << "[TB06TreeH2][check] entry->MEXTLenergy: " << entry->MEXTLenergy << "\n";
229 
230  for (int eta = 0; eta < 7; ++eta)
231  for (int phi = 0; phi < 7; ++phi)
232  std::cout << "[TB06TreeH2][check] entry->localMap[" << eta << "][" << phi << "]: " << entry->localMap[eta][phi]
233  << "\n";
234 
235  std::cout << "[TB06TreeH2][check] entry->xHodo: " << entry->xHodo << "\n";
236  std::cout << "[TB06TreeH2][check] entry->yHodo: " << entry->yHodo << "\n";
237  std::cout << "[TB06TreeH2][check] entry->xSlopeHodo: " << entry->xSlopeHodo << "\n";
238  std::cout << "[TB06TreeH2][check] entry->ySlopeHodo: " << entry->ySlopeHodo << "\n";
239  std::cout << "[TB06TreeH2][check] entry->xQualityHodo: " << entry->xQualityHodo << "\n";
240  std::cout << "[TB06TreeH2][check] entry->yQualityHodo: " << entry->yQualityHodo << "\n";
241  std::cout << "[TB06TreeH2][check] entry->convFactor: " << entry->convFactor << "\n";
242 
243  /* to be implemented with the right variables
244  std::cout << "[TB06TreeH2][check] ------------------------" << std::endl ;
245  std::cout << "[TB06TreeH2][check] " << entry->variable_name << std::endl ;
246  */
247 }

References gather_cfg::cout, mps_splice::entry, PVValHelper::eta, m_data, and phi.

◆ reset()

void TB06TreeH2::reset ( float  crystal[11][21])

Definition at line 209 of file TB06TreeH2.cc.

209  {
210  for (int eta = 0; eta < 11; ++eta) {
211  for (int phi = 0; phi < 21; ++phi) {
212  crystal[eta][phi] = -999.;
213  }
214  }
215 }

References PVValHelper::eta, and phi.

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

◆ store()

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 42 of file TB06TreeH2.cc.

93  {
94  m_data->Clear();
95  TB06RecoH2 *entry = static_cast<TB06RecoH2 *>(m_data->AddrAt(0));
96 
97  entry->reset();
98  // reset (entry->myCalibrationMap) ;
99 
100  entry->tableIsMoving = tableIsMoving;
101  entry->run = run;
102  entry->event = event;
103  entry->S6ADC = S6adc;
104 
105  entry->MEXTLindex = icMax;
106  entry->MEXTLeta = ietaMax;
107  entry->MEXTLphi = iphiMax;
108  entry->MEXTLenergy = ampl[24];
109  entry->beamEnergy = beamEnergy;
110 
111  for (int eta = 0; eta < 7; ++eta)
112  for (int phi = 0; phi < 7; ++phi) {
113  // FIXME capire l'orientamento di phi!
114  // FIXME capire se eta, phi iniziano da 1 o da 0
115  entry->localMap[eta][phi] = ampl[eta * 7 + phi];
116  }
117 
118  //[Edgar] S1 uncleaned, uncalibrated energy
119  entry->S1uncalib_ = ampl[24];
120 
121  //[Edgar] S25 uncleaned, uncalibrated energy
122  for (int eta = 1; eta < 6; ++eta)
123  for (int phi = 1; phi < 6; ++phi) {
124  entry->S25uncalib_ += entry->localMap[eta][phi];
125  }
126 
127  //[Edgar] S49 uncleaned, uncalibrated energy
128  for (int eta = 0; eta < 7; ++eta)
129  for (int phi = 0; phi < 7; ++phi) {
130  entry->S49uncalib_ += entry->localMap[eta][phi];
131  }
132 
133  //[Edgar] S9 uncleaned, uncalibrated energy
134  for (int eta = 2; eta < 5; ++eta)
135  for (int phi = 2; phi < 5; ++phi) {
136  entry->S9uncalib_ += entry->localMap[eta][phi];
137  }
138 
139  entry->xHodo = xhodo;
140  entry->yHodo = yhodo;
141  entry->xSlopeHodo = xslope;
142  entry->ySlopeHodo = yslope;
143  entry->xQualityHodo = xquality;
144  entry->yQualityHodo = yquality;
145  entry->wcAXo_ = wcAXo;
146  entry->wcAYo_ = wcAYo;
147  entry->wcBXo_ = wcBXo;
148  entry->wcBYo_ = wcBYo;
149  entry->wcCXo_ = wcCXo;
150  entry->wcCYo_ = wcCYo;
151  entry->xwA_ = xwA;
152  entry->ywA_ = ywA;
153  entry->xwB_ = xwB;
154  entry->ywB_ = ywB;
155  entry->xwC_ = xwC;
156  entry->ywC_ = ywC;
157  entry->S1adc_ = S1adc;
158  entry->S2adc_ = S2adc;
159  entry->S3adc_ = S3adc;
160  entry->S4adc_ = S4adc;
161  entry->VM1_ = VM1;
162  entry->VM2_ = VM2;
163  entry->VM3_ = VM3;
164  entry->VM4_ = VM4;
165  entry->VM5_ = VM5;
166  entry->VM6_ = VM6;
167  entry->VM7_ = VM7;
168  entry->VM8_ = VM8;
169  entry->VMF_ = VMF;
170  entry->VMB_ = VMB;
171  entry->CK1_ = CK1;
172  entry->CK2_ = CK2;
173  entry->CK3_ = CK3;
174  entry->BH1_ = BH1;
175  entry->BH2_ = BH2;
176  entry->BH3_ = BH3;
177  entry->BH4_ = BH4;
178  entry->TOF1S_ = TOF1S;
179  entry->TOF2S_ = TOF2S;
180  entry->TOF1J_ = TOF1J;
181  entry->TOF2J_ = TOF2J;
182 
183  entry->convFactor = 0.;
184 
185  /*
186  // loop over the 5x5 see (1)
187  for (int xtal=0 ; xtal<25 ; ++xtal)
188  {
189  int ieta = xtal/5 + 3 ;
190  int iphi = xtal%5 + 8 ;
191  entry->myCalibrationMap[ieta][iphi] = ampl[xtal] ;
192  } // loop over the 5x5
193 
194  entry->electron_Tr_Pmag_ = beamEnergy ;
195 
196  entry->centralCrystalEta_ = ietaMax ;
197  entry->centralCrystalPhi_ = iphiMax ;
198  entry->centralCrystalEnergy_ = ampl[12] ;
199 
200  // this is a trick
201  entry->electron_Tr_Peta_ = xhodo ;
202  entry->electron_Tr_Pphi_ = yhodo ;
203  */
204  m_tree->Fill();
205 }

References TB06Analysis_cfi::beamEnergy, mps_splice::entry, PVValHelper::eta, edmPickEvents::event, m_data, m_tree, phi, and writedatasetfile::run.

Member Data Documentation

◆ m_data

TClonesArray* TB06TreeH2::m_data
private

Definition at line 82 of file TB06TreeH2.h.

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

◆ m_dataSize

int TB06TreeH2::m_dataSize
private

Definition at line 83 of file TB06TreeH2.h.

◆ m_file

TFile* TB06TreeH2::m_file
private

Definition at line 79 of file TB06TreeH2.h.

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

◆ m_tree

TTree* TB06TreeH2::m_tree
private

Definition at line 80 of file TB06TreeH2.h.

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

TB06TreeH2::m_data
TClonesArray * m_data
Definition: TB06TreeH2.h:82
HLT_FULL_cff.Class
Class
Definition: HLT_FULL_cff.py:8427
mps_splice.entry
entry
Definition: mps_splice.py:68
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
TB06Analysis_cfi.beamEnergy
beamEnergy
Definition: TB06Analysis_cfi.py:13
PVValHelper::eta
Definition: PVValidationHelpers.h:69
edmPickEvents.event
event
Definition: edmPickEvents.py:273
DDAxes::phi
TB06RecoH2
Definition: TB06RecoH2.h:10
writedatasetfile.run
run
Definition: writedatasetfile.py:27
TB06TreeH2::m_dataSize
int m_dataSize
Definition: TB06TreeH2.h:83
TB06TreeH2::m_file
TFile * m_file
Definition: TB06TreeH2.h:79
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
TB06TreeH2::m_tree
TTree * m_tree
Definition: TB06TreeH2.h:80