gdynamicDigitization
Loading...
Searching...
No Matches
gParticleCounterDigitization.cc
Go to the documentation of this file.
2
3
5 double timeWindow = 10; // electronic readout time-window of the detector
6 double gridStartTime = 0; // defines the window grid
7 auto hitBitSet = HitBitSet("000000"); // defines what information to be stored in the hit
8
9 readoutSpecs = std::make_shared<GReadoutSpecs>(timeWindow, gridStartTime, hitBitSet, log);
10
11 return true;
12}
13
14
15// digitized the hit
16std::unique_ptr<GDigitizedData> GParticleCounterDigitization::digitizeHitImpl(GHit* ghit, size_t hitn) {
17 // ghit->getGID() must have a single entry
18 GIdentifier identity = ghit->getGID().front();
19
20 auto gdata = std::make_unique<GDigitizedData>(gopts, ghit);
21
22 gdata->includeVariable(identity.getName(), identity.getValue());
23 gdata->includeVariable("hitn", static_cast<int> (hitn) );
24 gdata->includeVariable("totEdep", ghit->getTotalEnergyDeposited());
25 gdata->includeVariable("time", ghit->getAverageTime());
26 gdata->includeVariable("pid", ghit->getPid());
27 gdata->includeVariable("totalE", ghit->getE());
28
29 return gdata;
30}
std::shared_ptr< GOptions > gopts
Optional pointer to GOptions.
std::shared_ptr< const GReadoutSpecs > readoutSpecs
After init, we never mutate these:
std::unique_ptr< GDigitizedData > digitizeHitImpl(GHit *ghit, size_t hitn) override
Digitizes a hit for particle counters.
bool defineReadoutSpecsImpl() override
Defines readout specifications for particle counter digitization.
Declares internal digitization classes for various detector types.