]>
Commit | Line | Data |
---|---|---|
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 "AliTPCcalibTracksCuts.h" | |
29 | ||
30 | ClassImp(AliTPCcalibTracksCuts) | |
31 | ||
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") { | |
35 | // | |
36 | // Constructor for AliTPCcalibTracksCuts | |
37 | // specify the cuts to be set on the processed tracks | |
38 | // default cuts are for comics | |
39 | // | |
40 | fMinClusters = minClusters; | |
41 | fMinRatio = minRatio; | |
42 | fMax1pt = max1pt; | |
43 | fEdgeYXCutNoise = edgeXZCutNoise; | |
44 | fEdgeThetaCutNoise = edgeThetaCutNoise; | |
45 | fOutputFileName = new TObjString(outputFileName); | |
46 | } | |
47 | ||
48 | AliTPCcalibTracksCuts::~AliTPCcalibTracksCuts(){ | |
49 | // | |
50 | // Destructor | |
51 | // | |
52 | cout << "AliTPCcalibTracksCuts destructor called, nothing happend." << endl; | |
53 | } | |
54 | ||
55 | ||
56 | AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(AliTPCcalibTracksCuts *cuts){ | |
57 | // | |
58 | // copy constructor | |
59 | // | |
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()); | |
66 | } | |
67 | ||
68 | AliTPCcalibTracksCuts::AliTPCcalibTracksCuts(){ | |
69 | // | |
70 | // default constructor | |
71 | // | |
72 | fMinClusters = 0; | |
73 | fMinRatio = 0; | |
74 | fMax1pt = 0; | |
75 | fEdgeYXCutNoise = 0; | |
76 | fEdgeThetaCutNoise = 0; | |
77 | fOutputFileName = new TObjString(""); | |
78 | } | |
79 | ||
80 | void AliTPCcalibTracksCuts::AddCuts(TChain * chain, char* ctype, char* outputFileName){ | |
81 | // | |
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) | |
86 | // fMinRatio | |
87 | // fMax1pt 1 over p_t | |
88 | // fEdgeYXCutNoise | |
89 | // fEdgeThetaCutNoise | |
90 | // | |
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 | |
96 | // | |
97 | ||
98 | TString cutType(ctype); | |
99 | cutType.ToUpper(); | |
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); | |
110 | else { | |
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; | |
113 | cutType = "COSMIC"; | |
114 | } | |
115 | chain->GetUserInfo()->AddLast(cuts); | |
116 | cout << "Cuts were set to predefined set: " << cutType << endl; | |
117 | } | |
118 | ||
119 | void AliTPCcalibTracksCuts::AddCuts(TChain * chain, Int_t minClusters, Float_t minRatio, Float_t max1pt, | |
120 | Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise, char* outputFileName){ | |
121 | // | |
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) | |
126 | // fMinRatio | |
127 | // fMax1pt 1 over p_t | |
128 | // fEdgeYXCutNoise | |
129 | // fEdgeThetaCutNoise | |
130 | // | |
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); | |
134 | } | |
135 | ||
136 | void AliTPCcalibTracksCuts::Print(Option_t* option) { | |
137 | // | |
138 | // Print the cut contents | |
139 | // | |
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 |