ATLAS Offline Software
TileTBAANtuple.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //*****************************************************************************
6 // Filename : TileTBAANtuple.cxx
7 // Author : Luca Fiorini
8 // Created : Mar, 2007
9 //
10 // DESCRIPTION:
11 // Implement the algorithm to save TB Beam ROD dataX
12 //
13 // HISTORY:
14 //
15 // BUGS:
16 //
17 //*****************************************************************************
18 
19 //Gaudi Includes
20 //#include "GaudiKernel/ITHistSvc.h"
21 
22 //Event info
24 
27 
28 #include <cmath>
29 
30 //Calo includes
32 #include "CaloIdentifier/CaloID.h"
33 
34 //TileCalo includes
35 #include "CaloIdentifier/TileID.h"
43 
44 #include <fstream>
45 #include <sstream>
46 
47 #define WRONG_SAMPLE(frag,chan,size) \
48 msg(MSG::ERROR) << "Wrong no. of samples (" << size \
49  << ") for channel " << chan \
50  << " in frag 0x"<<MSG::hex << frag << MSG::dec \
51  << " - " << BeamFragName[frag&0x1F] << endmsg;
52 
53 #define WRONG_CHANNEL(frag,chan) \
54 msg(MSG::ERROR) << "Wrong channel " << chan \
55  << " in frag 0x"<<MSG::hex << frag << MSG::dec \
56  << " - " << BeamFragName[frag&0x1F] << endmsg;
57 
58 #define FRAG_FOUND(frag,chan,size) \
59 if (msgLvl(MSG::DEBUG)) \
60  msg(MSG::DEBUG) << "Found channel " << chan \
61  << " in frag 0x"<<MSG::hex << frag << MSG::dec \
62  << " - " << BeamFragName[frag&0x1F] \
63  << " of size " << size << endmsg;
64 
65 
66 #define SIGNAL_FOUND(frag,chan,amplitude) \
67 if (msgLvl(MSG::DEBUG)) \
68  msg(MSG::DEBUG) << "Found channel " << chan \
69  << " in frag 0x"<<MSG::hex << frag << MSG::dec \
70  << " - " << BeamFragName[frag&0x1F] \
71  << " with amp=" << amplitude << endmsg;
72 
73 #define MAX_DRAWERS 256
74 #define N_CHANS 48
75 #define N_DMUS 16
76 
77 // Constructor & deconstructor
82 TileTBAANtuple::TileTBAANtuple(const std::string& name, ISvcLocator* pSvcLocator)
83  : AthAlgorithm(name, pSvcLocator)
84  , m_thistSvc("THistSvc", name)
85  , m_ntupleCreated(false)
86  , m_evTime(0)
87  , m_run(0)
88  , m_evt(0)
89  , m_trigType(0)
90  , m_dspFlags(0)
91  , m_muBackHit(0.0F)
92  , m_muBackSum(0.0F)
93  , m_las_BCID(0)
94  , m_las_Filt(0)
95  , m_las_ReqAmp(0.0)
96  , m_las_MeasAmp(0.0)
97  , m_las_D1_ADC(0)
98  , m_las_D2_ADC(0)
99  , m_las_D3_ADC(0)
100  , m_las_D4_ADC(0)
101  , m_las_D1_Ped(0.0)
102  , m_las_D2_Ped(0.0)
103  , m_las_D3_Ped(0.0)
104  , m_las_D4_Ped(0.0)
105  , m_las_D1_Ped_RMS(0.0)
106  , m_las_D2_Ped_RMS(0.0)
107  , m_las_D3_Ped_RMS(0.0)
108  , m_las_D4_Ped_RMS(0.0)
109  , m_las_D1_Alpha(0.0)
110  , m_las_D2_Alpha(0.0)
111  , m_las_D3_Alpha(0.0)
112  , m_las_D4_Alpha(0.0)
113  , m_las_D1_Alpha_RMS(0.0)
114  , m_las_D2_Alpha_RMS(0.0)
115  , m_las_D3_Alpha_RMS(0.0)
116  , m_las_D4_Alpha_RMS(0.0)
117  , m_las_D1_AlphaPed(0.0)
118  , m_las_D2_AlphaPed(0.0)
119  , m_las_D3_AlphaPed(0.0)
120  , m_las_D4_AlphaPed(0.0)
121  , m_las_D1_AlphaPed_RMS(0.0)
122  , m_las_D2_AlphaPed_RMS(0.0)
123  , m_las_D3_AlphaPed_RMS(0.0)
124  , m_las_D4_AlphaPed_RMS(0.0)
125  , m_las_PMT1_ADC(0)
126  , m_las_PMT2_ADC(0)
127  , m_las_PMT1_TDC(0)
128  , m_las_PMT2_TDC(0)
129  , m_las_PMT1_Ped(0.0)
130  , m_las_PMT2_Ped(0.0)
131  , m_las_PMT1_Ped_RMS(0.0)
132  , m_las_PMT2_Ped_RMS(0.0)
133  , m_las_Temperature(0.0)
134  , m_lasFlag(0)
135  , m_las0(0.0F)
136  , m_las1(0.0F)
137  , m_las2(0.0F)
138  , m_las3(0.0F)
139  , m_commonPU(0)
140  , m_adder(0)
141  , m_s1cou(0)
142  , m_s2cou(0)
143  , m_s3cou(0)
144  , m_cher1(0)
145  , m_cher2(0)
146  , m_cher3(0)
147  , m_muTag(0)
148  , m_muHalo(0)
149  , m_muVeto(0)
150  , m_s2extra(0)
151  , m_s3extra(0)
152  , m_sc1(0)
153  , m_sc2(0)
154  , m_btdc(0)
155  , m_tjitter(0)
156  , m_tscTOF(0)
157  , m_xChN2(0.0F)
158  , m_yChN2(0.0F)
159  , m_xChN1(0.0F)
160  , m_yChN1(0.0F)
161  , m_xCha0(0.0F)
162  , m_yCha0(0.0F)
163  , m_xCha1(0.0F)
164  , m_yCha1(0.0F)
165  , m_xCha2(0.0F)
166  , m_yCha2(0.0F)
167  , m_xCha1_0(0.0F)
168  , m_yCha1_0(0.0F)
169  , m_xCha2_0(0.0F)
170  , m_yCha2_0(0.0F)
171  , m_xImp(0.0F)
172  , m_yImp(0.0F)
173  , m_xImp_0(0.0F)
174  , m_yImp_0(0.0F)
175  , m_xImp_90(0.0F)
176  , m_yImp_90(0.0F)
177  , m_xImp_min90(0.0F)
178  , m_yImp_min90(0.0F)
179  , m_coincFlag1(0)
180  , m_coincFlag2(0)
181  , m_coincFlag3(0)
182  , m_coincFlag4(0)
183  , m_coincFlag5(0)
184  , m_coincFlag6(0)
185  , m_coincFlag7(0)
186  , m_coincFlag8(0)
187  , m_calibrateEnergyThisEvent(false)
188  , m_rchUnit(TileRawChannelUnit::MegaElectronVolts)
189  , m_dspUnit(TileRawChannelUnit::ADCcounts)
190 {
191 
192  char frg[6] = "0x000";
193  m_beamFragList.clear();
194  for (unsigned int i=0; i<sizeof(m_beamIdList)/sizeof(bool); ++i) {
195  m_beamIdList[i] = false;
196  // no coins trig by default (this is the case for 2004)
197  if (i <= ECAL_ADC_FRAG || i >= COMMON_ADC1_FRAG ) {
198  sprintf(frg,"0x%3.3x",i);
199  m_beamFragList.value().push_back((std::string)frg);
200  }
201  }
202 
203  m_eta = 0.0;
204  m_theta = 0.0;
205  m_runNumber = 0;
206  m_evtNr = -1;
207 }
208 
212 
226 
227  ATH_CHECK( m_tileToolEmscale.retrieve() );
228  ATH_CHECK( m_adderFilterAlgTool.retrieve(EnableTool{m_unpackAdder}) );
229 
231 
232  return StatusCode::SUCCESS;
233 }
234 
242 
243  CHECK( m_thistSvc.retrieve() );
244 
245  // find TileCablingService
247 
248  // retrieve TileID helper from det store
249 
251 
253 
254  if (m_nSamples < 0) {
255  m_nSamples = 7;
256  }
257  if (m_nSamplesFlx < 0) {
258  m_nSamplesFlx = m_saveFelixData ? 32 : 0;
259  }
260 
261  if (m_TBperiod >= 2015) {
262  m_unpackAdder = false;
263 
264  if (m_TBperiod == 2015) {
265  m_nDrawers = 2;
266  m_drawerList.value().resize(m_nDrawers);
267  m_drawerType.value().resize(m_nDrawers);
268  m_drawerList[0] = "0x200"; m_drawerType[0] = 2; // barrel neg
269  m_drawerList[1] = "0x401"; m_drawerType[1] = 4; // ext.barrel neg
270  } else if (m_TBperiod == 2016 || m_TBperiod == 2018 || m_TBperiod == 2021 || m_TBperiod == 2022) {
271  m_nDrawers = 5;
272  m_drawerList.value().resize(m_nDrawers); m_drawerType.value().resize(m_nDrawers);
273  m_drawerList[0] = "0x100"; m_drawerType[0] = 1; // M0 pos
274  m_drawerList[1] = "0x101"; m_drawerType[1] = 1; // barrel pos
275  m_drawerList[2] = "0x200"; m_drawerType[2] = 2; // M0 neg
276  m_drawerList[3] = "0x201"; m_drawerType[3] = 2; // barrel neg
277  m_drawerList[4] = "0x402"; m_drawerType[4] = 4; // ext.barrel neg
278  } else if (m_TBperiod == 2017) {
279  m_nDrawers = 6;
280  m_drawerList.value().resize(m_nDrawers); m_drawerType.value().resize(m_nDrawers);
281  m_drawerList[0] = "0x100"; m_drawerType[0] = 1; // M0 pos
282  m_drawerList[1] = "0x101"; m_drawerType[1] = 1; // barrel pos
283  m_drawerList[2] = "0x200"; m_drawerType[2] = 2; // M0 neg
284  m_drawerList[3] = "0x201"; m_drawerType[3] = 2; // barrel neg
285  m_drawerList[4] = "0x203"; m_drawerType[4] = 2; // barrel neg
286  m_drawerList[5] = "0x402"; m_drawerType[5] = 4; // ext.barrel neg
287  } else if (m_TBperiod == 2019) {
288  m_nDrawers = 7;
289  m_drawerList.value().resize(m_nDrawers); m_drawerType.value().resize(m_nDrawers);
290  m_drawerList[0] = "0x100"; m_drawerType[0] = 1; // M0 pos
291  m_drawerList[1] = "0x101"; m_drawerType[1] = 1; // barrel pos
292  m_drawerList[2] = "0x200"; m_drawerType[2] = 2; // M0 neg
293  m_drawerList[3] = "0x201"; m_drawerType[3] = 2; // barrel neg
294  m_drawerList[4] = "0x203"; m_drawerType[4] = 2; // barrel neg
295  m_drawerList[5] = "0x402"; m_drawerType[5] = 4; // ext.barrel neg
296  m_drawerList[6] = "0x405"; m_drawerType[6] = 4; // ext.barrel neg
297  }
298 
299  if (m_TBperiod < 2016) {
301  } else if (m_TBperiod < 2021) {
303  } else {
304  // Strating from 2021 the following properties should be setup via JO
312  checkIsPropertySetup(m_beamBC1Z_min90, "BC1Z_min90");
313 
321  checkIsPropertySetup(m_beamBC2Z_min90, "BC2Z_min90");
322  }
323 
324  } else {
326  }
327 
328 
329  if (m_unpackAdder) {
330  // get TileRawChannelBuilderFlatFilter for adder energy calculation
331 
332  StatusCode sc;
333  sc &= m_adderFilterAlgTool->setProperty("TileRawChannelContainer", "TileAdderFlat");
334  sc &= m_adderFilterAlgTool->setProperty("calibrateEnergy", "true");
335 
336  sc &= m_adderFilterAlgTool->setProperty("PedStart", "0");
337  sc &= m_adderFilterAlgTool->setProperty("PedLength", "1");
338  sc &= m_adderFilterAlgTool->setProperty("PedOffset", "0");
339  sc &= m_adderFilterAlgTool->setProperty("SignalStart", "1");
340  sc &= m_adderFilterAlgTool->setProperty("SignalLength", "15");
341  sc &= m_adderFilterAlgTool->setProperty("FilterLength", "5");
342  sc &= m_adderFilterAlgTool->setProperty("FrameLength", "16");
343  sc &= m_adderFilterAlgTool->setProperty("DeltaCutLo", "9.5");
344  sc &= m_adderFilterAlgTool->setProperty("DeltaCutHi", "9.5");
345  sc &= m_adderFilterAlgTool->setProperty("RMSCutLo", "1.0");
346  sc &= m_adderFilterAlgTool->setProperty("RMSCutHi", "1.0");
347  if (sc.isFailure()) {
348  ATH_MSG_ERROR("Failure setting properties of " << m_adderFilterAlgTool);
349  return StatusCode::FAILURE;
350  }
351  }
352 
355 
356  m_finalUnit = -1;
358  m_useDspUnits = true;
359  ATH_MSG_INFO( "Final offline units are not set, will use DSP units" );
360  }
361  }
362 
363  if (!m_calibrateEnergy) {
364  if (m_useDspUnits) {
365  ATH_MSG_INFO( "calibrateEnergy is disabled, don't want to use DSP units" );
366  m_useDspUnits = false;
367  }
368  }
369 
370  ATH_MSG_INFO( "TestBeam period " << m_TBperiod.value() );
371  ATH_MSG_INFO( "calibMode " << m_calibMode.value() );
372  ATH_MSG_INFO( "calibrateEnergy " << m_calibrateEnergy.value() );
373  ATH_MSG_INFO( "offlineUnits " << m_finalUnit.value() );
374  ATH_MSG_INFO( "useDspUnits " << m_useDspUnits.value() );
375  ATH_MSG_INFO( "number of samples " << m_nSamples.value() );
376 
377 
378  msg(MSG::INFO) << "drawerList " << MSG::hex;
379  unsigned int size = m_drawerList.size();
380  for (unsigned int dr = 0; dr < size; ++dr) {
381  int frag = strtol(m_drawerList[dr].data(), NULL, 0);
382  if (frag >= 0) {
383  m_drawerMap[frag] = dr;
384  if (dr == m_drawerType.size()) m_drawerType.value().push_back(frag >> 8);
385  msg(MSG::INFO) << " 0x" << frag;
386  } else {
387  msg(MSG::INFO) << " " << m_drawerList[dr];
388  // put negative number in first element (flag to read frag ID from data)
390  m_drawerList.value().resize(1);
391  // m_drawerType.clear();
392  m_drawerMap.clear();
393  size = 0;
394  break;
395  }
396  }
397  if (size == 0) {
398  if (m_drawerList.size() > 0)
399  msg(MSG::INFO) << " - negative number, will read frag IDs from the data" << MSG::dec << endmsg;
400  else
401  msg(MSG::INFO) << "is empty, no drawer fragments in ntuple" << MSG::dec << endmsg;
402  } else {
403  msg(MSG::INFO) << MSG::dec << endmsg;
404 
405  size = m_drawerType.size();
406  if (size < m_nDrawers) {
407  m_drawerType.value().resize(m_nDrawers);
408  for (; size < m_nDrawers; ++size)
409  m_drawerType[size] = 0;
410  }
411 
412  msg(MSG::INFO) << MSG::INFO << "drawerType ";
413  for (unsigned int dr = 0; dr < size; ++dr)
414  msg(MSG::INFO) << " " << m_drawerType[dr];
415  msg(MSG::INFO) << endmsg;
416 
417  if (size > m_nDrawers) {
418  ATH_MSG_INFO( "increasing m_nDrawers from " << m_nDrawers << " to " << size );
419  m_nDrawers = size;
420  }
421  }
422 
423  msg(MSG::INFO) << MSG::INFO << "Beam Frag List " << MSG::hex;
424  size = m_beamFragList.size();
425  for (unsigned int dr = 0; dr < size; ++dr) {
426  int frag = strtol(m_beamFragList[dr].data(), NULL, 0);
427  if (frag >= 0) {
428  m_beamIdList[frag & 0x1F] = true;
429  msg(MSG::INFO) << " 0x" << frag;
430  }
431  }
432  if (size == 0) {
433  msg(MSG::INFO) << "is empty, no beam fragments in ntuple" << MSG::dec << endmsg;
434  } else {
435  msg(MSG::INFO) << MSG::dec << endmsg;
436  }
437 
438  // set event number to 0 before first event
439  m_evtNr = 0;
441 
442  // find event and beam ROD header, calib mode for digitizers
443 
447  if (m_evtNr == 0) {
448  if (m_unpackAdder) // in 2003 event number starts from 1
449  ++m_evtNr;
450  }
451 
452  if (initList(ctx).isFailure()) {
453  ATH_MSG_ERROR( " Error during drawer list initialization" );
454  }
455 
456  if (m_saveFelixData && initListFlx(ctx).isFailure()) {
457  ATH_MSG_ERROR( " Error during drawer list initialization" );
458  }
459 
460  if (initNTuple().isFailure()) {
461  ATH_MSG_ERROR( " Error during ntuple initialization" );
462  }
463 
464  ATH_MSG_INFO( "initialization completed" );
465  return StatusCode::SUCCESS;
466 }
467 
469 
470  const EventContext& ctx = Gaudi::Hive::currentContext();
471  const TileDQstatus* dqStatus = (!m_dqStatusKey.empty()) ? SG::makeHandle(m_dqStatusKey, ctx).get() : nullptr;
472 
473  if (m_evtNr < 0) {
474 
475  //bool calibMode = (m_beamInfo->calibMode() == 1);
476  //if ( calibMode != m_calibMode ) {
477  // ATH_MSG_INFO( "Calib mode from data is " << calibMode );
478  // ATH_MSG_INFO( " Overwriting calib mode " );
479  // m_calibMode = calibMode;
480  //}
481 
482  if (ntuple_initialize(ctx).isFailure()) {
483  ATH_MSG_ERROR( "ntuple_initialize failed" );
484  }
485 
486  }
487 
488  m_dspFlags = 0;
489  if (ntuple_clear().isFailure()) {
490  ATH_MSG_ERROR( "ntuple_clear failed" );
491  }
492 
493  if (m_evtNr % 1000 == 0)
494  ATH_MSG_INFO( m_evtNr << " events processed so far" );
495 
496  m_run = ctx.eventID().run_number();
497  m_evt = ctx.eventID().event_number();
498 
499  //Get timestamp of the event
500  if (ctx.eventID().time_stamp() > 0) {
501  m_evTime = ctx.eventID().time_stamp();
502  }
503 
504  // store BeamElements
505  bool empty = storeBeamElements(ctx).isFailure();
506 
507  //store Laser Object
508  empty &= storeLaser(ctx).isFailure();
509 
510  if (m_drawerMap.size() > 0) {
511 
512  // store TileDigits
513  if (m_nSamples > 0) {
514  empty &= (storeDigits(ctx, m_digitsContainerKey, dqStatus).isFailure());
515  }
516  if (m_nSamplesFlx > 0) {
517  empty &= (storeDigitsFlx(ctx, m_digitsContainerFlxKey).isFailure());
518  }
519 
520  // store TileRawChannels
521  // start from DSP channels - so we can find out what is the DSP units
529 
530  empty &= (storeHitVector(ctx).isFailure());
531  empty &= (storeHitContainer(ctx).isFailure());
532  }
533 
534 
535  if (m_completeNtuple && m_TBperiod < 2015) {
536  // store energy per sampling from all calorimeters
537  empty &= (storeCells(ctx).isFailure());
538  }
539 
540  // increase event nr
541  // this number can be different from real event number if we skip events
542 
543  if (empty) {
544  ATH_MSG_WARNING( "Error in execute " );
545  }
546 
547  m_ntuplePtr->Fill();
548 
549  ++m_evtNr;
550 
551  // Execution completed.
552  ATH_MSG_DEBUG( "execute() completed successfully" );
553 
554  return StatusCode::SUCCESS;
555 }
556 
557 //
558 // Here the LASER object is opened and corresponding variable are stored
559 //
560 
561 
562 StatusCode TileTBAANtuple::storeLaser(const EventContext& ctx) {
563 
564  if (m_laserObjectKey.empty()) { // empty name, nothing to do
565  return StatusCode::FAILURE;
566  }
567 
568  // Read Hit Vector from TDS
569  const TileLaserObject* laserObj = SG::makeHandle (m_laserObjectKey, ctx).get();
570 
571  m_las_BCID = laserObj->getBCID();
572 
573  m_las_Filt = laserObj->getFiltNumber();
574  m_las_ReqAmp = laserObj->getDiodeCurrOrd();
575  m_las_MeasAmp = laserObj->getDiodeCurrMeas();
576 
577 
578  m_las_D1_ADC = laserObj->getDiodeADC(0);
579  m_las_D2_ADC = laserObj->getDiodeADC(1);
580  m_las_D3_ADC = laserObj->getDiodeADC(2);
581  m_las_D4_ADC = laserObj->getDiodeADC(3);
582 
583  m_las_D1_Ped = laserObj->getDiodePedestal(0);
584  m_las_D2_Ped = laserObj->getDiodePedestal(1);
585  m_las_D3_Ped = laserObj->getDiodePedestal(2);
586  m_las_D4_Ped = laserObj->getDiodePedestal(3);
587 
592 
593  m_las_D1_Alpha = laserObj->getAlpha(0);
594  m_las_D2_Alpha = laserObj->getAlpha(1);
595  m_las_D3_Alpha = laserObj->getAlpha(2);
596  m_las_D4_Alpha = laserObj->getAlpha(3);
597 
598  m_las_D1_Alpha_RMS = laserObj->getSigmaAlpha(0);
599  m_las_D2_Alpha_RMS = laserObj->getSigmaAlpha(1);
600  m_las_D3_Alpha_RMS = laserObj->getSigmaAlpha(2);
601  m_las_D4_Alpha_RMS = laserObj->getSigmaAlpha(3);
602 
603  m_las_D1_AlphaPed = laserObj->getPedestalAlpha(0);
604  m_las_D2_AlphaPed = laserObj->getPedestalAlpha(1);
605  m_las_D3_AlphaPed = laserObj->getPedestalAlpha(2);
606  m_las_D4_AlphaPed = laserObj->getPedestalAlpha(3);
607 
612 
613  m_las_PMT1_ADC = laserObj->getPMADC(0);
614  m_las_PMT2_ADC = laserObj->getPMADC(1);
615 
616  m_las_PMT1_TDC = laserObj->getTDC(0);
617  m_las_PMT2_TDC = laserObj->getTDC(1);
618 
619  m_las_PMT1_Ped = laserObj->getPMPedestal(0);
620  m_las_PMT2_Ped = laserObj->getPMPedestal(1);
621 
622  m_las_PMT1_Ped_RMS = laserObj->getPMSigmaPedestal(0);
623  m_las_PMT2_Ped_RMS = laserObj->getPMSigmaPedestal(1);
624 
625  m_las_Temperature = laserObj->getPumpDiodeTemp();
626 
627  ATH_MSG_DEBUG( "storeLaser() completed" );
628 
629  return StatusCode::SUCCESS;
630 }
631 
633 
634  if ( m_beamElemContainerKey.empty()) {
635  return StatusCode::SUCCESS;
636  }
637 
638  // Read Beam Elements from TES
639  const TileBeamElemContainer* beamElemCnt = SG::makeHandle (m_beamElemContainerKey, ctx).get();
640 
641  TileBeamElemContainer::const_iterator collItr = beamElemCnt->begin();
642  TileBeamElemContainer::const_iterator lastColl = beamElemCnt->end();
643 
644  if ( m_completeNtuple ) {
645  // Store ROD header info from collection (just from first one)
646  int nDrawersAll = m_nDrawers.value() + m_nDrawersFlx.value();
647  if ( collItr!=lastColl ) {
648  m_l1ID.at(nDrawersAll) = (*collItr)->getLvl1Id();
649  m_l1Type.at(nDrawersAll) = (*collItr)->getLvl1Type();
650  m_evType.at(nDrawersAll) = (*collItr)->getDetEvType();
651  m_evBCID.at(nDrawersAll) = (*collItr)->getRODBCID();
652  } else {
653  m_l1ID.at(nDrawersAll) = 0xFFFFFFFF;
654  m_l1Type.at(nDrawersAll) = 0xFFFFFFFF;
655  m_evType.at(nDrawersAll) = 0xFFFFFFFF;
656  m_evBCID.at(nDrawersAll) = 0xFFFFFFFF;
657  }
658  }
659 
660 
661  m_trigType = 0;
662 
663  for(; collItr != lastColl; ++collItr) {
664 
665  TileBeamElemCollection::const_iterator beamItr=(*collItr)->begin();
666  TileBeamElemCollection::const_iterator lastBeam=(*collItr)->end();
667 
668  if (msgLvl(MSG::VERBOSE)) {
669 
670  for (; beamItr != lastBeam; ++beamItr) {
671  HWIdentifier id = (*beamItr)->adc_HWID();
672  std::vector<uint32_t> digits = (*beamItr)->get_digits();
673  msg(MSG::VERBOSE) << " --- TileBeamElem -- Identifier " << m_tileHWID->to_string(id)
674  << MSG::hex << " frag: 0x" << (*collItr)->identify()
675  << MSG::dec << " channel " << m_tileHWID->channel(id)
676  << " digits size " << digits.size() << endmsg;
677  msg(MSG::VERBOSE) << " --- TileBeamElem -- BeamElem : ";
678  for (unsigned int k = 0; k < digits.size(); k++)
679  msg(MSG::VERBOSE) << digits[k] << " ";
680  msg(MSG::VERBOSE) << endmsg;
681  }
682  //restore iterator
683  beamItr = (*collItr)->begin();
684  }
685 
686  int frag = (*collItr)->identify();
687  ATH_MSG_DEBUG( " frag: " << frag );
688  ATH_MSG_DEBUG( " trigType " << (*collItr)->getLvl1Type() );
689 
690  if ( m_trigType == 0 && (*collItr)->getLvl1Type() != 0 ) // take it from the ROD header
691  m_trigType = (*collItr)->getLvl1Type();
692 
693  // unpack only fragments which we want to store in ntuple
694  if ( m_beamIdList[frag&0x1F] ) {
695 
696  for (; beamItr != lastBeam; ++beamItr) {
697 
698  HWIdentifier id = (*beamItr)->adc_HWID();
699  std::vector<uint32_t> digits = (*beamItr)->get_digits();
700  int cha = m_tileHWID->channel(id);
701  int dsize = digits.size();
702 
703  if ( dsize <= 0 ) {
704 
705  WRONG_SAMPLE(frag,cha,dsize);
706 
707  } else if ( dsize != 16 && frag == ADD_FADC_FRAG ) {
708 
709  WRONG_SAMPLE(frag,cha,dsize);
710 
711  } else if ( dsize != 1 && frag != ADD_FADC_FRAG &&
712  frag != BEAM_TDC_FRAG && frag != COMMON_TDC1_FRAG &&
713  frag != COMMON_TOF_FRAG && frag != COMMON_TDC2_FRAG &&
714  !(frag == ECAL_ADC_FRAG)) {
715 
716  WRONG_SAMPLE(frag,cha,dsize);
717 
718  } else {
719 
720  uint32_t amplitude = digits[0];
721  SIGNAL_FOUND(frag, cha, amplitude);
722 
723  switch (frag) {
724 
725  case BEAM_TDC_FRAG:
726 
727  FRAG_FOUND(frag,cha,dsize);
728  if(cha < 8) m_btdc1[cha] = amplitude;
729  else if(cha < 16) m_btdc2[cha-8] = amplitude;
730  else WRONG_CHANNEL(frag,cha);
731  break;
732 
733  case BEAM_ADC_FRAG:
734 
735  if ( m_TBperiod >= 2015 ) {
736  switch(cha) {
737  // BEAM
738  case 0: m_s1cou = amplitude; break;
739  case 1: m_s2cou = amplitude; break;
740  case 2: m_s3cou = amplitude; break;
741  case 3: m_cher1 = amplitude; break; // ATH_MSG_VERBOSE("load beam adc " << m_cher1); break;
742  case 4: m_cher2 = amplitude; break;
743  case 5: m_muTag = amplitude; break;
744  case 6: m_muHalo= amplitude; break;
745  case 7: m_muVeto= amplitude; break;
746  default: WRONG_CHANNEL(frag, cha);
747  }
748  } else if ( m_unpackAdder ) {
749  switch(cha) {
750  // BEAM
751  case 0: m_s1cou = amplitude; break;
752  case 1: m_s2cou = amplitude; break;
753  case 2: m_s3cou = amplitude; break;
754  case 3: m_cher1 = amplitude; break; // swap of Cher1
755  case 4: m_muTag = amplitude; break; // and S4 in 2003 data
756  case 5: m_cher2 = amplitude; break;
757  case 6: m_muHalo= amplitude; break;
758  case 7: m_muVeto= amplitude; break;
759  // LASER
760  case 8: m_las0 = amplitude; break;
761  case 9: m_las1 = amplitude; break;
762  case 10: m_las2 = amplitude; break;
763  case 11: m_las3 = amplitude; break;
764  case 12: m_lasExtra[0] = amplitude; break;
765  case 13: m_lasExtra[1] = amplitude; break;
766  case 14: m_lasExtra[2] = amplitude; break;
767  case 15: m_lasExtra[3] = amplitude; break;
768  default: WRONG_CHANNEL(frag, cha);
769  }
770  } else { // 2004 data
771  switch(cha) {
772  // BEAM
773  case 0: m_sc1 = amplitude; break;
774  case 1: m_sc2 = amplitude; break;
775  case 2:
776  case 3:
777  case 4:
778  case 5:
779  case 6:
780  case 7: break;
781  default: WRONG_CHANNEL(frag, cha);
782  }
783  }
784  break;
785 
786  case MUON_ADC_FRAG:
787 
788  // first 14 are m_muBack
789  if(cha < 14) m_muBack[cha] = amplitude;
790  // last 2 are m_muCalib
791  else if (cha < 16) m_muCalib[cha - 14] = amplitude;
792  else WRONG_CHANNEL(frag, cha);
793  break;
794 
795  case ADDR_ADC_FRAG:
796 
797  // second half of Muon Wall in 2004
798  if(cha < 6) m_muBack[cha + 8] = amplitude;
799  // last 2 are m_muCalib
800  else if (cha < 8) m_muCalib[cha - 6] = amplitude;
801  else WRONG_CHANNEL(frag,cha);
802  break;
803 
804  case LASE_PTN_FRAG:
805 
806  if (cha == 0) {
807  // laser pattern unit
808  m_lasFlag = amplitude;
809  if (amplitude & 0xFF00) m_trigType = amplitude >> 8;
810  } else {
811  WRONG_CHANNEL(frag, cha);
812  }
813  break;
814 
815  case LASE_ADC_FRAG:
816 
817  // laser in 2004
818  switch(cha) {
819  case 0: m_las0 = amplitude; break;
820  case 1: m_las1 = amplitude; break;
821  case 2: m_las2 = amplitude; break;
822  case 3: m_las3 = amplitude; break;
823  case 4: m_lasExtra[0] = amplitude; break;
824  case 5: m_lasExtra[1] = amplitude; break;
825  case 6: m_lasExtra[2] = amplitude; break;
826  case 7: m_lasExtra[3] = amplitude; break;
827  default: WRONG_CHANNEL(frag,cha);
828  }
829  break;
830 
831  case ADD_FADC_FRAG:
832 
833  if (m_unpackAdder) {
834 
835  for (int k = 0; k < dsize; k++) {
836  //m_addx[k]=k;
837  //check how the matrix is filled
838  m_adder[cha][k] = digits[k];
839  }
840  // FlatFiler adders
841  double ene, tim;
842  m_adderFilterAlgTool->flatFilter(digits, 0, ene, tim);
843  m_eneAdd[cha] = ene;
844  m_timeAdd[cha] = tim;
845  }
846 
847  break;
848 
849  case ECAL_ADC_FRAG:
850 
851  if (m_TBperiod > 2015) {
852 
853  if(cha < 15) {
854  m_qdc[cha] = amplitude;
855  ATH_MSG_VERBOSE( "QDC: " << cha << " amp: " << amplitude);
856  } else if (cha == 15) {
857  for (int idx = 0; idx < dsize && idx < 18; ++idx) {
858  m_qdc[idx + 15] = digits[idx];
859  ATH_MSG_VERBOSE("QDC2: " << cha << " amp: " << amplitude);
860  }
861  } else {
862  WRONG_CHANNEL(frag, cha);
863  }
864 
865  } else {
866  if(cha < 8) m_ecal[cha] = amplitude;
867  else WRONG_CHANNEL(frag, cha);
868  }
869 
870  break;
871 
872  case DIGI_PAR_FRAG:
873 
874  if(cha < 16) m_cispar[cha] = amplitude; //m_cispar->at(cha)=amplitude;
875  else WRONG_CHANNEL(frag,cha);
876  break;
877 
878  case COMMON_ADC1_FRAG:
879  if (m_TBperiod > 2015) {
880  if (cha < 16) {
881  if (m_run > 2211444) {
882  switch(cha) {
883  // BEAM
884  case 0: m_s1cou = amplitude; break;
885  case 1: m_s2cou = amplitude; break;
886  case 2: {
887  if (m_run < 2310000) {
888  m_muBack[10] = amplitude;
889  } else {
890  m_s3cou = amplitude;
891  }
892  }
893  break;
894  case 3: m_cher1 = amplitude; break;
895  case 4: m_cher2 = amplitude; break;
896  case 5: m_cher3 = amplitude; break;
897  default: m_muBack[cha - 6] = amplitude;
898  }
899  } else {
900  switch(cha) {
901  // BEAM
902  case 0: m_s1cou = amplitude; break;
903  case 1: m_s2cou = amplitude; break;
904  case 2: m_s3cou = amplitude; break;
905  case 3: m_cher1 = amplitude; break;
906  case 4: m_cher2 = amplitude; break;
907  case 5: m_cher3 = amplitude; break;
908  }
909  }
910  } else {
911  WRONG_CHANNEL(frag, cha);
912  }
913  } else {
914  switch(cha) {
915  // BEAM
916  case 0: m_s1cou = amplitude; break;
917  case 1: m_s2cou = amplitude; break;
918  case 2: m_s3cou = amplitude; break;
919  case 3: m_muTag = amplitude; break;
920  case 4: m_cher1 = amplitude; break;
921  case 5: m_cher2 = amplitude; break;
922  case 6: m_muHalo= amplitude; break;
923  case 7: m_muVeto= amplitude; break;
924  default: WRONG_CHANNEL(frag, cha);
925  }
926  }
927  break;
928 
929  case COMMON_ADC2_FRAG:
930 
931  if (m_TBperiod > 2015) {
932  if(cha < 14) {
933  m_muBack[cha] = amplitude;
934  } else {
935  WRONG_CHANNEL(frag, cha);
936  }
937  } else {
938  if ( ! m_unpackAdder ) {
939  switch(cha) {
940  // BEAM
941  case 0: break;
942  case 1: m_s2extra = amplitude; break;
943  case 2: m_s3extra = amplitude; break;
944  case 3:
945  case 4:
946  case 5:
947  case 6:
948  case 7: break;
949  default: WRONG_CHANNEL(frag, cha);
950  }
951  }
952  }
953  break;
954 
955  case COMMON_PTN_FRAG:
956  if (m_run > 2310000 && cha < 16) {
957  m_scaler[cha] = amplitude;
958  } else if (cha == 0) {
959  m_commonPU = amplitude;
960  } else {
961  WRONG_CHANNEL(frag, cha);
962  }
963  break;
964 
965  case COMMON_TOF_FRAG:
966 
967  if (m_TBperiod >= 2022) {
968  if (cha > 11) { // The first 12 channels are (can be) connected to BC1 and BC2, the last 4 channels are supposed to be TOF
969  if(cha < 16) {
970  m_tof[cha] = amplitude;
971  ATH_MSG_VERBOSE( "TOF: " << cha << " amp: " << amplitude);
972  } else {
973  WRONG_CHANNEL(frag, cha);
974  }
975  break;
976  }
977  // Fall through to case COMMON_TDC1_FRAG to unpack the first 12 channels of BC1 and BC2
978  [[fallthrough]]; // silent the warning on fall through
979  } else if (m_TBperiod > 2015) {
980 
981  if(cha < 16) {
982  m_tof[cha] = amplitude;
983  ATH_MSG_VERBOSE( "TOF: " << cha << " amp: " << amplitude);
984  } else {
985  WRONG_CHANNEL(frag, cha);
986  }
987  break;
988  } else {
989  if(cha < 8) m_tof[cha] = amplitude;
990  else WRONG_CHANNEL(frag, cha);
991  break;
992  }
993 
994  case COMMON_TDC1_FRAG:
995 
996  FRAG_FOUND(frag,cha,dsize);
997  if ((cha > 11) && (cha < 16) && (m_run > 2211136)) {
998  m_tof[cha] = amplitude;
999  ATH_MSG_VERBOSE( "TOF: " << cha << " amp: " << amplitude);
1000  } if(cha < 16) {
1001  m_btdc1[cha] = amplitude;
1002  ATH_MSG_VERBOSE( "TDC: " << cha << " amp: " << amplitude);
1003  if (m_btdcNhit[cha]==0) {
1004  m_btdc2[cha] = amplitude;
1005  }
1006  (*m_btdc)[cha].push_back(amplitude);
1007  ++m_btdcNhit[cha];
1008  } else WRONG_CHANNEL(frag, cha);
1009  break;
1010 
1011  case COMMON_TDC2_FRAG:
1012 
1013  FRAG_FOUND(frag,cha,dsize);
1014  if(cha < 16) m_btdc2[cha] = amplitude;
1015  else WRONG_CHANNEL(frag, cha);
1016  break;
1017 
1018  case COIN_TRIG1_FRAG:
1019 
1020  if(cha < 3) {
1021  int idx = cha * 32;
1022  for (int ibit = 0; ibit < 32; ++ibit){
1023  m_coincTrig1[idx++] = (amplitude >> ibit) & 1;
1024  }
1025  } else if (cha == 3) {
1026  m_coincFlag1 = amplitude;
1027  } else WRONG_CHANNEL(frag, cha);
1028 
1029  break;
1030 
1031  case COIN_TRIG2_FRAG:
1032 
1033  if(cha < 3) {
1034  int idx = cha * 32;
1035  for (int ibit=0; ibit < 32; ++ibit){
1036  m_coincTrig2[idx++] = (amplitude >> ibit) & 1;
1037  }
1038  } else if (cha == 3) {
1039  m_coincFlag2 = amplitude;
1040  } else WRONG_CHANNEL(frag, cha);
1041 
1042  break;
1043 
1044  case COIN_TRIG3_FRAG:
1045 
1046  if(cha < 3) {
1047  int idx = cha * 32;
1048  for (int ibit = 0; ibit < 32; ++ibit){
1049  m_coincTrig3[idx++] = (amplitude >> ibit) & 1;
1050  }
1051  } else if (cha == 3) {
1052  m_coincFlag3 = amplitude;
1053  } else WRONG_CHANNEL(frag,cha);
1054 
1055  break;
1056 
1057  case COIN_TRIG4_FRAG:
1058 
1059  if(cha < 3) {
1060  int idx = cha * 32;
1061  for (int ibit = 0; ibit < 32; ++ibit){
1062  m_coincTrig4[idx++] = (amplitude >> ibit) & 1;
1063  }
1064  } else if (cha == 3) {
1065  m_coincFlag4 = amplitude;
1066  } else WRONG_CHANNEL(frag, cha);
1067 
1068  break;
1069 
1070  case COIN_TRIG5_FRAG:
1071 
1072  if(cha < 3) {
1073  int idx = cha * 32;
1074  for (int ibit = 0; ibit < 32; ++ibit){
1075  m_coincTrig5[idx++] = (amplitude >> ibit) & 1;
1076  }
1077  } else if (cha == 3) {
1078  m_coincFlag5 = amplitude;
1079  } else WRONG_CHANNEL(frag, cha);
1080 
1081  break;
1082 
1083  case COIN_TRIG6_FRAG:
1084 
1085  if(cha < 3) {
1086  int idx = cha * 32;
1087  for (int ibit = 0; ibit < 32; ++ibit){
1088  m_coincTrig6[idx++] = (amplitude >> ibit) & 1;
1089  }
1090  } else if (cha == 3) {
1091  m_coincFlag6 = amplitude;
1092  } else WRONG_CHANNEL(frag, cha);
1093 
1094  break;
1095 
1096  case COIN_TRIG7_FRAG:
1097 
1098  if(cha < 3) {
1099  int idx = cha * 32;
1100  for (int ibit = 0; ibit < 32; ++ibit){
1101  m_coincTrig7[idx++] = (amplitude >> ibit) & 1;
1102  }
1103  } else if (cha == 3) {
1104  m_coincFlag7 = amplitude;
1105  } else WRONG_CHANNEL(frag,cha);
1106 
1107  break;
1108 
1109  case COIN_TRIG8_FRAG:
1110 
1111  if(cha < 3) {
1112  int idx = cha * 32;
1113  for (int ibit = 0; ibit < 32; ++ibit){
1114  m_coincTrig8[idx++] = (amplitude >> ibit) & 1;
1115  }
1116  } else if (cha == 3) {
1117  m_coincFlag8 = amplitude;
1118  } else WRONG_CHANNEL(frag, cha);
1119 
1120  break;
1121 
1122  default:
1123  break;
1124  }
1125  }
1126  }
1127  }
1128  }
1129 
1130  for (int i=0; i<8; ++i) {
1131  if (m_btdcNhit[i] > 1) ++m_btdcNchMultiHit[i>>2];
1132  }
1133  // calculate beam coords in Beam Chambers
1134  if ( m_TBperiod >= 2015 ) {
1135 
1136 // For BC1
1137 // -------
1138 // m_xCha1 = -0.0462586 + (-0.175666)*(m_btdc1[1] - m_btdc1[0]);
1139 // m_yCha1 = -0.051923 + (-0.176809)*(m_btdc1[2] - m_btdc1[3]);
1140 //
1141 // For BC2
1142 // -------
1143 // m_xCha2 = 0.25202 + (-0.18053)*(m_btdc1[5] - m_btdc1[4]);
1144 // m_yCha2 = 0.0431688 + (-0.181128)*(m_btdc1[6] - m_btdc1[7]);
1145 
1146  if (m_run > 2211444) {
1149  } else {
1152  }
1153  if (m_run > 612543 && m_run< 614141) {
1156  } else {
1159  }
1160 
1161  // Using the first value from the TDC
1162  if (m_run > 2211444) {
1165  } else {
1168  }
1171 
1172  m_tjitter = m_btdc1[8];
1173  m_tscTOF = m_btdc1[14];
1174 
1177 
1178 // Work in progress
1179 
1187 
1188  if (m_run > 2211444) {
1189  ATH_MSG_DEBUG( "BC1x : ( "<< m_btdc1[0] <<" - "<< m_btdc1[8] <<" )\t" << m_xCha1 );
1190  ATH_MSG_DEBUG( "BC1y : ( "<< m_btdc1[2] <<" - "<< m_btdc1[9] <<" )\t" << m_yCha1 );
1191  } else {
1192  ATH_MSG_DEBUG( "BC1x : ( "<< m_btdc1[0] <<" - "<< m_btdc1[1] <<" )\t" << m_xCha1 );
1193  ATH_MSG_DEBUG( "BC1y : ( "<< m_btdc1[2] <<" - "<< m_btdc1[3] <<" )\t" << m_yCha1 );
1194  }
1195  ATH_MSG_DEBUG( "BC2x : ( "<< m_btdc1[4] <<" - "<< m_btdc1[5] <<" )\t" << m_xCha2 );
1196  ATH_MSG_DEBUG( "BC2y : ( "<< m_btdc1[6] <<" - "<< m_btdc1[7] <<" )\t" << m_yCha2 );
1197 
1198  } else if ( m_unpackAdder ) { // this is 2003 data
1199 
1200  if ( m_beamIdList[BEAM_TDC_FRAG] ) {
1201  m_xCha1 = m_beamBC1X1 + m_beamBC1X2*(m_btdc1[6] - m_btdc1[7]); // last two channels of TDC !!!
1205 
1208  }
1209 
1210  } else { // this is 2004 data
1211 
1212  if ( m_beamIdList[COMMON_TDC1_FRAG] ) {
1217 
1220 
1221  ATH_MSG_DEBUG( "BC-2x : ( "<< m_btdc1[2] <<" - "<< m_btdc1[3] <<" )\t" <<m_xChN2 );
1222  ATH_MSG_DEBUG( "BC-2y : ( "<< m_btdc1[0] <<" - "<< m_btdc1[1] <<" )\t" <<m_yChN2 );
1223  ATH_MSG_DEBUG( "BC-1x : ( "<< m_btdc1[6] <<" - "<< m_btdc1[7] <<" )\t" <<m_xChN1 );
1224  ATH_MSG_DEBUG( "BC-1y : ( "<< m_btdc1[4] <<" - "<< m_btdc1[5] <<" )\t" <<m_yChN1 );
1225  ATH_MSG_DEBUG( "BC0x : ( "<< m_btdc1[10] <<" - "<< m_btdc1[11] <<" )\t" <<m_xCha0 );
1226  ATH_MSG_DEBUG( "BC0y : ( "<< m_btdc1[8] <<" - "<< m_btdc1[9] <<" )\t" <<m_yCha0 );
1227 
1228  }
1229 
1230  if ( m_beamIdList[COMMON_TDC2_FRAG] ) {
1235 
1236  m_xImp = 0.0;
1237  m_yImp = 0.0;
1238 
1239  ATH_MSG_DEBUG( "BC1x : ( "<< m_btdc2[2] <<" - "<< m_btdc2[3] <<" )\t" <<m_xCha1 );
1240  ATH_MSG_DEBUG( "BC1y : ( "<< m_btdc2[0] <<" - "<< m_btdc2[1] <<" )\t" <<m_yCha1 );
1241  ATH_MSG_DEBUG( "BC2x : ( "<< m_btdc2[6] <<" - "<< m_btdc2[7] <<" )\t" <<m_xCha2 );
1242  ATH_MSG_DEBUG( "BC2y : ( "<< m_btdc2[4] <<" - "<< m_btdc2[5] <<" )\t" <<m_yCha2 );
1243 
1244  }
1245 
1247 
1249  // Get run number and eta
1250  if ( 0==m_runNumber ){
1251  const xAOD::EventInfo* eventInfo(0);
1252  if (evtStore()->retrieve(eventInfo).isFailure()){
1253  ATH_MSG_ERROR( "No EventInfo object found! Can't read run number!" );
1254  m_runNumber = -1;
1255  } else {
1256  m_runNumber = eventInfo->runNumber();
1257  getEta();
1258  }
1259  }
1261 
1262  // Computation of X,Y imp on TileCal/LAr front
1263  float tanBx = (m_xCha1-m_xCha0) / (m_beamBC0Z - m_beamBC1Z);
1264  float tanBy = (m_yCha1-m_yCha0) / (m_beamBC0Z - m_beamBC1Z);
1265 
1266  float Ximp = m_xCha1 + m_beamBC1Z * tanBx;
1267  float Yimp = m_yCha1 + m_beamBC1Z * tanBy;
1268 
1269  if ( 0.0 != cos(m_theta) * (1 + tanBx * tan(m_theta)) ){
1270  m_xImp = (Ximp + m_radius *(tanBx * (cos(m_theta) - 1) -sin(m_theta))) / (cos(m_theta) * (1 + tanBx * tan(m_theta)));
1271  m_yImp = Yimp + tanBy * (m_radius * (1 - cos(m_theta)) -Ximp * sin(m_theta)) / (cos(m_theta) * (1+tanBx * tan(m_theta)));
1272  }
1273  }
1274  }
1275 
1276 
1277  // do not apply Cesium and Laser calibration for CIS events
1278  // m_calibrateEnergyThisEvent = m_calibrateEnergy && (m_trigType != 8);
1279 
1280  return StatusCode::SUCCESS;
1281 }
1282 
1283 
1288 
1290  , const SG::ReadHandleKey<TileRawChannelContainer>& containerKey
1291  , bool calib_mode
1292  , std::vector<std::array<float, MAX_CHAN>>* eneVec
1293  , std::vector<std::array<float, MAX_CHAN>>* timeVec
1294  , std::vector<std::array<float, MAX_CHAN>>* chi2Vec
1295  , std::vector<std::array<float, MAX_CHAN>>* pedVec
1296  , bool saveDQstatus)
1297 {
1298 
1299 
1300  if (containerKey.empty()) {// empty name, nothing to do
1301  return StatusCode::FAILURE;
1302  }
1303 
1304  bool isFELIX = containerKey.key().find("Flx") != std::string::npos;
1305  int nDrawers = isFELIX ? m_nDrawersFlx : m_nDrawers;
1306  std::map<unsigned int, unsigned int, std::less<unsigned int>>& drawerMap = (isFELIX) ? m_drawerFlxMap : m_drawerMap;
1307 
1308  // get named container
1309  const TileRawChannelContainer* rcCnt = SG::makeHandle (containerKey, ctx).get();
1310 
1311  TileRawChannelUnit::UNIT rChUnit = rcCnt->get_unit();
1312  ATH_MSG_DEBUG( "RawChannel unit is " << rChUnit );
1313 
1314 
1315  if (rChUnit >= TileRawChannelUnit::OnlineADCcounts) { // this is container with DSP results
1316  m_dspUnit = rChUnit;
1317  m_dspFlags = rcCnt->get_bsflags() >> 16;
1318  ATH_MSG_DEBUG( "DSP flag is 0x" << MSG::hex << m_dspFlags << MSG::dec << " DSP unit is " << m_dspUnit );
1319 
1321  && rChUnit != TileRawChannelUnit::ADCcounts) {
1322 
1323  ATH_MSG_ERROR( "RawChannel units are not ADC counts, can't apply DSP-like calibration" );
1324  return StatusCode::FAILURE;
1325  }
1326 
1328  if (m_useDspUnits) { // calibrate a-la online
1329  m_rchUnit = m_dspUnit;
1330  } else { // convert to final units
1332  }
1333  } else {
1334  m_rchUnit = rChUnit;
1335  }
1336 
1337  ATH_MSG_DEBUG( "Final RawChannel unit is " << m_rchUnit );
1338 
1339  // drawerIndex is 0 - m_nDrawers-1, fragType is 1-4 B+/B-/EB+/EB-
1340  int drawerIndex, fragType;
1341 
1342  // Go through all TileRawChannelCollections
1343  for (const TileRawChannelCollection* rawChannelCollection : *rcCnt) {
1344  // determine type
1345  int fragId = rawChannelCollection->identify();
1346  int drawerIdx = TileCalibUtils::getDrawerIdxFromFragId(fragId);
1347 
1348  drawerMap_iterator itr = drawerMap.find(fragId);
1349  if ( itr != drawerMap.end() ) {
1350  drawerIndex = (*itr).second;
1351  } else {
1352  drawerIndex= -1;
1353  }
1354 
1355  if (drawerIndex < 0) {
1356  if ( !rawChannelCollection->empty() )
1357  ATH_MSG_DEBUG( "frag id 0x" << MSG::hex << fragId << MSG::dec << " was not found among valid frag IDs when storing TRC!" );
1358  } else {
1359  fragType = isFELIX ? fragId >> 8 : m_drawerType[drawerIndex];
1360  ATH_MSG_DEBUG( "TRC (" << containerKey.key()
1361  << ") Event# " << m_evtNr
1362  << " Frag id 0x" << MSG::hex << fragId << MSG::dec
1363  << " index "<< drawerIndex );
1364 
1365  // go through all TileRawChannels in collection
1366  for (const TileRawChannel* rch : *rawChannelCollection) {
1367  int index = drawerIndex;
1368  HWIdentifier hwid = rch->adc_HWID();
1369 
1370  // determine channel and gain
1371  int channel = m_tileHWID->channel(hwid);
1372  int gain = m_tileHWID->adc(hwid);
1373 
1374  if (calib_mode) {
1375  // gain, if hi add m_nDrawers to index
1376  if (gain == 1) index += nDrawers;
1377  }
1378 
1380  double energy = rch->amplitude();
1381  if (m_rchUnit != rChUnit) {
1383  energy = m_tileToolEmscale->channelCalib(drawerIdx, channel, gain, energy, rChUnit, m_rchUnit);
1384  else
1385  energy = m_tileToolEmscale->channelCalibOnl(drawerIdx, channel, gain, energy, m_rchUnit);
1386  }
1387 
1388  // cabling for testbeam (convert to pmt#-1)
1389  if ((m_TBperiod < 2015 ||
1390  (m_TBperiod==2015 && fragType<3) ||
1391  ((m_TBperiod==2016 || m_TBperiod==2021) && ((fragId&0xFF)<4 && fragId != 0x201)) ||
1392  (m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1393  (m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1394  (m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1395  (m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (m_run >= 2210456 && fragId == 0x402)))))
1396  && fragType > 0 && m_pmtOrder)
1397  channel = digiChannel2PMT(fragType, channel);
1398 
1399  eneVec->at(index)[channel] = energy;
1400  timeVec->at(index)[channel] = rch->time();
1401  if (chi2Vec) {
1402  chi2Vec->at(index)[channel] = rch->quality();
1403  }
1404  if (pedVec) {
1405  pedVec->at(index)[channel] = rch->pedestal();
1406  }
1407 
1408  ATH_MSG_DEBUG( "TRC ene=" << energy
1409  << " time=" << rch->time()
1410  << " chi2=" << rch->quality()
1411  << " ped=" << rch->pedestal()
1412  << " pmt-1=" << channel
1413  << " index " << index );
1414 
1415  }
1416 
1417  if (saveDQstatus && !isFELIX) {
1418 
1419  int index1 = drawerIndex, index2 = drawerIndex + 1;
1420  if (calib_mode) index2 += m_nDrawers;
1421 
1422  for (int index = index1; index < index2; index += m_nDrawers) {
1423 
1424  m_ROD_GlobalCRCVec.at(index) = rawChannelCollection->getFragGlobalCRC() & 1;
1425  m_ROD_DMUMaskVec.at(index)[0] = rawChannelCollection->getFragRODChipMask();
1426  m_ROD_DMUMaskVec.at(index)[1] = rawChannelCollection->getFragFEChipMask();
1427 
1428  for (unsigned int dmu = 0; dmu < MAX_DMU; ++dmu) {
1429 
1430  m_ROD_DMUBCIDVec.at(index)[dmu] = (rawChannelCollection->getFragBCID() >> dmu) & 1;
1431  m_ROD_DMUmemoryErrVec.at(index)[dmu] = (rawChannelCollection->getFragMemoryPar() >> dmu) & 1;
1432  m_ROD_DMUSstrobeErrVec.at(index)[dmu] = (rawChannelCollection->getFragSstrobe() >> dmu) & 1;
1433  m_ROD_DMUDstrobeErrVec.at(index)[dmu] = (rawChannelCollection->getFragDstrobe() >> dmu) & 1;
1434  m_ROD_DMUHeadformatErrVec.at(index)[dmu] = (rawChannelCollection->getFragHeaderBit() >> dmu) & 1;
1435  m_ROD_DMUDataformatErrVec.at(index)[dmu] = (rawChannelCollection->getFragSampleBit() >> dmu) & 1;
1436  }
1437  }
1438  }
1439  }
1440  }
1441 
1442  return StatusCode::SUCCESS;
1443 }
1444 
1445 
1450 
1451 StatusCode TileTBAANtuple::storeDigits(const EventContext& ctx, const SG::ReadHandleKey<TileDigitsContainer>& containerKey, const TileDQstatus* dqStatus) {
1452 
1453  if (containerKey.empty()) { // empty name, nothing to do
1454  return StatusCode::FAILURE;
1455  }
1456 
1457  // Read Digits from TES
1458  const TileDigitsContainer* digitsCnt = SG::makeHandle (containerKey, ctx).get();
1459 
1460  bool emptyColl = true;
1461 
1462  // drawerIndex is 0 - m_nDrawers-1, fragType is 1-4 B+/B-/EB+/EB-
1463  int drawerIndex, fragType, channel;
1464 
1465  std::vector<float> sampleVec;
1466  std::vector<uint32_t> headerVec;
1467  std::vector<uint32_t> headerVecHi;
1468  uint32_t CRCmask;
1469  uint32_t fe_crc;
1470  uint32_t rod_crc;
1471 
1472  // Go through all TileDigitsCollections
1473  for (const TileDigitsCollection* digitsCollection : * digitsCnt) {
1474  // determine type of frag
1475  int fragId = digitsCollection->identify();
1476  int ros = (fragId >> 8);
1477  int drawer = fragId & 0x3F;
1478 
1479  drawerMap_iterator itr = m_drawerMap.find(fragId);
1480  if ( itr != m_drawerMap.end() ) {
1481  drawerIndex = (*itr).second;
1482  } else {
1483  drawerIndex= -1;
1484  }
1485 
1486  if (drawerIndex < 0) {
1487  if ( !digitsCollection->empty() )
1488  ATH_MSG_DEBUG( "frag id 0x" << MSG::hex << fragId << MSG::dec <<" was not found among valid frag IDs when storing TRC!" );
1489 
1490  } else {
1491  fragType = m_drawerType[drawerIndex];
1492 
1493  ATH_MSG_DEBUG( "Event# " << m_evtNr
1494  << " Frag id 0x" << MSG::hex << fragId << MSG::dec
1495  << " index " << drawerIndex
1496  << " Calib " << m_calibMode );
1497 
1498  ATH_MSG_DEBUG( " Size=" << digitsCollection->getFragSize()
1499  << " BCID=" << digitsCollection->getFragBCID()<<MSG::hex
1500  << " CRC=0x" << (digitsCollection->getFragCRC()&0xffff)
1501  << " DMUMask=0x" << (digitsCollection->getFragDMUMask()&0xffff)<<MSG::dec );
1502 
1503  ATH_MSG_DEBUG( " Lvl1ID=" << digitsCollection->getLvl1Id()
1504  << " Lvl1Type=" << digitsCollection->getLvl1Type()
1505  << " EvBCID=" << digitsCollection->getRODBCID()
1506  << " EvType=" << digitsCollection->getDetEvType() );
1507 
1508  ATH_MSG_DEBUG( " Header=" << digitsCollection->getFragChipHeaderWords() );
1509 
1510  if (m_completeNtuple) {
1515  m_l1ID.at(drawerIndex) = digitsCollection->getLvl1Id();
1516  m_l1Type.at(drawerIndex) = digitsCollection->getLvl1Type();
1517  m_evType.at(drawerIndex) = digitsCollection->getDetEvType();
1518  m_evBCID.at(drawerIndex) = digitsCollection->getRODBCID();
1519  // store FrBCID
1520  m_frBCID.at(drawerIndex) = digitsCollection->getFragBCID();
1521  }
1522 
1523  if(m_calibMode) {
1524  // Digits in calib mode
1525  // check gain for first digits in collection
1526 
1527  int dcnt=0;
1528  int drawerIndexHi = drawerIndex + m_nDrawers;
1529  // non empty collection
1530  if (!digitsCollection->empty()) {
1531  // store evtnr, bcid,crc, size
1532  // Same for lo and hi, because they come from the same fragment
1533  m_rodBCIDVec.at(drawerIndex) = digitsCollection->getRODBCID();
1534  m_sizeVec.at(drawerIndex) = digitsCollection->getFragSize();
1535  m_sizeVec.at(drawerIndexHi) = digitsCollection->getFragSize();
1536  m_evtVec.at(drawerIndex) = m_evtNr;
1537  m_evtVec.at(drawerIndexHi) = m_evtNr;
1538 
1539  headerVec = digitsCollection->getFragChipHeaderWords();
1540  headerVecHi = digitsCollection->getFragChipHeaderWordsHigh();
1541  CRCmask = digitsCollection->getFragDMUMask(); //mask of FE+ROD DMU crc check (16bit+16bit) 0xffffffff == All ok
1542  fe_crc = CRCmask & 0xFFFF;
1543  rod_crc = CRCmask >> 16;
1544 
1545  unsigned int headsize = std::min(16U, static_cast<unsigned int>(headerVec.size()));
1546  unsigned int headsizehi = std::min(16U, static_cast<unsigned int>(headerVecHi.size()));
1547 
1548  for (unsigned int ih = 0; ih < headsize; ++ih) {
1549 
1550  m_bcidVec.at(drawerIndex)[ih] = (headerVec[ih] & 0xFFF);
1551  m_DMUheaderVec.at(drawerIndex)[ih] = headerVec[ih];
1552  m_DMUformatErrVec.at(drawerIndex)[ih] = CheckDMUFormat(headerVec[ih]);
1553  m_DMUparityErrVec.at(drawerIndex)[ih] = CheckDMUParity(headerVec[ih]);
1554  m_DMUmemoryErrVec.at(drawerIndex)[ih] = (headerVec[ih] >> 25 & 0x1);
1555  m_DMUSstrobeErrVec.at(drawerIndex)[ih] = (headerVec[ih] >> 24 & 0x1);
1556  m_DMUDstrobeErrVec.at(drawerIndex)[ih] = (headerVec[ih] >> 23 & 0x1);
1557  m_feCRCVec.at(drawerIndex)[ih] = (fe_crc >> ih & 0x1);
1558  m_rodCRCVec.at(drawerIndex)[ih] = (rod_crc >> ih & 0x1);
1559 
1560  if (dqStatus) {
1561  m_DMUHeadparityErrVec.at(drawerIndex)[ih] = dqStatus->checkHeaderParityErr(ros, drawer, ih, 0);
1562  m_DMUDataparityErrVec.at(drawerIndex)[ih] = dqStatus->checkSampleParityErr(ros, drawer, ih, 0);
1563  }
1564  }
1565 
1566  for (unsigned int ihhi = 0; ihhi < headsizehi; ++ihhi) {
1567  m_bcidVec.at(drawerIndexHi)[ihhi] = (headerVecHi[ihhi] & 0xFFF);
1568  m_DMUheaderVec.at(drawerIndexHi)[ihhi] = headerVecHi[ihhi];
1569  m_DMUformatErrVec.at(drawerIndexHi)[ihhi] = CheckDMUFormat(headerVecHi[ihhi]);
1570  m_DMUparityErrVec.at(drawerIndexHi)[ihhi] = CheckDMUParity(headerVecHi[ihhi]);
1571  m_DMUmemoryErrVec.at(drawerIndexHi)[ihhi] = (headerVecHi[ihhi] >> 25 & 0x1);
1572  m_DMUSstrobeErrVec.at(drawerIndexHi)[ihhi] = (headerVecHi[ihhi] >> 24 & 0x1);
1573  m_DMUDstrobeErrVec.at(drawerIndexHi)[ihhi] = (headerVecHi[ihhi] >> 23 & 0x1);
1574  m_feCRCVec.at(drawerIndex)[ihhi] = -1; //Variables must be filled anyway, empty variables are not allowed
1575  m_rodCRCVec.at(drawerIndex)[ihhi] = -1; //Variables must be filled anyway, empty variables are not allowed
1576 
1577  if (dqStatus) {
1578  m_DMUHeadparityErrVec.at(drawerIndex)[ihhi] = dqStatus->checkHeaderParityErr(ros, drawer, ihhi, 1);
1579  m_DMUDataparityErrVec.at(drawerIndex)[ihhi] = dqStatus->checkSampleParityErr(ros, drawer, ihhi, 1);
1580  }
1581  }
1582 
1583  m_slinkCRCVec.at(drawerIndex)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1584  m_dmuMaskVec.at(drawerIndex)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1585  m_slinkCRCVec.at(drawerIndex)[1] = digitsCollection->getFragCRC() & 0xffff;
1586  m_dmuMaskVec.at(drawerIndex)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1587 
1588  m_slinkCRCVec.at(drawerIndexHi)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1589  m_dmuMaskVec.at(drawerIndexHi)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1590  m_slinkCRCVec.at(drawerIndexHi)[1] = digitsCollection->getFragCRC() & 0xffff;
1591  m_dmuMaskVec.at(drawerIndexHi)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1592 
1593  // go through all TileDigits in collection
1594  for (const TileDigits* tile_digits : *digitsCollection) {
1595 
1596  emptyColl = false;
1597 
1598  HWIdentifier hwid = tile_digits->adc_HWID();
1599  // determine gain
1600  int gain = m_tileHWID->adc(hwid);
1601  // add m_nDrawers to index if hi gain
1602  int index = (gain == 1) ? drawerIndexHi : drawerIndex;
1603  int nSamplesInDrawer = m_nSamplesInDrawer[index];
1604 
1605  // determine channel
1606  channel = m_tileHWID->channel(hwid);
1607  // cabling for testbeam (convert to pmt#-1)
1608 
1609  if ((m_TBperiod < 2015 ||
1610  (m_TBperiod==2015 && fragType<3) ||
1611  ((m_TBperiod==2016 || m_TBperiod==2021) && ((fragId&0xFF)<4 && fragId != 0x201)) ||
1612  (m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1613  (m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1614  (m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1615  (m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (m_run >= 2210456 && fragId == 0x402)))))
1616  && fragType > 0 && m_pmtOrder)
1617 
1618  channel = digiChannel2PMT(fragType, channel);
1619 
1620 
1621  // gain determined for all digits in collection
1622  m_gainVec.at(index)[channel] = gain;
1623  ATH_MSG_DEBUG( "Storing TD for channel: " << channel
1624  << " with gain " << m_tileHWID->adc(hwid)
1625  << " index " << index );
1626 
1627  // get digits
1628  sampleVec = tile_digits->samples();
1629  int siz = sampleVec.size();
1630 
1631  if (msgLvl(MSG::DEBUG)) {
1632  msg(MSG::DEBUG) << "Digits(" << siz << ")." << (dcnt++) << " {";
1633  for (int i = 0; i < siz; i++) {
1634  msg(MSG::DEBUG) << static_cast<int>(sampleVec[i]) << " ";
1635  }
1636 
1637  if (siz > nSamplesInDrawer) {
1638  msg(MSG::DEBUG) << "} ONLY " << nSamplesInDrawer << " digits saved to ntuple" << endmsg;
1639  } else {
1640  msg(MSG::DEBUG) << "}" << endmsg;
1641  }
1642  }
1643 
1644  if (siz > nSamplesInDrawer) siz = nSamplesInDrawer;
1645  std::transform(sampleVec.begin(), sampleVec.begin() + siz, &m_sampleVec.at(index).get()[0] + nSamplesInDrawer * channel, [] (float v) {return static_cast<int>(v);});
1646  }
1647  }
1648  } else {
1649  // Digits in normal mode
1650  // store evtnr, bcid,crc, size
1651  m_rodBCIDVec.at(drawerIndex) = digitsCollection->getRODBCID();
1652  m_sizeVec.at(drawerIndex) = digitsCollection->getFragSize();
1653  m_evtVec.at(drawerIndex) = m_evtNr;
1654 
1655  headerVec = digitsCollection->getFragChipHeaderWords();
1656  CRCmask = digitsCollection->getFragDMUMask(); //mask of FE+ROD DMU crc check (16bit+16bit) 0xffffffff == All ok
1657  fe_crc = CRCmask & 0xFFFF;
1658  rod_crc = CRCmask >> 16;
1659 
1660  int headsize = headerVec.size();
1661 
1662  for (int ih = 0; ih < headsize; ++ih) {
1663  m_bcidVec.at(drawerIndex)[ih] = (headerVec[ih] & 0xFFF);
1664  m_DMUheaderVec.at(drawerIndex)[ih] = headerVec[ih];
1665  m_DMUformatErrVec.at(drawerIndex)[ih] = CheckDMUFormat(headerVec[ih]);
1666  m_DMUparityErrVec.at(drawerIndex)[ih] = CheckDMUParity(headerVec[ih]);
1667  m_DMUmemoryErrVec.at(drawerIndex)[ih] = (headerVec[ih] >> 25 & 0x1);
1668  m_DMUSstrobeErrVec.at(drawerIndex)[ih] = (headerVec[ih] >> 24 & 0x1);
1669  m_DMUDstrobeErrVec.at(drawerIndex)[ih] = (headerVec[ih] >> 23 & 0x1);
1670  m_feCRCVec.at(drawerIndex)[ih] = (fe_crc >> ih & 0x1);
1671  m_rodCRCVec.at(drawerIndex)[ih] = (rod_crc >> ih & 0x1);
1672 
1673  if (dqStatus) {
1674  m_DMUHeadparityErrVec.at(drawerIndex)[ih] = dqStatus->checkHeaderParityErr(ros, drawer, ih, 0);
1675  m_DMUDataparityErrVec.at(drawerIndex)[ih] = dqStatus->checkSampleParityErr(ros, drawer, ih, 0);
1676  }
1677  }
1678 
1679  m_slinkCRCVec.at(drawerIndex)[0] = (digitsCollection->getFragCRC() >> 16) & 0xffff;
1680  m_dmuMaskVec.at(drawerIndex)[0] = (digitsCollection->getFragDMUMask() >> 16) & 0xffff;
1681  m_slinkCRCVec.at(drawerIndex)[1] = digitsCollection->getFragCRC() & 0xffff;
1682  m_dmuMaskVec.at(drawerIndex)[1] = digitsCollection->getFragDMUMask() & 0xffff;
1683 
1684  int nSamplesInDrawer = m_nSamplesInDrawer[drawerIndex];
1685 
1686  int dcnt = 0;
1687  // go through all TileDigits in collection
1688  for (const TileDigits* tile_digits : *digitsCollection) {
1689  emptyColl = false;
1690 
1691  HWIdentifier hwid = tile_digits->adc_HWID();
1692  // determine channel
1693  channel = m_tileHWID->channel(hwid);
1694  // cabling for testbeam
1695  if ((m_TBperiod < 2015 ||
1696  (m_TBperiod==2015 && fragType<3) ||
1697  ((m_TBperiod==2016 || m_TBperiod==2021) && ((fragId&0xFF)<4 && fragId != 0x201)) ||
1698  (m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
1699  (m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
1700  (m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
1701  (m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (m_run >= 2210456 && fragId == 0x402)))))
1702  && fragType > 0 && m_pmtOrder)
1703  channel = digiChannel2PMT(fragType, channel);
1704 
1705  // gain
1706  m_gainVec.at(drawerIndex)[channel] = m_tileHWID->adc(hwid);
1707  ATH_MSG_DEBUG( "Storing TD for channel: " << channel
1708  << " with gain " << m_tileHWID->adc(hwid) );
1709 
1710  // get digits
1711  sampleVec = tile_digits->samples();
1712  int siz = sampleVec.size();
1713  if (msgLvl(MSG::DEBUG)) {
1714  msg(MSG::DEBUG) << "Digits(" << siz << ")." << (dcnt++) << " {";
1715 
1716  for (int i = 0; i < siz; i++) {
1717  msg(MSG::DEBUG) << static_cast<int>(sampleVec[i]) << " ";
1718  }
1719 
1720  if (siz > nSamplesInDrawer) {
1721  msg(MSG::DEBUG) << "} ONLY " << nSamplesInDrawer << " digits saved to ntuple" << endmsg;
1722  } else {
1723  msg(MSG::DEBUG) << "}" << endmsg;
1724  }
1725  }
1726 
1727  if (siz > nSamplesInDrawer) siz = nSamplesInDrawer;
1728  std::transform(sampleVec.begin(), sampleVec.begin() + siz, &m_sampleVec.at(drawerIndex).get()[0] + nSamplesInDrawer * channel, [] (float v) {return static_cast<int>(v);});
1729  }
1730  }
1731  }
1732  // next container
1733  }
1734 
1735  if (emptyColl)
1736  return StatusCode::FAILURE;
1737  else
1738  return StatusCode::SUCCESS;
1739 }
1740 
1741 
1743 
1744  if (containerKey.empty()) { // empty name, nothing to do
1745  return StatusCode::FAILURE;
1746  }
1747 
1748  // Read Digits from TES
1749  const TileDigitsContainer* digitsCntFlx = SG::makeHandle (containerKey, ctx).get();
1750 
1751  bool emptyColl = true;
1752 
1753  // drawerIndex is 0 - m_nDrawersFlx-1, fragType is 1-4 B+/B-/EB+/EB-
1754  int drawerIndex, channel;
1755 
1756  std::vector<float> sampleVecLo;
1757  std::vector<float> sampleVecHi;
1758  // Go through all TileDigitsCollections
1759  for (const TileDigitsCollection* digitsCollection : *digitsCntFlx) {
1760  // determine type of frag
1761  int fragId = digitsCollection->identify();
1762  drawerMap_iterator itr = m_drawerFlxMap.find(fragId);
1763  if ( itr != m_drawerFlxMap.end() ) {
1764  drawerIndex = (*itr).second;
1765  } else {
1766  drawerIndex = -1;
1767  }
1768 
1769  if (drawerIndex < 0) {
1770  if ( !digitsCollection->empty() )
1771  ATH_MSG_DEBUG( "FELIX frag id 0x" << MSG::hex << fragId << MSG::dec <<" was not found among valid frag IDs when storing TRC!" );
1772 
1773  } else {
1774 
1775  ATH_MSG_DEBUG( "Event# " << m_evtNr
1776  << " FELIX Frag id 0x" << MSG::hex << fragId << MSG::dec
1777  << " index " << drawerIndex);
1778 
1779  ATH_MSG_DEBUG( " Size=" << digitsCollection->getFragSize());
1780 
1781  ATH_MSG_DEBUG( " Lvl1ID=" << digitsCollection->getLvl1Id()
1782  << " EvBCID=" << digitsCollection->getRODBCID()
1783  << " EvType=" << digitsCollection->getDetEvType() );
1784  ATH_MSG_DEBUG( " Headers = "<< digitsCollection->getFragExtraWords() );
1785 
1786  if (m_completeNtuple) {
1791  int index = drawerIndex + m_nDrawers;
1792  m_l1ID.at(index) = digitsCollection->getLvl1Id();
1793  m_l1Type.at(index) = digitsCollection->getLvl1Type();
1794  m_evType.at(index) = digitsCollection->getDetEvType();
1795  m_evBCID.at(index) = digitsCollection->getRODBCID();
1796  // store FrBCID
1797  m_frBCID.at(index) = digitsCollection->getFragBCID();
1798  }
1799 
1800  // Digits in calib mode
1801  // check gain for first digits in collection
1802 
1803 
1804  std::vector<uint32_t> extraWords = digitsCollection->getFragExtraWords();
1805  if (extraWords.size() >= 10 * MAX_MINIDRAWER) {
1806 
1807  std::reference_wrapper<std::array<int,MAX_MINIDRAWER>>
1808  md[] = {m_mdL1idflxVec.at(drawerIndex), m_mdBcidflxVec.at(drawerIndex),
1809  m_mdModuleflxVec.at(drawerIndex), m_mdRunTypeflxVec.at(drawerIndex),
1810  m_mdRunflxVec.at(drawerIndex), m_mdPedLoflxVec.at(drawerIndex),
1811  m_mdPedHiflxVec.at(drawerIndex), m_mdChargeflxVec.at(drawerIndex),
1812  m_mdChargeTimeflxVec.at(drawerIndex), m_mdCapacitorflxVec.at(drawerIndex)};
1813 
1814  auto it = extraWords.begin();
1815  for (int i = 0; i < 10; ++i) {
1816  std::copy(it + i * MAX_MINIDRAWER, it + (i + 1) * MAX_MINIDRAWER, &md[i].get()[0]);
1817  }
1818 
1819  }
1820 
1821  int dcnt=0;
1822  // non empty collection
1823  if(!digitsCollection->empty()) {
1824  int drawerIndexHi = drawerIndex + m_nDrawersFlx;
1825  // store evtnr, bcid,crc, size
1826  if (m_bsInput) {
1827  m_rodBCIDflxVec.at(drawerIndex) = digitsCollection->getRODBCID();
1828  m_sizeflxVec.at(drawerIndex) = digitsCollection->getFragSize();
1829  m_evtflxVec.at(drawerIndex) = m_evtNr;
1830  }
1831 
1832  // go through all TileDigits in collection
1833  for (const TileDigits* tile_digits : *digitsCollection) {
1834  emptyColl = false;
1835  HWIdentifier hwid = tile_digits->adc_HWID();
1836  // determine gain
1837  int gain = m_tileHWID->adc(hwid);
1838  // add m_nDrawersFlx to index if hi gain
1839  int index = (gain == 1) ? drawerIndexHi : drawerIndex;
1840 
1841  // determine channel
1842  channel = m_tileHWID->channel(hwid);
1843  // cabling for testbeam (convert to pmt#-1)
1844 
1845  // gain determined for all digits in collection
1846  m_gainflxVec.at(index)[channel] = gain;
1847  ATH_MSG_DEBUG( "Storing TD for channel: " << channel
1848  << " with gain " << m_tileHWID->adc(hwid)
1849  << " index " << index );
1850 
1851  // get digits
1852  if (gain == 0) {
1853  sampleVecLo = tile_digits->samples();
1854  } else if (gain == 1) {
1855  sampleVecHi = tile_digits->samples();
1856  }
1857 
1858  int sizLo = sampleVecLo.size();
1859  int sizHi = sampleVecHi.size();
1860 
1861  int nSamplesInDrawer = m_nSamplesFlxInDrawer[index];
1862 
1863  if (msgLvl(MSG::DEBUG)) {
1864  if (sizLo > 0 ){
1865  msg(MSG::DEBUG) << "Low gain Digits(" << sizLo << ")." << (dcnt++) << " {";
1866  for (int i = 0; i < sizLo; i++) {
1867  msg(MSG::DEBUG) << static_cast<int>(sampleVecLo[i]) << " ";
1868  }
1869 
1870  if (sizLo > nSamplesInDrawer) {
1871  msg(MSG::DEBUG) << "} ONLY " << nSamplesInDrawer << " digits saved to ntuple" << endmsg;
1872  } else {
1873  msg(MSG::DEBUG) << "}" << endmsg;
1874  }
1875  }
1876 
1877  if (sizHi > 0 ){
1878  msg(MSG::DEBUG) << "High gain Digits(" << sizHi << ")." << (dcnt++) << " {";
1879  for (int i = 0; i < sizHi; i++) {
1880  msg(MSG::DEBUG) << static_cast<int>(sampleVecHi[i]) << " ";
1881  }
1882 
1883  if (sizHi > nSamplesInDrawer) {
1884  msg(MSG::DEBUG) << "} ONLY " << nSamplesInDrawer << " digits saved to ntuple" << endmsg;
1885  } else {
1886  msg(MSG::DEBUG) << "}" << endmsg;
1887  }
1888  }
1889 
1890 
1891  }
1892  if (sizLo > nSamplesInDrawer) sizLo = nSamplesInDrawer;
1893  if (sizHi > nSamplesInDrawer) sizHi = nSamplesInDrawer;
1894  std::transform(sampleVecLo.begin(), sampleVecLo.begin() + sizLo, &m_sampleflxVec.at(index).get()[0] + nSamplesInDrawer * channel, [] (float v) {return static_cast<int>(v);});
1895  std::transform(sampleVecHi.begin(), sampleVecHi.begin() + sizHi, &m_sampleflxVec.at(index).get()[0] + nSamplesInDrawer * channel, [] (float v) {return static_cast<int>(v);});
1896  sampleVecLo.clear();
1897  sampleVecHi.clear();
1898  }
1899  }
1900  }
1901  // next container
1902  }
1903 
1904  if (emptyColl)
1905  return StatusCode::FAILURE;
1906  else
1907  return StatusCode::SUCCESS;
1908 }
1909 
1910 
1911 /*
1914  */
1915 StatusCode TileTBAANtuple::storeHitVector(const EventContext& ctx) {
1916 
1917  if (m_hitVectorKey.empty()) { // empty name, nothing to do
1918  return StatusCode::FAILURE;
1919  }
1920 
1921  // Read Hit Vector from TDS
1922  const TileHitVector* hitVec = SG::makeHandle (m_hitVectorKey, ctx).get();
1923 
1924  ATH_MSG_DEBUG( "Event# " << m_evtNr << " reading Hit Vector");
1925 
1927  ATH_CHECK( samplingFraction.isValid() );
1928 
1929  // Go through all TileHit
1930  for (const TileHit& cinp : *hitVec) {
1931 
1932  // get hits
1933  HWIdentifier hwid = cinp.pmt_HWID();
1934 
1935  // determine type of frag
1936  int fragId = m_tileHWID->frag(hwid);
1937  drawerMap_iterator itr = m_drawerMap.find(fragId);
1938  int drawerIndex = ( itr != m_drawerMap.end() ) ? (*itr).second : -1;
1939 
1940  if (drawerIndex < 0) {
1941  ATH_MSG_WARNING( "frag id 0x" << MSG::hex << fragId << MSG::dec <<" was not found among valid frag IDs when storing HITS!" );
1942 
1943  } else {
1944  int fragType = m_drawerType[drawerIndex];
1945  storeHit(&cinp,fragType,fragId,m_ehitVec.at(drawerIndex),m_thitVec.at(drawerIndex), *samplingFraction);
1946  }
1947  }
1948 
1949  if (hitVec->empty())
1950  return StatusCode::FAILURE;
1951  else
1952  return StatusCode::SUCCESS;
1953 }
1954 
1955 
1959 
1961 
1962  if (m_hitContainerKey.empty()) { // empty name, nothing to do
1963  return StatusCode::FAILURE;
1964  }
1965 
1966  // Read Hit Vector from TDS
1967  const TileHitContainer* hitCnt = SG::makeHandle (m_hitContainerKey, ctx).get();
1968 
1970  ATH_CHECK( samplingFraction.isValid() );
1971 
1972  bool emptyColl = true;
1973 
1974  // Go through all TileHitCollections
1975  for (const TileHitCollection* hitCollection : *hitCnt) {
1976 
1977  // determine type of frag
1978  int fragId = hitCollection->identify();
1979  drawerMap_iterator itr = m_drawerMap.find(fragId);
1980  int drawerIndex = ( itr != m_drawerMap.end() ) ? (*itr).second : -1;
1981 
1982  if (drawerIndex < 0) {
1983  if ( !hitCollection->empty() )
1984  ATH_MSG_WARNING( "frag id 0x" << MSG::hex << fragId << MSG::dec <<" was not found among valid frag IDs when storing HITS!" );
1985 
1986  } else {
1987  int fragType = m_drawerType[drawerIndex];
1988 
1989  ATH_MSG_DEBUG( "Event# " << m_evtNr
1990  << " Frag id 0x" << MSG::hex << fragId << MSG::dec
1991  << " index " << drawerIndex );
1992 
1993  if (emptyColl) emptyColl = hitCollection->empty();
1994  // go through all TileHit in collection
1995  for (const TileHit* cinp : *hitCollection) {
1996  storeHit(cinp,fragType,fragId,m_ehitCnt.at(drawerIndex),m_thitCnt.at(drawerIndex),*samplingFraction);
1997  }
1998  }
1999  }
2000 
2001  if (emptyColl)
2002  return StatusCode::FAILURE;
2003  else
2004  return StatusCode::SUCCESS;
2005 }
2006 
2007 void TileTBAANtuple::storeHit(const TileHit *cinp, int fragType, int fragId,
2008  std::array<float, MAX_CHAN>& ehitVec,
2009  std::array<float, MAX_CHAN>& thitVec,
2010  const TileSamplingFraction* samplingFraction) {
2011 
2012  // determine channel
2013  HWIdentifier hwid = cinp->pmt_HWID();
2014  int channel = m_tileHWID->channel(hwid);
2015 
2016  int size = cinp->size();
2017  if (msgLvl(MSG::VERBOSE)) {
2018  msg(MSG::VERBOSE) << "hit hwid="
2019  << m_tileHWID->to_string(hwid, -1) << " ener=";
2020 
2021  for (int i = 0; i < size; ++i)
2022  msg(MSG::VERBOSE) << cinp->energy(i) << " ";
2023 
2024  msg(MSG::VERBOSE) << "time=";
2025  for (int i = 0; i < size; ++i)
2026  msg(MSG::VERBOSE) << cinp->time(i) << " ";
2027 
2028  msg(MSG::VERBOSE) << endmsg;
2029  }
2030 
2031  double ehit=0.0, thit=0.0;
2032  for(int i=0;i<size;++i) {
2033 
2034  double e = cinp->energy(i);
2035  double t = cinp->time(i);
2036 
2037  if (-75.<t && t<75.) {
2038  ehit += e;
2039  thit += e*t;
2040  }
2041  }
2042 
2043  if (ehit!=0) {
2044  thit /= ehit;
2045  // conversion factor from hit energy to final energy units
2046  int drawerIdx = TileCalibUtils::getDrawerIdxFromFragId(fragId);
2047  ehit *= samplingFraction->getSamplingFraction(drawerIdx, channel);
2049  ehit /= m_tileToolEmscale->channelCalib(drawerIdx, channel, TileID::HIGHGAIN, 1.,
2051  }
2052  } else {
2053  thit=0.0;
2054  }
2055 
2056  // cabling for testbeam
2057  if ((m_TBperiod < 2015 ||
2058  (m_TBperiod==2015 && fragType<3) ||
2059  ((m_TBperiod==2016 || m_TBperiod==2021) && ((fragId&0xFF)<4 && fragId != 0x201)) ||
2060  (m_TBperiod==2017 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x203))) ||
2061  (m_TBperiod==2018 && ((fragId&0xFF)<4 && !(fragId == 0x201 || fragId == 0x402))) ||
2062  (m_TBperiod==2019 && ((fragId&0xFF)<5 && !(fragId == 0x201 || fragId == 0x203 || fragId >= 0x402))) ||
2063  (m_TBperiod==2022 && ((fragId&0xFF)<4 && !(fragId == 0x201 || (m_run >= 2210456 && fragId == 0x402)))))
2064  && fragType > 0 && m_pmtOrder)
2065  channel = digiChannel2PMT(fragType, channel);
2066 
2067  ehitVec[channel] = ehit;
2068  thitVec[channel] = thit;
2069 
2070  ATH_MSG_DEBUG( "HIT ene=" << ehit
2071  << " time=" << thit
2072  << " pmt-1=" << channel
2073  << " index " << m_drawerMap.find(fragId)->second );
2074 
2075 }
2077 
2079 
2081  MUON_clearBranch();
2082  }
2083 
2084  if (m_beamIdList[ECAL_ADC_FRAG]) {
2085  ECAL_clearBranch();
2086  if (m_TBperiod > 2015) QDC_clearBranch();
2087  }
2088 
2090 
2091  if (m_unpackAdder) {
2092  if (m_beamIdList[ADD_FADC_FRAG]) {
2094  }
2095  }
2096 
2097  if (m_beamIdList[DIGI_PAR_FRAG & 0x1F]) {
2099  }
2100 
2101  if (((m_TBperiod >= 2015 || m_unpackAdder) && m_beamIdList[BEAM_ADC_FRAG])
2103  || (m_TBperiod >= 2022 && m_beamIdList[COMMON_TOF_FRAG])) {
2104  BEAM_clearBranch();
2105  ATH_MSG_VERBOSE( "clear branch");
2106  }
2107 
2108  if (m_completeNtuple && m_TBperiod < 2015) {
2110  }
2111 
2113 
2114  DIGI_clearBranch(); // working now
2115  if (m_saveFelixData) {
2117  }
2118 
2119  HIT_clearBranch();
2120  ATH_MSG_DEBUG( "clear() successfully" );
2121 
2122  return StatusCode::SUCCESS;
2123 }
2124 
2125 
2127  MsgStream log(msgSvc(), name());
2128 
2129  m_evtVec.clear();
2130  m_bcidVec.clear();
2131  m_DMUheaderVec.clear();
2132  m_DMUformatErrVec.clear();
2133  m_DMUparityErrVec.clear();
2134  m_DMUmemoryErrVec.clear();
2135  m_DMUDstrobeErrVec.clear();
2136  m_DMUSstrobeErrVec.clear();
2137  m_DMUHeadparityErrVec.clear();
2138  m_DMUDataparityErrVec.clear();
2139  m_rodBCIDVec.clear();
2140  m_sizeVec.clear();
2141  m_dmuMaskVec.clear();
2142  m_slinkCRCVec.clear();
2143  m_gainVec.clear();
2144  m_sampleVec.clear();
2145  m_feCRCVec.clear();
2146  m_rodCRCVec.clear();
2147 
2148  m_evtflxVec.clear();
2149  m_rodBCIDflxVec.clear();
2150  m_sizeflxVec.clear();
2151  m_gainflxVec.clear();
2152  m_sampleflxVec.clear();
2153 
2154  m_eneVec.clear();
2155  m_timeVec.clear();
2156  m_pedFlatVec.clear();
2157  m_chi2FlatVec.clear();
2158 
2159  m_efitVec.clear();
2160  m_tfitVec.clear();
2161  m_pedfitVec.clear();
2162  m_chi2Vec.clear();
2163 
2164  m_efitcVec.clear();
2165  m_tfitcVec.clear();
2166  m_pedfitcVec.clear();
2167  m_chi2cVec.clear();
2168 
2169  m_eOptVec.clear();
2170  m_tOptVec.clear();
2171  m_pedOptVec.clear();
2172  m_chi2OptVec.clear();
2173 
2174  m_eflxfitVec.clear();
2175  m_tflxfitVec.clear();
2176  m_pedflxfitVec.clear();
2177  m_chi2flxfitVec.clear();
2178 
2179  m_eflxoptVec.clear();
2180  m_tflxoptVec.clear();
2181  m_pedflxoptVec.clear();
2182  m_chi2flxoptVec.clear();
2183 
2184  m_eDspVec.clear();
2185  m_tDspVec.clear();
2186  m_chi2DspVec.clear();
2187 
2188  m_ROD_GlobalCRCVec.clear();
2189  m_ROD_DMUBCIDVec.clear();
2190  m_ROD_DMUmemoryErrVec.clear();
2191  m_ROD_DMUSstrobeErrVec.clear();
2192  m_ROD_DMUDstrobeErrVec.clear();
2193  m_ROD_DMUHeadformatErrVec.clear();
2194  m_ROD_DMUDataformatErrVec.clear();
2195  m_ROD_DMUMaskVec.clear();
2196 
2197  //Ntuple creation
2198 
2199  auto tree = std::make_unique<TTree>(m_ntupleID.value().c_str(), "TileBEAM-Ntuple");
2200  tree->SetMaxTreeSize(m_treeSize);
2201  m_ntuplePtr = tree.get();
2202  if (m_thistSvc->regTree("/" + m_streamName + "/" + m_ntupleID, std::move(tree)).isFailure()) {
2203  ATH_MSG_ERROR( "Problem registering TileRec Tree" );
2204  m_ntupleCreated = false;
2205  } else {
2206  m_ntupleCreated = true;
2207  }
2208 
2210  MUON_addBranch();
2211 
2212  if (m_TBperiod < 2015) {
2213  ECAL_addBranch();
2214  LASER_addBranch();
2215  ADDER_addBranch();
2218  }
2219 
2220  if (m_TBperiod > 2015) {
2221  QDC_addBranch();
2222  }
2223 
2224  CISPAR_addBranch();
2225  BEAM_addBranch();
2226  DIGI_addBranch(); //working now
2227  if (m_saveFelixData) {
2228  FELIX_addBranch();
2229  }
2230 
2231  HIT_addBranch();
2232 
2233  return StatusCode::SUCCESS;
2234 }
2235 
2236 StatusCode TileTBAANtuple::storeCells(const EventContext& ctx) {
2237 
2238  if (m_cellContainerKey.empty()) { // empty name, nothing to do
2239  return StatusCode::FAILURE;
2240  }
2241 
2242  //Retrieve Cell collection from SG
2243  const CaloCellContainer* cellContainer = SG::makeHandle (m_cellContainerKey, ctx).get();
2244 
2245  //Loop over all cells in container. Sum up the Energy and fill 2DHistograms
2246  ATH_MSG_DEBUG( "succeeded retrieving cellContainer from SG" );
2247 
2248  ATH_MSG_DEBUG( "TileTBAANtuple : about to iterate over CaloCells" );
2249 
2250  m_LarEne[0] = m_LarEne[1] = m_LarEne[2] = m_LarEne[3] = 0.0;
2251  m_BarEne[0] = m_BarEne[1] = m_BarEne[2] = 0.0;
2252  m_ExtEne[0] = m_ExtEne[1] = m_ExtEne[2] = 0.0;
2253  m_GapEne[0] = m_GapEne[1] = m_GapEne[2] = 0.0;
2254 
2255  for (const CaloCell* cell : *cellContainer) {
2256  //Decode cell information
2257  const double energy = cell->energy();
2258  const CaloDetDescrElement* caloDDE = cell->caloDDE(); //pointer to the DetectorDescriptionElement
2259  const CaloCell_ID::CaloSample sampl = caloDDE->getSampling(); //To which sampling belongs this cell?
2260 
2261  if (sampl == CaloCell_ID::PreSamplerB) {
2262  m_LarEne[0] += energy;
2263  } else if (sampl == CaloCell_ID::EMB1) {
2264  m_LarEne[1] += energy;
2265  } else if (sampl == CaloCell_ID::EMB2) {
2266  m_LarEne[2] += energy;
2267  } else if (sampl == CaloCell_ID::EMB3) {
2268  m_LarEne[3] += energy;
2269  } else if (sampl == CaloCell_ID::TileBar0) {
2270  m_BarEne[0] += energy;
2271  } else if (sampl == CaloCell_ID::TileBar1) {
2272  m_BarEne[1] += energy;
2273  } else if (sampl == CaloCell_ID::TileBar2) {
2274  m_BarEne[2] += energy;
2275  } else if (sampl == CaloCell_ID::TileExt0) {
2276  m_ExtEne[0] += energy;
2277  } else if (sampl == CaloCell_ID::TileExt1) {
2278  m_ExtEne[1] += energy;
2279  } else if (sampl == CaloCell_ID::TileExt2) {
2280  m_ExtEne[2] += energy;
2281  } else if (sampl == CaloCell_ID::TileGap1) {
2282  m_GapEne[1] += energy;
2283  } else if (sampl == CaloCell_ID::TileGap2) {
2284  m_GapEne[2] += energy;
2285  } else if (sampl == CaloCell_ID::TileGap3) {
2286  m_GapEne[0] += energy;
2287  }
2288  }
2289 
2290  return StatusCode::SUCCESS;
2291 }
2292 
2293 
2294 
2295 StatusCode TileTBAANtuple::initList(const EventContext& ctx) {
2296 
2297  unsigned int size = m_drawerList.size();
2298 
2299  if (size > 0) {
2300 
2301  if (m_digitsContainerKey.empty()) { // empty name, nothing to do
2302 
2303  ATH_MSG_WARNING( "can't retrieve Digits from TDS" );
2304  ATH_MSG_WARNING( "can't set up fragment list for ntuple" );
2305 
2306  if (m_nSamples != 0) {
2307  ATH_MSG_WARNING( "Disable digit samples in ntuple" );
2308  m_nSamples = 0;
2309  }
2310 
2311  return StatusCode::SUCCESS;
2312  }
2313 
2314  // Read Digits from TES
2315  const TileDigitsContainer* digitsCnt = SG::makeHandle (m_digitsContainerKey, ctx).get();
2316 
2317  int frag = strtol(m_drawerList[0].data(), NULL, 0);
2318  if (frag < 0) { // setup frags IDs from the data
2319 
2320  std::vector<unsigned int> frags;
2321  // Go through all TileDigitsCollections
2322  for (const TileDigitsCollection* digitsCollection : *digitsCnt) {
2323  if (!digitsCollection->empty()) {
2324  // determine type of frag
2325  frags.push_back(digitsCollection->identify());
2326  }
2327  }
2328  size = frags.size();
2329 
2330  if (size > 0) {
2331 
2332  if (size < m_nDrawers) {
2333  ATH_MSG_INFO( "decreasing m_nDrawers from " << m_nDrawers << " to " << size );
2334  m_nDrawers = size;
2335  }
2336 
2337  unsigned int rosOrder[5] = { 2, 1, 3, 4, 0 };
2338  unsigned int dr = 0;
2339  char frg[6] = "0x000";
2340 
2341  m_drawerList.clear();
2342  // m_drawerType.clear();
2343  m_drawerMap.clear();
2344 
2345  msg(MSG::INFO) << "setting drawerList from data " << MSG::hex;
2346  for (unsigned int ir = 0; ir < 5; ++ir) {
2347  for (unsigned int i = 0; i < size; ++i) {
2348  unsigned int frag = frags[i];
2349  if (frag >> 8 == rosOrder[ir]) {
2350  sprintf(frg, "0x%3.3x", frag);
2351  m_drawerList.value().push_back((std::string) frg);
2352  if (dr == m_drawerType.size()) m_drawerType.value().push_back(frag >> 8);
2353  m_drawerMap[frag] = dr;
2354  msg(MSG::INFO) << " 0x" << frag;
2355  ++dr;
2356  }
2357  }
2358  }
2359 
2360  msg(MSG::INFO) << MSG::dec << endmsg;
2361 
2362  size = m_drawerType.size();
2363  if (size < m_nDrawers) {
2364  m_drawerType.value().resize(m_nDrawers);
2365  for (; size < m_nDrawers; ++size)
2366  m_drawerType[size] = 0;
2367  }
2368 
2369  msg(MSG::INFO) << MSG::INFO << "drawerType ";
2370  for (unsigned int dr = 0; dr < size; ++dr)
2371  msg(MSG::INFO) << " " << m_drawerType[dr];
2372  msg(MSG::INFO) << endmsg;
2373 
2374  if (size > m_nDrawers) {
2375  ATH_MSG_INFO( "increasing m_nDrawers from " << m_nDrawers << " to " << size );
2376  m_nDrawers = size;
2377  }
2378 
2379  if (size < 1) size = 1;
2380  if (m_eventsPerFile == 0) {
2381  m_eventsPerFile = static_cast<int>(200 / size) * 1000;
2382  ATH_MSG_INFO( "Number of events per file was 0, set it to 200k/" << size << " = " << m_eventsPerFile );
2383  }
2384 
2385  } else {
2386 
2387  ATH_MSG_ERROR( "can't find any TileDigits collections" );
2388  ATH_MSG_ERROR( "can't set up fragment list for ntuple" );
2389  }
2390  }
2391 
2392  // once again - check number of samples in the data
2393  // but do not print any ERRORs now
2394 
2395  // Go through all TileDigitsCollections
2396  for (const TileDigitsCollection* digitsCollection : *digitsCnt) {
2397  if (!digitsCollection->empty()) {
2398  int siz = digitsCollection->front()->samples().size();
2399  m_nSamplesInDrawerMap[digitsCollection->identify()] = siz;
2400  if (siz > m_nSamples && m_nSamples != 0) {
2401  ATH_MSG_WARNING( "Increasing number of digit samples in ntuple from " << m_nSamples << " to " << siz );
2402  m_nSamples = siz;
2403  }
2404  }
2405  }
2406  }
2407 
2408  return StatusCode::SUCCESS;
2409 }
2410 
2411 
2412 StatusCode TileTBAANtuple::initListFlx(const EventContext& ctx) {
2413 
2414  unsigned int listSize = m_drawerList.size();
2415 
2416  if (listSize > 0) {
2417 
2418  if (m_digitsContainerFlxKey.empty()) { // empty name, nothing to do
2419 
2420  ATH_MSG_WARNING( "can't retrieve FELIX Digits from TDS" );
2421  ATH_MSG_WARNING( "can't set up FELIX fragment list for ntuple" );
2422 
2423  if (m_nSamples != 0) {
2424  ATH_MSG_WARNING( "Disable FELIX digit samples in ntuple" );
2425  m_nSamplesFlx = 0;
2426  }
2427 
2428  return StatusCode::SUCCESS;
2429  }
2430 
2431  // Read Digits from TES
2432  const TileDigitsContainer* digitsCntFlx = SG::makeHandle (m_digitsContainerFlxKey, ctx).get();
2433 
2434  if (listSize == m_nDrawers) {
2435  // Only legacy drawers in the list, setup FELIX frags IDs from the data
2436 
2437  std::vector<unsigned int> frags;
2438  // Go through all TileDigitsCollections
2439  for (const TileDigitsCollection* digitsCollection : *digitsCntFlx) {
2440  if (!digitsCollection->empty()) {
2441  // Determine type of frag
2442  frags.push_back(digitsCollection->identify());
2443  }
2444  }
2445 
2446  unsigned int nFrags = frags.size();
2447 
2448  if (nFrags > 0) {
2449 
2450  if (nFrags != m_nDrawersFlx) {
2451  ATH_MSG_INFO( "changing m_nDrawersFlx from " << m_nDrawersFlx.value() << " to " << nFrags );
2452  m_nDrawersFlx = nFrags;
2453  }
2454 
2455  m_drawerFlxMap.clear();
2456 
2457  std::ostringstream os;
2458  os << "setting FELIX drawers from data " << std::hex;
2459  unsigned int drawerIndex = 0;
2460  for (unsigned int frag : frags) {
2461  m_drawerFlxMap[frag] = drawerIndex;
2462  os << " 0x" << frag;
2463  ++drawerIndex;
2464  }
2465  os << std::dec;
2466 
2467  ATH_MSG_INFO(os.str());
2468 
2469  if (m_eventsPerFile == 0) {
2470  int nDrawersAll = m_nDrawers.value() + m_nDrawersFlx.value();
2471  m_eventsPerFile = static_cast<int>(200 / nDrawersAll) * 1000;
2472  ATH_MSG_INFO( "Number of events per file was 0, set it to 200k/" << nDrawersAll << " = " << m_eventsPerFile );
2473  }
2474 
2475  } else {
2476  ATH_MSG_ERROR( "can't find any FELIX TileDigits collections" );
2477  ATH_MSG_ERROR( "can't set up FELIX fragment list for ntuple" );
2478  }
2479  }
2480 
2481 
2482  // once again - check number of samples in the data
2483  // but do not print any ERRORs now
2484 
2485  for (const TileDigitsCollection* digitsCollection : *digitsCntFlx) {
2486  if (!digitsCollection->empty()) {
2487  int siz = digitsCollection->front()->samples().size();
2488  m_nSamplesFlxInDrawerMap[digitsCollection->identify()] = siz;
2489  if (siz > m_nSamplesFlx && m_nSamplesFlx != 0) {
2490  ATH_MSG_WARNING( "Increasing number of FELIX digit samples in ntuple from " << m_nSamplesFlx << " to " << siz );
2491  m_nSamplesFlx = siz;
2492  }
2493  }
2494  }
2495  }
2496 
2497  return StatusCode::SUCCESS;
2498 }
2499 
2500 
2501 
2504 
2505  // Get eta from an ASCII file with the following structure :
2506  // runnumber eta
2507 
2508  ATH_MSG_INFO( "Get eta for run " << m_runNumber );
2509 
2510  // Find the full path to filename:
2511  std::string fileName = PathResolver::find_file(m_etaFileName, "DATAPATH");
2512  ATH_MSG_INFO( "Reading file " << fileName );
2513 
2514  if (fileName.size() == 0) {
2515 
2516  ATH_MSG_WARNING( "Could not find input file " << m_etaFileName );
2517  ATH_MSG_WARNING( "Skip reading of eta value " );
2518 
2519  } else {
2520 
2521  std::ifstream etafile;
2522  etafile.open(fileName.c_str());
2523 
2524  if (etafile.good()) {
2525 
2526  int runNumber = 0;
2527  float eta = 0;
2528  while ((runNumber != m_runNumber) && (!etafile.eof())) {
2529  etafile >> runNumber >> eta;
2530  }
2531 
2532  if (runNumber != m_runNumber) {
2533  ATH_MSG_INFO( "Run " << m_runNumber << " has not been found, keep eta and theta at zero" );
2534 
2535  m_eta = m_theta = 0.0;
2536  } else {
2537  m_eta = eta;
2538  m_theta = (M_PI_2 - 2 * atan(exp(m_eta)));
2539  ATH_MSG_INFO( "Run " << m_runNumber << " has been found with eta=" << m_eta << ", theta =" << m_theta );
2540 
2541  }
2542 
2543  } else {
2544 
2545  ATH_MSG_WARNING( "Problem with file " << fileName );
2546  ATH_MSG_WARNING( "Skip reading of eta value " );
2547 
2548  }
2549 
2550  etafile.close();
2551  }
2552 }
2553 
2556 
2571 
2576 
2578 
2580 {
2581 
2582  m_ntuplePtr->Branch("EvTime",&m_evTime,"EvTime/I");
2583  m_ntuplePtr->Branch("Run",&m_run,"Run/I");
2584  m_ntuplePtr->Branch("Evt",&m_evt,"Evt/I");
2585  m_ntuplePtr->Branch("Trig",&m_trigType,"Trig/S");
2586  m_ntuplePtr->Branch("DSPflags",&m_dspFlags,"DSPflags/I");
2587  m_ntuplePtr->Branch("DSPunits",&m_dspUnit,"DSPunits/S");
2588  m_ntuplePtr->Branch("OFLunits",&m_rchUnit,"OFLunits/S");
2589 
2590  if ( m_completeNtuple ) {
2591  int nDrawersAll = m_nDrawers.value() + m_nDrawersFlx.value();
2592  if (nDrawersAll > 0) {
2593  m_l1ID.resize(nDrawersAll + 1);
2594  m_l1Type.resize(nDrawersAll + 1);
2595  m_evType.resize(nDrawersAll + 1);
2596  m_evBCID.resize(nDrawersAll + 1);
2597  m_frBCID.resize(nDrawersAll);
2598  }
2599 
2600  // Info from ROD headers
2601  // m_nDrawers drawers separately (i.e. with duplications) + Beam ROD
2602  m_ntuplePtr->Branch("L1ID",&m_l1ID);
2603  m_ntuplePtr->Branch("L1Type",&m_l1Type);
2604  m_ntuplePtr->Branch("EvType",&m_evType);
2605  m_ntuplePtr->Branch("EvBCID",&m_evBCID);
2606  m_ntuplePtr->Branch("FrBCID",&m_frBCID);
2607  }
2608 
2609 
2610 }
2611 
2615 
2617 
2619 {
2620 
2621  if ( m_beamIdList[MUON_ADC_FRAG] ||
2623  {
2624  m_ntuplePtr->Branch("MuBackHit",&m_muBackHit,"MuBackHit/F");
2625  m_ntuplePtr->Branch("MuBackSum",&m_muBackSum,"MuBackSum/F");
2626 
2627  if (m_TBperiod < 2015) {
2628  m_ntuplePtr->Branch("MuBack",&m_muBack,"m_muBack[14]");
2629  m_ntuplePtr->Branch("MuCalib",&m_muCalib,"m_muCalib[2]");
2630  } else if (m_TBperiod == 2015) {
2631  m_ntuplePtr->Branch("MuBack",&m_muBack,"MuBack[8]/F");
2632  } else {
2633  m_ntuplePtr->Branch("MuBack",&m_muBack,"MuBack[12]/F");
2634  }
2635  }
2636 
2637 
2638 }
2639 
2643 
2645 
2647 {
2648 
2649  if (m_beamIdList[ECAL_ADC_FRAG]) {
2650  m_ntuplePtr->Branch("Ecal",&m_ecal,"m_ecal[8]/F");
2651  }
2652 
2653 }
2654 
2658 
2660 
2662 {
2663 
2664  if (m_beamIdList[ECAL_ADC_FRAG]) {
2665  for(unsigned i=0; i<33; ++i){ m_qdc[i]=0.0; }
2666  m_ntuplePtr->Branch("qdc", &m_qdc, "qdc[33]/i");
2667  }
2668 
2669 }
2670 
2671 
2674 
2677 
2679 
2680  m_evTime = 0;
2681  m_run = 0;
2682  m_evt = 0;
2683  m_trigType = 0;
2684 
2685  if (m_completeNtuple) {
2686  std::fill(m_l1ID.begin(), m_l1ID.end(), 0);
2687  std::fill(m_l1Type.begin(), m_l1Type.end(), 0);
2688  std::fill(m_evType.begin(), m_evType.end(), 0);
2689  std::fill(m_evBCID.begin(), m_evBCID.end(), 0);
2690  std::fill(m_frBCID.begin(), m_frBCID.end(), 0);
2691  }
2692 }
2693 
2696 
2699 
2701  m_muBackHit = 0.;
2702  m_muBackSum = 0.;
2703 
2704 }
2705 
2708 
2711 
2713 {
2714 
2715 }
2716 
2719 
2722 
2724 {
2725  for(unsigned i=0; i<33; ++i){ m_qdc[i]=0.0; }
2726 }
2727 
2728 
2732 
2734 
2736 
2737  if (!m_laserObjectKey.empty() > 0) {
2738 
2739  m_ntuplePtr->Branch("LASER_BCID", &m_las_BCID, "LASER_BCID/I");
2740 
2741  m_ntuplePtr->Branch("LASER_FILTER", &m_las_Filt, "LASER_FILTER/I");
2742  m_ntuplePtr->Branch("LASER_REQAMP", &m_las_ReqAmp, "LASER_REQAMP/D");
2743  m_ntuplePtr->Branch("LASER_MEASAMP", &m_las_MeasAmp, "LASER_MEASAMP/D");
2744 
2745  m_ntuplePtr->Branch("LASER_Diode_1_ADC", &m_las_D1_ADC, "LASER_Diode_1_ADC/I");
2746  m_ntuplePtr->Branch("LASER_Diode_2_ADC", &m_las_D2_ADC, "LASER_Diode_2_ADC/I");
2747  m_ntuplePtr->Branch("LASER_Diode_3_ADC", &m_las_D3_ADC, "LASER_Diode_3_ADC/I");
2748  m_ntuplePtr->Branch("LASER_Diode_4_ADC", &m_las_D4_ADC, "LASER_Diode_4_ADC/I");
2749 
2750  m_ntuplePtr->Branch("LASER_Diode_1_Ped", &m_las_D1_Ped, "LASER_Diode_1_Ped/D");
2751  m_ntuplePtr->Branch("LASER_Diode_2_Ped", &m_las_D2_Ped, "LASER_Diode_2_Ped/D");
2752  m_ntuplePtr->Branch("LASER_Diode_3_Ped", &m_las_D3_Ped, "LASER_Diode_3_Ped/D");
2753  m_ntuplePtr->Branch("LASER_Diode_4_Ped", &m_las_D4_Ped, "LASER_Diode_4_Ped/D");
2754 
2755  m_ntuplePtr->Branch("LASER_Diode_1_Ped_RMS", &m_las_D1_Ped_RMS, "LASER_Diode_1_Ped_RMS/D");
2756  m_ntuplePtr->Branch("LASER_Diode_2_Ped_RMS", &m_las_D2_Ped_RMS, "LASER_Diode_2_Ped_RMS/D");
2757  m_ntuplePtr->Branch("LASER_Diode_3_Ped_RMS", &m_las_D1_Ped_RMS, "LASER_Diode_3_Ped_RMS/D");
2758  m_ntuplePtr->Branch("LASER_Diode_4_Ped_RMS", &m_las_D1_Ped_RMS, "LASER_Diode_4_Ped_RMS/D");
2759 
2760  m_ntuplePtr->Branch("LASER_Diode_1_Alpha", &m_las_D1_Alpha, "LASER_Diode_1_Alpha/D");
2761  m_ntuplePtr->Branch("LASER_Diode_2_Alpha", &m_las_D2_Alpha, "LASER_Diode_2_Alpha/D");
2762  m_ntuplePtr->Branch("LASER_Diode_3_Alpha", &m_las_D3_Alpha, "LASER_Diode_3_Alpha/D");
2763  m_ntuplePtr->Branch("LASER_Diode_4_Alpha", &m_las_D4_Alpha, "LASER_Diode_4_Alpha/D");
2764 
2765  m_ntuplePtr->Branch("LASER_Diode_1_Alpha_RMS", &m_las_D1_Alpha_RMS, "LASER_Diode_1_Alpha_RMS/D");
2766  m_ntuplePtr->Branch("LASER_Diode_2_Alpha_RMS", &m_las_D2_Alpha_RMS, "LASER_Diode_2_Alpha_RMS/D");
2767  m_ntuplePtr->Branch("LASER_Diode_3_Alpha_RMS", &m_las_D3_Alpha_RMS, "LASER_Diode_3_Alpha_RMS/D");
2768  m_ntuplePtr->Branch("LASER_Diode_4_Alpha_RMS", &m_las_D4_Alpha_RMS, "LASER_Diode_4_Alpha_RMS/D");
2769 
2770  m_ntuplePtr->Branch("LASER_Diode_1_AlphaPed", &m_las_D1_AlphaPed, "LASER_Diode_1_AlphaPed/D");
2771  m_ntuplePtr->Branch("LASER_Diode_2_AlphaPed", &m_las_D2_AlphaPed, "LASER_Diode_2_AlphaPed/D");
2772  m_ntuplePtr->Branch("LASER_Diode_3_AlphaPed", &m_las_D3_AlphaPed, "LASER_Diode_3_AlphaPed/D");
2773  m_ntuplePtr->Branch("LASER_Diode_4_AlphaPed", &m_las_D4_AlphaPed, "LASER_Diode_4_AlphaPed/D");
2774 
2775  m_ntuplePtr->Branch("LASER_Diode_1_AlphaPed_RMS", &m_las_D1_AlphaPed_RMS, "LASER_Diode_1_AlphaPed_RMS/D");
2776  m_ntuplePtr->Branch("LASER_Diode_2_AlphaPed_RMS", &m_las_D2_AlphaPed_RMS, "LASER_Diode_2_AlphaPed_RMS/D");
2777  m_ntuplePtr->Branch("LASER_Diode_3_AlphaPed_RMS", &m_las_D3_AlphaPed_RMS, "LASER_Diode_3_AlphaPed_RMS/D");
2778  m_ntuplePtr->Branch("LASER_Diode_4_AlphaPed_RMS", &m_las_D4_AlphaPed_RMS, "LASER_Diode_4_AlphaPed_RMS/D");
2779 
2780  m_ntuplePtr->Branch("LASER_PMT_1_ADC", &m_las_PMT1_ADC, "LASER_PMT_1_ADC/I");
2781  m_ntuplePtr->Branch("LASER_PMT_2_ADC", &m_las_PMT2_ADC, "LASER_PMT_2_ADC/I");
2782 
2783  m_ntuplePtr->Branch("LASER_PMT_1_TDC", &m_las_PMT1_TDC, "LASER_PMT_1_TDC/I");
2784  m_ntuplePtr->Branch("LASER_PMT_2_TDC", &m_las_PMT2_TDC, "LASER_PMT_2_TDC/I");
2785 
2786  m_ntuplePtr->Branch("LASER_PMT_1_Ped", &m_las_PMT1_Ped, "LASER_PMT_1_Ped/D");
2787  m_ntuplePtr->Branch("LASER_PMT_2_Ped", &m_las_PMT2_Ped, "LASER_PMT_2_Ped/D");
2788 
2789  m_ntuplePtr->Branch("LASER_PMT_1_Ped_RMS", &m_las_PMT1_Ped_RMS, "LASER_PMT_1_Ped_RMS/D");
2790  m_ntuplePtr->Branch("LASER_PMT_2_Ped_RMS", &m_las_PMT2_Ped_RMS, "LASER_PMT_2_Ped_RMS/D");
2791 
2792  m_ntuplePtr->Branch("LASER_HEAD_Temp", &m_las_Temperature, "LASER_HEAD_Temp/D");
2793  }
2794 
2795  if (m_beamIdList[LASE_PTN_FRAG]) {
2796  m_ntuplePtr->Branch("LasFlag", &m_lasFlag, "LasFlag/s");
2797  }
2798 
2801  m_ntuplePtr->Branch("Las0", &m_las0, "Las0/F");
2802  m_ntuplePtr->Branch("Las1", &m_las1, "Las1/F");
2803  m_ntuplePtr->Branch("Las2", &m_las2, "Las2/F");
2804  m_ntuplePtr->Branch("Las3", &m_las3, "Las3/F");
2805  m_ntuplePtr->Branch("LasExtra", &m_lasExtra, "m_lasExtra[4]/F");
2806  }
2807 
2808 }
2809 
2812 
2815 
2817 {
2818 
2819  if (!m_laserObjectKey.empty()) {
2820 
2821  m_las_BCID = 0;
2822  m_las_D1_ADC = 0;
2823  m_las_D2_ADC = 0;
2824  m_las_D3_ADC = 0;
2825  m_las_D4_ADC = 0;
2826 
2827  m_las_D1_Ped = 0;
2828  m_las_D2_Ped = 0;
2829  m_las_D3_Ped = 0;
2830  m_las_D4_Ped = 0;
2831 
2832  m_las_D1_Alpha = 0;
2833  m_las_D2_Alpha = 0;
2834  m_las_D3_Alpha = 0;
2835  m_las_D4_Alpha = 0;
2836 
2837  m_las_PMT1_ADC = 0;
2838  m_las_PMT2_ADC = 0;
2839 
2840  m_las_PMT1_TDC = 0;
2841  m_las_PMT2_TDC = 0;
2842 
2843  m_las_PMT1_Ped = 0;
2844  m_las_PMT2_Ped = 0;
2845  }
2846 
2847  if (m_beamIdList[LASE_PTN_FRAG]) {
2848  m_lasFlag=0;
2849  }
2850 
2853 
2854  m_las0 = 0.;
2855  m_las1 = 0.;
2856  m_las2 = 0.;
2857  m_las3 = 0.;
2858 
2859  }
2860 }
2861 
2865 
2867 
2869 
2870  if (m_unpackAdder) {
2871  if (m_beamIdList[ADD_FADC_FRAG]) {
2872  m_adder = (int**) malloc(16 * sizeof(int *));
2873  m_adder[0] = (int*) malloc(16 * 16 * sizeof(int));
2874  for (int j = 1; j < 16; j++) {
2875  m_adder[j] = m_adder[0] + j * 16;
2876  }
2877 
2878  m_ntuplePtr->Branch("Adder", *m_adder, "m_adder[16][16]/I");
2879  m_ntuplePtr->Branch("EneAdd", &m_eneAdd, "m_eneAdd[16]/F");
2880  m_ntuplePtr->Branch("TimeAdd", &m_timeAdd, "m_timeAdd[16]/F");
2881  }
2882  }
2883 }
2884 
2887 
2890 
2892 {
2893 
2894 
2895 }
2896 
2900 
2902 
2904 
2905  if (m_beamIdList[DIGI_PAR_FRAG & 0x1F]) {
2906 
2907  m_ntuplePtr->Branch("cispar", m_cispar, "cispar[16]/I");
2908  }
2909 }
2910 
2913 
2916 
2918 {
2919  memset(m_cispar,-1,sizeof(m_cispar));
2920 }
2921 
2922 
2926 
2928 
2930 
2931  if (((m_TBperiod >= 2015 || m_unpackAdder) && m_beamIdList[BEAM_ADC_FRAG])
2932  || ((!m_unpackAdder || m_TBperiod >= 2022) && m_beamIdList[COMMON_ADC1_FRAG])) {
2933 
2934  m_ntuplePtr->Branch("S1cou", &m_s1cou, "S1cou/S");
2935  m_ntuplePtr->Branch("S2cou", &m_s2cou, "S2cou/S");
2936  if (m_TBperiod >= 2016 && m_TBperiod < 2022) {
2937  m_ntuplePtr->Branch("Cher3", &m_s3cou, "Cher3/S"); // dropped S3 in favor of Cher3 in September 2016 TB
2938  // m_ntuplePtr->Branch("SpmFinger", &m_muVeto, "SmpFinger/S"); // muVeto replaced by SPM for testing
2939  m_ntuplePtr->Branch("SiPM1", &m_muTag, "SiPM1/S"); // muTag replaced by SiPM1 for testing
2940  m_ntuplePtr->Branch("SiPM2", &m_muHalo, "SiPM2/S");// muHalo repalce by SiPM1 for testing
2941  } else {
2942  m_ntuplePtr->Branch("S3cou", &m_s3cou, "S3cou/S");
2943  }
2944 
2945  m_ntuplePtr->Branch("Cher1", &m_cher1, "Cher1/S");
2946  m_ntuplePtr->Branch("Cher2", &m_cher2, "Cher2/S");
2947  if (m_TBperiod >= 2022) {
2948  m_ntuplePtr->Branch("Cher3", &m_cher3, "Cher3/S");
2949  }
2950 
2951  if (m_TBperiod < 2015) {
2952  m_ntuplePtr->Branch("MuTag", &m_muTag, "MuTag/S");
2953  m_ntuplePtr->Branch("MuHalo", &m_muHalo, "MuHalo/S");
2954  m_ntuplePtr->Branch("MuVeto", &m_muVeto, "MuVeto/S");
2955  //} else if (m_TBperiod == 2015) {
2956  // nothing
2957  } else if (m_TBperiod >= 2016) {
2958  m_ntuplePtr->Branch("SCalo1", &m_muTag, "SCalo1/S");
2959  m_ntuplePtr->Branch("SCalo2", &m_muHalo, "SCalo2/S");
2960  //m_ntuplePtr->Branch("SCalo3", &m_muVeto, "SCalo3/S");
2961  }
2962  }
2963 
2964  if (m_TBperiod >= 2015) {
2966  m_btdc = new std::vector<std::vector<int> >(16);
2967  m_ntuplePtr->Branch("btdc1", &m_btdc1, "m_btdc1[16]/I");
2968  m_ntuplePtr->Branch("btdc2", &m_btdc2, "m_btdc2[16]/I");
2969  m_ntuplePtr->Branch("btdc", &m_btdc);
2970  m_ntuplePtr->Branch("tjitter", &m_tjitter, "tjitter/I");
2971  m_ntuplePtr->Branch("tscTOF", &m_tscTOF, "tscTOF/I");
2972  m_ntuplePtr->Branch("btdcNhit", m_btdcNhit, "btdcNhit[16]/I");
2973  m_ntuplePtr->Branch("btdcNchMultiHit", m_btdcNchMultiHit, "btdcNchMultiHit[2]/I");
2974  }
2976  m_ntuplePtr->Branch("tof", &m_tof, "m_tof[16]/I");
2977  }
2979  m_ntuplePtr->Branch("scaler", &m_scaler, "m_scaler[16]/I");
2980  }
2981  } else if (!m_unpackAdder) {
2983  m_ntuplePtr->Branch("S2extra", &m_s2extra, "S2extra/S");
2984  m_ntuplePtr->Branch("S2cou", &m_s3extra, "S3extra/S");
2985  }
2986  if (m_beamIdList[BEAM_ADC_FRAG]) {
2987  m_ntuplePtr->Branch("SC1", &m_sc1, "SC1/S");
2988  m_ntuplePtr->Branch("SC2", &m_sc2, "SC2/S");
2989  }
2991  m_ntuplePtr->Branch("pu", &m_commonPU, "pu/S");
2992  }
2994  m_ntuplePtr->Branch("tof", &m_tof, "m_tof[8]/I");
2995  }
2997  m_ntuplePtr->Branch("btdc1", &m_btdc1, "m_btdc1/I");
2998  }
3000  m_ntuplePtr->Branch("btdc2", &m_btdc2, "m_btdc2/I");
3001  }
3002 
3004  m_ntuplePtr->Branch("XchN2", &m_xChN2, "XchN2/F");
3005  m_ntuplePtr->Branch("YchN2", &m_yChN2, "YchN2/F");
3006  m_ntuplePtr->Branch("XchN1", &m_xChN1, "XchN1/F");
3007  m_ntuplePtr->Branch("YchN1", &m_yChN1, "YchN1/F");
3008  }
3010  m_ntuplePtr->Branch("Xcha0", &m_xCha0, "Xcha0/F");
3011  m_ntuplePtr->Branch("Ycha0", &m_yCha0, "Ycha0/F");
3012  }
3013  } else {
3014  if (m_beamIdList[BEAM_TDC_FRAG]) {
3015  m_ntuplePtr->Branch("btdc1", &m_btdc1, "m_btdc1[16]/I");
3016  m_ntuplePtr->Branch("btdc2", &m_btdc2, "m_btdc2[16]/I");
3017  }
3018  }
3019 
3020  if ((m_TBperiod >= 2015 && m_beamIdList[COMMON_TDC1_FRAG])
3023  || (m_TBperiod >= 2022 && m_beamIdList[COMMON_TOF_FRAG])) {
3024 
3025  m_ntuplePtr->Branch("Xcha1", &m_xCha1, "Xcha1/F");
3026  m_ntuplePtr->Branch("Ycha1", &m_yCha1, "Ycha1/F");
3027  m_ntuplePtr->Branch("Xcha2", &m_xCha2, "Xcha2/F");
3028  m_ntuplePtr->Branch("Ycha2", &m_yCha2, "Ycha2/F");
3029  m_ntuplePtr->Branch("Xcha1_0", &m_xCha1_0, "Xcha1_0/F");
3030  m_ntuplePtr->Branch("Ycha1_0", &m_yCha1_0, "Ycha1_0/F");
3031  m_ntuplePtr->Branch("Xcha2_0", &m_xCha2_0, "Xcha2_0/F");
3032  m_ntuplePtr->Branch("Ycha2_0", &m_yCha2_0, "Ycha2_0/F");
3033  m_ntuplePtr->Branch("Ximp", &m_xImp, "Ximp/F");
3034  m_ntuplePtr->Branch("Yimp", &m_yImp, "Yimp/F");
3035  m_ntuplePtr->Branch("Ximp_0", &m_xImp_0, "Ximp_0/F");
3036  m_ntuplePtr->Branch("Yimp_0", &m_yImp_0, "Yimp_0/F");
3037  m_ntuplePtr->Branch("Ximp_90", &m_xImp_90, "Ximp_90/F");
3038  m_ntuplePtr->Branch("Yimp_90", &m_yImp_90, "Yimp_90/F");
3039  m_ntuplePtr->Branch("Ximp_min90", &m_xImp_min90, "Ximp_min90/F");
3040  m_ntuplePtr->Branch("Yimp_min90", &m_yImp_min90, "Yimp_min90/F");
3041  }
3042 
3043 }
3044 
3047 
3050 
3052 
3055 
3056  m_s1cou = 0;
3057  m_s2cou = 0;
3058  m_s3cou = 0;
3059  m_cher1 = 0;
3060  m_cher2 = 0;
3061  m_cher3 = 0;
3062  m_muTag = 0;
3063  m_muHalo = 0;
3064  m_muVeto = 0;
3065  }
3066  if (!m_unpackAdder) {
3068 
3069  m_s2extra = 0;
3070  m_s3extra = 0;
3071  }
3072  if (m_beamIdList[BEAM_ADC_FRAG]) {
3073  m_sc1 = 0;
3074  m_sc2 = 0;
3075  }
3077  m_commonPU = 0;
3078  }
3080  m_xChN2 = 0.;
3081  m_yChN2 = 0.;
3082  m_xChN1 = 0.;
3083  m_yChN1 = 0.;
3084  }
3086  m_xCha0 = 0.;
3087  m_yCha0 = 0.;
3088  }
3089  }
3090 
3091  if ((m_TBperiod >= 2015 && m_beamIdList[COMMON_TDC1_FRAG])
3094  || (m_TBperiod >= 2022 && m_beamIdList[COMMON_TOF_FRAG])) {
3095 
3096  m_xCha1 = 0.;
3097  m_yCha1 = 0.;
3098  m_xCha2 = 0.;
3099  m_yCha2 = 0.;
3100  m_xCha1_0 = 0.;
3101  m_yCha1_0 = 0.;
3102  m_xCha2_0 = 0.;
3103  m_yCha2_0 = 0.;
3104  m_xImp = 0.;
3105  m_yImp = 0.;
3106  }
3107 
3108  m_muBack.fill(0.0F);
3109 
3110  for (int i=0; i<16; i+=2) {
3111  m_tof[i] = +0xFFFF;
3112  m_tof[i+1] = -0xFFFF;
3113  }
3114 
3115  for (int i=0; i<16; i+=2) {
3116  m_btdc1[i] = +0xFFFF;
3117  m_btdc1[i+1] = -0xFFFF;
3118  }
3119 
3120  for (int i=0; i<16; i+=2) {
3121  m_btdc2[i] = +0xFFFF;
3122  m_btdc2[i+1] = -0xFFFF;
3123  }
3124 
3125  if (m_btdc) {
3126  for (std::vector<int>& btdc_amplitudes : *m_btdc) {
3127  btdc_amplitudes.clear();
3128  }
3129  }
3130 
3131  memset(&m_scaler, 0, sizeof(m_scaler));
3132 
3133  memset(m_btdcNhit,0,sizeof(m_btdcNhit));
3134  memset(m_btdcNchMultiHit,0,sizeof(m_btdcNchMultiHit));
3135 }
3136 
3140 
3142 
3144 {
3145  if (m_completeNtuple) {
3146  m_ntuplePtr->Branch("LarSmp", &m_LarEne, "m_LarEne[4]/F");
3147  m_ntuplePtr->Branch("BarSmp", &m_BarEne, "m_BarEne[3]/F");
3148  m_ntuplePtr->Branch("ExtSmp", &m_ExtEne, "m_ExtEne[3]/F");
3149  m_ntuplePtr->Branch("GapSmp", &m_GapEne, "m_GapEne[3]/F");
3150  }
3151 }
3152 
3155 
3158 
3160 {
3161 
3162 
3163 }
3164 
3168 
3170 
3173  m_ntuplePtr->Branch("CoincTrig1", &m_coincTrig1, "m_coincTrig1[96]/I");
3174  m_ntuplePtr->Branch("CoincFlag1", &m_coincFlag1, "CoincFlag1/I");
3175  }
3176 
3178  m_ntuplePtr->Branch("CoincTrig2", &m_coincTrig2, "m_coincTrig2[96]/I");
3179  m_ntuplePtr->Branch("CoincFlag2", &m_coincFlag2, "CoincFlag2/I");
3180  }
3181 
3183  m_ntuplePtr->Branch("CoincTrig3", &m_coincTrig3, "m_coincTrig3[96]/I");
3184  m_ntuplePtr->Branch("CoincFlag3", &m_coincFlag3, "CoincFlag3/I");
3185  }
3186 
3188  m_ntuplePtr->Branch("CoincTrig4", &m_coincTrig4, "m_coincTrig4[96]/I");
3189  m_ntuplePtr->Branch("CoincFlag4", &m_coincFlag4, "CoincFlag4/I");
3190  }
3192  m_ntuplePtr->Branch("CoincTrig5", &m_coincTrig5, "m_coincTrig5[96]/I");
3193  m_ntuplePtr->Branch("CoincFlag5", &m_coincFlag5, "CoincFlag5/I");
3194  }
3195 
3197  m_ntuplePtr->Branch("CoincTrig6", &m_coincTrig6, "m_coincTrig6[96]/I");
3198  m_ntuplePtr->Branch("CoincFlag6", &m_coincFlag6, "CoincFlag6/I");
3199  }
3200 
3202  m_ntuplePtr->Branch("CoincTrig7", &m_coincTrig7, "m_coincTrig7[96]/I");
3203  m_ntuplePtr->Branch("CoincFlag7", &m_coincFlag7, "CoincFlag7/I");
3204  }
3205 
3207  m_ntuplePtr->Branch("CoincTrig8", &m_coincTrig8, "m_coincTrig8[96]/I");
3208  m_ntuplePtr->Branch("CoincFlag8", &m_coincFlag8, "CoincFlag8/I");
3209  }
3210 
3211 }
3212 
3215 
3218 
3220 {
3221 
3222 
3223 
3224 }
3225 
3229 
3231 
3233 {
3234 
3235 
3238  m_bcidVec.reserve(MAX_DRAWERS);
3239  m_DMUheaderVec.reserve(MAX_DRAWERS);
3240  m_DMUformatErrVec.reserve(MAX_DRAWERS);
3241  m_DMUparityErrVec.reserve(MAX_DRAWERS);
3242  m_DMUmemoryErrVec.reserve(MAX_DRAWERS);
3247  m_dmuMaskVec.reserve(MAX_DRAWERS);
3248  m_slinkCRCVec.reserve(MAX_DRAWERS);
3249  m_gainVec.reserve(MAX_DRAWERS);
3250  m_sampleVec.reserve(MAX_DRAWERS);
3251  m_feCRCVec.reserve(MAX_DRAWERS);
3252  m_rodCRCVec.reserve(MAX_DRAWERS);
3253  m_eneVec.reserve(MAX_DRAWERS);
3254  m_timeVec.reserve(MAX_DRAWERS);
3255  m_pedFlatVec.reserve(MAX_DRAWERS);
3256  m_chi2FlatVec.reserve(MAX_DRAWERS);
3257  m_efitVec.reserve(MAX_DRAWERS);
3258  m_tfitVec.reserve(MAX_DRAWERS);
3259  m_pedfitVec.reserve(MAX_DRAWERS);
3260  m_chi2Vec.reserve(MAX_DRAWERS);
3261  m_efitcVec.reserve(MAX_DRAWERS);
3262  m_tfitcVec.reserve(MAX_DRAWERS);
3263  m_pedfitcVec.reserve(MAX_DRAWERS);
3264  m_chi2cVec.reserve(MAX_DRAWERS);
3265  m_eOptVec.reserve(MAX_DRAWERS);
3266  m_tOptVec.reserve(MAX_DRAWERS);
3267  m_pedOptVec.reserve(MAX_DRAWERS);
3268  m_chi2OptVec.reserve(MAX_DRAWERS);
3269  m_eDspVec.reserve(MAX_DRAWERS);
3270  m_tDspVec.reserve(MAX_DRAWERS);
3271  m_chi2DspVec.reserve(MAX_DRAWERS);
3273  m_ROD_DMUBCIDVec.reserve(MAX_DRAWERS);
3279  m_ROD_DMUMaskVec.reserve(MAX_DRAWERS);
3280 
3281  std::ostringstream oss;
3282  oss << m_nSamples;
3283  std::string nSampStr=oss.str();
3284 
3285  unsigned int listSize = std::min(m_nDrawers.value(), static_cast<unsigned int>(m_drawerMap.size()));
3286 
3287  if (listSize > 0) {
3288 
3289  std::string digit[10] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
3290  std::vector<std::string> suffixArr;
3291  unsigned int length;
3292  bool testbeam = TileCablingService::getInstance()->getTestBeam();
3293 
3294  if (m_calibMode) {
3295 
3296  length = 2 * m_nDrawers;
3297  suffixArr.resize(length);
3298 
3299  for (unsigned int i = 0; i < listSize; ++i) {
3300  unsigned int ros = m_drawerType[i];
3301  unsigned int drawer = strtol(m_drawerList[i].data(), NULL, 0) & 0x3F;
3302  std::string digits;
3303  if (m_TBperiod >= 2010) {
3304  ++drawer; // count modules from 1
3305  digits = digit[drawer / 10] + digit[drawer % 10];
3306  } else if (testbeam) {
3307  digits = digit[drawer & 7];
3308  } else {
3309  ++drawer; // count modules from 1
3310  digits = digit[drawer / 10] + digit[drawer % 10];
3311  }
3312 
3313  if (ros == 0) {
3314  std::string suff = m_drawerList[i];
3315  suff.replace(suff.find("0x"), 2, "");
3316  suffixArr[i] = suff + "lo";
3317  suffixArr[i + m_nDrawers] = suff + "hi";
3318  } else {
3319  suffixArr[i] = m_rosName[ros] + digits + "lo";
3320  suffixArr[i + m_nDrawers] = m_rosName[ros] + digits + "hi";
3321  }
3322  }
3323  } else {
3324 
3325  length = m_nDrawers;
3326  suffixArr.resize(length);
3327 
3328  for (unsigned int i = 0; i < listSize; ++i) {
3329  unsigned int ros = m_drawerType[i];
3330  unsigned int drawer = strtol(m_drawerList[i].data(), NULL, 0) & 0x3F;
3331  std::string digits;
3332  if (m_TBperiod >= 2010) {
3333  ++drawer; // count modules from 1
3334  digits = digit[drawer / 10] + digit[drawer % 10];
3335  } else if (testbeam) {
3336  digits = digit[drawer & 7];
3337  } else {
3338  ++drawer; // count modules from 1
3339  digits = digit[drawer / 10] + digit[drawer % 10];
3340  }
3341 
3342  if (ros == 0) {
3343  std::string suff = m_drawerList[i];
3344  suff.replace(suff.find("0x"), 2, "");
3345  suffixArr[i] = suff;
3346  } else {
3347  suffixArr[i] = m_rosName[ros] + digits;
3348  }
3349  }
3350  }
3351 
3352  m_nSamplesInDrawer.reserve(length);
3353 
3354  m_evtVec.resize(length);
3355  m_rodBCIDVec.resize(length);
3356  m_sizeVec.resize(length);
3357  m_ROD_GlobalCRCVec.resize(length);
3358 
3359  for (unsigned int i = 0; i < length; i++) {
3360 
3361  int nSamplesInDrawer(m_nSamples);
3362  int frag = std::stoi(m_drawerList[i%m_nDrawers], nullptr, 0);
3363 
3364  auto it = m_nSamplesInDrawerMap.find(frag);
3365  if (it != m_nSamplesInDrawerMap.end()) {
3366  nSamplesInDrawer = it->second;
3367  }
3368  m_nSamplesInDrawer.push_back(nSamplesInDrawer);
3369 
3370  m_bcidVec.push_back(std::array<int, MAX_DMU>()); // U
3371  m_DMUheaderVec.push_back(std::array<uint32_t, MAX_DMU>()); // U32
3372  m_DMUformatErrVec.push_back(std::array<short, MAX_DMU>()); // U32
3373  m_DMUparityErrVec.push_back(std::array<short, MAX_DMU>()); // U32
3374  m_DMUmemoryErrVec.push_back(std::array<short, MAX_DMU>()); // U32
3375  m_DMUDstrobeErrVec.push_back(std::array<short, MAX_DMU>()); // U32
3376  m_DMUSstrobeErrVec.push_back(std::array<short, MAX_DMU>()); // U32
3377  m_DMUHeadparityErrVec.push_back(std::array<short, MAX_DMU>());
3378  m_DMUDataparityErrVec.push_back(std::array<short, MAX_DMU>());
3379 
3380  m_dmuMaskVec.push_back(std::array<int, 2>()); // U(2)
3381  m_slinkCRCVec.push_back(std::array<int, 2>()); // U(2)
3382  m_gainVec.push_back(std::array<int, MAX_CHAN>()); // U(48/96)
3383  m_sampleVec.push_back(std::make_unique<int[]>(MAX_CHAN * nSamplesInDrawer)); // U(48/96,9)
3384  m_feCRCVec.push_back(std::array<int, MAX_DMU>()); //U
3385  m_rodCRCVec.push_back(std::array<int, MAX_DMU>()); //U
3386 
3387  m_eneVec.push_back(std::array<float, MAX_CHAN>());
3388  m_timeVec.push_back(std::array<float, MAX_CHAN>());
3389  m_pedFlatVec.push_back(std::array<float, MAX_CHAN>());
3390  m_chi2FlatVec.push_back(std::array<float, MAX_CHAN>());
3391 
3392  m_efitVec.push_back(std::array<float, MAX_CHAN>());
3393  m_tfitVec.push_back(std::array<float, MAX_CHAN>());
3394  m_pedfitVec.push_back(std::array<float, MAX_CHAN>());
3395  m_chi2Vec.push_back(std::array<float, MAX_CHAN>());
3396 
3397  m_efitcVec.push_back(std::array<float, MAX_CHAN>());
3398  m_tfitcVec.push_back(std::array<float, MAX_CHAN>());
3399  m_pedfitcVec.push_back(std::array<float, MAX_CHAN>());
3400  m_chi2cVec.push_back(std::array<float, MAX_CHAN>());
3401 
3402  m_eOptVec.push_back(std::array<float, MAX_CHAN>());
3403  m_tOptVec.push_back(std::array<float, MAX_CHAN>());
3404  m_pedOptVec.push_back(std::array<float, MAX_CHAN>());
3405  m_chi2OptVec.push_back(std::array<float, MAX_CHAN>());
3406 
3407  m_eDspVec.push_back(std::array<float, MAX_CHAN>());
3408  m_tDspVec.push_back(std::array<float, MAX_CHAN>());
3409  m_chi2DspVec.push_back(std::array<float, MAX_CHAN>());
3410 
3411  m_ROD_DMUBCIDVec.push_back(std::array<short, MAX_DMU>());
3412  m_ROD_DMUmemoryErrVec.push_back(std::array<short, MAX_DMU>());
3413  m_ROD_DMUSstrobeErrVec.push_back(std::array<short, MAX_DMU>());
3414  m_ROD_DMUDstrobeErrVec.push_back(std::array<short, MAX_DMU>());
3415  m_ROD_DMUHeadformatErrVec.push_back(std::array<short, MAX_DMU>());
3416  m_ROD_DMUDataformatErrVec.push_back(std::array<short, MAX_DMU>());
3417  m_ROD_DMUMaskVec.push_back(std::array<short, 2>());
3418 
3419  if (i % m_nDrawers < listSize) {
3420 
3421  ATH_MSG_DEBUG( "Adding items for " << suffixArr[i] );
3422  // create ntuple layout
3423  if (m_bsInput) {
3424  m_ntuplePtr->Branch(("Evt"+suffixArr[i]).c_str(), &m_evtVec.data()[i], ("Evt"+suffixArr[i]+"/I").c_str()); // int
3425  m_ntuplePtr->Branch(("rodBCID"+suffixArr[i]).c_str(), &m_rodBCIDVec.data()[i], ("rodBCID"+suffixArr[i]+"/S").c_str());//int
3426  m_ntuplePtr->Branch(("Size"+suffixArr[i]).c_str(), &m_sizeVec.data()[i], ("Size"+suffixArr[i]+"/S").c_str()); // short
3427  m_ntuplePtr->Branch(("BCID"+suffixArr[i]).c_str(), &m_bcidVec.back(), ("bcid"+suffixArr[i]+"[16]/I").c_str()); // int
3428  m_ntuplePtr->Branch(("DMUheader"+suffixArr[i]).c_str(), &m_DMUheaderVec.back(), ("DMUheader"+suffixArr[i]+"[16]/i").c_str()); // uint32
3429  m_ntuplePtr->Branch(("DMUformatErr"+suffixArr[i]).c_str(), &m_DMUformatErrVec.back(), ("DMUformatErr"+suffixArr[i]+"[16]/S").c_str()); // short
3430  m_ntuplePtr->Branch(("DMUparityErr"+suffixArr[i]).c_str(), &m_DMUparityErrVec.back(), ("DMUparityErr"+suffixArr[i]+"[16]/S").c_str()); // short
3431  m_ntuplePtr->Branch(("DMUmemoryErr"+suffixArr[i]).c_str(), &m_DMUmemoryErrVec.back(), ("DMUmemoryErr"+suffixArr[i]+"[16]/S").c_str()); // short
3432  m_ntuplePtr->Branch(("DMUSstrobeErr"+suffixArr[i]).c_str(), &m_DMUSstrobeErrVec.back(), ("DMUSstrobeErr"+suffixArr[i]+"[16]/S").c_str()); // short
3433  m_ntuplePtr->Branch(("DMUDstrobeErr"+suffixArr[i]).c_str(), &m_DMUDstrobeErrVec.back(), ("DMUDstrobeErr"+suffixArr[i]+"[16]/S").c_str()); // short
3434  m_ntuplePtr->Branch(("DMUMask"+suffixArr[i]).c_str(), &m_dmuMaskVec.back(), ("dmumask"+suffixArr[i]+"[2]/I").c_str()); // int
3435  m_ntuplePtr->Branch(("SlinkCRC"+suffixArr[i]).c_str(), &m_slinkCRCVec.back(), ("crc"+suffixArr[i]+"[2]/I").c_str()); // int
3436  m_ntuplePtr->Branch(("DMUHeadparityErr"+suffixArr[i]).c_str(), &m_DMUHeadparityErrVec.back(), ("DMUHeadparityErr"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3437  m_ntuplePtr->Branch(("DMUDataparityErr"+suffixArr[i]).c_str(), &m_DMUDataparityErrVec.back(), ("DMUDataparityErr"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3438  }
3439 
3440  m_ntuplePtr->Branch(("Gain"+suffixArr[i]).c_str(),&m_gainVec.back(), ("gain"+suffixArr[i]+"[48]/I").c_str()); // int
3441 
3442  if (nSamplesInDrawer > 0) {
3443  nSampStr = std::to_string(nSamplesInDrawer);
3444  m_ntuplePtr->Branch(("Sample" + suffixArr[i]).c_str(), m_sampleVec.back().get(),
3445  ("sample" + suffixArr[i] + "[48]["+nSampStr+"]/I").c_str()); // size m_nsample and type int
3446  }
3447 
3448  if (m_bsInput) {
3449  m_ntuplePtr->Branch(("feCRC" + suffixArr[i]).c_str(), &m_feCRCVec.back(), ("fe_crc" + suffixArr[i] + "[16]/I").c_str()); // int
3450  m_ntuplePtr->Branch(("rodCRC" + suffixArr[i]).c_str(), &m_rodCRCVec.back(), ("rod_crc" + suffixArr[i] + "[16]/I").c_str()); // int
3451  }
3452 
3454 
3455  m_ntuplePtr->Branch(("Ene" + suffixArr[i]).c_str(), &m_eneVec.back(), ("ene" + suffixArr[i] + "[48]/F").c_str()); // float
3456  m_ntuplePtr->Branch(("Time" + suffixArr[i]).c_str(), &m_timeVec.back(), ("time" + suffixArr[i] + "[48]/F").c_str()); // float
3457  m_ntuplePtr->Branch(("Ped" + suffixArr[i]).c_str(), &m_pedFlatVec.back(), ("pedflat" + suffixArr[i] + "[48]/F").c_str()); // float
3458  m_ntuplePtr->Branch(("Chi2ene" + suffixArr[i]).c_str(), &m_chi2FlatVec.back(), ("chiflat" + suffixArr[i] + "[48]/F").c_str()); // float
3459 
3460  }
3461 
3463 
3464  m_ntuplePtr->Branch(("Efit" + suffixArr[i]).c_str(), &m_efitVec.back(), ("efit" + suffixArr[i] + "[48]/F").c_str()); // float
3465  m_ntuplePtr->Branch(("Tfit" + suffixArr[i]).c_str(), &m_tfitVec.back(), ("tfit" + suffixArr[i] + "[48]/F").c_str()); // float
3466  m_ntuplePtr->Branch(("Pedfit" + suffixArr[i]).c_str(), &m_pedfitVec.back(), ("pedfit" + suffixArr[i] + "[48]/F").c_str()); // float
3467  m_ntuplePtr->Branch(("Chi2fit" + suffixArr[i]).c_str(), &m_chi2Vec.back(), ("chifit" + suffixArr[i] + "[48]/F").c_str()); // float
3468 
3469  }
3470 
3472 
3473  m_ntuplePtr->Branch(("Efitc" + suffixArr[i]).c_str(), &m_efitcVec.back(), ("efitc" + suffixArr[i] + "[48]/F").c_str()); // float
3474  m_ntuplePtr->Branch(("Tfitc" + suffixArr[i]).c_str(), &m_tfitcVec.back(), ("tfitc" + suffixArr[i] + "[48]/F").c_str()); // float
3475  m_ntuplePtr->Branch(("Pedfitc" + suffixArr[i]).c_str(), &m_pedfitcVec.back(), ("pedfitc" + suffixArr[i] + "[48]/F").c_str()); // float
3476  m_ntuplePtr->Branch(("Chi2fitc" + suffixArr[i]).c_str(), &m_chi2cVec.back(), ("chifitc" + suffixArr[i] + "[48]/F").c_str()); // float
3477 
3478  }
3479 
3481 
3482  m_ntuplePtr->Branch(("Eopt"+suffixArr[i]).c_str(), &m_eOptVec.back(), ("eOpt"+suffixArr[i]+"[48]/F").c_str()); // float
3483  m_ntuplePtr->Branch(("Topt"+suffixArr[i]).c_str(), &m_tOptVec.back(), ("tOpt"+suffixArr[i]+"[48]/F").c_str()); // float
3484  m_ntuplePtr->Branch(("Pedopt"+suffixArr[i]).c_str(), &m_pedOptVec.back(), ("pedOpt"+suffixArr[i]+"[48]/F").c_str()); // float
3485  m_ntuplePtr->Branch(("Chi2opt"+suffixArr[i]).c_str(), &m_chi2OptVec.back(), ("chiOpt"+suffixArr[i]+"[48]/F").c_str()); // float
3486 
3487  }
3488 
3490 
3491  m_ntuplePtr->Branch(("Edsp"+suffixArr[i]).c_str(), &m_eDspVec.back(), ("eDsp"+suffixArr[i]+"[48]/F").c_str()); // float
3492  m_ntuplePtr->Branch(("Tdsp"+suffixArr[i]).c_str(), &m_tDspVec.back(), ("tDsp"+suffixArr[i]+"[48]/F").c_str()); // float
3493  m_ntuplePtr->Branch(("Chi2dsp"+suffixArr[i]).c_str(), &m_chi2DspVec.back(), ("chiDsp"+suffixArr[i]+"[48]/F").c_str()); // float
3494  m_ntuplePtr->Branch(("ROD_GlobalCRC"+suffixArr[i]).c_str(), &m_ROD_GlobalCRCVec.data()[i], ("ROD_GlobalCRC"+suffixArr[i]+"/s").c_str()); // unsigned short
3495  m_ntuplePtr->Branch(("ROD_DMUBCID"+suffixArr[i]).c_str(), &m_ROD_DMUBCIDVec.back(), ("ROD_DMUBCID"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3496  m_ntuplePtr->Branch(("ROD_DMUmemoryErr"+suffixArr[i]).c_str(), &m_ROD_DMUmemoryErrVec.back(), ("ROD_DMUmemoryErr"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3497  m_ntuplePtr->Branch(("ROD_DMUSstrobeErr"+suffixArr[i]).c_str(), &m_ROD_DMUSstrobeErrVec.back(), ("ROD_DMUSstrobeErr"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3498  m_ntuplePtr->Branch(("ROD_DMUDstrobeErr"+suffixArr[i]).c_str(), &m_ROD_DMUDstrobeErrVec.back(), ("ROD_DMUDstrobeErr"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3499  m_ntuplePtr->Branch(("ROD_DMUHeadformatErr"+suffixArr[i]).c_str(), &m_ROD_DMUHeadformatErrVec.back(), ("ROD_DMUHeadformatErr"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3500  m_ntuplePtr->Branch(("ROD_DMUDataformatErr"+suffixArr[i]).c_str(), &m_ROD_DMUDataformatErrVec.back(), ("ROD_DMUDataformatErr"+suffixArr[i]+"[16]/s").c_str()); // unsigned short
3501  m_ntuplePtr->Branch(("ROD_DMUMask"+suffixArr[i]).c_str(), &m_ROD_DMUMaskVec.back(), ("ROD_DMUMask"+suffixArr[i]+"[2]/s").c_str()); // unsigned short
3502 
3503  }
3504  }
3505  }
3506  }
3507 }
3508 
3513 
3515 {
3519 
3529 
3538 
3545 
3565 
3566 }
3567 
3568 
3570 {
3571 
3572  m_rodBCIDflxVec.reserve(MAX_DRAWERS);
3573  m_sizeflxVec.reserve(MAX_DRAWERS);
3574  m_evtflxVec.reserve(MAX_DRAWERS);
3575 
3576  m_eflxfitVec.reserve(MAX_DRAWERS);
3577  m_tflxfitVec.reserve(MAX_DRAWERS);
3578  m_chi2flxfitVec.reserve(MAX_DRAWERS);
3579  m_pedflxfitVec.reserve(MAX_DRAWERS);
3580  m_eflxoptVec.reserve(MAX_DRAWERS);
3581  m_tflxoptVec.reserve(MAX_DRAWERS);
3582  m_chi2flxoptVec.reserve(MAX_DRAWERS);
3583  m_pedflxoptVec.reserve(MAX_DRAWERS);
3584  m_gainflxVec.reserve(MAX_DRAWERS);
3585  m_sampleflxVec.reserve(MAX_DRAWERS);
3586 
3587  m_mdL1idflxVec.reserve(MAX_DRAWERS);
3588  m_mdBcidflxVec.reserve(MAX_DRAWERS);
3589  m_mdModuleflxVec.reserve(MAX_DRAWERS);
3590  m_mdRunTypeflxVec.reserve(MAX_DRAWERS);
3591  m_mdPedLoflxVec.reserve(MAX_DRAWERS);
3592  m_mdPedHiflxVec.reserve(MAX_DRAWERS);
3593  m_mdRunflxVec.reserve(MAX_DRAWERS);
3594  m_mdChargeflxVec.reserve(MAX_DRAWERS);
3597 
3598  std::string nSampStrFlx = std::to_string(m_nSamplesFlx);
3599  unsigned int listSize = std::min(m_nDrawersFlx.value(), static_cast<unsigned int>(m_drawerFlxMap.size()));
3600 
3601  bool testbeam = TileCablingService::getInstance()->getTestBeam();
3602  std::vector<std::string> moduleNames(m_nDrawersFlx, "");
3603  unsigned int length = 2 * m_nDrawersFlx;
3604  std::vector<std::string> suffixArr(length, "");
3605  m_nSamplesFlxInDrawer.resize(length);
3606 
3607  for (const std::pair<const unsigned int, unsigned int>& fragAndDrawer : m_drawerFlxMap) {
3608  unsigned int frag = fragAndDrawer.first;
3609  unsigned int ros = frag >> 8;
3610  unsigned int drawer = frag & 0x3F;
3611  unsigned int drawerIndex = fragAndDrawer.second;
3612 
3613  std::ostringstream drawerName;
3614  drawerName << m_rosName[ros];
3615  if (testbeam) {
3616  drawerName << (drawer & 7);
3617  } else {
3618  ++drawer; // count modules from 1
3619  drawerName << std::setw(2) << std::setfill('0') << drawer;
3620  }
3621 
3622  moduleNames.at(drawerIndex) = drawerName.str();
3623  suffixArr.at(drawerIndex) = drawerName.str() + "lo";
3624  suffixArr.at(drawerIndex + m_nDrawersFlx) = drawerName.str() + "hi";
3625 
3626  int nSamples(m_nSamplesFlx);
3627  auto it = m_nSamplesFlxInDrawerMap.find(frag);
3628  if (it != m_nSamplesFlxInDrawerMap.end()) {
3629  nSamples = it->second;
3630  }
3631 
3632  m_nSamplesFlxInDrawer[drawerIndex] = nSamples;
3633  m_nSamplesFlxInDrawer[drawerIndex + m_nDrawersFlx] = nSamples;
3634  }
3635 
3637  m_sizeflxVec.resize(m_nDrawersFlx);
3638  m_evtflxVec.resize(m_nDrawersFlx);
3639 
3640  for (unsigned int i = 0; i < length; ++i) {
3641 
3642  int nSamplesInDrawer = m_nSamplesFlxInDrawer[i];
3643 
3644  m_eflxfitVec.push_back(std::array<float, MAX_CHAN>());
3645  m_tflxfitVec.push_back(std::array<float, MAX_CHAN>());
3646  m_pedflxfitVec.push_back(std::array<float, MAX_CHAN>());
3647  m_chi2flxfitVec.push_back(std::array<float, MAX_CHAN>());
3648 
3649  m_eflxoptVec.push_back(std::array<float, MAX_CHAN>());
3650  m_tflxoptVec.push_back(std::array<float, MAX_CHAN>());
3651  m_pedflxoptVec.push_back(std::array<float, MAX_CHAN>());
3652  m_chi2flxoptVec.push_back(std::array<float, MAX_CHAN>());
3653 
3654  if (i < m_nDrawersFlx) {
3655  m_mdL1idflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3656  m_mdBcidflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3657  m_mdModuleflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3658  m_mdRunTypeflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3659  m_mdPedLoflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3660  m_mdPedHiflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3661  m_mdRunflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3662  m_mdChargeflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3663  m_mdChargeTimeflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3664  m_mdCapacitorflxVec.push_back(std::array<int, MAX_MINIDRAWER>());
3665 
3666  std::string suffix = moduleNames[i];
3667  ATH_MSG_DEBUG( "Adding items for " << suffix );
3668 
3669  if (m_bsInput) {
3670  m_ntuplePtr->Branch(("FlxEvt"+suffix).c_str(), &m_evtflxVec.data()[i]); // int
3671  m_ntuplePtr->Branch(("FlxRodBCID"+suffix).c_str(), &m_rodBCIDflxVec.data()[i]);//int
3672  m_ntuplePtr->Branch(("FlxSize"+suffix).c_str(), &m_sizeflxVec.data()[i]); // short
3673  }
3674 
3675  m_ntuplePtr->Branch(("FlxL1ID"+suffix).c_str(), &m_mdL1idflxVec.back()); // int
3676  m_ntuplePtr->Branch(("FlxBCID"+suffix).c_str(), &m_mdBcidflxVec.back()); // int
3677  m_ntuplePtr->Branch(("FlxModule"+suffix).c_str(), &m_mdModuleflxVec.back()); // int
3678  m_ntuplePtr->Branch(("FlxRun"+suffix).c_str(), &m_mdRunflxVec.back()); // int
3679  m_ntuplePtr->Branch(("FlxRunType"+suffix).c_str(), &m_mdRunTypeflxVec.back()); // int
3680  m_ntuplePtr->Branch(("FlxPedLo"+suffix).c_str(), &m_mdPedLoflxVec.back()); // int
3681  m_ntuplePtr->Branch(("FlxPedHi"+suffix).c_str(), &m_mdPedHiflxVec.back()); // int
3682  m_ntuplePtr->Branch(("FlxCharge"+suffix).c_str(), &m_mdChargeflxVec.back()); // int
3683  m_ntuplePtr->Branch(("FlxChargeTime"+suffix).c_str(), &m_mdChargeTimeflxVec.back()); // int
3684  m_ntuplePtr->Branch(("FlxCapacitor"+suffix).c_str(), &m_mdCapacitorflxVec.back()); // int
3685 
3686  }
3687 
3688  m_gainflxVec.push_back(std::array<int, MAX_CHAN>());
3689  m_sampleflxVec.push_back(std::make_unique<int[]>(MAX_CHAN * nSamplesInDrawer)); // U(48/96,9)
3690 
3691  if (i % m_nDrawersFlx < listSize) {
3692  ATH_MSG_DEBUG( "Adding items for " << suffixArr[i] );
3693 
3694  m_ntuplePtr->Branch(("FlxGain"+suffixArr[i]).c_str(), &m_gainflxVec.back()); // int
3695 
3696  if (nSamplesInDrawer > 0) {
3697  nSampStrFlx = std::to_string(nSamplesInDrawer);
3698  m_ntuplePtr->Branch(("FlxSample" + suffixArr[i]).c_str(), m_sampleflxVec.back().get(),
3699  ("Flxsample" + suffixArr[i] + "[48]["+nSampStrFlx+"]/I").c_str()); // size m_nsample and type int
3700  }
3701 
3703  m_ntuplePtr->Branch(("FlxEfit" + suffixArr[i]).c_str(), &m_eflxfitVec.back()); // float
3704  m_ntuplePtr->Branch(("FlxTfit" + suffixArr[i]).c_str(), &m_tflxfitVec.back()); // float
3705  m_ntuplePtr->Branch(("FlxPedfit" + suffixArr[i]).c_str(), &m_pedflxfitVec.back()); // float
3706  m_ntuplePtr->Branch(("FlxChi2fit" + suffixArr[i]).c_str(), &m_chi2flxfitVec.back()); // float
3707  }
3708 
3710  m_ntuplePtr->Branch(("FlxEOpt" + suffixArr[i]).c_str(), &m_eflxoptVec.back()); // float
3711  m_ntuplePtr->Branch(("FlxTOpt" + suffixArr[i]).c_str(), &m_tflxoptVec.back()); // float
3712  m_ntuplePtr->Branch(("FlxPedOpt" + suffixArr[i]).c_str(), &m_pedflxoptVec.back()); // float
3713  m_ntuplePtr->Branch(("FlxChi2Opt" + suffixArr[i]).c_str(), &m_chi2flxoptVec.back()); // float
3714  }
3715  }
3716  }
3717 }
3718 
3719 
3720 
3722 {
3726 
3729 
3734 
3739 
3750 }
3751 
3755 
3757 
3759 {
3760  m_ehitVec.clear();
3761  m_thitVec.clear();
3762  m_ehitCnt.clear();
3763  m_thitCnt.clear();
3764 
3765  m_ehitVec.reserve(MAX_DRAWERS);
3766  m_thitVec.reserve(MAX_DRAWERS);
3767  m_ehitCnt.reserve(MAX_DRAWERS);
3768  m_thitCnt.reserve(MAX_DRAWERS);
3769 
3770  unsigned int listSize = std::min(m_nDrawers.value(), static_cast<unsigned int>(m_drawerMap.size()));
3771 
3772  if (listSize > 0) {
3773 
3774  std::string digit[10] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
3775  std::vector<std::string> suffixArr;
3776  unsigned int length;
3777  bool testbeam = TileCablingService::getInstance()->getTestBeam();
3778 
3779  length = m_nDrawers;
3780  suffixArr.resize(length);
3781 
3782  for (unsigned int i = 0; i < listSize; ++i) {
3783  unsigned int ros = m_drawerType[i];
3784  unsigned int drawer = strtol(m_drawerList[i].data(), NULL, 0) & 0x3F;
3785  std::string digits;
3786  if (m_TBperiod >= 2010) {
3787  ++drawer; // count modules from 1
3788  digits = digit[drawer / 10] + digit[drawer % 10];
3789  } else if (testbeam) {
3790  digits = digit[drawer & 7];
3791  } else {
3792  ++drawer; // count modules from 1
3793  digits = digit[drawer / 10] + digit[drawer % 10];
3794  }
3795 
3796  if (ros == 0) {
3797  std::string suff = m_drawerList[i];
3798  suff.replace(suff.find("0x"), 2, "");
3799  suffixArr[i] = suff;
3800  } else {
3801  suffixArr[i] = m_rosName[ros] + digits;
3802  }
3803  }
3804 
3805  for (unsigned int i = 0; i < length; i++) {
3806 
3807  if (i % m_nDrawers < listSize)
3808  ATH_MSG_DEBUG( "Adding items for " << suffixArr[i] );
3809 
3810  m_ehitVec.push_back(std::array<float, MAX_CHAN>());
3811  m_thitVec.push_back(std::array<float, MAX_CHAN>());
3812  m_ehitCnt.push_back(std::array<float, MAX_CHAN>());
3813  m_thitCnt.push_back(std::array<float, MAX_CHAN>());
3814 
3815  if (i%m_nDrawers < listSize) {
3816 
3817  if (!m_hitVectorKey.empty()) {
3818 
3819  if (i % m_nDrawers < listSize)
3820  ATH_MSG_DEBUG( "Adding G4 hit info for " << suffixArr[i] );
3821 
3822  m_ntuplePtr->Branch(("EhitG4"+suffixArr[i]).c_str(),&m_ehitVec.back(),("eHitG4"+suffixArr[i]+"[48]/F").c_str());
3823  m_ntuplePtr->Branch(("ThitG4"+suffixArr[i]).c_str(),&m_thitVec.back(),("tHitG4"+suffixArr[i]+"[48]/F").c_str());
3824  }
3825 
3826  if (!m_hitContainerKey.empty()) {
3827 
3828  if (i % m_nDrawers < listSize)
3829  ATH_MSG_DEBUG( "Adding G4 corrected hit info for " << suffixArr[i] );
3830 
3831  m_ntuplePtr->Branch(("EhitSim"+suffixArr[i]).c_str(),&m_ehitCnt.back(),("eHitSim"+suffixArr[i]+"[48]/F").c_str());
3832  m_ntuplePtr->Branch(("ThitSim"+suffixArr[i]).c_str(),&m_thitCnt.back(),("tHitSim"+suffixArr[i]+"[48]/F").c_str());
3833  }
3834  }
3835  }
3836  }
3837 }
3838 
3843 
3845 {
3850 }
3851 
3852 template<typename T>
3854  std::fill(vec.begin(), vec.end(), static_cast<T>(-1));
3855 }
3856 
3857 template<typename T, size_t N>
3858 void TileTBAANtuple::clear_init_minus1(std::vector<std::array<T,N>>& vec) {
3859  for (std::array<T,N>& arr : vec) {
3860  std::fill(arr.begin(), arr.end(), static_cast<T>(-1));
3861  }
3862 }
3863 
3864 template<typename T, size_t N>
3865 void TileTBAANtuple::clear_init_zero(std::vector<std::array<T,N>>& vec) {
3866  for (std::array<T,N>& arr : vec) {
3867  std::fill(arr.begin(), arr.end(), static_cast<T>(0));
3868  }
3869 }
3870 
3871 void TileTBAANtuple::clear_samples(std::vector<std::unique_ptr<int []>> & vec, const std::vector<int>& nsamples, int nchan)
3872 {
3873  for (unsigned int i = 0; i < vec.size(); ++i) {
3874  std::fill(vec[i].get(), vec[i].get() + nsamples.at(i) * nchan, -1);
3875  }
3876 }
3877 
3879  // Setup default value for the following properties, if they are not setup via JO
3880  setupPropertyDefaultValue(m_beamBC1X1, -0.938, "BC1X1");
3881  setupPropertyDefaultValue(m_beamBC1X2, 0.1747, "BC1X2");
3882  setupPropertyDefaultValue(m_beamBC1Y1, 0.125, "BC1Y1");
3883  setupPropertyDefaultValue(m_beamBC1Y2, 0.1765, "BC1Y2");
3884  setupPropertyDefaultValue(m_beamBC1Z, 13788.0, "BC1Z");
3885  setupPropertyDefaultValue(m_beamBC1Z_0, 13788.0, "BC1Z_0");
3886  setupPropertyDefaultValue(m_beamBC1Z_90, 13788.0, "BC1Z_90");
3887  setupPropertyDefaultValue(m_beamBC1Z_min90, 13788.0, "BC1Z_min90");
3888 
3889  setupPropertyDefaultValue(m_beamBC2X1, -0.9369, "BC2X1");
3890  setupPropertyDefaultValue(m_beamBC2X2, 0.191, "BC2X2");
3891  setupPropertyDefaultValue(m_beamBC2Y1, -1.29, "BC2Y1");
3892  setupPropertyDefaultValue(m_beamBC2Y2, 0.187, "BC2Y2");
3893  setupPropertyDefaultValue(m_beamBC2Z, 9411.0, "BC2Z");
3894  setupPropertyDefaultValue(m_beamBC2Z_0, 9411.0, "BC2Z_0");
3895  setupPropertyDefaultValue(m_beamBC2Z_90, 9411.0, "BC2Z_90");
3896  setupPropertyDefaultValue(m_beamBC2Z_min90, 9411.0, "BC2Z_min90");
3897 }
3898 
3900  setupPropertyDefaultValue(m_beamBC1X1, -0.0462586, "BC1X1");
3901  setupPropertyDefaultValue(m_beamBC1X2, -0.175666, "BC1X2");
3902  setupPropertyDefaultValue(m_beamBC1Y1, -0.051923, "BC1Y1");
3903  setupPropertyDefaultValue(m_beamBC1Y2, -0.176809, "BC1Y2");
3904  setupPropertyDefaultValue(m_beamBC1Z, 13000. + 2760, "BC1Z");
3905  setupPropertyDefaultValue(m_beamBC1Z_0, 13788.0, "BC1Z_0");
3906  setupPropertyDefaultValue(m_beamBC1Z_90, 13788.0, "BC1Z_90");
3907  setupPropertyDefaultValue(m_beamBC1Z_min90, 13788.0, "BC1Z_min90");
3908 
3909  setupPropertyDefaultValue(m_beamBC2X1, 0.25202, "BC2X1");
3910  setupPropertyDefaultValue(m_beamBC2X2, -0.18053, "BC2X2");
3911  setupPropertyDefaultValue(m_beamBC2Y1, 0.0431688, "BC2Y1");
3912  setupPropertyDefaultValue(m_beamBC2Y2, -0.181128, "BC2Y2");
3913  setupPropertyDefaultValue(m_beamBC2Z, 2760, "BC2Z");
3914  setupPropertyDefaultValue(m_beamBC2Z_0, 9411.0, "BC2Z_0");
3915  setupPropertyDefaultValue(m_beamBC2Z_90, 9411.0, "BC2Z_90");
3916  setupPropertyDefaultValue(m_beamBC2Z_min90, 9411.0, "BC2Z_min90");
3917 }
3918 
3920  // 2016 settings:
3921  //
3922  // https://pcata007.cern.ch/elog/TB2016/88
3923  //
3924  //
3925  // The calibration has been done with the following runs :
3926  // BC1:
3927  // Center : 610212
3928  // Left/up : 610210
3929  // Right/down : 610209
3930  //
3931  // BC2:
3932  // Center : 610256
3933  // Left/up : 610321
3934  // Right/down : 610320
3935  //
3936  // Here are the new constants :
3937  //
3938  // BC1
3939  // horizontal slope = -0.171928
3940  // horizontal offset = -0.047624
3941  //
3942  // vertical slope = -0.172942
3943  // vertical offset = -0.0958677
3944  //
3945  // BC2
3946  // horizontal slope = -0.175698
3947  // horizontal offset = -1.04599
3948  //
3949  // vertical slope = -0.174535
3950  // vertical offset = -3.10666
3951 
3952  // June 2016 calibration
3953  //m_beamBC1X1 = -0.047624;
3954  //m_beamBC1X2 = -0.171928;
3955  //m_beamBC1Y1 = -0.0958677;
3956  //m_beamBC1Y2 = -0.172942;
3957  //m_beamBC1Z = 13000. + 2760 /* 2600. */;
3958 
3959  //m_beamBC2X1 = -1.04599;
3960  //m_beamBC2X2 = -0.175698;
3961  //m_beamBC2Y1 = -3.10666;
3962  //m_beamBC2Y2 = -0.174535;
3963  //m_beamBC2Z = 2760 /* 2600. */;
3964 
3965  // September 2016 calibration, https://pcata007.cern.ch/elog/TB2016/300 (joakim.olsson@cern.ch)
3966  //m_beamBC1X1 = 0.100857923042;
3967  //m_beamBC1X2 = -0.172098;
3968  //m_beamBC1Y1 = -0.133045996607;
3969  //m_beamBC1Y2 = -0.172855178323;
3970  //m_beamBC1Z = 13000. + 2760 /* 2600. */;
3971  //
3972  //m_beamBC2X1 = 0.271555258578 ;
3973  //m_beamBC2X2 = -0.173463 ;
3974  //m_beamBC2Y1 = 0.305483228502;
3975  //m_beamBC2Y2 = -0.173805131744 ;
3976  //m_beamBC2Z = 2760 /* 2600. */;
3977 
3978  // June 2017 calibration, https://pcata007.cern.ch/elog/TB2017/550 (schae@cern.ch)
3979  //m_beamBC1X1 = 0.153584934082;
3980  //m_beamBC1X2 = -0.175220;
3981  //m_beamBC1Y1 = -0.493246053303;
3982  //m_beamBC1Y2 = -0.176567356723;
3983  //m_beamBC1Z = 13000. + 2760 /* 2600. */;
3984  //
3985  //m_beamBC2X1 = 0.414611893278;
3986  //m_beamBC2X2 = -0.176122;
3987  //m_beamBC2Y1 = 0.150807740888;
3988  //m_beamBC2Y2 = -0.173472808704;
3989  //m_beamBC2Z = 2760 /* 2600. */;
3990 
3991  // August 2017 calibration, https://pcata007.cern.ch/elog/TB2017/550 (schae@cern.ch)
3992  //m_beamBC1X1 = 0.181797;
3993  //m_beamBC1X2 = -0.175657;
3994  //m_beamBC1Y1 = -0.128910;
3995  //m_beamBC1Y2 = -0.175965;
3996  //m_beamBC1Z = 13000. + 2760 /* 2600. */;
3997  //
3998  //m_beamBC2X1 = 0.611502;
3999  //m_beamBC2X2 = -0.183116;
4000  //m_beamBC2Y1 = 0.541212;
4001  //m_beamBC2Y2 = -0.183115;
4002  //m_beamBC2Z = 2760 /* 2600. */;
4003 
4004  // September 2017 calibration, https://pcata007.cern.ch/elog/TB2017/550 (schae@cern.ch)
4005  //m_beamBC1X1 = 0.181797;
4006  //m_beamBC1X2 = -0.175657;
4007  //m_beamBC1Y1 = -0.128910;
4008  //m_beamBC1Y2 = -0.175965;
4009  //m_beamBC1Z = 13000. + 2760 /* 2600. */;
4010 
4011  //m_beamBC2X1 = 0.622896039922;
4012  //m_beamBC2X2 = -0.176735;
4013  //m_beamBC2Y1 = 0.195954125116;
4014  //m_beamBC2Y2 = -0.176182117624;
4015  //m_beamBC2Z = 2760 /* 2600. */;
4016 
4017  // September 2017 calibration with additional precision from Survey
4018  setupPropertyDefaultValue(m_beamBC1X1, 0.681797, "BC1X1");
4019  setupPropertyDefaultValue(m_beamBC1X2, -0.175657, "BC1X2");
4020  setupPropertyDefaultValue(m_beamBC1Y1, -2.02891, "BC1Y1");
4021  setupPropertyDefaultValue(m_beamBC1Y2, -0.175965, "BC1Y2");
4022  setupPropertyDefaultValue(m_beamBC1Z, 17348.8, "BC1Z");
4023  setupPropertyDefaultValue(m_beamBC1Z_0, 17348.8, "BC1Z_0");
4024  setupPropertyDefaultValue(m_beamBC1Z_90, 15594.05, "BC1Z_90");
4025  setupPropertyDefaultValue(m_beamBC1Z_min90, 15571.8, "BC1Z_min90");
4026 
4027  setupPropertyDefaultValue(m_beamBC2X1, -24.377104, "BC2X1");
4028  setupPropertyDefaultValue(m_beamBC2X2, -0.176735, "BC2X2");
4029  setupPropertyDefaultValue(m_beamBC2Y1, 17.895954, "BC2Y1");
4030  setupPropertyDefaultValue(m_beamBC2Y2, -0.176182117624, "BC2Y2");
4031  setupPropertyDefaultValue(m_beamBC2Z, 4404.2, "BC2Z");
4032  setupPropertyDefaultValue(m_beamBC2Z_0, 4420.7, "BC2Z_0");
4033  setupPropertyDefaultValue(m_beamBC2Z_90, 2649.45, "BC2Z_90");
4034  setupPropertyDefaultValue(m_beamBC2Z_min90, 2627.2, "BC2Z_min90");
4035 
4036 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileTBAANtuple::m_sampleflxVec
std::vector< std::unique_ptr< int[]> > m_sampleflxVec
Definition: TileTBAANtuple.h:513
TileTBAANtuple::m_feCRCVec
std::vector< std::array< int, MAX_DMU > > m_feCRCVec
Definition: TileTBAANtuple.h:528
TileTBAANtuple::m_beamBC1Z_0
Gaudi::Property< float > m_beamBC1Z_0
Definition: TileTBAANtuple.h:209
TileTBAANtuple::m_xCha1
float m_xCha1
Definition: TileTBAANtuple.h:486
TileTBAANtuple::m_pedflxoptVec
std::vector< std::array< float, MAX_CHAN > > m_pedflxoptVec
Definition: TileTBAANtuple.h:558
TileTBAANtuple::m_coincTrig4
std::array< unsigned int, 96 > m_coincTrig4
Definition: TileTBAANtuple.h:588
TileRawChannelContainer
Definition: TileRawChannelContainer.h:13
COIN_TRIG7_FRAG
#define COIN_TRIG7_FRAG
Definition: TileTBFrag.h:38
TileSamplingFraction::getSamplingFraction
float getSamplingFraction(unsigned int drawerIdx, unsigned int channel) const
Return Tile Calorimeter sampling fraction.
Definition: TileSamplingFraction.h:53
TileTBAANtuple::m_coincFlag7
int m_coincFlag7
Definition: TileTBAANtuple.h:600
TileTBAANtuple::m_coincTrig3
std::array< unsigned int, 96 > m_coincTrig3
Definition: TileTBAANtuple.h:587
TileTBAANtuple::COINCBOARD_clearBranch
void COINCBOARD_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree COINCBOARD va...
Definition: TileTBAANtuple.cxx:3219
TileTBAANtuple::m_beamIdList
bool m_beamIdList[32]
Definition: TileTBAANtuple.h:607
TileRawChannelUnit
Definition: TileRawChannelUnit.h:13
TileTBAANtuple::m_beamBC0Z
Gaudi::Property< float > m_beamBC0Z
Definition: TileTBAANtuple.h:202
TileTBAANtuple::m_yChN2
float m_yChN2
Definition: TileTBAANtuple.h:480
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TileTBAANtuple::m_ecal
std::array< float, 8 > m_ecal
Definition: TileTBAANtuple.h:372
TileLaserObject::getTDC
int getTDC(const unsigned int j, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:209
TileTBAANtuple::m_treeSize
Gaudi::Property< Long64_t > m_treeSize
Definition: TileTBAANtuple.h:179
TileTBAANtuple::m_mdChargeTimeflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdChargeTimeflxVec
Definition: TileTBAANtuple.h:577
TileTBAANtuple::m_s1cou
uint32_t m_s1cou
Definition: TileTBAANtuple.h:453
TileTBAANtuple::m_calibMode
Gaudi::Property< bool > m_calibMode
Definition: TileTBAANtuple.h:168
TileTBAANtuple::m_beamBC1Y2
Gaudi::Property< float > m_beamBC1Y2
Definition: TileTBAANtuple.h:207
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
COMMON_TDC2_FRAG
#define COMMON_TDC2_FRAG
Definition: TileTBFrag.h:47
TileTBAANtuple::m_las_D4_AlphaPed
double m_las_D4_AlphaPed
Definition: TileTBAANtuple.h:412
TileTBAANtuple::m_coincFlag8
int m_coincFlag8
Definition: TileTBAANtuple.h:601
COMMON_PTN_FRAG
#define COMMON_PTN_FRAG
Definition: TileTBFrag.h:48
TileTBAANtuple::m_BarEne
std::array< float, 3 > m_BarEne
Definition: TileTBAANtuple.h:581
TileTBAANtuple::m_frBCID
std::vector< int > m_frBCID
Definition: TileTBAANtuple.h:363
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
TileTBAANtuple::m_chi2FlatVec
std::vector< std::array< float, MAX_CHAN > > m_chi2FlatVec
Definition: TileTBAANtuple.h:534
TileTBAANtuple::m_cellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
Definition: TileTBAANtuple.h:153
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
TileTBAANtuple::m_DMUSstrobeErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUSstrobeErrVec
Definition: TileTBAANtuple.h:521
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
TileTBAANtuple::m_xChN2
float m_xChN2
Definition: TileTBAANtuple.h:479
TileTBAANtuple::m_las_D4_ADC
int m_las_D4_ADC
Definition: TileTBAANtuple.h:387
TileTBAANtuple::m_las_D1_ADC
int m_las_D1_ADC
Definition: TileTBAANtuple.h:384
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
ADD_FADC_FRAG
#define ADD_FADC_FRAG
Definition: TileTBFrag.h:29
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TileTBAANtuple::m_yChN1
float m_yChN1
Definition: TileTBAANtuple.h:482
TileTBAANtuple::m_gainflxVec
std::vector< std::array< int, MAX_CHAN > > m_gainflxVec
Definition: TileTBAANtuple.h:512
TileTBAANtuple::m_slinkCRCVec
std::vector< std::array< int, 2 > > m_slinkCRCVec
Definition: TileTBAANtuple.h:525
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
TileTBAANtuple::m_muBack
std::array< float, 14 > m_muBack
Definition: TileTBAANtuple.h:368
TileTBAANtuple::m_las_ReqAmp
double m_las_ReqAmp
Definition: TileTBAANtuple.h:381
TileTBAANtuple::m_coincFlag4
int m_coincFlag4
Definition: TileTBAANtuple.h:597
TileTBAANtuple::m_las_PMT1_Ped
double m_las_PMT1_Ped
Definition: TileTBAANtuple.h:425
TileTBAANtuple::checkIsPropertySetup
void checkIsPropertySetup(float property, const std::string &name)
Definition: TileTBAANtuple.h:322
TileTBAANtuple::m_tof
std::array< int, 16 > m_tof
Definition: TileTBAANtuple.h:469
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition: TileCablingService.cxx:24
TileTBAANtuple::m_chi2cVec
std::vector< std::array< float, MAX_CHAN > > m_chi2cVec
Definition: TileTBAANtuple.h:542
TileTBAANtuple::m_mdRunTypeflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdRunTypeflxVec
Definition: TileTBAANtuple.h:572
TileTBAANtuple::m_DMUparityErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUparityErrVec
Definition: TileTBAANtuple.h:518
TileTBAANtuple::m_tscTOF
int m_tscTOF
Definition: TileTBAANtuple.h:475
TileTBAANtuple::m_beamBC2Y2
Gaudi::Property< float > m_beamBC2Y2
Definition: TileTBAANtuple.h:216
TileTBAANtuple::FELIX_addBranch
void FELIX_addBranch(void)
Definition: TileTBAANtuple.cxx:3569
TileTBAANtuple::m_tileToolEmscale
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
Definition: TileTBAANtuple.h:156
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TileTBAANtuple::m_sizeflxVec
std::vector< short > m_sizeflxVec
Definition: TileTBAANtuple.h:510
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
TileTBAANtuple::m_flatRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_flatRawChannelContainerKey
Definition: TileTBAANtuple.h:123
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TileTBAANtuple::m_las_PMT2_Ped
double m_las_PMT2_Ped
Definition: TileTBAANtuple.h:426
TileTBAANtuple::m_drawerFlxMap
std::map< unsigned int, unsigned int, std::less< unsigned int > > m_drawerFlxMap
Definition: TileTBAANtuple.h:604
TileTBAANtuple::m_las_Filt
int m_las_Filt
Definition: TileTBAANtuple.h:380
index
Definition: index.py:1
TileTBAANtuple::m_drawerType
Gaudi::Property< std::vector< int > > m_drawerType
Definition: TileTBAANtuple.h:185
TileTBAANtuple::m_rodBCIDVec
std::vector< short > m_rodBCIDVec
Definition: TileTBAANtuple.h:505
TileTBAANtuple::storeHitVector
StatusCode storeHitVector(const EventContext &ctx)
Definition: TileTBAANtuple.cxx:1915
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
TileTBAANtuple::m_efitVec
std::vector< std::array< float, MAX_CHAN > > m_efitVec
Definition: TileTBAANtuple.h:535
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
TileLaserObject::getPumpDiodeTemp
double getPumpDiodeTemp() const
Definition: TileLaserObject.h:234
TileTBAANtuple::m_laserObjectKey
SG::ReadHandleKey< TileLaserObject > m_laserObjectKey
Definition: TileTBAANtuple.h:144
TileTBAANtuple::m_hitContainerKey
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
Definition: TileTBAANtuple.h:147
TileTBAANtuple::m_evBCID
std::vector< int > m_evBCID
Definition: TileTBAANtuple.h:361
TileTBAANtuple::m_DMUmemoryErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUmemoryErrVec
Definition: TileTBAANtuple.h:519
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
TileTBAANtuple::m_coincTrig7
std::array< unsigned int, 96 > m_coincTrig7
Definition: TileTBAANtuple.h:591
TileTBAANtuple::m_mdBcidflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdBcidflxVec
Definition: TileTBAANtuple.h:570
TileTBAANtuple::m_chi2OptVec
std::vector< std::array< float, MAX_CHAN > > m_chi2OptVec
Definition: TileTBAANtuple.h:546
tree
TChain * tree
Definition: tile_monitor.h:30
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
TileTBAANtuple::m_pedFlatVec
std::vector< std::array< float, MAX_CHAN > > m_pedFlatVec
Definition: TileTBAANtuple.h:533
TileTBAANtuple::CISPAR_addBranch
void CISPAR_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree CISPAR variabl...
Definition: TileTBAANtuple.cxx:2903
AtlasHitsVector
Definition: AtlasHitsVector.h:33
TileTBAANtuple::m_calibrateEnergyThisEvent
bool m_calibrateEnergyThisEvent
Definition: TileTBAANtuple.h:620
TileTBAANtuple::m_btdcNhit
int m_btdcNhit[16]
Definition: TileTBAANtuple.h:476
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TileTBAANtuple::QDC_addBranch
void QDC_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add QDC variables to th...
Definition: TileTBAANtuple.cxx:2661
TileLaserObject::getAlpha
double getAlpha(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:138
CaloID.h
TileTBAANtuple::m_ntuplePtr
TTree * m_ntuplePtr
Definition: TileTBAANtuple.h:345
TileTBAANtuple::m_ROD_DMUBCIDVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUBCIDVec
Definition: TileTBAANtuple.h:561
TileTBAANtuple::m_muBackHit
float m_muBackHit
Definition: TileTBAANtuple.h:366
TileTBAANtuple::m_coincFlag3
int m_coincFlag3
Definition: TileTBAANtuple.h:596
TileTBAANtuple::m_samplingFractionKey
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
Definition: TileTBAANtuple.h:111
WRONG_SAMPLE
#define WRONG_SAMPLE(frag, chan, size)
Definition: TileTBAANtuple.cxx:47
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
TileTBAANtuple::m_xImp_0
float m_xImp_0
Definition: TileTBAANtuple.h:497
TileTBAANtuple::m_mdCapacitorflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdCapacitorflxVec
Definition: TileTBAANtuple.h:578
TileTBAANtuple::m_pedOptVec
std::vector< std::array< float, MAX_CHAN > > m_pedOptVec
Definition: TileTBAANtuple.h:545
PlotCalibFromCool.nchan
nchan
Definition: PlotCalibFromCool.py:564
TileLaserObject::getDiodeCurrOrd
double getDiodeCurrOrd() const
Definition: TileLaserObject.h:219
TileTBAANtuple::m_eta
float m_eta
Definition: TileTBAANtuple.h:611
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TileTBAANtuple::m_ntupleID
Gaudi::Property< std::string > m_ntupleID
Definition: TileTBAANtuple.h:181
TileTBAANtuple::m_rodBCIDflxVec
std::vector< short > m_rodBCIDflxVec
Definition: TileTBAANtuple.h:509
TileHWID::frag
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
Definition: TileHWID.h:181
TileTBAANtuple::m_beamBC0X2
Gaudi::Property< float > m_beamBC0X2
Definition: TileTBAANtuple.h:199
TileTBAANtuple::storeDigitsFlx
StatusCode storeDigitsFlx(const EventContext &ctx, const SG::ReadHandleKey< TileDigitsContainer > &containerKey)
Definition: TileTBAANtuple.cxx:1742
DIGI_PAR_FRAG
#define DIGI_PAR_FRAG
Definition: TileTBFrag.h:41
COIN_TRIG8_FRAG
#define COIN_TRIG8_FRAG
Definition: TileTBFrag.h:39
ADDR_ADC_FRAG
#define ADDR_ADC_FRAG
Definition: TileTBFrag.h:26
TileTBAANtuple::m_drawerMap
std::map< unsigned int, unsigned int, std::less< unsigned int > > m_drawerMap
Definition: TileTBAANtuple.h:603
COMMON_TOF_FRAG
#define COMMON_TOF_FRAG
Definition: TileTBFrag.h:45
Tile_Base_ID::HIGHGAIN
@ HIGHGAIN
Definition: Tile_Base_ID.h:57
TileTBAANtuple::m_muBackSum
float m_muBackSum
Definition: TileTBAANtuple.h:367
TileTBAANtuple::m_finalUnit
Gaudi::Property< int > m_finalUnit
Definition: TileTBAANtuple.h:167
TileTBAANtuple::m_las_D1_AlphaPed
double m_las_D1_AlphaPed
Definition: TileTBAANtuple.h:409
TileTBAANtuple::m_mdModuleflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdModuleflxVec
Definition: TileTBAANtuple.h:571
TileTBAANtuple::m_tfitcVec
std::vector< std::array< float, MAX_CHAN > > m_tfitcVec
Definition: TileTBAANtuple.h:540
TileCalibUtils.h
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
TileTBAANtuple::m_yImp_90
float m_yImp_90
Definition: TileTBAANtuple.h:500
TileRawChannelUnit::OnlineADCcounts
@ OnlineADCcounts
Definition: TileRawChannelUnit.h:21
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
COMMON_ADC1_FRAG
#define COMMON_ADC1_FRAG
Definition: TileTBFrag.h:43
LASE_ADC_FRAG
#define LASE_ADC_FRAG
Definition: TileTBFrag.h:28
TileTBAANtuple::m_evtVec
std::vector< int > m_evtVec
Definition: TileTBAANtuple.h:504
TileTBAANtuple::HIT_addBranch
void HIT_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree HIT variables ...
Definition: TileTBAANtuple.cxx:3758
TileTBAANtuple::m_coincTrig6
std::array< unsigned int, 96 > m_coincTrig6
Definition: TileTBAANtuple.h:590
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TileTBAANtuple::m_las_Temperature
double m_las_Temperature
Definition: TileTBAANtuple.h:431
TileTBAANtuple::TileTBAANtuple
TileTBAANtuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TileTBAANtuple.cxx:82
TileTBAANtuple::m_s2extra
int m_s2extra
Definition: TileTBAANtuple.h:463
TileTBAANtuple::LASER_clearBranch
void LASER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree LASER variabl...
Definition: TileTBAANtuple.cxx:2816
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TileTBAANtuple::m_las_PMT1_ADC
int m_las_PMT1_ADC
Definition: TileTBAANtuple.h:419
TileTBAANtuple::m_yImp_0
float m_yImp_0
Definition: TileTBAANtuple.h:498
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TileTBAANtuple::m_eflxfitVec
std::vector< std::array< float, MAX_CHAN > > m_eflxfitVec
Definition: TileTBAANtuple.h:551
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
TileTBAANtuple::m_xCha0
float m_xCha0
Definition: TileTBAANtuple.h:483
SG::ReadHandleKey< TileRawChannelContainer >
TileTBAANtuple::ntuple_clear
StatusCode ntuple_clear()
Definition: TileTBAANtuple.cxx:2076
TileDigitsContainer
Definition: TileDigitsContainer.h:13
TileHitCollection
Definition: TileHitCollection.h:12
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
TileTBAANtuple::m_las_D3_AlphaPed_RMS
double m_las_D3_AlphaPed_RMS
Definition: TileTBAANtuple.h:416
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
TileTBAANtuple::m_beamBN1X2
Gaudi::Property< float > m_beamBN1X2
Definition: TileTBAANtuple.h:194
HWIdentifier
Definition: HWIdentifier.h:13
TileTBAANtuple::MAX_CHAN
@ MAX_CHAN
Definition: TileTBAANtuple.h:106
TileTBAANtuple::m_DMUheaderVec
std::vector< std::array< uint32_t, MAX_DMU > > m_DMUheaderVec
Definition: TileTBAANtuple.h:516
TileTBAANtuple::m_commonPU
int m_commonPU
Definition: TileTBAANtuple.h:441
TileTBAANtuple::m_muHalo
uint32_t m_muHalo
Definition: TileTBAANtuple.h:460
TileTBAANtuple::m_bsInput
Gaudi::Property< bool > m_bsInput
Definition: TileTBAANtuple.h:171
TileTBAANtuple::ENETOTAL_clearBranch
void ENETOTAL_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree ENETOTAL vari...
Definition: TileTBAANtuple.cxx:3159
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
TileTBAANtuple::m_yCha2_0
float m_yCha2_0
Definition: TileTBAANtuple.h:493
TileTBAANtuple::ntuple_initialize
StatusCode ntuple_initialize(const EventContext &ctx)
Alg standard interface function LF TODO: We could have a problem with the new feature introduced by S...
Definition: TileTBAANtuple.cxx:241
TileTBAANtuple::m_las_MeasAmp
double m_las_MeasAmp
Definition: TileTBAANtuple.h:382
TileTBAANtuple::execute
virtual StatusCode execute() override
Definition: TileTBAANtuple.cxx:468
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileTBAANtuple::m_pedflxfitVec
std::vector< std::array< float, MAX_CHAN > > m_pedflxfitVec
Definition: TileTBAANtuple.h:554
TileHit::size
int size(void) const
Return length of energy/time vectors
Definition: TileSimEvent/TileSimEvent/TileHit.h:94
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
ReadCondHandle.h
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileTBAANtuple::m_xCha2_0
float m_xCha2_0
Definition: TileTBAANtuple.h:492
TileTBAANtuple::m_cher1
uint32_t m_cher1
Definition: TileTBAANtuple.h:456
TileID.h
BEAM_ADC_FRAG
#define BEAM_ADC_FRAG
Definition: TileTBFrag.h:24
TileTBAANtuple::m_useDspUnits
Gaudi::Property< bool > m_useDspUnits
Definition: TileTBAANtuple.h:166
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TileTBAANtuple::m_beamBN2X2
Gaudi::Property< float > m_beamBN2X2
Definition: TileTBAANtuple.h:189
TileTBAANtuple::m_beamBC2Z
Gaudi::Property< float > m_beamBC2Z
Definition: TileTBAANtuple.h:217
TileTBAANtuple::m_mdPedHiflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdPedHiflxVec
Definition: TileTBAANtuple.h:574
TileTBAANtuple::storeDigits
StatusCode storeDigits(const EventContext &ctx, const SG::ReadHandleKey< TileDigitsContainer > &containerKey, const TileDQstatus *dqStatus=nullptr)
/ Fill Ntuple with info from TileDigits / Return true if the collection is empty, / which means that ...
Definition: TileTBAANtuple.cxx:1451
TileTBAANtuple::m_saveFelixData
bool m_saveFelixData
Definition: TileTBAANtuple.h:634
CaloCell_ID.h
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
TileTBAANtuple::clear_samples
void clear_samples(std::vector< std::unique_ptr< int[]>> &vec, const std::vector< int > &nsamples, int nchan=MAX_CHAN)
Definition: TileTBAANtuple.cxx:3871
TileLaserObject::getPMADC
int getPMADC(const unsigned int j, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:195
TileTBAANtuple::m_tflxfitVec
std::vector< std::array< float, MAX_CHAN > > m_tflxfitVec
Definition: TileTBAANtuple.h:552
COMMON_TDC1_FRAG
#define COMMON_TDC1_FRAG
Definition: TileTBFrag.h:46
TileTBAANtuple::ENETOTAL_addBranch
void ENETOTAL_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree ENETOTAL varia...
Definition: TileTBAANtuple.cxx:3143
TileLaserObject::getFiltNumber
int getFiltNumber() const
Definition: TileLaserObject.h:229
TileTBAANtuple::m_lasFlag
int m_lasFlag
Definition: TileTBAANtuple.h:433
TileTBAANtuple::clear_init_zero
void clear_init_zero(std::vector< std::array< T, N >> &vec)
Definition: TileTBAANtuple.cxx:3865
TileTBAANtuple::ECAL_clearBranch
void ECAL_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree ECAL variable...
Definition: TileTBAANtuple.cxx:2712
TileTBAANtuple::m_eneVec
std::vector< std::array< float, MAX_CHAN > > m_eneVec
Definition: TileTBAANtuple.h:531
TileLaserObject::getSigmaPedAlpha
double getSigmaPedAlpha(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:180
TileTBAANtuple::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: TileTBAANtuple.h:342
TileTBAANtuple::m_beamBN1Y2
Gaudi::Property< float > m_beamBN1Y2
Definition: TileTBAANtuple.h:196
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TileTBAANtuple::m_dmuMaskVec
std::vector< std::array< int, 2 > > m_dmuMaskVec
Definition: TileTBAANtuple.h:524
TileTBAANtuple::m_yImp_min90
float m_yImp_min90
Definition: TileTBAANtuple.h:502
TileTBAANtuple::m_s3extra
int m_s3extra
Definition: TileTBAANtuple.h:464
TileTBAANtuple::m_beamBN1X1
Gaudi::Property< float > m_beamBN1X1
Definition: TileTBAANtuple.h:193
TileTBAANtuple::m_dspRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_dspRawChannelContainerKey
Definition: TileTBAANtuple.h:132
TileTBAANtuple::m_cher3
uint32_t m_cher3
Definition: TileTBAANtuple.h:458
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TileTBAANtuple::FELIX_clearBranch
void FELIX_clearBranch(void)
Definition: TileTBAANtuple.cxx:3721
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Definition: TileDQstatus.h:49
TileTBAANtuple::MAX_DMU
@ MAX_DMU
Definition: TileTBAANtuple.h:106
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
TileTBAANtuple::setupBeamChambersBeforeTB2015
void setupBeamChambersBeforeTB2015(void)
Definition: TileTBAANtuple.cxx:3878
TileTBAANtuple::m_beamBN2Y1
Gaudi::Property< float > m_beamBN2Y1
Definition: TileTBAANtuple.h:190
TileTBAANtuple::m_yCha1_0
float m_yCha1_0
Definition: TileTBAANtuple.h:491
FRAG_FOUND
#define FRAG_FOUND(frag, chan, size)
Definition: TileTBAANtuple.cxx:58
TileTBAANtuple::m_las3
float m_las3
Definition: TileTBAANtuple.h:437
TileTBAANtuple::m_tjitter
int m_tjitter
Definition: TileTBAANtuple.h:474
TileTBAANtuple::m_ExtEne
std::array< float, 3 > m_ExtEne
Definition: TileTBAANtuple.h:582
TileTBAANtuple::m_evTime
int m_evTime
Definition: TileTBAANtuple.h:352
TileTBAANtuple::m_calibrateEnergy
Gaudi::Property< bool > m_calibrateEnergy
Definition: TileTBAANtuple.h:165
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
TileTBAANtuple::m_beamBC2Z_0
Gaudi::Property< float > m_beamBC2Z_0
Definition: TileTBAANtuple.h:218
TileTBAANtuple::drawerMap_iterator
std::map< unsigned int, unsigned int, std::less< unsigned int > >::iterator drawerMap_iterator
Definition: TileTBAANtuple.h:605
TileHWID.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileTBAANtuple::setupBeamChambersTB2015
void setupBeamChambersTB2015(void)
Definition: TileTBAANtuple.cxx:3899
TileTBAANtuple::m_btdc2
std::array< int, 16 > m_btdc2
Definition: TileTBAANtuple.h:471
Trk::index1
@ index1
Definition: BoundarySurfaceFace.h:48
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
TileTBAANtuple::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileTBAANtuple.h:627
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
TileTBAANtuple::m_beamBC1X2
Gaudi::Property< float > m_beamBC1X2
Definition: TileTBAANtuple.h:205
TileTBAANtuple::m_las_D1_Ped
double m_las_D1_Ped
Definition: TileTBAANtuple.h:389
TileCablingService.h
TileTBAANtuple::m_tDspVec
std::vector< std::array< float, MAX_CHAN > > m_tDspVec
Definition: TileTBAANtuple.h:548
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
TileSamplingFraction
Condition object to keep and provide Tile Calorimeter sampling fraction and number of photoelectrons.
Definition: TileSamplingFraction.h:16
TileTBAANtuple::m_runNumber
int m_runNumber
Definition: TileTBAANtuple.h:610
TileTBAANtuple::setupPropertyDefaultValue
void setupPropertyDefaultValue(float property, float defaultValue, const std::string &name)
Definition: TileTBAANtuple.h:328
COIN_TRIG6_FRAG
#define COIN_TRIG6_FRAG
Definition: TileTBFrag.h:37
TileTBAANtuple::m_nSamplesFlx
Gaudi::Property< int > m_nSamplesFlx
Definition: TileTBAANtuple.h:174
TileTBAANtuple::m_theta
float m_theta
Definition: TileTBAANtuple.h:612
lumiFormat.i
int i
Definition: lumiFormat.py:92
TileTBAANtuple::m_chi2Vec
std::vector< std::array< float, MAX_CHAN > > m_chi2Vec
Definition: TileTBAANtuple.h:538
COIN_TRIG1_FRAG
#define COIN_TRIG1_FRAG
Definition: TileTBFrag.h:32
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TileTBAANtuple::m_evType
std::vector< int > m_evType
Definition: TileTBAANtuple.h:362
TileTBAANtuple::storeHitContainer
StatusCode storeHitContainer(const EventContext &ctx)
/ Fill Ntuple with MC truth info from simulation / Namely, hit energies corrected by photoelectron st...
Definition: TileTBAANtuple.cxx:1960
TileTBAANtuple::m_flxOptRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_flxOptRawChannelContainerKey
Definition: TileTBAANtuple.h:141
TileTBAANtuple::m_tileID
const TileID * m_tileID
Definition: TileTBAANtuple.h:626
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
TileTBAANtuple::m_evtflxVec
std::vector< int > m_evtflxVec
Definition: TileTBAANtuple.h:508
TileTBAANtuple::m_sampleVec
std::vector< std::unique_ptr< int[]> > m_sampleVec
Definition: TileTBAANtuple.h:527
TileTBAANtuple::m_las0
float m_las0
Definition: TileTBAANtuple.h:434
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
TileTBAANtuple::m_beamBN1Y1
Gaudi::Property< float > m_beamBN1Y1
Definition: TileTBAANtuple.h:195
TileRawDataContainer::get_bsflags
uint32_t get_bsflags() const
Definition: TileRawDataContainer.h:64
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
TileTBAANtuple::BEAM_addBranch
void BEAM_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree BEAM variables...
Definition: TileTBAANtuple.cxx:2929
WRONG_CHANNEL
#define WRONG_CHANNEL(frag, chan)
Definition: TileTBAANtuple.cxx:53
TileRawChannelUnit::OnlineOffset
@ OnlineOffset
Definition: TileRawChannelUnit.h:25
TileTBAANtuple::m_btdcNchMultiHit
int m_btdcNchMultiHit[2]
Definition: TileTBAANtuple.h:477
TileTBAANtuple::digiChannel2PMT
int digiChannel2PMT(int fragType, int chan)
Definition: TileTBAANtuple.h:296
TileTBAANtuple::m_muTag
uint32_t m_muTag
Definition: TileTBAANtuple.h:459
TileTBAANtuple::m_btdc
std::vector< std::vector< int > > * m_btdc
Definition: TileTBAANtuple.h:473
TileTBAANtuple::m_eventsPerFile
Gaudi::Property< int > m_eventsPerFile
Definition: TileTBAANtuple.h:178
TileTBAANtuple::m_ROD_DMUMaskVec
std::vector< std::array< short, 2 > > m_ROD_DMUMaskVec
Definition: TileTBAANtuple.h:567
TileTBAANtuple::m_mdPedLoflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdPedLoflxVec
Definition: TileTBAANtuple.h:573
TileTBAANtuple::initListFlx
StatusCode initListFlx(const EventContext &ctx)
Definition: TileTBAANtuple.cxx:2412
TileTBAANtuple::m_beamBN2Y2
Gaudi::Property< float > m_beamBN2Y2
Definition: TileTBAANtuple.h:191
TileTBAANtuple::HIT_clearBranch
void HIT_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// /Clear Tree HIT variable...
Definition: TileTBAANtuple.cxx:3844
TileTBAANtuple::setupBeamChambersTB2016_2020
void setupBeamChambersTB2016_2020(void)
Definition: TileTBAANtuple.cxx:3919
TileTBAANtuple::CheckDMUParity
short CheckDMUParity(uint32_t header)
Parity of the DMU header should be odd.
Definition: TileTBAANtuple.h:311
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
TileRawChannelUnit::MegaElectronVolts
@ MegaElectronVolts
Definition: TileRawChannelUnit.h:20
TileTBAANtuple::m_nDrawersFlx
Gaudi::Property< unsigned int > m_nDrawersFlx
Definition: TileTBAANtuple.h:176
TileTBAANtuple::m_drawerList
Gaudi::Property< std::vector< std::string > > m_drawerList
Definition: TileTBAANtuple.h:184
TileTBAANtuple::m_digitsContainerKey
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
Definition: TileTBAANtuple.h:114
TileRawChannel
Definition: TileRawChannel.h:35
TileTBAANtuple::m_yImp
float m_yImp
Definition: TileTBAANtuple.h:495
TileTBAANtuple::m_beamElemContainerKey
SG::ReadHandleKey< TileBeamElemContainer > m_beamElemContainerKey
Definition: TileTBAANtuple.h:120
TileTBAANtuple::initialize
virtual StatusCode initialize() override
Definition: TileTBAANtuple.cxx:209
TileTBAANtuple::m_streamName
Gaudi::Property< std::string > m_streamName
Definition: TileTBAANtuple.h:180
TileTBAANtuple::MAX_MINIDRAWER
@ MAX_MINIDRAWER
Definition: TileTBAANtuple.h:106
TileTBAANtuple::m_beamBC2Z_min90
Gaudi::Property< float > m_beamBC2Z_min90
Definition: TileTBAANtuple.h:220
TileTBAANtuple::m_ehitVec
std::vector< std::array< float, MAX_CHAN > > m_ehitVec
Definition: TileTBAANtuple.h:615
TileTBAANtuple::m_l1ID
std::vector< int > m_l1ID
Definition: TileTBAANtuple.h:359
TileTBAANtuple::m_coincTrig2
std::array< unsigned int, 96 > m_coincTrig2
Definition: TileTBAANtuple.h:586
TileTBAANtuple.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:242
TileTBAANtuple::m_beamBC1Z
Gaudi::Property< float > m_beamBC1Z
Definition: TileTBAANtuple.h:208
BEAM_TDC_FRAG
#define BEAM_TDC_FRAG
Definition: TileTBFrag.h:23
TileTBAANtuple::storeCells
StatusCode storeCells(const EventContext &ctx)
Definition: TileTBAANtuple.cxx:2236
TileTBAANtuple::m_beamBC2X1
Gaudi::Property< float > m_beamBC2X1
Definition: TileTBAANtuple.h:213
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TileTBAANtuple::m_s3cou
uint32_t m_s3cou
Definition: TileTBAANtuple.h:455
TileTBAANtuple::m_cabling
const TileCablingService * m_cabling
Definition: TileTBAANtuple.h:628
TrigInDetValidation_Base.malloc
malloc
Definition: TrigInDetValidation_Base.py:131
TileTBAANtuple::m_completeNtuple
Gaudi::Property< bool > m_completeNtuple
Definition: TileTBAANtuple.h:170
TileTBAANtuple::initNTuple
StatusCode initNTuple(void)
Definition: TileTBAANtuple.cxx:2126
TileTBAANtuple::m_beamBC0Y1
Gaudi::Property< float > m_beamBC0Y1
Definition: TileTBAANtuple.h:200
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
TileTBAANtuple::m_nSamplesInDrawerMap
std::map< int, int > m_nSamplesInDrawerMap
Definition: TileTBAANtuple.h:630
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
TileTBAANtuple::m_sizeVec
std::vector< short > m_sizeVec
Definition: TileTBAANtuple.h:506
TileTBAANtuple::m_beamBN2X1
Gaudi::Property< float > m_beamBN2X1
Definition: TileTBAANtuple.h:188
TileTBAANtuple::m_coincFlag6
int m_coincFlag6
Definition: TileTBAANtuple.h:599
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
TileTBAANtuple::MUON_clearBranch
void MUON_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree MUON variable...
Definition: TileTBAANtuple.cxx:2700
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TileTBAANtuple::m_evtNr
int m_evtNr
Definition: TileTBAANtuple.h:349
TileTBAANtuple::m_coincTrig5
std::array< unsigned int, 96 > m_coincTrig5
Definition: TileTBAANtuple.h:589
TileTBAANtuple::m_digitsContainerFlxKey
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerFlxKey
Definition: TileTBAANtuple.h:117
TileTBAANtuple::m_nSamplesInDrawer
std::vector< int > m_nSamplesInDrawer
Definition: TileTBAANtuple.h:632
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileTBAANtuple::m_DMUformatErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUformatErrVec
Definition: TileTBAANtuple.h:517
TileTBAANtuple::m_nDrawers
Gaudi::Property< unsigned int > m_nDrawers
Definition: TileTBAANtuple.h:175
TileBeamElemContainer
Definition: TileBeamElemContainer.h:13
TileTBAANtuple::DIGI_addBranch
void DIGI_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree DIGI variables...
Definition: TileTBAANtuple.cxx:3232
TileTBAANtuple::m_qdc
std::array< uint32_t, 33 > m_qdc
Definition: TileTBAANtuple.h:375
TileTBAANtuple::m_las_D4_Ped
double m_las_D4_Ped
Definition: TileTBAANtuple.h:392
TileRawChannelUnit::UNIT
UNIT
Definition: TileRawChannelUnit.h:16
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
TileTBAANtuple::m_xImp_90
float m_xImp_90
Definition: TileTBAANtuple.h:499
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
AthAlgorithm
Definition: AthAlgorithm.h:47
TileHitContainer
Definition: TileHitContainer.h:13
TileTBAANtuple::m_beamBC1X1
Gaudi::Property< float > m_beamBC1X1
Definition: TileTBAANtuple.h:204
TileTBAANtuple::ADDER_addBranch
void ADDER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree ADDER variable...
Definition: TileTBAANtuple.cxx:2868
TileTBAANtuple::m_hitVectorKey
SG::ReadHandleKey< TileHitVector > m_hitVectorKey
Definition: TileTBAANtuple.h:150
min
#define min(a, b)
Definition: cfImp.cxx:40
TileTBAANtuple::storeRawChannels
StatusCode storeRawChannels(const EventContext &ctx, const SG::ReadHandleKey< TileRawChannelContainer > &containerKey, bool calibMode, std::vector< std::array< float, MAX_CHAN >> *eneVec, std::vector< std::array< float, MAX_CHAN >> *timeVec, std::vector< std::array< float, MAX_CHAN >> *chi2Vec, std::vector< std::array< float, MAX_CHAN >> *pedVec, bool saveDQstatus=false)
/ Fill ntuple with data from TRC.
Definition: TileTBAANtuple.cxx:1289
TileTBAANtuple::m_thitCnt
std::vector< std::array< float, MAX_CHAN > > m_thitCnt
Definition: TileTBAANtuple.h:618
TileTBAANtuple::m_fitRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_fitRawChannelContainerKey
Definition: TileTBAANtuple.h:126
TileTBAANtuple::m_las_PMT2_TDC
int m_las_PMT2_TDC
Definition: TileTBAANtuple.h:423
TileTBAANtuple::m_las_BCID
int m_las_BCID
Definition: TileTBAANtuple.h:378
LASE_PTN_FRAG
#define LASE_PTN_FRAG
Definition: TileTBFrag.h:27
TileTBAANtuple::QDC_clearBranch
void QDC_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree QDC variables
Definition: TileTBAANtuple.cxx:2723
TileDigitsCollection
Definition: TileDigitsCollection.h:18
TileLaserObject::getDiodeSigmaPedestal
double getDiodeSigmaPedestal(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:123
TileTBAANtuple::COINCBOARD_addBranch
void COINCBOARD_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree COINCBOARD var...
Definition: TileTBAANtuple.cxx:3171
TileTBAANtuple::m_las_D3_AlphaPed
double m_las_D3_AlphaPed
Definition: TileTBAANtuple.h:411
TileTBAANtuple::m_tfitVec
std::vector< std::array< float, MAX_CHAN > > m_tfitVec
Definition: TileTBAANtuple.h:536
TileTBAANtuple::m_fitcRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_fitcRawChannelContainerKey
Definition: TileTBAANtuple.h:135
PathResolver.h
TileTBAANtuple::m_s2cou
uint32_t m_s2cou
Definition: TileTBAANtuple.h:454
Trk::index2
@ index2
Definition: BoundarySurfaceFace.h:49
TileTBAANtuple::m_rodCRCVec
std::vector< std::array< int, MAX_DMU > > m_rodCRCVec
Definition: TileTBAANtuple.h:529
TileTBAANtuple::m_ROD_GlobalCRCVec
std::vector< short > m_ROD_GlobalCRCVec
Definition: TileTBAANtuple.h:560
TileDQstatus::checkSampleParityErr
int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word parity error
Definition: TileDQstatus.h:125
TileTBAANtuple::m_cispar
int m_cispar[16]
Definition: TileTBAANtuple.h:450
TileTBAANtuple::m_xImp
float m_xImp
Definition: TileTBAANtuple.h:494
TileTBAANtuple::ECAL_addBranch
void ECAL_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add ECAL variables to t...
Definition: TileTBAANtuple.cxx:2646
TileTBAANtuple::m_las_D2_AlphaPed
double m_las_D2_AlphaPed
Definition: TileTBAANtuple.h:410
TileCablingService::getTestBeam
bool getTestBeam() const
Definition: TileCablingService.h:274
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TileDigits
Definition: TileDigits.h:30
TileTBAANtuple::m_ROD_DMUHeadformatErrVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUHeadformatErrVec
Definition: TileTBAANtuple.h:565
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
TileLaserObject::getBCID
int getBCID() const
Definition: TileLaserObject.h:335
TileTBAANtuple::m_las2
float m_las2
Definition: TileTBAANtuple.h:436
MAX_DRAWERS
#define MAX_DRAWERS
Definition: TileTBAANtuple.cxx:73
TileLaserObject::getDiodeADC
int getDiodeADC(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:95
TileTBAANtuple::m_adder
int ** m_adder
Definition: TileTBAANtuple.h:444
TileTBAANtuple::m_coincFlag2
int m_coincFlag2
Definition: TileTBAANtuple.h:595
TileTBAANtuple::m_beamFragList
Gaudi::Property< std::vector< std::string > > m_beamFragList
Definition: TileTBAANtuple.h:186
TileRawChannelCollection
Definition: TileRawChannelCollection.h:12
TileDQstatus::checkHeaderParityErr
int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word parity error
Definition: TileDQstatus.h:117
TileTBAANtuple::m_xCha2
float m_xCha2
Definition: TileTBAANtuple.h:488
TileTBAANtuple::m_coincTrig1
std::array< unsigned int, 96 > m_coincTrig1
Definition: TileTBAANtuple.h:585
TileTBAANtuple::m_las_D2_ADC
int m_las_D2_ADC
Definition: TileTBAANtuple.h:385
TileTBAANtuple::TRIGGER_addBranch
void TRIGGER_addBranch(void)
///////////////////////////////////////////////////////////////////////////
Definition: TileTBAANtuple.cxx:2579
TileTBAANtuple::clear_init_minus1
void clear_init_minus1(std::vector< T > &vec)
Definition: TileTBAANtuple.cxx:3853
TileTBAANtuple::m_btdc1
std::array< int, 16 > m_btdc1
Definition: TileTBAANtuple.h:470
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TileTBAANtuple::LASER_addBranch
void LASER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree LASER variable...
Definition: TileTBAANtuple.cxx:2735
TileTBAANtuple::m_las_D2_Alpha
double m_las_D2_Alpha
Definition: TileTBAANtuple.h:400
TileTBAANtuple::m_lasExtra
std::array< float, 4 > m_lasExtra
Definition: TileTBAANtuple.h:438
TileTBAANtuple::m_mdL1idflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdL1idflxVec
Definition: TileTBAANtuple.h:569
TileTBAANtuple::m_coincFlag1
int m_coincFlag1
Definition: TileTBAANtuple.h:594
TileTBFrag.h
TileHit
Definition: TileSimEvent/TileSimEvent/TileHit.h:30
TileTBAANtuple::m_beamBC1Z_min90
Gaudi::Property< float > m_beamBC1Z_min90
Definition: TileTBAANtuple.h:211
TileTBAANtuple::MUON_addBranch
void MUON_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add MUON variables to t...
Definition: TileTBAANtuple.cxx:2618
TileLaserObject::getPMPedestal
double getPMPedestal(const unsigned int j, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:223
TileTBAANtuple::BEAM_clearBranch
void BEAM_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree BEAM variable...
Definition: TileTBAANtuple.cxx:3051
TileTBAANtuple::m_yCha1
float m_yCha1
Definition: TileTBAANtuple.h:487
TileTBAANtuple::m_las_D1_Ped_RMS
double m_las_D1_Ped_RMS
Definition: TileTBAANtuple.h:394
TileTBAANtuple::m_etaFileName
Gaudi::Property< std::string > m_etaFileName
Definition: TileTBAANtuple.h:223
TileTBAANtuple::m_run
int m_run
Definition: TileTBAANtuple.h:353
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
TileTBAANtuple::m_eDspVec
std::vector< std::array< float, MAX_CHAN > > m_eDspVec
Definition: TileTBAANtuple.h:547
TileTBAANtuple::m_tOptVec
std::vector< std::array< float, MAX_CHAN > > m_tOptVec
Definition: TileTBAANtuple.h:544
TileLaserObject::getDiodeCurrMeas
double getDiodeCurrMeas() const
Definition: TileLaserObject.h:224
TileTBAANtuple::m_radius
Gaudi::Property< float > m_radius
Definition: TileTBAANtuple.h:222
TileTBAANtuple::m_beamBC1Y1
Gaudi::Property< float > m_beamBC1Y1
Definition: TileTBAANtuple.h:206
EventInfo.h
TileTBAANtuple::m_GapEne
std::array< float, 3 > m_GapEne
Definition: TileTBAANtuple.h:583
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
TileTBAANtuple::m_las_D3_Alpha
double m_las_D3_Alpha
Definition: TileTBAANtuple.h:401
ReadOfcFromCool.nsamples
nsamples
Definition: ReadOfcFromCool.py:115
TileTBAANtuple::m_pedfitcVec
std::vector< std::array< float, MAX_CHAN > > m_pedfitcVec
Definition: TileTBAANtuple.h:541
MUON_ADC_FRAG
#define MUON_ADC_FRAG
Definition: TileTBFrag.h:25
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
TileTBAANtuple::m_nSamplesFlxInDrawer
std::vector< int > m_nSamplesFlxInDrawer
Definition: TileTBAANtuple.h:633
python.PyAthena.v
v
Definition: PyAthena.py:157
TileTBAANtuple::m_las_D1_AlphaPed_RMS
double m_las_D1_AlphaPed_RMS
Definition: TileTBAANtuple.h:414
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
TileTBAANtuple::m_las_PMT1_TDC
int m_las_PMT1_TDC
Definition: TileTBAANtuple.h:422
TileTBAANtuple::m_tflxoptVec
std::vector< std::array< float, MAX_CHAN > > m_tflxoptVec
Definition: TileTBAANtuple.h:556
TileTBAANtuple::m_timeAdd
std::array< float, 16 > m_timeAdd
Definition: TileTBAANtuple.h:447
COIN_TRIG3_FRAG
#define COIN_TRIG3_FRAG
Definition: TileTBFrag.h:34
TileTBAANtuple::m_beamBC2X2
Gaudi::Property< float > m_beamBC2X2
Definition: TileTBAANtuple.h:214
DeMoScan.index
string index
Definition: DeMoScan.py:362
TileTBAANtuple::m_las_D3_ADC
int m_las_D3_ADC
Definition: TileTBAANtuple.h:386
TileTBAANtuple::m_bcidVec
std::vector< std::array< int, MAX_DMU > > m_bcidVec
Definition: TileTBAANtuple.h:515
TileTBAANtuple::m_sc1
int m_sc1
Definition: TileTBAANtuple.h:466
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TileTBAANtuple::m_las_D4_Alpha_RMS
double m_las_D4_Alpha_RMS
Definition: TileTBAANtuple.h:407
TileTBAANtuple::m_DMUHeadparityErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUHeadparityErrVec
Definition: TileTBAANtuple.h:522
TileTBAANtuple::m_dspUnit
TileRawChannelUnit::UNIT m_dspUnit
Unit for TileRawChannels in DSP.
Definition: TileTBAANtuple.h:623
TileTBAANtuple::TRIGGER_clearBranch
void TRIGGER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree TRIGGER varia...
Definition: TileTBAANtuple.cxx:2678
TileTBAANtuple::m_rchUnit
TileRawChannelUnit::UNIT m_rchUnit
Unit for TileRawChannels (ADC, pCb, MeV)
Definition: TileTBAANtuple.h:622
TileTBAANtuple::m_muCalib
std::array< float, 2 > m_muCalib
Definition: TileTBAANtuple.h:369
TileTBAANtuple::storeLaser
StatusCode storeLaser(const EventContext &ctx)
Definition: TileTBAANtuple.cxx:562
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
TileTBAANtuple::m_las_D2_Ped
double m_las_D2_Ped
Definition: TileTBAANtuple.h:390
COIN_TRIG2_FRAG
#define COIN_TRIG2_FRAG
Definition: TileTBFrag.h:33
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
TileRawDataContainer::get_unit
UNIT get_unit() const
Definition: TileRawDataContainer.h:60
TileHit::pmt_HWID
HWIdentifier pmt_HWID(void) const
Return pmt hardware ID (== channel ID)
Definition: TileHit.cxx:125
TileTBAANtuple::m_ROD_DMUSstrobeErrVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUSstrobeErrVec
Definition: TileTBAANtuple.h:563
lumiFormat.fill
fill
Definition: lumiFormat.py:111
TileTBAANtuple::getEta
void getEta(void)
Definition: TileTBAANtuple.cxx:2503
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileTBAANtuple::m_las_PMT2_ADC
int m_las_PMT2_ADC
Definition: TileTBAANtuple.h:420
TileHit::energy
float energy(int ind=0) const
Return energy of ind-th sub-hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:90
TileTBAANtuple::m_cher2
uint32_t m_cher2
Definition: TileTBAANtuple.h:457
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
TileTBAANtuple::m_unpackAdder
Gaudi::Property< bool > m_unpackAdder
Definition: TileTBAANtuple.h:169
TileTBAANtuple::m_mdRunflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdRunflxVec
Definition: TileTBAANtuple.h:575
TileTBAANtuple::m_optRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_optRawChannelContainerKey
Definition: TileTBAANtuple.h:129
TileLaserObject::getPMSigmaPedestal
double getPMSigmaPedestal(const unsigned int j, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:237
TileBeamElemContByteStreamCnv.h
TileTBAANtuple::m_beamBC0Y2
Gaudi::Property< float > m_beamBC0Y2
Definition: TileTBAANtuple.h:201
DEBUG
#define DEBUG
Definition: page_access.h:11
F
#define F(x, y, z)
Definition: MD5.cxx:112
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TileLaserObject::getDiodePedestal
double getDiodePedestal(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:109
TileTBAANtuple::m_yCha0
float m_yCha0
Definition: TileTBAANtuple.h:484
TileTBAANtuple::m_beamBC2Z_90
Gaudi::Property< float > m_beamBC2Z_90
Definition: TileTBAANtuple.h:219
TileTBAANtuple::m_pmtOrder
Gaudi::Property< bool > m_pmtOrder
Definition: TileTBAANtuple.h:172
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TileTBAANtuple::m_nSamples
Gaudi::Property< int > m_nSamples
Definition: TileTBAANtuple.h:173
TileTBAANtuple::m_chi2flxoptVec
std::vector< std::array< float, MAX_CHAN > > m_chi2flxoptVec
Definition: TileTBAANtuple.h:557
TileTBAANtuple::m_coincFlag5
int m_coincFlag5
Definition: TileTBAANtuple.h:598
TileTBAANtuple::m_beamBC2Y1
Gaudi::Property< float > m_beamBC2Y1
Definition: TileTBAANtuple.h:215
TileTBAANtuple::m_ROD_DMUmemoryErrVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUmemoryErrVec
Definition: TileTBAANtuple.h:562
TileTBAANtuple::m_chi2DspVec
std::vector< std::array< float, MAX_CHAN > > m_chi2DspVec
Definition: TileTBAANtuple.h:549
TileTBAANtuple::m_DMUDstrobeErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUDstrobeErrVec
Definition: TileTBAANtuple.h:520
TileTBAANtuple::m_thitVec
std::vector< std::array< float, MAX_CHAN > > m_thitVec
Definition: TileTBAANtuple.h:616
TileTBAANtuple::m_evt
int m_evt
Definition: TileTBAANtuple.h:354
TileTBAANtuple::m_xChN1
float m_xChN1
Definition: TileTBAANtuple.h:481
TileTBAANtuple::m_las_D3_Ped_RMS
double m_las_D3_Ped_RMS
Definition: TileTBAANtuple.h:396
TileTBAANtuple::m_sc2
int m_sc2
Definition: TileTBAANtuple.h:467
TileTBAANtuple::m_DMUDataparityErrVec
std::vector< std::array< short, MAX_DMU > > m_DMUDataparityErrVec
Definition: TileTBAANtuple.h:523
TileTBAANtuple::m_las_D3_Ped
double m_las_D3_Ped
Definition: TileTBAANtuple.h:391
TileTBAANtuple::m_trigType
int m_trigType
Definition: TileTBAANtuple.h:355
TileTBAANtuple::m_scaler
std::array< int, 16 > m_scaler
Definition: TileTBAANtuple.h:472
SIGNAL_FOUND
#define SIGNAL_FOUND(frag, chan, amplitude)
Definition: TileTBAANtuple.cxx:66
COMMON_ADC2_FRAG
#define COMMON_ADC2_FRAG
Definition: TileTBFrag.h:44
TileTBAANtuple::ADDER_clearBranch
void ADDER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree ADDER variabl...
Definition: TileTBAANtuple.cxx:2891
TileTBAANtuple::m_las_D2_Ped_RMS
double m_las_D2_Ped_RMS
Definition: TileTBAANtuple.h:395
TileTBAANtuple::m_las_PMT2_Ped_RMS
double m_las_PMT2_Ped_RMS
Definition: TileTBAANtuple.h:429
TileTBAANtuple::m_beamBC1Z_90
Gaudi::Property< float > m_beamBC1Z_90
Definition: TileTBAANtuple.h:210
LArDigits2NtupleDumper.nSamples
nSamples
Definition: LArDigits2NtupleDumper.py:70
TileTBAANtuple::storeHit
void storeHit(const TileHit *hit, int fragType, int fragId, std::array< float, MAX_CHAN > &ehitVec, std::array< float, MAX_CHAN > &thitVec, const TileSamplingFraction *samplingFraction)
Definition: TileTBAANtuple.cxx:2007
TileTBAANtuple::m_ROD_DMUDataformatErrVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUDataformatErrVec
Definition: TileTBAANtuple.h:566
TileTBAANtuple::m_ROD_DMUDstrobeErrVec
std::vector< std::array< short, MAX_DMU > > m_ROD_DMUDstrobeErrVec
Definition: TileTBAANtuple.h:564
TileTBAANtuple::m_adderFilterAlgTool
ToolHandle< TileRawChannelBuilderFlatFilter > m_adderFilterAlgTool
Definition: TileTBAANtuple.h:159
TileTBAANtuple::m_las_D1_Alpha
double m_las_D1_Alpha
Definition: TileTBAANtuple.h:399
calibdata.copy
bool copy
Definition: calibdata.py:27
TileTBAANtuple::CISPAR_clearBranch
void CISPAR_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree CISPAR variab...
Definition: TileTBAANtuple.cxx:2917
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileTBAANtuple::m_flxFitRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_flxFitRawChannelContainerKey
Definition: TileTBAANtuple.h:138
TileTBAANtuple::m_las_PMT1_Ped_RMS
double m_las_PMT1_Ped_RMS
Definition: TileTBAANtuple.h:428
TileTBAANtuple::m_las_D4_Alpha
double m_las_D4_Alpha
Definition: TileTBAANtuple.h:402
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TileHWID::to_string
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
Definition: TileHWID.cxx:49
TileTBAANtuple::m_xCha1_0
float m_xCha1_0
Definition: TileTBAANtuple.h:490
TileTBAANtuple::m_timeVec
std::vector< std::array< float, MAX_CHAN > > m_timeVec
Definition: TileTBAANtuple.h:532
TileLaserObject::getSigmaAlpha
double getSigmaAlpha(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:152
TileTBAANtuple::m_eflxoptVec
std::vector< std::array< float, MAX_CHAN > > m_eflxoptVec
Definition: TileTBAANtuple.h:555
TileTBAANtuple::m_LarEne
std::array< float, 4 > m_LarEne
Definition: TileTBAANtuple.h:580
TileTBAANtuple::m_gainVec
std::vector< std::array< int, MAX_CHAN > > m_gainVec
Definition: TileTBAANtuple.h:526
TileTBAANtuple::m_nSamplesFlxInDrawerMap
std::map< int, int > m_nSamplesFlxInDrawerMap
Definition: TileTBAANtuple.h:631
TileTBAANtuple::m_eneAdd
std::array< float, 16 > m_eneAdd
Definition: TileTBAANtuple.h:446
TileHit::time
float time(int ind=0) const
Return time of ind-th sub-hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:92
TileTBAANtuple::m_las_D4_AlphaPed_RMS
double m_las_D4_AlphaPed_RMS
Definition: TileTBAANtuple.h:417
TileTBAANtuple::m_chi2flxfitVec
std::vector< std::array< float, MAX_CHAN > > m_chi2flxfitVec
Definition: TileTBAANtuple.h:553
TileTBAANtuple::m_las_D2_Alpha_RMS
double m_las_D2_Alpha_RMS
Definition: TileTBAANtuple.h:405
ECAL_ADC_FRAG
#define ECAL_ADC_FRAG
Definition: TileTBFrag.h:30
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
TileTBAANtuple::m_las_D2_AlphaPed_RMS
double m_las_D2_AlphaPed_RMS
Definition: TileTBAANtuple.h:415
TileCalibUtils::getDrawerIdxFromFragId
static unsigned int getDrawerIdxFromFragId(unsigned int fragId)
Returns a drawer hash from fragId This function assumes drawer context (i.e.
Definition: TileCalibUtils.cxx:71
TileTBAANtuple::m_las_D1_Alpha_RMS
double m_las_D1_Alpha_RMS
Definition: TileTBAANtuple.h:404
TileTBAANtuple::m_las_D4_Ped_RMS
double m_las_D4_Ped_RMS
Definition: TileTBAANtuple.h:397
TileLaserObjByteStreamCnv.h
TileTBAANtuple::initList
StatusCode initList(const EventContext &ctx)
Definition: TileTBAANtuple.cxx:2295
TileTBAANtuple::m_rosName
Gaudi::Property< std::vector< std::string > > m_rosName
Definition: TileTBAANtuple.h:183
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
COIN_TRIG5_FRAG
#define COIN_TRIG5_FRAG
Definition: TileTBFrag.h:36
TileTBAANtuple::m_l1Type
std::vector< int > m_l1Type
Definition: TileTBAANtuple.h:360
TileTBAANtuple::m_ntupleCreated
bool m_ntupleCreated
Definition: TileTBAANtuple.h:346
TileTBAANtuple::storeBeamElements
StatusCode storeBeamElements(const EventContext &ctx)
Definition: TileTBAANtuple.cxx:632
TileTBAANtuple::DIGI_clearBranch
void DIGI_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// /Clear Tree DIGI variabl...
Definition: TileTBAANtuple.cxx:3514
TileTBAANtuple::m_TBperiod
Gaudi::Property< int > m_TBperiod
Definition: TileTBAANtuple.h:177
TileLaserObject
Definition: TileLaserObject.h:33
TileTBAANtuple::m_ehitCnt
std::vector< std::array< float, MAX_CHAN > > m_ehitCnt
Definition: TileTBAANtuple.h:617
TileTBAANtuple::m_dqStatusKey
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
Definition: TileTBAANtuple.h:162
COIN_TRIG4_FRAG
#define COIN_TRIG4_FRAG
Definition: TileTBFrag.h:35
TileTBAANtuple::m_eOptVec
std::vector< std::array< float, MAX_CHAN > > m_eOptVec
Definition: TileTBAANtuple.h:543
TileTBAANtuple::m_coincTrig8
std::array< unsigned int, 96 > m_coincTrig8
Definition: TileTBAANtuple.h:592
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17
TileTBAANtuple::m_las1
float m_las1
Definition: TileTBAANtuple.h:435
TileTBAANtuple::m_dspFlags
int m_dspFlags
Definition: TileTBAANtuple.h:356
TileTBAANtuple::m_pedfitVec
std::vector< std::array< float, MAX_CHAN > > m_pedfitVec
Definition: TileTBAANtuple.h:537
TileTBAANtuple::m_muVeto
uint32_t m_muVeto
Definition: TileTBAANtuple.h:461
TileTBAANtuple::m_yCha2
float m_yCha2
Definition: TileTBAANtuple.h:489
fitman.k
k
Definition: fitman.py:528
TileRawChannelUnit::OnlineMegaElectronVolts
@ OnlineMegaElectronVolts
Definition: TileRawChannelUnit.h:24
TileTBAANtuple::m_las_D3_Alpha_RMS
double m_las_D3_Alpha_RMS
Definition: TileTBAANtuple.h:406
TileTBAANtuple::m_efitcVec
std::vector< std::array< float, MAX_CHAN > > m_efitcVec
Definition: TileTBAANtuple.h:539
TileLaserObject::getPedestalAlpha
double getPedestalAlpha(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:166
TileTBAANtuple::m_xImp_min90
float m_xImp_min90
Definition: TileTBAANtuple.h:501
TileTBAANtuple::m_mdChargeflxVec
std::vector< std::array< int, MAX_MINIDRAWER > > m_mdChargeflxVec
Definition: TileTBAANtuple.h:576
TileTBAANtuple::CheckDMUFormat
short CheckDMUFormat(uint32_t header)
bit_31 of the DMU header must be 1 and bit_17 of the DMU header must be 0
Definition: TileTBAANtuple.h:302
TileTBAANtuple::m_beamBC0X1
Gaudi::Property< float > m_beamBC0X1
Definition: TileTBAANtuple.h:198