CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonCandProducerMon Class Reference

#include <MuonCandProducerMon.h>

Inheritance diagram for MuonCandProducerMon:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 MuonCandProducerMon (const edm::ParameterSet &)
 
 ~MuonCandProducerMon ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginJob (void)
 
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_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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_.

10  {
11 
12  verbose_ = pset.getUntrackedParameter<int>("VerboseFlag", 0);
13 
15  (edm::InputTag) ("csctfdigis"));
17  (edm::InputTag) ("dttfdigis"));
18 
19  cscPtLUT_ = 0;
20  m_scalesCacheID = 0;
21  m_ptScaleCacheID = 0;
22 
23  produces<std::vector<L1MuRegionalCand> >("CSC");
24  produces<std::vector<L1MuRegionalCand> >("DT");
25 }
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long m_scalesCacheID
unsigned long long m_ptScaleCacheID
MuonCandProducerMon::~MuonCandProducerMon ( )

Definition at line 27 of file MuonCandProducerMon.cc.

27  {
28 }

Member Function Documentation

virtual void MuonCandProducerMon::beginJob ( void  )
inlineprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 40 of file MuonCandProducerMon.h.

40 {};
void MuonCandProducerMon::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 30 of file MuonCandProducerMon.cc.

References cscPtLUT_.

30  {
31  if (cscPtLUT_)
32  delete cscPtLUT_;
33 }
void MuonCandProducerMon::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 35 of file MuonCandProducerMon.cc.

References edm::ParameterSet::addParameter(), edm::ParameterSet::addUntrackedParameter(), edm::eventsetup::EventSetupRecord::cacheIdentifier(), CSCinput_, cscPtLUT_, csc::L1Track::decodeRank(), DTinput_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::HandleBase::isValid(), m_ptScaleCacheID, m_scalesCacheID, edm::ESHandle< class >::product(), CSCTFPtLUT::Pt(), and edm::Event::put().

36  {
37 
39  iEvent.getByLabel(CSCinput_, CSCtracks);
40 
42  iEvent.getByLabel(DTinput_, DTtracks);
43 
44  std::auto_ptr<std::vector<L1MuRegionalCand> > csc_product(
45  new std::vector<L1MuRegionalCand>);
46 
47  std::auto_ptr<std::vector<L1MuRegionalCand> > dt_product(
48  new std::vector<L1MuRegionalCand>);
49 
50  if (!CSCtracks.isValid()) {
51 
52  csc_product->push_back(L1MuRegionalCand());
53 
54  } else {
55 
56  typedef L1CSCTrackCollection::const_iterator ctcIt;
57 
58  for (ctcIt tcit = CSCtracks->begin(); tcit != CSCtracks->end(); tcit++) {
59 
60  L1MuRegionalCand cand(tcit->first.getDataWord(), tcit->first.bx());
61 
62  // set pt value
63 
64  // Update CSCTFTrackBuilder only if the scales have changed. Use the
65  // EventSetup cacheIdentifier to tell when this has happened.
68  || iSetup.get<L1MuTriggerPtScaleRcd>().cacheIdentifier()
69  != m_ptScaleCacheID) {
70  if (cscPtLUT_)
71  delete cscPtLUT_;
73  iSetup.get<L1MuTriggerScalesRcd>().get(scales);
75  iSetup.get<L1MuTriggerPtScaleRcd>().get(ptScale);
76  // Create a dummy pset for CSC Pt LUTs
77 
78  edm::ParameterSet ptLUTset;
79  ptLUTset.addParameter<bool>("ReadPtLUT", false);
80  ptLUTset.addParameter<bool>("isBinary", false);
81  ptLUTset.addUntrackedParameter<std::string>("LUTPath", "./");
82 
83  cscPtLUT_ = new CSCTFPtLUT(ptLUTset, scales.product(),
84  ptScale.product());
86  = iSetup.get<L1MuTriggerScalesRcd>().cacheIdentifier();
88  = iSetup.get<L1MuTriggerPtScaleRcd>().cacheIdentifier();
89  }
90 
91  ptadd thePtAddress(tcit->first.ptLUTAddress());
92  ptdat thePtData = cscPtLUT_->Pt(thePtAddress);
93  const unsigned int rank =
94  (thePtAddress.track_fr ? thePtData.front_rank
95  : thePtData.rear_rank);
96  unsigned int quality = 0;
97  unsigned int pt = 0;
98  csc::L1Track::decodeRank(rank, pt, quality);
99  cand.setQualityPacked(quality & 0x3);
100  cand.setPtPacked(pt & 0x1f);
101  csc_product->push_back(cand);
102  }
103  }
104 
105  if (!DTtracks.isValid()) {
106 
107  dt_product->push_back(L1MuRegionalCand());
108 
109  } else {
110 
111  typedef std::vector<L1MuDTTrackCand>::const_iterator ctcIt;
112 
113  std::vector<L1MuDTTrackCand> *dttc = DTtracks->getContainer();
114 
115  for (ctcIt it = dttc->begin(); it != dttc->end(); it++) {
116  dt_product->push_back(L1MuRegionalCand(*it));
117  }
118  }
119 
120  iEvent.put(csc_product, "CSC");
121  iEvent.put(dt_product, "DT");
122 }
unsigned long long cacheIdentifier() const
unsigned long long m_scalesCacheID
unsigned long long m_ptScaleCacheID
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
static void decodeRank(const unsigned &rank, unsigned &pt, unsigned &quality)
Definition: L1Track.cc:140
class pt_address ptadd
class pt_data ptdat
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:209
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
int MuonCandProducerMon::verbose ( )
inlineprivate

Definition at line 45 of file MuonCandProducerMon.h.

References verbose_.

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