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 // This class does not take over responsibility for deleting the pointers it is
31 // initialized with. That is responsibility of the calling code.
32 //
33 
34 namespace l1t {
35 
37  public:
38  enum { VERSION = 1 };
39 
41 
42  //ctor if creating a new table (e.g. from XML or python file)
44  //create for reading only, from the EventSetup:
46  // create for reading and writing, starting from the EventSetup:
48 
51  // "PhiMatchWindowSt1" arbitrarily re-mapped to Primitive conversion (PC LUT) version
52  // because of rigid CondFormats naming conventions - AWB 02.06.17
54 
55  unsigned GetPtAssignVersion() const { return read_->PtAssignVersion_; }
56  unsigned GetFirmwareVersion() const { return read_->firmwareVersion_; }
57  unsigned GetPrimConvVersion() const { return read_->PhiMatchWindowSt1_; }
58 
59  // print all the parameters
60  void print(std::ostream&) const;
61 
62  // access to underlying pointers, mainly for ESProducer:
63  const L1TMuonEndCapParams* getReadInstance() const { return read_; }
65 
66  private:
68  void useCopy();
69  void check_write() { assert(write_); }
70  // separating read from write allows for a high-performance read-only mode (as no copy is made):
71  const L1TMuonEndCapParams* read_; // when reading/getting, use this.
72  L1TMuonEndCapParams* write_; // when writing/setting, use this.
74  };
75 
76 } // namespace l1t
77 #endif
l1t::EndCapParamsHelper::VERSION
Definition: EndCapParamsHelper.h:38
l1t::EndCapParamsHelper::useCopy
void useCopy()
Definition: EndCapParamsHelper.cc:31
l1t::EndCapParamsHelper::readFromEventSetup
static const EndCapParamsHelper * readFromEventSetup(const L1TMuonEndCapParams *es)
Definition: EndCapParamsHelper.cc:8
l1t::EndCapParamsHelper::SetPtAssignVersion
void SetPtAssignVersion(unsigned version)
Definition: EndCapParamsHelper.h:49
L1TMuonEndCapParams::PtAssignVersion_
unsigned PtAssignVersion_
Definition: L1TMuonEndCapParams.h:28
l1t::EndCapParamsHelper::getWriteInstance
L1TMuonEndCapParams * getWriteInstance()
Definition: EndCapParamsHelper.h:64
cms::cuda::assert
assert(be >=bs)
L1TMuonEndCapParams.h
l1t::EndCapParamsHelper::check_write
void check_write()
Definition: EndCapParamsHelper.h:69
l1t::EndCapParamsHelper::~EndCapParamsHelper
~EndCapParamsHelper()
Definition: EndCapParamsHelper.cc:37
l1t::EndCapParamsHelper
Definition: EndCapParamsHelper.h:36
w
const double w
Definition: UKUtility.cc:23
l1t::EndCapParamsHelper::read_
const L1TMuonEndCapParams * read_
Definition: EndCapParamsHelper.h:71
l1t::EndCapParamsHelper::getReadInstance
const L1TMuonEndCapParams * getReadInstance() const
Definition: EndCapParamsHelper.h:63
l1t::EndCapParamsHelper::readAndWriteFromEventSetup
static EndCapParamsHelper * readAndWriteFromEventSetup(const L1TMuonEndCapParams *es)
Definition: EndCapParamsHelper.cc:12
l1t::EndCapParamsHelper::write_
L1TMuonEndCapParams * write_
Definition: EndCapParamsHelper.h:72
l1t::EndCapParamsHelper::print
void print(std::ostream &) const
Definition: EndCapParamsHelper.cc:43
l1t::EndCapParamsHelper::GetPtAssignVersion
unsigned GetPtAssignVersion() const
Definition: EndCapParamsHelper.h:55
L1TMuonEndCapParams::firmwareVersion_
unsigned firmwareVersion_
Definition: L1TMuonEndCapParams.h:28
l1t
delete x;
Definition: CaloConfig.h:22
L1TMuonEndCapParams
Definition: L1TMuonEndCapParams.h:15
L1TMuonEndCapParamsRcd.h
l1t::EndCapParamsHelper::GetPrimConvVersion
unsigned GetPrimConvVersion() const
Definition: EndCapParamsHelper.h:57
L1TMuonEndCapParams::PhiMatchWindowSt1_
int PhiMatchWindowSt1_
Definition: L1TMuonEndCapParams.h:29
l1t::EndCapParamsHelper::SetFirmwareVersion
void SetFirmwareVersion(unsigned version)
Definition: EndCapParamsHelper.h:50
l1t::EndCapParamsHelper::we_own_write_
bool we_own_write_
Definition: EndCapParamsHelper.h:73
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
l1t::EndCapParamsHelper::EndCapParamsHelper
EndCapParamsHelper(L1TMuonEndCapParams *w)
Definition: EndCapParamsHelper.cc:18
l1t::EndCapParamsHelper::GetFirmwareVersion
unsigned GetFirmwareVersion() const
Definition: EndCapParamsHelper.h:56
l1t::EndCapParamsHelper::SetPrimConvVersion
void SetPrimConvVersion(unsigned version)
Definition: EndCapParamsHelper.h:53