]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCcalibCosmic.cxx
Impementation of the validation
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibCosmic.cxx
index f4e066b307b4c2f6e67a47789b46f9349eb516af..aea04cfe3d0552b1e483932efa1f89e295bfc022 100644 (file)
     gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
     gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
     AliXRDPROOFtoolkit tool;
-    TChain * chainCosmic = tool.MakeChainRandom("cosmic.txt","Track0",0,10000);
-    TChain * chainBudget = tool.MakeChainRandom("cosmic.txt","material",0,1000); 
-    TCut cutptV="abs(1/pt0V-1/pt1V)<0.1";
-    TCut cutptI="abs(1/pt0In-1/pt1In)<0.5";
-    TCut cutncl="nclmin>120";
-    TCut cutDz="abs(p0.fP[1])<50";
-    TCut cutDr="abs(p0.fP[0])<50";
+    TChain * chainCosmic = tool.MakeChainRandom("cosmicF.txt","Track0",0,10000);
     //
-    chainBudget->Draw(">>listB",cutptV+cutptI+cutncl+cutDr+cutDz,"entryList");
-    TEntryList *elistB = (TEntryList*)gDirectory->Get("listB");
-    chainBudget->SetEntryList(elistB);
+    TCut cutITSN="min(Orig0.fITSncls,Orig1.fITSncls)>2";
+    TCut cutTPCN="min(Orig0.fTPCncls,Orig1.fTPCncls)>120";
+
+    chainCosmic->Draw(">>listITS",cutITSN+cutTPCN,"entryList");
+    TEntryList *elistITS = (TEntryList*)gDirectory->Get("listITS");
+    chainCosmic->SetEntryList(elistITS);
     
-    chainBudget->SetAlias("dptrel","(pt0V-pt1V)/((pt0V+pt1V)*0.5)");
-    chainBudget->SetAlias("dptInrel","(pt0In-pt1In)/((pt0In+pt1In)*0.5)");
-    chainBudget->SetAlias("ptcorr","(pt0In-pt0V)/(pt0V)+(pt1V-pt1In)/(pt1In)");
-*/
+  */
 
 
 
@@ -68,6 +62,7 @@
 #include "TFile.h"
 #include "TF1.h"
 #include "THnSparse.h"
+#include "TDatabasePDG.h"
 
 #include "AliTPCclusterMI.h"
 #include "AliTPCseed.h"
@@ -550,8 +545,9 @@ void AliTPCcalibCosmic::FindPairs(AliESDEvent *event) {
 
 
    AliESDfriendTrack *friendTrack = esdFriend->GetTrack(i);
+   if (!friendTrack) continue;
    TObject *calibObject;
-   AliTPCseed *seed = 0;
+   AliTPCseed *seed = 0;   
    for (Int_t l=0;(calibObject=friendTrack->GetCalibObject(l));++l) {
      if ((seed=dynamic_cast<AliTPCseed*>(calibObject))) break;
    }
@@ -563,11 +559,11 @@ void AliTPCcalibCosmic::FindPairs(AliESDEvent *event) {
      //
      if (meanP > 0.4 && meanP < 0.45) fDeDxMIP->Fill(seed->CookdEdxNorm(0.0,0.45,0,0,159));
      //
-     if (GetDebugLevel()>0&&meanP>0.2&&seed->CookdEdxNorm(0.0,0.45,0,0,159)>300) {
-       TFile *curfile = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
-       if (curfile) printf(">>> p+ in file: %s \t event: %i \t Number of ESD tracks: %i \n", curfile->GetName(), (int)event->GetEventNumberInFile(), (int)ntracks);
-       if (track->GetOuterParam()->GetAlpha()<0) cout << " Polartiy: " << track->GetSign() << endl;
-     }
+     // if (GetDebugLevel()>0&&meanP>0.2&&seed->CookdEdxNorm(0.0,0.45,0,0,159)>300) {
+//        //TFile *curfile = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
+//        //if (curfile) printf(">>> p+ in file: %s \t event: %i \t Number of ESD tracks: %i \n", curfile->GetName(), (int)event->GetEventNumberInFile(), (int)ntracks);
+//        // if (track->GetOuterParam()->GetAlpha()<0) cout << " Polartiy: " << track->GetSign() << endl;
+//      }
 
    }
 
@@ -636,8 +632,8 @@ void AliTPCcalibCosmic::FindPairs(AliESDEvent *event) {
       Double_t sign0=-1;
       Double_t sign1=1;
       Double_t maxsnp=0.90;
-      AliTracker::PropagateTrackToBxByBz(&param0,dmax+1,0.0005,3,kTRUE,maxsnp,sign0);
-      AliTracker::PropagateTrackToBxByBz(&param1,dmax+1,0.0005,3,kTRUE,maxsnp,sign1);
+      AliTracker::PropagateTrackToBxByBz(&param0,dmax+1,TDatabasePDG::Instance()->GetParticle("e-")->Mass(),3,kTRUE,maxsnp,sign0);
+      AliTracker::PropagateTrackToBxByBz(&param1,dmax+1,TDatabasePDG::Instance()->GetParticle("e-")->Mass(),3,kTRUE,maxsnp,sign1);
       //
       // Propagate rest to the 0,0 DCA - z should be ignored
       //
@@ -888,7 +884,7 @@ void AliTPCcalibCosmic::BinLogX(THnSparse *const h, Int_t axisDim) {
    newBins[i] = factor * newBins[i-1];
   }
   axis->Set(bins, newBins);
-  delete newBins;
+  delete [] newBins;
 
 }
 
@@ -911,7 +907,7 @@ void AliTPCcalibCosmic::BinLogX(TH1 *const h) {
    newBins[i] = factor * newBins[i-1];
   }
   axis->Set(bins, newBins);
-  delete newBins;
+  delete [] newBins;
   
 }