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

#include <TFCSVoxelHistoLateralCovarianceFluctuations.h>

Inheritance diagram for TFCSVoxelHistoLateralCovarianceFluctuations:
Collaboration diagram for TFCSVoxelHistoLateralCovarianceFluctuations:

Public Types

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

 TFCSVoxelHistoLateralCovarianceFluctuations (const char *name=nullptr, const char *title=nullptr)
virtual ~TFCSVoxelHistoLateralCovarianceFluctuations ()
virtual void set_geometry (ICaloGeometry *geo) override
 Method to set the geometry access pointer.
ICaloGeometryget_geometry ()
bool initialize (TFile *inputfile, const std::string &folder)
virtual FCSReturnCode simulate (TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
 create one fluctuated shape for a shower to be applied as scale factor to the average shape Store the fluctuation in simulstate
virtual FCSReturnCode simulate_hit (Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
 weight the energy of one hit by the fluctuation calculated in simulate(...)
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.
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.
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 getMinWeight () const
 Get minimum and maximum value of weight for hit energy reweighting.
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 Print (Option_t *option="") const override
void clear ()
virtual bool is_match_pdgid (int id) const override
virtual bool is_match_Ekin (float Ekin) const override
virtual bool is_match_eta (float eta) const override
virtual bool is_match_all_Ekin () const override
virtual bool is_match_all_eta () const override
const std::set< int > & pdgid () const override
double Ekin_nominal () const override
double Ekin_min () const override
double Ekin_max () const override
double eta_nominal () const override
double eta_min () const override
double eta_max () const override
virtual void set_pdgid (int id)
virtual void set_pdgid (const std::set< int > &ids)
virtual void add_pdgid (int id)
virtual void clear_pdgid ()
virtual void set_Ekin_nominal (double min)
virtual void set_Ekin_min (double min)
virtual void set_Ekin_max (double max)
virtual void set_eta_nominal (double min)
virtual void set_eta_min (double min)
virtual void set_eta_max (double max)
virtual void set_Ekin (const TFCSParametrizationBase &ref)
virtual void set_eta (const TFCSParametrizationBase &ref)
virtual void set_Ekin_eta (const TFCSParametrizationBase &ref)
virtual void set_pdgid_Ekin_eta (const TFCSParametrizationBase &ref)
virtual bool is_match_all_pdgid () const
virtual void set_match_all_pdgid ()
virtual void reset_match_all_pdgid ()
virtual unsigned int size () const
 Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operator[] methods give general access to these daughters.
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.
virtual TFCSParametrizationBaseoperator[] (unsigned int)
 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, TFCSParametrizationBase *)
 Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter method allows to change these daughters - expert use only!
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.

Protected Types

typedef std::vector< std::vector< float > > weight_t
 do not persistify

Protected Member Functions

void MultiGaus (TFCSSimulationState &simulstate, TVectorD &genPars) const
bool compare (const TFCSParametrizationBase &ref) const

Protected Attributes

ICaloGeometrym_geo {}
std::vector< std::vector< std::vector< TFCS1DFunction * > > > m_transform
int m_nDim_x {}
int m_nDim_y {}
std::vector< TH2 * > m_voxel_template
std::vector< TVectorD > m_parMeans
std::vector< TMatrixD > m_EigenVectors
std::vector< TVectorD > m_EigenValues

Static Protected Attributes

static const std::uint32_t s_layer_hash [CaloCell_ID_FCS::MaxSample]
 do not persistify
static const std::uint32_t s_layer_hash_geo [CaloCell_ID_FCS::MaxSample]
 do not persistify
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

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

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

◆ weight_t

typedef std::vector<std::vector<float> > TFCSVoxelHistoLateralCovarianceFluctuations::weight_t
protected

do not persistify

Definition at line 51 of file TFCSVoxelHistoLateralCovarianceFluctuations.h.

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

◆ TFCSVoxelHistoLateralCovarianceFluctuations()

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

Definition at line 54 of file TFCSVoxelHistoLateralCovarianceFluctuations.cxx.

TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)

◆ ~TFCSVoxelHistoLateralCovarianceFluctuations()

TFCSVoxelHistoLateralCovarianceFluctuations::~TFCSVoxelHistoLateralCovarianceFluctuations ( )
virtual

Definition at line 59 of file TFCSVoxelHistoLateralCovarianceFluctuations.cxx.

60{}

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

◆ 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)
TFCSLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)
#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 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}
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...

◆ get_geometry()

ICaloGeometry * TFCSVoxelHistoLateralCovarianceFluctuations::get_geometry ( )
inline

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

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

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}

◆ initialize()

bool TFCSVoxelHistoLateralCovarianceFluctuations::initialize ( TFile * inputfile,
const std::string & folder )

Definition at line 62 of file TFCSVoxelHistoLateralCovarianceFluctuations.cxx.

63 {
64 // load m_eigenvariances and m_parMeans from input file
65 // load histograms for each cell from input file
66 // m_transform[i][j]=new TFCS1DFunctionInt16Int16Histogram(hist)
67 // where hist is the 1D histogram from which a CDF was calculated
68
69 inputfile->cd(folder.c_str());
70 // inputfile->ls();
71
72 int cs = calosample();
73 int bin = 1;
74
75 TH2 *temp = dynamic_cast<TH2 *>(
76 inputfile->Get(Form("voxel_template_cs%d_pca%d", cs, bin)));
77 if (!temp) {
78 ATH_MSG_ERROR("Template hist not found for cs " + std::to_string(cs));
79 return false;
80 }
81 m_voxel_template.push_back(temp);
82 m_nDim_x = m_voxel_template[0]->GetNbinsX();
83 m_nDim_y = m_voxel_template[0]->GetNbinsY();
84
85 while (inputfile->Get(Form("parMeans_cs%d_pca%d", cs, bin))) {
86 TVectorD parMeans;
87 TMatrixD EigenVectors;
88 TVectorD EigenValues;
89 std::vector<std::vector<TFCS1DFunction *>> transform;
90
91 std::string label = Form("_cs%d_pca%d", cs, bin);
92
93 TObject *obj = inputfile->Get(("parMeans" + label).c_str());
94 if (!obj) {
95 ATH_MSG_ERROR("parMeans" + label + " not found");
96 return false;
97 }
98 if (msgLvl(MSG::DEBUG)) {
99 ATH_MSG_DEBUG("parMeans");
100 obj->Print();
101 }
102 parMeans.ResizeTo(m_nDim_x * m_nDim_y);
103 parMeans = *dynamic_cast<TVectorT<double> *>(obj);
104 m_parMeans.push_back(parMeans);
105
106 obj = inputfile->Get(("covMatrix" + label).c_str());
107 if (!obj) {
108 ATH_MSG_ERROR("covMatrix" + label + " not found");
109 return false;
110 }
111 TMatrixTSym<double> covMatrix = *dynamic_cast<TMatrixTSym<double> *>(obj);
112 TMatrixDSymEigen eigenvariances = TMatrixDSymEigen(covMatrix);
113 EigenVectors.ResizeTo(eigenvariances.GetEigenVectors());
114 EigenVectors = eigenvariances.GetEigenVectors();
115 m_EigenVectors.push_back(EigenVectors);
116
117 EigenValues.ResizeTo(eigenvariances.GetEigenValues());
118 EigenValues = eigenvariances.GetEigenValues();
119 m_EigenValues.push_back(EigenValues);
120
121 if (msgLvl(MSG::DEBUG)) {
122 ATH_MSG_DEBUG("eigenvariances");
123 eigenvariances.GetEigenValues().Print();
124 eigenvariances.GetEigenVectors().Print();
125 }
126 if (msgLvl(MSG::DEBUG)) {
127 ATH_MSG_DEBUG("m_EigenValues");
128 EigenValues.Print();
129 ATH_MSG_DEBUG("m_EigenVectors");
130 EigenVectors.Print();
131 }
132
133 transform.resize(m_nDim_x);
134 for (int x = 0; x < m_nDim_x; ++x) {
135 transform[x].resize(m_nDim_y);
136 for (int y = 0; y < m_nDim_y; ++y) {
137 // Naming of hists is hist_xy where x, y are indices of cells
138 std::string histname = Form("hist_%d_%d%s", x, y, label.c_str());
139 TH1 *hist = (TH1 *)inputfile->Get(histname.c_str());
140 if (!hist) {
141 ATH_MSG_ERROR("Histogram " << histname << " not found");
142 return false;
143 }
144 TFCS1DFunctionInt32Int32Histogram *func =
145 new TFCS1DFunctionInt32Int32Histogram();
146 func->Initialize(hist, false);
147 transform[x][y] = func;
148 }
149 }
150 m_transform.push_back(std::move(transform));
151 ++bin;
152 }
153
154 return true;
155}
#define ATH_MSG_ERROR(x)
#define y
#define 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 Initialize(const TH1 *hist, bool doprint=true)
Initialize from root histogram.
std::vector< std::vector< std::vector< TFCS1DFunction * > > > m_transform
std::string label(const std::string &format, int i)
Definition label.h:19
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.

◆ 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

◆ MultiGaus()

void TFCSVoxelHistoLateralCovarianceFluctuations::MultiGaus ( TFCSSimulationState & simulstate,
TVectorD & genPars ) const
protected

Definition at line 159 of file TFCSVoxelHistoLateralCovarianceFluctuations.cxx.

160 {
161 int Ebin = simulstate.Ebin();
162
163 int nPars = m_parMeans[Ebin - 1].GetNrows();
164 genPars.ResizeTo(nPars);
165
166 TVectorD rotParMeans = m_EigenVectors[Ebin - 1] * m_parMeans[Ebin - 1];
167 for (int iPar = 0; iPar < nPars; iPar++) {
168 double variance = m_EigenValues[Ebin - 1][iPar];
169 // check for positive-definiteness of covMatrix
170 if (variance < 0) {
171 ATH_MSG_ERROR("Got a negative eigenvariance (" << variance
172 << ") on iPar = " << iPar);
173 variance = 0;
174 }
175 genPars[iPar] = CLHEP::RandGauss::shoot(simulstate.randomEngine(),
176 rotParMeans[iPar], sqrt(variance));
177 ATH_MSG_DEBUG("genPars[" << iPar << "]=" << genPars[iPar]
178 << " rotParMeans[iPar]=" << rotParMeans[iPar]
179 << " sqrt(variance)=" << sqrt(variance));
180 }
181 genPars = m_EigenVectors[Ebin - 1] * genPars;
182}
CLHEP::HepRandomEngine * randomEngine()

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

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

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

Reimplemented in TFCSLateralShapeParametrizationHitChain, and TFCSParametrizationChain.

Definition at line 106 of file TFCSParametrizationBase.h.

106 {
107 return nullptr;
108 };

◆ operator[]() [2/2]

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

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

Reimplemented in TFCSLateralShapeParametrizationHitChain, and TFCSParametrizationChain.

Definition at line 99 of file TFCSParametrizationBase.h.

99 {
100 return nullptr;
101 };

◆ pdgid()

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

Reimplemented from TFCSParametrizationBase.

Definition at line 34 of file TFCSParametrization.h.

34{ return m_pdgid; };

◆ Print()

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

Definition at line 53 of file TFCSLateralShapeParametrization.cxx.

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

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

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 TFCSLateralShapeParametrizationHitChain, and TFCSParametrizationChain.

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

virtual void TFCSVoxelHistoLateralCovarianceFluctuations::set_geometry ( ICaloGeometry * geo)
inlineoverridevirtual

Method to set the geometry access pointer.

Loops over daughter objects if present

Reimplemented from TFCSParametrizationBase.

Definition at line 25 of file TFCSVoxelHistoLateralCovarianceFluctuations.h.

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

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

create one fluctuated shape for a shower to be applied as scale factor to the average shape Store the fluctuation in simulstate

Reimplemented from TFCSParametrizationBase.

Definition at line 184 of file TFCSVoxelHistoLateralCovarianceFluctuations.cxx.

186 {
187 if (!simulstate.randomEngine()) {
188 return FCSFatal;
189 }
190
191 if (msgLvl(MSG::DEBUG)) {
192 ATH_MSG_DEBUG("simulstate before clearing AuxInfo");
193 simulstate.Print();
194 }
195
196 weight_t *weightvec;
197 TH2 *voxel_temp;
198
199 int Ebin = simulstate.Ebin();
200
201 for (int ilayer = 0; ilayer < CaloCell_ID_FCS::MaxSample; ++ilayer) {
202 if (simulstate.hasAuxInfo(s_layer_hash[ilayer])) {
203 weightvec = static_cast<weight_t *>(
204 simulstate.getAuxInfo<void *>(s_layer_hash[ilayer]));
205 if (weightvec) {
206 delete weightvec;
207 simulstate.setAuxInfo<void *>(s_layer_hash[ilayer], nullptr);
208 }
209 }
210 if (simulstate.hasAuxInfo(s_layer_hash_geo[ilayer])) {
211 voxel_temp = static_cast<TH2 *>(
212 simulstate.getAuxInfo<void *>(s_layer_hash_geo[ilayer]));
213 if (voxel_temp) {
214 delete voxel_temp;
215 simulstate.setAuxInfo<void *>(s_layer_hash_geo[ilayer], nullptr);
216 }
217 }
218 }
219
220 if (msgLvl(MSG::DEBUG)) {
221 ATH_MSG_DEBUG("simulstate after clearing AuxInfo");
222 simulstate.Print();
223 }
224 // if(m_parMeans[Ebin-1].GetNrows()<1) {
225 if (m_parMeans.empty() || Ebin <= 0) {
226 // not initialized, do nothing in case this instance is just used to clean
227 // up memory
228 return FCSSuccess;
229 }
230
231 // TODO: the following code should be executed for all relevant calo layers,
232 // possibly simulating correlated fluctuations between layers depending on the
233 // PCA bin
234 weightvec = new weight_t(m_nDim_x);
235 for (int x = 0; x < m_nDim_x; ++x)
236 (*weightvec)[x].resize(m_nDim_y);
237
238 TVectorD genPars(m_parMeans[Ebin - 1].GetNrows());
239
240 // Fill genPars with multivarate random Gauss
241 MultiGaus(simulstate, genPars);
242
243 // Loop through voxels
244 int count = 0;
245 for (int x = 0; x < m_nDim_x; ++x) {
246 for (int y = 0; y < m_nDim_y; ++y) {
247 // Get value of CDF corresponding to generated Gauss random
248 double cdf_val =
249 (TMath::Erf(genPars[count] * 2.0 / TMath::Pi()) + 1) / 2.0;
250
251 // Map that cdf value to input bin and value
252 double orig_val = m_transform[Ebin - 1][x][y]->rnd_to_fct(cdf_val);
253
254 // Fill hist, keep linear count
255 (*weightvec)[x][y] = orig_val;
256 ++count;
257
258 ATH_MSG_DEBUG("CELL x=" << x << " y=" << y << " : cdf_val=" << cdf_val
259 << " orig_val=" << orig_val);
260 }
261 }
262
263 voxel_temp = static_cast<TH2 *>(m_voxel_template[0]->Clone());
264
265 // For now simulating only the layer calosample()
266 simulstate.setAuxInfo<void *>(s_layer_hash[calosample()], weightvec);
267 simulstate.setAuxInfo<void *>(s_layer_hash_geo[calosample()], voxel_temp);
268
269 if (msgLvl(MSG::DEBUG)) {
270 ATH_MSG_DEBUG("simulstate after storing weight " << weightvec
271 << " in AuxInfo");
272 simulstate.Print();
273 }
274
275 return FCSSuccess;
276}
void Print(Option_t *option="") const
bool hasAuxInfo(std::uint32_t index) const
const T getAuxInfo(std::uint32_t index) const
void setAuxInfo(std::uint32_t index, const T &val)
static const std::uint32_t s_layer_hash[CaloCell_ID_FCS::MaxSample]
do not persistify
void MultiGaus(TFCSSimulationState &simulstate, TVectorD &genPars) const
std::vector< std::vector< float > > weight_t
do not persistify
static const std::uint32_t s_layer_hash_geo[CaloCell_ID_FCS::MaxSample]
do not persistify
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146

◆ simulate_hit()

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

weight the energy of one hit by the fluctuation calculated in simulate(...)

Reimplemented from TFCSLateralShapeParametrizationHitBase.

Definition at line 278 of file TFCSVoxelHistoLateralCovarianceFluctuations.cxx.

280 {
281 const double center_eta = hit.center_eta();
282 const double center_phi = hit.center_phi();
283 const double center_r = hit.center_r();
284 const double center_z = hit.center_z();
285
286 int cs = calosample();
287 weight_t *weightvec = nullptr;
288 if (simulstate.hasAuxInfo(s_layer_hash[cs]))
289 weightvec = static_cast<weight_t *>(
290 simulstate.getAuxInfo<void *>(s_layer_hash[cs]));
291
292 if (!weightvec) {
293 ATH_MSG_ERROR("Weights not stored in simulstate for calosample=" << cs);
294 return FCSFatal;
295 }
296
297 TH2 *voxel_template = nullptr;
298 if (simulstate.hasAuxInfo(s_layer_hash_geo[cs]))
299 voxel_template =
300 static_cast<TH2 *>(simulstate.getAuxInfo<void *>(s_layer_hash_geo[cs]));
301 if (!voxel_template) {
303 "Voxel geometry not stored in simulstate for calosample=" << cs);
304 return FCSFatal;
305 }
306
307 /* int nbinsx = 8;
308 float lowx = 0;
309 float highx = 2 * TMath::Pi();
310 int nbinsy = 9.;
311 float lowy = 0.;
312 float highy = 165.;
313 float coreSize = 5.;
314
315 std::vector<float> bins_x = {};
316 for(int bin = 0; bin <= nbinsx; ++bin){
317 bins_x.push_back(lowx+((highx-lowx)/nbinsx)*bin);
318 }
319
320 std::vector<float> bins_y = {lowy};
321 for(int bin = 0; bin <= nbinsy; ++bin){
322 float step = (highy-lowy)/nbinsy;
323 if(coreSize > 0){
324 if(bin ==0){lowy =lowy+coreSize;}
325 bins_y.push_back(lowy+bin*step);
326 }
327 else{
328 if(bin > 0){
329 bins_y.push_back(lowy+bin*step);
330 }
331 }
332 }
333
334 TH2F* voxel_template = new TH2F("", "", bins_x.size()-1, &bins_x[0],
335 bins_y.size()-1, &bins_y[0]); */
336
337 float deta_hit_minus_extrapol = hit.eta() - center_eta;
338 float dphi_hit_minus_extrapol = TVector2::Phi_mpi_pi(hit.phi() - center_phi);
339
340 // if(charge<0.)dphi_hit_minus_extrapol=-dphi_hit_minus_extrapol;
341 if (center_eta < 0.)
342 deta_hit_minus_extrapol = -deta_hit_minus_extrapol;
343
344 float phi_dist2r = 1.0;
345 float dist000 = TMath::Sqrt(center_r * center_r + center_z * center_z);
346 float eta_jakobi = TMath::Abs(2.0 * TMath::Exp(-hit.eta()) /
347 (1.0 + TMath::Exp(-2 * hit.eta())));
348
349 float deta_hit_minus_extrapol_mm =
350 deta_hit_minus_extrapol * eta_jakobi * dist000;
351 float dphi_hit_minus_extrapol_mm =
352 dphi_hit_minus_extrapol * center_r * phi_dist2r;
353
354 float alpha_mm =
355 TMath::ATan2(dphi_hit_minus_extrapol_mm, deta_hit_minus_extrapol_mm);
356 float radius_mm =
357 TMath::Sqrt(dphi_hit_minus_extrapol_mm * dphi_hit_minus_extrapol_mm +
358 deta_hit_minus_extrapol_mm * deta_hit_minus_extrapol_mm);
359
360 int ix;
361 int iy = voxel_template->GetYaxis()->FindBin(radius_mm) - 1;
362
363 // Treat core as one bin for simulation
364 if (iy == 0) {
365 ix = 0;
366 } else {
367 if (alpha_mm < 0)
368 ix = voxel_template->GetXaxis()->FindBin(2 * TMath::Pi() -
369 fabs(alpha_mm)) -
370 1;
371 else
372 ix = voxel_template->GetXaxis()->FindBin(alpha_mm) - 1;
373 }
374
375 const int sizex = (*weightvec).size();
376
377 float weight = 1;
378 if (ix >= 0 && ix < sizex) {
379 const int sizey = (*weightvec)[ix].size();
380 if (iy >= 0 && iy < sizey) {
381 weight = (*weightvec)[ix][iy];
382 }
383 }
384
385 hit.E() *= weight;
386
387 ATH_MSG_DEBUG("HIT: E=" << hit.E() << ", alpha = " << alpha_mm
388 << ", r = " << center_r << ", ix = " << ix
389 << ", iy = " << iy << ", weight = " << weight);
390
391 // delete voxel_template;
392 return FCSSuccess;
393}

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

std::vector<TVectorD> TFCSVoxelHistoLateralCovarianceFluctuations::m_EigenValues
protected

◆ m_EigenVectors

std::vector<TMatrixD> TFCSVoxelHistoLateralCovarianceFluctuations::m_EigenVectors
protected

◆ m_Ekin_bin

int TFCSLateralShapeParametrization::m_Ekin_bin
privateinherited

Definition at line 46 of file TFCSLateralShapeParametrization.h.

◆ m_Ekin_max

double TFCSParametrization::m_Ekin_max
privateinherited

Definition at line 64 of file TFCSParametrization.h.

◆ m_Ekin_min

double TFCSParametrization::m_Ekin_min
privateinherited

Definition at line 64 of file TFCSParametrization.h.

◆ m_Ekin_nominal

double TFCSParametrization::m_Ekin_nominal
privateinherited

Definition at line 64 of file TFCSParametrization.h.

◆ m_eta_max

double TFCSParametrization::m_eta_max
privateinherited

Definition at line 65 of file TFCSParametrization.h.

◆ m_eta_min

double TFCSParametrization::m_eta_min
privateinherited

Definition at line 65 of file TFCSParametrization.h.

◆ m_eta_nominal

double TFCSParametrization::m_eta_nominal
privateinherited

Definition at line 65 of file TFCSParametrization.h.

◆ m_geo

ICaloGeometry* TFCSVoxelHistoLateralCovarianceFluctuations::m_geo {}
protected

Definition at line 44 of file TFCSVoxelHistoLateralCovarianceFluctuations.h.

44{};

◆ m_nDim_x

int TFCSVoxelHistoLateralCovarianceFluctuations::m_nDim_x {}
protected

Definition at line 56 of file TFCSVoxelHistoLateralCovarianceFluctuations.h.

56{};

◆ m_nDim_y

int TFCSVoxelHistoLateralCovarianceFluctuations::m_nDim_y {}
protected

Definition at line 57 of file TFCSVoxelHistoLateralCovarianceFluctuations.h.

57{};

◆ m_nm

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

Message source name.

Definition at line 211 of file MLogging.h.

◆ m_parMeans

std::vector<TVectorD> TFCSVoxelHistoLateralCovarianceFluctuations::m_parMeans
protected

◆ m_pdgid

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

Definition at line 63 of file TFCSParametrization.h.

◆ m_transform

std::vector<std::vector<std::vector<TFCS1DFunction *> > > TFCSVoxelHistoLateralCovarianceFluctuations::m_transform
protected

◆ m_voxel_template

std::vector<TH2 *> TFCSVoxelHistoLateralCovarianceFluctuations::m_voxel_template
protected

◆ s_layer_hash

const std::uint32_t TFCSVoxelHistoLateralCovarianceFluctuations::s_layer_hash
staticprotected
Initial value:
= {
"PreSamplerB"_FCShash, "EMB1"_FCShash, "EMB2"_FCShash,
"EMB3"_FCShash, "PreSamplerE"_FCShash, "EME1"_FCShash,
"EME2"_FCShash, "EME3"_FCShash, "HEC0"_FCShash,
"HEC1"_FCShash, "HEC2"_FCShash, "HEC3"_FCShash,
"TileBar0"_FCShash, "TileBar1"_FCShash, "TileBar2"_FCShash,
"TileGap1"_FCShash, "TileGap2"_FCShash, "TileGap3"_FCShash,
"TileExt0"_FCShash, "TileExt1"_FCShash, "TileExt2"_FCShash,
"FCAL0"_FCShash, "FCAL1"_FCShash, "FCAL2"_FCShash}

do not persistify

Definition at line 28 of file TFCSVoxelHistoLateralCovarianceFluctuations.h.

◆ s_layer_hash_geo

const std::uint32_t TFCSVoxelHistoLateralCovarianceFluctuations::s_layer_hash_geo
staticprotected
Initial value:
= {
"PreSamplerB_geo"_FCShash, "EMB1_geo"_FCShash,
"EMB2_geo"_FCShash, "EMB3_geo"_FCShash,
"PreSamplerE_geo"_FCShash, "EME1_geo"_FCShash,
"EME2_geo"_FCShash, "EME3_geo"_FCShash,
"HEC0_geo"_FCShash, "HEC1_geo"_FCShash,
"HEC2_geo"_FCShash, "HEC3_geo"_FCShash,
"TileBar0_geo"_FCShash, "TileBar1_geo"_FCShash,
"TileBar2_geo"_FCShash, "TileGap1_geo"_FCShash,
"TileGap2_geo"_FCShash, "TileGap3_geo"_FCShash,
"TileExt0_geo"_FCShash, "TileExt1_geo"_FCShash,
"TileExt2_geo"_FCShash, "FCAL0_geo"_FCShash,
"FCAL1_geo"_FCShash, "FCAL2_geo"_FCShash}

do not persistify

Definition at line 39 of file TFCSVoxelHistoLateralCovarianceFluctuations.h.

43 :
44 ICaloGeometry *m_geo{};
45
46 static const std::uint32_t
48 static const std::uint32_t
50
51 typedef std::vector<std::vector<float>> weight_t;
52

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