CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1GlobalTriggerRecordProducer Class Reference

#include <L1GlobalTriggerRecordProducer.h>

Inheritance diagram for L1GlobalTriggerRecordProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 L1GlobalTriggerRecordProducer (const edm::ParameterSet &)
 constructor(s) More...
 
virtual ~L1GlobalTriggerRecordProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag m_l1GtReadoutRecordTag
 InputTag for the L1 Global Trigger DAQ readout record. More...
 
const L1GtTriggerMaskm_l1GtTmAlgo
 cached stuff More...
 
unsigned long long m_l1GtTmAlgoCacheID
 
const L1GtTriggerMaskm_l1GtTmTech
 
unsigned long long m_l1GtTmTechCacheID
 
std::vector< unsigned int > m_triggerMaskAlgoTrig
 
std::vector< unsigned int > m_triggerMaskTechTrig
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: L1GlobalTriggerRecord producer.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 37 of file L1GlobalTriggerRecordProducer.h.

Constructor & Destructor Documentation

L1GlobalTriggerRecordProducer::L1GlobalTriggerRecordProducer ( const edm::ParameterSet parSet)
explicit

constructor(s)

Definition at line 44 of file L1GlobaTriggerRecordProducer.cc.

References edm::ParameterSet::getParameter(), LogDebug, m_l1GtReadoutRecordTag, m_l1GtTmAlgoCacheID, and m_l1GtTmTechCacheID.

45 {
46 
47  produces<L1GlobalTriggerRecord>();
48 
49  // input tag for DAQ GT record
51  parSet.getParameter<edm::InputTag>("L1GtReadoutRecordTag");
52 
53  LogDebug("L1GlobalTriggerRecordProducer")
54  << "\nInput tag for L1 GT DAQ record: "
55  << m_l1GtReadoutRecordTag
56  << std::endl;
57 
58  // initialize cached IDs
59 
60  m_l1GtTmAlgoCacheID = 0ULL;
61  m_l1GtTmTechCacheID = 0ULL;
62 
63 }
#define LogDebug(id)
T getParameter(std::string const &) const
edm::InputTag m_l1GtReadoutRecordTag
InputTag for the L1 Global Trigger DAQ readout record.
L1GlobalTriggerRecordProducer::~L1GlobalTriggerRecordProducer ( )
virtual

destructor

Definition at line 66 of file L1GlobaTriggerRecordProducer.cc.

67 {
68 
69  // empty
70 
71 }

Member Function Documentation

void L1GlobalTriggerRecordProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 76 of file L1GlobaTriggerRecordProducer.cc.

77 {
78  // empty
79 }
void L1GlobalTriggerRecordProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 238 of file L1GlobaTriggerRecordProducer.cc.

239 {
240 
241  // empty now
242 }
void L1GlobalTriggerRecordProducer::produce ( edm::Event iEvent,
const edm::EventSetup evSetup 
)
privatevirtual

set global decision, decision word and technical trigger word for bunch cross with L1Accept (BxInEvent = 0) before applying the masks

Implements edm::EDProducer.

Definition at line 82 of file L1GlobaTriggerRecordProducer.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), L1GtTriggerMask::gtTriggerMask(), edm::isDebugEnabled(), edm::HandleBase::isValid(), LogDebug, LogTrace, m_l1GtReadoutRecordTag, m_l1GtTmAlgo, m_l1GtTmAlgoCacheID, m_l1GtTmTech, m_l1GtTmTechCacheID, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, edm::ESHandle< class >::product(), and edm::Event::put().

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().

83 {
84 
85  // produce the L1GlobalTriggerRecord
86  std::auto_ptr<L1GlobalTriggerRecord> gtRecord(new L1GlobalTriggerRecord());
87 
88  // get L1GlobalTriggerReadoutRecord
90  iEvent.getByLabel(m_l1GtReadoutRecordTag, gtReadoutRecord);
91 
92  if (!gtReadoutRecord.isValid()) {
93 
94  LogDebug("L1GlobalTriggerRecordProducer")
95  << "\n\n Error: no L1GlobalTriggerReadoutRecord found with input tag "
97  << "\n Returning empty L1GlobalTriggerRecord.\n\n"
98  << std::endl;
99 
100  iEvent.put( gtRecord );
101  return;
102  }
103 
104  //
105  boost::uint16_t gtFinalOR = gtReadoutRecord->finalOR();
106  int physicsDaqPartition = 0;
107  bool gtDecision = static_cast<bool> (gtFinalOR & (1 << physicsDaqPartition));
108 
109  DecisionWord algoDecisionWord = gtReadoutRecord->decisionWord();
110  TechnicalTriggerWord techDecisionWord = gtReadoutRecord->technicalTriggerWord();
111 
112  // get / update the trigger mask from the EventSetup
113  // local cache & check on cacheIdentifier
114 
115  unsigned long long l1GtTmAlgoCacheID =
116  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
117 
118  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
119 
121  evSetup.get< L1GtTriggerMaskAlgoTrigRcd >().get( l1GtTmAlgo );
122  m_l1GtTmAlgo = l1GtTmAlgo.product();
123 
125 
126  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
127 
128  }
129 
130 
131  unsigned long long l1GtTmTechCacheID =
132  evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
133 
134  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
135 
137  evSetup.get< L1GtTriggerMaskTechTrigRcd >().get( l1GtTmTech );
138  m_l1GtTmTech = l1GtTmTech.product();
139 
141 
142  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
143 
144  }
145 
148  gtRecord->setDecisionWordBeforeMask(algoDecisionWord);
149  gtRecord->setTechnicalTriggerWordBeforeMask(techDecisionWord);
150 
151  // mask the required bits for DAQ partition 0 (Physics Partition)
152 
153  int iDaq = 0;
154 
155  // algorithm trigger mask
156 
157  int iBit = -1; // bit counter
158 
159  for (std::vector<bool>::iterator
160  itBit = algoDecisionWord.begin(); itBit != algoDecisionWord.end(); ++itBit) {
161 
162  iBit++;
163 
164  int triggerMaskAlgoTrigBit = m_triggerMaskAlgoTrig[iBit] & (1 << iDaq);
165  //LogTrace("L1GlobalTriggerFDL")
166  //<< "\nAlgorithm trigger bit: " << iBit
167  //<< " mask = " << triggerMaskAlgoTrigBit
168  //<< " DAQ partition " << iDaq
169  //<< std::endl;
170 
171  if (triggerMaskAlgoTrigBit) {
172  *itBit = false;
173 
174  //LogTrace("L1GlobalTriggerFDL")
175  //<< "\nMasked algorithm trigger: " << iBit << ". Result set to false"
176  //<< std::endl;
177  }
178  }
179 
180  // mask the technical trigger
181 
182  iBit = -1; // bit counter
183 
184  for (std::vector<bool>::iterator
185  itBit = techDecisionWord.begin(); itBit != techDecisionWord.end(); ++itBit) {
186 
187  iBit++;
188 
189  int triggerMaskTechTrigBit = m_triggerMaskTechTrig[iBit] & (1 << iDaq);
190  //LogTrace("L1GlobalTriggerFDL")
191  //<< "\nTechnical trigger bit: " << iBit
192  //<< " mask = " << triggerMaskTechTrigBit
193  //<< " DAQ partition " << iDaq
194  //<< std::endl;
195 
196  if (triggerMaskTechTrigBit) {
197  *itBit = false;
198 
199  //LogTrace("L1GlobalTriggerFDL")
200  //<< "\nMasked technical trigger: " << iBit << ". Result set to false"
201  //<< std::endl;
202  }
203  }
204 
205 
206 
207 
208  // set global decision, decision word and technical trigger word
209  // for bunch cross with L1Accept (BxInEvent = 0) after applying the trigger masks
210  gtRecord->setDecision(gtDecision);
211  gtRecord->setDecisionWord(algoDecisionWord);
212  gtRecord->setTechnicalTriggerWord(techDecisionWord);
213 
214  // get/set index of the set of prescale factors
215  unsigned int pfIndexTech =
216  static_cast<unsigned int> ((gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech());
217  unsigned int pfIndexAlgo =
218  static_cast<unsigned int> ((gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo());
219 
220  gtRecord->setGtPrescaleFactorIndexTech(pfIndexTech);
221  gtRecord->setGtPrescaleFactorIndexAlgo(pfIndexAlgo);
222 
223  if ( edm::isDebugEnabled() ) {
224  std::ostringstream myCoutStream;
225  gtRecord->print(myCoutStream);
226  LogTrace("L1GlobalTriggerRecordProducer")
227  << "\n The following L1 GT record was produced.\n"
228  << myCoutStream.str() << "\n"
229  << std::endl;
230  }
231 
232  // put records into event
233  iEvent.put( gtRecord );
234 
235 }
#define LogDebug(id)
bool isDebugEnabled()
std::vector< unsigned int > m_triggerMaskAlgoTrig
const L1GtTriggerMask * m_l1GtTmAlgo
cached stuff
edm::InputTag m_l1GtReadoutRecordTag
InputTag for the L1 Global Trigger DAQ readout record.
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
std::vector< bool > DecisionWord
typedefs
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::vector< unsigned int > m_triggerMaskTechTrig
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62

Member Data Documentation

edm::InputTag L1GlobalTriggerRecordProducer::m_l1GtReadoutRecordTag
private

InputTag for the L1 Global Trigger DAQ readout record.

Definition at line 74 of file L1GlobalTriggerRecordProducer.h.

Referenced by L1GlobalTriggerRecordProducer(), and produce().

const L1GtTriggerMask* L1GlobalTriggerRecordProducer::m_l1GtTmAlgo
private

cached stuff

trigger masks

Definition at line 62 of file L1GlobalTriggerRecordProducer.h.

Referenced by produce().

unsigned long long L1GlobalTriggerRecordProducer::m_l1GtTmAlgoCacheID
private

Definition at line 63 of file L1GlobalTriggerRecordProducer.h.

Referenced by L1GlobalTriggerRecordProducer(), and produce().

const L1GtTriggerMask* L1GlobalTriggerRecordProducer::m_l1GtTmTech
private

Definition at line 65 of file L1GlobalTriggerRecordProducer.h.

Referenced by produce().

unsigned long long L1GlobalTriggerRecordProducer::m_l1GtTmTechCacheID
private

Definition at line 66 of file L1GlobalTriggerRecordProducer.h.

Referenced by L1GlobalTriggerRecordProducer(), and produce().

std::vector<unsigned int> L1GlobalTriggerRecordProducer::m_triggerMaskAlgoTrig
private

Definition at line 68 of file L1GlobalTriggerRecordProducer.h.

Referenced by produce().

std::vector<unsigned int> L1GlobalTriggerRecordProducer::m_triggerMaskTechTrig
private

Definition at line 69 of file L1GlobalTriggerRecordProducer.h.

Referenced by produce().