ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GlobalSim::ERatio Class Reference

#include <ERatio.h>

Collaboration diagram for GlobalSim::ERatio:

Public Member Functions

 ERatio (const std::string &name, double thresh=50., double maxERCut=2.5)
 
virtual ~ERatio ()=default
 
StatusCode run (const LArStripNeighborhood &in, bool &result)
 
std::string toString () const
 

Private Member Functions

double secondaryPeakEnergy_forw (const StripDataVector &, std::size_t)
 
double secondaryPeakEnergy_back (const StripDataVector &, std::size_t)
 
bool eratioCut (double p_peakE, double s_peakE)
 

Private Attributes

std::string m_name {"ERatio_object"}
 
double m_minDeltaE {50.}
 
double m_maxERCut {2.5}
 

Detailed Description

Definition at line 25 of file ERatio.h.

Constructor & Destructor Documentation

◆ ERatio()

GlobalSim::ERatio::ERatio ( const std::string &  name,
double  thresh = 50.,
double  maxERCut = 2.5 
)

Definition at line 12 of file ERatio.cxx.

14  :
15  m_name{name}, m_minDeltaE{minDeltaE}, m_maxERCut{maxERCut} {
16  }

◆ ~ERatio()

virtual GlobalSim::ERatio::~ERatio ( )
virtualdefault

Member Function Documentation

◆ eratioCut()

bool GlobalSim::ERatio::eratioCut ( double  p_peakE,
double  s_peakE 
)
private

Definition at line 128 of file ERatio.cxx.

128  {
129 
130  if (p_peakE <= 0 or s_peakE <= 0) {return false;}
131 
132  return std::max(p_peakE, s_peakE)/std::min(p_peakE, s_peakE) < m_maxERCut;
133 
134  }

◆ run()

StatusCode GlobalSim::ERatio::run ( const LArStripNeighborhood in,
bool &  result 
)

Definition at line 19 of file ERatio.cxx.

19  {
20 
21  result = false;
22 
23  std::size_t maxCellInd = nbhd.maxCellIndex();
24  auto p_peakE = nbhd.phi_center().at(maxCellInd).m_e;
25 
26  for (const auto& ps : {nbhd.phi_center(),
27  nbhd.phi_low(),
28  nbhd.phi_high()}) {
29 
30  double s_peakE = secondaryPeakEnergy_forw(ps, maxCellInd);
31 
32  result = eratioCut(p_peakE, s_peakE);
33  if (result) {break;}
34 
35  s_peakE = secondaryPeakEnergy_back(ps, maxCellInd);
36 
37  result = eratioCut(p_peakE, s_peakE);
38 
39  if (result) {break;}
40  }
41 
42  return StatusCode::SUCCESS;
43  }

◆ secondaryPeakEnergy_back()

double GlobalSim::ERatio::secondaryPeakEnergy_back ( const StripDataVector phi_str,
std::size_t  maxCellInd 
)
private

Definition at line 85 of file ERatio.cxx.

86  {
87 
88 
89  /*
90  * Look for a secondary peak in the direction of decreasing eta
91  * starting at the eta location of the maximum energy strip.
92  */
93 
94 
95  constexpr double maxStripE{std::numeric_limits<double>::max()};
96  double peakE{0.};
97 
98  // eratio needs at least three elements
99  auto sz = maxCellInd;
100  if (sz < 2) {return peakE;}
101 
102  bool valley =
103  phi_str.at(maxCellInd-1).m_e < maxStripE - m_minDeltaE;
104 
105 
106  // calculate offset to point to 2 less than phi_str[maxCellInd]
107  std::size_t start = phi_str.size() - maxCellInd + 1;
108  for(auto iter = std::rbegin(phi_str)+start;
109  iter != std::rend(phi_str);
110  ++iter){
111 
112  if(!valley) {
113  valley = iter->m_e < ((iter-1)->m_e) - m_minDeltaE;
114  continue;
115  }
116 
117  auto c_cellE = iter->m_e;
118  auto p_cellE = (iter-1)->m_e;
119  if(c_cellE > p_cellE + m_minDeltaE) {
120  peakE = std::max(peakE, c_cellE);
121  }
122 
123  }
124  return peakE;
125  }

◆ secondaryPeakEnergy_forw()

double GlobalSim::ERatio::secondaryPeakEnergy_forw ( const StripDataVector phi_str,
std::size_t  maxCellInd 
)
private

Definition at line 46 of file ERatio.cxx.

47  {
48 
49  /*
50  * Look for a secondary peak in the direction of increasing eta
51  * starting at the eta location of the maximum energy strip.
52  */
53 
54  constexpr double maxStripE{std::numeric_limits<double>::max()};
55  double peakE{0.};
56 
57  // eratio needs at least three elements
58  auto sz = phi_str.size();
59  if (sz < 3 or maxCellInd > sz) {return peakE;}
60 
61  bool valley =
62  phi_str.at(maxCellInd+1).m_e < maxStripE - m_minDeltaE;
63 
64  for(auto iter = std::begin(phi_str)+maxCellInd+2;
65  iter != std::end(phi_str);
66  ++iter){
67 
68  if(!valley) {
69  valley = iter->m_e < ((iter-1)->m_e) - m_minDeltaE;
70  }
71 
72  if(valley) {
73  auto c_cellE = iter->m_e;
74  auto p_cellE = (iter-1)->m_e;
75  if(c_cellE > p_cellE + m_minDeltaE) {
76  peakE = std::max(peakE, c_cellE);
77  }
78  }
79 
80  }
81  return peakE;
82  }

◆ toString()

std::string GlobalSim::ERatio::toString ( ) const

Definition at line 136 of file ERatio.cxx.

136  {
137  std::stringstream ss;
138  ss << "ERatio. "
139  << " name: " << m_name
140  << " minimum strip E difference to be significant " << m_minDeltaE
141  << " upper ERatio limit for pi0 candidate " << m_maxERCut
142  << '\n';
143 
144  return ss.str();
145  }

Member Data Documentation

◆ m_maxERCut

double GlobalSim::ERatio::m_maxERCut {2.5}
private

Definition at line 43 of file ERatio.h.

◆ m_minDeltaE

double GlobalSim::ERatio::m_minDeltaE {50.}
private

Definition at line 42 of file ERatio.h.

◆ m_name

std::string GlobalSim::ERatio::m_name {"ERatio_object"}
private

Definition at line 41 of file ERatio.h.


The documentation for this class was generated from the following files:
fitman.sz
sz
Definition: fitman.py:527
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
GlobalSim::ERatio::m_maxERCut
double m_maxERCut
Definition: ERatio.h:43
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
GlobalSim::ERatio::secondaryPeakEnergy_back
double secondaryPeakEnergy_back(const StripDataVector &, std::size_t)
Definition: ERatio.cxx:85
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
GlobalSim::ERatio::secondaryPeakEnergy_forw
double secondaryPeakEnergy_forw(const StripDataVector &, std::size_t)
Definition: ERatio.cxx:46
GlobalSim::ERatio::m_name
std::string m_name
Definition: ERatio.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
GlobalSim::ERatio::m_minDeltaE
double m_minDeltaE
Definition: ERatio.h:42
GlobalSim::ERatio::eratioCut
bool eratioCut(double p_peakE, double s_peakE)
Definition: ERatio.cxx:128