CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

ZMuMuSaMassHistogram Class Reference

Inheritance diagram for ZMuMuSaMassHistogram:
edm::EDAnalyzer

List of all members.

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

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 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);

}

Member Function Documentation

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, scaleCards::mass, 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]

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file ZMuMuSaMassHistogram.cc.

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

Definition at line 52 of file ZMuMuSaMassHistogram.cc.

                                                                        {
  hist->GetXaxis()->SetTitle(cx);
  hist->GetYaxis()->SetTitle(cy);
  hist->GetXaxis()->SetTitleOffset(1);
  hist->GetYaxis()->SetTitleOffset(1.2);
  hist->GetXaxis()->SetTitleSize(0.04);
  hist->GetYaxis()->SetTitleSize(0.04);
  hist->GetXaxis()->SetLabelSize(0.03);
  hist->GetYaxis()->SetLabelSize(0.03);
}

Member Data Documentation

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

Definition at line 47 of file ZMuMuSaMassHistogram.cc.

Referenced by ZMuMuSaMassHistogram().

Definition at line 44 of file ZMuMuSaMassHistogram.cc.

Referenced by analyze().

Definition at line 48 of file ZMuMuSaMassHistogram.cc.

Referenced by analyze(), and ZMuMuSaMassHistogram().