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 |
TString data = "root://eoscms//eos/cms/store/group/phys_heavyions/velicanu/forest/PA2013_HiForest_PromptRecofirstPR_forestv51.root";
|
18 |
|
19 |
//HiForest *forest = new HiForest(data.Data());
|
20 |
|
21 |
TFile *infile = TFile::Open(data);
|
22 |
|
23 |
TTree *photon = (TTree*)infile->Get("multiPhotonAnalyzer/photon");
|
24 |
TTree *hltTree = (TTree*)infile->Get("hltanalysis/HltTree");
|
25 |
|
26 |
Int_t nPhotons;
|
27 |
Float_t pt[126];
|
28 |
Float_t eta[126];
|
29 |
Float_t phi[126];
|
30 |
Float_t energy[126];
|
31 |
Float_t hadronicOverEm[126];
|
32 |
Float_t sigmaIetaIeta[126];
|
33 |
Float_t scEta[126];
|
34 |
|
35 |
Int_t HLT_PAPhoton15_Photon10_NoCaloIdVL_v1;
|
36 |
|
37 |
photon->SetBranchAddress("nPhotons", &nPhotons);
|
38 |
photon->SetBranchAddress("pt", pt);
|
39 |
photon->SetBranchAddress("eta", eta);
|
40 |
photon->SetBranchAddress("phi", phi);
|
41 |
photon->SetBranchAddress("energy", energy);
|
42 |
photon->SetBranchAddress("hadronicOverEm",hadronicOverEm);
|
43 |
photon->SetBranchAddress("sigmaIetaIeta",sigmaIetaIeta);
|
44 |
photon->SetBranchAddress("scEta",scEta);
|
45 |
|
46 |
hltTree->SetBranchAddress("HLT_PAPhoton15_Photon10_NoCaloIdVL_v1",&HLT_PAPhoton15_Photon10_NoCaloIdVL_v1);
|
47 |
|
48 |
TH1D *hMass = new TH1D("hMass",";Invariant Mass (GeV)",40,0,200);
|
49 |
|
50 |
int nentries = photon->GetEntries();
|
51 |
for (Long64_t jentry = 0 ; jentry < nentries; jentry++)
|
52 |
{
|
53 |
if (jentry % 1000 == 0)
|
54 |
std::cout << jentry << " / " << nentries << std::endl;
|
55 |
|
56 |
photon->GetEntry(jentry);
|
57 |
hltTree->GetEntry(jentry);
|
58 |
|
59 |
if(!HLT_PAPhoton15_Photon10_NoCaloIdVL_v1)
|
60 |
continue;
|
61 |
|
62 |
for (int j = 0; j < nPhotons; j++)
|
63 |
{
|
64 |
if(hadronicOverEm[j] > 0.05)
|
65 |
continue;
|
66 |
if((scEta[j] < 1.479) && (sigmaIetaIeta[j] > 0.011) )
|
67 |
continue;
|
68 |
if((scEta[j] > 1.479) && (sigmaIetaIeta[j] > 0.035) )
|
69 |
continue;
|
70 |
|
71 |
for(int i = j+1; i < nPhotons; i++)
|
72 |
{
|
73 |
if(hadronicOverEm[i] > 0.05)
|
74 |
continue;
|
75 |
if((scEta[i] < 1.479) && (sigmaIetaIeta[i] > 0.011) )
|
76 |
continue;
|
77 |
if((scEta[i] > 1.479) && (sigmaIetaIeta[i] > 0.035) )
|
78 |
continue;
|
79 |
|
80 |
if( (pt[i] < 20) && (pt[j] < 20) )
|
81 |
continue;
|
82 |
|
83 |
|
84 |
|
85 |
TLorentzVector v1, v2, vSum;
|
86 |
v1.SetPtEtaPhiE( pt[i],
|
87 |
eta[i],
|
88 |
phi[i],
|
89 |
energy[i]);
|
90 |
v2.SetPtEtaPhiE( pt[j],
|
91 |
eta[j],
|
92 |
phi[j],
|
93 |
energy[j]);
|
94 |
vSum = v1+v2;
|
95 |
hMass->Fill( vSum.M() );
|
96 |
}
|
97 |
}
|
98 |
}
|
99 |
|
100 |
hMass->Draw("E");
|
101 |
}
|