Belle II Software development
CDCWireHitRequirements Class Reference

Database object containing cut values to filter CDCWireHits. More...

#include <CDCWireHitRequirements.h>

Inheritance diagram for CDCWireHitRequirements:

Public Member Functions

 CDCWireHitRequirements ()=default
 Default constructor.
 
 CDCWireHitRequirements (boost::property_tree::ptree tree)
 Constructor using a boost::property_tree.
 
 ~CDCWireHitRequirements ()=default
 Destructor.
 
const intRange_tgetADCRangeFirstSuperLayer () const
 Get allowed ADC range (first super layer of CDC). An upper value of -1 stands for unbounded.
 
void setADCRangeFirstSuperLayer (const intRange_t &ADCRangeFirstSuperLayer)
 Set allowed ADC range (first super layer of CDC). An upper value of -1 stands for unbounded.
 
const intRange_tgetADCRangeOuterSuperLayers () const
 Get allowed ADC range (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
void setADCRangeOuterSuperLayers (const intRange_t &ADCRangeOuterSuperLayers)
 Set allowed ADC range (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
const intRange_tgetTOTRangeFirstSuperLayer () const
 Get allowed TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.
 
void setTOTRangeFirstSuperLayer (const intRange_t &TOTRangeFirstSuperLayer)
 Set allowed TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.
 
const intRange_tgetTOTRangeOuterSuperLayers () const
 Get allowed TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
void setTOTRangeOuterSuperLayers (const intRange_t &TOTRangeOuterSuperLayers)
 Set allowed TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
const floatRange_tgetADCOverTOTRangeFirstSuperLayer () const
 Get allowed ADC/TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.
 
void setADCOverTOTRangeFirstSuperLayer (const floatRange_t &ADCOverTOTRangeFirstSuperLayer)
 Set allowed ADC/TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.
 
const floatRange_tgetADCOverTOTRangeOuterSuperLayers () const
 Get allowed ADC/TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
void setADCOverTOTRangeOuterSuperLayers (const floatRange_t &ADCOverTOTRangeOuterSuperLayers)
 Set allowed ADC/TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
const std::map< short, short > getMaxADCGivenTOTFirstSuperLayer () const
 Get map of maximum allowed ADC given TOT (first super layer of CDC). An upper value of -1 stands for unbounded.
 
short getMaxADCGivenTOTFirstSuperLayer (short tot) const
 Get maximum allowed ADC given TOT (first super layer of CDC). An upper value of -1 stands for unbounded.
 
void setMaxADCGivenTOTFirstSuperLayer (const std::map< short, short > &MaxADCGivenTOTFirstSuperLayer)
 Set map of maximum allowed ADC given TOT (first super layer of CDC). An upper value of -1 stands for unbounded.
 
const std::map< short, short > getMaxADCGivenTOTOuterSuperLayers () const
 Get map of maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
short getMaxADCGivenTOTOuterSuperLayers (short tot) const
 Get maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
void setMaxADCGivenTOTOuterSuperLayers (const std::map< short, short > &MaxADCGivenTOTOuterSuperLayers)
 Set map of maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for unbounded.
 
void dump () const
 Print content.
 

Private Types

typedef std::pair< short, short > intRange_t
 Integer range.
 
typedef std::pair< float, float > floatRange_t
 Float range.
 

Private Member Functions

 ClassDef (CDCWireHitRequirements, 2)
 ROOT ClassDef.
 

Private Attributes

intRange_t m_ADCRangeFirstSuperLayer = {1, -1}
 Allowed ADC range (first super layer of CDC).
 
intRange_t m_ADCRangeOuterSuperLayers = {1, -1}
 Allowed ADC range (outer super layers of CDC).
 
intRange_t m_TOTRangeFirstSuperLayer = {1, -1}
 Allowed TOT range (first super layer of CDC).
 
intRange_t m_TOTRangeOuterSuperLayers = {1, -1}
 Allowed TOT range (outer super layers of CDC).
 
floatRange_t m_ADCOverTOTRangeFirstSuperLayer = {0.0, -1.0}
 Allowed ADC/TOT range (first super layer of CDC).
 
floatRange_t m_ADCOverTOTRangeOuterSuperLayers = {0.0, -1.0}
 Allowed ADC/TOT range (outer super layers of CDC).
 
std::map< short, short > m_MaxADCGivenTOTFirstSuperLayer = {}
 Map of conditions of the type: if TOT==x, then ADC<=y (first super layer of CDC).
 
std::map< short, short > m_MaxADCGivenTOTOuterSuperLayers = {}
 Map of conditions of the type: if TOT==x, then ADC<=y (outer super layers of CDC).
 

Detailed Description

Database object containing cut values to filter CDCWireHits.

The set of conditions is: {minADC<=ADC<=maxADC, minTOT<=TOT<=maxTOT, minADCOverTOT<=ADC/TOT<=maxACDOverTOT, if TOT==x, then ADC<=y (std::map)}. The first super layer of the CDC can have specific requirements. The other super layers of the CDC (outer super layers) share a single set of conditions. In the allowed range for ADC, TOT, ..., an upper value of -1 stands for unbounded. For example, the ADC range {5,-1} accepts all the hits with ADC>=5.

Definition at line 34 of file CDCWireHitRequirements.h.

Member Typedef Documentation

◆ floatRange_t

typedef std::pair<float, float> floatRange_t
private

Float range.

The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range. An upper value of -1 stands for unbounded.

Definition at line 47 of file CDCWireHitRequirements.h.

◆ intRange_t

typedef std::pair<short, short> intRange_t
private

Integer range.

The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range. An upper value of -1 stands for unbounded.

Definition at line 41 of file CDCWireHitRequirements.h.

Constructor & Destructor Documentation

◆ CDCWireHitRequirements()

CDCWireHitRequirements ( boost::property_tree::ptree  tree)
inlineexplicit

Constructor using a boost::property_tree.

Definition at line 59 of file CDCWireHitRequirements.h.

60 {
61
62 try {
63
64 m_ADCRangeFirstSuperLayer = std::make_pair(tree.get<short>("FirstSuperLayer.ADC.min"),
65 tree.get<short>("FirstSuperLayer.ADC.max"));
66 m_ADCRangeOuterSuperLayers = std::make_pair(tree.get<short>("OuterSuperLayers.ADC.min"),
67 tree.get<short>("OuterSuperLayers.ADC.max"));
68
69 m_TOTRangeFirstSuperLayer = std::make_pair(tree.get<short>("FirstSuperLayer.TOT.min"),
70 tree.get<short>("FirstSuperLayer.TOT.max"));
71 m_TOTRangeOuterSuperLayers = std::make_pair(tree.get<short>("OuterSuperLayers.TOT.min"),
72 tree.get<short>("OuterSuperLayers.TOT.max"));
73
74 m_ADCOverTOTRangeFirstSuperLayer = std::make_pair(tree.get<float>("FirstSuperLayer.ADCOverTOT.min"),
75 tree.get<float>("FirstSuperLayer.ADCOverTOT.max"));
76 m_ADCOverTOTRangeOuterSuperLayers = std::make_pair(tree.get<float>("OuterSuperLayers.ADCOverTOT.min"),
77 tree.get<float>("OuterSuperLayers.ADCOverTOT.max"));
78
79 for (boost::property_tree::ptree::value_type& row : tree.get_child("FirstSuperLayer.MaxADCGivenTOT")) {
80 m_MaxADCGivenTOTFirstSuperLayer.insert(std::make_pair(row.second.get<short>("givenTOT"),
81 row.second.get<short>("maxADC")));
82 }
83 for (boost::property_tree::ptree::value_type& row : tree.get_child("OuterSuperLayers.MaxADCGivenTOT")) {
84 m_MaxADCGivenTOTOuterSuperLayers.insert(std::make_pair(row.second.get<short>("givenTOT"),
85 row.second.get<short>("maxADC")));
86 }
87
88 } catch (boost::property_tree::ptree_error& e) {
89 // Any problem when parsing the tree?
90 B2FATAL("Cannot parse CDCWireHit requirement information: " << e.what());
91 }
92
93 }
intRange_t m_ADCRangeOuterSuperLayers
Allowed ADC range (outer super layers of CDC).
floatRange_t m_ADCOverTOTRangeOuterSuperLayers
Allowed ADC/TOT range (outer super layers of CDC).
intRange_t m_ADCRangeFirstSuperLayer
Allowed ADC range (first super layer of CDC).
intRange_t m_TOTRangeFirstSuperLayer
Allowed TOT range (first super layer of CDC).
std::map< short, short > m_MaxADCGivenTOTOuterSuperLayers
Map of conditions of the type: if TOT==x, then ADC<=y (outer super layers of CDC).
floatRange_t m_ADCOverTOTRangeFirstSuperLayer
Allowed ADC/TOT range (first super layer of CDC).
std::map< short, short > m_MaxADCGivenTOTFirstSuperLayer
Map of conditions of the type: if TOT==x, then ADC<=y (first super layer of CDC).
intRange_t m_TOTRangeOuterSuperLayers
Allowed TOT range (outer super layers of CDC).

Member Function Documentation

◆ dump()

void dump ( ) const
inline

Print content.

Definition at line 227 of file CDCWireHitRequirements.h.

228 {
229 std::string MaxADCGivenTOTFirstSuperLayer = "";
230 for (auto& v : getMaxADCGivenTOTFirstSuperLayer()) {
231 MaxADCGivenTOTFirstSuperLayer += "If TOT == " + std::to_string(v.first) +
232 ", then ADC <= " + std::to_string(v.second) + "\n";
233 }
234
235 std::string MaxADCGivenTOTOuterSuperLayers = "";
236 for (auto& v : getMaxADCGivenTOTOuterSuperLayers()) {
237 MaxADCGivenTOTOuterSuperLayers += "If TOT == " + std::to_string(v.first) +
238 ", then ADC <= " + std::to_string(v.second) + "\n";
239 }
240
241 B2INFO(" " << std::endl
242 << "=======================================================" << std::endl
243 << "CDCWireHit requirements (-1 values stand for unbounded)" << std::endl
244 << "=======================================================" << std::endl
245 << "First Super Layer: " << std::endl
246 << getADCRangeFirstSuperLayer().first << " <= ADC <= " << getADCRangeFirstSuperLayer().second << std::endl
247 << getTOTRangeFirstSuperLayer().first << " <= TOT <= " << getTOTRangeFirstSuperLayer().second << std::endl
248 << getADCOverTOTRangeFirstSuperLayer().first << " <= ADC/TOT <= " << getADCOverTOTRangeFirstSuperLayer().second << std::endl
249 << MaxADCGivenTOTFirstSuperLayer << std::endl
250 << "Outer Super Layers: " << std::endl
251 << getADCRangeOuterSuperLayers().first << " <= ADC <= " << getADCRangeOuterSuperLayers().second << std::endl
252 << getTOTRangeOuterSuperLayers().first << " <= TOT <= " << getTOTRangeOuterSuperLayers().second << std::endl
253 << getADCOverTOTRangeOuterSuperLayers().first << " <= ADC/TOT <= " << getADCOverTOTRangeOuterSuperLayers().second << std::endl
254 << MaxADCGivenTOTOuterSuperLayers
255 << "=======================================================" << std::endl);
256
257 }
const intRange_t & getTOTRangeFirstSuperLayer() const
Get allowed TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.
const intRange_t & getADCRangeOuterSuperLayers() const
Get allowed ADC range (outer super layers of CDC). An upper value of -1 stands for unbounded.
const std::map< short, short > getMaxADCGivenTOTOuterSuperLayers() const
Get map of maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for...
const intRange_t & getTOTRangeOuterSuperLayers() const
Get allowed TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
const std::map< short, short > getMaxADCGivenTOTFirstSuperLayer() const
Get map of maximum allowed ADC given TOT (first super layer of CDC). An upper value of -1 stands for ...
const floatRange_t & getADCOverTOTRangeOuterSuperLayers() const
Get allowed ADC/TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
const floatRange_t & getADCOverTOTRangeFirstSuperLayer() const
Get allowed ADC/TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.
const intRange_t & getADCRangeFirstSuperLayer() const
Get allowed ADC range (first super layer of CDC). An upper value of -1 stands for unbounded.

◆ getADCOverTOTRangeFirstSuperLayer()

const floatRange_t & getADCOverTOTRangeFirstSuperLayer ( ) const
inline

Get allowed ADC/TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 149 of file CDCWireHitRequirements.h.

150 {
152 }

◆ getADCOverTOTRangeOuterSuperLayers()

const floatRange_t & getADCOverTOTRangeOuterSuperLayers ( ) const
inline

Get allowed ADC/TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 161 of file CDCWireHitRequirements.h.

162 {
164 }

◆ getADCRangeFirstSuperLayer()

const intRange_t & getADCRangeFirstSuperLayer ( ) const
inline

Get allowed ADC range (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 101 of file CDCWireHitRequirements.h.

102 {
104 }

◆ getADCRangeOuterSuperLayers()

const intRange_t & getADCRangeOuterSuperLayers ( ) const
inline

Get allowed ADC range (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 113 of file CDCWireHitRequirements.h.

114 {
116 }

◆ getMaxADCGivenTOTFirstSuperLayer() [1/2]

const std::map< short, short > getMaxADCGivenTOTFirstSuperLayer ( ) const
inline

Get map of maximum allowed ADC given TOT (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 173 of file CDCWireHitRequirements.h.

174 {
176 }

◆ getMaxADCGivenTOTFirstSuperLayer() [2/2]

short getMaxADCGivenTOTFirstSuperLayer ( short  tot) const
inline

Get maximum allowed ADC given TOT (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 179 of file CDCWireHitRequirements.h.

180 {
181 // Find maxADC given TOT
182 const auto it = m_MaxADCGivenTOTFirstSuperLayer.find(tot);
183
184 // Check if TOT exists in map or not
185 if (it != m_MaxADCGivenTOTFirstSuperLayer.end()) {
186 return it->second;
187 } else {
188 // By convention, -1 stands for unbounded
189 return -1;
190 }
191 }

◆ getMaxADCGivenTOTOuterSuperLayers() [1/2]

const std::map< short, short > getMaxADCGivenTOTOuterSuperLayers ( ) const
inline

Get map of maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 200 of file CDCWireHitRequirements.h.

201 {
203 }

◆ getMaxADCGivenTOTOuterSuperLayers() [2/2]

short getMaxADCGivenTOTOuterSuperLayers ( short  tot) const
inline

Get maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 206 of file CDCWireHitRequirements.h.

207 {
208 // Find maxADC given TOT
209 const auto it = m_MaxADCGivenTOTOuterSuperLayers.find(tot);
210
211 // Check if TOT exists in map or not
212 if (it != m_MaxADCGivenTOTOuterSuperLayers.end()) {
213 return it->second;
214 } else {
215 // By convention, -1 stands for unbounded
216 return -1;
217 }
218 }

◆ getTOTRangeFirstSuperLayer()

const intRange_t & getTOTRangeFirstSuperLayer ( ) const
inline

Get allowed TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 125 of file CDCWireHitRequirements.h.

126 {
128 }

◆ getTOTRangeOuterSuperLayers()

const intRange_t & getTOTRangeOuterSuperLayers ( ) const
inline

Get allowed TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 137 of file CDCWireHitRequirements.h.

138 {
140 }

◆ setADCOverTOTRangeFirstSuperLayer()

void setADCOverTOTRangeFirstSuperLayer ( const floatRange_t ADCOverTOTRangeFirstSuperLayer)
inline

Set allowed ADC/TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 155 of file CDCWireHitRequirements.h.

156 {
157 m_ADCOverTOTRangeFirstSuperLayer = ADCOverTOTRangeFirstSuperLayer;
158 }

◆ setADCOverTOTRangeOuterSuperLayers()

void setADCOverTOTRangeOuterSuperLayers ( const floatRange_t ADCOverTOTRangeOuterSuperLayers)
inline

Set allowed ADC/TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 167 of file CDCWireHitRequirements.h.

168 {
169 m_ADCOverTOTRangeOuterSuperLayers = ADCOverTOTRangeOuterSuperLayers;
170 }

◆ setADCRangeFirstSuperLayer()

void setADCRangeFirstSuperLayer ( const intRange_t ADCRangeFirstSuperLayer)
inline

Set allowed ADC range (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 107 of file CDCWireHitRequirements.h.

108 {
109 m_ADCRangeFirstSuperLayer = ADCRangeFirstSuperLayer;
110 }

◆ setADCRangeOuterSuperLayers()

void setADCRangeOuterSuperLayers ( const intRange_t ADCRangeOuterSuperLayers)
inline

Set allowed ADC range (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 119 of file CDCWireHitRequirements.h.

120 {
121 m_ADCRangeOuterSuperLayers = ADCRangeOuterSuperLayers;
122 }

◆ setMaxADCGivenTOTFirstSuperLayer()

void setMaxADCGivenTOTFirstSuperLayer ( const std::map< short, short > &  MaxADCGivenTOTFirstSuperLayer)
inline

Set map of maximum allowed ADC given TOT (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 194 of file CDCWireHitRequirements.h.

195 {
196 m_MaxADCGivenTOTFirstSuperLayer = MaxADCGivenTOTFirstSuperLayer;
197 }

◆ setMaxADCGivenTOTOuterSuperLayers()

void setMaxADCGivenTOTOuterSuperLayers ( const std::map< short, short > &  MaxADCGivenTOTOuterSuperLayers)
inline

Set map of maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 221 of file CDCWireHitRequirements.h.

222 {
223 m_MaxADCGivenTOTOuterSuperLayers = MaxADCGivenTOTOuterSuperLayers;
224 }

◆ setTOTRangeFirstSuperLayer()

void setTOTRangeFirstSuperLayer ( const intRange_t TOTRangeFirstSuperLayer)
inline

Set allowed TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.

Definition at line 131 of file CDCWireHitRequirements.h.

132 {
133 m_TOTRangeFirstSuperLayer = TOTRangeFirstSuperLayer;
134 }

◆ setTOTRangeOuterSuperLayers()

void setTOTRangeOuterSuperLayers ( const intRange_t TOTRangeOuterSuperLayers)
inline

Set allowed TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.

Definition at line 143 of file CDCWireHitRequirements.h.

144 {
145 m_TOTRangeOuterSuperLayers = TOTRangeOuterSuperLayers;
146 }

Member Data Documentation

◆ m_ADCOverTOTRangeFirstSuperLayer

floatRange_t m_ADCOverTOTRangeFirstSuperLayer = {0.0, -1.0}
private

Allowed ADC/TOT range (first super layer of CDC).

An upper value of -1 stands for unbounded. The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range.

Definition at line 282 of file CDCWireHitRequirements.h.

◆ m_ADCOverTOTRangeOuterSuperLayers

floatRange_t m_ADCOverTOTRangeOuterSuperLayers = {0.0, -1.0}
private

Allowed ADC/TOT range (outer super layers of CDC).

An upper value of -1 stands for unbounded. The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range.

Definition at line 286 of file CDCWireHitRequirements.h.

◆ m_ADCRangeFirstSuperLayer

intRange_t m_ADCRangeFirstSuperLayer = {1, -1}
private

Allowed ADC range (first super layer of CDC).

An upper value of -1 stands for unbounded. The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range.

Definition at line 264 of file CDCWireHitRequirements.h.

◆ m_ADCRangeOuterSuperLayers

intRange_t m_ADCRangeOuterSuperLayers = {1, -1}
private

Allowed ADC range (outer super layers of CDC).

An upper value of -1 stands for unbounded. The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range.

Definition at line 268 of file CDCWireHitRequirements.h.

◆ m_MaxADCGivenTOTFirstSuperLayer

std::map<short, short> m_MaxADCGivenTOTFirstSuperLayer = {}
private

Map of conditions of the type: if TOT==x, then ADC<=y (first super layer of CDC).

An upper value of -1 stands for unbounded. The first value is the given TOT, the second value is the maximum ADC. The upper bound is included in the allowed range.

Definition at line 291 of file CDCWireHitRequirements.h.

◆ m_MaxADCGivenTOTOuterSuperLayers

std::map<short, short> m_MaxADCGivenTOTOuterSuperLayers = {}
private

Map of conditions of the type: if TOT==x, then ADC<=y (outer super layers of CDC).

An upper value of -1 stands for unbounded. The first value is the given TOT, the second value is the maximum ADC. The upper bound is included in the allowed range.

Definition at line 295 of file CDCWireHitRequirements.h.

◆ m_TOTRangeFirstSuperLayer

intRange_t m_TOTRangeFirstSuperLayer = {1, -1}
private

Allowed TOT range (first super layer of CDC).

An upper value of -1 stands for unbounded. The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range.

Definition at line 273 of file CDCWireHitRequirements.h.

◆ m_TOTRangeOuterSuperLayers

intRange_t m_TOTRangeOuterSuperLayers = {1, -1}
private

Allowed TOT range (outer super layers of CDC).

An upper value of -1 stands for unbounded. The first value is the lower bound, the second value is the upper bound. The two bounds are included in the allowed range.

Definition at line 277 of file CDCWireHitRequirements.h.


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