Title: HBT Analyzer
 1HBT Analyzer
Piotr Krszysztof Skowronski for ALICE 
Collaboration CERN/Warsaw Univ. of 
Technology CHEP 2003 
 2Correlation Function
- HBT analysis result is a Correlation Function 
(CF)  - Experimental CF of some variable Q(part1,part2,) 
is created by division of two histograms  - Numerator is a histogram obtained by calculating 
value of Q( part1n, part2n,) for particles 
coming from the same event  - Denominator is a combinatorial background 
obtained by histogramming Q(part1n,part2k,) 
value of particles coming from different events 
  3Algorithm
-  Algorithm itself is trivial 
 -  Loop over events (I) 
 -  Loop over events (II) 
 -  Loop over particles from event (I) 
 -  Loop over particles from event 
(II)  -  Check cuts 
 -  Calculate Q 
 -  Fill numerator or denominator depending if 
event (I)  event (I) 
- However, we want to 
 -  Calculate many CF in one analysis run 
 -  Apply different cuts 
 -  Have program as fast and robust as possible
 
  4Structure
fReader
fPairCut
fFirstPartCut fSecondPartCut
fBasePairCuts 
 5AliHBTAnalysis
-  This object performs looping 
 -  User adds functions to it in a macro 
 - Track functions (One Pair Fctn) 
 - Particle functions (One Pair Fctn) 
 - Resolution functions (Two Pair Fctn) 
 - Track Monitor Functions 
 -  Action is triggered by method Process(Option_t) 
 -  Options can be 
 - Tracks (default) - process only tracks 
 - Particles - process only particles 
 - TracksParticles - process all functions
 
  6AliHBTAnalysis cont.
- Separate, specialized mixing algorithm for 
non-identical particles analysis  - Used automatically in case particle cuts in pair 
cut exclude each other  -  i.e. different PID 
 - Events are filtered before mixing
 
  7Structure Functions
fReader
fPairCut 
 8Structure Functions 
 9Functions
- AliHBTOnePairFctn 
 - virtual void ProcessSameEventParticles(AliHBTPair
 pair)  0  - virtual void ProcessDiffEventParticles(AliHBTPair
 pair)  0  - AliHBTTwoPairFctn 
 - virtual void ProcessSameEventParticles(AliHBTPair
 trackpair, AliHBTPair partpair)  0  - virtual void ProcessDiffEventParticles(AliHBTPair
 trackpair, AliHBTPair partpair)  0  - AliHBTFunction, base pure virtual 
 - implements pair cut interface each function can 
have a different cut  - in one analysis it is possible to get the same 
function with different cuts  - some getters and setters 
 - (TH1 GetResult(), etc.) 
 - other common methods 
 - AliHBTOnePairFctn1D, uses TH1D 
 - AliHBTTwoPairFctn2D, uses TH2D 
 - etc...
 
  10Functions
-  So creating a new type function is very 
easyclass AliHBTQInvCorrelFctn public 
AliHBTOnePairFctn1D //Q Invaraint Correlation 
Function public AliHBTQInvCorrelFctn() 
AliHBTQInvCorrelFctn(Int_t nbins,Double_t 
maxXval,Double_t minXval) virtual 
AliHBTQInvCorrelFctn() TH1 
GetResult()return GetRatio(Scale()) 
protected Double_t GetValue(AliHBTPair  
pair)return pair-gtGetQInv() public 
ClassDef(AliHBTQInvCorrelFctn,1) 
  11Monitoring Functions
- Monitor Fuctions are for controling single 
particle properties  - Spectra 
 - Resolutions 
 - Structure similar to correlation functions 
 - AliHBTMonitorFunction, base pure virtual 
 - AliHBTMonOneParticleFctn 
 - virtual void Process(AliHBTParticle pair)  0 
 - AliHBTMonTwoParticleFctn 
 - virtual void Process(AliHBTParticle 
trackparticle,  -  AliHBTParticle partparticle)  
0  - AliHBTMonOneParticleFctn1D uses TH1D 
 - AliHBTMonOneParticleFctn2D uses TH2D 
 - etc...
 
  12AliHBTReader
- Pure virtual interface 
 - AliHBTEvent GetParticleEvent(Int_t) 
 - AliHBTEvent GetTrackEvent(Int_t) 
 - Int_t GetNumberOfPartEvents() 
 - Int_t GetNumberOfTrackEvents() 
 - Allows to implement buffering/non-buffering 
readers  - List of particle cuts (AliHBTPartCut) allows for 
filtering particles on the level of reading.  - In simple case no more cuts is needed 
 - Makes analysis faster 
 - User can specify list of directories to read 
events from  - Many AliHBTAnalysis objects can use the same 
instance of the reader  - It is very important feature, since reading is 
very time consuming - specially from the tape via 
RFIO. 
  13Structure Particle Cut
PID
fBaseCuts  
 14Particle Cut
- Applies cut on many particle properties 
 - Particle cut (AliHBTParticleCut) have an array of 
base cuts  - Base cut applies cut on one particle property 
 - Base cut (AliHbtBaseCut) implements setters and 
getters for max and min value and method  -  inline Bool_tAliHbtBaseCutPass(AliHBTParticle
 p) if( (GetValue(p)gtfMin)  
(GetValue(p)ltfMax) )  return kFALSE 
//accepted else  return kTRUE //rejected   -  where GetValue(AliHBTParticle) is pure virtual 
 - Package implements set of base cuts, and 
AliHBTParticleCut has an comfortable interface 
methods to set them  - However, users will invent for new cuts... 
 
  15Particle Cut
-  But again, implementing new base cut is very 
easyclass AliHBTPtCut public AliHbtBaseCut 
public AliHBTPtCut(Double_t min,Double_tmax) 
 AliHbtBaseCut(min,max,kHbtPt) 
virtual AliHBTPtCut() protected Double_t 
GetValue(AliHBTParticle  p)return p-gtPt() 
ClassDef(AliHBTPtCut,1)  - There is implemented Empty Particle Cut 
(AliHBTEmptyParticleCut) , which accepts all 
particles  - All objects that have a particle cut as a member, 
creates by default empty cut 
  16Pair Cut
- Applies cut on particle on different properties 
of a pair of particles  - Pair Cut has a two pointers for particle cut 
 - One for each particle in pair 
 - Both can point the same object, of course. 
 - By default they are empty cuts (accepting all 
particles)  - And a list of Base Pair Cuts (AliHbtBasePairCut) 
 - Implememnts cut on one particle pair property 
 - Implementation follows the idea described for 
Particle Cut  - An empty pair cut is implemented as well
 
  17AliHBTPair
- Just two pointers to particles and methods for 
calculating quantities (Qinv, Minv , etc., ...)  - But, 
 - Results of time consuming calculations are 
buffered  - For each such a variable exists buffer and 
Boolean flag  - Flags are set to false if new particles are set 
in pair  - Values are calculated on demand if flag "value 
calculated" is false.  - This solution speeds up the code more than twice
 
  18AliHBTPair
- AliHBTPair has a member variable of type 
AliHBTPair with swapped particles  - This is dictated by the way of mixing (looping) 
 - If pair is AB, there is not going to come BA 
 - In some analysis order of particles is important 
 - If Pair is not accepted by PairCut, swapped pair 
can be obtained and eventually (after passing 
cut) analyzed 
  19Example Macro
AliHBTAnalysis  analysis  new 
AliHBTAnalysis() AliHBTReader reader  new 
AliHBTReaderTPC() AliHBTParticleCut 
readerpartcut new AliHBTParticleCut() readerpart
cut-gtSetPtRange(0.1,1.0) readerpartcut-gtSetPID(kP
iPlus) //read this particle type with this 
cut reader-gtAddParticleCut(readerpartcut) 
 analysis-gtSetReader(reader)//Set Reader to 
Analysis AliHBTPairCut paircut  new 
AliHBTPairCut() paircut-gtSetQInvRange(0.0,0.20) 
analysis-gtSetGlobalPairCut(paircut) //pi pi 
analysis AliHBTQInvCorrelFctn  qinvcfT 
new AliHBTQInvCorrelFctn("qinvcfP","Particle 
(simulated) Qinv CF") AliHBTQInvCorrelFctn  
qinvcfP new AliHBTQInvCorrelFctn("qinvcfT","T
rack (recontructed) Qinv CF") analysis-gtAddTrack
Function(qinvcfT) analysis-gtAddParticleFunction(q
invcfP) analysis-gtProcess("TracksAndParticles") 
 TFile histoOutput(outfile,"recreate") analysis-gt
WriteFunctions() histoOutput.Close() 
 20http//alisoft.cern.ch/people/skowron