5 #include <StThreeVector.hh>
6 #include <StPrimaryVertex.h>
7 #include "StEEmcPool/StEEmcA2EMaker/StEEmcA2EMaker.h"
10 #include "StMessMgr.h"
12 #include "StEEmcFilterMaker.h"
38 Int_t StEEmcFilterMaker::Init(){
39 SetAttr(
".Privilege",1);
43 mH0=
new TH1F(
"mH0",
"Event counter",5,0.5,5.5);
44 nInpEve=nRecVert=nZverOK=nAccEve=0;
45 LOG_INFO << Form(
"Init ee-filter cuts: ET>%.2f Zvert=%.2f +/-%.2f (cm)", par_Et_thres, par_Z0_vert, par_delZ_vert)<<endm;
46 if(myMode==kUseFixedVertex) LOG_INFO << Form(
" FIXED vertex mode is activated")<<endl;
47 assert (myMode!=kUnknown);
48 return StMaker::Init();
53 Int_t StEEmcFilterMaker::FinishRun(
int runumber){
54 LOG_INFO << Form(
"Finish cuts: ET>%.2f Zvert=%.2f +/-%.2f (cm) fixVertexMode=%d", par_Et_thres, par_Z0_vert, par_delZ_vert,myMode)<<endm;
55 LOG_INFO << Form(
"%s::Finish run=%d nInp=%d,nRecVer=%d, nZverOK=%d nAcc=%d",
GetName(),runumber,nInpEve,nRecVert,nZverOK,nAccEve) << endm;
63 LOG_INFO << Form(
"in::Make inp=%d,nVer=%d, nZverOK=%d nAcc=%d",nInpEve,nRecVert,nZverOK,nAccEve) << endm;
68 Float_t vertexPosZ =par_Z0_vert ;
69 if(myMode==kUseRecoVertex) {
70 int nV=mEvent->numberOfPrimaryVertices();
79 if(fabs(vertexPosZ - par_Z0_vert)> par_delZ_vert)
return kStSKIP;
80 LOG_INFO << Form(
"eveID=%d nPrimVert=%d zVert=%.2f\n", mEvent->id(),nV, vertexPosZ);
89 Float_t highTEt = highTow.
et();
90 LOG_INFO << Form(
"eveID=%d highTEt=%.2f\n", mEvent->id(),highTEt);
92 Float_t triggerPatchEt;
93 Int_t triggerConditionReturn = triggerCondition(vertexPosZ,&highTow,triggerPatchEt);
96 if(triggerConditionReturn != 1) {
97 printf(
"janKill-%d Me### eve=%d zVer=%.2f highT_et=%.3f TP_ET=%.3f\n",myMode,nInpEve,vertexPosZ, highTEt,triggerPatchEt);
104 printf(
"janKeep-%d Me### eve=%d zVer=%.2f highT_et=%.3f TP_ET=%.3f\n",myMode,nInpEve,vertexPosZ, highTEt,triggerPatchEt);
111 Int_t StEEmcFilterMaker::triggerCondition( Float_t vertexPosZ,
StEEmcTower *highTow, Float_t &patchEt)
115 Float_t eemcPatchEt = transverseNRG(vertexPosZ,highTow);
117 for(
int Nn=0; Nn < Nneigh; Nn++)
120 Float_t neighEemcPatchEt = transverseNRG(vertexPosZ,&neighHighTow);
121 eemcPatchEt += neighEemcPatchEt;
124 patchEt = eemcPatchEt;
126 if(eemcPatchEt < par_Et_thres)
return 0;
133 Float_t StEEmcFilterMaker::transverseNRG(Float_t vertexPosZ,
StEEmcTower *tower)
140 Float_t xNew = towVector.x() - (288.2 - 279.54)*(towVector.x()/288.2);
141 Float_t yNew = towVector.y() - (288.2 - 279.54)*(towVector.y()/288.2);
143 TVector3 *eventTowVector =
new TVector3(0,0,0);
144 eventTowVector->SetXYZ(xNew,yNew,(279.54 - vertexPosZ));
148 Float_t newTheta = eventTowVector->Theta();
150 Float_t factor = sin(newTheta);
151 if(factor > 1.0 || factor < 0.0)
156 Float_t energy = tower->
energy();
158 Float_t transverseEnergy = energy*factor;
160 return transverseEnergy;
TVector3 getTowerCenter(const UInt_t sec, const UInt_t sub, const UInt_t etabin) const
Int_t numberOfNeighbors() const
get the number of neighboring towers
EEmc ADC –> energy maker.
void neighbor(StEEmcTower *n)
add a tower to list of neighbors
Int_t etabin() const
Returns the etabin of this tower, pre- or postshower element.
Int_t subsector() const
Returns subsector of this tower, pre- or postshower element.
Base class for representing tower, preshower and postshower elements.
virtual ~StEEmcFilterMaker()
This is destructor.
StEEmcTower & hightower(Int_t layer=0)
aborts events based on Endcap response cuts: reco vertex in some Z-range and EEMC 2x1 cluster event-e...
Int_t sector() const
Returns sector of this tower, pre- or postshower element.
virtual const char * GetName() const
special overload
void energy(Float_t e)
Set the energy (adc-ped+0.5)/gain for this element.