00001 #include "SpinHistos.h"
00002
00003 #include "TH1F.h"
00004 #include "TH2F.h"
00005 #include "TString.h"
00006
00007 #include <iostream>
00008
00009 ClassImp(SpinHistos);
00010
00011
00012 SpinHistos::SpinHistos(const Char_t *name, const Char_t *title):TDirectory(name,title,"SpinHistos")
00013 {
00014
00015 Double_t pt_bins[] = { 0.0, 3.4, 4.4, 5.4, 6.4, 8.4, 10.4, 12.4, 16.4, 32.4 };
00016 Int_t npt_bins = sizeof(pt_bins)/sizeof(Double_t)-1;
00017
00018 Int_t nmass = 120;
00019 Double_t min = 0.;
00020 Double_t max = 1.2;
00021
00022 mMin = 0.10;
00023 mMax = 0.18;
00024
00025 hMass = new TH1F(TString("hMass") +name, "Diphoton invariant mass", nmass,min,max );
00026 hPT = new TH2F(TString("hPT") +name, "Diphoton transverse momentum vs mass", nmass,min,max,npt_bins,pt_bins);
00027 hZgg = new TH2F(TString("hZgg") +name, "Diphoton energy sharing vs mass", nmass,min,max,50,0.,1.);
00028 hZvert= new TH2F(TString("hZvert") +name, "Event z-vertex vs mass", nmass,min,max,150,-150.,150.);
00029 hEta = new TH2F(TString("hEta") +name, "#eta of #pi^{0} candidate vs mass", nmass,min,max,48,1.086,2.);
00030
00031 hYX[0]= new TH2F(TString("hYX_0") +name, "#pi^{0} position at z=280cm", 120,-240.,240.,120,-240.,240.);
00032 hYX[1]= new TH2F(TString("hYX_1") +name, "higher energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
00033 hYX[2]= new TH2F(TString("hYX_2") +name, "lower energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
00034
00035 hE1E2 = new TH2F(TString("hE1E2") +name, "E1 vs E2", 100,0.,50.,100,0.,50.);
00036
00037 hPhiggVsEnergy = new TH2F(TString("hPhiggVsEnergy")+name,"#phi_{#gamma #gamma} vs energy",100,0.,50.,100,0.,0.2);
00038
00039
00040 hEsmd=new TH2F(TString("hEsmd")+name,"E_{smd} / E_{#pi^{0}} vs E_{#pi^{0}}", 60,0.,30.,60,0.,0.12);
00041 hEpre1=new TH2F(TString("hEpre1")+name,"E_{pre1} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,6.);
00042 hEpre2=new TH2F(TString("hEpre2")+name,"E_{pre2} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,12.);
00043 hEpost=new TH2F(TString("hEpost")+name,"E_{post} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,1.2);
00044
00045 hEpre12=new TH2F(TString("hEpre12")+name,"E_{pre2} vs E_{pre1} [MeV]",75,0.,150.,75,0.,150.);
00046
00047 }
00048
00049
00050 void SpinHistos::Fill(const StEEmcPair &pair )
00051 {
00052
00053 Float_t mass = pair.mass();
00054 hMass -> Fill( mass );
00055 hPT -> Fill( mass, pair.pt() );
00056 hZgg -> Fill( mass, pair.zgg() );
00057 hZvert -> Fill( mass, pair.vertex().Z() );
00058 hEta -> Fill( mass, pair.momentum().Eta() );
00059
00060 Float_t esmd=0.;
00061
00062 esmd += pair.point(0).cluster(0).energy();
00063 esmd += pair.point(0).cluster(1).energy();
00064 esmd += pair.point(1).cluster(0).energy();
00065 esmd += pair.point(1).cluster(1).energy();
00066
00067 Float_t epre1 = 0.;
00068
00069 epre1 += pair.point(0).energy(1);
00070 epre1 += pair.point(1).energy(1);
00071
00072 Float_t epre2 = 0.;
00073
00074 epre2 += pair.point(0).energy(2);
00075 epre2 += pair.point(1).energy(2);
00076
00077 Float_t epost = 0.;
00078
00079 epost += pair.point(0).energy(3);
00080 epost += pair.point(1).energy(3);
00081
00082 if ( mass >= mMin && mass < mMax )
00083 {
00084 Float_t e1 = pair.point(0).energy();
00085 Float_t e2 = pair.point(1).energy();
00086 Float_t epi0=e1+e2;
00087 hEsmd->Fill( epi0, esmd/epi0 );
00088 hEpre1->Fill( epi0, epre1*1000./epi0 );
00089 hEpre2->Fill( epi0, epre2*1000./epi0 );
00090 hEpost->Fill( epi0, epost*1000./epi0 );
00091 hEpre12->Fill( epre1*1000, epre2*1000 );
00092 TVector3 p1 = pair.point(0).position();
00093 TVector3 p2 = pair.point(1).position();
00094 TVector3 pp = (e1*p1 + e2*p2) * ( 1/(e1+e2) );
00095 hYX[0] -> Fill( pp.X(), pp.Y() );
00096 hYX[1] -> Fill( p1.X(), p1.Y() );
00097 hYX[2] -> Fill( p2.X(), p2.Y() );
00098 hE1E2 -> Fill( e2, e1 );
00099 hPhiggVsEnergy -> Fill( pair.phigg(), pair.energy() );
00100 }
00101
00102
00103
00104 }
00105
00106 void SpinHistos::Clear(Option_t *opts)
00107 {
00108
00109 hMass->Reset();
00110 hPT->Reset();
00111 hZgg->Reset();
00112 hZvert->Reset();
00113 hEta->Reset();
00114 hPhiggVsEnergy->Reset();
00115 for ( Int_t i=0;i<3;i++ ) hYX[i]->Reset();
00116 hE1E2->Reset();
00117 hEsmd->Reset();
00118 hEpre1->Reset();
00119 hEpre2->Reset();
00120 hEpost->Reset();
00121 hEpre12->Reset();
00122 }