CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EndCapParamsHelper.h
Go to the documentation of this file.
1 #ifndef l1t_EndCapParamsHelper_h_
2 #define l1t_EndCapParamsHelper_h_
3 
4 #include <cassert>
5 #include <vector>
6 #include <map>
7 
10 
11 // If you want to create a new object that you can read and write, use this constructor:
12 //
13 // l1t::EndCapParamsHelper x(new L1TPrescalesVetors());
14 //
15 // If you wish to read the table from the EventSetup, and will only read, use this:
16 //
17 // const EndCapParamsHelper * x = EndCapParamsHelper::readFromEventSetup(...)
18 // //...
19 // delete x;
20 //
21 // If you wish to read the table from the EventSetup, but then be able to edit the values locally, use this:
22 //
23 // EndCapParamsHelper * x = EndCapParamsHelper::readAndWriteFromEventSetup(...)
24 // //...
26 //
27 // but there's a performance penalty as a copy is made.
28 
29 
30 //
31 // This class does not take over responsibility for deleting the pointers it is
32 // initialized with. That is responsibility of the calling code.
33 //
34 
35 #include "TXMLEngine.h"
36 
37 namespace l1t {
38 
40  public:
41  enum {VERSION = 1};
42 
44 
45  //ctor if creating a new table (e.g. from XML or python file)
47  //create for reading only, from the EventSetup:
49  // create for reading and writing, starting from the EventSetup:
51 
58 
59  unsigned GetPtAssignVersion() const {return read_->PtAssignVersion_;};
60  unsigned GetFirmwareVersion() const {return read_->firmwareVersion_;}
65 
66  // print all the parameters
67  void print(std::ostream&) const;
68 
69  // access to underlying pointers, mainly for ESProducer:
70  const L1TMuonEndCapParams * getReadInstance() const {return read_;}
72 
73  private:
75  void useCopy();
76  void check_write() { assert(write_); }
77  // separating read from write allows for a high-performance read-only mode (as no copy is made):
78  const L1TMuonEndCapParams * read_; // when reading/getting, use this.
79  L1TMuonEndCapParams * write_; // when writing/setting, use this.
81  };
82 
83 }
84 #endif
L1TMuonEndCapParams * write_
def window
Definition: svgfig.py:642
const double w
Definition: UKUtility.cc:23
static EndCapParamsHelper * readAndWriteFromEventSetup(const L1TMuonEndCapParams *es)
assert(m_qm.get())
const L1TMuonEndCapParams * read_
void SetFirmwareVersion(unsigned version)
const L1TMuonEndCapParams * getReadInstance() const
void print(std::ostream &) const
void SetPtAssignVersion(unsigned version)
void SetSt1PhiMatchWindow(int window)
void SetSt4PhiMatchWindow(int window)
void SetSt2PhiMatchWindow(int window)
L1TMuonEndCapParams * getWriteInstance()
unsigned GetPtAssignVersion() const
static const EndCapParamsHelper * readFromEventSetup(const L1TMuonEndCapParams *es)
EndCapParamsHelper(L1TMuonEndCapParams *w)
unsigned GetFirmwareVersion() const
void SetSt3PhiMatchWindow(int window)