Process Track And Particles works with new schema
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Jun 2004 15:55:51 +0000 (15:55 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Jun 2004 15:55:51 +0000 (15:55 +0000)
HBTAN/AliHBTAnalysis.cxx
HBTAN/AliHBTAnalysis.h
HBTAN/hbtanalysis.C

index 08bdefa5e12ca08f5f8d087ada6cd68e22465db4..23edb2813fd3e9baff8efce71591caac0d2ecb13 100644 (file)
@@ -40,6 +40,7 @@ const UInt_t AliHBTAnalysis::fgkDefaultMixingInfo = 1000;
 const Int_t  AliHBTAnalysis::fgkDefaultBufferSize = 5;
 
 AliHBTAnalysis::AliHBTAnalysis():
+  fProcEvent(&AliHBTAnalysis::ProcessRecAndSim),
   fReader(0x0),
   fNTrackFunctions(0),
   fNParticleFunctions(0),
@@ -57,6 +58,9 @@ AliHBTAnalysis::AliHBTAnalysis():
   fBufferSize(2),
   fDisplayMixingInfo(fgkDefaultMixingInfo),
   fIsOwner(kFALSE),
+  fPartBuffer(0x0),
+  fTrackBuffer(0x0),
+  fNoCorrfctns(kFALSE),
   fkPass(&AliHBTAnalysis::PassPartAndTrack), //by default perform cut on both track and particle pair 
   fkPass1(&AliHBTAnalysis::PassPartAndTrack1), //used onluy by ProcessTracksAndParticles
   fkPass2(&AliHBTAnalysis::PassPartAndTrack2),
@@ -69,6 +73,7 @@ AliHBTAnalysis::AliHBTAnalysis():
 
 AliHBTAnalysis::AliHBTAnalysis(const AliHBTAnalysis& in):
   AliAnalysis(in),
+  fProcEvent(&AliHBTAnalysis::ProcessRecAndSim),
   fReader(0x0),
   fNTrackFunctions(0),
   fNParticleFunctions(0),
@@ -86,6 +91,9 @@ AliHBTAnalysis::AliHBTAnalysis(const AliHBTAnalysis& in):
   fBufferSize(fgkDefaultBufferSize),
   fDisplayMixingInfo(fgkDefaultMixingInfo),
   fIsOwner(kFALSE),
+  fPartBuffer(0x0),
+  fTrackBuffer(0x0),
+  fNoCorrfctns(kFALSE),
   fkPass(&AliHBTAnalysis::PassPartAndTrack), //by default perform cut on both track and particle pair 
   fkPass1(&AliHBTAnalysis::PassPartAndTrack1),
   fkPass2(&AliHBTAnalysis::PassPartAndTrack2),
@@ -142,14 +150,14 @@ Int_t AliHBTAnalysis::ProcessEvent(AliAOD* aodrec, AliAOD* aodsim)
      return 2;
    }
   
-  return 0;
+  return  (this->*fProcEvent)(aodrec,aodsim);
 }
 /*************************************************************************************/ 
 
 Int_t AliHBTAnalysis::Finish()
 {
   WriteFunctions();
-  return 1;
+  return 0;
 }
 /*************************************************************************************/ 
 
@@ -230,6 +238,17 @@ Int_t AliHBTAnalysis::Init()
 {
 //Initializeation method
 //calls Init for all functions
+  
+  
+ if (fPartBuffer == 0x0)  fPartBuffer = new AliEventBuffer (fBufferSize);
+ else fPartBuffer->Reset();
+
+ if (fTrackBuffer == 0x0)  fTrackBuffer = new AliEventBuffer (fBufferSize);
+ else fTrackBuffer->Reset();
+
+
+ fNoCorrfctns = (fNParticleFunctions == 0) && (fNTrackFunctions == 0) && (fNParticleAndTrackFunctions == 0);
  UInt_t ii;
  for(ii = 0;ii<fNParticleFunctions;ii++)
    fParticleFunctions[ii]->Init();
@@ -269,7 +288,222 @@ void AliHBTAnalysis::ResetFunctions()
   }
 }
 /*************************************************************************************/ 
+Int_t AliHBTAnalysis::ProcessRecAndSim(AliAOD* aodrec, AliAOD* aodsim)
+{
+//Makes analysis for both tracks and particles
+//mainly for resolution study and analysies with weighting algirithms
+//In order to minimize calling AliRun::GetEvent (we need at one time particles from different events),
+//the loops are splited
+  
+// cut on particles only -- why?
+// - PID: when we make resolution analysis we want to take only tracks with correct PID
+// We need cut on tracks because there are data characteristic to 
+  
+  AliVAODParticle * part1, * part2;
+  AliVAODParticle * track1, * track2;
+  
+  AliAOD * trackEvent = aodrec, *partEvent = aodsim;
+  AliAOD* trackEvent1 = new AliAOD();
+  AliAOD* partEvent1 = new AliAOD();
+  partEvent1->SetOwner(kTRUE);
+  trackEvent1->SetOwner(kTRUE);
+
+  AliAOD * trackEvent2,*partEvent2;
+  
+//  Int_t N1, N2, N=0; //number of particles in current event(we prcess two events in one time)
+  
+//  Int_t nev = fReader->GetNumberOfTrackEvents();
+  AliHBTPair tpair;
+  AliHBTPair ppair;
+
+  AliHBTPair* trackpair = &tpair;
+  AliHBTPair* partpair = &ppair;
+  AliHBTPair * tmptrackpair;//temprary pointers to pairs
+  AliHBTPair * tmppartpair;
+  
+  register UInt_t ii;
+  
+  
+
+  if ( !partEvent || !trackEvent ) 
+   {
+     Error("ProcessRecAndSim","Can not get event");
+     return 1;
+   }
+
+  if ( partEvent->GetNumberOfParticles() != trackEvent->GetNumberOfParticles() )
+   {
+     Error("ProcessRecAndSim",
+           "Number of simulated particles (%d) not equal to number of reconstructed tracks (%d). Skipping Event.",
+            partEvent->GetNumberOfParticles() , trackEvent->GetNumberOfParticles());
+     return 2;
+   }
+
+
+  for (Int_t j = 0; j<partEvent->GetNumberOfParticles() ; j++)
+   {
+     /***************************************/
+     /******   Looping same events   ********/
+     /******   filling numerators    ********/
+     /***************************************/
+     if ( (j%fDisplayMixingInfo) == 0)
+        Info("ProcessTracksAndParticles",
+             "Mixing particle %d with particles from the same event",j);
+
+     part1= partEvent->GetParticle(j);
+     track1= trackEvent->GetParticle(j);
+
+     Bool_t firstcut = (this->*fkPass1)(part1,track1);
+     if (fBufferSize != 0) 
+       if ( (firstcut == kFALSE) || ( (this->*fkPass2)(part1,track1) == kFALSE ) )
+        {
+          //accepted by any cut
+          // we have to copy because reader keeps only one event
+
+          partEvent1->AddParticle(new AliAODParticle(*part1));
+          trackEvent1->AddParticle(new AliAODParticle(*track1));
+        }
+
+     if (firstcut) continue;
+
+     for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
+       fParticleMonitorFunctions[ii]->Process(part1);
+     for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
+       fTrackMonitorFunctions[ii]->Process(track1);
+     for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
+       fParticleAndTrackMonitorFunctions[ii]->Process(track1,part1);
+
+     if (fNoCorrfctns) continue;
+
+     for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
+      {
+        part2= partEvent->GetParticle(k);
+        if (part1->GetUID() == part2->GetUID()) continue;
+        partpair->SetParticles(part1,part2);
+
+        track2= trackEvent->GetParticle(k);
+        trackpair->SetParticles(track1,track2);
+
+        if( (this->*fkPass)(partpair,trackpair) ) //check pair cut 
+          { //do not meets crietria of the pair cut, try with swapped pairs
+            if( (this->*fkPass)((AliHBTPair*)partpair->GetSwappedPair(),(AliHBTPair*)trackpair->GetSwappedPair()) )
+              continue; //swaped pairs do not meet criteria of pair cut as well, take next particle
+            else 
+             { //swaped pair meets all the criteria
+               tmppartpair = (AliHBTPair*)partpair->GetSwappedPair();
+               tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
+             }
+          }
+        else
+         {//meets criteria of the pair cut
+           tmptrackpair = trackpair;
+           tmppartpair = partpair;
+         }
+
+        for(ii = 0;ii<fNParticleFunctions;ii++)
+               fParticleFunctions[ii]->ProcessSameEventParticles(tmppartpair);
+
+        for(ii = 0;ii<fNTrackFunctions;ii++)
+               fTrackFunctions[ii]->ProcessSameEventParticles(tmptrackpair);
+
+        for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
+               fParticleAndTrackFunctions[ii]->ProcessSameEventParticles(tmptrackpair,tmppartpair);
+       //end of 2nd loop over particles from the same event  
+      }//for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
+
+     /***************************************/
+     /***** Filling denominators    *********/
+     /***************************************/
+     if (fBufferSize == 0) continue;
+
+     fPartBuffer->ResetIter();
+     fTrackBuffer->ResetIter();
+     Int_t m = 0;
+     while (( partEvent2 = fPartBuffer->Next() ))
+      {
+        trackEvent2 = fTrackBuffer->Next();
+
+        m++;
+        if ( (j%fDisplayMixingInfo) == 0)
+           Info("ProcessTracksAndParticles",
+                "Mixing particle %d from current event with particles from event %d",j,-m);
+
+        for(Int_t l = 0; l<partEvent2->GetNumberOfParticles();l++)   //  ... on all particles
+          {
+            part2= partEvent2->GetParticle(l);
+            partpair->SetParticles(part1,part2);
+
+            track2= trackEvent2->GetParticle(l);
+            trackpair->SetParticles(track1,track2);
+
+            if( (this->*fkPass)(partpair,trackpair) ) //check pair cut
+              { //do not meets crietria of the 
+                if( (this->*fkPass)((AliHBTPair*)partpair->GetSwappedPair(),(AliHBTPair*)trackpair->GetSwappedPair()) )
+                  continue;
+                else 
+                 {
+                   tmppartpair = (AliHBTPair*)partpair->GetSwappedPair();
+                   tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
+                 }
+              }
+            else
+             {//meets criteria of the pair cut
+              tmptrackpair = trackpair;
+              tmppartpair = partpair;
+             }
+
+            for(ii = 0;ii<fNParticleFunctions;ii++)
+              fParticleFunctions[ii]->ProcessDiffEventParticles(tmppartpair);
+
+            for(ii = 0;ii<fNTrackFunctions;ii++)
+              fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
+
+            for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
+              fParticleAndTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair,tmppartpair);
+          }//for(Int_t l = 0; l<N2;l++)   //  ... on all particles
+
+      }
+    //end of loop over particles from first event
+   }//for (Int_t j = 0; j<partEvent->GetNumberOfParticles() ; j++)
+  delete fPartBuffer->Push(partEvent1);
+  delete fTrackBuffer->Push(trackEvent1);
+ //end of loop over events  
+  return 0;
+}
+/*************************************************************************************/ 
 
+Int_t AliHBTAnalysis::ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim)
+{
+ if (aodsim == 0x0) return 0;
+ return 1;
+}
+/*************************************************************************************/ 
+Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
+{
+ if (aodrec== 0x0) return 0;
+ return 1;
+}
+/*************************************************************************************/ 
+     
+Int_t AliHBTAnalysis::ProcessRecAndSimNonId(AliAOD* aodrec, AliAOD* aodsim)
+{
+ if (aodsim && aodrec== 0x0) return 0;
+ return 1;
+}
+/*************************************************************************************/ 
+Int_t AliHBTAnalysis::ProcessSimNonId(AliAOD* aodrec, AliAOD* /*aodsim*/)
+{
+ if (aodrec== 0x0) return 0;
+ return 1;
+}
+/*************************************************************************************/ 
+Int_t AliHBTAnalysis::ProcessRecNonId(AliAOD* /*aodrec*/, AliAOD* aodsim)
+{
+ if (aodsim== 0x0) return 0;
+ return 1;
+}
+/*************************************************************************************/ 
 void AliHBTAnalysis::Process(Option_t* option)
 {
  //default option  = "TracksAndParticles"
@@ -344,209 +578,19 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
 // - PID: when we make resolution analysis we want to take only tracks with correct PID
 // We need cut on tracks because there are data characteristic to 
   
-  AliVAODParticle * part1, * part2;
-  AliVAODParticle * track1, * track2;
-  
   AliAOD * trackEvent, *partEvent;
-  AliAOD * trackEvent1 = 0x0,*partEvent1 = 0x0;
-  AliAOD * trackEvent2,*partEvent2;
-  
-//  Int_t N1, N2, N=0; //number of particles in current event(we prcess two events in one time)
-  
-//  Int_t nev = fReader->GetNumberOfTrackEvents();
-  AliHBTPair * trackpair = new AliHBTPair();
-  AliHBTPair * partpair = new AliHBTPair();
-
-  AliHBTPair * tmptrackpair;//temprary pointers to pairs
-  AliHBTPair * tmppartpair;
 
-  AliEventBuffer partbuffer(fBufferSize);
-  AliEventBuffer trackbuffer(fBufferSize);
-  
-  register UInt_t ii;
-  
-  Bool_t nocorrfctns = (fNParticleFunctions == 0) && (fNTrackFunctions == 0) && (fNParticleAndTrackFunctions == 0);
-  
   fReader->Rewind();
   Int_t i = -1;
   while (fReader->Next() == kFALSE)
     {
       i++;
-      partEvent= fReader->GetEventSim();
+      partEvent = fReader->GetEventSim();
       trackEvent = fReader->GetEventRec();
-      
-      if ( !partEvent || !trackEvent ) 
-       {
-         Error("ProcessTracksAndParticles","Can not get event");
-         return;
-       }
-       
-      if ( partEvent->GetNumberOfParticles() != trackEvent->GetNumberOfParticles() )
-       {
-         Fatal("ProcessTracksAndParticles",
-               "Event %d: Number of simulated particles (%d) not equal to number of reconstructed tracks (%d)",
-               i,partEvent->GetNumberOfParticles() , trackEvent->GetNumberOfParticles());
-         return;
-       }
-      
-      if(partEvent1 == 0x0) 
-       {
-         partEvent1 = new AliAOD();
-         partEvent1->SetOwner(kTRUE);
-
-         trackEvent1 = new AliAOD();
-         trackEvent1->SetOwner(kTRUE);
-       }
-      else
-       {
-         partEvent1->Reset();
-         trackEvent1->Reset();
-       }
-       
-      for (Int_t j = 0; j<partEvent->GetNumberOfParticles() ; j++)
-       {
-         /***************************************/
-         /******   Looping same events   ********/
-         /******   filling numerators    ********/
-         /***************************************/
-         if ( (j%fDisplayMixingInfo) == 0)
-            Info("ProcessTracksAndParticles",
-                 "Mixing particle %d from event %d with particles from event %d",j,i,i);
+      ProcessRecAndSim(trackEvent,partEvent);
 
-         part1= partEvent->GetParticle(j);
-         track1= trackEvent->GetParticle(j);
-  
-//PID imperfections ???
-//         if( part1->GetPdgCode() != track1->GetPdgCode() )
-//          {
-//            Fatal("ProcessTracksAndParticles",
-//                  "Event %d: Particle %d: PID of simulated particle (%d) not the same of reconstructed track (%d)",
-//                  i,j, part1->GetPdgCode(),track1->GetPdgCode() );
-//            return;
-//          }
-         
-         Bool_t firstcut = (this->*fkPass1)(part1,track1);
-         if (fBufferSize != 0) 
-           if ( (firstcut == kFALSE) || ( (this->*fkPass2)(part1,track1) == kFALSE ) )
-            {
-              //accepted by any cut
-              // we have to copy because reader keeps only one event
-
-              partEvent1->AddParticle(new AliAODParticle(*part1));
-              trackEvent1->AddParticle(new AliAODParticle(*track1));
-            }
-
-         if (firstcut) continue;
-         
-         for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
-           fParticleMonitorFunctions[ii]->Process(part1);
-         for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
-           fTrackMonitorFunctions[ii]->Process(track1);
-         for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
-           fParticleAndTrackMonitorFunctions[ii]->Process(track1,part1);
-
-         if (nocorrfctns) continue;
-        
-         for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
-          {
-            part2= partEvent->GetParticle(k);
-            if (part1->GetUID() == part2->GetUID()) continue;
-            partpair->SetParticles(part1,part2);
-           
-            track2= trackEvent->GetParticle(k);
-            trackpair->SetParticles(track1,track2);
-
-            if( (this->*fkPass)(partpair,trackpair) ) //check pair cut 
-              { //do not meets crietria of the pair cut, try with swapped pairs
-                if( (this->*fkPass)((AliHBTPair*)partpair->GetSwappedPair(),(AliHBTPair*)trackpair->GetSwappedPair()) )
-                  continue; //swaped pairs do not meet criteria of pair cut as well, take next particle
-                else 
-                 { //swaped pair meets all the criteria
-                   tmppartpair = (AliHBTPair*)partpair->GetSwappedPair();
-                   tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
-                 }
-              }
-            else
-             {//meets criteria of the pair cut
-               tmptrackpair = trackpair;
-               tmppartpair = partpair;
-             }
-             
-            for(ii = 0;ii<fNParticleFunctions;ii++)
-                   fParticleFunctions[ii]->ProcessSameEventParticles(tmppartpair);
-                
-            for(ii = 0;ii<fNTrackFunctions;ii++)
-                   fTrackFunctions[ii]->ProcessSameEventParticles(tmptrackpair);
-                 
-            for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
-                   fParticleAndTrackFunctions[ii]->ProcessSameEventParticles(tmptrackpair,tmppartpair);
-           //end of 2nd loop over particles from the same event  
-          }//for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
-          
-         /***************************************/
-         /***** Filling denominators    *********/
-         /***************************************/
-         if (fBufferSize == 0) continue;
-         
-         partbuffer.ResetIter();
-         trackbuffer.ResetIter();
-         Int_t m = 0;
-         while (( partEvent2 = partbuffer.Next() ))
-          {
-            trackEvent2 = trackbuffer.Next();
-            
-            m++;
-            if ( (j%fDisplayMixingInfo) == 0)
-               Info("ProcessTracksAndParticles",
-                    "Mixing particle %d from event %d with particles from event %d",j,i,i-m);
-         
-            for(Int_t l = 0; l<partEvent2->GetNumberOfParticles();l++)   //  ... on all particles
-              {
-                part2= partEvent2->GetParticle(l);
-                partpair->SetParticles(part1,part2);
-
-                track2= trackEvent2->GetParticle(l);
-                trackpair->SetParticles(track1,track2);
-
-                if( (this->*fkPass)(partpair,trackpair) ) //check pair cut
-                  { //do not meets crietria of the 
-                    if( (this->*fkPass)((AliHBTPair*)partpair->GetSwappedPair(),(AliHBTPair*)trackpair->GetSwappedPair()) )
-                      continue;
-                    else 
-                     {
-                       tmppartpair = (AliHBTPair*)partpair->GetSwappedPair();
-                       tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
-                     }
-                  }
-                else
-                 {//meets criteria of the pair cut
-                  tmptrackpair = trackpair;
-                  tmppartpair = partpair;
-                 }
-
-                for(ii = 0;ii<fNParticleFunctions;ii++)
-                  fParticleFunctions[ii]->ProcessDiffEventParticles(tmppartpair);
-                 
-                for(ii = 0;ii<fNTrackFunctions;ii++)
-                  fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
-                 
-                for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
-                  fParticleAndTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair,tmppartpair);
-              }//for(Int_t l = 0; l<N2;l++)   //  ... on all particles
-
-          }
-        //end of loop over particles from first event
-       }//for (Int_t j = 0; j<partEvent->GetNumberOfParticles() ; j++)
-      partEvent1  = partbuffer.Push(partEvent1);
-      trackEvent1 = trackbuffer.Push(trackEvent1);
-     //end of loop over events  
     }//while (fReader->Next() == kFALSE)
     
-   delete trackpair;
-   delete partpair;
-
-   partbuffer.SetOwner(kTRUE);
-   trackbuffer.SetOwner(kTRUE);
 } 
 /*************************************************************************************/
 
@@ -1608,6 +1652,7 @@ void AliHBTAnalysis::SetCutsOnTracks()
  // -- aplies only to Process("TracksAndParticles")
  // (ProcessTracksAndParticles and ProcessTracksAndParticlesNonIdentAnal)
  // Only tracks properties are checkes against cuts
+  Info("SetCutsOnTracks","Only reconstructed particles will be checked");
   fkPass = &AliHBTAnalysis::PassTrack;
   fkPass1 = &AliHBTAnalysis::PassTrack1;
   fkPass2 = &AliHBTAnalysis::PassTrack2;
index c4ca2bb4c1f19315b5e8e67129559f5576ff828e..e3c6d2a1fb2156b3a750753eb5b4fef37413eacd 100644 (file)
@@ -30,6 +30,8 @@ class AliHBTCut;
 class AliHBTRun;
 class AliAOD;
 class AliReader;
+class AliEventBuffer;
+
 class AliHBTOnePairFctn;      
 class AliHBTTwoPairFctn;
 
@@ -89,6 +91,24 @@ class AliHBTAnalysis: public AliAnalysis
      void FilterOut(AliAOD* out1, AliAOD* out2, AliAOD* in)const;
      void DeleteFunctions();
      
+
+     /**********************************************/
+     /*      E V E N T     P R O C E S S I N G     */
+     /**********************************************/
+     // NEW AOD schema
+     Int_t (AliHBTAnalysis::*fProcEvent)(AliAOD* aodrec, AliAOD* aodsim);//Pointer to the processing method
+
+     virtual Int_t ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim);
+     virtual Int_t ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/);
+     virtual Int_t ProcessRecAndSim(AliAOD* aodrec, AliAOD* aodsim);
+     
+     virtual Int_t ProcessRecAndSimNonId(AliAOD* aodrec, AliAOD* aodsim);
+     virtual Int_t ProcessSimNonId(AliAOD* aodrec, AliAOD* /*aodsim*/);
+     virtual Int_t ProcessRecNonId(AliAOD* /*aodrec*/, AliAOD* aodsim);
+     
+
+     // OLD legacy schema
+
      virtual void ProcessTracks();
      virtual void ProcessParticles();
      virtual void ProcessTracksAndParticles();
@@ -97,6 +117,7 @@ class AliHBTAnalysis: public AliAnalysis
      virtual void ProcessParticlesNonIdentAnal();
      virtual void ProcessTracksNonIdentAnal();
 
+
      AliReader* fReader;//! Pointer to reader
      
      UInt_t fNTrackFunctions; //! Number of Tracks functions 
@@ -126,8 +147,18 @@ class AliHBTAnalysis: public AliAnalysis
      Int_t  fBufferSize; //!defines the size of buffer for mixed events; -1==MIX All
      Int_t  fDisplayMixingInfo;//!defines every which particle mixing info is displayed
      Bool_t fIsOwner;//!defines of all functions are supposed to be deleted while by the way of analysis defaulr false
-
+    
+     AliEventBuffer* fPartBuffer;//Sim Particles event buffer
+     AliEventBuffer* fTrackBuffer;//Rec Tracks event buffer
+     
+     Bool_t          fNoCorrfctns;//Internal flag indicating that no cfs are set by the user (only monitor ones)
+     
    private:
+   
+     /**********************************************/
+     /*                C U T S                     */
+     /**********************************************/
+   
      Bool_t (AliHBTAnalysis::*fkPass)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
      Bool_t (AliHBTAnalysis::*fkPass1)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on first particle
      Bool_t (AliHBTAnalysis::*fkPass2)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on second particle
index 7c5933bb5cfc1e52b2bcef06a05cf93ff3847650..d4491dee2019b27911ce14a90aeec76badfc8558 100644 (file)
@@ -1,36 +1,40 @@
+#ifndef __MAKECINT__
+ #ifndef __CINT__
+
   #include "AliHBTAnalysis.h"
 //  #include "alles.h"
-  #include "AliHBTReader.h"
-  #include "AliHBTReaderKineTree.h"
-  #include "AliHBTReaderITSv2.h"
-  #include "AliHBTReaderITSv1.h"
-  #include "AliHBTReaderTPC.h"
-  #include "AliHBTReaderInternal.h"
-  #include "AliHBTParticleCut.h"
-  #include "AliHBTEvent.h"
-  #include "AliHBTPairCut.h"
+  #include "AliLoader.h"
+  #include "AliReader.h"
+  #include "AliReaderESD.h"
+  #include "AliReaderKineTree.h"
+  #include "AliAOD.h"
+  #include "AliAODPairCut.h"
   #include "AliHBTQResolutionFctns.h"
   #include "AliHBTQDistributionFctns.h"
   #include "AliHBTTwoTrackEffFctn.h"
   #include "AliHBTCorrelFctn.h"
+  #include "AliHBTLLWeights.h"
+  #include "AliHBTWeightTheorFctn.h"
   #include "TSystem.h"
   #include "TObjString.h"
   #include "TString.h"
   #include "TPDGCode.h"
+  #include "TFile.h"
   #include "AliHBTMonDistributionFctns.h"
   #include "AliHBTMonResolutionFctns.h"
+ #endif
+#endif
   
 void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles", 
                 Int_t first = -1,Int_t last = -1, 
                 char *outfile = "hbtanalysis.root")
  {
    
-  AliHBTTrackPoints::SetDebug(0);
-  AliHBTParticle::SetDebug(0);
+  AliVAODParticle::SetDebug(0);
   AliLoader::SetDebug(0);
   
-  AliHBTParticleCut c1;
-  AliHBTParticleCut c2 = c1;
+  AliAODParticleCut c1;
+  AliAODParticleCut c2 = c1;
 
 //HBT Anlysis Macro
 //Anlyzes TPC recontructed tracks and simulated particles that corresponds to them
@@ -76,45 +80,25 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   AliHBTAnalysis * analysis = new AliHBTAnalysis();
   analysis->SetCutsOnTracks();
   
-  AliHBTReader* reader;
+  AliReader* reader;
   Int_t kine = strcmp(datatype,"Kine");
   Int_t ESD = strcmp(datatype,"ESD");
-  Int_t TPC = strcmp(datatype,"TPC");
-  Int_t ITSv1 = strcmp(datatype,"ITSv1");
-  Int_t ITSv2 = strcmp(datatype,"ITSv2");
   Int_t intern = strcmp(datatype,"Intern");
   
   if(!kine)
    {
-    reader = new AliHBTReaderKineTree();
+    reader = new AliReaderKineTree();
     processopt="Particles"; //this reader by definition reads only simulated particles
    }
   else if(!ESD)
    {
-    AliHBTReaderESD* esdreader = new AliHBTReaderESD();
-    esdreader->ReadParticles(kTRUE);
+    AliReaderESD* esdreader = new AliReaderESD();
+    esdreader->MustTPC(kTRUE);
+    esdreader->ReadSimulatedData(kTRUE);
     esdreader->SetNumberOfTrackPoints(5,30.);
     esdreader->SetClusterMap();
     reader = esdreader;
    }
-  else if(!TPC)
-   {
-    reader = new AliHBTReaderTPC();
-    //((AliHBTReaderTPC*)reader)->SetNumberOfTrackPoints(5,30.);
-    ((AliHBTReaderTPC*)reader)->SetClusterMap();
-   }
-  else if(!ITSv1)
-   {
-    reader = new AliHBTReaderITSv1();
-   }
-  else if(!ITSv2)
-   {
-    reader = new AliHBTReaderITSv2();
-   }
-  else if(!intern)
-   {
-    reader = new AliHBTReaderInternal("data.root");
-   }
   else
    {
     cerr<<"Option "<<datatype<<"  not recognized. Exiting"<<endl;
@@ -140,7 +124,7 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   /***********************************************************/    
   
   //we want have only low pt pi+ so set a cut to reader
-  AliHBTParticleCut* readerpartcut= new AliHBTParticleCut();
+  AliAODParticleCut* readerpartcut= new AliAODParticleCut();
   readerpartcut->SetPtRange(0.0,10.0);
   readerpartcut->SetPID(kPiPlus);
   reader->AddParticleCut(readerpartcut);//read this particle type with this cut
@@ -151,7 +135,7 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   
   analysis->SetReader(reader);
 
-  AliHBTPairCut *paircut = new AliHBTPairCut();
+  AliAODPairCut *paircut = new AliAODPairCut();
   Float_t qinvmin = 0.0;
   Float_t qinvmax = 0.05;//50MeV
   paircut->SetQInvRange(qinvmin,qinvmax);  
@@ -159,7 +143,7 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
  // paircut->SetAvSeparationRange(10.); //AntiMerging
   paircut->SetClusterOverlapRange(-.5,1.0);//AntiSplitting
   
-//  AliHBTParticleCut* partcut= new AliHBTParticleCut();
+//  AliVAODParticleCut* partcut= new AliVAODParticleCut();
 //  partcut->SetPID(kPiPlus);
 //  paircut->SetFirstPartCut(partcut);
 //  partcut->SetPID(kPiMinus);
@@ -211,7 +195,7 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   AliHBTQOutLCMSCorrelFctn* qoutT = new AliHBTQOutLCMSCorrelFctn(); 
   qoutT->Rename("qoutT","Track (recontructed) Q_{out} CF \\pi^{+} \\pi^{+}");
 
-  AliHBTPairCut *outPairCut = new AliHBTPairCut();
+  AliAODPairCut *outPairCut = new AliAODPairCut();
   outPairCut->SetQOutCMSLRange(0.0,0.15);
   outPairCut->SetQSideCMSLRange(0.0,0.02);
   outPairCut->SetQLongCMSLRange(0.0,0.02);
@@ -230,7 +214,7 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   AliHBTQSideLCMSCorrelFctn* qsideT = new AliHBTQSideLCMSCorrelFctn(100,qinvmax); 
   qsideT->Rename("qsideT","Track (recontructed) Q_{side} CF \\pi^{+} \\pi^{+}");
 
-  AliHBTPairCut *sidePairCut = new AliHBTPairCut();
+  AliAODPairCut *sidePairCut = new AliAODPairCut();
   sidePairCut->SetQOutCMSLRange(0.0,0.02);
   sidePairCut->SetQSideCMSLRange(0.0,0.15);
   sidePairCut->SetQLongCMSLRange(0.0,0.02);
@@ -249,7 +233,7 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   AliHBTQLongLCMSCorrelFctn* qlongT = new AliHBTQLongLCMSCorrelFctn(100,qinvmax); 
   qlongT->Rename("qlongT","Track (recontructed) Q_{long} CF \\pi^{+} \\pi^{+}");
 
-  AliHBTPairCut *longPairCut = new AliHBTPairCut();
+  AliAODPairCut *longPairCut = new AliAODPairCut();
   longPairCut->SetQOutCMSLRange(0.0,0.02);
   longPairCut->SetQSideCMSLRange(0.0,0.02);
   longPairCut->SetQLongCMSLRange(0.0,0.15);
@@ -310,7 +294,7 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   if (threeDcuts) pairThetaVsKt.SetPairCut(longPairCut);
   //analysis->AddResolutionFunction(&pairThetaVsKt);
 
-  AliHBTPairCut phipc;
+  AliAODPairCut phipc;
   phipc.SetQLongCMSLRange(0.0,0.02);
 
   AliHBTPairPhiResolVsQInvFctn pairPhiVsqinv(200,qinvmax,qinvmin,300,0.015,-0.015);
@@ -414,6 +398,8 @@ void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
   /****   P R O C E S S                 ***********************/
   /************************************************************/
   analysis->SetBufferSize(2);
+  analysis->SetCutsOnTracks();
+  analysis->Init();
   analysis->Process(processopt);
   
   TFile histoOutput(outfile,"recreate");