11 #include "StFmsFastSimMaker.h"
13 #include "StMessMgr.h"
16 #include "StThreeVectorF.hh"
19 #include "StEvent/StEvent.h"
20 #include "StEvent/StFmsCollection.h"
21 #include "StEvent/StFmsPoint.h"
23 #include "StarGenerator/BASE/StarPrimaryMaker.h"
24 #include "StarGenerator/EVENT/StarGenEvent.h"
25 #include "StarGenerator/EVENT/StarGenParticle.h"
29 float projectFMS(
float x,
float z,
float zp,
float vz){
34 static const float ZFMS=720.0;
35 static const float XMINFMS=20.0;
36 static const float XMAXFMS=100.0;
39 if(p->
GetPz()<1.0)
return 0;
43 if(x<XMINFMS && y<XMINFMS)
return 0;
44 if(x>XMAXFMS || y>XMAXFMS)
return 0;
50 StFmsFastSimMaker::StFmsFastSimMaker(
const Char_t* name):
StMaker(name),mPrint(0) {}
52 StFmsFastSimMaker::~StFmsFastSimMaker(){}
54 Int_t StFmsFastSimMaker::Init(){
59 int n=mRealPi0.size();
60 for(
int i=0; i<n; i++)
delete mRealPi0[i];
64 Float_t StFmsFastSimMaker::hadronResponse(
float e,
float &f){
66 if(e<0.3) {f=1.0;
return e;}
71 while(f<=0.3/e || f>0.95) f = RND.Gaus()*0.3 + 0.35;
78 if(!primary) {LOG_INFO <<
"StFmsFastSimMaker cannot find PrimaryMaker"<<endm;
return kStErr;}
80 if(!pevent) {LOG_INFO <<
"StFmsFastSimMaker cannot find PrimaryMaker->event"<<endm;
return kStErr;}
88 stEvent->setFmsCollection(fmsColl);
89 StSPtrVecFmsPoint& points = fmsColl->points();
92 float etot=0.0, emeas=0.0;
93 for(
int j=0; j<n; j++){
100 if(fmsAcceptance(p)==0) {
107 if(abs(pid)==22 || abs(pid)==11){
110 point->setEnergy(ene);
112 points.push_back(point);
116 }
else if(abs(pid)==211 || abs(pid)==321 || abs(pid)==2212 || abs(pid)==2112){
119 hadres = hadronResponse(ene,f);
121 point->setEnergy(hadres);
123 points.push_back(point);
135 if(flag==1 || flag==6)
continue;
136 if(flag>0 && mPrint>1) {
137 cout << Form(
"%3d Pid=%5d Stat=%3d m=%8.3f p=%7.3f %7.3f %7.3f eta=%6.2f e=%7.2f meas=%7.2f zvtx=%7.2f",
142 case 1: cout <<
" Not heading to FMS" << endl;
break;
143 case 2: cout <<
" pi0" << endl;
break;
144 case 3: cout <<
" photon/electron" << endl;
break;
145 case 4: cout << Form(
" pi/K/P/N f=%4.2f",f) << endl;
break;
146 case 5: cout <<
" Something else pid=" << pid << endl;
break;
147 case 6: cout <<
" Unstable" << endl;
break;
148 default: cout << endl;
155 return b->perp() < a->perp();
160 int np=fmsColl->numberOfPoints();
161 LOG_INFO << Form(
"Etot=%f Emeasured=%f Created %d StFmsPoints, and NRealPi0=%d",etot,emeas,np,mRealPi0.size()) << endm;
Float_t GetVz()
Get the z-component of the start vertex.
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
Int_t GetNumberOfParticles()
Obtain the number of particles in the event record.
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.
void Clear(Option_t *option="")
User defined functions.
Int_t GetId()
Get the id code of the particle according to the PDG standard.
Float_t GetPx()
Get the x-component of the momentum.
TLorentzVector momentum()
Return the 4-momentum of the particle.
Float_t GetPy()
Get the y-component of the momentum.
Base class for event records.
StarGenEvent * event()
Return a pointer to the event.
Main steering class for event generation.
Float_t GetMass()
Get the mass.