ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/CmsHi/JetAnalysis/macros/templateMacro.C
Revision: 1.4
Committed: Mon Feb 4 22:32:30 2013 UTC (12 years, 3 months ago) by yilmaz
Content type: text/plain
Branch: MAIN
CVS Tags: HiForest_V02_85, HiForest_V02_84, HiForest_V02_83, HiForest_V02_82, HiForest_V02_81, HiForest_V02_80, HiForest_V02_79, HiForest_V02_78, HiForest_V02_77, HiForest_V02_76, HiForest_V02_73, HEAD
Changes since 1.3: +2 -2 lines
Log Message:
vtx cut added

File Contents

# User Rev Content
1 yilmaz 1.1 #include "CommonParameters.h"
2     #include "TLine.h"
3     #include <string>
4     #include "Slices.h"
5    
6    
7     using namespace std;
8    
9    
10    
11    
12     void templateMacro(){
13    
14     TH1::SetDefaultSumw2();
15    
16     TString infname = "/d101/yetkin/analysis/d0204/ntuple_data_pPb_akPu3PF_forest71_20130204_01.root";
17     TString refname = "/d101/yetkin/analysis/d0204/ntuple_data_PbPb_akPu3PF_forest71_20130204_01.root";
18     TString mixname = "/d101/yetkin/analysis/d0204/hijing.root";
19    
20    
21    
22     TFile *inf = new TFile(infname.Data());
23     TTree *nt =(TTree*)inf->FindObjectAny("ntdijet");
24     TTree *ntevt =(TTree*)inf->FindObjectAny("ntevt");
25     nt->AddFriend(ntevt);
26    
27     TFile *infMix = new TFile(mixname.Data());
28     TTree *ntMix =(TTree*)infMix->FindObjectAny("ntdijet");
29     TTree *ntevtMix =(TTree*)infMix->FindObjectAny("ntevt");
30     TTree *ntw =(TTree*)infMix->FindObjectAny("ntw");
31     ntMix->AddFriend(ntw);
32     ntMix->AddFriend(ntevtMix);
33    
34     nt->SetAlias("pt1","jtpt1");
35     nt->SetAlias("pt2","jtpt2");
36     nt->SetAlias("eta1","jteta1");
37     nt->SetAlias("eta2","jteta2");
38     nt->SetAlias("phi1","jtphi1");
39     nt->SetAlias("phi2","jtphi2");
40    
41     ntMix->SetAlias("pt1","jtpt1");
42     ntMix->SetAlias("pt2","jtpt2");
43     ntMix->SetAlias("eta1","jteta1");
44     ntMix->SetAlias("eta2","jteta2");
45     ntMix->SetAlias("phi1","jtphi1");
46     ntMix->SetAlias("phi2","jtphi2");
47    
48 yilmaz 1.4 nt->SetAlias("cent","hfp");
49     ntMix->SetAlias("cent","hfp");
50 yilmaz 1.1
51    
52     nt->SetAlias("w","pt1> -999");
53     ntMix->SetAlias("w","weight*(pthat > 50)");
54    
55     TCut weight("w");
56    
57     TTree* t[2] = {nt,ntMix};
58    
59 yilmaz 1.3 TH2D* h[2];
60     TH1D* hMean[3];
61     TH1D* hSigma[3];
62    
63 yilmaz 1.1
64     TCanvas* c1 = new TCanvas("c1","",1200,600);
65     c1->Divide(2,1);
66    
67     for(int i = 0; i < 2; ++i){
68     c1->cd(i+1)->SetLogz();
69     h[i] = new TH2D(Form("h%d",i),";E_{T}^{HF[#eta > 4]};N_{trk}^{offline}",35,0,70,250,0,250);
70     h[i]->GetXaxis()->CenterTitle();
71     h[i]->GetYaxis()->CenterTitle();
72    
73 yilmaz 1.2 t[i]->Draw(Form("ntrk:cent>>%s",h[i]->GetName()),weight*dijet&&deltaPhi&&jetID&&vtx&&noise,"colz");
74 yilmaz 1.1
75 yilmaz 1.3 fitSlices(h[i]);
76     hMean[i] = (TH1D*)gDirectory->Get(Form("%s_1",h[i]->GetName()));
77     hSigma[i] = (TH1D*)gDirectory->Get(Form("%s_2",h[i]->GetName()));
78    
79 yilmaz 1.1 }
80    
81    
82     }
83