9#include "CLHEP/Random/RandFlat.h"
63 const std::vector<const TFCS1DFunction *> &functions,
64 const std::vector<float> &bin_low_edges) {
66 if (functions.size() + 1 != bin_low_edges.size()) {
67 ATH_MSG_ERROR(
"Using " << functions.size() <<
" functions needs "
68 << functions.size() + 1 <<
" bin low edges, but got "
69 << bin_low_edges.size() <<
"bins");
93 const std::vector<const TH1 *> &histograms,
94 const std::vector<float> &bin_low_edges,
float xscale) {
96 if (histograms.size() + 1 != bin_low_edges.size()) {
97 ATH_MSG_ERROR(
"Using " << histograms.size() <<
" histograms needs "
98 << histograms.size() + 1 <<
" bins, but got "
99 << bin_low_edges.size() <<
"bins");
102 std::vector<const TFCS1DFunction *> functions(histograms.size());
103 for (
unsigned int i = 0; i < histograms.size(); ++i) {
113 functions[i] =
nullptr;
127 float eta = fabs(hit.
eta());
142 <<
" eta=" << hit.
eta() <<
" phi=" << hit.
phi()
143 <<
" wiggle=" << wiggle <<
" bin=" <<
bin <<
" ["
147 double hit_phi_shifted = hit.
phi() + wiggle;
148 hit.
phi() = TVector2::Phi_mpi_pi(hit_phi_shifted);
171 bool shortprint = opt.Index(
"short") >= 0;
172 bool longprint =
msgLvl(MSG::DEBUG) || (
msgLvl(MSG::INFO) && !shortprint);
173 TString optprint = opt;
174 optprint.ReplaceAll(
"short",
"");
190 <<
IsA()->GetName() <<
" != " <<
ref.IsA()->GetName());
206 if ((f1 && !f2) || (!f1 && f2)) {
208 "compare(): different only one function pointer is nullptr");
211 if (f1->IsA() != f2->IsA()) {
212 ATH_MSG_DEBUG(
"compare(): different class types for function "
213 << i <<
": " << f1->IsA()->GetName()
214 <<
" != " << f2->IsA()->GetName());
238 std::vector<const TFCS1DFunction *> functions;
239 std::vector<float> bin_low_edges;
243 for (
float eta = 0;
eta < maxeta;
eta += maxeta / nbin) {
244 TH1 *hist = TFCS1DFunction::generate_histogram_random_gauss(
245 16, 100000, -0.0125, 0.0125, 0, 0.005);
246 bin_low_edges.push_back(
eta);
250 bin_low_edges.push_back(100);
251 wiggle_test.
initialize(functions, bin_low_edges);
260 geo->LoadGeometryFromFile(
"/afs/cern.ch/atlas/groups/Simulation/FastCaloSimV2/Geometry-ATLAS-R2-2016-01-00-01.root",
"ATLAS-R2-2016-01-00-01");
261 TString path_to_fcal_geo_files =
"/afs/cern.ch/atlas/groups/Simulation/FastCaloSimV2/";
262 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");
265 for(
float eta=-maxeta+0.01;
eta<maxeta;
eta+=maxeta/nbin) {
270 wiggle_test.
simulate_hit(hit,*simulstate,truth,extrapol);
277void TFCSHitCellMappingWiggle::LoadHistFuncs() {
282 m_LdFH =
new LoadGpuFuncHist();
292 for (
size_t i = 0;
i < fhs.
nhist; ++
i) {
294 ->get_HistoContents()
297 ->get_HistoContents()[0]);
299 ->get_HistoBordersx()[0]);
303 m_LdFH->set_hf(&fhs);
const boost::regex ref(r_ef)
Scalar eta() const
pseudorapidity method
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
CUDA_HOSTDEV float & eta()
CUDA_HOSTDEV float & phi()
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
virtual void setLevel(MSG::Level lvl)
Update outputlevel.
const std::vector< float > & get_HistoBordersx() const
static const HistoContent_t s_MaxValue
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...
void initialize(TFCS1DFunction *func)
const TFCS1DFunction * get_function(int bin) 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
void Print(Option_t *option="") const override
double get_bin_low_edge(int bin) const
double get_bin_up_edge(int bin) const
std::vector< const TFCS1DFunction * > m_functions
unsigned int get_number_of_bins() const
~TFCSHitCellMappingWiggle()
std::vector< float > m_bin_low_edge
TFCSHitCellMappingWiggle(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
virtual bool operator==(const TFCSParametrizationBase &ref) const override
The == operator compares the content of instances.
virtual void set_geometry(ICaloGeometry *geo) override
Method to set the geometry access pointer.
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
fills all hits into calorimeter cells
void Print(Option_t *option) const override
TFCSHitCellMapping(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
bool compare(const TFCSParametrizationBase &ref) const
void set_calosample(int cs)
static constexpr double init_eta_max
Do not persistify!
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!
bool compare(const TFCSParametrizationBase &ref) const
CLHEP::HepRandomEngine * randomEngine()
#define IsA
Declare the TObject style functions.