correcting compilation errors in test macro
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibTime.cxx
CommitLineData
c74c5f6c 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 Comments to be written here:
18 1. What do we calibrate.
19
20Time dependence of gain and drift velocity in order to account for changes in: temperature, pressure, gas composition.
21
22 AliTPCcalibTime *calibTime = new AliTPCcalibTime("cosmicTime","cosmicTime",0, 1213.9e+06, 1213.96e+06, 0.04e+04, 0.04e+04);
23
24
25 2. How to interpret results
26 3. Simple example
27
28a.) determine the required time range:
29
30AliXRDPROOFtoolkit tool;
31TChain * chain = tool.MakeChain("pass2.txt","esdTree",0,6000);
32chain->Draw("GetTimeStamp()")
33
34b) analyse calibration object on Proof in calibration train
35
36AliTPCcalibTime *calibTime = new AliTPCcalibTime("cosmicTime","cosmicTime", StartTimeStamp, EndTimeStamp, IntegrationTimeVdrift, IntegrationTimeDeDx);
57dc06f2 37s
c74c5f6c 38c) plot results
39
40TFile f("CalibObjects.root");
828383be 41AliTPCcalibTime *cal = (AliTPCcalibTime *)f->Get("TPCCalib")->FindObject("cosmicTime");
c74c5f6c 42cal->GetHistVdrift()->Projection(1,0)->Draw()
43
44 4. Analysis using debug streamers.
45
da6c0bc9 46 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
47 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
48 AliXRDPROOFtoolkit tool;
49 TChain * chainTime = tool.MakeChain("time.txt","timeInfo",0,10200);
50 chainTime->Lookup();
51
52
c74c5f6c 53*/
54
55
56#include "Riostream.h"
57#include "TChain.h"
58#include "TTree.h"
59#include "TH1F.h"
60#include "TH2F.h"
61#include "TH3F.h"
62#include "THnSparse.h"
63#include "TList.h"
64#include "TMath.h"
65#include "TCanvas.h"
66#include "TFile.h"
67#include "TF1.h"
68#include "TVectorD.h"
69#include "TProfile.h"
70#include "TGraphErrors.h"
71#include "TCanvas.h"
72
73#include "AliTPCclusterMI.h"
74#include "AliTPCseed.h"
75#include "AliESDVertex.h"
76#include "AliESDEvent.h"
77#include "AliESDfriend.h"
78#include "AliESDInputHandler.h"
79#include "AliAnalysisManager.h"
80
81#include "AliTracker.h"
f7a1cc68 82#include "AliMagF.h"
c74c5f6c 83#include "AliTPCCalROC.h"
84
85#include "AliLog.h"
86
87#include "AliTPCcalibTime.h"
88
89#include "TTreeStream.h"
90#include "AliTPCTracklet.h"
da6c0bc9 91#include "TTimeStamp.h"
92#include "AliTPCcalibDB.h"
93#include "AliTPCcalibLaser.h"
31aa7c5c 94#include "AliDCSSensorArray.h"
95#include "AliDCSSensor.h"
c74c5f6c 96
97ClassImp(AliTPCcalibTime)
98
99
100AliTPCcalibTime::AliTPCcalibTime()
da6c0bc9 101 :AliTPCcalibBase(),
102 fTriggerMask(0),
c74c5f6c 103 fHistDeDxTgl(0),
104 fHistDeDx(0),
105 fHistVdrift(0),
106 fIntegrationTimeDeDx(0),
da6c0bc9 107 fIntegrationTimeVdrift(0),
108 fLaser(0), // pointer to laser calibration
109 fDz(0), // current delta z
110 fdEdx(0), // current dEdx
111 fdEdxRatio(0), // current dEdx ratio
112 fTl(0), // current tan(lambda)
c74c5f6c 113 fCutMaxD(5), // maximal distance in rfi ditection
da6c0bc9 114 fCutMaxDz(20), // maximal distance in rfi ditection
c74c5f6c 115 fCutTheta(0.03), // maximal distan theta
116 fCutMinDir(-0.99) // direction vector products
117
118{
119 AliInfo("Default Constructor");
120}
121
122
123AliTPCcalibTime::AliTPCcalibTime(const Text_t *name, const Text_t *title, ULong64_t TriggerMask, UInt_t StartTime, UInt_t EndTime, Int_t deltaIntegrationTimeDeDx, Int_t deltaIntegrationTimeVdrift)
124 :AliTPCcalibBase(),
125 fTriggerMask(0),
126 fHistDeDxTgl(0),
127 fHistDeDx(0),
128 fHistVdrift(0),
129 fIntegrationTimeDeDx(0),
da6c0bc9 130 fIntegrationTimeVdrift(0),
131 fLaser(0), // pointer to laser calibration
132 fDz(0), // current delta z
133 fdEdx(0), // current dEdx
134 fdEdxRatio(0), // current dEdx ratio
135 fTl(0), // current tan(lambda)
c74c5f6c 136 fCutMaxD(5), // maximal distance in rfi ditection
da6c0bc9 137 fCutMaxDz(20), // maximal distance in rfi ditection
c74c5f6c 138 fCutTheta(0.03), // maximal distan theta
139 fCutMinDir(-0.99) // direction vector products
140{
141
142 SetName(name);
143 SetTitle(title);
144
145 AliInfo("Non Default Constructor");
146
147 fTriggerMask = TriggerMask;
148
149 fIntegrationTimeDeDx = deltaIntegrationTimeDeDx;
150 fIntegrationTimeVdrift = deltaIntegrationTimeVdrift;
151
152 Double_t deltaTime = EndTime - StartTime;
153
828383be 154 Int_t binsVdrift[2] = {TMath::Nint(deltaTime/deltaIntegrationTimeVdrift), 100};
c74c5f6c 155 Double_t xminVdrift[2] = {StartTime, -20};
156 Double_t xmaxVdrift[2] = {EndTime, 20};
157 fHistVdrift = new THnSparseF("HistVdrift","vDrift; time;#Delta z",2,binsVdrift,xminVdrift,xmaxVdrift);
158
828383be 159 Int_t binsDeDxTgl[3] = {TMath::Nint(deltaTime/deltaIntegrationTimeDeDx),30,100};
c74c5f6c 160 Double_t xminDeDxTgl[3] = {StartTime,-1,0.7};
161 Double_t xmaxDeDxTgl[3] = {EndTime,1,1.3};
162 fHistDeDxTgl = new THnSparseF("HistDeDxTgl","dEdx vs tgl;time;tgl;dEdxUp/dEdxLow",3,binsDeDxTgl,xminDeDxTgl,xmaxDeDxTgl);
163
0ffd2ae1 164 Int_t binsDeDx[2] = {TMath::Nint(deltaTime/deltaIntegrationTimeDeDx),100};
c74c5f6c 165 Double_t xminDeDx[2] = {StartTime,1};
166 Double_t xmaxDeDx[2] = {EndTime,100};
167 fHistDeDx = new THnSparseF("HistDeDx","dEdx l;time;dEdx",2,binsDeDx,xminDeDx,xmaxDeDx);
168
169}
170
171
172
173AliTPCcalibTime::~AliTPCcalibTime(){
174 //
175 //
176 //
177}
da6c0bc9 178void AliTPCcalibTime::ResetCurrent(){
179 //
180 // reset current values
181 //
182 fDz=0; // current delta z
183 fdEdx=0; // current dEdx
184 fdEdxRatio=0; // current dEdx ratio
185 fTl=0; // current tan(lambda)
186
187}
188
c74c5f6c 189
190void AliTPCcalibTime::Process(AliESDEvent *event) {
191 //
192 //
193 //
da6c0bc9 194 Int_t ntracks=event->GetNumberOfTracks();
195 if (ntracks<2) return;
196 ResetCurrent();
197 //
c74c5f6c 198 ProcessCosmic(event);
da6c0bc9 199 if (fTrigger==16){
200 if (!fLaser) fLaser = new AliTPCcalibLaser("laserTPC","laserTPC",kFALSE);
201 fLaser->Process(event);
202 }
203 //
204 // fill debug streamer
205 if (fStreamLevel>0 && fDz!=0){
206 TTreeSRedirector *cstream = GetDebugStreamer();
207 if (cstream){
208 TTimeStamp tstamp(fTime);
209 Float_t valuePressure0 = AliTPCcalibDB::GetPressure(tstamp,fRun,0);
210 Float_t valuePressure1 = AliTPCcalibDB::GetPressure(tstamp,fRun,1);
211 Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,0);
212 Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,1);
213 Double_t temp0 = AliTPCcalibDB::GetTemperature(tstamp,fRun,0);
214 Double_t temp1 = AliTPCcalibDB::GetTemperature(tstamp,fRun,1);
31aa7c5c 215 TVectorD vecGoofie(20);
216 AliDCSSensorArray* goofieArray = AliTPCcalibDB::Instance()->GetGoofieSensors(fRun);
217 if (goofieArray)
218 for (Int_t isensor=0; isensor<goofieArray->NumSensors();isensor++){
219 AliDCSSensor *gsensor = goofieArray->GetSensor(isensor);
220 if (gsensor) vecGoofie[isensor]=gsensor->GetValue(tstamp);
221 }
222
da6c0bc9 223 TVectorD vdriftA, vdriftC,vdriftAC;
224 if (fLaser && fTrigger==16) {
225 if (fLaser->fFitAside) vdriftA=*(fLaser->fFitAside);
226 if (fLaser->fFitCside) vdriftC=*(fLaser->fFitCside);
227 if (fLaser->fFitACside) vdriftAC=*(fLaser->fFitACside);
228 }
229 (*cstream)<<"timeInfo"<<
230 "run="<<fRun<< // run number
231 "event="<<fEvent<< // event number
232 "time="<<fTime<< // time stamp of event
233 "trigger="<<fTrigger<< // trigger
234 "mag="<<fMagF<< // magnetic field
235 // Environment values
236 "press0="<<valuePressure0<<
237 "press1="<<valuePressure1<<
238 "pt0="<<ptrelative0<<
239 "pt1="<<ptrelative1<<
240 "temp0="<<temp0<<
241 "temp1="<<temp1<<
31aa7c5c 242 "vecGoofie.=<<"<<&vecGoofie<<
da6c0bc9 243 //
244 // accumulated values
245 //
246 "fDz="<<fDz<< //! current delta z
247 "fdEdx="<<fdEdx<< //! current dEdx
248 "fdEdxRatio="<<fdEdxRatio<< //! current dEdx ratio
249 "fTl="<<fTl<< //! current tan(lambda)
250 //
251 //laser
252 //
253 "laserA.="<<&vdriftA<<
254 "laserC.="<<&vdriftC<<
255 "laserAC.="<<&vdriftAC<<
256 "\n";
257 }
258 }
c74c5f6c 259}
260
261
262
263void AliTPCcalibTime::ProcessCosmic(AliESDEvent *event) {
264
265 if (!event) {
266 Printf("ERROR: ESD not available");
267 return;
268 }
269 if (event->GetTimeStamp() == 0 ) {
270 Printf("no time stamp!");
271 return;
272 }
273
274 if (fTriggerMask != 0 && event->GetTriggerMask() != fTriggerMask) return;
275
276 UInt_t time = event->GetTimeStamp();
277
278 //
279 // Find cosmic pairs
280 //
281 // Track0 is choosen in upper TPC part
282 // Track1 is choosen in lower TPC part
283 //
284 Int_t ntracks=event->GetNumberOfTracks();
285 if (ntracks==0) return;
286 if (ntracks > 10) return; // temporary debug to remove LASER events
287
288
289 if (GetDebugLevel()>1) printf("Hallo world: Im here\n");
290 AliESDfriend *ESDfriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
291
292 TObjArray tpcSeeds(ntracks);
293 Double_t vtxx[3]={0,0,0};
294 Double_t svtxx[3]={0.000001,0.000001,100.};
295 AliESDVertex vtx(vtxx,svtxx);
296 //
297 // track loop
298 //
299 for (Int_t i=0;i<ntracks;++i) {
300 AliESDtrack *track = event->GetTrack(i);
301
302 const AliExternalTrackParam * trackIn = track->GetInnerParam();
303 const AliExternalTrackParam * trackOut = track->GetOuterParam();
304 if (!trackIn) continue;
305 if (!trackOut) continue;
306
307 AliESDfriendTrack *friendTrack = ESDfriend->GetTrack(i);
308 TObject *calibObject;
309 AliTPCseed *seed = 0;
310 for (Int_t l=0;(calibObject=friendTrack->GetCalibObject(l));++l) {
311 if ((seed=dynamic_cast<AliTPCseed*>(calibObject))) break;
312 }
313 if (seed) {
314 tpcSeeds.AddAt(seed,i);
315 if (track->GetTPCNcls() > 50) {
316 Double_t meanP = 0.5*(trackIn->GetP() + trackOut->GetP());
317 Double_t TPCsignal = seed->CookdEdxNorm(0.0,0.6,1,0,159,0x0,kTRUE,kTRUE);
318 Double_t vecDeDx[2] = {time, TPCsignal};
da6c0bc9 319 if (meanP > 12) {
320 fdEdx = TPCsignal;
321 fHistDeDx->Fill(vecDeDx);
322 }
c74c5f6c 323 }
324 }
325 }
326
327 if (ntracks<2) return;
328 //
329 // Find pairs
330 //
331 for (Int_t i=0;i<ntracks;++i) {
332 AliESDtrack *track0 = event->GetTrack(i);
333 // track0 - choosen upper part
334 if (!track0) continue;
335 if (!track0->GetOuterParam()) continue;
336 if (track0->GetOuterParam()->GetAlpha()<0) continue;
337 Double_t d1[3];
338 track0->GetDirection(d1);
339 for (Int_t j=0;j<ntracks;++j) {
340 if (i==j) continue;
341 AliESDtrack *track1 = event->GetTrack(j);
342 //track 1 lower part
343 if (!track1) continue;
344 if (!track1->GetOuterParam()) continue;
345 if (track1->GetOuterParam()->GetAlpha()>0) continue;
346 //
347 Double_t d2[3];
348 track1->GetDirection(d2);
349
350 AliTPCseed * seed0 = (AliTPCseed*) tpcSeeds.At(i);
351 AliTPCseed * seed1 = (AliTPCseed*) tpcSeeds.At(j);
352 if (! seed0) continue;
353 if (! seed1) continue;
354 Float_t dir = (d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2]);
57dc06f2 355 Float_t dist0 = track0->GetLinearD(0,0);
356 Float_t dist1 = track1->GetLinearD(0,0);
c74c5f6c 357 //
358 // conservative cuts - convergence to be guarantied
359 // applying before track propagation
57dc06f2 360 if (TMath::Abs(dist0+dist1)>fCutMaxD) continue; // distance to the 0,0
c74c5f6c 361 if (dir>fCutMinDir) continue; // direction vector product
362 Float_t bz = AliTracker::GetBz();
363 Float_t dvertex0[2]; //distance to 0,0
364 Float_t dvertex1[2]; //distance to 0,0
365 track0->GetDZ(0,0,0,bz,dvertex0);
366 track1->GetDZ(0,0,0,bz,dvertex1);
367 if (TMath::Abs(dvertex0[1])>250) continue;
368 if (TMath::Abs(dvertex1[1])>250) continue;
369 //
370 //
371 //
57dc06f2 372 Float_t dmax = TMath::Max(TMath::Abs(dist0),TMath::Abs(dist1));
c74c5f6c 373 AliExternalTrackParam param0(*track0);
374 AliExternalTrackParam param1(*track1);
375 //
376 // Propagate using Magnetic field and correct fo material budget
377 //
378 AliTracker::PropagateTrackTo(&param0,dmax+1,0.0005,3,kTRUE);
379 AliTracker::PropagateTrackTo(&param1,dmax+1,0.0005,3,kTRUE);
380 //
381 // Propagate rest to the 0,0 DCA - z should be ignored
382 //
828383be 383 //Bool_t b0 = ;
384 param0.PropagateToDCA(&vtx,bz,1000);
385 //Bool_t b1 =
386 param1.PropagateToDCA(&vtx,bz,1000);
c74c5f6c 387 //
388 param0.GetDZ(0,0,0,bz,dvertex0);
389 param1.GetDZ(0,0,0,bz,dvertex1);
390 //
391 Double_t xyz0[3];//,pxyz0[3];
392 Double_t xyz1[3];//,pxyz1[3];
393 param0.GetXYZ(xyz0);
394 param1.GetXYZ(xyz1);
395 Bool_t isPair = IsPair(&param0,&param1);
396
397 Double_t z0 = track0->GetOuterParam()->GetZ();
398 Double_t z1 = track1->GetOuterParam()->GetZ();
399
400 Double_t z0inner = track0->GetInnerParam()->GetZ();
401 Double_t z1inner = track1->GetInnerParam()->GetZ();
402
403 if (isPair && z0>0 && z0inner>0 && z1<0 && z1inner<0) {
404 Double_t vecVdrift[2] = {time, param0.GetZ() - param1.GetZ()};
405
da6c0bc9 406 if (track0->GetTPCNcls() > 80) {
407 fHistVdrift->Fill(vecVdrift);
408 fDz = param0.GetZ() - param1.GetZ();
409 }
c74c5f6c 410 }
411 if (isPair && z0 > 0 && z1 > 0) {
412 if (track1->GetTPCNcls()> 110 && track0->GetTPCNcls()> 110 && seed1->CookdEdxNorm(0,0.6,1,0,159,0,kFALSE,kTRUE) > 0) {
da6c0bc9 413 Float_t dedxratio = seed0->CookdEdxNorm(0,0.6,1,0,159,0,kFALSE,kTRUE)/seed1->CookdEdxNorm(0,0.6,1,0,159,0,kFALSE,kTRUE);
c74c5f6c 414 Double_t vecDeDxTgl[3] = {time, track0->GetTgl(), seed0->CookdEdxNorm(0,0.6,1,0,159,0,kFALSE,kTRUE)/seed1->CookdEdxNorm(0,0.6,1,0,159,0,kFALSE,kTRUE)};
415 fHistDeDxTgl->Fill(vecDeDxTgl);
da6c0bc9 416 fdEdxRatio = dedxratio;
417 fTl = track0->GetTgl() ;
c74c5f6c 418 }
419 }
420
421 } // end 2nd order loop
422 } // end 1st order loop
423
424}
425
426
427void AliTPCcalibTime::Analyze() {
828383be 428 //
429 //
430 //
c74c5f6c 431 TH2D * hVdrift = GetHistVdrift()->Projection(1,0);
0ffd2ae1 432 hVdrift->Draw();
c74c5f6c 433}
434
435
436Long64_t AliTPCcalibTime::Merge(TCollection *li) {
437
438 TIterator* iter = li->MakeIterator();
439 AliTPCcalibTime* cal = 0;
440
441 while ((cal = (AliTPCcalibTime*)iter->Next())) {
442 if (!cal->InheritsFrom(AliTPCcalibTime::Class())) {
443 Error("Merge","Attempt to add object of class %s to a %s", cal->ClassName(), this->ClassName());
444 return -1;
445 }
446
447 // add histograms here...
448 fHistDeDxTgl->Add(cal->GetHistDeDxVsTgl());
449 fHistVdrift->Add(cal->GetHistVdrift());
450 fHistDeDx->Add(cal->GetHistDeDx());
451
452 }
453
454 return 0;
455
456}
457
458
459
460Bool_t AliTPCcalibTime::IsPair(AliExternalTrackParam *tr0, AliExternalTrackParam *tr1){
461 //
462 //
463 /*
464 // 0. Same direction - OPOSITE - cutDir +cutT
465 TCut cutDir("cutDir","dir<-0.99")
466 // 1.
467 TCut cutT("cutT","abs(Tr1.fP[3]+Tr0.fP[3])<0.03")
468 //
469 // 2. The same rphi
470 TCut cutD("cutD","abs(Tr0.fP[0]+Tr1.fP[0])<5")
471 //
472 //
473 //
474 TCut cutPt("cutPt","abs(Tr1.fP[4]+Tr0.fP[4])<1&&abs(Tr0.fP[4])+abs(Tr1.fP[4])<10");
475 // 1/Pt diff cut
476 */
477 const Double_t *p0 = tr0->GetParameter();
478 const Double_t *p1 = tr1->GetParameter();
479 if (TMath::Abs(p0[3]+p1[3])>fCutTheta) return kFALSE;
480 if (TMath::Abs(p0[0]+p1[0])>fCutMaxD) return kFALSE;
da6c0bc9 481 if (TMath::Abs(p0[1]-p1[1])>fCutMaxDz) return kFALSE;
c74c5f6c 482 Double_t d0[3], d1[3];
483 tr0->GetDirection(d0);
484 tr1->GetDirection(d1);
485 if (d0[0]*d1[0] + d0[1]*d1[1] + d0[2]*d1[2] >fCutMinDir) return kFALSE;
486 //
487 return kTRUE;
488}
31aa7c5c 489
490
491
492/*
493 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
494 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
495 AliXRDPROOFtoolkit tool;
496 TChain * chainTime = tool.MakeChain("time.txt","timeInfo",0,10200);
497 chainTime->Lookup();
498
499TCut dzc("abs(fDz-500*(1-pt1))<4")
500chainTime->SetMarkerSize(0.2);
501chainTime->SetMarkerStyle(24);
502
503
504chainTime->SetMarkerColor(2);
505chainTime->Draw("fDz:time","trigger==4"+dzc);
506chainTime->SetMarkerColor(1);
507chainTime->Draw("fDz:time","trigger==8"+dzc,"same");
508htemp->SetXTitle("time")
509htemp->SetYTitle("#Delta_{z}(cm)")
510gPad->SaveAs("~/Calibration/driftV/pic/cosmicdzraw_time.gif");
511
512
513chainTime->SetMarkerColor(2);
514chainTime->Draw("fDz:500*(1-pt1)","trigger==4"+dzc);
515chainTime->SetMarkerColor(1);
516chainTime->Draw("fDz:500*(1-pt1)","trigger==8"+dzc,"same");
517htemp->SetXTitle("2L#frac{#Delta_{P/T}}{P/T}")
518htemp->SetYTitle("#Delta_{z}(cm)")
519gPad->SaveAs("~/Calibration/driftV/pic/cosmicdzraw_PT1.gif");
520
521
522
523
524chainTime->SetLineColor(2);
525chainTime->Draw("fDz-500*0.965*(1-pt1)","trigger==4"+dzc);
526chainTime->SetLineColor(1);
527chainTime->Draw("fDz-500*0.965*(1-pt1)","trigger==8"+dzc,"same");
528htemp->SetXTitle("#Delta_{z}(cm)")
529htemp->SetYTitle("")
530gPad->SaveAs("~/Calibration/driftV/pic/cosmicdzcorr_1D.gif");
531
532
533chainTime->SetMarkerColor(2);
534chainTime->Draw("fDz-500*0.965*(1-pt1):time","trigger==4"+dzc);
535chainTime->SetMarkerColor(1);
536chainTime->Draw("fDz-500*0.965*(1-pt1):time","trigger==8"+dzc,"same");
537htemp->SetXTitle("time")
538htemp->SetYTitle("#Delta_{z}(cm)")
539gPad->SaveAs("~/Calibration/driftV/pic/cosmicdzcorr_time.gif");
540
541
542
543gSystem->Load("libSTAT.so");
544TStatToolkit toolkit;
545Double_t chi2=0;
546Int_t npoints=0;
547TVectorD fitParam;
548TMatrixD covMatrix;
549
550
551chainTime->SetAlias("dpr","(1-press0/970)");
552chainTime->SetAlias("dtr","(1-(temp0+273.15)/293.)");
553chainTime->SetAlias("d1pt","(1-(temp0+273.15)/293.)");
554chainTime->SetAlias("dptr","(press0/(273.15+temp0))/(970./293.15)");
555
556
557chainTime->SetAlias("dvr","fDz");
558TString *strvd = toolkit.FitPlane(chainTime,"fDz","dpr*500++dtr*500", "trigger==4"+dzc, chi2,npoints,fitParam,covMatrix,0.99);
559strvd.Tokenize("++")->Print();
560chainTime->SetAlias("vdcorr",strvd->Data());
561
562TString *strvdpt1 = toolkit.FitPlane(chainTime,"fDz","(1-dptr)*500", "trigger==4"+dzc, chi2,npoints,fitParam,covMatrix,0.99);
563strvdpt1.Tokenize("++")->Print();
564chainTime->SetAlias("vdcorrpt1",strvdpt1->Data());
565
566
567TString *strdedx = toolkit.FitPlane(chainTime,"1-fdEdx/27","(1-dptr)", "trigger==4&&run<62000"+dzc, chi2,npoints,fitParam,covMatrix,0.99);
568strdedx.Tokenize("++")->Print();
569chainTime->SetAlias("vdcorrpt1",strvdpt1->Data());
570
571*/