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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (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
 
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)
 
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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Definition at line 37 of file ZMuMuSaMassHistogram.cc.

Member Typedef Documentation

Definition at line 39 of file ZMuMuSaMassHistogram.cc.

Constructor & Destructor Documentation

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

Definition at line 64 of file ZMuMuSaMassHistogram.cc.

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

64  :
65  srcToken_(consumes<CandidateView>(pset.getParameter<InputTag>("src_m"))),
66  counter(0),
67  min(pset.getUntrackedParameter<double>("min")),
68  max(pset.getUntrackedParameter<double>("max")),
69  Nbin(pset.getUntrackedParameter<int>("nbin")) {
71  ZMassSa = fs->make<TH1F>("zMass","ZMass OneStandAlone (GeV/c^{2})",Nbin,min,max);
72 
73 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
EDGetTokenT< CandidateView > srcToken_

Member Function Documentation

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

Definition at line 76 of file ZMuMuSaMassHistogram.cc.

References counter, reco::Candidate::daughter(), reco::Candidate::get(), mps_fire::i, ResonanceBuilder::mass, reco::Candidate::mass(), reco::Candidate::polarP4(), edm::View< T >::size(), srcToken_, and ZMassSa.

76  {
77  Handle<CandidateView> dimuons;
78  event.getByToken(srcToken_, dimuons);
79  for(unsigned int i=0; i< dimuons->size(); ++ i ) {
80  const Candidate & zmm = (* dimuons)[i];
81  const Candidate * dau0 = zmm.daughter(0);
82  const Candidate * dau1 = zmm.daughter(1);
83  TrackRef stAloneTrack;
85  double mu_mass;
86  if(counter % 2 == 0) {
87  stAloneTrack = dau0->get<TrackRef,reco::StandAloneMuonTag>();
88  p4_0 = dau1->polarP4();
89  mu_mass = dau0->mass();
90  }
91  else{
92  stAloneTrack = dau1->get<TrackRef,reco::StandAloneMuonTag>();
93  p4_0= dau0->polarP4();
94  mu_mass = dau1->mass();
95  }
96 
97  Vector momentum = stAloneTrack->momentum();
98  Candidate::PolarLorentzVector p4_1(momentum.rho(), momentum.eta(),momentum.phi(), mu_mass);
99  double mass = (p4_0+p4_1).mass();
100  ZMassSa->Fill(mass);
101  ++counter;
102 
103  }
104 
105 
106 }
virtual const PolarLorentzVector & polarP4() const =0
four-momentum Lorentz vector
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
stand alone muon component tag
Definition: RecoCandidate.h:78
size_type size() const
EDGetTokenT< CandidateView > srcToken_
fixed size vector
Definition: Vector.h:25
virtual double mass() const =0
mass
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:21
T get() const
get a component
Definition: Candidate.h:217
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39
void ZMuMuSaMassHistogram::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file ZMuMuSaMassHistogram.cc.

References DEFINE_FWK_MODULE.

109  {
110 }
void ZMuMuSaMassHistogram::histo ( TH1F *  hist,
char *  cx,
char *  cy 
) const
private

Definition at line 52 of file ZMuMuSaMassHistogram.cc.

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

Member Data Documentation

int ZMuMuSaMassHistogram::counter
private

Definition at line 45 of file ZMuMuSaMassHistogram.cc.

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

double ZMuMuSaMassHistogram::max
private

Definition at line 46 of file ZMuMuSaMassHistogram.cc.

Referenced by ZMuMuSaMassHistogram().

double ZMuMuSaMassHistogram::min
private

Definition at line 46 of file ZMuMuSaMassHistogram.cc.

Referenced by ZMuMuSaMassHistogram().

int ZMuMuSaMassHistogram::Nbin
private

Definition at line 47 of file ZMuMuSaMassHistogram.cc.

Referenced by ZMuMuSaMassHistogram().

EDGetTokenT<CandidateView> ZMuMuSaMassHistogram::srcToken_
private

Definition at line 44 of file ZMuMuSaMassHistogram.cc.

Referenced by analyze().

TH1F* ZMuMuSaMassHistogram::ZMassSa
private

Definition at line 48 of file ZMuMuSaMassHistogram.cc.

Referenced by analyze(), and ZMuMuSaMassHistogram().