AliTPCcalibCalib.cxx - adding protection
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Aug 2009 12:07:15 +0000 (12:07 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Aug 2009 12:07:15 +0000 (12:07 +0000)
AliTPCcalibLaser.h AliTPCcalibLaser.cxx - adding THnSparse interface
AliTPCcalibTime.cxx AliTPCcalibTime.h   - Adding control histograms
                                        - New IsCross - crossing A-C and C-A

TPC/AliTPCcalibCalib.cxx
TPC/AliTPCcalibLaser.cxx
TPC/AliTPCcalibLaser.h
TPC/AliTPCcalibTime.cxx
TPC/AliTPCcalibTime.h

index e88a285..afd17c2 100644 (file)
@@ -443,6 +443,10 @@ Bool_t AliTPCcalibCalib::RejectCluster(AliTPCclusterMI* cl, AliExternalTrackPara
 
   Double_t cov[3]={0.01,0.,0.01}; //TODO: correct error parametrisation    
   AliTPCseed::GetError(cl, param,cov[0],cov[2]);
+  if (param->GetSigmaY2()<0 || param->GetSigmaZ2()){
+    AliError("Wrong parameters");
+    return kFALSE;
+  }
   Double_t py = (cl->GetY()-param->GetY())/TMath::Sqrt(cov[0]*cov[0]+param->GetSigmaY2());
   Double_t pz = (cl->GetZ()-param->GetZ())/TMath::Sqrt(cov[2]*cov[2]+param->GetSigmaZ2());
   //
index 5613ff3..fbee491 100644 (file)
@@ -143,6 +143,7 @@ AliTPCcalibLaser::AliTPCcalibLaser():
   fDeltaPhiP(336),
   fSignals(336),
   //
+  fHisLaser(0),      //  N dim histogram of laser
   fHisNclIn(0),      //->Number of clusters inner
   fHisNclOut(0),     //->Number of clusters outer
   fHisNclIO(0),      //->Number of cluster inner outer
@@ -238,6 +239,7 @@ AliTPCcalibLaser::AliTPCcalibLaser(const Text_t *name, const Text_t *title, Bool
   fSignals(336),           // array of dedx signals
   //
   //
+  fHisLaser(0),      //  N dim histogram of laser
   fHisNclIn(0),      //->Number of clusters inner
   fHisNclOut(0),     //->Number of clusters outer
   fHisNclIO(0),      //->Number of cluster inner outer
@@ -337,6 +339,7 @@ AliTPCcalibLaser::AliTPCcalibLaser(const AliTPCcalibLaser& calibLaser):
   fSignals(((calibLaser.fSignals))),           // array of dedx signals
   //
   //
+  fHisLaser(0),      //  N dim histogram of laser
   fHisNclIn(new TH2F(*(calibLaser.fHisNclIn))),      //->Number of clusters inner
   fHisNclOut(new TH2F(*(calibLaser.fHisNclOut))),     //->Number of clusters outer
   fHisNclIO(new TH2F(*(calibLaser.fHisNclIO))),      //->Number of cluster inner outer
@@ -435,6 +438,7 @@ AliTPCcalibLaser::~AliTPCcalibLaser() {
   // destructor
   //
   if ( fHisNclIn){
+    delete fHisLaser;      //->
     delete fHisNclIn;      //->Number of clusters inner
     delete fHisNclOut;     //->Number of clusters outer
     delete fHisNclIO;      //->Number of cluster inner outer
@@ -588,6 +592,7 @@ void AliTPCcalibLaser::MakeDistHisto(Int_t id){
     //
     if (!fTracksEsdParam.At(id)) return;
     if (!AcceptLaser(id)) return;
+    Double_t xhis[12]={0,0,0,0,0,0,0,0,0,0,0,0};
     //
     //
     TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
@@ -624,7 +629,21 @@ void AliTPCcalibLaser::MakeDistHisto(Int_t id){
     if (hisdphi) hisdphi->Fill(dphi);
     if (hisdphiP) hisdphiP->Fill(dphiP);
     if (hisSignal) hisSignal->Fill(TMath::Sqrt(TMath::Abs(track->GetTPCsignal())));
+    // fill HisLaser
+    xhis[0] = ltrp->GetId();
+    xhis[1] = ltrp->GetSide();
+    xhis[2] = ltrp->GetRod();
+    xhis[3] = ltrp->GetBundle();
+    xhis[4] = ltrp->GetBeam();
+    xhis[5] = dphi;
+    xhis[6] = fFitZ[id];
+    xhis[7] = param->GetParameter()[2]-ltrp->GetParameter()[2]; //dp2
+    xhis[8] = param->GetParameter()[3]-ltrp->GetParameter()[3]; //dp3
+    xhis[9] = param->GetParameter()[4];
+    xhis[10]= track->GetTPCNcls();
+    xhis[11]= TMath::Sqrt(TMath::Abs(track->GetTPCsignal()));
     // }
+    fHisLaser->Fill(xhis);
 }
 
 void AliTPCcalibLaser::FitDriftV(){
@@ -1856,7 +1875,7 @@ void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run){
     Float_t rmsphiP = hisphiP->GetRMS();
     Float_t meanZ = hisZ->GetMean();
     Float_t rmsZ = hisZ->GetRMS();
-    if (hisphi->GetRMS()>0)
+    if (hisphi->GetRMS()>hisphi->GetBinWidth(1))
       hisphi->Fit(&fg,"","",hisphi->GetMean()-4*hisphi->GetRMS(),hisphi->GetMean()+4*hisphi->GetRMS());
     Double_t gphi1 = fg.GetParameter(1);
     Double_t gphi2 = fg.GetParameter(2);
@@ -1865,17 +1884,17 @@ void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run){
     Double_t gphiP1 = fg.GetParameter(1);
     Double_t gphiP2 = fg.GetParameter(2);
     //
-    if (hisZ->GetRMS()>0)
-      hisZ->Fit(&fg,"","",hisZ->GetMean()-4*hisZ->GetRMS()-0.1,hisZ->GetMean()+4*hisZ->GetRMS()+0.1);
+    if (hisZ->GetRMS()>hisZ->GetBinWidth(1))
+      hisZ->Fit(&fg,"","");
     Double_t gz1 = fg.GetParameter(1);
     Double_t gz2 = fg.GetParameter(2);
     //
-    if (hisP3->GetRMS()>0)
+    if (hisP3->GetRMS()>hisP3->GetBinWidth(1))
       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);
     //
-    if (hisP4->GetRMS()>0)
+    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);
@@ -2720,6 +2739,76 @@ void   AliTPCcalibLaser::MakeFitHistos(){
   SetBeamParameters(fBeamOffsetZInner, fBeamSlopeZInner, fBeamSectorInner,3);
   SetBeamParameters(fBeamOffsetYOuter, fBeamSlopeYOuter, fBeamSectorOuter,0);
   SetBeamParameters(fBeamOffsetYInner, fBeamSlopeYInner, fBeamSectorInner,1);
+  //
+  // Make THnSparse
+  //
+  //                   id   side   rod  bundle  beam  dP0  dP1  dP2  dP3  dP4 ncl dEdx 
+  Int_t binsLaser[12]= {336,  //id
+                       2,    //side
+                       6,    //rod
+                       4,    //bundle
+                       7,    //beam
+                       300,  //dP0
+                       300,  //dP1
+                       300,  //dP2
+                       300,  //dP3
+                       300,  //dP4
+                       80,   //ncl
+                       50};   //dEdx
+  Double_t xminLaser[12]= {0,  //id
+                       0,     //side
+                       0,     //rod
+                       0,     //bundle
+                       0,     //beam
+                       -1,    //dP0
+                       -1,    //dP1
+                       -0.01,   //dP2
+                       -0.01,  //dP3
+                       -0.1,  //dP4
+                       0,   //ncl
+                       0};   //sqrt dEdx
+  Double_t xmaxLaser[12]= {336,  //id
+                       2,    //side
+                       6,    //rod
+                       4,    //bundle
+                       7,    //beam
+                       1,  //dP0
+                       1,  //dP1
+                       0.01,  //dP2
+                       0.01,  //dP3
+                       0.1,  //dP4
+                       160,   //ncl
+                       40};   //sqrt dEdx
+  
+  TString nameLaser[12]= {"id",
+                         "side",
+                         "rod",
+                         "bundle",
+                         "beam",
+                         "dP0",
+                         "dP1",
+                         "dP2",
+                         "dP3",
+                         "dP4",
+                         "ncl",
+                         "sqrt dEdx"};
+  TString titleLaser[12]= {"id",
+                         "side",
+                         "rod",
+                         "bundle",
+                         "beam",
+                         "#Delta_{P0}",
+                         "#Delta_{P1}",
+                         "#Delta_{P2}",
+                         "#Delta_{P3}",
+                         "#Delta_{P4}",
+                         "N_{cl}",
+                         "#sqrt{dEdx}"};
+  fHisLaser = new THnSparseS("dLaser","#Delta_{Laser}", 12, binsLaser,xminLaser, xmaxLaser);
+  for (Int_t iaxis=1; iaxis<12; iaxis++){
+    fHisLaser->GetAxis(iaxis)->SetName(nameLaser[iaxis]);
+    fHisLaser->GetAxis(iaxis)->SetTitle(titleLaser[iaxis]);
+  }
 }
 
 void AliTPCcalibLaser::MergeFitHistos(AliTPCcalibLaser * laser){
@@ -2727,10 +2816,11 @@ void AliTPCcalibLaser::MergeFitHistos(AliTPCcalibLaser * laser){
   // Merge content of histograms 
   //
   // Only first histogram is checked - all other should be the same
+  if (fHisLaser &&laser->fHisLaser) fHisLaser->Add(laser->fHisLaser);
+
   if (!laser->fHisNclIn) return;  // empty histograms
   if (!fHisNclIn) MakeFitHistos();
   //
-  
   fHisNclIn->Add(laser->fHisNclIn  );      //->Number of clusters inner
   fHisNclOut->Add(laser->fHisNclOut  );     //->Number of clusters outer
   fHisNclIO->Add(laser->fHisNclIO  );      //->Number of cluster inner outer
index 728fbf3..22396bd 100644 (file)
@@ -14,6 +14,7 @@
 #include "AliTPCcalibBase.h"
 #include "TH1.h"
 #include "TH2F.h"
+#include "THnSparse.h"
 
 
 class AliExternalTrackParam;
@@ -86,6 +87,7 @@ public:
   //
   // Refit residuals histogram
   //
+  THnSparseS     *fHisLaser;      //  N dim histogram of laser 
   TH2F           *fHisNclIn;      //->Number of clusters inner
   TH2F           *fHisNclOut;     //->Number of clusters outer
   TH2F           *fHisNclIO;      //->Number of cluster inner outer
@@ -163,7 +165,7 @@ public:
   Bool_t         fInverseSlopeZ;    //! invert slope in z - mismatch between database and lasers
   //
 private:
-  ClassDef(AliTPCcalibLaser,3)
+  ClassDef(AliTPCcalibLaser,4)
 };
 
 
index 4df9cb0..d787dd0 100644 (file)
@@ -1,3 +1,4 @@
+
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
@@ -103,8 +104,8 @@ AliTPCcalibTime::AliTPCcalibTime()
   :AliTPCcalibBase(), 
    fLaser(0),       // pointer to laser calibration
    fDz(0),          // current delta z
-   fCutMaxD(2),        // maximal distance in rfi ditection
-   fCutMaxDz(20),      // maximal distance in rfi ditection
+   fCutMaxD(3),        // maximal distance in rfi ditection
+   fCutMaxDz(25),      // maximal distance in rfi ditection
    fCutTheta(0.03),    // maximal distan theta
    fCutMinDir(-0.99),  // direction vector products
    fCutTracks(10),
@@ -131,7 +132,7 @@ AliTPCcalibTime::AliTPCcalibTime()
     fHistVdriftLaserA[i]=0;
     fHistVdriftLaserC[i]=0;
   }
-  for (Int_t i=0;i<5;i++) {
+  for (Int_t i=0;i<10;i++) {
     fCosmiMatchingHisto[i]=0;
   }
 }
@@ -139,14 +140,14 @@ AliTPCcalibTime::AliTPCcalibTime()
 
 AliTPCcalibTime::AliTPCcalibTime(const Text_t *name, const Text_t *title, UInt_t StartTime, UInt_t EndTime, Int_t deltaIntegrationTimeVdrift)
   :AliTPCcalibBase(),
-   fLaser(0),       // pointer to laser calibration
-   fDz(0),          // current delta z
-   fCutMaxD(2),        // maximal distance in rfi ditection
-   fCutMaxDz(20),      // maximal distance in rfi ditection
-   fCutTheta(0.03),    // maximal distan theta
-   fCutMinDir(-0.99),  // direction vector products
+   fLaser(0),            // pointer to laser calibration
+   fDz(0),               // current delta z
+   fCutMaxD(5*0.5356),   // maximal distance in rfi ditection
+   fCutMaxDz(5*4.541),   // maximal distance in rfi ditection
+   fCutTheta(5*0.004644),// maximal distan theta
+   fCutMinDir(-0.99),    // direction vector products
    fCutTracks(10),
-   fMapDz(0),          //NEW! Tmap of V drifts for different triggers
+   fMapDz(0),            //Tmap of V drifts for different triggers
    fTimeBins(0),
    fTimeStart(0),
    fTimeEnd(0),
@@ -181,7 +182,7 @@ AliTPCcalibTime::AliTPCcalibTime(const Text_t *name, const Text_t *title, UInt_t
   fVdriftEnd  =  20.0/500.0;
   fRunBins    = 100000;
   fRunStart   = -0.5;
-  fRunEnd     = 0.5;
+  fRunEnd     = 99999.5;
 
   Int_t    binsVdriftLaser[4] = {fTimeBins , fPtBins , fVdriftBins*20, fRunBins };
   Double_t xminVdriftLaser[4] = {fTimeStart, fPtStart, fVdriftStart  , fRunStart};
@@ -206,24 +207,49 @@ AliTPCcalibTime::AliTPCcalibTime(const Text_t *name, const Text_t *title, UInt_t
 
   fMapDz=new TMap();
 
-  for (Int_t i=0;i<5;i++) {
-    fCosmiMatchingHisto[i]=new TH1F("Cosmics matching","Cosmics matching",100,0,0);
-  }
+  fCosmiMatchingHisto[0]=new TH1F("Cosmics matching","p0-all"   ,100,-10*0.5356  ,10*0.5356  );
+  fCosmiMatchingHisto[1]=new TH1F("Cosmics matching","p1-all"   ,100,-10*4.541   ,10*4.541   );
+  fCosmiMatchingHisto[2]=new TH1F("Cosmics matching","p2-all"   ,100,-10*0.01134 ,10*0.01134 );
+  fCosmiMatchingHisto[3]=new TH1F("Cosmics matching","p3-all"   ,100,-10*0.004644,10*0.004644);
+  fCosmiMatchingHisto[4]=new TH1F("Cosmics matching","p4-all"   ,100,-10*0.03773 ,10*0.03773 );
+  fCosmiMatchingHisto[5]=new TH1F("Cosmics matching","p0-isPair",100,-10*0.5356  ,10*0.5356  );
+  fCosmiMatchingHisto[6]=new TH1F("Cosmics matching","p1-isPair",100,-10*4.541   ,10*4.541   );
+  fCosmiMatchingHisto[7]=new TH1F("Cosmics matching","p2-isPair",100,-10*0.01134 ,10*0.01134 );
+  fCosmiMatchingHisto[8]=new TH1F("Cosmics matching","p3-isPair",100,-10*0.004644,10*0.004644);
+  fCosmiMatchingHisto[9]=new TH1F("Cosmics matching","p4-isPair",100,-10*0.03773 ,10*0.03773 );
+//  Char_t nameHisto[3]={'p','0','\n'};
+//  for (Int_t i=0;i<10;i++){
+//    fCosmiMatchingHisto[i]=new TH1F("Cosmics matching",nameHisto,8192,0,0);
+//    nameHisto[1]++;
+//    if(i==4) nameHisto[1]='0';
+//  }
 }
 
 AliTPCcalibTime::~AliTPCcalibTime(){
   //
   // Destructor
   //
-  for (Int_t i=0;i<3;i++){
-    delete fHistVdriftLaserA[i];
-    delete fHistVdriftLaserC[i];
+  for(Int_t i=0;i<3;i++){
+    if(fHistVdriftLaserA[i]){
+      delete fHistVdriftLaserA[i];
+      fHistVdriftLaserA[i]=NULL;
+    }
+    if(fHistVdriftLaserC[i]){
+      delete fHistVdriftLaserC[i];
+      fHistVdriftLaserC[i]=NULL;
+    }
+  }
+  if(fMapDz){
+    fMapDz->SetOwner();
+    fMapDz->Delete();
+    delete fMapDz;
+    fMapDz=NULL;
   }
-  fMapDz->SetOwner();
-  fMapDz->Delete();
-  delete fMapDz;  
-  for (Int_t i=0;i<5;i++) {
-    delete fCosmiMatchingHisto[i];
+  for(Int_t i=0;i<5;i++){
+    if(fCosmiMatchingHisto[i]){
+      delete fCosmiMatchingHisto[i];
+      fCosmiMatchingHisto[i]=NULL;
+    }
   }
 }
 
@@ -418,6 +444,7 @@ void AliTPCcalibTime::ProcessCosmic(AliESDEvent *event){
   //
   // Find pairs
   //
+
   for (Int_t i=0;i<ntracks;++i) {
     AliESDtrack *track0 = event->GetTrack(i);
     // track0 - choosen upper part
@@ -483,16 +510,18 @@ void AliTPCcalibTime::ProcessCosmic(AliESDEvent *event){
       param0.GetXYZ(xyz0);
       param1.GetXYZ(xyz1);
       Bool_t isPair = IsPair(&param0,&param1);
+      Bool_t isCross = IsCross(track0, track1);
+
+//      Double_t z0 = track0->GetOuterParam()->GetZ();
+//      Double_t z1 = track1->GetOuterParam()->GetZ();
       
-      Double_t z0 = track0->GetOuterParam()->GetZ();
-      Double_t z1 = track1->GetOuterParam()->GetZ();
-      
-      Double_t z0inner = track0->GetInnerParam()->GetZ();
-      Double_t z1inner = track1->GetInnerParam()->GetZ();
+//      Double_t z0inner = track0->GetInnerParam()->GetZ();
+//      Double_t z1inner = track1->GetInnerParam()->GetZ();
       
-      if (isPair && z0>0 && z0inner>0 && z1<0 && z1inner<0) {
+      if (isPair && isCross){
        if (track0->GetTPCNcls() > 80) {
          fDz = param0.GetZ() - param1.GetZ();
+         if(track0->GetOuterParam()->GetZ()<0) fDz=-fDz;
          TTimeStamp tstamp(fTime);
          Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,0);
          Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,1);
@@ -514,6 +543,22 @@ void AliTPCcalibTime::ProcessCosmic(AliESDEvent *event){
          curHist->Fill(vecVdrift);
        }
       }
+      TTreeSRedirector *cstream = GetDebugStreamer();
+      if (fStreamLevel>0){
+        if (cstream){
+        (*cstream)<<"trackInfo"<<
+         "tr0.="<<track0<<
+         "tr1.="<<track1<<
+         "p0.="<<&param0<<
+         "p1.="<<&param1<<
+         "isPair="<<isPair<<
+         "isCross="<<isCross<<
+         "fDz="<<fDz<<
+         "fRun="<<fRun<<
+         "fTime="<<fTime<<
+         "\n";
+       }
+      }
     } // end 2nd order loop        
   } // end 1st order loop
   
@@ -565,7 +610,6 @@ void AliTPCcalibTime::Analyze(){}
 THnSparse* AliTPCcalibTime::GetHistoDrift(TObjString* name){
   return (THnSparseF*)(fMapDz->GetValue(name));
 }
-
 THnSparse* AliTPCcalibTime::GetHistoDrift(const char* name){
   TObjString* objName=new TObjString(name);
   THnSparse* histoDrift=0;
@@ -609,7 +653,7 @@ TMap* AliTPCcalibTime::GetGraphDrift(){
 }
 
 TGraph* AliTPCcalibTime::GetFitDrift(TObjString* name){
-  TGraphErrors* graphDrift=GetGraphDrift(name);
+  TGraph* graphDrift=GetGraphDrift(name);
   TGraph* fitDrift=0;
   if(graphDrift && graphDrift->GetN()){
     AliSplineFit fit;
@@ -643,7 +687,6 @@ TMap* AliTPCcalibTime::GetFitDrift(){
   while((addPair=(TPair*)(fMapDz->FindObject(iterator->Next())))) mapFitDrift->Add((TObjString*)addPair->Key(), GetFitDrift((TObjString*)addPair->Key()));
   return mapFitDrift;
 }
-
 Long64_t AliTPCcalibTime::Merge(TCollection *li) {
 
   TIterator* iter = li->MakeIterator();
@@ -676,11 +719,7 @@ Long64_t AliTPCcalibTime::Merge(TCollection *li) {
       }
       localHist->Add(addHist);
     }
-    if (cal->GetCosmiMatchingHisto(0)) fCosmiMatchingHisto[0]->Add(cal->GetCosmiMatchingHisto(0));
-    if (cal->GetCosmiMatchingHisto(1)) fCosmiMatchingHisto[1]->Add(cal->GetCosmiMatchingHisto(1));
-    if (cal->GetCosmiMatchingHisto(2)) fCosmiMatchingHisto[2]->Add(cal->GetCosmiMatchingHisto(2));
-    if (cal->GetCosmiMatchingHisto(3)) fCosmiMatchingHisto[3]->Add(cal->GetCosmiMatchingHisto(3));
-    if (cal->GetCosmiMatchingHisto(4)) fCosmiMatchingHisto[4]->Add(cal->GetCosmiMatchingHisto(4));
+    for(Int_t i=0;i<10;i++) if (cal->GetCosmiMatchingHisto(i)) fCosmiMatchingHisto[i]->Add(cal->GetCosmiMatchingHisto(i));
   }
   return 0;
 }
@@ -702,7 +741,7 @@ Bool_t  AliTPCcalibTime::IsPair(AliExternalTrackParam *tr0, AliExternalTrackPara
   const Double_t *p1 = tr1->GetParameter();
   fCosmiMatchingHisto[0]->Fill(p0[0]+p1[0]);
   fCosmiMatchingHisto[1]->Fill(p0[1]-p1[1]);
-  fCosmiMatchingHisto[2]->Fill(tr0->GetAlpha()+tr1->GetAlpha());
+  fCosmiMatchingHisto[2]->Fill(tr1->GetAlpha()-tr0->GetAlpha()+TMath::Pi());
   fCosmiMatchingHisto[3]->Fill(p0[3]+p1[3]);
   fCosmiMatchingHisto[4]->Fill(p0[4]+p1[4]);
   
@@ -714,6 +753,40 @@ Bool_t  AliTPCcalibTime::IsPair(AliExternalTrackParam *tr0, AliExternalTrackPara
   tr1->GetDirection(d1);       
   if (d0[0]*d1[0] + d0[1]*d1[1] + d0[2]*d1[2] >fCutMinDir) return kFALSE;
 
+  fCosmiMatchingHisto[5]->Fill(p0[0]+p1[0]);
+  fCosmiMatchingHisto[6]->Fill(p0[1]-p1[1]);
+  fCosmiMatchingHisto[7]->Fill(tr1->GetAlpha()-tr0->GetAlpha()+TMath::Pi());
+  fCosmiMatchingHisto[8]->Fill(p0[3]+p1[3]);
+  fCosmiMatchingHisto[9]->Fill(p0[4]+p1[4]);
+
   return kTRUE;  
 }
+Bool_t AliTPCcalibTime::IsCross(AliESDtrack *tr0, AliESDtrack *tr1){
+  return  tr0->GetOuterParam()->GetZ()*tr1->GetOuterParam()->GetZ()<0 && tr0->GetInnerParam()->GetZ()*tr1->GetInnerParam()->GetZ()<0 && tr0->GetOuterParam()->GetZ()*tr0->GetInnerParam()->GetZ()>0 && tr1->GetOuterParam()->GetZ()*tr1->GetInnerParam()->GetZ()>0;
+}
+
+/*
+chainDrift->Draw("p0.fP[0]+p1.fP[0]","isPair");
+  mean ~-0.02  ~-0.03913
+  RMS  ~ 0.5   ~ 0.5356    --> 3    (fCutMaxD)
+
+chainDrift->Draw("p0.fP[1]-p1.fP[1]","isPair");
+  mean         ~ 0.1855
+  RMS          ~ 4.541     -->25    (fCutMaxDz)
+
+chainDrift->Draw("p1.fAlpha-p0.fAlpha+pi","isPair");
+//chainDrift->Draw("p1.fAlpha+p0.fAlpha","isPair");
+//chainDrift->Draw("p1.fP[2]-p0.fP[2]+pi","isPair");
+//chainDrift->Draw("p1.fP[2]+p0.fP[2]","isPair");
+  mean ~ 0     ~ 0.001898
+  RMS  ~ 0.009 ~ 0.01134   --> 0.06
+
+chainDrift->Draw("p0.fP[3]+p1.fP[3]","isPair");
+  mean ~ 0.0013 ~ 0.001539
+  RMS  ~ 0.003  ~ 0.004644 --> 0.03  (fCutTheta)
+
+chainDrift->Draw("p1.fP[4]+p0.fP[4]>>his(100,-0.2,0.2)","isPair")
+  mean ~ 0.012  ~-0.0009729
+  RMS  ~ 0.036  ~ 0.03773  --> 0.2
+*/
 
index 9e5fb5d..15c8a33 100644 (file)
@@ -37,7 +37,8 @@ public:
   void                   ProcessLaser (AliESDEvent *event);
   void                   ProcessCosmic(AliESDEvent *event);
   Bool_t                 IsPair(AliExternalTrackParam *tr0, AliExternalTrackParam *tr1);
-  //
+  Bool_t                 IsCross(AliESDtrack *tr0, AliESDtrack *tr1);
+
   THnSparse* GetHistVdriftLaserA(Int_t index=1){return fHistVdriftLaserA[index];};
   THnSparse* GetHistVdriftLaserC(Int_t index=1){return fHistVdriftLaserC[index];};
   THnSparse* GetHistoDrift(TObjString* name);
@@ -73,7 +74,7 @@ private:
   AliTPCcalibTime(const AliTPCcalibTime&); 
   AliTPCcalibTime& operator=(const AliTPCcalibTime&); 
 
-  TH1F* fCosmiMatchingHisto[5];
+  TH1F* fCosmiMatchingHisto[10];
 
   // laser histo
   THnSparse * fHistVdriftLaserA[3];    //Histograms for V drift from laser