10 #include <ecl/modules/eclSplitterN2/ECLSplitterN2Module.h>
13 #include <ecl/utility/Position.h>
14 #include <ecl/dataobjects/ECLCalDigit.h>
15 #include <ecl/dataobjects/ECLConnectedRegion.h>
16 #include <ecl/dataobjects/ECLLocalMaximum.h>
17 #include <ecl/dataobjects/ECLShower.h>
20 #include <framework/datastore/RelationArray.h>
21 #include <framework/logging/Logger.h>
22 #include <mdst/dataobjects/ECLCluster.h>
42 m_eclConnectedRegions(eclConnectedRegionArrayName()),
43 m_eclLocalMaximums(eclLocalMaximumArrayName()),
44 m_eclShowers(eclShowerArrayName())
47 setDescription(
"ECLSplitterN2Module: Baseline reconstruction splitter code for the neutral hadron hypothesis.");
91 B2DEBUG(175,
"ECLCRSplitterN2Module::event()");
95 unsigned int iShower = 1;
100 aECLShower->addRelationTo(&aCR);
105 aECLShower->addRelationTo(&aLM);
109 double highestEnergy = 0.0;
110 double highestEnergyTime = 0.;
111 double highestEnergyTimeResolution = 0.;
112 double weightSum = 0.0;
113 double energySum = 0.0;
114 unsigned int highestEnergyID = 0;
115 std::vector< ECLCalDigit > digits;
116 std::vector< double > weights;
120 for (
unsigned int iRel = 0; iRel < relatedDigitsPairs.size(); iRel++) {
121 const auto aECLCalDigit = relatedDigitsPairs.object(iRel);
122 const auto weight = relatedDigitsPairs.weight(iRel);
125 aECLShower->addRelationTo(aECLCalDigit, weight);
128 const double energyDigit = aECLCalDigit->getEnergy();
129 if (energyDigit > highestEnergy) {
130 highestEnergy = energyDigit * weight;
131 highestEnergyID = aECLCalDigit->getCellId();
132 highestEnergyTime = aECLCalDigit->getTime();
133 highestEnergyTimeResolution = aECLCalDigit->getTimeResolution();
136 digits.push_back(*aECLCalDigit);
137 weights.push_back(weight);
140 energySum += energyDigit * weight;
144 const ROOT::Math::XYZVector& showerposition = Belle2::ECL::computePositionLiLo(digits, weights,
m_liloParameters);
145 aECLShower->setTheta(showerposition.Theta());
146 aECLShower->setPhi(showerposition.Phi());
147 aECLShower->setR(showerposition.R());
149 aECLShower->setEnergy(energySum);
150 aECLShower->setEnergyRaw(energySum);
151 aECLShower->setEnergyHighestCrystal(highestEnergy);
152 aECLShower->setCentralCellId(highestEnergyID);
153 aECLShower->setTime(highestEnergyTime);
154 aECLShower->setDeltaTime99(highestEnergyTimeResolution);
155 aECLShower->setNumberOfCrystals(weightSum);
157 aECLShower->setShowerId(iShower);
159 aECLShower->setConnectedRegionId(aCR.getCRId());
161 B2DEBUG(175,
"N2 shower " << iShower);
162 B2DEBUG(175,
" theta = " << aECLShower->getTheta());
163 B2DEBUG(175,
" phi = " << aECLShower->getPhi());
164 B2DEBUG(175,
" R = " << aECLShower->getR());
165 B2DEBUG(175,
" energy = " << aECLShower->getEnergy());
166 B2DEBUG(175,
" time = " << aECLShower->getTime());
167 B2DEBUG(175,
" time resolution = " << aECLShower->getDeltaTime99());
Class to store calibrated ECLDigits: ECLCalDigits.
Class to store local maxima (LM)
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
double m_liloParameterB
lin-log parameter B
StoreArray< ECLShower > m_eclShowers
Store array: ECLShower.
StoreArray< ECLConnectedRegion > m_eclConnectedRegions
Store array: ECLConnectedRegion.
ECLSplitterN2Module()
Constructor.
std::string m_positionMethod
Position calculation: lilo or linear.
virtual void initialize() override
Initialize.
StoreArray< ECLLocalMaximum > m_eclLocalMaximums
Store array: ECLLocalMaximum.
virtual void event() override
Event.
virtual const char * eclShowerArrayName() const
Default name ECLShowers.
virtual void endRun() override
End run.
virtual void terminate() override
Terminate.
~ECLSplitterN2Module()
Destructor.
virtual void beginRun() override
Begin run.
std::vector< double > m_liloParameters
lin-log parameters A, B, and C
virtual const char * eclCalDigitArrayName() const
Default name ECLCalDigits.
double m_liloParameterA
lin-log parameter A
StoreArray< ECLCalDigit > m_eclCalDigits
Store array: ECLCalDigit.
double m_liloParameterC
lin-log parameter C
virtual const char * eclConnectedRegionArrayName() const
Default name ECLConnectedRegions.
virtual const char * eclLocalMaximumArrayName() const
Default name ECLLocalMaximums.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Abstract base class for different kinds of events.