changes in AddAnalysisTaskPIDFluctuation.C for only one output file in analysis train...
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibTask.cxx
CommitLineData
98937691 1
2/**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16
17/////////////////////////////////////////////////////////////////////////////////
18//
19// AliTRDCalibTask
20//
21// Offline TRD calibration task
22//
23// Author:
24// R. Bailhache (R.Bailhache@gsi.de)
25//
26//////////////////////////////////////////////////////////////////////////////////////
27
01239968 28#include <iostream>
29using namespace std;
98937691 30#include "Riostream.h"
31#include "TChain.h"
32#include "TTree.h"
33#include "TFile.h"
34#include "TProfile2D.h"
35#include "TH2I.h"
36#include "TH1F.h"
37#include "TH2F.h"
54f2ff1c 38#include "TH2S.h"
98937691 39#include "TList.h"
40#include "TMath.h"
41#include "TObject.h"
42#include "TObjArray.h"
43#include "TString.h"
44#include "TCanvas.h"
45#include "TLegend.h"
46#include "TStyle.h"
47#include "TLine.h"
57185ead 48#include "TIterator.h"
54f2ff1c 49#include "TLinearFitter.h"
50#include "TVectorD.h"
98937691 51
52#include "AliAnalysisTask.h"
53#include "AliAnalysisManager.h"
54
c1105918 55#include "AliExternalTrackParam.h"
98937691 56#include "AliESDVertex.h"
57#include "AliESDEvent.h"
58#include "AliESDfriend.h"
89f7cf44 59#include "AliCentrality.h"
98937691 60#include "AliESDInputHandler.h"
61#include "AliESDtrack.h"
62#include "AliESDfriendTrack.h"
63#include "AliTRDtrackV1.h"
64#include "AliTRDseedV1.h"
65#include "AliTRDcluster.h"
66#include "AliTRDgeometry.h"
67#include "AliESDtrackCuts.h"
68#include "AliESDVertex.h"
69#include "AliTRDCalDet.h"
70
57185ead 71#include "AliTRDCalibraVector.h"
98937691 72#include "AliTRDCalibraFillHisto.h"
73#include "AliTRDCalibraVdriftLinearFit.h"
a0bb5615 74#include "AliTRDCalibraExbAltFit.h"
98937691 75
76#include "AliTRDcalibDB.h"
a2a4ec8e 77#include "AliCDBId.h"
78#include "AliLog.h"
98937691 79
b2277aa2 80#include "AliTRDCalibChamberStatus.h"
98937691 81
82#include "AliTRDCalibTask.h"
83
84
85ClassImp(AliTRDCalibTask)
86
87//________________________________________________________________________
88 AliTRDCalibTask::AliTRDCalibTask(const char *name)
01239968 89 : AliAnalysisTaskSE(name), fESD(0),
98937691 90 fkEsdTrack(0),
91 fFriendTrack(0),
92 fCalibObject(0),
93 fTrdTrack(0),
94 fCl(0),
95 fListHist(0),
96 fTRDCalibraFillHisto(0),
b2277aa2 97 fTRDChamberStatus(0),
98937691 98 fNEvents(0),
a5dcf618 99 fNEventsInput(0),
98937691 100 fNbTRDTrack(0),
101 fNbTRDTrackOffline(0),
102 fNbTRDTrackStandalone(0),
103 fNbTPCTRDtrack(0),
c1105918 104 fNbGoodTracks(0),
98937691 105 fNbTimeBin(0),
106 fNbTimeBinOffline(0),
107 fNbTimeBinStandalone(0),
108 fNbClusters(0),
109 fNbClustersOffline(0),
110 fNbClustersStandalone(0),
111 fNbTracklets(0),
112 fNbTrackletsOffline(0),
113 fNbTrackletsStandalone(0),
114 fAbsoluteGain(0),
115 fCH2dSum(0),
116 fPH2dSum(0),
117 fCH2dSM(0),
118 fPH2dSM(0),
54f2ff1c 119 fCH2dTest(0),
120 fPH2dTest(0),
121 fLinearVdriftTest(0),
122 fOnInstance(kTRUE),
98937691 123 fHisto2d(kTRUE),
124 fVector2d(kFALSE),
125 fVdriftLinear(kTRUE),
a0bb5615 126 fExbAlt(kFALSE),
5f689709 127 fDebugLevelTRDCalibraFillHisto(0),
98937691 128 fNbTimeBins(0),
5f689709 129 fNumberBinCharge(50),
130 fSelectTrigger(kTRUE),
98937691 131 fSelectedTrigger(new TObjArray()),
132 fRejected(kTRUE),
133 fEsdTrackCuts(0),
134 fRequirePrimaryVertex(kFALSE),
135 fVtxTPC(kFALSE),
136 fVtxSPD(kFALSE),
137 fMinNbContributors(0),
138 fRangePrimaryVertexZ(9999999.0),
c1105918 139 fMinNbTracks(9),
5f689709 140 fMaxNbTracks(999999999),
141 fCutWithVdriftCalib(kFALSE),
142 fMinNbTRDtracklets(0),
143 fMinTRDMomentum(0),
98937691 144 fLow(0),
145 fHigh(30),
146 fFillZero(kFALSE),
147 fNormalizeNbOfCluster(kFALSE),
148 fRelativeScale(0.0),
149 fMaxCluster(100.0),
150 fNbMaxCluster(2),
151 fOfflineTracks(kFALSE),
152 fStandaloneTracks(kFALSE),
d085ba91 153 fFirstRunGain(-1),
a2a4ec8e 154 fVersionGainUsed(-1),
155 fSubVersionGainUsed(-1),
d085ba91 156 fFirstRunGainLocal(-1),
a2a4ec8e 157 fVersionGainLocalUsed(-1),
158 fSubVersionGainLocalUsed(-1),
d085ba91 159 fFirstRunVdrift(-1),
a2a4ec8e 160 fVersionVdriftUsed(-1),
161 fSubVersionVdriftUsed(-1),
b2277aa2 162 fFirstRunExB(-1),
163 fVersionExBUsed(-1),
164 fSubVersionExBUsed(-1),
98937691 165 fCalDetGain(0x0),
166 fMaxEvent(0),
92df0132 167 fCounter(0)
98937691 168{
169 //
170 // Default constructor
171 //
172
173 fNz[0] = 0;
174 fNz[1] = 0;
175 fNz[2] = 0;
176
177 fNrphi[0] = 0;
178 fNrphi[1] = 0;
179 fNrphi[2] = 0;
180
92df0132 181
98937691 182 // Define input and output slots here
183 // Input slot #0 works with a TChain
184 DefineInput(0, TChain::Class());
185
186 // Output slot #0 writes into a TList container
01239968 187 DefineOutput(1, TList::Class());
98937691 188
189
190}
191//____________________________________________________________________________________
192AliTRDCalibTask::~AliTRDCalibTask()
193{
194 //
195 // AliTRDCalibTask destructor
196 //
197
198 // Pointeur
199 if(fNEvents) delete fNEvents;
a5dcf618 200 if(fNEventsInput) delete fNEventsInput;
98937691 201 if(fNbTRDTrack) delete fNbTRDTrack;
202 if(fNbTRDTrackOffline) delete fNbTRDTrackOffline;
203 if(fNbTRDTrackStandalone) delete fNbTRDTrackStandalone;
204 if(fNbTPCTRDtrack) delete fNbTPCTRDtrack;
c1105918 205 if(fNbGoodTracks) delete fNbGoodTracks;
98937691 206 if(fNbTimeBin) delete fNbTimeBin;
207 if(fNbTimeBinOffline) delete fNbTimeBinOffline;
208 if(fNbTimeBinStandalone) delete fNbTimeBinStandalone;
209 if(fNbClusters) delete fNbClusters;
210 if(fNbClustersOffline) delete fNbClustersOffline;
211 if(fNbClustersStandalone) delete fNbClustersStandalone;
212 if(fNbTracklets) delete fNbTracklets;
213 if(fNbTrackletsOffline) delete fNbTrackletsOffline;
214 if(fNbTrackletsStandalone) delete fNbTrackletsStandalone;
215 if(fAbsoluteGain) delete fAbsoluteGain;
216 if(fCH2dSum) delete fCH2dSum;
217 if(fPH2dSum) delete fPH2dSum;
218 if(fCH2dSM) delete fCH2dSM;
219 if(fPH2dSM) delete fPH2dSM;
54f2ff1c 220 if(fCH2dTest) delete fCH2dTest;
221 if(fPH2dTest) delete fPH2dTest;
222 if(fLinearVdriftTest) delete fLinearVdriftTest;
98937691 223 if(fCalDetGain) delete fCalDetGain;
224
225 if(fSelectedTrigger) {
226 fSelectedTrigger->Delete();
227 delete fSelectedTrigger;
228 }
229 if(fEsdTrackCuts) {
230 delete fEsdTrackCuts;
231 }
232
b2277aa2 233 if(fTRDChamberStatus) delete fTRDChamberStatus;
234
98937691 235}
01239968 236
98937691 237//________________________________________________________________________
01239968 238void AliTRDCalibTask::UserCreateOutputObjects()
98937691 239{
240 //
241 // Create the histos
242 //
01239968 243 //cout << "AliTRDCalibTask::CreateOutputObjects() IN" << endl;
98937691 244
245 // Number of time bins
246 if(fNbTimeBins==0) {
247 AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
248 fNbTimeBins = cal->GetNumberOfTimeBinsDCS();
249 if(fNbTimeBins <= 0){
250 AliWarning(Form("No of TimeBins from DB [%d] use default [30]", fNbTimeBins));
251 fNbTimeBins = 30;
252 }
253 }
a2a4ec8e 254
54f2ff1c 255 // output list
256 fListHist = new TList();
257 fListHist->SetOwner();
b2277aa2 258
259 // init chamber status
260 fTRDChamberStatus = new AliTRDCalibChamberStatus();
261 fTRDChamberStatus->Init();
262 fListHist->Add(fTRDChamberStatus->GetSparseI());
263
98937691 264 // instance calibration
265 fTRDCalibraFillHisto = AliTRDCalibraFillHisto::Instance();
54f2ff1c 266 if(fOnInstance) {
5f689709 267 fTRDCalibraFillHisto->SetNumberBinCharge(fNumberBinCharge); // set number of bin of the charge distribution
268 fTRDCalibraFillHisto->SetCutWithVdriftCalib(fCutWithVdriftCalib); // cut vdrift
269 fTRDCalibraFillHisto->SetMinNbTRDtracklets(fMinNbTRDtracklets); // min number of TRD tracklets
270 fTRDCalibraFillHisto->SetMinTRDMomentum(fMinTRDMomentum); // min TRD momentum
54f2ff1c 271 fTRDCalibraFillHisto->SetHisto2d(fHisto2d); // choose to use histograms
272 fTRDCalibraFillHisto->SetVector2d(fVector2d); // choose to use vectors
273 fTRDCalibraFillHisto->SetCH2dOn(); // choose to calibrate the gain
274 fTRDCalibraFillHisto->SetPH2dOn(); // choose to calibrate the drift velocity
275 fTRDCalibraFillHisto->SetPRF2dOn(); // choose to look at the PRF
276 fTRDCalibraFillHisto->SetLinearFitterOn(fVdriftLinear); // Other possibility vdrift VDRIFT
277 fTRDCalibraFillHisto->SetLinearFitterDebugOn(fVdriftLinear); // Other possibility vdrift
a0bb5615 278 fTRDCalibraFillHisto->SetExbAltFitOn(fExbAlt); // Alternative method for exb
54f2ff1c 279 for(Int_t k = 0; k < 3; k++){
280 if(((fNz[k] != 10) && (fNrphi[k] != 10)) && ((fNz[k] != 100) && (fNrphi[k] != 100))) {
281 fTRDCalibraFillHisto->SetNz(k,fNz[k]); // Mode calibration
282 fTRDCalibraFillHisto->SetNrphi(k,fNrphi[k]); // Mode calibration
98937691 283 }
54f2ff1c 284 else {
285 if((fNz[k] == 100) && (fNrphi[k] == 100)) {
286 if(fVector2d) AliInfo("The mode all together is not supported by the vector method");
287 fTRDCalibraFillHisto->SetAllTogether(k);
288 }
289 if((fNz[k] == 10) && (fNrphi[k] == 10)) {
290 if(fVector2d) AliInfo("The mode per supermodule is not supported by the vector method");
291 fTRDCalibraFillHisto->SetPerSuperModule(k);
292 }
98937691 293 }
294 }
54f2ff1c 295 // Variables for how to fill
296 fTRDCalibraFillHisto->SetFillWithZero(fFillZero);
297 fTRDCalibraFillHisto->SetNormalizeNbOfCluster(fNormalizeNbOfCluster);
298 fTRDCalibraFillHisto->SetMaxCluster(fMaxCluster);
299 fTRDCalibraFillHisto->SetNbMaxCluster(fNbMaxCluster);
98937691 300
54f2ff1c 301 // Init with 30 timebins
302 fTRDCalibraFillHisto->Init2Dhistos(fNbTimeBins); // initialise the histos
303 fTRDCalibraFillHisto->SetNumberClusters(fLow); // At least 11 clusters
304 fTRDCalibraFillHisto->SetNumberClustersf(fHigh); // At least 11 clusters
305
306 // For testing only
5f689709 307 fTRDCalibraFillHisto->SetDebugLevel(fDebugLevelTRDCalibraFillHisto); //debug stuff
54f2ff1c 308
309 if(fHisto2d) {
310 fListHist->Add(fTRDCalibraFillHisto->GetCH2d());
311 fListHist->Add(fTRDCalibraFillHisto->GetPH2d());
312 fListHist->Add(fTRDCalibraFillHisto->GetPRF2d());
313 }
314 if(fVdriftLinear) fListHist->Add((TObject *)fTRDCalibraFillHisto->GetVdriftLinearFit());
a0bb5615 315 if(fVector2d) fListHist->Add((TObject *) fTRDCalibraFillHisto->GetCalibraVector()); //calibra vector
316 if(fExbAlt) fListHist->Add((TObject *)fTRDCalibraFillHisto->GetExbAltFit());
54f2ff1c 317 }
98937691 318 fRelativeScale = fTRDCalibraFillHisto->GetRelativeScale(); // Get the relative scale for the gain
319
54f2ff1c 320 fNEvents = new TH1I(Form("NEvents_%s",(const char*)fName),"NEvents", 2, 0, 2);
98937691 321 fListHist->Add(fNEvents);
54f2ff1c 322 fNEventsInput = new TH1I(Form("NEventsInput_%s",(const char*)fName),"NEventsInput", 2, 0, 2);
a5dcf618 323 fListHist->Add(fNEventsInput);
98937691 324
325 // absolute gain calibration even without AliESDfriend
326 Int_t nBinsPt = 25;
327 Double_t minPt = 0.001;
328 Double_t maxPt = 10.0;
329
330 Double_t *binLimLogPt = new Double_t[nBinsPt+1];
331 Double_t *binLimPt = new Double_t[nBinsPt+1];
332 for(Int_t i=0; i<=nBinsPt; i++) binLimLogPt[i]=(Double_t)TMath::Log10(minPt) + (TMath::Log10(maxPt)-TMath::Log10(minPt))/nBinsPt*(Double_t)i ;
333 for(Int_t i=0; i<=nBinsPt; i++) binLimPt[i]=(Double_t)TMath::Power(10,binLimLogPt[i]);
334
54f2ff1c 335 fAbsoluteGain = new TH2F(Form("AbsoluteGain_%s",(const char*)fName),"AbsoluteGain", 200, 0.0, 700.0, nBinsPt, binLimPt);
98937691 336 fAbsoluteGain->SetYTitle("Momentum at TRD");
337 fAbsoluteGain->SetXTitle("charge deposit [a.u]");
338 fAbsoluteGain->SetZTitle("counts");
339 fAbsoluteGain->SetStats(0);
340 fAbsoluteGain->Sumw2();
341 fListHist->Add(fAbsoluteGain);
342
98937691 343 /////////////////////////////////////////
344 // First debug level
345 ///////////////////////////////////////
346 if(fDebug > 0) {
54f2ff1c 347
348 fLinearVdriftTest = new TH2S(Form("LFDV0testversion_%s",(const char*)fName),"LFDV0testversion",36,-0.9,0.9,48,-1.2,1.2);
349 fLinearVdriftTest->SetXTitle("tan(phi_{track})");
350 fLinearVdriftTest->SetYTitle("dy/dt");
351 fLinearVdriftTest->SetZTitle("Number of tracklets");
352 fLinearVdriftTest->SetStats(0);
353 fLinearVdriftTest->SetDirectory(0);
98937691 354
355 // Standart with AliESDfriend
54f2ff1c 356 fPH2dTest = new TProfile2D(Form("PH2dTest_%s",(const char*)fName),"Nz0Nrphi0"
357 ,fNbTimeBins,-0.05,(Double_t)((fNbTimeBins-0.5)/10.0)
358 ,540,0,540);
359 fPH2dTest->SetYTitle("Det/pad groups");
360 fPH2dTest->SetXTitle("time [#mus]");
361 fPH2dTest->SetZTitle("<PH> [a.u.]");
362 fPH2dTest->SetStats(0);
363 //
364 fCH2dTest = new TH2I(Form("CH2dTest_%s",(const char*)fName),"Nz0Nrphi0",50,0,300,540,0,540);
365 fCH2dTest->SetYTitle("Det/pad groups");
366 fCH2dTest->SetXTitle("charge deposit [a.u]");
367 fCH2dTest->SetZTitle("counts");
368 fCH2dTest->SetStats(0);
369 fCH2dTest->Sumw2();
370
371 //
372 fPH2dSM = new TProfile2D(Form("PH2dSM_%s",(const char*)fName),"Nz10Nrphi10"
98937691 373 ,fNbTimeBins,-0.05,(Double_t)((fNbTimeBins-0.5)/10.0)
374 ,18,0,18);
375 fPH2dSM->SetYTitle("Det/pad groups");
376 fPH2dSM->SetXTitle("time [#mus]");
377 fPH2dSM->SetZTitle("<PH> [a.u.]");
378 fPH2dSM->SetStats(0);
379 //
54f2ff1c 380 fCH2dSM = new TH2I(Form("CH2dSM_%s",(const char*)fName),"Nz10Nrphi10",50,0,300,18,0,18);
98937691 381 fCH2dSM->SetYTitle("Det/pad groups");
382 fCH2dSM->SetXTitle("charge deposit [a.u]");
383 fCH2dSM->SetZTitle("counts");
384 fCH2dSM->SetStats(0);
385 fCH2dSM->Sumw2();
386 //
54f2ff1c 387 fPH2dSum = new TProfile2D(Form("PH2dSum_%s",(const char*)fName),"Nz100Nrphi100"
98937691 388 ,fNbTimeBins,-0.05,(Double_t)((fNbTimeBins-0.5)/10.0)
389 ,1,0,1);
390 fPH2dSum->SetYTitle("Det/pad groups");
391 fPH2dSum->SetXTitle("time [#mus]");
392 fPH2dSum->SetZTitle("<PH> [a.u.]");
393 fPH2dSum->SetStats(0);
394 //
54f2ff1c 395 fCH2dSum = new TH2I(Form("CH2dSum_%s",(const char*)fName),"Nz100Nrphi100",50,0,300,1,0,1);
98937691 396 fCH2dSum->SetYTitle("Det/pad groups");
397 fCH2dSum->SetXTitle("charge deposit [a.u]");
398 fCH2dSum->SetZTitle("counts");
399 fCH2dSum->SetStats(0);
400 fCH2dSum->Sumw2();
54f2ff1c 401
98937691 402
403 // Add them
54f2ff1c 404 fListHist->Add(fLinearVdriftTest);
405 fListHist->Add(fPH2dTest);
406 fListHist->Add(fCH2dTest);
98937691 407 fListHist->Add(fPH2dSM);
408 fListHist->Add(fCH2dSM);
409 fListHist->Add(fPH2dSum);
410 fListHist->Add(fCH2dSum);
54f2ff1c 411
98937691 412 }
413
414 /////////////////////////////////////////
415 // Second debug level
416 ///////////////////////////////////////
417 if(fDebug > 1) {
418
54f2ff1c 419 fNbGoodTracks = new TH2F(Form("NbGoodTracks_%s",(const char*)fName),"NbGoodTracks",500,0.0,2500.0,200,0.0,100.0);
420 fNbGoodTracks->SetXTitle("Nb of good tracks");
421 fNbGoodTracks->SetYTitle("Centrality");
422 fNbGoodTracks->SetStats(0);
423
424 fNbTRDTrack = new TH1F(Form("TRDTrack_%s",(const char*)fName),"TRDTrack",50,0,50);
98937691 425 fNbTRDTrack->Sumw2();
54f2ff1c 426 fNbTRDTrackOffline = new TH1F(Form("TRDTrackOffline_%s",(const char*)fName),"TRDTrackOffline",50,0,50);
98937691 427 fNbTRDTrackOffline->Sumw2();
54f2ff1c 428 fNbTRDTrackStandalone = new TH1F(Form("TRDTrackStandalone_%s",(const char*)fName),"TRDTrackStandalone",50,0,50);
98937691 429 fNbTRDTrackStandalone->Sumw2();
54f2ff1c 430 fNbTPCTRDtrack = new TH2F(Form("NbTPCTRDtrack_%s",(const char*)fName),"NbTPCTRDtrack",100,0,100,100,0,100);
98937691 431 fNbTPCTRDtrack->Sumw2();
432 //
54f2ff1c 433 fNbTimeBin = new TH1F(Form("NbTimeBin_%s",(const char*)fName),"NbTimeBin",35,0,35);
98937691 434 fNbTimeBin->Sumw2();
54f2ff1c 435 fNbTimeBinOffline = new TH1F(Form("NbTimeBinOffline_%s",(const char*)fName),"NbTimeBinOffline",35,0,35);
98937691 436 fNbTimeBinOffline->Sumw2();
54f2ff1c 437 fNbTimeBinStandalone = new TH1F(Form("NbTimeBinStandalone_%s",(const char*)fName),"NbTimeBinStandalone",35,0,35);
98937691 438 fNbTimeBinStandalone->Sumw2();
439 //
54f2ff1c 440 fNbClusters = new TH1F(Form("NbClusters_%s",(const char*)fName),"",35,0,35);
98937691 441 fNbClusters->Sumw2();
54f2ff1c 442 fNbClustersOffline = new TH1F(Form("NbClustersOffline_%s",(const char*)fName),"",35,0,35);
98937691 443 fNbClustersOffline->Sumw2();
54f2ff1c 444 fNbClustersStandalone = new TH1F(Form("NbClustersStandalone_%s",(const char*)fName),"",35,0,35);
98937691 445 fNbClustersStandalone->Sumw2();
446 //
54f2ff1c 447 fNbTracklets = new TH1F(Form("NbTracklets_%s",(const char*)fName),"NbTracklets",540,0.,540.);
98937691 448 fNbTracklets->Sumw2();
54f2ff1c 449 fNbTrackletsOffline = new TH1F(Form("NbTrackletsOffline_%s",(const char*)fName),"NbTrackletsOffline",540,0.,540.);
98937691 450 fNbTrackletsOffline->Sumw2();
54f2ff1c 451 fNbTrackletsStandalone = new TH1F(Form("NbTrackletsStandalone_%s",(const char*)fName),"NbTrackletsStandalone",540,0.,540.);
98937691 452 fNbTrackletsStandalone->Sumw2();
453
54f2ff1c 454 fListHist->Add(fNbGoodTracks);
455
98937691 456 fListHist->Add(fNbTRDTrack);
457 fListHist->Add(fNbTRDTrackOffline);
458 fListHist->Add(fNbTRDTrackStandalone);
459 fListHist->Add(fNbTPCTRDtrack);
460
461 fListHist->Add(fNbTimeBin);
462 fListHist->Add(fNbTimeBinOffline);
463 fListHist->Add(fNbTimeBinStandalone);
464 fListHist->Add(fNbClusters);
465 fListHist->Add(fNbClustersOffline);
466 fListHist->Add(fNbClustersStandalone);
467 fListHist->Add(fNbTracklets);
468 fListHist->Add(fNbTrackletsOffline);
469 fListHist->Add(fNbTrackletsStandalone);
470
471 }
fdc15553 472
473 delete [] binLimLogPt;
474 delete [] binLimPt;
475
c7cb134f 476 PostData(1,fListHist);
477
01239968 478 //cout << "AliTRDCalibTask::UserCreateOutputObjects() OUT" << endl;
98937691 479
fdc15553 480}
57185ead 481
01239968 482//________________________________________________________________________
483void AliTRDCalibTask::UserExec(Option_t *)
484{
485 //
486 // Filling of the histos
487 //
488 //cout << "AliTRDCalibTask::Exec() IN" << endl;
98937691 489
a2a4ec8e 490 // Init Versions and subversions used
ca7e6e64 491 if((fFirstRunGain==-1) || (fVersionGainUsed==-1) || (fSubVersionGainUsed==-1) || (fFirstRunGainLocal==-1) || (fVersionGainLocalUsed==-1) || (fSubVersionGainLocalUsed==-1) || (fFirstRunVdrift==-1) || (fVersionVdriftUsed==-1) || (fSubVersionVdriftUsed==-1)) {
a2a4ec8e 492 if(!SetVersionSubversion()) {
ca7e6e64 493 PostData(1, fListHist);
494 return;
a2a4ec8e 495 }
496 }
497 if(fCounter==0) {
54f2ff1c 498 if(fOnInstance) {
499 fTRDCalibraFillHisto->SetFirstRunGain(fFirstRunGain); // Gain Used
500 fTRDCalibraFillHisto->SetVersionGainUsed(fVersionGainUsed); // Gain Used
501 fTRDCalibraFillHisto->SetSubVersionGainUsed(fSubVersionGainUsed); // Gain Used
502 fTRDCalibraFillHisto->SetFirstRunGainLocal(fFirstRunGainLocal); // Gain Used
503 fTRDCalibraFillHisto->SetVersionGainLocalUsed(fVersionGainLocalUsed); // Gain Used
504 fTRDCalibraFillHisto->SetSubVersionGainLocalUsed(fSubVersionGainLocalUsed); // Gain Used
505 fTRDCalibraFillHisto->SetFirstRunVdrift(fFirstRunVdrift); // Vdrift Used
506 fTRDCalibraFillHisto->SetVersionVdriftUsed(fVersionVdriftUsed); // Vdrift Used
507 fTRDCalibraFillHisto->SetSubVersionVdriftUsed(fSubVersionVdriftUsed); // Vdrift Used
b2277aa2 508 if((fFirstRunExB != -1) && (fVersionExBUsed != -1) && (fSubVersionExBUsed != -1)){
509 fTRDCalibraFillHisto->SetFirstRunExB(fFirstRunExB); // ExB Used
510 fTRDCalibraFillHisto->SetVersionExBUsed(fVersionExBUsed); // ExB Used
511 fTRDCalibraFillHisto->SetSubVersionExBUsed(fSubVersionExBUsed); // ExB Used
512 }
54f2ff1c 513 fTRDCalibraFillHisto->InitCalDet();
514 }
515 if(fDebug > 1){
516 // title CH2dTest
517 TString name("Ver");
518 name += fVersionGainUsed;
519 name += "Subver";
520 name += fSubVersionGainUsed;
521 name += "FirstRun";
522 name += fFirstRunGain;
523 name += "Nz0Nrphi0";
524 fCH2dTest->SetTitle(name);
525 // title PH2dTest
526 TString namee("Ver");
527 namee += fVersionVdriftUsed;
528 namee += "Subver";
529 namee += fSubVersionVdriftUsed;
530 namee += "FirstRun";
531 namee += fFirstRunVdrift;
532 namee += "Nz0Nrphi0";
533 fPH2dTest->SetTitle(namee);
534 }
a2a4ec8e 535 }
536
01239968 537 // AliLog::SetGlobalLogLevel(AliLog::kError);
538 // cout << "AliTRDCalibTask::Exec() 1" << endl;
539 fESD = dynamic_cast<AliESDEvent*>(fInputEvent);
540 if(!fESD){
541 AliError("ESD Event missing");
542 PostData(1, fListHist);
543 return;
544 }
c1105918 545
546 const char* type = fESD->GetBeamType();
547
01239968 548
549 //printf("Counter %d\n",fCounter);
550
551 fCounter++;
a5dcf618 552 fNEventsInput->Fill(1);
553
01239968 554 //cout << "maxEvent = " << fMaxEvent << endl;
555 //if(fCounter%100==0) cout << "fCounter = " << fCounter << endl;
c1105918 556 if((fMaxEvent != 0) && (fMaxEvent < fCounter)) {
557 PostData(1, fListHist);
558 return;
559 }
01239968 560 //if(fCounter%100==0) cout << "fCounter1 = " << fCounter << endl;
561 //cout << "event = " << fCounter << endl;
562
563 //printf("Counter %d\n",fCounter);
564
565 ///////////////////
566 // Check trigger
567 ///////////////////
568 Bool_t pass = kTRUE;
c1105918 569
5f689709 570 if (fSelectTrigger) {
c1105918 571
572 //printf("Will check the triggers\n");
573
574 Int_t numberOfTriggerSelected = fSelectedTrigger->GetEntriesFast();
575 //printf("numberofTriggerSelected %d\n",numberOfTriggerSelected);
576 if(fRejected) {
577 pass = kTRUE;
578 for(Int_t k = 0; k < numberOfTriggerSelected; k++){
579 const TObjString *const obString=(TObjString*)fSelectedTrigger->At(k);
580 const TString tString=obString->GetString();
581 if(fESD->IsTriggerClassFired((const char*)tString)) {
582 pass = kFALSE;
583 }
01239968 584 }
585 }
c1105918 586 else {
587 pass = kFALSE;
588 for(Int_t k = 0; k < numberOfTriggerSelected; k++){
589 const TObjString *const obString=(TObjString*)fSelectedTrigger->At(k);
590 const TString tString=obString->GetString();
591 if(fESD->IsTriggerClassFired((const char*)tString)) {
592 pass = kTRUE;
593 }
01239968 594 }
595 }
c1105918 596 if(!pass) {
597 PostData(1, fListHist);
598 return;
599 }
600
01239968 601 }
c1105918 602
01239968 603 //printf("Class Fired %s\n",(const char*)fESD->GetFiredTriggerClasses());
604 //printf("Trigger passed\n");
605
606 ///////////////////////////////
607 // Require a primary vertex
608 //////////////////////////////
609 if(fRequirePrimaryVertex) {
610 const AliESDVertex* vtxESD = 0x0;
611 if (fVtxTPC) vtxESD = fESD->GetPrimaryVertexTPC() ;
612 else if (fVtxSPD) vtxESD = fESD->GetPrimaryVertexSPD() ;
613 else vtxESD = fESD->GetPrimaryVertexTracks() ;
614 if(!vtxESD){
615 PostData(1, fListHist);
616 return;
617 }
618 Int_t nCtrb = vtxESD->GetNContributors();
619 if(nCtrb < fMinNbContributors) {
620 PostData(1, fListHist);
621 return;
622 }
623 Double_t zPosition = vtxESD->GetZ();
624 if(TMath::Abs(zPosition) > fRangePrimaryVertexZ) {
625 PostData(1, fListHist);
626 return;
627 }
628
629 }
630
631 //printf("Primary vertex passed\n");
632
c1105918 633 //////////////////////////////////////
634 // Requirement on number of good tracks
635 //////////////////////////////////////
636 Int_t nGoodParticles = 0;
637 Double_t nbTracks = fESD->GetNumberOfTracks();
638 for(Int_t itrack = 0; itrack < nbTracks; itrack++) {
639 if(ParticleGood(itrack)) nGoodParticles++;
640 }
54f2ff1c 641 if(fDebug > 1) {
c1105918 642 // Centrality
89f7cf44 643 AliCentrality *esdCentrality = fESD->GetCentrality();
c1105918 644 Float_t centrality = esdCentrality->GetCentralityPercentile("V0M");
645 //Float_t centralityb = esdCentrality->GetCentralityPercentile("CL1");
646 fNbGoodTracks->Fill(nGoodParticles,centrality);
647 //printf("centrality %f, centralityb %f\n",centrality,centralityb);
648 }
649
6cd743ca 650 //printf("Beam type %s\n",(const char*)type);
e8200e16 651 if (!strstr(type,"p-p")) {
652 //if (strstr(type,"A-A")) {
6cd743ca 653 //printf("Will check the number of good tracks %f %f %f\n",nGoodParticles,fMinNbTracks,fMaxNbTracks);
c1105918 654 if((nGoodParticles < fMinNbTracks) || (nGoodParticles > fMaxNbTracks)) {
655 PostData(1, fListHist);
656 return;
657 }
658 }
659
01239968 660 fNEvents->Fill(1);
661
662 // In total
663 Int_t nbTrdTracks = 0;
664 // standalone
665 Int_t nbTrdTracksStandalone = 0;
666 // offline
667 Int_t nbTrdTracksOffline = 0;
668 // TPC
669 Int_t nbtrackTPC = 0;
670
c1105918 671
01239968 672
673 if (nbTracks <= 0.0) {
674
675 if(fDebug > 1) {
676 fNbTRDTrack->Fill(nbTrdTracks);
677 fNbTRDTrackStandalone->Fill(nbTrdTracksStandalone);
678 fNbTRDTrackOffline->Fill(nbTrdTracksOffline);
679 }
680 PostData(1, fListHist);
681 return;
682 }
683
4c865c34 684
01239968 685 fESDfriend = dynamic_cast<AliESDfriend*> (fESD->FindListObject("AliESDfriend"));
686 if(!fESDfriend){
687 AliError("fESDfriend not available");
688 PostData(1, fListHist);
689 return;
690 }
20dfc307 691
692 if(fESDfriend->TestSkipBit()) {
693 PostData(1, fListHist);
694 return;
695 }
01239968 696
697 //printf("has friends\n");
98937691 698
01239968 699 /////////////////////////////////////
700 // Loop on AliESDtrack
701 ////////////////////////////////////
702 //printf("Nb of tracks %f\n",nbTracks);
703 for(int itrk=0; itrk < nbTracks; ++itrk){
98937691 704
01239968 705 // Get ESD track
706 fkEsdTrack = fESD->GetTrack(itrk);
707 if(!fkEsdTrack) continue;
708 ULong_t status = fkEsdTrack->GetStatus();
709 if(status&(AliESDtrack::kTPCout)) ++nbtrackTPC;
710
b2277aa2 711 fFriendTrack = fESDfriend->GetTrack(itrk);
712 if(!fFriendTrack) {
713 //printf("No friend track %d\n",itrk);
01239968 714 continue;
715 }
b2277aa2 716
01239968 717 // Other cuts
b2277aa2 718 fTrdTrack = 0x0;
01239968 719 Bool_t good = kTRUE;
720 Bool_t standalonetrack = kFALSE;
721 Bool_t offlinetrack = kFALSE;
722 //ULong_t status = fkEsdTrack->GetStatus();
723
01239968 724 //////////////////////////////////////
725 // Loop on calibration objects
726 //////////////////////////////////////
727 Int_t icalib=0;
728 Int_t nTRDtrackV1=0;
729 while((fCalibObject = (TObject *)(fFriendTrack->GetCalibObject(icalib++)))){
4c865c34 730 //printf("Name %s\n",fCalibObject->IsA()->GetName());
01239968 731 if(strcmp(fCalibObject->IsA()->GetName(), "AliTRDtrackV1") != 0) continue;
732 //printf("Find the calibration object\n");
733 ++nTRDtrackV1;
734
735 if((status&(AliESDtrack::kTRDout)) && (!(status&(AliESDtrack::kTRDin)))) {
736 standalonetrack = kTRUE;
737 }
738 if((status&(AliESDtrack::kTRDin))) {
739 offlinetrack = kTRUE;
740 }
741 if(fOfflineTracks){
742 if(!offlinetrack){
743 good = kFALSE;
744 }
745 }
746 else if(fStandaloneTracks){
747 if(!standalonetrack){
748 good = kFALSE;
749 }
750 }
751
752 fTrdTrack = (AliTRDtrackV1 *)fCalibObject;
b2277aa2 753 // process chamberstatus
754 fTRDChamberStatus->ProcessTrack(fTrdTrack);
755 }
756
757 // Quality cuts on the AliESDtrack
758 if((fEsdTrackCuts) && (!fEsdTrackCuts->IsSelected((AliVParticle *)fkEsdTrack))) {
759 //printf("Not a good track\n");
760 continue;
761 }
762
763 // First Absolute gain calibration
764 Int_t trdNTracklets = (Int_t) fkEsdTrack->GetTRDntracklets();
765 Int_t trdNTrackletsPID = (Int_t) fkEsdTrack->GetTRDntrackletsPID();
766 //printf("Number of trd tracklets %d and PID trd tracklets %d\n",trdNTracklets,trdNTrackletsPID);
767 if((trdNTracklets > 0) && (trdNTrackletsPID > 0)) {
768 for(Int_t iPlane = 0; iPlane < 6; ++iPlane){
769 //Double_t slide = fkEsdTrack->GetTRDslice(iPlane);
770 //printf("Number of slide %d\n",fkEsdTrack->GetNumberOfTRDslices());
771 //Double_t momentum = fkEsdTrack->GetTRDmomentum(iPlane);
772 //printf("momentum %f, slide %f\n",momentum,slide);
773 if(fkEsdTrack->GetTRDslice(iPlane) > 0.0)
774 fAbsoluteGain->Fill(fkEsdTrack->GetTRDslice(iPlane)*8.0/100.0,
775 fkEsdTrack->GetTRDmomentum(iPlane));
01239968 776 }
b2277aa2 777 }
778
779
780 if(!fTrdTrack) continue;
781
782 if(good && fOnInstance) {
783 //cout << "good" << endl;
5f689709 784 fTRDCalibraFillHisto->UpdateHistogramsV1(fTrdTrack,fkEsdTrack);
b2277aa2 785 //printf("Fill fTRDCalibraFillHisto\n");
786 }
787
01239968 788
b2277aa2 789
790 //////////////////////////////////
791 // Debug
792 ////////////////////////////////
793
794 if(fDebug > 0) {
795
796 //printf("Enter debug\n");
01239968 797
b2277aa2 798 Int_t nbtracklets = 0;
799
800 // Check some stuff
801 Bool_t standalonetracklet = kFALSE;
802 const AliTRDseedV1 *tracklet = 0x0;
803 //////////////////////////////////////
804 // Loop tracklets
805 /////////////////////////////////////
806 Int_t nbclusters=0;
807 Double_t phtb[AliTRDseedV1::kNtb];
808 memset(phtb, 0, AliTRDseedV1::kNtb*sizeof(Double_t));
809 Double_t sum = 0.0;
f29cf84c 810 Float_t normalisation = 1.13;
b2277aa2 811 Int_t detector = 0;
812 Int_t sector = 0;
813 for(Int_t itr = 0; itr < 6; ++itr){
01239968 814
b2277aa2 815 if(!(tracklet = fTrdTrack->GetTracklet(itr))) continue;
816 if(!tracklet->IsOK()) continue;
817 ++nbtracklets;
818 standalonetracklet = kFALSE;
819 if(tracklet->IsStandAlone()) standalonetracklet = kTRUE;
01239968 820
b2277aa2 821 nbclusters = 0;
822 memset(phtb, 0, AliTRDseedV1::kNtb*sizeof(Double_t));
823 sum = 0.0;
824 detector = 0;
825 sector = 0;
826 //Int_t crossrow = 0;
01239968 827
01239968 828 // Check no shared clusters
829 //for(int icc=AliTRDseedV1::kNtb; icc<AliTRDseedV1::kNclusters; icc++){
830 // if((fcl = tracklet->GetClusters(icc))) crossrow = 1;
831 // }
b2277aa2 832
01239968 833 // Loop on clusters
b2277aa2 834 Int_t time = 0;
835 Float_t ch = 0;
836 Float_t qcl = 0;
837 for(int ic=0; ic<AliTRDseedV1::kNtb; ++ic){
838
839 if(!(fCl = tracklet->GetClusters(ic))) continue;
840 ++nbclusters;
841 time = fCl->GetPadTime();
f29cf84c 842 //ch = tracklet->GetdQdl(ic);
843 ch = tracklet->GetQperTB(ic);
b2277aa2 844 qcl = TMath::Abs(fCl->GetQ());
845 detector = fCl->GetDetector();
846 // Add the charge if shared cluster
847 if((ic+AliTRDseedV1::kNtb) < AliTRDseedV1::kNclusters) {
848 if((fCl = tracklet->GetClusters(ic+AliTRDseedV1::kNtb))) {
849 qcl += TMath::Abs(fCl->GetQ());
850 //printf("Add the cluster charge\n");
01239968 851 }
852 }
b2277aa2 853 if((time>-1) && (time<fNbTimeBins)) phtb[time]=qcl;
854 if((fCalDetGain) && (fCalDetGain->GetValue(detector) > 0.0)) sum += ch*fCalDetGain->GetValue(detector)/normalisation;
855 else sum += ch/normalisation;
01239968 856
857 if(fDebug > 1) {
b2277aa2 858 fNbTimeBin->Fill(time);
859 if(tracklet->IsStandAlone()) fNbTimeBinStandalone->Fill(time);
860 else fNbTimeBinOffline->Fill(time);
861 }
862 }
863 sector = AliTRDgeometry::GetSector(detector);
864
865 if(fDebug > 1) {
866 fNbTracklets->Fill(detector);
867 if(tracklet->IsStandAlone()) fNbTrackletsStandalone->Fill(detector);
868 else fNbTrackletsOffline->Fill(detector);
01239968 869
b2277aa2 870 fNbClusters->Fill(nbclusters);
871 if(tracklet->IsStandAlone()) fNbClustersStandalone->Fill(nbclusters);
872 else fNbClustersOffline->Fill(nbclusters);
873 }
874
875 if((nbclusters > fLow) && (nbclusters < fHigh)){
876 if(fRelativeScale > 0.0) sum = sum/fRelativeScale;
877 fCH2dTest->Fill(sum,detector+0.5);
878 fCH2dSM->Fill(sum,sector+0.5);
879 fCH2dSum->Fill(sum,0.5);
880 Bool_t checknoise = kTRUE;
881 if(fMaxCluster > 0) {
882 if(phtb[0] > fMaxCluster) checknoise = kFALSE;
883 if(fNbTimeBins > fNbMaxCluster) {
884 for(Int_t k = (fNbTimeBins-fNbMaxCluster); k < fNbTimeBins; k++){
885 if(phtb[k] > fMaxCluster) checknoise = kFALSE;
01239968 886 }
54f2ff1c 887 }
b2277aa2 888 }
889 if(checknoise) {
890 for(int ic=0; ic<fNbTimeBins; ic++){
891 if(fFillZero) {
892 fPH2dTest->Fill((Double_t)(ic/10.0),detector+0.5,(Double_t)phtb[ic]);
893 fPH2dSum->Fill((Double_t)(ic/10.0),0.5,(Double_t)phtb[ic]);
894 fPH2dSM->Fill((Double_t)(ic/10.0),sector+0.5,(Double_t)phtb[ic]);
895 }
896 else {
897 if(phtb[ic] > 0.0) {
54f2ff1c 898 fPH2dTest->Fill((Double_t)(ic/10.0),detector+0.5,(Double_t)phtb[ic]);
b2277aa2 899 fPH2dSum->Fill((Double_t)(ic/10.0),0.0,(Double_t)phtb[ic]);
54f2ff1c 900 fPH2dSM->Fill((Double_t)(ic/10.0),sector+0.5,(Double_t)phtb[ic]);
901 }
01239968 902 }
903 }
904 }
b2277aa2 905 }
906 if(detector == 0) FindP1TrackPHtrackletV1Test(tracklet,nbclusters);
01239968 907
b2277aa2 908 } // loop on tracklets
01239968 909
b2277aa2 910
911 } // debug
912
01239968 913 if(nTRDtrackV1 > 0) {
914 ++nbTrdTracks;
915 if((status&(AliESDtrack::kTRDout)) && (!(status&(AliESDtrack::kTRDin)))) {
916 ++nbTrdTracksStandalone;
917 }
918 if((status&(AliESDtrack::kTRDin))) {
919 ++nbTrdTracksOffline;
920 }
921 }
922 //delete fFriendTrack;
923 } // loop ESD track
924
925 if(fDebug > 1) {
926 fNbTRDTrack->Fill(nbTrdTracks);
927 fNbTRDTrackStandalone->Fill(nbTrdTracksStandalone);
928 fNbTRDTrackOffline->Fill(nbTrdTracksOffline);
929 fNbTPCTRDtrack->Fill(nbTrdTracks,nbtrackTPC);
930 }
931
932 // Post output data
933 PostData(1, fListHist);
934 //cout << "AliTRDCalibTask::Exec() OUT" << endl;
935}
98937691 936
98937691 937//________________________________________________________________________
938void AliTRDCalibTask::Terminate(Option_t *)
939{
940 //
941 // Terminate
942 //
943
944 if(fTRDCalibraFillHisto) fTRDCalibraFillHisto->DestroyDebugStreamer();
945
946
947}
948//_______________________________________________________
949Bool_t AliTRDCalibTask::Load(const Char_t *filename)
950{
951 //
952 // Generic container loader
953 //
954
955 if(!TFile::Open(filename)){
956 //AliWarning(Form("Couldn't open file %s.", filename));
957 return kFALSE;
958 }
959 TList *o = 0x0;
960 if(!(o = (TList*)gFile->Get(GetName()))){
961 //AliWarning("Missing histogram container.");
962 return kFALSE;
963 }
964 fListHist = (TList*)o->Clone(GetName());
965 gFile->Close();
966 return kTRUE;
967}
57185ead 968//_______________________________________________________
969Bool_t AliTRDCalibTask::Load(TList *lister)
970{
971 //
972 // Generic container loader
973 //
974
975 fListHist = (TList*)lister->Clone(GetName());
976 return kTRUE;
977}
57185ead 978//_______________________________________________________________________________________
979void AliTRDCalibTask::AddTask(const AliTRDCalibTask * calibTask) {
980
981 //
982 // Add stats
983 //
984
985 TList *listcalibTask = calibTask->GetList();
986 if(!listcalibTask) return;
987
b2277aa2 988 THnSparseI *histoEntries = (THnSparseI *) listcalibTask->FindObject("NumberOfEntries");
989
990 TH1I *nEvents = (TH1I *) listcalibTask->FindObject(Form("NEvents_%s",(const char*)calibTask->GetName()));
991 TH1I *nEventsInput = (TH1I *) listcalibTask->FindObject(Form("NEventsInput_%s",(const char*)calibTask->GetName()));
992 TH2F *absoluteGain = (TH2F *) listcalibTask->FindObject(Form("AbsoluteGain_%s",(const char*)calibTask->GetName()));
57185ead 993
b2277aa2 994 TH1F *trdTrack = (TH1F *) listcalibTask->FindObject(Form("TRDTrack_%s",(const char*)calibTask->GetName()));
995 TH1F *trdTrackOffline = (TH1F *) listcalibTask->FindObject(Form("TRDTrackOffline_%s",(const char*)calibTask->GetName()));
996 TH1F *trdTrackStandalone = (TH1F *) listcalibTask->FindObject(Form("TRDTrackStandalone_%s",(const char*)calibTask->GetName()));
57185ead 997
b2277aa2 998 TH2F *tpctrdTrack = (TH2F *) listcalibTask->FindObject(Form("NbTPCTRDtrack_%s",(const char*)calibTask->GetName()));
57185ead 999
b2277aa2 1000 TH1F *nbTimeBin = (TH1F *) listcalibTask->FindObject(Form("NbTimeBin_%s",(const char*)calibTask->GetName()));
1001 TH1F *nbTimeBinOffline = (TH1F *) listcalibTask->FindObject(Form("NbTimeBinOffline_%s",(const char*)calibTask->GetName()));
1002 TH1F *nbTimeBinStandalone = (TH1F *) listcalibTask->FindObject(Form("NbTimeBinStandalone_%s",(const char*)calibTask->GetName()));
57185ead 1003
b2277aa2 1004 TH1F *nbClusters = (TH1F *) listcalibTask->FindObject(Form("NbClusters_%s",(const char*)calibTask->GetName()));
1005 TH1F *nbClustersOffline = (TH1F *) listcalibTask->FindObject(Form("NbClustersOffline_%s",(const char*)calibTask->GetName()));
1006 TH1F *nbClustersStandalone = (TH1F *) listcalibTask->FindObject(Form("NbClustersStandalone_%s",(const char*)calibTask->GetName()));
57185ead 1007
b2277aa2 1008 TH1F *nbTracklets = (TH1F *) listcalibTask->FindObject(Form("NbTracklets_%s",(const char*)calibTask->GetName()));
1009 TH1F *nbTrackletsOffline = (TH1F *) listcalibTask->FindObject(Form("NbTrackletsOffline_%s",(const char*)calibTask->GetName()));
1010 TH1F *nbTrackletsStandalone = (TH1F *) listcalibTask->FindObject(Form("NbTrackletsStandalone_%s",(const char*)calibTask->GetName()));
57185ead 1011
1012 TH2I *ch2d = (TH2I *) listcalibTask->FindObject("CH2d");
1013 TProfile2D *ph2d = (TProfile2D *) listcalibTask->FindObject("PH2d");
1014 TProfile2D *prf2d = (TProfile2D *) listcalibTask->FindObject("PRF2d");
1015
b2277aa2 1016 TH2I *ch2dSum = (TH2I *) listcalibTask->FindObject(Form("CH2dSum_%s",(const char*)calibTask->GetName()));
1017 TProfile2D *ph2dSum = (TProfile2D *) listcalibTask->FindObject(Form("PH2dSum_%s",(const char*)calibTask->GetName()));
57185ead 1018
b2277aa2 1019 TH2I *ch2dSM = (TH2I *) listcalibTask->FindObject(Form("CH2dSM_%s",(const char*)calibTask->GetName()));
1020 TProfile2D *ph2dSM = (TProfile2D *) listcalibTask->FindObject(Form("PH2dSM_%s",(const char*)calibTask->GetName()));
57185ead 1021
1022 AliTRDCalibraVdriftLinearFit *linearfit = (AliTRDCalibraVdriftLinearFit *) listcalibTask->FindObject("AliTRDCalibraVdriftLinearFit");
a0bb5615 1023 AliTRDCalibraExbAltFit *exbaltfit = (AliTRDCalibraExbAltFit *) listcalibTask->FindObject("AliTRDCalibraExbAltFit");
57185ead 1024 AliTRDCalibraVector *calibraVector = (AliTRDCalibraVector *) listcalibTask->FindObject("AliTRDCalibraVector");
1025
1026 //
1027
b2277aa2 1028 THnSparseI *inhistoEntries = (THnSparseI *) fListHist->FindObject("NumberOfEntries");
57185ead 1029
b2277aa2 1030 TH1I *inEventsInput = (TH1I *) fListHist->FindObject(Form("NEventsInput_%s",(const char*)fName));
1031 TH1I *inEvents = (TH1I *) fListHist->FindObject(Form("NEvents_%s",(const char*)fName));
1032 TH2F *iabsoluteGain = (TH2F *) fListHist->FindObject(Form("AbsoluteGain_%s",(const char*)fName));
57185ead 1033
b2277aa2 1034 TH1F *itrdTrack = (TH1F *) fListHist->FindObject(Form("TRDTrack_%s",(const char*)fName));
1035 TH1F *itrdTrackOffline = (TH1F *) fListHist->FindObject(Form("TRDTrackOffline_%s",(const char*)fName));
1036 TH1F *itrdTrackStandalone = (TH1F *) fListHist->FindObject(Form("TRDTrackStandalone_%s",(const char*)fName));
21185a48 1037
b2277aa2 1038 TH2F *itpctrdTrack = (TH2F *) fListHist->FindObject(Form("NbTPCTRDtrack_%s",(const char*)fName));
57185ead 1039
b2277aa2 1040 TH1F *inbTimeBin = (TH1F *) fListHist->FindObject(Form("NbTimeBin_%s",(const char*)fName));
1041 TH1F *inbTimeBinOffline = (TH1F *) fListHist->FindObject(Form("NbTimeBinOffline_%s",(const char*)fName));
1042 TH1F *inbTimeBinStandalone = (TH1F *) fListHist->FindObject(Form("NbTimeBinStandalone_%s",(const char*)fName));
57185ead 1043
b2277aa2 1044 TH1F *inbClusters = (TH1F *) fListHist->FindObject(Form("NbClusters_%s",(const char*)fName));
1045 TH1F *inbClustersOffline = (TH1F *) fListHist->FindObject(Form("NbClustersOffline_%s",(const char*)fName));
1046 TH1F *inbClustersStandalone = (TH1F *) fListHist->FindObject(Form("NbClustersStandalone_%s",(const char*)fName));
1047
1048 TH1F *inbTracklets = (TH1F *) fListHist->FindObject(Form("NbTracklets_%s",(const char*)fName));
1049 TH1F *inbTrackletsOffline = (TH1F *) fListHist->FindObject(Form("NbTrackletsOffline_%s",(const char*)fName));
1050 TH1F *inbTrackletsStandalone = (TH1F *) fListHist->FindObject(Form("NbTrackletsStandalone_%s",(const char*)fName));
57185ead 1051
1052 TH2I *ich2d = (TH2I *) fListHist->FindObject("CH2d");
1053 TProfile2D *iph2d = (TProfile2D *) fListHist->FindObject("PH2d");
1054 TProfile2D *iprf2d = (TProfile2D *) fListHist->FindObject("PRF2d");
1055
b2277aa2 1056 TH2I *ich2dSum = (TH2I *) fListHist->FindObject(Form("CH2dSum_%s",(const char*)fName));
1057 TProfile2D *iph2dSum = (TProfile2D *) fListHist->FindObject(Form("PH2dSum_%s",(const char*)fName));
57185ead 1058
b2277aa2 1059 TH2I *ich2dSM = (TH2I *) fListHist->FindObject(Form("CH2dSM_%s",(const char*)fName));
1060 TProfile2D *iph2dSM = (TProfile2D *) fListHist->FindObject(Form("PH2dSM_%s",(const char*)fName));
57185ead 1061
1062 AliTRDCalibraVdriftLinearFit *ilinearfit = (AliTRDCalibraVdriftLinearFit *) fListHist->FindObject("AliTRDCalibraVdriftLinearFit");
a0bb5615 1063 AliTRDCalibraExbAltFit *iexbaltfit = (AliTRDCalibraExbAltFit *) fListHist->FindObject("AliTRDCalibraExbAltFit");
57185ead 1064 AliTRDCalibraVector *icalibraVector = (AliTRDCalibraVector *) fListHist->FindObject("AliTRDCalibraVector");
1065
1066
1067 // Add
a5dcf618 1068
b2277aa2 1069 if(histoEntries) {
1070 if(inhistoEntries) {
1071 inhistoEntries->Add(histoEntries);
1072 //printf("Add Events\n");
1073 }
1074 else {
1075 //printf("Create new Events\n");
1076 inhistoEntries = (THnSparseI *) histoEntries->Clone();
1077 fListHist->Add(inhistoEntries);
1078 }
1079 }
1080
a5dcf618 1081 if(nEventsInput) {
1082 if(inEventsInput) {
1083 inEventsInput->Add(nEventsInput);
1084 //printf("Add Events\n");
1085 }
1086 else {
1087 //printf("Create new Events\n");
1088 inEventsInput = new TH1I(*nEventsInput);
1089 fListHist->Add(inEventsInput);
1090 }
1091 }
57185ead 1092
1093 if(nEvents) {
1094 if(inEvents) {
1095 inEvents->Add(nEvents);
1096 //printf("Add Events\n");
1097 }
1098 else {
1099 //printf("Create new Events\n");
1100 inEvents = new TH1I(*nEvents);
1101 fListHist->Add(inEvents);
1102 }
1103 }
1104
1105 if(absoluteGain) {
1106 if(iabsoluteGain) iabsoluteGain->Add(absoluteGain);
1107 else {
1108 iabsoluteGain = new TH2F(*absoluteGain);
1109 fListHist->Add(iabsoluteGain);
1110 }
1111 }
1112
1113 if(trdTrack) {
1114 if(itrdTrack) itrdTrack->Add(trdTrack);
1115 else {
1116 itrdTrack = new TH1F(*trdTrack);
1117 fListHist->Add(itrdTrack);
1118 }
1119 }
1120
1121 if(trdTrackOffline) {
1122 if(itrdTrackOffline) itrdTrackOffline->Add(trdTrackOffline);
1123 else {
1124 itrdTrackOffline = new TH1F(*trdTrackOffline);
1125 fListHist->Add(itrdTrackOffline);
1126 }
1127 }
1128
1129 if(trdTrackStandalone) {
1130 if(itrdTrackStandalone) itrdTrackStandalone->Add(trdTrackStandalone);
1131 else {
1132 itrdTrackStandalone = new TH1F(*trdTrackStandalone);
1133 fListHist->Add(itrdTrackStandalone);
1134 }
1135 }
1136
1137 if(tpctrdTrack) {
1138 if(itpctrdTrack) itpctrdTrack->Add(tpctrdTrack);
1139 else {
1140 itpctrdTrack = new TH2F(*tpctrdTrack);
1141 fListHist->Add(itpctrdTrack);
1142 }
1143 }
1144
1145 if(nbTimeBin) {
1146 if(inbTimeBin) inbTimeBin->Add(nbTimeBin);
1147 else {
1148 inbTimeBin = new TH1F(*inbTimeBin);
1149 fListHist->Add(inbTimeBin);
1150 }
1151 }
1152
1153 if(nbTimeBinOffline) {
1154 if(inbTimeBinOffline) inbTimeBinOffline->Add(nbTimeBinOffline);
1155 else {
1156 inbTimeBinOffline = new TH1F(*nbTimeBinOffline);
1157 fListHist->Add(inbTimeBinOffline);
1158 }
1159 }
1160
1161 if(nbTimeBinStandalone) {
1162 if(inbTimeBinStandalone) inbTimeBinStandalone->Add(nbTimeBinStandalone);
1163 else {
1164 inbTimeBinStandalone = new TH1F(*nbTimeBinStandalone);
1165 fListHist->Add(inbTimeBinStandalone);
1166 }
1167 }
1168
1169 if(nbClusters) {
1170 if(inbClusters) inbClusters->Add(nbClusters);
1171 else {
1172 inbClusters = new TH1F(*nbClusters);
1173 fListHist->Add(inbClusters);
1174 }
1175 }
1176
1177 if(nbClustersOffline) {
1178 if(inbClustersOffline) inbClustersOffline->Add(nbClustersOffline);
1179 else {
1180 inbClustersOffline = new TH1F(*nbClustersOffline);
1181 fListHist->Add(inbClustersOffline);
1182 }
1183 }
1184
1185 if(nbClustersStandalone) {
1186 if(inbClustersStandalone) inbClustersStandalone->Add(nbClustersStandalone);
1187 else {
1188 inbClustersStandalone = new TH1F(*nbClustersStandalone);
1189 fListHist->Add(inbClustersStandalone);
1190 }
1191 }
1192
1193 if(nbTracklets) {
1194 if(inbTracklets) inbTracklets->Add(nbTracklets);
1195 else {
1196 inbTracklets = new TH1F(*nbTracklets);
1197 fListHist->Add(inbTracklets);
1198 }
1199 }
1200
1201 if(nbTrackletsOffline) {
1202 if(inbTrackletsOffline) inbTrackletsOffline->Add(nbTrackletsOffline);
1203 else {
1204 inbTrackletsOffline = new TH1F(*nbTrackletsOffline);
1205 fListHist->Add(inbTrackletsOffline);
1206 }
1207 }
1208
1209 if(nbTrackletsStandalone) {
1210 if(inbTrackletsStandalone) inbTrackletsStandalone->Add(nbTrackletsStandalone);
1211 else {
1212 inbTrackletsStandalone = new TH1F(*nbTrackletsStandalone);
1213 fListHist->Add(inbTrackletsStandalone);
1214 }
1215 }
1216
1217 if(ch2d) {
1218 if(ich2d) ich2d->Add(ch2d);
1219 else {
1220 ich2d = new TH2I(*ch2d);
1221 fListHist->Add(ich2d);
1222 }
1223 }
1224
1225 if(ph2d) {
1226 if(iph2d) iph2d->Add(ph2d);
1227 else {
1228 iph2d = new TProfile2D(*ph2d);
1229 fListHist->Add(iph2d);
1230 }
1231 }
1232
1233 if(prf2d) {
1234 if(iprf2d) iprf2d->Add(prf2d);
1235 else {
1236 iprf2d = new TProfile2D(*prf2d);
1237 fListHist->Add(iprf2d);
1238 }
1239 }
1240
1241 if(ch2dSum) {
1242 if(ich2dSum) ich2dSum->Add(ch2dSum);
1243 else {
1244 ich2dSum = new TH2I(*ch2dSum);
1245 fListHist->Add(ich2dSum);
1246 }
1247 }
1248
1249 if(ph2dSum) {
1250 if(iph2dSum) iph2dSum->Add(ph2dSum);
1251 else {
1252 iph2dSum = new TProfile2D(*ph2dSum);
1253 fListHist->Add(iph2dSum);
1254 }
1255 }
1256
1257 if(ch2dSM) {
1258 if(ich2dSM) ich2dSM->Add(ch2dSM);
1259 else {
1260 ich2dSM = new TH2I(*ch2dSM);
1261 fListHist->Add(ich2dSM);
1262 }
1263 }
1264
1265 if(ph2dSM) {
1266 if(iph2dSM) iph2dSM->Add(ph2dSM);
1267 else {
1268 iph2dSM = new TProfile2D(*ph2dSM);
1269 fListHist->Add(iph2dSM);
1270 }
1271 }
1272
1273 if(linearfit) {
1274 if(ilinearfit) ilinearfit->Add(linearfit);
1275 else {
1276 ilinearfit = new AliTRDCalibraVdriftLinearFit(*linearfit);
1277 fListHist->Add(ilinearfit);
1278 }
a0bb5615 1279 }
1280
1281 if(exbaltfit) {
1282 if(iexbaltfit) iexbaltfit->Add(exbaltfit);
1283 else {
1284 iexbaltfit = new AliTRDCalibraExbAltFit(*exbaltfit);
1285 fListHist->Add(iexbaltfit);
1286 }
1287 }
57185ead 1288
1289 if(calibraVector) {
1290 if(icalibraVector) icalibraVector->Add(calibraVector);
1291 else {
1292 icalibraVector = new AliTRDCalibraVector(*calibraVector);
1293 fListHist->Add(icalibraVector);
1294 }
1295 }
1296
1297}
1298//________________________________________________________________________________
1299Long64_t AliTRDCalibTask::Merge(TCollection *li) {
1300
1301 //
1302 // merge component
1303 //
1304
1305 TIterator* iter = li->MakeIterator();
1306 AliTRDCalibTask* cal = 0;
1307
1308 while ((cal = (AliTRDCalibTask*)iter->Next())) {
1309 if (!cal->InheritsFrom(AliTRDCalibTask::Class())) {
1310 Error("Merge","Attempt to add object of class %s to a %s", cal->ClassName(), this->ClassName());
1311 return -1;
1312 }
1313
1314 // add histograms here...
1315 this->AddTask(cal);
1316
1317 }
1318
1319 return 0;
1320
1321}
a2a4ec8e 1322//_____________________________________________________
1323Bool_t AliTRDCalibTask::SetVersionSubversion(){
1324 //
1325 // Load Chamber Gain factors into the Tender supply
1326 //
1327
92df0132 1328 //printf("SetVersionSubversion\n");
a2a4ec8e 1329
1330 //find previous entry from the UserInfo
1331 TTree *tree=((TChain*)GetInputData(0))->GetTree();
1332 if (!tree) {
1333 AliError("Tree not found in ESDhandler");
1334 return kFALSE;
1335 }
1336
1337 TList *userInfo=(TList*)tree->GetUserInfo();
1338 if (!userInfo) {
1339 AliError("No UserInfo found in tree");
1340 return kFALSE;
1341 }
1342
1343 TList *cdbList=(TList*)userInfo->FindObject("cdbList");
1344 if (!cdbList) {
1345 AliError("No cdbList found in UserInfo");
1346 if (AliLog::GetGlobalLogLevel()>=AliLog::kError) userInfo->Print();
1347 return kFALSE;
1348 }
1349
1350 TIter nextCDB(cdbList);
1351 TObjString *os=0x0;
1352 while ( (os=(TObjString*)nextCDB()) ){
1353 if(os->GetString().Contains("TRD/Calib/ChamberGainFactor")){
1354 // Get Old gain calibration
1355 AliCDBId *id=AliCDBId::MakeFromString(os->GetString());
d085ba91 1356 fFirstRunGain = id->GetFirstRun();
a2a4ec8e 1357 fVersionGainUsed = id->GetVersion();
1358 fSubVersionGainUsed = id->GetSubVersion();
1359 } else if(os->GetString().Contains("TRD/Calib/ChamberVdrift")){
1360 // Get Old drift velocity calibration
1361 AliCDBId *id=AliCDBId::MakeFromString(os->GetString());
d085ba91 1362 fFirstRunVdrift = id->GetFirstRun();
a2a4ec8e 1363 fVersionVdriftUsed = id->GetVersion();
1364 fSubVersionVdriftUsed = id->GetSubVersion();
1365 } else if(os->GetString().Contains("TRD/Calib/LocalGainFactor")){
1366 // Get Old drift velocity calibration
1367 AliCDBId *id=AliCDBId::MakeFromString(os->GetString());
d085ba91 1368 fFirstRunGainLocal = id->GetFirstRun();
a2a4ec8e 1369 fVersionGainLocalUsed = id->GetVersion();
1370 fSubVersionGainLocalUsed = id->GetSubVersion();
709b13d5 1371 } else if((os->GetString().Contains("TRD/Calib/ChamberExB")) && (!os->GetString().Contains("TRD/Calib/ChamberExBAlt"))){
b2277aa2 1372 // Get Old drift velocity calibration
1373 AliCDBId *id=AliCDBId::MakeFromString(os->GetString());
1374 fFirstRunExB = id->GetFirstRun();
1375 fVersionExBUsed = id->GetVersion();
1376 fSubVersionExBUsed = id->GetSubVersion();
709b13d5 1377 //printf("Version %d and subversion %d\n",fVersionExBUsed,fSubVersionExBUsed);
a2a4ec8e 1378 }
1379 }
1380
1381 //printf("VersionGain %d, SubversionGain %d, VersionLocalGain %d, Subversionlocalgain %d, Versionvdrift %d, Subversionvdrift %d\n",fVersionGainUsed,fSubVersionGainUsed,fVersionGainLocalUsed,fSubVersionGainLocalUsed,fVersionVdriftUsed,fSubVersionVdriftUsed);
1382
1383 // Check
d085ba91 1384 if((fFirstRunGain < 0) ||
1385 (fFirstRunGainLocal < 0) ||
1386 (fFirstRunVdrift < 0) ||
1387 (fVersionGainUsed < 0) ||
1388 (fVersionGainLocalUsed < 0) ||
1389 (fSubVersionGainUsed < 0) ||
1390 (fSubVersionGainLocalUsed < 0) ||
1391 (fVersionVdriftUsed < 0) ||
1392 (fSubVersionVdriftUsed < 0)) {
a2a4ec8e 1393 AliError("No recent calibration found");
1394 return kFALSE;
1395 }
1396 else return kTRUE;
1397
1398}
c1105918 1399//_________________________________________________________________________________________________________________________
1400Bool_t AliTRDCalibTask::ParticleGood(int i) const {
1401
1402 //
1403 // Definition of good tracks
1404 //
1405
1406
1407 AliESDtrack *track = fESD->GetTrack(i);
1408 if (!track->IsOn(AliESDtrack::kTPCrefit)) return 0; // TPC refit
1409 if (track->GetTPCNcls() < 90) return 0; // number of TPC clusters
1410 if (fabs(track->Eta())>0.8) return 0; // fiducial pseudorapidity
1411 Float_t r,z;
1412 track->GetImpactParametersTPC(r,z);
1413 if (fabs(z)>2.0) return 0; // impact parameter in z
1414 if (fabs(r)>2.0) return 0; // impact parameter in xy
1415 if (r==0) return 0;
1416 return 1;
1417
1418
1419}
54f2ff1c 1420//______________________________________________________________________________________________________________________
1421Bool_t AliTRDCalibTask::FindP1TrackPHtrackletV1Test(const AliTRDseedV1 *tracklet, Int_t nbclusters)
1422{
1423 //
1424 // Drift velocity calibration:
1425 // Fit the clusters with a straight line
1426 // From the slope find the drift velocity
1427 //
1428
1429 ////////////////////////////////////////////////
1430 //Number of points: if less than 3 return kFALSE
1431 /////////////////////////////////////////////////
1432 if(nbclusters <= 2) return kFALSE;
1433
1434 ////////////
1435 //Variables
1436 ////////////
1437 // results of the linear fit
1438 Double_t dydt = 0.0; // dydt tracklet after straight line fit
1439 Double_t errorpar = 0.0; // error after straight line fit on dy/dt
1440 Double_t pointError = 0.0; // error after straight line fit
1441 // pad row problemes: avoid tracklet that cross pad rows, tilting angle in the constant
1442 Int_t crossrow = 0; // if it crosses a pad row
1443 Int_t rowp = -1; // if it crosses a pad row
1444 Float_t tnt = tracklet->GetTilt(); // tan tiltingangle
1445 TLinearFitter linearFitterTracklet(2,"pol1");
1446 linearFitterTracklet.StoreData(kTRUE);
1447
1448
1449 ///////////////////////////////////////////
1450 // Take the parameters of the track
1451 //////////////////////////////////////////
1452 // take now the snp, tnp and tgl from the track
1453 Double_t snp = tracklet->GetSnp(); // sin dy/dx at the end of the chamber
1454 Double_t tnp = 0.0; // dy/dx at the end of the chamber
1455 if( TMath::Abs(snp) < 1.){
1456 tnp = snp / TMath::Sqrt((1.-snp)*(1.+snp));
1457 }
1458 Double_t tgl = tracklet->GetTgl(); // dz/dl
1459 Double_t dzdx = tgl*TMath::Sqrt(1+tnp*tnp); // dz/dx calculated from dz/dl
1460 // at the entrance
1461 //Double_t tnp = tracklet->GetYref(1); // dy/dx at the entrance of the chamber
1462 //Double_t tgl = tracklet->GetZref(1); // dz/dl at the entrance of the chamber
1463 //Double_t dzdx = tgl; //*TMath::Sqrt(1+tnp*tnp); // dz/dx from dz/dl
1464 // at the end with correction due to linear fit
1465 //Double_t tnp = tracklet->GetYfit(1); // dy/dx at the end of the chamber after fit correction
1466 //Double_t tgl = tracklet->GetZfit(1); // dz/dl at the end of the chamber after fit correction
1467
1468
1469 ////////////////////////////
1470 // loop over the clusters
1471 ////////////////////////////
1472 Int_t nbli = 0;
1473 AliTRDcluster *cl = 0x0;
1474 //////////////////////////////
1475 // Check no shared clusters
1476 //////////////////////////////
1477 for(int icc=AliTRDseedV1::kNtb; icc<AliTRDseedV1::kNclusters; icc++){
1478 cl = tracklet->GetClusters(icc);
1479 if(cl) crossrow = 1;
1480 }
1481 //////////////////////////////////
1482 // Loop clusters
1483 //////////////////////////////////
1484 for(int ic=0; ic<AliTRDseedV1::kNtb; ic++){
1485 if(!(cl = tracklet->GetClusters(ic))) continue;
1486 //if((fLimitChargeIntegration) && (!cl->IsInChamber())) continue;
1487
1488 Double_t ycluster = cl->GetY();
1489 Int_t time = cl->GetPadTime();
1490 Double_t timeis = time/10.0;
1491 //See if cross two pad rows
1492 Int_t row = cl->GetPadRow();
1493 if(rowp==-1) rowp = row;
1494 if(row != rowp) crossrow = 1;
c1105918 1495
54f2ff1c 1496 linearFitterTracklet.AddPoint(&timeis,ycluster,1);
1497 nbli++;
a2a4ec8e 1498
54f2ff1c 1499
1500 }
1501
1502 ////////////////////////////////////
1503 // Do the straight line fit now
1504 ///////////////////////////////////
1505 if(nbli <= 2){
1506 linearFitterTracklet.ClearPoints();
1507 return kFALSE;
1508 }
1509 TVectorD pars;
1510 linearFitterTracklet.Eval();
1511 linearFitterTracklet.GetParameters(pars);
1512 pointError = TMath::Sqrt(linearFitterTracklet.GetChisquare()/(nbli-2));
1513 errorpar = linearFitterTracklet.GetParError(1)*pointError;
1514 dydt = pars[1];
1515 //printf("chis %f, nbli %d, pointError %f, parError %f, errorpar %f\n",linearFitterTracklet->GetChisquare(),nbli,pointError,linearFitterTracklet->GetParError(1),errorpar);
1516 linearFitterTracklet.ClearPoints();
1517
1518 /////////////////////////
1519 // Cuts quality
1520 ////////////////////////
1521
1522 if(nbclusters < fLow) return kFALSE;
1523 if(nbclusters > fHigh) return kFALSE;
1524 if(pointError >= 0.3) return kFALSE;
1525 if(crossrow == 1) return kTRUE;
1526
1527 ///////////////////////
1528 // Fill
1529 //////////////////////
1530
1531 if(fDebug > 0){
1532 //Add to the linear fitter of the detector
1533 if( TMath::Abs(snp) < 1.){
1534 Double_t x = tnp-dzdx*tnt;
1535 //if(!fLinearVdriftTest) printf("Not there\n");
1536 Double_t nbentries = fLinearVdriftTest->GetEntries();
1537 if(nbentries < (5.0*32767)) fLinearVdriftTest->Fill(x,dydt);
1538 }
1539 }
1540
1541 return kTRUE;
1542}
01239968 1543