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 
57 
58  unsigned GetPtAssignVersion() const {return read_->PtAssignVersion_;};
63 
64  // print all the parameters
65  void print(std::ostream&) const;
66 
67  // access to underlying pointers, mainly for ESProducer:
68  const L1TMuonEndCapParams * getReadInstance() const {return read_;}
70 
71  private:
73  void useCopy();
74  void check_write() { assert(write_); }
75  // separating read from write allows for a high-performance read-only mode (as no copy is made):
76  const L1TMuonEndCapParams * read_; // when reading/getting, use this.
77  L1TMuonEndCapParams * write_; // when writing/setting, use this.
79  };
80 
81 }
82 #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_
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)
void SetSt3PhiMatchWindow(int window)