|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include "CLHEP/Random/RandFlat.h"
51 const std::vector<const TFCS1DFunction *> &functions,
52 const std::vector<float> &bin_low_edges) {
53 if (functions.size() + 1 != bin_low_edges.size()) {
54 ATH_MSG_ERROR(
"Using " << functions.size() <<
" functions needs "
55 << functions.size() + 1 <<
" bin low edges, but got "
56 << bin_low_edges.size() <<
"bins");
80 const std::vector<float> &bin_low_edges,
float xscale) {
81 if (
histograms.size() + 1 != bin_low_edges.size()) {
84 << bin_low_edges.size() <<
"bins");
87 std::vector<const TFCS1DFunction *> functions(
histograms.size());
98 functions[
i] =
nullptr;
112 float eta = fabs(hit.
eta());
122 double rnd = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
127 <<
" eta=" << hit.
eta() <<
" phi=" << hit.
phi()
128 <<
" wiggle=" << wiggle <<
" bin=" <<
bin <<
" ["
132 double hit_phi_shifted = hit.
phi() + wiggle;
156 bool shortprint =
opt.Index(
"short") >= 0;
158 TString optprint =
opt;
159 optprint.ReplaceAll(
"short",
"");
175 <<
IsA()->GetName() <<
" != " <<
ref.IsA()->GetName());
193 "compare(): different only one function pointer is nullptr");
196 if (
f1->IsA() !=
f2->IsA()) {
197 ATH_MSG_DEBUG(
"compare(): different class types for function "
198 <<
i <<
": " <<
f1->IsA()->GetName()
199 <<
" != " <<
f2->IsA()->GetName());
211 void TFCSHitCellMappingWiggle::unit_test
223 std::vector<const TFCS1DFunction *> functions;
224 std::vector<float> bin_low_edges;
228 for (
float eta = 0;
eta < maxeta;
eta += maxeta / nbin) {
229 TH1 *
hist = TFCS1DFunction::generate_histogram_random_gauss(
230 16, 100000, -0.0125, 0.0125, 0, 0.005);
231 bin_low_edges.push_back(
eta);
235 bin_low_edges.push_back(100);
236 wiggle_test.
initialize(functions, bin_low_edges);
241 #if 0 // defined(__FastCaloSimStandAlone__)
245 geo->LoadGeometryFromFile(
"/afs/cern.ch/atlas/groups/Simulation/FastCaloSimV2/Geometry-ATLAS-R2-2016-01-00-01.root",
"ATLAS-R2-2016-01-00-01");
246 TString path_to_fcal_geo_files =
"/afs/cern.ch/atlas/groups/Simulation/FastCaloSimV2/";
247 geo->LoadFCalGeometryFromFiles(path_to_fcal_geo_files +
"FCal1-electrodes.sorted.HV.09Nov2007.dat", path_to_fcal_geo_files +
"FCal2-electrodes.sorted.HV.April2011.dat", path_to_fcal_geo_files +
"FCal3-electrodes.sorted.HV.09Nov2007.dat");
250 for(
float eta=-maxeta+0.01;
eta<maxeta;
eta+=maxeta/nbin) {
262 void TFCSHitCellMappingWiggle::LoadHistFuncs() {
277 for (
size_t i = 0;
i < fhs.
nhist; ++
i) {
279 ->get_HistoContents()
282 ->get_HistoContents()[0]);
284 ->get_HistoBordersx()[0]);
288 m_LdFH->set_hf(&fhs);
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
bool compare(const TFCSParametrizationBase &ref) const
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
modify one hit position to emulate the LAr accordeon shape and then fills all hits into calorimeter c...
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!
void Print(Option_t *option) const override
double get_bin_low_edge(int bin) const
#define IsA
Declare the TObject style functions.
double get_bin_up_edge(int bin) const
unsigned int get_number_of_bins() const
TFCSHitCellMappingWiggle(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
Scalar eta() const
pseudorapidity method
bool compare(const TFCSParametrizationBase &ref) const
virtual void rnd_to_fct(float value[], const float rnd[]) const
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function valu...
virtual void set_geometry(ICaloGeometry *geo) override
Method to set the geometry access pointer.
static constexpr double init_eta_max
Do not persistify!
void TFCSHitCellMappingWiggle::unit_test ATLAS_NOT_THREAD_SAFE(TFCSSimulationState *simulstate, TFCSTruthState *truth, TFCSExtrapolationState *extrapol)
CLHEP::HepRandomEngine * randomEngine()
__HOSTDEV__ double Phi_mpi_pi(double)
void initialize(TFCS1DFunction *func)
void Print(Option_t *option="") const override
std::vector< float > m_bin_low_edge
void set_calosample(int cs)
~TFCSHitCellMappingWiggle()
static const HistoContent_t s_MaxValue
CUDA_HOSTDEV float & phi()
virtual void setLevel(MSG::Level lvl)
Update outputlevel.
const TFCS1DFunction * get_function(int bin) const
bool compare(const TFCSParametrizationBase &ref) const
const boost::regex ref(r_ef)
CUDA_HOSTDEV float & eta()
virtual bool operator==(const TFCSParametrizationBase &ref) const override
The == operator compares the content of instances.
const std::vector< float > & get_HistoBordersx() const
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
fills all hits into calorimeter cells
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
std::vector< const TFCS1DFunction * > m_functions