gdynamicDigitization
Loading...
Searching...
No Matches
gFluxDigitization.cc
Go to the documentation of this file.
1#include "gFluxDigitization.h"
2
3// See header for API docs.
5 double timeWindow = 10; // electronic readout time-window of the detector
6 double gridStartTime = 0; // defines the window grid
7 double maxStep = 1 * CLHEP::mm;
8
9 readoutSpecs = std::make_shared<GReadoutSpecs>(timeWindow, gridStartTime, maxStep, log);
10
11 return true;
12}
13
14// See header for API docs.
15std::unique_ptr<GDigitizedData> GFluxDigitization::digitizeHitImpl(GHit* ghit, size_t hitn) {
16 // Expected to be a single-identity detector: take the first identity entry.
17 GIdentifier identity = ghit->getGID().front();
18
19 auto gdata = std::make_unique<GDigitizedData>(gopts, ghit);
20
21 gdata->includeVariable("hitn", static_cast<int>(hitn));
22 gdata->includeVariable("totEdep", ghit->getTotalEnergyDeposited());
23 gdata->includeVariable("time", ghit->getAverageTime());
24 gdata->includeVariable("pid", ghit->getPid());
25 gdata->includeVariable("tid", ghit->getTid());
26 gdata->includeVariable("E", ghit->getE());
27
28 return gdata;
29}
std::shared_ptr< GLogger > log
std::shared_ptr< GOptions > gopts
Options used by the digitization plugin instance.
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()
int getTid() const
double getE() const