gdynamicDigitization
Loading...
Searching...
No Matches
gFluxDigitization.cc
Go to the documentation of this file.
2
3// See header for API docs.
6
7 double timeWindow = 10; // electronic readout time-window of the detector
8 double gridStartTime = 0; // defines the windows grid
9 HitBitSet hitBitSet("000001"); // defines what information to be stored in the hit
10
11 readoutSpecs = std::make_shared<GReadoutSpecs>(timeWindow, gridStartTime, hitBitSet, log);
12
13 return true;
14}
15
16// See header for API docs.
17std::unique_ptr<GDigitizedData> GFluxDigitization::digitizeHitImpl(GHit* ghit, size_t hitn) {
19
20 GIdentifier identity = ghit->getGID().front();
21
22 auto gdata = std::make_unique<GDigitizedData>(gopts, ghit);
23
24 gdata->includeVariable(identity.getName(), identity.getValue());
25 gdata->includeVariable("hitn", static_cast<int>(hitn));
26 gdata->includeVariable("totEdep", ghit->getTotalEnergyDeposited());
27 gdata->includeVariable("time", ghit->getAverageTime());
28 gdata->includeVariable("pid", ghit->getPid());
29 gdata->includeVariable("totalE", ghit->getE());
30
31 return gdata;
32}
std::shared_ptr< GLogger > log
std::shared_ptr< GOptions > gopts
Options used by the digitization plugin instance.
void check_if_log_defined() const
Ensures options/logging are configured before plugin methods run.
std::shared_ptr< const GReadoutSpecs > readoutSpecs
Readout specs are created during initialization and treated as immutable.
std::unique_ptr< GDigitizedData > digitizeHitImpl(GHit *ghit, size_t hitn) override
Digitizes a hit for flux detectors.
bool defineReadoutSpecsImpl() override
Defines readout specifications for flux digitization.
int getPid() const
std::vector< GIdentifier > getGID() const
double getTotalEnergyDeposited()
double getAverageTime()
double getE() const
std::bitset< NHITBITS > HitBitSet
Internal digitization plugins shipped with the gdynamic digitization library.
std::string getName() const
int getValue() const