1 #include "StEEmcPi0Maker.h"
4 #include "StEEmcPair.h"
6 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
7 #include "StMuDSTMaker/COMMON/StMuDst.h"
8 #include "StMuDSTMaker/COMMON/StMuEvent.h"
9 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
10 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
12 #include "StEvent/StEvent.h"
13 #include "StEvent/StTriggerIdCollection.h"
14 #include "StEvent/StTriggerId.h"
16 #include "StarClassLibrary/StThreeVectorF.hh"
17 #include "StarRoot/TH1Helper.h"
24 #include "StEEmcMixEvent.h"
32 StEEmcPi0Maker::StEEmcPi0Maker(
const Char_t *name,
38 mEEclusters=cl; assert(cl);
45 void StEEmcPi0Maker::setFile( TFile *f ){ mFile=f; }
46 TTree *StEEmcPi0Maker::tree(){
return mTree; }
49 Int_t StEEmcPi0Maker::Init()
51 hMass =
new TH2F(
"hMass",
"Diphoton invariant mass; M [GeV]",120,0.,1.2,20,0.,20.);
52 hMass_cut =
new TH2F(
"hMass_cut",
"Diphoton invariant mass; M [GeV]",120,0.,1.2,20,0.,20.);
53 hMass_split =
new TH2F(
"hMass_split",
"Mass for events w/ a split smd cluster",120,0.,1.2,20,0.,20.);
55 hPT =
new TH1F(
"hPT",
"Diphoton p_{T}; p_{T} [GeV]",20,0.,20.);
56 hPT_cut =
new TH1F(
"hPT_cut",
"Diphoton p_{T}; p_{T} [GeV]",20,0.,20.);
57 hXF =
new TH1F(
"hXF",
"x_{F}=#frac{p_{L}}{#sqrt{s}/2}",50,0.,1.);
58 hEnergy =
new TH1F(
"hEnergy",
"Diphoton energy; E [GeV]",50,0.,50.);
59 hEta =
new TH1F(
"hEta",
"Diphoton #eta",24,0.8,2.2);
60 hPhi =
new TH1F(
"hPhi",
"Diphoton #phi",30,-3.142,3.142);
61 hZvertex=
new TH1F(
"hZvertex",
"z vertex",150,-150.,150.);
62 hZgg =
new TH1F(
"hZgg",
"energy sharing",50,0.,1.);
63 hZgg_cut =
new TH1F(
"hZgg_cut",
"energy sharing",50,0.,1.);
65 hEChi2 =
new TH1F(
"hEChi2",
"#sum_{points} #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
66 hE1Chi2 =
new TH1F(
"hE1Chi2",
"point1 #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
67 hE2Chi2 =
new TH1F(
"hE2Chi2",
"point2 #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
69 hEChi2_low =
new TH1F(
"hEChi2_low",
"#sum_{points} #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
70 hE1Chi2_low =
new TH1F(
"hE1Chi2_low",
"point1 #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
71 hE2Chi2_low =
new TH1F(
"hE2Chi2_low",
"point2 #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
73 hEChi2_hi =
new TH1F(
"hEChi2_hi",
"#sum_{points} #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
74 hE1Chi2_hi =
new TH1F(
"hE1Chi2_hi",
"point1 #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
75 hE2Chi2_hi =
new TH1F(
"hE2Chi2_hi",
"point2 #frac{(Eu-Ev)^{2}}{Nmip}",50,0.,10.);
77 hRatio =
new TH1F(
"hRatio",
"E_{smd} / E_{towers}",20,0.,0.05);
78 hRatio_low =
new TH1F(
"hRatio_low",
"E_{smd} / E_{towers}",20,0.,0.05);
79 hRatio_hi =
new TH1F(
"hRatio_hi",
"E_{smd} / E_{towers}",20,0.,0.05);
81 hEvents =
new TH1F(
"hEvents",
"event counter",1,0.,1.);
82 TH1Helper::SetCanRebin(hEvents);
88 mTree=
new TTree(
"mPi0Tree",
"EEmc pi0 events");
90 mTree->Branch(
"pi0event",&mPi0Event,32000,99);
91 mTree->SetDirectory( mFile );
94 return StMaker::Init();
104 hEvents->Fill(
"event",1.0);
107 hEvents->Fill(
"trigger",1.0);
110 TVector3
vertex( pv.x(), pv.y(), pv.z() );
112 if ( pv.z() < -150. || pv.z() > 150.0 || pv.z()==0.0 )
return kStOK;
113 hEvents->Fill(
"vertex",1.0);
118 if ( points.size() < 2 )
return kStOK;
119 hEvents->Fill(
"two+ points",1.0);
121 mPi0Event->setEvent( mudst->
muDst()->
event() );
124 for ( UInt_t ipoint=0;ipoint<points.size();ipoint++ )
129 for ( UInt_t jpoint=0;jpoint<points.size();jpoint++ )
131 if (ipoint>=jpoint)
continue;
135 Int_t phibin1 = p1.
tower(0).phibin();
136 Int_t phibin2 = p2.
tower(0).phibin();
142 Int_t dphi = phibin1-phibin2;
143 if ( dphi < 0 ) dphi+=60;
144 if ( dphi > 30 ) dphi=60-dphi;
146 if ( dphi > 10 )
continue;
158 mPairs.push_back( pair );
159 mPi0Event->addPair( pair );
164 StEEmcClusterVec_t tower_clusters;
167 tower_clusters.push_back( c1 );
168 if ( c1.key() != c2.key() ) {
169 tower_clusters.push_back(c2);
172 mPi0Event->mNumberOfTowerClusters.push_back( (Int_t)tower_clusters.size() );
176 for ( UInt_t i=0;i<tower_clusters.size();i++ )
194 hEvents->Fill(
"pair",1.0);
196 if ( pair.
momentum().Perp() < 3.0 )
continue;
198 hEvents->Fill(
"pair pt>3",1.0);
208 hEvents->Fill(
"pair in cl",1.0);
212 if ( cluster1.numberOfMatchingClusters(4) > 2 ||
213 cluster1.numberOfMatchingClusters(5) > 2 )
continue;
220 Bool_t didSplit =
false;
221 if ( u1.
key() == u2.
key() || v1.
key() == v2.
key() ) didSplit=
true;
227 Float_t esum_smd = u1.energy()+u2.energy()+v1.energy()+v2.energy();
228 Float_t esum_tow = cluster1.
energy();
229 if ( cluster1.key() != cluster2.key() ) esum_tow += cluster2.
energy();
233 hEvents->Fill(
"pair ncl",1.0);
235 hMass->Fill( pair.
mass(), pair.
pt() );
236 if( didSplit ) hMass_split->Fill( pair.
mass(), pair.
pt() );
238 Float_t ediff1 = 1000.0*(u1.energy()-v1.energy());
239 Float_t ediff2 = 1000.0*(u2.energy()-v2.energy());
240 Float_t nmip1 = 1000.0*(u1.energy()+v1.energy())/1.3;
241 Float_t nmip2 = 1000.0*(u2.energy()+v2.energy())/1.3;
242 if ( nmip1>0. && nmip2>0. )
244 Float_t e1chi2 = ediff1*ediff1/nmip1;
245 Float_t e2chi2 = ediff2*ediff2/nmip2;
246 Float_t echi2 = e1chi2+e2chi2;
248 if ( e1chi2 < 4.0 && e2chi2 < 4.0 ) {
249 hMass_cut -> Fill( pair.
mass(), pair.
pt() );
250 if ( pair.
mass()>0.1 && pair.
mass()<0.18 ) hPT_cut->Fill( pair.
pt() );
251 if ( pair.
mass()>0.1 && pair.
mass()<0.18 ) hZgg_cut->Fill( pair.
zgg() );
254 if ( pair.
mass() < 0.1 ) {
255 hEChi2_low->Fill(echi2);
256 hE1Chi2_low->Fill(e1chi2);
257 hE2Chi2_low->Fill(e2chi2);
258 hRatio_low -> Fill( esum_smd/esum_tow );
260 if ( pair.
mass() > 0.2 ) {
261 hEChi2_hi->Fill(echi2);
262 hE1Chi2_hi->Fill(e1chi2);
263 hE2Chi2_hi->Fill(e2chi2);
264 hRatio_hi -> Fill( esum_smd/esum_tow );
269 if ( pair.
mass() > 0.1 && pair.
mass() < 0.18 ) {
271 hPT->Fill( pair.
momentum().Perp() );
272 hXF->Fill( pair.
momentum().Z()/100.0 );
273 hEnergy->Fill( pair.
energy() );
274 hEta->Fill( pair.
momentum().Eta() );
275 hPhi->Fill( pair.
momentum().Phi() );
276 hZvertex->Fill( pair.
vertex().Z() );
277 hZgg->Fill( pair.
zgg() );
279 if ( nmip1==0. || nmip2==0. )
continue;
280 Float_t e1chi2 = ediff1*ediff1/nmip1;
281 Float_t e2chi2 = ediff2*ediff2/nmip2;
282 Float_t echi2 = e1chi2+e2chi2;
285 hE1Chi2->Fill(e1chi2);
286 hE2Chi2->Fill(e2chi2);
287 hRatio -> Fill( esum_smd/esum_tow );
288 printf(
"esum_smd/esum_tow = %5.3f\n", esum_smd/esum_tow );
313 void StEEmcPi0Maker::setCheckTrigger(Bool_t t){ mCheckTrigger=t; }
314 void StEEmcPi0Maker::addTrigger(Int_t t){ mTriggerList.push_back(t); }
320 if ( mTriggerList.size() == 0 )
return 1;
330 nominal = mumk->
muDst()->
event()->triggerIdCollection().nominal();
338 nominal=*
event->triggerIdCollection()->nominal();
348 for ( UInt_t ii=0;ii<mTriggerList.size();ii++ )
350 if ( nominal.isTrigger( mTriggerList[ii] ) )
return mTriggerList[ii];
void cluster(const StEEmcSmdCluster &c, Int_t plane)
Add an smd cluster to this point.
void Clear(Option_t *opts="")
User defined functions.
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in 'physical events'. Therefore there is only 1 primary vert...
EEmc ADC –> energy maker.
Base class for representing EEMC points.
StEEmcGenericClusterMaker * mEEclusters
Int_t numberOfPoints() const
Number of points.
const TVector3 & momentum() const
Returns momentum of pair.
const TVector3 & vertex() const
Returns vertex of pair.
std::vector< Int_t > mNumberOfPoints
Float_t zgg() const
Returns energy-sharing of pair.
StEEmcPointMaker * mEEpoints
pointer to the point maker
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Float_t energy() const
Returns energy of pair.
Int_t key()
Return a unique key assigned by the cluster maker.
StEEmcGenericPointMaker * mEEpoints
A base class for representing clusters of EEMC smd strips.
Float_t energy() const
Get energy of this cluster.
StEEmcPointVec_t & points()
Return vector of EEmc points.
void tower(const StEEmcTower &t, Float_t w=1.)
Add a tower with specified weight to the point.
std::vector< Int_t > mNumberOfTracks
A base class for describing clusters of EEMC towers.
Float_t mass() const
Returns invariant mass of pair.
StEEmcA2EMaker * mEEanalysis
pointer to analysis maker
Float_t pt() const
Returns pt of pair.
A class to represent pairs of points.
Int_t numberOfTracks(const StEEmcCluster &cluster) const
StEEmcClusterVec_t & clusters(Int_t layer)
Returns tower clusters for the specified layer 0=T, 1=P, 2=Q, 3=R, 4+=crash.