84 EventTiming = trgEvt.getEvtTime();
85 RevoGDL = trgEvt.getL1Revo();
86 RevoFAM = trgEvt.getEvtRevo();
94 const auto aTC =
m_eclTCs.appendNew();
96 const unsigned idx = trg.getTCId();
99 aTC->setFADC(trg.getTCEnergy());
100 aTC->setTiming(trg.getTCTime());
101 aTC->setEvtTiming(EventTiming);
102 aTC->setRevoGDL(RevoGDL);
103 aTC->setRevoFAM(RevoFAM);
104 aTC->setThetaId(
m_trgmap->getTCThetaIdFromTCId(idx));
105 aTC->setPhiId(
m_trgmap->getTCPhiIdFromTCId(idx));
106 aTC->setHitWin(trg.getHitWin());
109 float energySum = 0.;
110 for (
const auto&
id :
m_trgmap->getXtalIdFromTCId(idx)) {
122 aTC->setECLCalDigitEnergy(energySum);
127 for (
int i = 0; i <
m_eclTCs.getEntries(); i++) {
130 B2ERROR(
m_eclTCs[i]->getTCId() <<
" not possible");
144 auto relationsCalDigits = cluster.getRelationsTo<
ECLCalDigit>();
145 for (
unsigned int idx = 0; idx < relationsCalDigits.size(); ++idx) {
146 const auto cal = relationsCalDigits.object(idx);
147 const auto weight = relationsCalDigits.weight(idx);
150 for (
unsigned int idxTC = 0; idxTC < relationsTCs.size(); ++idxTC) {
151 const auto tc = relationsTCs.object(idxTC);
153 const unsigned tcid = tc->getTCId();
154 TCMap[tcid] += weight * cal->getEnergy();
159 for (
const auto& mapentry : TCMap) {
161 cluster.addRelationTo(
m_eclTCs[pos], mapentry.second);
166 float sumEnergyTCECLCalDigitInECLCluster = 0.0;
167 float sumEnergyECLCalDigitInECLCluster = 0.0;
175 float eventtiming = std::numeric_limits<float>::quiet_NaN();
180 const int tcid = trg.getTCId();
183 if (trg.getTCEnergy() > maxtc) {
184 maxtc = trg.getTCEnergy();
194 if (trg.getTCEnergy() > 0 and std::isnan(eventtiming)) {
195 eventtiming = EventTiming;
198 B2DEBUG(29,
"TC Id: (1.." <<
ECLTRGInformation::c_nTCs <<
") " << trg.getTCId() <<
" FADC=" << trg.getTCEnergy() <<
", t=" <<
199 trg.getTCTime() <<
", tevent=" << eventtiming);
204 float energyInTC = 0.;
205 float energyInTCInECLCluster = 0.;
206 float highestEnergy = -1.;
207 float time = std::numeric_limits<float>::quiet_NaN();
209 for (
const auto&
id :
m_trgmap->getXtalIdFromTCId(idx)) {
219 for (
unsigned int irel = 0; irel < rel.size(); ++irel) {
221 const auto cluster = rel.object(irel);
225 const auto weight = rel.weight(irel);
231 energyInTCInECLCluster += weight *
m_eclCalDigits[pos]->getEnergy();
246 B2DEBUG(28, energyInTCInECLCluster <<
" " <<
m_trgmap->getTCThetaIdFromTCId(idx));
249 if (
m_trgmap->getTCThetaIdFromTCId(idx) >= 2 and
250 m_trgmap->getTCThetaIdFromTCId(idx) <= 15) {
251 if (
m_eclTRGInformation->getEnergyTC(idx)) sumEnergyTCECLCalDigitInECLCluster += energyInTCInECLCluster;
252 sumEnergyECLCalDigitInECLCluster += energyInTCInECLCluster;
261 if (energyInTC > 0) B2DEBUG(29,
"ECLCalDigits TC Id: (1.." <<
ECLTRGInformation::c_nTCs <<
") " << idx <<
" E=" << energyInTC <<
267 m_eclTRGInformation->setSumEnergyTCECLCalDigitInECLCluster(sumEnergyTCECLCalDigitInECLCluster);
268 m_eclTRGInformation->setSumEnergyECLCalDigitInECLCluster(sumEnergyECLCalDigitInECLCluster);
275 m_eclTCs[pos]->setIsHighestFADC(
true);