* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-// 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 <Rtypes.h>
+
+//--------------------------------------------------------------------//
+// //
+// 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 "Rtypes.h"
#include "TClonesArray.h"
+#include "TGeoManager.h"
+#include "TTree.h"
+#include "AliAlignObj.h"
+#include "AliESDtrack.h"
+#include "AliESD.h"
#include "AliLog.h"
-#include "AliRun.h"
-#include "AliModule.h"
+#include "AliTrackPointArray.h"
+#include "AliTOFcalib.h"
#include "AliTOFcluster.h"
-#include "AliTOFtrack.h"
#include "AliTOFGeometry.h"
#include "AliTOFtracker.h"
+#include "AliTOFtrack.h"
-
-#include "AliTrackPointArray.h"
-#include "AliAlignObj.h"
-#include "AliTOFcalib.h"
+extern TGeoManager *gGeoManager;
ClassImp(AliTOFtracker)
//_____________________________________________________________________________
-AliTOFtracker::AliTOFtracker(AliTOFGeometry * geom, Double_t parPID[2]) {
+AliTOFtracker::AliTOFtracker(AliTOFGeometry * geom, Double_t parPID[2]):
+ fGeom(geom),
+ fTOFpid(new AliTOFpidESD(parPID)),
+ fHoles(kFALSE),
+ fN(0),
+ fNseeds(0),
+ fNseedsTOF(0),
+ fngoodmatch(0),
+ fnbadmatch(0),
+ fnunmatch(0),
+ fnmatch(0),
+ fR(378.),
+ fTOFHeigth(15.3),
+ fdCut(3.),
+ fDx(1.5),
+ fDy(0),
+ fDz(0),
+ fDzMax(35.),
+ fDyMax(50.),
+ fTracks(0x0),
+ fSeeds(0x0)
+ {
//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;
- fDzMax=35.;
- fDyMax=50.;
- fSeeds=0x0;
- fTracks=0x0;
- fN=0;
fHoles = fGeom->GetHoles();
}
//_____________________________________________________________________________
-AliTOFtracker::AliTOFtracker(const AliTOFtracker &t):AliTracker() {
+AliTOFtracker::AliTOFtracker(const AliTOFtracker &t):
+ AliTracker(),
+ fGeom(0x0),
+ fTOFpid(0x0),
+ fHoles(kFALSE),
+ fN(0),
+ fNseeds(0),
+ fNseedsTOF(0),
+ fngoodmatch(0),
+ fnbadmatch(0),
+ fnunmatch(0),
+ fnmatch(0),
+ fR(378.),
+ fTOFHeigth(15.3),
+ fdCut(3.),
+ fDx(1.5),
+ fDy(0),
+ fDz(0),
+ fDzMax(35.),
+ fDyMax(50.),
+ fTracks(0x0),
+ fSeeds(0x0)
+ {
//AliTOFtracker copy Ctor
fHoles=t.fHoles;
fTracks=t.fTracks;
fN=t.fN;
}
+
+//_____________________________________________________________________________
+AliTOFtracker& AliTOFtracker::operator=(const AliTOFtracker &t)
+{
+ //AliTOFtracker assignment operator
+
+ this->fHoles=t.fHoles;
+ this->fNseeds=t.fNseeds;
+ this->fNseedsTOF=t.fNseedsTOF;
+ this->fngoodmatch=t.fngoodmatch;
+ this->fnbadmatch=t.fnbadmatch;
+ this->fnunmatch=t.fnunmatch;
+ this->fnmatch=t.fnmatch;
+ this->fGeom = t.fGeom;
+ this->fTOFpid = t.fTOFpid;
+ this->fR=t.fR;
+ this->fTOFHeigth=t.fTOFHeigth;
+ this->fdCut=t.fdCut;
+ this->fDy=t.fDy;
+ this->fDz=t.fDz;
+ this->fDx=t.fDx;
+ this->fDzMax=t.fDzMax;
+ this->fDyMax=t.fDyMax;
+ this->fSeeds=t.fSeeds;
+ this->fTracks=t.fTracks;
+ this->fN=t.fN;
+ return *this;
+
+}
+
//_____________________________________________________________________________
Int_t AliTOFtracker::PropagateBack(AliESD* event) {
//
t->SetTOFcluster(seed->GetTOFcluster());
t->SetTOFsignalToT(seed->GetTOFsignalToT());
t->SetTOFCalChannel(seed->GetTOFCalChannel());
+ Int_t tlab[3]; seed->GetTOFLabel(tlab);
+ t->SetTOFLabel(tlab);
AliTOFtrack *track = new AliTOFtrack(*seed);
t->UpdateTrackParams(track,AliESDtrack::kTOFout);
delete track;
trackTOFin->GetExternalParameters(x,par);
Double_t cov[15];
trackTOFin->GetExternalCovariance(cov);
+
Float_t scalefact=3.;
Double_t dphi=
scalefact*
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();
AliTOFcluster *c=fClusters[k];
if (c->GetZ() > z+dz) break;
if (c->IsUsed()) continue;
+
+ if (!c->GetStatus()) continue; // skip bad channels as declared in OCDB
//AliInfo(Form(" fClusters[k]->GetZ() (%f) z-dz (%f) %4i ", fClusters[k]->GetZ(), z-dz, k));
Double_t dph=TMath::Abs(c->GetPhi()-phi);
if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
if (TMath::Abs(dph)>dphi) continue;
-
+
+ {
+ Double_t maxChi2=150.; // "calibration constant". Needs to be tuned.
+ Double_t yc=(c->GetPhi() - trackTOFin->GetAlpha())*c->GetR();
+ Double_t p[2]={yc, c->GetZ()};
+ Double_t cov[3]={fDy*fDy/12., 0., fDz*fDz/12.};
+ if (trackTOFin->AliExternalTrackParam::GetPredictedChi2(p,cov) > 150.)
+ continue;
+ }
+
clind[0][nc] = c->GetDetInd(0);
clind[1][nc] = c->GetDetInd(1);
clind[2][nc] = c->GetDetInd(2);
Bool_t skip=kFALSE;
Double_t ysect=trackTOFin->GetYat(xs,skip);
- if(skip)break;
+ if (skip) break;
if (ysect > ymax) {
if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
break;
// 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;
+ Double_t r[3];
+ trackTOFin->GetXYZ(r);
+ trackPos[0][istep]= (Float_t) r[0];
+ trackPos[1][istep]= (Float_t) r[1];
+ trackPos[2][istep]= (Float_t) r[2];
trackPos[3][istep]= trackTOFin->GetIntegratedLength();
}
delete trackTOFin;
// Store quantities to be used in the TOF Calibration
- Float_t ToT=c->GetToT(); // in ps
- t->SetTOFsignalToT(ToT);
+ Float_t tToT=c->GetToT(); // in ps
+ t->SetTOFsignalToT(tToT);
Int_t ind[5];
ind[0]=c->GetDetInd(0);
ind[1]=c->GetDetInd(1);
ind[4]=c->GetDetInd(4);
Int_t calindex = calib->GetIndex(ind);
t->SetTOFCalChannel(calindex);
+
+ // keep track of the track labels in the matched cluster
+ Int_t tlab[3];
+ tlab[0]=c->GetLabel(0);
+ tlab[1]=c->GetLabel(1);
+ tlab[2]=c->GetLabel(2);
Double_t tof=AliTOFGeometry::TdcBinWidth()*c->GetTDC()+32; // in ps
t->SetTOFsignal(tof);
t->UpdateTrackParams(trackTOFout,AliESDtrack::kTOFout);
t->SetIntegratedLength(recL);
t->SetIntegratedTimes(time);
+ t->SetTOFLabel(tlab);
delete trackTOFout;
}