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)
32 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(Int_t minClusters, Float_t minRatio, Float_t max1pt,
33 Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise, char* outputFileName):
34 TNamed("calibTracksCuts", "calibTracksCuts") {
36 // Constructor for AliTPCcalibTracksCuts
37 // specify the cuts to be set on the processed tracks
38 // default cuts are for comics
40 fMinClusters = minClusters;
43 fEdgeYXCutNoise = edgeXZCutNoise;
44 fEdgeThetaCutNoise = edgeThetaCutNoise;
45 fOutputFileName = new TObjString(outputFileName);
48 AliTPCcalibTracksCuts::~AliTPCcalibTracksCuts(){
52 cout << "AliTPCcalibTracksCuts destructor called, nothing happend." << endl;
56 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(AliTPCcalibTracksCuts *cuts){
60 fMinClusters = cuts->GetMinClusters();
61 fMinRatio = cuts->GetMinRatio();
62 fMax1pt = cuts->GetMax1pt();
63 fEdgeYXCutNoise = cuts->GetEdgeYXCutNoise();
64 fEdgeThetaCutNoise = cuts->GetEdgeThetaCutNoise();
65 fOutputFileName = new TObjString(cuts->GetOutputFileName());
68 AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(){
70 // default constructor
76 fEdgeThetaCutNoise = 0;
77 fOutputFileName = new TObjString("");
80 void AliTPCcalibTracksCuts::AddCuts(TChain * chain, char* ctype, char* outputFileName){
82 // add predefined cuts to the chain for processing
83 // (creates AliTPCcalibTracksCuts object)
84 // the cuts are set in the following order:
85 // fMinClusters (number of clusters)
91 // The following predefined sets of cuts can be selected:
92 // laser: 20, 0.4, 0.5, 0.13, 0.018
93 // cosmic: 20, 0.4, 0.5, 0.13, 0.018
94 // lowflux: 20, 0.4, 5, 0.2, 0.0001
95 // highflux: 20, 0.4, 5, 0.2, 0.0001
98 TString cutType(ctype);
100 AliTPCcalibTracksCuts *cuts = 0;
101 if (cutType == "LASER")
102 // cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018);
103 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.13, 0.018, outputFileName);
104 else if (cutType == "COSMIC")
105 cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018, outputFileName);
106 else if (cutType == "LOWFLUX")
107 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001, outputFileName);
108 else if (cutType == "HIGHFLUX")
109 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001, outputFileName);
111 cuts = new AliTPCcalibTracksCuts(20, 0.4, 5, 0.2, 0.0001, outputFileName);
112 cerr << "WARNING! unknown type '" << ctype << "', cuts set to default values for cosmics." << endl;
115 chain->GetUserInfo()->AddLast(cuts);
116 cout << "Cuts were set to predefined set: " << cutType << endl;
119 void AliTPCcalibTracksCuts::AddCuts(TChain * chain, Int_t minClusters, Float_t minRatio, Float_t max1pt,
120 Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise, char* outputFileName){
122 // add user defined cuts to the chain for processing
123 // (creates AliTPCcalibTracksCuts object)
124 // the cuts are set in the following order:
125 // fMinClusters (number of clusters)
127 // fMax1pt 1 over p_t
129 // fEdgeThetaCutNoise
131 chain->GetUserInfo()->AddLast(new AliTPCcalibTracksCuts(minClusters, minRatio, max1pt, edgeXZCutNoise, edgeThetaCutNoise, outputFileName));
132 printf("Cuts were set to the individal values: minClusters: %i, minRatio: %f, max1pt: %f, edgeXZCutNoise: %f, edgeThetaCutNoise: %f \n",
133 minClusters, minRatio, max1pt, edgeXZCutNoise, edgeThetaCutNoise);
136 void AliTPCcalibTracksCuts::Print(Option_t* option) {
138 // Print the cut contents
140 option = option; // to avoid compiler warnings
141 cout << "<AliTPCcalibTracksCuts>: The following cuts are specified: " << endl;
142 cout << "fMinClusters: " << fMinClusters << endl;
143 cout << "fMinRatio: " << fMinRatio << endl;
144 cout << "fMax1pt: " << fMax1pt << endl;
145 cout << "fEdgeYXCutNoise: " << fEdgeYXCutNoise << endl;
146 cout << "fEdgeThetaCutNoise: " << fEdgeThetaCutNoise << endl;
147 cout << "fOutputFileName: " << fOutputFileName->String().Data() << endl;
148 } // Prints out the specified cuts