StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
plTransMass.C
1 //Display plots related to reconstructing transverse mass for data and MC. Also shows correlations between "measured" quantities and values from the pythia record for W MC.
2 
3 void plTransMass(int isMC=1,int type=1){
4 
5  //type: ps==1 and png==everything else;
6 
7  char* dirMC="/star/u/stevens4/wAnalysis/ver4.41/out/";
8  char* dirData="/star/data05/scratch/stevens4/wAnalysisOut/ver4.41/data/";
9 
10  if(isMC) plMC(dirMC,type);
11  else plData(dirData,type);
12 
13  return;
14 }
15 
16 
17 //_________________________________________
18 //_________________________________________
19 void plMC(char* iPath="/star/u/stevens4/wAnalysis/ver4.41/out/",int type=1){
20 
21  char* core0="ppWprod_job";
22 
23  TString fullInpName=iPath; fullInpName+=core0;
24  fullInpName+=".wana.hist.root";
25  fd=new TFile(fullInpName);
26  if(! fd->IsOpen()) {
27  printf("EROR: input histo file not found, quit\n",fullInpName.Data());
28  return;
29  } else {
30  printf("Opened: %s\n",fullInpName.Data());
31  }
32 
33  gStyle->SetPalette(1);
34 
35  char *nameA[]={"MCWpt","MCWpL","MChadRecoilPt"};
36  char *nameB[]={"MCWminusHadRecoilpt","MChadRec_Wpt","MCdelPhi_Wpt","MCdelPhi_Recoilpt"};
37  char *nameC[]={"MCelectronRecoPt","MCelectronGeantPt","MCdiffElectronPtvsGeantpt","MCelectronRecovsGeant"};
38  char *nameD[]={"MCneutrinoRecoPt","MCneutrinoGeantPt","MCdiffNeutrinoPt","MCneutrinoRecovsGeant"};
39  char *nameE[]={"MCeleG_neutrinoG","MCmT","MCgMT","MCGmTminusmT"};
40  char *nameG[]={"MCRecoilEta_all","MCRecoilEta_WetaPos","MCRecoilEta_WetaNeg","MCRecoilEtaAll_Wpt"};
41 
42  cA=new TCanvas("aa","aa",800,600);
43  cA->Divide(2,2);
44  for(int i=0;i<3;i++) {
45  cA->cd(i+1);
46  h=(TH1F*)fd->Get(nameA[i]);
47  h->Draw();
48  }
49  TString titA="WMC1";
50  if(type==1) titA+=".ps";
51  else titA+=".png";
52  cA->Print(titA);
53 
54  cB=new TCanvas("bb","bb",800,600);
55  cB->Divide(2,2);
56  for(int i=0;i<4;i++) {
57  cB->cd(i+1);
58  h=(TH1F*)fd->Get(nameB[i]);
59  h->Draw();
60  if(i!=0) h->Draw("colz");
61  }
62  TString titB="WMC2";
63  if(type==1) titB+=".ps";
64  else titB+=".png";
65  cB->Print(titB);
66 
67  cC=new TCanvas("cc","cc",800,600);
68  cC->Divide(2,2);
69  for(int i=0;i<4;i++) {
70  cC->cd(i+1);
71  h=(TH1F*)fd->Get(nameC[i]);
72  h->Draw();
73  if(i==3 || i==2) h->Draw("colz");
74  }
75  TString titC="WMC3";
76  if(type==1) titC+=".ps";
77  else titC+=".png";
78  cC->Print(titC);
79 
80  cD=new TCanvas("dd","dd",800,600);
81  cD->Divide(2,2);
82  for(int i=0;i<4;i++) {
83  cD->cd(i+1);
84  h=(TH1F*)fd->Get(nameD[i]);
85  h->Draw();
86  if(i==3) h->Draw("colz");
87  }
88  TString titD="WMC4";
89  if(type==1) titD+=".ps";
90  else titD+=".png";
91  cD->Print(titD);
92 
93  cE=new TCanvas("ee","ee",800,600);
94  cE->Divide(2,2);
95  for(int i=0;i<4;i++) {
96  cE->cd(i+1);
97  h=(TH1F*)fd->Get(nameE[i]);
98  h->Draw();
99  if(i==0) h->Draw("colz");
100  }
101  TString titE="WMC5";
102  if(type==1) titE+=".ps";
103  else titE+=".png";
104  cE->Print(titE);
105 
106  cG=new TCanvas("gg","gg",800,600);
107  cG->Divide(2,2);
108  for(int i=0;i<4;i++) {
109  cG->cd(i+1);
110  h=(TH1F*)fd->Get(nameG[i]);
111  h->Draw();
112  if(i==3) h->Draw("colz");
113  }
114  TString titG="WMC6";
115  if(type==1) titG+=".ps";
116  else titG+=".png";
117  cG->Print(titG);
118 
119 }
120 
121 //_________________________________________
122 //_________________________________________
123 void plData(char* iPath="/star/data05/scratch/stevens4/wAnalysisOut/ver4.41/",int type=1){
124 
125  char* core0="run9setABCD.wana.hist.root";
126  TString fullInpName=iPath; fullInpName+=core0;
127 
128  fdData=new TFile(fullInpName);
129  if(! fdData->IsOpen()) {
130  printf("EROR: input histo file not found, quit\n",fullInpName);
131  return;
132  } else {
133  printf("Opened: %s\n",fullInpName.Data());
134  }
135 
136  gStyle->SetPalette(1);
137 
138  char *nameH[]={"JShadRecoilPt","JSelectronRecoPt","JSneutrinoRecoPt","JSmT"};
139 
140  cH=new TCanvas("hh","hh",800,600);
141  cH->Divide(2,2);
142  for(int k=0;k<4;k++) {
143  cH->cd(k+1);
144  h=(TH1F*)fdData->Get(nameH[k]);
145  h->Draw();
146  if(k==1) h->Rebin(2);
147  if(k>1) h->Rebin(4);
148  }
149  TString titH="RecoilData";
150  if(type==1) titH+=".ps";
151  else titH+=".png";
152  cH->Print(titH);
153 }
154 
155 
156 // $Log: plTransMass.C,v $
157 // Revision 1.1 2009/11/23 23:00:20 balewski
158 // code moved spin-pool
159 //