10 #include "CLHEP/Random/RandGauss.h"    14 #include "DetectorInfo/DetectorProperties.h"    29       fGeo   = gar::providerFrom<geo::GeometryGAr>();
    30       fTime  = gar::providerFrom<detinfo::DetectorClocksServiceGAr>();
    31       fClock = fTime->TPCClock();
    51       if (electrons <= 0) 
return;
    54       CLHEP::RandGauss GaussRand(
fEngine);
    56       double g4time = dep.
Time();
    60       float xyz[3] = {dep.
X(),
    64       MF_LOG_DEBUG(
"ElectronDriftStandardAlg::DriftElectronsToReadout") << 
"energy deposition: "     65         << dep.
X() << 
" " << dep.
Y() << 
" " << dep.
Z() << 
std::endl;
    76       double sqrtDriftD   = std::sqrt(driftD);
    80       float  nElectrons = electrons * lifetimeCorr;
    83       int ourelectronspercluster = nearbyint(nElectrons/nClusters);
    87       std::vector<double> XDiff(nClusters, 0.);
    88       std::vector<double> YDiff(nClusters, 0.);
    89       std::vector<double> ZDiff(nClusters, 0.);
    90       std::vector<double> TDiff(nClusters, 0.);
    91       std::vector<int   > nElec(nClusters, ourelectronspercluster);
    94       nElec.back() = nearbyint(nElectrons - (nClusters - 1) * ourelectronspercluster);
    99       GaussRand.fireArray(nClusters, &XDiff[0], 0., longDiffSigma);
   100       GaussRand.fireArray(nClusters, &YDiff[0], 0., transDiffSigma);
   101       GaussRand.fireArray(nClusters, &ZDiff[0], 0., transDiffSigma);
   104       for(
size_t c = 0; 
c < nClusters; ++
c){
   110           MF_LOG_DEBUG(
"ElectronDriftStandardAlg::DriftElectronsToReadout")
   129       driftInfo.
Reset(XDiff, YDiff, ZDiff, TDiff, nElec);
 ElectronDriftStandardAlg(CLHEP::HepRandomEngine &engine, fhicl::ParameterSet const &pset)
 
double fInverseVelocity
stored for computational convenience 
 
void Reset(std::vector< double > &xPos, std::vector< double > &yPos, std::vector< double > &zPos, std::vector< double > &time, std::vector< int > &size)
 
int TPCNumDriftVols() const 
Returns number of TPC drift volumes. 
 
virtual ~ElectronDriftStandardAlg()
 
void Reset(const gar::sdp::EnergyDeposit *dep)
 
double fLongDiffConst
stored for computational convenience in sqrt(cm) 
 
float TPCXCent() const 
Returns the X location of the center of the TPC in cm. 
 
int fElectronsPerCluster
Number of electrons to drift in a cluster. 
 
float const & Time() const 
 
gar::detinfo::ElecClock fClock
electronics clock 
 
double TickPeriod() const 
A single tick period in nano-second, frequency is in MHz. 
 
CLHEP::HepRandomEngine & fEngine
random number engine 
 
const gar::detinfo::DetectorClocks * fTime
electronics clock 
 
T get(std::string const &key) const 
 
double fLifetimeCorrection
electron lifetime correction in negative ms 
 
static int max(int a, int b)
 
static IonizationAndScintillation * Instance()
 
int NumberIonizationElectrons() const 
 
size_t fMinClusters
Minimum number of clusters for diffusion integral. 
 
General GArSoft Utilities. 
 
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
 
double fTransDiffConst
stored for computational convenience in sqrt(cm) 
 
virtual const ElecClock & TPCClock() const  =0
Borrow a const TPC clock with time set to Trigger time [ns]. 
 
float TPCLength() const 
Returns the length of the TPC (x direction) 
 
const gar::geo::GeometryCore * fGeo
Geometry. 
 
QTextStream & endl(QTextStream &s)
 
void DriftElectronsToReadout(gar::sdp::EnergyDeposit const &dep, gar::rosim::ElectronDriftInfo &driftInfo)