CMS 3D CMS Logo

Public Member Functions | Private Attributes

DTTrigProd Class Reference

#include <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
short int my_lut_btic
bool my_lut_dump_flag
edm::ParameterSet my_params
DTTrigmy_trig

Detailed Description

Main EDProducer for the DTTPG

Date:
2009/11/02 14:18:30
Revision:
1.7
Author:
C. Battilana

Main EDProducer for the DTTPG

Date:
2010/05/14 12:57:28
Revision:
1.16
Author:
C. Battilana

Definition at line 29 of file DTTrigProd.h.


Constructor & Destructor Documentation

DTTrigProd::DTTrigProd ( const edm::ParameterSet pset)

Constructor.

Definition at line 47 of file DTTrigProd.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), my_debug, my_DTTFnum, my_lut_btic, my_lut_dump_flag, my_params, and CrabTask::pset.

                                               : my_trig(0) {
  
  produces<L1MuDTChambPhContainer>();
  produces<L1MuDTChambThContainer>();

  my_debug = pset.getUntrackedParameter<bool>("debug");
  my_DTTFnum = pset.getParameter<bool>("DTTFSectorNumbering");
  my_params = pset;

  my_lut_dump_flag = pset.getUntrackedParameter<bool>("lut_dump_flag");
  my_lut_btic = pset.getUntrackedParameter<int>("lut_btic");
}
DTTrigProd::~DTTrigProd ( )

Destructor.

Definition at line 60 of file DTTrigProd.cc.

References my_trig.

                       {

  if (my_trig) delete my_trig;

}

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 79 of file DTTrigProd.cc.

References gather_cfg::cout, DTTrig::createTUs(), DTTrig::dumpLuts(), edm::EventSetup::get(), edm::RunBase::id(), my_debug, my_lut_btic, my_lut_dump_flag, my_params, my_trig, and edm::RunID::run().

                                                                        {

   if(my_debug)
        cout << "DTTrigProd::beginRun  " << iRun.id().run() << endl;

   using namespace edm;

   ESHandle< DTConfigManager > dtConfig ;
   iEventSetup.get< DTConfigManagerRcd >().get( dtConfig ) ;

   if(my_debug)
   {
        cout << "DTConfigManagerRcd : Print some Config stuff" << endl;
        DTBtiId btiid(1,1,1,1,1);
        DTTracoId tracoid(1,1,1,1);
        DTChamberId chid(1,1,1);
        DTSectCollId scid(1,1);
        cout    << "BtiMap & TracoMap Size for chamber (1,1,1):" << dtConfig->getDTConfigBtiMap(chid).size() 
                << " " << dtConfig->getDTConfigTracoMap(chid).size() << endl;

        dtConfig->getDTConfigBti(btiid)->print();
        dtConfig->getDTConfigTraco(tracoid)->print();
        dtConfig->getDTConfigTSTheta(chid)->print();
        dtConfig->getDTConfigTSPhi(chid)->print();
        // 100511 SV LUTs will NOT be configurated from cfg if not found in DB
        //dtConfig->getDTConfigLUTs(chid)->print(); 
  }


  if (!my_trig) {
    my_trig = new DTTrig(my_params);
    my_trig->createTUs(iEventSetup);
    if (my_debug)
      cout << "[DTTrigProd] TU's Created" << endl;

    //SV 090903 check luts
    if(my_lut_dump_flag) {
        cout << "Dumping luts...." << endl;
        my_trig->dumpLuts(my_lut_btic, dtConfig.product());
    }   
  }

}
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 124 of file DTTrigProd.cc.

References gather_cfg::cout, DTTrig::getBXOffset(), i, edm::EventBase::id(), my_BXoffset, my_debug, my_DTTFnum, my_trig, pos, edm::Event::put(), DTTrig::SCPhTrigs(), DTTrig::SCThTrigs(), ExpressReco_HICollisions_FallBack::step, and DTTrig::triggerReco().

                                                                     {

  my_trig->triggerReco(iEvent,iEventSetup);
  my_BXoffset = my_trig->getBXOffset();
  
  if (my_debug)
    cout << "[DTTrigProd] Trigger algorithm run for " <<iEvent.id() << endl;
  
  // Convert Phi Segments
  SectCollPhiColl myPhiSegments;
  myPhiSegments = my_trig->SCPhTrigs();
  vector<L1MuDTChambPhDigi> outPhi;

  SectCollPhiColl_iterator SCPCend = myPhiSegments.end();
  for (SectCollPhiColl_iterator it=myPhiSegments.begin();it!=SCPCend;++it){
    int step = (*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing)
    int sc_sector = (*it).SCId().sector();
    if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11]
    outPhi.push_back(L1MuDTChambPhDigi(step,
                                       (*it).ChamberId().wheel(),
                                       sc_sector,
                                       (*it).ChamberId().station(),
                                       (*it).phi(),
                                       (*it).phiB(),
                                       (*it).code(),
                                       !(*it).isFirst(),
                                       0
                                       ));
  }

  // Convert Theta Segments
  SectCollThetaColl myThetaSegments;
  myThetaSegments = my_trig->SCThTrigs();
  vector<L1MuDTChambThDigi> outTheta;
  
  SectCollThetaColl_iterator SCTCend = myThetaSegments.end();
  for (SectCollThetaColl_iterator it=myThetaSegments.begin();it!=SCTCend;++it){
    int pos[7], qual[7];
    for (int i=0; i<7; i++){
      pos[i] =(*it).position(i);
      qual[i]=(*it).quality(i);
    }
    int step =(*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing)
    int sc_sector =  (*it).SCId().sector();
    if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11]
    outTheta.push_back(L1MuDTChambThDigi( step,
                                         (*it).ChamberId().wheel(),
                                         sc_sector,
                                         (*it).ChamberId().station(),
                                         pos,
                                         qual
                                         ));
  }

   // Write everything into the event
   std::auto_ptr<L1MuDTChambPhContainer> resultPhi (new L1MuDTChambPhContainer);
   resultPhi->setContainer(outPhi);
   iEvent.put(resultPhi);
   std::auto_ptr<L1MuDTChambThContainer> resultTheta (new L1MuDTChambThContainer);
   resultTheta->setContainer(outTheta);
   iEvent.put(resultTheta);

}

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

short int DTTrigProd::my_lut_btic [private]

Definition at line 61 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

Definition at line 60 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

Definition at line 64 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

Definition at line 48 of file DTTrigProd.h.

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