StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St2009pubSpin_histo.cxx
1 // $Id: St2009pubSpin_histo.cxx,v 1.11 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 "St2009pubSpinMaker.h"
12 
13 //________________________________________________
14 //________________________________________________
15 void
16 St2009pubSpinMaker::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  char txt[1000], txt0[100];
24  int nCase=12;
25 
26  hA[0]=h=new TH1F(core+"StatEve",core+" event count",nCase,0,nCase);
27  h->GetXaxis()->SetTitleOffset(0.4); h->GetXaxis()->SetLabelSize(0.06); h->GetXaxis()->SetTitleSize(0.05); h->SetMinimum(0.8);
28  h->SetLineColor(kBlue);h->SetLineWidth(2);
29  h->SetMarkerSize(2);//<-- large text
30 
31  const char *key[]={"inp","badBx48","noZ","BG1","BG2","Wcut","eta","W25","Qlow","Qhigh","Q +","Q -"};
32  for(int i=0;i<12;i++) h->Fill(key[i],0.); // preset the order of keys
33 
34 
35  hA[1]=new TH1F(core+"bX48","Rate vs. raw bx48; bXing= raw bx48",128,-0.5,127.5);
36  hA[2]=new TH1F(core+"bX7","Rate vs. raw bx7; bXing= raw bx7",128,-0.5,127.5);
37 
38  hA[3]=new TH1F(core+"bX48c","Rate vs. STAR IP bXing(bx48); bXing= bx48+offset",128,-0.5,127.5);
39  hA[4]=new TH1F(core+"bX7c","Rate vs. STAR IP bXing(bx7); bXing= bx7+offset",128,-0.5,127.5);
40 
41  hA[5]=new TH2F(core+"s4mon","all L2W & vertex ; bXing at STAR (7bit); spin4 from DB",128,-0.5,127.5,32,-0.5,15.5);
42 
43 
44  hA[6]=new TH1F(core+"Y0","BG1: L2W-BHT3-rnd & vertex OK & low ET; spin4 ",16,-0.5,15.5);
45  hA[7]=new TH1F(core+"Y1","BG2: vertex & ET<20 & ET 2x2 << 4x4 ; spin4 ",16,-0.5,15.5);
46 
47  hA[8]=h=new TH1F(core+"QpT","reco Q/PT,W ET>25 GeV; reco Q/PT (1/GeV)",100,-0.099,0.099);
48  float highCut=par_QPThighA - (par_QPThighET1-par_QPThighET0)*par_QPThighB;
49 
50  if(par_QPTlow>0) { // abaility to skip all Q/PT cuts
51  Lx=h->GetListOfFunctions();
52  ln=new TLine(par_QPTlow,0,par_QPTlow,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
53  ln=new TLine(-par_QPTlow,0,-par_QPTlow,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
54  float avrC=(par_QPThighA+highCut)/2.;
55  ln=new TLine(-avrC,0,-avrC,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
56  ln=new TLine(avrC,0,avrC,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
57  }
58 
59  hA[9]=h=new TH2F(core+"QpT2","TPC PRIM Q/PT ; 2x2 cluster ET (GeV); Q/PT (1/GeV)",100,0.,100.,100,-0.1,0.1);
60  Lx=h->GetListOfFunctions();
61  ln=new TLine(0,0,100,0); ln->SetLineColor(kBlue); Lx->Add(ln);
62 
63  if(par_QPTlow>0) { // abaility to skip all Q/PT cuts
64  ln=new TLine(0,par_QPTlow,100,par_QPTlow); ln->SetLineColor(kRed); Lx->Add(ln);
65  ln=new TLine(0,-par_QPTlow,100,-par_QPTlow); ln->SetLineColor(kRed); Lx->Add(ln);
66  ln=new TLine(25,-0.1, 25,0.1); ln->SetLineColor(kRed); Lx->Add(ln);
67  ln=new TLine(par_QPThighET0,par_QPThighA,par_QPThighET1,highCut); ln->SetLineColor(kRed); Lx->Add(ln);
68  ln=new TLine(par_QPThighET0,-par_QPThighA,par_QPThighET1,-highCut); ln->SetLineColor(kRed); Lx->Add(ln);
69  }
70 
71  //use 10-19
72  char cPM[2]={'P','N'}; // Positive, Negative
73  char iCol[2]={46,9};
74  for(int ipn=0;ipn<2;ipn++){
75  TH1 *h;
76 
77  //.... J-peak
78  sprintf(txt0,"ET_%c",cPM[ipn]);
79  sprintf(txt,"Final W, charge=%c ; 2x2 ET (GeV) ",cPM[ipn]);
80  hA[10+ipn]=h=new TH1F(core+txt0,txt, 100,1,101); // shifted by 1 for nicer Rebin
81  h->SetFillColor(iCol[ipn]);
82 
83  //.... 1D spin sorting
84  sprintf(txt0,"Y2_%c",cPM[ipn]);
85  sprintf(txt,"Final W Q=%c, 2x2 ET=[25,50]GeV ; spin4 ",cPM[ipn]);
86  hA[12+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
87  h->SetFillColor(iCol[ipn]);
88 
89  sprintf(txt0,"Y3_%c",cPM[ipn]);
90  sprintf(txt,"Final W Q=%c, 2x2 ET=[32,44]GeV ; spin4 ",cPM[ipn]);
91  hA[14+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
92  h->SetFillColor(iCol[ipn]);
93 
94  sprintf(txt0,"Y4_%c",cPM[ipn]);
95  sprintf(txt,"Final QCD Q=%c, 2x2 ET=[15,20]GeV ; spin4 ",cPM[ipn]);
96  hA[16+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
97  h->SetFillColor(iCol[ipn]);
98 
99  sprintf(txt0,"Y5_%c",cPM[ipn]);
100  sprintf(txt,"Final 2x2 ET Q=%c; spin4 ; 2x2 cluster ET (GeV) ",cPM[ipn]);
101  hA[18+ipn]=h=new TH2F(core+txt0,txt,16,-0.5,15.5,10,0,100);
102  h->SetFillColor(iCol[ipn]);
103  }
104  // free 20-29
105 
106  hA[30]=h=new TH1F(core+"LepEta","selecting Ws ; lepton LAB eta",100, -1.5,1.5);
107  Lx=h->GetListOfFunctions();
108  ln=new TLine(par_leptonEta1,0,par_leptonEta1,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
109  ln=new TLine(par_leptonEta2,0,par_leptonEta2,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
110 
111  hA[31]=h=new TH1F(core+"LumET","Lumi monitor; 2x2 ET (GeV)",100,0.,100.);
112 
113 
114 
115  // add histos to the list (if provided)
116  for(int i=0;i<mxHA;i++) {
117  if( hA[i]==0) continue;
118  HList->Add( hA[i]);
119  }
120  // HList->ls();
121  LOG_INFO<<Form("%s::initHistos done1",GetName())<<endm;
122 
123 }
124 
125 
126 // $Log: St2009pubSpin_histo.cxx,v $
127 // Revision 1.11 2010/05/01 01:31:45 balewski
128 // added W->JJ code & JES calibration
129 //
130 // Revision 1.10 2010/03/22 16:11:42 balewski
131 // better computation of AL(QCD)
132 //
133 // Revision 1.9 2010/03/20 19:19:05 balewski
134 // added ability to drop Q/PT cut for spin analysis
135 //
136 // Revision 1.8 2010/03/18 18:46:40 balewski
137 // simplified sPtBalance calculation
138 //
139 // Revision 1.7 2010/03/14 22:50:31 balewski
140 // *** empty log message ***
141 //
142 // Revision 1.6 2010/02/04 03:48:12 balewski
143 // add ET for lumi monitor
144 //
145 // Revision 1.5 2010/01/30 02:02:54 balewski
146 // manore tunes
147 //
148 // Revision 1.4 2010/01/28 20:10:06 balewski
149 // added eta dependent spin sorting
150 //
151 // Revision 1.3 2010/01/28 03:42:55 balewski
152 // cleanup
153 //
154 // Revision 1.2 2010/01/27 22:12:25 balewski
155 // spin code matched to x-section code
156 //
157 // Revision 1.1 2009/11/23 23:00:18 balewski
158 // code moved spin-pool
159 //
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237