const Int_t AliHBTAnalysis::fgkDefaultBufferSize = 5;
AliHBTAnalysis::AliHBTAnalysis():
- fReader(0x0),
- fNTrackFunctions(0),
- fNParticleFunctions(0),
- fNParticleAndTrackFunctions(0),
- fNTrackMonitorFunctions(0),
- fNParticleMonitorFunctions(0),
- fNParticleAndTrackMonitorFunctions(0),
- fBufferSize(2),
- fDisplayMixingInfo(fgkDefaultMixingInfo),
- fIsOwner(kFALSE)
+ fReader(0x0),
+ fNTrackFunctions(0),
+ fNParticleFunctions(0),
+ fNParticleAndTrackFunctions(0),
+ fNTrackMonitorFunctions(0),
+ fNParticleMonitorFunctions(0),
+ fNParticleAndTrackMonitorFunctions(0),
+ fBufferSize(2),
+ fDisplayMixingInfo(fgkDefaultMixingInfo),
+ fIsOwner(kFALSE)
{
+//default constructor
fTrackFunctions = new AliHBTOnePairFctn* [fgkFctnArraySize];
fParticleFunctions = new AliHBTOnePairFctn* [fgkFctnArraySize];
fParticleAndTrackFunctions = new AliHBTTwoPairFctn* [fgkFctnArraySize];
/*************************************************************************************/
AliHBTAnalysis::AliHBTAnalysis(const AliHBTAnalysis& in):
- fReader(0x0),
- fNTrackFunctions(0),
- fNParticleFunctions(0),
- fNParticleAndTrackFunctions(0),
- fNTrackMonitorFunctions(0),
- fNParticleMonitorFunctions(0),
- fNParticleAndTrackMonitorFunctions(0),
- fTrackFunctions(0x0),
- fParticleFunctions(0x0),
- fParticleAndTrackFunctions(0x0),
- fParticleMonitorFunctions(0x0),
- fTrackMonitorFunctions(0x0),
- fParticleAndTrackMonitorFunctions(0x0),
- fPairCut(0x0),
- fBufferSize(fgkDefaultBufferSize),
- fDisplayMixingInfo(fgkDefaultMixingInfo),
- fIsOwner(kFALSE)
+ fReader(0x0),
+ fNTrackFunctions(0),
+ fNParticleFunctions(0),
+ fNParticleAndTrackFunctions(0),
+ fNTrackMonitorFunctions(0),
+ fNParticleMonitorFunctions(0),
+ fNParticleAndTrackMonitorFunctions(0),
+ fTrackFunctions(0x0),
+ fParticleFunctions(0x0),
+ fParticleAndTrackFunctions(0x0),
+ fParticleMonitorFunctions(0x0),
+ fTrackMonitorFunctions(0x0),
+ fParticleAndTrackMonitorFunctions(0x0),
+ fPairCut(0x0),
+ fBufferSize(fgkDefaultBufferSize),
+ fDisplayMixingInfo(fgkDefaultMixingInfo),
+ fIsOwner(kFALSE)
{
+//copy constructor
Fatal("AliHBTAnalysis(const AliHBTAnalysis&)","Sensless");
}
/*************************************************************************************/
const AliHBTAnalysis& AliHBTAnalysis::operator=(const AliHBTAnalysis& right)
{
+//operator =
Fatal("AliHBTAnalysis(const AliHBTAnalysis&)","Sensless");
return *this;
}
void AliHBTAnalysis::Init()
{
+//Initializeation method
+//calls Init for all functions
UInt_t ii;
for(ii = 0;ii<fNParticleFunctions;ii++)
fParticleFunctions[ii]->Init();
void AliHBTAnalysis::ProcessTracksAndParticles()
{
-
//In order to minimize calling AliRun::GetEvent (we need at one time particles from different events),
//the loops are splited
// Int_t N1, N2, N=0; //number of particles in current event(we prcess two events in one time)
- Int_t Nev = fReader->GetNumberOfTrackEvents();
+ Int_t nev = fReader->GetNumberOfTrackEvents();
/***************************************/
/****** Looping same events ********/
register UInt_t ii;
- for (Int_t i = 0;i<Nev;i++)
+ for (Int_t i = 0;i<nev;i++)
{
partEvent= fReader->GetParticleEvent(i);
trackEvent = fReader->GetTrackEvent(i);
/***** Filling denominators *********/
/***************************************/
if (fBufferSize != 0)
- for (Int_t i = 0;i<Nev-1;i++) //In each event (but last) ....
+ for (Int_t i = 0;i<nev-1;i++) //In each event (but last) ....
{
if ((fNParticleFunctions == 0) && (fNTrackFunctions ==0) && (fNParticleAndTrackFunctions == 0))
if (fPairCut->GetFirstPartCut()->Pass(part1)) continue;
- Int_t NNN;
+ Int_t maxeventnumber;
- if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative
+ 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
+ maxeventnumber = nev; //set the max event number
}
else
{
- NNN = i+fBufferSize; //set the current event number + fBufferSize
+ maxeventnumber = i+fBufferSize; //set the current event number + fBufferSize
}
- for (Int_t k = i+1; k<NNN;k++) // ... Loop over next event
+ for (Int_t k = i+1; k<maxeventnumber;k++) // ... Loop over next event
{
partEvent2= fReader->GetParticleEvent(k);
for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
fParticleAndTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair,tmppartpair);
}//for(Int_t l = 0; l<N2;l++) // ... on all particles
- }//for (Int_t k = i+1; k<NNN;k++) // ... Loop over next event
+ }//for (Int_t k = i+1; k<maxeventnumber;k++) // ... Loop over next event
}
}
/***************************************/
void AliHBTAnalysis::ProcessTracks()
{
- //In order to minimize calling AliRun::GetEvent (we need at one time particles from different events),
+//In order to minimize calling AliRun::GetEvent (we need at one time particles from different events),
//the loops are splited
AliHBTParticle * track1, * track2;
AliHBTEvent * trackEvent;
AliHBTEvent * trackEvent2;
UInt_t ii;
- Int_t Nev = fReader->GetNumberOfTrackEvents();
+ Int_t nev = fReader->GetNumberOfTrackEvents();
AliHBTPair * trackpair = new AliHBTPair();
AliHBTPair * tmptrackpair; //temporary pointer
/****** Looping same events ********/
/****** filling numerators ********/
/***************************************/
- for (Int_t i = 0;i<Nev;i++)
+ for (Int_t i = 0;i<nev;i++)
{
trackEvent = fReader->GetTrackEvent(i);
if (!trackEvent) continue;
/***** Filling diff histogram *********/
/***************************************/
if (fBufferSize != 0)
- for (Int_t i = 0;i<Nev-1;i++) //In each event (but last) ....
+ for (Int_t i = 0;i<nev-1;i++) //In each event (but last) ....
{
if ( fNTrackFunctions ==0 )
continue;
track1= trackEvent->GetParticle(j);
if (fPairCut->GetFirstPartCut()->Pass(track1)) continue;
- Int_t NNN;
+ Int_t maxeventnumber;
- if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative
+ 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
+ maxeventnumber = nev; //set the max event number
}
else
{
- NNN = i+fBufferSize; //set the current event number + fBufferSize
+ maxeventnumber = i+fBufferSize; //set the current event number + fBufferSize
}
- for (Int_t k = i+1; k<NNN;k++) // ... Loop over next event
+ for (Int_t k = i+1; k<maxeventnumber;k++) // ... Loop over next event
{
trackEvent2 = fReader->GetTrackEvent(k);
if (!trackEvent2) continue;
fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
}//for(Int_t l = 0; l<N2;l++) // ... on all particles
- }//for (Int_t k = i+1; k<NNN;k++) // ... Loop over next event
+ }//for (Int_t k = i+1; k<maxeventnumber;k++) // ... Loop over next event
}
}
/***************************************/
AliHBTPair * partpair = new AliHBTPair();
AliHBTPair * tmppartpair; //temporary pointer to the pair
- Int_t Nev = fReader->GetNumberOfPartEvents();
+ Int_t nev = fReader->GetNumberOfPartEvents();
/***************************************/
/****** Looping same events ********/
/****** filling numerators ********/
/***************************************/
- for (Int_t i = 0;i<Nev;i++)
+ for (Int_t i = 0;i<nev;i++)
{
partEvent= fReader->GetParticleEvent(i);
if (!partEvent) continue;
/***** Filling diff histogram *********/
/***************************************/
if (fBufferSize != 0) //less then 0 mix everything, == 0 do not mix denominator
- for (Int_t i = 0;i<Nev-1;i++) //In each event (but last)....
+ for (Int_t i = 0;i<nev-1;i++) //In each event (but last)....
{
if ( fNParticleFunctions ==0 )
continue;
{
part1= partEvent->GetParticle(j);
if (fPairCut->GetFirstPartCut()->Pass(part1)) continue;
- Int_t NNN;
+ Int_t maxeventnumber;
- if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative
+ 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
+ maxeventnumber = nev; //set the max event number
}
else
{
- NNN = i+fBufferSize; //set the current event number + fBufferSize
+ maxeventnumber = i+fBufferSize; //set the current event number + fBufferSize
}
- for (Int_t k = i+1; k<NNN;k++) // ... Loop over next event
+ for (Int_t k = i+1; k<maxeventnumber;k++) // ... Loop over next event
{
partEvent2= fReader->GetParticleEvent(k);
fParticleFunctions[ii]->ProcessDiffEventParticles(tmppartpair);
}//for(Int_t l = 0; l<N2;l++) // ... on all particles
- }//for (Int_t k = i+1; k<NNN;k++) // ... Loop over next event
+ }//for (Int_t k = i+1; k<maxeventnumber;k++) // ... Loop over next event
}
}
/***************************************/
AliHBTEvent * rawtrackEvent, *rawpartEvent;
- Int_t Nev = fReader->GetNumberOfTrackEvents();
+ Int_t nev = fReader->GetNumberOfTrackEvents();
AliHBTPair * trackpair = new AliHBTPair();
AliHBTPair * partpair = new AliHBTPair();
Info("ProcessTracksAndParticlesNonIdentAnal","***** NON IDENT MODE ****************");
Info("ProcessTracksAndParticlesNonIdentAnal","**************************************");
- for (Int_t i = 0;i<Nev;i++)
+ for (Int_t i = 0;i<nev;i++)
{
rawpartEvent = fReader->GetParticleEvent(i);
rawtrackEvent = fReader->GetTrackEvent(i);
void AliHBTAnalysis::ProcessTracksNonIdentAnal()
{
+//Process Tracks only with non identical mode
AliHBTParticle * track1, * track2;
AliHBTEvent * trackEvent1=0x0;
AliHBTEvent * rawtrackEvent;
- Int_t Nev = fReader->GetNumberOfTrackEvents();
+ Int_t nev = fReader->GetNumberOfTrackEvents();
AliHBTPair * trackpair = new AliHBTPair();
Info("ProcessTracksNonIdentAnal","***** NON IDENT MODE ****************");
Info("ProcessTracksNonIdentAnal","**************************************");
- for (Int_t i = 0;i<Nev;i++)
+ for (Int_t i = 0;i<nev;i++)
{
rawtrackEvent = fReader->GetTrackEvent(i);
if (rawtrackEvent == 0x0) continue;//in case of any error
void AliHBTAnalysis::ProcessParticlesNonIdentAnal()
{
+//process paricles only with non identical mode
AliHBTParticle * part1 = 0x0, * part2 = 0x0;
AliHBTEvent * partEvent1 = 0x0;
AliHBTEvent * rawpartEvent = 0x0;
- Int_t Nev = fReader->GetNumberOfPartEvents();
+ Int_t nev = fReader->GetNumberOfPartEvents();
AliHBTPair * partpair = new AliHBTPair();
Info("ProcessParticlesNonIdentAnal","***** NON IDENT MODE ****************");
Info("ProcessParticlesNonIdentAnal","**************************************");
- for (Int_t i = 0;i<Nev;i++)
+ for (Int_t i = 0;i<nev;i++)
{
rawpartEvent = fReader->GetParticleEvent(i);
if ( rawpartEvent == 0x0 ) continue;//in case of any error
#include "AliHBTEvent.h"
#include "AliHBTParticle.h"
+//_________________________________________________________________________
+///////////////////////////////////////////////////////////////////////////
+// //
+// class AliHBTEvent //
+// //
+// This class stores HBT perticles for one event //
+// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html //
+// //
+///////////////////////////////////////////////////////////////////////////
ClassImp(AliHBTEvent)
const UInt_t AliHBTEvent::fgkInitEventSize = 10000;
-
/**************************************************************************/
-AliHBTEvent::AliHBTEvent()
+AliHBTEvent::AliHBTEvent():
+ fSize(fgkInitEventSize),
+ fParticles(new AliHBTParticle* [fSize]),
+ fNParticles(0),
+ fOwner(kTRUE)
{
- 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
}
/**************************************************************************/
AliHBTEvent::~AliHBTEvent()
{
+ //destructor
this->Reset();//delete all particles
if(fParticles)
{
/**************************************************************************/
void AliHBTEvent::Reset()
{
- //deletes all particles from the event
+ //deletes all particles from the event
if(fParticles && fOwner)
{
for(Int_t i =0; i<fNParticles; i++)
}
fNParticles = 0;
}
+/**************************************************************************/
AliHBTParticle* AliHBTEvent::GetParticleSafely(Int_t 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
+ //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)
{
+ //Adds TParticle to event
AddParticle( new AliHBTParticle(*part) );
}
/**************************************************************************/
AddParticle(Int_t pdg, 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,px,py,pz,etot,vx,vy,vz,time) );
}
/**************************************************************************/
}
-
*/
///////////////////////////////////////////////////////////////////////
+#include <TH2.h>
+#include <TH3.h>
+
/******************************************************************/
/******************************************************************/
Double_t ratio;
Double_t sum = 0;
- Int_t N = 0;
+ Int_t n = 0;
Int_t offset = nbins - fNBinsToScale - 1;
{
ratio = den->GetBinContent(i)/num->GetBinContent(i);
sum += ratio;
- N++;
+ n++;
}
}
- if(gDebug > 0) Info("Scale","sum=%f fNBinsToScale=%d N=%d",sum,fNBinsToScale,N);
+ if(gDebug > 0) Info("Scale","sum=%f fNBinsToScale=%d n=%d",sum,fNBinsToScale,n);
- if (N == 0) return 0.0;
- Double_t ret = sum/((Double_t)N);
+ if (n == 0) return 0.0;
+ Double_t ret = sum/((Double_t)n);
if(gDebug > 0) Info("Scale","returning %f",ret);
return ret;
Double_t ratio;
Double_t sum = 0;
- Int_t N = 0;
+ Int_t n = 0;
for (UInt_t j = offsetY; j< nbinsY; j++)
for (UInt_t i = offsetX; i< nbinsX; i++)
{
ratio = fDenominator->GetBinContent(i,j)/fNumerator->GetBinContent(i,j);
sum += ratio;
- N++;
+ n++;
}
}
- if(gDebug > 0) Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d N=%d",sum,fNBinsToScaleX,fNBinsToScaleY,N);
+ if(gDebug > 0) Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d n=%d",sum,fNBinsToScaleX,fNBinsToScaleY,n);
- if (N == 0) return 0.0;
- Double_t ret = sum/((Double_t)N);
+ if (n == 0) return 0.0;
+ Double_t ret = sum/((Double_t)n);
if(gDebug > 0) Info("Scale","returning %f",ret);
return ret;
Double_t ratio;
Double_t sum = 0;
- Int_t N = 0;
+ Int_t n = 0;
for (UInt_t k = offsetZ; k<nbinsZ; k++)
for (UInt_t j = offsetY; j<nbinsY; j++)
{
ratio = fDenominator->GetBinContent(i,j,k)/fNumerator->GetBinContent(i,j,k);
sum += ratio;
- N++;
+ n++;
}
}
if(gDebug > 0)
- Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d N=%d",
- sum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ,N);
+ Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d n=%d",
+ sum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ,n);
- if (N == 0) return 0.0;
- Double_t ret = sum/((Double_t)N);
+ if (n == 0) return 0.0;
+ Double_t ret = sum/((Double_t)n);
if(gDebug > 0) Info("Scale","returning %f",ret);
return ret;