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-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef TrigConf_PrescaleSet
8#define TrigConf_PrescaleSet
9
11
12#include <vector>
13#include <string>
14#include <stdint.h>
15
21namespace TrigConf {
22
24 public:
25
26 static const int32_t maxPrescaleCut;
27
28 static int32_t getCutFromPrescale(double prescale);
29
30 static double getPrescaleFromCut(int32_t cut);
31
32 PrescaleSet() = default;
33 virtual ~PrescaleSet() override = default;
34
35 // Accessors
36 bool isNull() const { return m_null; }
37 const std::string& type() const { return m_Type; }
38 unsigned int partition() const { return m_Partition; }
39 const std::vector<int64_t>& prescales_ctp() const { return m_Prescales_ctp; }
40 const std::vector<float>& prescales_float() const { return m_Prescales_float; }
41 const std::vector<int32_t>& cuts() const { return m_Cuts; }
42
43 // Setters
44 void setType(const std::string& type) { m_Type = type; }
45 void setPartition(unsigned int partition) { m_Partition = partition; }
46
47 // setting of prescales
48 void resize(size_t size);
49 void setPrescale(unsigned int num, float prescaleValue);
50 void setCuts(const std::vector<int32_t>& cuts);
51 void setCut(unsigned int num, int32_t cut);
52
53 // reset all prescales to -1
54 void reset();
55
56 virtual void print(const std::string& indent="", unsigned int detail=1) const override;
57
58 void writeXML(std::ostream & xmlfile, int indentLevel = 0, int indentWidth = 2) const;
59
60 private:
61 bool m_null{true}; // false: indicates if the prescale set has been filled
62
63 std::string m_Type{"Physics"}; // the type of the prescale set, e.g. Physics, Standby, Cosmics, HighRate, VdM (case insensitive)
64 unsigned int m_Partition{0};
65 std::vector<int64_t> m_Prescales_ctp; // the 64bit representation.
66 std::vector<float> m_Prescales_float; // the float representation.
67 std::vector<int32_t> m_Cuts; // the cut
68
69 };
70
71}
72
73#endif
74
size_t size() const
Number of registered mappings.
static int32_t getCutFromPrescale(double prescale)
calculate cut value for hardware configuration cut = 2*24/prescale - 1
bool isNull() const
Definition PrescaleSet.h:36
const std::string & type() const
Definition PrescaleSet.h:37
void setCuts(const std::vector< int32_t > &cuts)
const std::vector< int64_t > & prescales_ctp() const
Definition PrescaleSet.h:39
virtual void print(const std::string &indent="", unsigned int detail=1) const override
void setPartition(unsigned int partition)
Definition PrescaleSet.h:45
const std::vector< float > & prescales_float() const
Definition PrescaleSet.h:40
virtual ~PrescaleSet() override=default
void setCut(unsigned int num, int32_t cut)
unsigned int partition() const
Definition PrescaleSet.h:38
const std::vector< int32_t > & cuts() const
Definition PrescaleSet.h:41
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)
static const int32_t maxPrescaleCut
Definition PrescaleSet.h:26
std::vector< int32_t > m_Cuts
Definition PrescaleSet.h:67
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:64
void setPrescale(unsigned int num, float prescaleValue)
void setType(const std::string &type)
Definition PrescaleSet.h:44
std::vector< float > m_Prescales_float
Definition PrescaleSet.h:66
void resize(size_t size)
std::vector< int64_t > m_Prescales_ctp
Definition PrescaleSet.h:65
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.