]>
Commit | Line | Data |
---|---|---|
76ce4b5b | 1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoShareQualityTPCEntranceSepQAPairCut - a pair cut which checks // | |
4 | // for some pair qualities that attempt to identify slit/doubly // | |
5 | // reconstructed tracks and also selects pairs based on their separation // | |
6 | // at the entrance to the TPC // | |
7 | // // | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | /*************************************************************************** | |
10 | * | |
11 | * $Id: AliFemtoShareQualityTPCEntranceSepQAPairCut.cxx,v 1.1.2.1 2007/10/19 13:35:33 akisiel Exp $ | |
12 | * | |
13 | * Author: Adam Kisiel, Ohio State, kisiel@mps.ohio-state.edu | |
14 | *************************************************************************** | |
15 | * | |
16 | * Description: part of STAR HBT Framework: AliFemtoMaker package | |
17 | * a cut to remove "shared" and "split" pairs | |
18 | * | |
19 | *************************************************************************** | |
20 | * | |
21 | * | |
22 | **************************************************************************/ | |
23 | ||
24 | #include "AliFemtoShareQualityTPCEntranceSepQAPairCut.h" | |
25 | #include <string> | |
26 | #include <cstdio> | |
27 | ||
28 | #ifdef __ROOT__ | |
29 | ClassImp(AliFemtoShareQualityTPCEntranceSepQAPairCut) | |
30 | #endif | |
31 | ||
32 | //__________________ | |
33 | AliFemtoShareQualityTPCEntranceSepQAPairCut::AliFemtoShareQualityTPCEntranceSepQAPairCut(): | |
34 | AliFemtoShareQualityQAPairCut(), | |
35 | fDTPCMin(0.0), | |
36 | fDTPCMax(1000.0), | |
37 | fDTPCQASwitch(0) | |
38 | { | |
39 | fDTPCQASwitch = false; | |
40 | fDTPCQAExclusionZone[0] = 0.0; | |
41 | fDTPCQAExclusionZone[1] = 1000.0; | |
42 | } | |
43 | //__________________ | |
44 | AliFemtoShareQualityTPCEntranceSepQAPairCut::AliFemtoShareQualityTPCEntranceSepQAPairCut(const AliFemtoShareQualityTPCEntranceSepQAPairCut& c) : | |
45 | AliFemtoShareQualityQAPairCut(c), | |
46 | fDTPCMin(0), | |
47 | fDTPCMax(1000.0), | |
48 | fDTPCQASwitch(0) | |
49 | { | |
50 | fDTPCMin = c.fDTPCMin; | |
51 | fDTPCMax = c.fDTPCMax; | |
52 | fDTPCQASwitch = c.fDTPCQASwitch; | |
53 | fDTPCQAExclusionZone[0] = c.fDTPCQAExclusionZone[0]; | |
54 | fDTPCQAExclusionZone[1] = c.fDTPCQAExclusionZone[1]; | |
55 | } | |
56 | ||
57 | //__________________ | |
58 | AliFemtoShareQualityTPCEntranceSepQAPairCut& AliFemtoShareQualityTPCEntranceSepQAPairCut::operator=(const AliFemtoShareQualityTPCEntranceSepQAPairCut& aCut) | |
59 | { | |
60 | // assignment operator | |
61 | if (this == &aCut) | |
62 | return *this; | |
63 | ||
64 | fDTPCMin = aCut.fDTPCMin; | |
65 | fDTPCMax = aCut.fDTPCMax; | |
66 | fDTPCQASwitch = aCut.fDTPCQASwitch; | |
67 | fDTPCQAExclusionZone[0] = aCut.fDTPCQAExclusionZone[0]; | |
68 | fDTPCQAExclusionZone[1] = aCut.fDTPCQAExclusionZone[1]; | |
69 | ||
70 | return *this; | |
71 | } | |
72 | ||
73 | //__________________ | |
74 | AliFemtoShareQualityTPCEntranceSepQAPairCut::~AliFemtoShareQualityTPCEntranceSepQAPairCut(){ | |
75 | /* no-op */ | |
76 | } | |
77 | //__________________ | |
78 | bool AliFemtoShareQualityTPCEntranceSepQAPairCut::Pass(const AliFemtoPair* pair){ | |
79 | // Accept pairs based on their TPC entrance separation and | |
80 | // quality and sharity | |
81 | bool pass = true; | |
82 | ||
83 | double distx = pair->Track1()->Track()->NominalTpcEntrancePoint().x() - pair->Track2()->Track()->NominalTpcEntrancePoint().x(); | |
84 | double disty = pair->Track1()->Track()->NominalTpcEntrancePoint().y() - pair->Track2()->Track()->NominalTpcEntrancePoint().y(); | |
85 | double distz = pair->Track1()->Track()->NominalTpcEntrancePoint().z() - pair->Track2()->Track()->NominalTpcEntrancePoint().z(); | |
86 | double dist = sqrt(distx*distx + disty*disty + distz*distz); | |
87 | ||
88 | if (fDTPCQASwitch) { | |
89 | pass = ((dist > fDTPCMin) && (dist < fDTPCQAExclusionZone[0])) || | |
90 | ((dist > fDTPCQAExclusionZone[1]) && (dist < fDTPCMax)); | |
91 | } | |
92 | else { | |
93 | pass = (dist > fDTPCMin) && (dist < fDTPCMax); | |
94 | } | |
95 | ||
96 | if (pass) { | |
97 | pass = AliFemtoShareQualityQAPairCut::Pass(pair); | |
98 | } | |
99 | else | |
100 | fNPairsFailed++; | |
101 | ||
102 | return pass; | |
103 | } | |
104 | //__________________ | |
105 | AliFemtoString AliFemtoShareQualityTPCEntranceSepQAPairCut::Report(){ | |
106 | // Prepare a report from the execution | |
107 | string stemp = "AliFemtoShareQualityTPCEntranceSep Pair Cut - remove shared and split pairs and pairs with small separation at the entrance to the TPC\n"; char ctemp[100]; | |
108 | snprintf(ctemp , 100, "Accept pair with TPC entrance separation more that %f",fDTPCMin); | |
109 | stemp += ctemp; | |
110 | snprintf(ctemp , 100, "Number of pairs which passed:\t%ld Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed); | |
111 | stemp += ctemp; | |
112 | AliFemtoString returnThis = stemp; | |
113 | return returnThis;} | |
114 | //__________________ | |
115 | ||
116 | TList *AliFemtoShareQualityTPCEntranceSepQAPairCut::ListSettings() | |
117 | { | |
118 | // return a list of settings in a writable form | |
119 | TList *tListSetttings = AliFemtoShareQualityQAPairCut::ListSettings(); | |
120 | char buf[200]; | |
121 | snprintf(buf, 200, "AliFemtoShareQualityTPCEntranceSepQAPairCut.tpcentsepmin=%f", fDTPCMin); | |
122 | tListSetttings->AddLast(new TObjString(buf)); | |
123 | ||
124 | return tListSetttings; | |
125 | } | |
126 | ||
127 | void AliFemtoShareQualityTPCEntranceSepQAPairCut::SetTPCEntranceSepMinimum(double dtpc) | |
128 | { | |
129 | fDTPCMin = dtpc; | |
130 | } | |
131 | ||
132 | void AliFemtoShareQualityTPCEntranceSepQAPairCut::SetTPCEntranceSepMaximum(double dtpc) | |
133 | { | |
134 | fDTPCMax = dtpc; | |
135 | } | |
136 | ||
137 | void AliFemtoShareQualityTPCEntranceSepQAPairCut::SetTPCEntranceSepQASwitch(bool Switch) | |
138 | { | |
139 | fDTPCQASwitch = Switch; | |
140 | } | |
141 | ||
142 | void AliFemtoShareQualityTPCEntranceSepQAPairCut::SetTPCEntranceSepQAExclusionZone(double lo, double hi) | |
143 | { | |
144 | fDTPCQAExclusionZone[0] = lo; | |
145 | fDTPCQAExclusionZone[1] = hi; | |
146 | } | |
147 |