#include <L1Trigger/DTTrigger/interface/DTTrigProd.h>
Public Member Functions | |
void | beginRun (edm::Run &iRun, const edm::EventSetup &iEventSetup) |
Create Trigger Units before starting event processing. | |
DTTrigProd (const edm::ParameterSet &pset) | |
Constructor. | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iEventSetup) |
Producer: process every event and generates trigger data. | |
~DTTrigProd () | |
Destructor. | |
Private Attributes | |
int | my_BXoffset |
bool | my_debug |
bool | my_DTTFnum |
edm::ParameterSet | my_params |
DTTrig * | my_trig |
Definition at line 29 of file DTTrigProd.h.
DTTrigProd::DTTrigProd | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 46 of file DTTrigProd.cc.
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), my_debug, my_DTTFnum, and my_params.
00046 : my_trig(0) { 00047 00048 produces<L1MuDTChambPhContainer>(); 00049 produces<L1MuDTChambThContainer>(); 00050 00051 my_debug = pset.getUntrackedParameter<bool>("debug"); 00052 my_DTTFnum = pset.getParameter<bool>("DTTFSectorNumbering"); 00053 my_params = pset; 00054 00055 }
DTTrigProd::~DTTrigProd | ( | ) |
void DTTrigProd::beginRun | ( | edm::Run & | iRun, | |
const edm::EventSetup & | iEventSetup | |||
) | [virtual] |
Create Trigger Units before starting event processing.
Reimplemented from edm::EDProducer.
Definition at line 76 of file DTTrigProd.cc.
References GenMuonPlsPt100GeV_cfg::cout, DTTrig::createTUs(), lat::endl(), my_debug, my_params, and my_trig.
00076 { 00077 00078 if (!my_trig) { 00079 my_trig = new DTTrig(my_params); 00080 my_trig->createTUs(iEventSetup); 00081 if (my_debug) 00082 cout << "[DTTrigProd] TU's Created" << endl; 00083 } 00084 00085 }
void DTTrigProd::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iEventSetup | |||
) | [virtual] |
Producer: process every event and generates trigger data.
Implements edm::EDProducer.
Definition at line 88 of file DTTrigProd.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DTTrig::getBXOffset(), i, edm::Event::id(), it, my_BXoffset, my_debug, my_DTTFnum, my_trig, edm::Event::put(), DTTrig::SCPhTrigs(), DTTrig::SCThTrigs(), cmsRelvalreportInput::step, and DTTrig::triggerReco().
00088 { 00089 00090 my_trig->triggerReco(iEvent,iEventSetup); 00091 my_BXoffset = my_trig->getBXOffset(); 00092 00093 if (my_debug) 00094 cout << "[DTTrigProd] Trigger algorithm run for " <<iEvent.id() << endl; 00095 00096 // Convert Phi Segments 00097 SectCollPhiColl myPhiSegments; 00098 myPhiSegments = my_trig->SCPhTrigs(); 00099 vector<L1MuDTChambPhDigi> outPhi; 00100 00101 SectCollPhiColl_iterator SCPCend = myPhiSegments.end(); 00102 for (SectCollPhiColl_iterator it=myPhiSegments.begin();it!=SCPCend;++it){ 00103 int step = (*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing) 00104 int sc_sector = (*it).SCId().sector(); 00105 if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11] 00106 outPhi.push_back(L1MuDTChambPhDigi(step, 00107 (*it).ChamberId().wheel(), 00108 sc_sector, 00109 (*it).ChamberId().station(), 00110 (*it).phi(), 00111 (*it).phiB(), 00112 (*it).code(), 00113 !(*it).isFirst(), 00114 0 00115 )); 00116 } 00117 00118 // Convert Theta Segments 00119 SectCollThetaColl myThetaSegments; 00120 myThetaSegments = my_trig->SCThTrigs(); 00121 vector<L1MuDTChambThDigi> outTheta; 00122 00123 SectCollThetaColl_iterator SCTCend = myThetaSegments.end(); 00124 for (SectCollThetaColl_iterator it=myThetaSegments.begin();it!=SCTCend;++it){ 00125 int pos[7], qual[7]; 00126 for (int i=0; i<7; i++){ 00127 pos[i] =(*it).position(i); 00128 qual[i]=(*it).quality(i); 00129 } 00130 int step =(*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing) 00131 int sc_sector = (*it).SCId().sector(); 00132 if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11] 00133 outTheta.push_back(L1MuDTChambThDigi( step, 00134 (*it).ChamberId().wheel(), 00135 sc_sector, 00136 (*it).ChamberId().station(), 00137 pos, 00138 qual 00139 )); 00140 } 00141 00142 // Write everything into the event 00143 std::auto_ptr<L1MuDTChambPhContainer> resultPhi (new L1MuDTChambPhContainer); 00144 resultPhi->setContainer(outPhi); 00145 iEvent.put(resultPhi); 00146 std::auto_ptr<L1MuDTChambThContainer> resultTheta (new L1MuDTChambThContainer); 00147 resultTheta->setContainer(outTheta); 00148 iEvent.put(resultTheta); 00149 00150 }
int DTTrigProd::my_BXoffset [private] |
bool DTTrigProd::my_debug [private] |
bool DTTrigProd::my_DTTFnum [private] |
edm::ParameterSet DTTrigProd::my_params [private] |
DTTrig* DTTrigProd::my_trig [private] |