38 #include "StEEmcMixQAMaker.h"
39 #include "StEEmcMixMaker.h"
40 #include "StEEmcPool/StEEmcPointMaker/StEEmcPointMaker.h"
76 hNcandidates =
new TH1F(
"hNcandidates",
"Number of pairs",30,0.,30.);
77 hNcandidatesR =
new TH1F(
"hNcandidatesR",
"Number of pairs [0.1,0.18] per sector",12,0.,12.);
79 hMassRall=
new TH1F(
"hMassRall",
"Dipoint invariant mass, integrated",360,0.,3.6);
80 hZvertexRall=
new TH1F(
"hZvertexRall",
"Event vertex",150,-150.,150.);
83 for ( Int_t sec=0;sec<13;sec++ )
85 TString name=
"hYXpair";name+=sec+1;
86 TString title=
"Y vs X [cm] of stable pi0, sector ";title+=sec+1;
87 hYXpair.push_back(
new TH2F(name,title,125,-250.,250.,125,-250.,250.));
88 name=
"hYXhigh";name+=sec+1;
89 title=
"Y vs X [cm] of higher energy gamma, sector ";title+=sec+1;
90 hYXhigh.push_back(
new TH2F(name,title,250,-250.,250.,250,-250.,250.));
91 name.ReplaceAll(
"high",
"low");
92 title.ReplaceAll(
"high",
"low");
93 hYXlow.push_back(
new TH2F(name,title,250,-250.,250.,250,-250.,250.));
94 name=
"hE1E2sec";name+=sec+1;
95 title=
"Energy point1 vs Energy point2 [GeV], sector ";title+=sec+1;
96 hE1E2.push_back(
new TH2F(name,title,100,0.,50.,100,0.,50.));
102 for ( Int_t sec=0;sec<13;sec++ )
106 std::vector<TH1F *> tmp;
109 hZggR.push_back( tmp );
113 TString sec_name =
"-sec";sec_name+=sec+1;
117 TString bin_name =
"-bin";bin_name+=
ptbin;
119 TString hname=
"hMassR";hname+=sec_name;hname+=bin_name;
120 TString htitle=
"Dipoint invariant mass, sector=";htitle+=sec+1;
121 htitle+=
", ptbin="; htitle+=(Int_t)
ptbin;
122 hMassR[sec].push_back(
new TH1F(hname,htitle,360,0.,3.60) );
124 hname=
"hZvertexR";hname+=sec_name;hname+=bin_name;
125 htitle=
"Event vertex";htitle+=sec+1;
126 htitle+=
", ptbin="; htitle+=(Int_t)
ptbin;
127 hZvertexR[sec].push_back(
new TH1F(hname,htitle,150,-150.,150.));
129 hname=
"hZggR";hname+=sec_name;hname+=bin_name;
130 htitle=
"Zgg = |E1-E2|/E, sector= ";htitle+=sec+1; htitle+=
", ptbin=";htitle+=(Int_t)
ptbin;
131 hZggR[sec].push_back(
new TH1F(hname,htitle,50,0.,1.));
133 hname=
"hPhiggR";hname+=sec_name;hname+=bin_name;
134 htitle=
"Opening angle, sector=";htitle+=sec+1;htitle+=
", ptbin=";htitle+=(Int_t)
ptbin;
135 hPhiggR[sec].push_back(
new TH1F(hname,htitle,50,0.,0.1));
137 hname=
"hEnergyR";hname+=sec_name;hname+=bin_name;
138 htitle+=
"Energy, sector=";htitle+=sec+1;htitle+=
", ptbin=";htitle+=(Int_t)
ptbin;
139 hEnergyR[sec].push_back(
new TH1F(hname,htitle,50,0.,50.));
144 TString hname=
"hMassR";hname+=sec_name;hname+=
"-unbinned";
145 TString htitle=
"Dipoint invariant mass, sector=";htitle+=sec+1;
146 hMassR[sec].push_back(
new TH1F(hname,htitle,360,0.,3.6) );
148 hname=
"hZvertexR";hname+=sec_name;hname+=
"-unbinned";
149 htitle=
"Event vertex, sector=";htitle+=sec+1;
150 hZvertexR[sec].push_back(
new TH1F(hname,htitle,150,-150.,150.));
152 hname=
"hZggR";hname+=sec_name;hname+=
"-unbinned";
153 htitle=
"Zgg = |E1-E2|/E, sector=";htitle+=sec+1;
154 hZggR[sec].push_back(
new TH1F(hname,htitle,50,0.,1.));
156 hname=
"hPhiggR";hname+=sec_name;hname+=
"-unbinned";
157 htitle=
"Opening angle, sector=";htitle+=sec+1;
158 hPhiggR[sec].push_back(
new TH1F(hname,htitle,50,0.,0.1));
160 hname=
"hEnergyR";hname+=sec_name;hname+=
"-unbinned";
161 htitle+=
"Energy, sector=";htitle+=sec+1;
162 hEnergyR[sec].push_back(
new TH1F(hname,htitle,50,0.,50.));
168 return StMaker::Init();
178 std::vector< StEEmcPairVec_t > pairs;
179 for ( Int_t sec=0;sec<12;sec++ )
182 pairs.push_back(tmp);
231 for ( UInt_t sec=0;sec<12;sec++ )
235 if ( pairs[sec].size() > (UInt_t)
maxPerSector )
continue;
238 for ( UInt_t i=0;i<pairs[sec].size();i++ )
247 Int_t bin =
ptbin( pair );
248 std::cout <<
"pair=" << i <<
" ptmin=" <<
mBins[bin] <<
" ptmax=" <<
mBins[bin+1] <<
" mass=" << pair.
mass() <<
" zgg=" << pair.
zgg() << std::endl;
262 if ( bin>=0 )
hMassR[sec][bin] -> Fill( pair.
mass() );
263 if ( bin>=0 )
hMassR[ 12][bin] -> Fill( pair.
mass() );
282 if ( bin>= 0 )
hZggR[sec][bin] -> Fill( pair.
zgg() );
283 if ( bin>= 0 )
hZggR[ 12][bin] -> Fill( pair.
zgg() );
284 hZggR[sec].back() -> Fill( pair.
zgg() );
285 hZggR[ 12].back() -> Fill( pair.
zgg() );
287 if ( bin>= 0 )
hPhiggR[sec][bin] -> Fill( pair.
phigg() );
288 if ( bin>= 0 )
hPhiggR[ 12][bin] -> Fill( pair.
phigg() );
308 Float_t e1=point1.energy();
309 Float_t e2=point2.
energy();
311 TVector3 posp = ( e1 * pos1 + e2 * pos2 ) * ( 1.0/(e1+e2) );
313 hYXpair[sec] -> Fill( posp.X(), posp.Y() );
314 hYXhigh[sec] -> Fill( pos1.X(), pos1.Y() );
315 hYXlow[sec] -> Fill( pos2.X(), pos2.Y() );
316 hE1E2[sec] -> Fill( e2, e1 );
318 hYXpair[ 12] -> Fill( posp.X(), posp.Y() );
319 hYXhigh[ 12] -> Fill( pos1.X(), pos1.Y() );
320 hYXlow[ 12] -> Fill( pos2.X(), pos2.Y() );
321 hE1E2[ 12] -> Fill( e2, e1 );
336 for ( UInt_t i=0;i<
mBins.size()-1;i++ )
338 if ( pair.
pt() >
mBins[i] && pair.
pt() <=
mBins[i+1] )
return (Int_t)i;
350 assert(max>min && max>0.);
366 Bool_t towers[720];
for (Int_t i=0;i<720;i++ ) towers[i]=
false;
373 towers[ t1.
index() ] =
true;
374 towers[ t2.
index() ] =
true;
378 towers[ mytow.
index() ] =
true;
379 Etowers += mytow.
energy();
383 if ( !towers[mytow.
index()] ) Etowers += mytow.
energy();
384 towers[ mytow.
index() ] =
true;
399 if ( towers[ t.
index() ] ) count++;
402 Float_t Epoints = pair.
energy();
404 return ( count <= maxPerCluster && Epoints >
minTowerFrac * Etowers );
Int_t numberOfNeighbors() const
get the number of neighboring towers
StEEmcMixMaker * mEEmixer
Pointer to the pi0 mixer.
Base class for representing EEMC points.
Int_t Init()
initializes the maker
std::vector< std::vector< TH1F * > > hEnergyR
Pair energy [mMin,mMax].
void mixer(const Char_t *name, Float_t min=0., Float_t max=999.)
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
std::vector< std::vector< TH1F * > > hPhiggR
Opening angle [mMin,mMax].
Int_t sector() const
Returns the sector.
void neighbor(StEEmcTower *n)
add a tower to list of neighbors
StEEmcPoint point(Int_t ipoint)
Return a specified point.
Int_t Make()
processes a single event
TH1F * hZvertexRall
vertex for all events
A maker for creating pi0 histograms.
StEEmcPointMaker * mEEpoints
pointer to the point maker
Int_t numberOfCandidates()
returns the number of candidates
const TVector3 & vertex() const
Returns vertex of pair.
Class for building points from smd clusters.
std::vector< std::vector< TH1F * > > hZggR
Energy sharing [mMin,mMax].
std::vector< std::vector< TH1F * > > hZvertexR
Event vertex [mMin,mMax].
const StEEmcPoint & point(Int_t index) const
std::vector< Float_t > mBins
E1 vs E2.
Bool_t twoBodyCut(StEEmcPair p)
Int_t ptbin(StEEmcPair p)
returns the ptbin the pair is in
Int_t numberOfMixedCandidates()
returns the number of mixed-background candidates
Int_t numberOfPoints()
Return number of points.
Base class for representing tower, preshower and postshower elements.
Float_t zgg() const
Returns energy-sharing of pair.
std::vector< TH2F * > hYXhigh
Y vs X of higher energy gamma.
void points(const Char_t *name)
specifies the name of the point maker
Float_t energy() const
Returns energy of pair.
std::vector< std::vector< TH1F * > > hMassR
Bin boundaries in pT.
void tower(const StEEmcTower &t, Float_t w=1.)
Add a tower with specified weight to the point.
void position(const TVector3 &p)
Set the position of this point at the SMD plane.
StEEmcMixQAMaker(const Char_t *name)
constructor
Float_t mass() const
Returns invariant mass of pair.
A class for mixing pi0 candidates.
Float_t phigg() const
Returns opening-angle of pair.
TH1F * hMassRall
Mass spectrum for all events.
void energy(Float_t e)
Set the energy (adc-ped+0.5)/gain for this element.
std::vector< TH2F * > hYXlow
Y vs X of lower energy gamma.
Float_t pt() const
Returns pt of pair.
std::vector< TH2F * > hYXpair
Y vs X of pi0 pairs.
std::vector< TH2F * > hE1E2
Energy of first gamma vs energy of second.
A class to represent pairs of points.