CMS 3D CMS Logo

GlobalParamsHelper.h
Go to the documentation of this file.
1 #ifndef GLOBALPARAMSHELPER_H__
2 #define GLOBALPARAMSHELPER_H__
3 
4 #include <cassert>
7 
8 // If you want to create a new object that you can read and write, use this constructor:
9 //
10 // l1t::GlobalParamsHelper x(new L1TPrescalesVetors());
11 //
12 // If you wish to read the table from the EventSetup, and will only read, use this:
13 //
14 // const GlobalParamsHelper * x = GlobalParamsHelper::readFromEventSetup(...)
15 // //...
16 // delete x;
17 //
18 // If you wish to read the table from the EventSetup, but then be able to edit the values locally, use this:
19 //
20 // GlobalParamsHelper * x = GlobalParamsHelper::readAndWriteFromEventSetup(...)
21 // //...
23 //
24 // but there's a performance penalty as a copy is made.
25 
26 //
27 // This class does not take over responsibility for deleting the pointers it is
28 // initialized with. That is responsibility of the calling code.
29 //
30 
31 namespace l1t {
32 
34  public:
35  enum { VERSION = 1 };
36 
38 
39  //ctor if creating a new table (e.g. from XML or python file)
41  //create for reading only, from the EventSetup:
43  // create for reading and writing, starting from the EventSetup:
45 
46  //int bxMaskDefault() const { return read_->bxmask_default_; };
47  //void setBxMaskDefault(int value) { check_write(); write_->bxmask_default_ = value; };
48 
50  inline int totalBxInEvent() const { return read_->m_totalBxInEvent; }
51 
52  void setTotalBxInEvent(const int&);
53 
55  inline unsigned int numberPhysTriggers() const { return read_->m_numberPhysTriggers; }
56 
57  void setNumberPhysTriggers(const unsigned int&);
58 
60  inline unsigned int numberL1Mu() const { return read_->m_numberL1Mu; }
61 
62  void setNumberL1Mu(const unsigned int&);
63 
65  inline unsigned int numberL1EG() const { return read_->m_numberL1EG; }
66 
67  void setNumberL1EG(const unsigned int&);
68 
70  inline unsigned int numberL1Jet() const { return read_->m_numberL1Jet; }
71 
72  void setNumberL1Jet(const unsigned int&);
73 
75  inline unsigned int numberL1Tau() const { return read_->m_numberL1Tau; }
76 
77  void setNumberL1Tau(const unsigned int&);
78 
80  inline unsigned int numberChips() const { return read_->m_numberChips; }
81 
82  void setNumberChips(const unsigned int&);
83 
85  inline unsigned int pinsOnChip() const { return read_->m_pinsOnChip; }
86 
87  void setPinsOnChip(const unsigned int&);
88 
91  inline const std::vector<int>& orderOfChip() const { return read_->m_orderOfChip; }
92 
93  void setOrderOfChip(const std::vector<int>&);
94 
96  void print(std::ostream&) const;
97 
98  // access to underlying pointers, mainly for ESProducer:
99  const L1TGlobalParameters* getReadInstance() const { return read_; }
101 
102  private:
104  void useCopy();
105  void check_write() { assert(write_); }
106  // separating read from write allows for a high-performance read-only mode (as no copy is made):
107  const L1TGlobalParameters* read_; // when reading/getting, use this.
108  L1TGlobalParameters* write_; // when writing/setting, use this.
110  };
111 
112 } // namespace l1t
113 #endif
l1t::GlobalParamsHelper::setNumberPhysTriggers
void setNumberPhysTriggers(const unsigned int &)
Definition: GlobalParamsHelper.cc:46
l1t::GlobalParamsHelper::VERSION
Definition: GlobalParamsHelper.h:35
l1t::GlobalParamsHelper::setNumberL1Jet
void setNumberL1Jet(const unsigned int &)
Definition: GlobalParamsHelper.cc:64
l1t::GlobalParamsHelper::numberL1Jet
unsigned int numberL1Jet() const
get / set the number of L1 jets received by GT
Definition: GlobalParamsHelper.h:70
l1t::GlobalParamsHelper::totalBxInEvent
int totalBxInEvent() const
get / set the number of bx in hardware
Definition: GlobalParamsHelper.h:50
l1t::GlobalParamsHelper::getWriteInstance
L1TGlobalParameters * getWriteInstance()
Definition: GlobalParamsHelper.h:100
L1TGlobalParameters::m_numberL1Jet
unsigned int m_numberL1Jet
jets
Definition: L1TGlobalParameters.h:31
L1TGlobalParametersRcd.h
l1t::GlobalParamsHelper::numberL1EG
unsigned int numberL1EG() const
get / set the number of L1 e/gamma objects received by GT
Definition: GlobalParamsHelper.h:65
cms::cuda::assert
assert(be >=bs)
L1TGlobalParameters::m_orderOfChip
std::vector< int > m_orderOfChip
correspondence "condition chip - GTL algorithm word" in the hardware
Definition: L1TGlobalParameters.h:45
L1TGlobalParameters::m_numberL1Tau
unsigned int m_numberL1Tau
taus
Definition: L1TGlobalParameters.h:34
l1t::GlobalParamsHelper::setOrderOfChip
void setOrderOfChip(const std::vector< int > &)
Definition: GlobalParamsHelper.cc:91
L1TGlobalParameters::m_numberL1EG
unsigned int m_numberL1EG
e/gamma objects
Definition: L1TGlobalParameters.h:28
l1t::GlobalParamsHelper::useCopy
void useCopy()
Definition: GlobalParamsHelper.cc:28
L1TGlobalParameters
Definition: L1TGlobalParameters.h:7
l1t::GlobalParamsHelper::~GlobalParamsHelper
~GlobalParamsHelper()
Definition: GlobalParamsHelper.cc:34
l1t::GlobalParamsHelper::setNumberL1Mu
void setNumberL1Mu(const unsigned int &)
Definition: GlobalParamsHelper.cc:52
l1t::GlobalParamsHelper::write_
L1TGlobalParameters * write_
Definition: GlobalParamsHelper.h:108
w
const double w
Definition: UKUtility.cc:23
l1t::GlobalParamsHelper::readFromEventSetup
static const GlobalParamsHelper * readFromEventSetup(const L1TGlobalParameters *es)
Definition: GlobalParamsHelper.cc:5
L1TGlobalParameters::m_totalBxInEvent
int m_totalBxInEvent
bx in event
Definition: L1TGlobalParameters.h:15
l1t::GlobalParamsHelper::check_write
void check_write()
Definition: GlobalParamsHelper.h:105
l1t::GlobalParamsHelper::orderOfChip
const std::vector< int > & orderOfChip() const
Definition: GlobalParamsHelper.h:91
l1t::GlobalParamsHelper::setNumberL1EG
void setNumberL1EG(const unsigned int &)
Definition: GlobalParamsHelper.cc:58
L1TGlobalParameters.h
l1t::GlobalParamsHelper
Definition: GlobalParamsHelper.h:33
l1t::GlobalParamsHelper::numberChips
unsigned int numberChips() const
get / set the number of condition chips in GTL
Definition: GlobalParamsHelper.h:80
l1t::GlobalParamsHelper::GlobalParamsHelper
GlobalParamsHelper(L1TGlobalParameters *w)
Definition: GlobalParamsHelper.cc:15
l1t
delete x;
Definition: CaloConfig.h:22
l1t::GlobalParamsHelper::numberPhysTriggers
unsigned int numberPhysTriggers() const
get / set the number of physics trigger algorithms
Definition: GlobalParamsHelper.h:55
l1t::GlobalParamsHelper::print
void print(std::ostream &) const
print all the L1 GT parameters
Definition: GlobalParamsHelper.cc:97
l1t::GlobalParamsHelper::we_own_write_
bool we_own_write_
Definition: GlobalParamsHelper.h:109
l1t::GlobalParamsHelper::numberL1Mu
unsigned int numberL1Mu() const
get / set the number of L1 muons received by GT
Definition: GlobalParamsHelper.h:60
L1TGlobalParameters::m_numberChips
unsigned int m_numberChips
hardware
Definition: L1TGlobalParameters.h:39
l1t::GlobalParamsHelper::numberL1Tau
unsigned int numberL1Tau() const
get / set the number of L1 tau received by GT
Definition: GlobalParamsHelper.h:75
l1t::GlobalParamsHelper::readAndWriteFromEventSetup
static GlobalParamsHelper * readAndWriteFromEventSetup(const L1TGlobalParameters *es)
Definition: GlobalParamsHelper.cc:9
l1t::GlobalParamsHelper::setTotalBxInEvent
void setTotalBxInEvent(const int &)
Definition: GlobalParamsHelper.cc:40
l1t::GlobalParamsHelper::read_
const L1TGlobalParameters * read_
Definition: GlobalParamsHelper.h:107
l1t::GlobalParamsHelper::pinsOnChip
unsigned int pinsOnChip() const
get / set the number of pins on the GTL condition chips
Definition: GlobalParamsHelper.h:85
l1t::GlobalParamsHelper::setPinsOnChip
void setPinsOnChip(const unsigned int &)
Definition: GlobalParamsHelper.cc:84
L1TGlobalParameters::m_numberPhysTriggers
unsigned int m_numberPhysTriggers
trigger decision
Definition: L1TGlobalParameters.h:20
l1t::GlobalParamsHelper::setNumberChips
void setNumberChips(const unsigned int &)
Definition: GlobalParamsHelper.cc:78
L1TGlobalParameters::m_numberL1Mu
unsigned int m_numberL1Mu
trigger objects
Definition: L1TGlobalParameters.h:25
l1t::GlobalParamsHelper::setNumberL1Tau
void setNumberL1Tau(const unsigned int &)
Definition: GlobalParamsHelper.cc:70
l1t::GlobalParamsHelper::getReadInstance
const L1TGlobalParameters * getReadInstance() const
Definition: GlobalParamsHelper.h:99
L1TGlobalParameters::m_pinsOnChip
unsigned int m_pinsOnChip
number of pins on the GTL condition chips
Definition: L1TGlobalParameters.h:42