]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Putting back corrections for coding connsion
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Jun 2003 13:09:54 +0000 (13:09 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Jun 2003 13:09:54 +0000 (13:09 +0000)
HBTAN/AliHBTAnalysis.cxx
HBTAN/AliHBTEvent.cxx

index d6656d0d6fa5ca2145690143c9510adc9289ed79..fee4c4c3dd1b8d2f7743880addac49ece6b3d1cc 100644 (file)
@@ -1,5 +1,3 @@
-#include "TH2D.h"
-#include "TH3D.h"
 #include "AliHBTAnalysis.h"
 #include "AliHBTRun.h"
 #include "AliHBTEvent.h"
@@ -338,6 +336,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
          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);       
@@ -370,7 +369,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
        }
     }
 
-  /***************************************/
+
   /***** Filling denominators    *********/
   /***************************************/
   if (fBufferSize != 0)
@@ -496,7 +495,9 @@ void AliHBTAnalysis::ProcessTracks()
         
          for (Int_t k =j+1; k < trackEvent->GetNumberOfParticles() ; k++)
           {
-           track2= trackEvent->GetParticle(k);       
+           track2= trackEvent->GetParticle(k);
+           if (track1->GetUID() == track2->GetUID()) continue;
+
            trackpair->SetParticles(track1,track2);
            if(fPairCut->Pass(trackpair)) //check pair cut
             { //do not meets crietria of the 
@@ -621,6 +622,7 @@ void AliHBTAnalysis::ProcessParticles()
          for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
           {
             part2= partEvent->GetParticle(k);
+            if (part1->GetUID() == part2->GetUID()) continue; //this is the same particle but different incarnation (PID)
             partpair->SetParticles(part1,part2);
             
             if( fPairCut->Pass(partpair) ) //check pair cut
@@ -977,6 +979,7 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal()
          for (Int_t k = 0; k < partEvent2->GetNumberOfParticles() ; k++)
           {
             part2= partEvent2->GetParticle(k);
+            if (part1->GetUID() == part2->GetUID()) continue;//this is the same particle but with different PID
             partpair->SetParticles(part1,part2);
 
             track2= trackEvent2->GetParticle(k);
@@ -1074,6 +1077,7 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal()
   AliHBTEvent * trackEvent2=0x0;
   AliHBTEvent * trackEvent3=0x0;
 
+
   AliHBTEvent * rawtrackEvent;
   
   Int_t nev = fReader->GetNumberOfTrackEvents();
@@ -1130,6 +1134,7 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal()
          for (Int_t k = 0; k < trackEvent2->GetNumberOfParticles() ; k++)
           {
             track2= trackEvent2->GetParticle(k);
+            if (track1->GetUID() == track2->GetUID()) continue;//this is the same particle but with different PID
             trackpair->SetParticles(track1,track2);
 
 
@@ -1257,6 +1262,7 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal()
          for (Int_t k = 0; k < partEvent2->GetNumberOfParticles() ; k++)
           {
             part2= partEvent2->GetParticle(k);
+            if (part1->GetUID() == part2->GetUID()) continue;//this is the same particle but with different PID
             partpair->SetParticles(part1,part2);
 
             if(fPairCut->PassPairProp(partpair) ) //check pair cut
index d9b9a8ce6ce9a20ccc2444b2c84103a0fa1f547d..bf3bd7e4c8dd539eab57bee0828a2afb04e64c71 100644 (file)
@@ -21,28 +21,30 @@ const UInt_t AliHBTEvent::fgkInitEventSize = 100;
  
 AliHBTEvent::AliHBTEvent()
  {
-    if(fgkInitEventSize<1) 
-     {
-      Fatal("AliHBTEvent::AliHBTEvent()",
-            "fgkInitEventSize has a stiupid value (%d). Change it to positive number and recompile",
-             fgkInitEventSize);
-      
-     }
-    fSize=fgkInitEventSize;
-    fParticles = new AliHBTParticle* [fSize];
-    fNParticles = 0;
-    fOwner = kTRUE;
+//default constructor   
+  if(fgkInitEventSize<1) 
+   {
+    Fatal("AliHBTEvent::AliHBTEvent()",
+          "fgkInitEventSize has a stiupid value (%d). Change it to positive number and recompile",
+           fgkInitEventSize);
+
+   }
+  fSize=fgkInitEventSize;
+  fParticles = new AliHBTParticle* [fSize];
+  fNParticles = 0;
+  fOwner = kTRUE;
  }
 /**************************************************************************/ 
 
 AliHBTEvent::~AliHBTEvent()
  {
-   this->Reset();//delete all particles
-   if(fParticles)
-    { 
-     delete [] fParticles; //and delete array itself
-    }
-   fParticles = 0x0;
+//destructor   
+  this->Reset();//delete all particles
+  if(fParticles)
+   { 
+    delete [] fParticles; //and delete array itself
+   }
+  fParticles = 0x0;
  }
 /**************************************************************************/ 
 void  AliHBTEvent::Reset()
@@ -55,56 +57,55 @@ void  AliHBTEvent::Reset()
     }
    fNParticles = 0;
 } 
+/**************************************************************************/ 
 
 AliHBTParticle* AliHBTEvent::GetParticleSafely(Int_t n)
- {
-   if( (n<0) || (fNParticles<=n) ) return 0x0;
-   else return fParticles[n];
-   
- }
+{
+  //returns nth particle with range check
+  if( (n<0) || (fNParticles<=n) ) return 0x0;
+  else return fParticles[n];
+}
 /**************************************************************************/ 
 
 void  AliHBTEvent:: AddParticle(AliHBTParticle* hbtpart)
- {
-   //Adds new perticle to the event
-   if ( fNParticles+1 >= fSize) Expand(); //if there is no space in array, expand it
-   fParticles[fNParticles++] = hbtpart; //add a pointer
- }
-
+{
+  //Adds new perticle to the event
+  if ( fNParticles+1 >= fSize) Expand(); //if there is no space in array, expand it
+  fParticles[fNParticles++] = hbtpart; //add a pointer
+}
 /**************************************************************************/ 
+
 void  AliHBTEvent::AddParticle(TParticle* part, Int_t idx)
- {
-   AddParticle( new AliHBTParticle(*part,idx) );
- }
+{
+  //Adds TParticle to event
+  AddParticle( new AliHBTParticle(*part,idx) );
+}
 /**************************************************************************/ 
-void  AliHBTEvent::
-AddParticle(Int_t pdg, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
-            Double_t vx, Double_t vy, Double_t vz, Double_t time)
- {
-   AddParticle(new  AliHBTParticle(pdg,idx,px,py,pz,etot,vx,vy,vz,time) );
- }
+void  AliHBTEvent::AddParticle(Int_t pdg, Int_t idx, 
+             Double_t px, Double_t py, Double_t pz, Double_t etot,
+             Double_t vx, Double_t vy, Double_t vz, Double_t time)
+{
+  //adds particle to event
+  AddParticle(new  AliHBTParticle(pdg,idx,px,py,pz,etot,vx,vy,vz,time) );
+}
 /**************************************************************************/ 
 
 void AliHBTEvent::Expand()
- {
- //expands the array with pointers to particles
- //about the size defined in fgkInitEventSize
-  fSize+=fgkInitEventSize;
-  AliHBTParticle** tmpParticles = new AliHBTParticle* [fSize]; //create new array of pointers
-  //check if we got memory / if not Abort
-  if (!tmpParticles) Fatal("AliHBTEvent::Expand()","No more space in memory");
-  
-  
-  for(Int_t i = 0; i<fNParticles ;i++)
-   //copy pointers to the new array
-   {
-     tmpParticles[i] = fParticles[i];
-   }
-  delete [] fParticles; //delete old array
-   fParticles = tmpParticles; //copy new pointer to the array of pointers to particles
-  
- }
+{
+//expands the array with pointers to particles
+//about the size defined in fgkInitEventSize
+
+ fSize+=fgkInitEventSize;
+ AliHBTParticle** tmpParticles = new AliHBTParticle* [fSize]; //create new array of pointers
+ //check if we got memory / if not Abort
+ if (!tmpParticles) Fatal("AliHBTEvent::Expand()","No more space in memory");
+
+
+ for(Int_t i = 0; i<fNParticles ;i++)
+  //copy pointers to the new array
+  {
+    tmpParticles[i] = fParticles[i];
+  }
+ delete [] fParticles; //delete old array
+  fParticles = tmpParticles; //copy new pointer to the array of pointers to particles
+}