]>
Commit | Line | Data |
---|---|---|
d0e92d9a | 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" | |
ea77036b | 9 | //#include <cstdio> |
d0e92d9a | 10 | |
11 | #ifdef __ROOT__ | |
12 | ClassImp(AliFemtoBasicEventCut) | |
13 | #endif | |
14 | ||
15 | AliFemtoBasicEventCut::AliFemtoBasicEventCut() : | |
63a5982a | 16 | AliFemtoEventCut(), |
17 | fEventMult(), | |
18 | fVertZPos(), | |
19 | fAcceptBadVertex(false), | |
20 | fNEventsPassed(0), | |
116778b6 | 21 | fNEventsFailed(0), |
73c932f8 | 22 | fAcceptOnlyPhysics(true), |
23 | fSelectTrigger(0) | |
d0e92d9a | 24 | { |
ea77036b | 25 | // Default constructor |
63a5982a | 26 | fEventMult[0] = 0; |
27 | fEventMult[1] = 100000; | |
28 | fVertZPos[0] = -100.0; | |
29 | fVertZPos[1] = 100.0; | |
d0e92d9a | 30 | } |
31 | //------------------------------ | |
ea77036b | 32 | AliFemtoBasicEventCut::~AliFemtoBasicEventCut(){ |
33 | // Default destructor | |
34 | } | |
d0e92d9a | 35 | //------------------------------ |
36 | bool AliFemtoBasicEventCut::Pass(const AliFemtoEvent* event){ | |
ea77036b | 37 | // Pass events if they fall within the multiplicity and z-vertex |
38 | // position range. Fail otherwise | |
03decc29 | 39 | // int mult = event->NumberOfTracks(); |
1cfb1e25 | 40 | int mult = (int) event->UncorrectedNumberOfPrimaries(); |
ea77036b | 41 | double vertexZPos = event->PrimVertPos().z(); |
1dead9de | 42 | // cout << "AliFemtoBasicEventCut:: mult: " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl; |
43 | // cout << "AliFemtoBasicEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl; | |
44 | // cout << "AliFemtoBasicEventCut:: VertexZErr: " << event->PrimVertCov()[4] << endl; | |
d0e92d9a | 45 | bool goodEvent = |
d58bc7b2 | 46 | ((mult >= fEventMult[0]) && |
47 | (mult <= fEventMult[1]) && | |
ea77036b | 48 | (vertexZPos > fVertZPos[0]) && |
63a5982a | 49 | (vertexZPos < fVertZPos[1]) && |
782723e1 | 50 | ((!fAcceptBadVertex) || (event->ZDCParticipants() > 1.0)) && |
73c932f8 | 51 | ((!fAcceptOnlyPhysics) || (event->IsCollisionCandidate())) && |
52 | ((!fSelectTrigger) || (event->TriggerCluster() == fSelectTrigger))); | |
d0e92d9a | 53 | goodEvent ? fNEventsPassed++ : fNEventsFailed++ ; |
1dead9de | 54 | // cout << "AliFemtoBasicEventCut:: return : " << goodEvent << endl; |
782723e1 | 55 | // (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) && |
d0e92d9a | 56 | return (goodEvent); |
57 | } | |
58 | //------------------------------ | |
59 | AliFemtoString AliFemtoBasicEventCut::Report(){ | |
ea77036b | 60 | // Prepare report |
61 | string stemp; | |
62 | char ctemp[100]; | |
3be563bf | 63 | snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]); |
ea77036b | 64 | stemp = ctemp; |
3be563bf | 65 | snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]); |
ea77036b | 66 | stemp += ctemp; |
3be563bf | 67 | snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld Number which failed:\t%ld",fNEventsPassed,fNEventsFailed); |
ea77036b | 68 | stemp += ctemp; |
69 | AliFemtoString returnThis = stemp; | |
d0e92d9a | 70 | return returnThis; |
71 | } | |
63a5982a | 72 | void AliFemtoBasicEventCut::SetAcceptBadVertex(bool b) |
73 | { | |
74 | fAcceptBadVertex = b; | |
75 | } | |
76 | bool AliFemtoBasicEventCut::GetAcceptBadVertex() | |
77 | { | |
78 | return fAcceptBadVertex; | |
79 | } | |
73695088 | 80 | void AliFemtoBasicEventCut::SetAcceptOnlyPhysics(bool b) |
81 | { | |
82 | fAcceptOnlyPhysics = b; | |
83 | } | |
84 | bool AliFemtoBasicEventCut::GetAcceptOnlyPhysics() | |
85 | { | |
86 | return fAcceptOnlyPhysics; | |
87 | } |