]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCcalibPID.cxx
Revert of a harmful change (A.Goel)
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibPID.cxx
index 73b9d47f06ec40fc1ac09da57211a77ee424cd61..334eda43f1430758164b4ee99af32f2c5fe35735 100644 (file)
@@ -251,11 +251,12 @@ void AliTPCcalibPID::Process(AliESDEvent *event) {
   Int_t ntracks=event->GetNumberOfTracks(); 
   fHistNTracks->Fill(ntracks);
   
-  AliESDfriend *ESDfriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
-  if (!ESDfriend) {
-   Printf("ERROR: ESDfriend not available");
+  AliESDfriend *esdFriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
+  if (!esdFriend) {
+   Printf("ERROR: esdFriend not available");
    return;
   }  
+  if (esdFriend->TestSkipBit()) return;
   //
   // track loop
   //
@@ -274,10 +275,10 @@ void AliTPCcalibPID::Process(AliESDEvent *event) {
     //Double_t meanP = 0.5*(trackIn->GetP() + trackOut->GetP());
     Double_t meanP = trackIn->GetP();
     //Double_t d = trackIn->GetLinearD(0,0);
-    Int_t NclsDeDx = track->GetTPCNcls();
+    Int_t nclsDeDx = track->GetTPCNcls();
 
     //if (meanP > 0.7 || meanP < 0.2) continue;
-     if (NclsDeDx < 60) continue;     
+     if (nclsDeDx < 60) continue;     
 
     // exclude tracks which do not look like primaries or are simply too short or on wrong sectors
 
@@ -291,7 +292,7 @@ void AliTPCcalibPID::Process(AliESDEvent *event) {
     if (TMath::Abs(trackIn->GetAlpha()+0.872665)<0.01 || TMath::Abs(trackOut->GetAlpha()+0.872665)<0.01) continue;  // Funny sector !
     
     // Get seeds
-    AliESDfriendTrack *friendTrack = ESDfriend->GetTrack(i);
+    AliESDfriendTrack *friendTrack = esdFriend->GetTrack(i);
     if (!friendTrack) continue;
     TObject *calibObject;
     AliTPCseed *seed = 0;
@@ -302,7 +303,7 @@ void AliTPCcalibPID::Process(AliESDEvent *event) {
     if (seed) {
       if (meanP > 30 && TMath::Abs(trackIn->GetSnp()) < 0.2) fClusters->Fill(track->GetTPCNcls());
       // calculate dEdx
-      Double_t TPCsignalMax    = (1/fMIP)*seed->CookdEdxNorm(fLowerTrunc,fUpperTrunc,1,0,159,fUseShapeNorm,fUsePosNorm,fUsePadNorm,0);
+      Double_t tpcSignalMax    = (1/fMIP)*seed->CookdEdxNorm(fLowerTrunc,fUpperTrunc,1,0,159,fUseShapeNorm,fUsePosNorm,fUsePadNorm,0);
       //
       //
       //Double_t driftMismatch = seed->GetDriftTimeMismatch(0,0.95,0.5);
@@ -313,7 +314,7 @@ void AliTPCcalibPID::Process(AliESDEvent *event) {
       Double_t mass = 0.105658369;// muon
       
       if (meanP > 30) {
-       fPileUp->Fill(driftMismatch,TPCsignalMax);
+       fPileUp->Fill(driftMismatch,tpcSignalMax);
        //
        fLandau->Fill(0.1,0.6);
       }
@@ -379,8 +380,8 @@ void AliTPCcalibPID::Process(AliESDEvent *event) {
        if (ncl[itype]<kMinClustersTracklet) continue;
        Float_t deltaL = TMath::Sqrt(1+snp*snp+tgl*tgl);
        //
-       Double_t vecQmax[8] = {dEdxMax[itype],drift,snp,tgl,meanP,meanP/mass,NclsDeDx, itype};
-       Double_t vecQtot[8] = {dEdxTot[itype],drift,snp,tgl,meanP,meanP/mass,NclsDeDx, itype};
+       Double_t vecQmax[8] = {dEdxMax[itype],drift,snp,tgl,meanP,meanP/mass,nclsDeDx, itype};
+       Double_t vecQtot[8] = {dEdxTot[itype],drift,snp,tgl,meanP,meanP/mass,nclsDeDx, itype};
        //
        //
        //
@@ -390,11 +391,11 @@ void AliTPCcalibPID::Process(AliESDEvent *event) {
        Double_t ratioTrackletTruncTot = (dEdxTot[0]>0)      ? dEdxTotFull[itype]/dEdxTot[itype]:0;
        Double_t ratioTrackletTruncMax = (dEdxMax[0]>0)      ? dEdxMaxFull[itype]/dEdxMax[itype]:0;
 
-       Double_t vecRatioMaxTot[8]      = {ratioMaxTot,      drift,snp,tgl,dEdxTot[0],  dEdxTot[0]*deltaL,NclsDeDx,itype};
-       Double_t vecRatioTrackletTot[8] = {ratioTrackletTot, drift,snp,tgl,dEdxTot[0],  dEdxTot[0]*deltaL,NclsDeDx,itype};      
-       Double_t vecRatioTrackletMax[8] = {ratioTrackletMax, drift,snp,tgl,dEdxMax[0],  dEdxMax[0]*deltaL,NclsDeDx,itype};      
-       Double_t vecRatioTrackletTruncTot[8] = {ratioTrackletTruncTot, drift,snp,tgl,dEdxTot[0],  dEdxTot[0]*deltaL,NclsDeDx,itype};    
-       Double_t vecRatioTrackletTruncMax[8] = {ratioTrackletTruncMax, drift,snp,tgl,dEdxMax[0],  dEdxMax[0]*deltaL,NclsDeDx,itype};    
+       Double_t vecRatioMaxTot[8]      = {ratioMaxTot,      drift,snp,tgl,dEdxTot[0],  dEdxTot[0]*deltaL,nclsDeDx,itype};
+       Double_t vecRatioTrackletTot[8] = {ratioTrackletTot, drift,snp,tgl,dEdxTot[0],  dEdxTot[0]*deltaL,nclsDeDx,itype};      
+       Double_t vecRatioTrackletMax[8] = {ratioTrackletMax, drift,snp,tgl,dEdxMax[0],  dEdxMax[0]*deltaL,nclsDeDx,itype};      
+       Double_t vecRatioTrackletTruncTot[8] = {ratioTrackletTruncTot, drift,snp,tgl,dEdxTot[0],  dEdxTot[0]*deltaL,nclsDeDx,itype};    
+       Double_t vecRatioTrackletTruncMax[8] = {ratioTrackletTruncMax, drift,snp,tgl,dEdxMax[0],  dEdxMax[0]*deltaL,nclsDeDx,itype};    
        fDeDxQmax->Fill(vecQmax); 
        fDeDxQtot->Fill(vecQtot); 
        fDeDxRatioMaxTot->Fill(vecRatioMaxTot); 
@@ -490,16 +491,16 @@ void AliTPCcalibPID::BinLogX(THnSparse *h, Int_t axisDim) {
 
   Double_t from = axis->GetXmin();
   Double_t to = axis->GetXmax();
-  Double_t *new_bins = new Double_t[bins + 1];
+  Double_t *newBins = new Double_t[bins + 1];
    
-  new_bins[0] = from;
+  newBins[0] = from;
   Double_t factor = pow(to/from, 1./bins);
   
   for (int i = 1; i <= bins; i++) {
-   new_bins[i] = factor * new_bins[i-1];
+   newBins[i] = factor * newBins[i-1];
   }
-  axis->Set(bins, new_bins);
-  delete new_bins;
+  axis->Set(bins, newBins);
+  delete [] newBins;
   
 }
 
@@ -862,7 +863,7 @@ void AliTPCcalibPID::DumpTree(THnSparse * hndim, const char * outname){
   //
   Double_t position[10];
   Double_t value; 
-  Int_t *bins = new Int_t[10];
+  Int_t bins[1000];
   //
   //
   const Float_t rmsy0=0.5, rmsz0=1;