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"},
75 m_useTriggerTime =
false;
79 m_BeginRunPriority = 100;
81 m_lvl1Helper =
nullptr;
83 m_hecHelper =
nullptr;
84 m_fcalHelper =
nullptr;
88 m_noEmCalibMode =
false;
89 m_noHadCalibMode =
false;
91 m_debugThresh = 5000.;
93 m_calibCoeffEmb.resize(s_NBETABINS);
94 m_calibCoeffEmec.resize(s_NBETABINS);
95 m_calibCoeffHec.resize(s_NBETABINS);
96 for (
int ieta = 0; ieta < s_NBETABINS; ieta++) {
97 m_calibCoeffEmb[ieta] = 1.;
98 m_calibCoeffEmec[ieta] = 1.;
99 m_calibCoeffHec[ieta] = 1.;
102 m_calibCoeffFcalEm.resize(
nEta);
103 m_calibCoeffFcalHad.resize(
nEta);
104 for (
int ieta = 0; ieta <
nEta; ieta++) {
105 m_calibCoeffFcalEm[ieta] = .03;
106 m_calibCoeffFcalHad[ieta] = .03;
113 declareProperty(
"EmBarrelHitContainerName", m_xxxHitContainerName[0]);
114 declareProperty(
"EmEndCapHitContainerName", m_xxxHitContainerName[1]);
115 declareProperty(
"HecHitContainerName", m_xxxHitContainerName[2]);
116 declareProperty(
"ForWardHitContainerName", m_xxxHitContainerName[3]);
118 declareProperty(
"EmTTL1ContainerName", m_EmTTL1ContainerName);
119 declareProperty(
"HadTTL1ContainerName", m_HadTTL1ContainerName);
121 declareProperty(
"NoiseOnOff", m_NoiseOnOff);
123 declareProperty(
"PileUp", m_PileUp);
124 declareProperty(
"UseTriggerTime", m_useTriggerTime);
125 declareProperty(
"TriggerTimeToolName", m_triggerTimeTool);
127 declareProperty(
"EmBarrelCalibrationCoeffs", m_calibCoeffEmb);
128 declareProperty(
"EmEndCapCalibrationCoeffs", m_calibCoeffEmec);
129 declareProperty(
"HECCalibrationCoeffs", m_calibCoeffHec);
130 declareProperty(
"EmFcalCalibrationCoeffs", m_calibCoeffFcalEm);
131 declareProperty(
"HadFcalCalibrationCoeffs", m_calibCoeffFcalHad);
133 declareProperty(
"NoEmCalibrationMode", m_noEmCalibMode);
134 declareProperty(
"NoHadCalibrationMode", m_noHadCalibMode);
135 declareProperty(
"ChronoTest", m_chronoTest);
136 declareProperty(
"DebugThreshold", m_debugThresh);
138 declareProperty(
"TruthHitsContainer", m_truthHitsContainer =
"",
139 "Specify a value to get a pair of LArTTL1 containers with "
140 "the truth hits in them");
141 declareProperty(
"LArfSamplKey", m_fSamplKey);
161 ATH_MSG_INFO(
"***********************************************");
162 ATH_MSG_INFO(
"* Steering options for LArTTL1Maker algorithm *");
163 ATH_MSG_INFO(
"***********************************************");
169 "Electronic noise will be added in each TT for selected "
200 "NO calibration mode chosen for EM towers "
201 <<
" == technical option. Should not be used for physics !!! ");
208 "NO calibration mode chosen for HEC towers "
209 <<
" == technical option. Should not be used for physics !!! ");
211 ATH_MSG_DEBUG(
"standard calibration mode chosen for HEC towers ");
219 " In case of pileup, the trigger time subtraction is done in "
221 ATH_MSG_INFO(
" => LArTTL1Maker will not apply Trigger Time ");
243 return StatusCode::FAILURE;
250 ATH_MSG_DEBUG(
"Successfully retrieved LArEM helper from DetectorStore");
255 ATH_MSG_DEBUG(
"Successfully retrieved LArHEC helper from DetectorStore");
259 ATH_MSG_DEBUG(
"Successfully retrieved LArFCAL helper from DetectorStore");
264 SmartIF<IIncidentSvc> incSvc{service(
"IncidentSvc")};
284 return StatusCode::SUCCESS;
318 CLHEP::HepRandomEngine* rndmEngine = *rngWrapper;
351 ATH_CHECK(ttL1ContainerEm.
record(std::make_unique<LArTTL1Container>()));
354 ATH_CHECK(ttL1ContainerHad.
record(std::make_unique<LArTTL1Container>()));
356 std::unique_ptr<LArTTL1Container> truth_ttL1ContainerEm;
357 std::unique_ptr<LArTTL1Container> truth_ttL1ContainerHad;
359 truth_ttL1ContainerEm = std::make_unique<LArTTL1Container>();
360 truth_ttL1ContainerHad = std::make_unique<LArTTL1Container>();
367 std::vector<std::vector<float> >
369 std::vector<std::vector<float> >
371 sumEnergy.resize(nbTT);
372 sumEnergy2.resize(nbTT);
373 std::vector<float> ttSumE;
374 int ttSumEvecSize = 0;
377 ttSumEvecSize = 2 * crossingTime - 1;
378 refTime = crossingTime - 1;
384 << ttSumEvecSize <<
" reference time= " << refTime);
385 ttSumE.resize(ttSumEvecSize);
386 for (
unsigned int iTT = 0; iTT < nbTT; iTT++) {
387 sumEnergy[iTT] = ttSumE;
388 sumEnergy2[iTT] = ttSumE;
391 m_chronSvc->chronoStart(
"LArTTL1Mk hit loop ");
402 float outOfTimeE = 0.;
406 float printEthresh = 20.;
407 int nMissingGain = 0;
408 for (;
it != it_end; ++
it) {
410 const std::vector<std::pair<float, float> >& timeE = hitlist.
getData();
411 if (!timeE.empty()) {
414 bool skipCell =
false;
419 if (!
m_ttSvc->is_in_lvl1(cellId))
436 const float cellSampFraction = fSampl->
FSAMPL(cellId);
437 const float inv_cellSampFraction = 1. / cellSampFraction;
451 std::vector<float> vecRG;
482 if (relGain < 0.001) {
486 << fcalHash <<
"), setting default value 1. ");
504 for (
const auto&
first : timeE) {
505 float hitEnergy =
first.first;
508 if (hitEnergy > printEthresh) {
512 <<
" energy= " << hitEnergy);
520 if (fabs(hitEnergy) > 1
e+9) {
523 <<
" energy= " << hitEnergy);
534 iShift =
static_cast<int>(floor(
hitTime + 0.5));
538 iShift =
static_cast<int>(floor(
hitTime * crossingRate + 0.5));
543 int iTime = iShift + refTime;
547 if (iTime >= 0 && iTime < ttSumEvecSize) {
552 ttSumE = sumEnergy[ttHash];
554 hitEnergy * inv_cellSampFraction * sinTheta * relGain;
555 sumEnergy[ttHash] = ttSumE;
559 ttSumE = sumEnergy2[ttHash];
561 hitEnergy * inv_cellSampFraction * sinTheta * relGain;
562 sumEnergy2[ttHash] = ttSumE;
568 inTimeE += hitEnergy;
572 outOfTimeE += hitEnergy;
574 if (hitEnergy > printEthresh) {
576 ATH_MSG_DEBUG(
"Found a hit out of the timing window, hitTime= "
577 <<
hitTime <<
" with more than " << printEthresh
578 <<
" MeV: hitEnergy= " << hitEnergy <<
" MeV");
581 "Found a hit out of the timing window, hitTime= "
582 <<
hitTime <<
" with more than " << printEthresh
583 <<
" MeV: hitEnergy= " << hitEnergy <<
" MeV");
593 ATH_MSG_DEBUG(
"Number of missing relative FCAL gains for this event = "
595 if (inTimeE == 0 || nInTime == 0)
599 << outOfTimeE <<
" MeV"
600 <<
" represents " << 100. * outOfTimeE / inTimeE
601 <<
" % of in time energy for " << nOutOfTime <<
" ("
602 << 100. * nOutOfTime / nInTime <<
" %) hits");
603 if (outOfTimeE > 0.02 * inTimeE) {
605 << outOfTimeE <<
" MeV"
606 <<
" larger than 2% of in time energy = " << inTimeE
607 <<
" MeV; nb of out of time hits = " << nInTime <<
" ("
608 << (nInTime > 0 ? 100. * nOutOfTime / nInTime : 0)
613 m_chronSvc->chronoStop(
"LArTTL1Mk hit loop ");
614 m_chronSvc->chronoPrint(
"LArTTL1Mk hit loop ");
615 m_chronSvc->chronoStart(
"LArTTL1Mk TT loop ");
618 std::vector<std::string> emHadString(2);
619 emHadString[0] =
"ElectroMagnetic";
620 emHadString[1] =
"Hadronic";
630 for (; itTt != itEnd; ++itTt) {
654 std::vector<float> sumTTE = sumEnergy[ttHash];
655 std::vector<float> sumTTE2 = sumEnergy2[ttHash];
656 int nSpecialCase = 0;
659 for (
unsigned int i = 0;
i < sumTTE.size(); ++
i) {
660 if (fabs(sumTTE[
i]) > 0.) {
667 for (
unsigned int i = 0;
i < sumTTE2.size(); ++
i) {
668 if (fabs(sumTTE2[
i]) > 0.) {
679 analogSum =
computeSignal(towerId, Ieta, 0, sumTTE, refTime);
688 if (nSpecialCase > 1) {
690 " more than 1 special case, current Trigger Tower is "
691 << emHadString[emHad] <<
": "
694 analogSum2 =
computeSignal(towerId, Ieta, 1, sumTTE2, refTime);
695 for (
int isamp = 0; isamp <
s_NBSAMPLES; isamp++) {
696 analogSum[isamp] += analogSum2[isamp];
702 << emHadString[emHad] <<
": "
705 " transverse E (i.e. sum E / sampling fraction * sin_theta * rel "
706 "gain)= (at ref. time, before calib)"
707 << sumTTE[refTime] <<
" + " << sumTTE2[refTime]
708 <<
" (special cases) ");
709 }
else if (sumTTE[refTime] > 0.) {
711 << emHadString[emHad] <<
": "
714 " [very low] transverse E (i.e. sum E / sampling fraction * "
715 "sin_theta * rel gain)= (at ref. time, before calib)"
716 << sumTTE[refTime] <<
" + " << sumTTE2[refTime]
717 <<
" (special cases) ");
733 fullSignal =
computeNoise(towerId, Ieta, analogSum, rndmEngine);
735 fullSignal = analogSum;
744 ATH_MSG_DEBUG(
" uncalibrated amplitudes around peak (+-3 time slots): "
745 << sumTTE[refTime - 3] <<
", " << sumTTE[refTime - 2]
746 <<
", " << sumTTE[refTime - 1] <<
", " << sumTTE[refTime]
747 <<
", " << sumTTE[refTime + 1] <<
", "
748 << sumTTE[refTime + 2] <<
", " << sumTTE[refTime + 3]);
750 << analogSum[0] <<
", " << analogSum[1] <<
", "
751 << analogSum[2] <<
", " << analogSum[3] <<
", "
752 << analogSum[4] <<
", " << analogSum[5] <<
", "
755 << analogSum[0] / analogSum[3] <<
", "
756 << analogSum[1] / analogSum[3] <<
", "
757 << analogSum[2] / analogSum[3] <<
", "
758 << analogSum[3] / analogSum[3] <<
", "
759 << analogSum[4] / analogSum[3] <<
", "
760 << analogSum[5] / analogSum[3] <<
", "
761 << analogSum[6] / analogSum[3]);
763 << fullSignal[0] <<
", " << fullSignal[1] <<
", "
764 << fullSignal[2] <<
", " << fullSignal[3] <<
", "
765 << fullSignal[4] <<
", " << fullSignal[5] <<
", "
768 for (
unsigned int iTime = 0; iTime < sumTTE.size(); iTime++) {
770 << iTime <<
" hit energy = " << sumTTE[iTime]);
773 }
else if (sumTTE[refTime] > 0.) {
775 " uncalibrated amplitudes around peak (+-3 time slots): "
776 << sumTTE[refTime - 3] <<
", " << sumTTE[refTime - 2] <<
", "
777 << sumTTE[refTime - 1] <<
", " << sumTTE[refTime] <<
", "
778 << sumTTE[refTime + 1] <<
", " << sumTTE[refTime + 2] <<
", "
779 << sumTTE[refTime + 3]);
781 << analogSum[0] <<
", " << analogSum[1] <<
", "
782 << analogSum[2] <<
", " << analogSum[3] <<
", "
783 << analogSum[4] <<
", " << analogSum[5] <<
", "
786 << analogSum[0] / analogSum[3] <<
", "
787 << analogSum[1] / analogSum[3] <<
", "
788 << analogSum[2] / analogSum[3] <<
", "
789 << analogSum[3] / analogSum[3] <<
", "
790 << analogSum[4] / analogSum[3] <<
", "
791 << analogSum[5] / analogSum[3] <<
", "
792 << analogSum[6] / analogSum[3]);
794 << fullSignal[0] <<
", " << fullSignal[1] <<
", "
795 << fullSignal[2] <<
", " << fullSignal[3] <<
", "
796 << fullSignal[4] <<
", " << fullSignal[5] <<
", "
807 ttL1 =
new LArTTL1(ttChannel, towerId, fullSignal);
815 std::vector<float>
et(3);
816 et[0] = sumTTE[refTime - 1];
817 et[1] = sumTTE[refTime];
818 et[2] = sumTTE[refTime + 1];
821 truth_ttL1ContainerHad->
push_back(truth_ttL1);
823 truth_ttL1ContainerEm->
push_back(truth_ttL1);
832 m_chronSvc->chronoPrint(
"LArTTL1Mk TT loop ");
836 << ttL1ContainerEm->
size() <<
" , "
837 << ttL1ContainerHad->
size());
839 return StatusCode::SUCCESS;
853 ATH_MSG_INFO(
" LArTTL1Maker finalize completed successfully");
855 m_chronSvc->chronoPrint(
"LArTTL1Mk hit loop ");
856 m_chronSvc->chronoPrint(
"LArTTL1Mk TT loop ");
858 return StatusCode::SUCCESS;
863 const int specialCase,
864 std::vector<float> ttSumEnergy,
865 const int refTime)
const
884 int visEvecSize = std::ssize(ttSumEnergy);
890 if (emb || barrelEnd || emec) {
894 float calibCoeff = 0.;
906 if (calibCoeff < 0.001) {
909 <<
" setting default value 6. ");
916 for (
int iTime = 0; iTime < visEvecSize; iTime++) {
917 if (fabs(ttSumEnergy[iTime]) > 0.) {
920 ttSumEnergy[iTime] *= calibCoeff;
922 " ComputeSignal: applied EM calibration coefficient (iTime) "
923 << calibCoeff <<
" (" << iTime <<
") ");
948 for (
int iSamp = 0; iSamp <
s_NBSAMPLES; iSamp++) {
955 static_cast<int>(floor(
hitTime * crossingRate + 0.5));
958 int j = iSamp -
time;
961 (pulseShape[j] - pulseShapeDer[j] * dTime) *
theEnergy;
964 int j = iSamp - iTime + refTime;
966 bareSignal[iSamp] += pulseShape[j] *
theEnergy;
986 for (
int iTime = 0; iTime < visEvecSize; iTime++) {
994 for (
int iSamp = 0; iSamp <
s_NBSAMPLES; iSamp++) {
1000 int time =
static_cast<int>(floor(
hitTime * crossingRate + 0.5));
1003 int j = iSamp -
time;
1005 bareSignal[iSamp] +=
1006 (pulseShape[j] - pulseShapeDer[j] * dTime) *
theEnergy;
1009 int j = iSamp - iTime + refTime;
1011 bareSignal[iSamp] += pulseShape[j] *
theEnergy;
1015 if (bareSignal[iSamp] > satEt) {
1016 bareSignal[iSamp] = satEt;
1027 int module = emOrHad + 1;
1029 if (emOrHad && (Ieta == 3 || Ieta == 4)) {
1038 for (
int iTime = 0; iTime < visEvecSize; iTime++) {
1047 for (
int iSamp = 0; iSamp <
s_NBSAMPLES; iSamp++) {
1050 int hitTime = iTime - refTime;
1053 int time =
static_cast<int>(floor(
hitTime * crossingRate + 0.5));
1056 int j = iSamp -
time;
1058 bareSignal[iSamp] +=
1059 (pulseShape[j] - pulseShapeDer[j] * dTime) *
theEnergy;
1062 int j = iSamp - iTime + refTime;
1064 bareSignal[iSamp] += pulseShape[j] *
theEnergy;
1079 const Identifier towerId,
const int Ieta, std::vector<float>& inputV,
1080 CLHEP::HepRandomEngine* rndmEngine) {
1095 float sigmaNoise = 0;
1096 std::vector<float>* autoC =
nullptr;
1097 std::vector<float> noiseRms(4);
1105 if (emb || barrelEnd || emec) {
1134 int module = emOrHad + 1;
1135 if (emOrHad && (Ieta == 3 || Ieta == 4)) {
1141 sigmaNoise = noiseRms[Ieta - 1];
1143 << sigmaNoise <<
" module= " <<
module <<
"Ieta= " << Ieta);
1150 if (fabs((*autoC)[0]) < 0.001) {
1153 <<
"setting default values 1.00 0.10 -0.30 -0.20 "
1154 "-0.05 -0.01 -0.01 ");
1157 (*autoC)[2] = -0.30;
1158 (*autoC)[3] = -0.20;
1159 (*autoC)[4] = -0.05;
1160 (*autoC)[5] = -0.01;
1161 (*autoC)[6] = -0.01;
1163 if (sigmaNoise < 0.001) {
1166 <<
"setting default value 300 MeV ");
1174 const float c11 = sigmaNoise * (*autoC)[0];
1175 const float c21 = sigmaNoise * (*autoC)[1];
1176 const float c31 = sigmaNoise * (*autoC)[2];
1177 const float c41 = sigmaNoise * (*autoC)[3];
1178 const float c51 = sigmaNoise * (*autoC)[4];
1179 const float c61 = sigmaNoise * (*autoC)[5];
1180 const float c71 = sigmaNoise * (*autoC)[6];
1182 const float c22 = sqrt(c11 * c11 - c21 * c21);
1183 const float inv_c22 = 1. / c22;
1184 const float c32 = (c21 * c11 - c21 * c31) * inv_c22;
1185 const float c33 = sqrt(c11 * c11 - c31 * c31 - c32 * c32);
1186 const float inv_c33 = 1. / c33;
1187 const float c42 = (c31 * c11 - c21 * c41) * inv_c22;
1188 const float c43 = (c21 * c11 - c31 * c41 - c32 * c42) * inv_c33;
1189 const float c44 = sqrt(c11 * c11 - c41 * c41 - c42 * c42 - c43 * c43);
1190 const float inv_c44 = 1. / c44;
1191 const float c52 = (c41 * c11 - c21 * c51) * inv_c22;
1192 const float c53 = (c31 * c11 - c31 * c51 - c32 * c52) * inv_c33;
1193 const float c54 = (c21 * c11 - c41 * c51 - c42 * c52 - c43 * c53) * inv_c44;
1195 sqrt(c11 * c11 - c51 * c51 - c52 * c52 - c53 * c53 - c54 * c54);
1196 const float inv_c55 = 1. / c55;
1197 const float c62 = (c51 * c11 - c21 * c61) * inv_c22;
1198 const float c63 = (c41 * c11 - c31 * c61 - c32 * c62) * inv_c33;
1199 const float c64 = (c31 * c11 - c41 * c61 - c42 * c62 - c43 * c63) * inv_c44;
1201 (c21 * c11 - c51 * c61 - c52 * c62 - c53 * c63 - c54 * c64) * inv_c55;
1202 const float c66 = sqrt(c11 * c11 - c61 * c61 - c62 * c62 - c63 * c63 -
1203 c64 * c64 - c65 * c65);
1204 const float c72 = (c61 * c11 - c21 * c71) * inv_c22;
1205 const float c73 = (c51 * c11 - c31 * c71 - c32 * c72) * inv_c33;
1206 const float c74 = (c41 * c11 - c41 * c71 - c42 * c72 - c43 * c73) * inv_c44;
1208 (c31 * c11 - c51 * c71 - c52 * c72 - c53 * c73 - c54 * c74) * inv_c55;
1210 (c21 * c11 - c61 * c71 - c62 * c72 - c63 * c73 - c64 * c74 - c65 * c75) /
1212 const float c77 = sqrt(c11 * c11 - c71 * c71 - c72 * c72 - c73 * c73 -
1213 c74 * c74 - c75 * c75 - c76 * c76);
1216 RandGaussZiggurat::shootArray(rndmEngine,
static_cast<int>(
s_NBSAMPLES), rndm,
1218 outputV[0] = inputV[0] + c11 * rndm[0];
1219 outputV[1] = inputV[1] + c21 * rndm[0] + c22 * rndm[1];
1220 outputV[2] = inputV[2] + c31 * rndm[0] + c32 * rndm[1] + c33 * rndm[2];
1222 inputV[3] + c41 * rndm[0] + c42 * rndm[1] + c43 * rndm[2] + c44 * rndm[3];
1223 outputV[4] = inputV[4] + c51 * rndm[0] + c52 * rndm[1] + c53 * rndm[2] +
1224 c54 * rndm[3] + c55 * rndm[4];
1225 outputV[5] = inputV[5] + c61 * rndm[0] + c62 * rndm[1] + c63 * rndm[2] +
1226 c64 * rndm[3] + c65 * rndm[4] + c66 * rndm[5];
1227 outputV[6] = inputV[6] + c71 * rndm[0] + c72 * rndm[1] + c73 * rndm[2] +
1228 c74 * rndm[3] + c75 * rndm[4] + c76 * rndm[5] + c77 * rndm[6];
1243 std::string barrel_endcap;
1245 float sinTheta = 0.;
1247 std::vector<float> noiseRms(3);
1248 std::vector<float> noiseRms4(4);
1251 std::string pulsedataname =
1253 if (pulsedataname.empty()) {
1255 return StatusCode::FAILURE;
1257 const char* pulsedatafile = pulsedataname.c_str();
1258 std::ifstream
infile(pulsedatafile);
1262 return StatusCode::FAILURE;
1270 infile >> refEnergy >> pulseShape[0] >> pulseShape[1] >> pulseShape[2] >>
1271 pulseShape[3] >> pulseShape[4] >> pulseShape[5] >> pulseShape[6] >>
1272 pulseShape[7] >> pulseShape[8] >> pulseShape[9] >> pulseShape[10] >>
1273 pulseShape[11] >> pulseShape[12] >> pulseShape[13] >> pulseShape[14] >>
1274 pulseShape[15] >> pulseShape[16] >> pulseShape[17] >> pulseShape[18] >>
1275 pulseShape[19] >> pulseShape[20] >> pulseShape[21] >> pulseShape[22] >>
1279 infile >> pulseShapeDer[0] >> pulseShapeDer[1] >> pulseShapeDer[2] >>
1280 pulseShapeDer[3] >> pulseShapeDer[4] >> pulseShapeDer[5] >>
1281 pulseShapeDer[6] >> pulseShapeDer[7] >> pulseShapeDer[8] >>
1282 pulseShapeDer[9] >> pulseShapeDer[10] >> pulseShapeDer[11] >>
1283 pulseShapeDer[12] >> pulseShapeDer[13] >> pulseShapeDer[14] >>
1284 pulseShapeDer[15] >> pulseShapeDer[16] >> pulseShapeDer[17] >>
1285 pulseShapeDer[18] >> pulseShapeDer[19] >> pulseShapeDer[20] >>
1286 pulseShapeDer[21] >> pulseShapeDer[22] >> pulseShapeDer[23];
1302 infile >> Ieta >> sinTheta;
1304 infile >> noiseRms[0] >> noiseRms[1] >> noiseRms[2];
1317 infile >> Ieta >> sinTheta;
1319 infile >> noiseRms[0] >> noiseRms[1] >> noiseRms[2];
1329 ATH_MSG_INFO(
" 1 pulse shape per energy for EMB+EMEC : ");
1358 " Finished reading 1 calib coeff + 1 noise value per eta bin for EM: ");
1365 ATH_MSG_INFO(
"Ieta= " << ieta + 1 <<
", noise rms EMB: "
1376 if (pulsedataname.empty()) {
1378 return StatusCode::FAILURE;
1380 pulsedatafile = pulsedataname.c_str();
1381 infile.open(pulsedatafile);
1385 return StatusCode::FAILURE;
1429 infile >> autoCorr[0] >> autoCorr[1] >> autoCorr[2] >> autoCorr[3] >>
1430 autoCorr[4] >> autoCorr[5] >> autoCorr[6];
1450 "Finished reading calib coeff, noise rms, sat ene, auto corr for each "
1451 "eta bin for HEC: ");
1457 ATH_MSG_INFO(
" Ieta= " << ieta + 1 <<
", noise rms HEC: "
1476 if (pulsedataname.empty()) {
1478 return StatusCode::FAILURE;
1480 pulsedatafile = pulsedataname.c_str();
1481 infile.open(pulsedatafile);
1485 return StatusCode::FAILURE;
1494 for (
int iMod = 0; iMod <
nMod; iMod++) {
1498 infile >> imod >> noiseRms4[0] >> noiseRms4[1] >> noiseRms4[2] >>
1503 infile >> pulseShape[0] >> pulseShape[1] >> pulseShape[2] >>
1504 pulseShape[3] >> pulseShape[4] >> pulseShape[5] >> pulseShape[6] >>
1505 pulseShape[7] >> pulseShape[8] >> pulseShape[9] >> pulseShape[10] >>
1506 pulseShape[11] >> pulseShape[12] >> pulseShape[13] >> pulseShape[14] >>
1507 pulseShape[15] >> pulseShape[16] >> pulseShape[17] >> pulseShape[18] >>
1508 pulseShape[19] >> pulseShape[20] >> pulseShape[21] >> pulseShape[22] >>
1513 infile >> pulseShapeDer[0] >> pulseShapeDer[1] >> pulseShapeDer[2] >>
1514 pulseShapeDer[3] >> pulseShapeDer[4] >> pulseShapeDer[5] >>
1515 pulseShapeDer[6] >> pulseShapeDer[7] >> pulseShapeDer[8] >>
1516 pulseShapeDer[9] >> pulseShapeDer[10] >> pulseShapeDer[11] >>
1517 pulseShapeDer[12] >> pulseShapeDer[13] >> pulseShapeDer[14] >>
1518 pulseShapeDer[15] >> pulseShapeDer[16] >> pulseShapeDer[17] >>
1519 pulseShapeDer[18] >> pulseShapeDer[19] >> pulseShapeDer[20] >>
1520 pulseShapeDer[21] >> pulseShapeDer[22] >> pulseShapeDer[23];
1533 std::vector<float> auxV(3);
1538 "Finished reading noise, calib coeff and pulse shape for each module for "
1540 for (
int iMod = 0; iMod <
nMod; iMod++) {
1542 ATH_MSG_INFO(
" iMod= " << iMod <<
", noise rms FCAL (eta bin 1,2,3,4): "
1545 ATH_MSG_INFO(
" iMod= " << iMod <<
", calib coeff FCAL (eta bin 1,2,3,4): "
1580 if (pulsedataname.empty()) {
1581 ATH_MSG_ERROR(
"Could not locate Fcal_ptweights_table7.data file");
1582 return StatusCode::FAILURE;
1584 pulsedatafile = pulsedataname.c_str();
1585 infile.open(pulsedatafile);
1589 return StatusCode::FAILURE;
1598 const unsigned int colNum = 14;
1600 const unsigned int maxCell = 4;
1601 std::vector<std::string> TTlabel;
1602 TTlabel.resize(colNum);
1603 std::vector<float>
gain;
1604 gain.resize(colNum);
1608 while (
infile >> TTlabel[0] >>
gain[0] >> TTlabel[1] >>
gain[1] >>
1609 TTlabel[2] >>
gain[2] >> TTlabel[3] >>
gain[3] >> TTlabel[4] >>
1610 gain[4] >> TTlabel[5] >>
gain[5] >> TTlabel[6] >>
gain[6] >>
1611 TTlabel[7] >>
gain[7] >> TTlabel[8] >>
gain[8] >> TTlabel[9] >>
1612 gain[9] >> TTlabel[10] >>
gain[10] >> TTlabel[11] >>
gain[11] >>
1613 TTlabel[12] >>
gain[12] >> TTlabel[13] >>
gain[13]) {
1617 ATH_MSG_DEBUG(
" TTlabel[13], gain[13]= " << TTlabel[13] <<
", "
1639 std::string TTlab = TTlabel[
icol];
1642 int eta =
int(TTlab[0]) - 49;
1643 int phi =
int(TTlab[1]) - 65;
1650 if (TTlab.size() > 3) {
1660 if ((
layer == 1 && detZside > 0) || (
layer == 0 && detZside < 0)) {
1661 if (
eta == 0 ||
eta == 2) {
1673 if (
eta == 1 ||
eta == 3) {
1694 std::vector<Identifier> cellIdVec =
m_ttSvc->createCellIDvecLayer(ttId);
1699 std::vector<unsigned int> hashVec;
1701 unsigned int nCell = 0;
1717 hashVec.push_back(fcalHash);
1727 for (
unsigned int iCell = 0; iCell <
maxCell; iCell++) {
1746 return StatusCode::SUCCESS;
1765 }
else if (region == 1 || region == 2) {
1771 }
else if (region == 3) {