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];
70 AliFemtoTrackCollection * tracks2 = event->TrackCollection();
71 for (AliFemtoTrackIterator iter2=tracks2->begin();iter2!=tracks2->end();iter2++){
73 Double_t NewPt2 = (*iter2)->Pt();
74 Double_t NewPhi2 = (*iter2)->P().Phi();
75 Double_t NewEta2 = (*iter2)->P().PseudoRapidity();
76 if(TMath::Abs(NewEta2)>0.8 || NewPt2<0.5){continue;}
81 Px= NewPt2 * TMath::Cos(NewPhi2);
82 Py= NewPt2 * TMath::Sin(NewPhi2);
93 Double_t Spherocity = 2;
95 for(Int_t i = 0; i < 360; ++i){
96 Double_t numerador = 0;
97 Double_t phiparam = 0;
100 phiparam=((TMath::Pi()) * i) / 180; // parametrization of the angle
101 nx = TMath::Cos(phiparam); // x component of an unitary vector n
102 ny = TMath::Sin(phiparam); // y component of an unitary vector n
103 for(Int_t i1 = 0; i1 < MULT; ++i1){
104 numerador += TMath::Abs(ny * pxA[i1] - nx * pyA[i1]);//product between momentum proyection in XY plane and the unitari vector.
106 pFull=TMath::Power( (numerador / sumapt),2 );
107 if(pFull < Spherocity)//maximization of pFull
108 {Spherocity = pFull;}
112 spherocity=((Spherocity)*TMath::Pi()*TMath::Pi())/4.0;
114 if(pxA){// clean up array memory used for TMath::Sort
118 if(pyA){// clean up array memory used for TMath::Sort
123 if(spherocity>fSoCutMax || spherocity<fSoCutMin){
124 //cout<<" Event kicked out !"<<"SoCutMax= "<<fSoCutMax<<" SoCutMin= "<<fSoCutMin<<endl;
127 double epvzero = event->ReactionPlaneAngle();
129 // cout << "AliFemtoSpherocityEventCut:: epvzero: " << fPsiEP[0] << " < " << epvzero << " < " << fPsiEP[1] << endl;
130 // cout << "AliFemtoSpherocityEventCut:: mult: " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
131 // cout << "AliFemtoSpherocityEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
132 // cout << "AliFemtoSpherocityEventCut:: VertexZErr: " << event->PrimVertCov()[4] << endl;
134 // cout << "AliFemtoSpherocityEventCut:: MagneticField: " << event->MagneticField() << endl;
135 // cout << "AliFemtoSpherocityEventCut:: IsCollisionCandidate: " << event->IsCollisionCandidate() << endl;
136 // cout << "AliFemtoSpherocityEventCut:: TriggerCluster: " << event->TriggerCluster() << endl;
137 // cout << "AliFemtoSpherocityEventCut:: fSelectTrigger: " << fSelectTrigger << endl;
138 // cout << "AliFemtoSpherocityEventCut:: " << endl;
140 ((mult >= fEventMult[0]) &&
141 (mult <= fEventMult[1]) &&
142 (vertexZPos > fVertZPos[0]) &&
143 (vertexZPos < fVertZPos[1]) &&
144 (epvzero > fPsiEP[0]) &&
145 (epvzero < fPsiEP[1]) &&
146 ((!fAcceptBadVertex) || (event->ZDCParticipants() > 1.0)) &&
147 ((!fSelectTrigger) || (event->TriggerCluster() == fSelectTrigger))
150 // cout << "AliFemtoSpherocityEventCut:: goodEvent" <<goodEvent << endl;
152 goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
153 // cout << "AliFemtoSpherocityEventCut:: return : " << goodEvent << endl;
154 // (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
158 //------------------------------
159 AliFemtoString AliFemtoSpherocityEventCut::Report(){
163 snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]);
165 snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
167 snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
169 AliFemtoString returnThis = stemp;
172 void AliFemtoSpherocityEventCut::SetAcceptBadVertex(bool b)
174 fAcceptBadVertex = b;
176 bool AliFemtoSpherocityEventCut::GetAcceptBadVertex()
178 return fAcceptBadVertex;