00001 int A='A', B='B',C='C',D='D',E='E';
00002 int a='A', b='B',c='C',d='D',e='E';
00003 TFile *f;
00004 TCanvas *cc;
00005
00006 plPresMap(int sect=3){
00007 TString path="./";
00008 path="/star/data05/scratch/balewski/2005-eemcCal/";
00009
00010
00011 path+="/mc-hist/iter8-mc/";
00012 path="iter14-pp/";
00013 path+="sum-sect"; path+=sect;
00014
00015 path+=".hist.root";
00016
00017 f=new TFile(path);
00018 assert(f->IsOpen());
00019
00020 gStyle->SetPalette(1,0);
00021 return;
00022 }
00023
00024 plPresSect(int sec=1) {
00025 int sub=B,eta=4;
00026 for(eta=1;eta<=12;eta++)
00027 for(sub=A;sub<=E;sub++) {
00028 plPres(sec,sub,eta);
00029 cc->Print();
00030 }
00031 }
00032
00033 plPres( int sec=3, int sub=c, int eta=10 ) {
00034 int reb0=4;
00035 char name[100];
00036 sprintf(name,"tower-%02d%c%02d",sec,sub,eta);
00037
00038 cc=new TCanvas(name,name,550,560); cc->Divide(2,2);
00039
00040
00041 int binL=5,binH=50;
00042 const int nT=4;
00043 char tA[nT]={'T','P','Q','R'};
00044 char *tN[nT]={"Tow","Pre1","Pre2","Post"};
00045 int pedA[nT]={20,50,50,50};
00046 int it;
00047 for(it=0;it<nT;it++) {
00048 int reb=reb0;
00049 if(it==0) reb=2;
00050 int ped=pedA[it];
00051 cc->cd(1+it);
00052 char name[100];
00053
00054 sprintf(name,"a%02d%c%c%02d",sec,tA[it],sub,eta);
00055
00056 TH1F *h=(TH1F *)f->Get(name); assert(h);
00057 int aN= h->Integral(binL+ped,binH+ped);
00058 h->Draw();
00059 h->SetMinimum(0.2);
00060 float yMax=h->GetMaximum()/20.;
00061
00062 gPad->SetLogy();
00063 if(it==0) h->SetAxisRange(-50,120);
00064
00065 sprintf(name,"d%02d%c%c%02d",sec,tA[it],sub,eta);
00066 h=(TH1F *)f->Get(name); assert(h);
00067 int dN= h->GetEntries();
00068 h->SetFillColor( kRed); h->SetLineColor( kRed);
00069 h->Draw("same");
00070 h->Rebin(reb);
00071
00072 sprintf(name,"e%02d%c%c%02d",sec,tA[it],sub,eta);
00073 h=(TH1F *)f->Get(name); assert(h);
00074 int eN= h->GetEntries();
00075 h->Draw("same");
00076 h->Rebin(reb);
00077 h->SetFillColor( h->GetLineColor( ));
00078 h->SetFillStyle(3644);
00079
00080 float r=0;
00081 if(dN) r=1.*eN/dN;
00082
00083 printf("%s [%d,%d]--> a=%5d d=%3d e=%3d r=%.2f\n",name+1,binL,binH,aN,dN,eN,r);
00084
00085 sprintf(name,"%s R=%.2f",tN[it],r);
00086 TText *tx=new TText(20,yMax,name);
00087 tx->SetTextSize(0.08);
00088 tx->SetTextColor( h->GetLineColor( ) );
00089
00090 tx->Draw();
00091
00092 }
00093 }
00094
00095
00096 plotDead(){
00097 TGraph *grT=new TGraph();
00098 grT->SetMarkerStyle(22); grT->SetMarkerSize(2);grT->SetMarkerColor(kMagenta);
00099 grT->SetPoint(0,65,115);
00100 grT->SetPoint(1,21,-93);
00101 grT->SetPoint(2,-60,-100);
00102 grT->Draw("P");
00103 return;
00104
00105 TGraph *grR=new TGraph(); grR->SetMarkerSize(2);grR->SetMarkerColor(kBlue);
00106 grR->SetMarkerStyle(24);
00107 grR->SetPoint(0,120,168);
00108 grR->SetPoint(1,201, -45);
00109 grR->SetPoint(2,-55,-75);
00110 grR->Draw("P");
00111
00112 TGraph *grP=new TGraph(); grP->SetMarkerSize(2);grP->SetMarkerColor(kRed);
00113 grR->SetMarkerStyle(25);
00114 grR->SetPoint(0,25,-85);
00115 grR->SetPoint(1,27,-88);
00116 grR->SetPoint(2,75,-175);
00117 grR->SetPoint(3,90,-152);
00118 grR->Draw("P");
00119 }