10 #include <ecl/dataobjects/ECLCalDigit.h>
11 #include <ecl/dataobjects/ECLCellIdMapping.h>
12 #include <ecl/dataobjects/ECLDsp.h>
13 #include <ecl/dataobjects/ECLShower.h>
14 #include <ecl/geometry/ECLGeometryPar.h>
17 #include <analysis/VariableManager/Manager.h>
18 #include <analysis/dataobjects/Particle.h>
19 #include <framework/core/Module.h>
20 #include <framework/datastore/StoreArray.h>
21 #include <framework/datastore/StoreObjPtr.h>
22 #include <framework/geometry/B2Vector3.h>
23 #include <mdst/dataobjects/ECLCluster.h>
24 #include <mdst/dataobjects/MCParticle.h>
25 #include <mdst/dataobjects/Track.h>
26 #include <tracking/dataobjects/ExtHit.h>
29 #include <Math/VectorUtil.h>
39 namespace ECLCalDigitVariable {
46 twoComponentChi2 = 10,
47 twoComponentTotalEnergy = 11,
48 twoComponentHadronEnergy = 12,
49 twoComponentDiodeEnergy = 13,
50 twoComponentSavedChi2_PhotonHadron = 14,
51 twoComponentSavedChi2_PileUpPhoton = 15,
52 twoComponentSavedChi2_PhotonDiode = 16,
53 twoComponentFitType = 17,
67 twoComponentHadronEnergyFraction = 41,
68 fractionOfShowerEnergy = 42,
69 phiRelativeToShower = 43,
70 thetaRelativeToShower = 44,
71 cosThetaRelativeToShower = 45,
72 rRelativeToShower = 46,
83 int getCenterCell(
const Particle* particle)
86 const ECLCluster* cluster = particle->getECLCluster();
89 double maxEnergy = -1.;
91 auto clusterDigitRelations = cluster->getRelationsTo<ECLCalDigit>();
92 for (
unsigned int ir = 0; ir < clusterDigitRelations.size(); ++ir) {
93 const auto calDigit = clusterDigitRelations.object(ir);
94 const auto weight = clusterDigitRelations.weight(ir);
96 if (calDigit->getEnergy()*weight > maxEnergy) {
97 maxEnergy = calDigit->getEnergy() * weight;
98 maxCellId = calDigit->getCellId();
109 int getExtCell(
const Particle* particle)
111 Const::EDetector myDetID = Const::EDetector::ECL;
112 Const::ChargedStable hypothesis = Const::pion;
113 int pdgCode = abs(hypothesis.getPDGCode());
115 const Track* track = particle->getTrack();
117 for (
const auto& extHit : track->getRelationsTo<ExtHit>()) {
118 if (abs(extHit.getPdgCode()) != pdgCode)
continue;
119 if ((extHit.getDetectorID() != myDetID))
continue;
120 if (extHit.getStatus() != EXT_ENTER)
continue;
122 int copyid = extHit.getCopyID();
124 if (copyid == -1)
continue;
125 const int cellid = copyid + 1;
135 double getCellIdMagnitude(
int cellid)
139 return position.
Mag();
143 std::vector<std::pair<unsigned int, bool>> calculateListOfCrystalEnergyRankAndQuality(ECLShower* shower)
145 std::vector<std::pair<unsigned int, bool>> listOfCrystalEnergyRankAndQuality;
146 std::vector<std::tuple<double, unsigned int, bool>> energyToSort;
148 RelationVector<ECLCalDigit> relatedDigits = shower->getRelationsTo<ECLCalDigit>();
151 for (
unsigned int iRel = 0; iRel < relatedDigits.size(); iRel++) {
153 const auto caldigit = relatedDigits.object(iRel);
154 const auto weight = relatedDigits.weight(iRel);
158 const double digitChi2 = caldigit->getTwoComponentChi2();
159 if (digitChi2 < 0) goodFit =
false;
161 ECLDsp::TwoComponentFitType digitFitType1 = caldigit->getTwoComponentFitType();
164 if (digitFitType1 == ECLDsp::poorChi2) goodFit =
false;
167 if (digitFitType1 == ECLDsp::photonDiodeCrossing) goodFit =
false;
169 energyToSort.emplace_back(caldigit->getEnergy()*weight, iRel, goodFit);
173 std::sort(energyToSort.begin(), energyToSort.end(), std::greater<>());
175 for (
unsigned int iSorted = 0; iSorted < energyToSort.size(); iSorted++) {
176 listOfCrystalEnergyRankAndQuality.push_back(std::make_pair(std::get<1>(energyToSort[iSorted]),
177 std::get<2>(energyToSort[iSorted])));
179 return listOfCrystalEnergyRankAndQuality;
182 ECLShower* getECLShowerFromParticle(
const Particle* particle)
184 const ECLCluster* cluster = particle->getECLCluster();
185 if (!cluster)
return nullptr;
186 const auto relShowers = cluster->getRelationsWith<ECLShower>();
187 if (relShowers.size() == 0)
return nullptr;
189 if (relShowers.size() == 1) {
190 return relShowers.object(0);
192 B2FATAL(
"Somehow found more than 1 ECLShower matched to the ECLCluster. This should not be possible!");
198 double getCalDigitExpertByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
201 if (!((vars.size() == 2) || (vars.size() == 3))) {
202 B2FATAL(
"Need two or three parameters (energy rank, variable id, [onlyGoodQualityPSDFits]).");
205 if (
int(std::lround(vars[0])) < 0) B2FATAL(
"Index cannot be negative.");
207 const unsigned int indexIn = int(std::lround(vars[0]));
208 const int varid = int(std::lround(vars[1]));
210 bool onlyGoodQualityPSDFits =
false;
211 if (vars.size() == 3) {
212 onlyGoodQualityPSDFits =
static_cast<bool>(std::lround(vars[2]));
215 ECLShower* shower = getECLShowerFromParticle(particle);
216 if (!shower)
return std::numeric_limits<float>::quiet_NaN();
219 if (shower->getListOfCrystalEnergyRankAndQuality().empty()) {
220 shower->setListOfCrystalEnergyRankAndQuality(calculateListOfCrystalEnergyRankAndQuality(shower));
223 const std::vector<std::pair<unsigned int, bool>> idxAndQualityList = shower->getListOfCrystalEnergyRankAndQuality();
226 if (indexIn >= idxAndQualityList.size())
return std::numeric_limits<float>::quiet_NaN();
228 auto relatedDigits = shower->getRelationsTo<ECLCalDigit>();
229 const auto calDigitIndex = idxAndQualityList.at(indexIn).first;
230 const auto goodFit = idxAndQualityList.at(indexIn).second;
231 const auto caldigitSelected = relatedDigits.object(calDigitIndex);
232 const auto weight = relatedDigits.weight(calDigitIndex);
233 const auto digitEnergy = caldigitSelected->getEnergy() * weight;
236 StoreObjPtr<ECLCellIdMapping> mapping;
237 if ((!mapping) and ((varid == varType::phi) or (varid == varType::theta))) {
238 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
239 return std::numeric_limits<double>::quiet_NaN();
243 if (onlyGoodQualityPSDFits && (!goodFit) && ((varid == varType::twoComponentChi2) ||
244 (varid == varType::twoComponentTotalEnergy) ||
245 (varid == varType::twoComponentHadronEnergy) ||
246 (varid == varType::twoComponentDiodeEnergy) ||
247 (varid == varType::twoComponentFitType) ||
248 (varid == varType::twoComponentHadronEnergyFraction)
250 return std::numeric_limits<double>::quiet_NaN();
253 if (varid == varType::energy) {
254 return caldigitSelected->getEnergy();
255 }
else if (varid == varType::time) {
256 return caldigitSelected->getTime();
257 }
else if (varid == varType::twoComponentChi2) {
258 return caldigitSelected->getTwoComponentChi2();
259 }
else if (varid == varType::twoComponentTotalEnergy) {
260 return caldigitSelected->getTwoComponentTotalEnergy();
261 }
else if (varid == varType::twoComponentHadronEnergy) {
262 return caldigitSelected->getTwoComponentHadronEnergy();
263 }
else if (varid == varType::twoComponentSavedChi2_PhotonHadron) {
264 return caldigitSelected->getTwoComponentSavedChi2(ECLDsp::photonHadron);
265 }
else if (varid == varType::twoComponentSavedChi2_PileUpPhoton) {
266 return caldigitSelected->getTwoComponentSavedChi2(ECLDsp::photonHadronBackgroundPhoton);
267 }
else if (varid == varType::twoComponentSavedChi2_PhotonDiode) {
268 return caldigitSelected->getTwoComponentSavedChi2(ECLDsp::photonDiodeCrossing);
269 }
else if (varid == varType::twoComponentDiodeEnergy) {
270 return caldigitSelected->getTwoComponentDiodeEnergy();
271 }
else if (varid == varType::twoComponentFitType) {
272 return int(caldigitSelected->getTwoComponentFitType());
273 }
else if (varid == varType::cellId) {
274 return caldigitSelected->getCellId();
275 }
else if (varid == varType::weight) {
277 }
else if (varid == varType::phi) {
278 return mapping->getCellIdToPhi(caldigitSelected->getCellId());
279 }
else if (varid == varType::theta) {
280 return mapping->getCellIdToTheta(caldigitSelected->getCellId());
281 }
else if (varid == varType::R_geom) {
282 return getCellIdMagnitude(caldigitSelected->getCellId());
283 }
else if (varid == varType::twoComponentHadronEnergyFraction) {
284 if (caldigitSelected-> getTwoComponentTotalEnergy() > 0) {
285 return caldigitSelected->getTwoComponentHadronEnergy() / caldigitSelected->getTwoComponentTotalEnergy();
289 }
else if (varid == varType::fractionOfShowerEnergy) {
290 return digitEnergy / shower->getEnergy();
292 }
else if ((varid == varType::phiRelativeToShower) ||
293 (varid == varType::thetaRelativeToShower) ||
294 (varid == varType::cosThetaRelativeToShower) ||
295 (varid == varType::rRelativeToShower)) {
296 ECL::ECLGeometryPar* geometry = ECL::ECLGeometryPar::Instance();
297 B2Vector3D calDigitPosition = geometry->GetCrystalPos(caldigitSelected->getCellId() - 1);
299 showerPosition.
SetMagThetaPhi(shower->getR(), shower->getTheta(), shower->getPhi());
301 ROOT::Math::XYZVector tempP = showerPosition - calDigitPosition;
302 if (varid == varType::rRelativeToShower)
return tempP.R();
303 if (varid == varType::thetaRelativeToShower)
return tempP.Theta();
304 if (varid == varType::cosThetaRelativeToShower)
return tempP.Z() / tempP.R();
305 if (varid == varType::phiRelativeToShower)
return tempP.Phi();
307 B2FATAL(
"variable id not found.");
309 return std::numeric_limits<double>::quiet_NaN();
313 double getCalDigitExpert(
const Particle* particle,
const std::vector<double>& vars)
315 if (vars.size() != 4) {
316 B2FATAL(
"Need exactly four parameters (cellid, neighbour area size, variable id, and cluster center (0) or ext (1)).");
319 StoreObjPtr<ECLCellIdMapping> mapping;
320 const unsigned int posid = int(std::lround(vars[0]));
322 const int nneighbours = int(std::lround(vars[1]));
323 const int varid = int(std::lround(vars[2]));
324 const int extid = int(std::lround(vars[3]));
327 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
328 return std::numeric_limits<double>::quiet_NaN();
330 if (nneighbours != 5 and nneighbours != 7 and nneighbours != 9 and nneighbours != 11) {
331 B2FATAL(
"Please request 5, 7, 9 or 11 neighbour area.");
332 return std::numeric_limits<double>::quiet_NaN();
338 if (extid == centerType::extCell) {
339 maxCellId = getExtCell(particle);
341 maxCellId = getCenterCell(particle);
344 if (maxCellId < 0)
return std::numeric_limits<double>::quiet_NaN();
347 int neighbourid = -1;
348 std::vector<short int> neighbours;
350 if (nneighbours == 5) {
351 neighbours = mapping->getCellIdToNeighbour5(maxCellId);
352 }
else if (nneighbours == 7) {
353 neighbours = mapping->getCellIdToNeighbour7(maxCellId);
354 }
else if (nneighbours == 9) {
355 neighbours = mapping->getCellIdToNeighbour9(maxCellId);
356 }
else if (nneighbours == 11) {
357 neighbours = mapping->getCellIdToNeighbour11(maxCellId);
360 if (posid < neighbours.size()) {
361 neighbourid = neighbours[posid];
363 B2WARNING(
"This position id is not contained in the requested neighbours.");
364 return std::numeric_limits<double>::quiet_NaN();
368 if (varid == varType::phi) {
369 return mapping->getCellIdToPhi(neighbourid);
370 }
else if (varid == varType::theta) {
371 return mapping->getCellIdToTheta(neighbourid);
372 }
else if (varid == varType::R_geom) {
373 return getCellIdMagnitude(neighbourid);
374 }
else if (varid == varType::phiId) {
375 return mapping->getCellIdToPhiId(neighbourid);
376 }
else if (varid == varType::thetaId) {
377 return mapping->getCellIdToThetaId(neighbourid);
378 }
else if (varid == varType::cellId) {
383 const int storearraypos = mapping->getCellIdToStoreArray(neighbourid);
384 StoreArray<ECLCalDigit> eclCalDigits;
386 if (storearraypos >= 0) {
387 if (varid == varType::energy) {
388 return eclCalDigits[storearraypos]->getEnergy();
389 }
else if (varid == varType::weight) {
390 const ECLCluster* cluster = particle->getECLCluster();
391 if (cluster ==
nullptr) {
return std::numeric_limits<double>::quiet_NaN();}
393 auto relatedDigits = cluster->getRelationsTo<ECLCalDigit>();
394 for (
unsigned int iDigit = 0; iDigit < relatedDigits.size(); iDigit++) {
395 const auto caldigit = relatedDigits.object(iDigit);
396 const int digitCellID = caldigit->getCellId();
397 if (digitCellID == neighbourid) {
398 weight = relatedDigits.weight(iDigit);
404 }
else if (varid == varType::time) {
405 return eclCalDigits[storearraypos]->getTime();
406 }
else if (varid == varType::timeResolution) {
407 return eclCalDigits[storearraypos]->getTimeResolution();
408 }
else if (varid == varType::twoComponentChi2) {
409 return eclCalDigits[storearraypos]->getTwoComponentChi2();
410 }
else if (varid == varType::twoComponentTotalEnergy) {
411 return eclCalDigits[storearraypos]->getTwoComponentTotalEnergy();
412 }
else if (varid == varType::twoComponentHadronEnergy) {
413 return eclCalDigits[storearraypos]->getTwoComponentHadronEnergy();
414 }
else if (varid == varType::twoComponentSavedChi2_PhotonHadron) {
415 return eclCalDigits[storearraypos]->getTwoComponentSavedChi2(ECLDsp::photonHadron);
416 }
else if (varid == varType::twoComponentSavedChi2_PileUpPhoton) {
417 return eclCalDigits[storearraypos]->getTwoComponentSavedChi2(ECLDsp::photonHadronBackgroundPhoton);
418 }
else if (varid == varType::twoComponentSavedChi2_PhotonDiode) {
419 return eclCalDigits[storearraypos]->getTwoComponentSavedChi2(ECLDsp::photonDiodeCrossing);
420 }
else if (varid == varType::twoComponentDiodeEnergy) {
421 return eclCalDigits[storearraypos]->getTwoComponentDiodeEnergy();
422 }
else if (varid == varType::twoComponentFitType) {
423 return int(eclCalDigits[storearraypos]->getTwoComponentFitType());
424 }
else if (varid == varType::mcenergy) {
426 auto digitMCRelations = eclCalDigits[storearraypos]->getRelationsTo<MCParticle>();
428 for (
unsigned int i = 0; i < digitMCRelations.size(); ++i) {
429 edep += digitMCRelations.weight(i);
432 }
else if (varid == varType::usedforenergy) {
433 const ECLCluster* cluster = particle->getECLCluster();
436 unsigned int cellid = eclCalDigits[storearraypos]->getCellId();
437 std::vector<unsigned int> listCellIds;
439 auto clusterShowerRelations = cluster->getRelationsWith<ECLShower>();
441 if (clusterShowerRelations.size() == 1) {
442 listCellIds = clusterShowerRelations.object(0)->getListOfCrystalsForEnergy();
444 B2ERROR(
"Somehow found more than 1 ECLShower matched to the ECLCluster. This should not be possible!");
447 if (std::find(listCellIds.begin(), listCellIds.end(), cellid) != listCellIds.end()) {
453 return std::numeric_limits<double>::quiet_NaN();
457 return std::numeric_limits<double>::quiet_NaN();
461 return std::numeric_limits<double>::quiet_NaN();
464 double getExtCellExpert(
const Particle* particle,
int varid,
bool front)
466 ECL::ECLGeometryPar* geometry = ECL::ECLGeometryPar::Instance();
468 B2ERROR(
"Geometry not found!");
469 return std::numeric_limits<double>::quiet_NaN();
471 const Track* track = particle->getTrack();
473 ExtHit* edgeExtHit =
nullptr;
475 for (
const auto& extHit : track->getRelationsTo<ExtHit>()) {
476 if (extHit.getDetectorID() != Const::EDetector::ECL)
continue;
477 if (extHit.getStatus() != EXT_ENTER)
continue;
478 int crystalID = extHit.getCopyID() - 1;
479 if (crystalID == -1)
continue;
480 edgeExtHit =
new ExtHit(extHit);
484 auto extHits = track->getRelationsTo<ExtHit>();
485 for (
unsigned int iextHit(extHits.size() - 1); iextHit > 0; --iextHit) {
486 const auto extHit = extHits[iextHit];
487 if (extHit->getDetectorID() != Const::EDetector::ECL)
continue;
488 if (extHit->getStatus() != EXT_EXIT)
continue;
489 int crystalID = extHit->getCopyID() - 1;
490 if (crystalID == -1)
break;
491 edgeExtHit =
new ExtHit(*extHit);
496 if (!edgeExtHit)
return std::numeric_limits<double>::quiet_NaN();
497 const ROOT::Math::XYZVector& extHitPosition = edgeExtHit->getPosition();
498 const ROOT::Math::XYZVector& trackPointing = edgeExtHit->getMomentum();
500 geometry->Mapping(edgeExtHit->getCopyID() - 1);
501 const int thetaID = geometry->GetThetaID();
502 const int phiID = geometry->GetPhiID();
503 const int cellID = geometry->GetCellID(thetaID, phiID);
505 const ROOT::Math::XYZVector& crystalCenterPosition =
506 geometry->GetCrystalPos(cellID);
507 const ROOT::Math::XYZVector& crystalOrientation =
508 geometry->GetCrystalVec(cellID);
509 const ROOT::Math::XYZVector& crystalPositionOnSurface =
510 crystalCenterPosition -
511 (crystalCenterPosition - extHitPosition).Dot(
512 crystalOrientation.Unit()) * crystalOrientation.Unit();
513 if (varid == varType::phiOffset) {
514 return ROOT::Math::VectorUtil::Phi_mpi_pi(extHitPosition.Phi() - crystalPositionOnSurface.Phi());
515 }
else if (varid == varType::thetaOffset) {
516 return extHitPosition.Theta() - crystalPositionOnSurface.Theta();
517 }
else if (varid == varType::phiPointing) {
518 return ROOT::Math::VectorUtil::Phi_mpi_pi(trackPointing.Phi() - crystalOrientation.Phi());
519 }
else if (varid == varType::thetaPointing) {
520 return trackPointing.Theta() - crystalOrientation.Theta();
524 return std::numeric_limits<double>::quiet_NaN();
531 double getECLCalDigitEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
534 if (vars.size() != 1) {
535 B2FATAL(
"Need exactly one parameter (energy index).");
537 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::energy};
538 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
542 double getECLCalDigitTimeByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
544 if (vars.size() != 1) {
545 B2FATAL(
"Need exactly one parameters (energy index).");
547 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::time};
548 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
552 double getECLCalDigitMCEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
554 if (vars.size() != 1) {
555 B2FATAL(
"Need exactly one parameters (energy index).");
557 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::mcenergy};
558 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
562 double getCellIdByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
564 if (vars.size() != 1) {
565 B2FATAL(
"Need exactly one parameters (energy index).");
567 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::cellId};
568 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
572 double getTwoComponentFitTypeByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
574 if (!((vars.size() == 1) || (vars.size() == 2))) {
575 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
577 double onlyGoodQualityPSDFits = 0.0;
578 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
580 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentFitType, onlyGoodQualityPSDFits};
581 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
585 double getTwoComponentChi2ByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
587 if (!((vars.size() == 1) || (vars.size() == 2))) {
588 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
590 double onlyGoodQualityPSDFits = 0.0;
591 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
593 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentChi2, onlyGoodQualityPSDFits};
594 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
598 double getTwoComponentTotalEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
600 if (!((vars.size() == 1) || (vars.size() == 2))) {
601 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
603 double onlyGoodQualityPSDFits = 0.0;
604 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
606 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentTotalEnergy, onlyGoodQualityPSDFits};
607 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
611 double getTwoComponentHadronEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
613 if (!((vars.size() == 1) || (vars.size() == 2))) {
614 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
616 double onlyGoodQualityPSDFits = 0.0;
617 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
619 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentHadronEnergy, onlyGoodQualityPSDFits};
620 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
624 double getTwoComponentHadronEnergyFractionByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
626 if (!((vars.size() == 1) || (vars.size() == 2))) {
627 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
629 double onlyGoodQualityPSDFits = 0.0;
630 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
632 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentHadronEnergyFraction, onlyGoodQualityPSDFits};
633 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
637 double getTwoComponentDiodeEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
639 if (!((vars.size() == 1) || (vars.size() == 2))) {
640 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
642 double onlyGoodQualityPSDFits = 0.0;
643 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
645 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentDiodeEnergy, onlyGoodQualityPSDFits};
646 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
650 double getTwoComponentChi2SavedByEnergyRank_PhotonHadron(
const Particle* particle,
const std::vector<double>& vars)
652 if (!((vars.size() == 1) || (vars.size() == 2))) {
653 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
655 double onlyGoodQualityPSDFits = 0.0;
656 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
658 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonHadron, onlyGoodQualityPSDFits};
659 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
663 double getTwoComponentChi2SavedByEnergyRank_PileUpPhoton(
const Particle* particle,
const std::vector<double>& vars)
665 if (!((vars.size() == 1) || (vars.size() == 2))) {
666 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
668 double onlyGoodQualityPSDFits = 0.0;
669 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
671 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentSavedChi2_PileUpPhoton, onlyGoodQualityPSDFits};
672 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
676 double getTwoComponentChi2SavedByEnergyRank_PhotonDiode(
const Particle* particle,
const std::vector<double>& vars)
678 if (!((vars.size() == 1) || (vars.size() == 2))) {
679 B2FATAL(
"Need one or two parameters (energy index, [onlyGoodQualityPSDFits]).");
681 double onlyGoodQualityPSDFits = 0.0;
682 if (vars.size() == 2) {onlyGoodQualityPSDFits = std::lround(vars[1]);}
684 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonDiode, onlyGoodQualityPSDFits};
685 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
689 double getWeightByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
691 if (vars.size() != 1) {
692 B2FATAL(
"Need exactly one parameters (energy index).");
694 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::weight};
695 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
699 double getECLCalDigitFractionOfShowerEnergyByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
701 if (vars.size() != 1) {
702 B2FATAL(
"Need exactly one parameters (energy index).");
704 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::fractionOfShowerEnergy};
705 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
709 double getECLCalDigitPhiRelativeToShowerByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
711 if (vars.size() != 1) {
712 B2FATAL(
"Need exactly one parameters (energy index).");
714 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::phiRelativeToShower};
715 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
719 double getECLCalDigitThetaRelativeToShowerByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
721 if (vars.size() != 1) {
722 B2FATAL(
"Need exactly one parameters (energy index).");
724 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::thetaRelativeToShower};
725 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
729 double getECLCalDigitCosThetaRelativeToShowerByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
731 if (vars.size() != 1) {
732 B2FATAL(
"Need exactly one parameters (energy index).");
734 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::cosThetaRelativeToShower};
735 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
739 double getECLCalDigitRadiusRelativeToShowerByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
741 if (vars.size() != 1) {
742 B2FATAL(
"Need exactly one parameters (energy index).");
744 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::rRelativeToShower};
745 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
749 double getECLCalDigitEnergy(
const Particle* particle,
const std::vector<double>& vars)
751 if (vars.size() != 2) {
752 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
755 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::energy, ECLCalDigitVariable::centerType::maxCell};
756 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
761 double getECLCalDigitWeight(
const Particle* particle,
const std::vector<double>& vars)
763 if (vars.size() != 2) {
764 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
767 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::weight, ECLCalDigitVariable::centerType::maxCell};
768 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
772 double getMCEnergy(
const Particle* particle,
const std::vector<double>& vars)
774 if (vars.size() != 2) {
775 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
778 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::mcenergy, ECLCalDigitVariable::centerType::maxCell};
779 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
784 double getExtECLCalDigitEnergy(
const Particle* particle,
const std::vector<double>& vars)
786 if (vars.size() != 2) {
787 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
790 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::energy, ECLCalDigitVariable::centerType::extCell};
791 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
796 double getECLCalDigitTime(
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::time, ECLCalDigitVariable::centerType::maxCell};
803 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
807 double getExtECLCalDigitTime(
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::time, ECLCalDigitVariable::centerType::extCell};
814 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
818 double getExtECLCalDigitTimeResolution(
const Particle* particle,
const std::vector<double>& vars)
820 if (vars.size() != 2) {
821 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
824 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::timeResolution, ECLCalDigitVariable::centerType::extCell};
825 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
829 double getECLCalDigitTimeResolution(
const Particle* particle,
const std::vector<double>& vars)
831 if (vars.size() != 2) {
832 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
835 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::timeResolution, ECLCalDigitVariable::centerType::maxCell};
836 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
840 double getTwoComponentChi2(
const Particle* particle,
const std::vector<double>& vars)
842 if (vars.size() != 2) {
843 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
846 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentChi2, ECLCalDigitVariable::centerType::maxCell};
847 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
851 double getExtECLCalDigitTwoComponentChi2(
const Particle* particle,
const std::vector<double>& vars)
853 if (vars.size() != 2) {
854 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
857 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentChi2, ECLCalDigitVariable::centerType::extCell};
858 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
862 double getTwoComponentTotalEnergy(
const Particle* particle,
const std::vector<double>& vars)
864 if (vars.size() != 2) {
865 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
868 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentTotalEnergy, ECLCalDigitVariable::centerType::maxCell};
869 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
873 double getExtECLCalDigitTwoComponentTotalEnergy(
const Particle* particle,
const std::vector<double>& vars)
875 if (vars.size() != 2) {
876 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
879 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentTotalEnergy, ECLCalDigitVariable::centerType::extCell};
880 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
884 double getTwoComponentHadronEnergy(
const Particle* particle,
const std::vector<double>& vars)
886 if (vars.size() != 2) {
887 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
890 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentHadronEnergy, ECLCalDigitVariable::centerType::maxCell};
891 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
895 double getUsedForClusterEnergy(
const Particle* particle,
const std::vector<double>& vars)
897 if (vars.size() != 2) {
898 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
901 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::usedforenergy, ECLCalDigitVariable::centerType::maxCell};
902 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
906 double getExtECLCalDigitTwoComponentHadronEnergy(
const Particle* particle,
const std::vector<double>& vars)
908 if (vars.size() != 2) {
909 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
912 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentHadronEnergy, ECLCalDigitVariable::centerType::extCell};
913 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
917 double getECLCalDigitTwoComponentDiodeEnergy(
const Particle* particle,
const std::vector<double>& vars)
919 if (vars.size() != 2) {
920 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
923 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentDiodeEnergy, ECLCalDigitVariable::centerType::maxCell};
924 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
928 double getExtECLCalDigitTwoComponentDiodeEnergy(
const Particle* particle,
const std::vector<double>& vars)
930 if (vars.size() != 2) {
931 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
934 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentDiodeEnergy, ECLCalDigitVariable::centerType::extCell};
935 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
939 double getECLCalDigitTwoComponentFitType(
const Particle* particle,
const std::vector<double>& vars)
941 if (vars.size() != 2) {
942 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
945 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentFitType, ECLCalDigitVariable::centerType::maxCell};
946 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
950 double getExtECLCalDigitTwoComponentFitType(
const Particle* particle,
const std::vector<double>& vars)
952 if (vars.size() != 2) {
953 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
956 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentFitType, ECLCalDigitVariable::centerType::extCell};
957 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
961 double getECLCalDigitTwoComponentChi2Saved_PhotonHadron(
const Particle* particle,
const std::vector<double>& vars)
963 if (vars.size() != 2) {
964 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
967 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonHadron, ECLCalDigitVariable::centerType::maxCell};
968 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
972 double getExtECLCalDigitTwoComponentChi2Saved_PhotonHadron(
const Particle* particle,
const std::vector<double>& vars)
974 if (vars.size() != 2) {
975 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
978 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonHadron, ECLCalDigitVariable::centerType::extCell};
979 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
983 double getECLCalDigitTwoComponentChi2Saved_PileUpPhoton(
const Particle* particle,
const std::vector<double>& vars)
985 if (vars.size() != 2) {
986 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
989 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PileUpPhoton, ECLCalDigitVariable::centerType::maxCell};
990 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
994 double getExtECLCalDigitTwoComponentChi2Saved_PileUpPhoton(
const Particle* particle,
const std::vector<double>& vars)
996 if (vars.size() != 2) {
997 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1000 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PileUpPhoton, ECLCalDigitVariable::centerType::extCell};
1001 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1005 double getECLCalDigitTwoComponentChi2Saved_PhotonDiode(
const Particle* particle,
const std::vector<double>& vars)
1007 if (vars.size() != 2) {
1008 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1011 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonDiode, ECLCalDigitVariable::centerType::maxCell};
1012 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1016 double getExtECLCalDigitTwoComponentChi2Saved_PhotonDiode(
const Particle* particle,
const std::vector<double>& vars)
1018 if (vars.size() != 2) {
1019 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1022 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::twoComponentSavedChi2_PhotonDiode, ECLCalDigitVariable::centerType::extCell};
1023 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1027 double getPhi(
const Particle* particle,
const std::vector<double>& vars)
1029 if (vars.size() != 2) {
1030 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1033 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phi, ECLCalDigitVariable::centerType::maxCell};
1034 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1038 double getExtPhi(
const Particle* particle,
const std::vector<double>& vars)
1040 if (vars.size() != 2) {
1041 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1044 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phi, ECLCalDigitVariable::centerType::extCell};
1045 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1049 double getTheta(
const Particle* particle,
const std::vector<double>& vars)
1051 if (vars.size() != 2) {
1052 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1055 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::theta, ECLCalDigitVariable::centerType::maxCell};
1056 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1060 double getExtTheta(
const Particle* particle,
const std::vector<double>& vars)
1062 if (vars.size() != 2) {
1063 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1066 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::theta, ECLCalDigitVariable::centerType::extCell};
1067 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1071 double getPhiId(
const Particle* particle,
const std::vector<double>& vars)
1073 if (vars.size() != 2) {
1074 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1077 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phiId, ECLCalDigitVariable::centerType::maxCell};
1078 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1082 double getExtPhiId(
const Particle* particle,
const std::vector<double>& vars)
1084 if (vars.size() != 2) {
1085 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1088 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::phiId, ECLCalDigitVariable::centerType::extCell};
1089 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1093 double getThetaId(
const Particle* particle,
const std::vector<double>& vars)
1095 if (vars.size() != 2) {
1096 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1099 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::thetaId, ECLCalDigitVariable::centerType::maxCell};
1100 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1104 double getExtThetaId(
const Particle* particle,
const std::vector<double>& vars)
1106 if (vars.size() != 2) {
1107 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1110 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::thetaId, ECLCalDigitVariable::centerType::extCell};
1111 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1115 double getCellId(
const Particle* particle,
const std::vector<double>& vars)
1117 if (vars.size() != 2) {
1118 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1121 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::cellId, ECLCalDigitVariable::centerType::maxCell};
1122 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1126 double getCenterCellId(
const Particle* particle)
1128 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
1130 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1131 return centercellid;
1135 double getCenterCellCrystalTheta(
const Particle* particle)
1137 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
1138 StoreObjPtr<ECLCellIdMapping> mapping;
1141 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1142 return std::numeric_limits<double>::quiet_NaN();
1145 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1146 return mapping->getCellIdToTheta(centercellid);
1150 double getCenterCellCrystalPhi(
const Particle* particle)
1152 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
1153 StoreObjPtr<ECLCellIdMapping> mapping;
1156 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1157 return std::numeric_limits<double>::quiet_NaN();
1160 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1161 return mapping->getCellIdToPhi(centercellid);
1165 double getExtCellId(
const Particle* particle)
1167 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
1169 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1174 double getCenterCellThetaId(
const Particle* particle)
1176 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
1177 StoreObjPtr<ECLCellIdMapping> mapping;
1180 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1181 return std::numeric_limits<double>::quiet_NaN();
1184 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1185 return mapping->getCellIdToThetaId(centercellid);
1189 double getCenterCellPhiId(
const Particle* particle)
1191 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
1192 StoreObjPtr<ECLCellIdMapping> mapping;
1195 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1196 return std::numeric_limits<double>::quiet_NaN();
1199 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1200 return mapping->getCellIdToPhiId(centercellid);
1204 double getExtCellThetaId(
const Particle* particle)
1206 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
1207 StoreObjPtr<ECLCellIdMapping> mapping;
1210 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1211 return std::numeric_limits<double>::quiet_NaN();
1214 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1215 return mapping->getCellIdToThetaId(extcellid);
1219 double getExtCellPhiId(
const Particle* particle)
1221 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
1222 StoreObjPtr<ECLCellIdMapping> mapping;
1225 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1226 return std::numeric_limits<double>::quiet_NaN();
1229 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1230 return mapping->getCellIdToPhiId(extcellid);
1234 double getExtCellCrystalTheta(
const Particle* particle)
1236 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
1237 StoreObjPtr<ECLCellIdMapping> mapping;
1240 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1241 return std::numeric_limits<double>::quiet_NaN();
1244 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1245 return mapping->getCellIdToTheta(extcellid);
1249 double getExtCellCrystalPhi(
const Particle* particle)
1251 const int extcellid = ECLCalDigitVariable::getExtCell(particle);
1252 StoreObjPtr<ECLCellIdMapping> mapping;
1255 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1256 return std::numeric_limits<double>::quiet_NaN();
1259 if (extcellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1260 return mapping->getCellIdToPhi(extcellid);
1264 double getCenterCellIndex(
const Particle* particle,
const std::vector<double>& vars)
1266 if (vars.size() != 1) {
1267 B2FATAL(
"Need exactly one parameters (neighbour area size).");
1270 StoreObjPtr<ECLCellIdMapping> mapping;
1271 const int nneighbours = int(std::lround(vars[0]));
1274 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1275 return std::numeric_limits<double>::quiet_NaN();
1277 if (nneighbours != 5 and nneighbours != 7 and nneighbours != 9 and nneighbours != 11) {
1278 B2FATAL(
"Please request 5, 7, 9 or 11 neighbour area.");
1279 return std::numeric_limits<double>::quiet_NaN();
1282 const int centercellid = ECLCalDigitVariable::getCenterCell(particle);
1283 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1285 std::vector<short int> neighbours;
1287 if (nneighbours == 5) {
1288 neighbours = mapping->getCellIdToNeighbour5(centercellid);
1289 }
else if (nneighbours == 7) {
1290 neighbours = mapping->getCellIdToNeighbour7(centercellid);
1291 }
else if (nneighbours == 9) {
1292 neighbours = mapping->getCellIdToNeighbour9(centercellid);
1293 }
else if (nneighbours == 11) {
1294 neighbours = mapping->getCellIdToNeighbour11(centercellid);
1297 for (
unsigned int idx = 0; idx < neighbours.size(); idx++) {
1298 if (neighbours[idx] == centercellid)
return idx;
1301 return std::numeric_limits<double>::quiet_NaN();
1306 double getExtCenterCellIndex(
const Particle* particle,
const std::vector<double>& vars)
1308 if (vars.size() != 1) {
1309 B2FATAL(
"Need exactly one parameters (neighbour area size).");
1312 StoreObjPtr<ECLCellIdMapping> mapping;
1313 const int nneighbours = int(std::lround(vars[0]));
1316 B2ERROR(
"Mapping not found, did you forget to run the eclFillCellIdMapping module?");
1317 return std::numeric_limits<double>::quiet_NaN();
1319 if (nneighbours != 5 and nneighbours != 7 and nneighbours != 9 and nneighbours != 11) {
1320 B2FATAL(
"Please request 5, 7, 9 or 11 neighbour area.");
1321 return std::numeric_limits<double>::quiet_NaN();
1324 const int centercellid = ECLCalDigitVariable::getExtCell(particle);
1325 if (centercellid < 0)
return std::numeric_limits<double>::quiet_NaN();
1327 std::vector<short int> neighbours;
1329 if (nneighbours == 5) {
1330 neighbours = mapping->getCellIdToNeighbour5(centercellid);
1331 }
else if (nneighbours == 7) {
1332 neighbours = mapping->getCellIdToNeighbour7(centercellid);
1333 }
else if (nneighbours == 9) {
1334 neighbours = mapping->getCellIdToNeighbour9(centercellid);
1335 }
else if (nneighbours == 11) {
1336 neighbours = mapping->getCellIdToNeighbour11(centercellid);
1339 for (
unsigned int idx = 0; idx < neighbours.size(); idx++) {
1340 if (neighbours[idx] == centercellid)
return idx;
1343 return std::numeric_limits<double>::quiet_NaN();
1346 double getTotalECLCalDigitMCEnergy(
const Particle* particle)
1348 const MCParticle* mcparticle = particle->getRelatedTo<MCParticle>();
1349 if (mcparticle ==
nullptr)
1350 return std::numeric_limits<double>::quiet_NaN();
1353 auto mcDigitRelations = mcparticle->getRelationsWith<ECLCalDigit>();
1354 for (
unsigned int ir = 0; ir < mcDigitRelations.size(); ++ir) {
1355 sum += mcDigitRelations.weight(ir);
1361 double getClusterTotalECLCalDigitMCEnergy(
const Particle* particle)
1363 const ECLCluster* cluster = particle->getECLCluster();
1364 if (cluster ==
nullptr) {
return std::numeric_limits<double>::quiet_NaN();}
1365 const MCParticle* mcparticle = particle->getRelatedTo<MCParticle>();
1366 if (mcparticle ==
nullptr) {
return std::numeric_limits<double>::quiet_NaN();}
1369 auto relatedDigits = cluster->getRelationsTo<ECLCalDigit>();
1370 for (
unsigned int iDigit = 0; iDigit < relatedDigits.size(); iDigit++) {
1371 const auto caldigit = relatedDigits.object(iDigit);
1372 auto mcDigitRelations = caldigit->getRelationsTo<MCParticle>();
1373 for (
unsigned int i = 0; i < mcDigitRelations.size(); i++) {
1374 const MCParticle* digitmcparticle = mcDigitRelations.object(i);
1375 if (digitmcparticle == mcparticle) {
1376 sum += mcDigitRelations.weight(i);
1384 double getClusterECLCalDigitMCEnergy(
const Particle* particle)
1387 const MCParticle* mcparticle = particle->getRelatedTo<MCParticle>();
1388 if (mcparticle ==
nullptr)
1389 return std::numeric_limits<double>::quiet_NaN();
1391 const ECLCluster* cluster = particle->getECLCluster();
1393 std::vector<unsigned int> listCellIds;
1394 auto clusterShowerRelations = cluster->getRelationsWith<ECLShower>();
1395 if (clusterShowerRelations.size() == 1) {
1396 listCellIds = clusterShowerRelations.object(0)->getListOfCrystalsForEnergy();
1398 B2ERROR(
"Somehow found more than 1 ECLShower matched to the ECLCluster. This should not be possible!");
1402 auto clusterDigitRelations = mcparticle->getRelationsWith<ECLCalDigit>();
1403 for (
unsigned int ir = 0; ir < clusterDigitRelations.size(); ++ir) {
1406 unsigned int cellid = clusterDigitRelations.object(ir)->getCellId();
1407 if (std::find(listCellIds.begin(), listCellIds.end(), cellid) != listCellIds.end()) {
1408 sum += clusterDigitRelations.weight(ir);
1414 return std::numeric_limits<float>::quiet_NaN();
1417 double getExtFrontPositionPhiOffset(
const Particle* particle)
1419 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::phiOffset,
true);
1422 double getExtFrontPositionThetaOffset(
const Particle* particle)
1424 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::thetaOffset,
true);
1427 double getExtFrontPositionPhiPointing(
const Particle* particle)
1429 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::phiPointing,
true);
1432 double getExtFrontPositionThetaPointing(
const Particle* particle)
1434 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::thetaPointing,
true);
1437 double getExtBackPositionPhiOffset(
const Particle* particle)
1439 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::phiOffset,
false);
1442 double getExtBackPositionThetaOffset(
const Particle* particle)
1444 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::thetaOffset,
false);
1447 double getExtBackPositionPhiPointing(
const Particle* particle)
1449 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::phiPointing,
false);
1452 double getExtBackPositionThetaPointing(
const Particle* particle)
1454 return ECLCalDigitVariable::getExtCellExpert(particle, ECLCalDigitVariable::varType::thetaPointing,
false);
1458 double getPhiByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
1460 if (vars.size() != 1) {
1461 B2FATAL(
"Need exactly one parameters (energy index).");
1463 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::phi};
1464 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
1468 double getThetaByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
1470 if (vars.size() != 1) {
1471 B2FATAL(
"Need exactly one parameters (energy index).");
1473 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::theta};
1474 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
1478 double getR(
const Particle* particle,
const std::vector<double>& vars)
1480 if (vars.size() != 2) {
1481 B2FATAL(
"Need exactly two parameters (cellid and neighbour area size).");
1484 std::vector<double> parameters {vars[0], vars[1], ECLCalDigitVariable::varType::R_geom, ECLCalDigitVariable::centerType::maxCell};
1485 return ECLCalDigitVariable::getCalDigitExpert(particle, parameters);
1489 double getRByEnergyRank(
const Particle* particle,
const std::vector<double>& vars)
1491 if (vars.size() != 1) {
1492 B2FATAL(
"Need exactly one parameters (energy index).");
1494 std::vector<double> parameters {vars[0], ECLCalDigitVariable::varType::R_geom};
1495 return ECLCalDigitVariable::getCalDigitExpertByEnergyRank(particle, parameters);
1498 double getClusterNHitsThreshold(
const Particle* particle,
const std::vector<double>& vars)
1500 if (vars.size() != 1) {
1501 B2FATAL(
"Need exactly one parameter (energy threshold in GeV).");
1503 const double threshold = vars[0];
1505 const ECLCluster* cluster = particle->getECLCluster();
1509 auto clusterDigitRelations = cluster->getRelationsTo<ECLCalDigit>();
1510 for (
unsigned int ir = 0; ir < clusterDigitRelations.size(); ++ir) {
1511 const auto calDigit = clusterDigitRelations.object(ir);
1512 const auto weight = clusterDigitRelations.weight(ir);
1515 if (calDigit->getEnergy() > threshold) {
1522 return std::numeric_limits<float>::quiet_NaN();
1526 VARIABLE_GROUP(
"ECL Calibration (cDST)");
1527 REGISTER_VARIABLE(
"eclcaldigitEnergy(i, j)", getECLCalDigitEnergy,
1528 "[calibration] Returns the energy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1529 REGISTER_VARIABLE(
"eclcaldigitWeight(i, j)", getECLCalDigitWeight,
1530 "[calibration] Returns the weight of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1531 REGISTER_VARIABLE(
"eclcaldigitTime(i, j)", getECLCalDigitTime,
1532 "[calibration] Returns the time of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1533 REGISTER_VARIABLE(
"eclcaldigitTimeResolution(i, j)", getECLCalDigitTimeResolution,
1534 "[calibration] Returns the time resolution (dt99) of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1535 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2(i, j)", getTwoComponentChi2,
1536 "[calibration] Returns the two component fit chi2 of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1537 REGISTER_VARIABLE(
"eclcaldigitTwoComponentTotalEnergy(i, j)", getTwoComponentTotalEnergy,
1538 "[calibration] Returns the two component total energy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1539 REGISTER_VARIABLE(
"eclcaldigitTwoComponentHadronEnergy(i, j)", getTwoComponentHadronEnergy,
1540 "[calibration] Returns the two component hadron energy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1541 REGISTER_VARIABLE(
"eclcaldigitPhi(i, j)", getPhi,
1542 "[calibration] Returns phi of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1543 REGISTER_VARIABLE(
"eclcaldigitTheta(i, j)", getTheta,
1544 "[calibration] Returns theta of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1545 REGISTER_VARIABLE(
"eclcaldigitR(i, j)", getR,
1546 "Returns R (from a geometry object) of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1547 REGISTER_VARIABLE(
"eclcaldigitPhiId(i, j)", getPhiId,
1548 "[calibration] Returns the phi Id of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1549 REGISTER_VARIABLE(
"eclcaldigitThetaId(i, j)", getThetaId,
1550 "[calibration] Returns the theta Id of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1551 REGISTER_VARIABLE(
"eclcaldigitCellId(i, j)", getCellId,
1552 "[calibration] Returns the cell id of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours (1-based)");
1553 REGISTER_VARIABLE(
"eclcaldigitUsedForClusterEnergy(i, j)", getUsedForClusterEnergy,
1554 " [calibration] Returns the 0 (not used) 1 (used) of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours (1-based)");
1556 REGISTER_VARIABLE(
"eclcaldigitCenterCellId", getCenterCellId,
"[calibration] Returns the center cell id");
1557 REGISTER_VARIABLE(
"eclcaldigitCenterCellThetaId", getCenterCellThetaId,
"[calibration] Returns the center cell theta id");
1558 REGISTER_VARIABLE(
"eclcaldigitCenterCellPhiId", getCenterCellPhiId,
"[calibration] Returns the center cell phi id");
1559 REGISTER_VARIABLE(
"eclcaldigitCenterCellCrystalTheta", getCenterCellCrystalTheta,
1560 "[calibration] Returns the center cell crystal theta");
1561 REGISTER_VARIABLE(
"eclcaldigitCenterCellCrystalPhi", getCenterCellCrystalPhi,
1562 "[calibration] Returns the center cell crystal phi");
1563 REGISTER_VARIABLE(
"eclcaldigitCenterCellIndex(i)", getCenterCellIndex,
1564 "[calibration] Returns the center cell index (within its 5x5 (i=5), 7x7 (i=7), 9x9 (i=9) or 11x11 (i=11) neighbours neighbours)");
1565 REGISTER_VARIABLE(
"eclcaldigitMCEnergy(i, j)", getMCEnergy,
1566 "[calibration] Returns the true deposited energy of all particles of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours (1-based)");
1567 REGISTER_VARIABLE(
"clusterNHitsThreshold(i)", getClusterNHitsThreshold,
1568 "[calibration] Returns sum of crystal weights sum(w_i) with w_i<=1 associated to this cluster above threshold (in GeV)");
1570 VARIABLE_GROUP(
"ECL Calibration (based on extrapolated tracks) (cDST)");
1571 REGISTER_VARIABLE(
"eclcaldigitExtEnergy(i, j)", getExtECLCalDigitEnergy,
1572 "[calibration] Returns the energy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1573 REGISTER_VARIABLE(
"eclcaldigitExtTime(i, j)", getExtECLCalDigitTime,
1574 "[calibration] Returns the time of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1575 REGISTER_VARIABLE(
"eclcaldigitExtTimeResolution(i, j)", getExtECLCalDigitTimeResolution,
1576 "[calibration] Returns the time resolution (dt99) of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1577 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentTotalEnergy(i, j)", getExtECLCalDigitTwoComponentTotalEnergy,
1578 "[calibration] Returns the TwoComponentTotalEnergy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1579 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentHadronEnergy(i, j)", getExtECLCalDigitTwoComponentHadronEnergy,
1580 "[calibration] Returns the TwoComponentHadronEnergy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1581 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2(i, j)", getExtECLCalDigitTwoComponentChi2,
1582 "[calibration] Returns the TwoComponentchi2 of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1583 REGISTER_VARIABLE(
"eclcaldigitExtPhi(i, j)", getExtPhi,
1584 "[calibration] Returns phi of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an extrapolated track");
1585 REGISTER_VARIABLE(
"eclcaldigitExtTheta(i, j)", getExtTheta,
1586 "[calibration] Returns theta of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an extrapolated track");
1587 REGISTER_VARIABLE(
"eclcaldigitExtPhiId(i, j)", getExtPhiId,
1588 "[calibration] Returns the phi Id of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11)) neighbours for an extrapolated track");
1589 REGISTER_VARIABLE(
"eclcaldigitExtThetaId(i, j)", getExtThetaId,
1590 "[calibration] Returns the theta Id of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an extrapolated track");
1591 REGISTER_VARIABLE(
"eclcaldigitExtCellId", getExtCellId,
"[calibration] Returns the extrapolated cell id");
1592 REGISTER_VARIABLE(
"eclcaldigitExtCellThetaId", getExtCellThetaId,
"[calibration] Returns the ext cell theta id");
1593 REGISTER_VARIABLE(
"eclcaldigitExtCellPhiId", getExtCellPhiId,
"[calibration] Returns the ext cell phi id");
1594 REGISTER_VARIABLE(
"eclcaldigitExtCellCrystalTheta", getExtCellCrystalTheta,
"[calibration] Returns the ext cell crystal theta");
1595 REGISTER_VARIABLE(
"eclcaldigitExtCellCrystalPhi", getExtCellCrystalPhi,
"[calibration] Returns the ext cell crystal phi");
1596 REGISTER_VARIABLE(
"eclcaldigitExtCenterCellIndex(i)", getExtCenterCellIndex,
1597 "[calibration] Returns the center cell index (within its 5x5 (i=5), 7x7 (i=7), 9x9 (i=9) or 11x11 (i=11) neighbours) for an ext track");
1599 REGISTER_VARIABLE(
"eclcaldigitExtFrontPositionPhiOffset", getExtFrontPositionPhiOffset,
1600 "[calibration] Returns the difference in the azimuthal angle (in radians)"
1601 "between the position where the track hit the front face of the ECL and the"
1602 "center of the struck crystal projected onto the front surface.");
1603 REGISTER_VARIABLE(
"eclcaldigitExtFrontPositionThetaOffset", getExtFrontPositionThetaOffset,
1604 "[calibration] Returns the difference in the polar angle (in radians)"
1605 "between the position where the track hit the front face of the ECL and the"
1606 "center of the struck crystal projected onto the front surface.");
1607 REGISTER_VARIABLE(
"eclcaldigitExtFrontPositionPhiPointing", getExtFrontPositionPhiPointing,
1608 "[calibration] Returns the difference in the azimuthal angle (in radians)"
1609 "between the momentum direction when the track hit the front face of the ECL and the"
1610 "orientation of the struck crystal.");
1611 REGISTER_VARIABLE(
"eclcaldigitExtFrontPositionThetaPointing", getExtFrontPositionThetaPointing,
1612 "[calibration] Returns the difference in the polar angle (in radians)"
1613 "between the momentum direction when the track hit the front face of the ECL and the"
1614 "orientation of the struck crystal.");
1616 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentFitType(i, j)", getExtECLCalDigitTwoComponentFitType,
1617 "[calibration] Returns the TwoComponentFitType of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1618 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentDiodeEnergy(i, j)", getExtECLCalDigitTwoComponentDiodeEnergy,
1619 "[calibration] Returns the TwoComponentDiodeEnergy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1620 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2Saved_PhotonHadron(i, j)", getExtECLCalDigitTwoComponentChi2Saved_PhotonHadron,
1621 "[calibration] Returns the TwoComponentChi2Saved_PhotonHadron of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1622 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2Saved_PileUpPhoton(i, j)", getExtECLCalDigitTwoComponentChi2Saved_PileUpPhoton,
1623 "[calibration] Returns the TwoComponentChi2Saved_PileUpPhoton of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1624 REGISTER_VARIABLE(
"eclcaldigitExtTwoComponentChi2Saved_PhotonDiode(i, j)", getExtECLCalDigitTwoComponentChi2Saved_PhotonDiode,
1625 "[calibration] Returns the TwoComponentChi2Saved_PhotonDiode of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours for an ext track");
1627 REGISTER_VARIABLE(
"eclcaldigitTwoComponentFitType(i, j)", getECLCalDigitTwoComponentFitType,
1628 "[calibration] Returns the TwoComponentFitType of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1629 REGISTER_VARIABLE(
"eclcaldigitTwoComponentDiodeEnergy(i, j)", getECLCalDigitTwoComponentDiodeEnergy,
1630 "[calibration] Returns the TwoComponentDiodeEnergy of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1631 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2Saved_PhotonHadron(i, j)", getECLCalDigitTwoComponentChi2Saved_PhotonHadron,
1632 "[calibration] Returns the TwoComponentChi2Saved_PhotonHadron of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1633 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2Saved_PileUpPhoton(i, j)", getECLCalDigitTwoComponentChi2Saved_PileUpPhoton,
1634 "[calibration] Returns the TwoComponentChi2Saved_PileUpPhoton of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1635 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2Saved_PhotonDiode(i, j)", getECLCalDigitTwoComponentChi2Saved_PhotonDiode,
1636 "[calibration] Returns the TwoComponentChi2Saved_PhotonDiode of the i-th caldigit for 5x5 (j=5), 7x7 (j=7), 9x9 (j=9) or 11x11 (j=11) neighbours");
1638 REGISTER_VARIABLE(
"eclcaldigitEnergyByEnergyRank(i)", getECLCalDigitEnergyByEnergyRank,
1639 "[calibration/eclChargedPIDExpert] Returns the caldigit energy of the i-th highest energy caldigit in the cluster (i>=0)");
1641 REGISTER_VARIABLE(
"eclcaldigitTimeByEnergyRank(i)", getECLCalDigitTimeByEnergyRank,
1642 "[calibration] Returns the caldigit time of the i-th highest energy caldigit in the cluster (i>=0)");
1644 REGISTER_VARIABLE(
"eclcaldigitTwoComponentFitTypeByEnergyRank(i[, b])", getTwoComponentFitTypeByEnergyRank,
1645 "[calibration/eclChargedPIDExpert] Returns the offline fit type of the i-th highest energy caldigit in the cluster (i>=0). If b is set to 1.0 only caldigits considered to have good quality PSD fits return PSD information.");
1647 REGISTER_VARIABLE(
"eclcaldigitMCEnergyByEnergyRank(i)", getECLCalDigitMCEnergyByEnergyRank,
1648 "[calibration] Returns the caldigit MC Energy of the i-th highest energy caldigit in the cluster (i>=0)");
1650 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2ByEnergyRank(i[, b])", getTwoComponentChi2ByEnergyRank,
1651 "[calibration/eclChargedPIDExpert] Returns the two component chi2 of the i-th highest energy caldigit in the cluster (i>=0). If b is set to 1.0 only caldigits considered to have good quality PSD fits return PSD information.");
1653 REGISTER_VARIABLE(
"eclcaldigitTwoComponentEnergyByEnergyRank(i)", getTwoComponentTotalEnergyByEnergyRank,
1654 "[calibration] Returns the two component total energy of the i-th highest energy caldigit in the cluster (i>=0)");
1656 REGISTER_VARIABLE(
"eclcaldigitTwoComponentHadronEnergyByEnergyRank(i[, b])", getTwoComponentHadronEnergyByEnergyRank,
1657 "[calibration/eclChargedPIDExpert] Returns the two component fit Hadron Energy of the i-th highest energy caldigit in the cluster (i>=0). If b is set to 1.0 only caldigits considered to have good quality PSD fits return PSD information.");
1659 REGISTER_VARIABLE(
"eclcaldigitTwoComponentDiodeEnergyByEnergyRank(i[, b])", getTwoComponentDiodeEnergyByEnergyRank,
1660 "[calibration/eclChargedPIDExpert] Returns the two component fit Diode Energy of the i-th highest energy caldigit in the cluster (i>=0). If b is set to 1.0 only caldigits considered to have good quality PSD fits return PSD information.");
1662 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2SavedByEnergyRank_PhotonHadron(i)", getTwoComponentChi2SavedByEnergyRank_PhotonHadron,
1663 "[calibration] Returns the chi2 for the photo+hadron fit type of the i-th highest energy caldigit in the cluster (i>=0)");
1665 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2SavedByEnergyRank_PileUpPhoton(i)", getTwoComponentChi2SavedByEnergyRank_PileUpPhoton,
1666 "[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)");
1668 REGISTER_VARIABLE(
"eclcaldigitTwoComponentChi2SavedByEnergyRank_PhotonDiode(i)", getTwoComponentChi2SavedByEnergyRank_PhotonDiode,
1669 "[calibration] Returns the chi2 for the photo+diode fit type of the i-th highest energy caldigit in the cluster (i>=0)");
1671 REGISTER_VARIABLE(
"eclcaldigitWeightByEnergyRank(i)", getWeightByEnergyRank,
1672 "[calibration/eclChargedPIDExpert] Returns the weight of the i-th highest energy caldigit in the cluster (i>=0)");
1674 REGISTER_VARIABLE(
"eclcaldigitCellIdByEnergyRank(i)", getCellIdByEnergyRank,
1675 "[calibration] Returns the cell id of the i-th highest energy caldigit in the cluster (i>=0)");
1677 REGISTER_VARIABLE(
"totalECLCalDigitMCEnergy", getTotalECLCalDigitMCEnergy,
1678 "[calibration] Returns total deposited MC energy in all ECLCalDigits for the MC particle");
1680 REGISTER_VARIABLE(
"clusterTotalECLCalDigitMCEnergy", getClusterTotalECLCalDigitMCEnergy,
1681 "[calibration] Returns total MC energy deposited in ECLCalDigits in the cluster by the related MC particle");
1683 REGISTER_VARIABLE(
"clusterECLCalDigitMCEnergy", getClusterECLCalDigitMCEnergy,
1684 "[calibration] Returns total deposited MC energy in all ECLCalDigits for the MC particle that are used to calculate the cluster energy");
1686 REGISTER_VARIABLE(
"eclcaldigitPhiByEnergyRank(i)", getPhiByEnergyRank,
1687 "Returns phi of the i-th highest energy caldigit in the cluster (i>=0)");
1689 REGISTER_VARIABLE(
"eclcaldigitThetaByEnergyRank(i)", getThetaByEnergyRank,
1690 "Returns theta of the i-th highest energy caldigit in the cluster (i>=0)");
1692 REGISTER_VARIABLE(
"eclcaldigitRByEnergyRank(i)", getRByEnergyRank,
1693 "Returns R of the i-th highest energy caldigit in the cluster (i>=0)");
1695 REGISTER_VARIABLE(
"eclcaldigitTwoComponentHadronEnergyFractionByEnergyRank(i[, b])",
1696 getTwoComponentHadronEnergyFractionByEnergyRank,
1697 "[eclChargedPIDExpert] Returns the hadron energy fraction of the i-th highest energy caldigit in the cluster (i>=0). If b is set to 1.0 only caldigits considered to have good quality PSD fits return PSD information.");
1698 REGISTER_VARIABLE(
"eclcaldigitFractionOfTotalShowerEnergyByEnergyRank(i)", getECLCalDigitFractionOfShowerEnergyByEnergyRank,
1699 "[eclChargedPIDExpert] Returns the fraction of the total Shower energy in the i-th highest energy caldigit in the Shower (i>=0). Assumes a photon hypothesis.");
1700 REGISTER_VARIABLE(
"eclcaldigitPhiRelativeToShowerByEnergyRank(i)", getECLCalDigitPhiRelativeToShowerByEnergyRank,
1701 "[eclChargedPIDExpert] Returns phi of the vector joining the i-th highest energy caldigit in the Shower (i>=0) to the Shower center.");
1702 REGISTER_VARIABLE(
"eclcaldigitThetaRelativeToShowerByEnergyRank(i)", getECLCalDigitThetaRelativeToShowerByEnergyRank,
1703 "[eclChargedPIDExpert] Returns theta of the vector joining the i-th highest energy caldigit in the Shower (i>=0) to the Shower center.");
1704 REGISTER_VARIABLE(
"eclcaldigitCosThetaRelativeToShowerByEnergyRank(i)", getECLCalDigitCosThetaRelativeToShowerByEnergyRank,
1705 "[eclChargedPIDExpert] Returns cos(theta) of the vector joining the i-th highest energy caldigit in the Shower (i>=0) to the Shower center.");
1706 REGISTER_VARIABLE(
"eclcaldigitRadiusRelativeToShowerByEnergyRank(i)", getECLCalDigitRadiusRelativeToShowerByEnergyRank,
1707 "[eclChargedPIDExpert] Returns the magnitude of the vector joining the i-th highest energy caldigit in the Shower (i>=0) to the Shower center.");
void SetMagThetaPhi(DataType mag, DataType theta, DataType phi)
setter with mag, theta, phi
DataType Mag() const
The magnitude (rho in spherical coordinate system).
The Class for ECL Geometry Parameters.
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.