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

This stores information, a rank and ring thickness, about cell rings in an ordered way. More...

#include <eflowRingSubtractionManager.h>

Collaboration diagram for eflowRingSubtractionManager:

Public Member Functions

 eflowRingSubtractionManager ()
double fudgeMean () const
double fudgeStdDev () const
void setFudgeMean (double fudgeMean)
void setFudgeStdDev (double fudgeStdDev)
void clear ()
std::map< double, RingId >::const_iterator rankBegin () const
std::map< double, RingId >::const_iterator rankEnd () const
double ringThickness (eflowCaloENUM layer) const
bool getOrdering (const eflowEEtaBinnedParameters *binnedParameters, double e, double eta, eflowFirstIntENUM j1st, bool useLegacyEnergyBinIndexing)

Private Member Functions

void setParameters (const eflowFirstIntParameters &param, const std::vector< double > &ringThickness)

Static Private Member Functions

static double ringMeanRank (const std::vector< double > &p, double rMin, double rMax)
static std::vector< eflowCaloENUMorderedLayersByShowerParam (const eflowFirstIntParameters &param, unsigned int whichParam=0)

Private Attributes

std::map< double, RingIdm_rankMap
std::vector< double > m_ringThickness
double m_fudgeMean {}
double m_fudgeStdDev {}

Static Private Attributes

static constexpr double m_rMax = 0.75
static constexpr double m_weightRange = 1.0e6

Detailed Description

This stores information, a rank and ring thickness, about cell rings in an ordered way.

The rings are ranked in descending energy density order. A ring is a list of calorimeter cells, in a given calorimeter layer, between two radii r1 and r2. This object is stored in the eflowRecTrack object, such that we have an eflowRingSubtractionManager for each track. The data in this object is filled in the simulateShower method of eflowCaloObject.

Definition at line 31 of file eflowRingSubtractionManager.h.

Constructor & Destructor Documentation

◆ eflowRingSubtractionManager()

eflowRingSubtractionManager::eflowRingSubtractionManager ( )

Member Function Documentation

◆ clear()

void eflowRingSubtractionManager::clear ( )
inline

Definition at line 43 of file eflowRingSubtractionManager.h.

43{m_rankMap.clear();}
std::map< double, RingId > m_rankMap

◆ fudgeMean()

double eflowRingSubtractionManager::fudgeMean ( ) const
inline

Definition at line 37 of file eflowRingSubtractionManager.h.

37{return m_fudgeMean;}

◆ fudgeStdDev()

double eflowRingSubtractionManager::fudgeStdDev ( ) const
inline

Definition at line 38 of file eflowRingSubtractionManager.h.

38{return m_fudgeStdDev;}

◆ getOrdering()

bool eflowRingSubtractionManager::getOrdering ( const eflowEEtaBinnedParameters * binnedParameters,
double e,
double eta,
eflowFirstIntENUM j1st,
bool useLegacyEnergyBinIndexing )

Definition at line 103 of file eflowRingSubtractionManager.cxx.

103 {
104 const eflowParameters* bin1 = nullptr;
105 const eflowParameters* bin2 = nullptr;
106
107 /* Get the left- and right-bin given (e,eta), return the weight of the two bins and fill the bins to &bin1 and &bin2 */
108 double weight = binnedParameters->getInterpolation(&bin1, &bin2, e, eta, useLegacyEnergyBinIndexing);
109 if (!(bin1 && bin2)) { return false; }
110
111 eflowFirstIntENUM adjustedJ1st = binnedParameters->adjustLFI(e, eta, j1st, useLegacyEnergyBinIndexing);
112
113 /* Interpolate the firstInBins */
114 eflowFirstIntParameters meanBin;
115 bool isFailed = !(meanBin.getWeightedParameters(bin1->getFirstIntBin(adjustedJ1st), bin2->getFirstIntBin(adjustedJ1st), weight));
116 if (isFailed) { return false; }
117
118 /* Set the ring thicknesses */
119 std::vector<double> ringThicknesses(eflowCalo::nRegions);
120 for (int i = 0; i < eflowCalo::nRegions; i++) {
121 //This was reviously interpolated - but the ring thickeness is a geometric property of the calorimeter without any energy dependence, so it was not needed.
123 }
124
125 setParameters(meanBin, ringThicknesses);
126 return true;
127}
Scalar eta() const
pseudorapidity method
eflowFirstIntENUM adjustLFI(double e, double eta, eflowFirstIntENUM j1st, bool useLegacyEnergyBinIndexing) const
double getInterpolation(const eflowParameters **bin1, const eflowParameters **bin2, double e, double eta, bool useLegacyEnergyBinIndexing) const
bool getWeightedParameters(const eflowFirstIntParameters *bin1, const eflowFirstIntParameters *bin2, const double w1)
void setParameters(const eflowFirstIntParameters &param, const std::vector< double > &ringThickness)
static double ringThickness(const eflowCaloENUM &layer)
eflowCalo::LAYER eflowCaloENUM
eflowFirstIntRegions::J1STLAYER eflowFirstIntENUM

◆ orderedLayersByShowerParam()

std::vector< eflowCaloENUM > eflowRingSubtractionManager::orderedLayersByShowerParam ( const eflowFirstIntParameters & param,
unsigned int whichParam = 0 )
staticprivate

Definition at line 42 of file eflowRingSubtractionManager.cxx.

43 {
44 /* Prepare a vector of calo layers which is ordered by the p0 parameter */
45 /* First prepare a list of all layers (which are not eflowCalo::Unknown i.e. 999) */
46 std::list<eflowCaloENUM> allLayers;
47 for (int iLayer = 0; iLayer < eflowCalo::nRegions; iLayer++) {
48 if (iLayer != eflowCalo::Unknown) {
49 allLayers.push_back((eflowCaloENUM) (iLayer));
50 }
51 }
52 /* Loop over the list to find the layer with highest p0.
53 * Attach it to the end of the ordered vector and remove it from the list.
54 * Repeat until the list is empty */
55 std::vector<eflowCaloENUM> orderedLayers;
56 while (!allLayers.empty()) {
57 std::list<eflowCaloENUM>::iterator itLayer = allLayers.begin();
58 std::list<eflowCaloENUM>::iterator itMaxP0Layer = itLayer;
59 double p0Max = param.getShapeParameter(*itMaxP0Layer, whichParam);
60 /* Get current highest p0-layer */
61 for (; itLayer != allLayers.end(); ++itLayer) {
62 double p0 = param.getShapeParameter(*itLayer, whichParam);
63 if (p0 > p0Max) {
64 itMaxP0Layer = itLayer;
65 p0Max = p0;
66 }
67 }
68 /* Attach to vector and remove from list */
69 orderedLayers.push_back(*itMaxP0Layer);
70 allLayers.erase(itMaxP0Layer);
71 }
72 return orderedLayers;
73}
double getShapeParameter(eflowCaloENUM layer, int paramIndex) const

◆ rankBegin()

std::map< double, RingId >::const_iterator eflowRingSubtractionManager::rankBegin ( ) const
inline

Definition at line 44 of file eflowRingSubtractionManager.h.

44{return m_rankMap.begin();}

◆ rankEnd()

std::map< double, RingId >::const_iterator eflowRingSubtractionManager::rankEnd ( ) const
inline

Definition at line 45 of file eflowRingSubtractionManager.h.

45{return m_rankMap.end();}

◆ ringMeanRank()

double eflowRingSubtractionManager::ringMeanRank ( const std::vector< double > & p,
double rMin,
double rMax )
staticprivate

Definition at line 29 of file eflowRingSubtractionManager.cxx.

29 {
30
31 double x1 = 0.0;
32 double x2 = 0.0;
33
34 if (0 != p[1] && 0 != p[3]){
35 x1 = exp(-rMin / p[1]) - exp(-rMax / p[1]);
36 x2 = exp(-rMin / p[3]) - exp(-rMax / p[3]);
37 }
38
39 return (p[0] * p[1] * x1 + p[2] * p[3] * x2) / (rMax - rMin); // hard coded 4-param model for now
40}

◆ ringThickness()

double eflowRingSubtractionManager::ringThickness ( eflowCaloENUM layer) const
inline

Definition at line 47 of file eflowRingSubtractionManager.h.

47{return m_ringThickness[layer];}
@ layer
Definition HitInfo.h:79

◆ setFudgeMean()

void eflowRingSubtractionManager::setFudgeMean ( double fudgeMean)
inline

◆ setFudgeStdDev()

void eflowRingSubtractionManager::setFudgeStdDev ( double fudgeStdDev)
inline

◆ setParameters()

void eflowRingSubtractionManager::setParameters ( const eflowFirstIntParameters & param,
const std::vector< double > & ringThickness )
private

Definition at line 75 of file eflowRingSubtractionManager.cxx.

75 {
76 /* Prepare a vector of calo layers which is ordered by the p0 parameter */
77 std::vector<eflowCaloENUM> orderedLayers = orderedLayersByShowerParam(param, 0);
78
79 /* Set e/p and ring thicknesses */
80 m_fudgeMean = param.fudgeMean();
81 m_fudgeStdDev = param.fudgeStdDev();
83
84 /* Populate the ring/rank map */
85 m_rankMap.clear();
86 double weight;
87 double weightMax = ringMeanRank(param.getShapeParameters(orderedLayers[0]), 0.0, ringThickness[orderedLayers[0]])/m_weightRange;
88 for (const auto & layer : orderedLayers) {
89 /* Add weights to map (map does the ordering) */
90 const int nRings = (int)(m_rMax / ringThickness[layer]);
91
92 for (int iRing = 0; iRing < nRings; iRing++) {
93 weight = ringMeanRank(param.getShapeParameters(layer), iRing*ringThickness[layer], (iRing+1)*ringThickness[layer]);
94 if (weight == 0 || weight < weightMax) {
95 break; // only add weights within a factor (range) of weightMax (say 10^6)
96 } else {
97 m_rankMap[1.0/weight] = RingId(layer, iRing);
98 }
99 }
100 }
101}
const std::vector< double > & getShapeParameters(eflowCaloENUM layer) const
double fudgeMean() const
double fudgeStdDev() const
static std::vector< eflowCaloENUM > orderedLayersByShowerParam(const eflowFirstIntParameters &param, unsigned int whichParam=0)
static double ringMeanRank(const std::vector< double > &p, double rMin, double rMax)
double ringThickness(eflowCaloENUM layer) const
std::pair< eflowCaloENUM, short > RingId

Member Data Documentation

◆ m_fudgeMean

double eflowRingSubtractionManager::m_fudgeMean {}
private

Definition at line 61 of file eflowRingSubtractionManager.h.

61{};

◆ m_fudgeStdDev

double eflowRingSubtractionManager::m_fudgeStdDev {}
private

Definition at line 62 of file eflowRingSubtractionManager.h.

62{};

◆ m_rankMap

std::map<double,RingId> eflowRingSubtractionManager::m_rankMap
private

Definition at line 59 of file eflowRingSubtractionManager.h.

◆ m_ringThickness

std::vector<double> eflowRingSubtractionManager::m_ringThickness
private

Definition at line 60 of file eflowRingSubtractionManager.h.

◆ m_rMax

double eflowRingSubtractionManager::m_rMax = 0.75
staticconstexprprivate

Definition at line 64 of file eflowRingSubtractionManager.h.

◆ m_weightRange

double eflowRingSubtractionManager::m_weightRange = 1.0e6
staticconstexprprivate

Definition at line 65 of file eflowRingSubtractionManager.h.


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