Transports energy depositions from GEANT4 to TPC channels. More...
#include <LArVoxelReadout.h>
Classes | |
struct | Setup_t |
Collection of what it takes to set a LArVoxelReadout up. More... | |
Public Types | |
typedef std::map< unsigned int, sim::SimChannel > | ChannelMap_t |
Type of map channel -> sim::SimChannel. More... | |
Public Member Functions | |
LArVoxelReadout (std::string const &name) | |
Constructor. Can detect which TPC to cover by the name. More... | |
LArVoxelReadout (std::string const &name, unsigned int cryostat, unsigned int tpc) | |
Constructor. Sets which TPC to work on. More... | |
void | Setup (Setup_t const &setupData) |
Reads all the configuration elements from setupData More... | |
void | SetSingleTPC (unsigned int cryostat, unsigned int tpc) |
Associates this readout to one specific TPC. More... | |
void | SetDiscoverTPC () |
Sets this readout to discover the TPC of each processed hit. More... | |
virtual void | Initialize (G4HCofThisEvent *) |
virtual void | EndOfEvent (G4HCofThisEvent *) |
virtual void | clear () |
virtual G4bool | ProcessHits (G4Step *, G4TouchableHistory *) |
virtual void | DrawAll () |
virtual void | PrintAll () |
void | ClearSimChannels () |
std::vector< sim::SimChannel > | GetSimChannels () const |
Creates a list with the accumulated information for the single TPC. More... | |
std::vector< sim::SimChannel > | GetSimChannels (unsigned short cryo, unsigned short tpc) const |
Creates a list with the accumulated information for specified TPC. More... | |
const ChannelMap_t & | GetSimChannelMap () const |
Returns the accumulated channel -> SimChannel map for the single TPC. More... | |
ChannelMap_t & | GetSimChannelMap () |
const ChannelMap_t & | GetSimChannelMap (unsigned short cryo, unsigned short tpc) const |
Returns the accumulated channel -> SimChannel map for the specified TPC. More... | |
ChannelMap_t & | GetSimChannelMap (unsigned short cryo, unsigned short tpc) |
Private Member Functions | |
void | SetClockData (detinfo::DetectorClocksData const *const clockData) noexcept |
void | SetPropertiesData (detinfo::DetectorPropertiesData const *const detProp) noexcept |
void | SetOffPlaneChargeRecoveryMargin (double margin) |
Sets the margin for recovery of charge drifted off-plane. More... | |
void | SetRandomEngines (CLHEP::HepRandomEngine *pPropGen) |
Sets the random generators to be used. More... | |
geo::Point_t | RecoverOffPlaneDeposit (geo::Point_t const &pos, geo::PlaneGeo const &plane) const |
Returns the point on the specified plane closest to position. More... | |
void | DriftIonizationElectrons (detinfo::DetectorClocksData const &clockData, G4ThreeVector stepMidPoint, const double simTime, int trackID, unsigned short int cryostat, unsigned short int tpc, int origTrackID) |
bool | Has (std::vector< unsigned short int > v, unsigned short int tpc) const |
void | ProcessStep (G4Step *) |
Private Attributes | |
double | fDriftVelocity [3] |
double | fLongitudinalDiffusion |
double | fTransverseDiffusion |
double | fElectronLifetime |
double | fElectronClusterSize |
int | fMinNumberOfElCluster |
bool | fDontDriftThem |
std::vector< unsigned short int > | fSkipWireSignalInTPCs |
double | fOffPlaneMargin = 0.0 |
Charge deposited within this many [cm] from the plane is lead onto it. More... | |
std::vector< std::vector < ChannelMap_t > > | fChannelMaps |
Maps of cryostat, tpc to channel data. More... | |
art::ServiceHandle < geo::Geometry const > | fGeoHandle |
Handle to the Geometry service. More... | |
art::ServiceHandle < sim::LArG4Parameters const > | fLgpHandle |
Handle to the LArG4 parameters service. More... | |
unsigned int | fTPC |
which TPC this LArVoxelReadout corresponds to More... | |
unsigned int | fCstat |
and in which cryostat (if bSingleTPC is true) More... | |
bool | bSingleTPC |
true if this readout is associated with a single TPC More... | |
CLHEP::HepRandomEngine * | fPropGen = nullptr |
random engine for charge propagation More... | |
detinfo::DetectorClocksData const * | fClockData {nullptr} |
detinfo::DetectorPropertiesData const * | fDetProp {nullptr} |
G4ThreeVector | fStepStart |
G4ThreeVector | fStepEnd |
size_t | fNSteps |
Friends | |
class | LArVoxelReadoutGeometry |
Transports energy depositions from GEANT4 to TPC channels.
This class acts on single energy depositions from GEANT4, simulating the transportation of the ensuing ionisation electrons to the readout channels:
larg4::IonizationAndScintillation
instanceFor each energy deposition, entries on the appropriate sim::SimChannel
are added, with the information of the position where the energy deposit happened (in global coordinates, centimeters), the ID of the Geant4 track which produced the deposition, and the quantized time of arrival to the channel (in global TDC tick units). At most one entry is added for each electron cluster, but entries from the same energy deposit can be compacted if falling on the same TDC tick.
The main entry point of this class is the method ProcessHits()
.
A few optional behaviours are supported:
RecoverOffPlaneDeposit()
, if charge which reaches a wire plane is actually off it by less than the chosen margin, it's accounted for by that plane; by default the margin is 0 and all the charge off the plane is lost (with a warning) Definition at line 170 of file LArVoxelReadout.h.
typedef std::map<unsigned int, sim::SimChannel> larg4::LArVoxelReadout::ChannelMap_t |
Type of map channel -> sim::SimChannel.
Definition at line 173 of file LArVoxelReadout.h.
larg4::LArVoxelReadout::LArVoxelReadout | ( | std::string const & | name | ) |
Constructor. Can detect which TPC to cover by the name.
Definition at line 49 of file LArVoxelReadout.cxx.
larg4::LArVoxelReadout::LArVoxelReadout | ( | std::string const & | name, |
unsigned int | cryostat, | ||
unsigned int | tpc | ||
) |
Constructor. Sets which TPC to work on.
Definition at line 67 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 146 of file LArVoxelReadout.cxx.
void larg4::LArVoxelReadout::ClearSimChannels | ( | ) |
Definition at line 151 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 595 of file LArVoxelReadout.cxx.
|
private |
Definition at line 340 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 139 of file LArVoxelReadout.cxx.
const LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | ) | const |
Returns the accumulated channel -> SimChannel map for the single TPC.
Definition at line 163 of file LArVoxelReadout.cxx.
LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | ) |
Definition at line 170 of file LArVoxelReadout.cxx.
const LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | unsigned short | cryo, |
unsigned short | tpc | ||
) | const |
Returns the accumulated channel -> SimChannel map for the specified TPC.
Definition at line 177 of file LArVoxelReadout.cxx.
LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | unsigned short | cryo, |
unsigned short | tpc | ||
) |
Definition at line 183 of file LArVoxelReadout.cxx.
std::vector< sim::SimChannel > larg4::LArVoxelReadout::GetSimChannels | ( | ) | const |
Creates a list with the accumulated information for the single TPC.
Definition at line 189 of file LArVoxelReadout.cxx.
std::vector< sim::SimChannel > larg4::LArVoxelReadout::GetSimChannels | ( | unsigned short | cryo, |
unsigned short | tpc | ||
) | const |
Creates a list with the accumulated information for specified TPC.
Definition at line 196 of file LArVoxelReadout.cxx.
|
inlineprivate |
Definition at line 329 of file LArVoxelReadout.h.
|
virtual |
Definition at line 103 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 598 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 209 of file LArVoxelReadout.cxx.
|
private |
|
private |
Returns the point on the specified plane closest to position.
pos | the position to be tested (global coordinates, centimeters) |
plane | the plane to test the position against |
This method considers the distance of the position pos
from the active part of the plane
(see geo::Plane::DeltaFromActivePlane()
). If the position is less than a configurable margin far from the plane, the closest point on the plane to that position is returned. Otherwise, the position itself is returned.
Ionization charge may be drifted so that when it arrives to the plane, it actually does not hit the area covered by wires. This can happen for many reasons:
The "recovery" consists in forcing the charge to the instrumented area covered by the plane wires. The distance of the drifted charge from each plane border is computed and compared to the margin. If that distance is smaller than the margin, it is neglected and the charge is assigned a new position on that border.
This method provides the position that should be used for the charge deposition.
This is a simplistic approach to the simulation of border effects, assuming that in fact the electric field, which is continuous and pointing to the collection wires, will drive the charge to the wires even when they are "off track". No correction is applied for the additional time that such deviation would take.
Definition at line 303 of file LArVoxelReadout.cxx.
|
inlineprivatenoexcept |
Definition at line 251 of file LArVoxelReadout.h.
void larg4::LArVoxelReadout::SetDiscoverTPC | ( | ) |
Sets this readout to discover the TPC of each processed hit.
Definition at line 92 of file LArVoxelReadout.cxx.
|
inlineprivate |
Sets the margin for recovery of charge drifted off-plane.
margin | the extent of the margin on each frame coordinate [cm] |
This method sets the margin for the recovery of off-plane ionization charge. See RecoverOffPlaneDeposit()
for a description of that feature.
This method is used by LArVoxelReadout::Setup()
.
Definition at line 272 of file LArVoxelReadout.h.
|
inlineprivatenoexcept |
Definition at line 257 of file LArVoxelReadout.h.
|
private |
Sets the random generators to be used.
Definition at line 295 of file LArVoxelReadout.cxx.
void larg4::LArVoxelReadout::SetSingleTPC | ( | unsigned int | cryostat, |
unsigned int | tpc | ||
) |
Associates this readout to one specific TPC.
Definition at line 83 of file LArVoxelReadout.cxx.
void larg4::LArVoxelReadout::Setup | ( | Setup_t const & | setupData | ) |
Reads all the configuration elements from setupData
Definition at line 75 of file LArVoxelReadout.cxx.
|
friend |
Definition at line 248 of file LArVoxelReadout.h.
|
private |
true if this readout is associated with a single TPC
Definition at line 356 of file LArVoxelReadout.h.
|
private |
Maps of cryostat, tpc to channel data.
Definition at line 350 of file LArVoxelReadout.h.
|
private |
Definition at line 360 of file LArVoxelReadout.h.
|
private |
and in which cryostat (if bSingleTPC is true)
Definition at line 355 of file LArVoxelReadout.h.
|
private |
Definition at line 361 of file LArVoxelReadout.h.
|
private |
Definition at line 345 of file LArVoxelReadout.h.
|
private |
Definition at line 339 of file LArVoxelReadout.h.
|
private |
Definition at line 343 of file LArVoxelReadout.h.
|
private |
Definition at line 342 of file LArVoxelReadout.h.
|
private |
Handle to the Geometry service.
Definition at line 351 of file LArVoxelReadout.h.
|
private |
Handle to the LArG4 parameters service.
Definition at line 353 of file LArVoxelReadout.h.
|
private |
Definition at line 340 of file LArVoxelReadout.h.
|
private |
Definition at line 344 of file LArVoxelReadout.h.
|
private |
Definition at line 368 of file LArVoxelReadout.h.
|
private |
Charge deposited within this many [cm] from the plane is lead onto it.
Definition at line 348 of file LArVoxelReadout.h.
|
private |
random engine for charge propagation
Definition at line 358 of file LArVoxelReadout.h.
|
private |
Definition at line 346 of file LArVoxelReadout.h.
|
private |
Definition at line 367 of file LArVoxelReadout.h.
|
private |
Definition at line 366 of file LArVoxelReadout.h.
|
private |
which TPC this LArVoxelReadout corresponds to
Definition at line 354 of file LArVoxelReadout.h.
|
private |
Definition at line 341 of file LArVoxelReadout.h.