.x ~/NimStyle.C
gSystem->Load("libANALYSIS");
gSystem->Load("libTPCcalib");
- TFile fcalib("CalibObjects.root");
- TObjArray * array = (TObjArray*)fcalib.Get("TPCCalib");
- AliTPCcalibLaser * laser = ( AliTPCcalibLaser *)array->FindObject("laserTPC");
- laser->DumpMeanInfo(-0,0)
+ TFile fcalib("CalibObjectsTrain2.root");
+ AliTPCcalibLaser * laser = ( AliTPCcalibLaser *)fcalib->Get("laserTPC");
+ laser->DumpMeanInfo(run)
TFile fmean("laserMean.root")
//
// laser track clasification;
//
TCut cutT("cutT","abs(Tr.fP[3])<0.06");
- TCut cutPt("cutPt","abs(Tr.fP[4])<0.1");
TCut cutN("cutN","fTPCncls>70");
TCut cutP("cutP","abs(atan2(x1,x0)-atan2(lx1,lx0))<0.03")
TCut cutA = cutT+cutPt+cutP;
gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
AliXRDPROOFtoolkit tool;
- TChain * chainDrift = tool.MakeChain("laser.txt","driftv",0,10200);
+ AliXRDPROOFtoolkit::FilterList("laserDebug.list","* driftvN",1)
+ TChain * chainDrift = tool.MakeChainRandom("laser.txt.Good","driftv",0,50);
chainDrift->Lookup();
+ TChain * chainDriftN = tool.MakeChainRandom("laserDebug.list.Good","driftvN",0,300);
+ chainDriftN->Lookup();
+
TChain * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
chain->Lookup();
TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
chainFit->Lookup();
+ TChain * chainTrack = tool.MakeChainRandom("laser.txt","Track",0,30);
+ chainTrack->Lookup();
*/
#include "TH2F.h"
#include "TStatToolkit.h"
#include "TROOT.h"
+#include "TDatabasePDG.h"
#include "TTreeStream.h"
#include "AliTPCLaserTrack.h"
#include "AliTPCcalibDB.h"
#include "AliTPCParam.h"
+#include "AliTPCParamSR.h"
#include "TTimeStamp.h"
#include "AliDCSSensorArray.h"
#include "AliDCSSensor.h"
+#include "AliGRPObject.h"
using namespace std;
fDeltaZres(336), //->2D histo fo residuals
fDeltaYres2(336), //->2D histo of residuals
fDeltaZres2(336), //->2D histo fo residuals
- fDeltaYresAbs(336), //->2D histo of residuals
- fDeltaZresAbs(336), //->2D histo of residuals
+ fDeltaYresAbs(336), //->2D histo of residuals
+ fHisYAbsErrors(0), //-> total errors per beam in the abs res y analysis
+ fDeltaZresAbs(336), //->2D histo of residuals
+ fHisZAbsErrors(0), //-> total errors per beam in the abs res z analysis
//fDeltaYres3(336), //->2D histo of residuals
//fDeltaZres3(336), //->2D histo fo residuals
fFitAside(new TVectorD(5)),
fBeamSlopeZOuter(336),
fBeamOffsetZInner(336),
fBeamSlopeZInner(336),
- fInverseSlopeZ(kTRUE)
+ fInverseSlopeZ(kTRUE),
+ fUseFixedDriftV(0),
+ fFixedFitAside0(0.0),
+ fFixedFitAside1(1.0),
+ fFixedFitCside0(0.0),
+ fFixedFitCside1(1.0)
{
//
// Constructor
fDeltaYres2(336),
fDeltaZres2(336),
fDeltaYresAbs(336),
+ fHisYAbsErrors(0),
fDeltaZresAbs(336),
+ fHisZAbsErrors(0),
// fDeltaYres3(336),
//fDeltaZres3(336),
fFitAside(new TVectorD(5)), // drift fit - A side
fBeamSlopeZOuter(336),
fBeamOffsetZInner(336),
fBeamSlopeZInner(336),
- fInverseSlopeZ(kTRUE)
+ fInverseSlopeZ(kTRUE),
+ fUseFixedDriftV(0),
+ fFixedFitAside0(0.0),
+ fFixedFitAside1(1.0),
+ fFixedFitCside0(0.0),
+ fFixedFitCside1(1.0)
{
SetName(name);
SetTitle(title);
fDeltaYres2(((calibLaser.fDeltaYres))),
fDeltaZres2(((calibLaser.fDeltaZres))),
fDeltaYresAbs(((calibLaser.fDeltaYresAbs))),
+ fHisYAbsErrors(new TH1F(*(calibLaser.fHisYAbsErrors))),
fDeltaZresAbs(((calibLaser.fDeltaZresAbs))),
+ fHisZAbsErrors(new TH1F(*(calibLaser.fHisZAbsErrors))),
// fDeltaYres3(((calibLaser.fDeltaYres))),
//fDeltaZres3(((calibLaser.fDeltaZres))),
fFitAside(new TVectorD(5)), // drift fit - A side
fBeamSlopeZOuter(336),
fBeamOffsetZInner(336),
fBeamSlopeZInner(336),
- fInverseSlopeZ(calibLaser.fInverseSlopeZ)
-
+ fInverseSlopeZ(calibLaser.fInverseSlopeZ),
+ fUseFixedDriftV(calibLaser.fUseFixedDriftV),
+ fFixedFitAside0(calibLaser.fFixedFitAside0),
+ fFixedFitAside1(calibLaser.fFixedFitAside1),
+ fFixedFitCside0(calibLaser.fFixedFitCside0),
+ fFixedFitCside1(calibLaser.fFixedFitCside1)
{
//
// copy constructor
fDeltaYres.SetOwner();
fDeltaYres.Delete();
+ delete fHisYAbsErrors;
fDeltaZres.SetOwner();
fDeltaZres.Delete();
+ delete fHisZAbsErrors;
fDeltaYres2.SetOwner();
fDeltaYres2.Delete();
fDeltaZres2.SetOwner();
//
// Loop over tracks and call Process function
//
- Int_t kMinTracks=20;
+ const Int_t kMinTracks=20;
+ const Int_t kMinClusters=40;
+
fESD = event;
if (!fESD) {
return;
}
if (fESD->GetNumberOfTracks()<kMinTracks) return; //not enough tracks
AliDebug(4,Form("Event number in current file: %d",event->GetEventNumberInFile()));
+ //
+ // find CE background if present
+ //
+ if (AliTPCLaserTrack::GetTracks()==0) AliTPCLaserTrack::LoadTracks();
+ TH1D hisCE("hhisCE","hhisCE",100,-100,100);
+ for (Int_t i=0;i<fESD->GetNumberOfTracks();++i) {
+ AliESDtrack *track=fESD->GetTrack(i);
+ if (!track) continue;
+ hisCE.Fill(track->GetZ());
+ hisCE.Fill(track->GetZ()+2);
+ hisCE.Fill(track->GetZ()-2);
+ }
+ //
+ //
+
+
fTracksTPC.Clear();
fTracksEsd.Clear();
fTracksEsdParam.Delete();
AliESDfriendTrack *friendTrack=fESDfriend->GetTrack(i);
if (!friendTrack) continue;
AliESDtrack *track=fESD->GetTrack(i);
+ Double_t binC = hisCE.GetBinContent(hisCE.FindBin(track->GetZ()));
+ if (binC>336) continue; //remove CE background
TObject *calibObject=0;
AliTPCseed *seed=0;
for (Int_t j=0;(calibObject=friendTrack->GetCalibObject(j));++j)
if ((seed=dynamic_cast<AliTPCseed*>(calibObject)))
break;
- if (track&&seed &&TMath::Abs(track->Pt()) >1 ) {
+ if (track&&seed&&track->GetTPCNcls()>kMinClusters && seed->GetNumberOfClusters() >kMinClusters) {
//filter CE tracks
Int_t id = FindMirror(track,seed);
- if (id>0) counter++;
+ if (id>=0) counter++;
}
//
}
fNtracks=counter;
if (counter<kMinTracks) return;
- FitDriftV();
+ //FitDriftV();
+ FitDriftV(0.2);
if (!fFullCalib) return;
static Bool_t init=kFALSE;
if (!init){
TVectorD fitA(3),fitC(3),fitAC(4);
AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
- AliTPCParam * tpcparam = calib->GetParameters();
-
+ AliTPCParam * tpcparam = calib->GetParameters();
//
for (Int_t id=0; id<336; id++) fFitZ[id]=0;
}
}
}
+Bool_t AliTPCcalibLaser::FitDriftV(Float_t minFraction){
+ //
+ // Fit corrections to the drift velocity - linear approximation in the z and global y
+ //The transfromatiom from the drift time to the z position done in AliTPCTracnsform class
+ //
+ // Source of outlyers :
+ // 0. Track in the saturation - postpeak
+ // 1. gating grid close the part of the signal for first bundle
+
+ // The robust fit is performed in 2 itterations /robust fraction controlled by kFraction/
+ // 1. Robust fit is used in the itteration number 0
+ // only fraction of laser uted
+ // 2. Only the tracks close to the fit used in the second itteration
+ /*
+ Formulas:
+
+ z = s* (z0 - vd*(t-t0))
+
+ s - side -1 and +1
+ t0 - time 0
+ vd - nominal drift velocity
+ zs - miscalibrated position
+
+ zs = s*(z0 - vd*(1+vr)*(t-(t0+dt))
+ vr - relative change of the drift velocity
+ dzt - vd*dt
+ dr = zz0-s*z
+ ..
+ ==>
+ zs ~ z - s*vr*(z0-s*z)+s*dzt
+ --------------------------------
+ 1. Correction function vr constant:
+
+
+ dz = zs-z = -s*vr *(z0-s*z)+s*dzt
+ dzs/dl = dz/dl +s*s*vr*dz/dl
+ d(dz/dl) = vr*dz/dl
+ */
+ const Int_t knLaser = 336; //n laser tracks
+ const Float_t kFraction[2] = {0.70,0.95}; // robust fit fraction
+
+ const Float_t kSaturCut = 0.05; // remove saturated lasers - cut on fraction of saturated
+ const Float_t kDistCut = 3.; // distance sigma cut - 3 sigma
+ const Float_t kDistCutAbs = 1.; // absolute cut 1 cm
+ const Float_t kMinClusters = 40.; // minimal amount of the clusters
+ const Float_t kMinSignal = 2.5; // minimal mean height of the signal
+ const Float_t kChi2Cut = 1.0; // chi2 cut to accept drift fit
+ //
+ static TLinearFitter fdriftA(3,"hyp2");
+ static TLinearFitter fdriftC(3,"hyp2");
+ static TLinearFitter fdriftAC(4,"hyp3");
+ TVectorD fitA(3),fitC(3),fitAC(4);
+
+ AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
+ AliTPCParam * tpcparam = calib->GetParameters();
+ //
+ // reset old data
+ //
+ for (Int_t id=0; id<336; id++) fFitZ[id]=0;
+ if (fFitAside->GetNoElements()<5) fFitAside->ResizeTo(5);
+ if (fFitCside->GetNoElements()<5) fFitCside->ResizeTo(5);
+ for (Int_t i=0;i<5; i++){
+ (*fFitCside)[i]=0;
+ (*fFitAside)[i]=0;
+ }
+ //
+ //
+ Float_t chi2A = 10;
+ Float_t chi2C = 10;
+ Float_t chi2AC = 10;
+ Int_t npointsA=0;
+ Int_t npointsC=0;
+ Int_t npointsAC=0;
+ Int_t nbA[4]={0,0,0,0};
+ Int_t nbC[4]={0,0,0,0};
+ TVectorD vecZM(336); // measured z potion of laser
+ TVectorD vecA(336); // accepted laser
+ TVectorD vecZF(336); // fitted position
+ TVectorD vecDz(336); // deltaZ
+ TVectorD vecZS(336); // surveyed position of laser
+ // additional variable to cut
+ TVectorD vecdEdx(336); // dEdx
+ TVectorD vecSy(336); // shape y
+ TVectorD vecSz(336); // shape z
+ //
+ //
+ for (Int_t id=0; id<336; id++){
+ Int_t reject=0;
+ AliTPCLaserTrack *ltrp =
+ (AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
+ AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
+ AliTPCseed * seed = (AliTPCseed*)fTracksTPC.At(id);
+ vecZM(id)= (param==0) ? 0:param->GetZ();
+ vecZS(id)= ltrp->GetZ();
+ vecDz(id)= 0;
+ vecA(id)=1;
+ vecdEdx(id)=(seed)?seed->GetdEdx():0;
+ vecSy(id) =(seed)?seed->CookShape(1):0;
+ vecSz(id) =(seed)?seed->CookShape(2):0;
+ //
+ fFitZ[id]=0;
+ if (!fTracksEsdParam.At(id)) reject|=1;
+ if (!param) continue;
+ if (!AcceptLaser(id)) reject|=2;
+ if ( fClusterSatur[id]>kSaturCut) reject|=4;
+ if ( fClusterCounter[id]<kMinClusters) reject|=8;
+ vecA(id)=reject;
+ if (reject>0) continue;
+ if (ltrp->GetSide()==0){
+ npointsA++;
+ nbA[ltrp->GetBundle()]++;
+ }
+ if (ltrp->GetSide()==1){
+ npointsC++;
+ nbC[ltrp->GetBundle()]++;
+ }
+ }
+ //
+ // reject "bad events"
+ //
+ Bool_t isOK=kTRUE;
+ Int_t naA=0;
+ Int_t naC=0;
+ if (npointsA<minFraction*0.5*knLaser && npointsC<minFraction*0.5*knLaser)
+ isOK=kFALSE;
+ for (Int_t i=0;i<4;i++){
+ //count accepted for all layers
+ if (nbA[i]>minFraction*0.5*0.25*knLaser) naA++;
+ if (nbC[i]>minFraction*0.5*0.25*knLaser) naC++;
+ }
+ if (naA<3 &&naC<3) isOK=kFALSE;
+ if (isOK==kFALSE) return kFALSE;
+
+ //
+ //
+ //
+ for (Int_t iter=0; iter<2; iter++){
+ fdriftA.ClearPoints();
+ fdriftC.ClearPoints();
+ fdriftAC.ClearPoints();
+ npointsA=0; npointsC=0; npointsAC=0;
+ //
+ for (Int_t id=0; id<336; id++){
+ if (!fTracksEsdParam.At(id)) continue;
+ if (!AcceptLaser(id)) continue;
+ if ( fClusterSatur[id]>kSaturCut) continue;
+ if ( fClusterCounter[id]<kMinClusters) continue;
+ AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
+ if (track->GetTPCsignal()<kMinSignal) continue;
+ AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
+ AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
+ Double_t xyz[3];
+ Double_t pxyz[3];
+ Double_t lxyz[3];
+ Double_t lpxyz[3];
+ param->GetXYZ(xyz);
+ param->GetPxPyPz(pxyz);
+ ltrp->GetXYZ(lxyz);
+ ltrp->GetPxPyPz(lpxyz);
+ Float_t sz = (ltrp->GetSide()==0) ? TMath::Sqrt(chi2A): TMath::Sqrt(chi2C);
+ if (npointsAC>0) sz =TMath::Sqrt(chi2AC);
+ if (iter>0 && TMath::Abs(fFitZ[id])>sz*kDistCut) continue;
+ if (iter>0 && TMath::Abs(fFitZ[id])>kDistCutAbs) continue;
+
+// // drift distance
+// Double_t zlength = tpcparam->GetZLength(0);
+// Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
+// Double_t mdrift = zlength-TMath::Abs(xyz[2]);
+ //
+ Double_t zlength = (ltrp->GetSide()==0)? tpcparam->GetZLength(36): tpcparam->GetZLength(71);
+ Double_t ldrift = (ltrp->GetSide()==0)?zlength-lxyz[2]:lxyz[2]+zlength;
+ Double_t mdrift = (ltrp->GetSide()==0)?zlength-xyz[2]:xyz[2]+zlength;
+
+
+ Double_t xxx[2] = {ldrift,lxyz[1]*ldrift/(zlength*250.)};
+ if (iter==0 &<rp->GetBundle()==0) continue;
+ // skip bundle 0 - can be wrong in the 0 iteration
+ if (ltrp->GetSide()==0){
+ fdriftA.AddPoint(xxx,mdrift,1);
+ }else{
+ fdriftC.AddPoint(xxx,mdrift,1);
+ }
+ Double_t xxx2[3] = {ltrp->GetSide(), ldrift,lxyz[1]*ldrift/(zlength*250.)};
+ fdriftAC.AddPoint(xxx2,mdrift,1);
+ }
+ //
+ if (fdriftA.GetNpoints()>minFraction*0.5*knLaser){
+ //
+ fdriftA.Eval();
+ npointsA= fdriftA.GetNpoints();
+ chi2A = fdriftA.GetChisquare()/fdriftA.GetNpoints();
+ fdriftA.EvalRobust(kFraction[iter]);
+ fdriftA.GetParameters(fitA);
+ if (chi2A<kChi2Cut ||(*fFitAside)[0]==0 ) {
+ if (fFitAside->GetNoElements()<5) fFitAside->ResizeTo(5);
+ (*fFitAside)[0] = fitA[0];
+ (*fFitAside)[1] = fitA[1];
+ (*fFitAside)[2] = fitA[2];
+ (*fFitAside)[3] = fdriftA.GetNpoints();
+ (*fFitAside)[4] = chi2A;
+ }
+ }
+ if (fdriftC.GetNpoints()>minFraction*0.5*knLaser){
+ fdriftC.Eval();
+ npointsC= fdriftC.GetNpoints();
+ chi2C = fdriftC.GetChisquare()/fdriftC.GetNpoints();
+ fdriftC.EvalRobust(kFraction[iter]);
+ fdriftC.GetParameters(fitC);
+ if (chi2C<kChi2Cut||(*fFitCside)[0]==0) {
+ if (fFitCside->GetNoElements()<5) fFitCside->ResizeTo(5);
+ (*fFitCside)[0] = fitC[0];
+ (*fFitCside)[1] = fitC[1];
+ (*fFitCside)[2] = fitC[2];
+ (*fFitCside)[3] = fdriftC.GetNpoints();
+ (*fFitCside)[4] = chi2C;
+ }
+ }
+
+ if (fdriftAC.GetNpoints()>minFraction*knLaser &&npointsA>0.5*minFraction*knLaser&&npointsC>0.5*minFraction*knLaser){
+ fdriftAC.Eval();
+ npointsAC= fdriftAC.GetNpoints();
+ chi2AC = fdriftAC.GetChisquare()/fdriftAC.GetNpoints();
+ fdriftAC.EvalRobust(kFraction[iter]);
+ fdriftAC.GetParameters(fitAC);
+ if (chi2AC<kChi2Cut||(*fFitACside)[0]==0) (*fFitACside) = fitAC;
+ (*fFitACside)[0] = fitAC[0];
+ (*fFitACside)[1] = fitAC[1];
+ (*fFitACside)[2] = fitAC[2];
+ (*fFitACside)[3] = fdriftAC.GetNpoints();
+ (*fFitACside)[4] = chi2AC;
+ }
+
+ for (Int_t id=0; id<336; id++){
+ if (!fTracksEsdParam.At(id)) continue;
+ //
+ AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
+ AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
+ Double_t xyz[3];
+ Double_t pxyz[3];
+ Double_t lxyz[3];
+ Double_t lpxyz[3];
+ param->GetXYZ(xyz);
+ param->GetPxPyPz(pxyz);
+ ltrp->GetXYZ(lxyz);
+ ltrp->GetPxPyPz(lpxyz);
+ //Double_t zlength = tpcparam->GetZLength(0);
+ //Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
+ //Double_t mdrift = zlength-TMath::Abs(xyz[2]);
+ Double_t zlength = (ltrp->GetSide()==0)? tpcparam->GetZLength(36): tpcparam->GetZLength(71);
+ Double_t ldrift = (ltrp->GetSide()==0)?zlength-lxyz[2]:lxyz[2]+zlength;
+ Double_t mdrift = (ltrp->GetSide()==0)?zlength-xyz[2]:xyz[2]+zlength;
+
+
+ Float_t fz =0;
+ if (ltrp->GetSide()==0){
+ fz = (fitA)[0]+(fitA)[1]*ldrift+(fitA)[2]*lxyz[1]*ldrift/(zlength*250.);
+ }else{
+ fz = (fitC)[0]+(fitC)[1]*ldrift+(fitC)[2]*lxyz[1]*ldrift/(zlength*250.);
+ }
+ if (npointsAC>10){
+ //fz = (fitAC)[0]+(fitAC)[1]*ltrp->GetSide()+(fitAC)[2]*ldrift+(fitAC)[3]*lxyz[1]*ldrift/(zlength*250.);
+ }
+ fFitZ[id]=mdrift-fz;
+ vecZF[id]=fz;
+ vecDz[id]=mdrift-fz;
+ }
+ if (fStreamLevel>0){
+ TTreeSRedirector *cstream = GetDebugStreamer();
+ TTimeStamp tstamp(fTime);
+ Float_t valuePressure0 = AliTPCcalibDB::GetPressure(tstamp,fRun,0);
+ Float_t valuePressure1 = AliTPCcalibDB::GetPressure(tstamp,fRun,1);
+ Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,0);
+ Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,1);
+ Double_t temp0 = AliTPCcalibDB::GetTemperature(tstamp,fRun,0);
+ Double_t temp1 = AliTPCcalibDB::GetTemperature(tstamp,fRun,1);
+ TVectorD vecGoofie(20);
+ AliDCSSensorArray* goofieArray = AliTPCcalibDB::Instance()->GetGoofieSensors(fRun);
+ if (goofieArray)
+ for (Int_t isensor=0; isensor<goofieArray->NumSensors();isensor++){
+ AliDCSSensor *gsensor = goofieArray->GetSensor(isensor);
+ if (gsensor) vecGoofie[isensor]=gsensor->GetValue(tstamp);
+ }
+
+ if (cstream){
+ (*cstream)<<"driftvN"<<
+ "run="<<fRun<< // run number
+ "event="<<fEvent<< // event number
+ "time="<<fTime<< // time stamp of event
+ "trigger="<<fTrigger<< // trigger
+ "mag="<<fMagF<< // magnetic field
+ // Environment values
+ "press0="<<valuePressure0<<
+ "press1="<<valuePressure1<<
+ "pt0="<<ptrelative0<<
+ "pt1="<<ptrelative1<<
+ "temp0="<<temp0<<
+ "temp1="<<temp1<<
+ "vecGoofie.="<<&vecGoofie<<
+ //
+ //
+ "vecZM.="<<&vecZM<< // measured z position
+ "vecZS.="<<&vecZS<< // surveyed z position
+ "vecZF.="<<&vecZF<< // fitted z position
+ "vecDz.="<<&vecDz<< // fitted z position
+ "vecA.="<<&vecA<< // accept laser flag
+ "vecdEdx.="<<&vecdEdx<< // dEdx - to cut on
+ "vecSy.="<<&vecSy<< // shape y - to cut on
+ "vecSz.="<<&vecSz<< // shape z - to cut on
+ //
+ "iter="<<iter<<
+ "driftA.="<<fFitAside<<
+ "driftC.="<<fFitCside<<
+ "driftAC.="<<fFitACside<<
+ "chi2A="<<chi2A<<
+ "chi2C="<<chi2C<<
+ "chi2AC="<<chi2AC<<
+ "nA="<<npointsA<<
+ "nC="<<npointsC<<
+ "nAC="<<npointsAC<<
+ "\n";
+ /*
+ //
+ variables to check in debug mode:
+ //
+ chainDriftN->SetAlias("driftS","250-abs(vecZS.fElements)");
+ chainDriftN->SetAlias("driftM","250-abs(vecZM.fElements)");
+ chainDriftN->SetAlias("driftF","vecZF.fElements");
+ chainDriftN->SetAlias("deltaZ","driftF-driftM"); //deltaZ
+ TCut cutA="iter==1&&sqrt(chi2A)<0.1&&vecZS.fElements>0&&vecA.fElements==0";
+ TCut cutC="iter==1&&sqrt(chi2C)<0.1&&vecZS.fElements<0&&vecA.fElements==0";
+
+ */
+ }
+ }
+ }
+ return kTRUE;
+}
Float_t AliTPCcalibLaser::GetDistance(AliExternalTrackParam *param, AliTPCLaserTrack *ltrp){
//
TCut cutP1("cutP1","abs(LTr.fP[1]-Tr.fP[1])<30");
TCut cutP2("cutP2","abs(LTr.fP[2]-Tr.fP[2])<0.03");
TCut cutP3("cutP3","abs(Tr.fP[3])<0.05");
- TCut cutP4("cutPt","abs(Tr.fP[4])<0.1");
TCut cutA = cutP0+cutP1+cutP2+cutP3+cutP4;
*/
if (TMath::Abs(param->GetParameter()[1]-ltrp->GetParameter()[1])>30) return kFALSE; // cutZ -P1
if (TMath::Abs(param->GetParameter()[2]-ltrp->GetParameter()[2])>0.03) return kFALSE; // cut -P2
if (TMath::Abs(param->GetParameter()[3])>0.05) return kFALSE; // cut Tl -P3
- if (TMath::Abs(param->GetParameter()[4])>0.1) return kFALSE; // cut Pt -P4
//
//
// Find corresponding mirror
// add the corresponding tracks
+ if (!track->GetOuterParam()) return -1;
Float_t kRadius0 = 252;
- Float_t kRadius = 253.4;
+ Float_t kRadius = 254.2;
+ Int_t countercl=0;
+ Float_t counterSatur=0;
+ Int_t csideA =0;
+ Int_t csideC =0;
+ for (Int_t irow=158;irow>-1;--irow) {
+ AliTPCclusterMI *c=seed->GetClusterPointer(irow);
+ if (!c) continue;
+ Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(c->GetY());
+ Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
+ if (pedgeY<3) continue;
+ if (pedgeX<3) continue;
+ countercl++;
+ if (c->GetDetector()%36<18) csideA++;
+ if (c->GetDetector()%36>=18) csideC++;
+ if (c->GetMax()>900) counterSatur++;
+ }
+ counterSatur/=(countercl+1);
+ //
+ //
+ //
+ if (csideA<0.9*seed->GetNumberOfClusters() && csideC<0.9*seed->GetNumberOfClusters()) return 0; // cross laser track can not happen
+
+ Int_t side= 0;
+ if (csideC>0.5*seed->GetNumberOfClusters()) side=1;
+
- if (!track->GetOuterParam()) return -1;
AliExternalTrackParam param(*(track->GetOuterParam()));
- AliTracker::PropagateTrackTo(¶m,kRadius0,0.10566,3,kTRUE);
- AliTracker::PropagateTrackTo(¶m,kRadius,0.10566,0.1,kTRUE);
+ AliTracker::PropagateTrackTo(¶m,kRadius0,TDatabasePDG::Instance()->GetParticle("mu+")->Mass(),3,kTRUE);
+ AliTracker::PropagateTrackTo(¶m,kRadius,TDatabasePDG::Instance()->GetParticle("mu+")->Mass(),0.1,kTRUE);
AliTPCLaserTrack ltr;
AliTPCLaserTrack *ltrp=0x0;
// AliTPCLaserTrack *ltrpjw=0x0;
//
- Int_t id = AliTPCLaserTrack::IdentifyTrack(¶m);
+ Int_t id = AliTPCLaserTrack::IdentifyTrack(¶m,side);
// Int_t idjw = AliTPCLaserTrack::IdentifyTrackJW(¶m);
//AliDebug(4,Form("Identified Track: %03d (%03d)",id,idjw));
else
ltrp=<r;
- if (id<0) return id;
+ if (id<0) return -1;
+ if (ltrp->GetSide()!=side) return -1;
fCounter[id]++;
//
//
//
- Int_t countercl=0;
- Float_t counterSatur=0;
- for (Int_t irow=158;irow>-1;--irow) {
- AliTPCclusterMI *c=seed->GetClusterPointer(irow);
- if (!c) continue;
- Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(c->GetY());
- Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
- if (pedgeY<3) continue;
- if (pedgeX<3) continue;
- countercl++;
- if (c->GetMax()>900) counterSatur++;
- }
- counterSatur/=(countercl+1);
//
if (counterSatur>fClusterSatur[id]) fClusterSatur[id]=counterSatur;
//
//
Float_t radius=TMath::Abs(ltrp->GetX());
- AliTracker::PropagateTrackTo(¶m,radius,0.10566,0.01,kTRUE);
param.Rotate(ltrp->GetAlpha());
+ AliTracker::PropagateTrackTo(¶m,radius,0.10566,0.01,kFALSE);
//
if (!fTracksMirror.At(id)) fTracksMirror.AddAt(ltrp,id);
Bool_t accept=kTRUE;
Double_t yfit2 = vecY2[irow];
Double_t x = vecX[irow];
Double_t yabsbeam = -1000;
- if(vecSec[irow]==outerSector && (outerSector%36)==fBeamSectorOuter[id])
+ if(vecSec[irow]==outerSector && outerSector==fBeamSectorOuter[id])
yabsbeam = fBeamSlopeYOuter[id]*x + fBeamOffsetYOuter[id];
- else if((innerSector%36)==fBeamSectorInner[id])
+ else if(innerSector==fBeamSectorInner[id])
yabsbeam = fBeamSlopeYInner[id]*x + fBeamOffsetYInner[id];
// Double_t yfit3 = vecY2[irow];
// zreal = (zmeasured - [0] + (1 - [1])*250.0)/[1]
Double_t dzabs = -1000;
+ Double_t zcorrected = -1000;
if (ltrp->GetSide()==0){
- if ((*fFitAside)[1]>0.) {
+ if ((*fFitAside)[1]>0. || fUseFixedDriftV) {
// ignore global y dependence for now
- Double_t zcorrected = (zcl + (*fFitAside)[0] -
- (1.0-(*fFitAside)[1])*250.0)/(*fFitAside)[1];
+ zcorrected = 0;
+ if(!fUseFixedDriftV)
+ zcorrected = (zcl + (*fFitAside)[0] -
+ (1.0-(*fFitAside)[1])*250.0)/(*fFitAside)[1];
+ else
+ zcorrected = (zcl + fFixedFitAside0 -
+ (1.0-fFixedFitAside1)*250.0)/fFixedFitAside1;
// zcorrected = zcl;
- if(vecSec[irow]==outerSector && (outerSector%36)==fBeamSectorOuter[id])
+ if(vecSec[irow]==outerSector && outerSector==fBeamSectorOuter[id])
dzabs = zcorrected -fBeamSlopeZOuter[id]*x -fBeamOffsetZOuter[id];
- else if((innerSector%36)==fBeamSectorInner[id])
+ else if(innerSector==fBeamSectorInner[id])
dzabs = zcorrected -fBeamSlopeZInner[id]*x -fBeamOffsetZInner[id];
}
} else {
- if ((*fFitCside)[1]>0.) {
- Double_t zcorrected = (zcl - (*fFitCside)[0] +
- (1.0-(*fFitCside)[1])*250.0)/(*fFitCside)[1];
+ if ((*fFitCside)[1]>0. || fUseFixedDriftV) {
+
+ if(!fUseFixedDriftV)
+ zcorrected = (zcl - (*fFitCside)[0] +
+ (1.0-(*fFitCside)[1])*250.0)/(*fFitCside)[1];
+ else
+ zcorrected = (zcl - fFixedFitCside0 +
+ (1.0-fFixedFitCside1)*250.0)/fFixedFitCside1;
+
// zcorrected = zcl;
- if(vecSec[irow]==outerSector && (outerSector%36)==fBeamSectorOuter[id])
+ if(vecSec[irow]==outerSector && outerSector==fBeamSectorOuter[id])
dzabs = zcorrected -fBeamSlopeZOuter[id]*x -fBeamOffsetZOuter[id];
- else if((innerSector%36)==fBeamSectorInner[id])
+ else if(innerSector==fBeamSectorInner[id])
dzabs = zcorrected -fBeamSlopeZInner[id]*x -fBeamOffsetZInner[id];
}
}
if (profy){
profy->Fill(irow,ycl-yfit);
profy2->Fill(irow,ycl-yfit2);
- if(yabsbeam<-100)
- profyabs->Fill(irow,-0.99);
- else
+ if(yabsbeam<-100) {
+ fHisYAbsErrors->Fill(id);
+ // profyabs->Fill(irow,-0.99);
+ } else
profyabs->Fill(irow,ycl-yabsbeam);
// profy3->Fill(irow,ycl-yfit3);
profz->Fill(irow,zcl-zfit);
profz2->Fill(irow,zcl-zfit2);
//profz3->Fill(irow,zcl-zfit3);
- if(dzabs<-100)
- profzabs->Fill(irow,-0.99);
- else
+ if(dzabs<-100) {
+
+ fHisZAbsErrors->Fill(id);
+ }else
profzabs->Fill(irow,dzabs);
}
}
-void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run){
+void AliTPCcalibLaser::DumpMeanInfo(Int_t run){
//
// Dump information about laser beams
// isOK variable indicates usability of the beam
const Float_t krmsCut1=0.16;
const Float_t kmultiCut=2;
const Float_t kcutP0=0.002;
+ AliMagF* magF= dynamic_cast<AliMagF*> (TGeoGlobalMagField::Instance()->GetField());
+ Double_t xyz[3]={90,0,10}; // tmp. global position
+ Double_t bxyz[3]={90,0,10}; // tmp. mag field integral - cylindrical
+ Double_t bgxyz[3]={90,0,10}; // tmp. mag field integral - local
//
AliTPCcalibLaser *laser = this;
TTreeSRedirector *pcstream = new TTreeSRedirector("laserMean.root");
TF1 fg("fg","gaus");
+ AliTPCParam * tpcparam = 0;
+ // start set up for absolute residuals analysis
+ //
+ AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
+ tpcparam = calib->GetParameters();
+ if (!tpcparam) tpcparam = new AliTPCParamSR;
+ tpcparam->Update();
+ AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
+ Float_t current=0;
+ Float_t bfield = 0, bz=0;
+
+ if (grp){
+ Float_t polarity = (grp->GetL3Polarity()>0) ? -1.:1;
+ current = grp->GetL3Current((AliGRPObject::Stats)0);
+ bfield = polarity*5*current/30000.;
+ bz = polarity*5*current/30000.;
+ printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
+ }
+
+ SetBeamParameters(fBeamOffsetYOuter, fBeamSlopeYOuter, fBeamSectorOuter,0);
+ SetBeamParameters(fBeamOffsetYInner, fBeamSlopeYInner, fBeamSectorInner,1);
+ TLinearFitter lfabsyInner(2);
+ lfabsyInner.SetFormula("1 ++ x");
+ TLinearFitter lfabszInner(2);
+ lfabszInner.SetFormula("1 ++ x");
+
+ TLinearFitter lfabsyOuter(2);
+ lfabsyOuter.SetFormula("1 ++ x");
+ TLinearFitter lfabszOuter(2);
+ lfabszOuter.SetFormula("1 ++ x");
+ // end set up for absolute residuals analysis
+
//
//
for (Int_t id=0; id<336; id++){
AliTPCLaserTrack::LoadTracks();
ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
}
+ ltrp->UpdatePoints();
pcstream->GetFile()->cd();
if (hisphi) hisphi->Write();
if (hisphiP) hisphiP->Write();
hisP3->Fit(&fg,"","",hisP3->GetMean()-4*hisP3->GetRMS(),hisP3->GetMean()+4*hisP3->GetRMS());
Double_t gp31 = fg.GetParameter(1);
Double_t gp32 = fg.GetParameter(2);
+ Double_t meanp3 = hisP3->GetMean();
+ Double_t rmsp3 = hisP3->GetRMS();
//
if (hisP4->GetRMS()>hisP4->GetBinWidth(1))
hisP4->Fit(&fg,"","",hisP4->GetMean()-4*hisP4->GetRMS(),hisP4->GetMean()+4*hisP4->GetRMS());
Double_t gp41 = fg.GetParameter(1);
Double_t gp42 = fg.GetParameter(2);
+ Double_t meanp4 = hisP4->GetMean();
+ Double_t rmsp4 = hisP4->GetRMS();
//
Float_t meanS=hisS->GetMean();
//
Float_t mPz3vP2IO = his->GetMean();
Float_t rPz3vP2IO = his->GetRMS();
delete his;
+
+ // Fit absolute laser residuals
+ TH2F* histAbsY = (TH2F*)laser->fDeltaYresAbs[id];
+ TH2F* histAbsZ = (TH2F*)laser->fDeltaZresAbs[id];
+
+ Int_t secInner = TMath::Nint(fBeamSectorInner[id]);
+ Int_t secOuter = TMath::Nint(fBeamSectorOuter[id]);
+
+ TVectorD vecX(159); // X
+ TVectorD vecY(159); // Y
+ TVectorD vecR(159); // R
+ TVectorD vecDY(159); // absolute residuals in Y
+ TVectorD vecDZ(159); // absolute residuals in Z
+ TVectorD vecN(159); // number of clusters
+ TVectorD vecEy(159); //error y
+ TVectorD vecEz(159); //error z
+ TVectorD vecPhi(159); // local tangent
+ TVectorD vecPhiR(159); // local tangent
+ // magnetic field integrals
+ TVectorD vecIBR(159); // radial
+ TVectorD vecIBRPhi(159); // r-phi
+ TVectorD vecIBLX(159); // local x
+ TVectorD vecIBLY(159); // local y
+ TVectorD vecIBGX(159); // local x
+ TVectorD vecIBGY(159); // local y
+ TVectorD vecIBZ(159); // z
+ //
+ for (Int_t irow=0;irow<159;irow++){
+ vecIBR[irow]=0;
+ vecIBRPhi[irow]=0;
+ vecIBLX[irow]=0;
+ vecIBLY[irow]=0;
+ vecIBGX[irow]=0;
+ vecIBGY[irow]=0;
+ vecIBZ[irow]=0;
+ Double_t gx =(*(ltrp->fVecGX))[irow];
+ Double_t gy =(*(ltrp->fVecGY))[irow];
+ Int_t lsec =TMath::Nint((*(ltrp->fVecSec))[irow]);
+ Double_t ca =TMath::Cos(TMath::Pi()*(lsec+0.5)/9.);
+ Double_t sa =TMath::Sin(TMath::Pi()*(lsec+0.5)/9.);
+ xyz[2]=(*(ltrp->fVecGZ))[irow];
+ xyz[0]=TMath::Sqrt(gx*gx+gy*gy);
+ xyz[1]=TMath::ATan2(gy,gx);
+ Double_t gxyz[3]={gx,gy,(*(ltrp->fVecGZ))[irow]};
+ if (magF){
+ magF->GetTPCIntCyl(xyz,bxyz);
+ magF->GetTPCInt(gxyz,bgxyz);
+ vecIBR[irow]=bxyz[0];
+ vecIBRPhi[irow]=bxyz[1];
+ //
+ vecIBGX[irow]=bgxyz[0];
+ vecIBGY[irow]=bgxyz[1];
+ //
+ vecIBLX[irow]= bgxyz[0]*ca+bgxyz[1]*sa;
+ vecIBLY[irow]= -bgxyz[0]*sa+bgxyz[1]*ca;
+ //
+
+ vecIBZ[irow]=bxyz[2];
+ }
+ }
+
+
+ lfabsyInner.ClearPoints();
+ lfabszInner.ClearPoints();
+ lfabsyOuter.ClearPoints();
+ lfabszOuter.ClearPoints();
+ // dummy fit values
+ Int_t nClInY = 0;
+ Float_t yAbsInOffset = -100;
+ Float_t yAbsInSlope = -100;
+ Float_t yAbsInDeltay = -100;
+ Int_t nClInZ = 0;
+ Float_t zAbsInOffset = -100;
+ Float_t zAbsInSlope = -100;
+ Float_t zAbsInDeltaz = -100;
+ Int_t nClOutY = 0;
+ Float_t yAbsOutOffset = -100;
+ Float_t yAbsOutSlope = -100;
+ Float_t yAbsOutDeltay = -100;
+ Int_t nClOutZ = 0;
+ Float_t zAbsOutOffset = -100;
+ Float_t zAbsOutSlope = -100;
+ Float_t zAbsOutDeltaz = -100;
+
+ Float_t lasTanPhiLocIn = -100;
+ Float_t lasTanPhiLocOut = -100;
+
+ if(histAbsY->GetEntries()>0) {
+
+ Double_t rotAngOut = 10;
+ Double_t rotAngIn = 10;
+ if((secInner%36)!=(secOuter%36))
+ rotAngIn += 20; // 30 degrees
+
+ // Calculate laser mirror X position in local frame
+ Double_t laserposOut =
+ TMath::Abs(ltrp->GetX()*TMath::Cos(rotAngOut*TMath::DegToRad()));
+ Double_t laserposIn =
+ TMath::Abs(ltrp->GetX()*TMath::Cos(rotAngIn*TMath::DegToRad()));
+
+ // Calculate laser tan phi in local frame
+ lasTanPhiLocOut = TMath::ASin(ltrp->GetSnp());
+ if(lasTanPhiLocOut<0) {
+ lasTanPhiLocIn = lasTanPhiLocOut - rotAngIn*TMath::DegToRad();
+ lasTanPhiLocOut -= rotAngOut*TMath::DegToRad();
+ } else {
+
+ lasTanPhiLocIn = lasTanPhiLocOut + rotAngIn*TMath::DegToRad();
+ lasTanPhiLocOut += rotAngOut*TMath::DegToRad();
+ }
+
+ lasTanPhiLocIn = TMath::Tan(lasTanPhiLocIn);
+ lasTanPhiLocOut = TMath::Tan(lasTanPhiLocOut);
+
+ TProfile* yprof = histAbsY->ProfileX("yprof");
+ TProfile* zprof = histAbsZ->ProfileX("zprof");
+
+ for(Int_t bin = 1; bin<=159; bin++) {
+
+ if(yprof->GetBinEntries(bin)<10&&
+ zprof->GetBinEntries(bin)<10) {
+ continue;
+ }
+
+ // There is a problem in defining inner and outer sectors for
+ // the outer beams (0 and 6) where both sectors are OROCs. To
+ // make sure there is no overlap row 94 to 99 are cutted.
+ if(((ltrp->GetBeam()==0)||(ltrp->GetBeam()==6))&&bin>=95&&bin<=100)
+ continue;
+
+ Int_t row = (bin-1);
+ if(row>62)
+ row -= 63;
+
+ Bool_t isOuter = kTRUE;
+ Int_t sector = TMath::Nint(fBeamSectorOuter[id]);
+
+ if(bin<=62 ||
+ (((ltrp->GetBeam()==0)||(ltrp->GetBeam()==6))&&bin<=95)) {
+
+ isOuter = kFALSE;
+ sector = TMath::Nint(fBeamSectorInner[id]);
+ }
+
+
+ Double_t x = tpcparam->GetPadRowRadii(sector, row); // slope
+ vecN[bin-1] =yprof->GetBinEntries(bin);
+ vecEy[bin-1]=yprof->GetBinError(bin);
+ vecEz[bin-1]=zprof->GetBinError(bin);
+ vecX[bin-1] = x;
+ vecDY[bin-1] = yprof->GetBinContent(bin);
+ vecDZ[bin-1] = zprof->GetBinContent(bin);
+ if(!isOuter) { // inner
+ vecPhi[bin-1]=lasTanPhiLocIn;
+ // Calculate local y from residual and database
+ Double_t y = fBeamSlopeYInner[id]*x + fBeamOffsetYInner[id]
+ + vecDY[bin-1];
+ vecY[bin-1] = y;
+ Double_t r = TMath::Sqrt(x*x + y*y);
+ vecR[bin-1] = r;
+ // Find angle between laser vector and R vector
+ // cos angle = (x,y).(1,fBeamSlopeYInner)/R/sqrt(1+fBeamSlopeYInner**2)
+ Double_t cosPhi = x + y*fBeamSlopeYInner[id];
+ cosPhi /= r*TMath::Sqrt(1+fBeamSlopeYInner[id]*fBeamSlopeYInner[id]);
+ vecPhiR[bin-1] = TMath::Tan(TMath::ACos(cosPhi));
+ if(lasTanPhiLocIn<0)
+ vecPhiR[bin-1]*=-1; // to have the same sign
+
+ if(yprof->GetBinEntries(bin)>=10) {
+ lfabsyInner.AddPoint(&x, yprof->GetBinContent(bin),
+ TMath::Max(yprof->GetBinError(bin), 0.001));
+ }
+ if(zprof->GetBinEntries(bin)>=10) {
+ lfabszInner.AddPoint(&x, zprof->GetBinContent(bin),
+ TMath::Max(zprof->GetBinError(bin), 0.001));
+ }
+ } else { // outer
+ vecPhi[bin-1]=lasTanPhiLocOut;
+ // Calculate local y from residual and database
+ Double_t y = fBeamSlopeYOuter[id]*x + fBeamOffsetYOuter[id]
+ + vecDY[bin-1];
+ vecY[bin-1] = y;
+ Double_t r = TMath::Sqrt(x*x + y*y);
+ vecR[bin-1] = r;
+
+ Double_t cosPhi = x + y*fBeamSlopeYOuter[id];
+ cosPhi /= r*TMath::Sqrt(1+fBeamSlopeYOuter[id]*fBeamSlopeYOuter[id]);
+ vecPhiR[bin-1] = TMath::Tan(TMath::ACos(cosPhi));
+ if(lasTanPhiLocOut<0)
+ vecPhiR[bin-1]*=-1; // to have the same sign
+
+ if(yprof->GetBinEntries(bin)>=10) {
+ lfabsyOuter.AddPoint(&x, yprof->GetBinContent(bin),
+ TMath::Max(yprof->GetBinError(bin), 0.001));
+ }
+ if(zprof->GetBinEntries(bin)>=10) {
+ lfabszOuter.AddPoint(&x, zprof->GetBinContent(bin),
+ TMath::Max(zprof->GetBinError(bin), 0.001));
+ }
+ }
+ // global position
+
+ }
+
+ delete yprof; delete zprof;
+
+
+ // Fit laser abs residuals with linear robust fit (exclude 5% outliers)
+ nClInY = lfabsyInner.GetNpoints();
+ if(lfabsyInner.GetNpoints()>10) {
+ lfabsyInner.EvalRobust(0.95);
+
+ TVectorD result(2);
+ lfabsyInner.GetParameters(result);
+ yAbsInOffset = result[0];
+ yAbsInSlope = result[1];
+ yAbsInDeltay = yAbsInSlope*laserposIn + yAbsInOffset;
+ }
+ nClInZ = lfabszInner.GetNpoints();
+ if(lfabszInner.GetNpoints()>10) {
+ lfabszInner.EvalRobust(0.95);
+
+ TVectorD result(2);
+ lfabszInner.GetParameters(result);
+ zAbsInOffset = result[0];
+ zAbsInSlope = result[1];
+ zAbsInDeltaz = zAbsInSlope*laserposIn + zAbsInOffset;
+ }
+ nClOutY = lfabsyOuter.GetNpoints();
+ if(lfabsyOuter.GetNpoints()>10) {
+ lfabsyOuter.EvalRobust(0.95);
+
+ TVectorD result(2);
+ lfabsyOuter.GetParameters(result);
+ yAbsOutOffset = result[0];
+ yAbsOutSlope = result[1];
+ yAbsOutDeltay = yAbsOutSlope*laserposOut + yAbsOutOffset;
+ }
+ nClOutZ = lfabszOuter.GetNpoints();
+ if(lfabszOuter.GetNpoints()>10) {
+ lfabszOuter.EvalRobust(0.95);
+
+ TVectorD result(2);
+ lfabszOuter.GetParameters(result);
+ zAbsOutOffset = result[0];
+ zAbsOutSlope = result[1];
+ zAbsOutDeltaz = zAbsOutSlope*laserposOut + zAbsOutOffset;
+ }
+ }
+
+ Int_t itime=-1;
+ Float_t coverIA=AliTPCcalibDB::GetCoverVoltage(run,0,itime);
+ Float_t coverIC=AliTPCcalibDB::GetCoverVoltage(run,18,itime);
+ Float_t coverOA=AliTPCcalibDB::GetCoverVoltage(run,36,itime);
+ Float_t coverOC=AliTPCcalibDB::GetCoverVoltage(run,54,itime);
+ //
+ Float_t skirtA=AliTPCcalibDB::GetSkirtVoltage(run,0,itime);
+ Float_t skirtC=AliTPCcalibDB::GetSkirtVoltage(run,18,itime);
+ //
+ Float_t ggOffA=AliTPCcalibDB::GetGGoffsetVoltage(run,0,itime);
+ Float_t ggOffC=AliTPCcalibDB::GetGGoffsetVoltage(run,18,itime);
+
//
(*pcstream)<<"Mean"<<
"run="<<run<< //
+ //voltages
+ "UcIA="<<coverIA<<
+ "UcIC="<<coverIC<<
+ "UcOA="<<coverOA<<
+ "UcOC="<<coverOC<<
+ "UsA="<<skirtA<<
+ "UsC="<<skirtC<<
+ "UggA="<<ggOffA<<
+ "UggC="<<ggOffC<<
+ //
"isOK="<<isOK<< //
"id="<<id<< // track id
"entries="<<entries<< // number of entries
//
"gp31="<<gp31<< //gaus mean - tgl
"gp32="<<gp32<< //gaus rms -tgl
+ "meanp3="<<meanp3<< //mean - tgl
+ "rmsp3="<<rmsp3<< //rms -tgl
"gp41="<<gp41<< //gaus mean - P4
"gp42="<<gp42<< //gaus rms - P4
-
+ "meanp4="<<meanp4<< //mean - P4
+ "rmsp4="<<rmsp4<< //rms - P4
+ // Parameters from abs res analysis
+ "SecIn="<<secInner<< // inner sector
+ "SecOut="<<secOuter<< // outer sector
+ "lasTanPhiLocIn="<<lasTanPhiLocIn<< // laser tan phi in local frame (inner)
+ "lasTanPhiLocOut="<<lasTanPhiLocOut<<// laser tan phi in local frame (outer)
+ "ibr.="<<&vecIBR<< // radial filed integral
+ "ibrphi.="<<&vecIBRPhi<< // r=phifiled integral
+ "ibr.="<<&vecIBR<< // radial filed integral
+ "ibz.="<<&vecIBZ<< // z filed integral
+ //
+ "iblx.="<<&vecIBLX<< // local bx integral
+ "ibly.="<<&vecIBLY<< // local by integral
+ "ibgx.="<<&vecIBGX<< // global bx integral
+ "ibgy.="<<&vecIBGY<< // global by integral
+ //
+ "X.="<<&vecX<< // local x
+ "Y.="<<&vecY<< // local y
+ "R.="<<&vecR<< // radius
+ "dY.="<<&vecDY<< // abs y residuals
+ "dZ.="<<&vecDZ<< // abs z residuals
+ "eY.="<<&vecEy<< // error of y residuals
+ "eZ.="<<&vecEz<< // error of z residuals
+ "kY.="<<&vecPhi<< // local tangent y (fixed for sector)
+ "kYR.="<<&vecPhiR<< // tangent between laser and R vector (varies inside sector)
+ "nCl.="<<&vecN<< // number of clusters
+ //
+ "nClInY="<<nClInY<< // Number of clusters for inner y
+ "yAbsInOffset="<<yAbsInOffset<< // fitted offset absres (inner y)
+ "yAbsInSlope="<<yAbsInSlope << // fitted slope absres (inner y)
+ "yAbsInDeltay="<<yAbsInDeltay<< // fitted laser offset absres (inner y)
+ "nClInZ="<<nClInZ<< // Number of clusters for inner z
+ "zAbsInOffset="<<zAbsInOffset<< // fitted offset absres (inner z)
+ "zAbsInSlope="<<zAbsInSlope << // fitted slope absres (inner z)
+ "zAbsInDeltaz="<<zAbsInDeltaz<< // fitted laser offset absres (inner z)
+ //
+ "nClOutY="<<nClOutY<< // Number of clusters for outer y
+ "yAbsOutOffset="<<yAbsOutOffset<< // fitted offset absres (outer y)
+ "yAbsOutSlope="<<yAbsOutSlope << // fitted slope absres (outer y)
+ "yAbsOutDeltay="<<yAbsOutDeltay<< // fitted laser offset absres (outer y)
+ "nClOutZ="<<nClOutZ<< // Number of clusters for outer z
+ "zAbsOutOffset="<<zAbsOutOffset<< // fitted offset absres (outer z)
+ "zAbsOutSlope="<<zAbsOutSlope << // fitted slope absres (outer z)
+ "zAbsOutDeltaz="<<zAbsOutDeltaz<< // fitted laser offset absres (outer z)
+ //
"\n";
}
delete pcstream;
fHisPz2vP2Out= new TH2F("HisPz2vP2Out","HisPz2vP2Out",336,0,336,500,-0.0002,0.0002);
fHisPz3vP2IO = new TH2F("HisPz3vP2IO", "HisPz3vP2IO",336,0,336,500,-0.0002,0.0002);
+ fHisYAbsErrors = new TH1F("HisYabsErrors", "Errors per beam (y)", 336, 0, 336);
+ fHisZAbsErrors = new TH1F("HisZabsErrors", "Errors per beam (z)", 336, 0, 336);
+
fHisNclIn->SetDirectory(0); //->Number of clusters inner
fHisNclOut->SetDirectory(0); //->Number of clusters outer
fHisNclIO->SetDirectory(0); //->Number of cluster inner outer
fHisPz2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
fHisPz3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
+ fHisYAbsErrors->SetDirectory(0); //-> total errors per beam in the abs res y analysis
+ fHisZAbsErrors->SetDirectory(0); //-> total errors per beam in the abs res z analysis
+
+
//
//
profy2=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Parabolic",id),160,0,160,50,-0.5,0.5);
profy2->SetDirectory(0);
fDeltaYres2.AddAt(profy2,id);
- profyabs=new TH2F(Form("pryabs%03d",id),Form("Y Residuals for Laser Beam %03d -Absolute",id),160,0,160,100,-1.0,1.0); // has to be bigger based on earlier studies
+ if(!fUseFixedDriftV)
+ profyabs=new TH2F(Form("pryabs%03d",id),Form("Y Residuals for Laser Beam %03d -Absolute",id),160,0,160,100,-1.0,1.0); // has to be bigger based on earlier studies
+ else
+ profyabs=new TH2F(Form("pryabs%03d",id),Form("Y Residuals for Laser Beam %03d -Absolute",id),160,0,160,200,-2.0,2.0); // has to be bigger based on earlier studies
profyabs->SetDirectory(0);
fDeltaYresAbs.AddAt(profyabs,id);
//profy3=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
profz2=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d - Parabolic",id),160,0,160,50,-0.5,0.5);
profz2->SetDirectory(0);
fDeltaZres2.AddAt(profz2,id);
- profzabs=new TH2F(Form("przabs%03d",id),Form("Z Residuals for Laser Beam %03d -Absolute",id),160,0,160,100,-1.0,1.0); // has to be bigger based on earlier studies
+ if(!fUseFixedDriftV)
+ profzabs=new TH2F(Form("przabs%03d",id),Form("Z Residuals for Laser Beam %03d -Absolute",id),160,0,160,100,-1.0,1.0); // has to be bigger based on earlier studies
+ else
+ profzabs=new TH2F(Form("przabs%03d",id),Form("Z Residuals for Laser Beam %03d -Absolute",id),160,0,160,200,-2.0,2.0); // has to be bigger based on earlier studies
profzabs->SetDirectory(0);
fDeltaZresAbs.AddAt(profzabs,id);
//profz3=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
fHisPz2vP2In->Add(laser->fHisPz2vP2In ); //-> Curv P2inner - parabola
fHisPz2vP2Out->Add(laser->fHisPz2vP2Out ); //-> Curv P2outer - parabola
fHisPz3vP2IO->Add(laser->fHisPz3vP2IO ); //-> Curv P2outerinner - common parabola
+ fHisYAbsErrors->Add(laser->fHisYAbsErrors); //-> total errors per beam in the abs res y analysis
+ fHisZAbsErrors->Add(laser->fHisZAbsErrors); //-> total errors per beam in the abs res z analysis
//
//
//
sector -= 18;
if(ltrp->GetSide()==1) // C side
sector += 18;
+ if(option==0 || option==2)
+ sector += 36;
+ if((option==1||option==3)&&(ltrp->GetBeam()==0||ltrp->GetBeam()==6))
+ sector += 36;
+
sectorArray[id] = sector;
const Double_t x0 = 0;