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 }
MessageLogger.h
L1GtParametersRcd.h
L1GtParametersTrivialProducer.h
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
ESProducer.h
L1GtParametersTrivialProducer::m_bstLengthBytes
unsigned int m_bstLengthBytes
length of BST record (in bytes)
Definition: L1GtParametersTrivialProducer.h:65
L1GtParametersTrivialProducer::produceGtParameters
std::unique_ptr< L1GtParameters > produceGtParameters(const L1GtParametersRcd &)
public methods
Definition: L1GtParametersTrivialProducer.cc:83
L1GtParametersTrivialProducer::m_daqNrBxBoard
std::vector< int > m_daqNrBxBoard
number of Bx per board in the DAQ record
Definition: L1GtParametersTrivialProducer.h:59
L1GtParametersTrivialProducer::m_daqActiveBoards
uint16_t m_daqActiveBoards
active boards in the L1 DAQ record
Definition: L1GtParametersTrivialProducer.h:53
L1GtParametersTrivialProducer::L1GtParametersTrivialProducer
L1GtParametersTrivialProducer(const edm::ParameterSet &)
constructor
Definition: L1GtParametersTrivialProducer.cc:36
L1GtParametersRcd
Definition: L1GtParametersRcd.h:38
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:36
L1GtParametersTrivialProducer::m_evmNrBxBoard
std::vector< int > m_evmNrBxBoard
number of Bx per board in the EVM record
Definition: L1GtParametersTrivialProducer.h:62
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
L1GtParametersTrivialProducer::m_totalBxInEvent
int m_totalBxInEvent
total Bx's in the event
Definition: L1GtParametersTrivialProducer.h:50
L1GtParametersTrivialProducer::m_evmActiveBoards
uint16_t m_evmActiveBoards
active boards in the L1 EVM record
Definition: L1GtParametersTrivialProducer.h:56
L1GtParametersTrivialProducer::~L1GtParametersTrivialProducer
~L1GtParametersTrivialProducer() override
destructor
Definition: L1GtParametersTrivialProducer.cc:76