89 B2DEBUG(175,
"ECLCRSplitterN2Module::event()");
93 unsigned int iShower = 1;
98 aECLShower->addRelationTo(&aCR);
103 aECLShower->addRelationTo(&aLM);
107 double highestEnergy = 0.0;
108 double highestEnergyTime = 0.;
109 double highestEnergyTimeResolution = 0.;
110 double weightSum = 0.0;
111 double energySum = 0.0;
112 unsigned int highestEnergyID = 0;
113 std::vector< ECLCalDigit > digits;
114 std::vector< double > weights;
118 for (
unsigned int iRel = 0; iRel < relatedDigitsPairs.size(); iRel++) {
119 const auto aECLCalDigit = relatedDigitsPairs.object(iRel);
120 const auto weight = relatedDigitsPairs.weight(iRel);
123 aECLShower->addRelationTo(aECLCalDigit, weight);
126 const double energyDigit = aECLCalDigit->getEnergy();
127 if (energyDigit > highestEnergy) {
128 highestEnergy = energyDigit * weight;
129 highestEnergyID = aECLCalDigit->getCellId();
130 highestEnergyTime = aECLCalDigit->getTime();
131 highestEnergyTimeResolution = aECLCalDigit->getTimeResolution();
134 digits.push_back(*aECLCalDigit);
135 weights.push_back(weight);
138 energySum += energyDigit * weight;
142 const ROOT::Math::XYZVector& showerposition = Belle2::ECL::computePositionLiLo(digits, weights,
m_liloParameters);
143 aECLShower->setTheta(showerposition.Theta());
144 aECLShower->setPhi(showerposition.Phi());
145 aECLShower->setR(showerposition.R());
147 aECLShower->setEnergy(energySum);
148 aECLShower->setEnergyRaw(energySum);
149 aECLShower->setEnergyHighestCrystal(highestEnergy);
150 aECLShower->setCentralCellId(highestEnergyID);
151 aECLShower->setTime(highestEnergyTime);
152 aECLShower->setDeltaTime99(highestEnergyTimeResolution);
153 aECLShower->setNumberOfCrystals(weightSum);
155 aECLShower->setShowerId(iShower);
157 aECLShower->setConnectedRegionId(aCR.getCRId());
159 B2DEBUG(175,
"N2 shower " << iShower);
160 B2DEBUG(175,
" theta = " << aECLShower->getTheta());
161 B2DEBUG(175,
" phi = " << aECLShower->getPhi());
162 B2DEBUG(175,
" R = " << aECLShower->getR());
163 B2DEBUG(175,
" energy = " << aECLShower->getEnergy());
164 B2DEBUG(175,
" time = " << aECLShower->getTime());
165 B2DEBUG(175,
" time resolution = " << aECLShower->getDeltaTime99());
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.