#include <CSCTriggerPrimitivesProducer.h>
Public Member Functions | |
CSCTriggerPrimitivesProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~CSCTriggerPrimitivesProducer () | |
Private Attributes | |
edm::InputTag | compDigiProducer_ |
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 33 of file CSCTriggerPrimitivesProducer.h.
CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer | ( | const edm::ParameterSet & | conf | ) | [explicit] |
Definition at line 39 of file CSCTriggerPrimitivesProducer.cc.
References compDigiProducer_, edm::ParameterSet::getParameter(), lctBuilder_, and wireDigiProducer_.
: iev(0) { wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer"); compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer"); 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 54 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 63 of file CSCTriggerPrimitivesProducer.cc.
References CSCTriggerPrimitivesBuilder::build(), compDigiProducer_, dbtoconf::conf, 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(), 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); // 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). 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()) { lctBuilder_->build(pBadChambers.product(), wireDigis.product(), compDigis.product(), *oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct); } // 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"); }
Definition at line 44 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), and produce().
int CSCTriggerPrimitivesProducer::iev [private] |
Definition at line 43 of file CSCTriggerPrimitivesProducer.h.
Referenced by produce(), and ~CSCTriggerPrimitivesProducer().
Definition at line 46 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), produce(), and ~CSCTriggerPrimitivesProducer().
Definition at line 45 of file CSCTriggerPrimitivesProducer.h.
Referenced by CSCTriggerPrimitivesProducer(), and produce().