Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <TruthTestTool.h>
Definition at line 13 of file TruthTestTool.h.
◆ TruthTestTool()
TruthTestTool::TruthTestTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ getPrimary()
◆ initialize()
StatusCode TruthTestTool::initialize |
( |
| ) |
|
|
overridevirtual |
Reimplemented from SimTestToolBase.
Definition at line 37 of file TruthTestTool.cxx.
42 std::string histdirname(
"Truth");
43 if (
m_key!=
"TruthEvent") {
120 _SET_TITLE(
m_particle_status,
"Particle Status (1==undecayed, 2==decayed, 4==beam particle)",
"GenParticle Status",
"N GenParticles");
122 _SET_TITLE(
m_particle_type,
"Type (Type 0 = PDG 22, 1=11, 2=13,15, 3=111,211, 4=130,310,311,321, 5=2122, 6=2212, 7=else)",
"Particle Type (negative for anti-particles)",
"N Particles");
131 _SET_TITLE(
m_p_gen,
"momentum distribution of generator particles",
"p",
"dN/dp [1/MeV]");
133 _SET_TITLE(
m_log_p_gen,
"momentum distribution of generator particles",
"log(p)",
"dN/dlog(p) [1/log(MeV)]");
139 return StatusCode::SUCCESS;
◆ processEvent()
StatusCode TruthTestTool::processEvent |
( |
| ) |
|
|
overridevirtual |
Definition at line 143 of file TruthTestTool.cxx.
148 const int evtnum(
eventInfo->eventNumber());
154 if (currentGenEventIter!=mcCollection->
end() ) {
158 if (!vtx && (*currentGenEventIter)->vertices().size()>0) vtx=((*currentGenEventIter)->vertices()).front();
160 if (!vtx && (*currentGenEventIter)->vertices_size()>0) vtx=*((*currentGenEventIter)->vertices_begin());
164 m_x_vert->Fill( vtx->position().x() );
165 m_y_vert->Fill( vtx->position().y() );
166 m_z_vert->Fill( vtx->position().z() );
174 for (
const auto& vtx: (*currentGenEventIter)->vertices()) {
176 for (HepMC::GenEvent::vertex_const_iterator vtxit=(*currentGenEventIter)->vertices_begin();
177 vtxit!=(*currentGenEventIter)->vertices_end();++vtxit) {
181 double x = vtx->position().x();
182 double y = vtx->position().y();
183 double z = vtx->position().z();
184 double r = std::sqrt(
x*
x+
y*
y);
212 for (;currentGenEventIter!=mcCollection->
end(); ++currentGenEventIter) {
215 sprintf(
fname,
"%s.event%d.txt",
m_key.c_str(),evtnum);
216 std::ofstream of(
fname);
221 int npart_prim=0, npart_sec=0;
222 for (
const auto& currentGenParticle: *(*currentGenEventIter)) {
224 const HepMC::FourVector
mom = currentGenParticle->momentum();
235 if(std::abs(currentGenParticle->pdg_id())==211) {
242 int pdg = currentGenParticle->pdg_id();
244 switch ( abs(pdg) ) {
278 if ( !is_simulation ) {
293 m_n_part->Fill(npart_prim+npart_sec);
297 return StatusCode::SUCCESS;
◆ m_eta_gen
TH1 * TruthTestTool::m_eta_gen |
|
private |
◆ m_eta_truth
TH1 * TruthTestTool::m_eta_truth |
|
private |
◆ m_eventInfoKey
◆ m_histSvc
◆ m_key
std::string SimTestToolBase::m_key |
|
protectedinherited |
◆ m_log_p_gen
TH1 * TruthTestTool::m_log_p_gen |
|
private |
◆ m_log_pt_truth
TH1 * TruthTestTool::m_log_pt_truth |
|
private |
◆ m_mcEventDump
int TruthTestTool::m_mcEventDump |
|
private |
◆ m_meanx_vert
TH1* TruthTestTool::m_meanx_vert |
|
private |
◆ m_meany_vert
TH1 * TruthTestTool::m_meany_vert |
|
private |
◆ m_meanz_vert
TH1 * TruthTestTool::m_meanz_vert |
|
private |
◆ m_n_generations
TH1* TruthTestTool::m_n_generations |
|
private |
◆ m_n_part
TH1 * TruthTestTool::m_n_part |
|
private |
◆ m_n_part_prim
TH1* TruthTestTool::m_n_part_prim |
|
private |
◆ m_n_part_sec
TH1 * TruthTestTool::m_n_part_sec |
|
private |
◆ m_n_vert
TH1* TruthTestTool::m_n_vert |
|
private |
◆ m_n_vert_prim
TH1* TruthTestTool::m_n_vert_prim |
|
private |
◆ m_n_vert_sec
TH1 * TruthTestTool::m_n_vert_sec |
|
private |
◆ m_origin
TH1* TruthTestTool::m_origin |
|
private |
◆ m_p_gen
TH1* TruthTestTool::m_p_gen |
|
private |
◆ m_particle_status
TH1* TruthTestTool::m_particle_status |
|
private |
◆ m_particle_type
TH1 * TruthTestTool::m_particle_type |
|
private |
◆ m_path
std::string SimTestHisto::m_path {"/truth/"} |
|
protectedinherited |
◆ m_phi_gen
TH1 * TruthTestTool::m_phi_gen |
|
private |
◆ m_phi_truth
TH1 * TruthTestTool::m_phi_truth |
|
private |
◆ m_pion_mass
TH1 * TruthTestTool::m_pion_mass |
|
private |
◆ m_pt_truth
TH1 * TruthTestTool::m_pt_truth |
|
private |
◆ m_px_truth
TH1* TruthTestTool::m_px_truth |
|
private |
◆ m_py_truth
TH1 * TruthTestTool::m_py_truth |
|
private |
◆ m_pz_truth
TH1 * TruthTestTool::m_pz_truth |
|
private |
◆ m_theta_truth
TH1* TruthTestTool::m_theta_truth |
|
private |
◆ m_vtx_r
TH1* TruthTestTool::m_vtx_r |
|
private |
◆ m_vtx_xy_indet
TH2 * TruthTestTool::m_vtx_xy_indet |
|
private |
◆ m_vtx_z
TH1 * TruthTestTool::m_vtx_z |
|
private |
◆ m_vtx_zr_indet
TH2* TruthTestTool::m_vtx_zr_indet |
|
private |
◆ m_x_vert
TH1* TruthTestTool::m_x_vert |
|
private |
◆ m_y_vert
TH1 * TruthTestTool::m_y_vert |
|
private |
◆ m_z_vert
TH1 * TruthTestTool::m_z_vert |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
Const iterator class for DataVector/DataList.
#define _SET_TITLE(var, title, xaxis, yaxis)
void line(std::ostream &os, const GenEvent &e)
#define _TH1D(var, name, nbin, xmin, xmax)
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
#define _TH2D(var, name, nbinx, xmin, xmax, nbiny, ymin, ymax)
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (TODO migrate to be based on status).
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
GenVertex * signal_process_vertex(const GenEvent *e)