00001 #include "SpinIUHistos.h"
00002 #include "TMath.h"
00003 #include "TH1F.h"
00004 #include "TH2F.h"
00005 #include "TString.h"
00006 #include "TMath.h"
00007 #include "TDirectory.h"
00008 #include <iostream>
00009
00010 ClassImp(SpinIUHistos);
00011
00012
00013 SpinIUHistos::SpinIUHistos(const Char_t *name, const Char_t *title):TDirectory(name,title,"SpinIUHistos")
00014 {
00015
00016
00017
00018
00019 Int_t nmass = 120;
00020 Double_t min = 0.;
00021 Double_t max = 1.2;
00022
00023 mMin = 0.08;
00024 mMax = 0.18;
00025
00026 hMass = new TH1F(TString("hMass") +name, "diphoton invariant mass", nmass,min,max );
00027
00028 hPT = new TH2F(TString("hPT") +name, "Diphoton transverse momentum vs mass", nmass,min,max,50,0.0, 25.0);
00029 hZgg = new TH2F(TString("hZgg") +name, "Diphoton energy sharing vs mass", nmass,min,max,50,0.,1.);
00030 hZvert= new TH2F(TString("hZvert") +name, "Event z-vertex vs mass", nmass,min,max,150,-150.,150.);
00031 hEta = new TH2F(TString("hEta") +name, "Reconstructed #eta of #pi^{0} candidate vs mass",nmass,min,max,180,1.0,2.5);
00032 hEEmcEta = new TH2F(TString("hEEmcEta") +name, "Detector #eta of #pi^{0} candidate vs mass",nmass,min,max,180,1.0,2.5);
00033 hPhi = new TH2F(TString("hPhi") +name, "Detector #Phi of #pi^{0} candidate vs mass",nmass,min,max,360,-180.,180.);
00034 hRGeo=new TH2F(TString("hRGeo")+name, "Reconstructed pi0 track; Recon phi / deg;ReconEta",360,-180.,180,20,1.,2.);
00035
00036 hYX[0]= new TH2F(TString("hYX_0") +name, "#pi^{0} position at z=280cm", 120,-240.,240.,120,-240.,240.);
00037 hYX[1]= new TH2F(TString("hYX_1") +name, "higher energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
00038 hYX[2]= new TH2F(TString("hYX_2") +name, "lower energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
00039
00040 hE1E2 = new TH2F(TString("hE1E2") +name, "E1 vs E2", 100,0.,50.,100,0.,50.);
00041
00042 hPhiggVsEnergy = new TH2F(TString("hPhiggVsEnergy")+name,"#phi_{#gamma #gamma} vs energy",100,0.,50.,100,0.,0.2);
00043
00044 hEpi = new TH2F(TString("hEpi") +name, "Reconstructed energy of #pi^{0} candidate vs mass",nmass,min,max,60,0.0,60.);
00045 hEsmd=new TH2F(TString("hEsmd")+name,"E_{smd} / E_{#pi^{0}} vs E_{#pi^{0}}", 60,0.,30.,60,0.,0.12);
00046 hEpre1=new TH2F(TString("hEpre1")+name,"E_{pre1} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,6.);
00047 hEpre2=new TH2F(TString("hEpre2")+name,"E_{pre2} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,12.);
00048 hEpost=new TH2F(TString("hEpost")+name,"E_{post} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,1.2);
00049
00050 hEpre12=new TH2F(TString("hEpre12")+name,"E_{pre2} vs E_{pre1} [MeV]",75,0.,150.,75,0.,150.);
00051
00052 }
00053
00054
00055 void SpinIUHistos::Fill( StEEmcIUPair &pair )
00056 {
00057
00058 Float_t mass = pair.mass();
00059 hMass -> Fill( mass );
00060 hPT -> Fill( mass, pair.pt() );
00061 hZgg -> Fill( mass, pair.zgg() );
00062 hZvert -> Fill( mass, pair.vertex().Z() );
00063 hEta -> Fill( mass, pair.momentum().Eta() );
00064 hEpi->Fill(mass,pair.energy());
00065
00066 float Rxy=TMath::Sqrt(pair.vertex().x()*pair.vertex().x()+pair.vertex().y()*pair.vertex().y());
00067 float hHeight=pair.pt()*(270.0-pair.vertex().Z())/pair.pz()+Rxy;
00068 float etatheta=TMath::ATan(hHeight/270.0);
00069
00070 float mideta=TMath::Tan(etatheta/2.0);
00071 float eemceta=-TMath::Log(mideta);
00072 hEEmcEta->Fill(mass,eemceta);
00073 hPhi->Fill(mass,pair.momentum().Phi()*180./3.14159265);
00074 hRGeo->Fill(pair.momentum().Phi()*180./3.14159265,eemceta);
00075 Float_t esmd=0.;
00076
00077 esmd += pair.point(0).cluster(0).energy();
00078 esmd += pair.point(0).cluster(1).energy();
00079 esmd += pair.point(1).cluster(0).energy();
00080 esmd += pair.point(1).cluster(1).energy();
00081
00082 Float_t epre1 = 0.;
00083
00084 epre1 += pair.point(0).energy(1);
00085 epre1 += pair.point(1).energy(1);
00086
00087 Float_t epre2 = 0.;
00088
00089 epre2 += pair.point(0).energy(2);
00090 epre2 += pair.point(1).energy(2);
00091
00092 Float_t epost = 0.;
00093
00094 epost += pair.point(0).energy(3);
00095 epost += pair.point(1).energy(3);
00096
00097
00098
00099 Float_t e1 = pair.point(0).energy();
00100 Float_t e2 = pair.point(1).energy();
00101 Float_t epi0=e1+e2;
00102 hEsmd->Fill( epi0, esmd/epi0 );
00103 hEpre1->Fill( epi0, epre1*1000./epi0 );
00104 hEpre2->Fill( epi0, epre2*1000./epi0 );
00105 hEpost->Fill( epi0, epost*1000./epi0 );
00106 hEpre12->Fill( epre1*1000, epre2*1000 );
00107 TVector3 p1 = pair.point(0).position();
00108 TVector3 p2 = pair.point(1).position();
00109 TVector3 pp = (e1*p1 + e2*p2) * ( 1/(e1+e2) );
00110 hYX[0] -> Fill( pp.X(), pp.Y() );
00111 hYX[1] -> Fill( p1.X(), p1.Y() );
00112 hYX[2] -> Fill( p2.X(), p2.Y() );
00113 hE1E2 -> Fill( e2, e1 );
00114 hPhiggVsEnergy -> Fill( pair.phigg(), pair.energy() );
00115
00116
00117
00118
00119 }
00120
00121 void SpinIUHistos::Clear(Option_t *opts)
00122 {
00123
00124 hMass->Reset();
00125 hPT->Reset();
00126 hZgg->Reset();
00127 hZvert->Reset();
00128 hEta->Reset();
00129 hEEmcEta->Reset();
00130 hPhi->Reset();
00131 hRGeo->Reset();
00132 hPhiggVsEnergy->Reset();
00133 for ( Int_t i=0;i<3;i++ ) hYX[i]->Reset();
00134 hE1E2->Reset();
00135 hEpi->Reset();
00136 hEsmd->Reset();
00137 hEpre1->Reset();
00138 hEpre2->Reset();
00139 hEpost->Reset();
00140 hEpre12->Reset();
00141 }