]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCcalibBase.cxx
Minor corrections to air-filled container volumes (M. Sitta)
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibBase.cxx
index 79fffbb2f8b13591af1af86ce8ec3eedcac69b7f..fac0eb727dde05774d6c309813750ba9b126e36f 100644 (file)
@@ -52,6 +52,7 @@
 #include "TH1D.h"
 #include "TH2D.h"
 #include "TAxis.h"
+#include "AliRecoParam.h"
 
 
 #include "AliLog.h"
@@ -201,26 +202,13 @@ Bool_t AliTPCcalibBase::HasLaser(AliESDEvent *event){
   //
   //
   //
-  // Thresholds more than 8 tracks with small dip angle
-  
-  const Int_t kMinLaserTracks = 8;
-  const Float_t kThrLaser       = 0.3;
-  const Float_t kLaserTgl       = 0.01;
-
-  Int_t ntracks = event->GetNumberOfTracks();
-  if (ntracks<kMinLaserTracks) return kFALSE;
-  Float_t nlaser=0;
-  Float_t nall=0;
-  for (Int_t i=0;i<ntracks;++i) {
-    AliESDtrack *track=event->GetTrack(i);
-    if (!track) continue;
-    if (track->GetTPCNcls()<=0) continue; 
-    nall++;
-    if (TMath::Abs(track->GetTgl())<kLaserTgl) nlaser++;
+  // Use event specie
+  Bool_t isLaser=kFALSE;
+  UInt_t specie = event->GetEventSpecie();  // select only cosmic events
+  if (specie==AliRecoParam::kCalib) {
+    isLaser = kTRUE;
   }
-  if (nlaser>kMinLaserTracks) return kTRUE;
-  if (nall>0 && nlaser/nall>kThrLaser) return kTRUE;
-  return kFALSE;
+  return isLaser;
 }
 
 
@@ -383,7 +371,7 @@ void AliTPCcalibBase::BinLogX(THnSparse *h, Int_t axisDim) {
    new_bins[i] = factor * new_bins[i-1];
   }
   axis->Set(bins, new_bins);
-  delete new_bins;
+  delete [] new_bins;
 
 }
 void AliTPCcalibBase::BinLogX(TH1 *h) {
@@ -404,6 +392,6 @@ void AliTPCcalibBase::BinLogX(TH1 *h) {
    new_bins[i] = factor * new_bins[i-1];
   }
   axis->Set(bins, new_bins);
-  delete new_bins;
+  delete [] new_bins;
 
 }