ATLAS Offline Software
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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();}

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

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

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

◆ setFudgeMean()

void eflowRingSubtractionManager::setFudgeMean ( double  fudgeMean)
inline

Definition at line 40 of file eflowRingSubtractionManager.h.

◆ setFudgeStdDev()

void eflowRingSubtractionManager::setFudgeStdDev ( double  fudgeStdDev)
inline

Definition at line 41 of file eflowRingSubtractionManager.h.

◆ 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++) {
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 }

Member Data Documentation

◆ m_fudgeMean

double eflowRingSubtractionManager::m_fudgeMean {}
private

Definition at line 61 of file eflowRingSubtractionManager.h.

◆ m_fudgeStdDev

double eflowRingSubtractionManager::m_fudgeStdDev {}
private

Definition at line 62 of file eflowRingSubtractionManager.h.

◆ 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

constexpr double eflowRingSubtractionManager::m_rMax = 0.75
staticconstexprprivate

Definition at line 64 of file eflowRingSubtractionManager.h.

◆ m_weightRange

constexpr 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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
eflowRingSubtractionManager::setParameters
void setParameters(const eflowFirstIntParameters &param, const std::vector< double > &ringThickness)
Definition: eflowRingSubtractionManager.cxx:75
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
eflowCalo::Unknown
@ Unknown
Definition: eflowCaloRegions.h:50
eflowRingSubtractionManager::m_ringThickness
std::vector< double > m_ringThickness
Definition: eflowRingSubtractionManager.h:60
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
eflowRingSubtractionManager::orderedLayersByShowerParam
static std::vector< eflowCaloENUM > orderedLayersByShowerParam(const eflowFirstIntParameters &param, unsigned int whichParam=0)
Definition: eflowRingSubtractionManager.cxx:42
eflowRingSubtractionManager::fudgeStdDev
double fudgeStdDev() const
Definition: eflowRingSubtractionManager.h:38
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
eflowRingSubtractionManager::m_fudgeMean
double m_fudgeMean
Definition: eflowRingSubtractionManager.h:61
eflowFirstIntParameters::getWeightedParameters
bool getWeightedParameters(const eflowFirstIntParameters *bin1, const eflowFirstIntParameters *bin2, const double w1)
Definition: eflowFirstIntParameters.cxx:31
beamspotman.isFailed
bool isFailed
Definition: beamspotman.py:1042
eflowFirstInt::fudgeStdDev
double fudgeStdDev() const
Definition: eflowFirstInt.h:40
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
eflowRingThicknesses::ringThickness
static double ringThickness(const eflowCaloENUM &layer)
Definition: eflowRingThicknesses.cxx:5
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
eflowRingSubtractionManager::fudgeMean
double fudgeMean() const
Definition: eflowRingSubtractionManager.h:37
eflowFirstIntParameters::getShapeParameters
const std::vector< double > & getShapeParameters(eflowCaloENUM layer) const
Definition: eflowFirstIntParameters.h:45
eflowParameters
Definition: eflowEEtaBinnedParameters.h:30
bin2
Definition: KillBinsByStrip.h:34
eflowRingSubtractionManager::ringMeanRank
static double ringMeanRank(const std::vector< double > &p, double rMin, double rMax)
Definition: eflowRingSubtractionManager.cxx:29
eflowEEtaBinnedParameters::adjustLFI
eflowFirstIntENUM adjustLFI(double e, double eta, eflowFirstIntENUM j1st, bool useLegacyEnergyBinIndexing) const
Definition: eflowEEtaBinnedParameters.cxx:109
eflowRingSubtractionManager::m_fudgeStdDev
double m_fudgeStdDev
Definition: eflowRingSubtractionManager.h:62
eflowFirstInt::fudgeMean
double fudgeMean() const
Definition: eflowFirstInt.h:39
eflowCalo::nRegions
static const int nRegions
Definition: eflowCaloRegions.h:45
RingId
std::pair< eflowCaloENUM, short > RingId
Definition: eflowRingSubtractionManager.h:24
eflowRingSubtractionManager::m_weightRange
static constexpr double m_weightRange
Definition: eflowRingSubtractionManager.h:65
eflowCalo::LAYER
LAYER
Definition: eflowCaloRegions.h:36
dqt_zlumi_pandas.bin1
bin1
Definition: dqt_zlumi_pandas.py:336
eflowRingSubtractionManager::m_rankMap
std::map< double, RingId > m_rankMap
Definition: eflowRingSubtractionManager.h:59
eflowFirstIntParameters::getShapeParameter
double getShapeParameter(eflowCaloENUM layer, int paramIndex) const
Definition: eflowFirstIntParameters.h:46
eflowRingSubtractionManager::m_rMax
static constexpr double m_rMax
Definition: eflowRingSubtractionManager.h:64
eflowFirstIntParameters
Extends eflowFirstInt to include parameters of the fits to radial shower profiles.
Definition: eflowFirstIntParameters.h:28
TRTCalib_cfilter.p0
p0
Definition: TRTCalib_cfilter.py:129
eflowRingSubtractionManager::ringThickness
double ringThickness(eflowCaloENUM layer) const
Definition: eflowRingSubtractionManager.h:47
eflowEEtaBinnedParameters::getInterpolation
double getInterpolation(const eflowParameters **bin1, const eflowParameters **bin2, double e, double eta, bool useLegacyEnergyBinIndexing) const
Definition: eflowEEtaBinnedParameters.cxx:52
eflowFirstIntRegions::J1STLAYER
J1STLAYER
Definition: eflowCaloRegions.h:58