1 #include "StEEmcMixHistMaker.h"
8 StEEmcMixHistMaker::StEEmcMixHistMaker(
const Char_t *name):
StEEmcMixMaker(name)
11 std::cout <<
"In constructor" << std::endl;
16 std::cout <<
"..." << std::endl;
24 book(hMass,
"hMass",
"Dipoint invariant mass spectrum",120,0.,1.2);
25 book(hEnergy,
"hEnergy",
"Dipoint energy distribution",100,0.,40.);
26 book(hPT,
"hPT",
"Dipoint PT distribution",100,0.,20.);
27 book(hZgg,
"hZgg",
"Dipoint asymmetry",100,0.,1.);
28 book(hPhigg,
"hPhigg",
"Dipoint opening angle",100,0.,0.2);
29 book(hU1,
"hU1",
"U seed strip for higher energy gamma",288,0.,288.);
30 book(hU2,
"hU2",
"U seed strip for lower energy gamma",288,0.,288.);
31 book(hV1,
"hV1",
"V seed strip for higher energy gamma",288,0.,288.);
32 book(hV2,
"hV2",
"V seed strip for lower energy gamma",288,0.,288.);
38 void StEEmcMixHistMaker::book( TH1F **h,
const Char_t *name,
const Char_t *title, Int_t nbin, Float_t min, Float_t max )
41 const Char_t *n[]={
"R",
"B",
"S"};
42 const Char_t *t[]={
", real events",
", mixed events",
", background subtracked"};
43 const Int_t col[]={1,2,4};
45 for ( Int_t i=0;i<3;i++ )
47 h[i]=
new TH1F(TString(name)+n[i], TString(title)+t[i], nbin, min, max );
49 h[i]->SetLineColor( col[i] );
58 if ( stat !=
kStOK )
return stat;
88 hMass[mode]->Fill( pair.
mass() );
89 if ( pair.
mass() >= mMin && pair.
mass() < mMax ) {
90 hEnergy[mode]->Fill( pair.
energy() );
91 hPT[mode]->Fill( pair.
momentum().Perp() );
92 hZgg[mode]->Fill( pair.
zgg() );
93 hPhigg[mode]->Fill( pair.
phigg() );
110 Float_t a=hMass[0]->Integral(80,120);
111 Float_t b=hMass[1]->Integral(80,120);
112 if ( b > 0. ) norm = a/b;
114 subtract(hMass,norm);
115 subtract(hEnergy,norm);
118 subtract(hPhigg,norm);
128 void StEEmcMixHistMaker::subtract( TH1F **h, Float_t norm )
131 h[2]->Add(h[0], 1.0);
132 h[2]->Add(h[1],-1.0);
135 Bool_t StEEmcMixHistMaker::accept(
StEEmcPair &pair )
137 if ( pair.
pt() < 2.0 )
return false;
void cluster(const StEEmcSmdCluster &c, Int_t plane)
Add an smd cluster to this point.
void book()
create 1d and 2d histograms
void fill()
fill 1d and 2d histograms
const TVector3 & momentum() const
Returns momentum of pair.
const StEEmcPoint & point(Int_t index) const
Float_t zgg() const
Returns energy-sharing of pair.
Float_t energy() const
Returns energy of pair.
Float_t mass() const
Returns invariant mass of pair.
A class for mixing pi0 candidates.
Float_t phigg() const
Returns opening-angle of pair.
StEEmcPairVec_t mBackground
Background pairs mixed on each event.
Float_t pt() const
Returns pt of pair.
StEEmcPairVec_t mCandidates
Point pairs mixed on each event.
A class to represent pairs of points.