StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St2009Wlumi_histo.cxx
1 // $Id: St2009Wlumi_histo.cxx,v 1.2 2011/09/14 14:23:21 stevens4 Exp $
2 //
3 //*-- Author : Ross Corliss, MIT
4 
5 #include <TH2.h>
6 #include <TList.h>
7 #include <TLine.h>
8 #include <TMath.h>
9 
10 #include "St2009WlumiMaker.h"
11 
12 //________________________________________________
13 //________________________________________________
14 void
15 St2009WlumiMaker::initHistos(){
16  // const float PI=TMath::Pi();
17  TString core="lumi_"; // prefix added to every histo name, to allow for multipl maker saving histos in the same root file
18 
19 
20  //...... data histograms
21  memset(hA,0,sizeof(hA));
22  TList *Lx; TLine *ln;TH1 *h;
23  char txt[1000], txt0[100];
24  int nCase=2;
25 
26  hA[0]=h=new TH1F(core+"EventType",core+" event type",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 
30  char key[][200]={"L2W","L2Wnormal","L2Wrandom"};
31  for(int i=0;i<3;i++) h->Fill(key[i],0.); // preset the order of keys
32 
33  // free 1-4, can be used
34  hA[5]=h=new TH1F(core+"WET"," Final W selection; 2x2 cluster ET (GeV), scaled by fdet", 100,0,100);
35  Lx=h->GetListOfFunctions();
36  ln=new TLine(par_highET,0,par_highET,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
37 
38  sprintf(txt,"TPC GLOB Q/PT ; 2x2 cluster ET (GeV); Q/PT");
39  hA[6]=h=new TH2F(core+"chRecPNg", txt,100,0.,100.,100,-0.1,0.1);
40  Lx=h->GetListOfFunctions();
41  ln=new TLine(0,0,100,0); ln->SetLineColor(kMagenta); Lx->Add(ln);
42 
43  sprintf(txt,"TPC PRIM Q/PT ; 2x2 cluster ET (GeV); Q/PT");
44  hA[7]=h=new TH2F(core+"chRecPNp", txt,100,0.,100.,100,-0.1,0.1);
45  Lx=h->GetListOfFunctions();
46  ln=new TLine(0,0,100,0); ln->SetLineColor(kMagenta); Lx->Add(ln);
47 
48  //free 8-9
49 
50  //use 10-15
51  char cPM[2]={'P','N'}; // Positive, Negative
52  for(int ipn=0;ipn<2;ipn++){
53  sprintf(txt0,"chWET%cg",cPM[ipn]);
54  sprintf(txt,"Final W glob sign=%c; 2x2 cluster ET ",cPM[ipn]);
55  hA[10+ipn]=h=new TH1F(core+txt0, txt, 100,0,100);
56  Lx=h->GetListOfFunctions();
57  ln=new TLine(par_highET,0,par_highET,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
58 
59  sprintf(txt0,"chWET%cp",cPM[ipn]);
60  sprintf(txt,"Final W prim sign=%c; 2x2 cluster ET ",cPM[ipn]);
61  hA[12+ipn]=h=new TH1F(core+txt0, txt, 100,0,100);
62  Lx=h->GetListOfFunctions();
63  ln=new TLine(par_highET,0,par_highET,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
64 
65 
66  sprintf(txt0,"chCF%c0",cPM[ipn]);
67  sprintf(txt,"prim sign=%c flip after V-refit; 2x2 cluster ET ",cPM[ipn]);
68  hA[14+ipn]=h=new TH1F(core+txt0, txt, 100,0,100);
69  }
70 
71  //use 16+
72  sprintf(txt,"Integrated (per run) Lumi vs Time; run number;Luminosity (pb^-1)");
73  hA[16]=h=new TH1F(core+"LvsT", txt,200000,10000000,10200000);
74 
75  sprintf(txt,"Live fraction of BEMC vs Time; run number;Fraction of towers with good status");
76  hA[17]=h=new TH1F(core+"GoodvsT", txt,200000,10000000,10200000);
77 
78  sprintf(txt,"Single Beam Background Counts vs Time;run number;Background BHT3 counts");
79  hA[18]=h=new TH1F(core+"SBBvsT",txt,200000,10000000,10200000);
80 
81  sprintf(txt,"blah");
82  hA[19]=h=new TH1F(core+"SoftBHT3",txt,200000,10000000,10200000);
83  hA[20]=h=new TH1F(core+"HardBHT3",txt,200000,10000000,10200000);
84  hA[21]=h=new TH1F(core+"AbortGap1",txt,200000,10000000,10200000);
85  hA[22]=h=new TH1F(core+"AbortGap2",txt,200000,10000000,10200000);
86  hA[23]=h=new TH1F(core+"ScaledBHT3",txt,200000,10000000,10200000);
87  hA[24]=h=new TH1F(core+"effLumi",txt,200000,10000000,10200000);
88  hA[25]=h=new TH1F(core+"nBHT3coin_coinBin",txt,16,0,16);
89 
90  for (int i=0;i<16;i++) {
91  hA[30+i]=h=new TH1F(core+Form("nBTH3coin_coinBin%d",i),txt,200000,10000000,10200000);
92  hA[50+i]=h=new TH1F(core+Form("AbortGap1_coinBin%d",i),txt,200000,10000000,10200000);
93  hA[70+i]=h=new TH1F(core+Form("AbortGap2_coinBin%d",i),txt,200000,10000000,10200000);
94  hA[90+i]=h=new TH1F(core+Form("awaySum_coinBin%d",i),txt,400,0.,400.);
95 
96  }
97 
98  // add histos to the list (if provided)
99  for(int i=0;i<mxHA;i++) {
100  if( hA[i]==0) continue;
101  HList->Add( hA[i]);
102  }
103  // HList->ls();
104  LOG_INFO<<Form("%s::initHistos done1",GetName())<<endm;
105 
106 }
107 
108 
109 // $Log: St2009Wlumi_histo.cxx,v $
110 // Revision 1.2 2011/09/14 14:23:21 stevens4
111 // update used for cross section PRD paper
112 //
113 // Revision 1.1 2009/11/23 23:00:18 balewski
114 // code moved spin-pool
115 //
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237