Skip to content

Commit 1e19047

Browse files
jokonigsawenzel
authored andcommitted
[EMCAL-539] Fix min. bias trigger handling for EMCal in simulation
- Bug introduced in #13227 : The decision of the fake trigger bit (if (ctpinpmask[CTP_NINPUTS - 1]) ) was always overwritten as the else case was removed completely. - This PR reverts this change. Hence the trigger flag used for analyis kTVXInEMC is now again only true when EMCal was in readout. Before it was always set when TVX fired. - Some more changes due to clang-format
1 parent 108aeca commit 1e19047

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

Detectors/CTP/simulation/src/Digitizer.cxx

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ std::vector<CTPDigit> Digitizer::process(const gsl::span<o2::ctp::CTPInputDigit>
8383
emcMBaccept.set(CTP_NINPUTS - 1, 1);
8484
inpmaskcoll |= emcMBaccept;
8585
} // else { // needs to be done always, remove else
86-
for (auto const& ctpinp : det2ctpinp[o2::detectors::DetID::EMC]) {
87-
uint64_t mask = inpmaskdebug & detInputName2Mask[ctpinp.name];
88-
// uint64_t mask = (inp->inputsMask).to_ullong() & detInputName2Mask[ctpinp.name];
89-
if (mask) {
90-
inpmaskcoll |= std::bitset<CTP_NINPUTS>(ctpinp.inputMask);
91-
}
86+
for (auto const& ctpinp : det2ctpinp[o2::detectors::DetID::EMC]) {
87+
uint64_t mask = inpmaskdebug & detInputName2Mask[ctpinp.name];
88+
// uint64_t mask = (inp->inputsMask).to_ullong() & detInputName2Mask[ctpinp.name];
89+
if (mask) {
90+
inpmaskcoll |= std::bitset<CTP_NINPUTS>(ctpinp.inputMask);
9291
}
93-
// }
94-
// LOG(info) << "EMC input mask:" << inpmaskcoll << " with IR = " << currentIR.bc << ", orbit = " << currentIR.orbit;
95-
break;
92+
}
93+
// }
94+
// LOG(info) << "EMC input mask:" << inpmaskcoll << " with IR = " << currentIR.bc << ", orbit = " << currentIR.orbit;
95+
break;
9696
}
9797
case o2::detectors::DetID::PHS: {
9898
for (auto const& ctpinp : det2ctpinp[o2::detectors::DetID::PHS]) {
@@ -153,21 +153,20 @@ void Digitizer::calculateClassMask(const std::bitset<CTP_NINPUTS> ctpinpmask, st
153153
if (clustername == "emc") {
154154
tvxMBemc |= tcl.name.find("minbias_TVX_L0") != std::string::npos; // 2022
155155
}
156-
if (tvxMBemc || (ctpinpmask.to_ullong() & tcl.descriptor->getInputsMask()) == tcl.descriptor->getInputsMask()) {
157-
// require real physics input in any case
158-
if (tvxMBemc) {
159-
// if the class is a min. bias class accept it only if the MB-accept bit is set in addition
160-
// (fake trigger input)
161-
if (ctpinpmask[CTP_NINPUTS - 1]) {
162-
classmask |= tcl.classMask;
163-
LOG(info) << "adding MBA:" << tcl.name;
164-
}
165-
} // else {
166-
// EMCAL rare triggers - physical trigger input
167-
// class identification can be handled like in the case of the other
168-
// classes as EMCAL trigger input is required
156+
// require real physics input in any case
157+
if (tvxMBemc) {
158+
// if the class is a min. bias class accept it only if the MB-accept bit is set in addition
159+
// (fake trigger input)
160+
if (ctpinpmask[CTP_NINPUTS - 1]) {
169161
classmask |= tcl.classMask;
170-
// }
162+
LOG(info) << "adding MBA:" << tcl.name;
163+
}
164+
} else if ((ctpinpmask.to_ullong() & tcl.descriptor->getInputsMask()) == tcl.descriptor->getInputsMask()) {
165+
// EMCAL rare triggers - physical trigger input
166+
// class identification can be handled like in the case of the other
167+
// classes as EMCAL trigger input is required
168+
LOG(info) << "adding EMCal rare trigger:" << tcl.name;
169+
classmask |= tcl.classMask;
171170
}
172171
} else {
173172
if (tcl.descriptor && ((ctpinpmask.to_ullong() & tcl.descriptor->getInputsMask()) == tcl.descriptor->getInputsMask())) {

0 commit comments

Comments
 (0)