CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ZMuMuSaMassHistogram Class Reference
Inheritance diagram for ZMuMuSaMassHistogram:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef math::XYZVector Vector
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 ZMuMuSaMassHistogram (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
void endJob () override
 
void histo (TH1F *hist, char *cx, char *cy) const
 

Private Attributes

int counter
 
double max
 
double min
 
int Nbin
 
EDGetTokenT< CandidateViewsrcToken_
 
TH1F * ZMassSa
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 35 of file ZMuMuSaMassHistogram.cc.

Member Typedef Documentation

◆ Vector

Definition at line 37 of file ZMuMuSaMassHistogram.cc.

Constructor & Destructor Documentation

◆ ZMuMuSaMassHistogram()

ZMuMuSaMassHistogram::ZMuMuSaMassHistogram ( const edm::ParameterSet pset)

Definition at line 62 of file ZMuMuSaMassHistogram.cc.

63  : srcToken_(consumes<CandidateView>(pset.getParameter<InputTag>("src_m"))),
64  counter(0),
65  min(pset.getUntrackedParameter<double>("min")),
66  max(pset.getUntrackedParameter<double>("max")),
67  Nbin(pset.getUntrackedParameter<int>("nbin")) {
69  ZMassSa = fs->make<TH1F>("zMass", "ZMass OneStandAlone (GeV/c^{2})", Nbin, min, max);
70 }

References TFileService::make(), max, min, Nbin, and ZMassSa.

Member Function Documentation

◆ analyze()

void ZMuMuSaMassHistogram::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 72 of file ZMuMuSaMassHistogram.cc.

72  {
74  event.getByToken(srcToken_, dimuons);
75  for (unsigned int i = 0; i < dimuons->size(); ++i) {
76  const Candidate& zmm = (*dimuons)[i];
77  const Candidate* dau0 = zmm.daughter(0);
78  const Candidate* dau1 = zmm.daughter(1);
79  TrackRef stAloneTrack;
81  double mu_mass;
82  if (counter % 2 == 0) {
83  stAloneTrack = dau0->get<TrackRef, reco::StandAloneMuonTag>();
84  p4_0 = dau1->polarP4();
85  mu_mass = dau0->mass();
86  } else {
87  stAloneTrack = dau1->get<TrackRef, reco::StandAloneMuonTag>();
88  p4_0 = dau0->polarP4();
89  mu_mass = dau1->mass();
90  }
91 
92  Vector momentum = stAloneTrack->momentum();
93  Candidate::PolarLorentzVector p4_1(momentum.rho(), momentum.eta(), momentum.phi(), mu_mass);
94  double mass = (p4_0 + p4_1).mass();
95  ZMassSa->Fill(mass);
96  ++counter;
97  }
98 }

References counter, reco::Candidate::daughter(), WZMuSkim_cff::dimuons, reco::Candidate::get(), mps_fire::i, EgHLTOffHistBins_cfi::mass, reco::Candidate::mass(), mu_mass, reco::Candidate::polarP4(), srcToken_, and ZMassSa.

◆ endJob()

void ZMuMuSaMassHistogram::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 100 of file ZMuMuSaMassHistogram.cc.

100 {}

◆ histo()

void ZMuMuSaMassHistogram::histo ( TH1F *  hist,
char *  cx,
char *  cy 
) const
private

Definition at line 51 of file ZMuMuSaMassHistogram.cc.

51  {
52  hist->GetXaxis()->SetTitle(cx);
53  hist->GetYaxis()->SetTitle(cy);
54  hist->GetXaxis()->SetTitleOffset(1);
55  hist->GetYaxis()->SetTitleOffset(1.2);
56  hist->GetXaxis()->SetTitleSize(0.04);
57  hist->GetYaxis()->SetTitleSize(0.04);
58  hist->GetXaxis()->SetLabelSize(0.03);
59  hist->GetYaxis()->SetLabelSize(0.03);
60 }

References compare::hist.

Member Data Documentation

◆ counter

int ZMuMuSaMassHistogram::counter
private

Definition at line 44 of file ZMuMuSaMassHistogram.cc.

Referenced by counter.Counters::__getitem__(), and analyze().

◆ max

double ZMuMuSaMassHistogram::max
private

Definition at line 45 of file ZMuMuSaMassHistogram.cc.

Referenced by ZMuMuSaMassHistogram().

◆ min

double ZMuMuSaMassHistogram::min
private

Definition at line 45 of file ZMuMuSaMassHistogram.cc.

Referenced by ZMuMuSaMassHistogram().

◆ Nbin

int ZMuMuSaMassHistogram::Nbin
private

Definition at line 46 of file ZMuMuSaMassHistogram.cc.

Referenced by ZMuMuSaMassHistogram().

◆ srcToken_

EDGetTokenT<CandidateView> ZMuMuSaMassHistogram::srcToken_
private

Definition at line 43 of file ZMuMuSaMassHistogram.cc.

Referenced by analyze().

◆ ZMassSa

TH1F* ZMuMuSaMassHistogram::ZMassSa
private

Definition at line 47 of file ZMuMuSaMassHistogram.cc.

Referenced by analyze(), and ZMuMuSaMassHistogram().

reco::Candidate::daughter
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
counter
Definition: counter.py:1
mps_fire.i
i
Definition: mps_fire.py:428
reco::Candidate::mass
virtual double mass() const =0
mass
ZMuMuSaMassHistogram::Nbin
int Nbin
Definition: ZMuMuSaMassHistogram.cc:46
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
reco::Candidate::get
T get() const
get a component
Definition: Candidate.h:221
ZMuMuSaMassHistogram::counter
int counter
Definition: ZMuMuSaMassHistogram.cc:44
edm::Handle
Definition: AssociativeIterator.h:50
ZMuMuSaMassHistogram::max
double max
Definition: ZMuMuSaMassHistogram.cc:45
edm::Ref< TrackCollection >
WZMuSkim_cff.dimuons
dimuons
Definition: WZMuSkim_cff.py:26
reco::StandAloneMuonTag
stand alone muon component tag
Definition: RecoCandidate.h:77
compare.hist
hist
Definition: compare.py:376
ZMuMuSaMassHistogram::min
double min
Definition: ZMuMuSaMassHistogram.cc:45
reco::Candidate::polarP4
virtual const PolarLorentzVector & polarP4() const =0
four-momentum Lorentz vector
ZMuMuSaMassHistogram::srcToken_
EDGetTokenT< CandidateView > srcToken_
Definition: ZMuMuSaMassHistogram.cc:43
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
math::Vector
fixed size vector
Definition: Vector.h:24
edm::Service< TFileService >
reco::Candidate
Definition: Candidate.h:27
mu_mass
static constexpr float mu_mass
Definition: L1TkMuonProducer.cc:30
ZMuMuSaMassHistogram::ZMassSa
TH1F * ZMassSa
Definition: ZMuMuSaMassHistogram.cc:47
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
edm::InputTag
Definition: InputTag.h:15
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27