StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SpinIUHistos.cxx
1 #include "SpinIUHistos.h"
2 #include "TMath.h"
3 #include "TH1F.h"
4 #include "TH2F.h"
5 #include "TString.h"
6 #include "TMath.h"
7 #include "TDirectory.h"
8 #include <iostream>
9 
10 ClassImp(SpinIUHistos);
11 
12 // ----------------------------------------------------------------------------
13 SpinIUHistos::SpinIUHistos(const Char_t *name, const Char_t *title):TDirectory(name,title,"SpinIUHistos")
14 {
15 
16  //Double_t pt_bins[] = { 0.0, 3.4, 4.4, 5.4, 6.4, 8.4, 10.4, 12.4, 16.4, 32.4 };
17  //Int_t npt_bins = sizeof(pt_bins)/sizeof(Double_t)-1;
18 
19  Int_t nmass = 120;
20  Double_t min = 0.;
21  Double_t max = 1.2;
22 
23  mMin = 0.08;
24  mMax = 0.18;
25 
26  hMass = new TH1F(TString("hMass") +name, "diphoton invariant mass", nmass,min,max );
27  //hPT = new TH2F(TString("hPT") +name, "Diphoton transverse momentum vs mass", nmass,min,max,npt_bins,pt_bins);
28  hPT = new TH2F(TString("hPT") +name, "Diphoton transverse momentum vs mass", nmass,min,max,50,0.0, 25.0);
29  hZgg = new TH2F(TString("hZgg") +name, "Diphoton energy sharing vs mass", nmass,min,max,50,0.,1.);
30  hZvert= new TH2F(TString("hZvert") +name, "Event z-vertex vs mass", nmass,min,max,150,-150.,150.);
31  hEta = new TH2F(TString("hEta") +name, "Reconstructed #eta of #pi^{0} candidate vs mass",nmass,min,max,180,1.0,2.5);
32  hEEmcEta = new TH2F(TString("hEEmcEta") +name, "Detector #eta of #pi^{0} candidate vs mass",nmass,min,max,180,1.0,2.5);
33  hPhi = new TH2F(TString("hPhi") +name, "Detector #Phi of #pi^{0} candidate vs mass",nmass,min,max,360,-180.,180.);
34  hRGeo=new TH2F(TString("hRGeo")+name, "Reconstructed pi0 track; Recon phi / deg;ReconEta",360,-180.,180,20,1.,2.);
35  //hPiPosition= new TH2F(TString("hYX") +name, "#pi^{0} position at z=280cm", 120,-240.,240.,120,-240.,240.);
36  hYX[0]= new TH2F(TString("hYX_0") +name, "#pi^{0} position at z=280cm", 120,-240.,240.,120,-240.,240.);
37  hYX[1]= new TH2F(TString("hYX_1") +name, "higher energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
38  hYX[2]= new TH2F(TString("hYX_2") +name, "lower energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
39 
40  hE1E2 = new TH2F(TString("hE1E2") +name, "E1 vs E2", 100,0.,50.,100,0.,50.);
41 
42  hPhiggVsEnergy = new TH2F(TString("hPhiggVsEnergy")+name,"#phi_{#gamma #gamma} vs energy",100,0.,50.,100,0.,0.2);
43 
44  hEpi = new TH2F(TString("hEpi") +name, "Reconstructed energy of #pi^{0} candidate vs mass",nmass,min,max,60,0.0,60.);
45  hEsmd=new TH2F(TString("hEsmd")+name,"E_{smd} / E_{#pi^{0}} vs E_{#pi^{0}}", 60,0.,30.,60,0.,0.12);
46  hEpre1=new TH2F(TString("hEpre1")+name,"E_{pre1} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,6.);
47  hEpre2=new TH2F(TString("hEpre2")+name,"E_{pre2} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,12.);
48  hEpost=new TH2F(TString("hEpost")+name,"E_{post} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,1.2);
49 
50  hEpre12=new TH2F(TString("hEpre12")+name,"E_{pre2} vs E_{pre1} [MeV]",75,0.,150.,75,0.,150.);
51 
52 }
53 
54 // ----------------------------------------------------------------------------
55 void SpinIUHistos::Fill( StEEmcIUPair &pair )
56 {
57 
58  Float_t mass = pair.mass();
59  hMass -> Fill( mass );
60  hPT -> Fill( mass, pair.pt() );
61  hZgg -> Fill( mass, pair.zgg() );
62  hZvert -> Fill( mass, pair.vertex().Z() );
63  hEta -> Fill( mass, pair.momentum().Eta() );
64  hEpi->Fill(mass,pair.energy());
65  //calculate detector Eta
66  float Rxy=TMath::Sqrt(pair.vertex().x()*pair.vertex().x()+pair.vertex().y()*pair.vertex().y());
67  float hHeight=pair.pt()*(270.0-pair.vertex().Z())/pair.pz()+Rxy;
68  float etatheta=TMath::ATan(hHeight/270.0);
69  //printf("accept pz=%f\n",pair.pz());
70  float mideta=TMath::Tan(etatheta/2.0);
71  float eemceta=-TMath::Log(mideta);
72  hEEmcEta->Fill(mass,eemceta);
73  hPhi->Fill(mass,pair.momentum().Phi()*180./3.14159265);
74  hRGeo->Fill(pair.momentum().Phi()*180./3.14159265,eemceta);
75  Float_t esmd=0.;
76 
77  esmd += pair.point(0).cluster(0).energy();
78  esmd += pair.point(0).cluster(1).energy();
79  esmd += pair.point(1).cluster(0).energy();
80  esmd += pair.point(1).cluster(1).energy();
81 
82  Float_t epre1 = 0.;
83 
84  epre1 += pair.point(0).energy(1);
85  epre1 += pair.point(1).energy(1);
86 
87  Float_t epre2 = 0.;
88 
89  epre2 += pair.point(0).energy(2);
90  epre2 += pair.point(1).energy(2);
91 
92  Float_t epost = 0.;
93 
94  epost += pair.point(0).energy(3);
95  epost += pair.point(1).energy(3);
96 
97  //if ( mass >= mMin && mass < mMax )
98  //{
99  Float_t e1 = pair.point(0).energy();
100  Float_t e2 = pair.point(1).energy();
101  Float_t epi0=e1+e2;
102  hEsmd->Fill( epi0, esmd/epi0 );
103  hEpre1->Fill( epi0, epre1*1000./epi0 );
104  hEpre2->Fill( epi0, epre2*1000./epi0 );
105  hEpost->Fill( epi0, epost*1000./epi0 );
106  hEpre12->Fill( epre1*1000, epre2*1000 );
107  TVector3 p1 = pair.point(0).position();
108  TVector3 p2 = pair.point(1).position();
109  TVector3 pp = (e1*p1 + e2*p2) * ( 1/(e1+e2) );
110  hYX[0] -> Fill( pp.X(), pp.Y() );
111  hYX[1] -> Fill( p1.X(), p1.Y() );
112  hYX[2] -> Fill( p2.X(), p2.Y() );
113  hE1E2 -> Fill( e2, e1 );
114  hPhiggVsEnergy -> Fill( pair.phigg(), pair.energy() );
115  //}
116 
117 
118 
119 }
120 // ----------------------------------------------------------------------------
121 void SpinIUHistos::Clear(Option_t *opts)
122 {
123 
124  hMass->Reset();
125  hPT->Reset();
126  hZgg->Reset();
127  hZvert->Reset();
128  hEta->Reset();
129  hEEmcEta->Reset();
130  hPhi->Reset();
131  hRGeo->Reset();
132  hPhiggVsEnergy->Reset();
133  for ( Int_t i=0;i<3;i++ ) hYX[i]->Reset();
134  hE1E2->Reset();
135  hEpi->Reset();
136  hEsmd->Reset();
137  hEpre1->Reset();
138  hEpre2->Reset();
139  hEpost->Reset();
140  hEpre12->Reset();
141 }
Float_t phigg()
Returns opening-angle of pair.
Definition: StEEmcIUPair.h:77
void Clear(Option_t *opts="")
Float_t pt()
Returns pt of pair.
Definition: StEEmcIUPair.h:78
TVector3 vertex()
Returns vertex of pair.
Definition: StEEmcIUPair.h:81
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcIUPoint.h:25
void position(TVector3 p)
Set the position of this point at the SMD plane.
Definition: StEEmcIUPoint.h:23
TH2F * hYX[3]
Definition: SpinIUHistos.h:60
TH2F * hEpre1
Definition: SpinIUHistos.h:64
TH2F * hEpre2
Definition: SpinIUHistos.h:65
void cluster(StEEmcIUSmdCluster c, Int_t plane)
Add an smd cluster to this point.
Definition: StEEmcIUPoint.h:31
TH2F * hEpost
Definition: SpinIUHistos.h:66
TH2F * hE1E2
Definition: SpinIUHistos.h:61
Float_t mass()
Returns invariant mass of pair.
Definition: StEEmcIUPair.h:74
TH2F * hEpre12
Definition: SpinIUHistos.h:67
TH2F * hZvert
Definition: SpinIUHistos.h:52
TH1F * hMass
Definition: SpinIUHistos.h:46
TH2F * hEsmd
Definition: SpinIUHistos.h:63
Float_t energy()
Returns energy of pair.
Definition: StEEmcIUPair.h:75
StEEmcIUPoint point(Int_t index)
Definition: StEEmcIUPair.h:30
Spin sorted pi0 histograms.
Definition: SpinIUHistos.h:22
TVector3 momentum()
Returns momentum of pair.
Definition: StEEmcIUPair.h:80
Float_t zgg()
Returns energy-sharing of pair.
Definition: StEEmcIUPair.h:76
TH2F * hPhiggVsEnergy
Definition: SpinIUHistos.h:59