Public Types | |
typedef math::XYZVector | Vector |
Public Member Functions | |
ZMuMuSaMassHistogram (const edm::ParameterSet &pset) | |
Private Member Functions | |
virtual void | analyze (const edm::Event &event, const edm::EventSetup &setup) |
virtual void | endJob () |
void | histo (const TH1F *hist, char *cx, char *cy) const |
Private Attributes | |
int | counter |
double | max |
double | min |
int | Nbin |
InputTag | src_muons |
TH1F * | ZMassSa |
Definition at line 37 of file ZMuMuSaMassHistogram.cc.
Definition at line 39 of file ZMuMuSaMassHistogram.cc.
ZMuMuSaMassHistogram::ZMuMuSaMassHistogram | ( | const edm::ParameterSet & | pset | ) |
Definition at line 64 of file ZMuMuSaMassHistogram.cc.
References max, min, Nbin, and ZMassSa.
: src_muons(pset.getParameter<InputTag>("src_m")), counter(0), min(pset.getUntrackedParameter<double>("min")), max(pset.getUntrackedParameter<double>("max")), Nbin(pset.getUntrackedParameter<int>("nbin")) { edm::Service<TFileService> fs; ZMassSa = fs->make<TH1F>("zMass","ZMass OneStandAlone (GeV/c^{2})",Nbin,min,max); }
void ZMuMuSaMassHistogram::analyze | ( | const edm::Event & | event, |
const edm::EventSetup & | setup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 76 of file ZMuMuSaMassHistogram.cc.
References counter, reco::Candidate::daughter(), WZMuSkim_cff::dimuons, reco::Candidate::get(), i, reco::Candidate::mass(), reco::Candidate::polarP4(), src_muons, and ZMassSa.
{ Handle<CandidateView> dimuons; event.getByLabel(src_muons, dimuons); for(unsigned int i=0; i< dimuons->size(); ++ i ) { const Candidate & zmm = (* dimuons)[i]; const Candidate * dau0 = zmm.daughter(0); const Candidate * dau1 = zmm.daughter(1); TrackRef stAloneTrack; Candidate::PolarLorentzVector p4_0; double mu_mass; if(counter % 2 == 0) { stAloneTrack = dau0->get<TrackRef,reco::StandAloneMuonTag>(); p4_0 = dau1->polarP4(); mu_mass = dau0->mass(); } else{ stAloneTrack = dau1->get<TrackRef,reco::StandAloneMuonTag>(); p4_0= dau0->polarP4(); mu_mass = dau1->mass(); } Vector momentum = stAloneTrack->momentum(); Candidate::PolarLorentzVector p4_1(momentum.rho(), momentum.eta(),momentum.phi(), mu_mass); double mass = (p4_0+p4_1).mass(); ZMassSa->Fill(mass); ++counter; } }
void ZMuMuSaMassHistogram::endJob | ( | void | ) | [private, virtual] |
void ZMuMuSaMassHistogram::histo | ( | const TH1F * | hist, |
char * | cx, | ||
char * | cy | ||
) | const [private] |
Definition at line 52 of file ZMuMuSaMassHistogram.cc.
int ZMuMuSaMassHistogram::counter [private] |
Definition at line 45 of file ZMuMuSaMassHistogram.cc.
Referenced by 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().
InputTag ZMuMuSaMassHistogram::src_muons [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().