]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity
authorrbailhac <rbailhac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Feb 2012 12:35:25 +0000 (12:35 +0000)
committerrbailhac <rbailhac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Feb 2012 12:35:25 +0000 (12:35 +0000)
PWGHF/hfe/AliAnalysisTaskHFE.cxx
PWGHF/hfe/AliHFEdebugTreeTask.cxx

index 03adfb44993304d267b153b18a94744b68ae087b..c5386ab00cb042fcacea4b70e10be33ebe18d68d 100644 (file)
@@ -13,6 +13,7 @@
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
 //
+//
 // The analysis task:
 // Filling an AliCFContainer with the quantities pt, eta and phi
 // for tracks which survivied the particle cuts (MC resp. ESD tracks)
@@ -997,7 +998,8 @@ void AliAnalysisTaskHFE::ProcessESD(){
             if(shared.CountBits() >= 2) sharebit=1;
 
            Double_t itschi2percluster = 0.0;
-           if(track->GetNcls(0) > 0) itschi2percluster = track->GetITSchi2()/static_cast<Double_t>(track->GetNcls(0));
+           Double_t itsnbcls = static_cast<Double_t>(track->GetNcls(0));
+           if(itsnbcls > 0) itschi2percluster = track->GetITSchi2()/itsnbcls;
 
             Double_t itsChi2[7] = {track->Pt(),track->Eta(), track->Phi(),
                                   fCentralityF,track->GetTPCsignalN(), sharebit, itschi2percluster};
@@ -1006,7 +1008,8 @@ void AliAnalysisTaskHFE::ProcessESD(){
     else{
       
       Double_t itschi2percluster = 0.0;
-      if(track->GetNcls(0) > 0) itschi2percluster = track->GetITSchi2()/static_cast<Double_t>(track->GetNcls(0));
+      Double_t itsnbcls = static_cast<Double_t>(track->GetNcls(0));
+      if(itsnbcls > 0) itschi2percluster = track->GetITSchi2()/itsnbcls;
 
       Double_t itsChi2[3] = {track->Pt(), fCentralityF, itschi2percluster};
       fQACollection->Fill("fChi2perITScluster", itsChi2);
index 972d2e4bb507c9580c9fe66a861df778e4ab24d4..9edd39d1925fdc5a31115aa1d3db518e029ac4f4 100644 (file)
@@ -18,6 +18,7 @@
 // Authors:
 //   Markus Fasel <M.Fasel@gsi.de>
 //
+//
 #include <TBits.h>
 #include <TString.h>
 
@@ -108,7 +109,11 @@ void AliHFEdebugTreeTask::UserExec(Option_t *){
     AliError("No Handler");
   }
   if(!pid){
-    AliError("No PID response\n");
+    AliError("No PID response");
+    return;
+  }
+  if(!fInputEvent) {
+    AliError("No Input event");
     return;
   }
   
@@ -146,7 +151,10 @@ void AliHFEdebugTreeTask::UserExec(Option_t *){
 
   // Get centrality
   Float_t centrality = -1.;
-  TString beamtype = (dynamic_cast<AliESDEvent *>(fInputEvent))->GetESDRun()->GetBeamType();
+  AliESDEvent *event = (dynamic_cast<AliESDEvent *>(fInputEvent));
+  if(!event) return;
+  TString beamtype = event->GetBeamType();
+  //printf("Beam type %s\n",(const char*)beamtype);
   if(!beamtype.CompareTo("Pb-Pb") || !beamtype.CompareTo("A-A")){
     // Heavy ion run
     AliDebug(1, "Heavy-Ion event\n");