--- /dev/null
+//********************************************************************
+// Example of the reconstruction that generates the ESD
+// Input files:
+// a) file containing the ITS clusters
+// (the AliITSFindClustersV2.C macro can be used to generate it)
+// b) file containing the TPC clusters
+// (the AliTPCFindClusters.C macro can be used to generate it)
+// c) file containing the TRD clusters
+// (the AliTRDdigits2cluster.C macro can be used to generate it)
+// d) file containing the TOF digits
+// (the AliTOFSDigits2Digits.C macro can be used to generate it)
+// Ouput file:
+// AliESDs.root containing the ESD events
+//
+// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//********************************************************************
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+ #include <Riostream.h>
+ #include "TFile.h"
+ #include "TSystem.h"
+ #include "TStopwatch.h"
+ #include "TArrayF.h"
+
+ #include "AliMagF.h"
+ #include "AliRun.h"
+ #include "AliRunLoader.h"
+ #include "AliLoader.h"
+ #include "AliHeader.h"
+ #include "AliGenEventHeader.h"
+
+ #include "AliESD.h"
+ #include "AliESDpid.h"
+
+ #include "AliITS.h"
+ #include "AliITSgeom.h"
+ #include "AliITStrackerV2.h"
+ #include "AliV0vertexer.h"
+ #include "AliCascadeVertexer.h"
+ #include "AliITSpidESD.h"
+ #include "AliITSLoader.h"
+
+ #include "AliTPCParam.h"
+ #include "AliTPCtracker.h"
+ #include "AliTPCpidESD.h"
+ #include "AliTPCLoader.h"
+
+ #include "AliTRDtracker.h"
+ #include "AliTRDPartID.h"
+
+ #include "AliTOFpidESD.h"
+ #include "AliTOF.h"
+ #include "AliTOFGeometry.h"
+#endif
+
+extern AliRun *gAlice;
+extern TFile *gFile;
+
+Int_t AliESDtest(Int_t nev=1,Int_t run=0) {
+
+/**** Initialization of the NewIO *******/
+
+ if (gAlice) {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice=0;
+ }
+
+ AliRunLoader *rl = AliRunLoader::Open("galice.root");
+ if (rl == 0x0) {
+ cerr<<"Can not open session"<<endl;
+ return 1;
+ }
+ Int_t retval = rl->LoadgAlice();
+ if (retval) {
+ cerr<<"AliESDtest.C : LoadgAlice returned error"<<endl;
+ delete rl;
+ return 1;
+ }
+ retval = rl->LoadHeader();
+ if (retval) {
+ cerr<<"AliESDtest.C : LoadHeader returned error"<<endl;
+ delete rl;
+ return 2;
+ }
+ gAlice=rl->GetAliRun();
+
+
+ AliKalmanTrack::SetConvConst(
+ 1000/0.299792458/gAlice->Field()->SolenoidField()
+ );
+
+
+/**** The ITS corner ********************/
+
+ AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
+ if (itsl == 0x0) {
+ cerr<<"AliESDtest.C : Can not get the ITS loader"<<endl;
+ return 3;
+ }
+ itsl->LoadRecPoints("read");
+
+ AliITS *dITS = (AliITS*)gAlice->GetDetector("ITS");
+ if (!dITS) {
+ cerr<<"AliESDtest.C : Can not find the ITS detector !"<<endl;
+ return 4;
+ }
+ AliITSgeom *geom = dITS->GetITSgeom();
+
+ //An instance of the ITS tracker
+ AliITStrackerV2 itsTracker(geom);
+
+ //An instance of the ITS PID maker
+ Double_t parITS[]={35.5,0.11,10.};
+ AliITSpidESD itsPID(parITS);
+
+ //An instance of the V0 finder
+ Double_t cuts[]={33, // max. allowed chi2
+ 0.16,// min. allowed negative daughter's impact parameter
+ 0.05,// min. allowed positive daughter's impact parameter
+ 0.080,// max. allowed DCA between the daughter tracks
+ 0.998,// max. allowed cosine of V0's pointing angle
+ 0.9, // min. radius of the fiducial volume
+ 2.9 // max. radius of the fiducial volume
+ };
+ AliV0vertexer vtxer(cuts);
+
+ Double_t cts[]={33., // max. allowed chi2
+ 0.05, // min. allowed V0 impact parameter
+ 0.008, // window around the Lambda mass
+ 0.035, // min. allowed bachelor's impact parameter
+ 0.10, // max. allowed DCA between a V0 and a track
+ 0.9985, //max. allowed cosine of the cascade pointing angle
+ 0.9, // min. radius of the fiducial volume
+ 2.9 // max. radius of the fiducial volume
+ };
+ AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
+
+/**** The TPC corner ********************/
+
+ AliTPCLoader* tpcl = (AliTPCLoader*)rl->GetLoader("TPCLoader");
+ if (tpcl == 0x0) {
+ cerr<<"AliESDtest.C : can not get the TPC loader"<<endl;
+ return 5;
+ }
+ tpcl->LoadRecPoints("read");
+
+ rl->CdGAFile();
+ AliTPCParam *par=(AliTPCParam *)gDirectory->Get("75x40_100x60_150x60");
+ if (!par) {
+ cerr<<"TPC parameters have not been found !\n";
+ return 6;
+ }
+
+ //An instance of the TPC tracker
+ AliTPCtracker tpcTracker(par);
+
+ //An instance of the TPC PID maker
+ Double_t parTPC[]={45.0,0.08,10.};
+ AliTPCpidESD tpcPID(parTPC);
+
+
+/**** The TRD corner ********************/
+
+ AliLoader* trdl = rl->GetLoader("TRDLoader");
+ if (trdl == 0x0) {
+ cerr<<"AliESDtest.C : can not get the TRD loader"<<endl;
+ return 5;
+ }
+ trdl->LoadRecPoints("read");
+
+ //An instance of the TRD tracker
+ rl->CdGAFile();
+ AliTRDtracker trdTracker(gFile); //galice.root file
+
+/*
+ //An instance of the TRD PID maker
+ TFile* pidFile = TFile::Open("pid.root");
+ if (!pidFile->IsOpen()) {
+ cerr << "Can't get pid.root !\n";
+ return 7;
+ }
+ AliTRDPartID* trdPID = (AliTRDPartID*) pidFile->Get("AliTRDPartID");
+ if (!trdPID) {
+ cerr << "Can't get PID object !\n";
+ return 8;
+ }
+*/
+
+
+/**** The TOF corner ********************/
+ AliTOF *dTOF = (AliTOF*)gAlice->GetDetector("TOF");
+ if (!dTOF) {
+ cerr<<"AliESDtest.C : Can not find the TOF detector !"<<endl;
+ return 4;
+ }
+ AliTOFGeometry *tofGeo = dTOF->GetGeometry();
+ if (!tofGeo) {
+ cerr<<"AliESDtest.C : Can not find the TOF geometry !"<<endl;
+ return 4;
+ }
+
+ AliLoader* tofl = rl->GetLoader("TOFLoader");
+ if (tofl == 0x0) {
+ cerr<<"AliESDtest.C : can not get the TOF loader"<<endl;
+ return 5;
+ }
+ tofl->LoadDigits("read");
+
+ //Instance of the TOF PID maker
+ Double_t parTOF[]={130.,5.};
+ AliTOFtracker tofTracker(tofGeo,parTOF) ;
+
+
+ //rl->UnloadgAlice();
+
+
+ TFile *bf=TFile::Open("AliESDcheck.root","RECREATE");
+ if (!bf || !bf->IsOpen()) {
+ cerr<<"Can't open AliESDcheck.root !\n"; return 1;
+ }
+ TFile *ef=TFile::Open("AliESDs.root","RECREATE");
+ if (!ef || !ef->IsOpen()) {cerr<<"Can't open AliESDs.root !\n"; return 2;}
+
+ TStopwatch timer;
+ Int_t rc=0;
+ if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
+ //The loop over events
+ for (Int_t i=0; i<nev; i++) {
+ Char_t ename[100];
+
+ cerr<<"\n\nProcessing event number : "<<i<<endl;
+ AliESD *event=new AliESD();
+ event->SetRunNumber(run);
+ event->SetEventNumber(i);
+ event->SetMagneticField(gAlice->Field()->SolenoidField());
+
+ rl->GetEvent(i);
+
+//***** Primary vertex reconstruction (MC vertex position, for the moment)
+ TArrayF v(3);
+ rl->GetHeader()->GenEventHeader()->PrimaryVertex(v);
+ Double_t vtx[3]={v[0],v[1],v[2]};
+ Double_t cvtx[3]={0.005,0.005,0.010};
+ AliESDVertex vertex(vtx,cvtx);
+ event->SetVertex(&vertex);
+
+//***** Initial path towards the primary vertex
+ tpcTracker.SetVertex(vtx,cvtx);
+ TTree *tpcTree=tpcl->TreeR();
+ if (!tpcTree) {
+ cerr<<"Can't get the TPC cluster tree !\n";
+ return 4;
+ }
+ tpcTracker.LoadClusters(tpcTree);
+ rc+=tpcTracker.Clusters2Tracks(event);
+ tpcPID.MakePID(event); // preliminary PID
+ AliESDpid::MakePID(event); // for the ITS tracker
+
+ itsTracker.SetVertex(vtx,cvtx);
+ TTree *itsTree=itsl->TreeR();
+ if (!itsTree) {
+ cerr<<"Can't get the ITS cluster tree !\n";
+ return 4;
+ }
+ itsTracker.LoadClusters(itsTree);
+ rc+=itsTracker.Clusters2Tracks(event);
+
+ //checkpoint
+ bf->cd();
+ sprintf(ename,"in%d",i);
+ event->Write(ename); bf->Flush();
+ ef->cd();
+
+//***** Back propagation towards the outer barrel detectors
+ rc+=itsTracker.PropagateBack(event);
+
+ rc+=tpcTracker.PropagateBack(event);
+
+ TTree *trdTree=trdl->TreeR();
+ if (!trdTree) {
+ cerr<<"Can't get the TRD cluster tree !\n";
+ return 4;
+ }
+ trdTracker.LoadClusters(trdTree);
+ rc+=trdTracker.PropagateBack(event);
+
+/*
+ for (Int_t iTrack = 0; iTrack < event->GetNumberOfTracks(); iTrack++) {
+ AliESDtrack* track = event->GetTrack(iTrack);
+ trdPID->MakePID(track);
+ }
+*/
+
+ TTree *tofTree=tofl->TreeD();
+ if (!tofTree) {
+ cerr<<"Can't get the TOF cluster tree !\n";
+ return 4;
+ }
+ tofTracker.LoadClusters(tofTree);
+ rc+=tofTracker.PropagateBack(event);
+ tofTracker.UnloadClusters();
+
+ //checkpoint
+ bf->cd();
+ strcat(ename,";*"); bf->Delete(ename);
+ sprintf(ename,"out%d",i);
+ event->Write(ename); bf->Flush();
+ ef->cd();
+
+
+//***** Now the final refit at the primary vertex...
+ rc+=trdTracker.RefitInward(event);
+ trdTracker.UnloadClusters();
+
+ rc+=tpcTracker.RefitInward(event);
+ tpcTracker.UnloadClusters();
+ tpcPID.MakePID(event);
+
+ rc+=itsTracker.RefitInward(event);
+ itsTracker.UnloadClusters();
+ itsPID.MakePID(event);
+
+
+//***** Here is the combined PID
+ AliESDpid::MakePID(event);
+
+
+ //checkpoint
+ bf->cd();
+ strcat(ename,";*"); bf->Delete(ename);
+ sprintf(ename,"refit%d",i);
+ event->Write(ename); bf->Flush();
+ ef->cd();
+
+ bf->Close();
+
+//***** Hyperon reconstruction
+ vtxer.SetVertex(vtx);
+ rc+=vtxer.Tracks2V0vertices(event); // V0 finding
+ rc+=cvtxer.V0sTracks2CascadeVertices(event); // cascade finding
+
+
+//***** Some final manipulations with this event
+ if (rc==0) {
+ sprintf(ename,"%d",i);
+ ef->cd();
+ if (!event->Write(ename)) rc++; ef->Flush();
+ bf=TFile::Open("AliESDcheck.root","RECREATE");
+ }
+ if (rc) {
+ cerr<<"Something bad happened...\n";
+ bf=TFile::Open("AliESDcheck.root","UPDATE");
+ }
+ delete event;
+ }
+ timer.Stop(); timer.Print();
+
+ //pidFile->Close();
+
+ delete par;
+
+ ef->Close();
+ bf->Close();
+
+ delete rl;
+
+ return rc;
+}
/*
$Log$
+Revision 1.3 2003/12/29 18:40:39 hristov
+Copy/paste error corrected
+
Revision 1.2 2003/12/29 17:26:01 hristov
Using enum to initaialize static ints in the header file, the initialization of static floats moved to the implementation file
Implement Global methods GetPos & GetDetID
Revision 0.03 2003/12/14 S.Arcelli
Set Phi range [-180,180]->[0,360]
+Revision 0.03 2004/4/05 S.Arcelli
+ Implement Global methods IsInsideThePad
+ DistanceToPad
*/
#include <stdlib.h>
const Int_t AliTOFGeometry::fgkTimeDiff = 25000;// Min signal separation (ps)
+const Float_t AliTOFGeometry::fgkxTOF = 371.; // Inner radius of the TOF for Reconstruction (cm)
const Float_t AliTOFGeometry::fgkRmin = 370.; // Inner radius of the TOF (cm)
const Float_t AliTOFGeometry::fgkRmax = 399; // Outer radius of the TOF (cm)
const Float_t AliTOFGeometry::fgkZlenA = 106.0;// length (cm) of the A module
//
// Strips Tilt Angles
- const Float_t angles[fgkNPlates][fgkMaxNstrip] ={
+ Float_t const kangles[kNPlates][kMaxNstrip] ={
{44.494, 43.725, 42.946, 42.156, 41.357, 40.548, 39.729, 38.899,
38.060, 37.211, 36.353, 35.484, 34.606, 33.719, 32.822, 31.916,
//Strips Heights
- const Float_t heights[fgkNPlates][fgkMaxNstrip]= {
+ Float_t const kheights[kNPlates][kMaxNstrip]= {
{-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5,
-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5 },
// Deposit in fAngles, fHeights
- for (Int_t iplate = 0; iplate < fgkNPlates; iplate++) {
- for (Int_t istrip = 0; istrip < fgkMaxNstrip; istrip++) {
- fAngles[iplate][istrip] = angles[iplate][istrip];
- fHeights[iplate][istrip] = heights[iplate][istrip];
+ for (Int_t iplate = 0; iplate < kNPlates; iplate++) {
+ for (Int_t istrip = 0; istrip < kMaxNstrip; istrip++) {
+ fAngles[iplate][istrip] = kangles[iplate][istrip];
+ fHeights[iplate][istrip] = kheights[iplate][istrip];
}
}
- fPhiSec = 360./fgkNSectors;
+ fPhiSec = 360./kNSectors;
+}
+
+//_____________________________________________________________________________
+Float_t AliTOFGeometry::DistanceToPad(Int_t *det, Float_t *pos)
+{
+//
+// Returns distance of space point with coor pos (x,y,z) (cm) wrt
+// pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
+//
+
+ //Transform pos into Sector Frame
+
+ Float_t x = pos[0];
+ Float_t y = pos[1];
+ Float_t z = pos[2];
+
+ Float_t radius = TMath::Sqrt(x*x+y*y);
+ Float_t phi=TMath::ATan2(y,x);
+ if(phi<0) phi=2.*TMath::Pi()+phi;
+ // Get the local angle in the sector philoc
+ Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/20.) + 0.5)*fPhiSec;
+ Float_t xs = radius*TMath::Cos(angle/kRaddeg);
+ Float_t ys = radius*TMath::Sin(angle/kRaddeg);
+ Float_t zs = z;
+
+ // Do the same for the selected pad
+
+ Float_t g[3];
+ GetPos(det,g);
+
+ Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
+ Float_t padPhi=TMath::ATan2(g[1],g[0]);
+ if(padPhi<0) padPhi=2.*TMath::Pi()+padPhi;
+ // Get the local angle in the sector philoc
+ Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/20.)+ 0.5) * fPhiSec;
+ Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
+ Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
+ Float_t padzs = g[2];
+
+ //Now move to local pad coordinate frame. Translate:
+
+ Float_t xt = xs-padxs;
+ Float_t yt = ys-padys;
+ Float_t zt = zs-padzs;
+ //Now Rotate:
+
+ Float_t alpha = GetAngles(det[1],det[2]);
+ Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
+ Float_t yr = yt;
+ Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
+
+ Float_t dist = TMath::Sqrt(xr*xr+yr*yr+zr*zr);
+ return dist;
+
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliTOFGeometry::IsInsideThePad(Int_t *det, Float_t *pos)
+{
+//
+// Returns true if space point with coor pos (x,y,z) (cm) falls
+// inside pad with Detector Indices idet (iSect,iPlate,iStrip,iPadX,iPadZ)
+//
+
+ Bool_t isInside=false;
+
+
+ //Transform pos into Sector Frame
+
+ Float_t x = pos[0];
+ Float_t y = pos[1];
+ Float_t z = pos[2];
+
+ Float_t radius = TMath::Sqrt(x*x+y*y);
+ Float_t phi=TMath::ATan2(y,x);
+ if(phi<0) phi=2.*TMath::Pi()+phi;
+ // Get the local angle in the sector philoc
+ Float_t angle = phi*kRaddeg-( Int_t (kRaddeg*phi/20.) + 0.5) *fPhiSec;
+ Float_t xs = radius*TMath::Cos(angle/kRaddeg);
+ Float_t ys = radius*TMath::Sin(angle/kRaddeg);
+ Float_t zs = z;
+
+ // Do the same for the selected pad
+
+ Float_t g[3];
+ GetPos(det,g);
+
+ Float_t padRadius = TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
+ Float_t padPhi=TMath::ATan2(g[1],g[0]);
+ if(padPhi<0) padPhi=2.*TMath::Pi()+padPhi;
+ // Get the local angle in the sector philoc
+ Float_t padAngle = padPhi*kRaddeg-( Int_t (padPhi*kRaddeg/20.)+ 0.5) * fPhiSec;
+ Float_t padxs = padRadius*TMath::Cos(padAngle/kRaddeg);
+ Float_t padys = padRadius*TMath::Sin(padAngle/kRaddeg);
+ Float_t padzs = g[2];
+
+ //Now move to local pad coordinate frame. Translate:
+
+ Float_t xt = xs-padxs;
+ Float_t yt = ys-padys;
+ Float_t zt = zs-padzs;
+ //Now Rotate:
+
+ Float_t alpha = GetAngles(det[1],det[2]);
+ Float_t xr = xt*TMath::Cos(alpha/kRaddeg)+zt*TMath::Sin(alpha/kRaddeg);
+ Float_t yr = yt;
+ Float_t zr = -xt*TMath::Sin(alpha/kRaddeg)+zt*TMath::Cos(alpha/kRaddeg);
+
+ if(fabs(xr)<=0.75 && fabs(yr)<= (fgkXPad*0.5) && fabs(zr)<= (fgkZPad*0.5))
+ isInside=true;
+ return isInside;
+
}
//_____________________________________________________________________________
Int_t ipadx = det[4];
// Find out distance d on the plane wrt median phi:
- Float_t d = (ipadx+0.5)*fgkXPad-(fgkNpadX*fgkXPad)*0.5;
+ Float_t d = (ipadx+0.5)*fgkXPad-(kNpadX*fgkXPad)*0.5;
// The radius r in xy plane:
Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+
Int_t ipadx = det[4];
// Find out distance d on the plane wrt median phi:
- Float_t d = (ipadx+0.5)*fgkXPad-(fgkNpadX*fgkXPad)*0.5;
+ Float_t d = (ipadx+0.5)*fgkXPad-(kNpadX*fgkXPad)*0.5;
// The radius r in xy plane:
Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip]+
// The radius r in xy plane:
Float_t r = (fgkRmin+fgkRmax)/2.+fHeights[iplate][istrip];
- Float_t zCoor = r*TMath::Tan(0.5*TMath::Pi()-GetStripTheta(iplate, istrip))-
+ Float_t zCoor = r*TMath::Tan(0.5*TMath::Pi()-GetStripTheta(iplate,istrip))-
(ipadz-0.5)*fgkZPad*TMath::Cos(fAngles[iplate][istrip]/kRaddeg);
return zCoor;
* 2.*fgkZPad*TMath::Sin(fAngles[iplate][istrip]/kRaddeg)-0.25;
// Find out distance projected onto the strip plane
- Float_t d = (r*TMath::Tan(philoc)+(fgkNpadX*fgkXPad)*0.5);
+ Float_t d = (r*TMath::Tan(philoc)+(kNpadX*fgkXPad)*0.5);
iPadX = (Int_t) ( d/fgkXPad);
return iPadX;
// theta projected on the median of the sector
Float_t theta=TMath::ATan2(rho*TMath::Cos(philoc),z);
- for (Int_t i=0; i<fgkNPlates; i++){
+ for (Int_t i=0; i<kNPlates; i++){
if ( GetMaxPlateTheta(i) >= theta &&
GetMinPlateTheta(i) <= theta)iPlate=i;
}
Float_t z = pos[2];
Int_t nstrips=0;
- if(iplate==0 || iplate == 4)nstrips=fgkNStripC;
- if(iplate==1 || iplate == 3)nstrips=fgkNStripB;
- if(iplate==2) nstrips=fgkNStripA;
+ if(iplate==0 || iplate == 4)nstrips=kNStripC;
+ if(iplate==1 || iplate == 3)nstrips=kNStripB;
+ if(iplate==2) nstrips=kNStripA;
Float_t rho=TMath::Sqrt(x*x+y*y);
Float_t phi=TMath::ATan2(y,x);
// Returns the maximum theta angle of a given plate iPlate (rad)
Int_t index=0;
- if(iPlate==0 ||iPlate == 4)index=fgkNStripC-1;
- if(iPlate==1 ||iPlate == 3)index=fgkNStripB-1;
- if(iPlate==2) index=fgkNStripA-1;
+ if(iPlate==0 ||iPlate == 4)index=kNStripC-1;
+ if(iPlate==1 ||iPlate == 3)index=kNStripB-1;
+ if(iPlate==2) index=kNStripA-1;
Float_t delta =0.;
if(iPlate==0)delta = -1. ;
AliTOFGeometry();
virtual ~AliTOFGeometry();
- static Int_t NStripA() { return fgkNStripA;};
- static Int_t NStripB() { return fgkNStripB;};
- static Int_t NStripC() { return fgkNStripC;};
- static Int_t NpadX() { return fgkNpadX;};
- static Int_t NpadZ() { return fgkNpadZ;};
- static Int_t NSectors() { return fgkNSectors;};
- static Int_t NPlates() { return fgkNPlates;};
- static Int_t NPadXSector() { return (fgkNStripA + 2*fgkNStripB +
- 2*fgkNStripC)*fgkNpadX*fgkNpadZ;};
+ static Int_t NStripA() { return kNStripA;};
+ static Int_t NStripB() { return kNStripB;};
+ static Int_t NStripC() { return kNStripC;};
+ static Int_t NpadX() { return kNpadX;};
+ static Int_t NpadZ() { return kNpadZ;};
+ static Int_t NSectors() { return kNSectors;};
+ static Int_t NPlates() { return kNPlates;};
+ static Int_t NPadXSector() { return (kNStripA + 2*kNStripB +
+ 2*kNStripC)*kNpadX*kNpadZ;};
static Int_t TimeDiff() { return fgkTimeDiff;};
- static Int_t MaxTOFTree() { return fgkMaxTOFTree;};
+ static Int_t MaxTOFTree() { return kMaxTOFTree;};
+ static Float_t RinTOF() { return fgkxTOF;};
static Float_t Rmin() { return fgkRmin;};
static Float_t Rmax() { return fgkRmax;};
static Float_t ZlenA() { return fgkZlenA;};
static Float_t ElectronMass() { return fgkElectronMass;};
static Float_t MuonMass() { return fgkMuonMass;};
+ static Double_t GetAlpha() { return 2 * 3.14159265358979323846 / kNSectors; };
virtual void Init();
+ virtual void SetHoles(Bool_t holes) {fHoles = holes;};
+ virtual Bool_t GetHoles() const {return fHoles;};
+ virtual Bool_t IsInsideThePad(Int_t *det, Float_t *pos);
+ virtual Float_t DistanceToPad(Int_t *det, Float_t *pos);
virtual void GetPos(Int_t *det,Float_t *pos);
virtual void GetDetID(Float_t *pos,Int_t *det);
virtual Int_t GetPlate(Float_t *pos);
private:
enum {
- fgkNStripA = 15, // number of strips in A type module
- fgkNStripB = 19, // number of strips in B type module
- fgkNStripC = 20, // number of strips in C type module
- fgkNpadX = 48, // Number of pads along X
- fgkNpadZ = 2, // Number of pads along Z
- fgkNSectors = 18, // Number of Sectors
- fgkNPlates = 5, // Number of Plates
- fgkMaxNstrip = 20, // Max. number of strips
- fgkMaxTOFTree = 5 // numer of geom. levels:
+ kNStripA = 15, // number of strips in A type module
+ kNStripB = 19, // number of strips in B type module
+ kNStripC = 20, // number of strips in C type module
+ kNpadX = 48, // Number of pads along X
+ kNpadZ = 2, // Number of pads along Z
+ kNSectors = 18, // Number of Sectors
+ kNPlates = 5, // Number of Plates
+ kMaxNstrip = 20, // Max. number of strips
+ kMaxTOFTree = 5 // numer of geom. levels:
};
static const Int_t fgkTimeDiff; // Min signal separation (ps)
static const Float_t fgkZPad; // Pad size in the z direction (cm)
static const Float_t fgkMaxhZtof;// Max half z-size of TOF (cm)
+ static const Float_t fgkxTOF;// Inner TOF Radius used in Reconstruction (cm)
static const Float_t fgkSigmaForTail1;//Sig1 for simulation of TDC tails
static const Float_t fgkSigmaForTail2;//Sig2 for simulation of TDC tails
static const Float_t fgkDprecMin;//num.prec.tolerance on Thmin
static const Float_t fgkDprecMax;//num.prec.tolerance on Thma
static const Float_t fgkDprecCen;//num.prec.tolerance on <Theta>
-
- Float_t fAngles[fgkNPlates][fgkMaxNstrip]; //Strip Tilt Angles
- Float_t fHeights[fgkNPlates][fgkMaxNstrip];//Strip heights
+ Bool_t fHoles; //logical for geometry version (w/wo holes)
+ Float_t fAngles[kNPlates][kMaxNstrip]; //Strip Tilt Angles
+ Float_t fHeights[kNPlates][kMaxNstrip];//Strip heights
Float_t fPhiSec; //sector Phi width (deg)
- ClassDef(AliTOFGeometry,0) // TOF Geometry base class
+ ClassDef(AliTOFGeometry,1) // TOF Geometry base class
};
#endif
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-//_________________________________________________________________________
-// This is a TTask for reconstruction V2 in TOF
-// Description of the algorithm
-//-- Author: F. Pierella | pierella@bo.infn.it
-//////////////////////////////////////////////////////////////////////////////
-
-
-#include <Riostream.h>
-#include <stdlib.h>
-
-#include <TBenchmark.h>
-#include <TClonesArray.h>
-#include <TFile.h>
-#include <TFolder.h>
-#include <TGeant3.h>
-#include <TParticle.h>
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TTask.h>
-#include <TTree.h>
-#include <TVirtualMC.h>
-
-#include "../TPC/AliTPCtrack.h"
-#include "../TRD/AliTRDtrack.h"
-#include "AliDetector.h"
-#include "AliHeader.h"
-#include "AliKalmanTrack.h"
-#include "AliLoader.h"
-#include "AliRun.h"
-#include "AliRunLoader.h"
-#include "AliTOF.h"
-#include "AliTOFGeometry.h"
-#include "AliTOFDigitMap.h"
-#include "AliTOFHitMap.h"
-#include "AliTOFReconstructionerV2.h"
-#include "AliTOFTrackV2.h"
-#include "AliTOFdigit.h"
-#include "AliTOFhitT0.h"
-#include "AliMC.h"
-
-ClassImp(AliTOFReconstructionerV2)
-
-//____________________________________________________________________________
- AliTOFReconstructionerV2::AliTOFReconstructionerV2():TTask("AliTOFReconstructionerV2","")
-{
- //
- // std ctor
- // set all member vars to zero
- //
- fdbg =0;
- fDigitsMap=0x0;
- fField =0;
- fNDummyTracks=0;
- fScaleSigmaFactor=0.;
- fStep =0;
- fTOFDigits=0x0;
- fTOFTracks=0x0;
- fTOFDigitsFile ="digits.root";
- fTPCBackTracksFile="AliTPCBackTracks.root";
- fKalmanTree =0x0;
- fBranchWithTracks =0x0;
-}
-
-//____________________________________________________________________________
-AliTOFReconstructionerV2::AliTOFReconstructionerV2(const char* tpcBackTracks, const char* tofDigits):TTask("AliTOFReconstructionerV2","")
-{
- //
- // par ctor
- // default arguments are specified only in
- // the header file
- // Parameters:
- // tpcBackTracks -> file name with backpropagated tracks in TPC
- // tofDigits -> file name with TOF digits
- //
-
- fdbg =0;
- fDigitsMap=0x0;
- fField =0.2; // default value 0.2 [Tesla]
- fNDummyTracks=20; // by default 20 test tracks used
- fScaleSigmaFactor=1.;
- fStep =0.01; // [cm]
- fTOFDigits=0x0;
- fTOFTracks=0x0;
- fTOFDigitsFile =tofDigits;
- fTPCBackTracksFile=tpcBackTracks;
- fKalmanTree =0x0;
- fBranchWithTracks =0x0;
-
- // initialize the G3 geometry
- gAlice->Init();
- gAlice->Print();
-
- // add Task to //root/Tasks folder
- TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
- roottasks->Add(this) ;
-}
-
-//____________________________________________________________________________
-AliTOFReconstructionerV2::AliTOFReconstructionerV2(const AliTOFReconstructionerV2 & /*rec*/)
-:TTask("AliTOFReconstructionerV2","")
-{
- //
- // Dummy copy constructor
- // required by coding conventions
- ;
-}
-
-
-
-//____________________________________________________________________________
- AliTOFReconstructionerV2::~AliTOFReconstructionerV2()
-{
- //
- // dtor
- // some delete has to be moved
- //
-
- if (fDigitsMap)
- {
- delete fDigitsMap;
- fDigitsMap = 0;
- }
-
- if (fTOFDigits)
- {
- delete fTOFDigits;
- fTOFDigits = 0;
- }
-
- if (fTOFTracks)
- {
- delete fTOFTracks;
- fTOFTracks = 0;
- }
-
- if (fTOFDigitsFile)
- {
- delete fTOFDigitsFile;
- }
-
- if (fTPCBackTracksFile)
- {
- delete fTPCBackTracksFile;
- }
-
- if (fKalmanTree)
- {
- delete fKalmanTree;
- fKalmanTree = 0;
- }
-
- if (fBranchWithTracks)
- {
- delete fBranchWithTracks;
- fBranchWithTracks = 0;
- }
-}
-
-
-//____________________________________________________________________________
-void AliTOFReconstructionerV2::Exec(Option_t* option)
-{
- //
- // Description of the algorithm:
- //
- //
- //
- //
- //
- //
-
- // load TOF digits and fill the digit map
- Int_t tofDigitsLoading=LoadTOFDigits();
-
- // load back-propagated tracks in TPC
- Int_t tpcTracksLoading=LoadTPCTracks();
-
- if(tofDigitsLoading || tpcTracksLoading) {
- cout<<" Couldn't start reconstruction V2. Exit."<<endl;
- exit(1);
- }
- // or load TRD reconstructed tracks
- // Int_t trdTracksLoading=LoadTRDTracks();
-
- // create a TObjArray to store reconstructed tracks
- // and reject fake tracks
- const Int_t maxRecTracks = 10000; // max number of reconstructed tracks
- // per event
-
- const Float_t stripRegionHeight = 15.3; // [cm] height in radial direction
- // of the volume where strips are placed
- TObjArray trackArray(maxRecTracks);
-
- // buffer for output
- fTOFTracks= new TClonesArray("AliTOFTrackV2");
- // create a reference to fill the TClonesArray
- TClonesArray &aTOFTracks = *fTOFTracks;
-
- const Int_t maxIndex = 100000; // max number of primary tracks to be analysed
- // the index of the rtIndex array is the track label
- // the content of the array is -1 for fake tracks
- // and the track index for good tracks
- Float_t dEdXarray[maxRecTracks];
- Int_t rtIndex[maxIndex];
- for(Int_t i = 0; i < maxIndex; i++) rtIndex[i] = -1;
-
- AliKalmanTrack::SetConvConst(100/0.299792458/fField);
-
- Int_t nRecTracks = (Int_t) fKalmanTree->GetEntries();
- cout<<"Found "<<nRecTracks<<" entries in the track tree "<<endl;
-
- // load the tracks into the array
- for (Int_t i=0; i<nRecTracks; i++) {
- AliTPCtrack *iotrack=new AliTPCtrack();
- fBranchWithTracks->SetAddress(&iotrack);
- fKalmanTree->GetEvent(i);
- trackArray.AddLast(iotrack);
- Int_t trackLabel = iotrack->GetLabel();
- dEdXarray[i]=iotrack->GetdEdx(); // usefull for PID
- //
- // start filling the TClonesArray of AliTOFTrackV2
- Float_t trdXYZ[3]={0.,0.,0.};
- Float_t trdPxPyPz[3]={0.,0.,0.};
-
- // tpc outer wall positions
- Double_t xk=iotrack->GetX();
- // get the running coordinates in the lrf
- // and alpha
- Double_t x=xk;
- Double_t y=iotrack->GetY();
- Double_t z=iotrack->GetZ();
- Double_t alpha=iotrack->GetAlpha();
- GetGlobalXYZ(alpha, x, y, z);
- Float_t tpcXYZ[3]={x,y,z};
-
- // momentum at the end of TPC
- Float_t lambda=TMath::ATan(iotrack->GetTgl());
- Float_t invpt=TMath::Abs(iotrack->Get1Pt());
- Float_t pt=-99.;
- if (invpt) pt= 1./invpt; // pt
- Float_t tpcmom=1./(invpt*TMath::Cos(lambda));
- Float_t pz=tpcmom*TMath::Sin(lambda);
- Float_t tpcPtPz[2]={pt,pz};
-
- Int_t matchingStatus=-1;
- if(trackLabel < 0) matchingStatus=0;
- new(aTOFTracks[i]) AliTOFTrackV2(trackLabel,matchingStatus,tpcmom,dEdXarray[i],tpcXYZ,tpcPtPz,trdXYZ,trdPxPyPz);
- // printf("rt with %d clusters and label %d \n",
- // iotrack->GetNumberOfClusters(), trackLabel);
-
- if(trackLabel < 0) continue;
- if(trackLabel >= maxIndex) continue;
- rtIndex[trackLabel] = i;
- delete iotrack;
- }
-
- if(strstr(option,"MC")) Comparison(rtIndex);
-
- // start loop on tracks
- // and backpropagate them from TPC to TOF
- // backpropagation is performed only
- // for good tracks (fake tracks rejected)
- AliTPCtrack *rt;
-
- for (Int_t i=0; i<nRecTracks; i++) {
-
- //******* tracking: extract track coordinates, momentum, etc.
- rt = (AliTPCtrack*) trackArray.UncheckedAt(i);
- // track length to be implemented
- // Double_t tr_length = rt->GetLength();
-
- Int_t tpcTrackLabel=rt->GetLabel();
- // reject fake tracks
- //if(tpcTrackLabel< 0) continue;
-
- // starting backpropagation to TOF
- // here we assume to have backpropagated tracks in TPC
- // starting point xk=246.055
- // starting back propagation
- // outer wall of the TPC
- Int_t iOuterTPCWall=rt->PropagateTo(261.53,40.,0.06124);
- // frame with air just to the beginning of the TOF
- Int_t iFrameWithAir=rt->PropagateTo(370.,36.66,1.2931e-3);
- // trough the wall of the TOF plate
- // thickness has changed according to the
- // last value
- Int_t iTOFWall=rt->PropagateTo(370.11,24.01,2.7);
-
- /*
- // outer wall of the TPC
- Int_t iOuterTPCWall=rt->PropagateTo(261.53,40.,0.06124);
- // air in between TPC and TRD
- Int_t iFrameWithAir=rt->PropagateTo(294.5,36.66,1.2931e-3);
- // TRD itself
- // mean density for the TRD calculated from
- // TRD Technical Design Report
- // page 11 -> global thickness
- // page 23 -> different main layers thickness (Radiator Air/ Drift Chamber Gas /G10)
- // page 139 -> material budget and radiation lengths
- Int_t iTRD=rt->PropagateTo(369.1,171.7,0.33);
- // air in between TRD and TOF
- Int_t iFrameWithAirbis=rt->PropagateTo(370.,36.66,1.2931e-3);
- // trough the wall of the TOF plate
- Int_t iTOFWall=rt->PropagateTo(370.11,24.01,2.7);
- */
-
- // select only cases when
- // backpropagation succeded
- // and particle is in the geometrical TOF acceptance along Z
- // |z|<380 [cm]
- AliTOFTrackV2* oTOFtracks=(AliTOFTrackV2*)fTOFTracks->UncheckedAt(i);
- Bool_t outOfZacceptance=(rt->GetZ()<=380.);
- if(outOfZacceptance) oTOFtracks->SetMatchingStatus(-2);
-
- if(iOuterTPCWall==1 && iFrameWithAir==1 && iTOFWall==1 && (!outOfZacceptance)){
- Double_t cc[15];
- // get sigmaY and sigmaZ
- rt->GetExternalCovariance(cc);
- //Double_t sigmaY =TMath::Sqrt(cc[0]); // [cm]
- //Double_t sigmaZ =TMath::Sqrt(cc[2]); // [cm]
-
- // arrays used by the DigitFinder
- Int_t nSlot=1;
- TArrayI *secArray= new TArrayI(nSlot);
- TArrayI *plaArray= new TArrayI(nSlot);
- TArrayI *strArray= new TArrayI(nSlot);
- TArrayI *pdzArray= new TArrayI(nSlot);
- TArrayI *pdxArray= new TArrayI(nSlot);
-
- // make fNDummyTracks clones of the current backpropagated track
- // make a copy of the current track
- // smear according to the backpropagated area
- for (Int_t j=0; j<fNDummyTracks; i++) {
- AliTPCtrack *dummyrt=new AliTPCtrack(*rt);
- // get ylrf and zlrf
- //Double_t ylrf= dummyrt->GetY(); // P0
- //Double_t zlrf= dummyrt->GetZ(); // P1
-
- // smear according to sigmaY and sigmaZ
- //Double_t ylrfNew=gRandom->Gaus(ylrf,fScaleSigmaFactor*sigmaY);
- //Double_t zlrfNew=gRandom->Gaus(zlrf,fScaleSigmaFactor*sigmaZ);
-
- // set Y and Z accordingly
- // setter to be added in the class AliTPCtrack
- // here I have to modify the AliTPCtrack class
- // adding the setters for Y and Z
- //dummyrt->SetY(ylrfNew);
- //dummyrt->SetZ(zlrfNew);
-
- // start fine-backpropagation inside the TOF
- Bool_t padNotFound =kTRUE;
- Bool_t isInStripsRegion=kTRUE;
- Double_t xk=dummyrt->GetX();
-
- while (padNotFound && isInStripsRegion){
- xk+=fStep;
- // here we assume a frame with air
- dummyrt->PropagateTo(xk,36.66,1.2931e-3);
- // get the running coordinates in the lrf
- // and alpha
- Double_t x=xk;
- Double_t y=dummyrt->GetY();
- Double_t z=dummyrt->GetZ();
- Double_t alpha=dummyrt->GetAlpha();
- GetGlobalXYZ(alpha, x, y, z);
-
- // check if the point falls into a pad
- // using the G3 geometry
- Int_t* volumeID = new Int_t[AliTOFGeometry::MaxTOFTree()];
- // volumeID[0] -> TOF Sector range [1-18]
- // volumeID[1] -> TOF Plate range [1- 5]
- // volumeID[2] -> TOF Strip max range [1-20]
- // volumeID[3] -> TOF Pad along Z range [1- 2]
- // volumeID[4] -> TOF Pad along X range [1-48]
-
- Float_t zInPadFrame=0.;
- Float_t xInPadFrame=0.;
- IsInsideThePad((Float_t)x,(Float_t)y,(Float_t)z, volumeID, zInPadFrame, xInPadFrame);
- // adding protection versus wrong volume numbering
- // to be released in the next release after debugging
- if(volumeID[4]){
- padNotFound=kFALSE;
- nSlot++;
- secArray->Set(nSlot-1);
- plaArray->Set(nSlot-1);
- strArray->Set(nSlot-1);
- pdzArray->Set(nSlot-1);
- pdxArray->Set(nSlot-1);
-
- (*secArray)[nSlot-1]=volumeID[0];
- (*plaArray)[nSlot-1]=volumeID[1];
- (*strArray)[nSlot-1]=volumeID[2];
- (*pdzArray)[nSlot-1]=volumeID[3];
- (*pdxArray)[nSlot-1]=volumeID[4];
-
- } // track falls into a pad volume
-
- delete [] volumeID;
-
- // check on xk to stop the fine-propagation
- if(xk>=(370.+stripRegionHeight)) isInStripsRegion=kFALSE;
-
- } // close the while for fine-propagation
-
- delete dummyrt;
- } // end loop on test tracks
-
- // start TOF digit finder
- Int_t assignedVol[5]={0,0,0,0,0};
- Float_t tdc=-1.;
- Int_t* digitTrackArray=0x0;
- Bool_t assignedDigit=DigitFinder(secArray, plaArray, strArray, pdzArray, pdxArray, assignedVol, digitTrackArray, tdc);
-
-
- if(assignedDigit){
- // fill the tree for tracks with time of flight
- // tof is given in tdc bin
- // conversion to [ns]
- Float_t binWidth=50.; // [ps]
- Float_t timeOfFlight=tdc*binWidth/1000.;
-
- // only the first track number contributing
- // to the assigned digit
- Int_t tofDigitTrackLabel=digitTrackArray[0];
-
- // matching status for the current track
- Int_t matching=4;
- if(tpcTrackLabel==digitTrackArray[0] || tpcTrackLabel==digitTrackArray[1] || tpcTrackLabel==digitTrackArray[0]) matching=3;
- oTOFtracks->UpdateTrack(tofDigitTrackLabel, matching, timeOfFlight);
- } else {
- // fill the TClonesArray for tracks with no time of flight
- Int_t matching=1;
- oTOFtracks->SetMatchingStatus(matching);
- }
-
- // delete used memory for tmp arrays used by DigitFinder
- delete secArray;
- delete plaArray;
- delete strArray;
- delete pdzArray;
- delete pdxArray;
-
- } // close the if for succeded backpropagation in TOF acceptance along z
-
- } // end loop on reconstructed tracks
-
- // free used memory for digitmap
- delete fDigitsMap;
-
- // save array with TOF tracks
- Int_t output=SaveTracks();
- if(output) cout << "Error writing TOF tracks " << endl;
-}
-
-
-//__________________________________________________________________
-void AliTOFReconstructionerV2::Init(Option_t* /*opt*/)
-{
- //
- // Initialize the AliTOFReconstructionerV2
- //
- //
-}
-
-
-//__________________________________________________________________
-Int_t AliTOFReconstructionerV2::LoadTPCTracks()
-{
- //
- // Connect the tree and the branch
- // with reconstructed tracks
- // backpropagated in the TPC
-
- gBenchmark->Start("LoadTPCTracks");
-
- TFile *kalFile = TFile::Open(fTPCBackTracksFile.Data());
- if (!kalFile->IsOpen()) {cerr<<"Can't open AliTPCBackTracks.root !\n"; return 3;}
-
- // tracks from Kalman
- Int_t event=0;
- char treename[100]; sprintf(treename,"TreeT_TPCb_%d",event);
- fKalmanTree=(TTree*)kalFile->Get(treename);
- if (!fKalmanTree) {cerr<<"Can't get a tree with TPC back tracks !\n"; return 4;}
-
- // otherwise you get always 0 for 1/pt
- AliKalmanTrack::SetConvConst(100/0.299792458/fField);
-
- fBranchWithTracks=fKalmanTree->GetBranch("tracks");
- Int_t kalEntries =(Int_t)fKalmanTree->GetEntries();
- cout<<"Number of loaded Tracks :"<< kalEntries <<endl;
-
- gBenchmark->Stop("LoadTPCTracks");
- gBenchmark->Show("LoadTPCTracks");
- return 0;
-}
-
-//__________________________________________________________________
-Int_t AliTOFReconstructionerV2::LoadTRDTracks()
-{
- //
- // Connect the tree and the branch
- // with reconstructed tracks in TRD
-
- gBenchmark->Start("LoadTRDTracks");
-
- Int_t nEvent = 0;
- const Int_t nPrimaries = 84210/16;
- const Int_t maxIndex = nPrimaries;
- Int_t rtIndex[maxIndex];
-
- TFile *tf=TFile::Open("AliTRDtracks.root");
-
- if (!tf->IsOpen()) {cerr<<"Can't open AliTRDtracks.root !\n"; return 3;}
- TObjArray tarray(2000);
- char tname[100];
- sprintf(tname,"TRDb_%d",nEvent);
- TTree *tracktree=(TTree*)tf->Get(tname);
-
- TBranch *tbranch=tracktree->GetBranch("tracks");
-
- Int_t nRecTracks = (Int_t) tracktree->GetEntries();
- cerr<<"Found "<<nRecTracks<<" entries in the track tree"<<endl;
-
- for (Int_t i=0; i<nRecTracks; i++) {
- AliTRDtrack *iotrack=new AliTRDtrack();
- tbranch->SetAddress(&iotrack);
- tracktree->GetEvent(i);
- tarray.AddLast(iotrack);
- Int_t trackLabel = iotrack->GetLabel();
-
- // printf("rt with %d clusters and label %d \n",
- // iotrack->GetNumberOfClusters(), trackLabel);
-
- if(trackLabel < 0) continue;
- if(trackLabel >= maxIndex) continue;
- rtIndex[trackLabel] = i;
- }
- tf->Close();
- gBenchmark->Stop("LoadTRDTracks");
- gBenchmark->Show("LoadTRDTracks");
- return 0;
-
-}
-
-//__________________________________________________________________
-Int_t AliTOFReconstructionerV2::LoadTOFDigits()
-{
- //
- // Connect the TClonesArray with TOF
- // digits and fill the digit map
- // used by the DigitFinder
-
- Int_t rc=0;
-
- gBenchmark->Start("LoadTOFDigits");
-
- TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(fTOFDigitsFile.Data());
- if(file){
- cout<<"headerFile already open \n";
- }
- else {
- if(!file)file=TFile::Open(fTOFDigitsFile.Data());
- }
-
- // Get AliRun object from file
- if (!gAlice) {
- gAlice = (AliRun*)file->Get("gAlice");
- if (gAlice) printf("AliRun object found on file\n");
- }
-
- Int_t iEvNum = 0;
- if (iEvNum == 0) iEvNum = (Int_t) gAlice->TreeE()->GetEntries();
-
-
- AliTOFdigit *tofdigit;
-
- AliTOF * tof = (AliTOF *) gAlice->GetDetector("TOF") ;
-
- if (!tof) {
- cout << "<LoadTOFDigits> No TOF detector found" << endl;
- rc = 2;
- return rc;
- }
-
- for (Int_t ievent = 0; ievent < iEvNum; ievent++) {
-
- gAlice->GetEvent(ievent) ;
- if(gAlice->TreeD()==0) {
- cout << "<LoadTOFDigits> No TreeD found" << endl;
- rc = 4;
- return rc;
- }
-
-
- Int_t ndig;
- gAlice->ResetDigits();
- gAlice->TreeD()->GetEvent(ievent);
- fTOFDigits = tof->Digits();
-
- ndig=fTOFDigits->GetEntries();
-
- // create the digit map
- fDigitsMap = new AliTOFDigitMap(fTOFDigits);
-
-
- cout << "<LoadTOFDigits> found " << ndig
- << " TOF digits for event " << ievent << endl;
-
- for (Int_t k=0; k<ndig; k++) {
- tofdigit= (AliTOFdigit*) fTOFDigits->UncheckedAt(k);
- Float_t tdc=tofdigit->GetTdc();
- // adc value can be used for weighting
- //Float_t adc=tofdigit->GetAdc();
-
- // TOF digit volumes
- Int_t vol[5]; // location for a digit
- Int_t sector = tofdigit->GetSector(); // range [1-18]
- Int_t plate = tofdigit->GetPlate(); // range [1- 5]
- Int_t strip = tofdigit->GetStrip(); // range [1-20]
- Int_t padx = tofdigit->GetPadx(); // range [1-48]
- Int_t padz = tofdigit->GetPadz(); // range [1- 2]
-
- vol[0] = sector;
- vol[1] = plate;
- vol[2] = strip;
- vol[3] = padx;
- vol[4] = padz;
-
- // QA
- Bool_t isDigitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
-
- if (isDigitBad) {
- cout << "<LoadTOFDigits> strange digit found" << endl;
- rc = 3;
- return rc;
- } // if (isDigitBad)
-
- // Fill the digit map checking if the location is already used
- // in this case we take the earliest signal
- if (fDigitsMap->TestHit(vol) != kEmpty) {
- // start comparison in between the 2 digit
- AliTOFdigit *dig = static_cast<AliTOFdigit*>(fDigitsMap->GetHit(vol));
- if(tdc < (dig->GetTdc())) fDigitsMap->SetHit(vol,k);
- // we can add also the check on adc value
- // by selecting the largest adc value
- } else {
- fDigitsMap->SetHit(vol,k);
- }
- // to be added protection versus 2-digit on the same pad
- // we have to have memory also of the second digit
-
- } // for (k=0; k<ndig; k++)
-
- } // end loop on events
-
- gBenchmark->Stop("LoadTOFDigits");
- gBenchmark->Show("LoadTOFDigits");
- return rc;
-}
-
-//__________________________________________________________________
-void AliTOFReconstructionerV2::IsInsideThePad(Float_t x, Float_t y, Float_t z, Int_t *nGeom, Float_t& zPad, Float_t& xPad)
-{
- // input: x,y,z - coordinates of a point in the mrf [cm]
- // output: array nGeom[]
- // nGeom[0] - the TOF sector number, 1,2,...,18 along azimuthal direction starting from -90 deg.
- // nGeom[1] - the TOF module number, 1,2,3,4,5=C,B,A,B,C along z-direction
- // nGeom[2] - the TOF strip number, 1,2,... along z-direction
- // nGeom[3] - the TOF padz number, 1,2=NPZ across a strip
- // nGeom[4] - the TOF padx number, 1,2,...,48=NPX along a strip
- // zPad, xPad - coordinates of the hit in the pad frame
- // numbering is adopted for the version 3.08 of AliRoot
- // example:
- // from Hits: sec,pla,str,padz,padx=4,2,14,2,35
- // Vol. n.0: ALIC, copy number 1
- // Vol. n.1: B077, copy number 1
- // Vol. n.2: B074, copy number 5
- // Vol. n.3: BTO2, copy number 1
- // Vol. n.4: FTOB, copy number 2
- // Vol. n.5: FLTB, copy number 0
- // Vol. n.6: FSTR, copy number 14
- // Vol. n.7: FSEN, copy number 0
- // Vol. n.8: FSEZ, copy number 2
- // Vol. n.9: FSEX, copy number 35
- // Vol. n.10: FPAD, copy number 0
-
-
- Float_t xTOF[3];
- Int_t sector=0,module=0,strip=0,padz=0,padx=0;
- Int_t i,numed,nLevel,copyNumber;
- Gcvolu_t* gcvolu;
- char name[5];
- name[4]=0;
-
- for (i=0; i<AliTOFGeometry::MaxTOFTree(); i++) nGeom[i]=0;
- zPad=100.;
- xPad=100.;
-
- xTOF[0]=x;
- xTOF[1]=y;
- xTOF[2]=z;
-
- TGeant3 * fG3Geom = (TGeant3*) gMC;
-
- fG3Geom->Gmedia(xTOF, numed);
- gcvolu=fG3Geom->Gcvolu();
- nLevel=gcvolu->nlevel;
- if(fdbg) {
- for (Int_t i=0; i<nLevel; i++) {
- strncpy(name,(char*) (&gcvolu->names[i]),4);
- cout<<"Vol. n."<<i<<": "<<name<<", copy number "<<gcvolu->number[i]<<endl;
- }
- }
- if(nLevel>=2) {
- // sector type name: B071(1,2,...,10),B074(1,2,3,4,5-PHOS),B075(1,2,3-RICH)
- strncpy(name,(char*) (&gcvolu->names[2]),4);
- // volume copy: 1,2,...,10 for B071, 1,2,3,4,5 for B074, 1,2,3 for B075
- copyNumber=gcvolu->number[2];
- if(!strcmp(name,"B071")) {
- if (copyNumber>=6 && copyNumber<=8) {
- sector=copyNumber+10;
- } else if (copyNumber>=1 && copyNumber<=5){
- sector=copyNumber+7;
- } else {
- sector=copyNumber-8;
- }
- } else if(!strcmp(name,"B075")) {
- sector=copyNumber+12;
- } else if(!strcmp(name,"B074")) {
- if (copyNumber>=1 && copyNumber<=3){
- sector=copyNumber+4;
- } else {
- sector=copyNumber-1;
- }
- }
- }
- if(sector) {
- nGeom[0]=sector;
- if(nLevel>=4) {
- // we'll use the module value in z-direction:
- // 1 2 3 4 5
- // the module order in z-direction: FTOC,FTOB,FTOA,FTOB,FTOC
- // the module copy: 2 2 0 1 1
- // module type name: FTOA, FTOB, FTOC
- strncpy(name,(char*) (&gcvolu->names[4]),4);
- // module copy:
- copyNumber=gcvolu->number[4];
- if(!strcmp(name,"FTOC")) {
- if (copyNumber==2) {
- module=1;
- } else {
- module=5;
- }
- } else if(!strcmp(name,"FTOB")) {
- if (copyNumber==2) {
- module=2;
- } else {
- module=4;
- }
- } else if(!strcmp(name,"FTOA")) {
- module=3;
- }
- }
- }
-
- if(module) {
- nGeom[1]=module;
- if(nLevel>=6) {
- // strip type name: FSTR
- strncpy(name,(char*) (&gcvolu->names[6]),4);
- // strip copy:
- copyNumber=gcvolu->number[6];
- if(!strcmp(name,"FSTR")) strip=copyNumber;
- }
- }
-
- if(strip) {
- nGeom[2]=strip;
- if(nLevel>=8) {
- // padz type name: FSEZ
- strncpy(name,(char*) (&gcvolu->names[8]),4);
- // padz copy:
- copyNumber=gcvolu->number[8];
- if(!strcmp(name,"FSEZ")) padz=copyNumber;
- }
- }
- if(padz) {
- nGeom[3]=padz;
- if(nLevel>=9) {
- // padx type name: FSEX
- strncpy(name,(char*) (&gcvolu->names[9]),4);
- // padx copy:
- copyNumber=gcvolu->number[9];
- if(!strcmp(name,"FSEX")) padx=copyNumber;
- }
- }
-
- if(padx) {
- nGeom[4]=padx;
- zPad=gcvolu->glx[2];
- xPad=gcvolu->glx[0];
- }
-
-}
-
-//__________________________________________________________________
-void AliTOFReconstructionerV2::GetGlobalXYZ(Double_t alpha, Double_t& x, Double_t& y, Double_t& /*z*/)
-{
- //
- // return the current running coordinates of
- // the track in the global reference frame
- // x, y and z have to initialized to the
- // local frame coordinates by the caller
- // alpha is the alpha coordinate in the TPC Kalman
- // reference frame
-
- // it take into account differences in between
- // TPC and TRD local coordinates frames
- if (alpha < -TMath::Pi()) alpha += 2*TMath::Pi();
- else if (alpha >= TMath::Pi()) alpha -= 2*TMath::Pi();
-
- // conversion
- Double_t tmp=x*TMath::Cos(alpha) - y*TMath::Sin(alpha);
- y=x*TMath::Sin(alpha) + y*TMath::Cos(alpha);
- x=tmp;
-}
-
-//__________________________________________________________________
-Bool_t AliTOFReconstructionerV2::DigitFinder(TArrayI *secArray, TArrayI *plaArray, TArrayI *strArray, TArrayI *pdzArray, TArrayI *pdxArray, Int_t* assignedVol, Int_t* digitTrackArray, Float_t& tdc)
-{
- //
- // Description
- // input: arrays with sectors, plates, strips, padz, padx
- // found during fine-propagation of probe tracks
- //
- // output kFALSE if signal is not found
- // kTRUE if signal is found
- // in this case the assignedVol array contains the digit volume numbers
- // and digitTrackArray the track numbers (max 3) contributing to the
- // digit
-
- Bool_t dummy=kFALSE;
- Int_t nFilledSlot=secArray->GetSize();
-
- // start loop
- Float_t maxWeight=-1.;
- Int_t indexOfMaxWeight=-1;
- for (Int_t i = 0; i < nFilledSlot; i++) {
- Int_t vol[5]; // location for a digit
- vol[0] = (*secArray)[i];
- vol[1] = (*plaArray)[i];
- vol[2] = (*strArray)[i];
- vol[3] = (*pdxArray)[i];
- vol[4] = (*pdzArray)[i];
-
- // check for digit in the current location
- if (fDigitsMap->TestHit(vol) != kEmpty) {
-
- AliTOFdigit *dig = static_cast<AliTOFdigit*>(fDigitsMap->GetHit(vol));
- Float_t adcWeight=dig->GetAdc();
- if(adcWeight > maxWeight){
- maxWeight=adcWeight;
- indexOfMaxWeight=i;
- tdc=dig->GetTdc();
- digitTrackArray=dig->GetTracks();
-
- } // if(adcWeight > maxWeight)
- } // close if (fDigitsMap->TestHit(vol) != kEmpty)
-
- } // end loop
-
- if(indexOfMaxWeight!=-1){
- assignedVol[0]=(*secArray)[indexOfMaxWeight];
- assignedVol[1]=(*plaArray)[indexOfMaxWeight];
- assignedVol[2]=(*strArray)[indexOfMaxWeight];
- assignedVol[3]=(*pdxArray)[indexOfMaxWeight];
- assignedVol[4]=(*pdzArray)[indexOfMaxWeight];
- dummy=kTRUE;
- }
-
- return dummy;
-}
-
-//__________________________________________________________________
-Int_t AliTOFReconstructionerV2::SaveTracks(const Char_t *outname, Int_t split)
-{
- //
- // save reconstructed tracks into
- // outname file
- //
- TDirectory *savedir=gDirectory;
- const Char_t *name="Writing Output";
- cerr<<'\n'<<name<<"...\n";
- gBenchmark->Start(name);
-
- TFile *out=TFile::Open(outname,"RECREATE");
- if (!out->IsOpen()) {
- cerr<<"AliTOFReconstructionerV2::SaveTracks(): ";
- cerr<<"file for TOF tracks is not open !\n";
- return 2;
- }
-
- out->cd();
- TTree T("T","tree with TOF tracks");
- T.Branch("tracks",&fTOFTracks,256000,split);
-
-
- T.Fill();
- T.Write();
- savedir->cd();
- out->Close();
- gBenchmark->Stop(name);
- gBenchmark->Show(name);
- return 0;
-}
-
-//__________________________________________________________________
-void AliTOFReconstructionerV2::Comparison(Int_t* rtIndex)
-{
- //
- // perform MC comparison
- // used also for track length
- // for the time being
- // Connect the AliRoot file containing Geometry, Kine, Hits, and Digits
-
-
- Int_t nEvent = 0;
- const char *datafile = "galice.root";
-
- AliRunLoader *rl = AliRunLoader::Open(datafile);
- if (rl == 0x0)
- {
- Error("Exec","Can not open session for file %s",datafile);
- return;
- }
- // Get AliRun object from file or create it if not on file
- rl->LoadgAlice();
- gAlice = rl->GetAliRun();
- if (gAlice)
- cout << "AliRun object found on file" << endl;
- else
- gAlice = new AliRun("gAlice","Alice test program");
-
-
- AliTOF* TOF = (AliTOF *) gAlice->GetDetector ("TOF");
-
-
-
- // Import the Trees for the event nEvent in the file
- rl->GetEvent(nEvent);
- const Int_t nparticles = rl->GetNumberOfEvents();
- if (nparticles <= 0) return;
-
- AliLoader* tofloader = rl->GetLoader("TOFLoader");
- if (tofloader == 0x0)
- {
- Error("AliTOFReconstructioner","Can not get TOF Loader from Run Loader.");
- delete rl;
- return;
- }
-
- // Get pointers to Alice detectors and Hits containers
- tofloader->LoadHits();
- Int_t ntracks = (Int_t) tofloader->TreeH()->GetEntries();
- TOF->SetTreeAddress();
- // Start loop on tracks in the hits containers
- for (Int_t track=0; track < ntracks; track++) {
-
- if(TOF) {
- for(AliTOFhitT0* tofHit = (AliTOFhitT0*)TOF->FirstHit(track);
- tofHit;
- tofHit=(AliTOFhitT0*)TOF->NextHit()) {
-
- Int_t ipart = tofHit->GetTrack();
- if(ipart >= 80000) continue;
- if(rtIndex[ipart] < 0) continue;
-
- TParticle *part = gAlice->GetMCApp()->Particle(ipart);
-
- // get first the pdg code
- Int_t pdgCode=part->GetPdgCode();
-
- // then track length
- Float_t trackLength=tofHit->GetLen(); // [cm]
-
- // update the tof TClonesArray with TOF tracks
- AliTOFTrackV2* oTOFtracks=(AliTOFTrackV2*)fTOFTracks->UncheckedAt(rtIndex[ipart]);
- oTOFtracks->UpdateTrack(pdgCode,trackLength);
-
- } // loop on hits connected to the current track
- } // if(TOF)
- } // end loop on primary tracks
-}
-
-//__________________________________________________________________
-Bool_t AliTOFReconstructionerV2::operator==(const AliTOFReconstructionerV2 & tofrecv2)const
-{
- // Equal operator.
- // Reconstructioner are equal if their fField, fNDummyTracks, fScaleSigmaFactor and fStep are equal
-
- if( (fField==tofrecv2.fField)&&(fNDummyTracks==tofrecv2.fNDummyTracks)&&(fScaleSigmaFactor==tofrecv2.fScaleSigmaFactor)&&(fStep==tofrecv2.fStep))
- return kTRUE ;
- else
- return kFALSE ;
-}
+++ /dev/null
-#ifndef ALITOFRECONSTRUCTIONERV2_H
-#define ALITOFRECONSTRUCTIONERV2_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-//_________________________________________________________________________
-// Task Class for Reconstruction V2 in TOF
-//
-//-- Author: F. Pierella
-
-
-#include "TTask.h"
-
-class AliTOFDigitMap;
-class AliTOFHitMap;
-class TClonesArray;
-class TString;
-class TTree;
-class TBranch;
-
-class AliTOFReconstructionerV2: public TTask {
-
-public:
- AliTOFReconstructionerV2() ; // ctor
- AliTOFReconstructionerV2(const char* tpcBackTracks, const char* tofDigits="digits.root");
- AliTOFReconstructionerV2(const AliTOFReconstructionerV2 & rec);
- virtual ~AliTOFReconstructionerV2() ; // dtor
- Bool_t BackPropagation(){return kTRUE;};
- //void CreateNTuple();
- void Comparison(Int_t* rtIndex); // for MC comparison
- virtual void Exec(Option_t* option); // do the main work
- Int_t GetDbgFlag() const {return fdbg;}
- const char* GetTOFDigitsFile() const {return (char*)fTOFDigitsFile.Data();}
- const char* GetTPCBackTracksFile() const {return (char*)fTPCBackTracksFile.Data();}
- void Init(Option_t* opt);
- Int_t LoadTPCTracks();
- Int_t LoadTOFDigits();
- Int_t LoadTRDTracks();
- Int_t SaveTracks(const Char_t* outname="tofTracks.root", Int_t split=0);
- void SetDbg(Int_t dbgflag) {fdbg=dbgflag;}
- void SetTOFDigitsFile(char * tofDigitsFile ) {fTOFDigitsFile=tofDigitsFile;}
- void SetTPCBackTracksFile(char * tpcBackTracksFile ){fTPCBackTracksFile=tpcBackTracksFile;}
- void SetField(Float_t field) {fField=field;}
- void SetNDummyTracks(Int_t nDummyTracks){fNDummyTracks=nDummyTracks;}
- void SetScaleSigmaFactor(Float_t factor){fScaleSigmaFactor=factor;}
- void SetStep(Float_t step) {fStep=step;}
- Bool_t operator == (const AliTOFReconstructionerV2 & tofrecv2) const ;
-
-private:
-
- Int_t fdbg; //! Flag for debug, 0 no debug, 1 debug
- AliTOFDigitMap* fDigitsMap;//! pointer to the map of TOF digits
- //AliTOFHitMap* fDigitsMap; //! pointer to the map of TOF digits
- Float_t fField; //! mag field value [Tesla]
- Int_t fNDummyTracks; // number of test tracks used to search
- // the signal on TOF
- Float_t fScaleSigmaFactor; // scale factor for sigma (common value for sigmaY and sigmaZ)
- Float_t fStep; //! step inside the TOF volumes during
- // back propagation
- TClonesArray* fTOFDigits; //! pointer to the TClonesArray with TOF digits
- TClonesArray* fTOFTracks; //! pointer to the TClonesArray with TOF tracks
- TString fTOFDigitsFile; //! file with TOF digits
- TString fTPCBackTracksFile;//! seed TPC to TOF file name
- TTree* fKalmanTree ;//! tree with reconstructed tracks in TPC
- TBranch* fBranchWithTracks;//! branch with backpropagated tracks in TPC
-
- virtual void IsInsideThePad(Float_t x, Float_t y, Float_t z, Int_t *nGeom, Float_t& zPad, Float_t& xPad);
- virtual void GetGlobalXYZ(Double_t alpha, Double_t& x, Double_t& y, Double_t& z);
- Bool_t DigitFinder(TArrayI *secArray, TArrayI *plaArray, TArrayI *strArray, TArrayI *pdzArray, TArrayI *pdxArray, Int_t* assignedVol, Int_t* digitTrackArray, Float_t& tdc);
-
- protected:
- // the class is assumed to have a streamer
- ClassDef(AliTOFReconstructionerV2,1) // Task class for TOF reconstruction V2
-
-};
-
-#endif // AliTOFRECONSTRUCTIONERV2_H
#include "AliTOFSDigitizer.h"
#include "AliTOFhit.h"
#include "AliTOFhitT0.h"
-#include "AliTOFv1.h"
-#include "AliTOFv2.h"
-#include "AliTOFv3.h"
-#include "AliTOFv4.h"
#include "AliMC.h"
ClassImp(AliTOFSDigitizer)
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-////////////////////////////////////////////////////////////////////////
-//
-// AliTOFTrack class
-//
-// Authors: Bologna-ITEP-Salerno Group
-//
-// Description: class for TPC data about extracted tracks for TPC-TOF
-// matching (cfr. TDR Section 4.4).
-// TRD tracking capabilities have been foreseen by including the member
-// variables fRxTRD and fRyTRD.
-// It is the candidate class to be written in TreeR for each event.
-//
-// Member variable summary description:
-// - track momentum and position in the last TPC padrow
-// - track length as given by the geometrical propagation
-// - reconstructed mass from time of flight
-//
-////////////////////////////////////////////////////////////////////////
-
-#include "AliTOFTrack.h"
-
-ClassImp(AliTOFTrack)
-
-AliTOFTrack::AliTOFTrack()
-{
- //
- // Default ctor
- //
- fTrack=0;
- fP=0.;
- fPdgCode=0;
- flTPC=0.;
- fRxTPC=0.;
- fRyTPC=0.;
- fRzTPC=0.;
- fPxTPC=0.;
- fPyTPC=0.;
- fPzTPC=0.;
- fRxTRD=0.;
- fRyTRD=0.;
- fPad=0;
- fMatching=0;
- fLength=-1;
- fTof=-1;
- fMassTOF=-1;
-}
-
-//_____________________________________________________________________________
-AliTOFTrack::AliTOFTrack(Int_t track, Float_t vtxMom, Int_t pdgcode, Float_t tpcTrackLen, Float_t* tpcpos, Float_t* tpcmom, Float_t* trdpos, Int_t pad, Int_t matchflag, Float_t length, Float_t tof, Float_t massTof)
-{
- //
- // par ctor
- //
- fTrack = track;
- fP = vtxMom;
- fPdgCode= pdgcode;
- flTPC = tpcTrackLen;
- fRxTPC = tpcpos[0];
- fRyTPC = tpcpos[1];
- fRzTPC = tpcpos[2];
- fPxTPC = tpcmom[0];
- fPyTPC = tpcmom[1];
- fPzTPC = tpcmom[2];
- fRxTRD = trdpos[0];
- fRyTRD = trdpos[1];
- fPad = pad;
- fMatching= matchflag;
- fLength = length;
- fTof = tof;
- fMassTOF= massTof;
-}
-
-//_____________________________________________________________________________
-void AliTOFTrack::SetTrack(Int_t track, Float_t vtxMom, Int_t pdgcode, Float_t tpcTrackLen, Float_t* tpcpos, Float_t* tpcmom, Float_t* trdpos)
-{
- //
- // setter
- //
- fTrack = track;
- fP = vtxMom;
- fPdgCode= pdgcode;
- flTPC = tpcTrackLen;
- fRxTPC = tpcpos[0];
- fRyTPC = tpcpos[1];
- fRzTPC = tpcpos[2];
- fPxTPC = tpcmom[0];
- fPyTPC = tpcmom[1];
- fPzTPC = tpcmom[2];
- fRxTRD = trdpos[0];
- fRyTRD = trdpos[1];
-}
+++ /dev/null
-#ifndef ALITOFTRACK_H
-#define ALITOFTRACK_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-//////////////////////////////////////////////////////////////
-// TOF Reconstructed track
-// AliTOFTrack class
-// (see implementation file for details)
-//
-//-- Authors: Bologna-ITEP-Salerno Group
-/////////////////////////////////////////////////////////////
-
-
-#include "TObject.h"
-
-//_______________________________________________________
-class AliTOFTrack : public TObject{
-
-public:
- AliTOFTrack();
- AliTOFTrack(Int_t track, Float_t vtxMom, Int_t pdgcode, Float_t tpcTrackLen, Float_t* tpcpos, Float_t* tpcmom, Float_t* trdpos, Int_t pad, Int_t matchflag, Float_t length, Float_t tof, Float_t massTof);
- ~AliTOFTrack(){};
- void SetTrack(Int_t track, Float_t vtxMom, Int_t pdgcode, Float_t tpcTrackLen, Float_t* tpcpos, Float_t* tpcmom, Float_t* trdpos);
- void SetTrack(Int_t track) {fTrack=track;}
- void SetP(Float_t mom) {fP=mom;}
- void SetPdgCode(Int_t pdgCode) {fPdgCode=pdgCode;}
- void SetlTPC(Float_t lTPC) {flTPC=lTPC;}
- void SetRxTPC(Float_t rxTPC) {fRxTPC=rxTPC;}
- void SetRyTPC(Float_t ryTPC) {fRyTPC=ryTPC;}
- void SetRzTPC(Float_t rzTPC) {fRzTPC=rzTPC;}
- void SetPxTPC(Float_t pxTPC) {fPxTPC=pxTPC;}
- void SetPyTPC(Float_t pyTPC) {fPyTPC=pyTPC;}
- void SetPzTPC(Float_t pzTPC) {fPzTPC=pzTPC;}
- void SetRxTRD(Float_t rxTRD) {fRxTRD=rxTRD;}
- void SetRyTRD(Float_t ryTRD) {fRyTRD=ryTRD;}
- void SetPixel(Int_t pad) {fPad=pad;}
- void SetMatching(Int_t matching) {fMatching=matching;}
- void SetLength(Float_t length) {fLength=length;}
- void SetTof(Float_t tof) {fTof=tof;}
- void SetMassTOF(Float_t massTOF) {fMassTOF=massTOF;}
-
- Int_t GetTrack() const {return fTrack;}
- Float_t GetP() const {return fP;}
- Int_t GetPdgCode() const {return fPdgCode;}
- Float_t GetlTPC() const {return flTPC;}
- Float_t GetRxTPC() const {return fRxTPC;}
- Float_t GetRyTPC() const {return fRyTPC;}
- Float_t GetRzTPC() const {return fRzTPC;}
- Float_t GetPxTPC() const {return fPxTPC;}
- Float_t GetPyTPC() const {return fPyTPC;}
- Float_t GetPzTPC() const {return fPzTPC;}
- Float_t GetRxTRD() const {return fRxTRD;}
- Float_t GetRyTRD() const {return fRyTRD;}
- Int_t GetPad() const {return fPad;}
- Int_t GetMatching()const {return fMatching;}
- Float_t GetLength() const {return fLength;}
- Float_t GetTof() const {return fTof;}
- Float_t GetMassTOF() const {return fMassTOF;}
-
-private:
- Int_t fTrack; // track number
- Float_t fP; // vertex momentum
- Int_t fPdgCode; // Geant code of particle
- Float_t flTPC; // length to TPC
- Float_t fRxTPC; // x-coordinate on TPC
- Float_t fRyTPC; // y-coordinate on TPC
- Float_t fRzTPC; // z-coordinate on TPC
- Float_t fPxTPC; // x-momentum on TPC
- Float_t fPyTPC; // y-momentum on TPC
- Float_t fPzTPC; // z-momentum on TPC
- Float_t fRxTRD; // x-coordinate on the last layer of TRD
- Float_t fRyTRD; // y-coordinate on the last layer of TRD
-// Float_t fTof; // Time of Flight [ns] smearing with RPC resolution
- Int_t fPad ; // pad number
- Int_t fMatching; // Index of TPC track - TOF pixel matching
- Float_t fLength ; // Track length [cm] from the origin to the TOF [cm]
- Float_t fTof; // Time [ns] determined by pixel matched with the track
- Float_t fMassTOF; // Mass [GeV] determined by fTOF,fLength,fPx,...
-
- ClassDef(AliTOFTrack,1) // TOF Reconstructed track
-};
-
-#endif /* ALITOFTRACK_H */
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-////////////////////////////////////////////////////////////////////////
-//
-// AliTOFTrackV2 class
-//
-// Author: F. Pierella | pierella@bo.infn.it
-//
-// Description: output of AliTOFReconstructionerV2
-// TRD tracking capabilities have been foreseen by including the member
-// variables fxTRD, fyTRD, fzTRD and momentum components fPxTRD, fPyTRD, fPzTRD.
-// Class to be written in TreeR for each event.
-//
-// Member variable summary description:
-// - track momentum and position in the last TPC padrow
-// - track length as given by the geometrical propagation
-// - reconstructed mass from time of flight and time of flight itself
-// - fMatchingStatus
-// -2 backpropagation goes out of the z acceptance of the TOF
-// -1 failed backpropagation on TOF inner radius
-// 0 for fake tracks
-// 1 for tracks matched with no signal on TOF (failed DigitFinder)
-// 3 for tracks matched with the actual digit
-// 4 for tracks matched with a wrong (not its own) TOF digit
-////////////////////////////////////////////////////////////////////////
-
-#include "AliTOFTrackV2.h"
-
-ClassImp(AliTOFTrackV2)
-
-AliTOFTrackV2::AliTOFTrackV2()
-{
- //
- // Default ctor
- //
- fTrackLabel=-1;
- fTOFDigitTrackLabel=-1;
- fPTPC=-1;
- fPdgCode=-1;
- fdEdX=-1;
- fxTPC=-1;
- fyTPC=-1;
- fzTPC=-1;
- fPtTPC=-1;
- fPzTPC=-1;
- fxTRD=-1;
- fyTRD=-1;
- fzTRD=-1;
- fPxTRD=-1;
- fPyTRD=-1;
- fPzTRD=-1;
- fMatchingStatus=-1;
- fLength=-1;
- fTof=-1;
- fMassTOF=-1;
- // vertex variables from reconstruction
- fXRecVtx=-1;
- fYRecVtx=-1;
- fZRecVtx=-1;
- fPxRecVtx=-1;
- fPyRecVtx=-1;
- fPzRecVtx=-1;
- fRecTrackLength=-1;
-}
-
-//_____________________________________________________________________________
-AliTOFTrackV2::AliTOFTrackV2(Int_t trackLabel, Int_t matchingStatus,
- Float_t tpcMom, Float_t dEdX, Float_t* tpcXYZ,
- Float_t* tpcPtPz, Float_t* /* trdXYZ */,
- Float_t* /* trdPxPyPz */)
-{
- //
- // par ctor
- //
-
- fTrackLabel=trackLabel;
- fTOFDigitTrackLabel=-1;
- fPTPC=tpcMom;
- fPdgCode=-1;
-
- fdEdX=dEdX;
- fxTPC=tpcXYZ[0];
- fyTPC=tpcXYZ[1];
- fzTPC=tpcXYZ[2];
- fPtTPC=tpcPtPz[0];
- fPzTPC=tpcPtPz[1];
-
- fxTRD=-1;
- fyTRD=-1;
- fzTRD=-1;
- fPxTRD=-1;
- fPyTRD=-1;
- fPzTRD=-1;
-
- fMatchingStatus=matchingStatus;
- fLength=-1;
- fTof=-1;
- fMassTOF=-1;
-
- // vertex variables from reconstruction
- fXRecVtx=-1;
- fYRecVtx=-1;
- fZRecVtx=-1;
- fPxRecVtx=-1;
- fPyRecVtx=-1;
- fPzRecVtx=-1;
- fRecTrackLength=-1;
-}
-
-//_____________________________________________________________________________
-void AliTOFTrackV2::UpdateTrack(Int_t tofDigitTrackLabel, Int_t matching, Float_t tof)
-{
- //
- // update the track after the TOF digit assignment
- //
- fTOFDigitTrackLabel=tofDigitTrackLabel;
- fMatchingStatus=matching;
- fTof=tof;
-}
-
-//_____________________________________________________________________________
-void AliTOFTrackV2::UpdateTrack(Int_t pdgCode, Float_t trackLength)
-{
- //
- // update the track
- //
- fPdgCode=pdgCode;
- fLength=trackLength;
-}
+++ /dev/null
-#ifndef ALITOFTRACKV2_H
-#define ALITOFTRACKV2_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-//////////////////////////////////////////////////////////////
-// TOF Reconstructed track
-// AliTOFTrackV2 class
-// (see implementation file for details)
-//
-//-- Author: F. Pierella
-/////////////////////////////////////////////////////////////
-
-
-#include "TObject.h"
-
-//_______________________________________________________
-class AliTOFTrackV2 : public TObject{
-
- public:
- AliTOFTrackV2();
- AliTOFTrackV2(Int_t trackLabel, Int_t matchingStatus, Float_t tpcMom, Float_t dEdX, Float_t* tpcXYZ, Float_t* tpcPtPz, Float_t* trdXYZ, Float_t* trdPxPyPz);
- ~AliTOFTrackV2(){};
-
- void AddRecLength(Float_t deltaRecLength) {fRecTrackLength+=deltaRecLength;}
- void UpdateTrack(Int_t tofDigitTrackLabel, Int_t matching, Float_t tof);
- void UpdateTrack(Int_t pdgCode, Float_t trackLength);
-
- void SetTrackLabel(Int_t trackLabel) {fTrackLabel=trackLabel;}
- void SetTOFDigitTrackLabel(Int_t tofDigitTrackLabel) {fTOFDigitTrackLabel=tofDigitTrackLabel;}
- void SetPTPC(Float_t tpcMom) {fPTPC=tpcMom;}
- void SetPdgCode(Int_t pdgCode) {fPdgCode=pdgCode;}
- void SetdEdX(Float_t dEdX) {fdEdX=dEdX;}
- void SetxTPC(Float_t xTPC) {fxTPC=xTPC;}
- void SetyTPC(Float_t yTPC) {fyTPC=yTPC;}
- void SetzTPC(Float_t zTPC) {fzTPC=zTPC;}
- void SetPtTPC(Float_t ptTPC) {fPtTPC=ptTPC;}
- void SetPzTPC(Float_t pzTPC) {fPzTPC=pzTPC;}
- void SetxTRD(Float_t xTRD) {fxTRD=xTRD;}
- void SetyTRD(Float_t yTRD) {fyTRD=yTRD;}
- void SetzTRD(Float_t zTRD) {fzTRD=zTRD;}
- void SetPxTRD(Float_t pxTRD) {fPxTRD=pxTRD;}
- void SetPyTRD(Float_t pyTRD) {fPyTRD=pyTRD;}
- void SetPzTRD(Float_t pzTRD) {fPzTRD=pzTRD;}
- void SetMatchingStatus(Int_t matching) {fMatchingStatus=matching;}
- void SetLength(Float_t length) {fLength=length;}
- void SetRecLength(Float_t rlength) {fRecTrackLength=rlength;}
- void SetTof(Float_t tof) {fTof=tof;}
- void SetMassTOF(Float_t massTOF) {fMassTOF=massTOF;}
- void SetVertex(Float_t xvtx,Float_t yvtx,Float_t zvtx) {fXRecVtx=xvtx; fYRecVtx=yvtx; fZRecVtx=zvtx;}
- void SetMomVertex(Float_t pxvtx,Float_t pyvtx,Float_t pzvtx) {fPxRecVtx=pxvtx; fPyRecVtx=pyvtx; fPzRecVtx=pzvtx;}
-
- Int_t GetTrackLabel() const {return fTrackLabel;}
- Int_t GetTOFDigitTrackLabel() const {return fTOFDigitTrackLabel;}
- Float_t GetPTPC() const {return fPTPC;}
- Int_t GetPdgCode() const {return fPdgCode;}
- Float_t GetdEdX() const {return fdEdX;}
- Float_t GetxTPC() const {return fxTPC;}
- Float_t GetyTPC() const {return fyTPC;}
- Float_t GetzTPC() const {return fzTPC;}
- Float_t GetPtTPC() const {return fPtTPC;}
- Float_t GetPzTPC() const {return fPzTPC;}
- Float_t GetxTRD() const {return fxTRD;}
- Float_t GetyTRD() const {return fyTRD;}
- Float_t GetzTRD() const {return fzTRD;}
- Float_t GetPxTRD() const {return fPxTRD;}
- Float_t GetPyTRD() const {return fPyTRD;}
- Float_t GetPzTRD() const {return fPzTRD;}
- Int_t GetMatchingStatus() const {return fMatchingStatus;}
- Float_t GetLength() const {return fLength;}
- Float_t GetRecLength() const {return fRecTrackLength;}
- Float_t GetTof() const {return fTof;}
- Float_t GetMassTOF() const {return fMassTOF;}
- Float_t GetXVtx() const {return fXRecVtx;}
- Float_t GetYVtx() const {return fYRecVtx;}
- Float_t GetZVtx() const {return fZRecVtx;}
- Float_t GetPxVtx() const {return fPxRecVtx;}
- Float_t GetPyVtx() const {return fPyRecVtx;}
- Float_t GetPzVtx() const {return fPzRecVtx;}
-
- private:
- Int_t fTrackLabel; // track label (rt->GetLabel()) as coming from TPC reconstruction
- Int_t fTOFDigitTrackLabel; // track label stored into the TOF digit
- // assigned to the track
- Float_t fPTPC; // momentum as given by reconstruction in TPC
- Int_t fPdgCode; // PDG code of the particle (for MC events)
- Float_t fdEdX; // total amount of loss energy in TPC and ITS
- Float_t fxTPC; // x-coordinate on TPC
- Float_t fyTPC; // y-coordinate on TPC
- Float_t fzTPC; // z-coordinate on TPC
- Float_t fPtTPC; // pt at the end of TPC
- Float_t fPzTPC; // pz-momentum at the end of TPC
- Float_t fxTRD; // x-coordinate on the last layer of TRD
- Float_t fyTRD; // y-coordinate on the last layer of TRD
- Float_t fzTRD; // y-coordinate on the last layer of TRD
- Float_t fPxTRD; // x-momentum at the end of TRD
- Float_t fPyTRD; // y-momentum at the end of TRD
- Float_t fPzTRD; // z-momentum at the end of TRD
- Int_t fMatchingStatus; // matching status (not only for MC events)
- // see details in the implementation file
- Float_t fLength ; // Track length [cm] from the origin to the TOF [cm]
- // GEANT track length to be compared with that coming from
- // reconstruction in order to evaluate the resolution
- Float_t fTof; // Time [ns] determined by the TOF digit assigned to the track
- Float_t fMassTOF; // Mass [GeV] determined by fTOF,fLength, and reconstructed momentum in TPC
- Float_t fXRecVtx; // x component of the reconstructed vertex position MRF
- Float_t fYRecVtx; // y component of the reconstructed vertex position MRF
- Float_t fZRecVtx; // z component of the reconstructed vertex position MRF
- Float_t fPxRecVtx; // x component of the reconstructed vertex momentum MRF
- Float_t fPyRecVtx; // y component of the reconstructed vertex momentum MRF
- Float_t fPzRecVtx; // z component of the reconstructed vertex momentum MRF
- Float_t fRecTrackLength; // reconstructed track length (coarse)
-
- ClassDef(AliTOFTrackV2,2) // TOF Reconstructed track
-};
-
-#endif /* ALITOFTRACKV2_H */
#include "AliESDtrack.h"
#include "AliTOFdigit.h"
#include "AliTOFGeometry.h"
+#include <Riostream.h>
#include <stdlib.h>
//
// The main constructor
//
- fR=378.;
- fDy=AliTOFGeometry::XPad(); fDz=AliTOFGeometry::ZPad();
fN=0; fEventN=0;
fSigma=param[0];
}
-//_________________________________________________________________________
-Int_t AliTOFpidESD::LoadClusters(TTree *dTree, AliTOFGeometry *geom) {
- //--------------------------------------------------------------------
- //This function loads the TOF clusters
- //--------------------------------------------------------------------
- TBranch *branch=dTree->GetBranch("TOF");
- if (!branch) {
- Error("LoadClusters"," can't get the branch with the TOF digits !\n");
- return 1;
- }
-
- TClonesArray dummy("AliTOFdigit",10000), *digits=&dummy;
- branch->SetAddress(&digits);
-
- dTree->GetEvent(0);
- Int_t nd=digits->GetEntriesFast();
- Info("LoadClusters","number of digits: %d",nd);
-
- for (Int_t i=0; i<nd; i++) {
- AliTOFdigit *d=(AliTOFdigit*)digits->UncheckedAt(i);
- Int_t dig[5]; Float_t g[3];
- dig[0]=d->GetSector();
- dig[1]=d->GetPlate();
- dig[2]=d->GetStrip();
- dig[3]=d->GetPadz();
- dig[4]=d->GetPadx();
-
- geom->GetPos(dig,g);
-
- Double_t h[5];
- h[0]=TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
- h[1]=TMath::ATan2(g[1],g[0]); h[2]=g[2];
- h[3]=d->GetTdc(); h[4]=d->GetAdc();
-
- AliTOFcluster *cl=new AliTOFcluster(h,d->GetTracks(),i);
- InsertCluster(cl);
- }
-
- return 0;
-}
-
-//_________________________________________________________________________
-void AliTOFpidESD::UnloadClusters() {
- //--------------------------------------------------------------------
- //This function unloads TOF clusters
- //--------------------------------------------------------------------
- for (Int_t i=0; i<fN; i++) delete fClusters[i];
- fN=0;
-}
-
-//_________________________________________________________________________
-Int_t AliTOFpidESD::InsertCluster(AliTOFcluster *c) {
- //--------------------------------------------------------------------
- //This function adds a cluster to the array of clusters sorted in Z
- //--------------------------------------------------------------------
- if (fN==kMaxCluster) {
- Error("InsertCluster","Too many clusters !\n");
- return 1;
- }
-
- if (fN==0) {fClusters[fN++]=c; return 0;}
- Int_t i=FindClusterIndex(c->GetZ());
- memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTOFcluster*));
- fClusters[i]=c; fN++;
-
- return 0;
-}
-
-//_________________________________________________________________________
-Int_t AliTOFpidESD::FindClusterIndex(Double_t z) const {
- //--------------------------------------------------------------------
- // This function returns the index of the nearest cluster
- //--------------------------------------------------------------------
- if (fN==0) return 0;
- if (z <= fClusters[0]->GetZ()) return 0;
- if (z > fClusters[fN-1]->GetZ()) return fN;
- Int_t b=0, e=fN-1, m=(b+e)/2;
- for (; b<e; m=(b+e)/2) {
- if (z > fClusters[m]->GetZ()) b=m+1;
- else e=m;
- }
- return m;
-}
-
-static int cmp(const void *p1, const void *p2) {
- AliESDtrack *t1=*((AliESDtrack**)p1);
- AliESDtrack *t2=*((AliESDtrack**)p2);
- Double_t c1[15]; t1->GetExternalCovariance(c1);
- Double_t c2[15]; t2->GetExternalCovariance(c2);
- if (c1[0]*c1[2] <c2[0]*c2[2]) return -1;
- if (c1[0]*c1[2]==c2[0]*c2[2]) return 0;
- return 1;
-}
-
//_________________________________________________________________________
Int_t AliTOFpidESD::MakePID(AliESD *event)
{
0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
};
+ Int_t nPID=0;
Int_t ntrk=event->GetNumberOfTracks();
AliESDtrack **tracks=new AliESDtrack*[ntrk];
AliESDtrack *t=event->GetTrack(i);
tracks[i]=t;
}
- qsort(tracks,ntrk,sizeof(AliESDtrack*),cmp);
- Int_t nmatch=0;
for (i=0; i<ntrk; i++) {
AliESDtrack *t=tracks[i];
-
- if ((t->GetStatus()&AliESDtrack::kTRDout)==0) continue;
- if ((t->GetStatus()&AliESDtrack::kTRDStop)!=0) continue;
-
- Double_t time[10]; t->GetIntegratedTimes(time);
-
- Double_t x,par[5]; t->GetExternalParameters(x,par);
- Double_t cov[15]; t->GetExternalCovariance(cov);
-
-Double_t dphi=(5*TMath::Sqrt(cov[0]) + 0.5*fDy + 2.5*TMath::Abs(par[2]))/fR;
-Double_t dz=5*TMath::Sqrt(cov[2]) + 0.5*fDz + 2.5*TMath::Abs(par[3]);
-
- Double_t phi=TMath::ATan2(par[0],x) + t->GetAlpha();
- if (phi<-TMath::Pi()) phi+=2*TMath::Pi();
- if (phi>=TMath::Pi()) phi-=2*TMath::Pi();
- Double_t z=par[1];
-
- Double_t d2max=1000.;
- Int_t index=-1;
- for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
- AliTOFcluster *c=fClusters[k];
-
- if (c->GetZ() > z+dz) break;
- if (c->IsUsed()) continue;
-
- Double_t tof=50*c->GetTDC()+32;
- if (t->GetIntegratedLength()/tof > 0.031) continue;
- if (tof>35000) continue;
-
- Double_t dph=TMath::Abs(c->GetPhi()-phi);
- if (dph>TMath::Pi()) dph=2*TMath::Pi()-dph; //Thanks to B.Zagreev
- if (dph>dphi) continue;
-
- Double_t d2=dph*dph*fR*fR + (c->GetZ()-z)*(c->GetZ()-z);
- if (d2 > d2max) continue;
-
- d2max=d2;
- index=k;
- }
-
- if (index<0) {
- //Info("MakePID","matching failed ! %d",TMath::Abs(t->GetLabel()));
- continue;
- }
-
- nmatch++;
-
- AliTOFcluster *c=fClusters[index];
- c->Use();
-
- Double_t tof=50*c->GetTDC()+32; // in ps
- t->SetTOFsignal(tof);
- t->SetTOFcluster(c->GetIndex());
-
+ if ((t->GetStatus()&AliESDtrack::kTOFout)==0) continue;
if ((t->GetStatus()&AliESDtrack::kTIME)==0) continue;
-
- //track length correction
- Double_t rc=TMath::Sqrt(c->GetR()*c->GetR() + c->GetZ()*c->GetZ());
- Double_t rt=TMath::Sqrt(x*x + par[0]*par[0] + par[1]*par[1]);
- Double_t dlt=rc-rt;
-
+ Double_t tof=t->GetTOFsignal();
+ Double_t time[10]; t->GetIntegratedTimes(time);
Double_t p[10];
Double_t mom=t->GetP();
+ nPID++;
for (Int_t j=0; j<AliESDtrack::kSPECIES; j++) {
Double_t mass=kMasses[j];
Double_t dpp=0.01; //mean relative pt resolution;
if (mom>0.5) dpp=0.01*mom;
Double_t sigma=dpp*time[j]/(1.+ mom*mom/(mass*mass));
sigma=TMath::Sqrt(sigma*sigma + fSigma*fSigma);
-
- time[j]+=dlt/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom;
-
if (TMath::Abs(tof-time[j]) > fRange*sigma) {
p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
continue;
}
p[j]=TMath::Exp(-0.5*(tof-time[j])*(tof-time[j])/(sigma*sigma))/sigma;
}
- /*
- if (c->GetLabel(0)!=TMath::Abs(t->GetLabel())) {
- cerr<<"Wrong matching: "<<t->GetLabel()<<endl;
- continue;
- }
- */
t->SetTOFpid(p);
-
}
- Info("MakePID","Number of matched ESD track: %d",nmatch);
-
delete[] tracks;
-
+
return 0;
}
//-------------------------------------------------------
// TOF PID class
-// A very naive design... Should be made better by the detector experts...
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------
class AliTOFpidESD : public TObject {
enum {kMaxCluster=77777}; //maximal number of the TOF clusters
public:
- AliTOFpidESD(){fR=376.; fDy=2.5; fDz=3.5; fN=0; fEventN=0;}
+ AliTOFpidESD(){fN=0; fEventN=0;}
AliTOFpidESD(Double_t *param);
- ~AliTOFpidESD(){UnloadClusters();}
+ ~AliTOFpidESD(){}
Int_t MakePID(AliESD *event);
- Int_t LoadClusters(TTree *f, AliTOFGeometry *geom);
- void UnloadClusters();
- void SetEventNumber(Int_t n) {fEventN=n;}
-
+ void SetEventNumber(Int_t n) {fEventN=n;}
Int_t GetEventNumber() const {return fEventN;}
-public:
- class AliTOFcluster {
- public:
- AliTOFcluster(Double_t *h, Int_t *l,Int_t idx) {
- fR=h[0]; fPhi=h[1]; fZ=h[2]; fTDC=h[3]; fADC=h[4];
- fLab[0]=l[0]; fLab[1]=l[1]; fLab[2]=l[2];
- fIdx=idx;
- }
- void Use() {fADC=-fADC;}
-
- Double_t GetR() const {return fR;}
- Double_t GetPhi() const {return fPhi;}
- Double_t GetZ() const {return fZ;}
- Double_t GetTDC() const {return fTDC;}
- Double_t GetADC() const {return TMath::Abs(fADC);}
- Int_t IsUsed() const {return (fADC<0) ? 1 : 0;}
- Int_t GetLabel(Int_t n) const {return fLab[n];}
- Int_t GetIndex() const {return fIdx;}
- private:
- Int_t fLab[3]; //track labels
- Double_t fR; //r-coordinate
- Double_t fPhi; //phi-coordinate
- Double_t fZ; //z-coordinate
- Double_t fTDC; //TDC count
- Double_t fADC; //ADC count
- Int_t fIdx; //index of this cluster
- };
-
private:
- Int_t InsertCluster(AliTOFcluster *c);
- Int_t FindClusterIndex(Double_t z) const;
-
- Int_t fEventN; //event number
-
- Double_t fR; // mean readius of the TOF barrel
- Double_t fDy; // size of the TOF cell in R*Phi
- Double_t fDz; // size of the TOF cell in Z
-
+
+ Int_t fN; // number of the TOF clusters
+ Int_t fEventN; // event number
Double_t fSigma; // intrinsic TOF resolution
Double_t fRange; // one particle type PID range (in sigmas)
- Int_t fN; // number of the TOF clusters
- AliTOFcluster *fClusters[kMaxCluster]; // pointers to the TOF clusters
-
ClassDef(AliTOFpidESD,1) // TOF PID class
};
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+#include <Riostream.h>
+#include <TObject.h>
+#include "AliTOFGeometry.h"
+#include "AliTOFtrack.h"
+#include "AliESDtrack.h"
+
+ClassImp(AliTOFtrack)
+
+//_____________________________________________________________________________
+AliTOFtrack::AliTOFtrack(const AliTOFtrack& t) : AliKalmanTrack(t) {
+ //
+ // Copy constructor.
+ //
+
+ SetSeedIndex(t.GetSeedIndex());
+ SetLabel(t.GetLabel());
+ fSeedLab=t.GetSeedLabel();
+ SetChi2(t.GetChi2());
+
+ fAlpha=t.fAlpha;
+ fX=t.fX;
+
+ fY=t.fY; fZ=t.fZ; fE=t.fE; fT=t.fT; fC=t.fC;
+
+ fCyy=t.fCyy;
+ fCzy=t.fCzy; fCzz=t.fCzz;
+ fCey=t.fCey; fCez=t.fCez; fCee=t.fCee;
+ fCty=t.fCty; fCtz=t.fCtz; fCte=t.fCte; fCtt=t.fCtt;
+ fCcy=t.fCcy; fCcz=t.fCcz; fCce=t.fCce; fCct=t.fCct; fCcc=t.fCcc;
+
+
+}
+
+//_____________________________________________________________________________
+AliTOFtrack::AliTOFtrack(const AliESDtrack& t)
+ :AliKalmanTrack() {
+ //
+ // Constructor from AliESDtrack
+ //
+
+ SetSeedIndex(-1);
+ SetLabel(t.GetLabel());
+ SetChi2(0.);
+ SetMass(t.GetMass());
+
+ fAlpha = t.GetAlpha();
+ if (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi();
+ else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi();
+ Double_t x, p[5]; t.GetExternalParameters(x,p);
+
+ fX=x;
+
+ x = GetConvConst();
+
+ fY=p[0];
+ fZ=p[1];
+ fT=p[3];
+ fC=p[4]/x;
+ fE=fC*fX - p[2];
+
+ //Conversion of the covariance matrix
+ Double_t c[15]; t.GetExternalCovariance(c);
+
+ c[10]/=x; c[11]/=x; c[12]/=x; c[13]/=x; c[14]/=x*x;
+
+ Double_t c22=fX*fX*c[14] - 2*fX*c[12] + c[5];
+ Double_t c32=fX*c[13] - c[8];
+ Double_t c20=fX*c[10] - c[3], c21=fX*c[11] - c[4], c42=fX*c[14] - c[12];
+
+ fCyy=c[0 ];
+ fCzy=c[1 ]; fCzz=c[2 ];
+ fCey=c20; fCez=c21; fCee=c22;
+ fCty=c[6 ]; fCtz=c[7 ]; fCte=c32; fCtt=c[9 ];
+ fCcy=c[10]; fCcz=c[11]; fCce=c42; fCct=c[13]; fCcc=c[14];
+
+ if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return;
+ StartTimeIntegral();
+ Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
+ SetIntegratedLength(t.GetIntegratedLength());
+
+
+}
+//____________________________________________________________________________
+void AliTOFtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const {
+ //
+ // This function returns external TOF track representation
+ //
+ xr=fX;
+ x[0]=GetY();
+ x[1]=GetZ();
+ x[2]=GetSnp();
+ x[3]=GetTgl();
+ x[4]=Get1Pt();
+}
+
+//_____________________________________________________________________________
+void AliTOFtrack::GetExternalCovariance(Double_t cc[15]) const {
+ //
+ // This function returns external representation of the covriance matrix.
+ //
+ Double_t a=GetConvConst();
+ Double_t c22=fX*fX*fCcc-2*fX*fCce+fCee;
+ Double_t c32=fX*fCct-fCte;
+ Double_t c20=fX*fCcy-fCey, c21=fX*fCcz-fCez, c42=fX*fCcc-fCce;
+
+ cc[0 ]=fCyy;
+ cc[1 ]=fCzy; cc[2 ]=fCzz;
+ cc[3 ]=c20; cc[4 ]=c21; cc[5 ]=c22;
+ cc[6 ]=fCty; cc[7 ]=fCtz; cc[8 ]=c32; cc[9 ]=fCtt;
+ cc[10]=fCcy*a; cc[11]=fCcz*a; cc[12]=c42*a; cc[13]=fCct*a; cc[14]=fCcc*a*a;
+
+}
+
+
+//_____________________________________________________________________________
+void AliTOFtrack::GetCovariance(Double_t cc[15]) const {
+
+ cc[0]=fCyy;
+ cc[1]=fCzy; cc[2]=fCzz;
+ cc[3]=fCey; cc[4]=fCez; cc[5]=fCee;
+ cc[6]=fCcy; cc[7]=fCcz; cc[8]=fCce; cc[9]=fCcc;
+ cc[10]=fCty; cc[11]=fCtz; cc[12]=fCte; cc[13]=fCct; cc[14]=fCtt;
+
+}
+
+
+//_____________________________________________________________________________
+Int_t AliTOFtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho)
+{
+ // Propagates a track of particle with mass=pm to a reference plane
+ // defined by x=xk through media of density=rho and radiationLength=x0
+
+ if (xk == fX) return 1;
+
+ if (TMath::Abs(fC*xk - fE) >= 0.90000) {
+ return 0;
+ }
+
+ // track Length measurement [SR, GSI, 17.02.2003]
+
+ Double_t oldX = fX, oldY = fY, oldZ = fZ;
+
+ Double_t x1=fX, x2=x1+(xk-x1), dx=x2-x1, y1=fY, z1=fZ;
+ Double_t c1=fC*x1 - fE;
+ if((c1*c1) > 1){
+ return 0;}
+ Double_t r1=sqrt(1.- c1*c1);
+ Double_t c2=fC*x2 - fE;
+ if((c2*c2) > 1) {
+ return 0;
+ }
+ Double_t r2=sqrt(1.- c2*c2);
+
+ fY += dx*(c1+c2)/(r1+r2);
+ fZ += dx*(c1+c2)/(c1*r2 + c2*r1)*fT;
+
+ //f = F - 1
+ Double_t rr=r1+r2, cc=c1+c2, xx=x1+x2;
+ Double_t f02=-dx*(2*rr + cc*(c1/r1 + c2/r2))/(rr*rr);
+ Double_t f04= dx*(rr*xx + cc*(c1*x1/r1+c2*x2/r2))/(rr*rr);
+ Double_t cr=c1*r2+c2*r1;
+ Double_t f12=-dx*fT*(2*cr + cc*(c2*c1/r1-r1 + c1*c2/r2-r2))/(cr*cr);
+ Double_t f13= dx*cc/cr;
+ Double_t f14=dx*fT*(cr*xx-cc*(r1*x2-c2*c1*x1/r1+r2*x1-c1*c2*x2/r2))/(cr*cr);
+
+ //b = C*ft
+ Double_t b00=f02*fCey + f04*fCcy, b01=f12*fCey + f14*fCcy + f13*fCty;
+ Double_t b10=f02*fCez + f04*fCcz, b11=f12*fCez + f14*fCcz + f13*fCtz;
+ Double_t b20=f02*fCee + f04*fCce, b21=f12*fCee + f14*fCce + f13*fCte;
+ Double_t b30=f02*fCte + f04*fCct, b31=f12*fCte + f14*fCct + f13*fCtt;
+ Double_t b40=f02*fCce + f04*fCcc, b41=f12*fCce + f14*fCcc + f13*fCct;
+
+ //a = f*b = f*C*ft
+ Double_t a00=f02*b20+f04*b40,a01=f02*b21+f04*b41,a11=f12*b21+f14*b41+f13*b31;
+
+ //F*C*Ft = C + (a + b + bt)
+ fCyy += a00 + 2*b00;
+ fCzy += a01 + b01 + b10;
+ fCey += b20;
+ fCty += b30;
+ fCcy += b40;
+ fCzz += a11 + 2*b11;
+ fCez += b21;
+ fCtz += b31;
+ fCcz += b41;
+
+ fX=x2;
+
+ //Multiple scattering ******************
+ Double_t d=sqrt((x1-fX)*(x1-fX)+(y1-fY)*(y1-fY)+(z1-fZ)*(z1-fZ));
+ Double_t p2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
+ Double_t beta2=p2/(p2 + GetMass()*GetMass());
+ Double_t theta2=14.1*14.1/(beta2*p2*1e6)*d/x0*rho;
+
+ Double_t ey=fC*fX - fE, ez=fT;
+ Double_t xz=fC*ez, zz1=ez*ez+1, xy=fE+ey;
+
+ fCee += (2*ey*ez*ez*fE+1-ey*ey+ez*ez+fE*fE*ez*ez)*theta2;
+ fCte += ez*zz1*xy*theta2;
+ fCtt += zz1*zz1*theta2;
+ fCce += xz*ez*xy*theta2;
+ fCct += xz*zz1*theta2;
+ fCcc += xz*xz*theta2;
+ /*
+ Double_t dc22 = (1-ey*ey+xz*xz*fX*fX)*theta2;
+ Double_t dc32 = (xz*fX*zz1)*theta2;
+ Double_t dc33 = (zz1*zz1)*theta2;
+ Double_t dc42 = (xz*fX*xz)*theta2;
+ Double_t dc43 = (zz1*xz)*theta2;
+ Double_t dc44 = (xz*xz)*theta2;
+ fCee += dc22;
+ fCte += dc32;
+ fCtt += dc33;
+ fCce += dc42;
+ fCct += dc43;
+ fCcc += dc44;
+ */
+ //Energy losses************************
+ if((5940*beta2/(1-beta2+1e-10) - beta2) < 0){return 0;}
+
+ Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2+1e-10)) - beta2)*d*rho;
+ if (x1 < x2) dE=-dE;
+ cc=fC;
+ fC*=(1.- sqrt(p2+GetMass()*GetMass())/p2*dE);
+ fE+=fX*(fC-cc);
+
+ // track time measurement [SR, GSI 17.02.2002]
+ if (x1 < x2)
+ if (IsStartedTimeIntegral()) {
+ Double_t l2 = (fX-oldX)*(fX-oldX) + (fY-oldY)*(fY-oldY) + (fZ-oldZ)*(fZ-oldZ);
+ AddTimeStep(TMath::Sqrt(l2));
+ }
+
+ return 1;
+}
+
+//_____________________________________________________________________________
+Int_t AliTOFtrack::PropagateToInnerTOF( Bool_t holes)
+{
+ // Propagates a track of particle with mass=pm to a reference plane
+ // defined by x=xk through media of density=rho and radiationLength=x0
+
+
+ Double_t ymax=AliTOFGeometry::RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
+ Bool_t skip = kFALSE;
+ Double_t y=this->GetYat(AliTOFGeometry::RinTOF(),skip);
+ if(skip){
+ return 0;
+ }
+ if (y > ymax) {
+ if (!this->Rotate(AliTOFGeometry::GetAlpha())) {
+ return 0;
+ }
+ } else if (y <-ymax) {
+ if (!this->Rotate(-AliTOFGeometry::GetAlpha())) {
+ return 0;
+ }
+ }
+
+
+ Double_t x = this->GetX();
+ Int_t nsteps=Int_t((370.-x)/0.5); // 0.5 cm Steps
+ for (Int_t istep=0;istep<nsteps;istep++){
+ Float_t xp = x+istep*0.5;
+ Double_t param[2];
+ this->GetPropagationParameters(holes,param);
+ this->PropagateTo(xp,param[0],param[1]);
+
+ }
+
+ if(!this->PropagateTo(AliTOFGeometry::RinTOF()))return 0;
+
+ return 1;
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTOFtrack::Rotate(Double_t alpha)
+{
+ // Rotates track parameters in R*phi plane
+
+
+ fAlpha += alpha;
+ if (fAlpha<-TMath::Pi()) fAlpha += 2*TMath::Pi();
+ if (fAlpha>=TMath::Pi()) fAlpha -= 2*TMath::Pi();
+
+ Double_t x1=fX, y1=fY;
+ Double_t ca=cos(alpha), sa=sin(alpha);
+ Double_t r1=fC*fX - fE;
+
+ fX = x1*ca + y1*sa;
+ fY =-x1*sa + y1*ca;
+ if((r1*r1) > 1) return 0;
+ fE=fE*ca + (fC*y1 + sqrt(1.- r1*r1))*sa;
+
+ Double_t r2=fC*fX - fE;
+ if (TMath::Abs(r2) >= 0.90000) {
+ cerr<<" AliTOFtrack warning: Rotation failed !\n";
+ return 0;
+ }
+
+ if((r2*r2) > 1) return 0;
+ Double_t y0=fY + sqrt(1.- r2*r2)/fC;
+ if ((fY-y0)*fC >= 0.) {
+ cerr<<" AliTOFtrack warning: Rotation failed !!!\n";
+ return 0;
+ }
+
+ //f = F - 1
+ Double_t f00=ca-1, f24=(y1 - r1*x1/sqrt(1.- r1*r1))*sa,
+ f20=fC*sa, f22=(ca + sa*r1/sqrt(1.- r1*r1))-1;
+
+ //b = C*ft
+ Double_t b00=fCyy*f00, b02=fCyy*f20+fCcy*f24+fCey*f22;
+ Double_t b10=fCzy*f00, b12=fCzy*f20+fCcz*f24+fCez*f22;
+ Double_t b20=fCey*f00, b22=fCey*f20+fCce*f24+fCee*f22;
+ Double_t b30=fCty*f00, b32=fCty*f20+fCct*f24+fCte*f22;
+ Double_t b40=fCcy*f00, b42=fCcy*f20+fCcc*f24+fCce*f22;
+
+ //a = f*b = f*C*ft
+ Double_t a00=f00*b00, a02=f00*b02, a22=f20*b02+f24*b42+f22*b22;
+
+ //F*C*Ft = C + (a + b + bt)
+ fCyy += a00 + 2*b00;
+ fCzy += b10;
+ fCey += a02+b20+b02;
+ fCty += b30;
+ fCcy += b40;
+ fCez += b12;
+ fCte += b32;
+ fCee += a22 + 2*b22;
+ fCce += b42;
+
+ return 1;
+}
+
+
+
+//_________________________________________________________________________
+void AliTOFtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const
+{
+ // Returns reconstructed track momentum in the global system.
+
+ Double_t pt=TMath::Abs(GetPt()); // GeV/c
+ Double_t r=fC*fX-fE;
+
+ Double_t y0;
+ if(r > 1) { py = pt; px = 0; }
+ else if(r < -1) { py = -pt; px = 0; }
+ else {
+ y0=fY + sqrt(1.- r*r)/fC;
+ px=-pt*(fY-y0)*fC; //cos(phi);
+ py=-pt*(fE-fX*fC); //sin(phi);
+ }
+ pz=pt*fT;
+ Double_t tmp=px*TMath::Cos(fAlpha) - py*TMath::Sin(fAlpha);
+ py=px*TMath::Sin(fAlpha) + py*TMath::Cos(fAlpha);
+ px=tmp;
+
+}
+
+//_________________________________________________________________________
+void AliTOFtrack::GetGlobalXYZ(Double_t& x, Double_t& y, Double_t& z) const
+{
+ // Returns reconstructed track coordinates in the global system.
+
+ x = fX; y = fY; z = fZ;
+ Double_t tmp=x*TMath::Cos(fAlpha) - y*TMath::Sin(fAlpha);
+ y=x*TMath::Sin(fAlpha) + y*TMath::Cos(fAlpha);
+ x=tmp;
+
+}
+
+//_________________________________________________________________________
+void AliTOFtrack::ResetCovariance() {
+ //
+ // Resets covariance matrix
+ //
+
+ fCyy*=10.;
+ fCzy=0.; fCzz*=10.;
+ fCey=0.; fCez=0.; fCee*=10.;
+ fCty=0.; fCtz=0.; fCte=0.; fCtt*=10.;
+ fCcy=0.; fCcz=0.; fCce=0.; fCct=0.; fCcc*=10.;
+}
+
+
+//_________________________________________________________________________
+void AliTOFtrack::ResetCovariance(Float_t mult) {
+ //
+ // Resets covariance matrix
+ //
+
+ fCyy*=mult;
+ fCzy*=0.; fCzz*=mult;
+ fCey*=0.; fCez*=0.; fCee*=mult;
+ fCty*=0.; fCtz*=0.; fCte*=0.; fCtt*=mult;
+ fCcy*=0.; fCcz*=0.; fCce*=0.; fCct*=0.; fCcc*=mult;
+}
+
+//_____________________________________________________________________________
+Int_t AliTOFtrack::Compare(const TObject *o) const {
+ //-----------------------------------------------------------------
+ // This function compares tracks according to the their curvature
+ //-----------------------------------------------------------------
+ AliTOFtrack *t=(AliTOFtrack*)o;
+ Double_t co=t->GetSigmaY2()*t->GetSigmaZ2();
+ Double_t c =GetSigmaY2()*GetSigmaZ2();
+ if (c>co) return 1;
+ else if (c<co) return -1;
+ return 0;
+}
+
+//_____________________________________________________________________________
+void AliTOFtrack::GetPropagationParameters(Bool_t holes, Double_t *param) {
+
+
+ Double_t thetamin = (90.-31.1) * TMath::Pi()/180.;
+ Double_t thetamax = (90.+31.1) * TMath::Pi()/180.;
+
+ Double_t zmin = -55.;
+ Double_t zmax = 55.;
+
+ Double_t rTPC = 261.53;
+ Double_t rTPCTRD = 294.5;
+ Double_t rTRD = 369.1;
+
+ Double_t x0TPC = 40.;
+ Double_t rhoTPC =0.06124;
+
+ Double_t x0Air = 36.66;
+ Double_t rhoAir =1.2931e-3;
+
+ Double_t x0TRD = 171.7;
+ Double_t rhoTRD =0.33;
+
+ Int_t isec = this->GetSector();
+ Double_t xtr,ytr,ztr;
+ this->GetGlobalXYZ(xtr,ytr,ztr);
+ Float_t thetatr = TMath::ATan2(TMath::Sqrt(xtr*xtr+ytr*ytr),ztr);
+
+ if(holes){
+ if (isec == 0 || isec == 1 || isec == 2 ) {
+ if( thetatr>=thetamin && thetatr<=thetamax){
+ x0TRD= x0Air;
+ rhoTRD = rhoAir;
+ }
+ }
+ if (isec == 11 || isec == 12 || isec == 13 || isec == 14 || isec == 15 ) {
+ if( ztr>=zmin && ztr<=zmax){
+ x0TRD= x0Air;
+ rhoTRD = rhoAir;
+ }
+ }
+ }
+
+ if(this->GetX() <= rTPC)
+ {param[0]=x0TPC;param[1]=rhoTPC;}
+ else if(this->GetX() > rTPC && this->GetX() < rTPCTRD)
+ {param[0]=x0Air;param[1]=rhoAir;}
+ else if(this->GetX() >= rTPCTRD && this->GetX() < rTRD)
+ {param[0]=x0TRD;param[1]=rhoTRD;}
+ else if(this->GetX() >= rTRD )
+ {param[0]=x0Air;param[1]=rhoAir;}
+
+}
--- /dev/null
+#ifndef ALITOFTRACK_H
+#define ALITOFTRACK_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+#include <AliKalmanTrack.h>
+#include <TMath.h>
+#include "AliTOFGeometry.h"
+#include "TVector2.h"
+
+class AliESDtrack;
+class AliTOFtrack : public AliKalmanTrack {
+
+// Represents reconstructed TOF track
+
+public:
+
+ AliTOFtrack():AliKalmanTrack(){}
+ AliTOFtrack(const AliTOFtrack& t);
+ AliTOFtrack(const AliESDtrack& t);
+
+
+ Double_t GetAlpha() const {return fAlpha;}
+ Int_t GetSector() const {
+ return Int_t(TVector2::Phi_0_2pi(fAlpha)/AliTOFGeometry::GetAlpha())%AliTOFGeometry::NSectors();}
+
+ Double_t GetC() const {return fC;}
+ void GetCovariance(Double_t cov[15]) const;
+ Double_t GetEta() const {return fE;}
+
+ void GetExternalCovariance(Double_t cov[15]) const ;
+ void GetExternalParameters(Double_t& xr, Double_t x[5]) const ;
+ Double_t GetSigmaY2() const {return fCyy;}
+ Double_t GetSigmaZ2() const {return fCzz;}
+
+ Double_t Get1Pt() const {return (1e-9*TMath::Abs(fC)/fC + fC)*GetConvConst();}
+ Double_t GetP() const {
+ return TMath::Abs(GetPt())*sqrt(1.+GetTgl()*GetTgl());
+ }
+ Double_t GetPt() const {return 1./Get1Pt();}
+ void GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const ;
+ void GetGlobalXYZ(Double_t &x, Double_t &y, Double_t &z) const ;
+ Int_t GetSeedLabel() const { return fSeedLab; }
+ Int_t GetSeedIndex() const { return fSeedInd; }
+ void SetSeedLabel(Int_t lab) { fSeedLab=lab; }
+ void SetSeedIndex(Int_t ind) { fSeedInd=ind; }
+ Double_t GetSnp() const {return fX*fC - fE;}
+ Double_t GetTgl() const {return fT;}
+ Double_t GetX() const {return fX;}
+ Double_t GetY() const {return fY;}
+ Double_t GetZ() const {return fZ;}
+
+ Int_t Compare(const TObject *o) const;
+
+
+ Double_t GetYat(Double_t xk, Bool_t skip) const {
+//-----------------------------------------------------------------
+// This function calculates the Y-coordinate of a track at the plane x=xk.
+// Needed for matching with the TOF (I.Belikov)
+//-----------------------------------------------------------------
+ skip=kFALSE;
+ Double_t c1=fC*fX - fE, r1=TMath::Sqrt(TMath::Abs(1.- c1*c1));
+ Double_t c2=fC*xk - fE, r2=TMath::Sqrt(TMath::Abs(1.- c2*c2));
+ if( ((1.- c2*c2)<0) || ((1.- c1*c1)<0) ) skip=kTRUE;
+ return fY + (xk-fX)*(c1+c2)/(r1+r2);
+ }
+
+
+ Int_t PropagateTo(Double_t xr, Double_t x0=8.72, Double_t rho=5.86e-3);
+ Int_t PropagateToInnerTOF(Bool_t holes);
+ void ResetCovariance();
+ void ResetCovariance(Float_t mult);
+ Int_t Rotate(Double_t angle);
+
+
+
+protected:
+
+
+ Int_t fSeedInd; // ESD seed track index
+ Int_t fSeedLab; // track label taken from seeding
+ Double_t fAlpha; // rotation angle
+ Double_t fX; // running local X-coordinate of the track (time bin)
+
+ Double_t fY; // Y-coordinate of the track
+ Double_t fZ; // Z-coordinate of the track
+ Double_t fE; // C*x0
+ Double_t fT; // tangent of the track momentum dip angle
+ Double_t fC; // track curvature
+
+ Double_t fCyy; // covariance
+ Double_t fCzy, fCzz; // matrix
+ Double_t fCey, fCez, fCee; // of the
+ Double_t fCty, fCtz, fCte, fCtt; // track
+ Double_t fCcy, fCcz, fCce, fCct, fCcc; // parameters
+
+ private:
+
+ void GetPropagationParameters(Bool_t holes, Double_t *param);
+
+ ClassDef(AliTOFtrack,0) // TOF reconstructed tracks
+
+};
+
+#endif
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
-/* $Id$ */
+// AliTOFtracker Class
+// Task: Perform association of the ESD tracks to TOF Clusters
+// and Update ESD track with associated TOF Cluster parameters
+//
+// -- Authors : S. Arcelli, C. Zampolli (Bologna University and INFN)
+// -- Contacts: Annalisa.De.Caro@cern.ch
+// -- : Chiara.Zampolli@bo.infn.it
+// -- : Silvia.Arcelli@bo.infn.it
+//--------------------------------------------------------------------
#include "AliTOFtracker.h"
-
+#include "AliTOFtrack.h"
+#include "TClonesArray.h"
+#include "TError.h"
+#include "AliTOFdigit.h"
+#include "AliTOFGeometry.h"
+#include "AliTOF.h"
+#include "AliRun.h"
+#include "AliModule.h"
ClassImp(AliTOFtracker)
+//_____________________________________________________________________________
+AliTOFtracker::AliTOFtracker(AliTOFGeometry * geom, Double_t parPID[2]) {
+ //AliTOFtracker main Ctor
+
+ fHoles=true;
+ fNseeds=0;
+ fNseedsTOF=0;
+ fngoodmatch=0;
+ fnbadmatch=0;
+ fnunmatch=0;
+ fnmatch=0;
+ fGeom = geom;
+ fTOFpid = new AliTOFpidESD(parPID);
+ fR=378.;
+ fTOFHeigth=15.3;
+ fdCut=3.;
+ fDy=AliTOFGeometry::XPad();
+ fDz=AliTOFGeometry::ZPad();
+ fDx=1.5;
+ fSeeds=0x0;
+ fTracks=0x0;
+ fN=0;
+ Init(); // temporary solution to know about Holes/no Holes
+}
+//_____________________________________________________________________________
+AliTOFtracker::AliTOFtracker(const AliTOFtracker &t):AliTracker() {
+ //AliTOFtracker copy Ctor
+
+ fHoles=t.fHoles;
+ fNseeds=t.fNseeds;
+ fNseedsTOF=t.fNseedsTOF;
+ fngoodmatch=t.fngoodmatch;
+ fnbadmatch=t.fnbadmatch;
+ fnunmatch=t.fnunmatch;
+ fnmatch=t.fnmatch;
+ fGeom = t.fGeom;
+ fTOFpid = t.fTOFpid;
+ fR=t.fR;
+ fTOFHeigth=t.fTOFHeigth;
+ fdCut=t.fdCut;
+ fDy=t.fDy;
+ fDz=t.fDz;
+ fDx=1.5;
+ fSeeds=t.fSeeds;
+ fTracks=t.fTracks;
+ fN=t.fN;
+}
+//_____________________________________________________________________________
+void AliTOFtracker::Init() {
+
+// temporary solution to know about Holes/no Holes, will be implemented as
+// an AliTOFGeometry getter
+
+ AliModule* frame=gAlice->GetModule("FRAME");
+
+ if(!frame) {
+ Error("Init","Could Not load FRAME! Assume Frame with Holes \n");
+ fHoles=true;
+ } else{
+ if(frame->IsVersion()==1) {fHoles=false;}
+ else {fHoles=true;}
+ }
+}
+//_____________________________________________________________________________
+Int_t AliTOFtracker::PropagateBack(AliESD* event) {
+ //
+ // Gets seeds from ESD event and Match with TOF Clusters
+ //
+
+
+ //Initialise some counters
+
+ fNseeds=0;
+ fNseedsTOF=0;
+ fngoodmatch=0;
+ fnbadmatch=0;
+ fnunmatch=0;
+ fnmatch=0;
+
+ Int_t ntrk=event->GetNumberOfTracks();
+ fNseeds = ntrk;
+ fSeeds= new TClonesArray("AliESDtrack");
+ TClonesArray &aESDTrack = *fSeeds;
+
+
+ //Load ESD tracks into a local Array of ESD Seeds
+
+ for (Int_t i=0; i<fNseeds; i++) {
+ AliESDtrack *t=event->GetTrack(i);
+ new(aESDTrack[i]) AliESDtrack(*t);
+ }
+
+ //Prepare ESD tracks candidates for TOF Matching
+ CollectESD();
+
+ //First Step with Strict Matching Criterion
+ MatchTracks(kFALSE);
+
+ //Second Step with Looser Matching Criterion
+ MatchTracks(kTRUE);
+
+ Info("PropagateBack","Number of matched tracks: %d",fnmatch);
+ Info("PropagateBack","Number of good matched tracks: %d",fngoodmatch);
+ Info("PropagateBack","Number of bad matched tracks: %d",fnbadmatch);
+
+ //Update the matched ESD tracks
+
+ for (Int_t i=0; i<ntrk; i++) {
+ AliESDtrack *t=event->GetTrack(i);
+ AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
+ if(seed->GetTOFsignal()>0){
+ t->SetTOFsignal(seed->GetTOFsignal());
+ t->SetTOFcluster(seed->GetTOFcluster());
+ AliTOFtrack *track = new AliTOFtrack(*seed);
+ t->UpdateTrackParams(track,AliESDtrack::kTOFout);
+ delete track;
+ }
+ }
+
+
+ //Make TOF PID
+ fTOFpid->MakePID(event);
+
+ delete fSeeds;
+ delete fTracks;
+ return 0;
+
+}
+//_________________________________________________________________________
+void AliTOFtracker::CollectESD() {
+ //prepare the set of ESD tracks to be matched to clusters in TOF
+
+ fTracks= new TClonesArray("AliTOFtrack");
+ TClonesArray &aTOFTrack = *fTracks;
+ for (Int_t i=0; i<fNseeds; i++) {
+
+ AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
+ if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
+
+ // TRD good tracks, already propagated at 371 cm
+
+ if (
+ ((t->GetStatus()&AliESDtrack::kTRDout)!=0) &&
+ ((t->GetStatus()&AliESDtrack::kTRDStop)==0)){
+ AliTOFtrack *track = new AliTOFtrack(*t);
+ track->SetSeedIndex(i);
+ t->UpdateTrackParams(track,AliESDtrack::kTOFout);
+ new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
+ fNseedsTOF++;
+ delete track;
+ }
+
+ // Propagate the rest of TPCbp
+
+ else {
+ AliTOFtrack *track = new AliTOFtrack(*t);
+ if(track->PropagateToInnerTOF(fHoles)){ // temporary solution
+ // if(track->PropagateToInnerTOF(fGeom->GetHoles())){
+ track->SetSeedIndex(i);
+ t->UpdateTrackParams(track,AliESDtrack::kTOFout);
+ new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
+ fNseedsTOF++;
+ }
+ delete track;
+ }
+ }
+
+ // Sort according uncertainties on track position
+ fTracks->Sort();
+
+}
+//_________________________________________________________________________
+void AliTOFtracker::MatchTracks( Bool_t mLastStep){
+
+ //Match ESD tracks to clusters in TOF
+
+ static const Double_t kMasses[]={
+ 0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
+ };
+
+ Int_t nSteps=(Int_t)(fTOFHeigth/0.1);
+
+ for (Int_t i=0; i<fNseedsTOF; i++) {
+
+ AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(i);
+ AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
+ AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
+ if(t->GetTOFsignal()>0. )continue;
+
+ // Some init
+
+ Int_t index[10000];
+ Float_t dist[10000];
+ Float_t cxpos[10000];
+ Float_t crecL[10000];
+ Float_t trackPos[4][nSteps];
+
+ // Determine a window around the track
+
+ Double_t x,par[5];
+ trackTOFin->GetExternalParameters(x,par);
+ Double_t cov[15];
+ trackTOFin->GetExternalCovariance(cov);
+ Float_t scalefact=3.;
+ Double_t dphi=
+ scalefact*
+ ((5*TMath::Sqrt(cov[0]) + 0.5*fDy + 2.5*TMath::Abs(par[2]))/fR);
+ Double_t dz=
+ scalefact*
+ (5*TMath::Sqrt(cov[2]) + 0.5*fDz + 2.5*TMath::Abs(par[3]));
+
+ Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
+ if (phi<-TMath::Pi())phi+=2*TMath::Pi();
+ if (phi>=TMath::Pi())phi-=2*TMath::Pi();
+ Double_t z=par[1];
+
+ Int_t clind[6][fN];
+ Int_t nc=0;
+
+ // find the clusters in the window of the track
+
+ for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
+ AliTOFcluster *c=fClusters[k];
+ if (c->GetZ() > z+dz) break;
+ if (c->IsUsed()) continue;
+
+ Double_t dph=TMath::Abs(c->GetPhi()-phi);
+ if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
+ if (fabs(dph)>dphi) continue;
+
+ clind[0][nc] = c->GetDetInd(0);
+ clind[1][nc] = c->GetDetInd(1);
+ clind[2][nc] = c->GetDetInd(2);
+ clind[3][nc] = c->GetDetInd(3);
+ clind[4][nc] = c->GetDetInd(4);
+ clind[5][nc] = k;
+ nc++;
+ }
+
+ //start fine propagation
+
+ Int_t nStepsDone = 0;
+ for( Int_t istep=0; istep<nSteps; istep++){
+
+ Float_t xs=AliTOFGeometry::RinTOF()+istep*0.1;
+ Double_t ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
+
+ Bool_t skip=kFALSE;
+ Double_t ysect=trackTOFin->GetYat(xs,skip);
+ if(skip)break;
+ if (ysect > ymax) {
+ if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
+ break;
+ }
+ } else if (ysect <-ymax) {
+ if (!trackTOFin->Rotate(-AliTOFGeometry::GetAlpha())) {
+ break;
+ }
+ }
+
+ if(!trackTOFin->PropagateTo(xs)) {
+ break;
+ }
+
+ nStepsDone++;
+
+ // store the running point (Globalrf) - fine propagation
+
+ Double_t x,y,z;
+ trackTOFin->GetGlobalXYZ(x,y,z);
+ trackPos[0][istep]= (Float_t) x;
+ trackPos[1][istep]= (Float_t) y;
+ trackPos[2][istep]= (Float_t) z;
+ trackPos[3][istep]= trackTOFin->GetIntegratedLength();
+ }
+
+
+ Int_t nfound = 0;
+ for (Int_t istep=0; istep<nStepsDone; istep++) {
+
+ Bool_t isInside =kFALSE;
+ Float_t ctrackPos[3];
+
+ ctrackPos[0]= trackPos[0][istep];
+ ctrackPos[1]= trackPos[1][istep];
+ ctrackPos[2]= trackPos[2][istep];
+
+ //now see whether the track matches any of the TOF clusters
+
+ for (Int_t i=0; i<nc; i++){
+ Int_t cind[5];
+ cind[0]= clind[0][i];
+ cind[1]= clind[1][i];
+ cind[2]= clind[2][i];
+ cind[3]= clind[3][i];
+ cind[4]= clind[4][i];
+ Bool_t accept = kFALSE;
+ if( mLastStep)accept = (fGeom->DistanceToPad(cind,ctrackPos)<fdCut);
+ if(!mLastStep)accept = (fGeom->IsInsideThePad(cind,ctrackPos));
+ if(accept){
+ if(!mLastStep)isInside=kTRUE;
+ dist[nfound]=fGeom->DistanceToPad(cind,ctrackPos);
+ crecL[nfound]=trackPos[3][istep];
+ index[nfound]=clind[5][i]; // store cluster id
+ cxpos[nfound]=AliTOFGeometry::RinTOF()+istep*0.1; //store prop.radius
+ nfound++;
+ if(isInside)break;
+ }//end if accept
+ } //end for on the clusters
+ if(isInside)break;
+ } //end for on the steps
+
+ if (nfound == 0 ) {
+ fnunmatch++;
+ continue;
+ }
+
+ fnmatch++;
+
+ // now choose the cluster to be matched with the track.
+
+ Int_t idclus=0;
+ Float_t recL = 0.;
+ Float_t xpos=0.;
+ Float_t mindist=1000.;
+ for (Int_t iclus= 0; iclus<nfound;iclus++){
+ if (dist[iclus]< mindist){
+ mindist = dist[iclus];
+ xpos = cxpos[iclus];
+ idclus =index[iclus];
+ recL=crecL[iclus]+fDx*0.5;
+ }
+ }
+
+ AliTOFcluster *c=fClusters[idclus];
+ c->Use();
+
+ // Track length correction for matching Step 2
+
+ if(mLastStep){
+ Float_t rc=TMath::Sqrt(c->GetR()*c->GetR() + c->GetZ()*c->GetZ());
+ Float_t rt=TMath::Sqrt(trackPos[0][70]*trackPos[0][70]
+ +trackPos[1][70]*trackPos[1][70]
+ +trackPos[2][70]*trackPos[2][70]);
+ Float_t dlt=rc-rt;
+ recL=trackPos[3][70]+dlt;
+ }
+
+ if (
+ (c->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
+ ||
+ (c->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
+ ||
+ (c->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
+ ) {
+ fngoodmatch++;
+ }
+ else{
+ fnbadmatch++;
+ }
+
+ delete trackTOFin;
+
+ Double_t tof=50*c->GetTDC()+32; // in ps
+ t->SetTOFsignal(tof);
+ t->SetTOFcluster(c->GetIndex());
+ Double_t time[10]; t->GetIntegratedTimes(time);
+ Double_t mom=t->GetP();
+ for(Int_t j=0;j<=5;j++){
+ Double_t mass=kMasses[j];
+ time[j]+=(recL-trackPos[3][0])/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom;
+ }
+
+ AliTOFtrack *trackTOFout = new AliTOFtrack(*t);
+ trackTOFout->PropagateTo(xpos);
+ t->UpdateTrackParams(trackTOFout,AliESDtrack::kTOFout);
+ t->SetIntegratedLength(recL);
+ t->SetIntegratedTimes(time);
+
+ delete trackTOFout;
+ }
+}
+//_________________________________________________________________________
+Int_t AliTOFtracker::LoadClusters(TTree *dTree) {
+ //--------------------------------------------------------------------
+ //This function loads the TOF clusters
+ //--------------------------------------------------------------------
+
+ TBranch *branch=dTree->GetBranch("TOF");
+ if (!branch) {
+ Error("LoadClusters"," can't get the branch with the TOF digits !\n");
+ return 1;
+ }
+
+ TClonesArray dummy("AliTOFdigit",10000), *digits=&dummy;
+ branch->SetAddress(&digits);
+
+ dTree->GetEvent(0);
+ Int_t nd=digits->GetEntriesFast();
+ Info("LoadClusters","number of digits: %d",nd);
+
+ for (Int_t i=0; i<nd; i++) {
+ AliTOFdigit *d=(AliTOFdigit*)digits->UncheckedAt(i);
+ Int_t dig[5]; Float_t g[3];
+ dig[0]=d->GetSector();
+ dig[1]=d->GetPlate();
+ dig[2]=d->GetStrip();
+ dig[3]=d->GetPadz();
+ dig[4]=d->GetPadx();
+
+ fGeom->GetPos(dig,g);
+
+ Double_t h[5];
+ h[0]=TMath::Sqrt(g[0]*g[0]+g[1]*g[1]);
+ h[1]=TMath::ATan2(g[1],g[0]); h[2]=g[2];
+ h[3]=d->GetTdc(); h[4]=d->GetAdc();
+
+ AliTOFcluster *cl=new AliTOFcluster(h,d->GetTracks(),dig,i);
+ InsertCluster(cl);
+ }
+
+ return 0;
+}
+//_________________________________________________________________________
+void AliTOFtracker::UnloadClusters() {
+ //--------------------------------------------------------------------
+ //This function unloads TOF clusters
+ //--------------------------------------------------------------------
+ for (Int_t i=0; i<fN; i++) delete fClusters[i];
+ fN=0;
+}
+
+//_________________________________________________________________________
+Int_t AliTOFtracker::InsertCluster(AliTOFcluster *c) {
+ //--------------------------------------------------------------------
+ //This function adds a cluster to the array of clusters sorted in Z
+ //--------------------------------------------------------------------
+ if (fN==kMaxCluster) {
+ Error("InsertCluster","Too many clusters !\n");
+ return 1;
+ }
+
+ if (fN==0) {fClusters[fN++]=c; return 0;}
+ Int_t i=FindClusterIndex(c->GetZ());
+ memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTOFcluster*));
+ fClusters[i]=c; fN++;
+
+ return 0;
+}
+
+//_________________________________________________________________________
+Int_t AliTOFtracker::FindClusterIndex(Double_t z) const {
+ //--------------------------------------------------------------------
+ // This function returns the index of the nearest cluster
+ //--------------------------------------------------------------------
+ if (fN==0) return 0;
+ if (z <= fClusters[0]->GetZ()) return 0;
+ if (z > fClusters[fN-1]->GetZ()) return fN;
+ Int_t b=0, e=fN-1, m=(b+e)/2;
+ for (; b<e; m=(b+e)/2) {
+ if (z > fClusters[m]->GetZ()) b=m+1;
+ else e=m;
+ }
+ return m;
+}
+
#define ALITOFTRACKER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+// AliTOFtracker Class
+// Task: Perform association of the ESD tracks to TOF Clusters
+// and Update ESD track with associated TOF Cluster parameters
+//
+// -- Authors : S. Arcelli, C. Zampolli (Bologna University and INFN)
+// -- Contacts: Annalisa.De.Caro@cern.ch
+// -- : Chiara.Zampolli@bo.infn.it
+// -- : Silvia.Arcelli@bo.infn.it
+//--------------------------------------------------------------------
/* $Id$ */
#include "AliTracker.h"
#include "AliTOFpidESD.h"
+#include "AliESD.h"
+#include "TClonesArray.h"
class AliTOFGeometry;
-
class AliTOFtracker : public AliTracker {
+
+enum {kMaxCluster=77777}; //maximal number of the TOF clusters
+
public:
- AliTOFtracker(AliTOFGeometry* geom, Double_t parPID[2])
- {fGeom = geom; fTOFpid = new AliTOFpidESD(parPID);};
+ AliTOFtracker(AliTOFGeometry* geom, Double_t parPID[2]);
+ AliTOFtracker(const AliTOFtracker &t); //Copy Ctor
virtual ~AliTOFtracker() {delete fTOFpid;}
virtual Int_t Clusters2Tracks(AliESD* /*event*/) {return -1;};
- virtual Int_t PropagateBack(AliESD* event) {return fTOFpid->MakePID(event);};
+ virtual Int_t PropagateBack(AliESD* event);
virtual Int_t RefitInward(AliESD* /*event*/) {return -1;};
-
- virtual Int_t LoadClusters(TTree* tree)
- {return fTOFpid->LoadClusters(tree, fGeom);};
- virtual void UnloadClusters() {fTOFpid->UnloadClusters();};
+ virtual Int_t LoadClusters(TTree *dTree); // Loading Clusters from Digits
+ virtual void UnloadClusters();// UnLoad Clusters
virtual AliCluster *GetCluster(Int_t /*index*/) const {return NULL;};
+public:
+ class AliTOFcluster {
+ public:
+ AliTOFcluster(Double_t *h, Int_t *l, Int_t *ind, Int_t idx) {
+ fR=h[0]; fPhi=h[1]; fZ=h[2]; fTDC=h[3]; fADC=h[4];
+ fLab[0]=l[0]; fLab[1]=l[1]; fLab[2]=l[2];
+ fIdx=idx;
+ fdetIndex[0]=ind[0];
+ fdetIndex[1]=ind[1];
+ fdetIndex[2]=ind[2];
+ fdetIndex[3]=ind[3];
+ fdetIndex[4]=ind[4];
+ }
+ void Use() {fADC=-fADC;}
+
+ Double_t GetR() const {return fR;} // Cluster Radius
+ Double_t GetPhi() const {return fPhi;} // Cluster Phi
+ Double_t GetZ() const {return fZ;} // Cluster Z
+ Double_t GetTDC() const {return fTDC;} // Cluster ToF
+ Double_t GetADC() const {return TMath::Abs(fADC);} // Cluster Charge
+ Int_t IsUsed() const {return (fADC<0) ? 1 : 0;} // Flagging
+ Int_t GetLabel(Int_t n) const {return fLab[n];} // Labels of tracks in Cluster
+ Int_t GetDetInd(Int_t n) const {return fdetIndex[n];} //Cluster Det Indeces
+ Int_t GetIndex() const {return fIdx;} // Cluster Index
+
+ private:
+
+ Int_t fLab[3]; //track labels
+ Int_t fIdx; //index of this cluster
+ Int_t fdetIndex[5]; //Cluster detector Indeces (plate,strip,..)
+ Double_t fR; //r-coordinate
+ Double_t fPhi; //phi-coordinate
+ Double_t fZ; //z-coordinate
+ Double_t fTDC; //TDC count
+ Double_t fADC; //ADC count
+
+ };
+
private:
- AliTOFpidESD* fTOFpid; // TOF PID
- AliTOFGeometry* fGeom; // TOF geometry
- ClassDef(AliTOFtracker, 1) // TOF tracker (wrapper for AliTOFpidESD)
+ Int_t InsertCluster(AliTOFcluster *c); // Fills TofClusters Array
+ Int_t FindClusterIndex(Double_t z) const; // Returns cluster index
+ void MatchTracks(Bool_t mLastStep); // Matching Algorithm
+ void CollectESD(); // Select starting Set for Matching
+ void Init();
+
+ AliTOFGeometry* fGeom; // Pointer to TOF geometry
+ AliTOFpidESD* fTOFpid; // Pointer to TOF PID
+ AliTOFcluster *fClusters[kMaxCluster]; // pointers to the TOF clusters
+
+ Bool_t fHoles; // flag for Geometry Version(w/wo Holes) temporary!
+ Int_t fN; // Number of Clusters
+ Int_t fNseeds; // Number of track seeds
+ Int_t fNseedsTOF; // TPC BP tracks
+ Int_t fngoodmatch; // Correctly matched tracks
+ Int_t fnbadmatch; // Wrongly matched tracks
+ Int_t fnunmatch; // Unmatched tracks
+ Int_t fnmatch; // Total matched tracks
+
+ Float_t fR; // Intermediate radius in TOF, used in matching
+ Float_t fTOFHeigth; // Inner TOF radius for propagation
+ Float_t fdCut; // Cut on minimum distance track-pad in matching
+ Float_t fDx; // Pad Size in X
+ Float_t fDy; // Pad Size in Y (== X TOF convention)
+ Float_t fDz; // Pad Size in Z
+ TClonesArray* fTracks; //! pointer to the TClonesArray with TOF tracks
+ TClonesArray* fSeeds; //! pointer to the TClonesArray with ESD tracks
+
+ ClassDef(AliTOFtracker, 1) // TOF tracker
};
#endif
cout << " TOF with Holes for PHOS " << endl;
fTOFHoles=true;}
}
+ fTOFGeometry->SetHoles(fTOFHoles);
}
//____________________________________________________________________________
if(gMC->GetMedium()==idtmed[513] &&
gMC->IsTrackEntering() && gMC->TrackCharge()
&& gMC->CurrentVolID(copy)==fIdSens)
- {
+ {
+
+ AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+
// getting information about hit volumes
padzid=gMC->CurrentVolOffID(2,copy);
#pragma link C++ class AliTOFSDigit+;
#pragma link C++ class AliTOFHitMap+;
#pragma link C++ class AliTOFPad+;
-#pragma link C++ class AliTOFTrack+;
+#pragma link C++ class AliTOFtrack+;
#pragma link C++ class AliTOFRecHit+;
-#pragma link C++ class AliTOFTrackV2+;
-#pragma link C++ class AliTOFReconstructionerV2+;
#pragma link C++ class AliTOFDigitMap+;
#pragma link C++ class AliTOFpidESD+;
SRCS = AliTOF.cxx AliTOFGeometry.cxx AliTOFv4T0.cxx AliTOFhit.cxx AliTOFhitT0.cxx \
AliTOFPID.cxx AliTOFT0.cxx AliTOFdigit.cxx AliTOFRawSector.cxx AliTOFRoc.cxx \
AliTOFRawDigit.cxx AliTOFDigitizer.cxx AliTOFSDigitizer.cxx AliTOFMerger.cxx \
- AliTOFSDigit.cxx AliTOFHitMap.cxx AliTOFPad.cxx AliTOFRecHit.cxx AliTOFTrack.cxx \
- AliTOFProb.cxx AliTOFTrackV2.cxx AliTOFReconstructionerV2.cxx \
- AliTOFDigitMap.cxx AliTOFpidESD.cxx AliTOFtracker.cxx
+ AliTOFSDigit.cxx AliTOFHitMap.cxx AliTOFPad.cxx AliTOFRecHit.cxx AliTOFtrack.cxx \
+ AliTOFProb.cxx AliTOFDigitMap.cxx AliTOFpidESD.cxx AliTOFtracker.cxx
HDRS:= $(SRCS:.cxx=.h)