remove option C for Clear for trigger array for the moment, causes malloc error
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutBetheBloch.cxx
index 5f3cbf12efb18deaa22e79a623fbe70028274662..329426f2dab142c7c4a8429cc273e4aa85889418 100644 (file)
@@ -26,7 +26,7 @@ ClassImp(AliRsnCutBetheBloch)
 
 //_________________________________________________________________________________________________
 AliRsnCutBetheBloch::AliRsnCutBetheBloch() :
-  AliRsnCut(AliRsnCut::kDaughter),
+  AliRsnCut("dummyBBCut", AliRsnTarget::kDaughter),
   fCorrect(kTRUE),
   fMIP(50.0),
   fType(AliPID::kUnknown)
@@ -110,24 +110,20 @@ Double_t AliRsnCutBetheBloch::RelDiff(AliRsnDaughter *track)
 }
 
 //_________________________________________________________________________________________________
-Bool_t AliRsnCutBetheBloch::IsSelected(TObject *obj1, TObject* /*obj2*/)
+Bool_t AliRsnCutBetheBloch::IsSelected(TObject *object)
 {
 //
 // Cut checker.
 //
 
-  // coherence check
-  if (!AliRsnCut::TargetOK(obj1))
-  {
-    AliError(Form("Wrong target '%s'. Skipping cut", GetName()));
-    return kTRUE;
-  }
-  
   // dynamic cast the object into AliRsnDaughter
-  AliRsnDaughter *track = dynamic_cast<AliRsnDaughter*>(obj1);
+  if (!TargetOK(object)) return kFALSE;
 
   // retrieve the TPC signal
-  AliESDtrack *esd = track->GetRefESDtrack();
+  AliRsnDaughter *track = fDaughter;
+  
+  // if track is meaningful, retrieve its ESD format
+  AliESDtrack    *esd   = track->GetRefESDtrack();
   if (!esd) {
     AliError("ESD information unavailable");
     return kTRUE;
@@ -145,5 +141,5 @@ Bool_t AliRsnCutBetheBloch::IsSelected(TObject *obj1, TObject* /*obj2*/)
   fCutValueD = RelDiff(track);
 
   // then, this cut is checked inside the range
-  return OkRange();
+  return OkRangeD();
 }