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