ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TFCSBinnedShowerONNX Class Reference

#include <TFCSBinnedShowerONNX.h>

Inheritance diagram for TFCSBinnedShowerONNX:
Collaboration diagram for TFCSBinnedShowerONNX:

Classes

struct  layer_bins_t
 

Public Types

typedef std::vector< layer_bins_tevent_bins_t
 
enum  FCSEnergyInitializationStatusBits { kOnlyScaleEnergy }
 Status bit for energy initialization. More...
 
enum  FCSStatusBits { kMatchAllPDGID }
 Status bit for FCS needs. More...
 
typedef std::map< TFCSParametrizationBase *, Duplicate_tFindDuplicates_t
 
typedef std::map< std::string, FindDuplicates_tFindDuplicateClasses_t
 

Public Member Functions

 TFCSBinnedShowerONNX (const char *name=nullptr, const char *title=nullptr)
 
virtual ~TFCSBinnedShowerONNX ()
 
virtual bool is_match_Ekin_bin (int) const override
 
void enable_upscaling ()
 
void disable_upscaling ()
 
void set_default_hit_energy (float energy)
 
float get_default_hit_energy () const
 
void set_max_hits_per_voxel (int max_hits)
 
int get_max_hits_per_voxel () const
 
void load_simulator (std::string &filename)
 
void load_meta_data (const std::string &filename, std::vector< long unsigned int > &layers)
 
void load_sub_bin_distribution (const std::string &filename)
 
void set_bin_boundaries (long unsigned int layer_index, const std::vector< float > &R_lower, const std::vector< float > &R_size, const std::vector< float > &alpha_lower, const std::vector< float > &alpha_size)
 
const event_bins_tget_coordinates ()
 
void set_coordinates (const event_bins_t &coordinates)
 
const std::vector< std::vector< std::vector< std::vector< float > > > > & get_sub_bin_distribution () const
 
const std::vector< float > & get_upscaling_energies () const
 
void set_sub_bin_distribution_and_energies (const std::vector< std::vector< std::vector< std::vector< float >>>> &sub_bin_distribution, const std::vector< float > &upscaling_energies)
 
bool OnlyScaleEnergy () const
 
void set_OnlyScaleEnergy ()
 
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. More...
 
virtual FCSReturnCode simulate_hit (Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
 simulated one hit position with some energy. More...
 
ICaloGeometryget_geometry ()
 
virtual void set_geometry (ICaloGeometry *geo) override
 Method to set the geometry access pointer. More...
 
virtual int get_number_of_hits (TFCSSimulationState &simulstate, const TFCSTruthState *, const TFCSExtrapolationState *) const override
 Call get_number_of_hits() only once per shower simulation, as it could be calculated with random numbers and give different results each time. More...
 
virtual double get_sigma2_fluctuation (TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
 Give the effective size sigma^2 of the fluctuations that should be generated by the amount of generated hits. More...
 
virtual float get_E_hit (TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
 Get hit energy from layer energy and number of hits. More...
 
virtual float getMinWeight () const
 Get minimum and maximum value of weight for hit energy reweighting. More...
 
virtual float getMaxWeight () const
 
bool is_match_calosample (int calosample) const override
 
virtual bool is_match_all_Ekin_bin () const override
 
virtual bool is_match_all_calosample () const override
 
int Ekin_bin () const
 
void set_Ekin_bin (int bin)
 
int calosample () const
 
void set_calosample (int cs)
 
virtual void set_pdgid_Ekin_eta_Ekin_bin_calosample (const TFCSLateralShapeParametrization &ref)
 
void Print (Option_t *option="") const override
 
void clear ()
 
virtual bool is_match_pdgid (int id) const override
 
virtual bool is_match_Ekin (float Ekin) const override
 
virtual bool is_match_eta (float eta) const override
 
virtual bool is_match_all_Ekin () const override
 
virtual bool is_match_all_eta () const override
 
const std::set< int > & pdgid () const override
 
double Ekin_nominal () const override
 
double Ekin_min () const override
 
double Ekin_max () const override
 
double eta_nominal () const override
 
double eta_min () const override
 
double eta_max () const override
 
virtual void set_pdgid (int id)
 
virtual void set_pdgid (const std::set< int > &ids)
 
virtual void add_pdgid (int id)
 
virtual void clear_pdgid ()
 
virtual void set_Ekin_nominal (double min)
 
virtual void set_Ekin_min (double min)
 
virtual void set_Ekin_max (double max)
 
virtual void set_eta_nominal (double min)
 
virtual void set_eta_min (double min)
 
virtual void set_eta_max (double max)
 
virtual void set_Ekin (const TFCSParametrizationBase &ref)
 
virtual void set_eta (const TFCSParametrizationBase &ref)
 
virtual void set_Ekin_eta (const TFCSParametrizationBase &ref)
 
virtual void set_pdgid_Ekin_eta (const TFCSParametrizationBase &ref)
 
virtual bool is_match_all_pdgid () const
 
virtual void set_match_all_pdgid ()
 
virtual void reset_match_all_pdgid ()
 
virtual unsigned int size () const
 Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters. More...
 
virtual const TFCSParametrizationBaseoperator[] (unsigned int) const
 Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters. More...
 
virtual TFCSParametrizationBaseoperator[] (unsigned int)
 Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters. More...
 
virtual void set_daughter (unsigned int, TFCSParametrizationBase *)
 Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter method allows to change these daughters - expert use only! The original element at this position is not deleted. More...
 
virtual bool operator== (const TFCSParametrizationBase &ref) const
 The == operator compares the content of instances. More...
 
virtual void CleanAuxInfo (TFCSSimulationState &) const
 Method in all derived classes to delete objects stored in the simulstate AuxInfo. More...
 
void FindDuplicates (FindDuplicateClasses_t &dup)
 
void RemoveDuplicates ()
 
void RemoveNameTitle ()
 
bool msgLvl (const MSG::Level lvl) const
 Check whether the logging system is active at the provided verbosity level. More...
 
MsgStream & msg () const
 Return a stream for sending messages directly (no decoration) More...
 
MsgStream & msg (const MSG::Level lvl) const
 Return a decorated starting stream for sending messages. More...
 
MSG::Level level () const
 Retrieve output level. More...
 
virtual void setLevel (MSG::Level lvl)
 Update outputlevel. More...
 

Static Public Member Functions

static std::string startMsg (MSG::Level lvl, const std::string &file, int line)
 Make a message to decorate the start of logging. More...
 

Protected Member Functions

virtual void get_event (TFCSSimulationState &simulstate, float eta_center, float phi_center, float e_init, long unsigned int reference_layer_index) const override
 do not persistify More...
 
virtual long unsigned int get_n_hits (TFCSSimulationState &simulstate, long unsigned int layer_index) const override
 
virtual void compute_n_hits_and_elayer (TFCSSimulationState &simulstate) const
 
virtual float get_layer_energy (TFCSSimulationState &simulstate, long unsigned int layer_index) const override
 
virtual std::tuple< float, float, float > get_hit_position_and_energy (TFCSSimulationState &simulstate, long unsigned int layer_index, long unsigned int hit_index) const override
 
virtual void delete_event (TFCSSimulationState &simulstate) const override
 
bool compare (const TFCSParametrizationBase &ref) const
 

Protected Attributes

ICaloGeometrym_geo
 

Static Protected Attributes

static constexpr double init_Ekin_nominal = 0
 
static constexpr double init_Ekin_min = 0
 Do not persistify! More...
 
static constexpr double init_Ekin_max = 14000000
 Do not persistify! More...
 
static constexpr double init_eta_nominal = 0
 Do not persistify! More...
 
static constexpr double init_eta_min = -100
 Do not persistify! More...
 
static constexpr double init_eta_max = 100
 Do not persistify! More...
 

Private Member Functions

std::tuple< float, float > get_coordinates (TFCSSimulationState &simulstate, long unsigned int layer_index, int bin_index) const
 
void upscale (TFCSSimulationState &simulstate, float &R_min, float &R_max, float &alpha_min, float &alpha_max, long unsigned int layer_index, int bin_index) const
 
long unsigned int get_energy_index (TFCSSimulationState &simulstate, long unsigned int layer_index, long unsigned int hit_index) const
 
std::tuple< std::vector< float >, std::vector< hsize_t >, bool > load_hdf5_dataset (const std::string &filename, const std::string &datasetname)
 
void load_bin_boundaries (const std::string &filename, long unsigned int layer_index)
 
void load_upscaling_distribution (const std::string &filename, long unsigned int layer_index)
 

Private Attributes

const long unsigned int m_n_layers
 
float m_default_hit_energy = 4.
 
int m_max_hits_per_voxel = 100
 
event_bins_t m_coordinates
 
bool m_use_upscaling = false
 
std::vector< std::vector< std::vector< std::vector< float > > > > m_sub_bin_distribution
 
std::vector< float > m_upscaling_energies
 
TFCSMLCalorimeterSimulatorm_ai_simulator = nullptr
 
int m_Ekin_bin
 
int m_calosample
 
std::set< int > m_pdgid
 
double m_Ekin_nominal
 
double m_Ekin_min
 
double m_Ekin_max
 
double m_eta_nominal
 
double m_eta_min
 
double m_eta_max
 
std::string m_nm
 Message source name. More...
 

Static Private Attributes

static boost::thread_specific_ptr< MsgStream > m_msg_tls ATLAS_THREAD_SAFE
 Do not persistify! More...
 

Detailed Description

Definition at line 25 of file TFCSBinnedShowerONNX.h.

Member Typedef Documentation

◆ event_bins_t

Definition at line 35 of file TFCSBinnedShowerONNX.h.

◆ FindDuplicateClasses_t

typedef std::map<std::string, FindDuplicates_t> TFCSParametrizationBase::FindDuplicateClasses_t
inherited

Definition at line 142 of file TFCSParametrizationBase.h.

◆ FindDuplicates_t

Definition at line 141 of file TFCSParametrizationBase.h.

Member Enumeration Documentation

◆ FCSEnergyInitializationStatusBits

Status bit for energy initialization.

Enumerator
kOnlyScaleEnergy 

Set this bit in the TObject bit field the simulated energy should only be scaled by the GAN.

Definition at line 29 of file TFCSBinnedShowerBase.h.

29  {
31  BIT(18)
32  };

◆ FCSStatusBits

Status bit for FCS needs.

Enumerator
kMatchAllPDGID 

Set this bit in the TObject bit field if valid for all PDGID.

Definition at line 52 of file TFCSParametrizationBase.h.

52  {
53  kMatchAllPDGID = BIT(
54  14)
55  };

Constructor & Destructor Documentation

◆ TFCSBinnedShowerONNX()

TFCSBinnedShowerONNX::TFCSBinnedShowerONNX ( const char *  name = nullptr,
const char *  title = nullptr 
)

Definition at line 50 of file TFCSBinnedShowerONNX.cxx.

◆ ~TFCSBinnedShowerONNX()

TFCSBinnedShowerONNX::~TFCSBinnedShowerONNX ( )
virtual

Definition at line 53 of file TFCSBinnedShowerONNX.cxx.

53  {
54  // Delete the AI simulator
55  if (m_ai_simulator) {
56  delete m_ai_simulator;
57  m_ai_simulator = nullptr;
58  }
59 }

Member Function Documentation

◆ add_pdgid()

void TFCSParametrization::add_pdgid ( int  id)
virtualinherited

Reimplemented in TFCSEnergyBinParametrization.

Definition at line 35 of file TFCSParametrization.cxx.

35 { m_pdgid.insert(id); }

◆ calosample()

int TFCSLateralShapeParametrization::calosample ( ) const
inlineinherited

Definition at line 34 of file TFCSLateralShapeParametrization.h.

34 { return m_calosample; };

◆ CleanAuxInfo()

virtual void TFCSParametrizationBase::CleanAuxInfo ( TFCSSimulationState ) const
inlinevirtualinherited

Method in all derived classes to delete objects stored in the simulstate AuxInfo.

Definition at line 130 of file TFCSParametrizationBase.h.

130 {};

◆ clear()

void TFCSParametrization::clear ( )
inherited

◆ clear_pdgid()

void TFCSParametrization::clear_pdgid ( )
virtualinherited

Reimplemented in TFCSEnergyBinParametrization.

Definition at line 37 of file TFCSParametrization.cxx.

37 { m_pdgid.clear(); }

◆ compare()

bool TFCSLateralShapeParametrization::compare ( const TFCSParametrizationBase ref) const
protectedinherited

Definition at line 32 of file TFCSLateralShapeParametrization.cxx.

33  {
34  if (IsA() != ref.IsA()) {
35  ATH_MSG_DEBUG("compare(): different class types "
36  << IsA()->GetName() << " != " << ref.IsA()->GetName());
37  return false;
38  }
39  const TFCSLateralShapeParametrization &ref_typed =
40  static_cast<const TFCSLateralShapeParametrization &>(ref);
41  if (Ekin_bin() != ref_typed.Ekin_bin()) {
42  ATH_MSG_DEBUG("compare(): different Ekin bin");
43  return false;
44  }
45  if (calosample() != ref_typed.calosample()) {
46  ATH_MSG_DEBUG("compare(): different calosample");
47  return false;
48  }
49 
50  return true;
51 }

◆ compute_n_hits_and_elayer()

void TFCSBinnedShowerONNX::compute_n_hits_and_elayer ( TFCSSimulationState simulstate) const
protectedvirtual

Definition at line 208 of file TFCSBinnedShowerONNX.cxx.

209  {
210 
213  simulstate.getAuxInfo<void *>("BSEventData"_FCShash));
214  float e_init = simulstate.getAuxInfo<float>("BSEinit"_FCShash);
215 
216  // Loop over all layers
217  long unsigned int n_layers = event->event_data.size();
218  std::vector<std::vector<long unsigned int>> hits_per_layer;
219  std::vector<float> elayer;
220  hits_per_layer.resize(n_layers);
221  elayer.resize(n_layers, 0.0f);
222 
223  for (long unsigned int layer_index = 0; layer_index < n_layers;
224  ++layer_index) {
225 
226  TFCSMLCalorimeterSimulator::layer_t &layer = event->event_data.at(layer_index);
227 
228  // Loop over all voxels in the layer
229  long unsigned int n_hits = 0;
230  for (float e_voxel : layer.E_vector) {
231  long unsigned int hits_per_bin;
232  if (e_voxel > std::numeric_limits<float>::epsilon()) {
233  hits_per_bin =
234  std::min(std::max(int(e_voxel * e_init / m_default_hit_energy), 1),
236  elayer.at(layer_index) += e_voxel * e_init;
237 
238  } else {
239  hits_per_bin = 0;
240  }
241  n_hits += hits_per_bin;
242  hits_per_layer.at(layer_index).push_back(n_hits);
243  }
244  }
245  // Store the hits per layer vector
246  std::vector<std::vector<long unsigned int>> *hits_per_layer_ptr =
247  new std::vector<std::vector<long unsigned int>>(hits_per_layer);
248  simulstate.setAuxInfo<void *>("BSNHits"_FCShash, hits_per_layer_ptr);
249 
250  // Store the energy per layer
251  std::vector<float> *elayer_ptr = new std::vector<float>(elayer);
252  simulstate.setAuxInfo<void *>("BSELayer"_FCShash, elayer_ptr);
253 }

◆ delete_event()

void TFCSBinnedShowerONNX::delete_event ( TFCSSimulationState simulstate) const
overrideprotectedvirtual

Implements TFCSBinnedShowerBase.

Definition at line 498 of file TFCSBinnedShowerONNX.cxx.

498  {
499  // Delete the event data
500  void *event_ptr = simulstate.getAuxInfo<void *>("BSEventData"_FCShash);
501  if (event_ptr) {
502  delete static_cast<TFCSMLCalorimeterSimulator::event_t *>(event_ptr);
503  simulstate.setAuxInfo<void *>("BSEventData"_FCShash, nullptr);
504  } else {
505  ATH_MSG_ERROR("No event data found to delete.");
506  }
507 
508  void *n_hits_ptr = simulstate.getAuxInfo<void *>("BSNHits"_FCShash);
509  if (n_hits_ptr) {
510  delete static_cast<std::vector<std::vector<long unsigned int>> *>(
511  n_hits_ptr);
512  simulstate.setAuxInfo<void *>("BSNHits"_FCShash, nullptr);
513  } else {
514  ATH_MSG_ERROR("No event hits data found to delete.");
515  }
516 
517  void *elayer_ptr = simulstate.getAuxInfo<void *>("BSELayer"_FCShash);
518  if (elayer_ptr) {
519  delete static_cast<std::vector<float> *>(elayer_ptr);
520  simulstate.setAuxInfo<void *>("BSELayer"_FCShash, nullptr);
521  } else {
522  ATH_MSG_ERROR("No event layer energy data found to delete.");
523  }
524 
525  return;
526 }

◆ disable_upscaling()

void TFCSBinnedShowerONNX::disable_upscaling ( )
inline

Definition at line 46 of file TFCSBinnedShowerONNX.h.

46 { m_use_upscaling = false; };

◆ Ekin_bin()

int TFCSLateralShapeParametrization::Ekin_bin ( ) const
inlineinherited

Definition at line 31 of file TFCSLateralShapeParametrization.h.

31 { return m_Ekin_bin; };

◆ Ekin_max()

double TFCSParametrization::Ekin_max ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 37 of file TFCSParametrization.h.

37 { return m_Ekin_max; };

◆ Ekin_min()

double TFCSParametrization::Ekin_min ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 36 of file TFCSParametrization.h.

36 { return m_Ekin_min; };

◆ Ekin_nominal()

double TFCSParametrization::Ekin_nominal ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 35 of file TFCSParametrization.h.

35 { return m_Ekin_nominal; };

◆ enable_upscaling()

void TFCSBinnedShowerONNX::enable_upscaling ( )
inline

Definition at line 45 of file TFCSBinnedShowerONNX.h.

45 { m_use_upscaling = true; };

◆ eta_max()

double TFCSParametrization::eta_max ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 40 of file TFCSParametrization.h.

40 { return m_eta_max; };

◆ eta_min()

double TFCSParametrization::eta_min ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 39 of file TFCSParametrization.h.

39 { return m_eta_min; };

◆ eta_nominal()

double TFCSParametrization::eta_nominal ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 38 of file TFCSParametrization.h.

38 { return m_eta_nominal; };

◆ FindDuplicates()

void TFCSParametrizationBase::FindDuplicates ( FindDuplicateClasses_t dup)
inherited

Definition at line 90 of file TFCSParametrizationBase.cxx.

91  {
92  for (unsigned int i = 0; i < size(); ++i)
93  if ((*this)[i]) {
94  TFCSParametrizationBase *param = (*this)[i];
95  FindDuplicates_t &dup = dupclasses[param->GetName()];
96  // If param is already in the duplication list, skip over
97  auto checkexist = dup.find(param);
98  if (checkexist != dup.end()) {
99  ATH_MSG_DEBUG("Found duplicate pointer for: " << param << "="
100  << param->GetName());
101  if (checkexist->second.replace) {
102  TFCSParametrizationBase *refparam = checkexist->second.replace;
103  ATH_MSG_DEBUG("Found duplicate pointer: "
104  << refparam << "=" << refparam->GetName()
105  << ", duplicate is " << param << "=" << param->GetName()
106  << " index " << i << " of " << this);
107  dup[refparam].mother.push_back(this);
108  dup[refparam].index.push_back(i);
109  }
110  continue;
111  }
112  // Add param to duplication list
113  dup[param] = Duplicate_t();
114  for (auto &ref : dup) {
115  TFCSParametrizationBase *refparam = ref.first;
116  // skip itself, as this just added above
117  if (param == refparam)
118  continue;
119  // skip nullptr reference
120  if (refparam == nullptr)
121  continue;
122  // skip reference that is itself going to get replaced
123  if (ref.second.replace)
124  continue;
125  // Check for objects with identical content
126  if (*param == *refparam) {
127  ATH_MSG_DEBUG("Found duplicate: "
128  << refparam << "=" << refparam->GetName()
129  << ", duplicate is " << param << "=" << param->GetName()
130  << " index " << i << " of " << this);
131  dup[param].replace = refparam;
132  dup[refparam].mother.push_back(this);
133  dup[refparam].index.push_back(i);
134  break;
135  }
136  }
137  // Continue for child objects in param
138  param->FindDuplicates(dupclasses);
139  }
140 }

◆ get_coordinates() [1/2]

const event_bins_t& TFCSBinnedShowerONNX::get_coordinates ( )
inline

Definition at line 75 of file TFCSBinnedShowerONNX.h.

75 { return m_coordinates; }

◆ get_coordinates() [2/2]

std::tuple< float, float > TFCSBinnedShowerONNX::get_coordinates ( TFCSSimulationState simulstate,
long unsigned int  layer_index,
int  bin_index 
) const
private

Definition at line 325 of file TFCSBinnedShowerONNX.cxx.

327  {
328  float R_min = m_coordinates.at(layer_index).R_lower.at(bin_index);
329  float R_max = m_coordinates.at(layer_index).R_size.at(bin_index) +
330  m_coordinates.at(layer_index).R_lower.at(bin_index);
331 
332  float alpha_min = m_coordinates.at(layer_index).alpha_lower.at(bin_index);
333  float alpha_max = m_coordinates.at(layer_index).alpha_size.at(bin_index) +
334  m_coordinates.at(layer_index).alpha_lower.at(bin_index);
335 
336  if (m_use_upscaling) {
337  upscale(simulstate, R_min, R_max, alpha_min, alpha_max, layer_index,
338  bin_index);
339  }
340 
341  float R = CLHEP::RandFlat::shoot(simulstate.randomEngine(), R_min, R_max);
342  float alpha =
343  CLHEP::RandFlat::shoot(simulstate.randomEngine(), alpha_min, alpha_max);
344 
345  return std::make_tuple(R, alpha);
346 }

◆ get_default_hit_energy()

float TFCSBinnedShowerONNX::get_default_hit_energy ( ) const
inline

Definition at line 49 of file TFCSBinnedShowerONNX.h.

49 { return m_default_hit_energy; }

◆ get_E_hit()

float TFCSLateralShapeParametrizationHitBase::get_E_hit ( TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
) const
virtualinherited

Get hit energy from layer energy and number of hits.

Definition at line 31 of file TFCSLateralShapeParametrizationHitBase.cxx.

33  {
34  const int nhits = get_number_of_hits(simulstate, truth, extrapol);
35  const int sample = calosample();
36  if (nhits <= 0 || sample < 0)
37  return -1.;
38  else
39  return simulstate.E(sample) / nhits;
40 }

◆ get_energy_index()

long unsigned int TFCSBinnedShowerONNX::get_energy_index ( TFCSSimulationState simulstate,
long unsigned int  layer_index,
long unsigned int  hit_index 
) const
private

Definition at line 288 of file TFCSBinnedShowerONNX.cxx.

290  {
291  std::vector<std::vector<long unsigned int>> *hits_per_layer_ptr =
292  static_cast<std::vector<std::vector<long unsigned int>> *>(
293  simulstate.getAuxInfo<void *>("BSNHits"_FCShash));
294  if (!hits_per_layer_ptr) {
295  ATH_MSG_ERROR("Invalid hits per layer information");
296  return 0;
297  }
298 
299  if (layer_index >= hits_per_layer_ptr->size()) {
300  ATH_MSG_ERROR("Layer index out of bounds: " << layer_index << " >= "
301  << hits_per_layer_ptr->size());
302  return 0;
303  }
304 
305  // Find the hit index in the hit vector for the given layer
306  const std::vector<long unsigned int> &hits =
307  hits_per_layer_ptr->at(layer_index);
308  auto it = std::upper_bound(hits.begin(), hits.end(), hit_index);
309  long unsigned int energy_index = std::distance(hits.begin(), it);
310 
311  if (energy_index >= hits.size()) {
312  ATH_MSG_ERROR("Energy index out of bounds: " << energy_index
313  << " >= " << hits.size());
314  // Print full hits for debugging
315  ATH_MSG_ERROR("Hits per layer: ");
316  for (const auto &hit : hits) {
317  ATH_MSG_ERROR("Hit: " << hit);
318  }
319  return 0;
320  }
321 
322  return energy_index;
323 }

◆ get_event()

void TFCSBinnedShowerONNX::get_event ( TFCSSimulationState simulstate,
float  eta_center,
float  phi_center,
float  e_init,
long unsigned int  reference_layer_index 
) const
overrideprotectedvirtual

do not persistify

Implements TFCSBinnedShowerBase.

Definition at line 61 of file TFCSBinnedShowerONNX.cxx.

63  {
64 
65  (void)reference_layer_index; // Unused parameter
66  (void)phi_center; // Unused parameter
67 
69  m_ai_simulator->getEvent(simulstate, eta_center, e_init);
70 
71  // Store a pointer to the event
74  simulstate.setAuxInfo<void *>("BSEventData"_FCShash, event_ptr);
75  simulstate.setAuxInfo<float>("BSEinit"_FCShash, e_init);
76 
77  compute_n_hits_and_elayer(simulstate);
78 }

◆ get_geometry()

ICaloGeometry* TFCSBinnedShowerBase::get_geometry ( )
inlineinherited

Definition at line 51 of file TFCSBinnedShowerBase.h.

51 { return m_geo; };

◆ get_hit_position_and_energy()

std::tuple< float, float, float > TFCSBinnedShowerONNX::get_hit_position_and_energy ( TFCSSimulationState simulstate,
long unsigned int  layer_index,
long unsigned int  hit_index 
) const
overrideprotectedvirtual

Implements TFCSBinnedShowerBase.

Definition at line 455 of file TFCSBinnedShowerONNX.cxx.

457  {
458 
461  simulstate.getAuxInfo<void *>("BSEventData"_FCShash));
462 
463  float e_init = simulstate.getAuxInfo<float>("BSEinit"_FCShash);
464 
465  if (layer_index >= event->event_data.size()) {
466  ATH_MSG_ERROR("Layer index out of bounds: " << layer_index << " >= "
467  << event->event_data.size());
468  return std::make_tuple(0.0f, 0.0f, 0.0f);
469  }
470 
471  long unsigned int energy_index = get_energy_index(
472  simulstate, layer_index, hit_index); // Get the bin index for the hit
473 
474  std::vector<std::vector<long unsigned int>> *hits_per_layer_ptr =
475  static_cast<std::vector<std::vector<long unsigned int>> *>(
476  simulstate.getAuxInfo<void *>("BSNHits"_FCShash));
477 
478  long unsigned int hits_per_bin;
479  if (energy_index == 0) {
480  hits_per_bin = hits_per_layer_ptr->at(layer_index).at(energy_index);
481  } else {
482  hits_per_bin = hits_per_layer_ptr->at(layer_index).at(energy_index) -
483  hits_per_layer_ptr->at(layer_index).at(energy_index - 1);
484  }
485 
486  float r, alpha;
487 
488  TFCSMLCalorimeterSimulator::layer_t &layer = event->event_data.at(layer_index);
489 
490  std::tie(r, alpha) = get_coordinates(simulstate, layer_index,
491  layer.bin_index_vector.at(energy_index));
492 
493  float E = layer.E_vector.at(energy_index) * e_init / hits_per_bin;
494 
495  return std::make_tuple(r, alpha, E);
496 }

◆ get_layer_energy()

float TFCSBinnedShowerONNX::get_layer_energy ( TFCSSimulationState simulstate,
long unsigned int  layer_index 
) const
overrideprotectedvirtual

Implements TFCSBinnedShowerBase.

Definition at line 270 of file TFCSBinnedShowerONNX.cxx.

271  {
272  std::vector<float> *elayer_ptr = static_cast<std::vector<float> *>(
273  simulstate.getAuxInfo<void *>("BSELayer"_FCShash));
274  if (!elayer_ptr) {
275  ATH_MSG_ERROR("Invalid layer energy information");
276  return 0.0f;
277  }
278  if (layer_index >= elayer_ptr->size()) {
279  return 0.0f;
280  }
281 
282  ATH_MSG_DEBUG("returning energy for layer " << layer_index
283  << ": " << elayer_ptr->at(layer_index));
284 
285  return elayer_ptr->at(layer_index);
286 }

◆ get_max_hits_per_voxel()

int TFCSBinnedShowerONNX::get_max_hits_per_voxel ( ) const
inline

Definition at line 51 of file TFCSBinnedShowerONNX.h.

51 { return m_max_hits_per_voxel; }

◆ get_n_hits()

long unsigned int TFCSBinnedShowerONNX::get_n_hits ( TFCSSimulationState simulstate,
long unsigned int  layer_index 
) const
overrideprotectedvirtual

Implements TFCSBinnedShowerBase.

Definition at line 255 of file TFCSBinnedShowerONNX.cxx.

256  {
257 
258  std::vector<std::vector<long unsigned int>> *hits_per_layer_ptr =
259  static_cast<std::vector<std::vector<long unsigned int>> *>(
260  simulstate.getAuxInfo<void *>("BSNHits"_FCShash));
261 
262  if (!hits_per_layer_ptr) {
263  ATH_MSG_ERROR("Invalid hits per layer information");
264  return 0;
265  }
266 
267  return hits_per_layer_ptr->at(layer_index).back();
268 }

◆ get_number_of_hits()

virtual int TFCSBinnedShowerBase::get_number_of_hits ( TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
) const
inlineoverridevirtualinherited

Call get_number_of_hits() only once per shower simulation, as it could be calculated with random numbers and give different results each time.

Return a value of -1 if this instance can't determine

Reimplemented from TFCSLateralShapeParametrizationHitBase.

Definition at line 58 of file TFCSBinnedShowerBase.h.

60  {
61  long unsigned int nhits = get_n_hits(simulstate, calosample());
62  if (nhits == 0)
63  return -1;
64  return static_cast<int>(nhits);
65  }

◆ get_sigma2_fluctuation()

double TFCSLateralShapeParametrizationHitBase::get_sigma2_fluctuation ( TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
) const
virtualinherited

Give the effective size sigma^2 of the fluctuations that should be generated by the amount of generated hits.

Return a value <0 if this instance can't determine

Reimplemented in TFCSHistoLateralShapeParametrization, TFCSLateralShapeParametrizationHitNumberFromE, and TFCS2DFunctionLateralShapeParametrization.

Definition at line 19 of file TFCSLateralShapeParametrizationHitBase.cxx.

21  {
22  return -1;
23 }

◆ get_sub_bin_distribution()

const std::vector<std::vector<std::vector<std::vector<float> > > >& TFCSBinnedShowerONNX::get_sub_bin_distribution ( ) const
inline

Definition at line 82 of file TFCSBinnedShowerONNX.h.

82  {
84  }

◆ get_upscaling_energies()

const std::vector<float>& TFCSBinnedShowerONNX::get_upscaling_energies ( ) const
inline

Definition at line 86 of file TFCSBinnedShowerONNX.h.

86  {
87  return m_upscaling_energies;
88  }

◆ getMaxWeight()

float TFCSLateralShapeParametrizationHitBase::getMaxWeight ( ) const
virtualinherited

Reimplemented in TFCSHistoLateralShapeWeight.

Definition at line 46 of file TFCSLateralShapeParametrizationHitBase.cxx.

46  {
47  return -1.;
48 }

◆ getMinWeight()

float TFCSLateralShapeParametrizationHitBase::getMinWeight ( ) const
virtualinherited

Get minimum and maximum value of weight for hit energy reweighting.

Reimplemented in TFCSHistoLateralShapeWeight.

Definition at line 42 of file TFCSLateralShapeParametrizationHitBase.cxx.

42  {
43  return -1.;
44 }

◆ is_match_all_calosample()

virtual bool TFCSLateralShapeParametrization::is_match_all_calosample ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrization.

Definition at line 29 of file TFCSLateralShapeParametrization.h.

29 { return false; };

◆ is_match_all_Ekin()

virtual bool TFCSParametrization::is_match_all_Ekin ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 25 of file TFCSParametrization.h.

25  {
26  return Ekin_min() == init_Ekin_min && Ekin_max() == init_Ekin_max;
27  };

◆ is_match_all_Ekin_bin()

virtual bool TFCSLateralShapeParametrization::is_match_all_Ekin_bin ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrization.

Definition at line 24 of file TFCSLateralShapeParametrization.h.

24  {
25  if (Ekin_bin() == -1)
26  return true;
27  return false;
28  };

◆ is_match_all_eta()

virtual bool TFCSParametrization::is_match_all_eta ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 28 of file TFCSParametrization.h.

28  {
29  return eta_min() == init_eta_min && eta_max() == init_eta_max;
30  };

◆ is_match_all_pdgid()

virtual bool TFCSParametrizationBase::is_match_all_pdgid ( ) const
inlinevirtualinherited

Definition at line 66 of file TFCSParametrizationBase.h.

66 { return TestBit(kMatchAllPDGID); };

◆ is_match_calosample()

bool TFCSLateralShapeParametrization::is_match_calosample ( int  calosample) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 20 of file TFCSLateralShapeParametrization.h.

20  {
21  return calosample == m_calosample;
22  };

◆ is_match_Ekin()

virtual bool TFCSParametrization::is_match_Ekin ( float  Ekin) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 18 of file TFCSParametrization.h.

18  {
19  return (Ekin >= m_Ekin_min) && (Ekin < m_Ekin_max);
20  };

◆ is_match_Ekin_bin()

virtual bool TFCSBinnedShowerONNX::is_match_Ekin_bin ( int  ) const
inlineoverridevirtual

Reimplemented from TFCSParametrizationBase.

Definition at line 41 of file TFCSBinnedShowerONNX.h.

41  {
42  return true;
43  };

◆ is_match_eta()

virtual bool TFCSParametrization::is_match_eta ( float  eta) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 21 of file TFCSParametrization.h.

21  {
22  return (eta >= m_eta_min) && (eta < m_eta_max);
23  };

◆ is_match_pdgid()

virtual bool TFCSParametrization::is_match_pdgid ( int  id) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 15 of file TFCSParametrization.h.

15  {
16  return TestBit(kMatchAllPDGID) || m_pdgid.find(id) != m_pdgid.end();
17  };

◆ level()

MSG::Level ISF_FCS::MLogging::level ( ) const
inlineinherited

Retrieve output level.

Definition at line 201 of file MLogging.h.

201 { return msg().level(); }

◆ load_bin_boundaries()

void TFCSBinnedShowerONNX::load_bin_boundaries ( const std::string &  filename,
long unsigned int  layer_index 
)
private

Definition at line 136 of file TFCSBinnedShowerONNX.cxx.

137  {
138 
139  // Assert that the layer index is valid
140  if (layer_index >= m_coordinates.size()) {
141  m_coordinates.resize(layer_index + 1);
142  }
143 
144  std::vector<std::string> datasetnames = {
145  "binstart_radius_layer_", "binsize_radius_layer_",
146  "binstart_alpha_layer_", "binsize_alpha_layer_"};
147 
148  for (long unsigned int i = 0; i < datasetnames.size(); i++) {
149  std::string datasetname = datasetnames.at(i) + std::to_string(layer_index);
150  std::vector<float> data;
151  std::vector<hsize_t> dims;
152  bool success;
153  std::tie(data, dims, success) = load_hdf5_dataset(filename, datasetname);
154  if (!success) {
155  ATH_MSG_ERROR("Error while extracting the bin boundaries for layer "
156  << layer_index << " from " << filename << "."
157  << "Specifically, the key " << datasetname
158  << " could not be loaded.");
159  return;
160  }
161 
162  // Fill the corresponding vector in the layer_bins_t structure
163  auto &event_bins = m_coordinates.at(layer_index);
164  switch (i) {
165  case 0:
166  event_bins.R_lower = data;
167  break;
168  case 1:
169  event_bins.R_size = data;
170  break;
171  case 2:
172  event_bins.alpha_lower = data;
173  break;
174  case 3:
175  event_bins.alpha_size = data;
176  break;
177  }
178  }
179 }

◆ load_hdf5_dataset()

std::tuple< std::vector< float >, std::vector< hsize_t >, bool > TFCSBinnedShowerONNX::load_hdf5_dataset ( const std::string &  filename,
const std::string &  datasetname 
)
private

Definition at line 102 of file TFCSBinnedShowerONNX.cxx.

103  {
104 
105  // Open the HDF5 file and dataset
106  H5::H5File file(filename, H5F_ACC_RDONLY);
107 
108  // check if the dataset exists
109  if (!file.exists(datasetname)) {
110  return std::make_tuple(std::vector<float>{}, std::vector<hsize_t>{}, false);
111  }
112 
113  H5::DataSet dataset = file.openDataSet(datasetname);
114 
115  // Get the dataspace of the dataset
116  H5::DataSpace dataspace = dataset.getSpace();
117 
118  // Get the number of dimensions and the size of each dimension
119  int rank = dataspace.getSimpleExtentNdims();
120  std::vector<hsize_t> dims_out(rank);
121  dataspace.getSimpleExtentDims(dims_out.data(), NULL);
122 
123  // Calculate the total number of elements
124  hsize_t totalSize = 1;
125  for (const auto &dim : dims_out) {
126  totalSize *= dim;
127  }
128 
129  // Read the dataset into a buffer
130  std::vector<float> data(totalSize);
131  dataset.read(data.data(), H5::PredType::NATIVE_FLOAT);
132  file.close();
133  return std::make_tuple(data, dims_out, true);
134 }

◆ load_meta_data()

void TFCSBinnedShowerONNX::load_meta_data ( const std::string &  filename,
std::vector< long unsigned int > &  layers 
)

Definition at line 80 of file TFCSBinnedShowerONNX.cxx.

81  {
82 
83  m_coordinates.clear();
84 
85  if (m_use_upscaling) {
86  m_sub_bin_distribution.clear();
87  }
88 
89  // layer dependent variables
90  for (long unsigned int layer_index : layers) {
91 
92  ATH_MSG_INFO("Loading layer " << layer_index << " from file: " << filename);
93 
94  // Load the bin boundaries for this layer
95  load_bin_boundaries(filename, layer_index);
96  }
97 
98  return;
99 }

◆ load_simulator()

void TFCSBinnedShowerONNX::load_simulator ( std::string &  filename)
inline

Definition at line 54 of file TFCSBinnedShowerONNX.h.

54  {
55  // TODO: Do I have to delete it again?
58  }

◆ load_sub_bin_distribution()

void TFCSBinnedShowerONNX::load_sub_bin_distribution ( const std::string &  filename)

Definition at line 528 of file TFCSBinnedShowerONNX.cxx.

529  {
530  m_use_upscaling = true;
531  TFile *file = TFile::Open(filename.c_str(), "READ");
532  if (!file || file->IsZombie()) {
533  std::cerr << "Failed to open file: " << filename << std::endl;
534  return;
535  }
536 
537  std::regex pattern(R"(probabilities_layer_(\d+)_energy_([0-9.]+))");
538  std::map<float, std::map<int, std::vector<std::vector<float>>>> temp_storage;
539 
540  TIter next(file->GetListOfKeys());
541  TKey *key;
542 
543  while ((key = (TKey *)next())) {
544  std::string keyname = key->GetName();
545  std::smatch match;
546  if (std::regex_match(keyname, match, pattern)) {
547  int layer = std::stoi(match[1].str());
548  float energy = std::stod(match[2].str());
549 
550  TMatrixD *matrix = dynamic_cast<TMatrixD *>(file->Get(keyname.c_str()));
551  if (matrix) {
552  std::vector<std::vector<float>> mat_vec(
553  matrix->GetNrows(), std::vector<float>(matrix->GetNcols()));
554  for (int i = 0; i < matrix->GetNrows(); ++i) {
555  for (int j = 0; j < matrix->GetNcols(); ++j) {
556  mat_vec[i][j] = static_cast<float>((*matrix)(i, j));
557  }
558  }
559  temp_storage[energy][layer] = std::move(mat_vec);
560  }
561  }
562  }
563 
564  file->Close();
565  delete file;
566 
567  // Output containers
568  std::vector<float> energies;
569  std::vector<std::vector<std::vector<std::vector<float>>>>
570  data; // [energy][layer][row][col]
571 
572  for (const auto &[energy, layer_map] : temp_storage) {
573  energies.push_back(energy);
574  int max_layer = 0;
575  for (const auto &[l, _] : layer_map)
576  max_layer = std::max(max_layer, l);
577 
578  std::vector<std::vector<std::vector<float>>> layer_vec(max_layer + 1);
579  for (const auto &[layer_idx, mat] : layer_map) {
580  layer_vec[layer_idx] = mat;
581  }
582  data.push_back(std::move(layer_vec));
583  }
584 
585  // Example output
586  for (size_t i = 0; i < energies.size(); ++i) {
587  std::cout << "Energy index " << i << ": " << energies[i] << " GeV\n";
588  for (size_t j = 0; j < data[i].size(); ++j) {
589  if (!data[i][j].empty()) {
590  std::cout << " Layer " << j << " Shape: (" << data[i][j].size() << ", "
591  << data[i][j][0].size() << ")\n";
592  }
593  }
594  }
595 
596  m_upscaling_energies = energies;
598 }

◆ load_upscaling_distribution()

void TFCSBinnedShowerONNX::load_upscaling_distribution ( const std::string &  filename,
long unsigned int  layer_index 
)
private

◆ msg() [1/2]

MsgStream & ISF_FCS::MLogging::msg ( ) const
inlineinherited

Return a stream for sending messages directly (no decoration)

Definition at line 231 of file MLogging.h.

231  {
232  MsgStream *ms = m_msg_tls.get();
233  if (!ms) {
234  ms = new MsgStream(Athena::getMessageSvc(), m_nm);
235  m_msg_tls.reset(ms);
236  }
237  return *ms;
238 }

◆ msg() [2/2]

MsgStream & ISF_FCS::MLogging::msg ( const MSG::Level  lvl) const
inlineinherited

Return a decorated starting stream for sending messages.

Definition at line 240 of file MLogging.h.

240  {
241  return msg() << lvl;
242 }

◆ msgLvl()

bool ISF_FCS::MLogging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Check whether the logging system is active at the provided verbosity level.

Definition at line 222 of file MLogging.h.

222  {
223  if (msg().level() <= lvl) {
224  msg() << lvl;
225  return true;
226  } else {
227  return false;
228  }
229 }

◆ OnlyScaleEnergy()

bool TFCSBinnedShowerBase::OnlyScaleEnergy ( ) const
inlineinherited

Definition at line 35 of file TFCSBinnedShowerBase.h.

35 { return TestBit(kOnlyScaleEnergy); };

◆ operator==()

virtual bool TFCSParametrizationBase::operator== ( const TFCSParametrizationBase ref) const
inlinevirtualinherited

The == operator compares the content of instances.

The implementation in the base class only returns true for a comparison with itself

Reimplemented in TFCSHitCellMappingWiggle, TFCSLateralShapeParametrizationHitNumberFromE, TFCSHitCellMapping, and TFCSPredictExtrapWeights.

Definition at line 119 of file TFCSParametrizationBase.h.

119  {
120  return compare(ref);
121  };

◆ operator[]() [1/2]

virtual TFCSParametrizationBase* TFCSParametrizationBase::operator[] ( unsigned int  )
inlinevirtualinherited

Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters.

Reimplemented in TFCSLateralShapeParametrizationHitChain, and TFCSParametrizationChain.

Definition at line 106 of file TFCSParametrizationBase.h.

106  {
107  return nullptr;
108  };

◆ operator[]() [2/2]

virtual const TFCSParametrizationBase* TFCSParametrizationBase::operator[] ( unsigned int  ) const
inlinevirtualinherited

Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters.

Reimplemented in TFCSLateralShapeParametrizationHitChain, and TFCSParametrizationChain.

Definition at line 99 of file TFCSParametrizationBase.h.

99  {
100  return nullptr;
101  };

◆ pdgid()

const std::set<int>& TFCSParametrization::pdgid ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 34 of file TFCSParametrization.h.

34 { return m_pdgid; };

◆ Print()

void TFCSLateralShapeParametrization::Print ( Option_t *  option = "") const
overrideinherited

Definition at line 53 of file TFCSLateralShapeParametrization.cxx.

53  {
54  TString opt(option);
55  bool shortprint = opt.Index("short") >= 0;
56  bool longprint = msgLvl(MSG::DEBUG) || (msgLvl(MSG::INFO) && !shortprint);
57  TString optprint = opt;
58  optprint.ReplaceAll("short", "");
60  if (longprint) {
61  if (Ekin_bin() == -1)
62  ATH_MSG_INFO(optprint << " Ekin_bin=all ; calosample=" << calosample());
63  else
64  ATH_MSG_INFO(optprint << " Ekin_bin=" << Ekin_bin()
65  << " ; calosample=" << calosample());
66  }
67 }

◆ RemoveDuplicates()

void TFCSParametrizationBase::RemoveDuplicates ( )
inherited

Definition at line 142 of file TFCSParametrizationBase.cxx.

142  {
143  FindDuplicateClasses_t dupclasses;
144  FindDuplicates(dupclasses);
145 
146  std::set<TFCSParametrizationBase *> dellist;
147  for (auto &dupiter : dupclasses) {
148  FindDuplicates_t &dup = dupiter.second;
149  for (auto onedup : dup) {
150  if (onedup.second.mother.empty())
151  continue;
152  TFCSParametrizationBase *ref = onedup.first;
153  ATH_MSG_DEBUG("Main object " << ref << "=" << ref->GetName());
154  for (unsigned int i = 0; i < onedup.second.mother.size(); ++i) {
155  int index = onedup.second.index[i];
156  TFCSParametrizationBase *mother = onedup.second.mother[i];
157  TFCSParametrizationBase *delparam = mother->operator[](index);
158  unsigned int delcount = dup[delparam].mother.size();
159  if (delcount == 0) {
160  ATH_MSG_DEBUG(" - Delete object "
161  << delparam << "=" << delparam->GetName() << " index "
162  << index << " of " << mother << ", has " << delcount
163  << " other replacements attached. Deleting");
164  mother->set_daughter(index, ref);
165  dellist.insert(delparam);
166  } else {
167  ATH_MSG_WARNING(" - Delete object "
168  << delparam << "=" << delparam->GetName() << " index "
169  << index << " of " << mother << ", has " << delcount
170  << " other replacements attached. Skipping");
171  }
172  }
173  }
174  }
175 
176  ATH_MSG_INFO("RERUNNING DUPLICATE FINDING");
177  FindDuplicateClasses_t dupclasses2;
178  FindDuplicates(dupclasses2);
179 
180  std::map<std::string, int> ndel;
181  for (auto *delparam : dellist) {
182  FindDuplicates_t &dup2 = dupclasses2[delparam->GetName()];
183  bool present = dup2.find(delparam) != dup2.end();
184  if (present) {
185  ATH_MSG_WARNING("- Delete object " << delparam << "="
186  << delparam->GetName()
187  << " still referenced somewhere!");
188  } else {
189  ATH_MSG_DEBUG("- Delete object " << delparam << "="
190  << delparam->GetName());
191  ++ndel[delparam->ClassName()];
192  delete delparam;
193  }
194  }
195  for (auto &del : ndel)
196  ATH_MSG_INFO("Deleted " << del.second << " duplicate objects of class "
197  << del.first);
198 }

◆ RemoveNameTitle()

void TFCSParametrizationBase::RemoveNameTitle ( )
inherited

Definition at line 200 of file TFCSParametrizationBase.cxx.

200  {
201  for (unsigned int i = 0; i < size(); ++i)
202  if ((*this)[i]) {
203  TFCSParametrizationBase *param = (*this)[i];
204  param->SetName("");
205  param->SetTitle("");
206 
207  // Continue for child objects in param
208  param->RemoveNameTitle();
209  }
210 }

◆ reset_match_all_pdgid()

virtual void TFCSParametrizationBase::reset_match_all_pdgid ( )
inlinevirtualinherited

Definition at line 84 of file TFCSParametrizationBase.h.

84 { ResetBit(kMatchAllPDGID); };

◆ reset_OnlyScaleEnergy()

void TFCSBinnedShowerBase::reset_OnlyScaleEnergy ( )
inlineinherited

Definition at line 39 of file TFCSBinnedShowerBase.h.

39 { ResetBit(kOnlyScaleEnergy); };

◆ set_bin_boundaries()

void TFCSBinnedShowerONNX::set_bin_boundaries ( long unsigned int  layer_index,
const std::vector< float > &  R_lower,
const std::vector< float > &  R_size,
const std::vector< float > &  alpha_lower,
const std::vector< float > &  alpha_size 
)

Definition at line 194 of file TFCSBinnedShowerONNX.cxx.

198  {
199  if (layer_index >= m_coordinates.size()) {
200  m_coordinates.resize(layer_index + 1);
201  }
202  m_coordinates.at(layer_index).R_lower = R_lower;
203  m_coordinates.at(layer_index).R_size = R_size;
204  m_coordinates.at(layer_index).alpha_lower = alpha_lower;
205  m_coordinates.at(layer_index).alpha_size = alpha_size;
206 }

◆ set_calosample()

void TFCSLateralShapeParametrization::set_calosample ( int  cs)
inherited

Definition at line 21 of file TFCSLateralShapeParametrization.cxx.

21  {
22  m_calosample = cs;
23 }

◆ set_coordinates()

void TFCSBinnedShowerONNX::set_coordinates ( const event_bins_t coordinates)
inline

Definition at line 77 of file TFCSBinnedShowerONNX.h.

77  {
78  m_coordinates = coordinates;
79  }

◆ set_daughter()

virtual void TFCSParametrizationBase::set_daughter ( unsigned int  ,
TFCSParametrizationBase  
)
inlinevirtualinherited

Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter method allows to change these daughters - expert use only! The original element at this position is not deleted.

Reimplemented in TFCSParametrizationChain, and TFCSLateralShapeParametrizationHitChain.

Definition at line 113 of file TFCSParametrizationBase.h.

114  {};

◆ set_default_hit_energy()

void TFCSBinnedShowerONNX::set_default_hit_energy ( float  energy)
inline

Definition at line 48 of file TFCSBinnedShowerONNX.h.

◆ set_Ekin()

void TFCSParametrization::set_Ekin ( const TFCSParametrizationBase ref)
virtualinherited

Definition at line 55 of file TFCSParametrization.cxx.

55  {
56  set_Ekin_nominal(ref.Ekin_nominal());
57  set_Ekin_min(ref.Ekin_min());
58  set_Ekin_max(ref.Ekin_max());
59 }

◆ set_Ekin_bin()

void TFCSLateralShapeParametrization::set_Ekin_bin ( int  bin)
inherited

Definition at line 17 of file TFCSLateralShapeParametrization.cxx.

17  {
18  m_Ekin_bin = bin;
19 }

◆ set_Ekin_eta()

void TFCSParametrization::set_Ekin_eta ( const TFCSParametrizationBase ref)
virtualinherited

Definition at line 67 of file TFCSParametrization.cxx.

67  {
68  set_Ekin(ref);
69  set_eta(ref);
70 }

◆ set_Ekin_max()

void TFCSParametrization::set_Ekin_max ( double  max)
virtualinherited

Definition at line 45 of file TFCSParametrization.cxx.

45 { m_Ekin_max = max; }

◆ set_Ekin_min()

void TFCSParametrization::set_Ekin_min ( double  min)
virtualinherited

Definition at line 43 of file TFCSParametrization.cxx.

43 { m_Ekin_min = min; }

◆ set_Ekin_nominal()

void TFCSParametrization::set_Ekin_nominal ( double  min)
virtualinherited

Definition at line 39 of file TFCSParametrization.cxx.

39  {
40  m_Ekin_nominal = nominal;
41 }

◆ set_eta()

void TFCSParametrization::set_eta ( const TFCSParametrizationBase ref)
virtualinherited

Definition at line 61 of file TFCSParametrization.cxx.

61  {
62  set_eta_nominal(ref.eta_nominal());
63  set_eta_min(ref.eta_min());
64  set_eta_max(ref.eta_max());
65 }

◆ set_eta_max()

void TFCSParametrization::set_eta_max ( double  max)
virtualinherited

Definition at line 53 of file TFCSParametrization.cxx.

53 { m_eta_max = max; }

◆ set_eta_min()

void TFCSParametrization::set_eta_min ( double  min)
virtualinherited

Definition at line 51 of file TFCSParametrization.cxx.

51 { m_eta_min = min; }

◆ set_eta_nominal()

void TFCSParametrization::set_eta_nominal ( double  min)
virtualinherited

Definition at line 47 of file TFCSParametrization.cxx.

47  {
48  m_eta_nominal = nominal;
49 }

◆ set_geometry()

virtual void TFCSBinnedShowerBase::set_geometry ( ICaloGeometry geo)
inlineoverridevirtualinherited

Method to set the geometry access pointer.

Loops over daughter objects if present

Reimplemented from TFCSParametrizationBase.

Definition at line 53 of file TFCSBinnedShowerBase.h.

53  {
54  m_geo = geo;
56  };

◆ set_match_all_pdgid()

virtual void TFCSParametrizationBase::set_match_all_pdgid ( )
inlinevirtualinherited

Definition at line 83 of file TFCSParametrizationBase.h.

83 { SetBit(kMatchAllPDGID); };

◆ set_max_hits_per_voxel()

void TFCSBinnedShowerONNX::set_max_hits_per_voxel ( int  max_hits)
inline

Definition at line 50 of file TFCSBinnedShowerONNX.h.

50 { m_max_hits_per_voxel = max_hits; }

◆ set_OnlyScaleEnergy()

void TFCSBinnedShowerBase::set_OnlyScaleEnergy ( )
inlineinherited

Definition at line 37 of file TFCSBinnedShowerBase.h.

37 { SetBit(kOnlyScaleEnergy); };

◆ set_pdgid() [1/2]

void TFCSParametrization::set_pdgid ( const std::set< int > &  ids)
virtualinherited

Reimplemented in TFCSEnergyBinParametrization.

Definition at line 33 of file TFCSParametrization.cxx.

33 { m_pdgid = ids; }

◆ set_pdgid() [2/2]

void TFCSParametrization::set_pdgid ( int  id)
virtualinherited

Reimplemented in TFCSEnergyBinParametrization.

Definition at line 28 of file TFCSParametrization.cxx.

28  {
29  m_pdgid.clear();
30  m_pdgid.insert(id);
31 }

◆ set_pdgid_Ekin_eta()

void TFCSParametrization::set_pdgid_Ekin_eta ( const TFCSParametrizationBase ref)
virtualinherited

Definition at line 72 of file TFCSParametrization.cxx.

73  {
75  set_pdgid(ref.pdgid());
76 }

◆ set_pdgid_Ekin_eta_Ekin_bin_calosample()

void TFCSLateralShapeParametrization::set_pdgid_Ekin_eta_Ekin_bin_calosample ( const TFCSLateralShapeParametrization ref)
virtualinherited

Definition at line 25 of file TFCSLateralShapeParametrization.cxx.

26  {
27  set_calosample(ref.calosample());
28  set_Ekin_bin(ref.Ekin_bin());
30 }

◆ set_sub_bin_distribution_and_energies()

void TFCSBinnedShowerONNX::set_sub_bin_distribution_and_energies ( const std::vector< std::vector< std::vector< std::vector< float >>>> &  sub_bin_distribution,
const std::vector< float > &  upscaling_energies 
)
inline

Definition at line 90 of file TFCSBinnedShowerONNX.h.

93  {
94  m_sub_bin_distribution = sub_bin_distribution;
95  m_upscaling_energies = upscaling_energies;
96  m_use_upscaling = true;
97  }

◆ setLevel()

void ISF_FCS::MLogging::setLevel ( MSG::Level  lvl)
virtualinherited

Update outputlevel.

Definition at line 105 of file MLogging.cxx.

105  {
106  lvl = (lvl >= MSG::NUM_LEVELS) ? MSG::ALWAYS
107  : (lvl < MSG::NIL) ? MSG::NIL
108  : lvl;
109  msg().setLevel(lvl);
110 }

◆ simulate()

FCSReturnCode TFCSBinnedShowerBase::simulate ( TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
) const
overridevirtualinherited

Method in all derived classes to do some simulation.

Result should be returned in simulstate.

Simulate all energies in calo layers for energy parametrizations. Simulate cells for shape simulation.

Reimplemented from TFCSParametrizationBase.

Definition at line 45 of file TFCSBinnedShowerBase.cxx.

47  {
48 
49  // select a random event from the library
50  float eta_center, phi_center;
51  long unsigned int reference_layer_index = CaloCell_ID_FCS::CaloSample_FCS::EMB2;
52  eta_center =
53  extrapol->eta(reference_layer_index, TFCSExtrapolationState::SUBPOS_MID);
54  if (eta_center > 1.4) { // Endcap becomes more relevant
55  reference_layer_index = CaloCell_ID_FCS::CaloSample_FCS::EME2;
56  }
57  // TODO: What about the endcap?
58  eta_center =
59  extrapol->eta(reference_layer_index, TFCSExtrapolationState::SUBPOS_MID);
60  phi_center =
61  extrapol->phi(reference_layer_index, TFCSExtrapolationState::SUBPOS_MID);
62 
63  // Fill the total energy and layer energies into simulstate
64  float Einit;
65  const float Ekin = truth->Ekin();
66 
67  if (OnlyScaleEnergy())
68  Einit = simulstate.E();
69  else
70  Einit = Ekin;
71 
72  // Reset the total energy
73  simulstate.set_E(0);
74 
75  get_event(simulstate, eta_center, phi_center, Einit, reference_layer_index);
76 
77  for (long unsigned int layer_index = 0;
78  layer_index < CaloCell_ID_FCS::MaxSample; ++layer_index) {
79 
80  float layer_energy = get_layer_energy(simulstate, layer_index);
81 
82  // Reset and set the layer energy
83  simulstate.set_E(layer_index, 0);
84  simulstate.add_E(layer_index, layer_energy);
85  }
86 
87  if (simulstate.E() > std::numeric_limits<double>::epsilon()) {
88  for (int ilayer = 0; ilayer < CaloCell_ID_FCS::MaxSample; ++ilayer) {
89  simulstate.set_Efrac(ilayer, simulstate.E(ilayer) / simulstate.E());
90  }
91  }
92  return FCSSuccess;
93 }

◆ simulate_hit()

FCSReturnCode TFCSBinnedShowerBase::simulate_hit ( Hit hit,
TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
)
overridevirtualinherited

simulated one hit position with some energy.

As last step in TFCSLateralShapeParametrizationHitChain::simulate, the hit should be mapped into a cell and this cell recorded in simulstate. All hits/cells should be resacled such that their final sum is simulstate->E(sample)

Reimplemented from TFCSLateralShapeParametrizationHitBase.

Definition at line 95 of file TFCSBinnedShowerBase.cxx.

97  {
98 
99  // Extrapol unused, but needed for the interface
100  (void)extrapol;
101 
102  const int pdgId = truth->pdgid();
103  const float charge = HepPDT::ParticleID(pdgId).charge();
104  long unsigned int layer_index = calosample();
105 
106  const double center_eta = hit.center_eta();
107  const double center_phi = hit.center_phi();
108  const double center_r = hit.center_r();
109  const double center_z = hit.center_z();
110 
111  ATH_MSG_VERBOSE(" Layer " << layer_index << " Extrap eta " << center_eta
112  << " phi " << center_phi << " R " << center_r);
113 
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)));
117 
118  long unsigned int hit_index = hit.idx();
119 
120  // Get necessary the hit information
121  float r, alpha, E;
122  std::tie(r, alpha, E) =
123  get_hit_position_and_energy(simulstate, layer_index, hit_index);
124 
125  hit.reset();
126  hit.E() = E;
127 
128  if (layer_index <= CaloCell_ID_FCS::CaloSample_FCS::FCAL0) {
129  float delta_eta_mm = r * cos(alpha);
130  float delta_phi_mm = r * sin(alpha);
131 
132  // Particles with negative eta are expected to have the same shape
133  // as those with positive eta after transformation: delta_eta -->
134  // -delta_eta
135  if (center_eta < 0.) {
136  delta_eta_mm = -delta_eta_mm;
137  }
138 
139  // We derive the shower shapes for electrons and positively charged
140  // hadrons. Particle with the opposite charge are expected to have the
141  // same shower shape after the transformation: delta_phi -->
142  // -delta_phi
143  if ((charge < 0. && pdgId != 11) || pdgId == -11)
144  delta_phi_mm = -delta_phi_mm;
145 
146  const float delta_eta = delta_eta_mm / eta_jakobi / dist000;
147  const float delta_phi = delta_phi_mm / center_r;
148 
149  hit.eta() = center_eta + delta_eta;
150  hit.phi() = TVector2::Phi_mpi_pi(center_phi + delta_phi);
151 
152  ATH_MSG_VERBOSE(" Hit eta " << hit.eta() << " phi " << hit.phi()
153  << " layer " << layer_index);
154 
155  } else { // FCAL is in (x,y,z)
156  const float hit_r = r * cos(alpha) + center_r;
157  float delta_phi = r * sin(alpha) / center_r;
158  // We derive the shower shapes for electrons and positively charged
159  // hadrons. Particle with the opposite charge are expected to have the
160  // same shower shape after the transformation: delta_phi -->
161  // -delta_phi
162  if ((charge < 0. && pdgId != 11) || pdgId == -11)
163  delta_phi = -delta_phi;
164  const float hit_phi = TVector2::Phi_mpi_pi(center_phi + delta_phi);
165  hit.x() = hit_r * cos(hit_phi);
166  hit.y() = hit_r * sin(hit_phi);
167  hit.z() = center_z;
168  ATH_MSG_VERBOSE(" Hit x " << hit.x() << " y " << hit.y() << " layer "
169  << layer_index);
170  }
171 
172  return FCSSuccess;
173 }

◆ size()

virtual unsigned int TFCSParametrizationBase::size ( ) const
inlinevirtualinherited

Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters.

Reimplemented in TFCSLateralShapeParametrizationHitChain, and TFCSParametrizationChain.

Definition at line 93 of file TFCSParametrizationBase.h.

93 { return 0; };

◆ startMsg()

std::string ISF_FCS::MLogging::startMsg ( MSG::Level  lvl,
const std::string &  file,
int  line 
)
staticinherited

Make a message to decorate the start of logging.

Print a message for the start of logging.

Definition at line 116 of file MLogging.cxx.

116  {
117  int col1_len = 20;
118  int col2_len = 5;
119  int col3_len = 10;
120  auto last_slash = file.find_last_of('/');
121  int path_len = last_slash == std::string::npos ? 0 : last_slash;
122  int trim_point = path_len;
123  int total_len = file.length();
124  if (total_len - path_len > col1_len)
125  trim_point = total_len - col1_len;
126  std::string trimmed_name = file.substr(trim_point);
127  const char *LevelNames[MSG::NUM_LEVELS] = {
128  "NIL", "VERBOSE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL", "ALWAYS"};
129  std::string level = LevelNames[lvl];
130  std::string level_string = std::string("(") + level + ") ";
131  std::stringstream output;
132  output << std::setw(col1_len) << std::right << trimmed_name << ":"
133  << std::setw(col2_len) << std::left << line << std::setw(col3_len)
134  << std::right << level_string;
135  return output.str();
136 }

◆ upscale()

void TFCSBinnedShowerONNX::upscale ( TFCSSimulationState simulstate,
float &  R_min,
float &  R_max,
float &  alpha_min,
float &  alpha_max,
long unsigned int  layer_index,
int  bin_index 
) const
private

Definition at line 348 of file TFCSBinnedShowerONNX.cxx.

352  {
353 
354  float p = CLHEP::RandFlat::shoot(simulstate.randomEngine(), 0, 1);
355 
356  float e_init = simulstate.getAuxInfo<float>("BSEinit"_FCShash);
357  std::vector<float> available_energies = m_upscaling_energies;
358 
359  unsigned int e_index = 0;
360 
361  std::vector<float> probabilities = {0.25f, 0.5f, 0.75f};
362 
363  if (available_energies.size() > 1) {
364  // find closest energy index using binary search
365  auto it = std::upper_bound(available_energies.begin(),
366  available_energies.end(), e_init);
367  if (it != available_energies.end()) {
368  e_index = std::distance(available_energies.begin(), it);
369  } else {
370  e_index = available_energies.size() - 1;
371  }
372 
373  float e_high = available_energies.at(e_index);
374  if (e_high < e_init || e_index == 0) {
375  if (m_sub_bin_distribution.at(e_index).size() > layer_index) {
376  probabilities =
377  m_sub_bin_distribution.at(e_index).at(layer_index).at(bin_index);
378  }
379  } else {
380  if (m_sub_bin_distribution.at(e_index).size() > layer_index &&
381  m_sub_bin_distribution.at(e_index - 1).size() > layer_index) {
382  float e_low = available_energies.at(e_index - 1);
383  float f_low = std::log(e_high / e_init) / (std::log(e_high / e_low));
384  float f_high = 1 - f_low;
385  for (unsigned int i = 0; i < 3; ++i) {
386  float p_low = m_sub_bin_distribution.at(e_index - 1)
387  .at(layer_index)
388  .at(bin_index)
389  .at(i);
390  float p_high = m_sub_bin_distribution.at(e_index)
391  .at(layer_index)
392  .at(bin_index)
393  .at(i);
394  probabilities[i] = f_low * p_low + f_high * p_high;
395  }
396  }
397  }
398  }
399 
400  else if (available_energies.size() == 1) {
401  probabilities = m_sub_bin_distribution.at(0).at(layer_index).at(bin_index);
402  }
403 
404 float p_alpha_low = probabilities[2] - probabilities[1] + probabilities[0];
405  float p_r;
406 
407  if (p < p_alpha_low) {
408  alpha_max = (alpha_min + alpha_max) / 2.;
409  p_r = probabilities[0] / (p_alpha_low);
410  } else {
411  alpha_min = (alpha_min + alpha_max) / 2.;
412  p_r = (probabilities[1] - probabilities[0]) / (1 - p_alpha_low);
413  }
414 
415  p = CLHEP::RandFlat::shoot(simulstate.randomEngine(), 0, 1);
416  if (layer_index != 2){
417  // if ((layer_index != 2) && (layer_index != 0)) {
418  if (p > p_r) {
419  R_min = (R_min + R_max) / 2.;
420  return;
421  } else {
422  R_max = (R_min + R_max) / 2.;
423  return;
424  }
425  }
426 
427 
428  // Use linear interpolation for layer 2
429  // It works better than uniform sampling for the second layer...
430  if (p_r < 0.25) {
431  p_r = 0.25; // Values below 0.25 are not allowed for linear pdf
432  } else if (p_r > 0.75) {
433  p_r = 0.75; // Values above 0.75 are not allowed for linear pdf
434  } else if (TMath::Abs(p_r - 0.5) < std::numeric_limits<float>::epsilon()) {
435  return; // Best upscaling is uniform sampling. Nothing to do here.
436  }
437 
438  // Inverse CDF for linear pdf
439  float r = (1. - 4. * p_r) / (2. - 4. * p_r) -
440  TMath::Sqrt(((1. - 4. * p_r) / (2. - 4. * p_r)) *
441  ((1. - 4. * p_r) / (2. - 4. * p_r)) +
442  p / ((1. / 2.) - p_r));
443  if (r < 0) {
444  r = (1. - 4. * p_r) / (2. - 4. * p_r) +
445  TMath::Sqrt(((1. - 4. * p_r) / (2. - 4. * p_r)) *
446  ((1. - 4. * p_r) / (2. - 4. * p_r)) +
447  p / ((1. / 2.) - p_r));
448  }
449 
450  R_min = R_min + r / 2 * (R_max - R_min);
451  R_max = R_min;
452 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

boost::thread_specific_ptr<MsgStream> m_msg_tls ISF_FCS::MLogging::ATLAS_THREAD_SAFE
inlinestaticprivateinherited

Do not persistify!

MsgStream instance (a std::cout like with print-out levels)

Definition at line 215 of file MLogging.h.

◆ init_Ekin_max

constexpr double TFCSParametrizationBase::init_Ekin_max = 14000000
staticconstexprprotectedinherited

Do not persistify!

Definition at line 155 of file TFCSParametrizationBase.h.

◆ init_Ekin_min

constexpr double TFCSParametrizationBase::init_Ekin_min = 0
staticconstexprprotectedinherited

Do not persistify!

Definition at line 154 of file TFCSParametrizationBase.h.

◆ init_Ekin_nominal

constexpr double TFCSParametrizationBase::init_Ekin_nominal = 0
staticconstexprprotectedinherited

Definition at line 153 of file TFCSParametrizationBase.h.

◆ init_eta_max

constexpr double TFCSParametrizationBase::init_eta_max = 100
staticconstexprprotectedinherited

Do not persistify!

Definition at line 158 of file TFCSParametrizationBase.h.

◆ init_eta_min

constexpr double TFCSParametrizationBase::init_eta_min = -100
staticconstexprprotectedinherited

Do not persistify!

Definition at line 157 of file TFCSParametrizationBase.h.

◆ init_eta_nominal

constexpr double TFCSParametrizationBase::init_eta_nominal = 0
staticconstexprprotectedinherited

Do not persistify!

Definition at line 156 of file TFCSParametrizationBase.h.

◆ m_ai_simulator

TFCSMLCalorimeterSimulator* TFCSBinnedShowerONNX::m_ai_simulator = nullptr
private

Definition at line 173 of file TFCSBinnedShowerONNX.h.

◆ m_calosample

int TFCSLateralShapeParametrization::m_calosample
privateinherited

Definition at line 47 of file TFCSLateralShapeParametrization.h.

◆ m_coordinates

event_bins_t TFCSBinnedShowerONNX::m_coordinates
private

Definition at line 139 of file TFCSBinnedShowerONNX.h.

◆ m_default_hit_energy

float TFCSBinnedShowerONNX::m_default_hit_energy = 4.
private

Definition at line 134 of file TFCSBinnedShowerONNX.h.

◆ m_Ekin_bin

int TFCSLateralShapeParametrization::m_Ekin_bin
privateinherited

Definition at line 46 of file TFCSLateralShapeParametrization.h.

◆ m_Ekin_max

double TFCSParametrization::m_Ekin_max
privateinherited

Definition at line 64 of file TFCSParametrization.h.

◆ m_Ekin_min

double TFCSParametrization::m_Ekin_min
privateinherited

Definition at line 64 of file TFCSParametrization.h.

◆ m_Ekin_nominal

double TFCSParametrization::m_Ekin_nominal
privateinherited

Definition at line 64 of file TFCSParametrization.h.

◆ m_eta_max

double TFCSParametrization::m_eta_max
privateinherited

Definition at line 65 of file TFCSParametrization.h.

◆ m_eta_min

double TFCSParametrization::m_eta_min
privateinherited

Definition at line 65 of file TFCSParametrization.h.

◆ m_eta_nominal

double TFCSParametrization::m_eta_nominal
privateinherited

Definition at line 65 of file TFCSParametrization.h.

◆ m_geo

ICaloGeometry* TFCSBinnedShowerBase::m_geo
protectedinherited

Definition at line 68 of file TFCSBinnedShowerBase.h.

◆ m_max_hits_per_voxel

int TFCSBinnedShowerONNX::m_max_hits_per_voxel = 100
private

Definition at line 136 of file TFCSBinnedShowerONNX.h.

◆ m_n_layers

const long unsigned int TFCSBinnedShowerONNX::m_n_layers
private
Initial value:

Definition at line 130 of file TFCSBinnedShowerONNX.h.

◆ m_nm

std::string ISF_FCS::MLogging::m_nm
privateinherited

Message source name.

Definition at line 211 of file MLogging.h.

◆ m_pdgid

std::set<int> TFCSParametrization::m_pdgid
privateinherited

Definition at line 63 of file TFCSParametrization.h.

◆ m_sub_bin_distribution

std::vector<std::vector<std::vector<std::vector<float> > > > TFCSBinnedShowerONNX::m_sub_bin_distribution
private

Definition at line 151 of file TFCSBinnedShowerONNX.h.

◆ m_upscaling_energies

std::vector<float> TFCSBinnedShowerONNX::m_upscaling_energies
private

Definition at line 152 of file TFCSBinnedShowerONNX.h.

◆ m_use_upscaling

bool TFCSBinnedShowerONNX::m_use_upscaling = false
private

Definition at line 146 of file TFCSBinnedShowerONNX.h.


The documentation for this class was generated from the following files:
Hit::x
CUDA_HOSTDEV float & x()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:73
TFCSParametrizationBase::set_daughter
virtual void set_daughter(unsigned int, TFCSParametrizationBase *)
Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter meth...
Definition: TFCSParametrizationBase.h:113
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:25
beamspotman.r
def r
Definition: beamspotman.py:672
TFCSParametrization::set_Ekin_nominal
virtual void set_Ekin_nominal(double min)
Definition: TFCSParametrization.cxx:39
TFCSBinnedShowerBase::m_geo
ICaloGeometry * m_geo
Definition: TFCSBinnedShowerBase.h:68
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TFCSSimulationState::getAuxInfo
const T getAuxInfo(std::uint32_t index) const
Definition: TFCSSimulationState.h:161
createLinkingScheme.layer_idx
layer_idx
Definition: createLinkingScheme.py:43
TFCSParametrizationBase::init_Ekin_max
static constexpr double init_Ekin_max
Do not persistify!
Definition: TFCSParametrizationBase.h:155
TFCSParametrizationBase::compare
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!
Definition: TFCSParametrizationBase.cxx:42
TFCSParametrizationBase::init_eta_nominal
static constexpr double init_eta_nominal
Do not persistify!
Definition: TFCSParametrizationBase.h:156
TFCSBinnedShowerONNX::m_max_hits_per_voxel
int m_max_hits_per_voxel
Definition: TFCSBinnedShowerONNX.h:136
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
add-xsec-uncert-quadrature-N.alpha
alpha
Definition: add-xsec-uncert-quadrature-N.py:110
TFCSBinnedShowerONNX::m_ai_simulator
TFCSMLCalorimeterSimulator * m_ai_simulator
Definition: TFCSBinnedShowerONNX.h:173
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
TFCSBinnedShowerONNX::m_upscaling_energies
std::vector< float > m_upscaling_energies
Definition: TFCSBinnedShowerONNX.h:152
TFCSParametrizationBase::init_Ekin_min
static constexpr double init_Ekin_min
Do not persistify!
Definition: TFCSParametrizationBase.h:154
Run3DQTestingDriver._
_
Definition: Run3DQTestingDriver.py:35
IsA
#define IsA
Declare the TObject style functions.
Definition: xAODTEventBranch.h:59
TFCSLateralShapeParametrization::Ekin_bin
int Ekin_bin() const
Definition: TFCSLateralShapeParametrization.h:31
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TFCSParametrization::Ekin_max
double Ekin_max() const override
Definition: TFCSParametrization.h:37
make_coralServer_rep.opt
opt
Definition: make_coralServer_rep.py:19
TFCSParametrizationBase::init_eta_min
static constexpr double init_eta_min
Do not persistify!
Definition: TFCSParametrizationBase.h:157
TFCSLateralShapeParametrization::m_Ekin_bin
int m_Ekin_bin
Definition: TFCSLateralShapeParametrization.h:46
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
index
Definition: index.py:1
ISF_FCS::MLogging::level
MSG::Level level() const
Retrieve output level.
Definition: MLogging.h:201
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
TFCSBinnedShowerONNX::load_bin_boundaries
void load_bin_boundaries(const std::string &filename, long unsigned int layer_index)
Definition: TFCSBinnedShowerONNX.cxx:136
TFCSBinnedShowerBase::get_layer_energy
virtual float get_layer_energy(TFCSSimulationState &simulstate, long unsigned int layer_index) const =0
TFCSParametrization::set_pdgid_Ekin_eta
virtual void set_pdgid_Ekin_eta(const TFCSParametrizationBase &ref)
Definition: TFCSParametrization.cxx:72
TFCSParametrization::m_eta_nominal
double m_eta_nominal
Definition: TFCSParametrization.h:65
TRT::Track::event
@ event
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:74
CaloClusterMLCalib::epsilon
constexpr float epsilon
Definition: CaloClusterMLGaussianMixture.h:16
TFCSBinnedShowerBase::kOnlyScaleEnergy
@ kOnlyScaleEnergy
Set this bit in the TObject bit field the simulated energy should only be scaled by the GAN.
Definition: TFCSBinnedShowerBase.h:30
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:113
skel.it
it
Definition: skel.GENtoEVGEN.py:407
TFCSParametrizationBase::FindDuplicates
void FindDuplicates(FindDuplicateClasses_t &dup)
Definition: TFCSParametrizationBase.cxx:90
TFCSParametrization::set_Ekin_max
virtual void set_Ekin_max(double max)
Definition: TFCSParametrization.cxx:45
TFCSMLCalorimeterSimulator::layer_t
Definition: TFCSMLCalorimeterSimulator.h:28
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:157
TFCSBinnedShowerBase::OnlyScaleEnergy
bool OnlyScaleEnergy() const
Definition: TFCSBinnedShowerBase.h:35
TFCSMLCalorimeterSimulator::getEvent
event_t getEvent(TFCSSimulationState &simulstate, float eta, float energy) const
Definition: TFCSMLCalorimeterSimulator.cxx:85
TFCSMLCalorimeterSimulator
Definition: TFCSMLCalorimeterSimulator.h:23
TFCSBinnedShowerONNX::get_coordinates
const event_bins_t & get_coordinates()
Definition: TFCSBinnedShowerONNX.h:75
TFCSParametrizationBase::init_eta_max
static constexpr double init_eta_max
Do not persistify!
Definition: TFCSParametrizationBase.h:158
TFCSParametrization::m_eta_max
double m_eta_max
Definition: TFCSParametrization.h:65
Hit::center_eta
CUDA_HOSTDEV float & center_eta()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:85
TFCSSimulationState::randomEngine
CLHEP::HepRandomEngine * randomEngine()
Definition: TFCSSimulationState.h:36
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TFCSExtrapolationState::SUBPOS_MID
@ SUBPOS_MID
Definition: TFCSExtrapolationState.h:20
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:91
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonR4::to_string
std::string to_string(const SectorProjector proj)
Definition: MsTrackSeeder.cxx:66
TFCSParametrization::set_Ekin
virtual void set_Ekin(const TFCSParametrizationBase &ref)
Definition: TFCSParametrization.cxx:55
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:10
TFCSParametrization::set_eta
virtual void set_eta(const TFCSParametrizationBase &ref)
Definition: TFCSParametrization.cxx:61
TFCSBinnedShowerBase::get_n_hits
virtual long unsigned int get_n_hits(TFCSSimulationState &simulstate, long unsigned int layer_index) const =0
TFCSMLCalorimeterSimulator::loadSimulator
bool loadSimulator(std::string &filename)
Definition: TFCSMLCalorimeterSimulator.cxx:16
dq_defect_bulk_create_defects.line
line
Definition: dq_defect_bulk_create_defects.py:27
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
TFCSParametrization::set_eta_max
virtual void set_eta_max(double max)
Definition: TFCSParametrization.cxx:53
TFCSBinnedShowerONNX::m_default_hit_energy
float m_default_hit_energy
Definition: TFCSBinnedShowerONNX.h:134
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
TFCSParametrization::set_pdgid
virtual void set_pdgid(int id)
Definition: TFCSParametrization.cxx:28
TFCSParametrization::set_Ekin_eta
virtual void set_Ekin_eta(const TFCSParametrizationBase &ref)
Definition: TFCSParametrization.cxx:67
TFCSParametrizationBase
Definition: TFCSParametrizationBase.h:46
TFCSSimulationState::add_E
void add_E(int sample, double Esample)
Definition: TFCSSimulationState.h:53
CaloCell_ID_FCS::MaxSample
@ MaxSample
Definition: FastCaloSim_CaloCell_ID.h:47
LArNewCalib_PedestalAutoCorr.MaxSample
int MaxSample
Definition: LArNewCalib_PedestalAutoCorr.py:15
TFCSLateralShapeParametrization::set_calosample
void set_calosample(int cs)
Definition: TFCSLateralShapeParametrization.cxx:21
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
TFCSBinnedShowerONNX::load_hdf5_dataset
std::tuple< std::vector< float >, std::vector< hsize_t >, bool > load_hdf5_dataset(const std::string &filename, const std::string &datasetname)
Definition: TFCSBinnedShowerONNX.cxx:102
ISF_FCS::MLogging::msg
MsgStream & msg() const
Return a stream for sending messages directly (no decoration)
Definition: MLogging.h:231
TFCSParametrization::set_Ekin_min
virtual void set_Ekin_min(double min)
Definition: TFCSParametrization.cxx:43
TFCSBinnedShowerONNX::m_sub_bin_distribution
std::vector< std::vector< std::vector< std::vector< float > > > > m_sub_bin_distribution
Definition: TFCSBinnedShowerONNX.h:151
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
TrigConf::MSGTC::ALWAYS
@ ALWAYS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:29
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
Hit::center_z
CUDA_HOSTDEV float & center_z()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:84
lumiFormat.i
int i
Definition: lumiFormat.py:85
TFCSLateralShapeParametrization::set_Ekin_bin
void set_Ekin_bin(int bin)
Definition: TFCSLateralShapeParametrization.cxx:17
Hit::center_phi
CUDA_HOSTDEV float & center_phi()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:86
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TFCSTruthState::Ekin
double Ekin() const
Definition: TFCSTruthState.h:26
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TFCSMLCalorimeterSimulator::event_t
Definition: TFCSMLCalorimeterSimulator.h:33
python.CaloAddPedShiftConfig.str
str
Definition: CaloAddPedShiftConfig.py:42
TFCSParametrizationBase::FindDuplicateClasses_t
std::map< std::string, FindDuplicates_t > FindDuplicateClasses_t
Definition: TFCSParametrizationBase.h:142
covarianceTool.title
title
Definition: covarianceTool.py:542
ISF_FCS::MLogging::m_nm
std::string m_nm
Message source name.
Definition: MLogging.h:211
TFCSParametrizationBase::set_geometry
virtual void set_geometry(ICaloGeometry *geo)
Method to set the geometry access pointer.
Definition: TFCSParametrizationBase.cxx:24
Hit::y
CUDA_HOSTDEV float & y()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:74
file
TFile * file
Definition: tile_monitor.h:29
TFCSParametrization::m_Ekin_min
double m_Ekin_min
Definition: TFCSParametrization.h:64
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
TFCSBinnedShowerBase::TFCSBinnedShowerBase
TFCSBinnedShowerBase(const char *name=nullptr, const char *title=nullptr)
Definition: TFCSBinnedShowerBase.cxx:38
TFCSParametrization::Ekin_min
double Ekin_min() const override
Definition: TFCSParametrization.h:36
TFCSParametrization::m_eta_min
double m_eta_min
Definition: TFCSParametrization.h:65
TFCSParametrizationBase::Print
void Print(Option_t *option="") const
Print object information.
Definition: TFCSParametrizationBase.cxx:52
hist_file_dump.f
f
Definition: hist_file_dump.py:140
Hit::z
CUDA_HOSTDEV float & z()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:76
dataset
Definition: dataset.h:27
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
TFCSParametrizationBase::FindDuplicates_t
std::map< TFCSParametrizationBase *, Duplicate_t > FindDuplicates_t
Definition: TFCSParametrizationBase.h:141
Hit::reset
CUDA_HOSTDEV void reset()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:63
FCSSuccess
@ FCSSuccess
Definition: TFCSParametrizationBase.h:41
TFCSParametrization::eta_max
double eta_max() const override
Definition: TFCSParametrization.h:40
TFCSBinnedShowerONNX::compute_n_hits_and_elayer
virtual void compute_n_hits_and_elayer(TFCSSimulationState &simulstate) const
Definition: TFCSBinnedShowerONNX.cxx:208
TFCSParametrizationBase::RemoveNameTitle
void RemoveNameTitle()
Definition: TFCSParametrizationBase.cxx:200
merge.output
output
Definition: merge.py:16
TFCSLateralShapeParametrizationHitBase::get_number_of_hits
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Call get_number_of_hits() only once per shower simulation, as it could be calculated with random numb...
Definition: TFCSLateralShapeParametrizationHitBase.cxx:25
TFCSParametrization::m_Ekin_nominal
double m_Ekin_nominal
Definition: TFCSParametrization.h:64
TrigConf::MSGTC::NUM_LEVELS
@ NUM_LEVELS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:30
Hit::phi
CUDA_HOSTDEV float & phi()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:72
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TFCSParametrization::eta_min
double eta_min() const override
Definition: TFCSParametrization.h:39
TFCSParametrization::m_pdgid
std::set< int > m_pdgid
Definition: TFCSParametrization.h:63
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
TFCSParametrization::set_eta_nominal
virtual void set_eta_nominal(double min)
Definition: TFCSParametrization.cxx:47
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
TFCSSimulationState::setAuxInfo
void setAuxInfo(std::uint32_t index, const T &val)
Definition: TFCSSimulationState.h:168
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:82
TFCSSimulationState::set_E
void set_E(int sample, double Esample)
Definition: TFCSSimulationState.h:48
charge
double charge(const T &p)
Definition: AtlasPID.h:997
runIDPVM.pdgId
pdgId
Definition: runIDPVM.py:91
TFCSTruthState::pdgid
int pdgid() const
Definition: TFCSTruthState.h:25
TFCSParametrizationBase::init_Ekin_nominal
static constexpr double init_Ekin_nominal
Definition: TFCSParametrizationBase.h:153
TFCSBinnedShowerONNX::get_energy_index
long unsigned int get_energy_index(TFCSSimulationState &simulstate, long unsigned int layer_index, long unsigned int hit_index) const
Definition: TFCSBinnedShowerONNX.cxx:288
TFCSBinnedShowerONNX::m_use_upscaling
bool m_use_upscaling
Definition: TFCSBinnedShowerONNX.h:146
DeMoScan.index
string index
Definition: DeMoScan.py:362
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:63
columnar::empty
bool empty() const noexcept
Definition: ObjectRange.h:167
TFCSLateralShapeParametrization::calosample
int calosample() const
Definition: TFCSLateralShapeParametrization.h:34
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
ref
const boost::regex ref(r_ef)
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
eFEXNTuple.delta_phi
def delta_phi(phi1, phi2)
Definition: eFEXNTuple.py:14
DEBUG
#define DEBUG
Definition: page_access.h:11
TFCSBinnedShowerBase::get_event
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
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TFCSBinnedShowerONNX::upscale
void upscale(TFCSSimulationState &simulstate, float &R_min, float &R_max, float &alpha_min, float &alpha_max, long unsigned int layer_index, int bin_index) const
Definition: TFCSBinnedShowerONNX.cxx:348
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
Hit::E
CUDA_HOSTDEV float & E()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:75
TFCSParametrization::set_eta_min
virtual void set_eta_min(double min)
Definition: TFCSParametrization.cxx:51
TFCSSimulationState::E
double E() const
Definition: TFCSSimulationState.h:42
python.copyTCTOutput.totalSize
totalSize
Definition: copyTCTOutput.py:90
TFCSBinnedShowerBase::get_hit_position_and_energy
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
Hit::eta
CUDA_HOSTDEV float & eta()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:71
TFCSParametrization::m_Ekin_max
double m_Ekin_max
Definition: TFCSParametrization.h:64
TrigConf::MSGTC::NIL
@ NIL
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:22
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TFCSParametrizationBase::kMatchAllPDGID
@ kMatchAllPDGID
Set this bit in the TObject bit field if valid for all PDGID.
Definition: TFCSParametrizationBase.h:53
TFCSBinnedShowerONNX::m_coordinates
event_bins_t m_coordinates
Definition: TFCSBinnedShowerONNX.h:139
TFCSLateralShapeParametrization
Definition: TFCSLateralShapeParametrization.h:10
TFCSLateralShapeParametrization::m_calosample
int m_calosample
Definition: TFCSLateralShapeParametrization.h:47
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
TFCSParametrizationBase::size
virtual unsigned int size() const
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
Definition: TFCSParametrizationBase.h:93
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
Hit::center_r
CUDA_HOSTDEV float & center_r()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:83
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:357
ISF_FCS::MLogging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
Definition: MLogging.h:222
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TFCSSimulationState::set_Efrac
void set_Efrac(int sample, double Efracsample)
Definition: TFCSSimulationState.h:49
python.SystemOfUnits.ms
float ms
Definition: SystemOfUnits.py:148