]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG/FLOW/Tasks/AliAnalysisTaskFlowEvent.cxx
fix typo in partial derivative which is used to calculate correlated errors
[u/mrichter/AliRoot.git] / PWG / FLOW / Tasks / AliAnalysisTaskFlowEvent.cxx
index 1672f7c7fc53d9e7d5ad3d9d30c87be0fff826c7..c9461d10ce304dfea31fa704f985f9cf42f2991e 100644 (file)
@@ -132,6 +132,7 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() :
   fV5(0.),
   fDifferentialV2(0),
   fFlowEvent(NULL),
+  fShuffleTracks(kFALSE),
   fMyTRandom3(NULL)
 {
   // Constructor
@@ -192,6 +193,7 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, TString RPt
   fV5(0.),
   fDifferentialV2(0),
   fFlowEvent(NULL),
+  fShuffleTracks(kFALSE),
   fMyTRandom3(NULL)
 {
   // Constructor
@@ -238,8 +240,8 @@ AliAnalysisTaskFlowEvent::~AliAnalysisTaskFlowEvent()
 void AliAnalysisTaskFlowEvent::NotifyRun()
 {
   //at the beginning of each new run
-  if (fCutsRP)   fCutsRP->SetRunsMuon(fCurrentRunNumber);  // XZhang 20120604
-  if (fCutsPOI) fCutsPOI->SetRunsMuon(fCurrentRunNumber);  // XZhang 20120604
+  if (fCutsRP)   fCutsRP->SetRunsMuon(fInputHandler);  // XZhang 20120604
+  if (fCutsPOI) fCutsPOI->SetRunsMuon(fInputHandler);  // XZhang 20120604
        AliESDEvent* fESD = dynamic_cast<AliESDEvent*> (InputEvent());
   if (!fESD) return;
 
@@ -282,7 +284,7 @@ void AliAnalysisTaskFlowEvent::UserCreateOutputObjects()
   cc->SetHistWeightvsPhiMax(fHistWeightvsPhiMax);
   cc->SetHistWeightvsPhiMin(fHistWeightvsPhiMin);
 
-  fFlowEvent = new AliFlowEvent(3000);
+  fFlowEvent = new AliFlowEvent(10000);
 
   if (fQAon)
   {
@@ -321,7 +323,8 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   if (fAnalysisType == "AUTOMATIC")
   {
     //check event cuts
-    if (InputEvent() && !fCutsEvent->IsSelected(InputEvent())) return;
+    if (InputEvent() && !fCutsEvent->IsSelected(InputEvent(),MCEvent())) 
+      return;
 
     //first attach all possible information to the cuts
     fCutsRP->SetEvent( InputEvent(), MCEvent() );  //attach event
@@ -332,7 +335,8 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
     //fFlowEvent = new AliFlowEvent( fCutsRP, fCutsPOI );
 
     //    if (myESD)
-      fFlowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent()));
+    fFlowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent(),mcEvent));
+    fFlowEvent->SetCentrality(fCutsEvent->GetCentrality(InputEvent(),mcEvent));
     if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent);
   }
 
@@ -493,9 +497,9 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
       for(int iCand=0; iCand!=candidates->GetEntriesFast(); ++iCand ) {
         AliFlowCandidateTrack *cand = dynamic_cast<AliFlowCandidateTrack*>(candidates->At(iCand));
         if (!cand) continue;
-        //printf("  Checking at candidate %d with %d daughters: mass %f\n",iCand,cand->GetNDaughters(),cand->Mass());
+        //printf(" - Checking at candidate %d with %d daughters: mass %f\n",iCand,cand->GetNDaughters(),cand->Mass());
         for(int iDau=0; iDau!=cand->GetNDaughters(); ++iDau) {
-          //printf("     Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau) );
+          //printf("    - Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau) );
           for(int iRPs=0; iRPs!=fFlowEvent->NumberOfTracks(); ++iRPs ) {
             AliFlowTrack *iRP = dynamic_cast<AliFlowTrack*>(fFlowEvent->GetTrack( iRPs ));
             if (!iRP) continue;
@@ -557,6 +561,12 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
     h1->Fill(fFlowEvent->GetMCReactionPlaneAngle());
   }
 
+  //do we want to serve shullfed tracks to everybody?
+  fFlowEvent->SetShuffleTracks(fShuffleTracks);
+
+  // associate the mother particles to their daughters in the flow event (if any)
+  fFlowEvent->FindDaughters();
+
   //fListHistos->Print();
   //fOutputFile->WriteObject(fFlowEvent,"myFlowEventSimple");
   PostData(1,fFlowEvent);