ATLAS Offline Software
PhysicsValidationTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FATRASTOOLS_PHYSICSVALIDATIONTOOL_H
6 #define ISF_FATRASTOOLS_PHYSICSVALIDATIONTOOL_H
7 
8 // Athena Base
10 #include "GaudiKernel/ToolHandle.h"
11 #include "GaudiKernel/ITHistSvc.h"
14 
15 // iFatras
17 
18 // Tracking
22 
23 #ifndef MAXCHILDREN
24 #define MAXCHILDREN 40
25 #endif
26 
27 // ROOT forward declarations
28 class TTree;
29 
30 namespace ISF {
31  class ISFParticle;
32 }
33 
34 namespace iFatras
35 {
43  class ATLAS_NOT_THREAD_SAFE PhysicsValidationTool : public extends<AthAlgTool, IPhysicsValidationTool> // deprecated: ATLASSIM-6020
44  {
45  public:
47  PhysicsValidationTool(const std::string&,const std::string&,const IInterface*);
48 
50  virtual ~PhysicsValidationTool ();
51 
53  virtual StatusCode initialize() override;
54 
56  virtual
57  void saveISFParticleInfo(const ISF::ISFParticle& isp, int endProcess, const Trk::TrackParameters* ePar, double time, double dX0 ) const override;
58 
60  virtual
61  void saveISFParticleInfo(const ISF::ISFParticle& isp, const Trk::ExtrapolationCell<Trk::TrackParameters>& ec,
62  Trk::ExtrapolationCode ecode ) const override;
63 
65  virtual
66  void saveISFParticleInfo(const ISF::ISFParticle& isp, const Trk::ExtrapolationCell<Trk::NeutralParameters>& ec,
67  Trk::ExtrapolationCode ecode ) const override;
68 
69 
70  virtual
71  void saveISFVertexInfo(int process,Amg::Vector3D vertex,const ISF::ISFParticle& isp,Amg::Vector3D primIn,
72  Amg::Vector3D* primOut, const ISF::ISFParticleVector& children) const override;
73 
74 
75  private:
77  template <class T> StatusCode retrieveTool(ToolHandle<T>& thandle){
78  if (!thandle.empty() && thandle.retrieve().isFailure()){
79  ATH_MSG_FATAL( "[ fatras setup ] Cannot retrieve " << thandle << ". Abort.");
80  return StatusCode::FAILURE;
81  }
82  else {
83  ATH_MSG_DEBUG("[ fatras setup ] Successfully retrieved " << thandle);
84  }
85  return StatusCode::SUCCESS;
86  }
87 
88  void saveInfo(const ISF::ISFParticle& isp) const;
89 
90  /*---------------------------------------------------------------------
91  * Private members
92  *---------------------------------------------------------------------*/
93 
95  std::string m_validationStream;
96 
98  // FIXME mutable variables are not thread-safe.
99  TTree *m_particles = nullptr;
100  mutable int m_pdg = 0;
101  mutable int m_scIn = 0;
102  mutable int m_scEnd = 0;
103  mutable int m_gen = 0;
104  mutable int m_geoID = 0;
105  mutable float m_pth = 0.0F;
106  mutable float m_pph = 0.0F;
107  mutable float m_p = 0.0F;
108  mutable float m_eloss;
109  mutable float m_ionloss;
110  mutable float m_radloss;
111  mutable float m_zOaTr;
112  mutable float m_wZ;
113  mutable float m_thIn;
114  mutable float m_phIn;
115  mutable float m_dIn;
116  mutable float m_thEnd;
117  mutable float m_phEnd;
118  mutable float m_dEnd;
119  mutable float m_X0;
120  mutable float m_dt;
121 
122  TTree *m_interactions;
123  mutable int m_process;
124  mutable int m_pdg_mother;
125  mutable int m_gen_mother;
126  mutable int m_nChild;
127  mutable float m_vtx_dist;
128  mutable float m_vtx_theta;
129  mutable float m_vtx_phi;
130  mutable float m_vtx_e_diff;
131  mutable float m_vtx_p_diff;
132  mutable float m_vtx_plong_diff;
133  mutable float m_vtx_pperp_diff;
134  mutable float m_p_mother;
135  mutable int m_pdg_child[MAXCHILDREN]{}; // decay product pdg code
136  mutable float m_fp_child[MAXCHILDREN]{}; // fraction of incoming momentum
137  mutable float m_oa_child[MAXCHILDREN]{}; // opening angle wrt the mother
138 
139  };
140 }
141 
142 #endif // FATRASTOOLS_TRANSPORTTOOL_H
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TrackParameters.h
iFatras::PhysicsValidationTool::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
the histogram service
Definition: PhysicsValidationTool.h:94
iFatras::PhysicsValidationTool::m_phIn
float m_phIn
Definition: PhysicsValidationTool.h:114
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
iFatras::PhysicsValidationTool::m_X0
float m_X0
Definition: PhysicsValidationTool.h:119
initialize
void initialize()
Definition: run_EoverP.cxx:894
iFatras::PhysicsValidationTool::m_ionloss
float m_ionloss
Definition: PhysicsValidationTool.h:109
ISF::ISFParticle
Definition: ISFParticle.h:42
iFatras::PhysicsValidationTool::m_vtx_p_diff
float m_vtx_p_diff
Definition: PhysicsValidationTool.h:131
iFatras::PhysicsValidationTool
Definition: PhysicsValidationTool.h:44
IPhysicsValidationTool.h
iFatras::PhysicsValidationTool::m_dt
float m_dt
Definition: PhysicsValidationTool.h:120
PdgToParticleHypothesis.h
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
iFatras::PhysicsValidationTool::m_zOaTr
float m_zOaTr
Definition: PhysicsValidationTool.h:111
iFatras::PhysicsValidationTool::m_vtx_theta
float m_vtx_theta
Definition: PhysicsValidationTool.h:128
iFatras
Definition: ActsFatrasSimTool.h:55
iFatras::PhysicsValidationTool::m_thIn
float m_thIn
Definition: PhysicsValidationTool.h:113
iFatras::PhysicsValidationTool::m_dEnd
float m_dEnd
Definition: PhysicsValidationTool.h:118
iFatras::PhysicsValidationTool::m_gen_mother
int m_gen_mother
Definition: PhysicsValidationTool.h:125
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
iFatras::PhysicsValidationTool::m_p_mother
float m_p_mother
Definition: PhysicsValidationTool.h:134
AthAlgTool.h
ISF::ISFParticleVector
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
Definition: ISFParticleContainer.h:26
Trk::ExtrapolationCode
Definition: ExtrapolationCell.h:105
Trk::ParametersBase
Definition: ParametersBase.h:55
ParticleHypothesis.h
IAtRndmGenSvc.h
iFatras::PhysicsValidationTool::m_eloss
float m_eloss
Definition: PhysicsValidationTool.h:108
iFatras::PhysicsValidationTool::m_interactions
TTree * m_interactions
ROOT tree containing vertex info.
Definition: PhysicsValidationTool.h:122
iFatras::PhysicsValidationTool::m_vtx_plong_diff
float m_vtx_plong_diff
Definition: PhysicsValidationTool.h:132
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
iFatras::PhysicsValidationTool::m_vtx_phi
float m_vtx_phi
Definition: PhysicsValidationTool.h:129
iFatras::PhysicsValidationTool::m_validationStream
std::string m_validationStream
validation THist stream name
Definition: PhysicsValidationTool.h:95
iFatras::PhysicsValidationTool::retrieveTool
StatusCode retrieveTool(ToolHandle< T > &thandle)
templated Tool retrieval - gives unique handling & look and feel
Definition: PhysicsValidationTool.h:77
iFatras::PhysicsValidationTool::m_dIn
float m_dIn
Definition: PhysicsValidationTool.h:115
iFatras::PhysicsValidationTool::m_radloss
float m_radloss
Definition: PhysicsValidationTool.h:110
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
iFatras::PhysicsValidationTool::m_nChild
int m_nChild
Definition: PhysicsValidationTool.h:126
Trk::ExtrapolationCell
Definition: ExtrapolationCell.h:231
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
iFatras::PhysicsValidationTool::m_wZ
float m_wZ
Definition: PhysicsValidationTool.h:112
python.DecayParser.children
children
Definition: DecayParser.py:32
iFatras::PhysicsValidationTool::m_phEnd
float m_phEnd
Definition: PhysicsValidationTool.h:117
iFatras::PhysicsValidationTool::m_pdg_mother
int m_pdg_mother
Definition: PhysicsValidationTool.h:124
iFatras::PhysicsValidationTool::m_vtx_e_diff
float m_vtx_e_diff
Definition: PhysicsValidationTool.h:130
iFatras::PhysicsValidationTool::m_process
int m_process
Definition: PhysicsValidationTool.h:123
checker_macros.h
Define macros for attributes used to control the static checker.
iFatras::PhysicsValidationTool::m_vtx_dist
float m_vtx_dist
Definition: PhysicsValidationTool.h:127
iFatras::PhysicsValidationTool::m_thEnd
float m_thEnd
Definition: PhysicsValidationTool.h:116
iFatras::PhysicsValidationTool::m_vtx_pperp_diff
float m_vtx_pperp_diff
Definition: PhysicsValidationTool.h:133
MAXCHILDREN
#define MAXCHILDREN
Definition: PhysicsValidationTool.h:24
ServiceHandle< ITHistSvc >