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
ResolutionAnalyzer Class Reference

#include <MuonAnalysis/MomentumScaleCalibration/plugins/ResolutionAnalyzer.cc>

Inheritance diagram for ResolutionAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ResolutionAnalyzer (const edm::ParameterSet &)
 
 ~ResolutionAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
bool checkDeltaR (const reco::Particle::LorentzVector &genMu, const reco::Particle::LorentzVector &recMu)
 Returns true if the two particles have DeltaR < cut. More...
 
virtual void endJob ()
 
void fillHistoMap ()
 Used to fill the map with the histograms needed. More...
 
template<typename T >
std::vector< reco::LeafCandidatefillMuonCollection (const std::vector< T > &tracks)
 
void writeHistoMap ()
 Writes the histograms in the map. More...
 

Private Attributes

bool debug_
 
TH1D * deltaPtOverPt_
 
TH1D * deltaPtOverPtForEta12_
 
int eventCounter_
 
std::map< std::string,
Histograms * > 
mapHisto_
 
HCovarianceVSxymassResolutionVsPtEta_
 
int32_t maxEvents_
 
TFile * outputFile_
 
double ptMax_
 
bool readCovariances_
 
TH2D * recoPtVsgenPt_
 
TH2D * recoPtVsgenPtEta12_
 
bool resonance_
 
std::string theCovariancesRootFileName_
 
edm::InputTag theMuonLabel_
 
int theMuonType_
 
std::string theRootFileName_
 
TString treeFileName_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 65 of file ResolutionAnalyzer.h.

Constructor & Destructor Documentation

ResolutionAnalyzer::ResolutionAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 19 of file ResolutionAnalyzer.cc.

ResolutionAnalyzer::~ResolutionAnalyzer ( )

Definition at line 54 of file ResolutionAnalyzer.cc.

Member Function Documentation

void ResolutionAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 68 of file ResolutionAnalyzer.cc.

bool ResolutionAnalyzer::checkDeltaR ( const reco::Particle::LorentzVector genMu,
const reco::Particle::LorentzVector recMu 
)
private

Returns true if the two particles have DeltaR < cut.

Definition at line 552 of file ResolutionAnalyzer.cc.

virtual void ResolutionAnalyzer::endJob ( void  )
inlineprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file ResolutionAnalyzer.h.

72 {};
void ResolutionAnalyzer::fillHistoMap ( )
private

Used to fill the map with the histograms needed.

Definition at line 420 of file ResolutionAnalyzer.cc.

template<typename T >
std::vector<reco::LeafCandidate> ResolutionAnalyzer::fillMuonCollection ( const std::vector< T > &  tracks)
inlineprivate

Definition at line 75 of file ResolutionAnalyzer.h.

References gather_cfg::cout, debug_, MuScleFitUtils::goodmuon, MuScleFitUtils::mMu2, RPCpg::mu, metsig::muon, patZpeak::muons, and mathSSE::sqrt().

75  {
76  std::vector<reco::LeafCandidate> muons;
77  typename std::vector<T>::const_iterator track;
78  for (track = tracks.begin(); track != tracks.end(); ++track){
79  reco::Particle::LorentzVector mu(track->px(),track->py(),track->pz(),
80  sqrt(track->p()*track->p() + MuScleFitUtils::mMu2));
82  if (debug_>0) std::cout <<std::setprecision(9)<< "Muon #" << MuScleFitUtils::goodmuon
83  << ": initial value Pt = " << mu.Pt() << std::endl;
84  reco::LeafCandidate muon(track->charge(),mu);
85  // Store muon
86  // ----------
87  muons.push_back( muon );
88  }
89  return muons;
90  }
T sqrt(T t)
Definition: SSEVec.h:18
const int mu
Definition: Constants.h:22
tuple tracks
Definition: testEve_cfg.py:39
static int goodmuon
static const double mMu2
tuple muons
Definition: patZpeak.py:38
tuple cout
Definition: gather_cfg.py:145
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
void ResolutionAnalyzer::writeHistoMap ( )
private

Writes the histograms in the map.

Definition at line 539 of file ResolutionAnalyzer.cc.

Member Data Documentation

bool ResolutionAnalyzer::debug_
private

Definition at line 108 of file ResolutionAnalyzer.h.

Referenced by fillMuonCollection().

TH1D* ResolutionAnalyzer::deltaPtOverPt_
private

Definition at line 124 of file ResolutionAnalyzer.h.

TH1D* ResolutionAnalyzer::deltaPtOverPtForEta12_
private

Definition at line 125 of file ResolutionAnalyzer.h.

int ResolutionAnalyzer::eventCounter_
private

Definition at line 112 of file ResolutionAnalyzer.h.

std::map<std::string, Histograms*> ResolutionAnalyzer::mapHisto_
private

Definition at line 109 of file ResolutionAnalyzer.h.

HCovarianceVSxy* ResolutionAnalyzer::massResolutionVsPtEta_
private

Definition at line 121 of file ResolutionAnalyzer.h.

int32_t ResolutionAnalyzer::maxEvents_
private

Definition at line 117 of file ResolutionAnalyzer.h.

TFile* ResolutionAnalyzer::outputFile_
private

Definition at line 110 of file ResolutionAnalyzer.h.

double ResolutionAnalyzer::ptMax_
private

Definition at line 119 of file ResolutionAnalyzer.h.

bool ResolutionAnalyzer::readCovariances_
private

Definition at line 114 of file ResolutionAnalyzer.h.

TH2D* ResolutionAnalyzer::recoPtVsgenPt_
private

Definition at line 122 of file ResolutionAnalyzer.h.

TH2D* ResolutionAnalyzer::recoPtVsgenPtEta12_
private

Definition at line 123 of file ResolutionAnalyzer.h.

bool ResolutionAnalyzer::resonance_
private

Definition at line 113 of file ResolutionAnalyzer.h.

std::string ResolutionAnalyzer::theCovariancesRootFileName_
private

Definition at line 107 of file ResolutionAnalyzer.h.

edm::InputTag ResolutionAnalyzer::theMuonLabel_
private

Definition at line 103 of file ResolutionAnalyzer.h.

int ResolutionAnalyzer::theMuonType_
private

Definition at line 105 of file ResolutionAnalyzer.h.

std::string ResolutionAnalyzer::theRootFileName_
private

Definition at line 106 of file ResolutionAnalyzer.h.

TString ResolutionAnalyzer::treeFileName_
private

Definition at line 116 of file ResolutionAnalyzer.h.