 |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "HepPDT/ParticleData.hh"
17 #if defined(__FastCaloSimStandAlone__)
18 #include "CLHEP/Random/TRandomEngine.h"
20 #include <CLHEP/Random/RanluxEngine.h>
29 #include "CLHEP/Random/RandFlat.h"
50 float eta_center, phi_center;
54 if (eta_center > 1.4) {
65 const float Ekin = truth->
Ekin();
68 Einit = simulstate.
E();
75 get_event(simulstate, eta_center, phi_center, Einit, reference_layer_index);
77 for (
long unsigned int layer_index = 0;
83 simulstate.
set_E(layer_index, 0);
84 simulstate.
add_E(layer_index, layer_energy);
89 simulstate.
set_Efrac(ilayer, simulstate.
E(ilayer) / simulstate.
E());
108 const double center_r = hit.
center_r();
109 const double center_z = hit.
center_z();
111 ATH_MSG_VERBOSE(
" Layer " << layer_index <<
" Extrap eta " << center_eta
112 <<
" phi " << center_phi <<
" R " << center_r);
114 const float dist000 = TMath::Sqrt(center_r * center_r + center_z * center_z);
115 const float eta_jakobi = TMath::Abs(2.0 * TMath::Exp(-center_eta) /
116 (1.0 + TMath::Exp(-2 * center_eta)));
118 long unsigned int hit_index = hit.
idx();
135 if (center_eta < 0.) {
136 delta_eta_mm = -delta_eta_mm;
144 delta_phi_mm = -delta_phi_mm;
146 const float delta_eta = delta_eta_mm / eta_jakobi / dist000;
147 const float delta_phi = delta_phi_mm / center_r;
149 hit.
eta() = center_eta + delta_eta;
153 <<
" layer " << layer_index);
156 const float hit_r =
r *
cos(
alpha) + center_r;
165 hit.
x() = hit_r *
cos(hit_phi);
166 hit.
y() = hit_r *
sin(hit_phi);
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
virtual ~TFCSBinnedShowerBase()
virtual float get_layer_energy(TFCSSimulationState &simulstate, long unsigned int layer_index) const =0
bool OnlyScaleEnergy() const
#define ATH_MSG_VERBOSE(x)
__HOSTDEV__ double Phi_mpi_pi(double)
void add_E(int sample, double Esample)
TFCSBinnedShowerBase(const char *name=nullptr, const char *title=nullptr)
long unsigned int & idx()
void set_E(int sample, double Esample)
double charge(const T &p)
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
simulated one hit position with some energy.
def delta_phi(phi1, phi2)
virtual void get_event(TFCSSimulationState &simulstate, float eta_center, float phi_center, float e_init, long unsigned int reference_layer_index) const =0
do not persistify
virtual std::tuple< float, float, float > get_hit_position_and_energy(TFCSSimulationState &simulstate, long unsigned int layer_index, long unsigned int hit_index) const =0
void reset_OnlyScaleEnergy()
virtual FCSReturnCode simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Method in all derived classes to do some simulation.
void set_Efrac(int sample, double Efracsample)