]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoSphericityEventCut.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemto / AliFemtoSphericityEventCut.cxx
CommitLineData
d5422074 1////////////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoSphericityEventCut - the basic cut for events. //
4// Only cuts on event multiplicity, z-vertex position and //
5// transverse sphericity are accepted. //
6// //
7////////////////////////////////////////////////////////////////////////////////
8
9#include "AliFemtoSphericityEventCut.h"
10//#include <cstdio>
11
12#ifdef __ROOT__
13ClassImp(AliFemtoSphericityEventCut)
14#endif
15
16AliFemtoSphericityEventCut::AliFemtoSphericityEventCut() :
17 AliFemtoEventCut(),
18 fEventMult(),
19 fVertZPos(),
20 fAcceptBadVertex(false),
21 fNEventsPassed(0),
22 fNEventsFailed(0),
23 fAcceptOnlyPhysics(0),
24 fStCutMin(0.0),
25 fStCutMax(1.0),
26 fSelectTrigger(0)
27{
28 // Default constructor
29 fEventMult[0] = 0;
30 fEventMult[1] = 100000;
31 fVertZPos[0] = -100.0;
32 fVertZPos[1] = 100.0;
33 fPsiEP[0] = -100.0;
34 fPsiEP[1] = 100.0;
35 fStCutMin = 0.0;
36 fStCutMax = 1.0;
37}
38//------------------------------
39AliFemtoSphericityEventCut::~AliFemtoSphericityEventCut(){
40 // Default destructor
41}
42//------------------------------
43bool AliFemtoSphericityEventCut::Pass(const AliFemtoEvent* event){
44
45 // Pass events if they fall within the multiplicity, z-vertex position range
46 // and transverse sphericity. Fail otherwise
47 // int mult = event->NumberOfTracks();
48 int mult = (int) event->UncorrectedNumberOfPrimaries();
49 double vertexZPos = event->PrimVertPos().z();
50
51 // Double_t qxEPVZERO = 0, qyEPVZERO = 0;
52 // Double_t qVZERO = -999;
53 double epvzero = event->ReactionPlaneAngle();
54
55 // cout << "AliFemtoSphericityEventCut:: epvzero: " << fPsiEP[0] << " < " << epvzero << " < " << fPsiEP[1] << endl;
56// cout << "AliFemtoSphericityEventCut:: mult: " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
57// cout << "AliFemtoSphericityEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
58// cout << "AliFemtoSphericityEventCut:: VertexZErr: " << event->PrimVertCov()[4] << endl;
59
60 // cout << "AliFemtoSphericityEventCut:: MagneticField: " << event->MagneticField() << endl;
61 // cout << "AliFemtoSphericityEventCut:: IsCollisionCandidate: " << event->IsCollisionCandidate() << endl;
62 // cout << "AliFemtoSphericityEventCut:: TriggerCluster: " << event->TriggerCluster() << endl;
63 // cout << "AliFemtoSphericityEventCut:: fSelectTrigger: " << fSelectTrigger << endl;
64 // cout << "AliFemtoSphericityEventCut:: " << endl;
65
66
67 Int_t ParticleNumber = 0;
68 Double_t SumPt = 0;
69 Double_t S00=0;
70 Double_t S11=0;
71 Double_t S10=0;
72 Double_t Lambda1 = 0;
73 Double_t Lambda2 = 0;
74 Double_t St = 0;
75
76 AliFemtoTrackCollection * tracks = event->TrackCollection();
77
78
79 for (AliFemtoTrackIterator iter=tracks->begin();iter!=tracks->end();iter++){
80
81
82 Double_t NewPhi = (*iter)->P().Phi();
83 Double_t NewPt = (*iter)->Pt();
84 Double_t NewEta = (*iter)->P().PseudoRapidity();
85
86
87 if(TMath::Abs(NewEta)>0.8 || NewPt<0.5){continue;}
88
89 Double_t Px;
90 Double_t Py;
91
92 Px= NewPt * TMath::Cos(NewPhi);
93 Py= NewPt * TMath::Sin(NewPhi);
94
95 S00 = S00 + Px*Px/(NewPt); // matrix elements of the transverse shpericity matrix S(i,j)
96 S11 = S11 + Py*Py/(NewPt); // i,j /in [0,1]
97 S10 = S10 + Px*Py/(NewPt);
98 SumPt = SumPt + NewPt;
99 ParticleNumber++;
100
101 } // end of track loop
102
103 if(SumPt==0){return kFALSE;}
104
105 S00 = S00/SumPt; // normalize
106 S11 = S11/SumPt;
107 S10 = S10/SumPt;
108
109 Lambda1 = (S00 + S11 + TMath::Sqrt((S00+S11)*(S00+S11)-4.0*(S00*S11-S10*S10)))/2.0;
110 Lambda2 = (S00 + S11 - TMath::Sqrt((S00+S11)*(S00+S11)-4.0*(S00*S11-S10*S10)))/2.0;
111
112 if(Lambda1+Lambda2!=0 && ParticleNumber>2)
113 {
114 St = 2*Lambda2/(Lambda1+Lambda2);
115 }
116 else{return kFALSE;};
117
118
119 //cout<<"St = "<<St<<endl;
120
121 if(St>fStCutMax || St<fStCutMin){
122 //cout<<"Event kicked out !"<<"StCutMax= "<<fStCutMax<<" StCutMin= "<<fStCutMin<<endl;
123 //cout<<"St = "<<St<<endl;
124 return kFALSE;}
125
126 bool goodEvent =
127 ((mult >= fEventMult[0]) &&
128 (mult <= fEventMult[1]) &&
129 (vertexZPos > fVertZPos[0]) &&
130 (vertexZPos < fVertZPos[1]) &&
131 (epvzero > fPsiEP[0]) &&
132 (epvzero < fPsiEP[1]) &&
133 ((!fAcceptBadVertex) || (event->ZDCParticipants() > 1.0)) &&
134 ((!fSelectTrigger) || (event->TriggerCluster() == fSelectTrigger))
135);
136
137 // cout << "AliFemtoSphericityEventCut:: goodEvent" <<goodEvent << endl;
138
139 goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
140 // cout << "AliFemtoSphericityEventCut:: return : " << goodEvent << endl;
141// (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
142
143 return (goodEvent);
144}
145//------------------------------
146AliFemtoString AliFemtoSphericityEventCut::Report(){
147 // Prepare report
148 string stemp;
149 char ctemp[100];
150 snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]);
151 stemp = ctemp;
152 snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
153 stemp += ctemp;
154 snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
155 stemp += ctemp;
156 AliFemtoString returnThis = stemp;
157 return returnThis;
158}
159void AliFemtoSphericityEventCut::SetAcceptBadVertex(bool b)
160{
161 fAcceptBadVertex = b;
162}
163bool AliFemtoSphericityEventCut::GetAcceptBadVertex()
164{
165 return fAcceptBadVertex;
166}
167