ATLAS Offline Software
PrescaleSet.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TrigConf_PrescaleSet
8 #define TrigConf_PrescaleSet
9 
10 #include <vector>
11 #include <string>
13 #include <stdint.h>
14 
20 namespace TrigConf {
21 
22  class PrescaleSet : public L1DataBaseclass {
23  public:
24 
25  //static const unsigned int N_PRESCALES;
26 
27  static const int32_t maxPrescaleCut;
28 
29  static int32_t getCutFromPrescale(double prescale);
30 
31  static double getPrescaleFromCut(int32_t cut);
32 
33  PrescaleSet();
34  virtual ~PrescaleSet() override = default;
35 
36  // Accessors
37  bool isNull() const { return m_null; }
38  bool newPrescaleStyle() const { return m_newPrescales; }
39  const std::string& type() const { return m_Type; }
40  unsigned int partition() const { return m_Partition; }
41  const std::vector<int>& prescales() const __attribute__((deprecated)) { return m_Prescales; }
42  const std::vector<int64_t>& prescales_ctp() const { return m_Prescales_ctp; }
43  const std::vector<float>& prescales_float() const { return m_Prescales_float; }
44  const std::vector<int32_t>& cuts() const { return m_Cuts; }
45 
46  // Setters
47  void setNewPrescaleStyle(bool newstyle=true) { m_newPrescales = newstyle; }
48  void setType(const std::string& type) { m_Type = type; }
49  void setPartition(unsigned int partition) { m_Partition = partition; }
50 
51  // setting of prescales
52  void resize(size_t size);
53  void setPrescales(const std::vector<int64_t>&) __attribute__ ((deprecated));
54  void setPrescales(const int64_t p[], unsigned int size) __attribute__ ((deprecated));
55  void setPrescales(const int p[], unsigned int size) __attribute__ ((deprecated));
56  void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__ ((deprecated));
57  void setPrescale(unsigned int num, int prescaleValue) __attribute__ ((deprecated));
58  void setPrescale(unsigned int num, float prescaleValue);
59  void setCuts(const std::vector<int32_t>& cuts);
60  void setCut(unsigned int num, int32_t cut);
61 
62  // reset all prescales to -1
63  void reset();
64 
65  virtual void print(const std::string& indent="", unsigned int detail=1) const override;
66 
67  void writeXML(std::ostream & xmlfile, int indentLevel = 0, int indentWidth = 2) const;
68 
69  private:
70  bool m_null; // false: indicates if the prescale set has been filled
71 
72  bool m_newPrescales; // if true, new random prescale style will be used
73 
74  std::string m_Type; // the type of the prescale set, e.g. Physics, Standby, Cosmics, HighRate, VdM (case insensitive)
75  unsigned int m_Partition;
76  std::vector<int> m_Prescales;
77  std::vector<int64_t> m_Prescales_ctp; // the 64bit representation.
78  std::vector<float> m_Prescales_float; // the float representation.
79  std::vector<int32_t> m_Cuts; // the cut
80 
81  };
82 
83 }
84 
85 #endif
86 
TrigConf::PrescaleSet::m_Cuts
std::vector< int32_t > m_Cuts
Definition: PrescaleSet.h:79
TrigConf::PrescaleSet::partition
unsigned int partition() const
Definition: PrescaleSet.h:40
TrigConf::PrescaleSet::m_null
bool m_null
Definition: PrescaleSet.h:70
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TrigConf::PrescaleSet
Definition: PrescaleSet.h:22
TrigConf::PrescaleSet::setCuts
void setCuts(const std::vector< int32_t > &cuts)
Definition: PrescaleSet.cxx:89
TrigConf::PrescaleSet::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition: PrescaleSet.cxx:197
TrigConf::PrescaleSet::writeXML
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Writes the Prescale item to the XML file.
Definition: PrescaleSet.cxx:213
TrigConf::PrescaleSet::resize
void resize(size_t size)
Definition: PrescaleSet.cxx:80
TrigConf::PrescaleSet::setType
void setType(const std::string &type)
Definition: PrescaleSet.h:48
TrigConf::PrescaleSet::prescales_ctp
const std::vector< int64_t > & prescales_ctp() const
Definition: PrescaleSet.h:42
detail
Definition: extract_histogram_tag.cxx:14
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
TrigConf::PrescaleSet::PrescaleSet
PrescaleSet()
Definition: PrescaleSet.cxx:59
TrigConf::PrescaleSet::prescales_float
const std::vector< float > & prescales_float() const
Definition: PrescaleSet.h:43
TrigConf::PrescaleSet::m_newPrescales
bool m_newPrescales
Definition: PrescaleSet.h:72
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::PrescaleSet::prescales
const std::vector< int > & prescales() const __attribute__((deprecated))
Definition: PrescaleSet.h:41
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TrigConf::PrescaleSet::maxPrescaleCut
static const int32_t maxPrescaleCut
Definition: PrescaleSet.h:27
TrigConf::PrescaleSet::getPrescaleFromCut
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)
Definition: PrescaleSet.cxx:52
TrigConf::PrescaleSet::setPartition
void setPartition(unsigned int partition)
Definition: PrescaleSet.h:49
TrigConf::PrescaleSet::setNewPrescaleStyle
void setNewPrescaleStyle(bool newstyle=true)
Definition: PrescaleSet.h:47
TrigConf::PrescaleSet::setPrescale
void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__((deprecated))
Set the prescale NUM from the int64 value prescaleValue.
Definition: PrescaleSet.cxx:166
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
TrigConf::PrescaleSet::cuts
const std::vector< int32_t > & cuts() const
Definition: PrescaleSet.h:44
TrigConf::PrescaleSet::m_Prescales_ctp
std::vector< int64_t > m_Prescales_ctp
Definition: PrescaleSet.h:77
TrigConf::PrescaleSet::getCutFromPrescale
static int32_t getCutFromPrescale(double prescale)
calculate cut value for hardware configuration cut = 2*24/prescale - 1
Definition: PrescaleSet.cxx:33
TrigConf::PrescaleSet::type
const std::string & type() const
Definition: PrescaleSet.h:39
TrigConf::PrescaleSet::setCut
void setCut(unsigned int num, int32_t cut)
Definition: PrescaleSet.cxx:96
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
TrigConf::PrescaleSet::newPrescaleStyle
bool newPrescaleStyle() const
Definition: PrescaleSet.h:38
TrigConf::PrescaleSet::m_Prescales_float
std::vector< float > m_Prescales_float
Definition: PrescaleSet.h:78
TrigConf::PrescaleSet::m_Prescales
std::vector< int > m_Prescales
Definition: PrescaleSet.h:76
runJobs.deprecated
deprecated
Definition: runJobs.py:191
TrigConf::PrescaleSet::~PrescaleSet
virtual ~PrescaleSet() override=default
__attribute__
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
Definition: TileCalibDrawerBase.h:190
TrigConf::PrescaleSet::m_Partition
unsigned int m_Partition
Definition: PrescaleSet.h:75
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition: TrigConfData.cxx:23
TrigConf::PrescaleSet::setPrescales
void setPrescales(const std::vector< int64_t > &) __attribute__((deprecated))
DEPRECATED.
Definition: PrescaleSet.cxx:115
TrigConf::L1DataBaseclass
Definition: L1DataBaseclass.h:22
L1DataBaseclass.h
TrigConf::PrescaleSet::reset
void reset()
Definition: PrescaleSet.cxx:71
TrigConf::PrescaleSet::m_Type
std::string m_Type
Definition: PrescaleSet.h:74
TrigConf::PrescaleSet::isNull
bool isNull() const
Definition: PrescaleSet.h:37