Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
7 : * Permission to use, copy, modify and distribute this software and its *
8 : * documentation strictly for non-commercial purposes is hereby granted *
9 : * without fee, provided that the above copyright notice appears in all *
10 : * copies and that both the copyright notice and this permission notice *
11 : * appear in the supporting documentation. The authors make no claims *
12 : * about the suitability of this software for any purpose. It is *
13 : * provided "as is" without express or implied warranty. *
14 : **************************************************************************/
15 :
16 :
17 : //////////////////////////////////////////////////////
18 : // //
19 : // Class to specify cuts for track analysis //
20 : // with AliTPCcalibTracks //
21 : // //
22 : //////////////////////////////////////////////////////
23 :
24 : #include <iostream>
25 : #include <TString.h>
26 : #include <TChain.h>
27 : #include <TList.h>
28 : #include "AliTPCseed.h"
29 : #include "AliESDtrack.h"
30 : #include "AliTPCcalibTracksCuts.h"
31 :
32 6 : ClassImp(AliTPCcalibTracksCuts)
33 :
34 :
35 : AliTPCcalibTracksCuts::AliTPCcalibTracksCuts():
36 0 : TNamed("calibTracksCuts", "calibTracksCuts"),
37 0 : fMinClusters(0), // number of clusters
38 0 : fMinRatio(0), // kMinRratio = 0.4
39 0 : fMax1pt(0), // kMax1pt = 0.5
40 0 : fEdgeYXCutNoise(0), // kEdgeYXCutNoise = 0.13
41 0 : fEdgeThetaCutNoise(0) // kEdgeThetaCutNoise = 0.018
42 0 : {
43 : //
44 : // default constructor
45 : //
46 0 : }
47 :
48 :
49 : AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(Int_t minClusters, Float_t minRatio, Float_t max1pt,
50 : Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise):
51 0 : TNamed("calibTracksCuts", "calibTracksCuts"),
52 0 : fMinClusters(minClusters), // number of clusters
53 0 : fMinRatio(minRatio), // kMinRratio = 0.4
54 0 : fMax1pt(max1pt), // kMax1pt = 0.5
55 0 : fEdgeYXCutNoise(edgeXZCutNoise), // kEdgeYXCutNoise = 0.13
56 0 : fEdgeThetaCutNoise(edgeThetaCutNoise) // kEdgeThetaCutNoise = 0.018
57 0 : {
58 : //
59 : // Constructor for AliTPCcalibTracksCuts
60 : // specify the cuts to be set on the processed tracks
61 : // default cuts are for comics
62 : //
63 0 : }
64 :
65 : AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(AliTPCcalibTracksCuts *cuts):
66 0 : TNamed(cuts->GetName(), cuts->GetTitle()),
67 0 : fMinClusters(cuts->GetMinClusters()), // number of clusters
68 0 : fMinRatio(cuts->GetMinRatio()), // kMinRratio = 0.4
69 0 : fMax1pt( cuts->GetMax1pt()), // kMax1pt = 0.5
70 0 : fEdgeYXCutNoise(cuts->GetEdgeYXCutNoise()), // kEdgeYXCutNoise = 0.13
71 0 : fEdgeThetaCutNoise( cuts->GetEdgeThetaCutNoise()) // kEdgeThetaCutNoise = 0.018
72 0 : {
73 : //
74 : // copy constructor
75 : //
76 0 : }
77 :
78 :
79 :
80 0 : AliTPCcalibTracksCuts::~AliTPCcalibTracksCuts(){
81 : //
82 : // Destructor
83 : //
84 0 : cout << "AliTPCcalibTracksCuts destructor called, nothing happend." << endl;
85 0 : }
86 :
87 :
88 :
89 :
90 : AliTPCcalibTracksCuts * AliTPCcalibTracksCuts::CreateCuts(char* ctype){
91 : //
92 : // Create predefined cuts
93 : // (creates AliTPCcalibTracksCuts object)
94 : //
95 : // The following predefined sets of cuts can be selected:
96 : // laser: 20, 0.4, 0.5, 0.13, 0.018
97 : // cosmic: 20, 0.4, 0.5, 0.13, 0.018
98 : // lowflux: 20, 0.4, 5, 0.2, 0.0001
99 : // highflux: 20, 0.4, 5, 0.2, 0.0001
100 : //
101 :
102 0 : TString cutType(ctype);
103 0 : cutType.ToUpper();
104 : AliTPCcalibTracksCuts *cuts = 0;
105 0 : if (cutType == "LASER")
106 0 : cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.13, 0.018);
107 0 : else if (cutType == "COSMIC")
108 0 : cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018);
109 0 : else if (cutType == "LOWFLUX")
110 0 : cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001);
111 0 : else if (cutType == "HIGHFLUX")
112 0 : cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001);
113 : else {
114 0 : cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001);
115 0 : cerr << "WARNING! unknown type '" << ctype << "', cuts set to default values for cosmics." << endl;
116 0 : cutType = "COSMIC";
117 : }
118 0 : cout << "Cuts were set to predefined set: " << cutType << endl;
119 : return cuts;
120 0 : }
121 :
122 :
123 :
124 : Int_t AliTPCcalibTracksCuts::AcceptTrack(const AliTPCseed * track) const {
125 : //
126 : // Function, that decides wheather a given track is accepted for
127 : // the analysis or not.
128 : // Returns 0 if a track is accepted or an integer different from 0
129 : // to indicate the failed cut
130 : //
131 :
132 : //
133 : // edge induced noise tracks - NEXT RELEASE will be removed during tracking
134 0 : if ( TMath::Abs(track->GetY() / track->GetX()) > fEdgeYXCutNoise )
135 0 : if ( TMath::Abs(track->GetTgl()) < fEdgeThetaCutNoise ) return 1;
136 0 : if (track->GetNumberOfClusters() < fMinClusters) return 2;
137 0 : Float_t ratio = track->GetNumberOfClusters() / (track->GetNFoundable() + 1.);
138 0 : if (ratio < fMinRatio) return 3;
139 : // Float_t mpt = track->Get1Pt(); // Get1Pt() doesn't exist any more
140 0 : Float_t mpt = track->GetSigned1Pt();
141 0 : if (TMath::Abs(mpt) > fMax1pt) return 4;
142 :
143 0 : return 0;
144 0 : }
145 :
146 : Int_t AliTPCcalibTracksCuts::AcceptTrack(const AliESDtrack * track) const {
147 : //
148 : // Function, that decides wheather a given track is accepted for
149 : // the analysis or not.
150 : // Returns 0 if a track is accepted or an integer different from 0
151 : // to indicate the failed cut
152 : //
153 :
154 : //
155 : // edge induced noise tracks - NEXT RELEASE will be removed during tracking
156 0 : if ( TMath::Abs(track->GetY() / track->GetX()) > fEdgeYXCutNoise )
157 0 : if ( TMath::Abs(track->GetTgl()) < fEdgeThetaCutNoise ) return 1;
158 0 : if (track->GetTPCNcls() < fMinClusters) return 2;
159 0 : Float_t ratio = track->GetTPCNcls() / (track->GetTPCNclsF() + 1.);
160 0 : if (ratio < fMinRatio) return 3;
161 : // Float_t mpt = track->Get1Pt(); // Get1Pt() doesn't exist any more
162 0 : Float_t mpt = track->GetSigned1Pt();
163 0 : if (TMath::Abs(mpt) > fMax1pt) return 4;
164 :
165 0 : return 0;
166 0 : }
167 :
168 : void AliTPCcalibTracksCuts::Print(Option_t*) const {
169 : //
170 : // Print the cut contents
171 : //
172 0 : cout << "<AliTPCcalibTracksCuts>: The following cuts are specified: " << endl;
173 0 : cout << "fMinClusters: " << fMinClusters << endl;
174 0 : cout << "fMinRatio: " << fMinRatio << endl;
175 0 : cout << "fMax1pt: " << fMax1pt << endl;
176 0 : cout << "fEdgeYXCutNoise: " << fEdgeYXCutNoise << endl;
177 0 : cout << "fEdgeThetaCutNoise: " << fEdgeThetaCutNoise << endl;
178 0 : } // Prints out the specified cuts
|