]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Buffer Size can be defined
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Mar 2002 09:34:20 +0000 (09:34 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Mar 2002 09:34:20 +0000 (09:34 +0000)
HBTAN/AliHBTAnalysis.cxx
HBTAN/AliHBTAnalysis.h

index 56e4bc76c903321803ebcd2529a3708272abc989..7d95ce8ec8d53c5dedefedfe1f9fe2001c7d5580 100644 (file)
@@ -31,9 +31,10 @@ AliHBTAnalysis::AliHBTAnalysis()
    fNTrackFunctions = 0;
    fNParticleFunctions = 0;
    fNParticleAndTrackFunctions = 0;
-   
+  
    fPairCut = new AliHBTEmptyPairCut();//empty cut - accepts all particles
    
+   fBufferSize = 2; 
  }
 /*************************************************************************************/ 
 
@@ -164,6 +165,8 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
   AliHBTPair * tmptrackpair;//temprary pointers to pairs
   AliHBTPair * tmppartpair;
   
+  
+  
   for (Int_t i = 0;i<Nev;i++)
     {
       partEvent= fReader->GetParticleEvent(i);
@@ -220,7 +223,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
   /***************************************/
   /***** Filling denominators    *********/
   /***************************************/
-  for (Int_t i = 0;i<Nev;i++)   //In each event ....
+  for (Int_t i = 0;i<Nev-1;i++)   //In each event (but last) ....
     {
       
       partEvent= fReader->GetParticleEvent(i);
@@ -232,17 +235,23 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
       
       for (Int_t j = 0; j< partEvent->GetNumberOfParticles(); j++) // ... Loop over all particles ...
        {
-//         if (N>MAXCOMB) break;
            
            part1= partEvent->GetParticle(j);
 
            track1= trackEvent->GetParticle(j);
  
-//         for (Int_t k = i+1; k<Nev;k++)  //  ... Loop over all proceeding events ...
            Int_t NNN;
-  
-           if ( (i+2) < Nev) NNN = i+2;
-           else NNN = Nev;
+           
+           if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative 
+                                                                //or current event+buffersize is greater
+                                                                //than max nuber of events
+            {
+             NNN = Nev; //set the max event number 
+            }
+           else 
+            {
+             NNN = i+fBufferSize; //set the current event number + fBufferSize
+            }
  
            for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
             {
@@ -361,7 +370,7 @@ void AliHBTAnalysis::ProcessTracks()
   /***************************************/
   /***** Filling diff histogram *********/
   /***************************************/
-  for (Int_t i = 0;i<Nev;i++)   //In each event ....
+  for (Int_t i = 0;i<Nev-1;i++)   //In each event (but last) ....
     {
       trackEvent = fReader->GetTrackEvent(i);
       if (!trackEvent) continue;
@@ -373,11 +382,18 @@ void AliHBTAnalysis::ProcessTracks()
            
            track1= trackEvent->GetParticle(j);
  
-//         for (Int_t k = i+1; k<Nev;k++)  //  ... Loop over all proceeding events ...
            Int_t NNN;
-  
-           if ( (i+2) < Nev) NNN = i+2;
-           else NNN = Nev;
+           
+           if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative 
+                                                                //or current event+buffersize is greater
+                                                                //than max nuber of events
+            {
+             NNN = Nev; //set the max event number 
+            }
+           else 
+            {
+             NNN = i+fBufferSize; //set the current event number + fBufferSize
+            }
  
            for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
             {
@@ -436,10 +452,12 @@ void AliHBTAnalysis::ProcessParticles()
   
   Int_t Nev = fReader->GetNumberOfPartEvents();
   
+ // Nev = 1;
   /***************************************/
   /******   Looping same events   ********/
   /******   filling numerators    ********/
   /***************************************/
+  
   for (Int_t i = 0;i<Nev;i++)
     {
       partEvent= fReader->GetParticleEvent(i);
@@ -482,7 +500,7 @@ void AliHBTAnalysis::ProcessParticles()
   /***************************************/
   /***** Filling diff histogram *********/
   /***************************************/
-  for (Int_t i = 0;i<Nev;i++)   //In each event ....
+  for (Int_t i = 0;i<Nev-1;i++)   //In each event (but last)....
     {
       partEvent= fReader->GetParticleEvent(i);
       if (!partEvent) continue;
@@ -495,12 +513,20 @@ void AliHBTAnalysis::ProcessParticles()
            
            part1= partEvent->GetParticle(j);
  
-//         for (Int_t k = i+1; k<Nev;k++)  //  ... Loop over all proceeding events ...
            Int_t NNN;
-  
-           if ( (i+2) < Nev) NNN = i+2; //loop over next event
-           else NNN = Nev;
+           
+           if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative 
+                                                                //or current event+buffersize is greater
+                                                                //than max nuber of events
+            {
+             NNN = Nev; //set the max event number 
+            }
+           else 
+            {
+             NNN = i+fBufferSize; //set the current event number + fBufferSize
+            }
+           
+//           cout<<"NNN = "<<NNN<<endl;
            for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
             {
              
index 2b50eb671f8612713020752856c9011b5a918811..45e7e31d896f8726e23f91c334bcbbce372af61d 100644 (file)
@@ -39,6 +39,9 @@ class AliHBTAnalysis: public TObject
      void SetReader(AliHBTReader* r){fReader = r;}
      
      void WriteFunctions();
+     
+     void SetBufferSize(Int_t buffsize){fBufferSize=buffsize;}
+    
    protected:
      
      Bool_t RunCoherencyCheck();
@@ -65,6 +68,7 @@ class AliHBTAnalysis: public TObject
 
       AliHBTPairCut *fPairCut;//!
       
+      Int_t fBufferSize; //defines the size of buffer for mixed events; -1==MIX All
      /**********************************************/