CMS 3D CMS Logo

DTTrigProd Class Reference

Main EDProducer for the DTTPG. More...

#include <L1Trigger/DTTrigger/interface/DTTrigProd.h>

Inheritance diagram for DTTrigProd:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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
DTTrigmy_trig


Detailed Description

Main EDProducer for the DTTPG.

Date
2008/09/05 16:06:35
Revision
1.6

Author:
C. Battilana
Date
2008/09/05 16:06:35
Revision
1.12

Author:
C. Battilana

Definition at line 29 of file DTTrigProd.h.


Constructor & Destructor Documentation

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 (  ) 

Destructor.

Definition at line 57 of file DTTrigProd.cc.

References my_trig.

00057                        {
00058 
00059   if (my_trig) delete my_trig;
00060 
00061 }


Member Function Documentation

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 }


Member Data Documentation

int DTTrigProd::my_BXoffset [private]

Definition at line 54 of file DTTrigProd.h.

Referenced by produce().

bool DTTrigProd::my_debug [private]

Definition at line 57 of file DTTrigProd.h.

Referenced by beginRun(), DTTrigProd(), and produce().

bool DTTrigProd::my_DTTFnum [private]

Definition at line 51 of file DTTrigProd.h.

Referenced by DTTrigProd(), and produce().

edm::ParameterSet DTTrigProd::my_params [private]

Definition at line 60 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

DTTrig* DTTrigProd::my_trig [private]

Definition at line 48 of file DTTrigProd.h.

Referenced by beginRun(), produce(), and ~DTTrigProd().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:09 2009 for CMSSW by  doxygen 1.5.4