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 "AliTPCcalibTracksCuts.h"
30 ClassImp(AliTPCcalibTracksCuts)
33 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts():
34 TNamed("calibTracksCuts", "calibTracksCuts"),
35 fMinClusters(0), // number of clusters
36 fMinRatio(0), // kMinRratio = 0.4
37 fMax1pt(0), // kMax1pt = 0.5
38 fEdgeYXCutNoise(0), // kEdgeYXCutNoise = 0.13
39 fEdgeThetaCutNoise(0), // kEdgeThetaCutNoise = 0.018
40 fOutputFileName() // filename of outputfile ('Output.root')
43 // default constructor
48 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(Int_t minClusters, Float_t minRatio, Float_t max1pt,
49 Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise, char* outputFileName):
50 TNamed("calibTracksCuts", "calibTracksCuts"),
51 fMinClusters(minClusters), // number of clusters
52 fMinRatio(minRatio), // kMinRratio = 0.4
53 fMax1pt(max1pt), // kMax1pt = 0.5
54 fEdgeYXCutNoise(edgeXZCutNoise), // kEdgeYXCutNoise = 0.13
55 fEdgeThetaCutNoise(edgeThetaCutNoise), // kEdgeThetaCutNoise = 0.018
56 fOutputFileName() // filename of outputfile ('Output.root')
59 // Constructor for AliTPCcalibTracksCuts
60 // specify the cuts to be set on the processed tracks
61 // default cuts are for comics
63 fOutputFileName = outputFileName;
66 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(AliTPCcalibTracksCuts *cuts):
67 TNamed(cuts->GetName(), cuts->GetTitle()),
68 fMinClusters(cuts->GetMinClusters()), // number of clusters
69 fMinRatio(cuts->GetMinRatio()), // kMinRratio = 0.4
70 fMax1pt( cuts->GetMax1pt()), // kMax1pt = 0.5
71 fEdgeYXCutNoise(cuts->GetEdgeYXCutNoise()), // kEdgeYXCutNoise = 0.13
72 fEdgeThetaCutNoise( cuts->GetEdgeThetaCutNoise()), // kEdgeThetaCutNoise = 0.018
73 fOutputFileName(0) // filename of outputfile ('Output.root')
78 fOutputFileName = cuts->GetOutputFileName();
83 AliTPCcalibTracksCuts::~AliTPCcalibTracksCuts(){
87 cout << "AliTPCcalibTracksCuts destructor called, nothing happend." << endl;
93 void AliTPCcalibTracksCuts::AddCuts(TChain * chain, char* ctype, char* outputFileName){
95 // add predefined cuts to the chain for processing
96 // (creates AliTPCcalibTracksCuts object)
97 // the cuts are set in the following order:
98 // fMinClusters (number of clusters)
100 // fMax1pt 1 over p_t
102 // fEdgeThetaCutNoise
104 // The following predefined sets of cuts can be selected:
105 // laser: 20, 0.4, 0.5, 0.13, 0.018
106 // cosmic: 20, 0.4, 0.5, 0.13, 0.018
107 // lowflux: 20, 0.4, 5, 0.2, 0.0001
108 // highflux: 20, 0.4, 5, 0.2, 0.0001
111 TString cutType(ctype);
113 AliTPCcalibTracksCuts *cuts = 0;
114 if (cutType == "LASER")
115 // cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018);
116 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.13, 0.018, outputFileName);
117 else if (cutType == "COSMIC")
118 cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018, outputFileName);
119 else if (cutType == "LOWFLUX")
120 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001, outputFileName);
121 else if (cutType == "HIGHFLUX")
122 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001, outputFileName);
124 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001, outputFileName);
125 cerr << "WARNING! unknown type '" << ctype << "', cuts set to default values for cosmics." << endl;
128 chain->GetUserInfo()->AddLast(cuts);
129 cout << "Cuts were set to predefined set: " << cutType << endl;
132 void AliTPCcalibTracksCuts::AddCuts(TChain * chain, Int_t minClusters, Float_t minRatio, Float_t max1pt,
133 Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise, char* outputFileName){
135 // add user defined cuts to the chain for processing
136 // (creates AliTPCcalibTracksCuts object)
137 // the cuts are set in the following order:
138 // fMinClusters (number of clusters)
140 // fMax1pt 1 over p_t
142 // fEdgeThetaCutNoise
144 chain->GetUserInfo()->AddLast(new AliTPCcalibTracksCuts(minClusters, minRatio, max1pt, edgeXZCutNoise, edgeThetaCutNoise, outputFileName));
145 printf("Cuts were set to the individal values: minClusters: %i, minRatio: %f, max1pt: %f, edgeXZCutNoise: %f, edgeThetaCutNoise: %f \n",
146 minClusters, minRatio, max1pt, edgeXZCutNoise, edgeThetaCutNoise);
149 void AliTPCcalibTracksCuts::Print(Option_t* option) const {
151 // Print the cut contents
153 option = option; // to avoid compiler warnings
154 cout << "<AliTPCcalibTracksCuts>: The following cuts are specified: " << endl;
155 cout << "fMinClusters: " << fMinClusters << endl;
156 cout << "fMinRatio: " << fMinRatio << endl;
157 cout << "fMax1pt: " << fMax1pt << endl;
158 cout << "fEdgeYXCutNoise: " << fEdgeYXCutNoise << endl;
159 cout << "fEdgeThetaCutNoise: " << fEdgeThetaCutNoise << endl;
160 cout << "fOutputFileName: " << fOutputFileName.GetName() << endl;
161 } // Prints out the specified cuts