]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx
Reaction Plane analysis updates
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemto / AliFemtoBasicEventCut.cxx
1 ////////////////////////////////////////////////////////////////////////////////
2 //                                                                            //
3 // AliFemtoBasicEventCut - the basic cut for events.                          //
4 // Only cuts on event multiplicity and z-vertex position                      //
5 //                                                                            //
6 ////////////////////////////////////////////////////////////////////////////////
7
8 #include "AliFemtoBasicEventCut.h"
9 //#include <cstdio>
10
11 #ifdef __ROOT__
12 ClassImp(AliFemtoBasicEventCut)
13 #endif
14
15 AliFemtoBasicEventCut::AliFemtoBasicEventCut() :
16   AliFemtoEventCut(),
17   fEventMult(),
18   fVertZPos(),
19   fAcceptBadVertex(false), 
20   fNEventsPassed(0), 
21   fNEventsFailed(0),
22   fAcceptOnlyPhysics(true),
23   fSelectTrigger(0)
24 {
25   // Default constructor
26   fEventMult[0] = 0;
27   fEventMult[1] = 100000;
28   fVertZPos[0] = -100.0;
29   fVertZPos[1] = 100.0;
30   fPsiEP[0] = -100.0;
31   fPsiEP[1] = 100.0;
32
33 //------------------------------
34 AliFemtoBasicEventCut::~AliFemtoBasicEventCut(){
35   // Default destructor
36 }
37 //------------------------------
38 bool AliFemtoBasicEventCut::Pass(const AliFemtoEvent* event){  
39
40   // Pass events if they fall within the multiplicity and z-vertex
41   // position range. Fail otherwise
42   //  int mult =  event->NumberOfTracks();
43   int mult = (int) event->UncorrectedNumberOfPrimaries();
44   double vertexZPos = event->PrimVertPos().z();
45
46
47   // Double_t qxEPVZERO = 0, qyEPVZERO = 0;
48   // Double_t qVZERO = -999;
49   double epvzero = event->ReactionPlaneAngle();
50
51   // cout << "AliFemtoBasicEventCut:: epvzero:       " << fPsiEP[0] << " < " << epvzero << " < " << fPsiEP[1] << endl;
52 //   cout << "AliFemtoBasicEventCut:: mult:       " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
53 //   cout << "AliFemtoBasicEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
54 //   cout << "AliFemtoBasicEventCut:: VertexZErr: " << event->PrimVertCov()[4] << endl;
55   // cout << "AliFemtoBasicEventCut:: MagneticField: " << event->MagneticField() << endl;
56   // cout << "AliFemtoBasicEventCut:: IsCollisionCandidate: " << event->IsCollisionCandidate() << endl;
57   // cout << "AliFemtoBasicEventCut:: TriggerCluster: " << event->TriggerCluster() << endl;
58   // cout << "AliFemtoBasicEventCut:: fSelectTrigger: " << fSelectTrigger << endl;
59   // cout << "AliFemtoBasicEventCut:: " << endl;
60   bool goodEvent =
61     ((mult >= fEventMult[0]) && 
62      (mult <= fEventMult[1]) && 
63      (vertexZPos > fVertZPos[0]) &&
64      (vertexZPos < fVertZPos[1]) &&
65      (epvzero > fPsiEP[0]) &&
66      (epvzero < fPsiEP[1]) &&
67      ((!fAcceptBadVertex) || (event->ZDCParticipants() > 1.0)) &&
68      ((!fAcceptOnlyPhysics) || (event->IsCollisionCandidate())) &&
69       ((!fSelectTrigger) || (event->TriggerCluster() == fSelectTrigger))
70 );
71
72   // cout << "AliFemtoBasicEventCut:: goodEvent" <<goodEvent << endl;
73
74   goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
75 //   cout << "AliFemtoBasicEventCut:: return : " << goodEvent << endl;
76 //     (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
77   return (goodEvent);
78 }
79 //------------------------------
80 AliFemtoString AliFemtoBasicEventCut::Report(){
81   // Prepare report
82   string stemp;
83   char ctemp[100];
84   snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]);
85   stemp = ctemp;
86   snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
87   stemp += ctemp;
88   snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld  Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
89   stemp += ctemp;
90   AliFemtoString returnThis = stemp;
91   return returnThis;
92 }
93 void AliFemtoBasicEventCut::SetAcceptBadVertex(bool b)
94 {
95   fAcceptBadVertex = b;
96 }
97 bool AliFemtoBasicEventCut::GetAcceptBadVertex()
98 {
99   return fAcceptBadVertex;
100 }
101 void AliFemtoBasicEventCut::SetAcceptOnlyPhysics(bool b)
102 {
103   fAcceptOnlyPhysics = b;
104 }
105 bool AliFemtoBasicEventCut::GetAcceptOnlyPhysics()
106 {
107   return fAcceptOnlyPhysics;
108 }