#include <L1Trigger/CSCTriggerPrimitives/plugins/CSCTriggerPrimitivesProducer.h>
Public Member Functions | |
virtual void | beginJob (const edm::EventSetup &setup) |
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_ |
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_.
00039 : iev(0) { 00040 00041 wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer"); 00042 compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer"); 00043 00044 lctBuilder_ = new CSCTriggerPrimitivesBuilder(conf); // pass on the conf 00045 00046 // register what this produces 00047 produces<CSCALCTDigiCollection>(); 00048 produces<CSCCLCTDigiCollection>(); 00049 produces<CSCCorrelatedLCTDigiCollection>(); 00050 produces<CSCCorrelatedLCTDigiCollection>("MPCSORTED"); 00051 }
CSCTriggerPrimitivesProducer::~CSCTriggerPrimitivesProducer | ( | ) |
Definition at line 53 of file CSCTriggerPrimitivesProducer.cc.
References iev, lctBuilder_, and LogDebug.
00053 { 00054 LogDebug("L1CSCTrigger") 00055 << "deleting trigger primitives after " << iev << " events."; 00056 delete lctBuilder_; 00057 //TimingReport::current()->dump(std::cout); 00058 }
void CSCTriggerPrimitivesProducer::beginJob | ( | const edm::EventSetup & | setup | ) | [virtual] |
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::InputTag::label(), lctBuilder_, LogDebug, edm::ESHandle< T >::product(), edm::Handle< T >::product(), edm::Event::put(), CSCTriggerPrimitivesBuilder::setConfigParameters(), CSCTriggerGeometry::setGeometry(), and wireDigiProducer_.
00064 { 00065 //static TimingReport::Item & lctTimer = 00066 // (*TimingReport::current())["CSCTriggerPrimitivesProducer:produce"]; 00067 //TimeMe t(lctTimer, false); 00068 00069 LogDebug("L1CSCTrigger") << "start producing LCTs for event " << ++iev; 00070 00071 // Find the geometry (& conditions?) for this event & cache it in 00072 // CSCTriggerGeometry. 00073 edm::ESHandle<CSCGeometry> h; 00074 setup.get<MuonGeometryRecord>().get(h); 00075 CSCTriggerGeometry::setGeometry(h); 00076 00077 // Get config. parameters using EventSetup mechanism. This must be done 00078 // in produce() for every event and not in beginJob() (see mail from 00079 // Jim Brooke sent to hn-cms-L1TrigEmulator on July 30, 2007). 00080 edm::ESHandle<CSCL1TPParameters> conf; 00081 setup.get<CSCL1TPParametersRcd>().get(conf); 00082 if (conf.product() == 0) { 00083 edm::LogError("CSCTriggerPrimitivesProducer") 00084 << "+++ Failed to find a CSCL1TPParametersRcd in EventSetup! +++\n" 00085 << "+++ Cannot continue emulation without these parameters +++\n"; 00086 return; 00087 } 00088 lctBuilder_->setConfigParameters(conf.product()); 00089 00090 // Get the collections of comparator & wire digis from event. 00091 edm::Handle<CSCComparatorDigiCollection> compDigis; 00092 edm::Handle<CSCWireDigiCollection> wireDigis; 00093 ev.getByLabel(compDigiProducer_.label(), compDigiProducer_.instance(), compDigis); 00094 ev.getByLabel(wireDigiProducer_.label(), wireDigiProducer_.instance(), wireDigis); 00095 00096 // Create empty collections of ALCTs, CLCTs, and correlated LCTs upstream 00097 // and downstream of MPC. 00098 std::auto_ptr<CSCALCTDigiCollection> oc_alct(new CSCALCTDigiCollection); 00099 std::auto_ptr<CSCCLCTDigiCollection> oc_clct(new CSCCLCTDigiCollection); 00100 std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_lct(new CSCCorrelatedLCTDigiCollection); 00101 std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_sorted_lct(new CSCCorrelatedLCTDigiCollection); 00102 00103 // Fill collections. 00104 lctBuilder_->build(wireDigis.product(), compDigis.product(), 00105 *oc_alct, *oc_clct, *oc_lct, *oc_sorted_lct); 00106 00107 // Put collections in event. 00108 ev.put(oc_alct); 00109 ev.put(oc_clct); 00110 ev.put(oc_lct); 00111 ev.put(oc_sorted_lct,"MPCSORTED"); 00112 }
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().