ATLAS Offline Software
LArTimePhysPrediction.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #include "GaudiKernel/ToolHandle.h"
15 #include "CaloDetDescr/CaloDetDescrElement.h"
20 #include "GaudiKernel/ITHistSvc.h"
21 #include "GaudiKernel/INTupleSvc.h"
22 #include "GaudiKernel/NTuple.h"
23 #include "GaudiKernel/IToolSvc.h"
24 #include <TMath.h>
25 
27 using CaliWaveIt = LArCaliWaveContainer::LArCaliWaves::const_iterator;
28 
29 LArTimePhysPrediction::LArTimePhysPrediction (const std::string& name, ISvcLocator* pSvcLocator) :
30  AthAlgorithm(name, pSvcLocator),
31  m_thistSvc(nullptr),
32  m_CaloDepthTool(nullptr),
33  m_nt(nullptr)
34 {
35  declareProperty("KeyInput", m_keyinput="LArCaliWave");
36  declareProperty("KeyOutput", m_keyoutput="LArPhysCaliTdiff");
37  declareProperty("vLCalib_EMB",m_vLCalib_EMB);
38  declareProperty("vEtaMin_EMB",m_vEtaMin_EMB);
39  declareProperty("vEtaMax_EMB",m_vEtaMax_EMB);
40  declareProperty("vLCalib_EMEC",m_vLCalib_EMEC = 0);
41  declareProperty("vLCalib_HEC",m_vLCalib_HEC = 0);
42  declareProperty("vLSignal_EMB",m_vLSignal_EMB);
43  declareProperty("vLSignal_EMEC",m_vLSignal_EMEC = 0);
44  declareProperty("vLSignal_HEC",m_vLSignal_HEC = 0);
45  declareProperty("vLSignal_FCAL",m_vLSignal_FCAL);
46  declareProperty("vDeltaTTC_EMB",m_vDeltaTTC_EMB);
47  declareProperty("vDeltaTTC_EC",m_vDeltaTTC_EC);
48  declareProperty("vDeltaTTC_ECC_SPEC",m_vDeltaTTC_ECC_SPEC);
49  declareProperty("vDeltaTTC_ECA_SPEC",m_vDeltaTTC_ECA_SPEC);
50  declareProperty("sCalib",m_sCalib=5.5);
51  declareProperty("sSignal",m_sSignal=5.5);
52  declareProperty("sPig",m_sPig=5.5);
53  declareProperty("sLTP",m_sLTP=5.5);
54  declareProperty("nchannels_max",m_nchannels_max=1000000);
55  declareProperty("GroupingType",m_groupingType="SubDetector");
56 }
57 
59 = default;
60 
62 {
63  ATH_MSG_INFO ( "LArTimePhysPrediction in initialize()" );
64  ATH_CHECK( service("THistSvc", m_thistSvc) );
65 
69 
70  //Initialize ntuples
71  NTupleFilePtr file1(ntupleSvc(),"/NTUPLES/FILE1");
72  if (!file1){
73  ATH_MSG_ERROR ( "Could not get NTupleFilePtr: failed" );
74  return StatusCode::FAILURE;
75  }
76  NTuplePtr nt(ntupleSvc(),"/NTUPLES/FILE1/MyNtuple");
77  if (!nt) {
78  nt=ntupleSvc()->book("/NTUPLES/FILE1/MyNtuple",CLID_ColumnWiseTuple,"Timing ntuple");
79  }
80  if (!nt){
81  ATH_MSG_ERROR ( "Booking of NTuple failed" );
82  return StatusCode::FAILURE;
83  }
84 
85  m_nt=nt;
86 
87  //Book leaves
88  ATH_CHECK( nt->addItem("Chid",m_Chid) );
89  ATH_CHECK( nt->addItem("Channel",m_Channel) );
90  ATH_CHECK( nt->addItem("CalibLine",m_CalibLine) );
91  ATH_CHECK( nt->addItem("is_lar_em",m_is_lar_em) );
92  ATH_CHECK( nt->addItem("is_lar_hec",m_is_lar_hec) );
93  ATH_CHECK( nt->addItem("is_lar_fcal",m_is_lar_fcal) );
94  ATH_CHECK( nt->addItem("pos_neg",m_pos_neg) );
95  ATH_CHECK( nt->addItem("barrel_ec",m_barrel_ec) );
96  ATH_CHECK( nt->addItem("FT",m_FT) );
97  ATH_CHECK( nt->addItem("FEBid",m_FEBid) );
98  ATH_CHECK( nt->addItem("slot",m_slot) );
99  ATH_CHECK( nt->addItem("eta",m_eta) );
100  ATH_CHECK( nt->addItem("phi",m_phi) );
101  ATH_CHECK( nt->addItem("layer",m_layer) );
102  ATH_CHECK( nt->addItem("real_eta",m_real_eta) );
103  ATH_CHECK( nt->addItem("real_phi",m_real_phi) );
104  ATH_CHECK( nt->addItem("t0",m_t0) );
105  ATH_CHECK( nt->addItem("tcali",m_tcali) );
106  ATH_CHECK( nt->addItem("tCalibPredicted",m_tCalibPredicted) );
107  ATH_CHECK( nt->addItem("CalibCables",m_CalibCables) );
108  ATH_CHECK( nt->addItem("SignalCables",m_SignalCables) );
109  ATH_CHECK( nt->addItem("TOF",m_TOF) );
110  ATH_CHECK( nt->addItem("DeltaTTC",m_DeltaTTC) );
111  ATH_CHECK( nt->addItem("tPhysPredicted",m_tPhysPredicted) );
112 
113  return StatusCode::SUCCESS;
114 }
115 
117 {
118  ATH_MSG_INFO ( "LArTimePhysPrediction in stop()" );
119  //Intermediate variables declaration (should be removed in an updated version)
120  const double meter2ns = 3.33564095;
121  int Channel;
122  int CalibLine;
123  double tphys;
124  double tcali;
125  double dt;
126  double TOF;
127  double CalibCables=0;
128  double LSignalFCAL=0;
129  double DeltaTTC;
130  double t0;
131  int barrel_ec;
132  int layer;
133  int eta;
134  int phi;
135  int FT;
136  int slot;
137  int pos_neg;
138  double real_eta;
139  double real_phi;
140  double radius=0;
141 
142  //Retrieve the LArCaliwaveContainer
143  const LArCaliWaveContainer* larCaliWaveContainer = nullptr;
144  ATH_CHECK( detStore()->retrieve(larCaliWaveContainer, m_keyinput) );
145  ATH_MSG_INFO ( "Loaded LArCaliWaveContainer with key = " << m_keyinput );
146 
147  //Create the LArPhysCaliTdiffComplete object
148  LArPhysCaliTdiffComplete *larPhysCaliTdiffComplete = new LArPhysCaliTdiffComplete();
149  ATH_CHECK( larPhysCaliTdiffComplete->setGroupingType(m_groupingType,msg()) );
150  ATH_CHECK( larPhysCaliTdiffComplete->initialize() );
151 
152  IAlgTool* algTool = nullptr;
153  ATH_CHECK( toolSvc()->retrieveTool("CaloDepthTool", algTool, this) );
154  m_CaloDepthTool=dynamic_cast<CaloDepthTool*>(algTool);
155  ATH_MSG_INFO ( "CaloDepthTool retrieved with name " << m_CaloDepth );
156 
158  ATH_CHECK(clHdl.isValid());
159  const LArCalibLineMapping *clCont{*clHdl};
160 
162  ATH_CHECK(cablingHdl.isValid());
163  const LArOnOffIdMapping* cabling{*cablingHdl};
164 
166  ATH_CHECK(caloMgrHandle.isValid());
167  const CaloDetDescrManager* caloDDM{*caloMgrHandle};
168 
169  //Define helpers
170  LArWaveHelper larWaveHelper;
171 
172  const LArOnlineID* onlineHelper = nullptr;
173  ATH_CHECK( detStore()->retrieve(onlineHelper, "LArOnlineID") );
174 
175  const CaloCell_ID* caloCID = nullptr;
176  ATH_CHECK( detStore()->retrieve(caloCID, "CaloCell_ID") );
177 
178  //Get identifiers
179  const LArEM_ID* emId = caloCID->em_idHelper();
180  const LArHEC_ID* hecId = caloCID->hec_idHelper();
181  const LArFCAL_ID* fcalId = caloCID->fcal_idHelper();
182 
183  //------------------------------------------------------------------------------------------------------------------------------
184  //--------------Start to loop on the LArCaliWaveContainer------------------------------------------------------------------------
185  for ( unsigned gain_it = CaloGain::LARHIGHGAIN ; gain_it < CaloGain::LARNGAIN ; ++gain_it ) { // Gains
186 
187  CaliCellIt cell_it = larCaliWaveContainer->begin(gain_it) ;
188  CaliCellIt cell_it_e = larCaliWaveContainer->end(gain_it) ;
189 
190  if ( cell_it == cell_it_e ) {
191  ATH_MSG_DEBUG ( "LArCaliWaveContainer (key = " << m_keyinput << ") has no wave with gain = " << gain_it );
192  continue;
193  } else {
194  ATH_MSG_INFO ( "Processing LArCaliWaveContainer (key = " << m_keyinput << ") in gain = " << gain_it );
195  }
196 
197  //counters for channels and waves
198  int nchannels = 0;
199 
200  for ( ; cell_it != cell_it_e; ++cell_it) { // Channels
201 
202  if(nchannels==m_nchannels_max){continue;}
203  std::cout << "nchannels " << nchannels << std::endl;
204  nchannels++;
205 
206  CaliWaveIt wave_it = cell_it->begin();
207  CaliWaveIt wave_it_e = cell_it->end();
208  if ( wave_it == wave_it_e ) {
209  ATH_MSG_DEBUG ( "Empty channel found..." );
210  continue; // skip empty channels
211  }
212 
213  //use HWIdentifier
214  HWIdentifier chid = cell_it.channelId();
215 
216  Identifier id;
217 
218  try {
219  id = cabling->cnvToIdentifier(chid);
220  } catch ( const LArID_Exception& ) {
221  ATH_MSG_ERROR ( "LArCabling exception caught for channel " << MSG::hex << chid << MSG::dec );
222  continue;
223  }
224 
225  Channel = onlineHelper->channel(chid);
226 
227  const std::vector<HWIdentifier>& calibLineV = clCont->calibSlotLine(chid);
228  std::vector<HWIdentifier>::const_iterator calibLineIt = calibLineV.begin();
229  CalibLine = onlineHelper->channel(*calibLineIt) ;
230 
231  //indexes eta/phi/layer
232  if (emId->is_lar_em(id)) {
233  eta=emId->eta(id);
234  phi=emId->phi(id);
235  layer=emId->sampling(id);}
236  else if (hecId->is_lar_hec(id)) {
237  eta=hecId->eta(id);
238  phi=hecId->phi(id);
239  layer=hecId->sampling(id);}
240  else if (fcalId->is_lar_fcal(id)) {
241  eta=fcalId->eta(id);
242  phi=fcalId->phi(id);
243  layer=fcalId->module(id);}
244  else {
245  ATH_MSG_INFO ( "cell not in the calorimeters " );
246  continue;
247  }
248 
249  //identification using the online helper (common to all LAr calorimeters)
250  pos_neg = onlineHelper->pos_neg(chid);
251  barrel_ec = onlineHelper->barrel_ec(chid);
252  FT = onlineHelper->feedthrough(chid);
253  slot = onlineHelper->slot(chid);
254 
255  //get the FT online identifier
256  HWIdentifier febid = onlineHelper->feb_Id(chid);
258 
259  //real eta and phi: need the hash identifier
260  IdentifierHash theHash = caloCID->calo_cell_hash(id) ;
261  const CaloDetDescrElement* theDDE = caloDDM->get_element(theHash) ;
262 
263  if(theDDE==nullptr) {
264  ATH_MSG_INFO ( "CellIndex = " << theHash << " has a DDE pointer NULL " );
265  continue;
266  }
267 
268  real_eta = theDDE->eta();
269  real_phi = theDDE->phi();
270  CaloCell_ID::CaloSample sample = theDDE->getSampling();//ok for EMB and EMEC
271  //retrieve/compute the shower depth
272  //use the "best" available parametrisation of the shower depth at the time of development
273  //WARNING: use the CaloDepthTool's convention radius=r(barrel), radius=z(end-cap)
274  //for HEC and FCAL: lengths could be moved in the job options
275  if(emId->is_lar_em(id) && m_CaloDepthTool){
276  radius = CaloDepthTool::cscopt2_parametrized(sample,real_eta,real_phi,caloDDM);
277  }
278  else if(hecId->is_lar_hec(id)){//assumption: "arrival point" = middle of the compartment
279  if(layer==0) radius=4398.;
280  if(layer==1) radius=4806.;
281  if(layer==2) radius=5359.;
282  if(layer==3) radius=5840.;
283  }
284  else if(fcalId->is_lar_fcal(id)){//assumption: "arrival point" = middle of the compartment
285  if(layer==1) {radius=4916.;LSignalFCAL=m_vLSignal_FCAL[0];}
286  if(layer==2) {radius=5366.;LSignalFCAL=m_vLSignal_FCAL[1];}
287  if(layer==3) {radius=5816.;LSignalFCAL=m_vLSignal_FCAL[2];}
288  }
289 
290  for ( ; wave_it != wave_it_e; ++wave_it) { // DACs <==> iterator = the caliwave
291 
292  //initialize tphys
293  tphys=-999.;
294 
295  //----step 1: get the calibration time
296  dt = wave_it->getDt();
297  tcali = dt * larWaveHelper.getMax(*wave_it);
298  //modified version of getT0
299  const unsigned Nbase=5;
300  double rT0=0.;
301  double asamp1=0.;
302  double asamp2=0.;
303  double base = larWaveHelper.getBaseline(*wave_it,Nbase);
304  double amax = larWaveHelper.getMaxAmp(*wave_it);
305  unsigned int imax=larWaveHelper.getMax(*wave_it);
306 
307  for (unsigned int i=1; i<imax ; i++) {
308  asamp1=wave_it->getSample(i);
309  asamp2=wave_it->getSample(i-1);
310  if((asamp1-base)>amax*0.10 && (asamp2-base)<amax*0.10)
311  rT0 = i-1+(0.01*amax-(asamp2-base))/(asamp1-asamp2);
312  }
313  t0=rT0;
314 
315  //----step 2: compute the TOF
316  if(emId->is_lar_em(id) && barrel_ec==0) TOF = fabs(radius)*TMath::CosH(real_eta)* meter2ns/1000;//EMB
317  else TOF = fabs(radius)/TMath::TanH(fabs(real_eta))* meter2ns/1000;//EC
318 
319  //----step 3: deduction of the propagation time due to the propagation of the calibration pulse
320  //from the pulse until the calibration board
321  if(emId->is_lar_em(id) && barrel_ec==0){//EMB
322  for(int ieta=0;ieta<16;ieta++){
323  if(fabs(real_eta)>ieta*0.1 && fabs(real_eta)<(ieta+1)*0.1) CalibCables=0.7*m_sPig+m_vLCalib_EMB[layer][ieta]*m_sCalib;
324  }
325  }
326  else if(emId->is_lar_em(id) && abs(barrel_ec)==1) CalibCables=0.9*m_sPig+m_vLCalib_EMEC*m_sCalib;//EMEC
327  else if(hecId->is_lar_hec(id)) CalibCables=m_vLCalib_HEC*m_sCalib;//HEC
328  else if(fcalId->is_lar_fcal(id)) CalibCables=-LSignalFCAL*m_sSignal;//FCAL
329 
330  //----step 4: deduction of the propagation times due to the optical fibers from USA15 to FEC
331  if(emId->is_lar_em(id) && barrel_ec==0){
332  if(pos_neg==1) DeltaTTC=m_vDeltaTTC_EMB[1][FT];//EMBA
333  else DeltaTTC=m_vDeltaTTC_EMB[0][FT];//EMBC
334  }
335  else {
336  if(real_eta>0) DeltaTTC=m_vDeltaTTC_EC[1][FT];//ECA
337  else DeltaTTC=m_vDeltaTTC_EC[0][FT];//ECC
338  //correction for special crates
339  //A FTs 2/3
340  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==2 && real_eta>0 && slot<11) DeltaTTC=m_vDeltaTTC_ECA_SPEC[0][0];
341  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==2 && real_eta>0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==3 && real_eta>0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECA_SPEC[0][1];
342  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==3 && real_eta>0) DeltaTTC=m_vDeltaTTC_ECA_SPEC[0][2];
343  //A FTs 9/10
344  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==9 && real_eta>0 && slot<11) DeltaTTC=m_vDeltaTTC_ECA_SPEC[1][0];
345  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==9 && real_eta>0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==10 && real_eta>0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECA_SPEC[1][1];
346  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==10 && real_eta>0) DeltaTTC=m_vDeltaTTC_ECA_SPEC[1][2];
347  //A FTs 15/16
348  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==15 && real_eta>0 && slot<11) DeltaTTC=m_vDeltaTTC_ECA_SPEC[2][0];
349  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==15 && real_eta>0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==16 && real_eta>0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECA_SPEC[2][1];
350  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==16 && real_eta>0) DeltaTTC=m_vDeltaTTC_ECA_SPEC[2][2];
351  //A FTs 21/22
352  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==21 && real_eta>0 && slot<11) DeltaTTC=m_vDeltaTTC_ECA_SPEC[3][0];
353  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==21 && real_eta>0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==21 && real_eta>0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECA_SPEC[3][1];
354  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==22 && real_eta>0) DeltaTTC=m_vDeltaTTC_ECA_SPEC[3][2];
355  //C FTs 2/3
356  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==2 && real_eta<0 && slot<11) DeltaTTC=m_vDeltaTTC_ECC_SPEC[0][0];
357  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==2 && real_eta<0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==3 && real_eta<0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECC_SPEC[0][1];
358  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==3 && real_eta>0) DeltaTTC=m_vDeltaTTC_ECC_SPEC[0][2];
359  //C FTs 9/10
360  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==9 && real_eta<0 && slot<11) DeltaTTC=m_vDeltaTTC_ECC_SPEC[1][0];
361  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==9 && real_eta<0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==10 && real_eta<0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECC_SPEC[1][1];
362  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==10 && real_eta<0) DeltaTTC=m_vDeltaTTC_ECC_SPEC[1][2];
363  //C FTs 15/16
364  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==15 && real_eta<0 && slot<11) DeltaTTC=m_vDeltaTTC_ECC_SPEC[2][0];
365  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==15 && real_eta<0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==16 && real_eta<0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECC_SPEC[2][1];
366  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==16 && real_eta<0) DeltaTTC=m_vDeltaTTC_ECC_SPEC[2][2];
367  //C FTs 21/22
368  if(emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==21 && real_eta<0 && slot<11) DeltaTTC=m_vDeltaTTC_ECC_SPEC[3][0];
369  if((emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==21 && real_eta<0 && slot>10) || (emId->is_lar_em(id) && abs(barrel_ec)==1 && FT==21 && real_eta<0 && slot<3)) DeltaTTC=m_vDeltaTTC_ECC_SPEC[3][1];
370  if(hecId->is_lar_hec(id) && abs(barrel_ec)==1 && FT==22 && real_eta<0) DeltaTTC=m_vDeltaTTC_ECC_SPEC[3][2];
371  }
372 
373  //----step 5: computation of tphys
374  //tphys=tcali-CalibCables+TOF-DeltaTTC;
375  //add the effect from LTP cables: LTPI->LTP and LTP->LTP (hard coded)
376  //for A-C sides difference: a 8 ns is set (derived from September 2008 splash events)
377  if(pos_neg==1 && emId->is_lar_em(id) && abs(barrel_ec)==0) tphys=tcali-CalibCables+TOF+DeltaTTC+8+0.3*m_sLTP;//EMBA
378  else if(pos_neg==0 && emId->is_lar_em(id) && abs(barrel_ec)==0) tphys=tcali-CalibCables+TOF+DeltaTTC+0.3*m_sLTP;//EMBC
379  else if(pos_neg==1 && emId->is_lar_em(id) && abs(barrel_ec)==1) tphys=tcali-CalibCables+TOF+DeltaTTC+8;//EMECA
380  else if(real_eta>0 && (emId->is_lar_hec(id)||emId->is_lar_fcal(id))) tphys=tcali-CalibCables+TOF+DeltaTTC+8+0.3*m_sLTP;//HEC,FCAL A
381  else if(real_eta<0 && (emId->is_lar_hec(id)||emId->is_lar_fcal(id))) tphys=tcali-CalibCables+TOF+DeltaTTC+0.3*m_sLTP;//HEC,FCAL C
382  else tphys=tcali-CalibCables+TOF+DeltaTTC;//EMECC
383 
384  //prediction of the expected calibration time
385  //not finalized (EMEC signal cables lengths not implemented)
386  if(emId->is_lar_em(id) && abs(barrel_ec)==0){//EMB
387  for(int ieta=0;ieta<16;ieta++){
388  if(fabs(real_eta)>ieta*0.1 && fabs(real_eta)<(ieta+1)*0.1 && (layer==0 || (layer==1 && fabs(real_eta)<0.6))) m_SignalCables=0.9*m_sPig+m_vLSignal_EMB[layer][ieta]*m_sSignal;
389  else if(fabs(real_eta)>ieta*0.1 && fabs(real_eta)<(ieta+1)*0.1) m_SignalCables=0.7*m_sPig+m_vLSignal_EMB[layer][ieta]*m_sSignal;
390  }
391  }
392  else if(emId->is_lar_em(id) && abs(barrel_ec)==1) m_SignalCables=0.9*m_sPig+m_vLSignal_EMEC*m_sSignal;//EMEC
393  else if(hecId->is_lar_hec(id)) m_SignalCables=m_vLSignal_HEC*m_sSignal;//HEC
394  else if(fcalId->is_lar_fcal(id)) m_SignalCables=0.;//FCAL
395 
396  m_tCalibPredicted=m_SignalCables+CalibCables+tcali-t0;
397  if(fcalId->is_lar_fcal(id))m_tCalibPredicted=tcali-t0;
398 
399  //fill larPhysCaliTdiffComplete (needed to fill the DB)
400  //larPhysCaliTdiffComplete->set(chid,gain_it,tphys);
401 
402  //for debugging purposes: check the computed times
431  //write the ntuple
432  if(emId->is_lar_em(id)) m_is_lar_em=1;
433  else m_is_lar_em=0;
434  if(emId->is_lar_hec(id)) m_is_lar_hec=1;
435  else m_is_lar_hec=0;
436  if(emId->is_lar_fcal(id)) m_is_lar_fcal=1;
437  else m_is_lar_fcal=0;
440  m_CalibLine=CalibLine;
441  m_pos_neg=pos_neg;
442  m_barrel_ec=barrel_ec;
443  m_FT=FT;
444  m_slot=slot;
445  m_eta=eta;
446  m_phi=phi;
447  m_layer=layer;
448  m_real_eta=real_eta;
449  m_real_phi=real_phi;
450  m_t0=t0;
451  m_tcali=tcali;
452  m_CalibCables=CalibCables;
453  m_TOF=TOF;
454  m_DeltaTTC=DeltaTTC;
455  m_tPhysPredicted=tphys;
456  //m_SignalCables: already filled
457  //m_tCalibPredicted: already filled (computation to be finalized)
458 
459  ATH_MSG_VERBOSE ( "Try to write to ntuple " );
460  ATH_CHECK( ntupleSvc()->writeRecord(m_nt) );
461  ATH_MSG_VERBOSE ( "wave written to ntuple" );
462  } // end of loop over DACs
463 
464  }// end of loop over Channels
465 
466  } // end of loop over Gains
467 
468  // Record LArPhysCaliTdiffComplete (needed to fill the DB)
487  //-----------------------------------end of the main loop-------------------------------------------------------------------------
488  //--------------------------------------------------------------------------------------------------------------------------------
489 
490  ATH_MSG_INFO ( "end of stop" );
491  return StatusCode::SUCCESS ;
492 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArTimePhysPrediction::m_Channel
NTuple::Item< long > m_Channel
Definition: LArTimePhysPrediction.h:75
CaloDepthTool
Implementation of the ICaloDepthTool interface.Given a Track direction, checks if it is in the Calori...
Definition: CaloDepthTool.h:47
LArTimePhysPrediction::m_t0
NTuple::Item< double > m_t0
Definition: LArTimePhysPrediction.h:90
LArTimePhysPrediction::m_FT
NTuple::Item< long > m_FT
Definition: LArTimePhysPrediction.h:82
base
std::string base
Definition: hcg.cxx:78
LArConditionsContainer< LArCaliWaveVec >::ConstConditionsMapIterator
ConditionsMap::const_iterator ConstConditionsMapIterator
Definition: LArConditionsContainer.h:86
LArEM_Base_ID::phi
int phi(const Identifier id) const
return phi according to :
LArConditionsContainerDB::iteratorT::channelId
HWIdentifier channelId() const
LArEM_ID.h
LArTimePhysPrediction::m_TOF
NTuple::Item< double > m_TOF
Definition: LArTimePhysPrediction.h:95
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
LArTimePhysPrediction.h
LArHEC_Base_ID::eta
int eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
LArCaliWaveContainer.h
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LArTimePhysPrediction::m_CalibLine
NTuple::Item< long > m_CalibLine
Definition: LArTimePhysPrediction.h:76
LArTimePhysPrediction::m_DeltaTTC
NTuple::Item< double > m_DeltaTTC
Definition: LArTimePhysPrediction.h:96
CaloCell_ID::em_idHelper
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition: CaloCell_ID.h:63
AtlasDetectorID::is_lar_fcal
bool is_lar_fcal(Identifier id) const
Definition: AtlasDetectorID.h:839
LArTimePhysPrediction::m_vLSignal_EMB
std::vector< std::vector< double > > m_vLSignal_EMB
Definition: LArTimePhysPrediction.h:58
LArBadChanBlobUtils::Channel
Identifier32::value_type Channel
Definition: LArBadChanBlobUtils.h:24
LArTimePhysPrediction::LArTimePhysPrediction
LArTimePhysPrediction(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArTimePhysPrediction.cxx:29
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArTimePhysPrediction::m_vDeltaTTC_EC
std::vector< std::vector< double > > m_vDeltaTTC_EC
Definition: LArTimePhysPrediction.h:63
LArTimePhysPrediction::m_sLTP
double m_sLTP
Definition: LArTimePhysPrediction.h:69
LArConditionsContainerDB::iteratorT
Declaration of const iterator.
Definition: LArConditionsContainerDB.h:72
LArWaveHelper::getBaseline
double getBaseline(const LArWave &theWave, unsigned nBase) const
Definition: LArWaveHelper.cxx:347
LArTimePhysPrediction::m_FEBid
NTuple::Item< long > m_FEBid
Definition: LArTimePhysPrediction.h:84
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
LArCalibLineMapping
Definition: LArCalibLineMapping.h:17
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
CaloDepthTool.h
Declaration of CaloDepthTool. Created by Claire Bourdarios, 25.10.2004.
LArOnlineID_Base::slot
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
Definition: LArOnlineID_Base.cxx:1961
LArTimePhysPrediction::m_real_phi
NTuple::Item< double > m_real_phi
Definition: LArTimePhysPrediction.h:89
LArTimePhysPrediction::m_vLSignal_FCAL
std::vector< double > m_vLSignal_FCAL
Definition: LArTimePhysPrediction.h:61
LArFCAL_Base_ID::module
int module(const Identifier id) const
module [1,3]
LArWaveHelper
Definition: LArWaveHelper.h:14
LArTimePhysPrediction::m_is_lar_hec
NTuple::Item< long > m_is_lar_hec
Definition: LArTimePhysPrediction.h:78
LArHEC_ID
Helper class for LArHEC offline identifiers.
Definition: LArHEC_ID.h:85
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
LArTimePhysPrediction::initialize
StatusCode initialize()
Definition: LArTimePhysPrediction.cxx:61
LArWaveHelper::getMaxAmp
double getMaxAmp(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:129
LArTimePhysPrediction::m_layer
NTuple::Item< long > m_layer
Definition: LArTimePhysPrediction.h:87
LArTimePhysPrediction::m_slot
NTuple::Item< long > m_slot
Definition: LArTimePhysPrediction.h:83
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LArHEC_ID.h
LArWaveHelper::getMax
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
Definition: LArWaveHelper.cxx:89
HWIdentifier
Definition: HWIdentifier.h:13
LArTimePhysPrediction::m_sSignal
double m_sSignal
Definition: LArTimePhysPrediction.h:67
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
LArOnlineID_Base::barrel_ec
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
Definition: LArOnlineID_Base.cxx:1942
LArTimePhysPrediction::m_vLCalib_EMEC
double m_vLCalib_EMEC
Definition: LArTimePhysPrediction.h:56
LArTimePhysPrediction::m_tCalibPredicted
NTuple::Item< double > m_tCalibPredicted
Definition: LArTimePhysPrediction.h:92
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
LArEM_Base_ID::eta
int eta(const Identifier id) const
return eta according to :
LArTimePhysPrediction::m_vEtaMin_EMB
std::vector< double > m_vEtaMin_EMB
Definition: LArTimePhysPrediction.h:54
LArFCAL_Base_ID::eta
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
CaloCell_ID.h
CaloCell_ID::hec_idHelper
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition: CaloCell_ID.h:69
LArCaliWaveContainer
Liquid Argon Cumulative Wave Container.
Definition: LArCaliWaveContainer.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArTimePhysPrediction::m_tPhysPredicted
NTuple::Item< double > m_tPhysPredicted
Definition: LArTimePhysPrediction.h:97
LArTimePhysPrediction::m_vDeltaTTC_ECA_SPEC
std::vector< std::vector< double > > m_vDeltaTTC_ECA_SPEC
Definition: LArTimePhysPrediction.h:65
LArTimePhysPrediction::m_keyoutput
std::string m_keyoutput
Definition: LArTimePhysPrediction.h:40
LArTimePhysPrediction::m_pos_neg
NTuple::Item< long > m_pos_neg
Definition: LArTimePhysPrediction.h:80
CaloDetDescriptor.h
Definition of CaloDetDescriptor.
LArFCAL_Base_ID::phi
int phi(const Identifier id) const
phi [0,15]
LArTimePhysPrediction::m_eta
NTuple::Item< long > m_eta
Definition: LArTimePhysPrediction.h:85
LArOnlineID_Base::channel
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
Definition: LArOnlineID_Base.cxx:1967
LArTimePhysPrediction::m_CalibCables
NTuple::Item< double > m_CalibCables
Definition: LArTimePhysPrediction.h:93
LArTimePhysPrediction::m_calibMapKey
SG::ReadCondHandleKey< LArCalibLineMapping > m_calibMapKey
Definition: LArTimePhysPrediction.h:46
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
LArConditionsContainer::end
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
LArTimePhysPrediction::m_thistSvc
ITHistSvc * m_thistSvc
Definition: LArTimePhysPrediction.h:39
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
LArTimePhysPrediction::m_phi
NTuple::Item< long > m_phi
Definition: LArTimePhysPrediction.h:86
LArPhysCaliTdiffComplete
This class implements the ILArPhysCaliTdiff interface ` *.
Definition: LArPhysCaliTdiffComplete.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloNoise_fillDB.dt
dt
Definition: CaloNoise_fillDB.py:58
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LArOnlineID_Base::pos_neg
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
Definition: LArOnlineID_Base.cxx:1954
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AtlasDetectorID::is_lar_hec
bool is_lar_hec(Identifier id) const
Definition: AtlasDetectorID.h:829
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
CaliWaveIt
LArCaliWaveContainer::LArCaliWaves::const_iterator CaliWaveIt
Definition: LArCaliWaveSelector.cxx:21
imax
int imax(int i, int j)
Definition: TileLaserTimingTool.cxx:33
AthAlgorithm
Definition: AthAlgorithm.h:47
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1483
CaloDepthTool::cscopt2_parametrized
static double cscopt2_parametrized(const CaloCell_ID::CaloSample sample, const double eta, const double phi, const CaloDetDescrManager *caloDD)
Same as cscopt with the outermost EMB2 point excluded.
Definition: CaloDepthTool.cxx:323
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArTimePhysPrediction::m_vLSignal_EMEC
double m_vLSignal_EMEC
Definition: LArTimePhysPrediction.h:59
LArTimePhysPrediction::m_CaloDepthTool
CaloDepthTool * m_CaloDepthTool
Definition: LArTimePhysPrediction.h:44
LArTimePhysPrediction::m_is_lar_fcal
NTuple::Item< long > m_is_lar_fcal
Definition: LArTimePhysPrediction.h:79
LArTimePhysPrediction::m_vLCalib_HEC
double m_vLCalib_HEC
Definition: LArTimePhysPrediction.h:57
LArTimePhysPrediction::m_vLCalib_EMB
std::vector< std::vector< double > > m_vLCalib_EMB
Definition: LArTimePhysPrediction.h:53
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArOnlineID
Definition: LArOnlineID.h:20
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArTimePhysPrediction::m_SignalCables
NTuple::Item< double > m_SignalCables
Definition: LArTimePhysPrediction.h:94
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
LArTimePhysPrediction::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArTimePhysPrediction.h:45
LArTimePhysPrediction::~LArTimePhysPrediction
~LArTimePhysPrediction()
LArTimePhysPrediction::m_vLSignal_HEC
double m_vLSignal_HEC
Definition: LArTimePhysPrediction.h:60
LArTimePhysPrediction::m_keyinput
std::string m_keyinput
Definition: LArTimePhysPrediction.h:41
LArTimePhysPrediction::m_vDeltaTTC_ECC_SPEC
std::vector< std::vector< double > > m_vDeltaTTC_ECC_SPEC
Definition: LArTimePhysPrediction.h:64
LArNewCalib_Delay_OFC_Cali.FT
FT
Definition: LArNewCalib_Delay_OFC_Cali.py:120
LArTimePhysPrediction::m_CaloDepth
std::string m_CaloDepth
Definition: LArTimePhysPrediction.h:43
LArFCAL_ID.h
LArOnlineID_Base::feedthrough
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
Definition: LArOnlineID_Base.cxx:1948
LArWaveHelper.h
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
LArTimePhysPrediction::m_real_eta
NTuple::Item< double > m_real_eta
Definition: LArTimePhysPrediction.h:88
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
LArTimePhysPrediction::stop
StatusCode stop()
Definition: LArTimePhysPrediction.cxx:116
LArConditionsContainer::initialize
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
LArTimePhysPrediction::m_barrel_ec
NTuple::Item< long > m_barrel_ec
Definition: LArTimePhysPrediction.h:81
LArTimePhysPrediction::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: LArTimePhysPrediction.h:47
LArTimePhysPrediction::m_nt
NTuple::Tuple * m_nt
Definition: LArTimePhysPrediction.h:72
LArHEC_Base_ID::sampling
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArTimePhysPrediction::m_nchannels_max
int m_nchannels_max
Definition: LArTimePhysPrediction.h:52
LArConditionsContainer::begin
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
LArPhysCaliTdiffComplete.h
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
LArEM_ID
Helper class for LArEM offline identifiers.
Definition: LArEM_ID.h:118
LArTimePhysPrediction::m_vDeltaTTC_EMB
std::vector< std::vector< double > > m_vDeltaTTC_EMB
Definition: LArTimePhysPrediction.h:62
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
LArTimePhysPrediction::m_tcali
NTuple::Item< double > m_tcali
Definition: LArTimePhysPrediction.h:91
LArTimePhysPrediction::m_is_lar_em
NTuple::Item< long > m_is_lar_em
Definition: LArTimePhysPrediction.h:77
beamspotnt.nt
def nt
Definition: bin/beamspotnt.py:1063
LArTimePhysPrediction::m_sPig
double m_sPig
Definition: LArTimePhysPrediction.h:68
IdentifierHash
Definition: IdentifierHash.h:38
LArTimePhysPrediction::m_vEtaMax_EMB
std::vector< double > m_vEtaMax_EMB
Definition: LArTimePhysPrediction.h:55
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
LArTimePhysPrediction::m_sCalib
double m_sCalib
Definition: LArTimePhysPrediction.h:66
CaloGain.h
LArFCAL_ID
Helper class for LArFCAL offline identifiers.
Definition: LArFCAL_ID.h:60
ntupleSvc
INTupleSvc * ntupleSvc()
Definition: ServiceAccessor.h:14
AtlasDetectorID::is_lar_em
bool is_lar_em(Identifier id) const
Definition: AtlasDetectorID.h:818
LArID_Exception
Exception class for LAr Identifiers.
Definition: LArID_Exception.h:20
LArTimePhysPrediction::m_Chid
NTuple::Item< long > m_Chid
Definition: LArTimePhysPrediction.h:74
LArTimePhysPrediction::m_groupingType
std::string m_groupingType
Definition: LArTimePhysPrediction.h:42
CaloCell_ID::fcal_idHelper
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition: CaloCell_ID.h:75
LArOnlineID.h
LArHEC_Base_ID::phi
int phi(const Identifier id) const
return phi[0,63] outer part [0,31] inner part
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20