1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //////////////////////////////////////////////////////
19 // Class to specify cuts for track analysis //
20 // with AliTPCcalibTracks //
22 //////////////////////////////////////////////////////
28 #include "AliTPCseed.h"
29 #include "AliESDtrack.h"
30 #include "AliTPCcalibTracksCuts.h"
32 ClassImp(AliTPCcalibTracksCuts)
35 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts():
36 TNamed("calibTracksCuts", "calibTracksCuts"),
37 fMinClusters(0), // number of clusters
38 fMinRatio(0), // kMinRratio = 0.4
39 fMax1pt(0), // kMax1pt = 0.5
40 fEdgeYXCutNoise(0), // kEdgeYXCutNoise = 0.13
41 fEdgeThetaCutNoise(0) // kEdgeThetaCutNoise = 0.018
44 // default constructor
49 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(Int_t minClusters, Float_t minRatio, Float_t max1pt,
50 Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise):
51 TNamed("calibTracksCuts", "calibTracksCuts"),
52 fMinClusters(minClusters), // number of clusters
53 fMinRatio(minRatio), // kMinRratio = 0.4
54 fMax1pt(max1pt), // kMax1pt = 0.5
55 fEdgeYXCutNoise(edgeXZCutNoise), // kEdgeYXCutNoise = 0.13
56 fEdgeThetaCutNoise(edgeThetaCutNoise) // kEdgeThetaCutNoise = 0.018
59 // Constructor for AliTPCcalibTracksCuts
60 // specify the cuts to be set on the processed tracks
61 // default cuts are for comics
65 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(AliTPCcalibTracksCuts *cuts):
66 TNamed(cuts->GetName(), cuts->GetTitle()),
67 fMinClusters(cuts->GetMinClusters()), // number of clusters
68 fMinRatio(cuts->GetMinRatio()), // kMinRratio = 0.4
69 fMax1pt( cuts->GetMax1pt()), // kMax1pt = 0.5
70 fEdgeYXCutNoise(cuts->GetEdgeYXCutNoise()), // kEdgeYXCutNoise = 0.13
71 fEdgeThetaCutNoise( cuts->GetEdgeThetaCutNoise()) // kEdgeThetaCutNoise = 0.018
80 AliTPCcalibTracksCuts::~AliTPCcalibTracksCuts(){
84 cout << "AliTPCcalibTracksCuts destructor called, nothing happend." << endl;
90 AliTPCcalibTracksCuts * AliTPCcalibTracksCuts::CreateCuts(char* ctype){
92 // Create predefined cuts
93 // (creates AliTPCcalibTracksCuts object)
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
102 TString cutType(ctype);
104 AliTPCcalibTracksCuts *cuts = 0;
105 if (cutType == "LASER")
106 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.13, 0.018);
107 else if (cutType == "COSMIC")
108 cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018);
109 else if (cutType == "LOWFLUX")
110 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001);
111 else if (cutType == "HIGHFLUX")
112 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001);
114 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001);
115 cerr << "WARNING! unknown type '" << ctype << "', cuts set to default values for cosmics." << endl;
118 cout << "Cuts were set to predefined set: " << cutType << endl;
124 Int_t AliTPCcalibTracksCuts::AcceptTrack(const AliTPCseed * track) const {
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
133 // edge induced noise tracks - NEXT RELEASE will be removed during tracking
134 if ( TMath::Abs(track->GetY() / track->GetX()) > fEdgeYXCutNoise )
135 if ( TMath::Abs(track->GetTgl()) < fEdgeThetaCutNoise ) return 1;
136 if (track->GetNumberOfClusters() < fMinClusters) return 2;
137 Float_t ratio = track->GetNumberOfClusters() / (track->GetNFoundable() + 1.);
138 if (ratio < fMinRatio) return 3;
139 // Float_t mpt = track->Get1Pt(); // Get1Pt() doesn't exist any more
140 Float_t mpt = track->GetSigned1Pt();
141 if (TMath::Abs(mpt) > fMax1pt) return 4;
146 Int_t AliTPCcalibTracksCuts::AcceptTrack(const AliESDtrack * track) const {
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
155 // edge induced noise tracks - NEXT RELEASE will be removed during tracking
156 if ( TMath::Abs(track->GetY() / track->GetX()) > fEdgeYXCutNoise )
157 if ( TMath::Abs(track->GetTgl()) < fEdgeThetaCutNoise ) return 1;
158 if (track->GetTPCNcls() < fMinClusters) return 2;
159 Float_t ratio = track->GetTPCNcls() / (track->GetTPCNclsF() + 1.);
160 if (ratio < fMinRatio) return 3;
161 // Float_t mpt = track->Get1Pt(); // Get1Pt() doesn't exist any more
162 Float_t mpt = track->GetSigned1Pt();
163 if (TMath::Abs(mpt) > fMax1pt) return 4;
168 void AliTPCcalibTracksCuts::Print(Option_t*) const {
170 // Print the cut contents
172 cout << "<AliTPCcalibTracksCuts>: The following cuts are specified: " << endl;
173 cout << "fMinClusters: " << fMinClusters << endl;
174 cout << "fMinRatio: " << fMinRatio << endl;
175 cout << "fMax1pt: " << fMax1pt << endl;
176 cout << "fEdgeYXCutNoise: " << fEdgeYXCutNoise << endl;
177 cout << "fEdgeThetaCutNoise: " << fEdgeThetaCutNoise << endl;
178 } // Prints out the specified cuts