StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St2011pubSpin_histo.cxx
1 // $Id: St2011pubSpin_histo.cxx,v 1.8 2013/09/13 19:33:13 stevens4 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 "St2011pubSpinMaker.h"
12 
13 //________________________________________________
14 //________________________________________________
15 void
16 St2011pubSpinMaker::initHistos(){
17  // const float PI=TMath::Pi();
18 
19  //...... data histograms
20  memset(hA,0,sizeof(hA));
21  memset(hE,0,sizeof(hE));
22  TList *Lx; TLine *ln;
23  TH1 *h;
24  char txt[1000], txt0[100];
25  int nCase=12;
26 
27 
28  // *********** Barrel spin histos **************
29  hA[0]=h=new TH1F(core+"StatEve",core+"Barrel event count",nCase,0,nCase);
30  h->GetXaxis()->SetTitleOffset(0.4); h->GetXaxis()->SetLabelSize(0.06); h->GetXaxis()->SetTitleSize(0.05); h->SetMinimum(0.8);
31  h->SetLineColor(kBlue);h->SetLineWidth(2);
32  h->SetMarkerSize(2);//<-- large text
33 
34  const char *key[]={"inp","badBx48","noZ","BG1","BG2","Wcut","eta","W25","Qlow","Qhigh","Q +","Q -"};
35  for(int i=0;i<12;i++) h->Fill(key[i],0.); // preset the order of keys
36 
37 
38  hA[1]=new TH1F(core+"bX48","Barrel Rate vs. raw bx48; bXing= raw bx48",128,-0.5,127.5);
39  hA[2]=new TH1F(core+"bX7","Barrel Rate vs. raw bx7; bXing= raw bx7",128,-0.5,127.5);
40 
41  hA[3]=new TH1F(core+"bX48c","Barrel Rate vs. STAR IP bXing(bx48); bXing= bx48+offset",128,-0.5,127.5);
42  hA[4]=new TH1F(core+"bX7c","Barrel Rate vs. STAR IP bXing(bx7); bXing= bx7+offset",128,-0.5,127.5);
43 
44  hA[5]=new TH2F(core+"s4mon","Barrel all L2W & vertex ; bXing at STAR (7bit); spin4 from DB",128,-0.5,127.5,32,-0.5,15.5);
45 
46 
47  hA[6]=new TH1F(core+"Y0","Barrel BG1: L2W-BHT3-rnd & vertex OK & low ET; spin4 ",16,-0.5,15.5);
48  hA[7]=new TH1F(core+"Y1",Form("Barrel BG2: vertex & ET<20 & ET 2x2 << 4x4 : %s; spin4 ",coreTitle.Data()),16,-0.5,15.5);
49 
50  hA[8]=h=new TH1F(core+"QpT","Barrel W ET>25 GeV; reco Q/PT (1/GeV)",100,-0.099,0.099);
51  hA[9]=h=new TH2F(core+"QpT2","Barrel TPC PRIM Q/PT ; 2x2 cluster ET (GeV); Q/PT (1/GeV)",100,0.,100.,100,-0.1,0.1);
52 
53  //use 10-19
54  char cPM[2]={'P','N'}; // Positive, Negative
55  char iCol[2]={46,9};
56  for(int ipn=0;ipn<2;ipn++){
57  TH1 *h;
58 
59  //.... J-peak
60  sprintf(txt0,"ET_%c",cPM[ipn]);
61  sprintf(txt,"Final Barrel W, charge=%c : %s; 2x2 ET (GeV) ",cPM[ipn],coreTitle.Data());
62  hA[10+ipn]=h=new TH1F(core+txt0,txt, 100,1,101); // shifted by 1 for nicer Rebin
63  h->SetFillColor(iCol[ipn]);
64 
65  //.... 1D spin sorting
66  sprintf(txt0,"Y2_%c",cPM[ipn]);
67  sprintf(txt,"Final Barrel W Q=%c, 2x2 ET=[25,50]GeV : %s; spin4 ",cPM[ipn],coreTitle.Data());
68  hA[12+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
69  h->SetFillColor(iCol[ipn]);
70 
71  sprintf(txt0,"Y3_%c",cPM[ipn]);
72  sprintf(txt,"Final Barrel W Q=%c, 2x2 ET=[32,44]GeV : %s; spin4 ",cPM[ipn],coreTitle.Data());
73  hA[14+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
74  h->SetFillColor(iCol[ipn]);
75 
76  sprintf(txt0,"Y4_%c",cPM[ipn]);
77  sprintf(txt,"Final Barrel QCD Q=%c, 2x2 ET=[15,20]GeV : %s; spin4 ",cPM[ipn],coreTitle.Data());
78  hA[16+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
79  h->SetFillColor(iCol[ipn]);
80 
81  sprintf(txt0,"Y5_%c",cPM[ipn]);
82  sprintf(txt,"Final Barrel 2x2 ET Q=%c; spin4 : %s; 2x2 cluster ET (GeV) ",cPM[ipn],coreTitle.Data());
83  hA[18+ipn]=h=new TH2F(core+txt0,txt,16,-0.5,15.5,10,0,100);
84  h->SetFillColor(iCol[ipn]);
85 
86  sprintf(txt0,"Y6_%c",cPM[ipn]);
87  sprintf(txt,"High pT Barrel QCD Q=%c, 2x2 ET=[25,50]GeV: %s; spin4 ",cPM[ipn],coreTitle.Data());
88  hA[20+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
89  h->SetFillColor(iCol[ipn]);
90 
91  sprintf(txt0,"Y7_%c",cPM[ipn]);
92  sprintf(txt,"High pT Barrel QCD 2x2 ET Q=%c; spin4 : %s; 2x2 cluster ET (GeV) ",cPM[ipn],coreTitle.Data());
93  hA[22+ipn]=h=new TH2F(core+txt0,txt,16,-0.5,15.5,100,0,100);
94  h->SetFillColor(iCol[ipn]);
95 
96  sprintf(txt0,"LepEta_%c",cPM[ipn]);
97  sprintf(txt,"selecting Barrel Ws Q=%c : %s ; lepton LAB eta",cPM[ipn],coreTitle.Data());
98  hA[29+ipn]=h=new TH1F(core+txt0,txt,400, -2.0,2.0);
99  Lx=h->GetListOfFunctions();
100  ln=new TLine(par_leptonEta1,0,par_leptonEta1,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
101  ln=new TLine(par_leptonEta2,0,par_leptonEta2,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
102  }
103  // free 24-29
104 
105  hA[31]=h=new TH1F(core+"LumET","Lumi monitor; 2x2 ET (GeV)",100,0.,100.);
106  hA[32]=h=new TH2F(core+"QpT_hits","nHitsFit vs Q/PT,Barrel W ET>25 GeV; reco Q/PT (1/GeV); nFitPoints",100,-0.099,0.099,50,0,50);
107  hA[33]=h=new TH2F(core+"QpT_hitF","nHitsFrac vs Q/PT,Barrel W ET>25 GeV; reco Q/PT (1/GeV); nHitsFrac",100,-0.099,0.099,50,0,1.1);
108  hA[34]=h=new TH2F(core+"HitsFit_Frac","Barrel nHitsFit vs nHitsFrac; nHitsFit; nHitsFrac",50,0,50,50,0,1.1);
109 
110 
111 
112  // *********** Endcap spin histos *************
113  hE[0]=h=new TH1F(core+"EStatEve",core+" Endcap event count",nCase,0,nCase);
114  h->GetXaxis()->SetTitleOffset(0.4); h->GetXaxis()->SetLabelSize(0.06); h->GetXaxis()->SetTitleSize(0.05); h->SetMinimum(0.8);
115  h->SetLineColor(kBlue);h->SetLineWidth(2);
116  h->SetMarkerSize(2);//<-- large text
117 
118  const char *keyE[]={"inp","badBx48","noZ","BG1","BG2","Wcut","eta","W25","Qlow","Qhigh","Q +","Q -"};
119  for(int i=0;i<12;i++) h->Fill(keyE[i],0.); // preset the order of keys
120 
121 
122  hE[1]=new TH1F(core+"EbX48","Endcap Rate vs. raw bx48; bXing= raw bx48",128,-0.5,127.5);
123  hE[2]=new TH1F(core+"EbX7","Endcap Rate vs. raw bx7; bXing= raw bx7",128,-0.5,127.5);
124 
125  hE[3]=new TH1F(core+"EbX48c","Endcap Rate vs. STAR IP bXing(bx48); bXing= bx48+offset",128,-0.5,127.5);
126  hE[4]=new TH1F(core+"EbX7c","Endcap Rate vs. STAR IP bXing(bx7); bXing= bx7+offset",128,-0.5,127.5);
127 
128  hE[5]=new TH2F(core+"Es4mon","Endcap all L2W & vertex ; bXing at STAR (7bit); spin4 from DB",128,-0.5,127.5,32,-0.5,15.5);
129 
130 
131  hE[6]=new TH1F(core+"EY0","Endcap BG1: L2W-BHT3-rnd & vertex OK & low ET; spin4 ",16,-0.5,15.5);
132  hE[7]=new TH1F(core+"EY1",Form("Endcap BG2: vertex & ET<20 & ET 2x2 << 4x4 : %s; spin4 ",coreTitle.Data()),16,-0.5,15.5);
133 
134  hE[8]=h=new TH1F(core+"EQpT","Endcap reco Q/PT,W ET>25 GeV; reco Q/PT (1/GeV)",100,-0.099,0.099);
135  hE[9]=h=new TH2F(core+"EQpT2","Endcap TPC PRIM Q/PT ; 2x2 cluster ET (GeV); Q/PT (1/GeV)",100,0.,100.,100,-0.1,0.1);
136 
137  //use 10-19
138  for(int ipn=0;ipn<2;ipn++){
139  TH1 *h;
140 
141  //.... J-peak
142  sprintf(txt0,"E_ET_%c",cPM[ipn]);
143  sprintf(txt,"Final Endcap W, charge=%c : %s; 2x2 ET (GeV) ",cPM[ipn],coreTitle.Data());
144  hE[10+ipn]=h=new TH1F(core+txt0,txt, 100,1,101); // shifted by 1 for nicer Rebin
145  h->SetFillColor(iCol[ipn]);
146 
147  //.... 1D spin sorting
148  sprintf(txt0,"EY2_%c",cPM[ipn]);
149  sprintf(txt,"Final Endcap W Q=%c, 2x2 ET=[25,50]GeV : %s; spin4 ",cPM[ipn],coreTitle.Data());
150  hE[12+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
151  h->SetFillColor(iCol[ipn]);
152 
153  sprintf(txt0,"EY3_%c",cPM[ipn]);
154  sprintf(txt,"Final Endcap W Q=%c, 2x2 ET=[32,44]GeV : %s; spin4 ",cPM[ipn],coreTitle.Data());
155  hE[14+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
156  h->SetFillColor(iCol[ipn]);
157 
158  sprintf(txt0,"EY4_%c",cPM[ipn]);
159  sprintf(txt,"Final Endcap (not all QCD!) Q=%c, 2x2 ET=[15,20]GeV : %s; spin4 ",cPM[ipn],coreTitle.Data());
160  hE[16+ipn]=h=new TH1F(core+txt0,txt,16,-0.5,15.5);
161  h->SetFillColor(iCol[ipn]);
162 
163  sprintf(txt0,"EY5_%c",cPM[ipn]);
164  sprintf(txt,"Final Endcap 2x2 ET Q=%c; spin4 : %s; 2x2 cluster ET (GeV) ",cPM[ipn],coreTitle.Data());
165  hE[18+ipn]=h=new TH2F(core+txt0,txt,16,-0.5,15.5,10,0,100);
166  h->SetFillColor(iCol[ipn]);
167 
168  sprintf(txt0,"ELepEta_%c",cPM[ipn]);
169  sprintf(txt,"selecting Endcap Ws Q=%c : %s ; lepton LAB eta",cPM[ipn],coreTitle.Data());
170  hE[29+ipn]=h=new TH1F(core+txt0,txt,400, -2.0,2.0);
171  Lx=h->GetListOfFunctions();
172  ln=new TLine(parE_leptonEta1,0,parE_leptonEta1,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
173  ln=new TLine(parE_leptonEta2,0,parE_leptonEta2,1e6); ln->SetLineColor(kRed); Lx->Add(ln);
174  }
175  // free 20-29
176 
177  hE[31]=h=new TH1F(core+"ELumET","Lumi monitor; 2x2 ET (GeV)",100,0.,100.);
178  hE[32]=h=new TH2F(core+"EQpT_hits","nHitsFit vs Q/PT,Endcap W ET>25 GeV; reco Q/PT (1/GeV); nFitPoints",100,-0.099,0.099,50,0,50);
179  hE[33]=h=new TH2F(core+"EQpT_hitF","nHitsFrac vs Q/PT,Endcap W ET>25 GeV; reco Q/PT (1/GeV); nHitsFrac",100,-0.099,0.099,50,0,1.1);
180  hE[34]=h=new TH2F(core+"EHitsFit_Frac","Endcap nHitsFit vs nHitsFrac; nHitsFit; nHitsFrac",50,0,50,50,0,1.1);
181 
182  // add histos to the list (if provided)
183  for(int i=0;i<mxHA;i++) {
184  if( hA[i]==0) continue;
185  HList->Add( hA[i]);
186  }
187  for(int i=0;i<mxHE;i++) {
188  if( hE[i]==0) continue;
189  HList->Add( hE[i]);
190  }
191  // HList->ls();
192  LOG_INFO<<Form("%s::initHistos done1",GetName())<<endm;
193 
194 }
195 
196 
197 // $Log: St2011pubSpin_histo.cxx,v $
198 // Revision 1.8 2013/09/13 19:33:13 stevens4
199 // Updates to code for combined 2011+2012 result presented to spin PWG 9.12.13
200 //
201 // Revision 1.7 2013/06/14 21:08:51 jlzhang
202 // add histo Q/pT vs. nHitsFit and Q/pT vs. nHitsPos
203 //
204 // Revision 1.7 2013/05/04/ zhang
205 // Add nHitsFit vs Q/pT and nHitsFit/nHitsPoss vs Q/pT , recover Q/pT
206 // Revision 1.6 2012/09/26 14:21:00 stevens4
207 // use PtBal cos(phi) for WB and WE algos and use Q*ET/PT for barrel charge sign
208 //
209 // Revision 1.5 2012/09/17 03:29:30 stevens4
210 // Updates to Endcap algo and Q*ET/PT charge separation
211 //
212 // Revision 1.4 2012/08/28 14:28:28 stevens4
213 // add histos for barrel and endcap algos
214 //
215 // Revision 1.3 2012/08/21 21:28:22 stevens4
216 // Add spin sorting for endcap Ws
217 //
218 // Revision 1.2 2012/08/07 21:06:38 stevens4
219 // update to tree analysis to produce independent histos in a TDirectory for each eta-bin
220 //
221 // Revision 1.1 2011/02/10 20:33:26 balewski
222 // start
223 //
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237