4 #include <StEmcPool/StPhotonCommon/MyEvent.h>
5 #include <StEmcPool/StPhotonCommon/MyPoint.h>
10 #include "EventMixer.h"
18 ev_array=
new TClonesArray(
"MyEvent",10);
19 ev_array->SetOwner(kTRUE);
22 cout<<
"EventMixer is constructed"<<endl;
24 h_minvMB_mixed=
new TH2F(
"h_minvMB_mixed",
"invariant mass vs pT MB (mixed events)",cuts->nPtBinsMB,cuts->ptBinsMB.GetArray(),cuts->nMinvBinsMB,cuts->mInvLowMB,cuts->mInvHighMB);
25 h_minvMB_mixed->Sumw2();
28 EventMixer::~EventMixer()
30 cout<<
"EventMixer is destructed"<<endl;
32 void EventMixer::addEvent(
MyEvent *ev)
34 if(ev->trigger()&1 && TMath::Abs(ev->vertex().Z())>0. && ev->numberOfPoints()>1){
35 TClonesArray &array=*ev_array;
36 new(array[fNmixed++])
MyEvent(*ev);
46 void EventMixer::mix()
49 for(
int i_ev=0;i_ev<10;i_ev++){
52 TClonesArray *clA=e1->getPointArray();
54 for(
int j_ev=i_ev+1;j_ev<10;j_ev++){
57 TClonesArray *clB=e2->getPointArray();
61 for(Int_t j=0;j<clA->GetEntries();j++)
65 TVector3 pPos=p->position();
66 TVector3 pMom=pPos - e1->vertex();
67 pMom.SetMag(p->energy());
69 if(!cuts->isPointOK(p,e1->vertex()))
continue;
72 for(Int_t jj=0;jj<clB->GetEntries();jj++)
76 TVector3 ppPos=pp->position();
77 TVector3 ppMom=ppPos - e2->vertex();
78 ppMom.SetMag(pp->energy());
79 if(!cuts->isPointOK(pp,e2->vertex()))
continue;
83 TVector3 pi0Mom=pMom+ppMom;
85 Float_t angle=pMom.Angle(ppMom);
86 Float_t minv=TMath::Sqrt(2.*p->energy()*pp->energy()*(1. - TMath::Cos(angle)));
87 Float_t pTpion=pi0Mom.Pt();
88 Float_t etapion=pi0Mom.PseudoRapidity();
89 Float_t asymm=TMath::Abs(p->energy()-pp->energy())/(p->energy()+pp->energy());
91 if(etapion<cuts->rapPionMinCUT||etapion>cuts->rapPionMaxCUT)
continue;
92 if(asymm>cuts->asymmetryCUT)
continue;
94 h_minvMB_mixed->Fill(pTpion,minv);