12#include <framework/logging/Logger.h>
13#include <boost/property_tree/ptree.hpp>
14#include <boost/property_tree/json_parser.hpp>
65 tree.get<
short>(
"FirstSuperLayer.ADC.max"));
67 tree.get<
short>(
"OuterSuperLayers.ADC.max"));
70 tree.get<
short>(
"FirstSuperLayer.TOT.max"));
72 tree.get<
short>(
"OuterSuperLayers.TOT.max"));
75 tree.get<
float>(
"FirstSuperLayer.ADCOverTOT.max"));
77 tree.get<
float>(
"OuterSuperLayers.ADCOverTOT.max"));
79 for (boost::property_tree::ptree::value_type& row : tree.get_child(
"FirstSuperLayer.MaxADCGivenTOT")) {
81 row.second.get<
short>(
"maxADC")));
83 for (boost::property_tree::ptree::value_type& row : tree.get_child(
"OuterSuperLayers.MaxADCGivenTOT")) {
85 row.second.get<
short>(
"maxADC")));
88 }
catch (boost::property_tree::ptree_error& e) {
90 B2FATAL(
"Cannot parse CDCWireHit requirement information: " << e.what());
229 std::string MaxADCGivenTOTFirstSuperLayer =
"";
231 MaxADCGivenTOTFirstSuperLayer +=
"If TOT == " + std::to_string(v.first) +
232 ", then ADC <= " + std::to_string(v.second) +
"\n";
235 std::string MaxADCGivenTOTOuterSuperLayers =
"";
237 MaxADCGivenTOTOuterSuperLayers +=
"If TOT == " + std::to_string(v.first) +
238 ", then ADC <= " + std::to_string(v.second) +
"\n";
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
249 << MaxADCGivenTOTFirstSuperLayer << std::endl
250 <<
"Outer Super Layers: " << std::endl
254 << MaxADCGivenTOTOuterSuperLayers
255 <<
"=======================================================" << std::endl);
Database object containing cut values to filter CDCWireHits.
const intRange_t & getTOTRangeFirstSuperLayer() 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.
intRange_t m_ADCRangeOuterSuperLayers
Allowed ADC range (outer super layers of CDC).
short getMaxADCGivenTOTOuterSuperLayers(short tot) const
Get maximum allowed ADC given TOT (outer super layers of CDC). An upper value of -1 stands for unboun...
void setADCOverTOTRangeOuterSuperLayers(const floatRange_t &ADCOverTOTRangeOuterSuperLayers)
Set allowed ADC/TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
CDCWireHitRequirements(boost::property_tree::ptree tree)
Constructor using a boost::property_tree.
void setTOTRangeOuterSuperLayers(const intRange_t &TOTRangeOuterSuperLayers)
Set allowed TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
floatRange_t m_ADCOverTOTRangeOuterSuperLayers
Allowed ADC/TOT range (outer super layers of CDC).
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 ...
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...
intRange_t m_ADCRangeFirstSuperLayer
Allowed ADC range (first super layer of CDC).
intRange_t m_TOTRangeFirstSuperLayer
Allowed TOT range (first super layer of CDC).
ClassDef(CDCWireHitRequirements, 2)
ROOT ClassDef.
std::map< short, short > m_MaxADCGivenTOTOuterSuperLayers
Map of conditions of the type: if TOT==x, then ADC<=y (outer super layers of CDC).
CDCWireHitRequirements()=default
Default constructor.
floatRange_t m_ADCOverTOTRangeFirstSuperLayer
Allowed ADC/TOT range (first super layer of CDC).
const intRange_t & getTOTRangeOuterSuperLayers() const
Get allowed TOT range (outer super layers of CDC). An upper value of -1 stands for unbounded.
std::pair< short, short > intRange_t
Integer range.
std::pair< float, float > floatRange_t
Float range.
std::map< short, short > m_MaxADCGivenTOTFirstSuperLayer
Map of conditions of the type: if TOT==x, then ADC<=y (first super layer of CDC).
void setADCRangeOuterSuperLayers(const intRange_t &ADCRangeOuterSuperLayers)
Set allowed ADC 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.
void setADCRangeFirstSuperLayer(const intRange_t &ADCRangeFirstSuperLayer)
Set allowed ADC range (first super layer of CDC). An upper value of -1 stands for unbounded.
intRange_t m_TOTRangeOuterSuperLayers
Allowed TOT range (outer super layers of CDC).
void setADCOverTOTRangeFirstSuperLayer(const floatRange_t &ADCOverTOTRangeFirstSuperLayer)
Set allowed ADC/TOT range (first super layer 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...
const floatRange_t & getADCOverTOTRangeFirstSuperLayer() const
Get allowed ADC/TOT range (first super layer of CDC). An upper value of -1 stands for unbounded.
~CDCWireHitRequirements()=default
Destructor.
void dump() const
Print content.
const intRange_t & getADCRangeFirstSuperLayer() const
Get allowed ADC range (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 unbound...
Abstract base class for different kinds of events.