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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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 47 of file ZMuMuMassConstraintParameterFinder.cc.

Constructor & Destructor Documentation

◆ ZMuMuMassConstraintParameterFinder()

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

Definition at line 102 of file ZMuMuMassConstraintParameterFinder.cc.

103  : genParticlesToken_(consumes<reco::GenParticleCollection>(edm::InputTag{"genParticles"})),
104  pMin_(iConfig.getParameter<double>("pMin")),
105  ptMin_(iConfig.getParameter<double>("ptMin")),
106  etaMin_(iConfig.getParameter<double>("etaMin")),
107  etaMax_(iConfig.getParameter<double>("etaMax")),
108  phiMin_(iConfig.getParameter<double>("phiMin")),
109  phiMax_(iConfig.getParameter<double>("phiMax")),
110  minMassPair_(iConfig.getParameter<double>("minMassPair")),
111  maxMassPair_(iConfig.getParameter<double>("maxMassPair")),
114  usesResource(TFileService::kSharedResource);
116  muonInfo_.setupTree("di_muon", fs);
117  muonInfoFromZ_.setupTree("di_muon_from_Z", fs);
118 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void setupTree(const std::string &, edm::Service< TFileService > &)
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken_

◆ ~ZMuMuMassConstraintParameterFinder()

ZMuMuMassConstraintParameterFinder::~ZMuMuMassConstraintParameterFinder ( )
override

Definition at line 120 of file ZMuMuMassConstraintParameterFinder.cc.

120 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 127 of file ZMuMuMassConstraintParameterFinder.cc.

References funct::abs(), etaMax_, etaMin_, ZMuMuMassConstraintParameterFinder::DiMuonInfo::fill(), AJJGenJetFilter_cfi::genParticles, genParticlesToken_, iEvent, muonInfo_, muonInfoFromZ_, muonPdg_, ZMuMuMassConstraintParameterFinder::DiMuonInfo::muons(), phiMax_, phiMin_, pMin_, ptMin_, and zBosonPdg_.

127  {
130 
131  for (const auto& particle : *(genParticles.product())) {
132  if (std::abs(particle.pdgId()) != muonPdg_ || particle.status() != 1)
133  continue;
134  if (particle.p() < pMin_)
135  continue;
136  if (particle.pt() < ptMin_)
137  continue;
138  if (particle.eta() < etaMin_ || particle.eta() > etaMax_)
139  continue;
140  if (particle.phi() < phiMin_ || particle.phi() > phiMax_)
141  continue;
142 
143  muonInfo_.muons().push_back(particle);
144  if (particle.mother()->pdgId() == zBosonPdg_) {
145  muonInfoFromZ_.muons().push_back(particle);
146  }
147  }
148 
149  muonInfo_.fill();
151 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ fillDescriptions()

void ZMuMuMassConstraintParameterFinder::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 154 of file ZMuMuMassConstraintParameterFinder.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

154  {
156  desc.setComment("Extract information on 'Z -> mu mu' decays.");
157  desc.add<double>("pMin", 3.0);
158  desc.add<double>("ptMin", 15.0);
159  desc.add<double>("etaMin", -3.0);
160  desc.add<double>("etaMax", 3.0);
161  desc.add<double>("phiMin", -3.1416);
162  desc.add<double>("phiMax", 3.1416);
163  desc.add<double>("minMassPair", 85.8);
164  desc.add<double>("maxMassPair", 95.8);
165  descriptions.add("zMuMuMassConstraintParameterFinder", desc);
166 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ etaMax_

const double ZMuMuMassConstraintParameterFinder::etaMax_
private

Definition at line 87 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ etaMin_

const double ZMuMuMassConstraintParameterFinder::etaMin_
private

Definition at line 86 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ genParticlesToken_

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

Definition at line 77 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ maxMassPair_

const double ZMuMuMassConstraintParameterFinder::maxMassPair_
private

◆ minMassPair_

const double ZMuMuMassConstraintParameterFinder::minMassPair_
private

◆ muonInfo_

DiMuonInfo ZMuMuMassConstraintParameterFinder::muonInfo_
private

Definition at line 95 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ muonInfoFromZ_

DiMuonInfo ZMuMuMassConstraintParameterFinder::muonInfoFromZ_
private

Definition at line 96 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ muonPdg_

const int ZMuMuMassConstraintParameterFinder::muonPdg_ {13}
private

Definition at line 80 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ phiMax_

const double ZMuMuMassConstraintParameterFinder::phiMax_
private

Definition at line 89 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ phiMin_

const double ZMuMuMassConstraintParameterFinder::phiMin_
private

Definition at line 88 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ pMin_

const double ZMuMuMassConstraintParameterFinder::pMin_
private

Definition at line 84 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ ptMin_

const double ZMuMuMassConstraintParameterFinder::ptMin_
private

Definition at line 85 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().

◆ zBosonPdg_

const int ZMuMuMassConstraintParameterFinder::zBosonPdg_ {23}
private

Definition at line 81 of file ZMuMuMassConstraintParameterFinder.cc.

Referenced by analyze().