]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
enabling MC comparison
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 May 2008 15:22:21 +0000 (15:22 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 May 2008 15:22:21 +0000 (15:22 +0000)
PWG2/FLOW/AliAnalysisTaskLYZEventPlane.cxx
PWG2/FLOW/AliAnalysisTaskLeeYangZeros.cxx
PWG2/FLOW/AliAnalysisTaskMCEventPlane.cxx
PWG2/FLOW/AliFlowEventSimpleMaker.cxx
PWG2/FLOW/AliFlowEventSimpleMaker.h
PWG2/FLOW/macros/runAliAnalysisTaskLYZEventPlane.C
PWG2/FLOW/macros/runAliAnalysisTaskLeeYangZeros.C
PWG2/FLOW/macros/runAliAnalysisTaskMCEventPlane.C
PWG2/PWG2flowLinkDef.h
PWG2/libPWG2flow.pkg

index c9b8347a19daed667a2d2224251dd55a478d3569..c1c72b931c0e316065e80abc7bbfb46714f42cb7 100644 (file)
@@ -91,7 +91,7 @@ void AliAnalysisTaskLYZEventPlane::ConnectInputData(Option_t *)
        fESD = esdH->GetEvent();
       }
     }
-    else if (fAnalysisType == "ESD") {
+    else if (fAnalysisType == "ESD" || fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1" ) {
       tree->SetBranchStatus("*", kFALSE);
       tree->SetBranchStatus("Tracks.*", kTRUE);
 
@@ -113,7 +113,7 @@ void AliAnalysisTaskLYZEventPlane::ConnectInputData(Option_t *)
       }
     }
     else {
-      Printf("Wrong analysis type: Only ESD, AOD and MC types are allowed!");
+      Printf("Wrong analysis type: Only ESD, ESDMC0, ESDMC1, AOD and MC types are allowed!");
       exit(1);
 
     }
@@ -126,8 +126,8 @@ void AliAnalysisTaskLYZEventPlane::CreateOutputObjects()
   // Called once
   cout<<"AliAnalysisTaskLYZEventPlane::CreateOutputObjects()"<<endl;
 
-  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "MC")) {
-    cout<<"WRONG ANALYSIS TYPE! only ESD, AOD and MC are allowed."<<endl;
+  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD"  || fAnalysisType == "ESDMC0"  || fAnalysisType == "ESDMC1" || fAnalysisType == "MC")) {
+    cout<<"WRONG ANALYSIS TYPE! only ESD, , ESDMC0, ESDMC1, AOD and MC are allowed."<<endl;
     exit(1);
   }
 
@@ -204,6 +204,56 @@ void AliAnalysisTaskLYZEventPlane::Exec(Option_t *)
     fLyz->Make(fEvent,fLyzEp);
     delete fEvent;
   }
+  else if (fAnalysisType == "ESDMC0") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+    
+    AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    if (!eventHandler) {
+      Printf("ERROR: Could not retrieve MC event handler");
+      return;
+    }
+
+    AliMCEvent* mcEvent = eventHandler->MCEvent();
+    if (!mcEvent) {
+      Printf("ERROR: Could not retrieve MC event");
+      return;
+    }
+
+    //lee yang zeros analysis 
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
+    fLyz->Make(fEvent,fLyzEp);
+    delete fEvent;
+    //delete mcEvent;
+  }
+  else if (fAnalysisType == "ESDMC1") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+    
+    AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    if (!eventHandler) {
+      Printf("ERROR: Could not retrieve MC event handler");
+      return;
+    }
+
+    AliMCEvent* mcEvent = eventHandler->MCEvent();
+    if (!mcEvent) {
+      Printf("ERROR: Could not retrieve MC event");
+      return;
+    }
+
+    //lee yang zeros analysis 
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,1); //0 = kine from ESD, 1 = kine from MC
+    fLyz->Make(fEvent,fLyzEp);
+    delete fEvent;
+    //delete mcEvent;
+  }
   else if (fAnalysisType == "AOD") {
     if (!fAOD) {
       Printf("ERROR: fAOD not available");
index 87e1ee7d7504e5f397c838f04f2f0c09f2c700a1..3f99f5fcfd7687eb2b91529ad2b80d7fe5f5b002 100644 (file)
@@ -89,7 +89,7 @@ void AliAnalysisTaskLeeYangZeros::ConnectInputData(Option_t *)
        fESD = esdH->GetEvent();
       }
     }
-    else if (fAnalysisType == "ESD") {
+    else if (fAnalysisType == "ESD" || fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1"  ) {
       tree->SetBranchStatus("*", kFALSE);
       tree->SetBranchStatus("Tracks.*", kTRUE);
 
@@ -111,7 +111,7 @@ void AliAnalysisTaskLeeYangZeros::ConnectInputData(Option_t *)
       }
     }
     else {
-      Printf("Wrong analysis type: Only ESD, AOD and MC types are allowed!");
+      Printf("Wrong analysis type: Only ESD, ESDMC0, ESDMC1, AOD and MC types are allowed!");
 
     }
   }
@@ -123,8 +123,8 @@ void AliAnalysisTaskLeeYangZeros::CreateOutputObjects()
   // Called once
   cout<<"AliAnalysisTaskLeeYangZeros::CreateOutputObjects()"<<endl;
 
-  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "MC")) {
-    cout<<"WRONG ANALYSIS TYPE! only ESD, AOD and MC are allowed."<<endl;
+  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMC0"  || fAnalysisType == "ESDMC1" || fAnalysisType == "MC")) {
+    cout<<"WRONG ANALYSIS TYPE! only ESD, ESDMC0, ESDMC1, AOD and MC are allowed."<<endl;
     exit(1);
   }
 
@@ -199,6 +199,56 @@ void AliAnalysisTaskLeeYangZeros::Exec(Option_t *)
     fLyz->Make(fEvent);
     delete fEvent;
   }
+  else if (fAnalysisType == "ESDMC0") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+    
+    AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    if (!eventHandler) {
+      Printf("ERROR: Could not retrieve MC event handler");
+      return;
+    }
+
+    AliMCEvent* mcEvent = eventHandler->MCEvent();
+    if (!mcEvent) {
+      Printf("ERROR: Could not retrieve MC event");
+      return;
+    }
+
+    //lee yang zeros analysis 
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
+    fLyz->Make(fEvent);
+    delete fEvent;
+    //delete mcEvent;
+  }
+  else if (fAnalysisType == "ESDMC1") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+    
+    AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    if (!eventHandler) {
+      Printf("ERROR: Could not retrieve MC event handler");
+      return;
+    }
+
+    AliMCEvent* mcEvent = eventHandler->MCEvent();
+    if (!mcEvent) {
+      Printf("ERROR: Could not retrieve MC event");
+      return;
+    }
+
+    //lee yang zeros analysis 
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,1); //0 = kine from ESD, 1 = kine from MC
+    fLyz->Make(fEvent);
+    delete fEvent;
+    //delete mcEvent;
+  }
   else if (fAnalysisType == "AOD") {
     if (!fAOD) {
       Printf("ERROR: fAOD not available");
index 8d3f31634690cc239ae4b6f8208a88c68d43b4a4..20f5c4bb485131dc8e213d8cf860b7308c171de9 100644 (file)
@@ -78,6 +78,7 @@ void AliAnalysisTaskMCEventPlane::ConnectInputData(Option_t *)
     Printf("ERROR: Could not read chain from input slot 0");
   } else {
     // Disable all branches and enable only the needed ones
+    
     if (fAnalysisType == "MC") {
       cout<<"!!!!!reading MC kinematics only"<<endl;
       // we want to process only MC
@@ -91,7 +92,8 @@ void AliAnalysisTaskMCEventPlane::ConnectInputData(Option_t *)
        fESD = esdH->GetEvent();
       }
     }
-    else if (fAnalysisType == "ESD") {
+
+    else if (fAnalysisType == "ESD" || fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1" ) {
       cout<<"!!!!!reading the ESD only"<<endl;
       tree->SetBranchStatus("*", kFALSE);
       tree->SetBranchStatus("Tracks.*", kTRUE);
@@ -103,6 +105,7 @@ void AliAnalysisTaskMCEventPlane::ConnectInputData(Option_t *)
       } else
        fESD = esdH->GetEvent();
     }
+
     else if (fAnalysisType == "AOD") {
       cout<<"!!!!!reading the AOD only"<<endl;
       AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
@@ -115,7 +118,7 @@ void AliAnalysisTaskMCEventPlane::ConnectInputData(Option_t *)
       }
     }
     else {
-      Printf("!!!!!Wrong analysis type: Only ESD, AOD and MC types are allowed!");
+      Printf("!!!!!Wrong analysis type: Only ESD, ESDMC0, ESDMC1, AOD and MC types are allowed!");
       exit(1);
       
     }
@@ -128,8 +131,8 @@ void AliAnalysisTaskMCEventPlane::CreateOutputObjects()
   // Called once
   cout<<"AliAnalysisTaskMCEventPlane::CreateOutputObjects()"<<endl;
 
-  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "MC")) {
-    cout<<"WRONG ANALYSIS TYPE! only ESD, AOD and MC are allowed."<<endl;
+  if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD"  || fAnalysisType == "ESDMC0"  || fAnalysisType == "ESDMC1" || fAnalysisType == "MC")) {
+    cout<<"WRONG ANALYSIS TYPE! only ESD, ESDMC0, ESDMC1, AOD and MC are allowed."<<endl;
     exit(1);
   }
 
@@ -201,6 +204,7 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
 
     delete fEvent;
   }
+
   else if (fAnalysisType == "ESD") {
     if (!fESD) {
       Printf("ERROR: fESD not available");
@@ -213,6 +217,33 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
     fMc->Make(fEvent,fRP);
     delete fEvent;
   }
+
+  else if (fAnalysisType == "ESDMC0") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+
+    // analysis 
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
+    fMc->Make(fEvent,fRP);
+    delete fEvent;
+  }
+
+  else if (fAnalysisType == "ESDMC1") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+
+    // analysis 
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,1); //0 = kine from ESD, 1 = kine from MC
+    fMc->Make(fEvent,fRP);
+    delete fEvent;
+  }
+
   else if (fAnalysisType == "AOD") {
     if (!fAOD) {
       Printf("ERROR: fAOD not available");
index 1fe097cfeaab11cca69c83f4a310ad647266e2ea..17484106b05849afc47c3cc4b65b32b59d49119d 100644 (file)
@@ -201,8 +201,7 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(TTree* fInput)
 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* fInput)
 {
   //Fills the event from the MC kinematic information
-  Bool_t  fDoubleLoop = kFALSE; 
-
+  
   Int_t fNumberOfInputTracks = fInput->GetNumberOfTracks() ;
   cerr<<"fInput->GetNumberOfTracks() = "<<fNumberOfInputTracks<<endl;
  
@@ -215,92 +214,34 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* fInput)
   Int_t fSelParticlesDiff = 0;
   Int_t fSelParticlesInt = 0;
 
-
-  if (fDoubleLoop)
-    {                   //double loop
-      while (fGoodTracks < fN*2 && ftrkN < fNumberOfInputTracks) 
-       {
-         AliMCParticle* fParticle = fInput->GetTrack(ftrkN);   //get input particle
-         //cut on tracks
-         if(TMath::Abs(fParticle->Eta()) < 0.9) 
-           {
-             //              Int_t fLoop = floor(2.*fParticle->Pt())+2;
-             //              for(Int_t d=0;d<fLoop;d++) 
-             for(Int_t d=0;d<2;d++) 
-               {
-                 if(
-                    TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211
-                    //       TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211 ||
-                    //       TMath::Abs(fParticle->Particle()->GetPdgCode()) == 321 ||
-                    //       TMath::Abs(fParticle->Particle()->GetPdgCode()) == 2212
-                    )
-                   {
-                     fTrack = new AliFlowTrackSimple();
-                     fTrack->SetPt(fParticle->Pt() );
-                     fTrack->SetEta(fParticle->Eta() );
-                     fTrack->SetPhi(fParticle->Phi() );
-                     fTrack->SetForIntegratedFlow(kTRUE);
-                     fTrack->SetForDifferentialFlow(kTRUE);
-
-                     if (fTrack->UseForIntegratedFlow())
-                       { fSelParticlesInt++; }
-                     if (fTrack->UseForDifferentialFlow())
-                       { fSelParticlesDiff++; }
-                     fGoodTracks++;
-                     fEvent->TrackCollection()->Add(fTrack);
-                   }
-                       /*
-                 else if(
-                         TMath::Abs(fParticle->Particle()->GetPdgCode()) == 2212
-                         )
-                   {
-                     fTrack = new AliFlowTrackSimple();
-                     fTrack->SetPt(fParticle->Pt() );
-                     fTrack->SetEta(fParticle->Eta() );
-                     fTrack->SetPhi(fParticle->Phi() );
-                     fTrack->SetForIntegratedFlow(kFALSE);
-                     fTrack->SetForDifferentialFlow(kTRUE);
-
-                     if (fTrack->UseForIntegratedFlow())
-                       { fSelParticlesInt++; }
-                     if (fTrack->UseForDifferentialFlow())
-                       { fSelParticlesDiff++; }
-                     fGoodTracks++;
-                     fEvent->TrackCollection()->Add(fTrack);     
-                   }
-                       */
-               }
-           }
-         ftrkN++; 
-       }
-    }
-  else {                                  //normal loop
-    while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
-      AliMCParticle* fParticle = fInput->GetTrack(ftrkN);   //get input particle
-      //cut on tracks
-      if (TMath::Abs(fParticle->Eta()) < 0.2)
-       {
-         if(
-            TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211
-            //       TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211 ||
-            //       TMath::Abs(fParticle->Particle()->GetPdgCode()) == 321 ||
-            //       TMath::Abs(fParticle->Particle()->GetPdgCode()) == 2212
-            )
-           {
-             fTrack = new AliFlowTrackSimple() ;
-             fTrack->SetPt(fParticle->Pt() );
-             fTrack->SetEta(fParticle->Eta() );
-             fTrack->SetPhi(fParticle->Phi() );
-             fTrack->SetForIntegratedFlow(kTRUE);
-             fTrack->SetForDifferentialFlow(kTRUE);
-
-             if (fTrack->UseForIntegratedFlow())
-               { fSelParticlesInt++; }
-             if (fTrack->UseForDifferentialFlow())
-               { fSelParticlesDiff++; }
-             fGoodTracks++;
-             fEvent->TrackCollection()->Add(fTrack) ;               
-           }
+   
+  //normal loop
+  while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
+    AliMCParticle* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    //cut on tracks
+    if (TMath::Abs(fParticle->Eta()) < 0.2)
+      {
+       if(
+          TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211
+          //         TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211 ||
+          //         TMath::Abs(fParticle->Particle()->GetPdgCode()) == 321 ||
+          //         TMath::Abs(fParticle->Particle()->GetPdgCode()) == 2212
+          )
+         {
+           fTrack = new AliFlowTrackSimple() ;
+           fTrack->SetPt(fParticle->Pt() );
+           fTrack->SetEta(fParticle->Eta() );
+           fTrack->SetPhi(fParticle->Phi() );
+           fTrack->SetForIntegratedFlow(kTRUE);
+           fTrack->SetForDifferentialFlow(kTRUE);
+
+           if (fTrack->UseForIntegratedFlow())
+             { fSelParticlesInt++; }
+           if (fTrack->UseForDifferentialFlow())
+             { fSelParticlesDiff++; }
+           fGoodTracks++;
+           fEvent->TrackCollection()->Add(fTrack) ;         
+         }
          /*      else if(
                  TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211
                  )
@@ -320,13 +261,11 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* fInput)
              fEvent->TrackCollection()->Add(fTrack);        
            }
          */
-       }
+      }
       
-      ftrkN++; 
-    }
+    ftrkN++; 
   }
-
-
+  
   fEvent-> SetEventNSelTracksIntFlow(fSelParticlesInt);  
   fEvent->SetNumberOfTracks(fGoodTracks);
   cout<<" fGoodTracks = "<<fGoodTracks<<endl;
@@ -341,8 +280,7 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* fInput)
 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput)
 {
   //Fills the event from the ESD
-  Bool_t  fDoubleLoop = kFALSE; 
-
+  
   Int_t fNumberOfInputTracks = fInput->GetNumberOfTracks() ;
   cerr<<"fInput->GetNumberOfTracks() = "<<fNumberOfInputTracks<<endl;
   
@@ -356,68 +294,36 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput)
   Int_t fSelParticlesInt = 0;
 
 
-  if (fDoubleLoop)
-    {                   //double loop
-      while (fGoodTracks < fN*2 && ftrkN < fNumberOfInputTracks) 
-       {
-         AliESDtrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
-         //cut on tracks
-         if(TMath::Abs(fParticle->Eta()) < 0.9) 
-           {
-             //              Int_t fLoop = floor(2.*fParticle->Pt())+2;
-             //              for(Int_t d=0;d<fLoop;d++) 
-             for(Int_t d=0;d<2;d++) 
-               {
-                 fTrack = new AliFlowTrackSimple();
-                 fTrack->SetPt(fParticle->Pt() );
-                 fTrack->SetEta(fParticle->Eta() );
-                 fTrack->SetPhi(fParticle->Phi() );
-                 fTrack->SetForIntegratedFlow(kTRUE);
-                 fTrack->SetForDifferentialFlow(kTRUE);
-
-                 if (fTrack->UseForIntegratedFlow())
-                   { fSelParticlesInt++; }
-                 if (fTrack->UseForDifferentialFlow())
-                   { fSelParticlesDiff++; }
-                 fGoodTracks++;
-                 fEvent->TrackCollection()->Add(fTrack);
-               }
-           }
-         ftrkN++; 
-       }
-    }
-  else {                                  //normal loop
-    while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
-      AliESDtrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
-      //cut on tracks
-      if (TMath::Abs(fParticle->Eta()) < 0.2)
-       {
-         fTrack = new AliFlowTrackSimple() ;
-         fTrack->SetPt(fParticle->Pt() );
-         fTrack->SetEta(fParticle->Eta() );
-         fTrack->SetPhi(fParticle->Phi() );
-         fTrack->SetForIntegratedFlow(kTRUE);
-         fTrack->SetForDifferentialFlow(kTRUE);
-
-         if (fTrack->UseForIntegratedFlow())
-           { fSelParticlesInt++; }
-         if (fTrack->UseForDifferentialFlow())
-           { fSelParticlesDiff++; }
-         fGoodTracks++;
-         fEvent->TrackCollection()->Add(fTrack) ;           
-       }
+  //normal loop
+  while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
+    AliESDtrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    //cut on tracks
+    if (TMath::Abs(fParticle->Eta()) < 0.2)
+      {
+       fTrack = new AliFlowTrackSimple() ;
+       fTrack->SetPt(fParticle->Pt() );
+       fTrack->SetEta(fParticle->Eta() );
+       fTrack->SetPhi(fParticle->Phi() );
+       fTrack->SetForIntegratedFlow(kTRUE);
+       fTrack->SetForDifferentialFlow(kTRUE);
+
+       if (fTrack->UseForIntegratedFlow())
+         { fSelParticlesInt++; }
+       if (fTrack->UseForDifferentialFlow())
+         { fSelParticlesDiff++; }
+       fGoodTracks++;
+       fEvent->TrackCollection()->Add(fTrack) ;             
+      }
       
-      ftrkN++; 
-    }
+    ftrkN++; 
   }
-
-
+  
   fEvent-> SetEventNSelTracksIntFlow(fSelParticlesInt);  
   fEvent->SetNumberOfTracks(fGoodTracks);
   cout<<" fGoodTracks = "<<fGoodTracks<<endl;
   cout << "  fSelectedTracksInt = " << fSelParticlesInt << endl;  
   return fEvent;
-  
+
 
 }
 
@@ -427,8 +333,7 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput)
 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* fInput)
 {
   //Fills the event from the AOD
-  Bool_t  fDoubleLoop = kFALSE; 
-
+  
   Int_t fNumberOfInputTracks = fInput->GetNumberOfTracks() ;
   cerr<<"fInput->GetNumberOfTracks() = "<<fNumberOfInputTracks<<endl;
   
@@ -442,71 +347,119 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* fInput)
   Int_t fSelParticlesInt = 0;
 
   
-  if (fDoubleLoop)
-    {                   //double loop
-      while (fGoodTracks < fN*2 && ftrkN < fNumberOfInputTracks) 
-       {
-         AliAODTrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
-         //cut on tracks
-         if(TMath::Abs(fParticle->Eta()) < 0.9) 
-           {
-             //              Int_t fLoop = floor(2.*fParticle->Pt())+2;
-             //              for(Int_t d=0;d<fLoop;d++) 
-             for(Int_t d=0;d<2;d++) 
-               {
-                 fTrack = new AliFlowTrackSimple();
-                 fTrack->SetPt(fParticle->Pt() );
-                 fTrack->SetEta(fParticle->Eta() );
-                 fTrack->SetPhi(fParticle->Phi() );
-                 fTrack->SetForIntegratedFlow(kTRUE);
-                 fTrack->SetForDifferentialFlow(kTRUE);
-
-                 if (fTrack->UseForIntegratedFlow())
-                   { fSelParticlesInt++; }
-                 if (fTrack->UseForDifferentialFlow())
-                   { fSelParticlesDiff++; }
-                 fGoodTracks++;
-                 fEvent->TrackCollection()->Add(fTrack);
-               }
-           }
-         ftrkN++; 
-       }
-    }
-  else {                                  //normal loop
-    while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
-      AliAODTrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
-      //cut on tracks
-      if (TMath::Abs(fParticle->Eta()) < 0.2)
-       {
-         fTrack = new AliFlowTrackSimple() ;
-         fTrack->SetPt(fParticle->Pt() );
-         fTrack->SetEta(fParticle->Eta() );
-         fTrack->SetPhi(fParticle->Phi() );
-         fTrack->SetForIntegratedFlow(kTRUE);
-         fTrack->SetForDifferentialFlow(kTRUE);
-
-         if (fTrack->UseForIntegratedFlow())
-           { fSelParticlesInt++; }
-         if (fTrack->UseForDifferentialFlow())
-           { fSelParticlesDiff++; }
-         fGoodTracks++;
-         fEvent->TrackCollection()->Add(fTrack) ;           
-       }
+  //normal loop
+  while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
+    AliAODTrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    //cut on tracks
+    if (TMath::Abs(fParticle->Eta()) < 0.2)
+      {
+       fTrack = new AliFlowTrackSimple() ;
+       fTrack->SetPt(fParticle->Pt() );
+       fTrack->SetEta(fParticle->Eta() );
+       fTrack->SetPhi(fParticle->Phi() );
+       fTrack->SetForIntegratedFlow(kTRUE);
+       fTrack->SetForDifferentialFlow(kTRUE);
+
+       if (fTrack->UseForIntegratedFlow())
+         { fSelParticlesInt++; }
+       if (fTrack->UseForDifferentialFlow())
+         { fSelParticlesDiff++; }
+       fGoodTracks++;
+       fEvent->TrackCollection()->Add(fTrack) ;             
+      }
       
-      ftrkN++; 
-    }
+    ftrkN++; 
+  }
+  
+  fEvent-> SetEventNSelTracksIntFlow(fSelParticlesInt);  
+  fEvent->SetNumberOfTracks(fGoodTracks);
+  cout<<" fGoodTracks = "<<fGoodTracks<<endl;
+  cout << "  fSelectedTracksInt = " << fSelParticlesInt << endl;  
+  return fEvent;
+  
+}
+//-----------------------------------------------------------------------   
+AliFlowEventSimple*  AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput, AliMCEvent* fInputMc, Int_t fOption)
+{
+  //fills the event with tracks from the ESD and kinematics from the MC info via the track label
+
+  if (!(fOption ==0 || fOption ==1)) {
+    cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput, AliMCEvent* fInputMc, Int_t fOption)"<<endl;
+    exit(1);
   }
 
+  Int_t fNumberOfInputTracks = fInput->GetNumberOfTracks() ;
+  cerr<<"fInput->GetNumberOfTracks() = "<<fNumberOfInputTracks<<endl;
+  
+  fEvent = new AliFlowEventSimple(10);
+    
+  //Int_t fN = 256; //multiplicity for chi=1
+  Int_t fN = fNumberOfInputTracks;
+  Int_t fGoodTracks = 0;
+  Int_t ftrkN = 0;
+  Int_t fSelParticlesDiff = 0;
+  Int_t fSelParticlesInt = 0;
 
+  //normal loop
+  while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
+    AliESDtrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    //get Label
+    Int_t fLabel = fParticle->GetLabel();
+    //match to mc particle
+    AliMCParticle* fMcParticle = fInputMc->GetTrack(TMath::Abs(fLabel));
+    
+    //check
+    if (TMath::Abs(fParticle->GetLabel())!=fMcParticle->Label()) cout<<"fParticle->GetLabel()!=fMcParticle->Label() "<<fParticle->GetLabel()<<"  "<<fMcParticle->Label()<<endl;
+    
+    //cut on tracks
+    if (TMath::Abs(fParticle->Eta()) < 0.2)
+      {
+       if(
+          TMath::Abs(fMcParticle->Particle()->GetPdgCode()) == 211 //pions
+          //         TMath::Abs(fMcParticle->Particle()->GetPdgCode()) == 211 ||
+          //         TMath::Abs(fMcParticle->Particle()->GetPdgCode()) == 321 ||
+          //         TMath::Abs(fMcParticle->Particle()->GetPdgCode()) == 2212
+          )
+         {
+           if(fOption == 0) { //take the PID from the MC & the kinematics from the ESD
+             fTrack = new AliFlowTrackSimple() ;
+             fTrack->SetPt(fParticle->Pt() );
+             fTrack->SetEta(fParticle->Eta() );
+             fTrack->SetPhi(fParticle->Phi() );
+             fTrack->SetForIntegratedFlow(kTRUE);
+             fTrack->SetForDifferentialFlow(kTRUE);
+           }
+           else if (fOption == 1) { //take the PID and kinematics from the MC
+             fTrack = new AliFlowTrackSimple() ;
+             fTrack->SetPt(fMcParticle->Pt() );
+             fTrack->SetEta(fMcParticle->Eta() );
+             fTrack->SetPhi(fMcParticle->Phi() );
+             fTrack->SetForIntegratedFlow(kTRUE);
+             fTrack->SetForDifferentialFlow(kTRUE);
+           }
+           else { cout<<"Not a valid option"<<endl; }
+           if (fTrack->UseForIntegratedFlow())
+             { fSelParticlesInt++; }
+           if (fTrack->UseForDifferentialFlow())
+             { fSelParticlesDiff++; }
+           fGoodTracks++;
+           fEvent->TrackCollection()->Add(fTrack) ;         
+         }
+      }
+    ftrkN++; 
+  }
+  
   fEvent-> SetEventNSelTracksIntFlow(fSelParticlesInt);  
   fEvent->SetNumberOfTracks(fGoodTracks);
   cout<<" fGoodTracks = "<<fGoodTracks<<endl;
   cout << "  fSelectedTracksInt = " << fSelParticlesInt << endl;  
   return fEvent;
 
-  
+
 }
 
+
+
 /*
 $Log$
 */ 
index 8483700a0f6e02aad474f63c54bc17c3b218ce21..0d08af0a33ae00a55c4c2426c6894f1c40c932bc 100644 (file)
@@ -33,6 +33,9 @@ class AliFlowEventSimpleMaker {
   AliFlowEventSimple* FillTracks(TTree* fInput);
   AliFlowEventSimple* FillTracks(AliMCEvent* fInput);
   AliFlowEventSimple* FillTracks(AliESDEvent* fInput);
+  AliFlowEventSimple* FillTracks(AliESDEvent* fInput, AliMCEvent* fInputMc, Int_t fOption);
+  // fOption = 0 : kine from ESD
+  // fOption = 1 : kine from MC
   AliFlowEventSimple* FillTracks(AliAODEvent* fInput);
     
  private:
index dcc2b4ba4fc0299fb8ac4c664a40566cbd2cd3c5..890d7bb69f2546f2b59ba08e5b0ad68bd38cf8ce 100644 (file)
@@ -10,8 +10,8 @@ void runAliAnalysisTaskLYZEventPlane(Int_t nRuns = 2, TString type = "ESD", cons
   timer.Start();
 
   // include path (to find the .h files when compiling)
-  //gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
-  //gSystem->AddIncludePath("-I$ROOTSYS/include") ;
+  gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
+  gSystem->AddIncludePath("-I$ROOTSYS/include") ;
 
   // load needed libraries
   gSystem->Load("libTree.so");
@@ -19,19 +19,19 @@ void runAliAnalysisTaskLYZEventPlane(Int_t nRuns = 2, TString type = "ESD", cons
   cerr<<"libESD loaded..."<<endl;
   gSystem->Load("libANALYSIS.so");
   cerr<<"libANALYSIS.so loaded..."<<endl;
-  gSystem->Load("libPWG2flow.so");
+  //gSystem->Load("libPWG2flow.so");
   
-  //gROOT->LoadMacro("AliFlowLYZConstants.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonConstants.cxx+");
-  //gROOT->LoadMacro("AliFlowVector.cxx+");
-  //gROOT->LoadMacro("AliFlowTrackSimple.cxx+");
-  //gROOT->LoadMacro("AliFlowEventSimple.cxx+");
-  //gROOT->LoadMacro("AliFlowEventSimpleMaker.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonHist.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonHistResults.cxx+");
-  //gROOT->LoadMacro("AliFlowLYZEventPlane.cxx+");
-  //gROOT->LoadMacro("AliFlowAnalysisWithLYZEventPlane.cxx+"); 
-  //gROOT->LoadMacro("AliAnalysisTaskLYZEventPlane.cxx+");
+  gROOT->LoadMacro("AliFlowLYZConstants.cxx+");
+  gROOT->LoadMacro("AliFlowCommonConstants.cxx+");
+  gROOT->LoadMacro("AliFlowVector.cxx+");
+  gROOT->LoadMacro("AliFlowTrackSimple.cxx+");
+  gROOT->LoadMacro("AliFlowEventSimple.cxx+");
+  gROOT->LoadMacro("AliFlowEventSimpleMaker.cxx+");
+  gROOT->LoadMacro("AliFlowCommonHist.cxx+");
+  gROOT->LoadMacro("AliFlowCommonHistResults.cxx+");
+  gROOT->LoadMacro("AliFlowLYZEventPlane.cxx+");
+  gROOT->LoadMacro("AliFlowAnalysisWithLYZEventPlane.cxx+"); 
+  gROOT->LoadMacro("AliAnalysisTaskLYZEventPlane.cxx+");
 
   // create the TChain. CreateESDChain() is defined in CreateESDChain.C
   TChain* chain = CreateESDChain(dataDir, nRuns, offset);
index d6a6d260669e525dab6c9a9a62659da1d7725521..e003b35d0cd1b98738df466ae77c9a13f03708a5 100644 (file)
@@ -4,14 +4,14 @@ void LookupWrite(TChain* chain, const char* target) ;
 
 
 
-void runAliAnalysisTaskLeeYangZeros(Int_t nRuns = 2, TString type = "ESD", Bool_t firstrun = kTRUE, Bool_t usesum = kTRUE, const Char_t* dataDir="/Users/snelling/alice_data/TherminatorFIX", Int_t offset = 0) 
+void runAliAnalysisTaskLeeYangZeros(Int_t nRuns = 2, Bool_t firstrun = kTRUE, TString type = "ESD", Bool_t usesum = kTRUE, const Char_t* dataDir="/Users/snelling/alice_data/TherminatorFIX", Int_t offset = 0) 
 {
   TStopwatch timer;
   timer.Start();
 
   // include path (to find the .h files when compiling)
-  //gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
-  //gSystem->AddIncludePath("-I$ROOTSYS/include") ;
+  gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
+  gSystem->AddIncludePath("-I$ROOTSYS/include") ;
 
   // load needed libraries
   gSystem->Load("libTree.so");
@@ -21,18 +21,18 @@ void runAliAnalysisTaskLeeYangZeros(Int_t nRuns = 2, TString type = "ESD", Bool_
   cerr<<"libANALYSIS.so loaded..."<<endl;
   gSystem->Load("libPWG2flow.so");
   
-  //gROOT->LoadMacro("AliFlowLYZConstants.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonConstants.cxx+");
-  //gROOT->LoadMacro("AliFlowVector.cxx+");
-  //gROOT->LoadMacro("AliFlowTrackSimple.cxx+");
-  //gROOT->LoadMacro("AliFlowEventSimple.cxx+");
-  //gROOT->LoadMacro("AliFlowEventSimpleMaker.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonHist.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonHistResults.cxx+");
-  //gROOT->LoadMacro("AliFlowLYZHist1.cxx+");
-  //gROOT->LoadMacro("AliFlowLYZHist2.cxx+");
-  //gROOT->LoadMacro("AliFlowAnalysisWithLeeYangZeros.cxx+"); 
-  //gROOT->LoadMacro("AliAnalysisTaskLeeYangZeros.cxx+");
+  //  gROOT->LoadMacro("AliFlowLYZConstants.cxx+");
+  //  gROOT->LoadMacro("AliFlowCommonConstants.cxx+");
+  //  gROOT->LoadMacro("AliFlowVector.cxx+");
+  //  gROOT->LoadMacro("AliFlowTrackSimple.cxx+");
+  //  gROOT->LoadMacro("AliFlowEventSimple.cxx+");
+  //  gROOT->LoadMacro("AliFlowEventSimpleMaker.cxx+");
+  //  gROOT->LoadMacro("AliFlowCommonHist.cxx+");
+  //  gROOT->LoadMacro("AliFlowCommonHistResults.cxx+");
+  //  gROOT->LoadMacro("AliFlowLYZHist1.cxx+");
+  //  gROOT->LoadMacro("AliFlowLYZHist2.cxx+");
+  //  gROOT->LoadMacro("AliFlowAnalysisWithLeeYangZeros.cxx+"); 
+  //  gROOT->LoadMacro("AliAnalysisTaskLeeYangZeros.cxx+");
 
   // create the TChain. CreateESDChain() is defined in CreateESDChain.C
   TChain* chain = CreateESDChain(dataDir, nRuns, offset);
index a2ec1c672398d2c9ddf66d8a0adbf36db30de883..ffad01a4e7324ecc052d7f31c573f4748edb3d26 100644 (file)
@@ -4,15 +4,15 @@ void LookupWrite(TChain* chain, const char* target) ;
 
 
 
-void runAliAnalysisTaskMCEventPlane(Int_t nRuns = 2, TString type = "MC", const Char_t* dataDir="/Users/snelling/alice_data/TherminatorFIX", Int_t offset = 0) 
+void runAliAnalysisTaskMCEventPlane(Int_t nRuns = 2, TString type = "MC", const Char_t* dataDir="/data/alice1/kolk/TherminatorFIX", Int_t offset = 0) 
 
 {
   TStopwatch timer;
   timer.Start();
 
   // include path (to find the .h files when compiling)
-  //gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
-  //gSystem->AddIncludePath("-I$ROOTSYS/include") ;
+  gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
+  gSystem->AddIncludePath("-I$ROOTSYS/include") ;
 
   // load needed libraries
   gSystem->Load("libTree.so");
@@ -20,17 +20,17 @@ void runAliAnalysisTaskMCEventPlane(Int_t nRuns = 2, TString type = "MC", const
   cerr<<"libESD loaded..."<<endl;
   gSystem->Load("libANALYSIS.so");
   cerr<<"libANALYSIS.so loaded..."<<endl;
-  gSystem->Load("libPWG2flow.so");
+  //gSystem->Load("libPWG2flow.so");
   
-  //gROOT->LoadMacro("AliFlowCommonConstants.cxx+");
-  //gROOT->LoadMacro("AliFlowVector.cxx+");
-  //gROOT->LoadMacro("AliFlowTrackSimple.cxx+");
-  //gROOT->LoadMacro("AliFlowEventSimple.cxx+");
-  //gROOT->LoadMacro("AliFlowEventSimpleMaker.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonHist.cxx+");
-  //gROOT->LoadMacro("AliFlowCommonHistResults.cxx+");
-  //gROOT->LoadMacro("AliFlowAnalysisWithMCEventPlane.cxx+"); 
-  //gROOT->LoadMacro("AliAnalysisTaskMCEventPlane.cxx+");
+  gROOT->LoadMacro("AliFlowCommonConstants.cxx+");
+  gROOT->LoadMacro("AliFlowVector.cxx+");
+  gROOT->LoadMacro("AliFlowTrackSimple.cxx+");
+  gROOT->LoadMacro("AliFlowEventSimple.cxx+");
+  gROOT->LoadMacro("AliFlowEventSimpleMaker.cxx+");
+  gROOT->LoadMacro("AliFlowCommonHist.cxx+");
+  gROOT->LoadMacro("AliFlowCommonHistResults.cxx+");
+  gROOT->LoadMacro("AliFlowAnalysisWithMCEventPlane.cxx+"); 
+  gROOT->LoadMacro("AliAnalysisTaskMCEventPlane.cxx+");
 
   // create the TChain. CreateESDChain() is defined in CreateESDChain.C
   TChain* chain = CreateESDChain(dataDir, nRuns, offset);
@@ -39,7 +39,7 @@ void runAliAnalysisTaskMCEventPlane(Int_t nRuns = 2, TString type = "MC", const
   //____________________________________________//
   // Make the analysis manager
   AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
-  if (type == "ESD" || type == "MC" ) {
+  if (type == "ESD" || type == "ESDMC0" || type == "ESDMC1" || type == "MC" ) {
     AliVEventHandler* esdH = new AliESDInputHandler;
     mgr->SetInputEventHandler(esdH);
   }  
index 2af9f72d70d1fc51cde57cfe248b73483de6bdac..68c2d98561e8c59201dda6a4cffb0489448179fa 100644 (file)
 #pragma link C++ class AliFlowLYZEventPlane+;
 #pragma link C++ class AliFlowEventSimpleMaker+;
 #pragma link C++ class AliFlowAnalysisWithMCEventPlane+;
+#pragma link C++ class AliFlowAnalysisWithScalarProduct+;
 #pragma link C++ class AliFlowAnalysisWithLYZEventPlane+;
 #pragma link C++ class AliFlowAnalysisWithLeeYangZeros+;
 #pragma link C++ class AliFlowAnalysisWithCumulants+;
+#pragma link C++ class AliAnalysisTaskScalarProduct+;
 #pragma link C++ class AliAnalysisTaskMCEventPlane+;
 #pragma link C++ class AliAnalysisTaskLYZEventPlane+;
 #pragma link C++ class AliAnalysisTaskLeeYangZeros+;
index 1f616a4ba10f70843b654342f7a8d5e0f5e106cd..779adb1d746ed83523c60cc6b7e1df530577f6a6 100644 (file)
@@ -12,10 +12,12 @@ SRCS= FLOW/AliFlowEventSimple.cxx \
       FLOW/AliFlowVector.cxx \
       FLOW/AliFlowLYZEventPlane.cxx \
       FLOW/AliFlowEventSimpleMaker.cxx \
+      FLOW/AliFlowAnalysisWithScalarProduct.cxx \
       FLOW/AliFlowAnalysisWithMCEventPlane.cxx \
       FLOW/AliFlowAnalysisWithLYZEventPlane.cxx \
       FLOW/AliFlowAnalysisWithLeeYangZeros.cxx \
       FLOW/AliFlowAnalysisWithCumulants.cxx \
+      FLOW/AliAnalysisTaskScalarProduct.cxx \
       FLOW/AliAnalysisTaskMCEventPlane.cxx \
       FLOW/AliAnalysisTaskLYZEventPlane.cxx \
       FLOW/AliAnalysisTaskLeeYangZeros.cxx