StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcJetCalib_histo.cxx
1 // $Id: StMcJetCalib_histo.cxx,v 1.1 2010/05/01 01:31:45 balewski Exp $
2 //
3 //*-- Author : Jan Balewski, MIT
4 
5 
6 #include <TH2.h>
7 #include <TList.h>
8 #include <TLine.h>
9 #include <TMath.h>
10 
11 #include "StMcJetCalibMaker.h"
12 
13 //________________________________________________
14 //________________________________________________
15 void
16 StMcJetCalibMaker::initHistos(){
17  // const float PI=TMath::Pi();
18 
19  //...... data histograms
20  memset(hA,0,sizeof(hA));
21  TList *Lx; TLine *ln;
22  TH1 *h;
23 
24  int nCase=10;
25  hA[0]=h=new TH1F(core+"StatEve",core+" event count",nCase,0,nCase);
26  h->GetXaxis()->SetTitleOffset(0.4); h->GetXaxis()->SetLabelSize(0.06); h->GetXaxis()->SetTitleSize(0.05); h->SetMinimum(0.8);
27  h->SetLineColor(kBlue);h->SetLineWidth(2);
28  h->SetMarkerSize(2);//<-- large text
29 
30  const char *key[]={"inp","verG","etaG","W,Z","verR","anyJ","mulJ","delR","xx1","xx2"};
31  for(int i=0;i<nCase;i++) h->Fill(key[i],0.); // preset the order of keys
32 
33 
34  hA[1]=h=new TH1F(core+"_vz1","geant vertex Z; gen Z(cm)",100,-200,200);
35  Lx=h->GetListOfFunctions();
36  ln=new TLine(-par_vertexZ,0,-par_vertexZ,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
37  ln=new TLine(par_vertexZ,0,par_vertexZ,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
38 
39 
40  hA[2]=h=new TH1F(core+"_vz2","1st reco Z vertex error ; Zreco-Zgeant (cm)",100,-4,4);
41  Lx=h->GetListOfFunctions();
42  ln=new TLine(-par_verZerr,0,-par_verZerr,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
43  ln=new TLine(par_verZerr,0,par_verZerr,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
44 
45 
46  hA[3]=h=new TH1F(core+"_dR","#DeltaR(reco-gen) for best match jets; #DeltaR",200,0.,1.2);
47  Lx=h->GetListOfFunctions();
48  ln=new TLine(par_delRmax,0,par_delRmax,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
49 
50  hA[4]=new TH2F(core+"_g2","gen C, D, after #eta cut; gen PT GeV/c; gen #eta",40,0.,80.,40,-2.5,2.5);
51 
52 
53  //...........
54  hA[10]=new TH1F(core+"_mC","gen boson, input (empty for QCD) ; inv mass (GeV)",150,0,150.);
55  hA[11]=h=new TH2F(core+"_D1","gen decay 1 ; eta; phi",20,-2.5,2.5,20,-3.2,3.2);
56  Lx=h->GetListOfFunctions();
57  ln=new TLine(par_jetEtaHigh,-4,par_jetEtaHigh,4); ln->SetLineColor(kRed); Lx->Add(ln);
58  ln=new TLine(-par_jetEtaHigh,-4,-par_jetEtaHigh,4); ln->SetLineColor(kRed); Lx->Add(ln);
59 
60 
61  hA[12]=new TH2F(core+"_m3","gen q,qbar matched; PT(gen) GeV/c; gen eta",40,0.,80.,40,-2.5,2.5);
62 
63  //free 13-14
64 
65  //...... full jet energy .....
66  hA[15]=h=new TH1F(core+"_fr0","gen & matched q, qbar; gen PT (GeV/c)",100,0,100);
67  hA[16]=h=new TH1F(core+"_fr1","reco jet PT ratio; ratio=PT(reco)/PT(gen)",100,0.0,1.8);
68 
69 
70  hA[17]=new TH2F(core+"_fr2","reco jet E fraction; fracE=E(reco)/E(gen); gen eta",70,0.0,1.8,50,-2.5,2.5);
71  hA[18]=new TH2F(core+"_fr3","reco jet #eta ; #eta(gen) - #eta(reco); gen eta",50,-.2,.2,40,-2.5,2.5);
72  hA[19]=new TH2F(core+"_fr4","reco jet #phi ; #phi(gen) - #phi(reco) (deg); gen eta",50,-20,20,50,-2.5,2.5);
73  hA[20]=0;
74  hA[21]=h=new TH2F(core+"_fr6","reco jet E; gen E (GeV); rec E (GeV)",60,0.0,120.,60,0,120);
75  hA[22]=h=new TH2F(core+"_fr7","reco jet PT; gen PT (GeV/c); rec PT (GeV/c)",50,0.0,100.,50,0,100);
76 
77 
78  //... neutral....
79  hA[26]=new TH1F(core+"_fr1n","reco jet NEUTRAL PT ratio; ratio=neutPT(reco)/PT(gen)",100,0.0,1.8);
80  hA[27]=new TH2F(core+"_fr2n","reco jet NEUTRAL E ; reco jet #eta; reco jet neut E ",40,-2.,2.,60,0.0,80);
81 
82  //.... charged....
83  hA[36]=new TH1F(core+"_fr1c","reco jet CHARGED PT ratio; ratio=cahrgPT(reco)/PT(gen)",100,0.0,1.8);
84  hA[37]=new TH2F(core+"_fr2c","reco jet CHARGED E ; reco jet #eta; reco jet charg. E ",40,-2.,2.,60,0.0,80);
85 
86  //..... eta dependent calibration matrix
87  for(int i=0;i<mxEta;i++) {
88  float eta1=i*0.4-1.2, eta2=eta1+0.4;
89  hA[40+i]=new TH2F(core+Form("_iEta%d",i),Form("matched reco jets, #eta=[%.1f,%.1f]; gen PT (GeV/c); rec PT (GeV/c)",eta1,eta2),20,0.0,100.,20,0,100);
90  }
91  // free 48..63
92 
93 
94  // add histos to the list (if provided)
95  for(int i=0;i<mxHA;i++) {
96  if( hA[i]==0) continue;
97  HList->Add( hA[i]);
98  }
99  // HList->ls();
100  LOG_INFO<<Form("%s::initHistos done1",GetName())<<endm;
101 
102 }
103 
104 
105 // $Log: StMcJetCalib_histo.cxx,v $
106 // Revision 1.1 2010/05/01 01:31:45 balewski
107 // added W->JJ code & JES calibration
108 //
109 // Revision 1.1 2010/04/16 01:04:43 balewski
110 // start
111 //
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237