k4SimGeant4
Loading...
Searching...
No Matches
SimG4ParticleSmearRootFile.h
Go to the documentation of this file.
1#ifndef SIMG4FAST_G4PARTICLESMEARROOTFILE_H
2#define SIMG4FAST_G4PARTICLESMEARROOTFILE_H
3
4// Gaudi
5#include "GaudiKernel/AlgTool.h"
6#include "GaudiKernel/RndmGenerators.h"
7class IRndmGenSvc;
8class IRndmGen;
9
10// ROOT
11#include "TGraph.h"
12
13// FCCSW
15
31class SimG4ParticleSmearRootFile : public AlgTool, virtual public ISimG4ParticleSmearTool {
32public:
33 explicit SimG4ParticleSmearRootFile(const std::string& type, const std::string& name, const IInterface* parent);
35
39 virtual StatusCode initialize() final;
43 virtual StatusCode finalize() final;
49 virtual StatusCode smearMomentum(CLHEP::Hep3Vector& aMom, int aPdg = 0) final;
53 StatusCode readResolutions();
59 double resolution(double aEta, double aMom);
60
68 virtual StatusCode checkConditions(double aMinMomentum, double aMaxMomentum, double aMaxEta) const final;
69
70private:
72 SmartIF<IRndmGenSvc> m_randSvc;
74 IRndmGen* m_gauss;
77 std::map<double, TGraph> m_momentumResolutions;
79 Gaudi::Property<std::string> m_resolutionFileName{this, "filename", "",
80 "File name with the resolutions obtained from root file"};
86 double m_maxEta;
87};
88
89#endif /* SIMG4FAST_G4PARTICLESMEARROOTFILE_H */
Interface to the particle smearing tool.
Definition ISimG4ParticleSmearTool.h:20
Root file particle smearing tool.
Definition SimG4ParticleSmearRootFile.h:31
SimG4ParticleSmearRootFile(const std::string &type, const std::string &name, const IInterface *parent)
Definition SimG4ParticleSmearRootFile.cpp:20
IRndmGen * m_gauss
Gaussian random number generator used for smearing with a constant resolution (m_sigma)
Definition SimG4ParticleSmearRootFile.h:74
virtual StatusCode initialize() final
Initialize the tool and a random number generator.
Definition SimG4ParticleSmearRootFile.cpp:28
double m_maxMomentum
maximum momentum defined in the resolution file
Definition SimG4ParticleSmearRootFile.h:84
StatusCode readResolutions()
Read the file with the resolutions.
Definition SimG4ParticleSmearRootFile.cpp:56
SmartIF< IRndmGenSvc > m_randSvc
Random Number Service.
Definition SimG4ParticleSmearRootFile.h:72
double resolution(double aEta, double aMom)
Read the file with the resolutions.
Definition SimG4ParticleSmearRootFile.cpp:122
std::map< double, TGraph > m_momentumResolutions
Map of p-dependent resolutions and the end of eta bin that it refers to (lower end is defined by prev...
Definition SimG4ParticleSmearRootFile.h:77
virtual StatusCode checkConditions(double aMinMomentum, double aMaxMomentum, double aMaxEta) const final
Check conditions of the smearing model, especially if the given parametrs do not exceed the parameter...
Definition SimG4ParticleSmearRootFile.cpp:133
double m_minMomentum
minimum momentum defined in the resolution file
Definition SimG4ParticleSmearRootFile.h:82
Gaudi::Property< std::string > m_resolutionFileName
File name with the resolutions obtained from root file (set by job options)
Definition SimG4ParticleSmearRootFile.h:79
virtual StatusCode finalize() final
Finalize.
Definition SimG4ParticleSmearRootFile.cpp:44
virtual ~SimG4ParticleSmearRootFile()
Definition SimG4ParticleSmearRootFile.cpp:26
double m_maxEta
maximum pseudorapidity defined in the resolution file
Definition SimG4ParticleSmearRootFile.h:86
virtual StatusCode smearMomentum(CLHEP::Hep3Vector &aMom, int aPdg=0) final
Smear the momentum of the particle.
Definition SimG4ParticleSmearRootFile.cpp:46