}
/***********************************************************************/
AliHBTClusterMap::AliHBTClusterMap(AliESDtrack* track):
- fPadRawMap(fNPadRows)
+ fPadRawMap( (track)?track->GetTPCClusterMap():fNPadRows )
{
- //cotor
- track->Print();//to shut up compiler warning
+ //ctor
+ if (AliHBTParticle::GetDebug() > 2)
+ {
+ Info("AliHBTClusterMap(AliESDtrack*)","");
+ Print();
+ }
}
/***********************************************************************/
AliHBTClusterMap::AliHBTClusterMap(AliTPCtrack* track):
fPadRawMap(fNPadRows)
{
- //cotor
+ //ctor
//Does not work since indeces in the claster index array
//in the TPC track does not correspond to the padraw segmatation
}
else
{ //we don't know the order (inner to outer or reverse)
- //just to be save in case it is going change
+ //just to be save in case it is going to change
Int_t n = 0, m = 0;
if (prevrow < row)
{
prevrow = row;
}
}
- if (AliHBTParticle::GetDebug() > 2)
- {
- Print();
- }
+
+ if (AliHBTParticle::GetDebug() > 2)
+ {
+ Info("AliHBTClusterMap(AliTPCtrack*)","");
+ Print();
+ }
}
/***********************************************************************/
ClassImp(AliHBTMonPyDistributionFctn)
-AliHBTMonPyDistributionFctn::
-AliHBTMonPyDistributionFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
+AliHBTMonPyDistributionFctn::AliHBTMonPyDistributionFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
AliHBTMonOneParticleFctn1D(nbins,maxXval,minXval)
{
//constructor
AliHBTReader& AliHBTReader::operator=(const AliHBTReader& in)
{
//Assigment operator
- if (this == &in) return *this;
- TNamed::operator=( (const TNamed&)in );
-
+ if (this == &in) return *this;
+ TNamed::operator=( (const TNamed&)in );
+
fCuts = (in.fCuts)?(TObjArray*)in.fCuts->Clone():0x0;
fDirs = (in.fDirs)?(TObjArray*)in.fDirs->Clone():0x0;
fCurrentEvent = 0;
#include <TObjString.h>
#include <TTree.h>
#include <TFile.h>
+#include <TKey.h>
#include <TParticle.h>
+#include <AliRun.h>
#include <AliRunLoader.h>
#include <AliStack.h>
#include <AliESDtrack.h>
#include "AliHBTEvent.h"
#include "AliHBTParticle.h"
#include "AliHBTParticleCut.h"
+#include "AliHBTTrackPoints.h"
+#include "AliHBTClusterMap.h"
ClassImp(AliHBTReaderESD)
fGAlFileName(galfilename),
fFile(0x0),
fRunLoader(0x0),
- fReadParticles(kFALSE)
+ fKeyIterator(0x0),
+ fReadParticles(kFALSE),
+ fNTrackPoints(0),
+ fdR(0.0),
+ fClusterMap(kFALSE),
+ fNTPCClustMin(0),
+ fNTPCClustMax(150),
+ fTPCChi2PerClustMin(0.0),
+ fTPCChi2PerClustMax(10e5),
+ fC00Min(0.0),
+ fC00Max(10e5),
+ fC11Min(0.0),
+ fC11Max(10e5),
+ fC22Min(0.0),
+ fC22Max(10e5),
+ fC33Min(0.0),
+ fC33Max(10e5),
+ fC44Min(0.0),
+ fC44Max(10e5),
+ fTPCC00Min(0.0),
+ fTPCC00Max(10e5),
+ fTPCC11Min(0.0),
+ fTPCC11Max(10e5),
+ fTPCC22Min(0.0),
+ fTPCC22Max(10e5),
+ fTPCC33Min(0.0),
+ fTPCC33Max(10e5),
+ fTPCC44Min(0.0),
+ fTPCC44Max(10e5)
+
{
//cosntructor
if ( ((Int_t)kNSpecies) != ((Int_t)AliESDtrack::kSPECIES))
fGAlFileName(galfilename),
fFile(0x0),
fRunLoader(0x0),
- fReadParticles(kFALSE)
+ fKeyIterator(0x0),
+ fReadParticles(kFALSE),
+ fNTrackPoints(0),
+ fdR(0.0),
+ fClusterMap(kFALSE),
+ fNTPCClustMin(0),
+ fNTPCClustMax(150),
+ fTPCChi2PerClustMin(0.0),
+ fTPCChi2PerClustMax(10e5),
+ fC00Min(0.0),
+ fC00Max(10e5),
+ fC11Min(0.0),
+ fC11Max(10e5),
+ fC22Min(0.0),
+ fC22Max(10e5),
+ fC33Min(0.0),
+ fC33Max(10e5),
+ fC44Min(0.0),
+ fC44Max(10e5),
+ fTPCC00Min(0.0),
+ fTPCC00Max(10e5),
+ fTPCC11Min(0.0),
+ fTPCC11Max(10e5),
+ fTPCC22Min(0.0),
+ fTPCC22Max(10e5),
+ fTPCC33Min(0.0),
+ fTPCC33Max(10e5),
+ fTPCC44Min(0.0),
+ fTPCC44Max(10e5)
{
//cosntructor
if ( ((Int_t)kNSpecies) != ((Int_t)AliESDtrack::kSPECIES))
{
//desctructor
delete fRunLoader;
+ delete fKeyIterator;
delete fFile;
}
/**********************************************************/
Int_t AliHBTReaderESD::ReadNext()
{
//reads next event from fFile
-
+ //fRunLoader is for reading Kine
//****** Tentative particle type "concentrations"
static const Double_t concentr[5]={0.05, 0., 0.85, 0.10, 0.05};
continue;
}
fCurrentEvent = 0;
+ fKeyIterator = new TIter(fFile->GetListOfKeys());
+ fFile->Dump();
+ fFile->GetListOfKeys()->Print();
}
-
+ TKey* key = (TKey*)fKeyIterator->Next();
+ if (key == 0x0)
+ {
+ if (AliHBTParticle::GetDebug() > 2 )
+ {
+ Info("ReadNext","No more keys.");
+ }
+ fCurrentDir++;
+ delete fKeyIterator;
+ fKeyIterator = 0x0;
+ delete fFile;//we have to assume there is no more ESD objects in the fFile
+ fFile = 0x0;
+ delete fRunLoader;
+ fRunLoader = 0x0;
+ continue;
+ }
//try to read
- TString esdname;
+
+
+// TObject* esdobj = key->ReadObj();
+// if (esdobj == 0x0)
+// {
+// if (AliHBTParticle::GetDebug() > 2 )
+// {
+// Info("ReadNext","Key read NULL. Key Name is %s",key->GetName());
+// key->Dump();
+// }
+// continue;
+// }
+// esdobj->Dump();
+// AliESD* esd = dynamic_cast<AliESD*>(esdobj);
+
+ TString esdname = "ESD";
esdname+=fCurrentEvent;
AliESD* esd = dynamic_cast<AliESD*>(fFile->Get(esdname));
if (esd == 0x0)
{
+// if (AliHBTParticle::GetDebug() > 2 )
+// {
+// Info("ReadNext","This key is not an AliESD object %s",key->GetName());
+// }
if (AliHBTParticle::GetDebug() > 2 )
{
- Info("ReadNext","Can not find ESD object named %s.",esdname.Data());
+ Info("ReadNext","Can not find AliESD object named %s",esdname.Data());
}
fCurrentDir++;
+ delete fKeyIterator;
+ fKeyIterator = 0x0;
delete fFile;//we have to assume there is no more ESD objects in the fFile
- delete fRunLoader;
fFile = 0x0;
+ delete fRunLoader;
fRunLoader = 0x0;
continue;
}
+
+
+ Float_t mf = esd->GetMagneticField();
+
+ if ( (mf == 0.0) && (fNTrackPoints > 0) )
+ {
+ Error("ReadNext","Magnetic Field is 0 and Track Points Demended. Skipping to next event.");
+ fCurrentEvent++;
+ continue;
+ }
+
AliStack* stack = 0x0;
if (fReadParticles && fRunLoader)
{
}
Info("ReadNext","%s",msg.Data());
}//if (AliHBTParticle::GetDebug()>4)
+
+ AliHBTTrackPoints* tpts = 0x0;
+ if (fNTrackPoints > 0)
+ {
+ tpts = new AliHBTTrackPoints(fNTrackPoints,esdtrack,mf,fdR);
+ }
+
+ AliHBTClusterMap* cmap = 0x0;
+ if ( fClusterMap )
+ {
+ cmap = new AliHBTClusterMap(esdtrack);
+ }
for (Int_t s = 0; s<kNSpecies; s++)
{
if (w[k] == 0.0) continue;
track->SetPIDprobability(charge*GetSpeciesPdgCode( (ESpecies)k ),w[k]);
}
+
if(Pass(track))//check if meets all criteria of any of our cuts
//if it does not delete it and take next good track
{
delete track;
continue;
}
+
+ //Single Particle cuts on cluster map and track points rather do not have sense
+ if (tpts)
+ {
+ track->SetTrackPoints(tpts);
+ }
+
+ if (cmap)
+ {
+ track->SetClusterMap(cmap);
+ }
fTracksEvent->AddParticle(track);
if (particle) fParticlesEvent->AddParticle(particle);
}
}//for (Int_t s = 0; s<kNSpecies; s++)
- if (keeppart == kFALSE) delete particle;//particle was not stored in event
+ if (keeppart == kFALSE)
+ {
+ delete particle;//particle was not stored in event
+ delete tpts;
+ delete cmap;
+ }
}//for (Int_t i = 0;i<ntr; i++) -- loop over tracks
void AliHBTReaderESD::Rewind()
{
//rewinds reading
+ delete fKeyIterator;
delete fFile;
- fFile = 0;
+ fFile = 0x0;
+ fKeyIterator = 0x0;
delete fRunLoader;
+ fRunLoader = 0x0;
fCurrentDir = 0;
fNEventsRead = 0;
fCurrentEvent++;
return 0x0;
}
- if (fReadParticles)
+ if (fReadParticles )
{
fRunLoader = AliRunLoader::Open(dirname +"/"+ fGAlFileName);
if (fRunLoader == 0x0)
delete ret;
return 0x0;
}
+
fRunLoader->LoadHeader();
if (fRunLoader->LoadKinematics())
{
return 0x0;
}
}
+
return ret;
}
/**********************************************************/
}
return 0;
}
+/********************************************************************/
+
+void AliHBTReaderESD::SetTPCNClustersRange(Int_t min,Int_t max)
+{
+ //sets range of Number Of Clusters that tracks have to have
+ fNTPCClustMin = min;
+ fNTPCClustMax = max;
+}
+/********************************************************************/
+
+void AliHBTReaderESD::SetTPCChi2PerCluserRange(Float_t min, Float_t max)
+{
+ //sets range of Chi2 per Cluster
+ fTPCChi2PerClustMin = min;
+ fTPCChi2PerClustMax = max;
+}
+/********************************************************************/
+
+void AliHBTReaderESD::SetC00Range(Float_t min, Float_t max)
+{
+ //Sets range of C00 parameter of covariance matrix of the track
+ //it defines uncertainty of the momentum
+ fC00Min = min;
+ fC00Max = max;
+}
+/********************************************************************/
+
+void AliHBTReaderESD::SetC11Range(Float_t min, Float_t max)
+{
+ //Sets range of C11 parameter of covariance matrix of the track
+ //it defines uncertainty of the momentum
+ fC11Min = min;
+ fC11Max = max;
+}
+/********************************************************************/
+
+void AliHBTReaderESD::SetC22Range(Float_t min, Float_t max)
+{
+ //Sets range of C22 parameter of covariance matrix of the track
+ //it defines uncertainty of the momentum
+ fC22Min = min;
+ fC22Max = max;
+}
+/********************************************************************/
+
+void AliHBTReaderESD::SetC33Range(Float_t min, Float_t max)
+{
+ //Sets range of C33 parameter of covariance matrix of the track
+ //it defines uncertainty of the momentum
+ fC33Min = min;
+ fC33Max = max;
+}
+/********************************************************************/
+
+void AliHBTReaderESD::SetC44Range(Float_t min, Float_t max)
+{
+ //Sets range of C44 parameter of covariance matrix of the track
+ //it defines uncertainty of the momentum
+ fC44Min = min;
+ fC44Max = max;
+}
Bool_t ReadsTracks() const {return kTRUE;}
Bool_t ReadsParticles() const {return fReadParticles;}
+ void ReadDataTPC(){}
+ void ReadDataITS(){}
+
+ void SetTPCNClustersRange(Int_t min,Int_t max);
+ void SetTPCChi2PerCluserRange(Float_t min, Float_t max);
+ void SetC00Range(Float_t min, Float_t max);
+ void SetC11Range(Float_t min, Float_t max);
+ void SetC22Range(Float_t min, Float_t max);
+ void SetC33Range(Float_t min, Float_t max);
+ void SetC44Range(Float_t min, Float_t max);
+ void SetNumberOfTrackPoints(Int_t n = 5,Float_t dr = 30.0) {fNTrackPoints = n; fdR = dr;}
+ Int_t GetNumberOfTrackPoints() const {return fNTrackPoints;}
+ void SetClusterMap(Bool_t flag = kTRUE){fClusterMap = flag;}
+
+
enum ESpecies {kESDElectron = 0, kESDMuon, kESDPion, kESDKaon, kESDProton, kNSpecies};
static Int_t GetSpeciesPdgCode(ESpecies spec);//skowron
protected:
Int_t ReadNext();
TFile* OpenFile(Int_t evno);//opens files to be read for given event
- void CloseFiles(TFile*);//close files
TString fESDFileName;//name of the file with tracks
TString fGAlFileName;//name of the file with tracks
TFile* fFile;//! pointer to current ESD file
AliRunLoader* fRunLoader;//!Run Loader
+ TIter* fKeyIterator;
Bool_t fReadParticles;//flag indicating wether to read particles from kinematics
+ Int_t fNTrackPoints;//number of track points; if==0 track points are not created
+ Float_t fdR;//spacing between points (along radius) in cm
+ //Track Points are needed for Anti-Merging Cut
+
+ Bool_t fClusterMap;//Flag indicating if Claster Map should be created for each track
+ //Claster map is needed for Anti-Splitting Cut
+
+ //Cut Parameters specific to TPC tracks
+
+ Int_t fNTPCClustMin;//Number of clusters min value
+ Int_t fNTPCClustMax;//Number of clusters max value
+
+ Float_t fTPCChi2PerClustMin;//Chi^2 per number of clusters min value
+ Float_t fTPCChi2PerClustMax;//Chi^2 per number of clusters max value
+
+
+ // Required parameters at vertex
+ Float_t fC00Min;//C00 (0th diagonal element of covariance matrix) min value
+ Float_t fC00Max;//C00 (0th diagonal element of covariance matrix) max value
+
+ Float_t fC11Min;//C11 (1th diagonal element of covariance matrix) min value
+ Float_t fC11Max;//C11 (1th diagonal element of covariance matrix) max value
+
+ Float_t fC22Min;//C22 (2th diagonal element of covariance matrix) min value
+ Float_t fC22Max;//C22 (2th diagonal element of covariance matrix) max value
+
+ Float_t fC33Min;//C33 (3th diagonal element of covariance matrix) min value
+ Float_t fC33Max;//C33 (3th diagonal element of covariance matrix) max value
+
+ Float_t fC44Min;//C44 (4th diagonal element of covariance matrix) min value
+ Float_t fC44Max;//C44 (4th diagonal element of covariance matrix) max value
+
+ // Required parameters at TPC Inner Layer
+ Float_t fTPCC00Min;//C00 (0th diagonal element of covariance matrix) min value
+ Float_t fTPCC00Max;//C00 (0th diagonal element of covariance matrix) max value
+
+ Float_t fTPCC11Min;//C11 (1th diagonal element of covariance matrix) min value
+ Float_t fTPCC11Max;//C11 (1th diagonal element of covariance matrix) max value
+
+ Float_t fTPCC22Min;//C22 (2th diagonal element of covariance matrix) min value
+ Float_t fTPCC22Max;//C22 (2th diagonal element of covariance matrix) max value
+
+ Float_t fTPCC33Min;//C33 (3th diagonal element of covariance matrix) min value
+ Float_t fTPCC33Max;//C33 (3th diagonal element of covariance matrix) max value
+
+ Float_t fTPCC44Min;//C44 (4th diagonal element of covariance matrix) min value
+ Float_t fTPCC44Max;//C44 (4th diagonal element of covariance matrix) max value
+
private:
ClassDef(AliHBTReaderESD,2)
};
{
//constructor
}
-AliHBTTrackPoints::AliHBTTrackPoints(const AliHBTTrackPoints& in):
- TObject(in),
- fN(in.fN),
- fX(new Float_t[fN]),
- fY(new Float_t[fN]),
- fZ(new Float_t[fN])
-{
-//cpy constructor
- for (Int_t i = 0; i < fN; i++)
- {
- fX[i] = in.fX[i];
- fY[i] = in.fY[i];
- fZ[i] = in.fZ[i];
- }
-}
-/***************************************************************/
-
-AliHBTTrackPoints& AliHBTTrackPoints::operator=(const AliHBTTrackPoints& in)
-{
- //Assigment operator
- if(this == &in) return *this;
- TObject::operator=((const TObject&)in);
-
- if (in.fN <= 0)
- {
- delete [] fX;
- delete [] fY;
- delete [] fZ;
- fN = 0;
- fX = 0x0;
- fY = 0x0;
- fZ = 0x0;
- return *this;
- }
-
- if ( fN != in.fN )
- {
- delete [] fX;
- delete [] fY;
- delete [] fZ;
- fN = in.fN;
- fX = new Float_t[fN];
- fY = new Float_t[fN];
- fZ = new Float_t[fN];
- }
-
- for (Int_t i = 0; i < fN; i++)
- {
- fX[i] = in.fX[i];
- fY[i] = in.fY[i];
- fZ[i] = in.fZ[i];
- }
-
- return *this;
-}
/***************************************************************/
AliHBTTrackPoints::AliHBTTrackPoints(Int_t n, AliESDtrack* track, Float_t mf, Float_t dr, Float_t r0):
fX = fY = fZ = 0x0;
return;
}
-
- for (Int_t i = 0; i < fN; i++)
+
+ Double_t x;
+ Double_t par[5];
+ track->GetInnerExternalParameters(x,par); //get properties of the track
+ if (x == 0)
{
- fX[i] = 0.0;
- fY[i] = 0.0;
- fZ[i] = 0.0;
+ Error("AliHBTTrackPoints","This ESD track does not contain TPC information");
+ return;
+ }
+
+ if (mf == 0.0)
+ {
+ Error("AliHBTTrackPoints","Zero Magnetic field passed as parameter.");
+ return;
}
-
- TMath::Hypot(dr,r0)+mf;//just to shut up compilers warning
-// Double_t x;
-// Double_t par[5];
-// track->GetInnerExternalParameters(x,par); //get properties of the track
-// if (x == 0)
-// {
-// Error("AliHBTTrackPoints","This ESD track does not contain TPC information");
-// return;
-// }
-//
-// if (mf == 0.0)
-// {
-// Error("AliHBTTrackPoints","Zero Magnetic field passed as parameter.");
-// return;
-// }
-// Double_t alpha = track->GetInnerAlpha();
-// Double_t cc = 1000./0.299792458/mf;//conversion constant
-// Double_t c=par[4]/cc;
-//
-// MakePoints(dr,r0,x,par,c,alpha);
+ Double_t alpha = track->GetInnerAlpha();
+ Double_t cc = 1000./0.299792458/mf;//conversion constant
+ Double_t c=par[4]/cc;
+
+ MakePoints(dr,r0,x,par,c,alpha);
}
/***************************************************************/
/***************************************************************/
/***************************************************************/
-/*
#include "AliRun.h"
#include "AliESD.h"
#include "AliRunLoader.h"
void AliHBTTrackPoints::testesd(Int_t entr,const char* fname )
{
-//testing routine
delete gAlice;
gAlice = 0x0;
AliRunLoader* rl = AliRunLoader::Open();
delete rl;
}
-*/
/***************************************************************/
/***************************************************************/
/***************************************************************/
-/*
void AliHBTTrackPoints::testtpc(Int_t entr)
{
-//testing routine
-
delete gAlice;
gAlice = 0x0;
AliRunLoader* rl = AliRunLoader::Open();
delete rl;
}
-*/
-
-/***************************************************************/
char *outfile = "hbtanalysis.root")
{
-// AliHBTTrackPoints::SetDebug(1);
+ AliHBTTrackPoints::SetDebug(0);
AliHBTParticle::SetDebug(0);
+ AliLoader::SetDebug(0);
+ AliHBTParticleCut c1;
+ AliHBTParticleCut c2 = c1;
+
//HBT Anlysis Macro
//Anlyzes TPC recontructed tracks and simulated particles that corresponds to them
{
AliHBTReaderESD* esdreader = new AliHBTReaderESD();
esdreader->ReadParticles(kTRUE);
+ esdreader->SetNumberOfTrackPoints(5,30.);
+ esdreader->SetClusterMap();
reader = esdreader;
}
else if(!TPC)