ATLAS Offline Software
Loading...
Searching...
No Matches
TFCSLateralShapeParametrizationHitChain Class Reference

#include <TFCSLateralShapeParametrizationHitChain.h>

Inheritance diagram for TFCSLateralShapeParametrizationHitChain:
Collaboration diagram for TFCSLateralShapeParametrizationHitChain:

Public Types

typedef std::vector< TFCSLateralShapeParametrizationHitBase * > Chain_t
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

 TFCSLateralShapeParametrizationHitChain (const char *name=nullptr, const char *title=nullptr)
 TFCSLateralShapeParametrizationHitChain (TFCSLateralShapeParametrizationHitBase *hitsim)
virtual FCSReturnCode init_hit (TFCSLateralShapeParametrizationHitBase::Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
virtual FCSReturnCode simulate (TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
 Method in all derived classes to do some simulation.
virtual unsigned int size () const override
 Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters.
virtual const TFCSParametrizationBaseoperator[] (unsigned int ind) const override
 Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters.
virtual TFCSParametrizationBaseoperator[] (unsigned int ind) override
 Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters.
virtual void set_daughter (unsigned int ind, TFCSParametrizationBase *param) override
 Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter method allows to change these daughters - expert use only!
const Chain_tchain () const
Chain_tchain ()
void push_back (const Chain_t::value_type &value)
void push_back_init (const Chain_t::value_type &value)
unsigned int get_nr_of_init () const
void set_nr_of_init (unsigned int ninit)
virtual void set_number_of_hits_simul (TFCSLateralShapeParametrizationHitBase *sim)
 set which instance should determine the 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, as it could contain a random number.
virtual float get_E_hit (TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
 Get hit energy from layer energy and number of hits.
virtual float 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.
virtual float getMinWeight () const
 Get minimum and maximum value of weight for hit energy reweighting.
virtual float getMaxWeight () const
void Print (Option_t *option="") const override
 Do not persistify!
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.
virtual bool operator== (const TFCSParametrizationBase &ref) const
 The == operator compares the content of instances.
virtual void CleanAuxInfo (TFCSSimulationState &) const
 Method in all derived classes to delete objects stored in the simulstate AuxInfo.
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.
MsgStream & msg () const
 Return a stream for sending messages directly (no decoration)
MsgStream & msg (const MSG::Level lvl) const
 Return a decorated starting stream for sending messages.
MSG::Level level () const
 Retrieve output level.
virtual void setLevel (MSG::Level lvl)
 Update outputlevel.

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.

Static Public Attributes

static constexpr float s_max_sigma2_fluctuation = 1000

Protected Member Functions

void PropagateMSGLevel (MSG::Level level) const
virtual bool check_all_hits_simulated (TFCSLateralShapeParametrizationHitBase::Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol, bool success) const
bool compare (const TFCSParametrizationBase &ref) const

Protected Attributes

Chain_t m_chain

Static Protected Attributes

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

Private Attributes

TFCSLateralShapeParametrizationHitBasem_number_of_hits_simul
unsigned int m_ninit = 0
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.

Static Private Attributes

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

Detailed Description

Definition at line 14 of file TFCSLateralShapeParametrizationHitChain.h.

Member Typedef Documentation

◆ Chain_t

◆ FindDuplicateClasses_t

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

Definition at line 142 of file TFCSParametrizationBase.h.

◆ FindDuplicates_t

Member Enumeration Documentation

◆ 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 };
@ kMatchAllPDGID
Set this bit in the TObject bit field if valid for all PDGID.

Constructor & Destructor Documentation

◆ TFCSLateralShapeParametrizationHitChain() [1/2]

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

Definition at line 47 of file TFCSLateralShapeParametrizationHitChain.cxx.

50 m_number_of_hits_simul(nullptr) {}
TFCSLateralShapeParametrizationHitBase * m_number_of_hits_simul
TFCSLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)

◆ TFCSLateralShapeParametrizationHitChain() [2/2]

TFCSLateralShapeParametrizationHitChain::TFCSLateralShapeParametrizationHitChain ( TFCSLateralShapeParametrizationHitBase * hitsim)

Definition at line 53 of file TFCSLateralShapeParametrizationHitChain.cxx.

56 : TFCSLateralShapeParametrization(TString("hit_chain_") + hitsim->GetName(),
57 TString("hit chain for ") +
58 hitsim->GetTitle()),
59 m_number_of_hits_simul(nullptr) {
61
62 m_chain.push_back(hitsim);
63}
virtual void set_pdgid_Ekin_eta_Ekin_bin_calosample(const TFCSLateralShapeParametrization &ref)

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

◆ chain() [1/2]

Chain_t & TFCSLateralShapeParametrizationHitChain::chain ( )
inline

Definition at line 51 of file TFCSLateralShapeParametrizationHitChain.h.

51{ return m_chain; };

◆ chain() [2/2]

const Chain_t & TFCSLateralShapeParametrizationHitChain::chain ( ) const
inline

Definition at line 50 of file TFCSLateralShapeParametrizationHitChain.h.

50{ return m_chain; };

◆ check_all_hits_simulated()

bool TFCSLateralShapeParametrizationHitChain::check_all_hits_simulated ( TFCSLateralShapeParametrizationHitBase::Hit & hit,
TFCSSimulationState & simulstate,
const TFCSTruthState * truth,
const TFCSExtrapolationState * extrapol,
bool success ) const
protectedvirtual

Reimplemented in TFCSLateralShapeParametrizationFixedHitChain.

Definition at line 457 of file TFCSLateralShapeParametrizationHitChain.cxx.

460 {
461
462 (void)truth; // unused parameter
463 (void)extrapol; // unused parameter
464
465 if (!success) {
466 // The hit simulation failed => Nothing changed => Still not done
467 return false;
468 }
469
470 float sumEhit = 0;
471 if (simulstate.hasAuxInfo("FCSHitChainEnergySum"_FCShash) && hit.idx() > 1) {
472 sumEhit = simulstate.getAuxInfo<float>("FCSHitChainEnergySum"_FCShash);
473 }
474
475 sumEhit += hit.E();
476
477 simulstate.setAuxInfo<float>("FCSHitChainEnergySum"_FCShash, sumEhit);
478
479 float Elayer = simulstate.E(calosample());
480 return (std::abs(sumEhit) >= std::abs(Elayer));
481}
bool hasAuxInfo(std::uint32_t index) const
const T getAuxInfo(std::uint32_t index) const
void setAuxInfo(std::uint32_t index, const T &val)

◆ 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

Definition at line 18 of file TFCSParametrization.cxx.

18 {
19 m_pdgid.clear();
26}
static constexpr double init_Ekin_nominal
static constexpr double init_eta_max
Do not persistify!
static constexpr double init_Ekin_max
Do not persistify!
static constexpr double init_eta_nominal
Do not persistify!
static constexpr double init_eta_min
Do not persistify!
static constexpr double init_Ekin_min
Do not persistify!

◆ 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}
const boost::regex ref(r_ef)
#define ATH_MSG_DEBUG(x)
#define IsA
Declare the TObject style functions.

◆ Ekin_bin()

int TFCSLateralShapeParametrization::Ekin_bin ( ) const
inlineinherited

◆ 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
93 for (unsigned int i = 0; i < size(); ++i)
94 if ((*this)[i]) {
95 TFCSParametrizationBase *param = (*this)[i];
96 FindDuplicates_t &dup = dupclasses[param->GetName()];
97 // If param is already in the duplication list, skip over
98 auto checkexist = dup.find(param);
99 if (checkexist != dup.end()) {
100 ATH_MSG_WARNING(" [TFCSParametrizationBase::FindDuplicates] "
101 "DUPLICATE POINTER DETECTED");
102
103 ATH_MSG_WARNING(" - Pointer : " << param);
104 ATH_MSG_WARNING(" - Name : " << param->GetName());
105 ATH_MSG_WARNING(" - Class : " << param->ClassName());
106 ATH_MSG_WARNING(" - Occurs in parent : " << this
107 << " (" << this->ClassName() << ")"
108 << " index=" << i);
109
110 if (checkexist->second.replace) {
111 TFCSParametrizationBase *refparam = checkexist->second.replace;
112 ATH_MSG_DEBUG("Found duplicate pointer: "
113 << refparam << "=" << refparam->GetName()
114 << ", duplicate is " << param << "=" << param->GetName()
115 << " index " << i << " of " << this);
116 dup[refparam].mother.push_back(this);
117 dup[refparam].index.push_back(i);
118 }
119 continue;
120 }
121 // Add param to duplication list
122 dup[param] = Duplicate_t();
123 for (auto &ref : dup) {
124 TFCSParametrizationBase *refparam = ref.first;
125 // skip itself, as this just added above
126 if (param == refparam)
127 continue;
128 // skip nullptr reference
129 if (refparam == nullptr)
130 continue;
131 // skip reference that is itself going to get replaced
132 if (ref.second.replace)
133 continue;
134 // Check for objects with identical content
135 if (*param == *refparam) {
136 ATH_MSG_DEBUG("Found duplicate: "
137 << refparam << "=" << refparam->GetName()
138 << ", duplicate is " << param << "=" << param->GetName()
139 << " index " << i << " of " << this);
140
141 dup[param].replace = refparam;
142 dup[refparam].mother.push_back(this);
143 dup[refparam].index.push_back(i);
144 break;
145 }
146 }
147 // Continue for child objects in param
148 param->FindDuplicates(dupclasses);
149 }
150}
#define ATH_MSG_WARNING(x)
void FindDuplicates(FindDuplicateClasses_t &dup)
std::map< TFCSParametrizationBase *, Duplicate_t > FindDuplicates_t
virtual unsigned int size() const
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
TFCSParametrizationBase(const char *name=nullptr, const char *title=nullptr)

◆ get_E_hit()

float TFCSLateralShapeParametrizationHitChain::get_E_hit ( TFCSSimulationState & simulstate,
const TFCSTruthState * truth,
const TFCSExtrapolationState * extrapol ) const
virtual

Get hit energy from layer energy and number of hits.

Reimplemented in TFCSLateralShapeParametrizationFluctChain.

Definition at line 162 of file TFCSLateralShapeParametrizationHitChain.cxx.

164 {
165 const int nhits = get_number_of_hits(simulstate, truth, extrapol);
166
167 // Store nhits in the simulation state as the get function may only be
168 // called once per event
169 simulstate.setAuxInfo<int>("FCSHitChainNHits"_FCShash, nhits);
170
171 const int sample = calosample();
172 if (sample < 0)
173 return 0;
174 if (nhits <= 0)
175 return simulstate.E(sample);
176 const float maxWeight =
177 getMaxWeight(); // maxWeight = -1 if shapeWeight class is not in m_chain
178
179 if (maxWeight > 0)
180 return simulstate.E(sample) /
181 (maxWeight *
182 nhits); // maxWeight is used only if shapeWeight class is in m_chain
183 else
184 return simulstate.E(sample) /
185 nhits; // Otherwise, old definition of E_hit is used
186}
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Call get_number_of_hits() only once, as it could contain a random number.

◆ get_nr_of_init()

unsigned int TFCSLateralShapeParametrizationHitChain::get_nr_of_init ( ) const
inline

◆ get_number_of_hits()

int TFCSLateralShapeParametrizationHitChain::get_number_of_hits ( TFCSSimulationState & simulstate,
const TFCSTruthState * truth,
const TFCSExtrapolationState * extrapol ) const
virtual

Call get_number_of_hits() only once, as it could contain a random number.

Definition at line 125 of file TFCSLateralShapeParametrizationHitChain.cxx.

127 {
128 // TODO: should we still do it?
130 int n =
131 m_number_of_hits_simul->get_number_of_hits(simulstate, truth, extrapol);
132 if (n < 1)
133 n = 1;
134 return n;
135 }
136 for (TFCSLateralShapeParametrizationHitBase *hitsim : m_chain) {
137 int n = hitsim->get_number_of_hits(simulstate, truth, extrapol);
138 if (n > 0)
139 return n;
140 }
141 return 1;
142}

◆ get_sigma2_fluctuation()

float TFCSLateralShapeParametrizationHitChain::get_sigma2_fluctuation ( TFCSSimulationState & simulstate,
const TFCSTruthState * truth,
const TFCSExtrapolationState * extrapol ) const
virtual

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

Definition at line 188 of file TFCSLateralShapeParametrizationHitChain.cxx.

190 {
192 double sigma2 = m_number_of_hits_simul->get_sigma2_fluctuation(
193 simulstate, truth, extrapol);
194 if (sigma2 > 0)
195 return sigma2;
196 }
197 for (TFCSLateralShapeParametrizationHitBase *hitsim : m_chain) {
198 double sigma2 = hitsim->get_sigma2_fluctuation(simulstate, truth, extrapol);
199 if (sigma2 > 0)
200 return sigma2;
201 }
202 // Limit to factor s_max_sigma2_fluctuation fluctuations
204}

◆ getMaxWeight()

float TFCSLateralShapeParametrizationHitChain::getMaxWeight ( ) const
virtual

Definition at line 153 of file TFCSLateralShapeParametrizationHitChain.cxx.

153 {
154 for (TFCSLateralShapeParametrizationHitBase *hitsim : m_chain) {
155 float weight = hitsim->getMaxWeight();
156 if (weight > 0.)
157 return weight;
158 }
159 return -1.;
160}

◆ getMinWeight()

float TFCSLateralShapeParametrizationHitChain::getMinWeight ( ) const
virtual

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

Definition at line 144 of file TFCSLateralShapeParametrizationHitChain.cxx.

144 {
145 for (TFCSLateralShapeParametrizationHitBase *hitsim : m_chain) {
146 float weight = hitsim->getMinWeight();
147 if (weight > 0.)
148 return weight;
149 }
150 return -1.;
151}

◆ init_hit()

FCSReturnCode TFCSLateralShapeParametrizationHitChain::init_hit ( TFCSLateralShapeParametrizationHitBase::Hit & hit,
TFCSSimulationState & simulstate,
const TFCSTruthState * truth,
const TFCSExtrapolationState * extrapol ) const
virtual

Definition at line 212 of file TFCSLateralShapeParametrizationHitChain.cxx.

215 {
216 hit.reset_center();
217 if (get_nr_of_init() > 0) {
218 ATH_MSG_DEBUG("E(" << calosample() << ")=" << simulstate.E(calosample())
219 << " before init");
220
221 auto initloopend = m_chain.begin() + get_nr_of_init();
222 for (auto hititr = m_chain.begin(); hititr != initloopend; ++hititr) {
223 TFCSLateralShapeParametrizationHitBase *hitsim = *hititr;
224
226 hitsim->simulate_hit(hit, simulstate, truth, extrapol);
227
228 if (status != FCSSuccess) {
229 ATH_MSG_ERROR("TFCSLateralShapeParametrizationHitChain::simulate(): "
230 "simulate_hit init call failed");
231 return FCSFatal;
232 }
233 }
234 }
235 return FCSSuccess;
236}
#define ATH_MSG_ERROR(x)
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol)
simulated one hit position with some energy.
status
Definition merge.py:16

◆ 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 };
double Ekin_min() const override
double Ekin_max() const override

◆ 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 };
double eta_max() const override
double eta_min() const override

◆ 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 };
Scalar eta() const
pseudorapidity method

◆ 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(); }
MsgStream & msg() const
Return a stream for sending messages directly (no decoration)
Definition MLogging.h:231

◆ 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}
std::string m_nm
Message source name.
Definition MLogging.h:211
IMessageSvc * getMessageSvc(bool quiet=false)

◆ 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}
MSG::Level level() const
Retrieve output level.
Definition MLogging.h:201

◆ 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 TFCSHitCellMapping, TFCSHitCellMappingWiggle, TFCSLateralShapeParametrizationHitNumberFromE, and TFCSPredictExtrapWeights.

Definition at line 119 of file TFCSParametrizationBase.h.

119 {
120 return compare(ref);
121 };
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!

◆ operator[]() [1/2]

const TFCSParametrizationBase * TFCSLateralShapeParametrizationHitChain::operator[] ( unsigned int ) const
overridevirtual

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

Reimplemented from TFCSParametrizationBase.

Definition at line 84 of file TFCSLateralShapeParametrizationHitChain.cxx.

84 {
86 if (ind == 0)
88 return m_chain[ind - 1];
89 } else {
90 return m_chain[ind];
91 }
92}

◆ operator[]() [2/2]

TFCSParametrizationBase * TFCSLateralShapeParametrizationHitChain::operator[] ( unsigned int )
overridevirtual

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

Reimplemented from TFCSParametrizationBase.

Definition at line 95 of file TFCSLateralShapeParametrizationHitChain.cxx.

95 {
97 if (ind == 0)
99 return m_chain[ind - 1];
100 } else {
101 return m_chain[ind];
102 }
103}

◆ 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 TFCSLateralShapeParametrizationHitChain::Print ( Option_t * option = "") const
override

Do not persistify!

Definition at line 483 of file TFCSLateralShapeParametrizationHitChain.cxx.

483 {
485 TString opt(option);
486 bool shortprint = opt.Index("short") >= 0;
487 bool longprint = msgLvl(MSG::DEBUG) || (msgLvl(MSG::INFO) && !shortprint);
488 TString optprint = opt;
489 optprint.ReplaceAll("short", "");
490
492 if (longprint)
493 ATH_MSG_INFO(optprint << "#:Number of hits simulation:");
494 m_number_of_hits_simul->Print(opt + "#:");
495 }
496 if (longprint && get_nr_of_init() > 0)
497 ATH_MSG_INFO(optprint << "> Simulation init chain:");
498 auto hitloopstart = m_chain.begin() + get_nr_of_init();
499 for (auto hititr = m_chain.begin(); hititr != hitloopstart; ++hititr) {
500 TFCSLateralShapeParametrizationHitBase *hitsim = *hititr;
501 hitsim->Print(opt + "> ");
502 }
503 if (longprint)
504 ATH_MSG_INFO(optprint << "- Simulation chain:");
505 char count = 'A';
506 for (auto hititr = hitloopstart; hititr != m_chain.end(); ++hititr) {
507 TFCSLateralShapeParametrizationHitBase *hitsim = *hititr;
508 hitsim->Print(opt + count + " ");
509 count++;
510 }
511}
#define ATH_MSG_INFO(x)
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
Definition MLogging.h:222
void Print(Option_t *option="") const override
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146

◆ PropagateMSGLevel()

void TFCSLateralShapeParametrizationHitChain::PropagateMSGLevel ( MSG::Level level) const
protected

Definition at line 206 of file TFCSLateralShapeParametrizationHitChain.cxx.

207 {
208 for (TFCSLateralShapeParametrizationHitBase *reset : m_chain)
209 reset->setLevel(level);
210}
constexpr std::enable_if_t< is_bitmask_v< E >, E & > reset(E &lhs, E rhs)
Convenience function to clear bits in a class enum bitmask.
Definition bitmask.h:251

◆ push_back()

void TFCSLateralShapeParametrizationHitChain::push_back ( const Chain_t::value_type & value)
inline

Definition at line 52 of file TFCSLateralShapeParametrizationHitChain.h.

52 {
53 m_chain.push_back(value);
54 };

◆ push_back_init()

void TFCSLateralShapeParametrizationHitChain::push_back_init ( const Chain_t::value_type & value)

Definition at line 72 of file TFCSLateralShapeParametrizationHitChain.cxx.

73 {
74 if (m_ninit == size()) {
75 chain().push_back(value);
76 } else {
77 const auto it = chain().begin() + m_ninit;
78 chain().insert(it, value);
79 }
80 ++m_ninit;
81}
virtual unsigned int size() const override
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...

◆ RemoveDuplicates()

void TFCSParametrizationBase::RemoveDuplicates ( )
inherited

Definition at line 152 of file TFCSParametrizationBase.cxx.

152 {
153 FindDuplicateClasses_t dupclasses;
154 FindDuplicates(dupclasses);
155
156 std::set<TFCSParametrizationBase *> dellist;
157 for (auto &dupiter : dupclasses) {
158 FindDuplicates_t &dup = dupiter.second;
159 for (auto onedup : dup) {
160 if (onedup.second.mother.empty())
161 continue;
162 TFCSParametrizationBase *ref = onedup.first;
163 ATH_MSG_DEBUG("Main object " << ref << "=" << ref->GetName());
164 for (unsigned int i = 0; i < onedup.second.mother.size(); ++i) {
165 int index = onedup.second.index[i];
166 TFCSParametrizationBase *mother = onedup.second.mother[i];
167 TFCSParametrizationBase *delparam = mother->operator[](index);
168 unsigned int delcount = dup[delparam].mother.size();
169 if (delcount == 0) {
170 ATH_MSG_DEBUG(" - Delete object "
171 << delparam << "=" << delparam->GetName() << " index "
172 << index << " of " << mother << ", has " << delcount
173 << " other replacements attached. Deleting");
174 mother->set_daughter(index, ref);
175 dellist.insert(delparam);
176 } else {
177 ATH_MSG_WARNING(" - Delete object "
178 << delparam << "=" << delparam->GetName() << " index "
179 << index << " of " << mother << ", has " << delcount
180 << " other replacements attached. Skipping");
181 }
182 }
183 }
184 }
185
186 ATH_MSG_INFO("RERUNNING DUPLICATE FINDING");
187 FindDuplicateClasses_t dupclasses2;
188 FindDuplicates(dupclasses2);
189
190 std::map<std::string, int> ndel;
191 for (auto *delparam : dellist) {
192 FindDuplicates_t &dup2 = dupclasses2[delparam->GetName()];
193 bool present = dup2.find(delparam) != dup2.end();
194 if (present) {
195 ATH_MSG_WARNING("- Delete object " << delparam << "="
196 << delparam->GetName()
197 << " still referenced somewhere!");
198 } else {
199 ATH_MSG_DEBUG("- Delete object " << delparam << "="
200 << delparam->GetName());
201 ++ndel[delparam->ClassName()];
202 delete delparam;
203 }
204 }
205 for (auto &del : ndel)
206 ATH_MSG_INFO("Deleted " << del.second << " duplicate objects of class "
207 << del.first);
208}
virtual void set_daughter(unsigned int, TFCSParametrizationBase *)
Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter meth...
std::map< std::string, FindDuplicates_t > FindDuplicateClasses_t
str index
Definition DeMoScan.py:362

◆ RemoveNameTitle()

void TFCSParametrizationBase::RemoveNameTitle ( )
inherited

Definition at line 210 of file TFCSParametrizationBase.cxx.

210 {
211 for (unsigned int i = 0; i < size(); ++i)
212 if ((*this)[i]) {
213 TFCSParametrizationBase *param = (*this)[i];
214 param->SetName("");
215 param->SetTitle("");
216
217 // Continue for child objects in param
218 param->RemoveNameTitle();
219 }
220}

◆ reset_match_all_pdgid()

virtual void TFCSParametrizationBase::reset_match_all_pdgid ( )
inlinevirtualinherited

Definition at line 84 of file TFCSParametrizationBase.h.

84{ ResetBit(kMatchAllPDGID); };

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

void TFCSLateralShapeParametrizationHitChain::set_daughter ( unsigned int ,
TFCSParametrizationBase *  )
overridevirtual

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 from TFCSParametrizationBase.

Definition at line 105 of file TFCSLateralShapeParametrizationHitChain.cxx.

106 {
107 TFCSLateralShapeParametrizationHitBase *param_typed = nullptr;
108 if (param != nullptr) {
109 if (!param->InheritsFrom(TFCSLateralShapeParametrizationHitBase::Class())) {
110 ATH_MSG_ERROR("Wrong class type " << param->IsA()->GetName());
111 return;
112 }
113 param_typed = static_cast<TFCSLateralShapeParametrizationHitBase *>(param);
114 }
116 if (ind == 0)
117 m_number_of_hits_simul = param_typed;
118 else
119 m_chain.at(ind - 1) = param_typed;
120 } else {
121 m_chain.at(ind) = param_typed;
122 }
123}

◆ 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}
virtual void set_Ekin_max(double max)
virtual void set_Ekin_min(double min)
virtual void set_Ekin_nominal(double min)

◆ set_Ekin_bin()

void TFCSLateralShapeParametrization::set_Ekin_bin ( int bin)
inherited

Definition at line 17 of file TFCSLateralShapeParametrization.cxx.

17 {
19}

◆ set_Ekin_eta()

void TFCSParametrization::set_Ekin_eta ( const TFCSParametrizationBase & ref)
virtualinherited

Definition at line 67 of file TFCSParametrization.cxx.

67 {
69 set_eta(ref);
70}
virtual void set_eta(const TFCSParametrizationBase &ref)
virtual void set_Ekin(const TFCSParametrizationBase &ref)

◆ set_Ekin_max()

void TFCSParametrization::set_Ekin_max ( double max)
virtualinherited

Definition at line 45 of file TFCSParametrization.cxx.

45{ m_Ekin_max = max; }
#define max(a, b)
Definition cfImp.cxx:41

◆ set_Ekin_min()

void TFCSParametrization::set_Ekin_min ( double min)
virtualinherited

Definition at line 43 of file TFCSParametrization.cxx.

43{ m_Ekin_min = min; }
#define min(a, b)
Definition cfImp.cxx:40

◆ 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}
virtual void set_eta_max(double max)
virtual void set_eta_nominal(double min)
virtual void set_eta_min(double min)

◆ set_eta_max()

void TFCSParametrization::set_eta_max ( double max)
virtualinherited

Definition at line 53 of file TFCSParametrization.cxx.

53{ m_eta_max = max; }

◆ set_eta_min()

void TFCSParametrization::set_eta_min ( double min)
virtualinherited

Definition at line 51 of file TFCSParametrization.cxx.

51{ m_eta_min = min; }

◆ set_eta_nominal()

void TFCSParametrization::set_eta_nominal ( double min)
virtualinherited

Definition at line 47 of file TFCSParametrization.cxx.

47 {
48 m_eta_nominal = nominal;
49}

◆ set_geometry()

void TFCSParametrizationBase::set_geometry ( ICaloGeometry * geo)
virtualinherited

Method to set the geometry access pointer.

Loops over daughter objects if present

Reimplemented in TFCSBinnedShowerBase, TFCSHistoLateralShapeParametrization, TFCSHitCellMapping, TFCSPhiModulationCorrection, and TFCSVoxelHistoLateralCovarianceFluctuations.

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

void TFCSLateralShapeParametrizationHitChain::set_nr_of_init ( unsigned int ninit)
inline

Definition at line 58 of file TFCSLateralShapeParametrizationHitChain.h.

58{ m_ninit = ninit; };

◆ set_number_of_hits_simul()

virtual void TFCSLateralShapeParametrizationHitChain::set_number_of_hits_simul ( TFCSLateralShapeParametrizationHitBase * sim)
inlinevirtual

set which instance should determine the number of hits

Definition at line 62 of file TFCSLateralShapeParametrizationHitChain.h.

62 {
64 };

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

◆ 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}
virtual void set_Ekin_eta(const TFCSParametrizationBase &ref)
virtual void set_pdgid(int id)

◆ 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}
virtual void set_pdgid_Ekin_eta(const TFCSParametrizationBase &ref)

◆ 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 TFCSLateralShapeParametrizationHitChain::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.

Reimplemented in TFCSLateralShapeParametrizationFluctChain.

Definition at line 238 of file TFCSLateralShapeParametrizationHitChain.cxx.

240 {
241 MSG::Level old_level = level();
242 const bool debug = msgLvl(MSG::DEBUG);
243 const bool verbose = msgLvl(MSG::VERBOSE);
244
245 // Execute the first get_nr_of_init() simulate calls only once. Used for
246 // example to initialize the center position
247 TFCSLateralShapeParametrizationHitBase::Hit hit;
248 if (init_hit(hit, simulstate, truth, extrapol) != FCSSuccess) {
249 ATH_MSG_ERROR("init_hit() failed");
250 return FCSFatal;
251 }
252
253 int cs = calosample();
254 // Initialize hit energy only now, as init loop above might change the layer
255 // energy
256 const float Elayer = simulstate.E(cs);
257 if (Elayer == 0) {
258 ATH_MSG_VERBOSE("Elayer=0, nothing to do");
259 return FCSSuccess;
260 }
261 const float Ehit = get_E_hit(simulstate, truth, extrapol);
262 if (Ehit * Elayer <= 0) {
263 ATH_MSG_ERROR("TFCSLateralShapeParametrizationHitChain::simulate(): Ehit "
264 "and Elayer have different sign! Ehit="
265 << Ehit << " Elayer=" << Elayer);
266 return FCSFatal;
267 }
268
269 // Call get_number_of_hits() only once inside get_E_hit(...),
270 // as it could contain a random number
271 //TODO: should read simulate value!
272 int nhit_signed = TMath::Nint(Elayer / Ehit);
273 if (nhit_signed < 1)
274 nhit_signed = 1;
275 unsigned int nhit = (unsigned int)nhit_signed;
276
277 float sumEhit = 0;
278
279 if (debug) {
280 PropagateMSGLevel(old_level);
281 ATH_MSG_DEBUG("E(" << cs << ")=" << simulstate.E(cs) << " #hits~" << nhit);
282 }
283
284 //
285 // simulate the hits in GPU
286 //
287#ifdef USE_GPU
288 int ichn = 0;
289 bool our_chainA = false;
290 if (cs > 0 && cs < 8 && cs != 4)
291 our_chainA = true;
292 if (nhit > MIN_GPU_HITS && our_chainA && simulstate.get_geold() != nullptr) {
294 "running FastCaloSim in GPU, nhits = " << nhit << " ; Ehit = " << Ehit);
295 GeoLoadGpu *gld = (GeoLoadGpu *)simulstate.get_geold();
296
298 args.debug = debug;
299 args.cs = cs;
300 args.extrapol_eta_ent = extrapol->eta(cs, SUBPOS_ENT);
301 args.extrapol_eta_ext = extrapol->eta(cs, SUBPOS_EXT);
302 args.extrapol_phi_ent = extrapol->phi(cs, SUBPOS_ENT);
303 args.extrapol_phi_ext = extrapol->phi(cs, SUBPOS_EXT);
304 args.extrapol_r_ent = extrapol->r(cs, SUBPOS_ENT);
305 args.extrapol_r_ext = extrapol->r(cs, SUBPOS_EXT);
306 args.extrapol_z_ent = extrapol->z(cs, SUBPOS_ENT);
307 args.extrapol_z_ext = extrapol->z(cs, SUBPOS_EXT);
308 args.pdgId = truth->pdgid();
309 args.charge = HepPDT::ParticleID(args.pdgId).charge();
310 args.nhits = nhit;
311 args.rand = 0;
312 args.geo = gld->get_geoPtr();
313 args.rd4h = simulstate.get_gpu_rand();
314 args.ncells = gld->get_ncells();
315 ichn = 0;
316 // reweight the cell energies for pion
317 bool reweight = false;
318 for (auto hitsim : m_chain) {
319 if (ichn == 0) {
320 args.extrapWeight =
321 ((TFCSCenterPositionCalculation *)hitsim)->getExtrapWeight();
322 }
323
324 if (ichn == 1) {
325
326 args.is_phi_symmetric = ((TFCSHistoLateralShapeParametrization *)hitsim)
327 ->is_phi_symmetric();
328 args.fh2d =
329 ((TFCSHistoLateralShapeParametrization *)hitsim)->LdFH()->hf2d_d();
330 args.fh2d_h = *(
331 ((TFCSHistoLateralShapeParametrization *)hitsim)->LdFH()->hf2d_h());
332 }
333 if (ichn == 2 && m_chain.size() == 4) {
334 args.fh1d =
335 ((TFCSHistoLateralShapeGausLogWeight *)hitsim)->LdFH()->hf1d_d();
336 args.fh1d_h =
337 *(((TFCSHistoLateralShapeGausLogWeight *)hitsim)->LdFH()->hf1d_h());
338 reweight = true;
339 }
340 if ((ichn == 2 && m_chain.size() == 3) ||
341 (ichn == 3 && m_chain.size() == 4)) {
342 // ATH_MSG_DEBUG("---NumberOfBins :" << ( (TFCSHitCellMappingWi
343 // ggle*)hitsim )->get_number_of_bins() );
344 args.fhs = ((TFCSHitCellMappingWiggle *)hitsim)->LdFH()->hf_d();
345 args.fhs_h = *(((TFCSHitCellMappingWiggle *)hitsim)->LdFH()->hf_h());
346 }
347
348 ichn++;
349 }
350 if (reweight)
351 CaloGpuGeneral::simulate_hits(Ehit, 1.2 * nhit, args, reweight);
352 else
353 CaloGpuGeneral::simulate_hits(Ehit, nhit, args, reweight);
354
355 for (unsigned int ii = 0; ii < args.ct; ++ii) {
356
357 const CaloDetDescrElement_Gpu *cellele =
358 gld->index2cell(args.hitcells_E_h[ii].cellid);
359 const CaloDetDescrElement *cell_h =
360 m_geo->getDDE(cs, cellele->eta(), cellele->phi());
361 sumEhit += args.hitcells_E_h[ii].energy;
362 if (reweight) {
363 if (std::abs(sumEhit) > std::abs(Elayer))
364 simulstate.deposit(cell_h, args.hitcells_E_h[ii].energy);
365 }
366 }
367 } else
368#endif
369 {
370
371 auto hitloopstart = m_chain.begin() + get_nr_of_init();
372 hit.idx() = 0;
373 int ifail = 0;
374 int itotalfail = 0;
375 int retry_warning = 1;
376 int retry = 0;
377 bool failed = false;
378 do {
379 hit.reset();
380 hit.E() = Ehit;
381 failed = false;
382 if (debug)
383 if (hit.idx() == 2)
384 if (!verbose) {
385 // Switch debug output back to INFO to avoid huge logs, but keep
386 // full log in verbose
387 PropagateMSGLevel(MSG::INFO);
388 }
389 for (auto hititr = hitloopstart; hititr != m_chain.end(); ++hititr) {
390 TFCSLateralShapeParametrizationHitBase *hitsim = *hititr;
391
393 hitsim->simulate_hit(hit, simulstate, truth, extrapol);
394
395 if (status == FCSSuccess)
396 continue;
397 if (status == FCSFatal) {
398 if (debug)
399 PropagateMSGLevel(old_level);
400 return FCSFatal;
401 }
402 failed = true;
403 ++ifail;
404 ++itotalfail;
405 retry = status - FCSRetry;
406 retry_warning = retry >> 1;
407 if (retry_warning < 1)
408 retry_warning = 1;
409 break;
410 }
411 if (!failed) {
412 ifail = 0;
413 sumEhit += hit.E();
414 ++hit.idx();
415
416 // TODO: Different signedness:
417 if (((hit.idx() == 20 * nhit) || (hit.idx() == 100 * nhit)) && hit.idx() >= 100) {
419 "TFCSLateralShapeParametrizationHitChain::simulate(): Iterated "
420 << hit.idx() << " times, expected " << nhit << " times. Deposited E("
421 << cs << ")=" << sumEhit << " expected E=" << Elayer);
422 }
423 if (hit.idx() >= 1000 * nhit && hit.idx() >= 1000) {
424 ATH_MSG_DEBUG("TFCSLateralShapeParametrizationHitChain::simulate():"
425 " Aborting hit chain, iterated "
426 << hit.idx() << " times, expected " << nhit
427 << " times. Deposited E(" << cs << ")=" << sumEhit
428 << " expected E=" << Elayer << ", caused by:");
429 if (debug) Print();
430 break;
431 }
432 } else {
433 if (ifail >= retry) {
434 ATH_MSG_ERROR("TFCSLateralShapeParametrizationHitChain::simulate(): "
435 "simulate_hit call failed after "
436 << ifail << "/" << retry
437 << "retries, total fails=" << itotalfail);
438 if (debug)
439 PropagateMSGLevel(old_level);
440 return FCSFatal;
441 }
442 if (ifail >= retry_warning) {
443 ATH_MSG_WARNING("TFCSLateralShapeParametrizationHitChain::simulate():"
444 " retry simulate_hit calls "
445 << ifail << "/" << retry
446 << ", total fails=" << itotalfail);
447 }
448 }
449 } while (!check_all_hits_simulated(hit, simulstate, truth, extrapol, !failed));
450 }
451
452 if (debug)
453 PropagateMSGLevel(old_level);
454 return FCSSuccess;
455}
struct Chain0_Args Chain0_Args
#define ATH_MSG_VERBOSE(x)
#define MIN_GPU_HITS
const bool debug
CUDA_HOSTDEV float phi() const
cell phi
CUDA_HOSTDEV float eta() const
cell eta
unsigned long get_ncells() const
Definition GeoLoadGpu.h:46
GeoGpu * get_geoPtr() const
Definition GeoLoadGpu.h:44
const CaloDetDescrElement_Gpu * index2cell(unsigned long index)
Definition GeoLoadGpu.h:34
virtual bool check_all_hits_simulated(TFCSLateralShapeParametrizationHitBase::Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol, bool success) const
void Print(Option_t *option="") const override
Do not persistify!
virtual FCSReturnCode init_hit(TFCSLateralShapeParametrizationHitBase::Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
virtual float get_E_hit(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Get hit energy from layer energy and number of hits.
void deposit(const CaloDetDescrElement *cellele, float E)
int pdgid() const
bool verbose
Definition hcg.cxx:73
void simulate_hits(float, int, Chain0_Args &, bool)

◆ size()

unsigned int TFCSLateralShapeParametrizationHitChain::size ( ) const
overridevirtual

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

Reimplemented from TFCSParametrizationBase.

Definition at line 65 of file TFCSLateralShapeParametrizationHitChain.cxx.

65 {
67 return m_chain.size() + 1;
68 else
69 return m_chain.size();
70}

◆ 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}
output
Definition merge.py:16
TFile * file

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

double TFCSParametrizationBase::init_Ekin_max = 14000000
staticconstexprprotectedinherited

Do not persistify!

Definition at line 155 of file TFCSParametrizationBase.h.

◆ init_Ekin_min

double TFCSParametrizationBase::init_Ekin_min = 0
staticconstexprprotectedinherited

Do not persistify!

Definition at line 154 of file TFCSParametrizationBase.h.

◆ init_Ekin_nominal

double TFCSParametrizationBase::init_Ekin_nominal = 0
staticconstexprprotectedinherited

Definition at line 153 of file TFCSParametrizationBase.h.

◆ init_eta_max

double TFCSParametrizationBase::init_eta_max = 100
staticconstexprprotectedinherited

Do not persistify!

Definition at line 158 of file TFCSParametrizationBase.h.

◆ init_eta_min

double TFCSParametrizationBase::init_eta_min = -100
staticconstexprprotectedinherited

Do not persistify!

Definition at line 157 of file TFCSParametrizationBase.h.

◆ init_eta_nominal

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_chain

Chain_t TFCSLateralShapeParametrizationHitChain::m_chain
protected

Definition at line 99 of file TFCSLateralShapeParametrizationHitChain.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_ninit

unsigned int TFCSLateralShapeParametrizationHitChain::m_ninit = 0
private

Definition at line 109 of file TFCSLateralShapeParametrizationHitChain.h.

◆ m_nm

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

Message source name.

Definition at line 211 of file MLogging.h.

◆ m_number_of_hits_simul

TFCSLateralShapeParametrizationHitBase* TFCSLateralShapeParametrizationHitChain::m_number_of_hits_simul
private

Definition at line 108 of file TFCSLateralShapeParametrizationHitChain.h.

◆ m_pdgid

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

Definition at line 63 of file TFCSParametrization.h.

◆ s_max_sigma2_fluctuation

float TFCSLateralShapeParametrizationHitChain::s_max_sigma2_fluctuation = 1000
staticconstexpr

Definition at line 87 of file TFCSLateralShapeParametrizationHitChain.h.


The documentation for this class was generated from the following files: