ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/richard/photonPhysicsValidation/photonMass.C
Revision: 1.1
Committed: Thu Jan 24 17:27:06 2013 UTC (12 years, 3 months ago) by richard
Content type: text/plain
Branch: MAIN
Log Message:
photon mass plot

File Contents

# User Rev Content
1 richard 1.1 #include <TCanvas.h>
2     #include <TTree.h>
3     #include <TFile.h>
4     #include <TMath.h>
5     #include <TH1D.h>
6     #include <TLorentzVector.h>
7     #include <iostream>
8    
9     #include "../HiForest_V2_latest/hiForest.h"
10     #include "alexUtils.h"
11    
12    
13     void photonMass()
14     {
15     TString data = "/mnt/hadoop/cms/store/user/luck/pA2013_forests/PA2013_HiForest_Express_r210614_autoforest_v1.root";
16    
17     HiForest *forest = new HiForest(data.Data());
18    
19     TH1D *hMass = new TH1D("hMass",";Invariant Mass (GeV)",100,0,200);
20    
21     int nentries = forest->GetEntries();
22     for (Long64_t jentry = 0 ; jentry < nentries; jentry++)
23     {
24     if (jentry % 1000 == 0)
25     std::cout << jentry << " / " << nentries << std::endl;
26    
27     forest->GetEntry(jentry);
28     for (int j = 0; j < forest->photon.nPhotons; j++)
29     {
30     for(int i = j+1; i < forest->photon.nPhotons; i++)
31     {
32     TLorentzVector v1, v2, vSum;
33     v1.SetPtEtaPhiE( forest->photon.pt[i],
34     forest->photon.eta[i],
35     forest->photon.phi[i],
36     forest->photon.energy[i]);
37     v2.SetPtEtaPhiE( forest->photon.pt[j],
38     forest->photon.eta[j],
39     forest->photon.phi[j],
40     forest->photon.energy[j]);
41     vSum = v1+v2;
42     hMass->Fill( vSum.M() );
43     }
44     }
45     }
46    
47     hMass->Draw("E");
48     }