103 Fatal(
"Exec",
"No BdDigit array");
106 fDigitArray->Delete();
110 map<Int_t, pair<Double_t, Double_t>> ampTimeMap;
116 for (Int_t iPoint = 0; iPoint < fPointArray->GetEntriesFast(); iPoint++) {
121 Int_t mod = point->
GetCopy() - 1;
124 if (mod < 0 || mod >= fNMod) {
126 cout <<
"-W- BmnBdDigitizer::Exec: Invalid module number " << mod << endl;
131 Double_t energyLoss = point->GetEnergyLoss();
132 Double_t noise = rand.Gaus(0, fNoiseSigma);
133 Double_t totalEnergy = energyLoss + noise;
134 Double_t time = point->GetTime();
136 auto it = ampTimeMap.find(mod);
137 if (it != ampTimeMap.end()) {
138 it->second.first += totalEnergy;
139 if (time < it->second.second)
140 it->second.second = time;
142 ampTimeMap[mod] = {totalEnergy, time};
147 for (
auto mit : ampTimeMap) {
148 if (mit.second.first < fThreshold)
152 digi.
SetMod((Short_t)mit.first);
153 Double_t duration = ConvertAmplitudeToTime(mit.second.first);
155 digi.
SetTime(mit.second.second);
157 new ((*fDigitArray)[fDigitArray->GetEntriesFast()])
BmnTrigDigit(digi);
169 workTime += sw.RealTime();