]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCcalibTracksCuts.cxx
Changes needed to pass the failover tests (F. Prino)
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibTracksCuts.cxx
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
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')
41 {
42    // 
43    // default constructor
44    // 
45 }
46
47
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')
57 {
58    //
59    // Constructor for AliTPCcalibTracksCuts
60    // specify the cuts to be set on the processed tracks
61    // default cuts are for comics
62    //
63    fOutputFileName = outputFileName;
64 }
65
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')
74 {
75   // 
76   // copy constructor
77   // 
78   fOutputFileName = cuts->GetOutputFileName();
79 }
80
81
82
83 AliTPCcalibTracksCuts::~AliTPCcalibTracksCuts(){
84   //
85   // Destructor
86   //
87   cout << "AliTPCcalibTracksCuts destructor called, nothing happend." << endl;
88 }
89
90
91
92
93 void AliTPCcalibTracksCuts::AddCuts(TChain * chain, char* ctype, char* outputFileName){
94    // 
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)
99    // fMinRatio 
100    // fMax1pt   1  over p_t
101    // fEdgeYXCutNoise
102    // fEdgeThetaCutNoise
103    // 
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
109    // 
110    
111    TString cutType(ctype);
112    cutType.ToUpper();
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);
123    else {
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;
126       cutType = "COSMIC";
127    }
128    chain->GetUserInfo()->AddLast(cuts);
129    cout << "Cuts were set to predefined set: " << cutType << endl;
130 }
131
132 void AliTPCcalibTracksCuts::AddCuts(TChain * chain, Int_t minClusters, Float_t minRatio, Float_t max1pt,
133       Float_t edgeXZCutNoise, Float_t edgeThetaCutNoise, char* outputFileName){
134    // 
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)
139    // fMinRatio 
140    // fMax1pt   1  over p_t
141    // fEdgeYXCutNoise
142    // fEdgeThetaCutNoise
143    // 
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);
147 }
148
149 void AliTPCcalibTracksCuts::Print(Option_t* option) const  {
150   //
151   // Print the cut contents
152   //
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