CMS 3D CMS Logo

MuonCandProducerMon Class Reference

#include <L1Trigger/HardwareValidation/plugins/MuonCandProducerMon.h>

Inheritance diagram for MuonCandProducerMon:

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

List of all members.

Public Member Functions

 MuonCandProducerMon (const edm::ParameterSet &)
 ~MuonCandProducerMon ()

Private Member Functions

virtual void beginJob (const edm::EventSetup &)
virtual void endJob ()
virtual void produce (edm::Event &, const edm::EventSetup &)
int verbose ()

Private Attributes

edm::InputTag CSCinput_
CSCTFPtLUTcscPtLUT_
edm::InputTag DTinput_
unsigned long long m_ptScaleCacheID
unsigned long long m_scalesCacheID
int verbose_


Detailed Description

Definition at line 32 of file MuonCandProducerMon.h.


Constructor & Destructor Documentation

MuonCandProducerMon::MuonCandProducerMon ( const edm::ParameterSet pset  )  [explicit]

Definition at line 10 of file MuonCandProducerMon.cc.

References CSCinput_, cscPtLUT_, DTinput_, edm::ParameterSet::getUntrackedParameter(), m_ptScaleCacheID, m_scalesCacheID, and verbose_.

00010                                                                     {
00011 
00012   verbose_ = pset.getUntrackedParameter<int>("VerboseFlag",0);
00013 
00014   CSCinput_ = pset.getUntrackedParameter<edm::InputTag>("CSCinput",(edm::InputTag)("csctfdigis"));
00015   DTinput_ = pset.getUntrackedParameter<edm::InputTag>("DTinput",(edm::InputTag)("dttfdigis"));
00016 
00017   cscPtLUT_  = 0;
00018   m_scalesCacheID  = 0;
00019   m_ptScaleCacheID = 0;
00020 
00021   produces<std::vector<L1MuRegionalCand> >("CSC");
00022   produces<std::vector<L1MuRegionalCand> >("DT");
00023 }

MuonCandProducerMon::~MuonCandProducerMon (  ) 

Definition at line 25 of file MuonCandProducerMon.cc.

00025 {}


Member Function Documentation

void MuonCandProducerMon::beginJob ( const edm::EventSetup  )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 27 of file MuonCandProducerMon.cc.

00027 {}

void MuonCandProducerMon::endJob ( void   )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 29 of file MuonCandProducerMon.cc.

References cscPtLUT_.

00029                                  {
00030   if( cscPtLUT_ ) delete cscPtLUT_;
00031 }

void MuonCandProducerMon::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 34 of file MuonCandProducerMon.cc.

References edm::ParameterSet::addUntrackedParameter(), CSCinput_, cscPtLUT_, csc::L1Track::decodeRank(), DTinput_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::Handle< T >::isValid(), it, m_ptScaleCacheID, m_scalesCacheID, edm::ESHandle< T >::product(), CSCTFPtLUT::Pt(), and edm::Event::put().

00034                                                                           {
00035 
00036   edm::Handle<L1CSCTrackCollection> CSCtracks;
00037   iEvent.getByLabel(CSCinput_, CSCtracks);
00038 
00039   edm::Handle<L1MuDTTrackContainer> DTtracks;
00040   iEvent.getByLabel(DTinput_, DTtracks);
00041 
00042   std::auto_ptr<std::vector<L1MuRegionalCand> >
00043     csc_product(new std::vector<L1MuRegionalCand>);
00044 
00045   std::auto_ptr<std::vector<L1MuRegionalCand> >
00046     dt_product(new std::vector<L1MuRegionalCand>);
00047 
00048 
00049   if(!CSCtracks.isValid()) {
00050 
00051     csc_product->push_back(L1MuRegionalCand());
00052 
00053   } else {
00054 
00055     typedef L1CSCTrackCollection::const_iterator ctcIt;
00056 
00057     for(ctcIt tcit=CSCtracks->begin(); tcit!=CSCtracks->end(); tcit++) {
00058 
00059       L1MuRegionalCand cand(tcit->first.getDataWord(), tcit->first.bx());
00060 
00061       // set pt value
00062 
00063       // Update CSCTFTrackBuilder only if the scales have changed.  Use the
00064       // EventSetup cacheIdentifier to tell when this has happened.
00065       if(  iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier() != m_scalesCacheID ||
00066            iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != m_ptScaleCacheID ) {
00067          if( cscPtLUT_ ) delete cscPtLUT_;
00068          edm::ESHandle< L1MuTriggerScales > scales ;
00069          iSetup.get< L1MuTriggerScalesRcd >().get( scales ) ;
00070          edm::ESHandle< L1MuTriggerPtScale > ptScale ;
00071          iSetup.get< L1MuTriggerPtScaleRcd >().get( ptScale ) ;
00072          // Create a dummy pset for CSC Pt LUTs
00073          edm::ParameterSet ptLUTset;
00074          ptLUTset.addUntrackedParameter<bool>("ReadLUTs", false);
00075          ptLUTset.addUntrackedParameter<bool>("Binary",   false);
00076          ptLUTset.addUntrackedParameter<std::string>("LUTPath", "./");
00077          cscPtLUT_ = new CSCTFPtLUT(ptLUTset,scales.product(),ptScale.product());
00078          m_scalesCacheID = iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier() ;
00079          m_ptScaleCacheID = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() ;
00080       }
00081 
00082       ptadd thePtAddress(tcit->first.ptLUTAddress());
00083       ptdat thePtData = cscPtLUT_->Pt(thePtAddress);
00084       const unsigned int rank =
00085         ( thePtAddress.track_fr ? thePtData.front_rank : thePtData.rear_rank );
00086       unsigned int quality = 0;
00087       unsigned int pt = 0;
00088       csc::L1Track::decodeRank(rank, pt, quality);
00089       cand.setQualityPacked(quality & 0x3);
00090       cand.setPtPacked(pt & 0x1f);
00091       csc_product->push_back(cand);
00092     }
00093   }
00094 
00095   if(!DTtracks.isValid()) {
00096 
00097     dt_product->push_back(L1MuRegionalCand());
00098 
00099   } else {
00100 
00101     typedef std::vector<L1MuDTTrackCand>::const_iterator ctcIt;
00102 
00103     std::vector<L1MuDTTrackCand> *dttc = DTtracks->getContainer();
00104 
00105     for(ctcIt it=dttc->begin(); it!=dttc->end(); it++) {
00106       dt_product->push_back(L1MuRegionalCand(*it));
00107     }
00108   }
00109 
00110   iEvent.put(csc_product,"CSC");
00111   iEvent.put(dt_product,"DT");
00112 }

int MuonCandProducerMon::verbose ( void   )  [inline, private]

Definition at line 45 of file MuonCandProducerMon.h.

References verbose_.

00045 {return verbose_;}


Member Data Documentation

edm::InputTag MuonCandProducerMon::CSCinput_ [private]

Definition at line 50 of file MuonCandProducerMon.h.

Referenced by MuonCandProducerMon(), and produce().

CSCTFPtLUT* MuonCandProducerMon::cscPtLUT_ [private]

Definition at line 52 of file MuonCandProducerMon.h.

Referenced by endJob(), MuonCandProducerMon(), and produce().

edm::InputTag MuonCandProducerMon::DTinput_ [private]

Definition at line 51 of file MuonCandProducerMon.h.

Referenced by MuonCandProducerMon(), and produce().

unsigned long long MuonCandProducerMon::m_ptScaleCacheID [private]

Definition at line 54 of file MuonCandProducerMon.h.

Referenced by MuonCandProducerMon(), and produce().

unsigned long long MuonCandProducerMon::m_scalesCacheID [private]

Definition at line 53 of file MuonCandProducerMon.h.

Referenced by MuonCandProducerMon(), and produce().

int MuonCandProducerMon::verbose_ [private]

Definition at line 49 of file MuonCandProducerMon.h.

Referenced by MuonCandProducerMon(), and verbose().


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