Skip to content

Commit 0b719d9

Browse files
authored
Simdigitizer (#13015)
* Fixing sim digitizer * Updating busy time
1 parent 4a639b3 commit 0b719d9

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

Detectors/HMPID/simulation/include/HMPIDSimulation/HMPIDDigitizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class HMPIDDigitizer
5959
}
6060
}
6161
}
62-
62+
// void setOrbit(double timeNS) {mOrbit = }
6363
uint32_t getOrbit() { return mOrbit; };
6464
uint16_t getBc() { return mBc; };
6565

@@ -99,7 +99,7 @@ class HMPIDDigitizer
9999
std::vector<o2::hmpid::Digit> mDigits; // internal store for digits
100100

101101
constexpr static double TRACKHOLDTIME = 1200; // defines the window for pile-up after a trigger received in nanoseconds
102-
constexpr static double BUSYTIME = 22000; // the time for which no new trigger can be received in nanoseconds
102+
constexpr static double BUSYTIME = 40000; // the time for which no new trigger can be received in nanoseconds
103103

104104
std::map<int, int> mIndexForPad; //! logarithmic mapping of pad to digit index
105105

Steer/DigitizerWorkflow/src/HMPIDDigitizerSpec.cxx

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
using namespace o2::framework;
3535
using SubSpecificationType = o2::framework::DataAllocator::SubSpecificationType;
3636

37-
3837
namespace o2
3938
{
4039
namespace hmpid
@@ -102,34 +101,32 @@ class HMPIDDPLDigitizerTask : public o2::base::BaseDPLDigitizer
102101
// try to start new readout cycle by setting the trigger time
103102
auto triggeraccepted = mDigitizer.setTriggerTime(irecords[collID].getTimeNS());
104103
if (triggeraccepted) {
105-
flushDigitsAndLabels(); // flush previous readout cycle
106-
}
107-
auto withinactivetime = mDigitizer.setEventTime(irecords[collID].getTimeNS());
108-
if (withinactivetime) {
109-
// for each collision, loop over the constituents event and source IDs
110-
// (background signal merging is basically taking place here)
111-
for (auto& part : eventParts[collID]) {
112-
mDigitizer.setEventID(part.entryID);
113-
mDigitizer.setSrcID(part.sourceID);
114-
115-
// get the hits for this event and this source
116-
std::vector<o2::hmpid::HitType> hits;
117-
context->retrieveHits(mSimChains, "HMPHit", part.sourceID, part.entryID, &hits);
118-
LOG(info) << "For collision " << collID << " eventID " << part.entryID << " found HMP " << hits.size() << " hits ";
119-
120-
mDigitizer.setLabelContainer(&mLabels);
121-
mLabels.clear();
122-
mDigits.clear();
123-
124-
mDigitizer.process(hits, mDigits);
104+
auto withinactivetime = mDigitizer.setEventTime(irecords[collID].getTimeNS());
105+
if (withinactivetime) {
106+
// for each collision, loop over the constituents event and source IDs
107+
// (background signal merging is basically taking place here)
108+
for (auto& part : eventParts[collID]) {
109+
mDigitizer.setEventID(part.entryID);
110+
mDigitizer.setSrcID(part.sourceID);
111+
112+
// get the hits for this event and this source
113+
std::vector<o2::hmpid::HitType> hits;
114+
context->retrieveHits(mSimChains, "HMPHit", part.sourceID, part.entryID, &hits);
115+
LOG(info) << "For collision " << collID << " eventID " << part.entryID << " found HMP " << hits.size() << " hits ";
116+
117+
mDigitizer.setLabelContainer(&mLabels);
118+
mLabels.clear();
119+
mDigits.clear();
120+
121+
mDigitizer.process(hits, mDigits);
122+
}
123+
124+
flushDigitsAndLabels(); // flush previous readout cycle
125+
} else {
126+
LOG(info) << "COLLISION " << collID << "FALLS WITHIN A DEAD TIME";
125127
}
126-
127-
} else {
128-
LOG(info) << "COLLISION " << collID << "FALLS WITHIN A DEAD TIME";
129128
}
130129
}
131-
// final flushing step; getting everything not yet written out
132-
flushDigitsAndLabels();
133130

134131
// send out to next stage
135132
pc.outputs().snapshot(Output{"HMP", "DIGITS", 0}, digitsAccum);

0 commit comments

Comments
 (0)