LArSoft
v07_13_02
Liquid Argon Software toolkit - http://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... | |
virtual | ~LArVoxelReadout () |
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 | 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 (G4ThreeVector stepMidPoint, const double simTime, int trackID, unsigned short int cryostat, unsigned short int tpc) |
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 > | fGeoHandle |
Handle to the Geometry service. More... | |
art::ServiceHandle< sim::LArG4Parameters > | 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::ElecClock | fClock |
TPC electronics clock. More... | |
G4ThreeVector | fStepStart |
G4ThreeVector | fStepEnd |
size_t | fNSteps |
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 157 of file LArVoxelReadout.h.
typedef std::map<unsigned int, sim::SimChannel> larg4::LArVoxelReadout::ChannelMap_t |
Type of map channel -> sim::SimChannel.
Definition at line 161 of file LArVoxelReadout.h.
larg4::LArVoxelReadout::LArVoxelReadout | ( | std::string const & | name | ) |
Constructor. Can detect which TPC to cover by the name.
Definition at line 47 of file LArVoxelReadout.cxx.
References ClearSimChannels(), fClock, SetDiscoverTPC(), SetSingleTPC(), and detinfo::DetectorClocks::TPCClock().
larg4::LArVoxelReadout::LArVoxelReadout | ( | std::string const & | name, |
unsigned int | cryostat, | ||
unsigned int | tpc | ||
) |
Constructor. Sets which TPC to work on.
Definition at line 70 of file LArVoxelReadout.cxx.
References SetSingleTPC().
|
virtual |
Definition at line 102 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 142 of file LArVoxelReadout.cxx.
void larg4::LArVoxelReadout::ClearSimChannels | ( | ) |
Definition at line 147 of file LArVoxelReadout.cxx.
References fChannelMaps, fGeoHandle, geo::GeometryCore::Ncryostats(), and geo::GeometryCore::NTPC().
Referenced by LArVoxelReadout().
|
virtual |
Definition at line 582 of file LArVoxelReadout.cxx.
|
private |
Definition at line 331 of file LArVoxelReadout.cxx.
References sim::SimChannel::AddIonizationElectrons(), geo::TPCGeo::DriftDirection(), e, energy, larg4::IonizationAndScintillation::EnergyDeposit(), fChannelMaps, fClock, fDriftVelocity, fElectronClusterSize, fElectronLifetime, fGeoHandle, fLongitudinalDiffusion, fMinNumberOfElCluster, fOffPlaneMargin, fPropGen, fTransverseDiffusion, larg4::IonizationAndScintillation::Instance(), geo::kNegX, geo::kPosX, LOG_DEBUG, geo::GeometryCore::NearestChannel(), geo::TPCGeo::Nplanes(), larg4::IonizationAndScintillation::NumberIonizationElectrons(), geo::TPCGeo::Plane(), geo::TPCGeo::Plane0Pitch(), geo::TPCGeo::PlaneLocation(), geo::TPCGeo::PlanePitch(), RecoverOffPlaneDeposit(), detinfo::ElecClock::Ticks(), geo::GeometryCore::TPC(), and xx.
Referenced by ProcessHits().
|
virtual |
Definition at line 135 of file LArVoxelReadout.cxx.
References fNSteps.
const LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | ) | const |
Returns the accumulated channel -> SimChannel map for the single TPC.
Definition at line 157 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, and fTPC.
Referenced by GetSimChannelMap(), and larg4::LArG4::produce().
LArVoxelReadout::ChannelMap_t & larg4::LArVoxelReadout::GetSimChannelMap | ( | ) |
Returns the accumulated channel -> SimChannel map for the single TPC.
Definition at line 163 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 170 of file LArVoxelReadout.cxx.
References fChannelMaps, and GetSimChannelMap().
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 174 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 304 of file LArVoxelReadout.h.
Referenced by ProcessHits().
|
virtual |
Definition at line 106 of file LArVoxelReadout.cxx.
References sim::LArG4Parameters::DisableWireplanes(), sim::LArG4Parameters::ElectronClusterSize(), fDontDriftThem, fDriftVelocity, fElectronClusterSize, fElectronLifetime, fLgpHandle, fLongitudinalDiffusion, fMinNumberOfElCluster, fNSteps, fSkipWireSignalInTPCs, fTransverseDiffusion, LOG_DEBUG, sim::LArG4Parameters::LongitudinalDiffusion(), sim::LArG4Parameters::MinNumberOfElCluster(), sim::LArG4Parameters::NoElectronPropagation(), sim::LArG4Parameters::SkipWireSignalInTPCs(), and sim::LArG4Parameters::TransverseDiffusion().
|
virtual |
Definition at line 583 of file LArVoxelReadout.cxx.
|
virtual |
Definition at line 196 of file LArVoxelReadout.cxx.
References bSingleTPC, DriftIonizationElectrons(), fCstat, fDontDriftThem, fNSteps, fSkipWireSignalInTPCs, fTPC, larg4::ParticleListAction::GetCurrentTrackID(), Has(), larg4::G4PVPlacementWithID< IDTYPE >::ID, larg4::IonizationAndScintillation::Instance(), 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 292 of file LArVoxelReadout.cxx.
References geo::PlaneGeo::ComposePoint(), geo::PlaneGeo::DeltaFromActivePlane(), geo::PlaneGeo::DistanceFromPlane(), fOffPlaneMargin, and geo::PlaneGeo::PointWidthDepthProjection().
Referenced by DriftIonizationElectrons(), and SetRandomEngines().
void larg4::LArVoxelReadout::SetDiscoverTPC | ( | ) |
Sets this readout to discover the TPC of each processed hit.
Definition at line 93 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, fTPC, and 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 251 of file LArVoxelReadout.h.
References max.
Referenced by Setup().
|
private |
Sets the random generators to be used.
Definition at line 284 of file LArVoxelReadout.cxx.
References fPropGen, and RecoverOffPlaneDeposit().
Referenced by Setup().
void larg4::LArVoxelReadout::SetSingleTPC | ( | unsigned int | cryostat, |
unsigned int | tpc | ||
) |
Associates this readout to one specific TPC.
Definition at line 85 of file LArVoxelReadout.cxx.
References bSingleTPC, fCstat, fTPC, and 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 76 of file LArVoxelReadout.cxx.
References larg4::LArVoxelReadout::Setup_t::offPlaneMargin, larg4::LArVoxelReadout::Setup_t::propGen, SetOffPlaneChargeRecoveryMargin(), and SetRandomEngines().
Referenced by larg4::LArVoxelReadoutGeometry::Construct().
|
private |
true if this readout is associated with a single TPC
Definition at line 332 of file LArVoxelReadout.h.
Referenced by GetSimChannelMap(), GetSimChannels(), ProcessHits(), SetDiscoverTPC(), and SetSingleTPC().
|
private |
Maps of cryostat, tpc to channel data.
Definition at line 327 of file LArVoxelReadout.h.
Referenced by ClearSimChannels(), DriftIonizationElectrons(), GetSimChannelMap(), and GetSimChannels().
|
private |
TPC electronics clock.
Definition at line 336 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and LArVoxelReadout().
|
private |
and in which cryostat (if bSingleTPC is true)
Definition at line 331 of file LArVoxelReadout.h.
Referenced by GetSimChannelMap(), GetSimChannels(), ProcessHits(), SetDiscoverTPC(), and SetSingleTPC().
|
private |
Definition at line 322 of file LArVoxelReadout.h.
Referenced by Initialize(), and ProcessHits().
|
private |
Definition at line 313 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 317 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 316 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Handle to the Geometry service.
Definition at line 328 of file LArVoxelReadout.h.
Referenced by ClearSimChannels(), and DriftIonizationElectrons().
|
private |
Handle to the LArG4 parameters service.
Definition at line 329 of file LArVoxelReadout.h.
Referenced by Initialize().
|
private |
Definition at line 314 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 318 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().
|
private |
Definition at line 343 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 325 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and RecoverOffPlaneDeposit().
|
private |
random engine for charge propagation
Definition at line 334 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and SetRandomEngines().
|
private |
Definition at line 323 of file LArVoxelReadout.h.
Referenced by Initialize(), and ProcessHits().
|
private |
Definition at line 342 of file LArVoxelReadout.h.
|
private |
Definition at line 341 of file LArVoxelReadout.h.
|
private |
which TPC this LArVoxelReadout corresponds to
Definition at line 330 of file LArVoxelReadout.h.
Referenced by GetSimChannelMap(), GetSimChannels(), ProcessHits(), SetDiscoverTPC(), and SetSingleTPC().
|
private |
Definition at line 315 of file LArVoxelReadout.h.
Referenced by DriftIonizationElectrons(), and Initialize().