]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
restore event cuts and change couts and printf's to alilog
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 May 2010 15:10:09 +0000 (15:10 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 May 2010 15:10:09 +0000 (15:10 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx

index 0c9087a969d2e184a1ad1fa5a1c6d300406f3707..56b8f176652e1cbf5572def46404e7ec0b0226b1 100644 (file)
@@ -366,7 +366,7 @@ void AliFlowEventSimple::Print(Option_t *option) const
   //   -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
   //             ===============================================
   //   printf( "TH1.Print Name  = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
-  printf( "Class.Print Name = %s, Total number of tracks= %d, Number of selected tracks= %d, MC EventPlaneAngle= %f",
+  printf( "Class.Print Name = %s, Total number of tracks= %d, Number of selected tracks= %d, MC EventPlaneAngle= %f\n",
           GetName(),fNumberOfTracks, fEventNSelTracksRP, fMCReactionPlaneAngle );
 
   if (fTrackCollection)
index 973af3176f65daa5bc1ab6093b042c25d9979c96..850c6b49f56c0dc291314859de5eea34e175465a 100644 (file)
@@ -63,6 +63,8 @@
 
 #include "AliAnalysisTaskFlowEvent.h"
 
+#include "AliLog.h"
+
 ClassImp(AliAnalysisTaskFlowEvent)
 
 //________________________________________________________________________
@@ -160,7 +162,7 @@ void AliAnalysisTaskFlowEvent::UserCreateOutputObjects()
 
   if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMCkineESD"  || fAnalysisType == "ESDMCkineMC" || fAnalysisType == "MC"))
   {
-    cout<<"WRONG ANALYSIS TYPE! only ESD, ESDMCkineESD, ESDMCkineMC, AOD and MC are allowed."<<endl;
+    AliError("WRONG ANALYSIS TYPE! only ESD, ESDMCkineESD, ESDMCkineMC, AOD and MC are allowed.");
     exit(1);
   }
 }
@@ -182,20 +184,26 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
     // This handler can return the current MC event
     if (!(fCFManager1&&fCFManager2))
     {
-      cout << "ERROR: No pointer to correction framework cuts! " << endl;
+      AliError("ERROR: No pointer to correction framework cuts! ");
       return;
     }
     if (!mcEvent)
     {
-      Printf("ERROR: Could not retrieve MC event");
+      AliError("ERROR: Could not retrieve MC event");
       return;
     }
 
     fCFManager1->SetMCEventInfo(mcEvent);
     fCFManager2->SetMCEventInfo(mcEvent);
     
-    Printf("Number of MC particles: %d", mcEvent->GetNumberOfTracks());
-    // analysis
+    AliInfo(Form("Number of MC particles: %d", mcEvent->GetNumberOfTracks()));
+
+    //check multiplicity 
+    if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtGenCuts,mcEvent))
+    {
+      AliWarning("Event does not pass multiplicity cuts"); return;
+    }
+    //make event
     flowEvent = new AliFlowEvent(mcEvent,fCFManager1,fCFManager2);
   }
   // Make the FlowEvent for ESD input
@@ -203,17 +211,25 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   {
     if (!(fCFManager1&&fCFManager2))
     {
-      cout << "ERROR: No pointer to correction framework cuts! " << endl;
+      AliError("ERROR: No pointer to correction framework cuts!");
       return;
     }
     if (!myESD)
     {
-      Printf("ERROR: ESD not available");
+      AliError("ERROR: ESD not available");
       return;
     }
+
     //check the offline trigger (check if the event has the correct trigger)
-    Printf("There are %d tracks in this event", fInputEvent->GetNumberOfTracks());
-    // analysis
+    AliInfo(Form("There are %d tracks in this event", fInputEvent->GetNumberOfTracks()));
+
+    //check multiplicity
+    if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtRecCuts,myESD))
+    {
+      AliWarning("Event does not pass multiplicity cuts"); return;
+    }
+
+    //make event
     flowEvent = new AliFlowEvent(myESD,fCFManager1,fCFManager2);
   }
   // Make the FlowEvent for ESD input combined with MC info
@@ -221,25 +237,32 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   {
     if (!(fCFManager1&&fCFManager2))
     {
-      cout << "ERROR: No pointer to correction framework cuts! " << endl;
+      AliError("ERROR: No pointer to correction framework cuts! ");
       return;
     }
     if (!myESD)
     {
-      Printf("ERROR: ESD not available");
+      AliError("ERROR: ESD not available");
       return;
     }
-    Printf("There are %d tracks in this event", fInputEvent->GetNumberOfTracks());
+    AliInfo(Form("There are %d tracks in this event", fInputEvent->GetNumberOfTracks()));
 
     if (!mcEvent)
     {
-      Printf("ERROR: Could not retrieve MC event");
+      AliError("ERROR: Could not retrieve MC event");
       return;
     }
 
     fCFManager1->SetMCEventInfo(mcEvent);
     fCFManager2->SetMCEventInfo(mcEvent);
 
+    //check multiplicity
+    if (!fCFManager1->CheckEventCuts(AliCFManager::kEvtRecCuts,myESD))
+    {
+      AliWarning("Event does not pass multiplicity cuts"); return;
+    }
+
+    //make event
     if (fAnalysisType == "ESDMCkineESD")
     {
       flowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kESDkine, fCFManager1, fCFManager2 );
@@ -254,16 +277,19 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   {
     if (!myAOD)
     {
-      Printf("ERROR: AOD not available");
+      AliError("ERROR: AOD not available");
       return;
     }
-    Printf("There are %d tracks in this event", myAOD->GetNumberOfTracks());
+    AliInfo(Form("There are %d tracks in this event", myAOD->GetNumberOfTracks()));
     flowEvent = new AliFlowEvent(myAOD);
   }
 
-  //check event cuts
+  //check final event cuts
   Int_t mult = flowEvent->NumberOfTracks();
-  if (mult<fMinMult && mult>fMaxMult) return;
+  if (mult<fMinMult && mult>fMaxMult)
+  {
+    AliWarning("FlowEvent cut on multiplicity"); return;
+  }
 
   //tag subevents
   flowEvent->TagSubeventsInEta(fMinA,fMaxA,fMinB,fMaxB);
index ea24a8b938b19276f993bf491a7df1cfb4ce1e0e..29381f80fac3a2ca257fffe9baf6f63436a6f62b 100644 (file)
@@ -34,6 +34,7 @@
 #include "AliFlowTrackSimpleCuts.h"
 #include "AliFlowEventSimple.h"
 #include "AliFlowEvent.h"
+#include "AliLog.h"
 
 ClassImp(AliFlowEvent)
 
@@ -281,7 +282,7 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
   //fills the event with tracks from the ESD and kinematics from the MC info via the track label
   if (anOption==kNoKine)
   {
-    cout<<"WRONG OPTION IN AliFlowEventMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, KineSource anOption)"<<endl;
+    AliFatal("WRONG OPTION IN AliFlowEventMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, KineSource anOption)");
     exit(1);
   }
 
@@ -290,7 +291,7 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
   Int_t iNumberOfInputTracksMC = anInputMc->GetNumberOfTracks() ;
   if (iNumberOfInputTracksMC==-1)
   {
-    cout<<"Skipping Event -- No MC information available for this event"<<endl;
+    AliError("Skipping Event -- No MC information available for this event");
     return;
   }
 
@@ -304,7 +305,8 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
     AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel));
 
     //check
-    if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<"  "<<pMcParticle->Label()<<endl;
+    if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label())
+      AliWarning(Form("pParticle->GetLabel()!=pMcParticle->Label(), %i, %i", pParticle->GetLabel(), pMcParticle->Label()));
 
     //check if pParticle passes the cuts
     Bool_t rpOK = kTRUE;
@@ -313,7 +315,6 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
     {
       if(anOption == kESDkine)
       {
-        //cout<<"take the PID from the MC & the kinematics from the ESD"<<endl;
         if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") &&
             intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
           rpOK=kTRUE;
@@ -323,7 +324,6 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
       }
       else if (anOption == kMCkine)
       {
-        //cout<<"take the PID and kinematics from the MC"<<endl;
         if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
           rpOK=kTRUE;
         if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
@@ -347,10 +347,6 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
       pTrack->SetEta(pMcParticle->Eta() );
       pTrack->SetPhi(pMcParticle->Phi() );
     }
-    else
-    {
-      cout<<"Not a valid option"<<endl;
-    }
 
     if (rpOK && intCFManager)
     {