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)
 
static void prevalidate (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 42 of file L1GlobaTriggerRecordProducer.cc.

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

43 {
44 
45  produces<L1GlobalTriggerRecord>();
46 
47  // input tag for DAQ GT record
49  parSet.getParameter<edm::InputTag>("L1GtReadoutRecordTag");
50 
51  LogDebug("L1GlobalTriggerRecordProducer")
52  << "\nInput tag for L1 GT DAQ record: "
53  << m_l1GtReadoutRecordTag
54  << std::endl;
55 
56  // initialize cached IDs
57 
58  m_l1GtTmAlgoCacheID = 0ULL;
59  m_l1GtTmTechCacheID = 0ULL;
60 
61 }
#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 64 of file L1GlobaTriggerRecordProducer.cc.

65 {
66 
67  // empty
68 
69 }

Member Function Documentation

void L1GlobalTriggerRecordProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 74 of file L1GlobaTriggerRecordProducer.cc.

75 {
76  // empty
77 }
void L1GlobalTriggerRecordProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 236 of file L1GlobaTriggerRecordProducer.cc.

237 {
238 
239  // empty now
240 }
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 80 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 JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

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