CMS 3D CMS Logo

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

#include <Alignment/MillePedeAlignmentAlgorithm/plugins/ZMuMuMassConstraintParameterFinder.cc>

Inheritance diagram for ZMuMuMassConstraintParameterFinder:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Classes

class  DiMuonInfo
 helper class containing information about a di-muon system More...
 

Public Member Functions

 ZMuMuMassConstraintParameterFinder (const edm::ParameterSet &)
 
 ~ZMuMuMassConstraintParameterFinder ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const double etaMax_
 
const double etaMin_
 
edm::EDGetTokenT
< reco::GenParticleCollection
genParticlesToken_
 
const double maxMassPair_
 
const double minMassPair_
 
DiMuonInfo muonInfo_
 
DiMuonInfo muonInfoFromZ_
 
const int muonPdg_ {13}
 
const double phiMax_
 
const double phiMin_
 
const double pMin_
 
const double ptMin_
 
const int zBosonPdg_ {23}
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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: Determines the generator di-muon invariant-mass distribution

Implementation:

Generator muons are extracted from the genParticles collection and matched to Z-boson decays. The configured selection should match the selection applied on muon tracks in real data to obtain a "true" invariant mass distribution within the selection.

Definition at line 49 of file ZMuMuMassConstraintParameterFinder.cc.

Constructor & Destructor Documentation

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

Definition at line 108 of file ZMuMuMassConstraintParameterFinder.cc.

108  :
109  genParticlesToken_(consumes<reco::GenParticleCollection>(edm::InputTag{"genParticles"})),
110  pMin_(iConfig.getParameter<double>("pMin")),
111  ptMin_(iConfig.getParameter<double>("ptMin")),
112  etaMin_(iConfig.getParameter<double>("etaMin")),
113  etaMax_(iConfig.getParameter<double>("etaMax")),
114  phiMin_(iConfig.getParameter<double>("phiMin")),
115  phiMax_(iConfig.getParameter<double>("phiMax")),
116  minMassPair_(iConfig.getParameter<double>("minMassPair")),
117  maxMassPair_(iConfig.getParameter<double>("maxMassPair")),
120 {
121  usesResource(TFileService::kSharedResource);
123  muonInfo_.setupTree("di_muon", fs);
124  muonInfoFromZ_.setupTree("di_muon_from_Z", fs);
125 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
void setupTree(const std::string &, edm::Service< TFileService > &)
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken_
ZMuMuMassConstraintParameterFinder::~ZMuMuMassConstraintParameterFinder ( )

Definition at line 129 of file ZMuMuMassConstraintParameterFinder.cc.

130 {
131 }

Member Function Documentation

void ZMuMuMassConstraintParameterFinder::analyze ( const edm::Event iEvent,
const edm::EventSetup  
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 141 of file ZMuMuMassConstraintParameterFinder.cc.

References funct::abs(), genParticleCandidates2GenParticles_cfi::genParticles, edm::Event::getByToken(), and edm::Handle< T >::product().

142 {
144  iEvent.getByToken(genParticlesToken_, genParticles);
145 
146  for (const auto& particle: *(genParticles.product())) {
147  if (std::abs(particle.pdgId()) != muonPdg_ || particle.status() != 1) continue;
148  if (particle.p() < pMin_) continue;
149  if (particle.pt() < ptMin_) continue;
150  if (particle.eta() < etaMin_ || particle.eta() > etaMax_) continue;
151  if (particle.phi() < phiMin_ || particle.phi() > phiMax_) continue;
152 
153  muonInfo_.muons().push_back(particle);
154  if (particle.mother()->pdgId() == zBosonPdg_) {
155  muonInfoFromZ_.muons().push_back(particle);
156  }
157  }
158 
159  muonInfo_.fill();
161 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T const * product() const
Definition: Handle.h:81
void ZMuMuMassConstraintParameterFinder::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 167 of file ZMuMuMassConstraintParameterFinder.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and edm::ParameterSetDescription::setComment().

167  {
169  desc.setComment("Extract information on 'Z -> mu mu' decays.");
170  desc.add<double>("pMin", 3.0);
171  desc.add<double>("ptMin", 15.0);
172  desc.add<double>("etaMin", -3.0);
173  desc.add<double>("etaMax", 3.0);
174  desc.add<double>("phiMin", -3.1416);
175  desc.add<double>("phiMax", 3.1416);
176  desc.add<double>("minMassPair", 85.8);
177  desc.add<double>("maxMassPair", 95.8);
178  descriptions.add("zMuMuMassConstraintParameterFinder", desc);
179 }
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const double ZMuMuMassConstraintParameterFinder::etaMax_
private

Definition at line 91 of file ZMuMuMassConstraintParameterFinder.cc.

const double ZMuMuMassConstraintParameterFinder::etaMin_
private

Definition at line 90 of file ZMuMuMassConstraintParameterFinder.cc.

edm::EDGetTokenT<reco::GenParticleCollection> ZMuMuMassConstraintParameterFinder::genParticlesToken_
private

Definition at line 81 of file ZMuMuMassConstraintParameterFinder.cc.

const double ZMuMuMassConstraintParameterFinder::maxMassPair_
private

Definition at line 97 of file ZMuMuMassConstraintParameterFinder.cc.

const double ZMuMuMassConstraintParameterFinder::minMassPair_
private

Definition at line 96 of file ZMuMuMassConstraintParameterFinder.cc.

DiMuonInfo ZMuMuMassConstraintParameterFinder::muonInfo_
private

Definition at line 99 of file ZMuMuMassConstraintParameterFinder.cc.

DiMuonInfo ZMuMuMassConstraintParameterFinder::muonInfoFromZ_
private

Definition at line 100 of file ZMuMuMassConstraintParameterFinder.cc.

const int ZMuMuMassConstraintParameterFinder::muonPdg_ {13}
private

Definition at line 84 of file ZMuMuMassConstraintParameterFinder.cc.

const double ZMuMuMassConstraintParameterFinder::phiMax_
private

Definition at line 93 of file ZMuMuMassConstraintParameterFinder.cc.

const double ZMuMuMassConstraintParameterFinder::phiMin_
private

Definition at line 92 of file ZMuMuMassConstraintParameterFinder.cc.

const double ZMuMuMassConstraintParameterFinder::pMin_
private

Definition at line 88 of file ZMuMuMassConstraintParameterFinder.cc.

const double ZMuMuMassConstraintParameterFinder::ptMin_
private

Definition at line 89 of file ZMuMuMassConstraintParameterFinder.cc.

const int ZMuMuMassConstraintParameterFinder::zBosonPdg_ {23}
private

Definition at line 85 of file ZMuMuMassConstraintParameterFinder.cc.