StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SpinHistos.cxx
1 #include "SpinHistos.h"
2 
3 #include "TH1F.h"
4 #include "TH2F.h"
5 #include "TString.h"
6 
7 #include <iostream>
8 
9 ClassImp(SpinHistos);
10 
11 // ----------------------------------------------------------------------------
12 SpinHistos::SpinHistos(const Char_t *name, const Char_t *title):TDirectory(name,title,"SpinHistos")
13 {
14 
15  Double_t pt_bins[] = { 0.0, 3.4, 4.4, 5.4, 6.4, 8.4, 10.4, 12.4, 16.4, 32.4 };
16  Int_t npt_bins = sizeof(pt_bins)/sizeof(Double_t)-1;
17 
18  Int_t nmass = 120;
19  Double_t min = 0.;
20  Double_t max = 1.2;
21 
22  mMin = 0.10;
23  mMax = 0.18;
24 
25  hMass = new TH1F(TString("hMass") +name, "Diphoton invariant mass", nmass,min,max );
26  hPT = new TH2F(TString("hPT") +name, "Diphoton transverse momentum vs mass", nmass,min,max,npt_bins,pt_bins);
27  hZgg = new TH2F(TString("hZgg") +name, "Diphoton energy sharing vs mass", nmass,min,max,50,0.,1.);
28  hZvert= new TH2F(TString("hZvert") +name, "Event z-vertex vs mass", nmass,min,max,150,-150.,150.);
29  hEta = new TH2F(TString("hEta") +name, "#eta of #pi^{0} candidate vs mass", nmass,min,max,48,1.086,2.);
30 
31  hYX[0]= new TH2F(TString("hYX_0") +name, "#pi^{0} position at z=280cm", 120,-240.,240.,120,-240.,240.);
32  hYX[1]= new TH2F(TString("hYX_1") +name, "higher energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
33  hYX[2]= new TH2F(TString("hYX_2") +name, "lower energy gamma at z=280 cm", 240,-240.,240.,240,-240.,240.);
34 
35  hE1E2 = new TH2F(TString("hE1E2") +name, "E1 vs E2", 100,0.,50.,100,0.,50.);
36 
37  hPhiggVsEnergy = new TH2F(TString("hPhiggVsEnergy")+name,"#phi_{#gamma #gamma} vs energy",100,0.,50.,100,0.,0.2);
38 
39 
40  hEsmd=new TH2F(TString("hEsmd")+name,"E_{smd} / E_{#pi^{0}} vs E_{#pi^{0}}", 60,0.,30.,60,0.,0.12);
41  hEpre1=new TH2F(TString("hEpre1")+name,"E_{pre1} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,6.);
42  hEpre2=new TH2F(TString("hEpre2")+name,"E_{pre2} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,12.);
43  hEpost=new TH2F(TString("hEpost")+name,"E_{post} [MeV] / E_{#pi^{0}} [GeV] vs E_{#pi^{0}}", 60,0.,30.,60,0.,1.2);
44 
45  hEpre12=new TH2F(TString("hEpre12")+name,"E_{pre2} vs E_{pre1} [MeV]",75,0.,150.,75,0.,150.);
46 
47 }
48 
49 // ----------------------------------------------------------------------------
50 void SpinHistos::Fill(const StEEmcPair &pair )
51 {
52 
53  Float_t mass = pair.mass();
54  hMass -> Fill( mass );
55  hPT -> Fill( mass, pair.pt() );
56  hZgg -> Fill( mass, pair.zgg() );
57  hZvert -> Fill( mass, pair.vertex().Z() );
58  hEta -> Fill( mass, pair.momentum().Eta() );
59 
60  Float_t esmd=0.;
61 
62  esmd += pair.point(0).cluster(0).energy();
63  esmd += pair.point(0).cluster(1).energy();
64  esmd += pair.point(1).cluster(0).energy();
65  esmd += pair.point(1).cluster(1).energy();
66 
67  Float_t epre1 = 0.;
68 
69  epre1 += pair.point(0).energy(1);
70  epre1 += pair.point(1).energy(1);
71 
72  Float_t epre2 = 0.;
73 
74  epre2 += pair.point(0).energy(2);
75  epre2 += pair.point(1).energy(2);
76 
77  Float_t epost = 0.;
78 
79  epost += pair.point(0).energy(3);
80  epost += pair.point(1).energy(3);
81 
82  if ( mass >= mMin && mass < mMax )
83  {
84  Float_t e1 = pair.point(0).energy();
85  Float_t e2 = pair.point(1).energy();
86  Float_t epi0=e1+e2;
87  hEsmd->Fill( epi0, esmd/epi0 );
88  hEpre1->Fill( epi0, epre1*1000./epi0 );
89  hEpre2->Fill( epi0, epre2*1000./epi0 );
90  hEpost->Fill( epi0, epost*1000./epi0 );
91  hEpre12->Fill( epre1*1000, epre2*1000 );
92  TVector3 p1 = pair.point(0).position();
93  TVector3 p2 = pair.point(1).position();
94  TVector3 pp = (e1*p1 + e2*p2) * ( 1/(e1+e2) );
95  hYX[0] -> Fill( pp.X(), pp.Y() );
96  hYX[1] -> Fill( p1.X(), p1.Y() );
97  hYX[2] -> Fill( p2.X(), p2.Y() );
98  hE1E2 -> Fill( e2, e1 );
99  hPhiggVsEnergy -> Fill( pair.phigg(), pair.energy() );
100  }
101 
102 
103 
104 }
105 // ----------------------------------------------------------------------------
106 void SpinHistos::Clear(Option_t *opts)
107 {
108 
109  hMass->Reset();
110  hPT->Reset();
111  hZgg->Reset();
112  hZvert->Reset();
113  hEta->Reset();
114  hPhiggVsEnergy->Reset();
115  for ( Int_t i=0;i<3;i++ ) hYX[i]->Reset();
116  hE1E2->Reset();
117  hEsmd->Reset();
118  hEpre1->Reset();
119  hEpre2->Reset();
120  hEpost->Reset();
121  hEpre12->Reset();
122 }
TH2F * hEta
Definition: SpinHistos.h:53
void cluster(const StEEmcSmdCluster &c, Int_t plane)
Add an smd cluster to this point.
Definition: StEEmcPoint.h:40
TH1F * hMass
Definition: SpinHistos.h:46
TH2F * hEpre1
Definition: SpinHistos.h:62
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcPoint.h:34
TH2F * hPhiggVsEnergy
Definition: SpinHistos.h:57
TH2F * hZgg
Definition: SpinHistos.h:51
const TVector3 & momentum() const
Returns momentum of pair.
Definition: StEEmcPair.h:78
const TVector3 & vertex() const
Returns vertex of pair.
Definition: StEEmcPair.h:79
TH2F * hEpost
Definition: SpinHistos.h:64
Float_t mMax
Definition: SpinHistos.h:42
TH2F * hEpre12
Definition: SpinHistos.h:65
TH2F * hPT
Definition: SpinHistos.h:50
const StEEmcPoint & point(Int_t index) const
Definition: StEEmcPair.h:30
TH2F * hYX[3]
Definition: SpinHistos.h:58
TH2F * hE1E2
Definition: SpinHistos.h:59
Float_t zgg() const
Returns energy-sharing of pair.
Definition: StEEmcPair.h:75
void Clear(Option_t *opts="")
Definition: SpinHistos.cxx:106
Float_t mMin
Definition: SpinHistos.h:41
Float_t energy() const
Returns energy of pair.
Definition: StEEmcPair.h:74
void position(const TVector3 &p)
Set the position of this point at the SMD plane.
Definition: StEEmcPoint.h:32
TH2F * hEpre2
Definition: SpinHistos.h:63
Float_t mass() const
Returns invariant mass of pair.
Definition: StEEmcPair.h:73
Float_t phigg() const
Returns opening-angle of pair.
Definition: StEEmcPair.h:76
TH2F * hEsmd
Definition: SpinHistos.h:61
TH2F * hZvert
Definition: SpinHistos.h:52
Float_t pt() const
Returns pt of pair.
Definition: StEEmcPair.h:77
A class to represent pairs of points.
Definition: StEEmcPair.h:9
Spin sorted pi0 histograms.
Definition: SpinHistos.h:22