1 ////////////////////////////////////////////////////////////////////////////////
3 // AliFemtoQAEventCut - the basic cut to check QA for event cuts. //
4 // Only cuts on event multiplicity and z-vertex position //
6 ////////////////////////////////////////////////////////////////////////////////
8 #include "AliFemtoQAEventCut.h"
12 ClassImp(AliFemtoQAEventCut)
15 AliFemtoQAEventCut::AliFemtoQAEventCut() :
19 fAcceptBadVertex(false),
23 fEventMultQASwitch(kFALSE),
24 fEventZPosQASwitch(kFALSE)
26 // Default constructor
28 fEventMult[1] = 100000;
29 fVertZPos[0] = -100.0;
33 fEventMultQASwitch = false;
34 fEventZPosQASwitch = false;
35 fEventMultQAExclusionZone[0] = 0;
36 fEventMultQAExclusionZone[1] = 100000;
37 fEventZPosQAExclusionZone[0] = -100.0;
38 fEventZPosQAExclusionZone[1] = 100.0;
41 //------------------------------
42 AliFemtoQAEventCut::~AliFemtoQAEventCut(){
45 //------------------------------
46 bool AliFemtoQAEventCut::Pass(const AliFemtoEvent* event){
47 // Pass events if they fall within the multiplicity and z-vertex
48 // position range. If QA cutting on quantity, pass if outside
49 // exclusion zone between low and high cut values. Fail otherwise.
50 int mult = event->NumberOfTracks();
51 double vertexZPos = event->PrimVertPos().z();
52 cout << "AliFemtoQAEventCut:: mult: " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
53 cout << "AliFemtoQAEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
57 if (fEventMultQASwitch) {
59 ( (((mult < fEventMultQAExclusionZone[0]) && (fHighOrLowSwitch > 0)) ||
60 ((mult > fEventMultQAExclusionZone[1]) && (fHighOrLowSwitch < 0))) &&
61 (mult > fEventMult[0]) &&
62 (mult < fEventMult[1]) &&
63 (vertexZPos > fVertZPos[0]) &&
64 (vertexZPos < fVertZPos[1]) &&
65 (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)));
67 else if (fEventZPosQASwitch) {
69 ((((vertexZPos < fEventZPosQAExclusionZone[0]) && (fHighOrLowSwitch > 0)) ||
70 ((vertexZPos > fEventZPosQAExclusionZone[1]) && (fHighOrLowSwitch < 0))) &&
71 (mult > fEventMult[0]) &&
72 (mult < fEventMult[1]) &&
73 (vertexZPos > fVertZPos[0]) &&
74 (vertexZPos < fVertZPos[1]) &&
75 (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)));
79 ((mult > fEventMult[0]) &&
80 (mult < fEventMult[1]) &&
81 (vertexZPos > fVertZPos[0]) &&
82 (vertexZPos < fVertZPos[1]) &&
83 (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)));
86 if (goodEvent) fHighOrLowSwitch *= -1;
87 goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
88 //cout << "AliFemtoQAEventCut:: return : " << goodEvent << endl;
91 //------------------------------
92 AliFemtoString AliFemtoQAEventCut::Report(){
96 snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]);
98 snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
100 snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
102 AliFemtoString returnThis = stemp;
105 void AliFemtoQAEventCut::SetAcceptBadVertex(bool b)
107 fAcceptBadVertex = b;
109 bool AliFemtoQAEventCut::GetAcceptBadVertex()
111 return fAcceptBadVertex;