some coverty fixes
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 28 Jan 2011 17:14:55 +0000 (17:14 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 28 Jan 2011 17:14:55 +0000 (17:14 +0000)
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskQAflow.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.cxx

index 53a1666..8338450 100644 (file)
@@ -384,9 +384,12 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
     //pmd
     
     // if monte carlo event get reaction plane from monte carlo (depends on generator)
-    if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent);
-    //set reference multiplicity, TODO: maybe move it to the constructor?
-    flowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE));
+    if (flowEvent)
+    {
+      if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent);
+      //set reference multiplicity, TODO: maybe move it to the constructor?
+      flowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE));
+    }
   }
 
   // Make the FlowEvent for ESD input combined with MC info
@@ -448,11 +451,16 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   //inject candidates
   if(fLoadCandidates) {
     TObjArray* Candidates = dynamic_cast<TObjArray*>(GetInputData(availableINslot++));
-    AliFlowCandidateTrack *cand;
-    for(int iCand=0; iCand!=Candidates->GetEntriesFast(); ++iCand ) {
-      cand = dynamic_cast<AliFlowCandidateTrack*>(Candidates->At(iCand));
-      cand->SetForPOISelection();
-      flowEvent->AddTrack(cand);
+    AliFlowCandidateTrack *cand = NULL;
+    if (Candidates)
+    {
+      for(int iCand=0; iCand!=Candidates->GetEntriesFast(); ++iCand )
+      {
+        cand = dynamic_cast<AliFlowCandidateTrack*>(Candidates->At(iCand));
+        if (!cand) continue;
+        cand->SetForPOISelection();
+        flowEvent->AddTrack(cand);
+      }
     }
   }
 
index 2436a7d..b4b60e7 100644 (file)
@@ -155,55 +155,55 @@ void AliAnalysisTaskQAflow::UserExec(Option_t *)
   //TObjArray* after = ((TDirectory*)fOutput->At(1))->GetList();
   TObjArray* before = (TObjArray*)fOutput->At(0);
   TObjArray* after = (TObjArray*)fOutput->At(1);
-  TH1* htrackletmultB = dynamic_cast<TH1*>(before->At(0));
-  TH1* htrackletmultA = dynamic_cast<TH1*>(after->At(0));
-  TH1* htrackmultB = dynamic_cast<TH1*>(before->At(1));
-  TH1* htrackmultA = dynamic_cast<TH1*>(after->At(1));
-  TH1* hrefmultB = dynamic_cast<TH1*>(before->At(2));
-  TH1* hrefmultA = dynamic_cast<TH1*>(after->At(2));
-  TH1* hspdclustersB = dynamic_cast<TH1*>(before->At(3));
-  TH1* hspdclustersA = dynamic_cast<TH1*>(after->At(3));
-  TH1* hprimvtxzB = dynamic_cast<TH1*>(before->At(4));
-  TH1* hprimvtxzA = dynamic_cast<TH1*>(after->At(4));
+  TH1* htrackletmultB = static_cast<TH1*>(before->At(0));
+  TH1* htrackletmultA = static_cast<TH1*>(after->At(0));
+  TH1* htrackmultB = static_cast<TH1*>(before->At(1));
+  TH1* htrackmultA = static_cast<TH1*>(after->At(1));
+  TH1* hrefmultB = static_cast<TH1*>(before->At(2));
+  TH1* hrefmultA = static_cast<TH1*>(after->At(2));
+  TH1* hspdclustersB = static_cast<TH1*>(before->At(3));
+  TH1* hspdclustersA = static_cast<TH1*>(after->At(3));
+  TH1* hprimvtxzB = static_cast<TH1*>(before->At(4));
+  TH1* hprimvtxzA = static_cast<TH1*>(after->At(4));
 
-  TH1* hITSclsB = dynamic_cast<TH1*>(before->At(5));
-  TH1* hITSclsA = dynamic_cast<TH1*>(after->At(5));
-  TH1* hTPCclsB = dynamic_cast<TH1*>(before->At(6));
-  TH1* hTPCclsA = dynamic_cast<TH1*>(after->At(6));
-  TH1* hTPCchi2B = dynamic_cast<TH1*>(before->At(7));
-  TH1* hTPCchi2A = dynamic_cast<TH1*>(after->At(7));
-  TH1* hdcaxyB = dynamic_cast<TH1*>(before->At(8));
-  TH1* hdcaxyA = dynamic_cast<TH1*>(after->At(8));
-  TH1* hdcazB = dynamic_cast<TH1*>(before->At(9));
-  TH1* hdcazA = dynamic_cast<TH1*>(after->At(9));
-  TH1* hphitrackletsB = dynamic_cast<TH1*>(before->At(10));
-  TH1* hphitrackletsA = dynamic_cast<TH1*>(after->At(10));
-  TH1* hphitracksB = dynamic_cast<TH1*>(before->At(11));
-  TH1* hphitracksA = dynamic_cast<TH1*>(after->At(11));
-  TH1* hetatrackletsB = dynamic_cast<TH1*>(before->At(12));
-  TH1* hetatrackletsA = dynamic_cast<TH1*>(after->At(12));
-  TH1* hetatracksB = dynamic_cast<TH1*>(before->At(13));
-  TH1* hetatracksA = dynamic_cast<TH1*>(after->At(13));
-  TH1* hprimvtxzTPCB = dynamic_cast<TH1*>(before->At(14));
-  TH1* hprimvtxzTPCA = dynamic_cast<TH1*>(after->At(14));
-  TH1* hptyieldB = dynamic_cast<TH1*>(before->At(15));
-  TH1* hptyieldA = dynamic_cast<TH1*>(after->At(15));
-  TH1* hptyieldplusB = dynamic_cast<TH1*>(before->At(16));
-  TH1* hptyieldplusA = dynamic_cast<TH1*>(after->At(16));
-  TH1* hptyieldnegB = dynamic_cast<TH1*>(before->At(17));
-  TH1* hptyieldnegA = dynamic_cast<TH1*>(after->At(17));
-  TH1* hchargesB = dynamic_cast<TH1*>(before->At(18));
-  TH1* hchargesA = dynamic_cast<TH1*>(after->At(18));
-  TH1* hphisepB = dynamic_cast<TH1*>(before->At(19));
-  TH1* hphisepA = dynamic_cast<TH1*>(after->At(19));
-  TH1* hstdtpcmultB = dynamic_cast<TH1*>(before->At(20));
-  TH1* hstdtpcmultA = dynamic_cast<TH1*>(after->At(20));
-  TH1* hstdv0multB = dynamic_cast<TH1*>(before->At(21));
-  TH1* hstdv0multA = dynamic_cast<TH1*>(after->At(21));
-  TH1* hstdspd1clsmultB = dynamic_cast<TH1*>(before->At(22));
-  TH1* hstdspd1clsmultA = dynamic_cast<TH1*>(after->At(22));
-  TH1* hstdspdtrmultB = dynamic_cast<TH1*>(before->At(23));
-  TH1* hstdspdtrmultA = dynamic_cast<TH1*>(after->At(23));
+  TH1* hITSclsB = static_cast<TH1*>(before->At(5));
+  TH1* hITSclsA = static_cast<TH1*>(after->At(5));
+  TH1* hTPCclsB = static_cast<TH1*>(before->At(6));
+  TH1* hTPCclsA = static_cast<TH1*>(after->At(6));
+  TH1* hTPCchi2B = static_cast<TH1*>(before->At(7));
+  TH1* hTPCchi2A = static_cast<TH1*>(after->At(7));
+  TH1* hdcaxyB = static_cast<TH1*>(before->At(8));
+  TH1* hdcaxyA = static_cast<TH1*>(after->At(8));
+  TH1* hdcazB = static_cast<TH1*>(before->At(9));
+  TH1* hdcazA = static_cast<TH1*>(after->At(9));
+  TH1* hphitrackletsB = static_cast<TH1*>(before->At(10));
+  TH1* hphitrackletsA = static_cast<TH1*>(after->At(10));
+  TH1* hphitracksB = static_cast<TH1*>(before->At(11));
+  TH1* hphitracksA = static_cast<TH1*>(after->At(11));
+  TH1* hetatrackletsB = static_cast<TH1*>(before->At(12));
+  TH1* hetatrackletsA = static_cast<TH1*>(after->At(12));
+  TH1* hetatracksB = static_cast<TH1*>(before->At(13));
+  TH1* hetatracksA = static_cast<TH1*>(after->At(13));
+  TH1* hprimvtxzTPCB = static_cast<TH1*>(before->At(14));
+  TH1* hprimvtxzTPCA = static_cast<TH1*>(after->At(14));
+  TH1* hptyieldB = static_cast<TH1*>(before->At(15));
+  TH1* hptyieldA = static_cast<TH1*>(after->At(15));
+  TH1* hptyieldplusB = static_cast<TH1*>(before->At(16));
+  TH1* hptyieldplusA = static_cast<TH1*>(after->At(16));
+  TH1* hptyieldnegB = static_cast<TH1*>(before->At(17));
+  TH1* hptyieldnegA = static_cast<TH1*>(after->At(17));
+  TH1* hchargesB = static_cast<TH1*>(before->At(18));
+  TH1* hchargesA = static_cast<TH1*>(after->At(18));
+  TH1* hphisepB = static_cast<TH1*>(before->At(19));
+  TH1* hphisepA = static_cast<TH1*>(after->At(19));
+  TH1* hstdtpcmultB = static_cast<TH1*>(before->At(20));
+  TH1* hstdtpcmultA = static_cast<TH1*>(after->At(20));
+  TH1* hstdv0multB = static_cast<TH1*>(before->At(21));
+  TH1* hstdv0multA = static_cast<TH1*>(after->At(21));
+  TH1* hstdspd1clsmultB = static_cast<TH1*>(before->At(22));
+  TH1* hstdspd1clsmultA = static_cast<TH1*>(after->At(22));
+  TH1* hstdspdtrmultB = static_cast<TH1*>(before->At(23));
+  TH1* hstdspdtrmultA = static_cast<TH1*>(after->At(23));
 
   Bool_t passevent = fEventCuts->IsSelected(event);
   Bool_t isSelectedEventSelection = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
index f7db2fc..e53909b 100644 (file)
@@ -326,8 +326,8 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
       AliWarning(Form("pParticle->GetLabel()!=pMcParticle->Label(), %i, %i", pParticle->GetLabel(), pMcParticle->Label()));
 
     //check if pParticle passes the cuts
-    Bool_t rpOK = kTRUE;
-    Bool_t poiOK = kTRUE;
+    Bool_t rpOK = kFALSE;
+    Bool_t poiOK = kFALSE;
     if (rpCFManager && poiCFManager)
     {
       if(anOption == kESDkine)
index d2a222c..9e144d3 100644 (file)
@@ -108,6 +108,7 @@ AliFlowTrackCuts::AliFlowTrackCuts():
   fAliPID(AliPID::kPion)
 {
   //io constructor 
+  SetPriors(); //init arrays
 }
 
 //-----------------------------------------------------------------------
@@ -171,7 +172,7 @@ AliFlowTrackCuts::AliFlowTrackCuts(const char* name):
                                                     5.04114e-11,
                                                     2.12543e+00,
                                                     4.88663e+00 );
-
+  SetPriors(); //init arrays
 }
 
 //-----------------------------------------------------------------------
@@ -231,6 +232,7 @@ AliFlowTrackCuts::AliFlowTrackCuts(const AliFlowTrackCuts& that):
   if (that.fTPCpidCuts) fTPCpidCuts = new TMatrixF(*(that.fTPCpidCuts));
   if (that.fTOFpidCuts) fTOFpidCuts = new TMatrixF(*(that.fTOFpidCuts));
   if (that.fAliESDtrackCuts) fAliESDtrackCuts = new AliESDtrackCuts(*(that.fAliESDtrackCuts));
+  SetPriors(); //init arrays
 }
 
 //-----------------------------------------------------------------------
@@ -1147,7 +1149,6 @@ void AliFlowTrackCuts::InitPIDcuts()
 //-----------------------------------------------------------------------
 // part added by F. Noferini (some methods)
 Bool_t AliFlowTrackCuts::PassesTOFbayesianCut(AliESDtrack* track){
-  SetPriors();
 
   Bool_t goodtrack = track && (track->GetStatus() & AliESDtrack::kTOFpid) && (track->GetTOFsignal() > 12000) && (track->GetTOFsignal() < 100000) && (track->GetIntegratedLength() > 365) && !(track->GetStatus() & AliESDtrack::kTOFmismatch);