//
// class AliHBTReaderTPC
//
-// reader for TPC tracking
-// needs galice.root, AliTPCtracks.root, AliTPCclusters.root
-//
+// reader for TPC tracks
+// needs galice.root
+// just to shut up coding conventions checker
+//
// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
// Piotr.Skowronski@cern.ch
//
///////////////////////////////////////////////////////////////////////////
#include <TTree.h>
-#include <TFile.h>
#include <TParticle.h>
#include <TH1.h>
-#include <Varargs.h>
#include <AliRun.h>
#include <AliLoader.h>
#include <AliStack.h>
#include <AliMagF.h>
#include <AliTPCtrack.h>
-#include <AliTPCParam.h>
-#include <AliTPCtracker.h>
#include <AliTPCLoader.h>
-#include "AliHBTRun.h"
#include "AliHBTEvent.h"
#include "AliHBTParticle.h"
-#include "AliHBTParticleCut.h"
-
+#include "AliHBTTrackPoints.h"
+#include "AliHBTClusterMap.h"
ClassImp(AliHBTReaderTPC)
fTPCLoader(0x0),
fMagneticField(0.0),
fUseMagFFromRun(kTRUE),
+ fNTrackPoints(0),
+ fdR(0.0),
+ fClusterMap(kFALSE),
fNClustMin(0),
- fNClustMax(190),
+ fNClustMax(150),
fNChi2PerClustMin(0.0),
fNChi2PerClustMax(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)
{
- //constructor,
- //Defaults:
- // galicefilename = "" - this means: Do not open gAlice file -
- // just leave the global pointer untouched
+ //constructor
}
+/********************************************************************/
AliHBTReaderTPC::AliHBTReaderTPC(const Char_t* galicefilename):
fFileName(galicefilename),
fTPCLoader(0x0),
fMagneticField(0.0),
fUseMagFFromRun(kTRUE),
+ fNTrackPoints(0),
+ fdR(0.0),
fNClustMin(0),
- fNClustMax(190),
+ fNClustMax(150),
fNChi2PerClustMin(0.0),
fNChi2PerClustMax(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)
{
//constructor,
//Defaults:
- // galicefilename = "" - this means: Do not open gAlice file -
- // just leave the global pointer untouched
-
}
/********************************************************************/
+
AliHBTReaderTPC::AliHBTReaderTPC(TObjArray* dirs, const Char_t* galicefilename):
AliHBTReader(dirs),
fFileName(galicefilename),
fTPCLoader(0x0),
fMagneticField(0.0),
fUseMagFFromRun(kTRUE),
+ fNTrackPoints(0),
+ fdR(0.0),
+ fClusterMap(kFALSE),
fNClustMin(0),
- fNClustMax(190),
+ fNClustMax(150),
fNChi2PerClustMin(0.0),
fNChi2PerClustMax(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)
{
}
/********************************************************************/
+AliHBTReaderTPC::AliHBTReaderTPC(const AliHBTReaderTPC& in):
+ AliHBTReader(in),
+ fFileName(in.fFileName),
+ fRunLoader(0x0),
+ fTPCLoader(0x0),
+ fMagneticField(in.fMagneticField),
+ fUseMagFFromRun(in.fUseMagFFromRun),
+ fNTrackPoints(in.fNTrackPoints),
+ fdR(in.fdR),
+ fNClustMin(in.fNClustMin),
+ fNClustMax(in.fNClustMax),
+ fNChi2PerClustMin(in.fNChi2PerClustMin),
+ fNChi2PerClustMax(in.fNChi2PerClustMax),
+ fC00Min(in.fC00Min),
+ fC00Max(in.fC00Max),
+ fC11Min(in.fC11Min),
+ fC11Max(in.fC11Max),
+ fC22Min(in.fC22Min),
+ fC22Max(in.fC22Max),
+ fC33Min(in.fC33Min),
+ fC33Max(in.fC33Max),
+ fC44Min(in.fC44Min),
+ fC44Max(in.fC44Max)
+{
+ //cpy constructor,
+}
+/********************************************************************/
AliHBTReaderTPC::~AliHBTReaderTPC()
{
}
}
/********************************************************************/
-
+
+AliHBTReaderTPC& AliHBTReaderTPC::operator=(const AliHBTReaderTPC& in)
+{
+//Assigment operator
+
+ delete fRunLoader;
+
+ fFileName = in.fFileName;
+ fRunLoader = 0x0;
+ fTPCLoader = 0x0;
+ fMagneticField = in.fMagneticField;
+ fUseMagFFromRun = in.fUseMagFFromRun;
+ fNTrackPoints = in.fNTrackPoints;
+ fdR = in.fdR;
+ fNClustMin = in.fNClustMin;
+ fNClustMax = in.fNClustMax;
+ fNChi2PerClustMin = in.fNChi2PerClustMin;
+ fNChi2PerClustMax = in.fNChi2PerClustMax;
+ fC00Min = in.fC00Min;
+ fC00Max = in.fC00Max;
+ fC11Min = in.fC11Min;
+ fC11Max = in.fC11Max;
+ fC22Min = in.fC22Min;
+ fC22Max = in.fC22Max;
+ fC33Min = in.fC33Min;
+ fC33Max = in.fC33Max;
+ fC44Min = in.fC44Min;
+ fC44Max = in.fC44Max;
+ return *this;
+}
+/********************************************************************/
+
void AliHBTReaderTPC::Rewind()
{
+//Rewind reading to the beginning
delete fRunLoader;
fRunLoader = 0x0;
fCurrentDir = 0;
//
Info("Read","");
- Int_t ntracksread = 0;
-
TObjArray *tarray = new TObjArray(5000); //cotainer for tpc tracks
tarray->SetOwner(); //set the ownership of the objects it contains
//when array is is deleted or cleared all objects
if (!tracktree) //check if we got the tree
{//if not return with error
Error("ReadNext","Can't get a tree with TPC tracks !\n");
+ fCurrentEvent++;//go to next dir
continue;
}
if (!trackbranch) ////check if we got the branch
{//if not return with error
Error("ReadNext","Can't get a branch with TPC tracks !\n");
+ fCurrentEvent++;//go to next dir
continue;
}
Int_t ntpctracks=(Int_t)tracktree->GetEntries();//get number of TPC tracks
if (label < 0) continue;
- if (CheckTrack(iotrack)) continue;
+ if (CheckTrack(iotrack)) continue;//Checks the cuts on track parameters cov. mtx etc
TParticle *p = (TParticle*)stack->Particle(label);
if(p == 0x0) continue; //if returned pointer is NULL
if(p->GetPDG() == 0x0) continue; //if particle has crezy PDG code (not known to our database)
- if(Pass(p->GetPdgCode())) continue; //check if we are intersted with particles of this type
+ if(Rejected(p->GetPdgCode())) continue; //check if we are intersted with particles of this type
//if not take next partilce
AliHBTParticle* part = new AliHBTParticle(*p,i);
- if(Pass(part)) { delete part; continue;}//check if meets all criteria of any of our cuts
+ if(Rejected(part)) { delete part; continue;}//check if meets all criteria of any of our cuts
//if it does not delete it and take next good track
// iotrack->PropagateTo(3.,0.0028,65.19);
Double_t tEtot = TMath::Sqrt( tpx*tpx + tpy*tpy + tpz*tpz + mass*mass);//total energy of the track
AliHBTParticle* track = new AliHBTParticle(p->GetPdgCode(),i, tpx, tpy , tpz, tEtot, 0., 0., 0., 0.);
- if(Pass(track))//check if meets all criteria of any of our cuts
+ if(Rejected(track))//check if meets all criteria of any of our cuts
//if it does not delete it and take next good track
{
delete track;
delete part;
continue;
}
+
+ if (fNTrackPoints > 0)
+ {
+ AliHBTTrackPoints* tpts = new AliHBTTrackPoints(fNTrackPoints,iotrack,fdR);
+ track->SetTrackPoints(tpts);
+ }
+ if ( fClusterMap )
+ {
+ AliHBTClusterMap* cmap = new AliHBTClusterMap(iotrack);
+ track->SetClusterMap(cmap);
+ }
+
fParticlesEvent->AddParticle(part);
fTracksEvent->AddParticle(track);
}
Int_t AliHBTReaderTPC::OpenNextSession()
{
+//Opens session thats from fCurrentDir
TString filename = GetDirName(fCurrentDir);
if (filename.IsNull())
{
return 1;
}
filename = filename +"/"+ fFileName;
- fRunLoader = AliRunLoader::Open(filename,AliConfig::fgkDefaultEventFolderName);
+ fRunLoader = AliRunLoader::Open(filename,AliConfig::GetDefaultEventFolderName());
if( fRunLoader == 0x0)
{
DoOpenError("Can not open session.");
AliKalmanTrack::SetConvConst(1000/0.299792458/mf);
- fRunLoader->CdGAFile();
- AliTPCParam *TPCParam= (AliTPCParam*)gDirectory->Get("75x40_100x60");
- if (!TPCParam)
- {
- TPCParam=(AliTPCParam *)gDirectory->Get("75x40_100x60_150x60");
- if (!TPCParam)
- {
- DoOpenError("TPC parameters have not been found !\n");
- return 1;
- }
- }
-
if (fTPCLoader->LoadTracks())
{
DoOpenError("Error occured while loading TPC tracks.");
}
/********************************************************************/
-Bool_t AliHBTReaderTPC::CheckTrack(AliTPCtrack* t)
+Bool_t AliHBTReaderTPC::CheckTrack(AliTPCtrack* t) const
{
//Performs check of the track
if ( (t->GetNumberOfClusters() > fNClustMax) || (t->GetNumberOfClusters() < fNClustMin) ) return kTRUE;
- Double_t cc[15];
- t->GetCovariance(cc);
- if ( (cc[9] < fC44Min) || (cc[9] > fC44Max) ) return kTRUE;
-
Float_t chisqpercl = t->GetChi2()/((Double_t)t->GetNumberOfClusters());
if ( (chisqpercl < fNChi2PerClustMin) || (chisqpercl > fNChi2PerClustMax) ) return kTRUE;
+ Double_t cc[15];
+ t->GetExternalCovariance(cc);
+
+ if ( (cc[0] < fC00Min) || (cc[0] > fC00Max) ) return kTRUE;
+ if ( (cc[2] < fC11Min) || (cc[2] > fC11Max) ) return kTRUE;
+ if ( (cc[5] < fC22Min) || (cc[5] > fC22Max) ) return kTRUE;
+ if ( (cc[9] < fC33Min) || (cc[9] > fC33Max) ) return kTRUE;
+ if ( (cc[14] < fC44Min) || (cc[14] > fC44Max) ) return kTRUE;
+
+
return kFALSE;
}
}
/********************************************************************/
+void AliHBTReaderTPC::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 AliHBTReaderTPC::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 AliHBTReaderTPC::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 AliHBTReaderTPC::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 AliHBTReaderTPC::SetC44Range(Float_t min, Float_t max)
{
//Sets range of C44 parameter of covariance matrix of the track