12 #include <analysis/VariableManager/Manager.h>
15 #include <framework/core/Module.h>
16 #include <framework/datastore/StoreObjPtr.h>
17 #include <framework/datastore/StoreArray.h>
20 #include <mdst/dataobjects/ECLCluster.h>
21 #include <mdst/dataobjects/Track.h>
22 #include <mdst/dataobjects/MCParticle.h>
24 #include <analysis/dataobjects/Particle.h>
25 #include <ecl/dataobjects/ECLCalDigit.h>
26 #include <ecl/dataobjects/ECLShower.h>
27 #include <ecl/dataobjects/ECLCellIdMapping.h>
28 #include <tracking/dataobjects/ExtHit.h>
30 #include <ecl/dataobjects/ECLDsp.h>
40 namespace ECLCalDigitVariable {
47 twoComponentChi2 = 10,
48 twoComponentTotalEnergy = 11,
49 twoComponentHadronEnergy = 12,
50 twoComponentDiodeEnergy = 13,
51 twoComponentSavedChi2_PhotonHadron = 14,
52 twoComponentSavedChi2_PileUpPhoton = 15,
53 twoComponentSavedChi2_PhotonDiode = 16,
54 twoComponentFitType = 17,
73 int getCenterCell(
const Particle* particle)
76 const ECLCluster* cluster = particle->getECLCluster();
79 double maxEnergy = -1.;
81 auto clusterDigitRelations = cluster->getRelationsTo<ECLCalDigit>();
82 for (
unsigned int ir = 0; ir < clusterDigitRelations.size(); ++ir) {
83 const auto calDigit = clusterDigitRelations.object(ir);
85 if (calDigit->getEnergy() > maxEnergy) {
86 maxEnergy = calDigit->getEnergy();
87 maxCellId = calDigit->getCellId();
98 int getExtCell(
const Particle* particle)
100 Const::EDetector myDetID = Const::EDetector::ECL;
101 Const::ChargedStable hypothesis = Const::pion;
102 int pdgCode = abs(hypothesis.getPDGCode());
104 const Track* track = particle->getTrack();
106 for (
const auto& extHit : track->getRelationsTo<ExtHit>()) {
107 if (abs(extHit.getPdgCode()) != pdgCode)
continue;
108 if ((extHit.getDetectorID() != myDetID))
continue;
109 if (extHit.getStatus() != EXT_ENTER)
continue;
111 int copyid = extHit.getCopyID();
113 if (copyid == -1)
continue;
114 const int cellid = copyid + 1;
123 double getCalDigitExpertByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
126 if (vars.size() != 2) {
127 B2FATAL(
"Need exactly two parameters (energy rank, variable id).");
130 if (
int(std::lround(vars[0])) < 0) B2FATAL(
"Index cannot be negative.");
132 const unsigned int indexIn = int(std::lround(vars[0]));
134 const int varid = int(std::lround(vars[1]));
137 std::vector<std::tuple<double, unsigned int>> energyToSort;
139 const ECLCluster* cluster = particle->getECLCluster();
143 auto relatedDigits = cluster->getRelationsTo<ECLCalDigit>();
145 if (indexIn < relatedDigits.size()) {
147 for (
unsigned int iRel = 0; iRel < relatedDigits.size(); iRel++) {
149 const auto caldigit = relatedDigits.object(iRel);
151 energyToSort.emplace_back(caldigit->getEnergy(), iRel);
156 return std::numeric_limits<double>::quiet_NaN();
159 std::sort(energyToSort.begin(), energyToSort.end(), std::greater<>());
161 const auto [digitEnergy, caldigitIndex] = energyToSort[indexIn];
163 const auto caldigitSelected = relatedDigits.object(caldigitIndex);
165 if (varid == varType::energy) {
166 return caldigitSelected->getEnergy();
167 }
else if (varid == varType::time) {
168 return caldigitSelected->getTime();
169 }
else if (varid == varType::twoComponentChi2) {
170 return caldigitSelected->getTwoComponentChi2();
171 }
else if (varid == varType::twoComponentTotalEnergy) {
172 return caldigitSelected->getTwoComponentTotalEnergy();
173 }
else if (varid == varType::twoComponentHadronEnergy) {
174 return caldigitSelected->getTwoComponentHadronEnergy();
175 }
else if (varid == varType::twoComponentSavedChi2_PhotonHadron) {
176 return caldigitSelected->getTwoComponentSavedChi2(ECLDsp::photonHadron);
177 }
else if (varid == varType::twoComponentSavedChi2_PileUpPhoton) {
178 return caldigitSelected->getTwoComponentSavedChi2(ECLDsp::photonHadronBackgroundPhoton);
179 }
else if (varid == varType::twoComponentSavedChi2_PhotonDiode) {
180 return caldigitSelected->getTwoComponentSavedChi2(ECLDsp::photonDiodeCrossing);
181 }
else if (varid == varType::twoComponentDiodeEnergy) {
182 return caldigitSelected->getTwoComponentDiodeEnergy();
183 }
else if (varid == varType::twoComponentFitType) {
184 return int(caldigitSelected->getTwoComponentFitType());
185 }
else if (varid == varType::cellId) {
186 return caldigitSelected->getCellId();
187 }
else if (varid == varType::weight) {
188 const auto weight = relatedDigits.weight(caldigitIndex);
191 B2FATAL(
"variable id not found.");
196 return std::numeric_limits<double>::quiet_NaN();
201 double getCalDigitExpert(
const Particle* particle,
const std::vector<double>& vars)
203 if (vars.size() != 4) {
204 B2FATAL(
"Need exactly four parameters (cellid, neighbour area size, variable id, and cluster center (0) or ext (1)).");
207 StoreObjPtr<ECLCellIdMapping> mapping;
208 const unsigned int posid = int(std::lround(vars[0]));
209 const int nneighbours = int(std::lround(vars[1]));
210 const int varid = int(std::lround(vars[2]));
211 const int extid = int(std::lround(vars[3]));
214 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
215 return std::numeric_limits<double>::quiet_NaN();
217 if (nneighbours != 5 and nneighbours != 7) {
218 B2FATAL(
"Please request 5 or 7 neighbour area.");
219 return std::numeric_limits<double>::quiet_NaN();
225 if (extid == centerType::extCell) {
226 maxCellId = getExtCell(particle);
228 maxCellId = getCenterCell(particle);
232 if (maxCellId < 0)
return std::numeric_limits<double>::quiet_NaN();
235 int neighbourid = -1;
236 std::vector<short int> neighbours;
238 if (nneighbours == 5) {
239 neighbours = mapping->getCellIdToNeighbour5(maxCellId);
240 }
else if (nneighbours == 7) {
241 neighbours = mapping->getCellIdToNeighbour7(maxCellId);
244 if (posid < neighbours.size()) {
245 neighbourid = neighbours[posid];
247 B2WARNING(
"This position id is not contained in the requested neighbours.");
248 return std::numeric_limits<double>::quiet_NaN();
252 if (varid == varType::phi) {
253 return mapping->getCellIdToPhi(neighbourid);
254 }
else if (varid == varType::theta) {
255 return mapping->getCellIdToTheta(neighbourid);
256 }
else if (varid == varType::phiId) {
257 return mapping->getCellIdToPhiId(neighbourid);
258 }
else if (varid == varType::thetaId) {
259 return mapping->getCellIdToThetaId(neighbourid);
260 }
else if (varid == varType::cellId) {
265 const int storearraypos = mapping->getCellIdToStoreArray(neighbourid);
266 StoreArray<ECLCalDigit> eclCalDigits;
268 if (storearraypos >= 0) {
269 if (varid == varType::energy) {
270 return eclCalDigits[storearraypos]->getEnergy();
271 }
else if (varid == varType::time) {
272 return eclCalDigits[storearraypos]->getTime();
273 }
else if (varid == varType::timeResolution) {
274 return eclCalDigits[storearraypos]->getTimeResolution();
275 }
else if (varid == varType::twoComponentChi2) {
276 return eclCalDigits[storearraypos]->getTwoComponentChi2();
277 }
else if (varid == varType::twoComponentTotalEnergy) {
278 return eclCalDigits[storearraypos]->getTwoComponentTotalEnergy();
279 }
else if (varid == varType::twoComponentHadronEnergy) {
280 return eclCalDigits[storearraypos]->getTwoComponentHadronEnergy();
281 }
else if (varid == varType::twoComponentSavedChi2_PhotonHadron) {
282 return eclCalDigits[storearraypos]->getTwoComponentSavedChi2(ECLDsp::photonHadron);
283 }
else if (varid == varType::twoComponentSavedChi2_PileUpPhoton) {
284 return eclCalDigits[storearraypos]->getTwoComponentSavedChi2(ECLDsp::photonHadronBackgroundPhoton);
285 }
else if (varid == varType::twoComponentSavedChi2_PhotonDiode) {
286 return eclCalDigits[storearraypos]->getTwoComponentSavedChi2(ECLDsp::photonDiodeCrossing);
287 }
else if (varid == varType::twoComponentDiodeEnergy) {
288 return eclCalDigits[storearraypos]->getTwoComponentDiodeEnergy();
289 }
else if (varid == varType::twoComponentFitType) {
290 return int(eclCalDigits[storearraypos]->getTwoComponentFitType());
291 }
else if (varid == varType::mcenergy) {
293 auto digitMCRelations = eclCalDigits[storearraypos]->getRelationsTo<MCParticle>();
295 for (
unsigned int i = 0; i < digitMCRelations.size(); ++i) {
296 edep += digitMCRelations.weight(i);
299 }
else if (varid == varType::usedforenergy) {
300 const ECLCluster* cluster = particle->getECLCluster();
302 unsigned int cellid = eclCalDigits[storearraypos]->getCellId();
304 std::vector<unsigned int> listCellIds;
305 auto clusterShowerRelations = cluster->getRelationsWith<ECLShower>();
306 for (
unsigned int ir = 0; ir < clusterShowerRelations.size(); ++ir) {
307 const auto shower = clusterShowerRelations.object(ir);
308 listCellIds = shower->getListOfCrystalsForEnergy();
311 if (std::find(listCellIds.begin(), listCellIds.end(), cellid) != listCellIds.end()) {
317 return std::numeric_limits<double>::quiet_NaN();
321 return std::numeric_limits<double>::quiet_NaN();
325 return std::numeric_limits<double>::quiet_NaN();
333 double getECLCalDigitEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
335 if (vars.size() != 1) {
336 B2FATAL(
"Need exactly one parameters (energy index).");
338 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::energy};
339 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
343 double getECLCalDigitTimeByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
345 if (vars.size() != 1) {
346 B2FATAL(
"Need exactly one parameters (energy index).");
348 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::time};
349 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
353 double getCellIdByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
355 if (vars.size() != 1) {
356 B2FATAL(
"Need exactly one parameters (energy index).");
358 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::cellId};
359 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
363 double getTwoComponentFitTypeByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
365 if (vars.size() != 1) {
366 B2FATAL(
"Need exactly one parameters (energy index).");
368 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentFitType};
369 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
373 double getTwoComponentChi2ByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
375 if (vars.size() != 1) {
376 B2FATAL(
"Need exactly one parameters (energy index).");
378 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentChi2};
379 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
383 double getTwoComponentTotalEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
385 if (vars.size() != 1) {
386 B2FATAL(
"Need exactly one parameters (energy index).");
388 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentTotalEnergy};
389 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
393 double getTwoComponentHadronEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
395 if (vars.size() != 1) {
396 B2FATAL(
"Need exactly one parameters (energy index).");
398 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentHadronEnergy};
399 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
403 double getTwoComponentDiodeEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
405 if (vars.size() != 1) {
406 B2FATAL(
"Need exactly one parameters (energy index).");
408 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentDiodeEnergy};
409 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
413 double getTwoComponentChi2SavedByEnergyRank_PhotonHadron(
const Particle* particle,
const std::vector<double>& vars)
415 if (vars.size() != 1) {
416 B2FATAL(
"Need exactly one parameters (energy index).");
418 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonHadron};
419 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
423 double getTwoComponentChi2SavedByEnergyRank_PileUpPhoton(
const Particle* particle,
const std::vector<double>& vars)
425 if (vars.size() != 1) {
426 B2FATAL(
"Need exactly one parameters (energy index).");
428 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentSavedChi2_PileUpPhoton};
429 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
433 double getTwoComponentChi2SavedByEnergyRank_PhotonDiode(
const Particle* particle,
const std::vector<double>& vars)
435 if (vars.size() != 1) {
436 B2FATAL(
"Need exactly one parameters (energy index).");
438 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonDiode};
439 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
443 double getWeightByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
445 if (vars.size() != 1) {
446 B2FATAL(
"Need exactly one parameters (energy index).");
448 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::weight};
449 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
453 double getECLCalDigitEnergy(
const Particle* particle,
const std::vector<double>& vars)
455 if (vars.size() != 2) {
456 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
459 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::energy, ECLCalDigitVariable::centerType::maxCell};
460 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
464 double getMCEnergy(
const Particle* particle,
const std::vector<double>& vars)
466 if (vars.size() != 2) {
467 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
470 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::mcenergy, ECLCalDigitVariable::centerType::maxCell};
471 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
476 double getExtECLCalDigitEnergy(
const Particle* particle,
const std::vector<double>& vars)
478 if (vars.size() != 2) {
479 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
482 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::energy, ECLCalDigitVariable::centerType::extCell};
483 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
488 double getECLCalDigitTime(
const Particle* particle,
const std::vector<double>& vars)
490 if (vars.size() != 2) {
491 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
494 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::time, ECLCalDigitVariable::centerType::maxCell};
495 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
499 double getExtECLCalDigitTime(
const Particle* particle,
const std::vector<double>& vars)
501 if (vars.size() != 2) {
502 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
505 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::time, ECLCalDigitVariable::centerType::extCell};
506 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
510 double getExtECLCalDigitTimeResolution(
const Particle* particle,
const std::vector<double>& vars)
512 if (vars.size() != 2) {
513 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
516 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::timeResolution, ECLCalDigitVariable::centerType::extCell};
517 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
521 double getECLCalDigitTimeResolution(
const Particle* particle,
const std::vector<double>& vars)
523 if (vars.size() != 2) {
524 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
527 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::timeResolution, ECLCalDigitVariable::centerType::maxCell};
528 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
532 double getTwoComponentChi2(
const Particle* particle,
const std::vector<double>& vars)
534 if (vars.size() != 2) {
535 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
538 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentChi2, ECLCalDigitVariable::centerType::maxCell};
539 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
543 double getExtECLCalDigitTwoComponentChi2(
const Particle* particle,
const std::vector<double>& vars)
545 if (vars.size() != 2) {
546 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
549 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentChi2, ECLCalDigitVariable::centerType::extCell};
550 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
554 double getTwoComponentTotalEnergy(
const Particle* particle,
const std::vector<double>& vars)
556 if (vars.size() != 2) {
557 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
560 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentTotalEnergy, ECLCalDigitVariable::centerType::maxCell};
561 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
565 double getExtECLCalDigitTwoComponentTotalEnergy(
const Particle* particle,
const std::vector<double>& vars)
567 if (vars.size() != 2) {
568 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
571 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentTotalEnergy, ECLCalDigitVariable::centerType::extCell};
572 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
576 double getTwoComponentHadronEnergy(
const Particle* particle,
const std::vector<double>& vars)
578 if (vars.size() != 2) {
579 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
582 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentHadronEnergy, ECLCalDigitVariable::centerType::maxCell};
583 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
587 double getUsedForClusterEnergy(
const Particle* particle,
const std::vector<double>& vars)
589 if (vars.size() != 2) {
590 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
593 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::usedforenergy, ECLCalDigitVariable::centerType::maxCell};
594 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
598 double getExtECLCalDigitTwoComponentHadronEnergy(
const Particle* particle,
const std::vector<double>& vars)
600 if (vars.size() != 2) {
601 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
604 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentHadronEnergy, ECLCalDigitVariable::centerType::extCell};
605 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
609 double getECLCalDigitTwoComponentDiodeEnergy(
const Particle* particle,
const std::vector<double>& vars)
611 if (vars.size() != 2) {
612 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
615 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentDiodeEnergy, ECLCalDigitVariable::centerType::maxCell};
616 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
620 double getExtECLCalDigitTwoComponentDiodeEnergy(
const Particle* particle,
const std::vector<double>& vars)
622 if (vars.size() != 2) {
623 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
626 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentDiodeEnergy, ECLCalDigitVariable::centerType::extCell};
627 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
631 double getECLCalDigitTwoComponentFitType(
const Particle* particle,
const std::vector<double>& vars)
633 if (vars.size() != 2) {
634 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
637 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentFitType, ECLCalDigitVariable::centerType::maxCell};
638 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
642 double getExtECLCalDigitTwoComponentFitType(
const Particle* particle,
const std::vector<double>& vars)
644 if (vars.size() != 2) {
645 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
648 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentFitType, ECLCalDigitVariable::centerType::extCell};
649 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
653 double getECLCalDigitTwoComponentChi2Saved_PhotonHadron(
const Particle* particle,
const std::vector<double>& vars)
655 if (vars.size() != 2) {
656 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
659 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonHadron, ECLCalDigitVariable::centerType::maxCell};
660 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
664 double getExtECLCalDigitTwoComponentChi2Saved_PhotonHadron(
const Particle* particle,
const std::vector<double>& vars)
666 if (vars.size() != 2) {
667 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
670 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonHadron, ECLCalDigitVariable::centerType::extCell};
671 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
675 double getECLCalDigitTwoComponentChi2Saved_PileUpPhoton(
const Particle* particle,
const std::vector<double>& vars)
677 if (vars.size() != 2) {
678 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
681 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PileUpPhoton, ECLCalDigitVariable::centerType::maxCell};
682 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
686 double getExtECLCalDigitTwoComponentChi2Saved_PileUpPhoton(
const Particle* particle,
const std::vector<double>& vars)
688 if (vars.size() != 2) {
689 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
692 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PileUpPhoton, ECLCalDigitVariable::centerType::extCell};
693 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
697 double getECLCalDigitTwoComponentChi2Saved_PhotonDiode(
const Particle* particle,
const std::vector<double>& vars)
699 if (vars.size() != 2) {
700 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
703 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonDiode, ECLCalDigitVariable::centerType::maxCell};
704 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
708 double getExtECLCalDigitTwoComponentChi2Saved_PhotonDiode(
const Particle* particle,
const std::vector<double>& vars)
710 if (vars.size() != 2) {
711 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
714 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonDiode, ECLCalDigitVariable::centerType::extCell};
715 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
719 double getPhi(
const Particle* particle,
const std::vector<double>& vars)
721 if (vars.size() != 2) {
722 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
725 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phi, ECLCalDigitVariable::centerType::maxCell};
726 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
730 double getExtPhi(
const Particle* particle,
const std::vector<double>& vars)
732 if (vars.size() != 2) {
733 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
736 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phi, ECLCalDigitVariable::centerType::extCell};
737 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
741 double getTheta(
const Particle* particle,
const std::vector<double>& vars)
743 if (vars.size() != 2) {
744 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
747 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::theta, ECLCalDigitVariable::centerType::maxCell};
748 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
752 double getExtTheta(
const Particle* particle,
const std::vector<double>& vars)
754 if (vars.size() != 2) {
755 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
758 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::theta, ECLCalDigitVariable::centerType::extCell};
759 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
763 double getPhiId(
const Particle* particle,
const std::vector<double>& vars)
765 if (vars.size() != 2) {
766 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
769 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phiId, ECLCalDigitVariable::centerType::maxCell};
770 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
774 double getExtPhiId(
const Particle* particle,
const std::vector<double>& vars)
776 if (vars.size() != 2) {
777 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
780 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phiId, ECLCalDigitVariable::centerType::extCell};
781 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
785 double getThetaId(
const Particle* particle,
const std::vector<double>& vars)
787 if (vars.size() != 2) {
788 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
791 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::thetaId, ECLCalDigitVariable::centerType::maxCell};
792 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
796 double getExtThetaId(
const Particle* particle,
const std::vector<double>& vars)
798 if (vars.size() != 2) {
799 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
802 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::thetaId, ECLCalDigitVariable::centerType::extCell};
803 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
807 double getCellId(
const Particle* particle,
const std::vector<double>& vars)
809 if (vars.size() != 2) {
810 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
813 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::cellId, ECLCalDigitVariable::centerType::maxCell};
814 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
818 double getCenterCellId(
const Particle* particle)
820 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
822 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
827 double getCenterCellCrystalTheta(
const Particle* particle)
829 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
830 StoreObjPtr<ECLCellIdMapping> mapping;
833 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
834 return std::numeric_limits<double>::quiet_NaN();
837 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
838 return mapping->getCellIdToTheta(centercellid);
842 double getCenterCellCrystalPhi(
const Particle* particle)
844 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
845 StoreObjPtr<ECLCellIdMapping> mapping;
848 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
849 return std::numeric_limits<double>::quiet_NaN();
852 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
853 return mapping->getCellIdToPhi(centercellid);
857 double getExtCellId(
const Particle* particle)
859 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
861 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
866 double getCenterCellThetaId(
const Particle* particle)
868 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
869 StoreObjPtr<ECLCellIdMapping> mapping;
872 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
873 return std::numeric_limits<double>::quiet_NaN();
876 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
877 return mapping->getCellIdToThetaId(centercellid);
881 double getCenterCellPhiId(
const Particle* particle)
883 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
884 StoreObjPtr<ECLCellIdMapping> mapping;
887 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
888 return std::numeric_limits<double>::quiet_NaN();
891 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
892 return mapping->getCellIdToPhiId(centercellid);
896 double getExtCellThetaId(
const Particle* particle)
898 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
899 StoreObjPtr<ECLCellIdMapping> mapping;
902 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
903 return std::numeric_limits<double>::quiet_NaN();
906 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
907 return mapping->getCellIdToThetaId(extcellid);
911 double getExtCellPhiId(
const Particle* particle)
913 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
914 StoreObjPtr<ECLCellIdMapping> mapping;
917 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
918 return std::numeric_limits<double>::quiet_NaN();
921 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
922 return mapping->getCellIdToPhiId(extcellid);
926 double getExtCellCrystalTheta(
const Particle* particle)
928 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
929 StoreObjPtr<ECLCellIdMapping> mapping;
932 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
933 return std::numeric_limits<double>::quiet_NaN();
936 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
937 return mapping->getCellIdToTheta(extcellid);
941 double getExtCellCrystalPhi(
const Particle* particle)
943 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
944 StoreObjPtr<ECLCellIdMapping> mapping;
947 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
948 return std::numeric_limits<double>::quiet_NaN();
951 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
952 return mapping->getCellIdToPhi(extcellid);
956 double getCenterCellIndex(
const Particle* particle,
const std::vector<double>& vars)
958 if (vars.size() != 1) {
959 B2FATAL(
"Need exactly one parameters (neighbour area size).");
962 StoreObjPtr<ECLCellIdMapping> mapping;
963 const int nneighbours = int(std::lround(vars[0]));
966 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
967 return std::numeric_limits<double>::quiet_NaN();
969 if (nneighbours != 5 and nneighbours != 7) {
970 B2FATAL(
"Please request 5 or 7 neighbour area.");
971 return std::numeric_limits<double>::quiet_NaN();
974 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
975 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
977 std::vector<short int> neighbours;
979 if (nneighbours == 5) {
980 neighbours = mapping->getCellIdToNeighbour5(centercellid);
981 }
else if (nneighbours == 7) {
982 neighbours = mapping->getCellIdToNeighbour7(centercellid);
985 for (
unsigned int idx = 0; idx < neighbours.size(); idx++) {
986 if (neighbours[idx] == centercellid)
return idx;
989 return std::numeric_limits<double>::quiet_NaN();
994 double getExtCenterCellIndex(
const Particle* particle,
const std::vector<double>& vars)
996 if (vars.size() != 1) {
997 B2FATAL(
"Need exactly one parameters (neighbour area size).");
1000 StoreObjPtr<ECLCellIdMapping> mapping;
1001 const int nneighbours = int(std::lround(vars[0]));
1004 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1005 return std::numeric_limits<double>::quiet_NaN();
1007 if (nneighbours != 5 and nneighbours != 7) {
1008 B2FATAL(
"Please request 5 or 7 neighbour area.");
1009 return std::numeric_limits<double>::quiet_NaN();
1012 const int centercellid = ECLCalDigitVariable::getExtCell(particle);
1013 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1015 std::vector<short int> neighbours;
1017 if (nneighbours == 5) {
1018 neighbours = mapping->getCellIdToNeighbour5(centercellid);
1019 }
else if (nneighbours == 7) {
1020 neighbours = mapping->getCellIdToNeighbour7(centercellid);
1023 for (
unsigned int idx = 0; idx < neighbours.size(); idx++) {
1024 if (neighbours[idx] == centercellid)
return idx;
1027 return std::numeric_limits<double>::quiet_NaN();
1030 double getTotalECLCalDigitMCEnergy(
const Particle* particle)
1032 const MCParticle* mcparticle = particle->getRelatedTo<MCParticle>();
1033 if (mcparticle ==
nullptr)
1034 return std::numeric_limits<double>::quiet_NaN();
1037 auto mcDigitRelations = mcparticle->getRelationsWith<ECLCalDigit>();
1038 for (
unsigned int ir = 0; ir < mcDigitRelations.size(); ++ir) {
1039 sum += mcDigitRelations.weight(ir);
1046 double getClusterECLCalDigitMCEnergy(
const Particle* particle)
1049 const MCParticle* mcparticle = particle->getRelatedTo<MCParticle>();
1050 if (mcparticle ==
nullptr)
1051 return std::numeric_limits<double>::quiet_NaN();
1053 const ECLCluster* cluster = particle->getECLCluster();
1055 std::vector<unsigned int> listCellIds;
1056 auto clusterShowerRelations = cluster->getRelationsWith<ECLShower>();
1057 for (
unsigned int ir = 0; ir < clusterShowerRelations.size(); ++ir) {
1058 const auto shower = clusterShowerRelations.object(ir);
1059 listCellIds = shower->getListOfCrystalsForEnergy();
1063 auto clusterDigitRelations = mcparticle->getRelationsWith<ECLCalDigit>();
1064 for (
unsigned int ir = 0; ir < clusterDigitRelations.size(); ++ir) {
1067 unsigned int cellid = clusterDigitRelations.object(ir)->getCellId();
1068 if (std::find(listCellIds.begin(), listCellIds.end(), cellid) != listCellIds.end()) {
1069 sum += clusterDigitRelations.weight(ir);
1076 return std::numeric_limits<float>::quiet_NaN();
1082 double getClusterNHitsThreshold(
const Particle* particle,
const std::vector<double>& vars)
1084 if (vars.size() != 1) {
1085 B2FATAL(
"Need exactly one parameter (energy threshold in GeV).");
1087 const double threshold = vars[0];
1089 const ECLCluster* cluster = particle->getECLCluster();
1093 auto clusterDigitRelations = cluster->getRelationsTo<ECLCalDigit>();
1094 for (
unsigned int ir = 0; ir < clusterDigitRelations.size(); ++ir) {
1095 const auto calDigit = clusterDigitRelations.object(ir);
1096 const auto weight = clusterDigitRelations.weight(ir);
1099 if (calDigit->getEnergy() > threshold) {
1106 return std::numeric_limits<float>::quiet_NaN();
1110 VARIABLE_GROUP(
"ECL Calibration (cDST)");
1111 REGISTER_VARIABLE(
"eclcaldigitEnergy(i, j)", getECLCalDigitEnergy,
1112 "[calibration] Returns the energy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1113 REGISTER_VARIABLE(
"eclcaldigitTime(i, j)", getECLCalDigitTime,
1114 "[calibration] Returns the time of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1115 REGISTER_VARIABLE(
"eclcaldigitTimeResolution(i, j)", getECLCalDigitTimeResolution,
1116 "[calibration] Returns the time resolution (dt99) of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1117 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2(i, j)", getTwoComponentChi2,
1118 "[calibration] Returns the two component fit chi2 of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1119 REGISTER_VARIABLE(
"eclcaldigitTwoComponentTotalEnergy(i, j)", getTwoComponentTotalEnergy,
1120 "[calibration] Returns the two component total energy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1121 REGISTER_VARIABLE(
"eclcaldigitTwoComponentHadronEnergy(i, j)", getTwoComponentHadronEnergy,
1122 "[calibration] Returns the two component hadron energy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1123 REGISTER_VARIABLE(
"eclcaldigitPhi(i, j)", getPhi,
1124 "[calibration] Returns phi of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1125 REGISTER_VARIABLE(
"eclcaldigitTheta(i, j)", getTheta,
1126 "[calibration] Returns theta of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1127 REGISTER_VARIABLE(
"eclcaldigitPhiId(i, j)", getPhiId,
1128 "[calibration] Returns the phi Id of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1129 REGISTER_VARIABLE(
"eclcaldigitThetaId(i, j)", getThetaId,
1130 "[calibration] Returns the theta Id of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1131 REGISTER_VARIABLE(
"eclcaldigitCellId(i, j)", getCellId,
1132 "[calibration] Returns the cell id of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours (1-based)");
1133 REGISTER_VARIABLE(
"eclcaldigitUsedForClusterEnergy(i, j)", getUsedForClusterEnergy,
1134 " [calibration] Returns the 0 (not used) 1 (used) of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours (1-based)");
1136 REGISTER_VARIABLE(
"eclcaldigitCenterCellId", getCenterCellId,
"[calibration] Returns the center cell id");
1137 REGISTER_VARIABLE(
"eclcaldigitCenterCellThetaId", getCenterCellThetaId,
"[calibration] Returns the center cell theta id");
1138 REGISTER_VARIABLE(
"eclcaldigitCenterCellPhiId", getCenterCellPhiId,
"[calibration] Returns the center cell phi id");
1139 REGISTER_VARIABLE(
"eclcaldigitCenterCellCrystalTheta", getCenterCellCrystalTheta,
1140 "[calibration] Returns the center cell crystal theta");
1141 REGISTER_VARIABLE(
"eclcaldigitCenterCellCrystalPhi", getCenterCellCrystalPhi,
1142 "[calibration] Returns the center cell crystal phi");
1143 REGISTER_VARIABLE(
"eclcaldigitCenterCellIndex(i)", getCenterCellIndex,
1144 "[calibration] Returns the center cell index (within its 5x5 (i=5) or 7x7 (i=7) neighbours)");
1145 REGISTER_VARIABLE(
"eclcaldigitMCEnergy(i, j)", getMCEnergy,
1146 "[calibration] Returns the true deposited energy of all particles of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours (1-based)");
1147 REGISTER_VARIABLE(
"clusterNHitsThreshold(i)", getClusterNHitsThreshold,
1148 "[calibration] Returns sum of crystal weights sum(w_i) with w_i<=1 associated to this cluster above threshold (in GeV)");
1150 VARIABLE_GROUP(
"ECL Calibration (based on extrapolated tracks) (cDST)");
1151 REGISTER_VARIABLE(
"eclcaldigitExtEnergy(i, j)", getExtECLCalDigitEnergy,
1152 "[calibration] Returns the energy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1153 REGISTER_VARIABLE(
"eclcaldigitExtTime(i, j)", getExtECLCalDigitTime,
1154 "[calibration] Returns the time of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1155 REGISTER_VARIABLE(
"eclcaldigitExtTimeResolution(i, j)", getExtECLCalDigitTimeResolution,
1156 "[calibration] Returns the time resolution (dt99) of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1157 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentTotalEnergy(i, j)", getExtECLCalDigitTwoComponentTotalEnergy,
1158 "[calibration] Returns the TwoComponentTotalEnergy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1159 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentHadronEnergy(i, j)", getExtECLCalDigitTwoComponentHadronEnergy,
1160 "[calibration] Returns the TwoComponentHadronEnergy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1161 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2(i, j)", getExtECLCalDigitTwoComponentChi2,
1162 "[calibration] Returns the TwoComponentchi2 of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1163 REGISTER_VARIABLE(
"eclcaldigitExtPhi(i, j)", getExtPhi,
1164 "[calibration] Returns phi of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an extrapolated track");
1165 REGISTER_VARIABLE(
"eclcaldigitExtTheta(i, j)", getExtTheta,
1166 "[calibration] Returns theta of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an extrapolated track");
1167 REGISTER_VARIABLE(
"eclcaldigitExtPhiId(i, j)", getExtPhiId,
1168 "[calibration] Returns the phi Id of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an extrapolated track");
1169 REGISTER_VARIABLE(
"eclcaldigitExtThetaId(i, j)", getExtThetaId,
1170 "[calibration] Returns the theta Id of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an extrapolated track");
1171 REGISTER_VARIABLE(
"eclcaldigitExtCellId", getExtCellId,
"[calibration] Returns the extrapolated cell id");
1172 REGISTER_VARIABLE(
"eclcaldigitExtCellThetaId", getExtCellThetaId,
"[calibration] Returns the ext cell theta id");
1173 REGISTER_VARIABLE(
"eclcaldigitExtCellPhiId", getExtCellPhiId,
"[calibration] Returns the ext cell phi id");
1174 REGISTER_VARIABLE(
"eclcaldigitExtCellCrystalTheta", getExtCellCrystalTheta,
"[calibration] Returns the ext cell crystal theta");
1175 REGISTER_VARIABLE(
"eclcaldigitExtCellCrystalPhi", getExtCellCrystalPhi,
"[calibration] Returns the ext cell crystal phi");
1176 REGISTER_VARIABLE(
"eclcaldigitExtCenterCellIndex(i)", getExtCenterCellIndex,
1177 "[calibration] Returns the center cell index (within its 5x5 (i=5) or 7x7 (i=7) neighbours) for an ext track");
1179 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentFitType(i, j)", getExtECLCalDigitTwoComponentFitType,
1180 "[calibration] Returns the TwoComponentFitType of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1181 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentDiodeEnergy(i, j)", getExtECLCalDigitTwoComponentDiodeEnergy,
1182 "[calibration] Returns the TwoComponentDiodeEnergy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1183 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2Saved_PhotonHadron(i, j)", getExtECLCalDigitTwoComponentChi2Saved_PhotonHadron,
1184 "[calibration] Returns the TwoComponentChi2Saved_PhotonHadron of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1185 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2Saved_PileUpPhoton(i, j)", getExtECLCalDigitTwoComponentChi2Saved_PileUpPhoton,
1186 "[calibration] Returns the TwoComponentChi2Saved_PileUpPhoton of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1187 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2Saved_PhotonDiode(i, j)", getExtECLCalDigitTwoComponentChi2Saved_PhotonDiode,
1188 "[calibration] Returns the TwoComponentChi2Saved_PhotonDiode of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours for an ext track");
1190 REGISTER_VARIABLE(
"eclcaldigitTwoComponentFitType(i, j)", getECLCalDigitTwoComponentFitType,
1191 "[calibration] Returns the TwoComponentFitType of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1192 REGISTER_VARIABLE(
"eclcaldigitTwoComponentDiodeEnergy(i, j)", getECLCalDigitTwoComponentDiodeEnergy,
1193 "[calibration] Returns the TwoComponentDiodeEnergy of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1194 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2Saved_PhotonHadron(i, j)", getECLCalDigitTwoComponentChi2Saved_PhotonHadron,
1195 "[calibration] Returns the TwoComponentChi2Saved_PhotonHadron of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1196 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2Saved_PileUpPhoton(i, j)", getECLCalDigitTwoComponentChi2Saved_PileUpPhoton,
1197 "[calibration] Returns the TwoComponentChi2Saved_PileUpPhoton of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1198 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2Saved_PhotonDiode(i, j)", getECLCalDigitTwoComponentChi2Saved_PhotonDiode,
1199 "[calibration] Returns the TwoComponentChi2Saved_PhotonDiode of the i-th caldigit for 5x5 (j=5) or 7x7 (j=7) neighbours");
1201 REGISTER_VARIABLE(
"eclcaldigitEnergyByEnergyRank(i)", getECLCalDigitEnergyByEnergyRank,
1202 "[calibration] Returns the caldigit energy of the i-th highest energy caldigit in the cluster (i>=0)");
1204 REGISTER_VARIABLE(
"eclcaldigitTimeByEnergyRank(i)", getECLCalDigitTimeByEnergyRank,
1205 "[calibration] Returns the caldigit time of the i-th highest energy caldigit in the cluster (i>=0)");
1207 REGISTER_VARIABLE(
"eclcaldigitTwoComponentFitTypeByEnergyRank(i)", getTwoComponentFitTypeByEnergyRank,
1208 "[calibration] Returns the offline fit type of the i-th highest energy caldigit in the cluster (i>=0)");
1210 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2ByEnergyRank(i)", getTwoComponentChi2ByEnergyRank,
1211 "[calibration] Returns the two component chi2 of the i-th highest energy caldigit in the cluster (i>=0)");
1213 REGISTER_VARIABLE(
"eclcaldigitTwoComponentEnergyByEnergyRank(i)", getTwoComponentTotalEnergyByEnergyRank,
1214 "[calibration] Returns the two component total energy of the i-th highest energy caldigit in the cluster (i>=0)");
1216 REGISTER_VARIABLE(
"eclcaldigitTwoComponentHadronEnergyByEnergyRank(i)", getTwoComponentHadronEnergyByEnergyRank,
1217 "[calibration] Returns the two component fit Hadron Energy of the i-th highest energy caldigit in the cluster (i>=0)");
1219 REGISTER_VARIABLE(
"eclcaldigitTwoComponentDiodeEnergyByEnergyRank(i)", getTwoComponentDiodeEnergyByEnergyRank,
1220 "[calibration] Returns the two component fit Diode Energy of the i-th highest energy caldigit in the cluster (i>=0)");
1222 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2SavedByEnergyRank_PhotonHadron(i)", getTwoComponentChi2SavedByEnergyRank_PhotonHadron,
1223 "[calibration] Returns the chi2 for the photo+hadron fit type of the i-th highest energy caldigit in the cluster (i>=0)");
1225 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2SavedByEnergyRank_PileUpPhoton(i)", getTwoComponentChi2SavedByEnergyRank_PileUpPhoton,
1226 "[calibration] Returns the chi2 for the photo+hadron+pile-up photon fit type of the i-th highest energy caldigit in the cluster (i>=0)");
1228 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2SavedByEnergyRank_PhotonDiode(i)", getTwoComponentChi2SavedByEnergyRank_PhotonDiode,
1229 "[calibration] Returns the chi2 for the photo+diode fit type of the i-th highest energy caldigit in the cluster (i>=0)");
1231 REGISTER_VARIABLE(
"eclcaldigitWeightByEnergyRank(i)", getWeightByEnergyRank,
1232 "[calibration] Returns the weight of the i-th highest energy caldigit in the cluster (i>=0)");
1234 REGISTER_VARIABLE(
"eclcaldigitCellIdByEnergyRank(i)", getCellIdByEnergyRank,
1235 "[calibration] Returns the cell id of the i-th highest energy caldigit in the cluster (i>=0)");
1237 REGISTER_VARIABLE(
"totalECLCalDigitMCEnergy", getTotalECLCalDigitMCEnergy,
1238 "[calibration] Returns total deposited MC energy in all ECLCalDigits for the MC particle");
1240 REGISTER_VARIABLE(
"clusterECLCalDigitMCEnergy", getClusterECLCalDigitMCEnergy,
1241 "[calibration] Returns total deposited MC energy in all ECLCalDigits for the MC particle that are used to calculate the cluster energy");