ATLAS Offline Software
Loading...
Searching...
No Matches
LArTTL1Maker.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// +======================================================================+
6// + +
7// + Author ........: F. Ledroit +
8// + Institut ......: ISN Grenoble +
9// + Creation date .: 09/01/2003 +
10// + +
11// +======================================================================+
12//
13//
15// .......... utilities
16//
18//
19#include "CLHEP/Random/RandGaussZiggurat.h"
20#include "CLHEP/Random/RandomEngine.h"
21//
22#include "LArRawEvent/LArTTL1.h"
23//
26//
32//
33// ........ Gaudi needed includes
34//
35#include "GaudiKernel/IChronoStatSvc.h"
36#include "GaudiKernel/IIncidentSvc.h"
38
39//
40#include <cmath>
41#include <fstream>
42
43using CLHEP::RandGaussZiggurat;
44
45namespace {
46constexpr double crossingTime = 25 /* nanosecond */;
47constexpr double crossingRate = 1. / crossingTime;
48} // namespace
49
51 // +======================================================================+
52 // + +
53 // + Author ........: F. Ledroit +
54 // + Creation date .: 09/01/2003 +
55 // + +
56 // +======================================================================+
57 //
58 // ......... declaration
59 //
60 m_chronSvc = chronoSvc();
61
62 ATH_MSG_INFO("***********************************************");
63 ATH_MSG_INFO("* Steering options for LArTTL1Maker algorithm *");
64 ATH_MSG_INFO("***********************************************");
65 //
66 // ......... print the noise flag
67 //
68 if (m_NoiseOnOff) {
70 "Electronic noise will be added in each TT for selected "
71 "sub-detectors.");
72 } else {
73 ATH_MSG_INFO("No electronic noise added.");
74 }
75
76 //
77 // ......... print the pile-up flag
78 //
79 if (m_PileUp) {
80 ATH_MSG_INFO("processing pile-up events");
81 } else {
82 ATH_MSG_INFO("no pile up");
83 }
84
85 //
86 // ......... print the trigger time flag
87 //
88 if (m_useTriggerTime) {
89 ATH_MSG_INFO("use Trigger Time service " << m_triggerTimeTool);
90 } else {
91 ATH_MSG_INFO("no Trigger Time used");
92 }
93
94 //
95 // ......... print the calibration flags
96 //
97 // currently the calib modes are not used anymore -> turning INFO logs into
98 // DEBUG
99 if (m_noEmCalibMode) {
101 "NO calibration mode chosen for EM towers "
102 << " == technical option. Should not be used for physics !!! ");
103 } else {
104 ATH_MSG_DEBUG("standard calibration chosen for EM towers");
105 }
106
107 if (m_noHadCalibMode) {
109 "NO calibration mode chosen for HEC towers "
110 << " == technical option. Should not be used for physics !!! ");
111 } else {
112 ATH_MSG_DEBUG("standard calibration mode chosen for HEC towers ");
113 }
114
115 //
116 // .........retrieve tool computing trigger time if requested
117 //
118 if (m_useTriggerTime && m_PileUp) {
120 " In case of pileup, the trigger time subtraction is done in "
121 "PileUpSvc ");
122 ATH_MSG_INFO(" => LArTTL1Maker will not apply Trigger Time ");
123 m_useTriggerTime = false;
124 }
125
126 if (m_useTriggerTime) {
127 ATH_CHECK(m_triggerTimeTool.retrieve());
128 } else {
129 m_triggerTimeTool.disable();
130 }
131
132 //
133 // ..... need LAr and CaloIdManager to retrieve all needed helpers
134 //
135 const CaloIdManager* caloMgr = nullptr;
136 ATH_CHECK(detStore()->retrieve(caloMgr));
137 ATH_CHECK(detStore()->retrieve(m_OflHelper, "CaloCell_ID"));
138 //
139 //..... need of course the LVL1 helper
140 //
141 m_lvl1Helper = caloMgr->getLVL1_ID();
142 if (!m_lvl1Helper) {
143 ATH_MSG_ERROR("Could not access CaloLVL1_ID helper");
144 return StatusCode::FAILURE;
145 } else {
146 ATH_MSG_DEBUG("Successfully accessed CaloLVL1_ID helper");
147 }
148
149 //..... also need the LArEM helper (e.g. to deal with the barrel end part)
150 ATH_CHECK(detStore()->retrieve(m_emHelper));
151 ATH_MSG_DEBUG("Successfully retrieved LArEM helper from DetectorStore");
152
153 //..... also need the LArHEC helper to avoid adding up energy from 4th
154 // compartment
155 ATH_CHECK(detStore()->retrieve(m_hecHelper));
156 ATH_MSG_DEBUG("Successfully retrieved LArHEC helper from DetectorStore");
157
158 //..... also need the LArFCAL helper to use hash ids to store all gains
159 ATH_CHECK(detStore()->retrieve(m_fcalHelper));
160 ATH_MSG_DEBUG("Successfully retrieved LArFCAL helper from DetectorStore");
161
162 ATH_CHECK(m_ttSvc.retrieve());
163
164 // Incident Service:
165 SmartIF<IIncidentSvc> incSvc{service("IncidentSvc")};
166 ATH_CHECK(incSvc.isValid());
167 // start listening to "BeginRun"
168 incSvc->addListener(this, "BeginRun", m_BeginRunPriority);
169
170 ATH_CHECK(m_RandomSvc.retrieve());
171
172 ATH_CHECK(m_fSamplKey.initialize());
173
174 // Initialize read-handle keys
175 for (auto& dhk : m_xxxHitContainerName) {
176 ATH_CHECK(dhk.initialize(!m_PileUp));
177 }
178
179 ATH_CHECK(m_EmTTL1ContainerName.initialize());
180 ATH_CHECK(m_HadTTL1ContainerName.initialize());
181
182 ATH_CHECK(m_hitMapKey.initialize());
183
184 ATH_MSG_DEBUG("Initialization completed successfully");
185 return StatusCode::SUCCESS;
186}
187
188void LArTTL1Maker::handle(const Incident& /* inc*/) {
189 ATH_MSG_DEBUG("LArTTL1Maker handle()");
190
191 // ...... Read auxiliary data files
192 //
193 if (this->readAuxiliary() == StatusCode::FAILURE) {
194 ATH_MSG_ERROR(" Error from readAuxiliary() ");
195 }
196
197 return;
198}
199
201 // +======================================================================+
202 // + +
203 // + Author: F. Ledroit +
204 // + Creation date: 2003/01/13 +
205 // + Subject: Make the TTL1s and put them into the container +
206 // + +
207 // +======================================================================+
208
209 ATH_MSG_DEBUG("Begining of execution");
210
211 // Prepare RNG Service
212 ATHRNG::RNGWrapper* rngWrapper =
213 m_RandomSvc->getEngine(this, m_randomStreamName);
217 rngWrapper->setSeedLegacy(m_randomStreamName, Gaudi::Hive::currentContext(),
218 m_randomSeedOffset, seedingmode);
219 CLHEP::HepRandomEngine* rndmEngine = *rngWrapper;
220
221 //
222 // ....... fill the LArHitEMap
223 //
224 if (m_chronoTest) {
225 m_chronSvc->chronoStart("fill LArHitEMap ");
226 }
227
229 const ILArfSampl* fSampl = *fSamplhdl;
230
232
233 if (m_chronoTest) {
234 m_chronSvc->chronoStop("fill LArHitEMap ");
235 m_chronSvc->chronoPrint("fill LArHitEMap ");
236 }
237
238 //
239 // .....get the trigger time if requested
240 //
241 double trigtime = 0;
242 if (m_useTriggerTime) {
243 trigtime = m_triggerTimeTool->time();
244 }
245 ATH_MSG_DEBUG("Trigger time used : " << trigtime);
246
247 //
248 // ....... create the LAr TTL1 Containers
249 //
250
252 ATH_CHECK(ttL1ContainerEm.record(std::make_unique<LArTTL1Container>()));
253
255 ATH_CHECK(ttL1ContainerHad.record(std::make_unique<LArTTL1Container>()));
256
257 std::unique_ptr<LArTTL1Container> truth_ttL1ContainerEm;
258 std::unique_ptr<LArTTL1Container> truth_ttL1ContainerHad;
259 if (!m_truthHitsContainer.empty()) {
260 truth_ttL1ContainerEm = std::make_unique<LArTTL1Container>();
261 truth_ttL1ContainerHad = std::make_unique<LArTTL1Container>();
262 }
263
264 // ... initialise vectors for sums of energy in each TT
265 //
266 unsigned int nbTT = (unsigned int)m_lvl1Helper->tower_hash_max();
267 ATH_MSG_DEBUG("Max number of LAr Trigger Towers= " << nbTT);
268 std::vector<std::vector<float> >
269 sumEnergy; // inner index = time slot (from 0 to visEvecSize-1)
270 std::vector<std::vector<float> >
271 sumEnergy2; // to allow barrel/endcap separation in 15th TT + FCAL2/3
272 sumEnergy.resize(nbTT);
273 sumEnergy2.resize(nbTT);
274 std::vector<float> ttSumE;
275 int ttSumEvecSize = 0;
276 int refTime = 0;
277 if (!m_PileUp) {
278 ttSumEvecSize = 2 * crossingTime - 1;
279 refTime = crossingTime - 1;
280 } else {
281 ttSumEvecSize = s_MAXSAMPLES + s_NBSAMPLES - 1;
282 refTime = s_MAXSAMPLES - 1;
283 }
284 ATH_MSG_DEBUG("Number of time slots considered= "
285 << ttSumEvecSize << " reference time= " << refTime);
286 ttSumE.resize(ttSumEvecSize);
287 for (unsigned int iTT = 0; iTT < nbTT; iTT++) {
288 sumEnergy[iTT] = ttSumE;
289 sumEnergy2[iTT] = ttSumE;
290 }
291
292 m_chronSvc->chronoStart("LArTTL1Mk hit loop ");
293
294 int it = 0;
295 int it_end = hitmap->GetNbCells();
296 ATH_MSG_DEBUG("Size of the hit map= " << it_end);
297
298 //
299 // .... loop on hit lists in the map
300 // .... and fill sumEnergy vector according to hit membership to TT
301 // .... (one sum per time slot for each TT)
302 //
303 float outOfTimeE = 0.;
304 int nOutOfTime = 0;
305 float inTimeE = 0.;
306 int nInTime = 0;
307 float printEthresh = 20.;
308 int nMissingGain = 0;
309 for (; it != it_end; ++it) {
310 const LArHitList& hitlist = hitmap->GetCell(it);
311 const std::vector<std::pair<float, float> >& timeE = hitlist.getData();
312 if (!timeE.empty()) {
313 Identifier cellId = m_OflHelper->cell_id(IdentifierHash(it));
314 int specialCase = 0;
315 bool skipCell = false;
316 //
317 // ... skip cells not summed up in LVL1 (end of barrel PS and 4th
318 // compartment of HEC)
319 //
320 if (!m_ttSvc->is_in_lvl1(cellId))
321 skipCell = true;
322
323 if (!skipCell) {
324 //
325 // ...determine to which TT this channel belongs
326 //
327 Identifier ttId = m_ttSvc->whichTTID(cellId);
328
329 if (m_chronoTest) {
330 m_chronSvc->chronoStart("retrieve RG ");
331 }
332
333 //
334 // ....... determine the sampling fraction
335 //........ and the relative (layer) gains for this cellId
336 //
337 const float cellSampFraction = fSampl->FSAMPL(cellId);
338 const float inv_cellSampFraction = 1. / cellSampFraction;
339 // std::cout << "cellid, SF= " <<
340 // m_lvl1Helper->show_to_string(cellId) << " " << cellSampFraction <<
341 // std::endl;
342 float relGain = 0.;
343 float sinTheta = 0.;
344
345 int region = m_lvl1Helper->region(ttId);
346 int eta = m_lvl1Helper->eta(ttId);
347 int Ieta = decodeInverse(region, eta);
348
349 // case EM cell
350 if (m_lvl1Helper->is_lar_em(cellId)) {
351 bool barrelEnd = m_lvl1Helper->is_barrel_end(ttId);
352 std::vector<float> vecRG;
353 if (m_emHelper->is_em_barrel(cellId)) {
354 // Barrel
355 sinTheta = m_sinThetaEmb[Ieta - 1]; // Ieta starts at 1
356 } else {
357 // End-Cap
358 if (!barrelEnd) {
359 sinTheta = m_sinThetaEmec[Ieta - 1];
360 } else {
361 // patching the fact that TT offline ID is ambiguous
362 // decodeInverse(eta,region) returns 15 (ok barrel) instead of 1
363 // (ec value).
364 sinTheta = m_sinThetaEmec[0];
365 specialCase = 1;
366 ATH_MSG_VERBOSE(" special case "
367 << m_emHelper->show_to_string(ttId));
368 }
369 }
370 relGain = 1.; // no relative gain for EMB and EMEC
371 }
372
373 // case HEC cell
374 else if (m_lvl1Helper->is_lar_hec(cellId)) {
375 sinTheta = m_sinThetaHec[Ieta - 1]; // Ieta starts at 1
376 relGain = 1.;
377 }
378
379 // case FCAL cell
380 else if (m_lvl1Helper->is_lar_fcal(cellId)) {
381 IdentifierHash fcalHash = m_fcalHelper->channel_hash(cellId);
382 relGain = m_cellRelGainFcal[fcalHash];
383 if (relGain < 0.001) {
384 nMissingGain++;
385 ATH_MSG_WARNING(" No relative gain value found for FCAL cell "
386 << m_emHelper->show_to_string(cellId) << " (index "
387 << fcalHash << "), setting default value 1. ");
388 relGain = 1.;
389 }
390 sinTheta = 1.; // this factor is included in the relative gain
391 }
392 if (m_chronoTest) {
393 m_chronSvc->chronoStop("retrieve RG ");
394 m_chronSvc->chronoPrint("retrieve RG ");
395 }
396
397 IdentifierHash ttHash = m_lvl1Helper->tower_hash(ttId);
398
399 //
400 // .... loop on hits in hit list
401 //
402 // std::vector<std::pair<float,float> >::const_iterator first =
403 // timeEbegin(); std::vector<std::pair<float,float> >::const_iterator
404 // last = timeE->end(); while (first != last) {
405 for (const auto& first : timeE) {
406 float hitEnergy = first.first;
407 float hitTime = first.second - trigtime;
408 if (hitTime > 99000.) {
409 if (hitEnergy > printEthresh) {
410 ATH_MSG_WARNING(" Found pathological hit time, cellId= "
411 << m_emHelper->show_to_string(cellId)
412 << " time= " << hitTime
413 << " energy= " << hitEnergy);
414 }
415 // provisionally fix a bug in PileUpEvent. Normally not needed
416 // starting from 10.5.0
417 hitTime -= 100000.;
418 }
419 // remove pathological energies (found in some Grid simulated DC2/Rome
420 // samples)
421 if (fabs(hitEnergy) > 1e+9) {
422 ATH_MSG_WARNING(" Pathological energy ignored cellId= "
423 << m_emHelper->show_to_string(cellId)
424 << " energy= " << hitEnergy);
425 hitEnergy = 0.;
426 hitTime = 0.;
427 }
428 //
429 // ....determine time with respect to ref shape
430 //
431 int iShift = 0;
432 if (!m_PileUp) {
433 // keep 1ns granularity
434 // iShift = (int)(hitTime+0.5);
435 iShift = static_cast<int>(floor(hitTime + 0.5));
436 } else {
437 // round to 25ns
438 // iShift = (int)(hitTime/25.+0.5);
439 iShift = static_cast<int>(floor(hitTime * crossingRate + 0.5));
440 }
441 //
442 // ....make time positive to allow using it as an index
443 //
444 int iTime = iShift + refTime;
445 //
446 // .... keep only hits in the timing window
447 //
448 if (iTime >= 0 && iTime < ttSumEvecSize) {
449
450 if (!specialCase) {
451 // standard case
452 // ....... make the energy sum
453 ttSumE = sumEnergy[ttHash];
454 ttSumE[iTime] +=
455 hitEnergy * inv_cellSampFraction * sinTheta * relGain;
456 sumEnergy[ttHash] = ttSumE;
457 } else {
458 // ec part of barrel-end or FCAL3
459 // ....... make the energy sum
460 ttSumE = sumEnergy2[ttHash];
461 ttSumE[iTime] +=
462 hitEnergy * inv_cellSampFraction * sinTheta * relGain;
463 sumEnergy2[ttHash] = ttSumE;
464 }
465 // msglog << MSG::VERBOSE << "applied relative layer gain "
466 //<< relGain
467 // << " to a hit of cell " <<
468 // m_emHelper->show_to_string(cellId) << endmsg;
469 inTimeE += hitEnergy;
470 nInTime++;
471 } // only hits in timing window
472 else {
473 outOfTimeE += hitEnergy;
474 nOutOfTime++;
475 if (hitEnergy > printEthresh) {
476 if (!m_PileUp) {
477 ATH_MSG_DEBUG("Found a hit out of the timing window, hitTime= "
478 << hitTime << " with more than " << printEthresh
479 << " MeV: hitEnergy= " << hitEnergy << " MeV");
480 } else {
482 "Found a hit out of the timing window, hitTime= "
483 << hitTime << " with more than " << printEthresh
484 << " MeV: hitEnergy= " << hitEnergy << " MeV");
485 }
486 }
487 }
488 } // end of loop on hits in the list
489 } // skip cell condition
490 } // check timeE->size() > 0
491
492 } // end of loop on hit lists
493
494 ATH_MSG_DEBUG("Number of missing relative FCAL gains for this event = "
495 << nMissingGain);
496 if (inTimeE == 0 || nInTime == 0)
497 ATH_MSG_VERBOSE("No in time energy");
498 else
499 ATH_MSG_VERBOSE("Out of time energy = "
500 << outOfTimeE << " MeV"
501 << " represents " << 100. * outOfTimeE / inTimeE
502 << " % of in time energy for " << nOutOfTime << " ("
503 << 100. * nOutOfTime / nInTime << " %) hits");
504 if (outOfTimeE > 0.02 * inTimeE) {
505 ATH_MSG_WARNING("Out of time energy = "
506 << outOfTimeE << " MeV"
507 << " larger than 2% of in time energy = " << inTimeE
508 << " MeV; nb of out of time hits = " << nInTime << " ("
509 << (nInTime > 0 ? 100. * nOutOfTime / nInTime : 0)
510 << " %)");
511 }
512
513 if (m_chronoTest) {
514 m_chronSvc->chronoStop("LArTTL1Mk hit loop ");
515 m_chronSvc->chronoPrint("LArTTL1Mk hit loop ");
516 m_chronSvc->chronoStart("LArTTL1Mk TT loop ");
517 }
518
519 std::vector<std::string> emHadString(2);
520 emHadString[0] = "ElectroMagnetic";
521 emHadString[1] = "Hadronic";
522
523 std::vector<Identifier>::const_iterator itTt = m_lvl1Helper->tower_begin();
524 std::vector<Identifier>::const_iterator itEnd = m_lvl1Helper->tower_end();
525
526 //
527 // ....... loop on Trigger Towers
528 // ....... and build signals using pulse shape and noise for each TT
529 //
530 ATH_MSG_DEBUG(" Starting loop on Trigger Towers ");
531 for (; itTt != itEnd; ++itTt) {
532
533 Identifier towerId = (*itTt);
534
535 //
536 // ........ skip Tile cal
537 //
538 if (!m_lvl1Helper->is_tile(towerId)) {
539
540 int emHad = m_lvl1Helper->sampling(towerId);
541 // convert offline id to hash id
542 IdentifierHash ttHash = m_lvl1Helper->tower_hash(towerId);
543 int region = m_lvl1Helper->region(towerId);
544 int eta = m_lvl1Helper->eta(towerId);
545 int Ieta = decodeInverse(region, eta);
546
547 //
548 // .... compute the signal for current trigger tower
549 //
550 if (m_chronoTest) {
551 m_chronSvc->chronoStart("compute signal ");
552 }
553 std::vector<float> analogSum(s_NBSAMPLES);
554 std::vector<float> analogSum2(s_NBSAMPLES);
555 std::vector<float> sumTTE = sumEnergy[ttHash];
556 std::vector<float> sumTTE2 = sumEnergy2[ttHash];
557 int nSpecialCase = 0;
558
559 bool hasE = false;
560 for (unsigned int i = 0; i < sumTTE.size(); ++i) {
561 if (fabs(sumTTE[i]) > 0.) {
562 hasE = true;
563 break;
564 }
565 }
566
567 bool hasE2 = false;
568 for (unsigned int i = 0; i < sumTTE2.size(); ++i) {
569 if (fabs(sumTTE2[i]) > 0.) {
570 hasE2 = true;
571 break;
572 }
573 }
574
575 // if ( fabs(sumTTE[refTime]) > 0.|| fabs(sumTTE2[refTime]) > 0. ) {
576 if (hasE || hasE2) {
577
578 // if(fabs(sumTTE[refTime]) > 0.) {
579 if (hasE) {
580 analogSum = computeSignal(towerId, Ieta, 0, sumTTE, refTime);
581 }
582
583 // treat special case of ec part of the "barrel end" and special case of
584 // FCAL2/FCAL3 fix me !! this way, we double the saturation energy in
585 // this tower...(because it is cut into 2 pieces)
586 // if(fabs(sumTTE2[refTime]) > 0.) {
587 if (hasE2) {
588 nSpecialCase += 1;
589 if (nSpecialCase > 1) {
591 " more than 1 special case, current Trigger Tower is "
592 << emHadString[emHad] << ": "
593 << m_emHelper->show_to_string(towerId) << " ");
594 }
595 analogSum2 = computeSignal(towerId, Ieta, 1, sumTTE2, refTime);
596 for (int isamp = 0; isamp < s_NBSAMPLES; isamp++) {
597 analogSum[isamp] += analogSum2[isamp];
598 }
599 }
600
601 if (sumTTE[refTime] > m_debugThresh) {
602 ATH_MSG_DEBUG(" current Trigger Tower is "
603 << emHadString[emHad] << ": "
604 << m_emHelper->show_to_string(towerId) << " ");
606 " transverse E (i.e. sum E / sampling fraction * sin_theta * rel "
607 "gain)= (at ref. time, before calib)"
608 << sumTTE[refTime] << " + " << sumTTE2[refTime]
609 << " (special cases) ");
610 } else if (sumTTE[refTime] > 0.) {
611 ATH_MSG_VERBOSE(" current Trigger Tower is "
612 << emHadString[emHad] << ": "
613 << m_emHelper->show_to_string(towerId) << " ");
615 " [very low] transverse E (i.e. sum E / sampling fraction * "
616 "sin_theta * rel gain)= (at ref. time, before calib)"
617 << sumTTE[refTime] << " + " << sumTTE2[refTime]
618 << " (special cases) ");
619 }
620 }
621 if (m_chronoTest) {
622 m_chronSvc->chronoStop("compute signal ");
623 m_chronSvc->chronoPrint("compute signal ");
624 }
625
626 //
627 // ........ add the noise
628 //
629 if (m_chronoTest) {
630 m_chronSvc->chronoStart("adding noise ");
631 }
632 std::vector<float> fullSignal(s_NBSAMPLES);
633 if (m_NoiseOnOff) {
634 fullSignal = computeNoise(towerId, Ieta, analogSum, rndmEngine);
635 } else {
636 fullSignal = analogSum;
637 }
638
639 if (m_chronoTest) {
640 m_chronSvc->chronoStop("adding noise ");
641 m_chronSvc->chronoPrint("adding noise ");
642 }
643
644 if (sumTTE[refTime] > m_debugThresh) {
645 ATH_MSG_DEBUG(" uncalibrated amplitudes around peak (+-3 time slots): "
646 << sumTTE[refTime - 3] << ", " << sumTTE[refTime - 2]
647 << ", " << sumTTE[refTime - 1] << ", " << sumTTE[refTime]
648 << ", " << sumTTE[refTime + 1] << ", "
649 << sumTTE[refTime + 2] << ", " << sumTTE[refTime + 3]);
650 ATH_MSG_DEBUG(" calibrated signal is "
651 << analogSum[0] << ", " << analogSum[1] << ", "
652 << analogSum[2] << ", " << analogSum[3] << ", "
653 << analogSum[4] << ", " << analogSum[5] << ", "
654 << analogSum[6]);
655 ATH_MSG_DEBUG(" shape of calibrated signal is "
656 << analogSum[0] / analogSum[3] << ", "
657 << analogSum[1] / analogSum[3] << ", "
658 << analogSum[2] / analogSum[3] << ", "
659 << analogSum[3] / analogSum[3] << ", "
660 << analogSum[4] / analogSum[3] << ", "
661 << analogSum[5] / analogSum[3] << ", "
662 << analogSum[6] / analogSum[3]);
663 ATH_MSG_DEBUG(" after adding noise, full signal is "
664 << fullSignal[0] << ", " << fullSignal[1] << ", "
665 << fullSignal[2] << ", " << fullSignal[3] << ", "
666 << fullSignal[4] << ", " << fullSignal[5] << ", "
667 << fullSignal[6]);
668 if (msgLvl(MSG::VERBOSE)) {
669 for (unsigned int iTime = 0; iTime < sumTTE.size(); iTime++) {
670 ATH_MSG_VERBOSE(" iTime [range=0-28 or 0-299] = "
671 << iTime << " hit energy = " << sumTTE[iTime]);
672 }
673 }
674 } else if (sumTTE[refTime] > 0.) {
676 " uncalibrated amplitudes around peak (+-3 time slots): "
677 << sumTTE[refTime - 3] << ", " << sumTTE[refTime - 2] << ", "
678 << sumTTE[refTime - 1] << ", " << sumTTE[refTime] << ", "
679 << sumTTE[refTime + 1] << ", " << sumTTE[refTime + 2] << ", "
680 << sumTTE[refTime + 3]);
681 ATH_MSG_VERBOSE(" calibrated signal is "
682 << analogSum[0] << ", " << analogSum[1] << ", "
683 << analogSum[2] << ", " << analogSum[3] << ", "
684 << analogSum[4] << ", " << analogSum[5] << ", "
685 << analogSum[6]);
686 ATH_MSG_VERBOSE(" shape of calibrated signal is "
687 << analogSum[0] / analogSum[3] << ", "
688 << analogSum[1] / analogSum[3] << ", "
689 << analogSum[2] / analogSum[3] << ", "
690 << analogSum[3] / analogSum[3] << ", "
691 << analogSum[4] / analogSum[3] << ", "
692 << analogSum[5] / analogSum[3] << ", "
693 << analogSum[6] / analogSum[3]);
694 ATH_MSG_VERBOSE(" after adding noise, full signal is "
695 << fullSignal[0] << ", " << fullSignal[1] << ", "
696 << fullSignal[2] << ", " << fullSignal[3] << ", "
697 << fullSignal[4] << ", " << fullSignal[5] << ", "
698 << fullSignal[6]);
699 }
700
701 if (fabs(fullSignal[s_PEAKPOS]) > 0.) {
702 //
703 // ...... create the LArTTL1 and push it into the appropriate TTL1
704 // container
705 //
706 LArTTL1* ttL1;
707 HWIdentifier ttChannel;
708 ttL1 = new LArTTL1(ttChannel, towerId, fullSignal);
709 if (emHad) {
710 ttL1ContainerHad->push_back(ttL1);
711 } else {
712 ttL1ContainerEm->push_back(ttL1);
713 }
714
715 if (!m_truthHitsContainer.empty()) {
716 std::vector<float> et(3);
717 et[0] = sumTTE[refTime - 1];
718 et[1] = sumTTE[refTime];
719 et[2] = sumTTE[refTime + 1];
720 LArTTL1* truth_ttL1 = new LArTTL1(ttChannel, towerId, et);
721 if (emHad) {
722 truth_ttL1ContainerHad->push_back(truth_ttL1);
723 } else {
724 truth_ttL1ContainerEm->push_back(truth_ttL1);
725 }
726 }
727 }
728
729 } // end excluding Tile cal
730 } // end of for loop on TT
731 if (m_chronoTest) {
732 m_chronSvc->chronoStop("LArTTL1Mk TT loop ");
733 m_chronSvc->chronoPrint("LArTTL1Mk TT loop ");
734 }
735
736 ATH_MSG_DEBUG("number of created TTL1s (Em, Had) = "
737 << ttL1ContainerEm->size() << " , "
738 << ttL1ContainerHad->size());
739
740 return StatusCode::SUCCESS;
741}
742
744 // +======================================================================+
745 // + +
746 // + Author: F. Ledroit +
747 // + Creation date: 2003/01/13 +
748 // + +
749 // +======================================================================+
750 //
751 // ......... declaration
752 //
753
754 ATH_MSG_INFO(" LArTTL1Maker finalize completed successfully");
755
756 m_chronSvc->chronoPrint("LArTTL1Mk hit loop ");
757 m_chronSvc->chronoPrint("LArTTL1Mk TT loop ");
758
759 return StatusCode::SUCCESS;
760}
761
762std::vector<float> LArTTL1Maker::computeSignal(const Identifier towerId,
763 const int Ieta,
764 const int specialCase,
765 std::vector<float> ttSumEnergy,
766 const int refTime) const
767
768{
769 // +======================================================================+
770 // + +
771 // + Author: F. Ledroit +
772 // + Creation date: 2003/01/13 +
773 // + +
774 // +======================================================================+
775 //
776
777 std::vector<float> bareSignal(s_NBSAMPLES);
778 std::vector<float> pulseShape(s_MAXSAMPLES);
779 std::vector<float> pulseShapeDer(s_MAXSAMPLES);
780
781 bool emb = m_lvl1Helper->is_emb(towerId);
782 bool barrelEnd = m_lvl1Helper->is_barrel_end(towerId);
783 bool emec = m_lvl1Helper->is_emec(towerId);
784
785 int visEvecSize = std::ssize(ttSumEnergy);
786 ATH_MSG_VERBOSE("computeSignal: special case = " << specialCase);
787
788 //
789 // ..... case EM
790 //
791 if (emb || barrelEnd || emec) {
792 //
793 // ..... retrieve calib coeffs for the tower
794 //
795 float calibCoeff = 0.;
796 if (emb) {
797 calibCoeff = m_calibCoeffEmb[Ieta - 1];
798 } else if (emec) {
799 calibCoeff = m_calibCoeffEmec[Ieta - 1];
800 } else { // barrelEnd
801 if (!specialCase) {
802 calibCoeff = m_calibCoeffEmb[14];
803 } else {
804 calibCoeff = m_calibCoeffEmec[0];
805 }
806 }
807 if (calibCoeff < 0.001) {
808 ATH_MSG_WARNING(" No calibration coefficient value found for tower "
809 << m_emHelper->show_to_string(towerId)
810 << " setting default value 6. ");
811 calibCoeff = 6.;
812 }
813
814 //
815 // ... loop on time samples
816 //
817 for (int iTime = 0; iTime < visEvecSize; iTime++) {
818 if (fabs(ttSumEnergy[iTime]) > 0.) {
819 if (!m_noEmCalibMode) {
820 // apply calibration coefficient
821 ttSumEnergy[iTime] *= calibCoeff;
823 " ComputeSignal: applied EM calibration coefficient (iTime) "
824 << calibCoeff << " (" << iTime << ") ");
825 }
826
827 // with respect to saturation
828 // to compute the amplitude
829 float theEnergy = ttSumEnergy[iTime];
830 if (ttSumEnergy[iTime] > m_refEnergyEm[0]) {
831 theEnergy = m_refEnergyEm[0];
832 }
833 // to determine the shape
834 if (ttSumEnergy[iTime] > m_refEnergyEm[s_NBENERGIES - 1]) {
835 // don't know the shape after highest energy point -> stick to 'last'
836 // shape
837 ttSumEnergy[iTime] = m_refEnergyEm[s_NBENERGIES - 1];
838 }
839
840 //
841 // ... determine regime: linear(iene=0) or saturation
842 //
843 for (int iene = 0; iene < s_NBENERGIES; iene++) {
844 if (ttSumEnergy[iTime] <= m_refEnergyEm[iene]) {
845 pulseShape = m_pulseShapeEm[iene];
846 pulseShapeDer = m_pulseShapeDerEm[iene];
847
848 // make samples
849 for (int iSamp = 0; iSamp < s_NBSAMPLES; iSamp++) {
850 if (!m_PileUp) {
851 // go back to signed value of time
852 int hitTime = iTime - refTime;
853 // go to 25 ns sampling
854 // int time = (int)(hitTime/25.+0.5) ;
855 int time =
856 static_cast<int>(floor(hitTime * crossingRate + 0.5));
857 // ....determine fine shift within 25ns
858 float dTime = (float)(hitTime - crossingTime * time);
859 int j = iSamp - time;
860 if (j >= 0 && j < s_MAXSAMPLES) {
861 bareSignal[iSamp] +=
862 (pulseShape[j] - pulseShapeDer[j] * dTime) * theEnergy;
863 }
864 } else {
865 int j = iSamp - iTime + refTime;
866 if (j >= 0 && j < s_MAXSAMPLES) {
867 bareSignal[iSamp] += pulseShape[j] * theEnergy;
868 }
869 }
870 } // end loop on samples
871
872 break;
873 }
874 } // end of loop on reference energies
875 } // end condition visE>0
876 } // end loop on times
877 } // end case EM
878 //
879 // ..... case HEC
880 //
881 else if (m_lvl1Helper->is_hec(towerId)) {
882 pulseShape = m_pulseShapeHec;
883 pulseShapeDer = m_pulseShapeDerHec;
884 //
885 // ... loop on time samples
886 //
887 for (int iTime = 0; iTime < visEvecSize; iTime++) {
888 float theEnergy = ttSumEnergy[iTime];
889 if (!m_noHadCalibMode) {
890 // apply calibration coefficient
891 theEnergy *= m_calibCoeffHec[Ieta - 1];
892 }
893
894 float satEt = m_satEnergyHec[Ieta - 1];
895 for (int iSamp = 0; iSamp < s_NBSAMPLES; iSamp++) {
896 if (!m_PileUp) {
897 // go back to signed value of time
898 int hitTime = iTime - refTime;
899 // go to 25 ns sampling
900 // int time = (int)(hitTime/25.+0.5) ;
901 int time = static_cast<int>(floor(hitTime * crossingRate + 0.5));
902 // ....determine fine shift within 25ns
903 float dTime = (float)(hitTime - crossingTime * time);
904 int j = iSamp - time;
905 if (j >= 0 && j < s_MAXSAMPLES) {
906 bareSignal[iSamp] +=
907 (pulseShape[j] - pulseShapeDer[j] * dTime) * theEnergy;
908 }
909 } else {
910 int j = iSamp - iTime + refTime;
911 if (j >= 0 && j < s_MAXSAMPLES) {
912 bareSignal[iSamp] += pulseShape[j] * theEnergy;
913 }
914 }
915 // saturation
916 if (bareSignal[iSamp] > satEt) {
917 bareSignal[iSamp] = satEt;
918 }
919 }
920 }
921 }
922 //
923 // ..... case FCAL
924 //
925 else if (m_lvl1Helper->is_fcal(towerId)) {
926
927 int emOrHad = m_lvl1Helper->sampling(towerId);
928 int module = emOrHad + 1;
929 std::vector<float> calibCoeff2 = m_calibCoeffFcal[module - 1];
930 if (emOrHad && (Ieta == 3 || Ieta == 4)) {
931 module += 1; // FCAL3
932 }
933 pulseShape = m_pulseShapeFcal[module - 1];
934 pulseShapeDer = m_pulseShapeDerFcal[module - 1];
935
936 //
937 // ... loop on time samples (only one if no pile-up)
938 //
939 for (int iTime = 0; iTime < visEvecSize; iTime++) {
940 float theEnergy = ttSumEnergy[iTime];
941 if ((!m_noEmCalibMode && module == 1) ||
942 (!m_noHadCalibMode && module > 1)) {
943 // apply calibration coefficient
944 theEnergy *= calibCoeff2[Ieta - 1];
945 }
946
947 // make samples
948 for (int iSamp = 0; iSamp < s_NBSAMPLES; iSamp++) {
949 if (!m_PileUp) {
950 // go back to signed value of time
951 int hitTime = iTime - refTime;
952 // go to 25 ns sampling
953 // int time = (int)(hitTime/25.+0.5) ;
954 int time = static_cast<int>(floor(hitTime * crossingRate + 0.5));
955 // ....determine fine shift within 25ns
956 float dTime = (float)(hitTime - crossingTime * time);
957 int j = iSamp - time;
958 if (j >= 0 && j < s_MAXSAMPLES) {
959 bareSignal[iSamp] +=
960 (pulseShape[j] - pulseShapeDer[j] * dTime) * theEnergy;
961 }
962 } else {
963 int j = iSamp - iTime + refTime;
964 if (j >= 0 && j < s_MAXSAMPLES) {
965 bareSignal[iSamp] += pulseShape[j] * theEnergy;
966 }
967 }
968 }
969 }
970 } else {
971 ATH_MSG_WARNING(" LArTTL1Maker: computeSignal unknown towerId "
972 << m_lvl1Helper->show_to_string(towerId));
973 return bareSignal;
974 }
975
976 return bareSignal;
977}
978
979std::vector<float> LArTTL1Maker::computeNoise(
980 const Identifier towerId, const int Ieta, std::vector<float>& inputV,
981 CLHEP::HepRandomEngine* rndmEngine) {
982
983 // +======================================================================+
984 // + +
985 // + Author: F. Ledroit +
986 // + Creation date: 2003/01/13 +
987 // + +
988 // +======================================================================+
989
990 std::vector<float> outputV(s_NBSAMPLES);
991
992 //
993 // .... first retrieve auto-correlation matrix and noise rms
994 //
995
996 float sigmaNoise = 0;
997 std::vector<float>* autoC = nullptr;
998 std::vector<float> noiseRms(4);
999
1000 bool emb = m_lvl1Helper->is_emb(towerId);
1001 bool barrelEnd = m_lvl1Helper->is_barrel_end(towerId);
1002 bool emec = m_lvl1Helper->is_emec(towerId);
1003 //
1004 // ..... case EM
1005 //
1006 if (emb || barrelEnd || emec) {
1007 //
1008 // ..... retrieve noise info for the tower
1009 //
1010 autoC = &(m_autoCorrEm);
1011 if (emb) {
1012 sigmaNoise = m_noiseRmsEmb[Ieta - 1];
1013 } else if (emec) {
1014 sigmaNoise = m_noiseRmsEmec[Ieta - 1];
1015 } else { // barrelEnd
1016 sigmaNoise = sqrt(m_noiseRmsEmb[14] * m_noiseRmsEmb[14] +
1018 ATH_MSG_VERBOSE(" LArTTL1Maker: barrelEnd noise rms" << sigmaNoise);
1019 }
1020 } // end case EM
1021 //
1022 // ..... case HEC
1023 //
1024 else if (m_lvl1Helper->is_hec(towerId)) {
1025
1026 autoC = &(m_autoCorrHec[Ieta - 1]);
1027 sigmaNoise = m_noiseRmsHec[Ieta - 1];
1028 }
1029 //
1030 // ..... case FCAL
1031 //
1032 else if (m_lvl1Helper->is_fcal(towerId)) {
1033
1034 int emOrHad = m_lvl1Helper->sampling(towerId);
1035 int module = emOrHad + 1;
1036 if (emOrHad && (Ieta == 3 || Ieta == 4)) {
1037 module += 1; // FCAL3
1038 }
1039 autoC = &m_autoCorrFcal;
1040 // sigmaNoise = m_noiseRmsFcal[module-1];
1041 noiseRms = m_noiseRmsFcal[module - 1];
1042 sigmaNoise = noiseRms[Ieta - 1];
1043 ATH_MSG_VERBOSE(" LArTTL1Maker: noise FCAL= "
1044 << sigmaNoise << " module= " << module << "Ieta= " << Ieta);
1045 } else {
1046 ATH_MSG_WARNING(" LArTTL1Maker: computeNoise unknown towerId "
1047 << m_lvl1Helper->show_to_string(towerId));
1048 return inputV;
1049 }
1050
1051 if (fabs((*autoC)[0]) < 0.001) {
1052 ATH_MSG_WARNING(" No autocorrelation matrix found for tower "
1053 << m_emHelper->show_to_string(towerId) << " "
1054 << "setting default values 1.00 0.10 -0.30 -0.20 "
1055 "-0.05 -0.01 -0.01 ");
1056 (*autoC)[0] = 1.00;
1057 (*autoC)[1] = 0.10;
1058 (*autoC)[2] = -0.30;
1059 (*autoC)[3] = -0.20;
1060 (*autoC)[4] = -0.05;
1061 (*autoC)[5] = -0.01;
1062 (*autoC)[6] = -0.01;
1063 }
1064 if (sigmaNoise < 0.001) {
1065 ATH_MSG_WARNING(" No noise rms value found for tower "
1066 << m_emHelper->show_to_string(towerId) << " "
1067 << "setting default value 300 MeV ");
1068 sigmaNoise = 300.;
1069 }
1070
1071 //
1072 // .... now compute the noise 'signal'
1073 //
1074
1075 const float c11 = sigmaNoise * (*autoC)[0];
1076 const float c21 = sigmaNoise * (*autoC)[1];
1077 const float c31 = sigmaNoise * (*autoC)[2];
1078 const float c41 = sigmaNoise * (*autoC)[3];
1079 const float c51 = sigmaNoise * (*autoC)[4];
1080 const float c61 = sigmaNoise * (*autoC)[5];
1081 const float c71 = sigmaNoise * (*autoC)[6];
1082 //
1083 const float c22 = sqrt(c11 * c11 - c21 * c21);
1084 const float inv_c22 = 1. / c22;
1085 const float c32 = (c21 * c11 - c21 * c31) * inv_c22;
1086 const float c33 = sqrt(c11 * c11 - c31 * c31 - c32 * c32);
1087 const float inv_c33 = 1. / c33;
1088 const float c42 = (c31 * c11 - c21 * c41) * inv_c22;
1089 const float c43 = (c21 * c11 - c31 * c41 - c32 * c42) * inv_c33;
1090 const float c44 = sqrt(c11 * c11 - c41 * c41 - c42 * c42 - c43 * c43);
1091 const float inv_c44 = 1. / c44;
1092 const float c52 = (c41 * c11 - c21 * c51) * inv_c22;
1093 const float c53 = (c31 * c11 - c31 * c51 - c32 * c52) * inv_c33;
1094 const float c54 = (c21 * c11 - c41 * c51 - c42 * c52 - c43 * c53) * inv_c44;
1095 const float c55 =
1096 sqrt(c11 * c11 - c51 * c51 - c52 * c52 - c53 * c53 - c54 * c54);
1097 const float inv_c55 = 1. / c55;
1098 const float c62 = (c51 * c11 - c21 * c61) * inv_c22;
1099 const float c63 = (c41 * c11 - c31 * c61 - c32 * c62) * inv_c33;
1100 const float c64 = (c31 * c11 - c41 * c61 - c42 * c62 - c43 * c63) * inv_c44;
1101 const float c65 =
1102 (c21 * c11 - c51 * c61 - c52 * c62 - c53 * c63 - c54 * c64) * inv_c55;
1103 const float c66 = sqrt(c11 * c11 - c61 * c61 - c62 * c62 - c63 * c63 -
1104 c64 * c64 - c65 * c65);
1105 const float c72 = (c61 * c11 - c21 * c71) * inv_c22;
1106 const float c73 = (c51 * c11 - c31 * c71 - c32 * c72) * inv_c33;
1107 const float c74 = (c41 * c11 - c41 * c71 - c42 * c72 - c43 * c73) * inv_c44;
1108 const float c75 =
1109 (c31 * c11 - c51 * c71 - c52 * c72 - c53 * c73 - c54 * c74) * inv_c55;
1110 const float c76 =
1111 (c21 * c11 - c61 * c71 - c62 * c72 - c63 * c73 - c64 * c74 - c65 * c75) /
1112 c66;
1113 const float c77 = sqrt(c11 * c11 - c71 * c71 - c72 * c72 - c73 * c73 -
1114 c74 * c74 - c75 * c75 - c76 * c76);
1115
1116 double rndm[s_NBSAMPLES];
1117 RandGaussZiggurat::shootArray(rndmEngine, static_cast<int>(s_NBSAMPLES), rndm,
1118 0., 1.);
1119 outputV[0] = inputV[0] + c11 * rndm[0];
1120 outputV[1] = inputV[1] + c21 * rndm[0] + c22 * rndm[1];
1121 outputV[2] = inputV[2] + c31 * rndm[0] + c32 * rndm[1] + c33 * rndm[2];
1122 outputV[3] =
1123 inputV[3] + c41 * rndm[0] + c42 * rndm[1] + c43 * rndm[2] + c44 * rndm[3];
1124 outputV[4] = inputV[4] + c51 * rndm[0] + c52 * rndm[1] + c53 * rndm[2] +
1125 c54 * rndm[3] + c55 * rndm[4];
1126 outputV[5] = inputV[5] + c61 * rndm[0] + c62 * rndm[1] + c63 * rndm[2] +
1127 c64 * rndm[3] + c65 * rndm[4] + c66 * rndm[5];
1128 outputV[6] = inputV[6] + c71 * rndm[0] + c72 * rndm[1] + c73 * rndm[2] +
1129 c74 * rndm[3] + c75 * rndm[4] + c76 * rndm[5] + c77 * rndm[6];
1130
1131 return outputV;
1132}
1133
1135 //
1136 // ...... Read auxiliary data file for EM (barrel and EC)
1137 //
1138
1139 ATH_MSG_DEBUG("executing readAuxiliary()");
1140
1141 float refEnergy;
1142 std::vector<float> pulseShape(s_MAXSAMPLES);
1143 std::vector<float> pulseShapeDer(s_MAXSAMPLES);
1144 std::string barrel_endcap;
1145 int Ieta;
1146 float sinTheta = 0.;
1147 std::vector<float> layerRelGain(s_NBDEPTHS);
1148 std::vector<float> noiseRms(3);
1149 std::vector<float> noiseRms4(4);
1150 std::vector<float> autoCorr(s_NBSAMPLES);
1151
1152 std::string pulsedataname =
1153 PathResolver::find_file("LArEmLvl1.data", "DATAPATH");
1154 if (pulsedataname.empty()) {
1155 ATH_MSG_ERROR("Could not locate LArEmLvl1.data file");
1156 return StatusCode::FAILURE;
1157 }
1158 const char* pulsedatafile = pulsedataname.c_str();
1159 std::ifstream infile(pulsedatafile);
1160
1161 if (!infile) {
1162 ATH_MSG_ERROR(" cannot open EM file ");
1163 return StatusCode::FAILURE;
1164 } else {
1165 ATH_MSG_DEBUG(" EM file opened ");
1166 }
1167
1168 // first read the pulse shape for all energies
1169 // valid for both barrel and endcap (from Xavier de la Broise)
1170 for (int iene = 0; iene < s_NBENERGIES; iene++) {
1171 infile >> refEnergy >> pulseShape[0] >> pulseShape[1] >> pulseShape[2] >>
1172 pulseShape[3] >> pulseShape[4] >> pulseShape[5] >> pulseShape[6] >>
1173 pulseShape[7] >> pulseShape[8] >> pulseShape[9] >> pulseShape[10] >>
1174 pulseShape[11] >> pulseShape[12] >> pulseShape[13] >> pulseShape[14] >>
1175 pulseShape[15] >> pulseShape[16] >> pulseShape[17] >> pulseShape[18] >>
1176 pulseShape[19] >> pulseShape[20] >> pulseShape[21] >> pulseShape[22] >>
1177 pulseShape[23];
1178 m_refEnergyEm.push_back(refEnergy);
1179 m_pulseShapeEm.push_back(pulseShape);
1180 infile >> pulseShapeDer[0] >> pulseShapeDer[1] >> pulseShapeDer[2] >>
1181 pulseShapeDer[3] >> pulseShapeDer[4] >> pulseShapeDer[5] >>
1182 pulseShapeDer[6] >> pulseShapeDer[7] >> pulseShapeDer[8] >>
1183 pulseShapeDer[9] >> pulseShapeDer[10] >> pulseShapeDer[11] >>
1184 pulseShapeDer[12] >> pulseShapeDer[13] >> pulseShapeDer[14] >>
1185 pulseShapeDer[15] >> pulseShapeDer[16] >> pulseShapeDer[17] >>
1186 pulseShapeDer[18] >> pulseShapeDer[19] >> pulseShapeDer[20] >>
1187 pulseShapeDer[21] >> pulseShapeDer[22] >> pulseShapeDer[23];
1188 m_pulseShapeDerEm.push_back(pulseShapeDer);
1189 }
1190
1191 // then read autocorrelation function valid for barrel and endcap
1192 // ("default" auto-correlation function)
1193 m_autoCorrEm.resize(s_NBSAMPLES);
1194 infile >> m_autoCorrEm[0] >> m_autoCorrEm[1] >> m_autoCorrEm[2] >>
1196
1197 // then read the separator for barrel
1198 infile >> barrel_endcap;
1199
1200 for (int ieta = 0; ieta < s_NBETABINS; ieta++) {
1201 // then read the calibration factor (from MC)
1202 // and the noise rms (from Bill Cleland) for each eta bin, in barrel
1203 infile >> Ieta >> sinTheta;
1204 m_sinThetaEmb.push_back(sinTheta);
1205 infile >> noiseRms[0] >> noiseRms[1] >> noiseRms[2];
1206 m_noiseRmsEmb.push_back(noiseRms[2]);
1207 // if later we want to disentangle between pre-sum and summing electronic
1208 // noise...
1209 // m_noiseRmsEmb.push_back(noiseRms);
1210 }
1211
1212 // now read the separator for endcap
1213 infile >> barrel_endcap;
1214
1215 for (int ieta = 0; ieta < s_NBETABINS; ieta++) {
1216 // then read the calibration coefficient (from MC)
1217 // and the noise rms (from Bill Cleland) for each eta bin, in barrel
1218 infile >> Ieta >> sinTheta;
1219 m_sinThetaEmec.push_back(sinTheta);
1220 infile >> noiseRms[0] >> noiseRms[1] >> noiseRms[2];
1221 m_noiseRmsEmec.push_back(noiseRms[2]);
1222 // if later we want to disentangle between pre-sum and summing electronic
1223 // noise...
1224 // m_noiseRmsEmec.push_back(noiseRms);
1225 }
1226
1227 infile.close();
1228 ATH_MSG_DEBUG(" EM file closed ");
1229
1230 ATH_MSG_INFO(" 1 pulse shape per energy for EMB+EMEC : ");
1231 for (int iene = 0; iene < s_NBENERGIES; iene++) {
1233 m_refEnergyEm[iene]
1234 << " MeV: " << (m_pulseShapeEm[iene])[0] << ", "
1235 << (m_pulseShapeEm[iene])[1] << ", " << (m_pulseShapeEm[iene])[2]
1236 << ", " << (m_pulseShapeEm[iene])[3] << ", "
1237 << (m_pulseShapeEm[iene])[4] << ", " << (m_pulseShapeEm[iene])[5]
1238 << ", " << (m_pulseShapeEm[iene])[6] << ", "
1239 << (m_pulseShapeEm[iene])[7] << ", " << (m_pulseShapeEm[iene])[8]
1240 << ", " << (m_pulseShapeEm[iene])[9] << ", "
1241 << (m_pulseShapeEm[iene])[10] << ", " << (m_pulseShapeEm[iene])[11]
1242 << ", " << (m_pulseShapeEm[iene])[12] << ", "
1243 << (m_pulseShapeEm[iene])[13] << ", " << (m_pulseShapeEm[iene])[14]
1244 << ", " << (m_pulseShapeEm[iene])[15] << ", "
1245 << (m_pulseShapeEm[iene])[16] << ", " << (m_pulseShapeEm[iene])[17]
1246 << ", " << (m_pulseShapeEm[iene])[18] << ", "
1247 << (m_pulseShapeEm[iene])[19] << ", " << (m_pulseShapeEm[iene])[20]
1248 << ", " << (m_pulseShapeEm[iene])[21] << ", "
1249 << (m_pulseShapeEm[iene])[22] << ", " << (m_pulseShapeEm[iene])[23]
1250 << ", ");
1251 }
1252 ATH_MSG_INFO(" 1 auto-corr matrix for EMB+EMEC : "
1253 << m_autoCorrEm[0] << ", " << m_autoCorrEm[1] << ", "
1254 << m_autoCorrEm[2] << ", " << m_autoCorrEm[3] << ", "
1255 << m_autoCorrEm[4] << ", " << m_autoCorrEm[5] << ", "
1256 << m_autoCorrEm[6]);
1257
1259 " Finished reading 1 calib coeff + 1 noise value per eta bin for EM: ");
1260 for (int ieta = 0; ieta < s_NBETABINS; ieta++) {
1261 // currently the calib coeffs are all set to 1 -> turning INFO logs into
1262 // DEBUG
1263 ATH_MSG_DEBUG("Ieta= " << ieta + 1
1264 << ", calib coeff EMB: " << m_calibCoeffEmb[ieta]
1265 << ", calib coeff EMEC: " << m_calibCoeffEmec[ieta]);
1266 ATH_MSG_INFO("Ieta= " << ieta + 1 << ", noise rms EMB: "
1267 << m_noiseRmsEmb[ieta] << " MeV"
1268 << ", noise rms EMEC: " << m_noiseRmsEmec[ieta]
1269 << " MeV");
1270 }
1271
1272 //
1273 // ...... Read auxiliary data file for HEC
1274 //
1275
1276 pulsedataname = PathResolver::find_file("LArHecLvl1.data", "DATAPATH");
1277 if (pulsedataname.empty()) {
1278 ATH_MSG_ERROR("Could not locate LArHecLvl1.data file");
1279 return StatusCode::FAILURE;
1280 }
1281 pulsedatafile = pulsedataname.c_str();
1282 infile.open(pulsedatafile);
1283
1284 if (!infile) {
1285 ATH_MSG_ERROR(" cannot open HEC file ");
1286 return StatusCode::FAILURE;
1287 } else {
1288 ATH_MSG_DEBUG(" HEC file opened ");
1289 }
1290
1291 // first read the pulse shape for each eta bin (from Leonid Kurchaninov)
1293 infile >> m_pulseShapeHec[0] >> m_pulseShapeHec[1] >> m_pulseShapeHec[2] >>
1301
1303 infile >> m_pulseShapeDerHec[0] >> m_pulseShapeDerHec[1] >>
1314
1316 m_sinThetaHec.resize(s_NBETABINS);
1317 m_noiseRmsHec.resize(s_NBETABINS);
1318 m_autoCorrHec.push_back(autoCorr);
1319 for (int ieta = 1; ieta < s_NBETABINS; ieta++) {
1320 // now read for each eta bin:
1321 // - the calibration factor (determined from MC)
1322 // - the transverse saturating energies (same in all eta bins but Ieta=15)
1323 // - the value of sin_theta
1324 // - the noise rms
1325 infile >> Ieta >> m_satEnergyHec[ieta] >> m_sinThetaHec[ieta] >>
1326 m_noiseRmsHec[ieta];
1327
1328 // and the autocorrelation function for each eta bin (from Leonid
1329 // Kurchaninov)
1330 infile >> autoCorr[0] >> autoCorr[1] >> autoCorr[2] >> autoCorr[3] >>
1331 autoCorr[4] >> autoCorr[5] >> autoCorr[6];
1332 m_autoCorrHec.push_back(autoCorr);
1333 }
1334 infile.close();
1335 ATH_MSG_DEBUG(" HEC file closed ");
1336 ATH_MSG_INFO(" 1 pulse shape for HEC : "
1337 << m_pulseShapeHec[0] << ", " << m_pulseShapeHec[1] << ", "
1338 << m_pulseShapeHec[2] << ", " << m_pulseShapeHec[3] << ", "
1339 << m_pulseShapeHec[4] << ", " << m_pulseShapeHec[5] << ", "
1340 << m_pulseShapeHec[5] << ", " << m_pulseShapeHec[6] << ", "
1341 << m_pulseShapeHec[7] << ", " << m_pulseShapeHec[8] << ", "
1342 << m_pulseShapeHec[9] << ", " << m_pulseShapeHec[10] << ", "
1343 << m_pulseShapeHec[11] << ", " << m_pulseShapeHec[12] << ", "
1344 << m_pulseShapeHec[13] << ", " << m_pulseShapeHec[14] << ", "
1345 << m_pulseShapeHec[15] << ", " << m_pulseShapeHec[16] << ", "
1346 << m_pulseShapeHec[17] << ", " << m_pulseShapeHec[18] << ", "
1347 << m_pulseShapeHec[19] << ", " << m_pulseShapeHec[20] << ", "
1348 << m_pulseShapeHec[21] << ", " << m_pulseShapeHec[22] << ", "
1349 << m_pulseShapeHec[23]);
1351 "Finished reading calib coeff, noise rms, sat ene, auto corr for each "
1352 "eta bin for HEC: ");
1353 for (int ieta = 1; ieta < s_NBETABINS; ieta++) {
1354 // currently the calib coeffs are all set to 1 -> turning INFO logs into
1355 // DEBUG
1356 ATH_MSG_DEBUG(" Ieta= " << ieta + 1
1357 << ", calib coeff HEC: " << m_calibCoeffHec[ieta]);
1358 ATH_MSG_INFO(" Ieta= " << ieta + 1 << ", noise rms HEC: "
1359 << m_noiseRmsHec[ieta] << " MeV"
1360 << ", sat ene HEC: " << m_satEnergyHec[ieta]
1361 << " MeV");
1362 ATH_MSG_INFO(" Ieta= " << ieta + 1
1363 << ", auto corr HEC: " << (m_autoCorrHec[ieta])[0]
1364 << ", " << (m_autoCorrHec[ieta])[1] << ", "
1365 << (m_autoCorrHec[ieta])[2] << ", "
1366 << (m_autoCorrHec[ieta])[3] << ", "
1367 << (m_autoCorrHec[ieta])[4] << ", "
1368 << (m_autoCorrHec[ieta])[5] << ", "
1369 << (m_autoCorrHec[ieta])[6] << ", ");
1370 }
1371
1372 //
1373 // ...... Read auxiliary data files for FCAL
1374 //
1375
1376 pulsedataname = PathResolver::find_file("LArFcalLvl1.data", "DATAPATH");
1377 if (pulsedataname.empty()) {
1378 ATH_MSG_ERROR("Could not locate LArFcalLvl1.data file");
1379 return StatusCode::FAILURE;
1380 }
1381 pulsedatafile = pulsedataname.c_str();
1382 infile.open(pulsedatafile);
1383
1384 if (!infile) {
1385 ATH_MSG_ERROR(" cannot open FCAL file ");
1386 return StatusCode::FAILURE;
1387 } else {
1388 ATH_MSG_DEBUG(" FCAL file opened ");
1389 }
1390
1391 const int nMod = 3;
1392 // m_noiseRmsFcal.resize(nMod);
1393 int imod = 0;
1394
1395 for (int iMod = 0; iMod < nMod; iMod++) {
1396
1397 // first read the module number + noise rms (from J. Rutherfoord)
1398 // infile >> imod >> m_noiseRmsFcal[iMod] ;
1399 infile >> imod >> noiseRms4[0] >> noiseRms4[1] >> noiseRms4[2] >>
1400 noiseRms4[3];
1401 m_noiseRmsFcal.push_back(noiseRms4);
1402
1403 // read the pulse shape for this module (from John Rutherfoord)
1404 infile >> pulseShape[0] >> pulseShape[1] >> pulseShape[2] >>
1405 pulseShape[3] >> pulseShape[4] >> pulseShape[5] >> pulseShape[6] >>
1406 pulseShape[7] >> pulseShape[8] >> pulseShape[9] >> pulseShape[10] >>
1407 pulseShape[11] >> pulseShape[12] >> pulseShape[13] >> pulseShape[14] >>
1408 pulseShape[15] >> pulseShape[16] >> pulseShape[17] >> pulseShape[18] >>
1409 pulseShape[19] >> pulseShape[20] >> pulseShape[21] >> pulseShape[22] >>
1410 pulseShape[23];
1411 m_pulseShapeFcal.push_back(pulseShape);
1412
1413 // read the pulse shape derivative
1414 infile >> pulseShapeDer[0] >> pulseShapeDer[1] >> pulseShapeDer[2] >>
1415 pulseShapeDer[3] >> pulseShapeDer[4] >> pulseShapeDer[5] >>
1416 pulseShapeDer[6] >> pulseShapeDer[7] >> pulseShapeDer[8] >>
1417 pulseShapeDer[9] >> pulseShapeDer[10] >> pulseShapeDer[11] >>
1418 pulseShapeDer[12] >> pulseShapeDer[13] >> pulseShapeDer[14] >>
1419 pulseShapeDer[15] >> pulseShapeDer[16] >> pulseShapeDer[17] >>
1420 pulseShapeDer[18] >> pulseShapeDer[19] >> pulseShapeDer[20] >>
1421 pulseShapeDer[21] >> pulseShapeDer[22] >> pulseShapeDer[23];
1422 m_pulseShapeDerFcal.push_back(pulseShapeDer);
1423 }
1424
1426 // finally read standard autocorrelation matrix
1427 infile >> m_autoCorrFcal[0] >> m_autoCorrFcal[1] >> m_autoCorrFcal[2] >>
1429 m_autoCorrFcal[6];
1430
1431 infile.close();
1432 ATH_MSG_DEBUG(" FCAL file closed ");
1433
1434 std::vector<float> auxV(3);
1437
1439 "Finished reading noise, calib coeff and pulse shape for each module for "
1440 "FCAL: ");
1441 for (int iMod = 0; iMod < nMod; iMod++) {
1442
1443 ATH_MSG_INFO(" iMod= " << iMod << ", noise rms FCAL (eta bin 1,2,3,4): "
1444 << m_noiseRmsFcal[iMod] << " (transverse) MeV ");
1445 if (iMod < 2) {
1446 ATH_MSG_INFO(" iMod= " << iMod << ", calib coeff FCAL (eta bin 1,2,3,4): "
1447 << (m_calibCoeffFcal[iMod])[0] << ", "
1448 << (m_calibCoeffFcal[iMod])[1] << ", "
1449 << (m_calibCoeffFcal[iMod])[2] << ", "
1450 << (m_calibCoeffFcal[iMod])[3]);
1451 }
1453 " iMod= "
1454 << iMod << ", pulse shape FCAL: " << (m_pulseShapeFcal[iMod])[0] << ", "
1455 << (m_pulseShapeFcal[iMod])[1] << ", " << (m_pulseShapeFcal[iMod])[2]
1456 << ", " << (m_pulseShapeFcal[iMod])[3] << ", "
1457 << (m_pulseShapeFcal[iMod])[4] << ", " << (m_pulseShapeFcal[iMod])[5]
1458 << ", " << (m_pulseShapeFcal[iMod])[6] << ", "
1459 << (m_pulseShapeFcal[iMod])[7] << ", " << (m_pulseShapeFcal[iMod])[8]
1460 << ", " << (m_pulseShapeFcal[iMod])[9] << ", "
1461 << (m_pulseShapeFcal[iMod])[10] << ", " << (m_pulseShapeFcal[iMod])[11]
1462 << ", " << (m_pulseShapeFcal[iMod])[12] << ", "
1463 << (m_pulseShapeFcal[iMod])[13] << ", " << (m_pulseShapeFcal[iMod])[14]
1464 << ", " << (m_pulseShapeFcal[iMod])[15] << ", "
1465 << (m_pulseShapeFcal[iMod])[16] << ", " << (m_pulseShapeFcal[iMod])[17]
1466 << ", " << (m_pulseShapeFcal[iMod])[18] << ", "
1467 << (m_pulseShapeFcal[iMod])[19] << ", " << (m_pulseShapeFcal[iMod])[20]
1468 << ", " << (m_pulseShapeFcal[iMod])[21] << ", "
1469 << (m_pulseShapeFcal[iMod])[22] << ", "
1470 << (m_pulseShapeFcal[iMod])[23]);
1471 }
1472 ATH_MSG_INFO("auto corr FCAL: "
1473 << m_autoCorrFcal[0] << ", " << m_autoCorrFcal[1] << ", "
1474 << m_autoCorrFcal[2] << ", " << m_autoCorrFcal[3] << ", "
1475 << m_autoCorrFcal[4] << ", " << m_autoCorrFcal[5] << ", "
1476 << m_autoCorrFcal[6]);
1477
1478 // now the relative gains
1479 pulsedataname =
1480 PathResolver::find_file("Fcal_ptweights_table7.data", "DATAPATH");
1481 if (pulsedataname.empty()) {
1482 ATH_MSG_ERROR("Could not locate Fcal_ptweights_table7.data file");
1483 return StatusCode::FAILURE;
1484 }
1485 pulsedatafile = pulsedataname.c_str();
1486 infile.open(pulsedatafile);
1487
1488 if (!infile) {
1489 ATH_MSG_ERROR(" cannot open FCAL gains file ");
1490 return StatusCode::FAILURE;
1491 } else {
1492 ATH_MSG_DEBUG(" FCAL gains file opened ");
1493 }
1494
1495 // first read the gain file for all cells (from John Rutherfoord)
1496
1497 m_cellRelGainFcal.resize(m_fcalHelper->channel_hash_max());
1498 // file structure:
1499 const unsigned int colNum = 14;
1500 // number of cells per 'group' (sharing the same gain)
1501 const unsigned int maxCell = 4;
1502 std::vector<std::string> TTlabel;
1503 TTlabel.resize(colNum);
1504 std::vector<float> gain;
1505 gain.resize(colNum);
1506 int iline = 0;
1507 int ngain = 0;
1508
1509 while (infile >> TTlabel[0] >> gain[0] >> TTlabel[1] >> gain[1] >>
1510 TTlabel[2] >> gain[2] >> TTlabel[3] >> gain[3] >> TTlabel[4] >>
1511 gain[4] >> TTlabel[5] >> gain[5] >> TTlabel[6] >> gain[6] >>
1512 TTlabel[7] >> gain[7] >> TTlabel[8] >> gain[8] >> TTlabel[9] >>
1513 gain[9] >> TTlabel[10] >> gain[10] >> TTlabel[11] >> gain[11] >>
1514 TTlabel[12] >> gain[12] >> TTlabel[13] >> gain[13]) {
1515
1516 ATH_MSG_DEBUG(" TTlabel[0], gain[0]= " << TTlabel[0] << ", " << gain[0]);
1517 ATH_MSG_DEBUG(" [...] ");
1518 ATH_MSG_DEBUG(" TTlabel[13], gain[13]= " << TTlabel[13] << ", "
1519 << gain[13]);
1520
1521 // int barrel_ec_fcal = 2;
1522 // int pos_neg = -2; // C side (neg z)
1523 int detZside = -1;
1524 if (iline < 32) {
1525 detZside = 1;
1526 } // A side (pos z)
1527 // if(iline < 32) {pos_neg = 2;} // A side (pos z)
1528 for (unsigned int icol = 0; icol < colNum; icol++) {
1529
1530 int em_had = 0; // FCAL1
1531 int layer = 0;
1532 if (icol > 7) {
1533 em_had = 1; // FCAL2+FCAL3
1534 if (icol > 11) {
1535 layer = 1;
1536 }
1537 }
1538 int region = 3; // FCAL
1539
1540 std::string TTlab = TTlabel[icol];
1541 // int Ieta = int(TTlab[0])-48;
1542 // int Lphi = int(TTlab[1])-64;
1543 int eta = int(TTlab[0]) - 49;
1544 int phi = int(TTlab[1]) - 65;
1545 int nPhi = 16;
1546 if (detZside < 0) {
1547 phi = (phi < nPhi / 2 ? nPhi / 2 - 1 - phi : 3 * nPhi / 2 - 1 - phi);
1548 }
1549
1550 int group = 1;
1551 if (TTlab.size() > 3) {
1552 group = int(TTlab[3]) - 48;
1553 }
1554
1555 // added Nov 2009 following introduction of TTCell map "FcalFix"
1556 // modified again Jun 2010 following introduction of TTCell map "FcalFix2"
1557 // (the C side is not symmetric wrt the A side) modified again Jan 2011 in
1558 // an attempt to correctly load the gains to the correct cells (not all
1559 // cells were being assigned gains)
1560 if (em_had) { // FCAL-had only
1561 if ((layer == 1 && detZside > 0) || (layer == 0 && detZside < 0)) {
1562 if (eta == 0 || eta == 2) {
1563 eta += 1;
1564 // group+=1; //- OLD CODE (pre Jan2011 change)
1565
1566 } else {
1567 if (layer == 1) {
1568 group += 1;
1569 } else {
1570 group += 2;
1571 }
1572 }
1573 } else {
1574 if (eta == 1 || eta == 3) {
1575 eta -= 1;
1576 // group+=2; //- OLD CODE (pre Jan2011 change)
1577 if (layer == 1) {
1578 group += 1;
1579 } else {
1580 group += 2;
1581 }
1582 }
1583 }
1584 }
1585 //
1586 // ... create an offline TT+layer identifier from the labels read in.
1587 //
1588 Identifier ttId =
1589 m_lvl1Helper->layer_id(detZside, em_had, region, eta, phi, layer);
1590 ATH_MSG_DEBUG("ttId= " << m_lvl1Helper->show_to_string(ttId));
1591 //
1592 //... fill a vector with offline identifier of cells belonging to this
1593 // tower (with layer info)
1594 //
1595 std::vector<Identifier> cellIdVec = m_ttSvc->createCellIDvecLayer(ttId);
1596 //
1597 // .... loop on all LAr offline channels belonging to the trigger tower
1598 // (with layer info)
1599 //
1600 std::vector<unsigned int> hashVec;
1601 // number of connected cells in the current tower
1602 unsigned int nCell = 0;
1603 for (unsigned int ichan = 0; ichan < cellIdVec.size(); ichan++) {
1604 Identifier cellId = cellIdVec[ichan];
1605
1606 int cellPhi = m_fcalHelper->phi(cellId);
1607 if (cellPhi >=
1608 0) { // protection skipping unconnected channels (they have
1609 // eta=phi=-999) - normally, they should not be in the list
1610 nCell++;
1611 //
1612 // .... convert to FCAL hash
1613 //
1614 IdentifierHash fcalHash = m_fcalHelper->channel_hash(cellId);
1615 //
1616 //... save hash indices
1617 //
1618 hashVec.push_back(fcalHash);
1619 } // end condition cellPhi>=0
1620
1621 } // end of loop on channels in the tower
1622 ATH_MSG_DEBUG("nCell= " << nCell);
1623
1624 //
1625 //... loop on the 4 cells of the current group and put their gain in the
1626 // gain vector (indexed by hashes)
1627 //
1628 for (unsigned int iCell = 0; iCell < maxCell; iCell++) {
1629 unsigned int index0 = (group - 1) * maxCell + iCell;
1630 if (index0 < nCell) { // unconnected channels have highest hash ids
1631 // (because highest eta values)
1632 unsigned int index = hashVec[index0];
1633 m_cellRelGainFcal[index] = gain[icol];
1634 ngain++;
1635 ATH_MSG_DEBUG(" index, gain= " << index << ", " << gain[icol]);
1636 }
1637 }
1638
1639 } // end of loop on columns
1640 iline++;
1641 } // end of loop on lines
1642
1643 ATH_MSG_DEBUG(" number of lines found= " << iline);
1644 infile.close();
1645 ATH_MSG_INFO(" FCAL gains file closed, extracted " << ngain << " gains");
1646
1647 return StatusCode::SUCCESS;
1648}
1649//===========================================================================
1650int LArTTL1Maker::decodeInverse(int region, int eta) {
1651 //===========================================================================
1652 // Maps [ region , eta ] to [ Ieta]
1653 // ==========================================================================
1654 // Problem: this is NOT a bijection, because of the "barrel end" zone.
1655 // Convention: only the barrel part of the identifying fields is
1656 // returned
1657 //===========================================================================
1658
1659 int Ieta = 0;
1660 if (region == 0) { // Barrel + EC-OW
1661 if (eta <= 14) {
1662 Ieta = eta + 1;
1663 } else {
1664 Ieta = eta - 13;
1665 }
1666 } else if (region == 1 || region == 2) { // EC-IW
1667 if (region == 1) {
1668 Ieta = eta + 12;
1669 } else {
1670 Ieta = 15;
1671 }
1672 } else if (region == 3) { // FCAL
1673 Ieta = eta + 1;
1674 }
1675 return Ieta;
1676}
float hitTime(const AFP_SIDSimHit &hit)
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
float et(const xAOD::jFexSRJetRoI *j)
#define maxCell
A wrapper class for event-slot-local random engines.
Definition RNGWrapper.h:56
SeedingOptionType
Options for seeding option=0 is setSeed as in MC20 option=1 is setSeedLegacy as in MC16 option=2 is s...
Definition RNGWrapper.h:97
void setSeedLegacy(const std::string &algName, size_t slot, uint64_t ev, uint64_t run, uint64_t offset, SeedingOptionType seeding, EventContext::ContextEvt_t evt=EventContext::INVALID_CONTEXT_EVT)
Set the random seed using a string (e.g.
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
This class initializes the Calo (LAr and Tile) offline identifiers.
const CaloLVL1_ID * getLVL1_ID(void) const
virtual const float & FSAMPL(const HWIdentifier &id) const =0
This is a "hash" representation of an Identifier.
const LARLIST & getData() const
Definition LArHitList.h:25
std::vector< std::vector< float > > m_noiseRmsFcal
auxiliary FCAL data: noise rms
std::vector< float > m_sinThetaEmec
auxiliary EMEC data: sin(theta)
std::vector< std::vector< float > > m_calibCoeffFcal
auxiliary FCAL data: calibration coefficients
SG::WriteHandleKey< LArTTL1Container > m_HadTTL1ContainerName
algorithm property: container name for the HAD TTL1s
SG::WriteHandleKey< LArTTL1Container > m_EmTTL1ContainerName
algorithm property: container name for the EM TTL1s
Gaudi::Property< bool > m_useLegacyRandomSeeds
virtual StatusCode finalize() override
Gaudi::Property< bool > m_useTriggerTime
Alorithm property: use trigger time or not.
std::vector< std::vector< float > > m_pulseShapeDerEm
auxiliary EM data: pulse shape derivative
std::vector< float > m_sinThetaEmb
auxiliary EMBarrel data: sin(theta)
virtual void handle(const Incident &) override
IChronoStatSvc * m_chronSvc
std::vector< float > computeNoise(const Identifier towerId, const int Ieta, std::vector< float > &inputV, CLHEP::HepRandomEngine *rndmEngine)
std::vector< std::vector< float > > m_pulseShapeDerFcal
auxiliary FCAL data: pulse shape derivatives
std::vector< std::vector< float > > m_pulseShapeFcal
auxiliary FCAL data: pulse shapes
std::vector< float > m_satEnergyHec
auxiliary HEC data: saturation energy
std::vector< float > computeSignal(const Identifier towerId, const int Ieta, const int specialCase, std::vector< float > visEnergy, const int refTime) const
initialize hit map
Gaudi::Property< std::string > m_truthHitsContainer
key for saving truth
const LArHEC_ID * m_hecHelper
pointer to the offline HEC helper
PublicToolHandle< CaloTriggerTowerService > m_ttSvc
const LArEM_ID * m_emHelper
pointer to the offline EM helper
SG::ReadHandleKey< LArHitEMap > m_hitMapKey
hit map
std::vector< std::vector< float > > m_autoCorrHec
auxiliary HEC data: auto-correlation matrix
std::vector< float > m_noiseRmsEmec
auxiliary EMEC data: noise rms
Gaudi::Property< std::vector< float > > m_calibCoeffFcalHad
auxiliary FCAL data: calibration coefficients
virtual StatusCode initialize() override
Read ascii files for auxiliary data (puslse shapes, noise, etc...)
std::vector< float > m_autoCorrEm
auxiliary EM data: auto-correlation matrix
const CaloLVL1_ID * m_lvl1Helper
pointer to the offline TT helper
static const short s_NBDEPTHS
number of sampling (in depth)
static const short s_MAXSAMPLES
max number of samples in pulse shape
std::vector< std::vector< float > > m_pulseShapeEm
auxiliary EM data: pulse shapes
Gaudi::Property< bool > m_PileUp
algorithm property: pile up or not
std::vector< float > m_sinThetaHec
auxiliary HEC data: sin(theta)
std::vector< float > m_refEnergyEm
auxiliary EM data: reference energies for saturation simulation
const LArFCAL_ID * m_fcalHelper
pointer to the offline FCAL helper
PublicToolHandle< ITriggerTime > m_triggerTimeTool
Alorithm property: name of the TriggerTimeTool.
std::vector< float > m_noiseRmsHec
auxiliary HEC data: noise rms
std::vector< float > m_pulseShapeDerHec
auxiliary HEC data: pulse shape derivative
Gaudi::Property< float > m_debugThresh
algorithm property: debug threshold
Gaudi::Property< std::string > m_randomStreamName
const CaloCell_ID * m_OflHelper
pointer to the offline id helper
StatusCode readAuxiliary()
method called at the begining of execute() to fill the hit map
Gaudi::Property< bool > m_chronoTest
algorithm property: switch chrono on
Gaudi::Property< bool > m_noEmCalibMode
algorithm property: no calibration mode for EM towers
std::vector< float > m_pulseShapeHec
auxiliary HEC data: pulse shape
static const short s_NBETABINS
number of eta bins
Gaudi::Property< std::vector< float > > m_calibCoeffEmec
auxiliary EMEC data: calibration coeeficient
Gaudi::Property< bool > m_NoiseOnOff
algorithm property: noise (in all sub-detectors) is on if true
Gaudi::Property< uint32_t > m_randomSeedOffset
std::array< SG::ReadHandleKey< LArHitContainer >, 4 > m_xxxHitContainerName
ServiceHandle< IAthRNGSvc > m_RandomSvc
Gaudi::Property< bool > m_noHadCalibMode
algorithm property: no calibration mode for had towers
std::vector< float > m_noiseRmsEmb
auxiliary EMBarrel data: noise rms
std::vector< float > m_cellRelGainFcal
auxiliary FCAL data: relative gains
static const short s_NBENERGIES
number of energies at which saturation is described (em)
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
Sampling fractions retrieved from DB.
static const short s_NBSAMPLES
number of samples in TTL1s
std::vector< float > m_autoCorrFcal
auxiliary FCAL data: auto-correlation matrix
static const short s_PEAKPOS
peak position
virtual StatusCode execute() override
Create LArTTL1 object save in TES (2 containers: 1 EM, 1 hadronic)
Gaudi::Property< std::vector< float > > m_calibCoeffEmb
auxiliary EMBarrel data: calibration coefficient
Gaudi::Property< std::vector< float > > m_calibCoeffFcalEm
auxiliary FCAL data: calibration coefficients
int decodeInverse(int region, int eta)
Gaudi::Property< std::vector< float > > m_calibCoeffHec
auxiliary HEC data: calibration coefficients
Liquid Argon TT L1 sum class.
Definition LArTTL1.h:29
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Definition index.py:1
Extra patterns decribing particle interation process.