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 Types | Private Member Functions | Private Attributes
RochesterCorrMuonProducerT< T > Class Template Reference

#include <RochesterCorrMuonProducerT.h>

Inheritance diagram for RochesterCorrMuonProducerT< T >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RochesterCorrMuonProducerT (const edm::ParameterSet &cfg)
 
 ~RochesterCorrMuonProducerT ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef std::vector< TMuonCollection
 

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es)
 

Private Attributes

rochcor algorithm_
 
bool isMC_
 
std::string moduleLabel_
 
edm::InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<typename T>
class RochesterCorrMuonProducerT< T >

Apply muon momentum corrections

NOTE: The muon momentum corrections account for residual differences in alignment between MC and data. The corrections are documented on the wiki http://www-cdf.fnal.gov/~jyhan/cms_momscl/cms_rochcor_manual.html and in CMS analysis notes AN-12/062 and AN-12/298.

Author
Christian Veelken, LLR
Version
Revision:
1.2
Id:
RochesterCorrMuonProducerT.h,v 1.2 2013/01/15 14:53:15 veelken Exp

Definition at line 36 of file RochesterCorrMuonProducerT.h.

Member Typedef Documentation

template<typename T >
typedef std::vector<T> RochesterCorrMuonProducerT< T >::MuonCollection
private

Definition at line 38 of file RochesterCorrMuonProducerT.h.

Constructor & Destructor Documentation

template<typename T >
RochesterCorrMuonProducerT< T >::RochesterCorrMuonProducerT ( const edm::ParameterSet cfg)
inlineexplicit
template<typename T >
RochesterCorrMuonProducerT< T >::~RochesterCorrMuonProducerT ( )
inline

Definition at line 50 of file RochesterCorrMuonProducerT.h.

50 {}

Member Function Documentation

template<typename T >
void RochesterCorrMuonProducerT< T >::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineprivatevirtual

Implements edm::EDProducer.

Definition at line 54 of file RochesterCorrMuonProducerT.h.

References RochesterCorrMuonProducerT< T >::algorithm_, relativeConstraints::error, edm::Event::getByLabel(), customizeTrackingMonitorSeedNumber::idx, RochesterCorrMuonProducerT< T >::isMC_, rochcor::momcor_data(), rochcor::momcor_mc(), edm::Event::put(), and RochesterCorrMuonProducerT< T >::src_.

55  {
56  //std::cout << "<RochesterCorrMuonProducer>:" << std::endl;
57 
58  std::auto_ptr<MuonCollection> correctedMuonCollection(new MuonCollection);
59 
60  edm::Handle<MuonCollection> uncorrectedMuonCollection;
61  evt.getByLabel(src_, uncorrectedMuonCollection);
62 
63  int idx = 0;
64  for ( typename MuonCollection::const_iterator uncorrectedMuon = uncorrectedMuonCollection->begin();
65  uncorrectedMuon != uncorrectedMuonCollection->end(); ++uncorrectedMuon ) {
66  //std::cout << " uncorrected Muon #" << idx << ": Pt = " << uncorrectedMuon->pt() << ","
67  // << " eta = " << uncorrectedMuon->eta() << ", phi = " << uncorrectedMuon->phi() << ", mass = " << uncorrectedMuon->mass() << std::endl;
68 
69  TLorentzVector muonP4(uncorrectedMuon->px(), uncorrectedMuon->py(), uncorrectedMuon->pz(), uncorrectedMuon->energy());
70 
71  float error;
72  if ( isMC_ ) algorithm_.momcor_mc(muonP4, uncorrectedMuon->charge(), 0, 0, error);
73  else algorithm_.momcor_data(muonP4, uncorrectedMuon->charge(), 0, 0, error);
74 
75  T correctedMuon(*uncorrectedMuon);
76  // CV: use PolarLorentzVector to preserve muon mass (Rochester muon corrections change muon mass)
77  correctedMuon.setP4(reco::Candidate::PolarLorentzVector(muonP4.Pt(), muonP4.Eta(), muonP4.Phi(), uncorrectedMuon->mass()));
78  //std::cout << " corrected Muon #" << idx << ": Pt = " << correctedMuon.pt() << ","
79  // << " eta = " << correctedMuon.eta() << ", phi = " << correctedMuon.phi() << ", mass = " << correctedMuon.mass() << std::endl;
80 
81  correctedMuonCollection->push_back(correctedMuon);
82 
83  ++idx;
84  }
85 
86  evt.put(correctedMuonCollection);
87  }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
void momcor_mc(TLorentzVector &, float, float, int, float &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:405
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void momcor_data(TLorentzVector &, float, float, int, float &)
long double T
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39

Member Data Documentation

template<typename T >
rochcor RochesterCorrMuonProducerT< T >::algorithm_
private
template<typename T >
bool RochesterCorrMuonProducerT< T >::isMC_
private
template<typename T >
std::string RochesterCorrMuonProducerT< T >::moduleLabel_
private
template<typename T >
edm::InputTag RochesterCorrMuonProducerT< T >::src_
private