]>
Commit | Line | Data |
---|---|---|
7f7dd416 | 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 | #include <iostream> | |
17 | #include <TList.h> | |
18 | #include <TAxis.h> | |
19 | #include <THnSparse.h> | |
20 | ||
21 | #include "AliLog.h" | |
22 | #include "AliESDtrack.h" | |
23 | #include "AliExternalTrackParam.h" | |
24 | #include "TParticle.h" | |
25 | ||
26 | #include "AlidNdPtBackgroundCuts.h" | |
27 | ||
28 | using namespace std; | |
29 | ||
30 | ClassImp(AlidNdPtBackgroundCuts) | |
31 | ||
32 | //_____________________________________________________________________________ | |
33 | AlidNdPtBackgroundCuts::AlidNdPtBackgroundCuts(const Char_t* name,const Char_t *title) : | |
34 | AliAnalysisCuts(name, title) | |
35 | , fMinEta(0) | |
36 | , fMaxEta(0) | |
37 | , fMinPhi(0) | |
38 | , fMaxPhi(0) | |
39 | , fMinPt(0) | |
40 | , fMaxPt(0) | |
41 | , fMaxFracSharedClust(0) | |
42 | , fFillControlHisto(kFALSE) | |
43 | , fControlHisto(0) | |
44 | { | |
45 | // default constructor | |
46 | ||
47 | // init data members with defaults | |
48 | Init(); | |
49 | } | |
50 | ||
51 | //_____________________________________________________________________________ | |
52 | AlidNdPtBackgroundCuts::~AlidNdPtBackgroundCuts() | |
53 | { | |
54 | // destructor | |
55 | if(fControlHisto) delete fControlHisto; | |
56 | } | |
57 | ||
58 | //_____________________________________________________________________________ | |
59 | void AlidNdPtBackgroundCuts::Init() | |
60 | { | |
61 | // set default values | |
62 | SetEtaWindow(); | |
63 | SetPhiWindow(); | |
64 | SetPtWindow(); | |
65 | SetMaxFracSharedClust(); | |
66 | ||
67 | const Int_t ptNbins = 56; | |
68 | Double_t binsPt[ptNbins+1] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0}; | |
69 | ||
70 | //etasum:dphi:dpt:eta1:eta2:pt1:fracSharedClust1:qsum | |
71 | Int_t binsControlHisto[8]= { 201, 401, 101, 30, 30, ptNbins, 101, 3 }; | |
72 | Double_t minControlHisto[8]={-3.0, -2.*TMath::Pi(), -10, -1.5, -1.5, 0., 0., 0.}; | |
73 | Double_t maxControlHisto[8]={ 3.0, 2.*TMath::Pi(), 10, 1.5, 1.5, 16., 1., 3.}; | |
74 | ||
75 | fControlHisto = new THnSparseF("fControlHisto","etasum:dphi:dpt:eta1:eta2:pt1:fracSharedClust1:qsum",8,binsControlHisto,minControlHisto,maxControlHisto); | |
76 | fControlHisto->SetBinEdges(5,binsPt); | |
77 | fControlHisto->GetAxis(0)->SetTitle("#eta1+#eta2"); | |
78 | fControlHisto->GetAxis(1)->SetTitle("#phi1-#phi2 (rad)"); | |
79 | fControlHisto->GetAxis(2)->SetTitle("pt1-pt2 (GeV/c)"); | |
80 | fControlHisto->GetAxis(3)->SetTitle("#eta1"); | |
81 | fControlHisto->GetAxis(4)->SetTitle("#eta2"); | |
82 | fControlHisto->GetAxis(5)->SetTitle("pt1 (GeV/c)"); | |
83 | fControlHisto->GetAxis(6)->SetTitle("fracSharedClust1"); | |
84 | fControlHisto->GetAxis(7)->SetTitle("q1+q2"); | |
85 | fControlHisto->Sumw2(); | |
86 | } | |
87 | ||
88 | //_____________________________________________________________________________ | |
89 | Bool_t AlidNdPtBackgroundCuts::IsBackgroundTrack(AliESDtrack *track1, AliESDtrack *track2) | |
90 | { | |
91 | // | |
92 | // check whether track is cosmic or splitted one | |
93 | // | |
94 | if(!track1) return kFALSE; | |
95 | if(!track2) return kFALSE; | |
96 | const AliExternalTrackParam *tpcTrack1 = track1->GetTPCInnerParam(); | |
97 | const AliExternalTrackParam *tpcTrack2 = track2->GetTPCInnerParam(); | |
98 | if(!tpcTrack1) return kFALSE; | |
99 | if(!tpcTrack2) return kFALSE; | |
100 | ||
101 | if( IsHistogramsOn() ) | |
102 | { | |
103 | Float_t etasum = tpcTrack1->Eta() + tpcTrack2->Eta(); | |
104 | Float_t dphi = tpcTrack1->Phi() - tpcTrack2->Phi(); | |
105 | Float_t dpt = tpcTrack1->Pt() - tpcTrack2->Pt(); | |
106 | Float_t pt1 = tpcTrack1->Pt(); | |
107 | Float_t qsum = track1->Charge() + track2->Charge(); | |
108 | if(qsum == -2) qsum = 1; | |
109 | ||
110 | Float_t nclust1 = track1->GetTPCNclsIter1() ; // first tracking pass | |
111 | Float_t nclust2 = track2->GetTPCNclsIter1() ; // first tracking pass | |
112 | Float_t fracSharedClust1 = 0.0; | |
113 | if(nclust1) fracSharedClust1 = track1->GetTPCnclsS()/Float_t(nclust1); | |
114 | ||
115 | //Float_t dsphi = (tpcTrack1->GetSnp()-tpcTrack2->GetSnp()) / TMath::Sqrt(tpcTrack1->GetSigmaSnp2()+tpcTrack2->GetSigmaSnp2()); | |
116 | //Float_t dtanl = (tpcTrack1->GetTgl()-tpcTrack2->GetTgl()) / TMath::Sqrt(tpcTrack1->GetSigmaTgl2()+tpcTrack2->GetSigmaTgl2()); | |
117 | //Float_t dsphi = tpcTrack1->GetSnp()-tpcTrack2->GetSnp(); | |
118 | //Float_t dtanl = tpcTrack1->GetTgl()-tpcTrack2->GetTgl(); | |
119 | // | |
120 | ||
121 | ||
122 | /* | |
123 | printf("tpcTrack1->GetSnp() %e, track1->Pt() %f, track1->Theta() %f, track1->Eta() %f, track1->Phi() %f, track1->Charge() %d \n", tpcTrack1->GetSnp(), track1->Pt(), track1->Theta(), track1->Eta(), track1->Phi(), track1->Charge()); | |
124 | ||
125 | printf("tpcTrack2->GetSnp() %e, track2->Pt() %f, track2->Theta() %f, track2->Eta() %f, track2->Phi() %f, track2->Charge() %d \n", tpcTrack2->GetSnp(), track2->Pt(), track2->Theta(), track2->Eta(), track2->Phi(), track2->Charge()); | |
126 | */ | |
127 | ||
128 | Double_t vControlHisto[8] = {etasum, dphi, dpt, tpcTrack1->Eta(), tpcTrack2->Eta(), pt1, fracSharedClust1,qsum}; | |
129 | if(nclust1 > 70 && nclust2 > 70) | |
130 | fControlHisto->Fill(vControlHisto); | |
131 | } | |
132 | ||
133 | if ( IsCosmicTrack(track1,track2) || IsSplittedTrack(track1,track2) ) return kTRUE; | |
134 | else return kFALSE; | |
135 | ||
136 | return kFALSE; | |
137 | } | |
138 | ||
139 | //_____________________________________________________________________________ | |
140 | Bool_t AlidNdPtBackgroundCuts::IsCosmicTrack(AliESDtrack *track1, AliESDtrack *track2) | |
141 | { | |
142 | // | |
143 | // check whether track is cosmic | |
144 | // | |
145 | if(!track1) return kFALSE; | |
146 | if(!track2) return kFALSE; | |
147 | const AliExternalTrackParam *tpcTrack1 = track1->GetTPCInnerParam(); | |
148 | const AliExternalTrackParam *tpcTrack2 = track2->GetTPCInnerParam(); | |
149 | if(!tpcTrack1) return kFALSE; | |
150 | if(!tpcTrack2) return kFALSE; | |
151 | ||
152 | /* | |
153 | Float_t etasum = tpcTrack1->Eta() + tpcTrack2->Eta(); | |
154 | Float_t dphi = tpcTrack1->Phi() - tpcTrack2->Phi(); | |
155 | Float_t dpt = tpcTrack1->Pt() - tpcTrack2->Pt(); | |
156 | Float_t pt1 = tpcTrack1->Pt(); | |
157 | */ | |
158 | Float_t qsum = track1->Charge() + track2->Charge(); | |
159 | ||
160 | Float_t nclust = track1->GetTPCNclsIter1() ; // first tracking pass | |
161 | Float_t fracSharedClust = 0.0; | |
162 | if(nclust) fracSharedClust = track1->GetTPCnclsS()/Float_t(nclust); | |
163 | ||
164 | if( qsum != 0) return kFALSE; | |
165 | ||
166 | return kFALSE; | |
167 | } | |
168 | ||
169 | //_____________________________________________________________________________ | |
170 | Bool_t AlidNdPtBackgroundCuts::IsSplittedTrack(AliESDtrack *track1, AliESDtrack *track2) | |
171 | { | |
172 | // | |
de93884d | 173 | // check whether track is splitted |
7f7dd416 | 174 | // |
175 | if(!track1) return kFALSE; | |
176 | if(!track2) return kFALSE; | |
177 | const AliExternalTrackParam *tpcTrack1 = track1->GetTPCInnerParam(); | |
178 | const AliExternalTrackParam *tpcTrack2 = track2->GetTPCInnerParam(); | |
179 | if(!tpcTrack1) return kFALSE; | |
180 | if(!tpcTrack2) return kFALSE; | |
181 | ||
182 | /* | |
183 | Float_t etasum = tpcTrack1->Eta() + tpcTrack2->Eta(); | |
184 | Float_t dphi = tpcTrack1->Phi() - tpcTrack2->Phi(); | |
185 | Float_t dpt = tpcTrack1->Pt() - tpcTrack2->Pt(); | |
186 | Float_t pt1 = tpcTrack1->Pt(); | |
187 | Float_t qsum = track1->Charge() + track2->Charge(); | |
188 | ||
189 | Float_t nclust = track1->GetTPCNclsIter1() ; // first tracking pass | |
190 | Float_t fracSharedClust = 0.0; | |
191 | if(nclust) fracSharedClust = track1->GetTPCnclsS()/Float_t(nclust); | |
192 | */ | |
193 | ||
194 | return kFALSE; | |
195 | } | |
196 | ||
197 | ||
198 | ||
199 | //_____________________________________________________________________________ | |
200 | Long64_t AlidNdPtBackgroundCuts::Merge(TCollection* list) | |
201 | { | |
202 | // Merge list of objects (needed by PROOF) | |
203 | if (!list) | |
204 | return 0; | |
205 | ||
206 | if (list->IsEmpty()) | |
207 | return 1; | |
208 | ||
209 | TIterator* iter = list->MakeIterator(); | |
210 | TObject* obj = 0; | |
211 | ||
212 | Int_t count=0; | |
213 | while((obj = iter->Next()) != 0) | |
214 | { | |
215 | AlidNdPtBackgroundCuts* entry = dynamic_cast<AlidNdPtBackgroundCuts*>(obj); | |
216 | if (entry == 0) | |
217 | continue; | |
218 | ||
219 | fControlHisto->Add(entry->fControlHisto); | |
220 | ||
221 | count++; | |
222 | } | |
223 | ||
224 | return count; | |
225 | } |