LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Monte Carlo Simulation. More...
Namespaces | |
details | |
dump | |
Functions to dump Monte Carlo object information into a stream. | |
Classes | |
class | AuxDetHit |
class | AuxDetIDE |
MC truth information to make RawDigits and do back tracking. More... | |
class | AuxDetSimChannel |
Collection of particles crossing one auxiliary detector cell. More... | |
class | BeamGateInfo |
class | DumpGTruth |
class | DumpMCParticles |
class | DumpMCShowers |
class | DumpMCTracks |
class | DumpMCTruth |
class | DumpOpDetBacktrackerRecords |
class | DumpSimChannels |
class | DumpSimPhotons |
class | DumpSimPhotonsLite |
class | EmEveIdCalculator |
class | EveIdCalculator |
class | GeneratedParticleInfo |
Contains information about a generated particle. More... | |
struct | IDE |
Ionization at a point of the TPC sensitive volume. More... | |
class | LArG4Parameters |
class | LArVoxelCalculator |
class | LArVoxelData |
class | LArVoxelID |
class | LArVoxelList |
class | MCBaseException |
struct | MCEdep |
class | MCEdepHit |
class | MCEnDep |
class | MCHit |
class | MCHitCollection |
class | MCMiniPart |
class | MCRecoEdep |
class | MCRecoPart |
class | MCShower |
class | MCShowerRecoAlg |
class | MCShowerRecoPart |
class | MCStep |
class | MCTrack |
class | MCTrackCollectionAnaAlg |
class | MCTrackRecoAlg |
class | MCWire |
class | MCWireCollection |
class | MergeSimSources |
class | MergeSimSourcesUtility |
class | OnePhoton |
class | OpDetBacktrackerRecord |
Energy deposited on a readout Optical Detector by simulated tracks. More... | |
class | ParticleHistory |
class | ParticleList |
class | PhotonVoxel |
class | PhotonVoxelDef |
struct | SDP |
class | SimChannel |
Energy deposited on a readout channel by simulated tracks. More... | |
class | SimDriftedElectronCluster |
class | SimEnergyDeposit |
class | SimListUtils |
class | SimPhotons |
class | SimPhotonsCollection |
class | SimPhotonsLite |
class | SupernovaTruth |
struct | TrackIDE |
Ionization energy from a Geant4 track. More... | |
struct | TrackSDP |
Ionization photons from a Geant4 track. More... | |
class | UniquePosition |
Typedefs | |
typedef std::vector< AuxDetHit > | AuxDetHitCollection |
typedef std::vector< AuxDetSimChannel > | AuxDetSimChannelCollection |
typedef std::pair< double, std::vector< sim::SDP > > | timePDclockSDP_t |
List of energy deposits at the same time (on this Optical Detector) More... | |
typedef std::pair< unsigned short, std::vector< sim::IDE > > | TDCIDE |
List of energy deposits at the same time (on this channel) More... | |
typedef std::vector< SimEnergyDeposit > | SimEnergyDepositCollection |
Enumerations | |
enum | BeamType_t { kUnknown =0, kBNB, kNuMI, kBeamTypeMax } |
Defines category of beams to be stored in sim::BeamGateInfo. More... | |
enum | SupernovaSamplingMode_t { kUnknownSupernovaSamplingMode = 0, kUnbiased, kUniformTime, kUniformEnergy, kSupernovaSamplingModeMax } |
Functions | |
bool | operator< (const BeamGateInfo &lhs, const BeamGateInfo &rhs) |
unsigned int | GetRandomNumberSeed () |
const LArVoxelData | operator* (const double &value, const LArVoxelData &data) |
std::ostream & | operator<< (std::ostream &output, const LArVoxelData &data) |
std::ostream & | operator<< (std::ostream &output, const LArVoxelID &id) |
const LArVoxelList | operator* (const double &value, const LArVoxelList &list) |
std::ostream & | operator<< (std::ostream &output, const LArVoxelList &list) |
std::ostream & | operator<< (std::ostream &output, const ParticleHistory &list) |
std::ostream & | operator<< (std::ostream &output, const ParticleList &list) |
std::ostream & | operator<< (std::ostream &output, const ParticleList::archived_info_type &info) |
Function to name `simb::MCParticle` enumerators and codes. | |
std::string | ParticleName (int pigid) |
Returns a string with the name of particle the specified with PDG ID. More... | |
std::string | ParticleStatusName (int code) |
Describes the status of a particle (simb::MCParticle::StatusCode() ). More... | |
Functions to name `simb::MCTruth` enumerators and codes. | |
std::string | TruthOriginName (simb::Origin_t origin) |
Returns a string representing the specified process origin. More... | |
std::string | TruthCCNCname (int ccnc) |
std::string | TruthReactionMode (int mode) |
Returns the "mode" of the reaction (a lesser version of interaction type). More... | |
std::string | TruthInteractionTypeName (int type) |
Variables | |
const double | kINVALID_DOUBLE = std::numeric_limits <double>::max() |
const float | kINVALID_FLOAT = std::numeric_limits <float>::max() |
const unsigned int | kINVALID_UINT = std::numeric_limits <unsigned int>::max() |
const int | kINVALID_INT = std::numeric_limits <int>::max() |
static const int | NoParticleId = std::numeric_limits<int>::min() |
static std::unique_ptr< EveIdCalculator > | eveIdCalculator |
Monte Carlo Simulation.
TECHNICAL NOTES:
Title: MergeSimSources Utility Class Author: Wes Ketchum (wketc) hum@ lanl. gov
Description: Class that merges different simulation sources together to created a combined sim list. Typically just merges vectors/maps/etc together. But, if anything as a G4 trackID, applies a user-defined offset to those IDs.
This class encapsulates the calculations associated with computing the LArVoxelID, and provides access to the any LArVoxel parameters from the input file(s). It is to be called using art::ServiceHandle<sim::LArVoxelCalculator> lvx; The service makes it act like a singleton, but it knows about the Parameters defined in the input file. Definition: "Voxels" are three-dimensional "pixels"; basically they divide the energy deposition in the LAr into (x,y,z) cubes. Well, hyper-cubes actually, since we have to potentially include divisions in time as well. Example of a typical use: const sim::LArVoxelCalculator* lhc = sim::LArVoxelCalculator::Instance(); double xSize = lhc->VoxelSizeX();
This service encapsulates the calculations associated with computing the LArVoxelID, and provides access to the any LArVoxel parameters from the input file(s). Definition: "Voxels" are three-dimensional "pixels"; basically they divide the energy deposition in the LAr into (x,y,z) cubes. Well, hyper-cubes actually, since we have to potentially include divisions in time as well.
LArVoxelList associates a voxel ID with voxel data. LArVoxelID describes the ID (position); this class describes the data.
In particular, this class stores the association between particle tracks and the energy deposited within a voxel.
The key item of information stored for a voxel is the energy. Another, less important item is the association of a particular particle track to an amount of energy stored in the voxel. If all you want is the energy in a voxel, use LArVoxelData::Energy() and ignore the rest of this discussion. If you want to understand the source of that energy, you have to dig deeper:
LArVoxelData::Energy[trackID] returns the amount of energy deposited by the particle with the given track ID (note the use of square brackets).
LArVoxelData::NumberParticles() returns the number of individual particles whose energy deposits are recorded for this voxel.
LArVoxelData::Energy(i) returns the amount of energy deposited by the "i-th" particle (note the use of parenthesis).
LArVoxelData::TrackID(i) returns the track ID of the "i-th" particle.
LArVoxelData::UnassignedEnergy() returns the amount of energy in the voxel that's not assigned to any particle. There might be "unassigned" energy for one of two reasons:
1) In the Monte Carlo, particles can be cut from the ParticleList because they fall below the energy cut. If that happens, the particle is also removed from the LArVoxelData lists, and its energy placed in "unassigned" energy.
For example, a voxel might contain the sum of many low-energy electrons. It may be that none of the individual electron tracks would be written to the output, but their sum might be enough for the voxel to be written to the output file.
2) If any form of "voxel arithmetic" is performed (e.g,. adding two LArVoxelLists together), it becomes too difficult to maintain the particle<->energy relationship because the track IDs change. In that case, all the voxel energies are moved to "unassigned" energy.
LArVoxelData::AssignedEnergy() returns, in effect, Energy() - UnassignedEnergy()
This class defines a unique identifier for a given volume element ("voxel") in the LAr volume. It is sortable, can be tested for equality, and is persistent under ROOT I/O. (Actually, the term "voxel" is a mis-nomer, since we're also keeping track of the time slice. What's a four-dimensional volume element? A "tesseract element or "tessel"?)
A container for LAr voxel information. Although there's nothing in the class below that assumes units, the standard for LArSoft is that distances are in cm, and energy is in GeV.
It acts like a map<LArVoxelID,LArVoxelData>, but with additional features:
this class is designed to hold methods that access the event handle to make the various simulation lists, ie ParticleList, LArVoxelList, etc
If you haven't done so already, read the comments in front of Simulation/EveIdCalculator.h. The default calculator for the eve ID, EveIdCalculator, goes up the chain of particles in an event to return the track ID of a primary particle from the event generator. But what if you want different defintion of the eve ID? There's a way to substitute your own calculation; this class is an example of how to do it. This particular class attempts to find the "ultimate mother" for electromagnetic showers. It goes up the chain of particles in an event, until it encounters a particle that is either primary or was not produced by a "trivial" e-m process. To create your own eve ID calculation, copy this header file and change the name from "EmEveIdCalculator" to whatever name you prefer. Then copy the implementation file "EmEveIdCalculator.cxx", again changing the name to your class. Then revise the calculation in the DoCalculateEveId method to whatever you want. To use this new calculation within sim::ParticleList, use the following statement: If you've written your own calculator, subtitute it for "sim::EmEveIdCalculator" in the above statement. Just do this once, in the initialization portion of your program. (You can call it for every event, but you'll be wasting time.) It may look like there's a memory leak in the above statement, but there isn't: the "Adopt" in the method name means that ParticleList will take control of the pointer. Don't delete it; ParticleList will do that. If you're familiar with design patterns, this class makes use of the Template Method. No, this has nothing to do with C++ templates; see "Design Patterns" by Gemma et al., or "Effective C++" by Scott Meyers. If you're a good enough programmer to contemplate buffering of results or lazy evaluation, don't bother; ParticleList and EveIdCalculator already take care of this.
This is the base class for an algorithm to calculate the "eve ID". This begs two questions:- What is an eve ID?- What does it mean to be a base class? The "eve ID" is the ultimate "mother" of a particle in a shower produced by the detector simulation. Consider the following example chain of particles: TrackID Particle "Mother" 2 pi+ 0 101 nu_mu 2 102 mu+ 2 341 nu_mu_bar 102 342 nu_e 102 343 e+ 102 1022 gamma 343 1123 e+ 1022 1124 e- 1022 The "mother" (or parent) particle of track ID 1123 is 1022; the "mother" of track ID 102 is 2. The mother of ID 2 is 0 because it is a primary particle, created by the event generator instead of the detector simulation. The track IDs were originally assigned by the simulation. Each particle is stored in a simb::MCParticle object. All of the particles for a given event are stored in a sim::ParticleList object. When you are studying an event, especially one with many primary particles, it can be helpful to go up the decay chain, from "child" to mother to "grand-mother", to eventually the ultimate mother particle of the chain. The track ID of the ultimate mother is the "eve ID". In the above example, if we want the eve ID to refer to primary particles, the eve ID of track ID 1123 is 2. This class is never called directly. Instead, it's invoked indirectly via the sim::ParticleList class. For example: const sim::ParticleList* particleList = // ... from somewhere int trackID = // ... an ID you select according to some criteria int eveID = particleList->EveId( trackID ); The class below defines the eve ID to be a primary particle that comes from the event. But what if you want a different definition of the ultimate mother; for example, perhaps you only want to go up the chain of particles for basic e-m showers, but stop at more significant physics; for example, in the chain above, you might want the eve ID of track 1123 to be 343, since all the particles descended from 343 are part of the same e-m shower. You can override the default calculation of this class (the "base" calculation) with one of your own. For an example of how to do this, see EmEveIdCalculator.h. (If you're familiar with design patterns, this base class implements the Template Method. No, this has nothing to do with C++ templates; see "Design Patterns" by Gemma et al., or "Effective C++" by Scott Meyers.)
A container for a chain of particles in an event. It's a meant as a convenience for looking at a sequence of particles within a sim::ParticeList. Here's an example to illustrate the purpose and use of a list. Assume a pi+ is a primary particle in an event whose decay is modeled like this: TrackID Particle 2 pi+ 101 nu_mu 102 mu+ 341 nu_mu_bar 342 nu_e 343 e+ I'm playing around with the ParticleList for the event, and I'm interested in what produced track ID 343, which is an e+. I can use the ParticleHistory class to quickly go through the production chain: sim::ParticleList* particleList = // ... from somewhere int trackID = 343; const sim::ParticleHistory particleHistory( particleList, trackID ); for ( int i = 0; i != particleHistory.size(); ++i ) { const simb::MCParticle* particle = particleHistory[i]; // ... } In the above example: particleHistory.size() == 3 particleHistory[0] points to the particle with track ID 2 particleHistory[1] points to the particle with track ID 102 particleHistory[2] points to the particle with track ID 343 So as you go through a ParticleHistory "array," the first element is a primary particle in the event, and the last element is the particle you used to create the history. ParticleHistory looks like a vector< const simb::MCParticle* >, with the following additions: - a ParticleList() method that returns a ParticleList* to the object that's associated with the history. - an EndParticleID() method that returns the track ID of the last particle in the chain; that is, it's the second argument in the constructor.- operator<< method for ROOT display and ease of debugging.ParticleHistory behaves mostly like a vector, but it's actually a deque. This means that you can't assume that &particleHistory[0] is a continugous array of Particle*. If those two sentences mean nothing to you, don't worry about it; this only matters to folks familiar with STL. A given ParticleHistory object is associated with the ParticleList used to create it. If you delete the ParticleList (by reading in a new event, for example) then the contents of the corresponding ParticleHistory object(s) are garbage. If you create a ParticleHistory object like this: const sim::ParticleHistory ph(particleList,1123); and there is no track 1123 in the particle list, then ph.size()==0. particleHistory[0] is not necessarily a primary particle in the event. It's possible for a production chain to be broken due to simulation cuts. The first element just represents as far back we can go in the production chain given the ParticleList.
typedef std::vector<AuxDetHit> sim::AuxDetHitCollection |
Definition at line 185 of file AuxDetHit.h.
typedef std::vector<AuxDetSimChannel> sim::AuxDetSimChannelCollection |
Definition at line 107 of file AuxDetSimChannel.h.
typedef std::vector<SimEnergyDeposit> sim::SimEnergyDepositCollection |
Definition at line 228 of file SimEnergyDeposit.h.
typedef std::pair<unsigned short, std::vector<sim::IDE> > sim::TDCIDE |
List of energy deposits at the same time (on this channel)
Definition at line 125 of file SimChannel.h.
typedef std::pair< double, std::vector<sim::SDP> > sim::timePDclockSDP_t |
List of energy deposits at the same time (on this Optical Detector)
Definition at line 108 of file OpDetBacktrackerRecord.h.
enum sim::BeamType_t |
Defines category of beams to be stored in sim::BeamGateInfo.
Enumerator | |
---|---|
kUnknown |
Unknown beam type. |
kBNB |
BNB. |
kNuMI |
NuMI. |
kBeamTypeMax |
Max value of enum for iteration. |
Definition at line 9 of file BeamTypes.h.
Definition at line 14 of file SupernovaTruth.h.
const LArVoxelList sim::operator* | ( | const double & | value, |
const LArVoxelList & | list | ||
) |
Just in case: define the result of "scalar * LArVoxelList" to be the same as "LArVoxelList * scalar".
Definition at line 46 of file LArVoxelList.cxx.
References sim::LArVoxelList::LArVoxelList(), and fhicl::detail::atom::value().
const LArVoxelData sim::operator* | ( | const double & | value, |
const LArVoxelData & | data | ||
) |
Just in case: define the result of "scalar * LArVoxelData" to be the same as "LArVoxelData * scalar".
Definition at line 69 of file LArVoxelData.cxx.
References sim::LArVoxelData::LArVoxelData(), and fhicl::detail::atom::value().
bool sim::operator< | ( | const BeamGateInfo & | lhs, |
const BeamGateInfo & | rhs | ||
) |
Definition at line 48 of file BeamGateInfo.h.
References sim::BeamGateInfo::Start(), and sim::BeamGateInfo::Width().
std::ostream& sim::operator<< | ( | std::ostream & | output, |
const ParticleHistory & | list | ||
) |
Definition at line 47 of file ParticleHistory.cxx.
std::ostream& sim::operator<< | ( | std::ostream & | output, |
const LArVoxelData & | data | ||
) |
Definition at line 75 of file LArVoxelData.cxx.
References sim::LArVoxelData::begin(), sim::LArVoxelData::end(), sim::LArVoxelData::Energy(), sim::LArVoxelData::UnassignedEnergy(), and sim::LArVoxelData::VoxelID().
std::ostream& sim::operator<< | ( | std::ostream & | output, |
const LArVoxelList & | list | ||
) |
Definition at line 92 of file LArVoxelList.cxx.
References sim::LArVoxelList::begin(), sim::LArVoxelList::end(), and sim::LArVoxelList::size().
std::ostream& sim::operator<< | ( | std::ostream & | output, |
const LArVoxelID & | id | ||
) |
Put the contents on the output stream. We have a choice: write the bin number, or write the position represented by the bins. For now, let's pick writing the positions.
Definition at line 121 of file LArVoxelID.cxx.
std::ostream& sim::operator<< | ( | std::ostream & | output, |
const ParticleList & | list | ||
) |
Definition at line 352 of file ParticleList.cxx.
References sim::ParticleList::begin(), sim::ParticleList::end(), sim::ParticleList::m_archive, and sim::ParticleList::size().
std::ostream& sim::operator<< | ( | std::ostream & | output, |
const ParticleList::archived_info_type & | info | ||
) |
Definition at line 425 of file ParticleList.cxx.
std::string sim::ParticleName | ( | int | pigid | ) |
Returns a string with the name of particle the specified with PDG ID.
Definition at line 147 of file MCDumperUtils.cxx.
References util::flags::to_string().
Referenced by sim::dump::DumpGTruth(), sim::dump::DumpMCNeutrino(), and sim::dump::DumpMCParticle().
std::string sim::ParticleStatusName | ( | int | code | ) |
Describes the status of a particle (simb::MCParticle::StatusCode()
).
Definition at line 126 of file MCDumperUtils.cxx.
Referenced by sim::dump::DumpMCParticle(), evgen::NUANCEGen::ParticleStatus(), evgen::NDKGen::ParticleStatus(), and evgen::GENIEGen::ParticleStatus().
std::string sim::TruthCCNCname | ( | int | ccnc | ) |
Returns a string representing the specified process from simb::MCTruth
(CC or NC, nothing fancy).
Definition at line 32 of file MCDumperUtils.cxx.
References simb::kCC, simb::kNC, and util::flags::to_string().
Referenced by sim::dump::DumpMCNeutrino().
std::string sim::TruthInteractionTypeName | ( | int | type | ) |
Returns a string representing the specified interaction type as in simb::MCTruth
convention.
Definition at line 56 of file MCDumperUtils.cxx.
References simb::kAMNuGamma, simb::kCCCOH, simb::kCCDIS, simb::kCCQE, simb::kCCQEHyperon, simb::kCoh, simb::kCohElastic, simb::kDiffractive, simb::kDIS, simb::kElectronScattering, simb::kEM, simb::kGlashowResonance, simb::kIMDAnnihilation, simb::kInverseBetaDecay, simb::kInverseMuDecay, simb::kMEC, simb::kNCCOH, simb::kNCDIS, simb::kNCQE, simb::kNuanceOffset, simb::kNuElectronElastic, simb::kQE, simb::kRes, simb::kResCCNuBarDelta0PiMinus, simb::kResCCNuBarDeltaMinusPiPlus, simb::kResCCNuBarKaon0Lambda0, simb::kResCCNuBarNeutronEta, simb::kResCCNuBarNeutronPi0Pi0, simb::kResCCNuBarNeutronPiMinus, simb::kResCCNuBarNeutronPiPlusPiMinus, simb::kResCCNuBarNeutronRho0, simb::kResCCNuBarNeutronRhoMinus, simb::kResCCNuBarProtonPi0, simb::kResCCNuBarProtonPi0Pi0, simb::kResCCNuBarProtonPiMinus, simb::kResCCNuBarSigma0Kaon0, simb::kResCCNuBarSigmaMinusKaon0, simb::kResCCNuDelta2PlusPiMinus, simb::kResCCNuDeltaPlusPiPlus, simb::kResCCNuKaonPlusLambda0, simb::kResCCNuNeutronPi0, simb::kResCCNuNeutronPiPlus, simb::kResCCNuNeutronRhoPlus, simb::kResCCNuProtonEta, simb::kResCCNuProtonPi0Pi0, simb::kResCCNuProtonPiPlus, simb::kResCCNuProtonPiPlusPiMinus, simb::kResCCNuProtonRhoPlus, simb::kResCCNuSigmaPlusKaon0, simb::kResCCNuSigmaPlusKaonPlus, simb::kResNCNuBarNeutronPi0, simb::kResNCNuBarNeutronPiMinus, simb::kResNCNuBarProtonPi0, simb::kResNCNuBarProtonPiPlus, simb::kResNCNuNeutronPi0, simb::kResNCNuNeutronPiMinus, simb::kResNCNuProtonPi0, simb::kResNCNuProtonPiPlus, simb::kUnknownInteraction, simb::kUnUsed1, simb::kUnUsed2, simb::kWeakMix, and util::flags::to_string().
Referenced by sim::dump::DumpMCNeutrino().
std::string sim::TruthOriginName | ( | simb::Origin_t | origin | ) |
Returns a string representing the specified process origin.
Definition at line 19 of file MCDumperUtils.cxx.
References simb::kBeamNeutrino, simb::kCosmicRay, simb::kSingleParticle, simb::kSuperNovaNeutrino, simb::kUnknown, and util::flags::to_string().
Referenced by sim::dump::DumpMCTruth().
std::string sim::TruthReactionMode | ( | int | mode | ) |
Returns the "mode" of the reaction (a lesser version of interaction type).
Definition at line 42 of file MCDumperUtils.cxx.
Referenced by sim::dump::DumpMCNeutrino().
|
static |
Definition at line 388 of file ParticleList.cxx.
const double sim::kINVALID_DOUBLE = std::numeric_limits <double>::max() |
Definition at line 10 of file MCLimits.h.
Referenced by sim::MCTrack::Clear(), sim::MCShower::ClearData(), sim::MCShowerRecoAlg::Reconstruct(), and sim::MCMiniPart::Reset().
const float sim::kINVALID_FLOAT = std::numeric_limits <float>::max() |
Definition at line 12 of file MCLimits.h.
Referenced by sim::MCEnDep::Reset(), and sim::MCHit::Reset().
const int sim::kINVALID_INT = std::numeric_limits <int>::max() |
Definition at line 16 of file MCLimits.h.
Referenced by sim::MCTrack::Clear(), sim::MCShower::ClearData(), sim::MCHit::Reset(), and sim::MCMiniPart::Reset().
const unsigned int sim::kINVALID_UINT = std::numeric_limits <unsigned int>::max() |
Definition at line 14 of file MCLimits.h.
Referenced by sim::MCRecoPart::AncestorTrackID(), sim::MCTrack::Clear(), sim::MCShower::ClearData(), sim::MCRecoPart::MotherTrackID(), sim::MCTrackRecoAlg::Reconstruct(), sim::MCShowerRecoAlg::Reconstruct(), sim::MCWireCollection::Reset(), sim::MCHitCollection::Reset(), sim::MCWire::Reset(), sim::MCEnDep::Reset(), sim::MCMiniPart::Reset(), and sim::MCRecoPart::TrackToParticleIndex().
|
static |
Definition at line 28 of file sim.h.
Referenced by larg4::LArG4Ana::analyze(), opdet::SimPhotonCounter::analyze(), trkf::TrackAna::anaStitch(), larg4::ParticleListAction::BeginOfEventAction(), cheat::BackTracker::ChannelToTrackIDEs(), cheat::PhotonBackTracker::ChannelToTrackSDPs(), larg4::ParticleListAction::GetParentage(), cheat::PhotonBackTracker::OpDetToTrackSDPs(), larg4::ParticleListAction::PreTrackingAction(), sim::SimChannel::TrackIDEs(), and sim::OpDetBacktrackerRecord::TrackSDPs().