CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtParametersTrivialProducer.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 #include <memory>
22 
23 #include "boost/shared_ptr.hpp"
24 #include <boost/cstdint.hpp>
25 
26 
27 // user include files
28 // base class
30 
32 
35 
37 
38 // forward declarations
39 
40 // constructor(s)
42 {
43  // tell the framework what data is being produced
45 
46  // now do what ever other initialization is needed
47 
48  // total Bx's in the event
49 
50  m_totalBxInEvent = parSet.getParameter<int>("TotalBxInEvent");
51 
52  if (m_totalBxInEvent > 0) {
53  if ( (m_totalBxInEvent%2) == 0 ) {
55 
56  edm::LogInfo("L1GtParametersTrivialProducer")
57  << "\nWARNING: Number of bunch crossing in event rounded to: "
58  << m_totalBxInEvent << "\n The number must be an odd number!\n"
59  << std::endl;
60  }
61  } else {
62 
63  edm::LogInfo("L1GtParametersTrivialProducer")
64  << "\nWARNING: Number of bunch crossing in event must be a positive number!"
65  << "\n Requested value was: " << m_totalBxInEvent
66  << "\n Reset to 1 (L1Accept bunch only).\n"
67  << std::endl;
68 
69  m_totalBxInEvent = 1;
70 
71  }
72 
73  m_daqActiveBoards = static_cast<boost::uint16_t> (parSet.getParameter<unsigned int> (
74  "DaqActiveBoards"));
75 
76  m_evmActiveBoards = static_cast<boost::uint16_t> (parSet.getParameter<unsigned int> (
77  "EvmActiveBoards"));
78 
79  m_daqNrBxBoard = parSet.getParameter<std::vector<int> > ("DaqNrBxBoard");
80 
81  m_evmNrBxBoard = parSet.getParameter<std::vector<int> > ("EvmNrBxBoard");
82 
83  m_bstLengthBytes = parSet.getParameter<unsigned int> ("BstLengthBytes");
84 
85 }
86 
87 // destructor
89 {
90 
91  // empty
92 
93 }
94 
95 
96 // member functions
97 
98 // method called to produce the data
99 boost::shared_ptr<L1GtParameters> L1GtParametersTrivialProducer::produceGtParameters(
100  const L1GtParametersRcd& iRecord)
101 {
102 
103  using namespace edm::es;
104 
105 
106  boost::shared_ptr<L1GtParameters> pL1GtParameters =
107  boost::shared_ptr<L1GtParameters>( new L1GtParameters() );
108 
109 
110  // set total Bx's in the event
111  pL1GtParameters->setGtTotalBxInEvent(m_totalBxInEvent);
112 
113  // set the active boards for L1 GT DAQ record
114  pL1GtParameters->setGtDaqActiveBoards(m_daqActiveBoards);
115 
116  // set the active boards for L1 GT EVM record
117  pL1GtParameters->setGtEvmActiveBoards(m_evmActiveBoards);
118 
119  // set the number of Bx per board for L1 GT DAQ record
120  pL1GtParameters->setGtDaqNrBxBoard(m_daqNrBxBoard);
121 
122  // set the number of Bx per board for L1 GT EVM record
123  pL1GtParameters->setGtEvmNrBxBoard(m_evmNrBxBoard);
124 
125  // set length of BST record (in bytes) for L1 GT EVM record
126  pL1GtParameters->setGtBstLengthBytes(m_bstLengthBytes);
127 
128  return pL1GtParameters ;
129 }
130 
T getParameter(std::string const &) const
std::vector< int > m_daqNrBxBoard
number of Bx per board in the DAQ record
unsigned int m_bstLengthBytes
length of BST record (in bytes)
L1GtParametersTrivialProducer(const edm::ParameterSet &)
constructor
boost::shared_ptr< L1GtParameters > produceGtParameters(const L1GtParametersRcd &)
public methods
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::vector< int > m_evmNrBxBoard
number of Bx per board in the EVM record
boost::uint16_t m_evmActiveBoards
active boards in the L1 EVM record
int m_totalBxInEvent
total Bx&#39;s in the event
boost::uint16_t m_daqActiveBoards
active boards in the L1 DAQ record