13 #ifndef SBND_CRTDETSIMALG_H
14 #define SBND_CRTDETSIMALG_H
17 #include "fhiclcpp/ParameterSet.h"
18 #include "art/Framework/Services/Registry/ServiceHandle.h"
26 #include "messagefacility/MessageLogger/MessageLogger.h"
29 #include "CLHEP/Random/RandomEngine.h"
30 #include "CLHEP/Random/RandFlat.h"
31 #include "CLHEP/Random/RandGauss.h"
32 #include "CLHEP/Random/RandPoisson.h"
44 #include "TGeoManager.h"
46 #include "Math/Interpolator.h"
73 SiPMData(
int _sipmID,
int _channel, uint64_t _t0, uint64_t _t1,
double _adc) :
145 void FillTaggers(
const uint32_t adid,
const uint32_t adsid, std::vector<AuxDetIDE> ides);
165 std::vector<std::pair<sbnd::crt::FEBData, std::vector<AuxDetIDE>>>
GetData();
185 float t0,
float npeMean,
float r);
200 void ChargeResponse(
double eDep,
double d0,
double d1,
double distToReadout,
201 long & npe0,
long & npe1,
double & q0,
double & q1);
239 std::vector<std::pair<sbnd::crt::FEBData, std::vector<AuxDetIDE>>>
fData;
uint32_t getChannelTriggerTicks(float t0, float npeMean, float r)
Functions to help with numbers.
void AddADC(sbnd::crt::FEBData &feb_data, const int &sipmID, const uint16_t &adc)
int channel
The SiPM global channel number, calculated as 32 x (module) + 2 x (strip) + j.
void ConfigureTimeOffset()
std::vector< std::pair< sbnd::crt::FEBData, std::vector< AuxDetIDE > > > GetData()
std::unique_ptr< ROOT::Math::Interpolator > fInterpolator
The interpolator used to estimate the CRT waveform.
CRTDetSimParams fParams
The table of CRT simulation parameters.
void FillTaggers(const uint32_t adid, const uint32_t adsid, std::vector< AuxDetIDE > ides)
void ProcessStrips(const std::vector< StripData > &strips)
double fG4RefTime
The G4 reference time that can be used as a time offset.
double adc
The SiPM simulated ADC value in double format.
StripData(uint16_t _mac5, unsigned _planeID, SiPMData _sipm0, SiPMData _sipm1, bool _sipm_coinc, sim::AuxDetIDE _ide)
std::vector< std::pair< sbnd::crt::FEBData, std::vector< AuxDetIDE > > > fData
This member stores the final FEBData for the CRT simulation.
unsigned planeID
The plane ID (0 or 1 for horizontal or vertical)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
SiPMData(int _sipmID, int _channel, uint64_t _t0, uint64_t _t1, double _adc)
object containing MC truth information necessary for making RawDigits and doing back tracking ...
SiPMData sipm0
One SiPM (the one that sees signal first)
std::vector< std::vector< int > > GetAuxData()
std::map< std::string, Tagger > fTaggers
A list of hit taggers, before any coincidence requirement (name -> tagger)
std::vector< StripData > data
A vector of strips that have energy deposits.
art framework interface to geometry description for auxiliary detectors
void ChargeResponse(double eDep, double d0, double d1, double distToReadout, long &npe0, long &npe1, double &q0, double &q1)
sim::AuxDetIDE ide
The AuxDetIDE associated with this strip.
fhicl::Table< CRTDetSimParams > Parameters
Encapsulate the geometry of an auxiliary detector.
int sipmID
The SiPM ID in the strip (0-31)
MC truth information to make RawDigits and do back tracking.
CLHEP::HepRandomEngine & fEngine
The random-number engine.
uint16_t mac5
The FEB number this strip is in.
stream1 can override from command line with o or output services user sbnd
CRTDetSimAlg(const Parameters &p, CLHEP::HepRandomEngine &fRandEngine, double g4RefTime)
bool sipm_coinc
Stores the ID of the SiPM that sees signal first (0-31)
std::vector< std::vector< int > > fAuxData
This member stores the indeces of SiPM per AuxDetIDE.
double fTimeOffset
The time that will be used in the simulation.
int size()
Returns the number of strips with energy deposits for this tagger.
uint16_t WaveformEmulation(const uint32_t &time_delay, const double &adc)
const CRTDetSimParams & Params()
art framework interface to geometry description