ATLAS Offline Software
Loading...
Searching...
No Matches
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
20namespace TrigConf {
21
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
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
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
static int32_t getCutFromPrescale(double prescale)
calculate cut value for hardware configuration cut = 2*24/prescale - 1
bool isNull() const
Definition PrescaleSet.h:37
const std::string & type() const
Definition PrescaleSet.h:39
void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__((deprecated))
Set the prescale NUM from the int64 value prescaleValue.
void setCuts(const std::vector< int32_t > &cuts)
bool newPrescaleStyle() const
Definition PrescaleSet.h:38
const std::vector< int > & prescales() const __attribute__((deprecated))
Definition PrescaleSet.h:41
const std::vector< int64_t > & prescales_ctp() const
Definition PrescaleSet.h:42
virtual void print(const std::string &indent="", unsigned int detail=1) const override
void setPartition(unsigned int partition)
Definition PrescaleSet.h:49
const std::vector< float > & prescales_float() const
Definition PrescaleSet.h:43
virtual ~PrescaleSet() override=default
void setPrescales(const std::vector< int64_t > &) __attribute__((deprecated))
DEPRECATED.
void setCut(unsigned int num, int32_t cut)
unsigned int partition() const
Definition PrescaleSet.h:40
const std::vector< int32_t > & cuts() const
Definition PrescaleSet.h:44
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)
static const int32_t maxPrescaleCut
Definition PrescaleSet.h:27
std::vector< int32_t > m_Cuts
Definition PrescaleSet.h:79
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Writes the Prescale item to the XML file.
unsigned int m_Partition
Definition PrescaleSet.h:75
void setType(const std::string &type)
Definition PrescaleSet.h:48
std::vector< float > m_Prescales_float
Definition PrescaleSet.h:78
void resize(size_t size)
std::vector< int > m_Prescales
Definition PrescaleSet.h:76
std::vector< int64_t > m_Prescales_ctp
Definition PrescaleSet.h:77
void setNewPrescaleStyle(bool newstyle=true)
Definition PrescaleSet.h:47
std::ostream & indent(std::ostream &o, int lvl, int size) const
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22