CMS 3D CMS Logo

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 () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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

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

Private Attributes

const double etaMax_
 
const double etaMin_
 
edm::EDGetTokenT< reco::GenParticleCollectiongenParticlesToken_
 
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.

References etaMax_, etaMin_, TFileService::kSharedResource, ZMuMuMassConstraintParameterFinder::DiMuonInfo::maxMassPair_, ZMuMuMassConstraintParameterFinder::DiMuonInfo::minMassPair_, muonInfo_, muonInfoFromZ_, phiMax_, phiMin_, pMin_, ptMin_, ZMuMuMassConstraintParameterFinder::DiMuonInfo::setupTree(), and ~ZMuMuMassConstraintParameterFinder().

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 ( )
override

Definition at line 129 of file ZMuMuMassConstraintParameterFinder.cc.

References analyze().

Referenced by ZMuMuMassConstraintParameterFinder().

130 {
131 }

Member Function Documentation

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

Definition at line 141 of file ZMuMuMassConstraintParameterFinder.cc.

References funct::abs(), etaMax_, etaMin_, ZMuMuMassConstraintParameterFinder::DiMuonInfo::fill(), fillDescriptions(), GenHFHadronMatcher_cfi::genParticles, genParticlesToken_, edm::Event::getByToken(), muonInfo_, muonInfoFromZ_, muonPdg_, ZMuMuMassConstraintParameterFinder::DiMuonInfo::muons(), phiMax_, phiMin_, pMin_, edm::Handle< T >::product(), ptMin_, and zBosonPdg_.

Referenced by ~ZMuMuMassConstraintParameterFinder().

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:519
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(), ZMuMuMassConstraintParameterFinder::DiMuonInfo::DiMuonInfo(), and edm::ParameterSetDescription::setComment().

Referenced by analyze().

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
const double ZMuMuMassConstraintParameterFinder::etaMin_
private
edm::EDGetTokenT<reco::GenParticleCollection> ZMuMuMassConstraintParameterFinder::genParticlesToken_
private

Definition at line 81 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

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
DiMuonInfo ZMuMuMassConstraintParameterFinder::muonInfoFromZ_
private
const int ZMuMuMassConstraintParameterFinder::muonPdg_ {13}
private

Definition at line 84 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

const double ZMuMuMassConstraintParameterFinder::phiMax_
private
const double ZMuMuMassConstraintParameterFinder::phiMin_
private
const double ZMuMuMassConstraintParameterFinder::pMin_
private
const double ZMuMuMassConstraintParameterFinder::ptMin_
private
const int ZMuMuMassConstraintParameterFinder::zBosonPdg_ {23}
private

Definition at line 85 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().