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

#include <TFCSPredictExtrapWeights.h>

Inheritance diagram for TFCSPredictExtrapWeights:
Collaboration diagram for TFCSPredictExtrapWeights:

Public Types

enum  FCSfreemem { kfreemem = BIT(17) }
 
enum  TFCSPredictExtrapWeightsStatusBits { kUseHardcodedWeight = BIT(15) }
 
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

 TFCSPredictExtrapWeights (const char *name=nullptr, const char *title=nullptr)
 
virtual ~TFCSPredictExtrapWeights ()
 
virtual bool operator== (const TFCSParametrizationBase &ref) const override
 The == operator compares the content of instances. More...
 
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...
 
bool freemem () const
 
void set_freemem ()
 
bool initializeNetwork (int pid, const std::string &etaBin, const std::string &FastCaloNNInputFolderName)
 
bool getNormInputs (const std::string &etaBin, const std::string &FastCaloTXTInputFolderName)
 
std::map< std::string, double > prepareInputs (TFCSSimulationState &simulstate, const float truthE) const
 
void Print (Option_t *option="") const override
 
bool UseHardcodedWeight () const
 
void set_UseHardcodedWeight ()
 
void reset_UseHardcodedWeight ()
 
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 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 numbers and give different results each time. 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_Ekin_bin (int bin) const override
 
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 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 void set_geometry (ICaloGeometry *geo)
 Method to set the geometry access pointer. More...
 
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 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 void test_path (std::string &net_path, std::string const &norm_path, TFCSSimulationState *simulstate=nullptr, const TFCSTruthState *truth=nullptr, const TFCSExtrapolationState *extrapol=nullptr)
 
static void unit_test (TFCSSimulationState *simulstate=nullptr, const TFCSTruthState *truth=nullptr, const TFCSExtrapolationState *extrapol=nullptr)
 
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

bool compare (const TFCSParametrizationBase &ref) const
 

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 Attributes

std::string * m_input = nullptr
 
std::vector< int > * m_relevantLayers = nullptr
 
lwt::LightweightNeuralNetwork * m_nn = nullptr
 
std::vector< int > * m_normLayers
 Do not persistify. More...
 
std::vector< float > * m_normMeans
 
std::vector< float > * m_normStdDevs
 
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 18 of file TFCSPredictExtrapWeights.h.

Member Typedef Documentation

◆ 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

◆ FCSfreemem

Enumerator
kfreemem 

Set this bit in the TObject bit if the memory for m_input should be freed after reading in athena.

Definition at line 38 of file TFCSPredictExtrapWeights.h.

38  {
39  kfreemem = BIT(17)
40  };

◆ 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  };

◆ TFCSPredictExtrapWeightsStatusBits

Enumerator
kUseHardcodedWeight 

Definition at line 70 of file TFCSPredictExtrapWeights.h.

70 { kUseHardcodedWeight = BIT(15) };

Constructor & Destructor Documentation

◆ TFCSPredictExtrapWeights()

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

◆ ~TFCSPredictExtrapWeights()

TFCSPredictExtrapWeights::~TFCSPredictExtrapWeights ( )
virtual

Definition at line 55 of file TFCSPredictExtrapWeights.cxx.

55  {
56  if (m_input != nullptr) {
57  delete m_input;
58  }
59  if (m_relevantLayers != nullptr) {
60  delete m_relevantLayers;
61  }
62  if (m_normLayers != nullptr) {
63  delete m_normLayers;
64  }
65  if (m_normMeans != nullptr) {
66  delete m_normMeans;
67  }
68  if (m_normStdDevs != nullptr) {
69  delete m_normStdDevs;
70  }
71  if (m_nn != nullptr) {
72  delete m_nn;
73  }
74 }

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 }

◆ 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; };

◆ eta_max()

double TFCSParametrization::eta_max ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 40 of file TFCSParametrization.h.

40 { return m_eta_max; };

◆ eta_min()

double TFCSParametrization::eta_min ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 39 of file TFCSParametrization.h.

39 { return m_eta_min; };

◆ eta_nominal()

double TFCSParametrization::eta_nominal ( ) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 38 of file TFCSParametrization.h.

38 { return m_eta_nominal; };

◆ FindDuplicates()

void TFCSParametrizationBase::FindDuplicates ( FindDuplicateClasses_t dup)
inherited

Definition at line 90 of file TFCSParametrizationBase.cxx.

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

◆ freemem()

bool TFCSPredictExtrapWeights::freemem ( ) const
inline

Definition at line 42 of file TFCSPredictExtrapWeights.h.

42 { return TestBit(kfreemem); };

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

int TFCSLateralShapeParametrizationHitBase::get_number_of_hits ( TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
) const
virtualinherited

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 in TFCSHistoLateralShapeParametrization, TFCS2DFunctionLateralShapeParametrization, TFCSLateralShapeParametrizationHitNumberFromE, and TFCSFlatLateralShapeParametrization.

Definition at line 25 of file TFCSLateralShapeParametrizationHitBase.cxx.

27  {
28  return -1;
29 }

◆ 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 }

◆ 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 }

◆ getNormInputs()

bool TFCSPredictExtrapWeights::getNormInputs ( const std::string &  etaBin,
const std::string &  FastCaloTXTInputFolderName 
)

Definition at line 98 of file TFCSPredictExtrapWeights.cxx.

99  {
100  ATH_MSG_DEBUG(" Getting normalization inputs... ");
101 
102  // Open corresponding TXT file and extract mean/std dev for each variable
103  if (m_normLayers != nullptr) {
104  m_normLayers->clear();
105  } else {
106  m_normLayers = new std::vector<int>();
107  }
108  if (m_normMeans != nullptr) {
109  m_normMeans->clear();
110  } else {
111  m_normMeans = new std::vector<float>();
112  }
113  if (m_normStdDevs != nullptr) {
114  m_normStdDevs->clear();
115  } else {
116  m_normStdDevs = new std::vector<float>();
117  }
118  std::string inputFileName = FastCaloTXTInputFolderName +
119  "MeanStdDevEnergyFractions_eta_" + etaBin +
120  ".txt";
121  ATH_MSG_DEBUG(" Opening " << inputFileName);
122  std::ifstream inputTXT(inputFileName);
123  if (inputTXT.is_open()) {
124  std::string line;
125  while (getline(inputTXT, line)) {
126  std::stringstream ss(line);
127  unsigned int counter = 0;
128  while (ss.good()) {
129  std::string substr;
130  getline(ss, substr, ' ');
131  if (counter == 0) { // Get index (#layer or -1 if var == etrue)
132  if (substr != "etrue") {
133  int index = std::stoi(substr.substr(substr.find('_') + 1));
134  m_normLayers->push_back(index);
135  } else { // etrue
136  m_normLayers->push_back(-1);
137  }
138  } else if (counter == 1) {
139  m_normMeans->push_back(std::stof(substr));
140  } else if (counter == 2) {
141  m_normStdDevs->push_back(std::stof(substr));
142  }
143  counter++;
144  }
145  }
146  inputTXT.close();
147  } else {
148  ATH_MSG_ERROR(" Unable to open file " << inputFileName);
149  return false;
150  }
151 
152  return true;
153 }

◆ initializeNetwork()

bool TFCSPredictExtrapWeights::initializeNetwork ( int  pid,
const std::string &  etaBin,
const std::string &  FastCaloNNInputFolderName 
)

Definition at line 298 of file TFCSPredictExtrapWeights.cxx.

300  {
301 
302  ATH_MSG_INFO(
303  "Using FastCaloNNInputFolderName: " << FastCaloNNInputFolderName);
304  set_pdgid(pid);
305 
306  std::string inputFileName =
307  FastCaloNNInputFolderName + "NN_" + etaBin + ".json";
308  ATH_MSG_DEBUG("Will read JSON file: " << inputFileName);
309  if (inputFileName.empty()) {
310  ATH_MSG_ERROR("Could not find json file " << inputFileName);
311  return false;
312  } else {
313  ATH_MSG_INFO("For pid: " << pid << " and etaBin" << etaBin
314  << ", loading json file " << inputFileName);
315  std::ifstream input(inputFileName);
316  std::stringstream sin;
317  sin << input.rdbuf();
318  input.close();
319  auto config = lwt::parse_json(sin);
320  m_nn = new lwt::LightweightNeuralNetwork(config.inputs, config.layers,
321  config.outputs);
322  if (m_nn == nullptr) {
323  ATH_MSG_ERROR("Could not create LightWeightNeuralNetwork from "
324  << inputFileName);
325  return false;
326  }
327  if (m_input != nullptr) {
328  delete m_input;
329  }
330  m_input = new std::string(sin.str());
331  // Extract relevant layers from the outputs
332  m_relevantLayers = new std::vector<int>();
333  for (auto name : config.outputs) {
334  int layer = std::stoi(
335  name.erase(0, 13)); // remove "extrapWeight_" and convert to int
336  m_relevantLayers->push_back(layer);
337  }
338  }
339  return true;
340 }

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

bool TFCSLateralShapeParametrization::is_match_Ekin_bin ( int  bin) const
inlineoverridevirtualinherited

Reimplemented from TFCSParametrizationBase.

Definition at line 15 of file TFCSLateralShapeParametrization.h.

15  {
16  if (Ekin_bin() == -1)
17  return true;
18  return bin == Ekin_bin();
19  };

◆ 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(); }

◆ 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 }

◆ operator==()

bool TFCSPredictExtrapWeights::operator== ( const TFCSParametrizationBase ref) const
overridevirtual

The == operator compares the content of instances.

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

Reimplemented from TFCSParametrizationBase.

Definition at line 76 of file TFCSPredictExtrapWeights.cxx.

77  {
78  if (IsA() != ref.IsA()) {
79  ATH_MSG_DEBUG("operator==: different class types "
80  << IsA()->GetName() << " != " << ref.IsA()->GetName());
81  return false;
82  }
83  const TFCSPredictExtrapWeights &ref_typed =
84  static_cast<const TFCSPredictExtrapWeights &>(ref);
85 
87  return true;
89  return false;
91  return false;
92 
93  return (m_input->compare(*ref_typed.m_input) == 0);
94 }

◆ 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; };

◆ prepareInputs()

std::map< std::string, double > TFCSPredictExtrapWeights::prepareInputs ( TFCSSimulationState simulstate,
const float  truthE 
) const

Definition at line 158 of file TFCSPredictExtrapWeights.cxx.

159  {
160  std::map<std::string, double> inputVariables;
161  for (int ilayer = 0; ilayer < CaloCell_ID_FCS::MaxSample; ++ilayer) {
162  if (std::find(m_relevantLayers->cbegin(), m_relevantLayers->cend(),
163  ilayer) != m_relevantLayers->cend()) {
164  const std::string layer = std::to_string(ilayer);
165  // Find index
166  auto itr =
167  std::find(m_normLayers->cbegin(), m_normLayers->cend(), ilayer);
168  if (itr != m_normLayers->cend()) {
169  const int index = std::distance(m_normLayers->cbegin(), itr);
170  inputVariables["ef_" + layer] =
171  (simulstate.Efrac(ilayer) - std::as_const(m_normMeans)->at(index)) /
172  std::as_const(m_normStdDevs)->at(index);
173  } else {
174  ATH_MSG_ERROR("Normalization information not found for layer "
175  << ilayer);
176  }
177  }
178  }
179  // Find index for truth energy
180  auto itr = std::find(m_normLayers->cbegin(), m_normLayers->cend(), -1);
181  int index = std::distance(m_normLayers->cbegin(), itr);
182  inputVariables["etrue"] = (truthE - std::as_const(m_normMeans)->at(index)) /
183  std::as_const(m_normStdDevs)->at(index);
184  if (is_match_pdgid(22)) {
185  inputVariables["pdgId"] = 1; // one hot enconding
186  } else if (is_match_pdgid(11) || is_match_pdgid(-11)) {
187  inputVariables["pdgId"] = 0; // one hot enconding
188  }
189  return inputVariables;
190 }

◆ Print()

void TFCSPredictExtrapWeights::Print ( Option_t *  option = "") const
override

Definition at line 511 of file TFCSPredictExtrapWeights.cxx.

511  {
512  TString opt(option);
513  bool shortprint = opt.Index("short") >= 0;
514  bool longprint = msgLvl(MSG::DEBUG) || (msgLvl(MSG::INFO) && !shortprint);
515  TString optprint = opt;
516  optprint.ReplaceAll("short", "");
518 
519  if (longprint)
520  ATH_MSG_INFO(optprint << " m_input (TFCSPredictExtrapWeights): "
522  if (longprint)
523  ATH_MSG_INFO(optprint << " Address of m_nn: " << (void *)m_nn);
524 }

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

void TFCSPredictExtrapWeights::reset_UseHardcodedWeight ( )
inline

Definition at line 73 of file TFCSPredictExtrapWeights.h.

73 { ResetBit(kUseHardcodedWeight); };

◆ set_calosample()

void TFCSLateralShapeParametrization::set_calosample ( int  cs)
inherited

Definition at line 21 of file TFCSLateralShapeParametrization.cxx.

21  {
22  m_calosample = cs;
23 }

◆ 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_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_freemem()

void TFCSPredictExtrapWeights::set_freemem ( )
inline

Definition at line 43 of file TFCSPredictExtrapWeights.h.

43 { SetBit(kfreemem); };

◆ set_geometry()

void TFCSParametrizationBase::set_geometry ( ICaloGeometry geo)
virtualinherited

Method to set the geometry access pointer.

Loops over daughter objects if present

Reimplemented in TFCSHistoLateralShapeParametrization, TFCSVoxelHistoLateralCovarianceFluctuations, and TFCSHitCellMapping.

Definition at line 24 of file TFCSParametrizationBase.cxx.

24  {
25  for (unsigned int i = 0; i < size(); ++i)
26  (*this)[i]->set_geometry(geo);
27 }

◆ set_match_all_pdgid()

virtual void TFCSParametrizationBase::set_match_all_pdgid ( )
inlinevirtualinherited

Definition at line 83 of file TFCSParametrizationBase.h.

83 { SetBit(kMatchAllPDGID); };

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

void TFCSPredictExtrapWeights::set_UseHardcodedWeight ( )
inline

Definition at line 72 of file TFCSPredictExtrapWeights.h.

72 { SetBit(kUseHardcodedWeight); };

◆ 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 TFCSPredictExtrapWeights::simulate ( TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
) const
overridevirtual

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 194 of file TFCSPredictExtrapWeights.cxx.

196  {
197 
198  // Get inputs to Neural Network
199  std::map<std::string, double> inputVariables =
200  prepareInputs(simulstate, truth->E() * 0.001);
201 
202  // Get predicted extrapolation weights
203  auto outputs = m_nn->compute(inputVariables);
204  for (int ilayer = 0; ilayer < CaloCell_ID_FCS::MaxSample; ++ilayer) {
205  if (std::find(m_relevantLayers->cbegin(), m_relevantLayers->cend(),
206  ilayer) != m_relevantLayers->cend()) {
207  ATH_MSG_DEBUG("TFCSPredictExtrapWeights::simulate: layer: "
208  << ilayer << " weight: "
209  << outputs["extrapWeight_" + std::to_string(ilayer)]);
210  float weight = outputs["extrapWeight_" + std::to_string(ilayer)];
211  // Protections
212  if (weight < 0) {
213  weight = 0;
214  } else if (weight > 1) {
215  weight = 1;
216  }
217  simulstate.setAuxInfo<float>(ilayer, weight);
218  } else { // use weight=0.5 for non-relevant layers
220  "Setting weight=0.5 for layer = " << std::to_string(ilayer));
221  simulstate.setAuxInfo<float>(ilayer, float(0.5));
222  }
223  }
224  return FCSSuccess;
225 }

◆ simulate_hit()

FCSReturnCode TFCSPredictExtrapWeights::simulate_hit ( Hit hit,
TFCSSimulationState simulstate,
const TFCSTruthState truth,
const TFCSExtrapolationState extrapol 
)
overridevirtual

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 228 of file TFCSPredictExtrapWeights.cxx.

230  {
231 
232  const int cs = calosample();
233 
234  // Get corresponding predicted extrapolation weight from simulstate
235  float extrapWeight;
236  if (simulstate.hasAuxInfo(cs)) {
237  extrapWeight = simulstate.getAuxInfo<float>(cs);
238  } else { // missing AuxInfo
240  "Simulstate is not decorated with extrapolation weights for cs = "
241  << std::to_string(cs));
242  return FCSFatal;
243  }
244 
245  double eta = (1. - extrapWeight) * extrapol->eta(cs, SUBPOS_ENT) +
246  extrapWeight * extrapol->eta(cs, SUBPOS_EXT);
247  double phi = (1. - extrapWeight) * extrapol->phi(cs, SUBPOS_ENT) +
248  extrapWeight * extrapol->phi(cs, SUBPOS_EXT);
249  float extrapWeight_for_r_z = extrapWeight;
250  if (UseHardcodedWeight()) {
251  extrapWeight_for_r_z = 0.5;
253  "Will use extrapWeight=0.5 for r and z when constructing a hit");
254  } else {
255  ATH_MSG_DEBUG("Will use predicted extrapWeight also for r and z when "
256  "constructing a hit");
257  }
258  double r = (1. - extrapWeight_for_r_z) * extrapol->r(cs, SUBPOS_ENT) +
259  extrapWeight_for_r_z * extrapol->r(cs, SUBPOS_EXT);
260  double z = (1. - extrapWeight_for_r_z) * extrapol->z(cs, SUBPOS_ENT) +
261  extrapWeight_for_r_z * extrapol->z(cs, SUBPOS_EXT);
262 
263  if (!std::isfinite(r) || !std::isfinite(z) || !std::isfinite(eta) ||
264  !std::isfinite(phi)) {
265  ATH_MSG_WARNING("Extrapolator contains NaN or infinite number.\nSetting "
266  "center position to calo boundary.");
267  ATH_MSG_WARNING("Before fix: center_r: "
268  << r << " center_z: " << z << " center_phi: " << phi
269  << " center_eta: " << eta << " weight: " << extrapWeight
270  << " cs: " << cs);
271  // If extrapolator fails we can set position to calo boundary
272  r = extrapol->IDCaloBoundary_r();
273  z = extrapol->IDCaloBoundary_z();
274  eta = extrapol->IDCaloBoundary_eta();
275  phi = extrapol->IDCaloBoundary_phi();
276  ATH_MSG_WARNING("After fix: center_r: "
277  << r << " center_z: " << z << " center_phi: " << phi
278  << " center_eta: " << eta << " weight: " << extrapWeight
279  << " cs: " << cs);
280  }
281 
282  hit.setCenter_r(r);
283  hit.setCenter_z(z);
284  hit.setCenter_eta(eta);
285  hit.setCenter_phi(phi);
286 
287  ATH_MSG_DEBUG("TFCSPredictExtrapWeights: center_r: "
288  << hit.center_r() << " center_z: " << hit.center_z()
289  << " center_phi: " << hit.center_phi()
290  << " center_eta: " << hit.center_eta()
291  << " weight: " << extrapWeight << " cs: " << cs);
292 
293  return FCSSuccess;
294 }

◆ 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 }

◆ test_path()

void TFCSPredictExtrapWeights::test_path ( std::string &  net_path,
std::string const norm_path,
TFCSSimulationState simulstate = nullptr,
const TFCSTruthState truth = nullptr,
const TFCSExtrapolationState extrapol = nullptr 
)
static

Definition at line 390 of file TFCSPredictExtrapWeights.cxx.

393  {
395  ATH_MSG_NOCLASS(logger, "Testing net path ..."
396  << net_path.substr(net_path.length() - 20)
397  << " and norm path ..."
398  << norm_path.substr(norm_path.length() - 20));
399  if (!simulstate) {
400  simulstate = new TFCSSimulationState();
401 #if defined(__FastCaloSimStandAlone__)
402  simulstate->setRandomEngine(new CLHEP::TRandomEngine());
403 #else
404  simulstate->setRandomEngine(new CLHEP::RanluxEngine());
405 #endif
406  }
407  if (!truth) {
409  t->SetPtEtaPhiM(524288000, 0, 0, 130); // 524288 GeV
410  t->set_pdgid(22); // photon
411  truth = t;
412  }
413  if (!extrapol) {
415  e->set_IDCaloBoundary_eta(truth->Eta());
416  for (int i = 0; i < 24; ++i) {
417  e->set_eta(i, TFCSExtrapolationState::SUBPOS_ENT, truth->Eta());
418  e->set_eta(i, TFCSExtrapolationState::SUBPOS_EXT, truth->Eta());
419  e->set_eta(i, TFCSExtrapolationState::SUBPOS_MID, truth->Eta());
420  e->set_phi(i, TFCSExtrapolationState::SUBPOS_ENT, 0);
421  e->set_phi(i, TFCSExtrapolationState::SUBPOS_EXT, 0);
422  e->set_phi(i, TFCSExtrapolationState::SUBPOS_MID, 0);
423  e->set_r(i, TFCSExtrapolationState::SUBPOS_ENT, 1500 + i * 10);
424  e->set_r(i, TFCSExtrapolationState::SUBPOS_EXT, 1510 + i * 10);
425  e->set_r(i, TFCSExtrapolationState::SUBPOS_MID, 1505 + i * 10);
426  e->set_z(i, TFCSExtrapolationState::SUBPOS_ENT, 3500 + i * 10);
427  e->set_z(i, TFCSExtrapolationState::SUBPOS_EXT, 3510 + i * 10);
428  e->set_z(i, TFCSExtrapolationState::SUBPOS_MID, 3505 + i * 10);
429  }
430  extrapol = e;
431  }
432 
433  // Set energy in layers which then will be retrieved in simulate_hit()
434  simulstate->set_E(0, 1028.77124023);
435  simulstate->set_E(1, 68199.0625);
436  simulstate->set_E(2, 438270.78125);
437  simulstate->set_E(3, 3024.02929688);
438  simulstate->set_E(12, 1330.10131836);
439  simulstate->set_E(1028.77124023 + 68199.0625 + 438270.78125 + 3024.02929688 +
440  1330.10131836);
441  simulstate->set_Efrac(0, simulstate->E(0) / simulstate->E());
442  simulstate->set_Efrac(1, simulstate->E(1) / simulstate->E());
443  simulstate->set_Efrac(2, simulstate->E(2) / simulstate->E());
444  simulstate->set_Efrac(3, simulstate->E(3) / simulstate->E());
445  simulstate->set_Efrac(12, simulstate->E(12) / simulstate->E());
446 
447  const int pdgId = truth->pdgid();
448  const float Ekin = truth->Ekin();
449  const float eta = truth->Eta();
450 
451  ATH_MSG_NOCLASS(logger, "True energy " << Ekin << " pdgId " << pdgId
452  << " eta " << eta);
453 
454  // Find eta bin
455  const int Eta = eta * 10;
456  std::string etaBin = "";
457  for (int i = 0; i <= 25; ++i) {
458  int etaTmp = i * 5;
459  if (Eta >= etaTmp && Eta < (etaTmp + 5)) {
460  etaBin = std::to_string(i * 5) + "_" + std::to_string((i + 1) * 5);
461  }
462  }
463 
464  ATH_MSG_NOCLASS(logger, "etaBin = " << etaBin);
465 
466  TFCSPredictExtrapWeights NN("NN", "NN");
467  NN.setLevel(MSG::INFO);
468  const int pid = truth->pdgid();
469  NN.initializeNetwork(pid, etaBin, net_path);
470  NN.getNormInputs(etaBin, norm_path);
471 
472  // Get extrapWeights and save them as AuxInfo in simulstate
473 
474  // Get inputs to Neural Network
475  std::map<std::string, double> inputVariables =
476  NN.prepareInputs(*simulstate, truth->E() * 0.001);
477 
478  // Get predicted extrapolation weights
479  ATH_MSG_NOCLASS(logger, "computing with m_nn");
480  auto outputs = NN.m_nn->compute(inputVariables);
481  const std::vector<int> layers = {0, 1, 2, 3, 12};
482  for (int ilayer : layers) {
483  simulstate->setAuxInfo<float>(
484  ilayer, outputs["extrapWeight_" + std::to_string(ilayer)]);
485  }
486 
487  // Simulate
488  const int layer = 0;
489  NN.set_calosample(layer);
491  NN.simulate_hit(hit, *simulstate, truth, extrapol);
492 
493  // Write
494  TFile *fNN = new TFile("FCSNNtest.root", "RECREATE");
495  NN.Write();
496  fNN->ls();
497  fNN->Close();
498  delete fNN;
499 
500  // Open
501  fNN = TFile::Open("FCSNNtest.root");
502  TFCSPredictExtrapWeights *NN2 = (TFCSPredictExtrapWeights *)(fNN->Get("NN"));
503 
504  NN2->setLevel(MSG::INFO);
505  NN2->simulate_hit(hit, *simulstate, truth, extrapol);
506  //simulstate->Print();
507 
508  return;
509 }

◆ unit_test()

void TFCSPredictExtrapWeights::unit_test ( TFCSSimulationState simulstate = nullptr,
const TFCSTruthState truth = nullptr,
const TFCSExtrapolationState extrapol = nullptr 
)
static

Definition at line 374 of file TFCSPredictExtrapWeights.cxx.

376  {
377  const std::string this_file = __FILE__;
378  const std::string parent_dir = this_file.substr(0, this_file.find("/src/"));
379  const std::string norm_path = parent_dir + "/share/NormPredExtrapSample/";
380  std::string net_path = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/"
381  "FastCaloSim/LWTNNPredExtrapSample/";
382  test_path(net_path, norm_path, simulstate, truth, extrapol);
383  //net_path = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/FastCaloSim/"
384  // "ONNXPredExtrapSample/";
385  //test_path(net_path, norm_path, simulstate, truth, extrapol);
386 }

◆ UseHardcodedWeight()

bool TFCSPredictExtrapWeights::UseHardcodedWeight ( ) const
inline

Definition at line 71 of file TFCSPredictExtrapWeights.h.

71 { return TestBit(kUseHardcodedWeight); };

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_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_input

std::string* TFCSPredictExtrapWeights::m_input = nullptr
private

Definition at line 80 of file TFCSPredictExtrapWeights.h.

◆ m_nm

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

Message source name.

Definition at line 211 of file MLogging.h.

◆ m_nn

lwt::LightweightNeuralNetwork* TFCSPredictExtrapWeights::m_nn = nullptr
private

Definition at line 82 of file TFCSPredictExtrapWeights.h.

◆ m_normLayers

std::vector<int>* TFCSPredictExtrapWeights::m_normLayers
private
Initial value:
=
nullptr

Do not persistify.

Definition at line 83 of file TFCSPredictExtrapWeights.h.

◆ m_normMeans

std::vector<float>* TFCSPredictExtrapWeights::m_normMeans
private
Initial value:
=
nullptr

Definition at line 85 of file TFCSPredictExtrapWeights.h.

◆ m_normStdDevs

std::vector<float>* TFCSPredictExtrapWeights::m_normStdDevs
private
Initial value:
=
nullptr

Definition at line 88 of file TFCSPredictExtrapWeights.h.

◆ m_pdgid

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

Definition at line 63 of file TFCSParametrization.h.

◆ m_relevantLayers

std::vector<int>* TFCSPredictExtrapWeights::m_relevantLayers = nullptr
private

Definition at line 81 of file TFCSPredictExtrapWeights.h.


The documentation for this class was generated from the following files:
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
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
TFCSParametrization::set_Ekin_nominal
virtual void set_Ekin_nominal(double min)
Definition: TFCSParametrization.cxx:39
TFCSPredictExtrapWeights
Definition: TFCSPredictExtrapWeights.h:18
TFCSParametrization::compare
bool compare(const TFCSParametrizationBase &ref) const
Definition: TFCSParametrization.cxx:78
ISF_FCS::MLogging
Cut down AthMessaging.
Definition: MLogging.h:176
TFCSSimulationState::getAuxInfo
const T getAuxInfo(std::uint32_t index) const
Definition: TFCSSimulationState.h:161
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
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
checkFileSG.line
line
Definition: checkFileSG.py:75
TFCSParametrizationBase::init_eta_nominal
static constexpr double init_eta_nominal
Do not persistify!
Definition: TFCSParametrizationBase.h:156
TFCSPredictExtrapWeights::m_normMeans
std::vector< float > * m_normMeans
Definition: TFCSPredictExtrapWeights.h:85
TFCSParametrization::is_match_pdgid
virtual bool is_match_pdgid(int id) const override
Definition: TFCSParametrization.h:15
max
#define max(a, b)
Definition: cfImp.cxx:41
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
TFCSParametrizationBase::init_Ekin_min
static constexpr double init_Ekin_min
Do not persistify!
Definition: TFCSParametrizationBase.h:154
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
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
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TFCSPredictExtrapWeights::kUseHardcodedWeight
@ kUseHardcodedWeight
Definition: TFCSPredictExtrapWeights.h:70
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
TFCSSimulationState::Efrac
double Efrac(int sample) const
Definition: TFCSSimulationState.h:44
TFCSPredictExtrapWeights::m_input
std::string * m_input
Definition: TFCSPredictExtrapWeights.h:80
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
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
TFCSParametrizationBase::FindDuplicates
void FindDuplicates(FindDuplicateClasses_t &dup)
Definition: TFCSParametrizationBase.cxx:90
TFCSLateralShapeParametrization::Print
void Print(Option_t *option="") const override
Definition: TFCSLateralShapeParametrization.cxx:53
bin
Definition: BinsDiffFromStripMedian.h:43
TFCSParametrization::set_Ekin_max
virtual void set_Ekin_max(double max)
Definition: TFCSParametrization.cxx:45
TFCSExtrapolationState::SUBPOS_ENT
@ SUBPOS_ENT
Definition: TFCSExtrapolationState.h:21
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
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
TFCSLateralShapeParametrizationHitBase::Hit
Definition: TFCSLateralShapeParametrizationHitBase.h:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TFCSExtrapolationState::SUBPOS_MID
@ SUBPOS_MID
Definition: TFCSExtrapolationState.h:20
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:90
TFCSParametrization::set_Ekin
virtual void set_Ekin(const TFCSParametrizationBase &ref)
Definition: TFCSParametrization.cxx:55
TFCSExtrapolationState::SUBPOS_EXT
@ SUBPOS_EXT
Definition: TFCSExtrapolationState.h:22
TFCSParametrization::set_eta
virtual void set_eta(const TFCSParametrizationBase &ref)
Definition: TFCSParametrization.cxx:61
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
lwtDev::parse_json
JSONConfig parse_json(std::istream &json)
Definition: parse_json.cxx:42
TFCSPredictExtrapWeights::m_normLayers
std::vector< int > * m_normLayers
Do not persistify.
Definition: TFCSPredictExtrapWeights.h:83
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
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
TFCSPredictExtrapWeights::simulate_hit
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
simulated one hit position with some energy.
Definition: TFCSPredictExtrapWeights.cxx:228
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
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
CaloCell_ID_FCS::MaxSample
@ MaxSample
Definition: FastCaloSim_CaloCell_ID.h:47
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
TFCSLateralShapeParametrization::set_calosample
void set_calosample(int cs)
Definition: TFCSLateralShapeParametrization.cxx:21
TFCSPredictExtrapWeights::m_normStdDevs
std::vector< float > * m_normStdDevs
Definition: TFCSPredictExtrapWeights.h:88
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
TFCSPredictExtrapWeights::UseHardcodedWeight
bool UseHardcodedWeight() const
Definition: TFCSPredictExtrapWeights.h:71
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
TrigConf::MSGTC::ALWAYS
@ ALWAYS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:29
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
z
#define z
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
TFCSParametrizationBase::FindDuplicateClasses_t
std::map< std::string, FindDuplicates_t > FindDuplicateClasses_t
Definition: TFCSParametrizationBase.h:142
TFCSPredictExtrapWeights::set_freemem
void set_freemem()
Definition: TFCSPredictExtrapWeights.h:43
covarianceTool.title
title
Definition: covarianceTool.py:542
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
ISF_FCS::MLogging::m_nm
std::string m_nm
Message source name.
Definition: MLogging.h:211
TFCSSimulationState::hasAuxInfo
bool hasAuxInfo(std::uint32_t index) const
Definition: TFCSSimulationState.h:155
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
file
TFile * file
Definition: tile_monitor.h:29
TFCSParametrization::m_Ekin_min
double m_Ekin_min
Definition: TFCSParametrization.h:64
TFCSParametrization::Ekin_min
double Ekin_min() const override
Definition: TFCSParametrization.h:36
TFCSParametrization::m_eta_min
double m_eta_min
Definition: TFCSParametrization.h:65
TFCSPredictExtrapWeights::set_UseHardcodedWeight
void set_UseHardcodedWeight()
Definition: TFCSPredictExtrapWeights.h:72
TFCSParametrizationBase::FindDuplicates_t
std::map< TFCSParametrizationBase *, Duplicate_t > FindDuplicates_t
Definition: TFCSParametrizationBase.h:141
FCSFatal
@ FCSFatal
Definition: TFCSParametrizationBase.h:41
SUBPOS_ENT
@ SUBPOS_ENT
Definition: FastCaloSim_CaloCell_ID.h:12
FCSSuccess
@ FCSSuccess
Definition: TFCSParametrizationBase.h:41
TFCSParametrization::eta_max
double eta_max() const override
Definition: TFCSParametrization.h:40
python.CreateTierZeroArgdict.outputs
outputs
Definition: CreateTierZeroArgdict.py:189
TFCSParametrizationBase::RemoveNameTitle
void RemoveNameTitle()
Definition: TFCSParametrizationBase.cxx:200
TFCSLateralShapeParametrizationHitBase::TFCSLateralShapeParametrizationHitBase
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
Definition: TFCSLateralShapeParametrizationHitBase.cxx:15
min
#define min(a, b)
Definition: cfImp.cxx:40
merge.output
output
Definition: merge.py:17
TFCSPredictExtrapWeights::m_relevantLayers
std::vector< int > * m_relevantLayers
Definition: TFCSPredictExtrapWeights.h:81
TFCSLateralShapeParametrizationHitBase::get_number_of_hits
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Call get_number_of_hits() only once per shower simulation, as it could be calculated with random numb...
Definition: TFCSLateralShapeParametrizationHitBase.cxx:25
TFCSParametrization::m_Ekin_nominal
double m_Ekin_nominal
Definition: TFCSParametrization.h:64
TrigConf::MSGTC::NUM_LEVELS
@ NUM_LEVELS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ISF_FCS::MLogging::setLevel
virtual void setLevel(MSG::Level lvl)
Update outputlevel.
Definition: MLogging.cxx:105
TFCSSimulationState::setAuxInfo
void setAuxInfo(std::uint32_t index, const T &val)
Definition: TFCSSimulationState.h:168
CxxUtils::as_const_ptr
const T * as_const_ptr(const T *p)
Helper for getting a const version of a pointer.
Definition: as_const_ptr.h:32
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
TFCSSimulationState::set_E
void set_E(int sample, double Esample)
Definition: TFCSSimulationState.h:48
TFCSPredictExtrapWeights::test_path
static void test_path(std::string &net_path, std::string const &norm_path, TFCSSimulationState *simulstate=nullptr, const TFCSTruthState *truth=nullptr, const TFCSExtrapolationState *extrapol=nullptr)
Definition: TFCSPredictExtrapWeights.cxx:390
TFCSTruthState::pdgid
int pdgid() const
Definition: TFCSTruthState.h:25
Hit::setCenter_phi
CUDA_HOSTDEV void setCenter_phi(float phi)
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:90
TFCSPredictExtrapWeights::prepareInputs
std::map< std::string, double > prepareInputs(TFCSSimulationState &simulstate, const float truthE) const
Definition: TFCSPredictExtrapWeights.cxx:158
TFCSParametrizationBase::init_Ekin_nominal
static constexpr double init_Ekin_nominal
Definition: TFCSParametrizationBase.h:153
TFCSSimulationState::setRandomEngine
void setRandomEngine(CLHEP::HepRandomEngine *engine)
Definition: TFCSSimulationState.h:37
SUBPOS_EXT
@ SUBPOS_EXT
Definition: FastCaloSim_CaloCell_ID.h:13
DeMoScan.index
string index
Definition: DeMoScan.py:364
TFCSLateralShapeParametrization::compare
bool compare(const TFCSParametrizationBase &ref) const
Definition: TFCSLateralShapeParametrization.cxx:32
ATH_MSG_NOCLASS
#define ATH_MSG_NOCLASS(logger_name, x)
Definition: MLogging.h:52
TFCSLateralShapeParametrization::calosample
int calosample() const
Definition: TFCSLateralShapeParametrization.h:34
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ref
const boost::regex ref(r_ef)
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
DEBUG
#define DEBUG
Definition: page_access.h:11
TFCSPredictExtrapWeights::m_nn
lwt::LightweightNeuralNetwork * m_nn
Definition: TFCSPredictExtrapWeights.h:82
Hit::setCenter_eta
CUDA_HOSTDEV void setCenter_eta(float eta)
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:89
TFCSParametrization::set_eta_min
virtual void set_eta_min(double min)
Definition: TFCSParametrization.cxx:51
TFCSSimulationState::E
double E() const
Definition: TFCSSimulationState.h:42
TFCSParametrization::m_Ekin_max
double m_Ekin_max
Definition: TFCSParametrization.h:64
TrigConf::MSGTC::NIL
@ NIL
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:22
Hit::setCenter_r
CUDA_HOSTDEV void setCenter_r(float r)
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:87
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
test_pyathena.counter
counter
Definition: test_pyathena.py:15
Hit::setCenter_z
CUDA_HOSTDEV void setCenter_z(float z)
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:88
TFCSLateralShapeParametrization
Definition: TFCSLateralShapeParametrization.h:10
TFCSLateralShapeParametrization::m_calosample
int m_calosample
Definition: TFCSLateralShapeParametrization.h:47
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
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSParametrizationBase::size
virtual unsigned int size() const
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
Definition: TFCSParametrizationBase.h:93
TFCSSimulationState
Definition: TFCSSimulationState.h:32
readCCLHist.float
float
Definition: readCCLHist.py:83
python.iconfTool.gui.pad.logger
logger
Definition: pad.py:14
Eta
@ Eta
Definition: RPCdef.h:8
Hit::center_r
CUDA_HOSTDEV float & center_r()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:83
TFCSPredictExtrapWeights::kfreemem
@ kfreemem
Set this bit in the TObject bit if the memory for m_input should be freed after reading in athena.
Definition: TFCSPredictExtrapWeights.h:39
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
TFCSSimulationState::set_Efrac
void set_Efrac(int sample, double Efracsample)
Definition: TFCSSimulationState.h:49