]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx
Merge branch 'feature-movesplit'
[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   fSelectTrigger(0)
23 {
24   // Default constructor
25   fEventMult[0] = 0;
26   fEventMult[1] = 100000;
27   fVertZPos[0] = -100.0;
28   fVertZPos[1] = 100.0;
29   fPsiEP[0] = -1000.0;
30   fPsiEP[1] = 1000.0;
31
32 //------------------------------
33 AliFemtoBasicEventCut::~AliFemtoBasicEventCut(){
34   // Default destructor
35 }
36 //------------------------------
37 bool AliFemtoBasicEventCut::Pass(const AliFemtoEvent* event){  
38
39   // Pass events if they fall within the multiplicity and z-vertex
40   // position range. Fail otherwise
41   //  int mult =  event->NumberOfTracks();
42   int mult = (int) event->UncorrectedNumberOfPrimaries();
43   double vertexZPos = event->PrimVertPos().z();
44
45   // Double_t qxEPVZERO = 0, qyEPVZERO = 0;
46   // Double_t qVZERO = -999;
47   double epvzero = event->ReactionPlaneAngle();
48
49   // cout << "AliFemtoBasicEventCut:: epvzero:       " << fPsiEP[0] << " < " << epvzero << " < " << fPsiEP[1] << endl;
50 //   cout << "AliFemtoBasicEventCut:: mult:       " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
51 //   cout << "AliFemtoBasicEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
52 //   cout << "AliFemtoBasicEventCut:: VertexZErr: " << event->PrimVertCov()[4] << endl;
53
54   // cout << "AliFemtoBasicEventCut:: MagneticField: " << event->MagneticField() << endl;
55   // cout << "AliFemtoBasicEventCut:: IsCollisionCandidate: " << event->IsCollisionCandidate() << endl;
56   // cout << "AliFemtoBasicEventCut:: TriggerCluster: " << event->TriggerCluster() << endl;
57   // cout << "AliFemtoBasicEventCut:: fSelectTrigger: " << fSelectTrigger << endl;
58   // cout << "AliFemtoBasicEventCut:: " << endl;
59   bool goodEvent =
60     ((mult >= fEventMult[0]) && 
61      (mult <= fEventMult[1]) && 
62      (vertexZPos > fVertZPos[0]) &&
63      (vertexZPos < fVertZPos[1]) &&
64      (epvzero > fPsiEP[0]) &&
65      (epvzero < fPsiEP[1]) &&
66      ((!fAcceptBadVertex) || (event->ZDCParticipants() > 1.0)) &&
67       ((!fSelectTrigger) || (event->TriggerCluster() == fSelectTrigger))
68 );
69
70   // cout << "AliFemtoBasicEventCut:: goodEvent" <<goodEvent << endl;
71
72   goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
73   // cout << "AliFemtoBasicEventCut:: return : " << goodEvent << endl;
74 //     (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
75
76   return (goodEvent);
77 }
78 //------------------------------
79 AliFemtoString AliFemtoBasicEventCut::Report(){
80   // Prepare report
81   string stemp;
82   char ctemp[100];
83   snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]);
84   stemp = ctemp;
85   snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
86   stemp += ctemp;
87   snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld  Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
88   stemp += ctemp;
89   AliFemtoString returnThis = stemp;
90   return returnThis;
91 }
92 void AliFemtoBasicEventCut::SetAcceptBadVertex(bool b)
93 {
94   fAcceptBadVertex = b;
95 }
96 bool AliFemtoBasicEventCut::GetAcceptBadVertex()
97 {
98   return fAcceptBadVertex;
99 }
100