1 ////////////////////////////////////////////////////////////////////////////////
3 // AliFemtoSpherocityEventCut - the basic cut for events. //
4 // Only cuts on event multiplicity, z-vertex position and //
5 // transverse spherocity are accepted. //
7 ////////////////////////////////////////////////////////////////////////////////
9 #include "AliFemtoSpherocityEventCut.h"
13 ClassImp(AliFemtoSpherocityEventCut)
16 AliFemtoSpherocityEventCut::AliFemtoSpherocityEventCut() :
20 fAcceptBadVertex(false),
23 fAcceptOnlyPhysics(0),
28 // Default constructor
30 fEventMult[1] = 100000;
31 fVertZPos[0] = -100.0;
36 //------------------------------
37 AliFemtoSpherocityEventCut::~AliFemtoSpherocityEventCut(){
40 //------------------------------
41 bool AliFemtoSpherocityEventCut::Pass(const AliFemtoEvent* event){
43 // Pass events if they fall within the multiplicity and z-vertex
44 // position range. Fail otherwise
45 // int mult = event->NumberOfTracks();
46 int mult = (int) event->UncorrectedNumberOfPrimaries();
47 double vertexZPos = event->PrimVertPos().z();
48 double spherocity=-10;
52 AliFemtoTrackCollection * tracks = event->TrackCollection();
53 for (AliFemtoTrackIterator iter=tracks->begin();iter!=tracks->end();iter++){
55 Double_t NewPt = (*iter)->Pt();
56 Double_t NewEta = (*iter)->P().PseudoRapidity();
57 if(TMath::Abs(NewEta)>0.8 || NewPt<0.5){continue;}
62 //if(SumPt==0){return kFALSE;}
63 if(MULT<3){return kFALSE;}
65 Double_t *pxA=new Double_t[MULT]();
66 Double_t *pyA=new Double_t[MULT]();
71 AliFemtoTrackCollection * tracks2 = event->TrackCollection();
72 for (AliFemtoTrackIterator iter2=tracks2->begin();iter2!=tracks2->end();iter2++){
74 Double_t NewPt2 = (*iter2)->Pt();
75 Double_t NewPhi2 = (*iter2)->P().Phi();
76 Double_t NewEta2 = (*iter2)->P().PseudoRapidity();
77 if(TMath::Abs(NewEta2)>0.8 || NewPt2<0.5){continue;}
82 Px= NewPt2 * TMath::Cos(NewPhi2);
83 Py= NewPt2 * TMath::Sin(NewPhi2);
94 Double_t Spherocity = 2;
96 for(Int_t i = 0; i < 360; ++i){
97 Double_t numerador = 0;
98 Double_t phiparam = 0;
101 phiparam=((TMath::Pi()) * i) / 180; // parametrization of the angle
102 nx = TMath::Cos(phiparam); // x component of an unitary vector n
103 ny = TMath::Sin(phiparam); // y component of an unitary vector n
104 for(Int_t i1 = 0; i1 < MULT; ++i1){
105 numerador += TMath::Abs(ny * pxA[i1] - nx * pyA[i1]);//product between momentum proyection in XY plane and the unitari vector.
107 pFull=TMath::Power( (numerador / sumapt),2 );
108 if(pFull < Spherocity)//maximization of pFull
109 {Spherocity = pFull;}
113 spherocity=((Spherocity)*TMath::Pi()*TMath::Pi())/4.0;
115 if(pxA){// clean up array memory used for TMath::Sort
119 if(pyA){// clean up array memory used for TMath::Sort
124 if(spherocity>fSoCutMax || spherocity<fSoCutMin){
125 //cout<<" Event kicked out !"<<"SoCutMax= "<<fSoCutMax<<" SoCutMin= "<<fSoCutMin<<endl;
128 double epvzero = event->ReactionPlaneAngle();
130 // cout << "AliFemtoSpherocityEventCut:: epvzero: " << fPsiEP[0] << " < " << epvzero << " < " << fPsiEP[1] << endl;
131 // cout << "AliFemtoSpherocityEventCut:: mult: " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
132 // cout << "AliFemtoSpherocityEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
133 // cout << "AliFemtoSpherocityEventCut:: VertexZErr: " << event->PrimVertCov()[4] << endl;
135 // cout << "AliFemtoSpherocityEventCut:: MagneticField: " << event->MagneticField() << endl;
136 // cout << "AliFemtoSpherocityEventCut:: IsCollisionCandidate: " << event->IsCollisionCandidate() << endl;
137 // cout << "AliFemtoSpherocityEventCut:: TriggerCluster: " << event->TriggerCluster() << endl;
138 // cout << "AliFemtoSpherocityEventCut:: fSelectTrigger: " << fSelectTrigger << endl;
139 // cout << "AliFemtoSpherocityEventCut:: " << endl;
141 ((mult >= fEventMult[0]) &&
142 (mult <= fEventMult[1]) &&
143 (vertexZPos > fVertZPos[0]) &&
144 (vertexZPos < fVertZPos[1]) &&
145 (epvzero > fPsiEP[0]) &&
146 (epvzero < fPsiEP[1]) &&
147 ((!fAcceptBadVertex) || (event->ZDCParticipants() > 1.0)) &&
148 ((!fSelectTrigger) || (event->TriggerCluster() == fSelectTrigger))
151 // cout << "AliFemtoSpherocityEventCut:: goodEvent" <<goodEvent << endl;
153 goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
154 // cout << "AliFemtoSpherocityEventCut:: return : " << goodEvent << endl;
155 // (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
159 //------------------------------
160 AliFemtoString AliFemtoSpherocityEventCut::Report(){
164 snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]);
166 snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
168 snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
170 AliFemtoString returnThis = stemp;
173 void AliFemtoSpherocityEventCut::SetAcceptBadVertex(bool b)
175 fAcceptBadVertex = b;
177 bool AliFemtoSpherocityEventCut::GetAcceptBadVertex()
179 return fAcceptBadVertex;