10 #include <analysis/VariableManager/Manager.h>
13 #include <framework/core/Module.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/datastore/StoreArray.h>
18 #include <mdst/dataobjects/ECLCluster.h>
20 #include <analysis/dataobjects/Particle.h>
21 #include <ecl/dataobjects/ECLShower.h>
34 double getShowerNumberOfCrystalsForEnergy(
const Particle* particle)
36 const ECLCluster* cluster = particle->getECLCluster();
38 double showerNumberOfCrystalsForEnergy = -1.0;
40 auto clusterShowerRelations = cluster->getRelationsWith<ECLShower>();
41 for (
unsigned int ir = 0; ir < clusterShowerRelations.size(); ++ir) {
42 const auto shower = clusterShowerRelations.object(ir);
44 showerNumberOfCrystalsForEnergy = shower->getNumberOfCrystalsForEnergy();
47 return showerNumberOfCrystalsForEnergy;
50 return std::numeric_limits<float>::quiet_NaN();
54 double getShowerNominalNumberOfCrystalsForEnergy(
const Particle* particle)
56 const ECLCluster* cluster = particle->getECLCluster();
58 double showerNominalNumberOfCrystalsForEnergy = -1.0;
60 auto clusterShowerRelations = cluster->getRelationsWith<ECLShower>();
61 for (
unsigned int ir = 0; ir < clusterShowerRelations.size(); ++ir) {
62 const auto shower = clusterShowerRelations.object(ir);
64 showerNominalNumberOfCrystalsForEnergy = shower->getNominalNumberOfCrystalsForEnergy();
67 return showerNominalNumberOfCrystalsForEnergy;
70 return std::numeric_limits<float>::quiet_NaN();
74 VARIABLE_GROUP(
"ECL Shower Debugging (cDST)");
76 REGISTER_VARIABLE(
"eclShowerNumberOfCrystalsForEnergy", getShowerNumberOfCrystalsForEnergy,
77 "[debugging] Returns the number of crystals ued to calculate the shower energy (optimized to minimize the energy resolution). This should not be confused with the number of crystals contained in the cluster. ");
78 REGISTER_VARIABLE(
"eclShowerNominalNumberOfCrystalsForEnergy", getShowerNominalNumberOfCrystalsForEnergy,
79 "[debugging] Returns the nominal number of crystals ued to calculate the shower energy (optimized to minimize the energy resolution). This should not be confused with the number of crystals contained in the cluster. ");
Abstract base class for different kinds of events.