CMS 3D CMS Logo

L1GlobalTriggerRecordProducer Class Reference

Description: L1GlobalTriggerRecord producer. More...

#include <EventFilter/L1GlobalTriggerRawToDigi/interface/L1GlobalTriggerRecordProducer.h>

Inheritance diagram for L1GlobalTriggerRecordProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 L1GlobalTriggerRecordProducer (const edm::ParameterSet &)
 constructor(s)
virtual ~L1GlobalTriggerRecordProducer ()
 destructor

Private Member Functions

virtual void beginJob (const edm::EventSetup &)
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.
const L1GtTriggerMaskm_l1GtTmAlgo
 cached stuff
unsigned long long m_l1GtTmAlgoCacheID
const L1GtTriggerMaskm_l1GtTmTech
unsigned long long m_l1GtTmTechCacheID
std::vector< unsigned intm_triggerMaskAlgoTrig
std::vector< unsigned intm_triggerMaskTechTrig


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 lat::endl(), edm::ParameterSet::getParameter(), LogDebug, m_l1GtReadoutRecordTag, m_l1GtTmAlgoCacheID, and m_l1GtTmTechCacheID.

00045 {
00046 
00047     produces<L1GlobalTriggerRecord>();
00048 
00049     // input tag for DAQ GT record
00050     m_l1GtReadoutRecordTag = 
00051         parSet.getParameter<edm::InputTag>("L1GtReadoutRecordTag");
00052 
00053     LogDebug("L1GlobalTriggerRecordProducer")
00054     << "\nInput tag for L1 GT DAQ record:             "
00055     << m_l1GtReadoutRecordTag
00056     << std::endl;
00057 
00058     // initialize cached IDs
00059     
00060     m_l1GtTmAlgoCacheID = 0ULL;
00061     m_l1GtTmTechCacheID = 0ULL;
00062     
00063 }

L1GlobalTriggerRecordProducer::~L1GlobalTriggerRecordProducer (  )  [virtual]

destructor

Definition at line 66 of file L1GlobaTriggerRecordProducer.cc.

00067 {
00068 
00069     // empty
00070     
00071 }


Member Function Documentation

void L1GlobalTriggerRecordProducer::beginJob ( const edm::EventSetup evSetup  )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 76 of file L1GlobaTriggerRecordProducer.cc.

00077 {
00078     // empty
00079 }

void L1GlobalTriggerRecordProducer::endJob ( void   )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 238 of file L1GlobaTriggerRecordProducer.cc.

00239 {
00240 
00241     // empty now
00242 }

void L1GlobalTriggerRecordProducer::produce ( edm::Event iEvent,
const edm::EventSetup evSetup 
) [private, virtual]

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 lat::endl(), edm::EventSetup::get(), edm::Event::getByLabel(), L1GtTriggerMask::gtTriggerMask(), edm::isDebugEnabled(), edm::Handle< T >::isValid(), LogDebug, LogTrace, m_l1GtReadoutRecordTag, m_l1GtTmAlgo, m_l1GtTmAlgoCacheID, m_l1GtTmTech, m_l1GtTmTechCacheID, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, edm::ESHandle< T >::product(), and edm::Event::put().

00083 {
00084 
00085     // produce the L1GlobalTriggerRecord
00086     std::auto_ptr<L1GlobalTriggerRecord> gtRecord(new L1GlobalTriggerRecord());
00087 
00088     // get L1GlobalTriggerReadoutRecord
00089     edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecord;
00090     iEvent.getByLabel(m_l1GtReadoutRecordTag, gtReadoutRecord);
00091     
00092     if (!gtReadoutRecord.isValid()) {
00093         
00094         LogDebug("L1GlobalTriggerRecordProducer")
00095         << "\n\n Error: no L1GlobalTriggerReadoutRecord found with input tag "
00096         << m_l1GtReadoutRecordTag
00097         << "\n Returning empty L1GlobalTriggerRecord.\n\n"
00098         << std::endl;
00099         
00100         iEvent.put( gtRecord );
00101         return;
00102     }
00103 
00104     //
00105     boost::uint16_t gtFinalOR = gtReadoutRecord->finalOR();
00106     int physicsDaqPartition = 0;
00107     bool gtDecision = static_cast<bool> (gtFinalOR & (1 << physicsDaqPartition));
00108     
00109     DecisionWord algoDecisionWord = gtReadoutRecord->decisionWord();    
00110     TechnicalTriggerWord techDecisionWord = gtReadoutRecord->technicalTriggerWord();   
00111 
00112     // get / update the trigger mask from the EventSetup 
00113     // local cache & check on cacheIdentifier
00114 
00115     unsigned long long l1GtTmAlgoCacheID = 
00116         evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
00117 
00118     if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
00119         
00120         edm::ESHandle< L1GtTriggerMask > l1GtTmAlgo;
00121         evSetup.get< L1GtTriggerMaskAlgoTrigRcd >().get( l1GtTmAlgo );        
00122         m_l1GtTmAlgo = l1GtTmAlgo.product();
00123         
00124         m_triggerMaskAlgoTrig = m_l1GtTmAlgo->gtTriggerMask();
00125         
00126         m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
00127 
00128     }
00129     
00130 
00131     unsigned long long l1GtTmTechCacheID = 
00132         evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
00133 
00134     if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
00135         
00136         edm::ESHandle< L1GtTriggerMask > l1GtTmTech;
00137         evSetup.get< L1GtTriggerMaskTechTrigRcd >().get( l1GtTmTech );        
00138         m_l1GtTmTech = l1GtTmTech.product();
00139         
00140         m_triggerMaskTechTrig = m_l1GtTmTech->gtTriggerMask();
00141         
00142         m_l1GtTmTechCacheID = l1GtTmTechCacheID;
00143 
00144     }
00145     
00148     gtRecord->setDecisionWordBeforeMask(algoDecisionWord);
00149     gtRecord->setTechnicalTriggerWordBeforeMask(techDecisionWord);
00150 
00151     // mask the required bits for DAQ partition 0 (Physics Partition)
00152     
00153     int iDaq = 0;
00154     
00155     // algorithm trigger mask
00156     
00157     int iBit = -1; // bit counter
00158 
00159     for (std::vector<bool>::iterator 
00160             itBit = algoDecisionWord.begin(); itBit != algoDecisionWord.end(); ++itBit) {
00161         
00162         iBit++;
00163         
00164         int triggerMaskAlgoTrigBit = m_triggerMaskAlgoTrig[iBit] & (1 << iDaq);
00165         //LogTrace("L1GlobalTriggerFDL")
00166         //<< "\nAlgorithm trigger bit: " << iBit 
00167         //<< " mask = " << triggerMaskAlgoTrigBit
00168         //<< " DAQ partition " << iDaq
00169         //<< std::endl;
00170 
00171         if (triggerMaskAlgoTrigBit) {
00172             *itBit = false;
00173 
00174             //LogTrace("L1GlobalTriggerFDL")
00175             //<< "\nMasked algorithm trigger: " << iBit << ". Result set to false"
00176             //<< std::endl;
00177         }
00178     }
00179 
00180     // mask the technical trigger
00181 
00182     iBit = -1; // bit counter
00183 
00184     for (std::vector<bool>::iterator 
00185             itBit = techDecisionWord.begin(); itBit != techDecisionWord.end(); ++itBit) {
00186         
00187         iBit++;
00188         
00189         int triggerMaskTechTrigBit = m_triggerMaskTechTrig[iBit] & (1 << iDaq);
00190         //LogTrace("L1GlobalTriggerFDL")
00191         //<< "\nTechnical trigger bit: " << iBit 
00192         //<< " mask = " << triggerMaskTechTrigBit
00193         //<< " DAQ partition " << iDaq
00194         //<< std::endl;
00195 
00196         if (triggerMaskTechTrigBit) {
00197             *itBit = false;
00198 
00199             //LogTrace("L1GlobalTriggerFDL")
00200             //<< "\nMasked technical trigger: " << iBit << ". Result set to false"
00201             //<< std::endl;
00202         }
00203     }
00204 
00205     
00206     
00207 
00208     // set global decision, decision word and technical trigger word
00209     // for bunch cross with L1Accept (BxInEvent = 0) after applying the trigger masks
00210     gtRecord->setDecision(gtDecision);
00211     gtRecord->setDecisionWord(algoDecisionWord);
00212     gtRecord->setTechnicalTriggerWord(techDecisionWord);
00213     
00214     // get/set index of the set of prescale factors
00215     unsigned int pfIndexTech = 
00216         static_cast<unsigned int> ((gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech());
00217     unsigned int pfIndexAlgo =
00218         static_cast<unsigned int> ((gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo());
00219     
00220     gtRecord->setGtPrescaleFactorIndexTech(pfIndexTech);
00221     gtRecord->setGtPrescaleFactorIndexAlgo(pfIndexAlgo);
00222     
00223     if ( edm::isDebugEnabled() ) {
00224         std::ostringstream myCoutStream;
00225         gtRecord->print(myCoutStream);
00226         LogTrace("L1GlobalTriggerRecordProducer")
00227         << "\n The following L1 GT record was produced.\n"
00228         << myCoutStream.str() << "\n"
00229         << std::endl;
00230     }
00231 
00232     // put records into event
00233     iEvent.put( gtRecord );
00234 
00235 }


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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:42 2009 for CMSSW by  doxygen 1.5.4