CMS 3D CMS Logo

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 
54  // "PhiMatchWindowSt1" arbitrarily re-mapped to Primitive conversion (PC LUT) version
55  // because of rigid CondFormats naming conventions - AWB 02.06.17
57 
58  unsigned GetPtAssignVersion() const {return read_->PtAssignVersion_;}
59  unsigned GetFirmwareVersion() const {return read_->firmwareVersion_;}
60  unsigned GetPrimConvVersion() const {return read_->PhiMatchWindowSt1_;}
61 
62  // print all the parameters
63  void print(std::ostream&) const;
64 
65  // access to underlying pointers, mainly for ESProducer:
66  const L1TMuonEndCapParams * getReadInstance() const {return read_;}
68 
69  private:
71  void useCopy();
72  void check_write() { assert(write_); }
73  // separating read from write allows for a high-performance read-only mode (as no copy is made):
74  const L1TMuonEndCapParams * read_; // when reading/getting, use this.
75  L1TMuonEndCapParams * write_; // when writing/setting, use this.
77  };
78 
79 }
80 #endif
L1TMuonEndCapParams * write_
const double w
Definition: UKUtility.cc:23
static EndCapParamsHelper * readAndWriteFromEventSetup(const L1TMuonEndCapParams *es)
delete x;
Definition: CaloConfig.h:22
const L1TMuonEndCapParams * read_
void SetFirmwareVersion(unsigned version)
const L1TMuonEndCapParams * getReadInstance() const
void print(std::ostream &) const
void SetPtAssignVersion(unsigned version)
void SetPrimConvVersion(unsigned version)
L1TMuonEndCapParams * getWriteInstance()
unsigned GetPtAssignVersion() const
static const EndCapParamsHelper * readFromEventSetup(const L1TMuonEndCapParams *es)
EndCapParamsHelper(L1TMuonEndCapParams *w)
unsigned GetFirmwareVersion() const
unsigned GetPrimConvVersion() const