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