|
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"
29 m_r_offset(0), m_r_scale(1.0) {
42 int first_fix_bin = -1;
46 << GetTitle() <<
", bin[" <<
i
52 if (first_fix_bin < 0)
55 if (first_fix_bin == 0) {
58 <<
" for all bins. Fixed to probability 1 causing hits "
59 "to be deposited in the shower center");
61 int last_fix_bin = -1;
65 << GetTitle() <<
", bin[" <<
i
72 << GetTitle() <<
". Fixed up to bin " << last_fix_bin
73 <<
" with probability 0 and beyond bin " << first_fix_bin
74 <<
" with probability 1.");
109 const int pdgId = truth->
pdgid();
115 const double center_r = hit.
center_r();
116 const double center_z = hit.
center_z();
118 if (TMath::IsNaN(center_r) or TMath::IsNaN(center_z) or
119 TMath::IsNaN(center_eta) or
120 TMath::IsNaN(center_phi)) {
124 float alpha,
r, rnd1, rnd2;
125 rnd1 = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
126 rnd2 = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
140 if (TMath::IsNaN(alpha) || TMath::IsNaN(
r)) {
144 <<
" bins, #hits=" <<
m_nhits <<
" alpha=" << alpha
145 <<
" r=" <<
r <<
" rnd1=" << rnd1 <<
" rnd2=" << rnd2);
158 float delta_eta_mm =
r *
cos(alpha);
159 float delta_phi_mm =
r *
sin(alpha);
164 delta_eta_mm = -delta_eta_mm;
168 if ((
charge < 0. && pdgId!=11) || pdgId==-11)
169 delta_phi_mm = -delta_phi_mm;
171 const float dist000 = TMath::Sqrt(center_r * center_r + center_z * center_z);
172 const float eta_jakobi = TMath::Abs(2.0 * TMath::Exp(-center_eta) /
173 (1.0 + TMath::Exp(-2 * center_eta)));
175 const float delta_eta = delta_eta_mm / eta_jakobi / dist000;
176 const float delta_phi = delta_phi_mm / center_r;
182 <<
" phi=" << hit.
phi() <<
" z=" << hit.
z()
183 <<
" r=" <<
r <<
" alpha=" << alpha);
203 std::unique_ptr<TFile>
inputfile(TFile::Open(filepath,
"READ"));
209 if (inputShape ==
nullptr)
221 bool shortprint =
opt.Index(
"short") >= 0;
223 TString optprint =
opt;
224 optprint.ReplaceAll(
"short",
"");
233 <<
", r offset=" <<
m_r_offset <<
"mm (phi symmetric)");
239 <<
", r offset=" <<
m_r_offset <<
"mm (not phi symmetric)");
245 void TFCSHistoLateralShapeParametrization::LoadHistFuncs() {
251 FH2D fh = {0, 0, 0, 0, 0};
261 m_LdFH->set_hf2d(&
fh);
virtual void reset_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...
const std::vector< float > & get_HistoContents() const
void Print(Option_t *option="") const override
TFCSHistoLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)
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
CLHEP::HepRandomEngine * randomEngine()
void Initialize(TH2 *hist)
const std::vector< float > & get_HistoBordersy() const
bool Initialize(TH2 *hist)
Init from histogram.
~TFCSHistoLateralShapeParametrization()
virtual void set_geometry(ICaloGeometry *geo)
Method to set the geometry access pointer.
virtual void set_geometry(ICaloGeometry *geo) override
will actually not store the geometry information, but rather used to check the validity of the 2D sha...
virtual void rnd_to_fct(float &valuex, float &valuey, float rnd0, float rnd1) const
bool is_phi_symmetric() const
double charge(const T &p)
#define ATH_MSG_WARNING(x)
def delta_phi(phi1, phi2)
TFCS2DFunctionHistogram m_hist
Histogram to be used for the shape simulation.
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 setEtaPhiZE(float eta, float phi, float z, float E)
const std::vector< float > & get_HistoBordersx() const
void Print(Option_t *option="") const override
virtual unsigned int size() const
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
void set_number_of_hits(float nhits)
set the integral of the histogram to the desired number of hits