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
TFCSBinnedShower Class Reference

#include <TFCSBinnedShower.h>

Inheritance diagram for TFCSBinnedShower:
Collaboration diagram for TFCSBinnedShower:

Classes

struct  event_t
 
struct  layer_bins_t
 
struct  layer_t
 

Public Types

typedef std::vector< event_teventvector_t
 
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

 TFCSBinnedShower (const char *name=nullptr, const char *title=nullptr)
 
virtual ~TFCSBinnedShower ()
 
virtual bool is_match_Ekin_bin (int) const override
 
void enable_event_matching ()
 
void disable_event_matching ()
 
void enable_event_cherry_picking ()
 
void disable_event_cherry_picking ()
 
void enable_eta_matching ()
 
void disable_eta_matching ()
 
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_event_library (const std::string &filename, std::vector< long unsigned int > &layers, bool only_load_meta_data=false)
 
void load_sub_bin_distribution (const std::string &filename)
 
void set_hdf5_path (const std::string &filename)
 
void delete_hdf5_path ()
 
const std::string & get_hdf5_path () const
 
void set_layer_energy (long unsigned int event_index, long unsigned int layer_index, const std::vector< unsigned int > &bin_index_vector, const std::vector< float > &E_vector)
 
void set_bin_boundaries (long unsigned int layer_index, std::vector< float > &R_lower, std::vector< float > &R_size, std::vector< float > &alpha_lower, std::vector< float > &alpha_size)
 
void set_shower_center_information (long unsigned int event_index, long unsigned int reference_layer_index, float eta_center, float phi_center)
 
const eventvector_tget_eventlibrary ()
 
void set_event_library (eventvector_t &eventlibrary)
 
const event_bins_tget_coordinates ()
 
void set_coordinates (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 (std::vector< std::vector< std::vector< std::vector< float >>>> &sub_bin_distribution, 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

long unsigned int find_best_match (float eta_center, float phi_center, float e_init, long unsigned int reference_layer_index, bool phi_mod_matching) const
 
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_layer_energy (const std::string &filename, long unsigned int layer_index)
 
void load_bin_boundaries (const std::string &filename, long unsigned int layer_index)
 
void load_shower_center_information (const std::string &filename)
 

Private Attributes

const long unsigned int m_n_layers
 
float m_default_hit_energy = 4.
 
int m_max_hits_per_voxel = 100
 
std::string m_hdf5_file
 
eventvector_t m_eventlibrary
 
event_bins_t m_coordinates
 
bool m_use_event_matching = false
 
bool m_use_event_cherry_picking = false
 
bool m_use_eta_matching = false
 
bool m_use_upscaling = false
 
std::vector< std::vector< std::vector< std::vector< float > > > > m_sub_bin_distribution
 
std::vector< float > m_upscaling_energies
 
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 23 of file TFCSBinnedShower.h.

Member Typedef Documentation

◆ event_bins_t

Definition at line 46 of file TFCSBinnedShower.h.

◆ eventvector_t

Definition at line 37 of file TFCSBinnedShower.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

◆ TFCSBinnedShower()

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

Definition at line 50 of file TFCSBinnedShower.cxx.

◆ ~TFCSBinnedShower()

TFCSBinnedShower::~TFCSBinnedShower ( )
virtual

Definition at line 53 of file TFCSBinnedShower.cxx.

53 {}

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 TFCSBinnedShower::compute_n_hits_and_elayer ( TFCSSimulationState simulstate) const
protectedvirtual

Definition at line 221 of file TFCSBinnedShower.cxx.

222  {
223 
224  event_t *event = static_cast<event_t *>(
225  simulstate.getAuxInfo<void *>("BSEventData"_FCShash));
226  float e_init = simulstate.getAuxInfo<float>("BSEinit"_FCShash);
227 
228  // Loop over all layers
229  long unsigned int n_layers = event->event_data.size();
230  std::vector<std::vector<long unsigned int>> hits_per_layer;
231  std::vector<float> elayer;
232  hits_per_layer.resize(n_layers);
233  elayer.resize(n_layers, 0.0f);
234 
235  for (long unsigned int layer_index = 0; layer_index < n_layers;
236  ++layer_index) {
237 
238  layer_t &layer = event->event_data.at(layer_index);
239 
240  // Loop over all voxels in the layer
241  long unsigned int n_hits = 0;
242  for (float e_voxel : layer.E_vector) {
243  long unsigned int hits_per_bin;
244  if (e_voxel > std::numeric_limits<float>::epsilon()) {
245  hits_per_bin =
246  std::min(std::max(int(e_voxel * e_init / m_default_hit_energy), 1),
248  elayer.at(layer_index) += e_voxel * e_init;
249 
250  } else {
251  hits_per_bin = 0;
252  }
253  n_hits += hits_per_bin;
254  hits_per_layer.at(layer_index).push_back(n_hits);
255  }
256  }
257  // Store the hits per layer vector
258  std::vector<std::vector<long unsigned int>> *hits_per_layer_ptr =
259  new std::vector<std::vector<long unsigned int>>(hits_per_layer);
260  simulstate.setAuxInfo<void *>("BSNHits"_FCShash, hits_per_layer_ptr);
261 
262  // Store the energy per layer
263  std::vector<float> *elayer_ptr = new std::vector<float>(elayer);
264  simulstate.setAuxInfo<void *>("BSELayer"_FCShash, elayer_ptr);
265 }

◆ delete_event()

void TFCSBinnedShower::delete_event ( TFCSSimulationState simulstate) const
overrideprotectedvirtual

Implements TFCSBinnedShowerBase.

Definition at line 509 of file TFCSBinnedShower.cxx.

509  {
510  // Delete the event data
511  void *event_ptr = simulstate.getAuxInfo<void *>("BSEventData"_FCShash);
512  if (event_ptr) {
513  delete static_cast<event_t *>(event_ptr);
514  simulstate.setAuxInfo<void *>("BSEventData"_FCShash, nullptr);
515  } else {
516  ATH_MSG_ERROR("No event data found to delete.");
517  }
518 
519  void *n_hits_ptr = simulstate.getAuxInfo<void *>("BSNHits"_FCShash);
520  if (n_hits_ptr) {
521  delete static_cast<std::vector<std::vector<long unsigned int>> *>(
522  n_hits_ptr);
523  simulstate.setAuxInfo<void *>("BSNHits"_FCShash, nullptr);
524  } else {
525  ATH_MSG_ERROR("No event hits data found to delete.");
526  }
527 
528  void *elayer_ptr = simulstate.getAuxInfo<void *>("BSELayer"_FCShash);
529  if (elayer_ptr) {
530  delete static_cast<std::vector<float> *>(elayer_ptr);
531  simulstate.setAuxInfo<void *>("BSELayer"_FCShash, nullptr);
532  } else {
533  ATH_MSG_ERROR("No event layer energy data found to delete.");
534  }
535 
536  return;
537 }

◆ delete_hdf5_path()

void TFCSBinnedShower::delete_hdf5_path ( )
inline

Definition at line 102 of file TFCSBinnedShower.h.

102 { m_hdf5_file.clear(); }

◆ disable_eta_matching()

void TFCSBinnedShower::disable_eta_matching ( )
inline

Definition at line 78 of file TFCSBinnedShower.h.

78 { m_use_eta_matching = false; };

◆ disable_event_cherry_picking()

void TFCSBinnedShower::disable_event_cherry_picking ( )
inline

Definition at line 70 of file TFCSBinnedShower.h.

70 { m_use_event_cherry_picking = false; };

◆ disable_event_matching()

void TFCSBinnedShower::disable_event_matching ( )
inline

Definition at line 62 of file TFCSBinnedShower.h.

62 { m_use_event_matching = false; }

◆ disable_upscaling()

void TFCSBinnedShower::disable_upscaling ( )
inline

Definition at line 81 of file TFCSBinnedShower.h.

81 { 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_eta_matching()

void TFCSBinnedShower::enable_eta_matching ( )
inline

Definition at line 72 of file TFCSBinnedShower.h.

72  {
73  m_use_eta_matching = true;
74  m_use_event_matching = false;
76  };

◆ enable_event_cherry_picking()

void TFCSBinnedShower::enable_event_cherry_picking ( )
inline

Definition at line 64 of file TFCSBinnedShower.h.

64  {
66  m_use_event_matching = false;
67  m_use_eta_matching = false;
68  };

◆ enable_event_matching()

void TFCSBinnedShower::enable_event_matching ( )
inline

Definition at line 56 of file TFCSBinnedShower.h.

56  {
57  m_use_event_matching = true;
59  m_use_eta_matching = false;
60  };

◆ enable_upscaling()

void TFCSBinnedShower::enable_upscaling ( )
inline

Definition at line 80 of file TFCSBinnedShower.h.

80 { 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; };

◆ find_best_match()

long unsigned int TFCSBinnedShower::find_best_match ( float  eta_center,
float  phi_center,
float  e_init,
long unsigned int  reference_layer_index,
bool  phi_mod_matching 
) const
private

Definition at line 115 of file TFCSBinnedShower.cxx.

117  {
118 
119  float phi_cell_size, phi_within_cell;
120 
121  if (phi_mod_matching) {
122  const CaloDetDescrElement *cellele =
123  m_geo->getDDE(reference_layer_index, eta_center, phi_center);
125  reference_layer_index, eta_center);
126 
127  float phi_cell = cellele->phi();
128  phi_within_cell = phi_center - phi_cell;
129 
130  phi_within_cell = fmod(phi_within_cell, phi_cell_size);
131  if (phi_within_cell < 0)
132  phi_within_cell += phi_cell_size;
133  }
134 
135  // Find the event with the closest eta_center and phi_mod (L2 distance)
136  float best_distance = std::numeric_limits<float>::max();
137  long unsigned int best_match = m_eventlibrary.size() + 1;
138 
139  for (long unsigned int event_index = 0; event_index < m_eventlibrary.size();
140  ++event_index) {
141 
142  // Absolute eta difference. Normalized by the (usual) eta range of 0.05...
143  float eta_diff =
144  (m_eventlibrary.at(event_index).center_eta - eta_center) / 0.05;
145 
146  // Logarithmic energy difference. Use power of two (distance between usual
147  // energy points) as reasonable distance measure.
148  float e_diff =
149  std::log(m_eventlibrary.at(event_index).e_init / e_init) / std::log(2);
150 
151  // float dist2 = eta_diff * eta_diff;
152  float dist2 = eta_diff * eta_diff + e_diff * e_diff;
153 
154  if (phi_mod_matching) {
155  float phi_mod = m_eventlibrary.at(event_index).phi_mod;
156  float phi_diff = (phi_mod - phi_within_cell) / phi_cell_size;
157  dist2 = dist2 + phi_diff * phi_diff;
158  }
159  float distance = TMath::Sqrt(dist2);
160 
161  if (distance < best_distance) {
162  best_distance = distance;
163  best_match = event_index;
164  }
165  }
166 
167  if (best_match == m_eventlibrary.size() + 1) {
168  ATH_MSG_ERROR("No best match found");
169  } else {
170  ATH_MSG_INFO("Best match found for eta "
171  << eta_center << " / "
172  << m_eventlibrary.at(best_match).center_eta << " with energy "
173  << e_init << " / " << m_eventlibrary.at(best_match).e_init);
174  }
175 
176  return best_match;
177 }

◆ 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& TFCSBinnedShower::get_coordinates ( )
inline

Definition at line 130 of file TFCSBinnedShower.h.

130 { return m_coordinates; }

◆ get_coordinates() [2/2]

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

Definition at line 333 of file TFCSBinnedShower.cxx.

335  {
336  float R_min = m_coordinates.at(layer_index).R_lower.at(bin_index);
337  float R_max = m_coordinates.at(layer_index).R_size.at(bin_index) +
338  m_coordinates.at(layer_index).R_lower.at(bin_index);
339 
340  float alpha_min = m_coordinates.at(layer_index).alpha_lower.at(bin_index);
341  float alpha_max = m_coordinates.at(layer_index).alpha_size.at(bin_index) +
342  m_coordinates.at(layer_index).alpha_lower.at(bin_index);
343 
344  if (m_use_upscaling) {
345  upscale(simulstate, R_min, R_max, alpha_min, alpha_max, layer_index,
346  bin_index);
347  }
348  float R;
349  if (TMath::Abs(R_max - R_min) > std::numeric_limits<float>::epsilon()) {
350  R = CLHEP::RandFlat::shoot(simulstate.randomEngine(), R_min, R_max);
351  } else {
352  R = R_min; // If the range is too small, just use the minimum value
353  }
354  float alpha =
355  CLHEP::RandFlat::shoot(simulstate.randomEngine(), alpha_min, alpha_max);
356 
357  return std::make_tuple(R, alpha);
358 }

◆ get_default_hit_energy()

float TFCSBinnedShower::get_default_hit_energy ( ) const
inline

Definition at line 84 of file TFCSBinnedShower.h.

84 { 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 TFCSBinnedShower::get_energy_index ( TFCSSimulationState simulstate,
long unsigned int  layer_index,
long unsigned int  hit_index 
) const
private

Definition at line 296 of file TFCSBinnedShower.cxx.

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

◆ get_event()

void TFCSBinnedShower::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 179 of file TFCSBinnedShower.cxx.

181  {
182 
183  if (m_eventlibrary.empty()) {
185  "No event library loaded. Please load an event libray for "
186  "TFCSBinnedShower::get_event.");
187  return;
188  }
189 
190  simulstate.setAuxInfo<float>("BSEinit"_FCShash, e_init);
191 
192  long unsigned int event_index;
193  if (simulstate.hasAuxInfo("EventNr"_FCShash) && m_use_event_matching) {
194  event_index = simulstate.getAuxInfo<int>("EventNr"_FCShash);
196  // dphi/deta
197  event_index =
198  find_best_match(eta_center, phi_center, e_init, reference_layer_index,
200 
201  if (event_index >= m_eventlibrary.size()) {
202  event_index = std::floor(CLHEP::RandFlat::shoot(
203  simulstate.randomEngine(), 0, m_eventlibrary.size()));
204  }
205 
206  } else {
207  event_index = std::floor(CLHEP::RandFlat::shoot(simulstate.randomEngine(),
208  0, m_eventlibrary.size()));
209  }
210 
211  ATH_MSG_DEBUG("Using event index " << event_index << " for eta " << eta_center
212  << " and phi " << phi_center);
213 
214  // Store a pointer to the event
215  event_t *event_ptr = new event_t(m_eventlibrary.at(event_index));
216  simulstate.setAuxInfo<void *>("BSEventData"_FCShash, event_ptr);
217 
218  compute_n_hits_and_elayer(simulstate);
219 }

◆ get_eventlibrary()

const eventvector_t& TFCSBinnedShower::get_eventlibrary ( )
inline

Definition at line 124 of file TFCSBinnedShower.h.

124 { return m_eventlibrary; }

◆ get_geometry()

ICaloGeometry* TFCSBinnedShowerBase::get_geometry ( )
inlineinherited

Definition at line 51 of file TFCSBinnedShowerBase.h.

51 { return m_geo; };

◆ get_hdf5_path()

const std::string& TFCSBinnedShower::get_hdf5_path ( ) const
inline

Definition at line 103 of file TFCSBinnedShower.h.

103 { return m_hdf5_file; }

◆ get_hit_position_and_energy()

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

Implements TFCSBinnedShowerBase.

Definition at line 467 of file TFCSBinnedShower.cxx.

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

◆ get_layer_energy()

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

Implements TFCSBinnedShowerBase.

Definition at line 282 of file TFCSBinnedShower.cxx.

283  {
284  std::vector<float> *elayer_ptr = static_cast<std::vector<float> *>(
285  simulstate.getAuxInfo<void *>("BSELayer"_FCShash));
286  if (!elayer_ptr) {
287  ATH_MSG_ERROR("Invalid layer energy information");
288  return 0.0f;
289  }
290  if (layer_index >= elayer_ptr->size()) {
291  return 0.0f;
292  }
293  return elayer_ptr->at(layer_index);
294 }

◆ get_max_hits_per_voxel()

int TFCSBinnedShower::get_max_hits_per_voxel ( ) const
inline

Definition at line 86 of file TFCSBinnedShower.h.

86 { return m_max_hits_per_voxel; }

◆ get_n_hits()

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

Implements TFCSBinnedShowerBase.

Definition at line 267 of file TFCSBinnedShower.cxx.

268  {
269 
270  std::vector<std::vector<long unsigned int>> *hits_per_layer_ptr =
271  static_cast<std::vector<std::vector<long unsigned int>> *>(
272  simulstate.getAuxInfo<void *>("BSNHits"_FCShash));
273 
274  if (!hits_per_layer_ptr) {
275  ATH_MSG_ERROR("Invalid hits per layer information");
276  return 0;
277  }
278 
279  return hits_per_layer_ptr->at(layer_index).back();
280 }

◆ 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> > > >& TFCSBinnedShower::get_sub_bin_distribution ( ) const
inline

Definition at line 137 of file TFCSBinnedShower.h.

137  {
138  return m_sub_bin_distribution;
139  }

◆ get_upscaling_energies()

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

Definition at line 141 of file TFCSBinnedShower.h.

141  {
142  return m_upscaling_energies;
143  }

◆ 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 TFCSBinnedShower::is_match_Ekin_bin ( int  ) const
inlineoverridevirtual

Reimplemented from TFCSParametrizationBase.

Definition at line 52 of file TFCSBinnedShower.h.

52  {
53  return true;
54  };

◆ 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 TFCSBinnedShower::load_bin_boundaries ( const std::string &  filename,
long unsigned int  layer_index 
)
private

Definition at line 652 of file TFCSBinnedShower.cxx.

653  {
654 
655  // Assert that the layer index is valid
656  if (layer_index >= m_coordinates.size()) {
657  m_coordinates.resize(layer_index + 1);
658  }
659 
660  std::vector<std::string> datasetnames = {
661  "binstart_radius_layer_", "binsize_radius_layer_",
662  "binstart_alpha_layer_", "binsize_alpha_layer_"};
663 
664  for (long unsigned int i = 0; i < datasetnames.size(); i++) {
665  std::string datasetname = datasetnames.at(i) + std::to_string(layer_index);
666  std::vector<float> data;
667  std::vector<hsize_t> dims;
668  bool success;
669  std::tie(data, dims, success) = load_hdf5_dataset(filename, datasetname);
670  if (!success) {
671  ATH_MSG_ERROR("Error while extracting the bin boundaries for layer "
672  << layer_index << " from " << filename << "."
673  << "Specifically, the key " << datasetname
674  << " could not be loaded.");
675  return;
676  }
677 
678  // Fill the corresponding vector in the layer_bins_t structure
679  auto &event_bins = m_coordinates.at(layer_index);
680  switch (i) {
681  case 0:
682  event_bins.R_lower = data;
683  break;
684  case 1:
685  event_bins.R_size = data;
686  break;
687  case 2:
688  event_bins.alpha_lower = data;
689  break;
690  case 3:
691  event_bins.alpha_size = data;
692  break;
693  }
694  }
695 }

◆ load_event_library()

void TFCSBinnedShower::load_event_library ( const std::string &  filename,
std::vector< long unsigned int > &  layers,
bool  only_load_meta_data = false 
)

Definition at line 539 of file TFCSBinnedShower.cxx.

541  {
542 
543  if (!only_load_meta_data) {
544  m_eventlibrary.clear();
545  }
546 
547  m_coordinates.clear();
548 
549  if (m_use_upscaling) {
550  m_sub_bin_distribution.clear();
551  }
552 
553  // layer dependent variables
554  for (long unsigned int layer_index : layers) {
555 
556  ATH_MSG_INFO("Loading layer " << layer_index << " from file: " << filename);
557 
558  // Load the bin boundaries for this layer
559  load_bin_boundaries(filename, layer_index);
560 
561  if (!only_load_meta_data) {
562  // Load the layer energies
563  load_layer_energy(filename, layer_index);
564  }
565 
566  }
567 
569  !only_load_meta_data) {
571  }
572 
573  return;
574 }

◆ load_hdf5_dataset()

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

Definition at line 577 of file TFCSBinnedShower.cxx.

578  {
579 
580  // Open the HDF5 file and dataset
581  H5::H5File file(filename, H5F_ACC_RDONLY);
582 
583  // check if the dataset exists
584  if (!file.exists(datasetname)) {
585  return std::make_tuple(std::vector<float>{}, std::vector<hsize_t>{}, false);
586  }
587 
588  H5::DataSet dataset = file.openDataSet(datasetname);
589 
590  // Get the dataspace of the dataset
591  H5::DataSpace dataspace = dataset.getSpace();
592 
593  // Get the number of dimensions and the size of each dimension
594  int rank = dataspace.getSimpleExtentNdims();
595  std::vector<hsize_t> dims_out(rank);
596  dataspace.getSimpleExtentDims(dims_out.data(), NULL);
597 
598  // Calculate the total number of elements
599  hsize_t totalSize = 1;
600  for (const auto &dim : dims_out) {
601  totalSize *= dim;
602  }
603 
604  // Read the dataset into a buffer
605  std::vector<float> data(totalSize);
606  dataset.read(data.data(), H5::PredType::NATIVE_FLOAT);
607  file.close();
608  return std::make_tuple(data, dims_out, true);
609 }

◆ load_layer_energy()

void TFCSBinnedShower::load_layer_energy ( const std::string &  filename,
long unsigned int  layer_index 
)
private

Definition at line 611 of file TFCSBinnedShower.cxx.

612  {
613 
614  std::string datasetname = "energy_layer_" + std::to_string(layer_index);
615 
616  std::vector<float> data;
617  std::vector<hsize_t> dims;
618  bool success;
619  std::tie(data, dims, success) = load_hdf5_dataset(filename, datasetname);
620  if (!success) {
621  ATH_MSG_ERROR("Error while extracting the layer energy for layer "
622  << layer_index << " from " << filename << ".");
623  return;
624  }
625 
626  // Store the data in the event library
627  std::vector<unsigned int> bin_index_vector;
628  std::vector<float> E_vector;
629 
630  for (size_t i = 0; i < data.size(); ++i) {
631  long unsigned int event_index = i / dims.at(1);
632  float bin_index = i % dims.at(1);
633 
634  if (bin_index == 0) {
635  bin_index_vector.clear();
636  E_vector.clear();
637  }
638 
639  if (data.at(i) != 0.0) {
640  bin_index_vector.push_back(bin_index);
641  E_vector.push_back(data.at(i));
642  }
643 
644  if (bin_index ==
645  dims.at(1) - 1) // True for the last voxel of the event in this layer
646  {
647  set_layer_energy(event_index, layer_index, bin_index_vector, E_vector);
648  }
649  }
650 }

◆ load_shower_center_information()

void TFCSBinnedShower::load_shower_center_information ( const std::string &  filename)
private

Definition at line 697 of file TFCSBinnedShower.cxx.

698  {
699 
700  // Open the HDF5 file
701  H5::H5File file(filename, H5F_ACC_RDONLY);
702 
703  // Open the dataset
704  std::vector<std::string> datasetnames = {"phi_mod", "center_eta",
705  "incident_energy"};
706 
707  for (long unsigned int i = 0; i < datasetnames.size(); i++) {
708  std::string datasetname = datasetnames.at(i);
709  std::vector<float> data;
710  std::vector<hsize_t> dims;
711  bool success;
712  std::tie(data, dims, success) = load_hdf5_dataset(filename, datasetname);
713  if (!success) {
714  if (datasetname == "phi_mod" && m_use_eta_matching) {
715  // We do not necessarly need the phi_mod for eta matching, so we can
716  // just skip this dataset
717  continue;
718  } else {
720  "Error while extracting the shower center information from "
721  << filename << "."
722  << "Specifically, the key " << datasetname
723  << " could not be loaded.");
724  }
725  return;
726  }
727 
728  for (long unsigned int event_index = 0; event_index < data.size();
729  ++event_index) {
730  switch (i) {
731  case 0:
732  m_eventlibrary.at(event_index).phi_mod = data.at(event_index);
733  break;
734  case 1:
735  m_eventlibrary.at(event_index).center_eta = data.at(event_index);
736  break;
737  case 2:
738  m_eventlibrary.at(event_index).e_init = data.at(event_index);
739  break;
740  }
741  }
742  }
743 }

◆ load_sub_bin_distribution()

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

Definition at line 776 of file TFCSBinnedShower.cxx.

776  {
777  m_use_upscaling = true;
778  TFile *file = TFile::Open(filename.c_str(), "READ");
779  if (!file || file->IsZombie()) {
780  std::cerr << "Failed to open file: " << filename << std::endl;
781  return;
782  }
783 
784  std::regex pattern(R"(probabilities_layer_(\d+)_energy_([0-9.]+))");
785  std::map<float, std::map<int, std::vector<std::vector<float>>>> temp_storage;
786 
787  TIter next(file->GetListOfKeys());
788  TKey *key;
789 
790  while ((key = (TKey *)next())) {
791  std::string keyname = key->GetName();
792  std::smatch match;
793  if (std::regex_match(keyname, match, pattern)) {
794  int layer = std::stoi(match[1].str());
795  float energy = std::stod(match[2].str());
796 
797  TMatrixD *matrix = dynamic_cast<TMatrixD *>(file->Get(keyname.c_str()));
798  if (matrix) {
799  std::vector<std::vector<float>> mat_vec(
800  matrix->GetNrows(), std::vector<float>(matrix->GetNcols()));
801  for (int i = 0; i < matrix->GetNrows(); ++i) {
802  for (int j = 0; j < matrix->GetNcols(); ++j) {
803  mat_vec[i][j] = static_cast<float>((*matrix)(i, j));
804  }
805  }
806  temp_storage[energy][layer] = std::move(mat_vec);
807  }
808  }
809  }
810 
811  file->Close();
812  delete file;
813 
814  // Output containers
815  std::vector<float> energies;
816  std::vector<std::vector<std::vector<std::vector<float>>>>
817  data; // [energy][layer][row][col]
818 
819  for (const auto &[energy, layer_map] : temp_storage) {
820  energies.push_back(energy);
821  int max_layer = 0;
822  for (const auto &[l, _] : layer_map)
823  max_layer = std::max(max_layer, l);
824 
825  std::vector<std::vector<std::vector<float>>> layer_vec(max_layer + 1);
826  for (const auto &[layer_idx, mat] : layer_map) {
827  layer_vec[layer_idx] = mat;
828  }
829  data.push_back(std::move(layer_vec));
830  }
831 
832  // Example output
833  for (size_t i = 0; i < energies.size(); ++i) {
834  std::cout << "Energy index " << i << ": " << energies[i] << " GeV\n";
835  for (size_t j = 0; j < data[i].size(); ++j) {
836  if (!data[i][j].empty()) {
837  std::cout << " Layer " << j << " Shape: (" << data[i][j].size() << ", "
838  << data[i][j][0].size() << ")\n";
839  }
840  }
841  }
842 
843  m_upscaling_energies = energies;
845 }

◆ 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 TFCSBinnedShower::set_bin_boundaries ( long unsigned int  layer_index,
std::vector< float > &  R_lower,
std::vector< float > &  R_size,
std::vector< float > &  alpha_lower,
std::vector< float > &  alpha_size 
)

Definition at line 76 of file TFCSBinnedShower.cxx.

80  {
81  if (layer_index >= m_coordinates.size()) {
82  m_coordinates.resize(layer_index + 1);
83  }
84  m_coordinates.at(layer_index).R_lower = R_lower;
85  m_coordinates.at(layer_index).R_size = R_size;
86  m_coordinates.at(layer_index).alpha_lower = alpha_lower;
87  m_coordinates.at(layer_index).alpha_size = alpha_size;
88 }

◆ 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 TFCSBinnedShower::set_coordinates ( event_bins_t coordinates)
inline

Definition at line 132 of file TFCSBinnedShower.h.

132  {
133  m_coordinates = coordinates;
134  }

◆ 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 TFCSBinnedShower::set_default_hit_energy ( float  energy)
inline

Definition at line 83 of file TFCSBinnedShower.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_event_library()

void TFCSBinnedShower::set_event_library ( eventvector_t eventlibrary)
inline

Definition at line 126 of file TFCSBinnedShower.h.

126  {
127  m_eventlibrary = eventlibrary;
128  }

◆ 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_hdf5_path()

void TFCSBinnedShower::set_hdf5_path ( const std::string &  filename)
inline

Definition at line 101 of file TFCSBinnedShower.h.

101 { m_hdf5_file = filename; }

◆ set_layer_energy()

void TFCSBinnedShower::set_layer_energy ( long unsigned int  event_index,
long unsigned int  layer_index,
const std::vector< unsigned int > &  bin_index_vector,
const std::vector< float > &  E_vector 
)

Definition at line 55 of file TFCSBinnedShower.cxx.

58  {
59 
60  // Assert that the event index is valid
61  if (event_index >= m_eventlibrary.size()) {
62  m_eventlibrary.resize(event_index + 1);
63  }
64 
65  // Assert that the layer index is valid
66  if (layer_index >= m_eventlibrary.at(event_index).event_data.size()) {
67  m_eventlibrary.at(event_index).event_data.resize(layer_index + 1);
68  }
69 
70  // Set the layer energy
71  layer_t &layer = m_eventlibrary.at(event_index).event_data.at(layer_index);
72  layer.bin_index_vector = bin_index_vector;
73  layer.E_vector = E_vector;
74 }

◆ 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 TFCSBinnedShower::set_max_hits_per_voxel ( int  max_hits)
inline

Definition at line 85 of file TFCSBinnedShower.h.

85 { 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_shower_center_information()

void TFCSBinnedShower::set_shower_center_information ( long unsigned int  event_index,
long unsigned int  reference_layer_index,
float  eta_center,
float  phi_center 
)

Definition at line 90 of file TFCSBinnedShower.cxx.

92  {
93 
94  // Compute phi_mod
96  reference_layer_index, eta_center);
97  float phi_cell =
98  m_geo->getDDE(reference_layer_index, eta_center, phi_center)->phi();
99  float phi_within_cell = fmod(phi_center - phi_cell, phi_cell_size);
100  if (phi_within_cell < 0) {
101  phi_within_cell += phi_cell_size;
102  }
103 
104  if (m_eventlibrary.size() <= event_index) {
105  m_eventlibrary.resize(event_index + 1);
106  }
107  if (m_eventlibrary.at(event_index).event_data.size() <=
108  reference_layer_index) {
109  m_eventlibrary.at(event_index).event_data.resize(reference_layer_index + 1);
110  }
111  m_eventlibrary.at(event_index).center_eta = eta_center;
112  m_eventlibrary.at(event_index).phi_mod = phi_within_cell;
113 }

◆ set_sub_bin_distribution_and_energies()

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

Definition at line 145 of file TFCSBinnedShower.h.

148  {
149  m_sub_bin_distribution = sub_bin_distribution;
150  m_upscaling_energies = upscaling_energies;
151  m_use_upscaling = true;
152  }

◆ 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 TFCSBinnedShower::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 360 of file TFCSBinnedShower.cxx.

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

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_calosample

int TFCSLateralShapeParametrization::m_calosample
privateinherited

Definition at line 47 of file TFCSLateralShapeParametrization.h.

◆ m_coordinates

event_bins_t TFCSBinnedShower::m_coordinates
private

Definition at line 198 of file TFCSBinnedShower.h.

◆ m_default_hit_energy

float TFCSBinnedShower::m_default_hit_energy = 4.
private

Definition at line 189 of file TFCSBinnedShower.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_eventlibrary

eventvector_t TFCSBinnedShower::m_eventlibrary
private

Definition at line 197 of file TFCSBinnedShower.h.

◆ m_geo

ICaloGeometry* TFCSBinnedShowerBase::m_geo
protectedinherited

Definition at line 68 of file TFCSBinnedShowerBase.h.

◆ m_hdf5_file

std::string TFCSBinnedShower::m_hdf5_file
private

Definition at line 194 of file TFCSBinnedShower.h.

◆ m_max_hits_per_voxel

int TFCSBinnedShower::m_max_hits_per_voxel = 100
private

Definition at line 191 of file TFCSBinnedShower.h.

◆ m_n_layers

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

Definition at line 185 of file TFCSBinnedShower.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> > > > TFCSBinnedShower::m_sub_bin_distribution
private

Definition at line 233 of file TFCSBinnedShower.h.

◆ m_upscaling_energies

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

Definition at line 234 of file TFCSBinnedShower.h.

◆ m_use_eta_matching

bool TFCSBinnedShower::m_use_eta_matching = false
private

Definition at line 216 of file TFCSBinnedShower.h.

◆ m_use_event_cherry_picking

bool TFCSBinnedShower::m_use_event_cherry_picking = false
private

Definition at line 211 of file TFCSBinnedShower.h.

◆ m_use_event_matching

bool TFCSBinnedShower::m_use_event_matching = false
private

Definition at line 205 of file TFCSBinnedShower.h.

◆ m_use_upscaling

bool TFCSBinnedShower::m_use_upscaling = false
private

Definition at line 228 of file TFCSBinnedShower.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
TFCSBinnedShower::m_max_hits_per_voxel
int m_max_hits_per_voxel
Definition: TFCSBinnedShower.h:191
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
TFCSBinnedShower::load_shower_center_information
void load_shower_center_information(const std::string &filename)
Definition: TFCSBinnedShower.cxx:697
TFCSParametrizationBase::init_eta_nominal
static constexpr double init_eta_nominal
Do not persistify!
Definition: TFCSParametrizationBase.h:156
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
add-xsec-uncert-quadrature-N.alpha
alpha
Definition: add-xsec-uncert-quadrature-N.py:110
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
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
TFCSBinnedShower::m_upscaling_energies
std::vector< float > m_upscaling_energies
Definition: TFCSBinnedShower.h:234
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
TFCSBinnedShower::load_bin_boundaries
void load_bin_boundaries(const std::string &filename, long unsigned int layer_index)
Definition: TFCSBinnedShower.cxx:652
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
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
TFCSBinnedShower::find_best_match
long unsigned int find_best_match(float eta_center, float phi_center, float e_init, long unsigned int reference_layer_index, bool phi_mod_matching) const
Definition: TFCSBinnedShower.cxx:115
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
TFCSBinnedShower::set_layer_energy
void set_layer_energy(long unsigned int event_index, long unsigned int layer_index, const std::vector< unsigned int > &bin_index_vector, const std::vector< float > &E_vector)
Definition: TFCSBinnedShower.cxx:55
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
TFCSBinnedShower::m_use_upscaling
bool m_use_upscaling
Definition: TFCSBinnedShower.h:228
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:157
TFCSBinnedShowerBase::OnlyScaleEnergy
bool OnlyScaleEnergy() const
Definition: TFCSBinnedShowerBase.h:35
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
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
TFCSBinnedShower::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: TFCSBinnedShower.cxx:360
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
TFCSBinnedShower::m_use_eta_matching
bool m_use_eta_matching
Definition: TFCSBinnedShower.h:216
TFCSLateralShapeParametrization::set_calosample
void set_calosample(int cs)
Definition: TFCSLateralShapeParametrization.cxx:21
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
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
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
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
TFCSSimulationState::hasAuxInfo
bool hasAuxInfo(std::uint32_t index) const
Definition: TFCSSimulationState.h:155
TFCSBinnedShower::compute_n_hits_and_elayer
virtual void compute_n_hits_and_elayer(TFCSSimulationState &simulstate) const
Definition: TFCSBinnedShower.cxx:221
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
TFCSBinnedShower::get_coordinates
const event_bins_t & get_coordinates()
Definition: TFCSBinnedShower.h:130
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
TFCSBinnedShower::load_layer_energy
void load_layer_energy(const std::string &filename, long unsigned int layer_index)
Definition: TFCSBinnedShower.cxx:611
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
TFCSBinnedShower::m_eventlibrary
eventvector_t m_eventlibrary
Definition: TFCSBinnedShower.h:197
TFCSParametrizationBase::RemoveNameTitle
void RemoveNameTitle()
Definition: TFCSParametrizationBase.cxx:200
merge.output
output
Definition: merge.py:16
TFCSBinnedShower::m_hdf5_file
std::string m_hdf5_file
Definition: TFCSBinnedShower.h:194
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
TFCSPhiModulationCorrection::get_phi_cell_size
static float get_phi_cell_size(long unsigned int layer, float eta)
Definition: TFCSPhiModulationCorrection.h:57
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
TFCSBinnedShower::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: TFCSBinnedShower.cxx:577
TFCSTruthState::pdgid
int pdgid() const
Definition: TFCSTruthState.h:25
TFCSParametrizationBase::init_Ekin_nominal
static constexpr double init_Ekin_nominal
Definition: TFCSParametrizationBase.h:153
TFCSBinnedShower::m_sub_bin_distribution
std::vector< std::vector< std::vector< std::vector< float > > > > m_sub_bin_distribution
Definition: TFCSBinnedShower.h:233
DeMoScan.index
string index
Definition: DeMoScan.py:362
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:63
TFCSBinnedShower::m_use_event_matching
bool m_use_event_matching
Definition: TFCSBinnedShower.h:205
TFCSBinnedShower::m_default_hit_energy
float m_default_hit_energy
Definition: TFCSBinnedShower.h:189
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
TFCSBinnedShower::m_coordinates
event_bins_t m_coordinates
Definition: TFCSBinnedShower.h:198
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
TFCSBinnedShower::m_use_event_cherry_picking
bool m_use_event_cherry_picking
Definition: TFCSBinnedShower.h:211
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
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
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
ICaloGeometry::getDDE
virtual const CaloDetDescrElement * getDDE(Identifier identify) const =0
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
TFCSBinnedShower::get_energy_index
long unsigned int get_energy_index(TFCSSimulationState &simulstate, long unsigned int layer_index, long unsigned int hit_index) const
Definition: TFCSBinnedShower.cxx:296
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
TrackOverlayDecisionAlg::e_diff
const float e_diff
Definition: TrackOverlayDecisionAlg.h:33