1 #include "FcsDYBGFilter.h"
3 #include "StarGenerator/EVENT/StarGenParticle.h"
4 #include "StarGenerator/EVENT/StarGenEvent.h"
12 static const float ZFCS = 710.16 + 13.9 + 15.0;
13 static const float XFCSMin = 16.69;
14 static const float XFCSMax = 16.69 + 22.0 * 5.542;
15 static const float YFCS = 34.0/2.0 * 5.542;
16 static const float FVCUT = 0;
17 static const float ETCUT = 0.8;
18 static const float DRCUT = 40.0;
19 static const float DYETCUT = 1.0;
20 static const float DYMASSCUT= 2.5;
29 cout<<
"FCS DYBG filter is used!!!"<<endl;
30 cout<<
"FCS DYBG filter swap particles="<<mSwap<<endl;
33 FcsDYBGFilter::FcsDYBGFilter(
int dy,
int check,
int swap):
StarFilterMaker(
"fcsDYBGFilter"), mDYmode(dy), mCheckmode(check), mSwap(swap){
34 cout<<
"FCS DYBG filter is used!!!"<<endl;
35 cout<<
"FCS DYBG filter DYMode="<<mDYmode<<endl;
36 cout<<
"FCS DYBG filter Checkmode="<<mCheckmode<<endl;
37 cout<<
"FCS DYBG filter swap particles="<<mSwap<<endl;
46 int np=
event.GetNumberOfParticles();
47 if(np <= 0) {
return kError;}
50 TIter Iterator =
event.IterAll();
52 vector<StarGenParticle*> forwardParticles;
54 int pid = abs(p->
GetId());
57 if(p->
GetPz()<0.0)
continue;
58 if(p->
pt()<ETCUT)
continue;
61 if(x<XFCSMin+FVCUT || x>XFCSMax-FVCUT)
continue;
63 if(y>YFCS-FVCUT)
continue;
64 forwardParticles.push_back(p);
66 unsigned int size=forwardParticles.size();
67 if(size<2)
return StarGenEvent::kReject;
70 std::vector<int> swap;
71 for(
unsigned int i=0; i<size-1; i++){
76 int pid1 = abs(p1->
GetId());
77 for(
unsigned int j=i + 1; j<size; j++){
82 int pid2 = abs(p2->
GetId());
87 float dr=sqrt(dx*dx+dy*dy);
89 if(pid1==11 && pid2==11 && pt1>DYETCUT && pt2>DYETCUT && m>DYMASSCUT) res|=0x08;
95 cout << Form(
"FcsDYBGFilter : idx=%3d %3d Pid=%5d %5d E=%6.2f %6.2f M=%6.2f DR=%6.2f res=0x%03x, x1=%.3f, x2=%.3f, xx_ep=%.3f",
98 if(pid1!=111 && pid1!=22 && abs(pid1)!=11) swap.push_back(idx1);
99 if(pid2!=111 && pid2!=22 && abs(pid2)!=11) swap.push_back(idx2);
104 if(mDYmode && !(res & 0x08))
return StarGenEvent::kReject;
110 cout << Form(
"FcsDYBGFilter : found %d accepted pairs, swapped %d particles when implemented",accept,swap.size())<<endl;
112 cout << Form(
"FcsDYBGFilter : found %d accepted pairs, No swap but could swap %d particles",accept,swap.size())<<endl;
114 cout << Form(
"FcsDYBGFilter : N_Genearted=%6d N_Accepted=%6d R=%6.4f",
115 ntot,ngood,
float(ngood)/
float(ntot)) <<endl;
116 return (StarGenEvent::kAccept | res);
118 if(mCheckmode)
return (StarGenEvent::kReject | res | StarGenEvent::kFlag);
119 return StarGenEvent::kReject;
Int_t GetIndex()
Get the line number in the event record.
Float_t GetVz()
Get the z-component of the start vertex.
Float_t pt()
Returns the transverse momentum of the particle.
Yet another particle class.
Int_t GetStatus()
Get the status code of the particle according to the HEPEVT standard.
Float_t GetPz()
Get the z-component of the momentum.
Float_t GetEnergy()
Get the energy.
Int_t GetId()
Get the id code of the particle according to the PDG standard.
Main filter class. Goes anywhere in the chain, filters StarGenEvent objects.
Float_t GetPx()
Get the x-component of the momentum.
TLorentzVector momentum()
Return the 4-momentum of the particle.
Float_t GetVy()
Get the y-component of the start vertex.
Float_t GetPy()
Get the y-component of the momentum.
Base class for event records.
Int_t Filter(StarGenEvent *mEvent)
destructor
Float_t GetVx()
Get the x-component of the start vertex.