LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
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 () |
Returns the accumulated channel -> SimChannel map for the single TPC. More... | |
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) |
Returns the accumulated channel -> SimChannel map for the specified TPC. More... | |
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 169 of file LArVoxelReadout.h.
typedef std::map<unsigned int, sim::SimChannel> larg4::LArVoxelReadout::ChannelMap_t |
Type of map channel -> sim::SimChannel.
Definition at line 172 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.
References ClearSimChannels(), SetDiscoverTPC(), and SetSingleTPC().
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.
References SetSingleTPC().
|
virtual |
Definition at line 140 of file LArVoxelReadout.cxx.
void larg4::LArVoxelReadout::ClearSimChannels | ( | ) |
Definition at line 143 of file LArVoxelReadout.cxx.
References fChannelMaps, fGeoHandle, geo::GeometryCore::Ncryostats(), and geo::GeometryCore::NTPC().
Referenced by LArVoxelReadout().
|
virtual |
Definition at line 575 of file LArVoxelReadout.cxx.
|
private |
Definition at line 327 of file LArVoxelReadout.cxx.
References util::abs(), sim::SimChannel::AddIonizationElectrons(), geo::TPCGeo::DriftDirection(), e, energy, larg4::IonizationAndScintillation::EnergyDeposit(), fChannelMaps, fDriftVelocity, fElectronClusterSize, fElectronLifetime, fGeoHandle, fLongitudinalDiffusion, fMinNumberOfElCluster, fOffPlaneMargin, for(), fPropGen, fTransverseDiffusion, detinfo::DetectorClocksData::G4ToElecTime(), geo::PlaneGeo::GetCenter(), geo::PlaneGeo::ID(), larg4::IonizationAndScintillation::Instance(), geo::kNegX, geo::kPosX, MF_LOG_DEBUG, geo::GeometryCore::NearestChannel(), geo::TPCGeo::Nplanes(), larg4::IonizationAndScintillation::NumberIonizationElectrons(), larsim::Utils::SCE::out_of_bounds(), geo::TPCGeo::Plane(), geo::TPCGeo::Plane0Pitch(), geo::TPCGeo::PlanePitch(), RecoverOffPlaneDeposit(), geo::GeometryCore::TPC(), detinfo::DetectorClocksData::TPCClock(), and xx.
Referenced by ProcessHits().
|
virtual |
const LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | ) | const |
Returns the accumulated channel -> SimChannel map for the single TPC.
Definition at line 154 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, and fTPC.
Referenced by GetSimChannelMap().
LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | ) |
Returns the accumulated channel -> SimChannel map for the single TPC.
Definition at line 160 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, fTPC, and GetSimChannelMap().
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 166 of file LArVoxelReadout.cxx.
References fChannelMaps.
LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | unsigned short | cryo, |
unsigned short | tpc | ||
) |
Returns the accumulated channel -> SimChannel map for the specified TPC.
Definition at line 172 of file LArVoxelReadout.cxx.
References fChannelMaps.
std::vector< sim::SimChannel > larg4::LArVoxelReadout::GetSimChannels | ( | ) | const |
Creates a list with the accumulated information for the single TPC.
Definition at line 178 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, and fTPC.
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 184 of file LArVoxelReadout.cxx.
References fChannelMaps.
|
inlineprivate |
Definition at line 321 of file LArVoxelReadout.h.
Referenced by ProcessHits().
|
virtual |
Definition at line 99 of file LArVoxelReadout.cxx.
References sim::LArG4Parameters::DisableWireplanes(), detinfo::DetectorPropertiesData::DriftVelocity(), detinfo::DetectorPropertiesData::Efield(), sim::LArG4Parameters::ElectronClusterSize(), detinfo::DetectorPropertiesData::ElectronLifetime(), fClockData, fDetProp, fDontDriftThem, fDriftVelocity, fElectronClusterSize, fElectronLifetime, fLgpHandle, fLongitudinalDiffusion, fMinNumberOfElCluster, fNSteps, fSkipWireSignalInTPCs, fTransverseDiffusion, sim::LArG4Parameters::LongitudinalDiffusion(), MF_LOG_DEBUG, sim::LArG4Parameters::MinNumberOfElCluster(), sim::LArG4Parameters::NoElectronPropagation(), sim::LArG4Parameters::SkipWireSignalInTPCs(), detinfo::DetectorPropertiesData::Temperature(), and sim::LArG4Parameters::TransverseDiffusion().
|
virtual |
Definition at line 576 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 197 of file LArVoxelReadout.cxx.
References bSingleTPC, DriftIonizationElectrons(), fClockData, fCstat, fDontDriftThem, fNSteps, fSkipWireSignalInTPCs, fTPC, larg4::ParticleListAction::GetCurrentOrigTrackID(), larg4::ParticleListAction::GetCurrentTrackID(), Has(), larg4::G4PVPlacementWithID< IDTYPE >::ID, larg4::IonizationAndScintillation::Instance(), MF_LOG_DEBUG, and larg4::IonizationAndScintillation::Reset().
|
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 290 of file LArVoxelReadout.cxx.
References util::abs(), geo::PlaneGeo::ComposePoint(), geo::PlaneGeo::DeltaFromActivePlane(), geo::PlaneGeo::DistanceFromPlane(), fOffPlaneMargin, and geo::PlaneGeo::PointWidthDepthProjection().
Referenced by DriftIonizationElectrons().
|
inlineprivatenoexcept |
Definition at line 249 of file LArVoxelReadout.h.
void larg4::LArVoxelReadout::SetDiscoverTPC | ( | ) |
Sets this readout to discover the TPC of each processed hit.
Definition at line 89 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, fTPC, and MF_LOG_DEBUG.
Referenced by LArVoxelReadout().
|
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 268 of file LArVoxelReadout.h.
Referenced by Setup().
|
inlineprivatenoexcept |
Definition at line 254 of file LArVoxelReadout.h.
|
private |
Sets the random generators to be used.
Definition at line 283 of file LArVoxelReadout.cxx.
References fPropGen.
Referenced by Setup().
void larg4::LArVoxelReadout::SetSingleTPC | ( | unsigned int | cryostat, |
unsigned int | tpc | ||
) |
Associates this readout to one specific TPC.
Definition at line 81 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, fTPC, and MF_LOG_DEBUG.
Referenced by larg4::LArVoxelReadoutGeometry::Construct(), and LArVoxelReadout().
void larg4::LArVoxelReadout::Setup | ( | Setup_t const & | setupData | ) |
Reads all the configuration elements from setupData
Definition at line 74 of file LArVoxelReadout.cxx.
References larg4::LArVoxelReadout::Setup_t::offPlaneMargin, larg4::LArVoxelReadout::Setup_t::propGen, SetOffPlaneChargeRecoveryMargin(), and SetRandomEngines().
Referenced by larg4::LArVoxelReadoutGeometry::Construct().
|
friend |
Definition at line 247 of file LArVoxelReadout.h.
|
private |
true if this readout is associated with a single TPC
Definition at line 348 of file LArVoxelReadout.h.
Referenced by GetSimChannelMap(), GetSimChannels(), ProcessHits(), SetDiscoverTPC(), and SetSingleTPC().
|
private |
Maps of cryostat, tpc to channel data.
Definition at line 342 of file LArVoxelReadout.h.
Referenced by ClearSimChannels(), DriftIonizationElectrons(), GetSimChannelMap(), and GetSimChannels().
|
private |
Definition at line 352 of file LArVoxelReadout.h.
Referenced by Initialize(), and ProcessHits().
|
private |
and in which cryostat (if bSingleTPC is true)
Definition at line 347 of file LArVoxelReadout.h.
Referenced by GetSimChannelMap(), GetSimChannels(), ProcessHits(), SetDiscoverTPC(), and SetSingleTPC().
|
private |
Definition at line 353 of file LArVoxelReadout.h.
Referenced by Initialize().
|
private |
Definition at line 337 of file LArVoxelReadout.h.
Referenced by Initialize(), and ProcessHits().
|
private |
Definition at line 331 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 335 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 334 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Handle to the Geometry service.
Definition at line 343 of file LArVoxelReadout.h.
Referenced by ClearSimChannels(), and DriftIonizationElectrons().
|
private |
Handle to the LArG4 parameters service.
Definition at line 345 of file LArVoxelReadout.h.
Referenced by Initialize().
|
private |
Definition at line 332 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 336 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 360 of file LArVoxelReadout.h.
Referenced by EndOfEvent(), Initialize(), and ProcessHits().
|
private |
Charge deposited within this many [cm] from the plane is lead onto it.
Definition at line 340 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and RecoverOffPlaneDeposit().
|
private |
random engine for charge propagation
Definition at line 350 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and SetRandomEngines().
|
private |
Definition at line 338 of file LArVoxelReadout.h.
Referenced by Initialize(), and ProcessHits().
|
private |
Definition at line 359 of file LArVoxelReadout.h.
|
private |
Definition at line 358 of file LArVoxelReadout.h.
|
private |
which TPC this LArVoxelReadout corresponds to
Definition at line 346 of file LArVoxelReadout.h.
Referenced by GetSimChannelMap(), GetSimChannels(), ProcessHits(), SetDiscoverTPC(), and SetSingleTPC().
|
private |
Definition at line 333 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().