![]() |
![]() |
#include <CSCTriggerPrimitivesProducer.h>
Public Member Functions | |
CSCTriggerPrimitivesProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~CSCTriggerPrimitivesProducer () | |
Private Attributes | |
bool | checkBadChambers_ |
edm::InputTag | compDigiProducer_ |
bool | debugParameters_ |
int | iev |
CSCTriggerPrimitivesBuilder * | lctBuilder_ |
edm::InputTag | wireDigiProducer_ |
Implementation of the local Level-1 Cathode Strip Chamber trigger. Simulates functionalities of the anode and cathode Local Charged Tracks (LCT) processors, of the Trigger Mother Board (TMB), and of the Muon Port Card (MPC).
Input to the simulation are collections of the CSC wire and comparator digis.
Produces four collections of the Level-1 CSC Trigger Primitives (track stubs, or LCTs): anode LCTs (ALCTs), cathode LCTs (CLCTs), correlated LCTs at TMB, and correlated LCTs at MPC.
Definition at line 32 of file CSCTriggerPrimitivesProducer.h.
CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer | ( | const edm::ParameterSet & | conf | ) | [explicit] |
Definition at line 38 of file CSCTriggerPrimitivesProducer.cc.
References checkBadChambers_, compDigiProducer_, debugParameters_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), lctBuilder_, and wireDigiProducer_.
: iev(0) { // if false, parameters will be read in from DB using EventSetup mechanism // else will use all parameters from the config file debugParameters_ = conf.getUntrackedParameter<bool>("debugParameters",false); wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer"); compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer"); checkBadChambers_ = conf.getUntrackedParameter<bool>("checkBadChambers", true); lctBuilder_ = new CSCTriggerPrimitivesBuilder(conf); // pass on the conf // register what this produces produces<CSCALCTDigiCollection>(); produces<CSCCLCTDigiCollection>(); produces<CSCCLCTPreTriggerCollection>(); produces<CSCCorrelatedLCTDigiCollection>(); produces<CSCCorrelatedLCTDigiCollection>("MPCSORTED"); }
CSCTriggerPrimitivesProducer::~CSCTriggerPrimitivesProducer | ( | ) |
Definition at line 58 of file CSCTriggerPrimitivesProducer.cc.
References iev, lctBuilder_, and LogDebug.
{ LogDebug("L1CSCTrigger") << "deleting trigger primitives after " << iev << " events."; delete lctBuilder_; }
void CSCTriggerPrimitivesProducer::produce | ( | edm::Event & | ev, |
const edm::EventSetup & | setup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 67 of file CSCTriggerPrimitivesProducer.cc.
References CSCTriggerPrimitivesBuilder::build(), checkBadChambers_, compDigiProducer_, dbtoconf::conf, debugParameters_, edm::EventSetup::get(), edm::Event::getByLabel(), h, iev, edm::InputTag::instance(), edm::HandleBase::isValid(), edm::InputTag::label(), lctBuilder_, LogDebug, edm::ESHandle< T >::product(), edm::Handle< T >::product(), edm::Event::put(), CSCTriggerPrimitivesBuilder::setConfigParameters(), CSCTriggerGeometry::setGeometry(), groupFilesInBlocks::temp, and wireDigiProducer_.
{ LogDebug("L1CSCTrigger") << "start producing LCTs for event " << ++iev; // Find the geometry (& conditions?) for this event & cache it in // CSCTriggerGeometry. { edm::ESHandle<CSCGeometry> h; setup.get<MuonGeometryRecord>().get(h); CSCTriggerGeometry::setGeometry(h); } // Find conditions data for bad chambers. edm::ESHandle<CSCBadChambers> pBadChambers; setup.get<CSCBadChambersRcd>().get(pBadChambers); // If !debugParameters then get config parameters using EventSetup mechanism. // This must be done in produce() for every event and not in beginJob() // (see mail from Jim Brooke sent to hn-cms-L1TrigEmulator on July 30, 2007). if (!debugParameters_) { edm::ESHandle<CSCDBL1TPParameters> conf; setup.get<CSCDBL1TPParametersRcd>().get(conf); if (conf.product() == 0) { edm::LogError("L1CSCTPEmulatorConfigError") << "+++ Failed to find a CSCDBL1TPParametersRcd in EventSetup! +++\n" << "+++ Cannot continue emulation without these parameters +++\n"; return; } lctBuilder_->setConfigParameters(conf.product()); } // Get the collections of comparator & wire digis from event. edm::Handle<CSCComparatorDigiCollection> compDigis; edm::Handle<CSCWireDigiCollection> wireDigis; ev.getByLabel(compDigiProducer_.label(), compDigiProducer_.instance(), compDigis); ev.getByLabel(wireDigiProducer_.label(), wireDigiProducer_.instance(), wireDigis); // Create empty collections of ALCTs, CLCTs, and correlated LCTs upstream // and downstream of MPC. std::auto_ptr<CSCALCTDigiCollection> oc_alct(new CSCALCTDigiCollection); std::auto_ptr<CSCCLCTDigiCollection> oc_clct(new CSCCLCTDigiCollection); std::auto_ptr<CSCCLCTPreTriggerCollection> oc_pretrig(new CSCCLCTPreTriggerCollection); std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_lct(new CSCCorrelatedLCTDigiCollection); std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_sorted_lct(new CSCCorrelatedLCTDigiCollection); if (!wireDigis.isValid()) { edm::LogWarning("L1CSCTPEmulatorNoInputCollection") << "+++ Warning: Collection of wire digis with label " << wireDigiProducer_.label() << " requested in configuration, but not found in the event..." << " Skipping production of CSC TP digis +++\n"; } if (!compDigis.isValid()) { edm::LogWarning("L1CSCTPEmulatorNoInputCollection") << "+++ Warning: Collection of comparator digis with label " << compDigiProducer_.label() << " requested in configuration, but not found in the event..." << " Skipping production of CSC TP digis +++\n"; } // Fill output collections if valid input collections are available. if (wireDigis.isValid() && compDigis.isValid()) { const CSCBadChambers* temp = checkBadChambers_ ? pBadChambers.product() : new CSCBadChambers; lctBuilder_->build(temp, wireDigis.product(), compDigis.product(), *oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct); if (!checkBadChambers_) delete temp; } // Put collections in event. ev.put(oc_alct); ev.put(oc_clct); ev.put(oc_pretrig); ev.put(oc_lct); ev.put(oc_sorted_lct,"MPCSORTED"); }
bool CSCTriggerPrimitivesProducer::checkBadChambers_ [private] |
Definition at line 48 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), and produce().
Definition at line 43 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), and produce().
bool CSCTriggerPrimitivesProducer::debugParameters_ [private] |
Definition at line 46 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), and produce().
int CSCTriggerPrimitivesProducer::iev [private] |
Definition at line 42 of file CSCTriggerPrimitivesProducer.h.
Referenced by produce(), and ~CSCTriggerPrimitivesProducer().
Definition at line 49 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), produce(), and ~CSCTriggerPrimitivesProducer().
Definition at line 44 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), and produce().