5 #include <StThreeVector.hh>
6 #include <StPrimaryVertex.h>
8 #include "StFmsDbMaker/StFmsDbMaker.h"
9 #include "StEvent/StFmsCollection.h"
10 #include "StEvent/StFmsHit.h"
13 #include "StMessMgr.h"
15 #include "StFmsFilterMaker.h"
41 Int_t StFmsFilterMaker::Init(){
42 SetAttr(
".Privilege",1);
45 mFmsDbMaker=
static_cast<StFmsDbMaker*
>(GetMaker(
"fmsDb"));
47 mH0=
new TH1F(
"mH0",
"Event counter",5,0.5,5.5);
48 nInpEve=nRecVert=nZverOK=nAccEve=0;
49 LOG_INFO << Form(
"Init ee-filter cuts: ET>%.2f Zvert=%.2f +/-%.2f (cm)", par_E_thres, par_Z0_vert, par_delZ_vert)<<endm;
52 return StMaker::Init();
57 Int_t StFmsFilterMaker::FinishRun(
int runumber){
58 LOG_INFO << Form(
"Finish cuts: ET>%.2f Zvert=%.2f +/-%.2f (cm) fixVertexMode=%d", par_E_thres, par_Z0_vert, par_delZ_vert,myMode)<<endm;
59 LOG_INFO << Form(
"%s::Finish run=%d nInp=%d,nRecVer=%d, nZverOK=%d nAcc=%d",
GetName(),runumber,nInpEve,nRecVert,nZverOK,nAccEve) << endm;
67 LOG_INFO << Form(
"in::Make inp=%d,nVer=%d, nZverOK=%d nAcc=%d",nInpEve,nRecVert,nZverOK,nAccEve) << endm;
72 Float_t vertexPosZ =par_Z0_vert ;
92 if(!event) {LOG_ERROR <<
"StFmsJetMaker::Make did not find StEvent"<<endm;
return kStErr;}
93 mFmsColl =
event->fmsCollection();
96 Float_t triggerPatchEt;
97 Int_t triggerConditionReturn = triggerCondition();
100 if(triggerConditionReturn != 1) {
116 Int_t StFmsFilterMaker::triggerCondition()
118 int nhits=mFmsColl->numberOfHits();
120 StSPtrVecFmsHit& hits = mFmsColl->hits();
122 Float_t M_pi=TMath::Pi();
123 Float_t energyQuadrant[8] = {0,0,0,0,0,0,0,0};
125 for(
int i=0; i<nhits; i++){
126 Int_t dId = hits[i]->detectorId();
127 Float_t energy = hits[i]->energy();
128 if(dId>7&&dId<12 && energy>0.2){
129 int ch= hits[i]->channel();
134 Int_t
id = dId*1000+ch;
135 Float_t phi = v3.phi();
138 if((phi< 1.0*(M_pi/4)) && (phi > -1.0*(M_pi/4))) binPhi = 0;
139 if((phi< 0*(M_pi/4)) && (phi > -2.0*(M_pi/4))) binPhi = 1;
140 if((phi< -1.0*(M_pi/4)) && (phi > -3.0*(M_pi/4))) binPhi = 2;
141 if((phi< -2.0*(M_pi/4)) && (phi > -4.0*(M_pi/4))) binPhi = 3;
143 if((phi < -3.0*(M_pi/4)) && (phi > 3.0*(M_pi/4))) binPhi = 4;
144 if((phi < 4.0*(M_pi/4)) && (phi > 2.0*(M_pi/4))) binPhi = 5;
145 if((phi < 3.0*(M_pi/4)) && (phi > 1.*(M_pi/4))) binPhi = 6;
146 if((phi < 2.0*(M_pi/4)) && (phi > 0*(M_pi/4))) binPhi = 7;
148 if(binPhi<8) energyQuadrant[binPhi] += energy;
154 TMath::Sort(8, energyQuadrant, iOrd);
155 if( energyQuadrant[iOrd[0]] < par_E_thres )
return 0;
virtual ~StFmsFilterMaker()
This is destructor.
StThreeVectorF getStarXYZ(Int_t detectorId, Float_t FmsX, Float_t FmsY)
get the Y width of the cell
virtual const char * GetName() const
special overload
aborts events based on Endcap response cuts: reco vertex in some Z-range and EEMC 2x1 cluster event-e...