Stable/Interacting particle filter for HepMC particles to be used in the stack filling process.
More...
#include <GenParticleSimAcceptList.h>
|
| bool | pass (const HepMC::GenParticle &particle, std::vector< int > &used_vertices) const |
| | returns true if the the particle and all daughters are on the accept list
|
|
| StringArrayProperty | m_acceptLists {this, "AcceptLists", {"G4particle_acceptlist.txt"} } |
| | The location of the accept lists.
|
| std::vector< long int > | m_pdgId |
| | Allowed PDG IDs.
|
| BooleanProperty | m_qs {this, "QuasiStableSim", true} |
| | Switch for quasi-stable particle simulation.
|
| BooleanProperty | m_useShadowEvent {this, "UseShadowEvent", false, "New approach to selecting particles for simulation" } |
| DoubleProperty | m_minDecayRadiusQS {this, "MinimumDecayRadiusQS", 30.19*Gaudi::Units::mm} |
| | Decay radius below which QS particles should be ignored.
|
Stable/Interacting particle filter for HepMC particles to be used in the stack filling process.
Checks this particle and all daughters.
- Author
- ZLMarshall -at- lbl.gov
Definition at line 31 of file GenParticleSimAcceptList.h.
◆ GenParticleSimAcceptList()
| ISF::GenParticleSimAcceptList::GenParticleSimAcceptList |
( |
const std::string & | t, |
|
|
const std::string & | n, |
|
|
const IInterface * | p ) |
◆ ~GenParticleSimAcceptList()
| ISF::GenParticleSimAcceptList::~GenParticleSimAcceptList |
( |
| ) |
|
|
inline |
◆ finalize()
| StatusCode ISF::GenParticleSimAcceptList::finalize |
( |
| ) |
|
|
finaloverridevirtual |
◆ initialize()
| StatusCode ISF::GenParticleSimAcceptList::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Athena algtool's Hooks.
Definition at line 31 of file GenParticleSimAcceptList.cxx.
32{
34
35
37
39
41 std::ifstream white_list;
42 white_list.open( resolvedFilename );
43 if (!white_list.is_open()){
45 return StatusCode::FAILURE;
46 }
47
48
49 std::string a_line;
50 char * pEnd;
51 while (!white_list.eof()){
52 getline( white_list , a_line );
53 long int pdg = strtol( a_line.c_str() , &pEnd , 10 );
56 } else {
57 ATH_MSG_DEBUG(
"pdgId " << pdg <<
" already in acceptlist. Will not add it again.");
58 }
59 }
60
61
63 }
64
65
66 return StatusCode::SUCCESS;
67}
StringArrayProperty m_acceptLists
The location of the accept lists.
std::vector< long int > m_pdgId
Allowed PDG IDs.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
◆ pass() [1/2]
| bool ISF::GenParticleSimAcceptList::pass |
( |
const HepMC::GenParticle & | particle | ) |
const |
|
overridevirtual |
passes through to the private version
passes through to the private version of the filter
Definition at line 97 of file GenParticleSimAcceptList.cxx.
98{
99
100 ATH_MSG_VERBOSE(
"Checking whether " << particle <<
" passes the filter." );
101
102 std::vector<int> vertices(500);
103 bool so_far_so_good =
pass( particle , vertices );
104
105
106 if (so_far_so_good &&
particle.production_vertex() &&
m_qs){
107 for (HepMC::GenVertex::particle_iterator it =
particle.production_vertex()->particles_begin(HepMC::parents);
108 it !=
particle.production_vertex()->particles_end(HepMC::parents); ++it){
109
111
112 vertices.clear();
113 bool parent_all_clear =
pass( **it , vertices );
115 "\nIf true, will not pass the daughter because it should have been picked up through the parent already (to avoid multi-counting)." );
116 so_far_so_good = so_far_so_good && !parent_all_clear;
117 }
118 }
119
120 return so_far_so_good;
121}
BooleanProperty m_qs
Switch for quasi-stable particle simulation.
virtual bool pass(const HepMC::GenParticle &particle) const override
passes through to the private version
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
◆ pass() [2/2]
| bool ISF::GenParticleSimAcceptList::pass |
( |
const HepMC::GenParticle & | particle, |
|
|
std::vector< int > & | used_vertices ) const |
|
private |
returns true if the the particle and all daughters are on the accept list
Definition at line 168 of file GenParticleSimAcceptList.cxx.
169{
170
172
174
176
177
178
179
181 if (passFilter) {
182
183 if ( std::find( used_vertices.begin() , used_vertices.end() ,
HepMC::uniqueID(
particle.end_vertex()) )==used_vertices.end() ){
185 for (HepMC::GenVertex::particle_iterator it =
particle.end_vertex()->particles_begin(HepMC::children);
186 it !=
particle.end_vertex()->particles_end(HepMC::children); ++it){
188 if (!passFilter) {
190 break;
191 }
192 }
193 }
194 }
195 else {
197 }
198 }
200 ATH_MSG_ERROR(
"Found a particle with no end vertex that does not appear in the accept list." );
201 ATH_MSG_ERROR(
"This is VERY likely pointing to a problem with either the configuration you ");
202 ATH_MSG_ERROR(
"are using, or a bug in the generator. Either way it should be fixed. The");
203 ATH_MSG_ERROR(
"particle will come next, and then we will throw.");
205 throw std::runtime_error("GenParticleSimAcceptList: Particle with no end vertex and not in acceptlist");
206 }
207
209}
Scalar perp() const
perp method - perpendicular length
DoubleProperty m_minDecayRadiusQS
Decay radius below which QS particles should be ignored.
BooleanProperty m_useShadowEvent
bool isDecayed(const T &p)
Identify if the particle decayed.
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
◆ m_acceptLists
| StringArrayProperty ISF::GenParticleSimAcceptList::m_acceptLists {this, "AcceptLists", {"G4particle_acceptlist.txt"} } |
|
private |
The location of the accept lists.
Definition at line 58 of file GenParticleSimAcceptList.h.
58{this, "AcceptLists", {"G4particle_acceptlist.txt"} };
◆ m_minDecayRadiusQS
| DoubleProperty ISF::GenParticleSimAcceptList::m_minDecayRadiusQS {this, "MinimumDecayRadiusQS", 30.19*Gaudi::Units::mm} |
|
private |
Decay radius below which QS particles should be ignored.
Definition at line 62 of file GenParticleSimAcceptList.h.
62{this, "MinimumDecayRadiusQS", 30.19*Gaudi::Units::mm};
◆ m_pdgId
| std::vector<long int> ISF::GenParticleSimAcceptList::m_pdgId |
|
private |
◆ m_qs
| BooleanProperty ISF::GenParticleSimAcceptList::m_qs {this, "QuasiStableSim", true} |
|
private |
◆ m_useShadowEvent
| BooleanProperty ISF::GenParticleSimAcceptList::m_useShadowEvent {this, "UseShadowEvent", false, "New approach to selecting particles for simulation" } |
|
private |
Definition at line 61 of file GenParticleSimAcceptList.h.
61{this, "UseShadowEvent", false, "New approach to selecting particles for simulation" };
The documentation for this class was generated from the following files: