CMS 3D CMS Logo

Public Member Functions | Private Member Functions

ShallowEventDataProducer Class Reference

#include <ShallowEventDataProducer.h>

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

List of all members.

Public Member Functions

 ShallowEventDataProducer (const edm::ParameterSet &)

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &)

Detailed Description

Definition at line 7 of file ShallowEventDataProducer.h.


Constructor & Destructor Documentation

ShallowEventDataProducer::ShallowEventDataProducer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 5 of file ShallowEventDataProducer.cc.

                                                                                 {
  produces <unsigned int> ( "run"      );
  produces <unsigned int> ( "event"    );
  produces <unsigned int> ( "bx"       );
  produces <unsigned int> ( "lumi"       );
  produces <std::vector<bool> > ( "TrigTech" );
  produces <std::vector<bool> > ( "TrigPh" );
}

Member Function Documentation

void ShallowEventDataProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 15 of file ShallowEventDataProducer.cc.

References edm::EventBase::bunchCrossing(), edm::EventID::event(), event(), edm::Event::getByLabel(), i, edm::EventBase::id(), fjr2json::lumi, edm::EventBase::luminosityBlock(), edm::Event::put(), edm::EventID::run(), and CrabTask::run.

                                                       {


  std::auto_ptr<unsigned int >  run   ( new unsigned int(iEvent.id().run()   ) );
  std::auto_ptr<unsigned int >  event ( new unsigned int(iEvent.id().event() ) );
  std::auto_ptr<unsigned int >  bx    ( new unsigned int(iEvent.bunchCrossing() ) );
  std::auto_ptr<unsigned int >  lumi  ( new unsigned int(iEvent.luminosityBlock() ) );


  edm::Handle< L1GlobalTriggerReadoutRecord > gtRecord;
  iEvent.getByLabel( edm::InputTag("gtDigis"), gtRecord);

  std::vector<bool> TrigTech_(64,0);
  std::vector<bool> TrigPh_(128,0);

  // Get dWord after masking disabled bits
  DecisionWord dWord = gtRecord->decisionWord();
  if ( ! dWord.empty() ) { // if board not there this is zero
    // loop over dec. bit to get total rate (no overlap)
    for ( int i = 0; i < 64; ++i ) {
      TrigPh_[i]= dWord[i];
    }
  }
    
  TechnicalTriggerWord tw = gtRecord->technicalTriggerWord();
  if ( ! tw.empty() ) {
    // loop over dec. bit to get total rate (no overlap)
    for ( int i = 0; i < 64; ++i ) {
      TrigTech_[i]=tw[i];
    }
  }

  std::auto_ptr<std::vector<bool> >  TrigTech(new std::vector<bool>(TrigTech_));
  std::auto_ptr<std::vector<bool> > TrigPh(new std::vector<bool>(TrigPh_));

  iEvent.put( run,      "run"   );
  iEvent.put( event,    "event" );
  iEvent.put( bx,       "bx" );
  iEvent.put( lumi,       "lumi" );
  iEvent.put( TrigTech, "TrigTech" );
  iEvent.put( TrigPh,   "TrigPh" );
}