]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the global event information in central place
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Oct 2008 11:59:45 +0000 (11:59 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Oct 2008 11:59:45 +0000 (11:59 +0000)
Use it in debug streamers (Marian)

12 files changed:
TPC/AliTPCcalibAlign.cxx
TPC/AliTPCcalibAlign.h
TPC/AliTPCcalibBase.cxx
TPC/AliTPCcalibBase.h
TPC/AliTPCcalibCalib.cxx
TPC/AliTPCcalibCosmic.cxx
TPC/AliTPCcalibCosmic.h
TPC/AliTPCcalibDB.cxx
TPC/AliTPCcalibLaser.cxx
TPC/AliTPCcalibLaser.h
TPC/AliTPCcalibTracks.cxx
TPC/AliTPCcalibTracksGain.cxx

index 8f0c2f7cbcc9cde5789b96f910d545467bd4e8c7..bcdedc8dcdaddef3cddd91b5cf5b51537c122664 100644 (file)
   AliXRDPROOFtoolkit tool;
   TChain * chain = tool.MakeChain("align.txt","Track",0,10200);
   chain->Lookup();
+  TCut cutA("abs(tp1.fP[1]-tp2.fP[1])<0.3&&abs(tp1.fP[0]-tp2.fP[0])<0.15&&abs(tp1.fP[3]-tp2.fP[3])<0.01&&abs(tp1.fP[2]-tp2.fP[2])<0.01");
+  TCut cutS("s1%36==s2%36");
   
   .x ~/UliStyle.C
+  .x $ALICE_ROOT/macros/loadlibsREC.C
+
+  gSystem->Load("$ROOTSYS/lib/libXrdClient.so");
+  gSystem->Load("libProof");
   gSystem->Load("libANALYSIS");
+  gSystem->Load("libSTAT");
   gSystem->Load("libTPCcalib");
+  //
+  // compare reference
   TFile fcalib("CalibObjects.root");
   TObjArray * array = (TObjArray*)fcalib.Get("TPCCalib");
+
   AliTPCcalibAlign * align = ( AliTPCcalibAlign *)array->FindObject("alignTPC");
   //
   //
@@ -209,7 +219,7 @@ void AliTPCcalibAlign::Terminate(){
   // Terminate function
   // call base terminate + Eval of fitters
   //
-  if (GetDebugLevel()>0) Info("AliTPCcalibAlign","Terminate");
+  Info("AliTPCcalibAlign","Terminate");
   EvalFitters();
   AliTPCcalibBase::Terminate();
 }
@@ -260,6 +270,11 @@ void AliTPCcalibAlign::ProcessTracklets(const AliExternalTrackParam &tp1,
       AliExternalTrackParam *p1 = &((AliExternalTrackParam&)tp1);
       AliExternalTrackParam *p2 = &((AliExternalTrackParam&)tp2);
       (*cstream)<<"Tracklet"<<
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field
        "tp1.="<<p1<<
        "tp2.="<<p2<<
        "v1.="<<&vec1<<
@@ -372,6 +387,11 @@ void  AliTPCcalibAlign::ProcessDiff(const AliExternalTrackParam &t1,
 
     if (cstream){
       (*cstream)<<"Track"<<
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field
        "Cl.="<<&arrCl<<
        //"tp0.="<<p0<<
        "tp1.="<<p1<<
@@ -1098,3 +1118,39 @@ void AliTPCcalibAlign::Add(AliTPCcalibAlign * align){
     }
   }
 }
+
+
+
+
+
+/*
+  
+
+gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
+gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
+AliXRDPROOFtoolkit tool;
+TChain * chainTr = tool.MakeChain("align.txt","Track",0,10200);
+chainTr->Lookup();
+
+
+
+TCut cutS("s1%36==s2%36");
+
+TCut cutN("c1>32&&c2>60");
+TCut cutC0("sqrt(tp2.fC[0])<1");
+
+TCut cutP0("abs(tp1.fP[0]-tp2.fP[0])<0.4");
+TCut cutP2("abs(tp1.fP[2]-tp2.fP[2])<0.01");
+TCut cutP3("abs(tp1.fP[3]-tp2.fP[3])<0.01");
+TCut cutP4("abs(tp1.fP[4]-tp2.fP[4])<0.5");
+TCut cutP=cutP0+cutP2+cutP3+cutP4+cutC0;
+
+TCut cutX("abs(tp2.fX-133.6)<2");
+
+TCut cutA = cutP+cutN;
+
+
+TCut cutY("abs(vcY.fElements-vtY.fElements)<0.3&&vcY.fElements!=0")
+TCut cutZ("abs(vcZ.fElements-vtZ.fElements)<0.3&&vcZ.fElements!=0")
+
+*/
index 5f3b67ba9f02f29d0813924ffd26cf5052da8b75..d12314a6080bab700b69a25027fe0717db8fd18c 100644 (file)
@@ -58,7 +58,7 @@ public:
 //   Bool_t GetTransformationCovar9(Int_t s1,Int_t s2,TMatrixD &a, Bool_t norm=kFALSE);
 //   Bool_t GetTransformationCovar6(Int_t s1,Int_t s2,TMatrixD &a, Bool_t norm=kFALSE);
   void Add(AliTPCcalibAlign * align);
-  //  Int_t *GetPoints() {return fPoints;}
+  Int_t *GetPoints() {return fPoints;}
 private:
   void FillHisto(const AliExternalTrackParam &t1,
                        const AliExternalTrackParam &t2,
index f3b71e2696c3f516ed908d8529d3e89c584a24b4..3ed2898cb1867bc03959a60c206f31471ba4600a 100644 (file)
@@ -45,6 +45,7 @@
 #include "TTreeStream.h"
 #include "AliLog.h"
 #include "TTimeStamp.h"
+#include "AliESDEvent.h"
 
 
 ClassImp(AliTPCcalibBase)
@@ -52,7 +53,12 @@ ClassImp(AliTPCcalibBase)
 AliTPCcalibBase::AliTPCcalibBase():
     TNamed(),
     fDebugStreamer(0),
-    fStreamLevel(0),
+    fStreamLevel(0),   
+    fRun(0),                  //!  current Run number
+    fEvent(0),                //!  current Event number
+    fTime(0),                 //!  current Time
+    fTrigger(0),              //! current trigger type
+    fMagF(0),                 //! current magnetic field
     fDebugLevel(0)
 {
   //
@@ -118,6 +124,17 @@ TTreeSRedirector *AliTPCcalibBase::GetDebugStreamer(){
 }
 
 
+void    AliTPCcalibBase::UpdateEventInfo(AliESDEvent * event){
+  //
+  //
+  //
+  fRun     = event->GetRunNumber();
+  fEvent   = event->GetEventNumberInFile();
+  fTime    = event->GetTimeStamp();
+  fTrigger = event->GetTriggerMask();
+  fMagF    = event->GetMagneticField();
+}
+
 void AliTPCcalibBase::RegisterDebugOutput(const char *path){
   //
   // store  - copy debug output to the destination position
index 08f0956706b129c248bcf95f0d40fa38a86499f5..468278a663a23afa8ecae554df3bd7303ba3ae19 100644 (file)
@@ -27,6 +27,8 @@ public:
   virtual Long64_t Merge(TCollection */*li*/){return 0;}
   virtual void     Analyze(){return;}
   virtual void     Terminate();
+
+  virtual void    UpdateEventInfo(AliESDEvent * event);
   //
   // debug streamer support
   TTreeSRedirector *GetDebugStreamer();
@@ -38,8 +40,14 @@ public:
 protected: 
   TTreeSRedirector *fDebugStreamer;     //! debug streamer
   Int_t  fStreamLevel;                  //  debug stream level
+  Int_t  fRun;                          //!  current Run number
+  Int_t  fEvent;                        //! current Event number
+  Int_t  fTime;                         //!  current Time
+  Int_t  fTrigger;                      //! current trigger type
+  Float_t fMagF;                        //! current magnetic field 
 private:
   Int_t  fDebugLevel;                   //  debug level
+
   ClassDef(AliTPCcalibBase,1)
 };
 
index 62787893e7912e91d679f6539dd2febb259550f7..c9b760f0cd858b08cfaaee0eab8f2f10784003c1 100644 (file)
@@ -176,6 +176,11 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed){
       TTreeSRedirector *cstream = GetDebugStreamer();
       if (cstream){
        (*cstream)<<"Clusters"<<
+         "run="<<fRun<<              //  run number
+         "event="<<fEvent<<          //  event number
+         "time="<<fTime<<            //  time stamp of event
+         "trigger="<<fTrigger<<      //  trigger
+         "mag="<<fMagF<<             //  magnetic field
          "cl0.="<<&cl0<<
          "cl.="<<cluster<<
          "cy="<<dy<<
@@ -265,6 +270,11 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed){
     TTreeSRedirector *cstream = GetDebugStreamer();
     if (cstream){
       (*cstream)<<"Tracks"<<
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field
        "nclIn="<<nclIn<<
        "nclOut="<<nclOut<<
        "ncl="<<ncl<<
index 86fdf3b4747a392de46eeca9b624943b1b077275..61e0b7c2ee91ee687820c79f0083d6194a8622bf 100644 (file)
@@ -14,7 +14,7 @@
  **************************************************************************/
 
 /*
-    Comments to be written here:
+    Comments to be written here: 
     1. What do we calibrate.
     2. How to interpret results
     3. Simple example
@@ -144,6 +144,7 @@ void AliTPCcalibCosmic::Process(AliESDEvent *event) {
    return;
   }
    
+
   FindPairs(event); // nearly everything takes place in find pairs...
 
   if (GetDebugLevel()>20) printf("Hallo world: Im here and processing an event\n");
@@ -297,7 +298,7 @@ void AliTPCcalibCosmic::FindPairs(AliESDEvent *event) {
       //
       if (fStreamLevel>0){
        TTreeSRedirector * cstream =  GetDebugStreamer();
-       printf("My stream=%p\n",(void*)cstream);
+       //printf("My stream=%p\n",(void*)cstream);
        AliExternalTrackParam *ip0 = (AliExternalTrackParam *)track0->GetInnerParam();
        AliExternalTrackParam *ip1 = (AliExternalTrackParam *)track1->GetInnerParam();
        AliExternalTrackParam *op0 = (AliExternalTrackParam *)track0->GetOuterParam();
@@ -306,12 +307,13 @@ void AliTPCcalibCosmic::FindPairs(AliESDEvent *event) {
        Bool_t isCrossO = op0->GetZ()*op1->GetZ()<0;
        Double_t alpha0 = TMath::ATan2(dir0[1],dir0[0]);
        Double_t alpha1 = TMath::ATan2(dir1[1],dir1[0]);
-       Int_t runNr = event->GetRunNumber();
-       UInt_t time = event->GetTimeStamp();
        if (cstream) {
          (*cstream) << "Track0" <<
-           "runNr="<<runNr<<           //  run number
-           "time="<<time<<             //  time stamp of event
+           "run="<<fRun<<              //  run number
+           "event="<<fEvent<<          //  event number
+           "time="<<fTime<<            //  time stamp of event
+           "trigger="<<fTrigger<<      //  trigger
+           "mag="<<fMagF<<             //  magnetic field
            "dir="<<dir<<               //  direction
            "OK="<<isPair<<             //  will be accepted
            "b0="<<b0<<                 //  propagate status
@@ -542,7 +544,7 @@ chain->Lookup();
 
 TCut cutT("cutT","abs(Tr1.fP[3]+Tr0.fP[3])<0.01");  // OK
 TCut cutD("cutD","abs(Tr0.fP[0]+Tr1.fP[0])<2");     // OK
-TCut cutP1("cutP1","abs(Tr0.fP[1]-Tr1.fP[1])<4");   // OK
+TCut cutP1("cutP1","abs(Tr0.fP[1]-Tr1.fP[1])<10");   // OK
 TCut cutPt("cutPt","abs(Tr1.fP[4]+Tr0.fP[4])<0.1&&abs(Tr0.fP[4])+abs(Tr1.fP[4])<10");
 TCut cutN("cutN","min(Orig0.fTPCncls,Orig1.fTPCncls)>100");
 TCut cutA=cutT+cutD+cutPt+cutN+cutP1;
@@ -563,11 +565,143 @@ chain->SetEntryList(elistV40Z100);
 //
 chain->SetAlias("side","(-1+(Tr0.fP[1]>0)*2)");
 chain->SetAlias("hpt","abs(Tr0.fP[4])<0.2");
+chain->SetAlias("signy","(-1+(Tr0.fP[0]>0)*2)");
+
+chain->SetAlias("dy","Tr0.fP[0]+Tr1.fP[0]");
+chain->SetAlias("dz","Tr0.fP[1]-Tr1.fP[1]");
+chain->SetAlias("d1pt","Tr0.fP[4]+Tr1.fP[4]");
 chain->SetAlias("dtheta","(Tr0.fP[3]+Tr1.fP[3])");
+chain->SetAlias("dphi","(Tr0.fAlpha-Tr1.fAlpha-pi)");
+
 chain->SetAlias("mtheta","(Tr0.fP[3]-Tr1.fP[3])*0.5")
 chain->SetAlias("sa","(sin(Tr0.fAlpha+0.))");
 chain->SetAlias("ca","(cos(Tr0.fAlpha+0.))");
 
+
+
+chain->Draw("dy:sqrt(abs(Tr0.fP[4]))>>hisdyA(5,0,1,50,-1,1)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]>0");
+hisdyA->FitSlicesY();
+hisdyA_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdyA_2->SetYTitle("#sigma_{y}(cm)");
+hisdyA_2->SetTitle("Cosmic - Y matching");
+hisdyA_2->SetMaximum(0.5);
+
+
+chain->Draw("dy:sqrt(abs(Tr0.fP[4]))>>hisdyC(5,0,1,50,-1,1)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]<0");
+hisdyC->FitSlicesY();
+hisdyC_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdyC_2->SetYTitle("#sigma_{y}(cm)");
+hisdyC_2->SetTitle("Cosmic - Y matching");
+hisdyC_2->SetMaximum(1);
+hisdyC_2->SetMinimum(0);
+hisdyC_2->SetMarkerStyle(22);
+hisdyA_2->SetMarkerStyle(21);
+hisdyC_2->SetMarkerSize(1.5);
+hisdzA_2->SetMarkerSize(1.5);
+hisdyC_2->Draw();
+hisdyA_2->Draw("same");
+gPad->SaveAs("~/Calibration/Cosmic/pic/ymatching.gif")
+
+chain->Draw("dz:sqrt(abs(Tr0.fP[4]))>>hisdzA(5,0,1,50,-1,1)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]>0");
+hisdzA->FitSlicesY();
+hisdzA_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdzA_2->SetYTitle("#sigma_{z}(cm)");
+hisdzA_2->SetTitle("Cosmic - Z matching - A side ");
+hisdzA_2->SetMaximum(0.5);
+
+chain->Draw("dz:sqrt(abs(Tr0.fP[4]))>>hisdzC(5,0,1,50,-1,1)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]<0");
+hisdzC->FitSlicesY();
+hisdzC_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdzC_2->SetYTitle("#sigma_{z}(cm)");
+hisdzC_2->SetTitle("Cosmic - Z matching");
+hisdzC_2->SetMaximum(0.5);
+hisdzC_2->SetMarkerStyle(22);
+hisdzA_2->SetMarkerStyle(21);
+hisdzC_2->SetMarkerSize(1.5);
+hisdzA_2->SetMarkerSize(1.5);
+
+hisdzC_2->Draw();
+hisdzA_2->Draw("same");
+
+
+//
+// PICTURE 1/pt
+//
+chain->Draw("d1pt:sqrt(abs(Tr0.fP[4]))>>hisd1ptA(5,0,1,30,-0.1,0.1)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]>0");
+hisd1ptA->FitSlicesY();
+hisd1ptA_2->SetXTitle("#sqrt{1/p_{t}}");
+hisd1ptA_2->SetYTitle("#sigma_{z}(cm)");
+hisd1ptA_2->SetTitle("Cosmic - Z matching - A side ");
+hisd1ptA_2->SetMaximum(0.5);
+
+chain->Draw("d1pt:sqrt(abs(Tr0.fP[4]))>>hisd1ptC(5,0,1,30,-0.1,0.1)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]<0");
+hisd1ptC->FitSlicesY();
+hisd1ptC_2->SetXTitle("#sqrt{1/p_{t}}");
+hisd1ptC_2->SetYTitle("#sigma_{1/pt}(1/GeV)");
+hisd1ptC_2->SetTitle("Cosmic - 1/pt matching");
+hisd1ptC_2->SetMaximum(0.05);
+hisd1ptC_2->SetMarkerStyle(22);
+hisd1ptA_2->SetMarkerStyle(21);
+hisd1ptC_2->SetMarkerSize(1.5);
+hisd1ptA_2->SetMarkerSize(1.5);
+
+hisd1ptC_2->Draw();
+hisd1ptA_2->Draw("same");
+gPad->SaveAs("~/Calibration/Cosmic/pic/1ptmatching.gif")
+
+//
+// Theta
+//
+chain->Draw("dtheta:sqrt(abs(Tr0.fP[4]))>>hisdthetaA(5,0,1,30,-0.01,0.01)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]>0");
+hisdthetaA->FitSlicesY();
+hisdthetaA_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdthetaA_2->SetYTitle("#sigma_{#theta}(cm)");
+hisdthetaA_2->SetTitle("Cosmic - Z matching - A side ");
+hisdthetaA_2->SetMaximum(0.5);
+
+chain->Draw("dtheta:sqrt(abs(Tr0.fP[4]))>>hisdthetaC(5,0,1,30,-0.01,0.01)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]<0");
+hisdthetaC->FitSlicesY();
+hisdthetaC_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdthetaC_2->SetYTitle("#sigma_{#theta}(rad)");
+hisdthetaC_2->SetTitle("Cosmic - Theta matching");
+hisdthetaC_2->SetMaximum(0.01);
+hisdthetaC_2->SetMinimum(0.0);
+hisdthetaC_2->SetMarkerStyle(22);
+hisdthetaA_2->SetMarkerStyle(21);
+hisdthetaC_2->SetMarkerSize(1.5);
+hisdthetaA_2->SetMarkerSize(1.5);
+
+hisdthetaC_2->Draw();
+hisdthetaA_2->Draw("same");
+gPad->SaveAs("~/Calibration/Cosmic/pic/thetamatching.gif")
+//
+// Phi
+//
+chain->Draw("dphi:sqrt(abs(Tr0.fP[4]))>>hisdphiA(5,0,1,30,-0.01,0.01)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]>0");
+hisdphiA->FitSlicesY();
+hisdphiA_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdphiA_2->SetYTitle("#sigma_{#phi}(rad)");
+hisdphiA_2->SetTitle("Cosmic - Z matching - A side ");
+hisdphiA_2->SetMaximum(0.5);
+
+chain->Draw("dphi:sqrt(abs(Tr0.fP[4]))>>hisdphiC(5,0,1,30,-0.01,0.01)","!crossO&&!crossI&&abs(d0)<40&&Tr0.fP[1]<0");
+hisdphiC->FitSlicesY();
+hisdphiC_2->SetXTitle("#sqrt{1/p_{t}}");
+hisdphiC_2->SetYTitle("#sigma_{#phi}(rad)");
+hisdphiC_2->SetTitle("Cosmic - Phi matching");
+hisdphiC_2->SetMaximum(0.01);
+hisdphiC_2->SetMinimum(0.0);
+hisdphiC_2->SetMarkerStyle(22);
+hisdphiA_2->SetMarkerStyle(21);
+hisdphiC_2->SetMarkerSize(1.5);
+hisdphiA_2->SetMarkerSize(1.5);
+
+hisdphiC_2->Draw();
+hisdphiA_2->Draw("same");
+gPad->SaveAs("~/Calibration/Cosmic/pic/phimatching.gif")
+
+
+
 }
 
 
@@ -589,18 +723,21 @@ TMatrixD covMatrix;
 
 TString fstring="";
 // 
+fstring+="mtheta++";
 fstring+="ca++";
 fstring+="sa++";
 fstring+="ca*mtheta++";
 fstring+="sa*mtheta++";
+//
 fstring+="side++";
+fstring+="side*mtheta++";
 fstring+="side*ca++";
 fstring+="side*sa++";
 fstring+="side*ca*mtheta++";
 fstring+="side*sa*mtheta++";
 
 
-TString *strTheta0 = toolkit.FitPlane(chain,"dtheta",fstring->Data(), "hpt"+cutS, chi2,npoints,fitParamA0,covMatrix,0.8);
+TString *strTheta0 = toolkit.FitPlane(chain,"dtheta",fstring->Data(), "hpt&&!crossI&&!crossO", chi2,npoints,fitParamA0,covMatrix,0.8);
 chain->SetAlias("dtheta0",strTheta0.Data());
 strTheta0->Tokenize("+")->Print();
 
@@ -726,7 +863,7 @@ TCut cutT("cutT","abs(Tr1.fP[3]+Tr0.fP[3])<0.03");  // OK
 TCut cutD("cutD","abs(Tr0.fP[0]+Tr1.fP[0])<5");     // OK
 TCut cutPt("cutPt","abs(Tr1.fP[4]+Tr0.fP[4])<0.2&&abs(Tr0.fP[4])+abs(Tr1.fP[4])<10");
 TCut cutN("cutN","min(Orig0.fTPCncls,Orig1.fTPCncls)>110");
-TCut cutA="abs(norm-1)<0.3"+cutT+cutD+cutPt+cutN;
+TCut cutA=cutT+cutD+cutPt+cutN;
 
 
 
@@ -762,3 +899,13 @@ chain->SetAlias("corQT",strqdedx->Data());
 */
 
 
+/*
+  chain->SetProof(kTRUE);
+  chain->Draw("Seed0.CookdEdxNorm(0,0.6,1,0,159,0,kTRUE,kTRUE):Seed0.CookdEdxNorm(0,0.6,1,0,159,0,kFALSE,kTRUE)",""+cutA,"",1000);
+
+
+chain->Draw("Seed0.CookdEdxNorm(0,0.6,1,0,159,0,kTRUE,kTRUE)/Seed1.CookdEdxNorm(0,0.6,1,0,159,0,kTRUE,kTRUE)>>his(100,0.5,1.5)","min(Orig0.fTPCncls,Orig1.fTPCncls)>130"+cutA,"",50000);
+
+*/
+
+
index a9b058c16b64be1108d1dbea22071a63a798fc14..0fb464eea3a5d7eb0f3f3449794273ed7ec74695 100644 (file)
@@ -57,7 +57,7 @@ private:
   TH1F  *fDeDxMIP;                //  TPC signal close to the MIP region of muons 0.4 < p < 0.45 GeV
 
   Double_t fMIPvalue;             //  MIP value calculated via a fit to fDeDxMIP
-
+  //
   // cuts
   //
   Float_t fCutMaxD;     // maximal distance in rfi ditection
index a682c3b91d344e07df98aba0eaf15044bb7b4353..e571abeada38af9cb5acface6e0bac241629838f 100644 (file)
@@ -704,5 +704,6 @@ void  AliTPCcalibDB::SetExBField(Float_t bz){
   //
   // Set magnetic filed for ExB correction
   //
+  printf("Set magnetic field for ExB correction = %f\n",bz); 
   fExB = GetExB(bz,kFALSE);
 }
index 3978a3ba59f53764e5e017c094a09810253a9dd8..65cc580afe780dfbeb28501dbcdcb91f96ea3a9c 100644 (file)
 #include <iostream>
 #include <sstream>
 #include "AliTPCLaserTrack.h"
+#include "AliTPCcalibDB.h"
+#include "AliTPCParam.h"
 
 using namespace std;
 
@@ -176,16 +178,19 @@ AliTPCcalibLaser::AliTPCcalibLaser():
   fHisPz2vP2Out(0),  //-> Curv  P2outer - parabola
   fHisPz3vP2IO(0),   //-> Curv  P2outerinner - common parabola
   //
-  fDeltaYres(336),
-  fDeltaZres(336),  
+  fDeltaYres(336),   //->2D histo of residuals
+  fDeltaZres(336),   //->2D histo fo residuals
+  fDeltaYres2(336),   //->2D histo of residuals
+  fDeltaZres2(336),   //->2D histo fo residuals
+  //fDeltaYres3(336),   //->2D histo of residuals
+  //fDeltaZres3(336),   //->2D histo fo residuals
   fFitAside(new TVectorD(3)),
   fFitCside(new TVectorD(3)),      
+  fFitACside(new TVectorD(4)),      
   fEdgeXcuts(3),    
   fEdgeYcuts(3),    
   fNClCuts(5),      
-  fNcuts(0),        
-  fRun(0),
-  fEvent(0)
+  fNcuts(0)        
 {
   //
   // Constructor
@@ -257,14 +262,17 @@ AliTPCcalibLaser::AliTPCcalibLaser(const Text_t *name, const Text_t *title):
   //
   fDeltaYres(336),
   fDeltaZres(336),  
+  fDeltaYres2(336),
+  fDeltaZres2(336),  
+  //  fDeltaYres3(336),
+  //fDeltaZres3(336),  
   fFitAside(new TVectorD(3)),        // drift fit - A side
   fFitCside(new TVectorD(3)),        // drift fit - C- side
+  fFitACside(new TVectorD(4)),        // drift fit - AC- side
   fEdgeXcuts(3),       // cuts in local x direction; used in the refit of the laser tracks
   fEdgeYcuts(3),       // cuts in local y direction; used in the refit of the laser tracks
   fNClCuts(5),         // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
-  fNcuts(0),           // number of cuts
-  fRun(0),
-  fEvent(0)
+  fNcuts(0)           // number of cuts
 {
   SetName(name);
   SetTitle(title);
@@ -337,14 +345,17 @@ AliTPCcalibLaser::AliTPCcalibLaser(const AliTPCcalibLaser& calibLaser):
   //
   fDeltaYres(((calibLaser.fDeltaYres))),
   fDeltaZres(((calibLaser.fDeltaZres))),  
+  fDeltaYres2(((calibLaser.fDeltaYres))),
+  fDeltaZres2(((calibLaser.fDeltaZres))),  
+  //  fDeltaYres3(((calibLaser.fDeltaYres))),
+  //fDeltaZres3(((calibLaser.fDeltaZres))),  
   fFitAside(new TVectorD(3)),        // drift fit - A side
   fFitCside(new TVectorD(3)),        // drift fit - C- side
+  fFitACside(new TVectorD(4)),        // drift fit - C- side
   fEdgeXcuts(3),       // cuts in local x direction; used in the refit of the laser tracks
   fEdgeYcuts(3),       // cuts in local y direction; used in the refit of the laser tracks
   fNClCuts(5),         // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
-  fNcuts(0),           // number of cuts
-  fRun(0),             // run number
-  fEvent(0)            // current eventnumber
+  fNcuts(0)           // number of cuts
 {
   //
   // copy constructor
@@ -424,6 +435,7 @@ void AliTPCcalibLaser::Process(AliESDEvent * event) {
   //
   // Loop over tracks and call  Process function
   //
+  Int_t kMinTracks=20;
   fESD = event;
   if (!fESD) {
     return;
@@ -432,6 +444,7 @@ void AliTPCcalibLaser::Process(AliESDEvent * event) {
   if (!fESDfriend) {
     return;
   }
+  if (fESD->GetNumberOfTracks()<kMinTracks) return; //not enough tracks
   AliDebug(4,Form("Event number in current file: %d",event->GetEventNumberInFile()));
   fTracksTPC.Clear();
   fTracksEsd.Clear();
@@ -448,8 +461,7 @@ void AliTPCcalibLaser::Process(AliESDEvent * event) {
   }
   //
   Int_t n=fESD->GetNumberOfTracks();
-  Int_t run = fESD->GetRunNumber();
-  fRun = run;
+  Int_t counter=0;
   for (Int_t i=0;i<n;++i) {
     AliESDfriendTrack *friendTrack=fESDfriend->GetTrack(i);
     AliESDtrack *track=fESD->GetTrack(i);
@@ -459,10 +471,13 @@ void AliTPCcalibLaser::Process(AliESDEvent * event) {
       if ((seed=dynamic_cast<AliTPCseed*>(calibObject)))
        break;
     if (track&&seed) {
-      FindMirror(track,seed);
+      Int_t id = FindMirror(track,seed);
+      if (id>0) counter++;
     }
     //
   }  
+  if (counter<kMinTracks) return;
+
   FitDriftV();
   //
   for (Int_t id=0; id<336; id++){    
@@ -476,7 +491,6 @@ void AliTPCcalibLaser::Process(AliESDEvent * event) {
     }
   }
 
- fEvent++;
 }
 
 void AliTPCcalibLaser::MakeDistHisto(Int_t id){
@@ -491,38 +505,14 @@ void AliTPCcalibLaser::MakeDistHisto(Int_t id){
     //
     //
     TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
+    if (!hisdz) MakeFitHistos();
+    hisdz = (TH1F*)fDeltaZ.At(id);
     TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
     TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
-
     TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
     TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
     TH1F * hisSignal = (TH1F*)fSignals.At(id);
-
-    if (!hisdz){
-      hisdz = new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
-      hisdz->SetDirectory(0);
-      fDeltaZ.AddAt(hisdz,id);
-
-      hisP3 = new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
-      hisP3->SetDirectory(0);
-      fDeltaP3.AddAt(hisP3,id);
-      //
-      hisP4 = new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
-      hisP4->SetDirectory(0);
-      fDeltaP4.AddAt(hisP4,id);
-
-      //
-      hisdphi = new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
-      hisdphi->SetDirectory(0);
-      fDeltaPhi.AddAt(hisdphi,id);
-      //
-      hisdphiP = new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
-      hisdphiP->SetDirectory(0);
-      fDeltaPhiP.AddAt(hisdphiP,id);
-      hisSignal = new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
-      hisSignal->SetDirectory(0);
-      fSignals.AddAt(hisSignal,id);
-    }
+    //
 
     AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
     AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
@@ -553,38 +543,76 @@ void AliTPCcalibLaser::MakeDistHisto(Int_t id){
 
 void AliTPCcalibLaser::FitDriftV(){
   //
-  // Fit drift velocity - linear approximation in the z and global y
-  //
-  Float_t kDistCut           = 4;      // cut on distance to the fitted value
-  const Float_t kZCut        = 200;    // remove the closest laser beam
+  // 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
+  // 
+  /*
+    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 Float_t kZCut        = 240;    // remove the closest laser beam
   const Float_t kSaturCut    = 0.05;   // remove saturated lasers - cut on fraction of saturated 
+  const Float_t kDistCut     = 3;    // distance sigma cut
+  const Float_t kDistCutAbs  = 0.25;  
   const Float_t kMinClusters = 60;  // minimal amount of the clusters
   const Float_t kMinSignal   = 16;  // minimal mean height of the signal
   const Float_t kChi2Cut     = 0.1; // chi2 cut to accept drift fit
   static TLinearFitter fdriftA(3,"hyp2");
   static TLinearFitter fdriftC(3,"hyp2");
-  static TLinearFitter fdriftA1(2,"hyp1");
-  static TLinearFitter fdriftC1(2,"hyp1");
-  TVectorD fitA(3),fitC(3);
-
+  static TLinearFitter fdriftAC(4,"hyp3");
+  TVectorD fitA(3),fitC(3),fitAC(4);
+  
+  AliTPCcalibDB*  calib=AliTPCcalibDB::Instance();
+  AliTPCParam  * tpcparam    = calib->GetParameters(); 
+   
+  //
   for (Int_t id=0; id<336; id++) fFitZ[id]=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;
 
-  for (Int_t iter=0; iter<2; iter++){
+
+  for (Int_t iter=0; iter<3; iter++){
     fdriftA.ClearPoints();
     fdriftC.ClearPoints();
-    fdriftA1.ClearPoints();
-    fdriftC1.ClearPoints();
+    fdriftAC.ClearPoints();
     //
     for (Int_t id=0; id<336; id++){
       if (!fTracksEsdParam.At(id)) continue;
       if (!AcceptLaser(id)) continue;
-      if (TMath::Abs(fFitZ[id])>kDistCut-iter) 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];
@@ -594,22 +622,30 @@ void AliTPCcalibLaser::FitDriftV(){
       ltrp->GetXYZ(lxyz);
       ltrp->GetPxPyPz(lpxyz);
       if (TMath::Abs(lxyz[2])>kZCut) continue;
-      Double_t xxx[2] = {lxyz[2],lxyz[1]};
+      Float_t sz = (ltrp->GetSide()==0) ? TMath::Sqrt(chi2A): TMath::Sqrt(chi2C);
+      if (npointsAC>0) sz =TMath::Sqrt(chi2AC); 
+      if (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 xxx[2] = {ldrift,lxyz[1]*ldrift/(zlength*250.)};
       if (ltrp->GetSide()==0){
-       fdriftA1.AddPoint(xxx,xyz[2],1);
-       fdriftA.AddPoint(xxx,xyz[2],1);
+       fdriftA.AddPoint(xxx,mdrift,1);
       }else{
-       fdriftC1.AddPoint(xxx,xyz[2],1);
-       fdriftC.AddPoint(xxx,xyz[2],1);
+       fdriftC.AddPoint(xxx,mdrift,1);
       }
+      Double_t xxx2[3] = {ltrp->GetSide(), ldrift,lxyz[1]*ldrift/(zlength*250.)};
+      fdriftAC.AddPoint(xxx2,mdrift,1);
     }
-    Float_t chi2A = 0;
-    Float_t chi2C = 0;
-    Int_t npointsA=0;
-    Int_t npointsC=0;
     //
     if (fdriftA.GetNpoints()>10){
+      //
       fdriftA.Eval();
+      if (iter==0) fdriftA.EvalRobust(0.7);
+      else fdriftA.EvalRobust(0.8);
       fdriftA.GetParameters(fitA);
       npointsA= fdriftA.GetNpoints();
       chi2A = fdriftA.GetChisquare()/fdriftA.GetNpoints();
@@ -617,11 +653,25 @@ void AliTPCcalibLaser::FitDriftV(){
     }
     if (fdriftC.GetNpoints()>10){
       fdriftC.Eval();
+      if (iter==0) fdriftC.EvalRobust(0.7);
+      else fdriftC.EvalRobust(0.8);
+      //
       fdriftC.GetParameters(fitC);
       npointsC= fdriftC.GetNpoints();
       chi2C = fdriftC.GetChisquare()/fdriftC.GetNpoints();
       if (chi2C<kChi2Cut||(*fFitCside)[0]==0) (*fFitCside) = fitC;
     }
+
+    if (fdriftAC.GetNpoints()>10&&fdriftC.GetNpoints()>10&&fdriftA.GetNpoints()>10){
+      fdriftAC.Eval();
+      if (iter==0) fdriftAC.EvalRobust(0.7);
+      else fdriftAC.EvalRobust(0.8);
+      //
+      fdriftAC.GetParameters(fitAC);
+      npointsAC= fdriftAC.GetNpoints();
+      chi2AC = fdriftAC.GetChisquare()/fdriftAC.GetNpoints();
+      if (chi2AC<kChi2Cut||(*fFitACside)[0]==0) (*fFitACside) = fitAC;
+    }
     
     for (Int_t id=0; id<336; id++){
       if (!fTracksEsdParam.At(id)) continue;
@@ -635,28 +685,41 @@ void AliTPCcalibLaser::FitDriftV(){
       param->GetXYZ(xyz);
       param->GetPxPyPz(pxyz);
       ltrp->GetXYZ(lxyz);
-      ltrp->GetPxPyPz(lpxyz);
+      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]);
+
       Float_t fz =0;
       if (ltrp->GetSide()==0){
-       fz = (fitA)[0]+(fitA)[1]*lxyz[2]+(fitA)[2]*lxyz[1];
+       fz = (fitA)[0]+(fitA)[1]*ldrift+(fitA)[2]*lxyz[1]*ldrift/(zlength*250.);
       }else{
-       fz = (fitC)[0]+(fitC)[1]*lxyz[2]+(fitC)[2]*lxyz[1];     
+       fz = (fitC)[0]+(fitC)[1]*ldrift+(fitC)[2]*lxyz[1]*ldrift/(zlength*250.);        
       }
-      fFitZ[id]=xyz[2]-fz;
+      if (npointsAC>10){
+       fz = (fitAC)[0]+(fitAC)[1]*ltrp->GetSide()+(fitAC)[2]*ldrift+(fitAC)[3]*lxyz[1]*ldrift/(zlength*250.);
+      }
+      fFitZ[id]=mdrift-fz;
     }
     if (fStreamLevel>0){
       TTreeSRedirector *cstream = GetDebugStreamer();
-      Int_t time = fESD->GetTimeStamp();
       if (cstream){
-       (*cstream)<<"driftv"<<      
+       (*cstream)<<"driftv"<<
+         "run="<<fRun<<              //  run number
+         "event="<<fEvent<<          //  event number
+         "time="<<fTime<<            //  time stamp of event
+         "trigger="<<fTrigger<<      //  trigger
+         "mag="<<fMagF<<             //  magnetic field
          "iter="<<iter<<
          "driftA.="<<fFitAside<<
          "driftC.="<<fFitCside<<
+         "driftAC.="<<fFitACside<<
          "chi2A="<<chi2A<<
          "chi2C="<<chi2C<<
+         "chi2AC="<<chi2AC<<
          "nA="<<npointsA<<
          "nC="<<npointsC<<
-         "time="<<time<<
+         "nAC="<<npointsAC<<
          "\n";
       }
     }
@@ -732,9 +795,11 @@ Int_t  AliTPCcalibLaser::FindMirror(AliESDtrack *track, AliTPCseed *seed){
   //
   // Find corresponding mirror
   // add the corresponding tracks
-  //
-  Float_t kRadius0 = 252;
-  Float_t kRadius  = 253.4;
+
+  Float_t kRadius0  = 252;
+  Float_t kRadius   = 253.4;
+
   if (!track->GetOuterParam()) return -1;
   AliExternalTrackParam param(*(track->GetOuterParam()));
   AliTracker::PropagateTrackTo(&param,kRadius0,0.10566,3,kTRUE);
@@ -829,7 +894,13 @@ void AliTPCcalibLaser::DumpLaser(Int_t id) {
     Bool_t accept = AcceptLaser(id);
     if (cstream){
       (*cstream)<<"Track"<<
-       "run="<<fRun<<
+       //
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field
+
        "id="<<id<<
        "accept="<<accept<<
        "driftA.="<<fFitAside<<
@@ -876,6 +947,19 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
   // store x, y, z information for all models and the cluster to calculate the residuals
   //
   
+  // The clusters which do not fulfill given  criteria are skipped
+  //
+  // Cluters removed from fit
+  //  1. Extended shape     > kShapeCut
+  //  2. In saturation  Max > kMax
+  //  3. Distance to edge   < cutEdge
+  //
+  // Clusters not used for the calibration:
+  //
+  //  1. Extended shape     > kShapeCut
+  //  2. In saturation  Max > kMax
+
+
   AliTPCseed *track      = (AliTPCseed*)fTracksTPC.At(id);
   AliExternalTrackParam *extparam=(AliExternalTrackParam*)fTracksEsdParam.At(id);
   AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
@@ -883,7 +967,13 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
   AliTPCclusterMI dummyCl;
 
   //two tracklets
-  Int_t kMaxTracklets=2;
+  Int_t kMaxTracklets=2;  
+  Float_t kShapeCut = 1.3;
+  Float_t kRatioCut = 2.;
+
+  Float_t kMax      = 900.;
+
+
   //=============================================//
   // Linear Fitters for the Different Approaches //
   //=============================================//
@@ -913,8 +1003,12 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
   // Loop over all Tracklet Cuts //
   //=============================//
   for (Int_t icut=0; icut<fNcuts; icut++){
-    Float_t xinMin = 250, xinMax=90;
-    Float_t xoutMin=250, xoutMax=90;
+    Float_t xinMin = 2500, xinMax=-90;
+    Float_t xoutMin=2500, xoutMax=-90;
+    Float_t msigmaYIn=0;
+    Float_t msigmaYOut=0;
+    Float_t mqratioIn=0;
+    Float_t mqratioOut=0;
 
 
       AliDebug(4,Form("Processing cut %d for track with ID %d",icut,id));
@@ -933,6 +1027,10 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
       TVectorD vecy2resOuter(3),vecz2resOuter(3); //pol2 fit parameters outer
       TVectorD vecy4res(5),vecz4res(5);
       // cluster and track positions for each row - used for residuals
+      TVectorD vecgX(159);        // global X
+      TVectorD vecgY(159);        // global Y
+      TVectorD vecgZ(159);        // global Z
+
       TVectorD vecX(159);        // x is the same for all (row center)
       TVectorD vecYkalman(159);  // y from kalman fit
       TVectorD vecZkalman(159);  // z from kalman fit
@@ -945,6 +1043,7 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
       TVectorD vecClY(159);      // y cluster position
       TVectorD vecClZ(159);      // z cluster position
       TVectorD vecSec(159);      // sector for each row
+      TVectorD  isReject(159);    // flag - cluster to be rejected 
       //chi2 of fits
       Double_t chi2I1z=0;       // chi2 of pol1 fit in z (inner)
       Double_t chi2I1y=0;       // chi2 of pol1 fit in y (inner)
@@ -1015,6 +1114,10 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
       // fill fitters with cluster information //
       //=======================================//
       AliDebug(3,"Filing Cluster Information");
+
+      //
+      //
+
       for (Int_t irow=158;irow>-1;--irow) {
          AliTPCclusterMI *c=track->GetClusterPointer(irow);
          AliTPCclusterMI &cl = (AliTPCclusterMI&) (*arrCl[irow]);
@@ -1040,7 +1143,7 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
           //
           vecSec[irow]=-1;
          if (!c) continue;
-         Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(meanY);
+         Double_t pedgeY = c->GetX()*TMath::Tan(TMath::DegToRad()*(10))-TMath::Abs(meanY);
          Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
          
           //
@@ -1056,6 +1159,12 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
          vecX[irow]   = c->GetX();
          vecClY[irow] = c->GetY();
          vecClZ[irow] = c->GetZ();
+         //
+         Float_t gxyz[3];
+         c->GetGlobalXYZ(gxyz);
+         vecgX[irow]   = gxyz[0];
+         vecgY[irow]   = gxyz[1];
+         vecgZ[irow]   = gxyz[2];
           //
           Double_t x = vecX[irow]-133.4; //reference is between IROC and OROC
           Double_t y = vecClY[irow];
@@ -1080,8 +1189,12 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              fy2I.AddPoint(x2,y);
              fz2I.AddPoint(x2,z);
               ++nclI;
-             if (x<xinMin) xinMin=x;
-             if (x>xinMax) xinMax=x;
+             if (c->GetX()<xinMin) xinMin=c->GetX();
+             if (c->GetX()>xinMax) xinMax=c->GetX();
+
+             msigmaYIn +=TMath::Sqrt(c->GetSigmaY2());
+             mqratioIn +=c->GetMax()/c->GetQ();
+
          }
          if ( roc==outerSector ){
              fy1O.AddPoint(x2,y);
@@ -1089,12 +1202,23 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              fy2O.AddPoint(x2,y);
              fz2O.AddPoint(x2,z);
               ++nclO;
-             if (x<xoutMin) xoutMin=x;
-             if (x>xoutMax) xoutMax=x;
+             if (c->GetX()<xoutMin) xoutMin=c->GetX();
+             if (c->GetX()>xoutMax) xoutMax=c->GetX();
+             msigmaYOut +=TMath::Sqrt(c->GetSigmaY2());
+             mqratioOut +=c->GetMax()/c->GetQ();
+
          }
          fy4.AddPoint(x4,y);
          fz4.AddPoint(x4,z);
       }
+      if (nclI>0)  {
+       msigmaYIn/=nclI;
+       mqratioIn/=nclI;
+      }
+      if (nclO>0)  {
+       msigmaYOut/=nclO;
+       mqratioOut/=nclO;
+      }
       //======================================//
       // Evaluate and retrieve fit parameters //
       //======================================//
@@ -1153,6 +1277,29 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
       //==============================//
       AliDebug(4,"Calculate tracklet positions");
       for (Int_t irow=158;irow>-1;--irow) {
+       isReject[irow]=0;
+        AliTPCclusterMI *c=track->GetClusterPointer(irow);
+        if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) { // no cluster in given sectors
+          isReject[irow]+=1;
+        }
+
+        if (!c) { //no cluster    
+          isReject[irow]+=2;
+        }else{
+          if (c->GetMax()>kMax){   //saturation
+            isReject[irow]+=4;
+          }
+          if ( vecSec[irow] == outerSector ) {   //extended shape
+            if (c->GetMax()/c->GetQ()> mqratioOut*kRatioCut)                isReject[irow]+=8;
+            if (TMath::Sqrt(c->GetSigmaY2())>msigmaYOut*kShapeCut)    isReject[irow]+=16;
+          }else{
+            if (c->GetMax()/c->GetQ()> mqratioIn*kRatioCut)                isReject[irow]+=8;
+            if (TMath::Sqrt(c->GetSigmaY2())>msigmaYIn*kShapeCut)    isReject[irow]+=16;
+          }       
+        }
+
+
+
          if ( vecSec[irow]==-1 ) continue;  //no cluster info
           if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) continue;
          tr=&dummy;
@@ -1200,6 +1347,10 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              vecYkalman[irow]=xyz[1];
              vecZkalman[irow]=xyz[2];
          }
+         //
+         //
+         //
+        
       }
       //=====================================================================//
       // write results from the different tracklet fits with debug streamers //
@@ -1209,6 +1360,12 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
          if (cstream){
            Float_t dedx = track->GetdEdx();
            (*cstream)<<"FitModels"<<
+             "run="<<fRun<<              //  run number
+             "event="<<fEvent<<          //  event number
+             "time="<<fTime<<            //  time stamp of event
+             "trigger="<<fTrigger<<      //  trigger
+             "mag="<<fMagF<<             //  magnetic field          
+             //
              "cutNr="      << icut <<
              "edgeCutX="   << edgeCutX <<
              "edgeCutY="   << edgeCutY <<
@@ -1246,6 +1403,10 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              "xinMax="     << xinMax<<
              "xoutMin="    << xoutMin<<
              "xoutMax="     << xoutMax<<
+             "msigmaYIn=" <<msigmaYIn<<
+             "msigmaYOut=" <<msigmaYOut<<
+             "mqratioIn=" <<mqratioIn<<
+             "mqratioOut=" <<  mqratioOut      <<
              "\n";
          }
       }
@@ -1256,6 +1417,12 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
          if (cstream){
            Float_t dedx = track->GetdEdx();
            (*cstream)<<"Residuals"<<
+             "run="<<fRun<<              //  run number
+             "event="<<fEvent<<          //  event number
+             "time="<<fTime<<            //  time stamp of event
+             "trigger="<<fTrigger<<      //  trigger
+             "mag="<<fMagF<<             //  magnetic field          
+             //
              "cutNr="      << icut <<
              "edgeCutX="   << edgeCutX <<
              "edgeCutY="   << edgeCutY <<
@@ -1264,6 +1431,9 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              "Tr.="        << extparam<<
              "dEdx="       << dedx <<
              "Cl.="        << &arrCl <<
+             "vX.="        << &vecgX<<   // global x
+             "vY.="        << &vecgY<<   // global y
+             "vZ.="        << &vecgZ<<   // global z
              "TrX.="       << &vecX <<
              "TrYpol1.="   << &vecY1 <<
              "TrZpol1.="   << &vecZ1 <<
@@ -1273,6 +1443,7 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              "TrZInOut.="  << &vecZ4 <<
              "ClY.="       << &vecClY <<
              "ClZ.="       << &vecClZ <<
+             "isReject.="  << &isReject<<
              "sec.="       << &vecSec <<
              "nclI="       << nclI <<
              "nclO="       << nclO <<
@@ -1280,8 +1451,13 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              "xinMax="     << xinMax<<
              "xoutMin="    << xoutMin<<
              "xoutMax="     << xoutMax<<
+             "msigmaYIn=" <<msigmaYIn<<
+             "msigmaYOut=" <<msigmaYOut<<
+             "mqratioIn=" <<mqratioIn<<
+             "mqratioOut=" <<  mqratioOut      <<
              "yInOut.="    << &vecy4res <<
              "zInOut.="    << &vecz4res <<
+             //chi2s
              "chi2y1In="   << chi2I1y <<    //
              "chi2z1In="   << chi2I1z <<
              "chi2y1Out="  << chi2O1y <<
@@ -1292,6 +1468,16 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
              "chi2z2Out="  << chi2O2z <<
              "chi2yInOut=" << chi2IOy <<
              "chi2zInOut=" << chi2IOz <<
+             // fit parameters
+             "yPol1In.="   << &vecy1resInner <<
+             "zPol1In.="   << &vecz1resInner <<
+             "yPol2In.="   << &vecy2resInner <<
+             "zPol2In.="   << &vecz2resInner <<
+             "yPol1Out.="  << &vecy1resOuter <<
+             "zPol1Out.="  << &vecz1resOuter <<
+             "yPol2Out.="  << &vecy2resOuter <<
+             "zPol2Out.="  << &vecz2resOuter <<
+
              "\n";
 
          }
@@ -1299,39 +1485,45 @@ void AliTPCcalibLaser::RefitLaserJW(Int_t id){
       //==========================//
       // Fill Residual Histograms //
       //==========================//
-      TProfile *profy = (TProfile*)fDeltaYres.UncheckedAt(id);
-      TProfile *profz = (TProfile*)fDeltaZres.UncheckedAt(id);
-      if (!profy){
-       profy=new TProfile(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d",id),160,0,160);
-       profy->SetDirectory(0);
-       fDeltaYres.AddAt(profy,id);
-      }
-      if (!profz){
-       profz=new TProfile(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d",id),160,0,160);
-       profz->SetDirectory(0);
-       fDeltaZres.AddAt(profz,id);
-      }
+      if (!fHisNclIn) MakeFitHistos(); 
+
+      TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
+      TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
+      TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
+      TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
+      //      TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
+      //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
+      //
       for (Int_t irow=158;irow>-1;--irow) {
-       if (vecSec[irow]==-1)continue; //no cluster info
+       if (vecSec[irow]==-1)continue; // no cluster info
+       if (isReject[irow]>0.5) continue;  // 
        Double_t x    = vecX[irow];
        Double_t ycl  = vecClY[irow];
        Double_t yfit = vecY1[irow];
+       Double_t yfit2 = vecY2[irow];
+       Double_t yfit3 = vecY2[irow];
        Double_t zcl  = vecClZ[irow];
        Double_t zfit = vecZ1[irow];
+       Double_t zfit2 = vecZ2[irow];
+       Double_t zfit3 = vecZ2[irow];
+
        if (TMath::Abs(yfit-ycl)<2&&TMath::Abs(zfit-zcl)<2){
-         if (profy) 
-           if (profy->GetEntries()<1000000) 
-             profy->Fill(irow,yfit-ycl);
-         if (profz) 
-           if (profz->GetEntries()<1000000) 
-             profz->Fill(irow,zfit-zcl);
+         if (profy){       
+             profy->Fill(irow,ycl-yfit);
+             profy2->Fill(irow,ycl-yfit2);
+             //              profy3->Fill(irow,ycl-yfit3);
+         }
+         if (profz) {
+             profz->Fill(irow,zcl-zfit);
+             profz2->Fill(irow,zcl-zfit2);
+             //profz3->Fill(irow,zcl-zfit3);
+         }
        }
       }
       //
       //
       // Fill laser fit histograms
       //
-      if (!fHisNclIn) MakeFitHistos(); 
       Float_t dedx = track->GetdEdx();
       if (nclI>20&&nclO>20){
        fHisNclIn->Fill(id,nclI);      //->Number of clusters inner
@@ -1423,7 +1615,7 @@ void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run, Int_t minEntries)
     TH1F * hisP4    = (TH1F*)laser->fDeltaP4.At(id);
     TH1F * hisS    = (TH1F*)laser->fSignals.At(id);
     //if (!hisphi) continue;
-    Double_t entries = hisphi->GetEntries();
+    Double_t entries = (hisphi==0)? 0: hisphi->GetEntries();
     //if (entries<minEntries) continue;
     //
     AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
@@ -1503,9 +1695,6 @@ void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run, Int_t minEntries)
     Float_t mdEdx =  his->GetMean();
     delete his;
     //
-    his = fHisdZfit->ProjectionY("aaa",id+1,id+1);
-    Float_t mdZfit =  his->GetMean();
-    delete his;
     //
     //
     //
@@ -1542,6 +1731,12 @@ void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run, Int_t minEntries)
     //
     // fit res. histos
     // 
+    his = fHisdZfit->ProjectionY("aaa",id+1,id+1);
+    Float_t  edZfit  = his->GetEntries();
+    Float_t  mdZfit =  his->GetMean();
+    Float_t  rdZfit  = his->GetRMS();
+    delete his;
+
     his = fHisPy1vP0->ProjectionY("aaa",id+1,id+1);     //-> delta y   P0outer-P0inner - line
     Float_t  ePy1vP0  = his->GetEntries();
     Float_t  mPy1vP0  = his->GetMean();
@@ -1653,7 +1848,6 @@ void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run, Int_t minEntries)
     delete his;
     
     //
-    if (run<=0) run=fRun;
     (*pcstream)<<"Mean"<<
       "run="<<run<<               //
       "isOK="<<isOK<<             //
@@ -1669,7 +1863,9 @@ void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run, Int_t minEntries)
       "mLclOut="<<mLclOut<<       // mean number of clusters in outer
       "mLclIO="<<mLclIO<<         // mean number of clusters in inner+outer
       "mdEdx="<<mdEdx<<           // mean dEdx
+      "edZfit="<<edZfit<<           // entries z fit
       "mdZfit="<<mdZfit<<           // mean z fit
+      "rdZfit="<<rdZfit<<           // RMS z fit
       //
       //
       "mChi2YIn1="<<mChi2YIn1<<       //->chi2 y inner - line
@@ -1953,18 +2149,22 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
 
   TIterator* iter = li->MakeIterator();
   AliTPCcalibLaser* cal = 0;
-
+  static Int_t counter0=0;
   while ((cal = (AliTPCcalibLaser*)iter->Next())) {
     if (!cal->InheritsFrom(AliTPCcalibLaser::Class())) {
       Error("Merge","Attempt to add object of class %s to a %s", cal->ClassName(), this->ClassName());
       return -1;
     }
+    printf("Marging number %d\n", counter0);
+    counter0++;
     //
     MergeFitHistos(cal);
     TH1F *h=0x0;
     TH1F *hm=0x0;
-    TProfile *hp=0x0;
-    TProfile *hpm=0x0;
+    TH2F *h2=0x0;
+    TH2F *h2m=0x0;
+    //    TProfile *hp=0x0;
+    //TProfile *hpm=0x0;
 
     for (Int_t id=0; id<336; id++){
       // merge fDeltaZ histograms
@@ -2025,24 +2225,30 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
       if (hm) h->Add(hm);
       //
       //
-      // merge ProfileY histograms
-      hpm = (TProfile*)cal->fDeltaYres.At(id);
-      hp  = (TProfile*)fDeltaYres.At(id);
-      if (!hp) {
-       hp=new TProfile(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d",id),160,0,160);
-       hp->SetDirectory(0);
-       fDeltaYres.AddAt(hp,id);
-      }
-      if (hpm) hp->Add(hpm);
+      // merge ProfileY histograms -0
+      h2m = (TH2F*)cal->fDeltaYres.At(id);
+      h2  = (TH2F*)fDeltaYres.At(id);
+      if (h2m) h2->Add(h2m);
       //
-      hpm = (TProfile*)cal->fDeltaZres.At(id);
-      hp  = (TProfile*)fDeltaZres.At(id);
-      if (!hp) {
-       hp=new TProfile(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d",id),160,0,160);
-       hp->SetDirectory(0);
-       fDeltaZres.AddAt(hp,id);
-      }
-      if (hpm) hp->Add(hpm);
+      h2m = (TH2F*)cal->fDeltaZres.At(id);
+      h2  = (TH2F*)fDeltaZres.At(id);
+      if (h2m) h->Add(h2m);
+      // merge ProfileY histograms - 2
+      h2m = (TH2F*)cal->fDeltaYres2.At(id);
+      h2  = (TH2F*)fDeltaYres2.At(id);
+      if (h2m) h2->Add(h2m);
+      //
+      h2m = (TH2F*)cal->fDeltaZres2.At(id);
+      h2  = (TH2F*)fDeltaZres2.At(id);
+      if (h2m) h->Add(h2m);
+      // merge ProfileY histograms - 3
+      //h2m = (TH2F*)cal->fDeltaYres3.At(id);
+      //h2  = (TH2F*)fDeltaYres3.At(id);
+      //if (h2m) h2->Add(h2m);
+      //
+      //h2m = (TH2F*)cal->fDeltaZres3.At(id);
+      //h2  = (TH2F*)fDeltaZres3.At(id);
+      //if (h2m) h->Add(h2m);
       //
       //
     }
@@ -2069,7 +2275,7 @@ void   AliTPCcalibLaser::MakeFitHistos(){
   fHisLclIO  = new TH2F("HisLclIO","HisLclIO",336,0,336,160,10,160);
   //
   fHisdEdx = new TH2F("HisdEdx","HisdEdx",336,0,336,160,1,50);
-  fHisdZfit = new TH2F("HisdZfit","HisdZfit",336,0,336,300,-1.,1.);
+  fHisdZfit = new TH2F("HisdZfit","HisdZfit",336,0,336,300,-0.3,0.3);
   
   //
   //  Chi2
@@ -2181,7 +2387,76 @@ void   AliTPCcalibLaser::MakeFitHistos(){
   fHisPz3vP2IO->SetDirectory(0);   //-> Curv  P2outerinner - common parabola
 
 
+  //
+  //
+  //
+  for (Int_t id=0; id<336;id++){
+    TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
+    TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
+    TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
+    TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
+    //    TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
+    //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
+    if (!profy){
+      profy=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Linear",id),160,0,160,50,-0.5,0.5);
+      profy->SetDirectory(0);
+      fDeltaYres.AddAt(profy,id);
+      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);
+      //profy3=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
+      //profy3->SetDirectory(0);
+      //fDeltaYres3.AddAt(profy3,id);
+    }
+    if (!profz){
+      profz=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d Linear",id),160,0,160,50,-0.5,0.5);
+      profz->SetDirectory(0);
+      fDeltaZres.AddAt(profz,id);
+      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);
+      //profz3=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
+      //profz3->SetDirectory(0);
+      //fDeltaZres3.AddAt(profz3,id);
+    }
+  }
+  //
+  //
+  for (Int_t id=0; id<336;id++){
+    TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
+    TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
+    TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
+    
+    TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
+    TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
+    TH1F * hisSignal = (TH1F*)fSignals.At(id);
+
+    if (!hisdz){
+      hisdz = new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
+      hisdz->SetDirectory(0);
+      fDeltaZ.AddAt(hisdz,id);
+
+      hisP3 = new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
+      hisP3->SetDirectory(0);
+      fDeltaP3.AddAt(hisP3,id);
+      //
+      hisP4 = new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
+      hisP4->SetDirectory(0);
+      fDeltaP4.AddAt(hisP4,id);
 
+      //
+      hisdphi = new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
+      hisdphi->SetDirectory(0);
+      fDeltaPhi.AddAt(hisdphi,id);
+      //
+      hisdphiP = new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
+      hisdphiP->SetDirectory(0);
+      fDeltaPhiP.AddAt(hisdphiP,id);
+      hisSignal = new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
+      hisSignal->SetDirectory(0);
+      fSignals.AddAt(hisSignal,id);
+    }
+  }
 }
 
 void AliTPCcalibLaser::MergeFitHistos(AliTPCcalibLaser * laser){
index acdef84e3bc3031c46ec30dd35eeaabf3b0f04d2..df4f229830f0500169f486adc59bc3f250ea10ed 100644 (file)
@@ -124,19 +124,23 @@ public:
   //
   TObjArray      fDeltaYres;       //-> array of histograms of delta y residuals for each track
   TObjArray      fDeltaZres;       //-> array of histograms of delta z residuals for each track
+  TObjArray      fDeltaYres2;       //-> array of histograms of delta y residuals for each track
+  TObjArray      fDeltaZres2;       //-> array of histograms of delta z residuals for each track
+  //  TObjArray      fDeltaYres3;       //-> array of histograms of delta y residuals for each track
+  //TObjArray      fDeltaZres3;       //-> array of histograms of delta z residuals for each track
+
   //
   TVectorD*      fFitAside;        //! drift fit - A side
   TVectorD*      fFitCside;        //! drift fit - C- side
+  TVectorD*      fFitACside;        //! drift fit - A+C- side
   //
   TVectorD       fEdgeXcuts;       //! cuts in local x direction; used in the refit of the laser tracks
   TVectorD       fEdgeYcuts;       //! cuts in local y direction; used in the refit of the laser tracks
   TVectorD       fNClCuts;         //! cuts on the number of clusters per tracklet; used in the refit of the laser tracks
   Int_t          fNcuts;           //! number of cuts
   //
-  Int_t          fRun;             // current run number
-  Int_t          fEvent;           // cuttent event - internal counter
 private:
-  ClassDef(AliTPCcalibLaser,2)
+  ClassDef(AliTPCcalibLaser,3)
 };
 
 
index bad63dcec7faab231b06c54de196b3184e486761..86755828a6d0042e3c3e216ffb97ad98d75e6604 100644 (file)
@@ -928,6 +928,11 @@ void  AliTPCcalibTracks::FillResolutionHistoLocal(AliTPCseed * track){
        Float_t sy = cluster0->GetSigmaY2();
        Float_t sz = cluster0->GetSigmaZ2();
        (*cstream)<<"Resol0"<<
+         "run="<<fRun<<              //  run number
+         "event="<<fEvent<<          //  event number
+         "time="<<fTime<<            //  time stamp of event
+         "trigger="<<fTrigger<<      //  trigger
+         "mag="<<fMagF<<             //  magnetic field              
          "padSize="<<padSize<<
          "angley="<<angley<<
          "anglez="<<anglez<<
@@ -1169,6 +1174,11 @@ void AliTPCcalibTracks::FillResolutionHistoLocalDebugPart(AliTPCseed *track, Ali
    TTreeSRedirector *cstream = GetDebugStreamer();
    if (cstream){
      (*cstream)<<"ResolCl"<<   // valgrind 3   40,000 bytes in 1 blocks are possibly 
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field        
        "Sector="<<sector<<
        "Cl.="<<cluster0<<
        "CSigmaY0="<<csigmaY0<<   // cluster errorY
@@ -1201,6 +1211,11 @@ void AliTPCcalibTracks::FillResolutionHistoLocalDebugPart(AliTPCseed *track, Ali
      
      //       tracklet dubug
      (*cstream)<<"ResolTr"<<   
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field        
        "padSize="<<padSize<<
        "IPad="<<padSize<<
        "Sector="<<sector<<
@@ -2573,9 +2588,6 @@ void  AliTPCcalibTracks::MakeQPosNormAll(TTree * chainres, AliTPCClusterParam *
   chainres->SetAlias("st","(sin(dt)-dt)");
   //
   chainres->SetAlias("di","sqrt(1.-abs(Cl.fZ/250.))");
-  chainres->SetAlias("dq","sqrt(15./(5+Cl.fMax))");
-  chainres->SetAlias("sy","(0.32/sqrt(0.01^2+Cl.fSigmaY2))");
-  chainres->SetAlias("sz","(0.32/sqrt(0.01^2+Cl.fSigmaZ2))");
   //
   //
   //
@@ -2584,25 +2596,13 @@ void  AliTPCcalibTracks::MakeQPosNormAll(TTree * chainres, AliTPCClusterParam *
   //
   fstringY+="(dp)++";            //1
   fstringY+="(dp)*di++";         //2
-  fstringY+="(dp)*dq++";         //3
-  fstringY+="(dp)*sy++";         //4
-  //
-  fstringY+="(sp)++";            //5
-  fstringY+="(sp)*di++";         //6
-  fstringY+="(sp)*dq++";         //7
-  fstringY+="(sp)*sy++";         //8
-  //
-
+  fstringY+="(sp)++";            //3
+  fstringY+="(sp)*di++";         //4
   TString fstringZ="";  
   fstringZ+="(dt)++";            //1
   fstringZ+="(dt)*di++";         //2
-  fstringZ+="(dt)*dq++";         //3
-  fstringZ+="(dt)*sz++";         //4
-  //
-  fstringZ+="(st)++";            //5
-  fstringZ+="(st)*di++";         //6
-  fstringZ+="(st)*dq++";         //7
-  fstringZ+="(st)*sz++";         //8
+  fstringZ+="(st)++";            //3
+  fstringZ+="(st)*di++";         //4
   //
   // Z corrections
   //
@@ -2638,82 +2638,5 @@ void  AliTPCcalibTracks::MakeQPosNormAll(TTree * chainres, AliTPCClusterParam *
   //  chainres->Draw("Cl.fZ-PZ0.fElements[0]","CSigmaY0<0.7&&CSigmaZ0<0.7"+cutA,"",10000);   
 }
 
-/*
-  gSystem->Load("libSTAT.so");
-  gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
-  gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
-  AliXRDPROOFtoolkit tool;  
-  TChain * chainres = tool.MakeChain("tracks.txt","ResolCl",0,10200);
-  chainres->Lookup();
-  //
-  //
-  //
-
-
-
-  TStatToolkit toolkit;
-  Double_t chi2;
-  TVectorD fitParamY0;
-  TVectorD fitParamY1;
-  TVectorD fitParamZ0;
-  TVectorD fitParamZ1;
-  TMatrixD covMatrix;
-  Int_t npoints;
-
-  chainres->SetAlias("dp","(-1+(Cl.fZ>0)*2)*((Cl.fPad-int(Cl.fPad))-0.5)");
-  chainres->SetAlias("dt","(-1+(Cl.fZ>0)*2)*((Cl.fTimeBin-0.66-int(Cl.fTimeBin-0.66))-0.5)");
-  chainres->SetAlias("sp","(sin(dp*pi)-dp*pi)");
-  chainres->SetAlias("st","(sin(dt)-dt)");
-  //
-  chainres->SetAlias("di","sqrt(1.-abs(Cl.fZ/250.))");
-  chainres->SetAlias("dq","sqrt(15./(5+Cl.fMax))");
-  chainres->SetAlias("sy","(0.32/sqrt(0.01^2+Cl.fSigmaY2))");
-  chainres->SetAlias("sz","(0.32/sqrt(0.01^2+Cl.fSigmaZ2))");
-  //
-  //
-  //
-  TCut cutA("1")
-  
-  TString fstringY="";  
-  //
-  fstringY+="(dp)++";            //1
-  fstringY+="(dp)*di++";         //2
-  fstringY+="(dp)*dq++";         //3
-  fstringY+="(dp)*sy++";         //4
-  //
-  fstringY+="(sp)++";            //5
-  fstringY+="(sp)*di++";         //6
-  fstringY+="(sp)*dq++";         //7
-  fstringY+="(sp)*sy++";         //8
-  //
-
-  TString fstringZ="";  
-  fstringZ+="(dt)++";            //1
-  fstringZ+="(dt)*di++";         //2
-  fstringZ+="(dt)*dq++";         //3
-  fstringZ+="(dt)*sz++";         //4
-  //
-  fstringZ+="(st)++";            //5
-  fstringZ+="(st)*di++";         //6
-  fstringZ+="(st)*dq++";         //7
-  fstringZ+="(st)*sz++";         //8
-
-  
-  TString *strZ0 = toolkit.FitPlane(chainres,"(Cl.fZ-PZ0.fElements[0]):CSigmaZ0",fstringZ.Data(), "Cl.fDetector<36"+cutA, chi2,npoints,fitParamZ0,covMatrix,-1,0,100000);
-  TString *strZ1 = toolkit.FitPlane(chainres,"(Cl.fZ-PZ0.fElements[0]):CSigmaZ0",fstringZ.Data(), "Cl.fDetector>36"+cutA, chi2,npoints,fitParamZ1,covMatrix,-1,0,100000);
-
-  TString *strY0 = toolkit.FitPlane(chainres,"(Cl.fY-PY0.fElements[0]):CSigmaY0",fstringY.Data(), "Cl.fDetector<36"+cutA, chi2,npoints,fitParamY0,covMatrix,-1,0,100000);
-  TString *strY1 = toolkit.FitPlane(chainres,"(Cl.fY-PY0.fElements[0]):CSigmaY0",fstringY.Data(), "Cl.fDetector>36"+cutA, chi2,npoints,fitParamY1,covMatrix,-1,0,100000);
-
-  chainres->SetAlias("fitZ0",strZ0.Data());
-  chainres->SetAlias("fitZ1",strZ1.Data());
-  chainres->SetAlias("fitY0",strY0.Data());
-  chainres->SetAlias("fitY1",strY1.Data());
-  chainres->Draw("Cl.fZ-PZ0.fElements[0]","CSigmaY0<0.7&&CSigmaZ0<0.7"+cutA,"",10000)
-
-
-
-*/
-
 
 
index 669edb394c837fcd1114029e58007801e8418fb3..de8918376559e94e0fa1f549609644780cf8bddf 100644 (file)
@@ -1219,6 +1219,11 @@ void AliTPCcalibTracksGain::DumpTrack(AliTPCseed* track) {
    TTreeSRedirector * cstream =  GetDebugStreamer();
    if (cstream){
      (*cstream) << "Track" <<
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field        
        "Track.=" << track <<        // track information
        "\n";
      //
@@ -1226,6 +1231,11 @@ void AliTPCcalibTracksGain::DumpTrack(AliTPCseed* track) {
      //
      if ( GetStreamLevel()>1 && count>1){
        (*cstream) << "TrackG" <<
+        "run="<<fRun<<              //  run number
+        "event="<<fEvent<<          //  event number
+        "time="<<fTime<<            //  time stamp of event
+        "trigger="<<fTrigger<<      //  trigger
+        "mag="<<fMagF<<             //  magnetic field       
         "Track.=" << track <<        // track information
         "ncount="<<count<<
         // info for pad type 0
@@ -1415,6 +1425,12 @@ Bool_t AliTPCcalibTracksGain::GetDedx(AliTPCseed* track, Int_t padType, Int_t* /
       AddCluster(cluster, momenta, mdedx, padType, xcenter, dedxQ, dedxM, fraction, fraction2, dedge, parY, parZ, meanPos);
       Float_t gain = GetGain(cluster);
       if (cstream) (*cstream) << "dEdx" <<
+       "run="<<fRun<<              //  run number
+       "event="<<fEvent<<          //  event number
+       "time="<<fTime<<            //  time stamp of event
+       "trigger="<<fTrigger<<      //  trigger
+       "mag="<<fMagF<<             //  magnetic field        
+
                     "Cl.=" << cluster <<           // cluster of interest
                     "gain="<<gain<<                // gain at cluster position
                     "P=" << momenta <<             // track momenta
@@ -1433,6 +1449,11 @@ Bool_t AliTPCcalibTracksGain::GetDedx(AliTPCseed* track, Int_t padType, Int_t* /
    }
    
    if (cstream) (*cstream) << "dEdxT" <<
+     "run="<<fRun<<              //  run number
+     "event="<<fEvent<<          //  event number
+     "time="<<fTime<<            //  time stamp of event
+     "trigger="<<fTrigger<<      //  trigger
+     "mag="<<fMagF<<             //  magnetic field          
      "P=" << momenta <<             // track momenta
      "npoints="<<inonEdge<<         // number of points
      "sector="<<lastSector<<        // sector number