19 #include "CLHEP/Random/RandGaussZiggurat.h"
20 #include "CLHEP/Random/RandomEngine.h"
36 #include "GaudiKernel/IChronoStatSvc.h"
37 #include "GaudiKernel/IIncidentSvc.h"
47 using CLHEP::RandGaussZiggurat;
50 constexpr
double crossingTime = 25 ;
51 constexpr
double crossingRate = 1. / crossingTime;
56 m_ttSvc(
"CaloTriggerTowerService"),
57 m_fSamplKey(
"LArfSamplSym"),
58 m_EmTTL1ContainerName{
"LArTTL1EM"},
59 m_HadTTL1ContainerName{
"LArTTL1HAD"},
60 m_xxxHitContainerName{
61 {std::string(
"LArHitEMB"), std::string(
"LArHitEMEC"),
62 std::string(
"LArHitHEC"), std::string(
"LArHitFCAL")}}
74 m_useTriggerTime =
false;
78 m_BeginRunPriority = 100;
80 m_lvl1Helper =
nullptr;
82 m_hecHelper =
nullptr;
83 m_fcalHelper =
nullptr;
87 m_noEmCalibMode =
false;
88 m_noHadCalibMode =
false;
90 m_debugThresh = 5000.;
92 m_calibCoeffEmb.resize(s_NBETABINS);
93 m_calibCoeffEmec.resize(s_NBETABINS);
94 m_calibCoeffHec.resize(s_NBETABINS);
95 for (
int ieta = 0; ieta < s_NBETABINS; ieta++) {
96 m_calibCoeffEmb[ieta] = 1.;
97 m_calibCoeffEmec[ieta] = 1.;
98 m_calibCoeffHec[ieta] = 1.;
101 m_calibCoeffFcalEm.resize(
nEta);
102 m_calibCoeffFcalHad.resize(
nEta);
103 for (
int ieta = 0; ieta <
nEta; ieta++) {
104 m_calibCoeffFcalEm[ieta] = .03;
105 m_calibCoeffFcalHad[ieta] = .03;
112 declareProperty(
"EmBarrelHitContainerName", m_xxxHitContainerName[0]);
113 declareProperty(
"EmEndCapHitContainerName", m_xxxHitContainerName[1]);
114 declareProperty(
"HecHitContainerName", m_xxxHitContainerName[2]);
115 declareProperty(
"ForWardHitContainerName", m_xxxHitContainerName[3]);
117 declareProperty(
"EmTTL1ContainerName", m_EmTTL1ContainerName);
118 declareProperty(
"HadTTL1ContainerName", m_HadTTL1ContainerName);
120 declareProperty(
"NoiseOnOff", m_NoiseOnOff);
122 declareProperty(
"PileUp", m_PileUp);
123 declareProperty(
"UseTriggerTime", m_useTriggerTime);
124 declareProperty(
"TriggerTimeToolName", m_triggerTimeTool);
126 declareProperty(
"EmBarrelCalibrationCoeffs", m_calibCoeffEmb);
127 declareProperty(
"EmEndCapCalibrationCoeffs", m_calibCoeffEmec);
128 declareProperty(
"HECCalibrationCoeffs", m_calibCoeffHec);
129 declareProperty(
"EmFcalCalibrationCoeffs", m_calibCoeffFcalEm);
130 declareProperty(
"HadFcalCalibrationCoeffs", m_calibCoeffFcalHad);
132 declareProperty(
"NoEmCalibrationMode", m_noEmCalibMode);
133 declareProperty(
"NoHadCalibrationMode", m_noHadCalibMode);
134 declareProperty(
"ChronoTest", m_chronoTest);
135 declareProperty(
"DebugThreshold", m_debugThresh);
137 declareProperty(
"TruthHitsContainer", m_truthHitsContainer =
"",
138 "Specify a value to get a pair of LArTTL1 containers with "
139 "the truth hits in them");
140 declareProperty(
"LArfSamplKey", m_fSamplKey);
160 ATH_MSG_INFO(
"***********************************************");
161 ATH_MSG_INFO(
"* Steering options for LArTTL1Maker algorithm *");
162 ATH_MSG_INFO(
"***********************************************");
168 "Electronic noise will be added in each TT for selected "
199 "NO calibration mode chosen for EM towers "
200 <<
" == technical option. Should not be used for physics !!! ");
207 "NO calibration mode chosen for HEC towers "
208 <<
" == technical option. Should not be used for physics !!! ");
210 ATH_MSG_DEBUG(
"standard calibration mode chosen for HEC towers ");
218 " In case of pileup, the trigger time subtraction is done in "
220 ATH_MSG_INFO(
" => LArTTL1Maker will not apply Trigger Time ");
242 return StatusCode::FAILURE;
249 ATH_MSG_DEBUG(
"Successfully retrieved LArEM helper from DetectorStore");
254 ATH_MSG_DEBUG(
"Successfully retrieved LArHEC helper from DetectorStore");
258 ATH_MSG_DEBUG(
"Successfully retrieved LArFCAL helper from DetectorStore");
263 SmartIF<IIncidentSvc> incSvc{service(
"IncidentSvc")};
283 return StatusCode::SUCCESS;
317 CLHEP::HepRandomEngine* rndmEngine = *rngWrapper;
350 ATH_CHECK(ttL1ContainerEm.
record(std::make_unique<LArTTL1Container>()));
353 ATH_CHECK(ttL1ContainerHad.
record(std::make_unique<LArTTL1Container>()));
355 std::unique_ptr<LArTTL1Container> truth_ttL1ContainerEm;
356 std::unique_ptr<LArTTL1Container> truth_ttL1ContainerHad;
358 truth_ttL1ContainerEm = std::make_unique<LArTTL1Container>();
359 truth_ttL1ContainerHad = std::make_unique<LArTTL1Container>();
366 std::vector<std::vector<float> >
368 std::vector<std::vector<float> >
370 sumEnergy.resize(nbTT);
371 sumEnergy2.resize(nbTT);
372 std::vector<float> ttSumE;
373 int ttSumEvecSize = 0;
376 ttSumEvecSize = 2 * crossingTime - 1;
377 refTime = crossingTime - 1;
383 << ttSumEvecSize <<
" reference time= " << refTime);
384 ttSumE.resize(ttSumEvecSize);
385 for (
unsigned int iTT = 0; iTT < nbTT; iTT++) {
386 sumEnergy[iTT] = ttSumE;
387 sumEnergy2[iTT] = ttSumE;
390 m_chronSvc->chronoStart(
"LArTTL1Mk hit loop ");
401 float outOfTimeE = 0.;
405 float printEthresh = 20.;
406 int nMissingGain = 0;
407 for (;
it != it_end; ++
it) {
409 const std::vector<std::pair<float, float> >& timeE = hitlist.
getData();
410 if (!timeE.empty()) {
413 bool skipCell =
false;
418 if (!
m_ttSvc->is_in_lvl1(cellId))
435 const float cellSampFraction = fSampl->
FSAMPL(cellId);
436 const float inv_cellSampFraction = 1. / cellSampFraction;
450 std::vector<float> vecRG;
481 if (relGain < 0.001) {
485 << fcalHash <<
"), setting default value 1. ");
503 for (
const auto&
first : timeE) {
504 float hitEnergy =
first.first;
507 if (hitEnergy > printEthresh) {
511 <<
" energy= " << hitEnergy);
519 if (fabs(hitEnergy) > 1
e+9) {
522 <<
" energy= " << hitEnergy);
533 iShift =
static_cast<int>(floor(
hitTime + 0.5));
537 iShift =
static_cast<int>(floor(
hitTime * crossingRate + 0.5));
542 int iTime = iShift + refTime;
546 if (iTime >= 0 && iTime < ttSumEvecSize) {
551 ttSumE = sumEnergy[ttHash];
553 hitEnergy * inv_cellSampFraction * sinTheta * relGain;
554 sumEnergy[ttHash] = ttSumE;
558 ttSumE = sumEnergy2[ttHash];
560 hitEnergy * inv_cellSampFraction * sinTheta * relGain;
561 sumEnergy2[ttHash] = ttSumE;
567 inTimeE += hitEnergy;
571 outOfTimeE += hitEnergy;
573 if (hitEnergy > printEthresh) {
575 ATH_MSG_DEBUG(
"Found a hit out of the timing window, hitTime= "
576 <<
hitTime <<
" with more than " << printEthresh
577 <<
" MeV: hitEnergy= " << hitEnergy <<
" MeV");
580 "Found a hit out of the timing window, hitTime= "
581 <<
hitTime <<
" with more than " << printEthresh
582 <<
" MeV: hitEnergy= " << hitEnergy <<
" MeV");
592 ATH_MSG_DEBUG(
"Number of missing relative FCAL gains for this event = "
594 if (inTimeE == 0 || nInTime == 0)
598 << outOfTimeE <<
" MeV"
599 <<
" represents " << 100. * outOfTimeE / inTimeE
600 <<
" % of in time energy for " << nOutOfTime <<
" ("
601 << 100. * nOutOfTime / nInTime <<
" %) hits");
602 if (outOfTimeE > 0.02 * inTimeE) {
604 << outOfTimeE <<
" MeV"
605 <<
" larger than 2% of in time energy = " << inTimeE
606 <<
" MeV; nb of out of time hits = " << nInTime <<
" ("
607 << (nInTime > 0 ? 100. * nOutOfTime / nInTime : 0)
612 m_chronSvc->chronoStop(
"LArTTL1Mk hit loop ");
613 m_chronSvc->chronoPrint(
"LArTTL1Mk hit loop ");
614 m_chronSvc->chronoStart(
"LArTTL1Mk TT loop ");
617 std::vector<std::string> emHadString(2);
618 emHadString[0] =
"ElectroMagnetic";
619 emHadString[1] =
"Hadronic";
629 for (; itTt != itEnd; ++itTt) {
653 std::vector<float> sumTTE = sumEnergy[ttHash];
654 std::vector<float> sumTTE2 = sumEnergy2[ttHash];
655 int nSpecialCase = 0;
658 for (
unsigned int i = 0;
i < sumTTE.size(); ++
i) {
659 if (fabs(sumTTE[
i]) > 0.) {
666 for (
unsigned int i = 0;
i < sumTTE2.size(); ++
i) {
667 if (fabs(sumTTE2[
i]) > 0.) {
678 analogSum =
computeSignal(towerId, Ieta, 0, sumTTE, refTime);
687 if (nSpecialCase > 1) {
689 " more than 1 special case, current Trigger Tower is "
690 << emHadString[emHad] <<
": "
693 analogSum2 =
computeSignal(towerId, Ieta, 1, sumTTE2, refTime);
694 for (
int isamp = 0; isamp <
s_NBSAMPLES; isamp++) {
695 analogSum[isamp] += analogSum2[isamp];
701 << emHadString[emHad] <<
": "
704 " transverse E (i.e. sum E / sampling fraction * sin_theta * rel "
705 "gain)= (at ref. time, before calib)"
706 << sumTTE[refTime] <<
" + " << sumTTE2[refTime]
707 <<
" (special cases) ");
708 }
else if (sumTTE[refTime] > 0.) {
710 << emHadString[emHad] <<
": "
713 " [very low] transverse E (i.e. sum E / sampling fraction * "
714 "sin_theta * rel gain)= (at ref. time, before calib)"
715 << sumTTE[refTime] <<
" + " << sumTTE2[refTime]
716 <<
" (special cases) ");
732 fullSignal =
computeNoise(towerId, Ieta, analogSum, rndmEngine);
734 fullSignal = analogSum;
743 ATH_MSG_DEBUG(
" uncalibrated amplitudes around peak (+-3 time slots): "
744 << sumTTE[refTime - 3] <<
", " << sumTTE[refTime - 2]
745 <<
", " << sumTTE[refTime - 1] <<
", " << sumTTE[refTime]
746 <<
", " << sumTTE[refTime + 1] <<
", "
747 << sumTTE[refTime + 2] <<
", " << sumTTE[refTime + 3]);
749 << analogSum[0] <<
", " << analogSum[1] <<
", "
750 << analogSum[2] <<
", " << analogSum[3] <<
", "
751 << analogSum[4] <<
", " << analogSum[5] <<
", "
754 << analogSum[0] / analogSum[3] <<
", "
755 << analogSum[1] / analogSum[3] <<
", "
756 << analogSum[2] / analogSum[3] <<
", "
757 << analogSum[3] / analogSum[3] <<
", "
758 << analogSum[4] / analogSum[3] <<
", "
759 << analogSum[5] / analogSum[3] <<
", "
760 << analogSum[6] / analogSum[3]);
762 << fullSignal[0] <<
", " << fullSignal[1] <<
", "
763 << fullSignal[2] <<
", " << fullSignal[3] <<
", "
764 << fullSignal[4] <<
", " << fullSignal[5] <<
", "
767 for (
unsigned int iTime = 0; iTime < sumTTE.size(); iTime++) {
769 << iTime <<
" hit energy = " << sumTTE[iTime]);
772 }
else if (sumTTE[refTime] > 0.) {
774 " uncalibrated amplitudes around peak (+-3 time slots): "
775 << sumTTE[refTime - 3] <<
", " << sumTTE[refTime - 2] <<
", "
776 << sumTTE[refTime - 1] <<
", " << sumTTE[refTime] <<
", "
777 << sumTTE[refTime + 1] <<
", " << sumTTE[refTime + 2] <<
", "
778 << sumTTE[refTime + 3]);
780 << analogSum[0] <<
", " << analogSum[1] <<
", "
781 << analogSum[2] <<
", " << analogSum[3] <<
", "
782 << analogSum[4] <<
", " << analogSum[5] <<
", "
785 << analogSum[0] / analogSum[3] <<
", "
786 << analogSum[1] / analogSum[3] <<
", "
787 << analogSum[2] / analogSum[3] <<
", "
788 << analogSum[3] / analogSum[3] <<
", "
789 << analogSum[4] / analogSum[3] <<
", "
790 << analogSum[5] / analogSum[3] <<
", "
791 << analogSum[6] / analogSum[3]);
793 << fullSignal[0] <<
", " << fullSignal[1] <<
", "
794 << fullSignal[2] <<
", " << fullSignal[3] <<
", "
795 << fullSignal[4] <<
", " << fullSignal[5] <<
", "
806 ttL1 =
new LArTTL1(ttChannel, towerId, fullSignal);
814 std::vector<float>
et(3);
815 et[0] = sumTTE[refTime - 1];
816 et[1] = sumTTE[refTime];
817 et[2] = sumTTE[refTime + 1];
820 truth_ttL1ContainerHad->
push_back(truth_ttL1);
822 truth_ttL1ContainerEm->
push_back(truth_ttL1);
831 m_chronSvc->chronoPrint(
"LArTTL1Mk TT loop ");
835 << ttL1ContainerEm->
size() <<
" , "
836 << ttL1ContainerHad->
size());
838 return StatusCode::SUCCESS;
852 ATH_MSG_INFO(
" LArTTL1Maker finalize completed successfully");
854 m_chronSvc->chronoPrint(
"LArTTL1Mk hit loop ");
855 m_chronSvc->chronoPrint(
"LArTTL1Mk TT loop ");
857 return StatusCode::SUCCESS;
862 const int specialCase,
863 std::vector<float> ttSumEnergy,
864 const int refTime)
const
883 int visEvecSize = std::ssize(ttSumEnergy);
889 if (emb || barrelEnd || emec) {
893 float calibCoeff = 0.;
905 if (calibCoeff < 0.001) {
908 <<
" setting default value 6. ");
915 for (
int iTime = 0; iTime < visEvecSize; iTime++) {
916 if (fabs(ttSumEnergy[iTime]) > 0.) {
919 ttSumEnergy[iTime] *= calibCoeff;
921 " ComputeSignal: applied EM calibration coefficient (iTime) "
922 << calibCoeff <<
" (" << iTime <<
") ");
947 for (
int iSamp = 0; iSamp <
s_NBSAMPLES; iSamp++) {
954 static_cast<int>(floor(
hitTime * crossingRate + 0.5));
957 int j = iSamp -
time;
960 (pulseShape[j] - pulseShapeDer[j] * dTime) *
theEnergy;
963 int j = iSamp - iTime + refTime;
965 bareSignal[iSamp] += pulseShape[j] *
theEnergy;
985 for (
int iTime = 0; iTime < visEvecSize; iTime++) {
993 for (
int iSamp = 0; iSamp <
s_NBSAMPLES; iSamp++) {
999 int time =
static_cast<int>(floor(
hitTime * crossingRate + 0.5));
1002 int j = iSamp -
time;
1004 bareSignal[iSamp] +=
1005 (pulseShape[j] - pulseShapeDer[j] * dTime) *
theEnergy;
1008 int j = iSamp - iTime + refTime;
1010 bareSignal[iSamp] += pulseShape[j] *
theEnergy;
1014 if (bareSignal[iSamp] > satEt) {
1015 bareSignal[iSamp] = satEt;
1026 int module = emOrHad + 1;
1028 if (emOrHad && (Ieta == 3 || Ieta == 4)) {
1037 for (
int iTime = 0; iTime < visEvecSize; iTime++) {
1046 for (
int iSamp = 0; iSamp <
s_NBSAMPLES; iSamp++) {
1049 int hitTime = iTime - refTime;
1052 int time =
static_cast<int>(floor(
hitTime * crossingRate + 0.5));
1055 int j = iSamp -
time;
1057 bareSignal[iSamp] +=
1058 (pulseShape[j] - pulseShapeDer[j] * dTime) *
theEnergy;
1061 int j = iSamp - iTime + refTime;
1063 bareSignal[iSamp] += pulseShape[j] *
theEnergy;
1078 const Identifier towerId,
const int Ieta, std::vector<float>& inputV,
1079 CLHEP::HepRandomEngine* rndmEngine) {
1094 float sigmaNoise = 0;
1095 std::vector<float>* autoC =
nullptr;
1096 std::vector<float> noiseRms(4);
1104 if (emb || barrelEnd || emec) {
1133 int module = emOrHad + 1;
1134 if (emOrHad && (Ieta == 3 || Ieta == 4)) {
1140 sigmaNoise = noiseRms[Ieta - 1];
1142 << sigmaNoise <<
" module= " <<
module <<
"Ieta= " << Ieta);
1149 if (fabs((*autoC)[0]) < 0.001) {
1152 <<
"setting default values 1.00 0.10 -0.30 -0.20 "
1153 "-0.05 -0.01 -0.01 ");
1156 (*autoC)[2] = -0.30;
1157 (*autoC)[3] = -0.20;
1158 (*autoC)[4] = -0.05;
1159 (*autoC)[5] = -0.01;
1160 (*autoC)[6] = -0.01;
1162 if (sigmaNoise < 0.001) {
1165 <<
"setting default value 300 MeV ");
1173 const float c11 = sigmaNoise * (*autoC)[0];
1174 const float c21 = sigmaNoise * (*autoC)[1];
1175 const float c31 = sigmaNoise * (*autoC)[2];
1176 const float c41 = sigmaNoise * (*autoC)[3];
1177 const float c51 = sigmaNoise * (*autoC)[4];
1178 const float c61 = sigmaNoise * (*autoC)[5];
1179 const float c71 = sigmaNoise * (*autoC)[6];
1181 const float c22 = sqrt(c11 * c11 - c21 * c21);
1182 const float inv_c22 = 1. / c22;
1183 const float c32 = (c21 * c11 - c21 * c31) * inv_c22;
1184 const float c33 = sqrt(c11 * c11 - c31 * c31 - c32 * c32);
1185 const float inv_c33 = 1. / c33;
1186 const float c42 = (c31 * c11 - c21 * c41) * inv_c22;
1187 const float c43 = (c21 * c11 - c31 * c41 - c32 * c42) * inv_c33;
1188 const float c44 = sqrt(c11 * c11 - c41 * c41 - c42 * c42 - c43 * c43);
1189 const float inv_c44 = 1. / c44;
1190 const float c52 = (c41 * c11 - c21 * c51) * inv_c22;
1191 const float c53 = (c31 * c11 - c31 * c51 - c32 * c52) * inv_c33;
1192 const float c54 = (c21 * c11 - c41 * c51 - c42 * c52 - c43 * c53) * inv_c44;
1194 sqrt(c11 * c11 - c51 * c51 - c52 * c52 - c53 * c53 - c54 * c54);
1195 const float inv_c55 = 1. / c55;
1196 const float c62 = (c51 * c11 - c21 * c61) * inv_c22;
1197 const float c63 = (c41 * c11 - c31 * c61 - c32 * c62) * inv_c33;
1198 const float c64 = (c31 * c11 - c41 * c61 - c42 * c62 - c43 * c63) * inv_c44;
1200 (c21 * c11 - c51 * c61 - c52 * c62 - c53 * c63 - c54 * c64) * inv_c55;
1201 const float c66 = sqrt(c11 * c11 - c61 * c61 - c62 * c62 - c63 * c63 -
1202 c64 * c64 - c65 * c65);
1203 const float c72 = (c61 * c11 - c21 * c71) * inv_c22;
1204 const float c73 = (c51 * c11 - c31 * c71 - c32 * c72) * inv_c33;
1205 const float c74 = (c41 * c11 - c41 * c71 - c42 * c72 - c43 * c73) * inv_c44;
1207 (c31 * c11 - c51 * c71 - c52 * c72 - c53 * c73 - c54 * c74) * inv_c55;
1209 (c21 * c11 - c61 * c71 - c62 * c72 - c63 * c73 - c64 * c74 - c65 * c75) /
1211 const float c77 = sqrt(c11 * c11 - c71 * c71 - c72 * c72 - c73 * c73 -
1212 c74 * c74 - c75 * c75 - c76 * c76);
1215 RandGaussZiggurat::shootArray(rndmEngine,
static_cast<int>(
s_NBSAMPLES), rndm,
1217 outputV[0] = inputV[0] + c11 * rndm[0];
1218 outputV[1] = inputV[1] + c21 * rndm[0] + c22 * rndm[1];
1219 outputV[2] = inputV[2] + c31 * rndm[0] + c32 * rndm[1] + c33 * rndm[2];
1221 inputV[3] + c41 * rndm[0] + c42 * rndm[1] + c43 * rndm[2] + c44 * rndm[3];
1222 outputV[4] = inputV[4] + c51 * rndm[0] + c52 * rndm[1] + c53 * rndm[2] +
1223 c54 * rndm[3] + c55 * rndm[4];
1224 outputV[5] = inputV[5] + c61 * rndm[0] + c62 * rndm[1] + c63 * rndm[2] +
1225 c64 * rndm[3] + c65 * rndm[4] + c66 * rndm[5];
1226 outputV[6] = inputV[6] + c71 * rndm[0] + c72 * rndm[1] + c73 * rndm[2] +
1227 c74 * rndm[3] + c75 * rndm[4] + c76 * rndm[5] + c77 * rndm[6];
1242 std::string barrel_endcap;
1244 float sinTheta = 0.;
1246 std::vector<float> noiseRms(3);
1247 std::vector<float> noiseRms4(4);
1250 std::string pulsedataname =
1252 if (pulsedataname.empty()) {
1254 return StatusCode::FAILURE;
1256 const char* pulsedatafile = pulsedataname.c_str();
1257 std::ifstream
infile(pulsedatafile);
1261 return StatusCode::FAILURE;
1269 infile >> refEnergy >> pulseShape[0] >> pulseShape[1] >> pulseShape[2] >>
1270 pulseShape[3] >> pulseShape[4] >> pulseShape[5] >> pulseShape[6] >>
1271 pulseShape[7] >> pulseShape[8] >> pulseShape[9] >> pulseShape[10] >>
1272 pulseShape[11] >> pulseShape[12] >> pulseShape[13] >> pulseShape[14] >>
1273 pulseShape[15] >> pulseShape[16] >> pulseShape[17] >> pulseShape[18] >>
1274 pulseShape[19] >> pulseShape[20] >> pulseShape[21] >> pulseShape[22] >>
1278 infile >> pulseShapeDer[0] >> pulseShapeDer[1] >> pulseShapeDer[2] >>
1279 pulseShapeDer[3] >> pulseShapeDer[4] >> pulseShapeDer[5] >>
1280 pulseShapeDer[6] >> pulseShapeDer[7] >> pulseShapeDer[8] >>
1281 pulseShapeDer[9] >> pulseShapeDer[10] >> pulseShapeDer[11] >>
1282 pulseShapeDer[12] >> pulseShapeDer[13] >> pulseShapeDer[14] >>
1283 pulseShapeDer[15] >> pulseShapeDer[16] >> pulseShapeDer[17] >>
1284 pulseShapeDer[18] >> pulseShapeDer[19] >> pulseShapeDer[20] >>
1285 pulseShapeDer[21] >> pulseShapeDer[22] >> pulseShapeDer[23];
1301 infile >> Ieta >> sinTheta;
1303 infile >> noiseRms[0] >> noiseRms[1] >> noiseRms[2];
1316 infile >> Ieta >> sinTheta;
1318 infile >> noiseRms[0] >> noiseRms[1] >> noiseRms[2];
1328 ATH_MSG_INFO(
" 1 pulse shape per energy for EMB+EMEC : ");
1357 " Finished reading 1 calib coeff + 1 noise value per eta bin for EM: ");
1364 ATH_MSG_INFO(
"Ieta= " << ieta + 1 <<
", noise rms EMB: "
1375 if (pulsedataname.empty()) {
1377 return StatusCode::FAILURE;
1379 pulsedatafile = pulsedataname.c_str();
1380 infile.open(pulsedatafile);
1384 return StatusCode::FAILURE;
1428 infile >> autoCorr[0] >> autoCorr[1] >> autoCorr[2] >> autoCorr[3] >>
1429 autoCorr[4] >> autoCorr[5] >> autoCorr[6];
1449 "Finished reading calib coeff, noise rms, sat ene, auto corr for each "
1450 "eta bin for HEC: ");
1456 ATH_MSG_INFO(
" Ieta= " << ieta + 1 <<
", noise rms HEC: "
1475 if (pulsedataname.empty()) {
1477 return StatusCode::FAILURE;
1479 pulsedatafile = pulsedataname.c_str();
1480 infile.open(pulsedatafile);
1484 return StatusCode::FAILURE;
1493 for (
int iMod = 0; iMod <
nMod; iMod++) {
1497 infile >> imod >> noiseRms4[0] >> noiseRms4[1] >> noiseRms4[2] >>
1502 infile >> pulseShape[0] >> pulseShape[1] >> pulseShape[2] >>
1503 pulseShape[3] >> pulseShape[4] >> pulseShape[5] >> pulseShape[6] >>
1504 pulseShape[7] >> pulseShape[8] >> pulseShape[9] >> pulseShape[10] >>
1505 pulseShape[11] >> pulseShape[12] >> pulseShape[13] >> pulseShape[14] >>
1506 pulseShape[15] >> pulseShape[16] >> pulseShape[17] >> pulseShape[18] >>
1507 pulseShape[19] >> pulseShape[20] >> pulseShape[21] >> pulseShape[22] >>
1512 infile >> pulseShapeDer[0] >> pulseShapeDer[1] >> pulseShapeDer[2] >>
1513 pulseShapeDer[3] >> pulseShapeDer[4] >> pulseShapeDer[5] >>
1514 pulseShapeDer[6] >> pulseShapeDer[7] >> pulseShapeDer[8] >>
1515 pulseShapeDer[9] >> pulseShapeDer[10] >> pulseShapeDer[11] >>
1516 pulseShapeDer[12] >> pulseShapeDer[13] >> pulseShapeDer[14] >>
1517 pulseShapeDer[15] >> pulseShapeDer[16] >> pulseShapeDer[17] >>
1518 pulseShapeDer[18] >> pulseShapeDer[19] >> pulseShapeDer[20] >>
1519 pulseShapeDer[21] >> pulseShapeDer[22] >> pulseShapeDer[23];
1532 std::vector<float> auxV(3);
1537 "Finished reading noise, calib coeff and pulse shape for each module for "
1539 for (
int iMod = 0; iMod <
nMod; iMod++) {
1541 ATH_MSG_INFO(
" iMod= " << iMod <<
", noise rms FCAL (eta bin 1,2,3,4): "
1544 ATH_MSG_INFO(
" iMod= " << iMod <<
", calib coeff FCAL (eta bin 1,2,3,4): "
1579 if (pulsedataname.empty()) {
1580 ATH_MSG_ERROR(
"Could not locate Fcal_ptweights_table7.data file");
1581 return StatusCode::FAILURE;
1583 pulsedatafile = pulsedataname.c_str();
1584 infile.open(pulsedatafile);
1588 return StatusCode::FAILURE;
1597 const unsigned int colNum = 14;
1599 const unsigned int maxCell = 4;
1600 std::vector<std::string> TTlabel;
1601 TTlabel.resize(colNum);
1602 std::vector<float>
gain;
1603 gain.resize(colNum);
1607 while (
infile >> TTlabel[0] >>
gain[0] >> TTlabel[1] >>
gain[1] >>
1608 TTlabel[2] >>
gain[2] >> TTlabel[3] >>
gain[3] >> TTlabel[4] >>
1609 gain[4] >> TTlabel[5] >>
gain[5] >> TTlabel[6] >>
gain[6] >>
1610 TTlabel[7] >>
gain[7] >> TTlabel[8] >>
gain[8] >> TTlabel[9] >>
1611 gain[9] >> TTlabel[10] >>
gain[10] >> TTlabel[11] >>
gain[11] >>
1612 TTlabel[12] >>
gain[12] >> TTlabel[13] >>
gain[13]) {
1616 ATH_MSG_DEBUG(
" TTlabel[13], gain[13]= " << TTlabel[13] <<
", "
1638 std::string TTlab = TTlabel[
icol];
1641 int eta =
int(TTlab[0]) - 49;
1642 int phi =
int(TTlab[1]) - 65;
1649 if (TTlab.size() > 3) {
1659 if ((
layer == 1 && detZside > 0) || (
layer == 0 && detZside < 0)) {
1660 if (
eta == 0 ||
eta == 2) {
1672 if (
eta == 1 ||
eta == 3) {
1693 std::vector<Identifier> cellIdVec =
m_ttSvc->createCellIDvecLayer(ttId);
1698 std::vector<unsigned int> hashVec;
1700 unsigned int nCell = 0;
1716 hashVec.push_back(fcalHash);
1726 for (
unsigned int iCell = 0; iCell <
maxCell; iCell++) {
1745 return StatusCode::SUCCESS;
1764 }
else if (region == 1 || region == 2) {
1770 }
else if (region == 3) {