|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include "CLHEP/Random/RandFlat.h"
6 #include "CLHEP/Random/RandPoisson.h"
17 #include "HepPDT/ParticleData.hh"
18 #include "HepPDT/ParticleDataTable.hh"
70 const int pdgId = truth->
pdgid();
76 const double center_r = hit.
center_r();
77 const double center_z = hit.
center_z();
79 if (TMath::IsNaN(center_r) or TMath::IsNaN(center_z) or
80 TMath::IsNaN(center_eta) or
81 TMath::IsNaN(center_phi)) {
85 float alpha,
r, rnd1, rnd2;
86 rnd1 = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
87 rnd2 = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
101 if (TMath::IsNaN(alpha) || TMath::IsNaN(
r)) {
103 <<
" r=" <<
r <<
" rnd1=" << rnd1
104 <<
" rnd2=" << rnd2);
112 float delta_eta_mm =
r *
cos(alpha);
113 float delta_phi_mm =
r *
sin(alpha);
118 delta_eta_mm = -delta_eta_mm;
122 if ((
charge < 0. && pdgId!=11) || pdgId==-11)
123 delta_phi_mm = -delta_phi_mm;
125 const float dist000 = TMath::Sqrt(center_r * center_r + center_z * center_z);
126 const float eta_jakobi = TMath::Abs(2.0 * TMath::Exp(-center_eta) /
127 (1.0 + TMath::Exp(-2 * center_eta)));
129 const float delta_eta = delta_eta_mm / eta_jakobi / dist000;
130 const float delta_phi = delta_phi_mm / center_r;
136 <<
" phi=" << hit.
phi() <<
" z=" << hit.
z()
137 <<
" r=" <<
r <<
" alpha=" << alpha);
158 bool shortprint =
opt.Index(
"short") >= 0;
160 TString optprint =
opt;
161 optprint.ReplaceAll(
"short",
"");
167 <<
" (phi symmetric)");
170 <<
" (not phi symmetric)");
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
simulated one hit position with weight that should be put into simulstate sometime later all hit weig...
virtual double get_sigma2_fluctuation(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
default for this class is to simulate get_number_of_expected_hits() hits, which gives fluctuations si...
void Print(Option_t *option="") const override
CLHEP::HepRandomEngine * randomEngine()
virtual void Print(Option_t *option="") const override
virtual void rnd_to_fct(float &valuex, float &valuey, float rnd0, float rnd1) const =0
TFCS2DFunctionLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)
~TFCS2DFunctionLateralShapeParametrization()
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
default for this class is to simulate get_number_of_expected_hits() hits
virtual void reset_phi_symmetric()
bool Initialize(TFCS2DFunction *func, float nhits=-1)
Init from function.
void set_number_of_hits(float nhits)
set the desired number of hits
double charge(const T &p)
def delta_phi(phi1, phi2)
void setEtaPhiZE(float eta, float phi, float z, float E)
bool is_phi_symmetric() const
TFCS2DFunction * m_function
Histogram to be used for the shape simulation.
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.