CMS 3D CMS Logo

L1GtParametersTrivialProducer.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <memory>
20 
21 // user include files
22 // base class
24 
26 
29 
31 #include <cstdint>
32 
33 // forward declarations
34 
35 // constructor(s)
37  // tell the framework what data is being produced
39 
40  // now do what ever other initialization is needed
41 
42  // total Bx's in the event
43 
44  m_totalBxInEvent = parSet.getParameter<int>("TotalBxInEvent");
45 
46  if (m_totalBxInEvent > 0) {
47  if ((m_totalBxInEvent % 2) == 0) {
49 
50  edm::LogInfo("L1GtParametersTrivialProducer")
51  << "\nWARNING: Number of bunch crossing in event rounded to: " << m_totalBxInEvent
52  << "\n The number must be an odd number!\n"
53  << std::endl;
54  }
55  } else {
56  edm::LogInfo("L1GtParametersTrivialProducer")
57  << "\nWARNING: Number of bunch crossing in event must be a positive number!"
58  << "\n Requested value was: " << m_totalBxInEvent << "\n Reset to 1 (L1Accept bunch only).\n"
59  << std::endl;
60 
61  m_totalBxInEvent = 1;
62  }
63 
64  m_daqActiveBoards = static_cast<uint16_t>(parSet.getParameter<unsigned int>("DaqActiveBoards"));
65 
66  m_evmActiveBoards = static_cast<uint16_t>(parSet.getParameter<unsigned int>("EvmActiveBoards"));
67 
68  m_daqNrBxBoard = parSet.getParameter<std::vector<int> >("DaqNrBxBoard");
69 
70  m_evmNrBxBoard = parSet.getParameter<std::vector<int> >("EvmNrBxBoard");
71 
72  m_bstLengthBytes = parSet.getParameter<unsigned int>("BstLengthBytes");
73 }
74 
75 // destructor
77  // empty
78 }
79 
80 // member functions
81 
82 // method called to produce the data
83 std::unique_ptr<L1GtParameters> L1GtParametersTrivialProducer::produceGtParameters(const L1GtParametersRcd& iRecord) {
84  auto pL1GtParameters = std::make_unique<L1GtParameters>();
85 
86  // set total Bx's in the event
87  pL1GtParameters->setGtTotalBxInEvent(m_totalBxInEvent);
88 
89  // set the active boards for L1 GT DAQ record
90  pL1GtParameters->setGtDaqActiveBoards(m_daqActiveBoards);
91 
92  // set the active boards for L1 GT EVM record
93  pL1GtParameters->setGtEvmActiveBoards(m_evmActiveBoards);
94 
95  // set the number of Bx per board for L1 GT DAQ record
96  pL1GtParameters->setGtDaqNrBxBoard(m_daqNrBxBoard);
97 
98  // set the number of Bx per board for L1 GT EVM record
99  pL1GtParameters->setGtEvmNrBxBoard(m_evmNrBxBoard);
100 
101  // set length of BST record (in bytes) for L1 GT EVM record
102  pL1GtParameters->setGtBstLengthBytes(m_bstLengthBytes);
103 
104  return pL1GtParameters;
105 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
uint16_t m_evmActiveBoards
active boards in the L1 EVM record
std::vector< int > m_daqNrBxBoard
number of Bx per board in the DAQ record
unsigned int m_bstLengthBytes
length of BST record (in bytes)
uint16_t m_daqActiveBoards
active boards in the L1 DAQ record
L1GtParametersTrivialProducer(const edm::ParameterSet &)
constructor
std::unique_ptr< L1GtParameters > produceGtParameters(const L1GtParametersRcd &)
public methods
std::vector< int > m_evmNrBxBoard
number of Bx per board in the EVM record
Log< level::Info, false > LogInfo
int m_totalBxInEvent
total Bx&#39;s in the event
~L1GtParametersTrivialProducer() override
destructor