|
ATLAS Offline Software
|
Go to the documentation of this file.
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");
94 const std::vector<float> &bin_low_edges,
float xscale) {
96 if (
histograms.size() + 1 != bin_low_edges.size()) {
99 << bin_low_edges.size() <<
"bins");
102 std::vector<const TFCS1DFunction *> functions(
histograms.size());
113 functions[
i] =
nullptr;
127 float eta = fabs(hit.
eta());
137 double rnd = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
142 <<
" eta=" << hit.
eta() <<
" phi=" << hit.
phi()
143 <<
" wiggle=" << wiggle <<
" bin=" <<
bin <<
" ["
147 double hit_phi_shifted = hit.
phi() + wiggle;
171 bool shortprint =
opt.Index(
"short") >= 0;
173 TString optprint =
opt;
174 optprint.ReplaceAll(
"short",
"");
190 <<
IsA()->GetName() <<
" != " <<
ref.IsA()->GetName());
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);
256 #if 0 // defined(__FastCaloSimStandAlone__)
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) {
277 void TFCSHitCellMappingWiggle::LoadHistFuncs() {
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);
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