test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 //
28 // This class does not take over responsibility for deleting the pointers it is
29 // initialized with. That is responsibility of the calling code.
30 //
31 
32 
33 namespace l1t {
34 
36  public:
37  enum {VERSION = 1};
38 
40 
41  //ctor if creating a new table (e.g. from XML or python file)
43  //create for reading only, from the EventSetup:
45  // create for reading and writing, starting from the EventSetup:
47 
48  //int bxMaskDefault() const { return read_->bxmask_default_; };
49  //void setBxMaskDefault(int value) { check_write(); write_->bxmask_default_ = value; };
50 
51 
53  inline int totalBxInEvent() const {
54  return read_->m_totalBxInEvent;
55  }
56 
57  void setTotalBxInEvent(const int&);
58 
59 
61  inline unsigned int numberPhysTriggers() const {
63  }
64 
65  void setNumberPhysTriggers(const unsigned int&);
66 
67 
69  inline unsigned int numberL1Mu() const {
70  return read_->m_numberL1Mu;
71  }
72 
73  void setNumberL1Mu(const unsigned int&);
74 
76  inline unsigned int numberL1EG() const {
77  return read_->m_numberL1EG;
78  }
79 
80  void setNumberL1EG(const unsigned int&);
81 
82 
84  inline unsigned int numberL1Jet() const {
85  return read_->m_numberL1Jet;
86  }
87 
88  void setNumberL1Jet(const unsigned int&);
89 
90 
92  inline unsigned int numberL1Tau() const {
93  return read_->m_numberL1Tau;
94  }
95 
96  void setNumberL1Tau(const unsigned int&);
97 
98 
99 
101  inline unsigned int numberChips() const {
102  return read_->m_numberChips;
103  }
104 
105  void setNumberChips(const unsigned int&);
106 
108  inline unsigned int pinsOnChip() const {
109  return read_->m_pinsOnChip;
110  }
111 
112  void setPinsOnChip(const unsigned int&);
113 
116  inline const std::vector<int>& orderOfChip() const {
117  return read_->m_orderOfChip;
118  }
119 
120  void setOrderOfChip(const std::vector<int>&);
121 
123  void print(std::ostream&) const;
124 
125 
126 
127  // access to underlying pointers, mainly for ESProducer:
128  const L1TGlobalParameters * getReadInstance() const {return read_;}
130 
131  private:
133  void useCopy();
134  void check_write() { assert(write_); }
135  // separating read from write allows for a high-performance read-only mode (as no copy is made):
136  const L1TGlobalParameters * read_; // when reading/getting, use this.
137  L1TGlobalParameters * write_; // when writing/setting, use this.
139  };
140 
141 }
142 #endif
void setNumberL1Tau(const unsigned int &)
void setNumberL1Jet(const unsigned int &)
unsigned int m_pinsOnChip
number of pins on the GTL condition chips
unsigned int numberL1Jet() const
get / set the number of L1 jets received by GT
unsigned int m_numberL1Mu
trigger objects
const double w
Definition: UKUtility.cc:23
unsigned int numberL1EG() const
get / set the number of L1 e/gamma objects received by GT
void setNumberChips(const unsigned int &)
std::vector< int > m_orderOfChip
correspondence &quot;condition chip - GTL algorithm word&quot; in the hardware
unsigned int m_numberL1Jet
jets
unsigned int numberPhysTriggers() const
get / set the number of physics trigger algorithms
void setOrderOfChip(const std::vector< int > &)
assert(m_qm.get())
void print(std::ostream &) const
print all the L1 GT parameters
static const GlobalParamsHelper * readFromEventSetup(const L1TGlobalParameters *es)
void setNumberL1EG(const unsigned int &)
const L1TGlobalParameters * getReadInstance() const
void setTotalBxInEvent(const int &)
int m_totalBxInEvent
bx in event
const std::vector< int > & orderOfChip() const
L1TGlobalParameters * write_
GlobalParamsHelper(L1TGlobalParameters *w)
unsigned int m_numberL1EG
e/gamma objects
unsigned int m_numberL1Tau
taus
unsigned int numberL1Tau() const
get / set the number of L1 tau received by GT
unsigned int m_numberChips
hardware
void setNumberL1Mu(const unsigned int &)
L1TGlobalParameters * getWriteInstance()
const L1TGlobalParameters * read_
int totalBxInEvent() const
get / set the number of bx in hardware
void setPinsOnChip(const unsigned int &)
unsigned int m_numberPhysTriggers
trigger decision
void setNumberPhysTriggers(const unsigned int &)
unsigned int numberL1Mu() const
get / set the number of L1 muons received by GT
unsigned int pinsOnChip() const
get / set the number of pins on the GTL condition chips
unsigned int numberChips() const
get / set the number of condition chips in GTL
static GlobalParamsHelper * readAndWriteFromEventSetup(const L1TGlobalParameters *es)