CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 // 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
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
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 > &)
void print(std::ostream &) const
print all the L1 GT parameters
static const GlobalParamsHelper * readFromEventSetup(const L1TGlobalParameters *es)
void setNumberL1EG(const unsigned int &)
assert(be >=bs)
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
T w() const
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)