Fixes for coverity
authorcoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Jul 2013 08:04:39 +0000 (08:04 +0000)
committercoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Jul 2013 08:04:39 +0000 (08:04 +0000)
PWGLF/FORWARD/GEO/AliAnalysisTaskZDCTreeMaker.cxx
PWGLF/FORWARD/GEO/AliAnalysisTaskZDCTreeMaker.h
PWGLF/FORWARD/GEO/AliAnalysisTaskZDCpAcalib.cxx
PWGLF/FORWARD/GEO/AliAnalysisTaskZDCpAcalib.h

index 11938a4..25e42b9 100644 (file)
@@ -66,6 +66,7 @@ AliAnalysisTaskZDCTreeMaker::AliAnalysisTaskZDCTreeMaker():
     fUseSpecialOutput(kFALSE),
     fOutput(0x0),
     fCentralityTree(0x0),
+    fTrigClass(""),
     fIsEventSelected(kFALSE),
     fIsPileupFromSPD(kFALSE),
     fxVertex(0),        
@@ -130,6 +131,7 @@ AliAnalysisTaskZDCTreeMaker::AliAnalysisTaskZDCTreeMaker(const char *name):
     fUseSpecialOutput(kFALSE),
     fOutput(0x0),
     fCentralityTree(0x0),
+    fTrigClass(""),
     fIsEventSelected(kFALSE),
     fIsPileupFromSPD(kFALSE),
     fxVertex(0),        
@@ -296,12 +298,14 @@ void AliAnalysisTaskZDCTreeMaker::UserExec(Option_t */*option*/)
       if(!fIsMCInput && esd->GetEventType()!=7) return; 
       
       // ***** Trigger selection
-      TString triggerClass = esd->GetFiredTriggerClasses();
-      sprintf(fTrigClass,"%s",triggerClass.Data());
+      fTrigClass = esd->GetFiredTriggerClasses();
+      //TString triggerClass = esd->GetFiredTriggerClasses();
+      //sprintf(fTrigClass,"%s",triggerClass.Data());
       
       // use response of AliPhysicsSelection
       fIsEventSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kAnyINT);       
-      fIsPileupFromSPD = esd->IsPileupFromSPD(6,1.0);
+      fIsPileupFromSPD = esd->IsPileupFromSPD(7,0.8);
+      //fIsPileupFromSPD = esd->IsPileupFromSPDInMultBins();
 
       AliCentrality *centrality = esd->GetCentrality();
       fCentralityV0M = centrality->GetCentralityPercentile("V0M");
@@ -408,8 +412,9 @@ void AliAnalysisTaskZDCTreeMaker::UserExec(Option_t */*option*/)
       fCentralityZPC = centrality->GetCentralityPercentile("ZPC");
       
       // ***** Trigger selection
-      TString triggerClass = aod->GetFiredTriggerClasses();
-      sprintf(fTrigClass,"%s",triggerClass.Data());
+      fTrigClass = aod->GetFiredTriggerClasses();
+      //TString triggerClass = aod->GetFiredTriggerClasses();
+      //sprintf(fTrigClass,"%s",triggerClass.Data());
       
       const AliAODVertex *vertex = aod->GetPrimaryVertexSPD();
       fxVertex = vertex->GetX();
index 8f97053..868f3ad 100644 (file)
@@ -46,7 +46,7 @@ class AliAnalysisTaskZDCTreeMaker : public AliAnalysisTaskSE {
   //
   TTree   *fCentralityTree;     //! output tree
   //
-  char     fTrigClass[100];    //  fired trigger classes
+  TString  fTrigClass;         //  fired trigger classes
   //
   Bool_t   fIsEventSelected;    //  is physics selection on
   Bool_t   fIsPileupFromSPD;   //  is pilue up from SPD
@@ -101,7 +101,7 @@ class AliAnalysisTaskZDCTreeMaker : public AliAnalysisTaskSE {
   AliAnalysisTaskZDCTreeMaker& operator= (const AliAnalysisTaskZDCTreeMaker& ana);
   AliAnalysisTaskZDCTreeMaker(const AliAnalysisTaskZDCTreeMaker& c);
   //
-  ClassDef(AliAnalysisTaskZDCTreeMaker,4); 
+  ClassDef(AliAnalysisTaskZDCTreeMaker, 5); 
 
 };
 
index 132830e..548a072 100644 (file)
@@ -66,7 +66,7 @@ AliAnalysisTaskZDCpAcalib::AliAnalysisTaskZDCpAcalib():
     fUseSpecialOutput(kFALSE),
     fOutput(0x0),
     fCentralityTree(0x0),
-   // fTrigClass(""),
+    fTrigClass(""),
     fIsEventSelected(kFALSE),
     fIsV0ATriggered(0),
     fIsV0CTriggered(0)
@@ -102,7 +102,7 @@ AliAnalysisTaskZDCpAcalib::AliAnalysisTaskZDCpAcalib(const char *name):
     fUseSpecialOutput(kFALSE),
     fOutput(0x0),
     fCentralityTree(0x0),
-  //  fTrigClass(""),
+    fTrigClass(""),
     fIsEventSelected(kFALSE),
     fIsV0ATriggered(0),
     fIsV0CTriggered(0)
@@ -205,8 +205,9 @@ void AliAnalysisTaskZDCpAcalib::UserExec(Option_t */*option*/)
       if(!fIsMCInput && esd->GetEventType()!=7) return; 
       
       // ***** Trigger selection
-      TString triggerClass = esd->GetFiredTriggerClasses();
-      sprintf(fTrigClass,"%s",triggerClass.Data());
+      fTrigClass = esd->GetFiredTriggerClasses();
+      //TString triggerClass = esd->GetFiredTriggerClasses();
+      //sprintf(fTrigClass,"%s",triggerClass.Data());
       
       // use response of AliPhysicsSelection
       fIsEventSelected =
index 3a22c03..b5fb852 100644 (file)
@@ -46,7 +46,7 @@ class AliAnalysisTaskZDCpAcalib : public AliAnalysisTaskSE {
   //
   TTree   *fCentralityTree;    //! output tree
   //
-  char     fTrigClass[100];    //  fired trigger classes
+  TString  fTrigClass;    //  fired trigger classes
   //
   Bool_t   fIsEventSelected;   //  is physics selection on
   //
@@ -70,7 +70,7 @@ class AliAnalysisTaskZDCpAcalib : public AliAnalysisTaskSE {
   AliAnalysisTaskZDCpAcalib& operator= (const AliAnalysisTaskZDCpAcalib& ana);
   AliAnalysisTaskZDCpAcalib(const AliAnalysisTaskZDCpAcalib& c);
   //
-  ClassDef(AliAnalysisTaskZDCpAcalib,2); 
+  ClassDef(AliAnalysisTaskZDCpAcalib, 3); 
 
 };