X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDtracker.cxx;h=374b35039e1bbe83523d689a859917fec9b2cc66;hb=634a162510ff6ba3f9086f8aaf11713b0d0e6fe2;hp=05d410391efb3d10900ab3e10c2c6ad016cf6245;hpb=082a228314509c18838504ce07a2e84040b7d9ff;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDtracker.cxx b/TRD/AliTRDtracker.cxx index 05d410391ef..374b35039e1 100644 --- a/TRD/AliTRDtracker.cxx +++ b/TRD/AliTRDtracker.cxx @@ -22,25 +22,22 @@ // // // Authors: // // M. Ivanov (Marian.Ivanov@cern.ch) // -// Y. Belikov (Jouri.Belikov@cern.ch) // // // /////////////////////////////////////////////////////////////////////////////// - -#include #include #include #include -#include -#include #include #include #include #include #include -#include "AliESD.h" -#include "AliAlignObj.h" +#include "AliESDEvent.h" +#include "AliESDtrack.h" +//#include "AliAlignObj.h" +#include "AliGeomManager.h" #include "AliRieman.h" #include "AliTrackPointArray.h" @@ -54,31 +51,21 @@ #include "AliTRDCommonParam.h" #include "AliTRDtracker.h" #include "AliTRDReconstructor.h" +#include "AliTRDrecoParam.h" #include "AliTRDCalibraFillHisto.h" ClassImp(AliTRDtracker) -const Float_t AliTRDtracker::fgkMinClustersInTrack = 0.5; -const Float_t AliTRDtracker::fgkLabelFraction = 0.8; // ?? -const Double_t AliTRDtracker::fgkMaxChi2 = 12.0; -const Double_t AliTRDtracker::fgkMaxSnp = 0.95; // Corresponds to tan = 3 +const Float_t AliTRDtracker::fgkMinClustersInTrack = 0.5; // +const Float_t AliTRDtracker::fgkLabelFraction = 0.8; // +const Double_t AliTRDtracker::fgkMaxChi2 = 12.0; // +const Double_t AliTRDtracker::fgkMaxSnp = 0.95; // Maximum local sine of the azimuthal angle const Double_t AliTRDtracker::fgkMaxStep = 2.0; // Maximal step size in propagation //_____________________________________________________________________________ -AliTRDtracker::AliTRDtracker() +AliTRDtracker::AliTRDtracker(AliTRDReconstructor *rec) :AliTracker() - ,fHBackfit(0x0) - ,fHClSearch(0x0) - ,fHRefit(0x0) - ,fHX(0x0) - ,fHNCl(0x0) - ,fHNClTrack(0x0) - ,fHMinYPos(0x0) - ,fHMinYNeg(0x0) - ,fHMinZ(0x0) - ,fHMinD(0x0) - ,fHDeltaX(0x0) - ,fHXCl(0x0) + ,fReconstructor(rec) ,fGeom(0) ,fNclusters(0) ,fClusters(0) @@ -89,6 +76,18 @@ AliTRDtracker::AliTRDtracker() ,fTimeBinsPerPlane(0) ,fAddTRDseeds(kFALSE) ,fNoTilt(kFALSE) + ,fHBackfit(NULL) + ,fHClSearch(NULL) + ,fHRefit(NULL) + ,fHX(NULL) + ,fHNCl(NULL) + ,fHNClTrack(NULL) + ,fHMinYPos(NULL) + ,fHMinYNeg(NULL) + ,fHMinZ(NULL) + ,fHMinD(NULL) + ,fHDeltaX(NULL) + ,fHXCl(NULL) ,fDebugStreamer(0) { // @@ -98,11 +97,6 @@ AliTRDtracker::AliTRDtracker() for (Int_t i = 0; i < kTrackingSectors; i++) { fTrSec[i] = 0; } - for (Int_t j = 0; j < 5; j++) { - for (Int_t k = 0; k < 18; k++) { - fHoles[j][k] = kFALSE; - } - } InitLogHists(); @@ -111,18 +105,7 @@ AliTRDtracker::AliTRDtracker() //_____________________________________________________________________________ AliTRDtracker::AliTRDtracker(const AliTRDtracker &t) :AliTracker(t) - ,fHBackfit(0x0) - ,fHClSearch(0x0) - ,fHRefit(0x0) - ,fHX(0x0) - ,fHNCl(0x0) - ,fHNClTrack(0x0) - ,fHMinYPos(0x0) - ,fHMinYNeg(0x0) - ,fHMinZ(0x0) - ,fHMinD(0x0) - ,fHDeltaX(0x0) - ,fHXCl(0x0) + ,fReconstructor(t.fReconstructor) ,fGeom(0) ,fNclusters(0) ,fClusters(0) @@ -133,6 +116,18 @@ AliTRDtracker::AliTRDtracker(const AliTRDtracker &t) ,fTimeBinsPerPlane(0) ,fAddTRDseeds(kFALSE) ,fNoTilt(kFALSE) + ,fHBackfit(NULL) + ,fHClSearch(NULL) + ,fHRefit(NULL) + ,fHX(NULL) + ,fHNCl(NULL) + ,fHNClTrack(NULL) + ,fHMinYPos(NULL) + ,fHMinYNeg(NULL) + ,fHMinZ(NULL) + ,fHMinD(NULL) + ,fHDeltaX(NULL) + ,fHXCl(NULL) ,fDebugStreamer(0) { // @@ -142,20 +137,9 @@ AliTRDtracker::AliTRDtracker(const AliTRDtracker &t) } //_____________________________________________________________________________ -AliTRDtracker::AliTRDtracker(const TFile *geomfile) +AliTRDtracker::AliTRDtracker(const TFile */*geomfile*/, AliTRDReconstructor *rec) :AliTracker() - ,fHBackfit(0x0) - ,fHClSearch(0x0) - ,fHRefit(0x0) - ,fHX(0x0) - ,fHNCl(0x0) - ,fHNClTrack(0x0) - ,fHMinYPos(0x0) - ,fHMinYNeg(0x0) - ,fHMinZ(0x0) - ,fHMinD(0x0) - ,fHDeltaX(0x0) - ,fHXCl(0x0) + ,fReconstructor(rec) ,fGeom(0) ,fNclusters(0) ,fClusters(new TObjArray(2000)) @@ -166,6 +150,18 @@ AliTRDtracker::AliTRDtracker(const TFile *geomfile) ,fTimeBinsPerPlane(0) ,fAddTRDseeds(kFALSE) ,fNoTilt(kFALSE) + ,fHBackfit(NULL) + ,fHClSearch(NULL) + ,fHRefit(NULL) + ,fHX(NULL) + ,fHNCl(NULL) + ,fHNClTrack(NULL) + ,fHMinYPos(NULL) + ,fHMinYNeg(NULL) + ,fHMinZ(NULL) + ,fHMinD(NULL) + ,fHDeltaX(NULL) + ,fHXCl(NULL) ,fDebugStreamer(0) { // @@ -173,34 +169,15 @@ AliTRDtracker::AliTRDtracker(const TFile *geomfile) // TDirectory *savedir = gDirectory; - TFile *in = (TFile *) geomfile; - - if (!in->IsOpen()) { - AliWarning("geometry file is not open!\n"); - AliWarning("FULL TRD geometry and DEFAULT TRD parameter will be used\n"); - } - else { - in->cd(); - fGeom = (AliTRDgeometry *) in->Get("TRDgeometry"); - } - - if (!fGeom) { - AliWarning("Cannot find TRD geometry!\n"); - fGeom = new AliTRDgeometry(); - } - fGeom->ReadGeoMatrices(); - savedir->cd(); + fGeom = new AliTRDgeometry(); for (Int_t geomS = 0; geomS < kTrackingSectors; geomS++) { Int_t trS = geomS; fTrSec[trS] = new AliTRDtrackingSector(fGeom,geomS); - for (Int_t icham = 0; icham < AliTRDgeometry::kNcham; icham++) { - fHoles[icham][trS] = fGeom->IsHole(0,icham,geomS); - } } - AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(0,0); + AliTRDpadPlane *padPlane = fGeom->GetPadPlane(0,0); Float_t tiltAngle = TMath::Abs(padPlane->GetTiltingAngle()); if (tiltAngle < 0.1) { fNoTilt = kTRUE; @@ -209,7 +186,7 @@ AliTRDtracker::AliTRDtracker(const TFile *geomfile) if (!AliTRDcalibDB::Instance()) { AliFatal("Could not get calibration object"); } - fTimeBinsPerPlane = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); + fTimeBinsPerPlane = AliTRDcalibDB::Instance()->GetNumberOfTimeBinsDCS(); fDebugStreamer = new TTreeSRedirector("TRDdebug.root"); @@ -241,7 +218,9 @@ AliTRDtracker::~AliTRDtracker() delete fSeeds; } - delete fGeom; + if (fGeom) { + delete fGeom; + } for (Int_t geomS = 0; geomS < kTrackingSectors; geomS++) { delete fTrSec[geomS]; @@ -260,34 +239,34 @@ Int_t AliTRDtracker::LocalToGlobalID(Int_t lid) // Transform internal TRD ID to global detector ID // - Int_t isector = fGeom->GetSector(lid); - Int_t ichamber = fGeom->GetChamber(lid); - Int_t iplan = fGeom->GetPlane(lid); + Int_t isector = fGeom->GetSector(lid); + Int_t istack = fGeom->GetStack(lid); + Int_t ilayer = fGeom->GetLayer(lid); - AliAlignObj::ELayerID iLayer = AliAlignObj::kTRD1; - switch (iplan) { + AliGeomManager::ELayerID iLayer = AliGeomManager::kTRD1; + switch (ilayer) { case 0: - iLayer = AliAlignObj::kTRD1; + iLayer = AliGeomManager::kTRD1; break; case 1: - iLayer = AliAlignObj::kTRD2; + iLayer = AliGeomManager::kTRD2; break; case 2: - iLayer = AliAlignObj::kTRD3; + iLayer = AliGeomManager::kTRD3; break; case 3: - iLayer = AliAlignObj::kTRD4; + iLayer = AliGeomManager::kTRD4; break; case 4: - iLayer = AliAlignObj::kTRD5; + iLayer = AliGeomManager::kTRD5; break; case 5: - iLayer = AliAlignObj::kTRD6; + iLayer = AliGeomManager::kTRD6; break; }; - Int_t modId = isector * fGeom->Ncham() + ichamber; - UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,modId); + Int_t modId = isector * fGeom->Nstack() + istack; + UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,modId); return volid; @@ -301,29 +280,29 @@ Int_t AliTRDtracker::GlobalToLocalID(Int_t gid) // Int_t modId = 0; - AliAlignObj::ELayerID layerId = AliAlignObj::VolUIDToLayer(gid,modId); + AliGeomManager::ELayerID layerId = AliGeomManager::VolUIDToLayer(gid,modId); - Int_t isector = modId / fGeom->Ncham(); - Int_t ichamber = modId % fGeom->Ncham(); - Int_t iLayer = -1; + Int_t isector = modId / fGeom->Nstack(); + Int_t istack = modId % fGeom->Nstack(); + Int_t iLayer = -1; switch (layerId) { - case AliAlignObj::kTRD1: + case AliGeomManager::kTRD1: iLayer = 0; break; - case AliAlignObj::kTRD2: + case AliGeomManager::kTRD2: iLayer = 1; break; - case AliAlignObj::kTRD3: + case AliGeomManager::kTRD3: iLayer = 2; break; - case AliAlignObj::kTRD4: + case AliGeomManager::kTRD4: iLayer = 3; break; - case AliAlignObj::kTRD5: + case AliGeomManager::kTRD5: iLayer = 4; break; - case AliAlignObj::kTRD6: + case AliGeomManager::kTRD6: iLayer = 5; break; default: @@ -334,172 +313,14 @@ Int_t AliTRDtracker::GlobalToLocalID(Int_t gid) return -1; } - Int_t lid = fGeom->GetDetector(iLayer,ichamber,isector); + Int_t lid = fGeom->GetDetector(iLayer,istack,isector); return lid; } //_____________________________________________________________________________ -Bool_t AliTRDtracker::Transform(AliTRDcluster *cluster) -{ - // - // Transform something ... whatever ... - // - - // Magic constants for geo manager transformation - const Double_t kX0shift = 2.52; - const Double_t kX0shift5 = 3.05; - - // - // Apply alignment and calibration to transform cluster - // - Int_t detector = cluster->GetDetector(); - Int_t plane = fGeom->GetPlane(cluster->GetDetector()); - Int_t chamber = fGeom->GetChamber(cluster->GetDetector()); - Int_t sector = fGeom->GetSector(cluster->GetDetector()); - - Double_t dxAmp = (Double_t) fGeom->CamHght(); // Amplification region - Double_t driftX = TMath::Max(cluster->GetX()-dxAmp*0.5,0.0); // Drift distance - - // - // ExB correction - // - Double_t vdrift = AliTRDcalibDB::Instance()->GetVdrift(cluster->GetDetector(),0,0); - Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift,-AliTracker::GetBz()*0.1); - - AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance(); - AliTRDpadPlane *padPlane = commonParam->GetPadPlane(plane,chamber); - Double_t zshiftIdeal = 0.5*(padPlane->GetRow0()+padPlane->GetRowEnd()); - Double_t localPos[3]; - Double_t localPosTracker[3]; - localPos[0] = -cluster->GetX(); - localPos[1] = cluster->GetY() - driftX * exB; - localPos[2] = cluster->GetZ() - zshiftIdeal; - - cluster->SetY(cluster->GetY() - driftX*exB); - Double_t xplane = (Double_t) AliTRDgeometry::GetTime0(plane); - cluster->SetX(xplane- cluster->GetX()); - - TGeoHMatrix *matrix = fGeom->GetCorrectionMatrix(cluster->GetDetector()); - if (!matrix) { - // No matrix found - if somebody used geometry with holes - AliError("Invalid Geometry - Default Geometry used\n"); - return kTRUE; - } - matrix->LocalToMaster(localPos,localPosTracker); - - if (AliTRDReconstructor::StreamLevel() > 1) { - (* fDebugStreamer) << "Transform" - << "Cl.=" << cluster - << "matrix.=" << matrix - << "Detector=" << detector - << "Sector=" << sector - << "Plane=" << plane - << "Chamber=" << chamber - << "lx0=" << localPosTracker[0] - << "ly0=" << localPosTracker[1] - << "lz0=" << localPosTracker[2] - << "\n"; - } - - if (plane == 5) { - cluster->SetX(localPosTracker[0]+kX0shift5); - } - else { - cluster->SetX(localPosTracker[0]+kX0shift); - } - - cluster->SetY(localPosTracker[1]); - cluster->SetZ(localPosTracker[2]); - - return kTRUE; - -} - -//_____________________________________________________________________________ -// Bool_t AliTRDtracker::Transform(AliTRDcluster *cluster) -//{ -// // -// // Is this still needed ???? -// // -// const Double_t kDriftCorrection = 1.01; // drift coeficient correction -// const Double_t kTime0Cor = 0.32; // time0 correction -// // -// const Double_t kX0shift = 2.52; -// const Double_t kX0shift5 = 3.05; - -// // -// // apply alignment and calibration to transform cluster -// // -// // -// Int_t detector = cluster->GetDetector(); -// Int_t plane = fGeom->GetPlane(cluster->GetDetector()); -// Int_t chamber = fGeom->GetChamber(cluster->GetDetector()); -// Int_t sector = fGeom->GetSector(cluster->GetDetector()); - -// Double_t dxAmp = (Double_t) fGeom->CamHght(); // Amplification region -// Double_t driftX = TMath::Max(cluster->GetX()-dxAmp*0.5,0.); // drift distance -// // -// // ExB correction -// // -// Double_t vdrift = AliTRDcalibDB::Instance()->GetVdrift(cluster->GetDetector(),0,0); -// Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift,-AliTracker::GetBz()*0.1); -// // - -// AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance(); -// AliTRDpadPlane * padPlane = commonParam->GetPadPlane(plane,chamber); -// Double_t zshiftIdeal = 0.5*(padPlane->GetRow0()+padPlane->GetRowEnd()); -// Double_t localPos[3], globalPos[3], localPosTracker[3], localPosTracker2[3]; -// localPos[2] = -cluster->GetX(); -// localPos[0] = cluster->GetY() - driftX*exB; -// localPos[1] = cluster->GetZ() -zshiftIdeal; -// TGeoHMatrix * matrix = fGeom->GetGeoMatrix(cluster->GetDetector()); -// matrix->LocalToMaster(localPos, globalPos); - -// Double_t sectorAngle = 20.*(sector%18)+10; -// TGeoHMatrix rotSector; -// rotSector.RotateZ(sectorAngle); -// rotSector.LocalToMaster(globalPos, localPosTracker); -// // -// // -// TGeoHMatrix matrix2(*matrix); -// matrix2.MultiplyLeft(&rotSector); -// matrix2.LocalToMaster(localPos,localPosTracker2); -// // -// // -// // -// cluster->SetY(cluster->GetY() - driftX*exB); -// Double_t xplane = (Double_t) AliTRDgeometry::GetTime0(plane); -// cluster->SetX(xplane- kDriftCorrection*(cluster->GetX()-kTime0Cor)); -// (*fDebugStreamer)<<"Transform"<< -// "Cl.="<SetX(localPosTracker[0]+kX0shift5); -// else -// cluster->SetX(localPosTracker[0]+kX0shift); - -// cluster->SetY(localPosTracker[1]); -// cluster->SetZ(localPosTracker[2]); -// return kTRUE; -// } - -//_____________________________________________________________________________ -Bool_t AliTRDtracker::AdjustSector(AliTRDtrack *track) +Bool_t AliTRDtracker::AdjustSector(AliTRDtrack* const track) const { // // Rotates the track when necessary @@ -509,18 +330,12 @@ Bool_t AliTRDtracker::AdjustSector(AliTRDtrack *track) Double_t y = track->GetY(); Double_t ymax = track->GetX()*TMath::Tan(0.5*alpha); - // Is this still needed ???? - //Int_t ns = AliTRDgeometry::kNsect; - //Int_t s=Int_t(track->GetAlpha()/alpha)%ns; - if (y > ymax) { - //s = (s+1) % ns; if (!track->Rotate( alpha)) { return kFALSE; } } else if (y < -ymax) { - //s = (s-1+ns) % ns; if (!track->Rotate(-alpha)) { return kFALSE; } @@ -531,7 +346,7 @@ Bool_t AliTRDtracker::AdjustSector(AliTRDtrack *track) } //_____________________________________________________________________________ -AliTRDcluster *AliTRDtracker::GetCluster(AliTRDtrack *track, Int_t plane +AliTRDcluster *AliTRDtracker::GetCluster(AliTRDtrack * const track, Int_t plane , Int_t timebin, UInt_t &index) { // @@ -539,7 +354,7 @@ AliTRDcluster *AliTRDtracker::GetCluster(AliTRDtrack *track, Int_t plane // AliTRDcluster *cl =0; - Int_t *indexes = track->GetBackupIndexes(); + const Int_t *indexes = track->GetBackupIndexes(); for (UInt_t i = 0; i < kMaxTimeBinIndex; i++) { if (indexes[i] == 0) { @@ -552,8 +367,8 @@ AliTRDcluster *AliTRDtracker::GetCluster(AliTRDtrack *track, Int_t plane if (cli->GetLocalTimeBin() != timebin) { continue; } - Int_t iplane = fGeom->GetPlane(cli->GetDetector()); - if (iplane == plane) { + Int_t ilayer = fGeom->GetLayer(cli->GetDetector()); + if (ilayer == plane) { cl = cli; index = indexes[i]; break; @@ -565,91 +380,32 @@ AliTRDcluster *AliTRDtracker::GetCluster(AliTRDtrack *track, Int_t plane } //_____________________________________________________________________________ -Int_t AliTRDtracker::GetLastPlane(AliTRDtrack *track) +Int_t AliTRDtracker::GetLastPlane(AliTRDtrack * const track) { // // Return last updated plane // Int_t lastplane = 0; - Int_t *indexes = track->GetBackupIndexes(); + const Int_t *indexes = track->GetBackupIndexes(); for (UInt_t i = 0; i < kMaxTimeBinIndex; i++) { AliTRDcluster *cli = (AliTRDcluster *) fClusters->UncheckedAt(indexes[i]); if (!cli) { break; } - Int_t iplane = fGeom->GetPlane(cli->GetDetector()); - if (iplane > lastplane) { - lastplane = iplane; + Int_t ilayer = fGeom->GetLayer(cli->GetDetector()); + if (ilayer > lastplane) { + lastplane = ilayer; } } return lastplane; } - -//_____________________________________________________________________________ -Int_t AliTRDtracker::Clusters2Tracks(AliESD *event) -{ - // - // Finds tracks within the TRD. The ESD event is expected to contain seeds - // at the outer part of the TRD. The seeds - // are found within the TRD if fAddTRDseeds is TRUE. - // The tracks are propagated to the innermost time bin - // of the TRD and the ESD event is updated - // - - Int_t timeBins = fTrSec[0]->GetNumberOfTimeBins(); - Float_t foundMin = fgkMinClustersInTrack * timeBins; - Int_t nseed = 0; - Int_t found = 0; - //Int_t innerTB = fTrSec[0]->GetInnerTimeBin(); - - Int_t n = event->GetNumberOfTracks(); - for (Int_t i = 0; i < n; i++) { - - AliESDtrack *seed = event->GetTrack(i); - ULong_t status = seed->GetStatus(); - if ((status & AliESDtrack::kTRDout) == 0) { - continue; - } - if ((status & AliESDtrack::kTRDin) != 0) { - continue; - } - nseed++; - - AliTRDtrack *seed2 = new AliTRDtrack(*seed); - //seed2->ResetCovariance(); - AliTRDtrack *pt = new AliTRDtrack(*seed2,seed2->GetAlpha()); - AliTRDtrack &t = *pt; - FollowProlongation(t); - if (t.GetNumberOfClusters() >= foundMin) { - UseClusters(&t); - CookLabel(pt,1 - fgkLabelFraction); - //t.CookdEdx(); - } - found++; - - Double_t xTPC = 250.0; - if (PropagateToX(t,xTPC,fgkMaxStep)) { - seed->UpdateTrackParams(pt, AliESDtrack::kTRDin); - } - delete seed2; - delete pt; - - } - - AliInfo(Form("Number of loaded seeds: %d",nseed)); - AliInfo(Form("Number of found tracks from loaded seeds: %d",found)); - AliInfo(Form("Total number of found tracks: %d",found)); - - return 0; - -} //_____________________________________________________________________________ -Int_t AliTRDtracker::PropagateBack(AliESD *event) +Int_t AliTRDtracker::PropagateBack(AliESDEvent *event) { // // Gets seeds from ESD event. The seeds are AliTPCtrack's found and @@ -660,281 +416,251 @@ Int_t AliTRDtracker::PropagateBack(AliESD *event) // by the TPC tracker. // - Int_t found = 0; // number of tracks found - Float_t foundMin = 20.0; - Int_t n = event->GetNumberOfTracks(); - - // Sort tracks - Float_t *quality = new Float_t[n]; - Int_t *index = new Int_t[n]; - for (Int_t i = 0; i < n; i++) { - AliESDtrack *seed = event->GetTrack(i); - Double_t covariance[15]; - seed->GetExternalCovariance(covariance); - quality[i] = covariance[0]+covariance[2]; - //quality[i] = covariance[0]; - } - TMath::Sort(n,quality,index,kFALSE); - - for (Int_t i = 0; i < n; i++) { - - //AliESDtrack *seed = event->GetTrack(i); - AliESDtrack *seed = event->GetTrack(index[i]); - fHBackfit->Fill(0); - - ULong_t status = seed->GetStatus(); - if ((status & AliESDtrack::kTPCout) == 0) { - fHBackfit->Fill(1); - continue; - } - - if ((status & AliESDtrack::kTRDout) != 0) { - fHBackfit->Fill(2); - continue; - } - - Int_t lbl = seed->GetLabel(); - AliTRDtrack *track = new AliTRDtrack(*seed); - track->SetSeedLabel(lbl); - seed->UpdateTrackParams(track,AliESDtrack::kTRDbackup); // Make backup - fNseeds++; - Float_t p4 = track->GetC(); - Int_t expectedClr = FollowBackProlongation(*track); - - fHBackfit->Fill(3); - fHX->Fill(track->GetX()); - - - // store the last measurement - /* - fHNClTrack->Fill(track->GetNumberOfClusters()); - if (track->GetNumberOfClusters() >= foundMin) { - - fHBackfit->Fill(4); - track->CookdEdx(); - CookdEdxTimBin(*track); - CookLabel(track,1 - fgkLabelFraction); - if (track->GetBackupTrack()) { - //fHBackfit->Fill(5); - UseClusters(track->GetBackupTrack()); - seed->UpdateTrackParams(track->GetBackupTrack(),AliESDtrack::kTRDbackup); - } - } - */ - - /**/ - // inter-tracks competition ??? - if ((TMath::Abs(track->GetC() - p4) / TMath::Abs(p4) < 0.2) || - (TMath::Abs(track->GetPt()) > 0.8)) { - - fHBackfit->Fill(4); - - // - // Make backup for back propagation - // - - Int_t foundClr = track->GetNumberOfClusters(); - if (foundClr >= foundMin) { - track->CookdEdx(); - CookdEdxTimBin(*track); - CookLabel(track,1 - fgkLabelFraction); - if (track->GetBackupTrack()) { - UseClusters(track->GetBackupTrack()); - } - - // Sign only gold tracks - if (track->GetChi2() / track->GetNumberOfClusters() < 4) { - if ((seed->GetKinkIndex(0) == 0) && - (TMath::Abs(track->GetPt()) < 1.5)) { - UseClusters(track); - } - } - Bool_t isGold = kFALSE; + Int_t found = 0; // number of tracks found + Float_t foundMin = 20.0; - // Full gold track - if (track->GetChi2() / track->GetNumberOfClusters() < 5) { - //seed->UpdateTrackParams(track, AliESDtrack::kTRDbackup); - if (track->GetBackupTrack()) { - seed->UpdateTrackParams(track->GetBackupTrack(),AliESDtrack::kTRDbackup); - - } - isGold = kTRUE; - //fHBackfit->Fill() - } - - // Almost gold track - if ((!isGold) && - (track->GetNCross() == 0) && - (track->GetChi2() / track->GetNumberOfClusters() < 7)) { - //seed->UpdateTrackParams(track, AliESDtrack::kTRDbackup); - if (track->GetBackupTrack()) { - seed->UpdateTrackParams(track->GetBackupTrack(),AliESDtrack::kTRDbackup); - } - isGold = kTRUE; + Int_t nSeed = event->GetNumberOfTracks(); + if(!nSeed){ + // run stand alone tracking + if (fReconstructor->IsSeeding()) Clusters2Tracks(event); + return 0; } - - if ((!isGold) && - (track->GetBackupTrack())) { - if ((track->GetBackupTrack()->GetNumberOfClusters() > foundMin) && - ((track->GetBackupTrack()->GetChi2()/(track->GetBackupTrack()->GetNumberOfClusters()+1)) < 7)) { - seed->UpdateTrackParams(track->GetBackupTrack(),AliESDtrack::kTRDbackup); - isGold = kTRUE; - } - } - - if ((track->StatusForTOF() > 0) && - (track->GetNCross() == 0) && - (Float_t(track->GetNumberOfClusters()) / Float_t(track->GetNExpected()) > 0.4)) { - //seed->UpdateTrackParams(track->GetBackupTrack(), AliESDtrack::kTRDbackup); + + Float_t *quality = new Float_t[nSeed]; + Int_t *index = new Int_t[nSeed]; + for (Int_t iSeed = 0; iSeed < nSeed; iSeed++) { + AliESDtrack *seed = event->GetTrack(iSeed); + Double_t covariance[15]; + seed->GetExternalCovariance(covariance); + quality[iSeed] = covariance[0] + covariance[2]; } - - } - } - /**/ - - /**/ - // Debug part of tracking - TTreeSRedirector &cstream = *fDebugStreamer; - Int_t eventNrInFile = event->GetEventNumberInFile(); // This is most likely NOT the event number you'd like to use. It has nothing to do with the 'real' event number. - if (AliTRDReconstructor::StreamLevel() > 0) { - if (track->GetBackupTrack()) { - cstream << "Tracks" - << "EventNrInFile=" << eventNrInFile - << "ESD.=" << seed - << "trd.=" << track - << "trdback.=" << track->GetBackupTrack() - << "\n"; - } - else { - cstream << "Tracks" - << "EventNrInFile=" << eventNrInFile - << "ESD.=" << seed - << "trd.=" << track - << "trdback.=" << track - << "\n"; - } - } - /**/ - - // Propagation to the TOF (I.Belikov) - if (track->GetStop() == kFALSE) { - fHBackfit->Fill(5); - - Double_t xtof = 371.0; - Double_t xTOF0 = 370.0; - - Double_t c2 = track->GetSnp() + track->GetC() * (xtof - track->GetX()); - if (TMath::Abs(c2) >= 0.99) { + // Sort tracks according to covariance of local Y and Z + TMath::Sort(nSeed,quality,index,kFALSE); - fHBackfit->Fill(6); - delete track; - continue; - } - - PropagateToX(*track,xTOF0,fgkMaxStep); - - // Energy losses taken to the account - check one more time - c2 = track->GetSnp() + track->GetC() * (xtof - track->GetX()); - if (TMath::Abs(c2) >= 0.99) { + // Backpropagate all seeds + for (Int_t iSeed = 0; iSeed < nSeed; iSeed++) { - fHBackfit->Fill(7); - delete track; - continue; - } - - //if (!PropagateToX(*track,xTOF0,fgkMaxStep)) { - // fHBackfit->Fill(7); - //delete track; - // continue; - //} - - Double_t ymax = xtof * TMath::Tan(0.5 * AliTRDgeometry::GetAlpha()); - Double_t y; - track->GetYAt(xtof,GetBz(),y); - if (y > ymax) { - if (!track->Rotate( AliTRDgeometry::GetAlpha())) { - fHBackfit->Fill(8); - delete track; - continue; - } - } - else if (y < -ymax) { - if (!track->Rotate(-AliTRDgeometry::GetAlpha())) { - fHBackfit->Fill(9); - delete track; - continue; - } - } - - if (track->PropagateTo(xtof)) { - seed->UpdateTrackParams(track,AliESDtrack::kTRDout); - fHBackfit->Fill(10); - - for (Int_t i = 0; i < AliESDtrack::kNPlane; i++) { - for (Int_t j = 0; j < AliESDtrack::kNSlice; j++) { - seed->SetTRDsignals(track->GetPIDsignals(i,j),i,j); - } - seed->SetTRDTimBin(track->GetPIDTimBin(i),i); - } - //seed->SetTRDtrack(new AliTRDtrack(*track)); - if (track->GetNumberOfClusters() > foundMin) { - fHBackfit->Fill(11); - found++; + // Get the seeds in sorted sequence + AliESDtrack *seed = event->GetTrack(index[iSeed]); + fHBackfit->Fill(0); // All seeds + + // Check the seed status + ULong_t status = seed->GetStatus(); + if ((status & AliESDtrack::kTPCout) == 0) { + fHBackfit->Fill(1); // TPC outer edge reached + continue; + } + if ((status & AliESDtrack::kTRDout) != 0) { + fHBackfit->Fill(2); // TRD outer edge reached (does this happen ?) + continue; + } + + // Do the back prolongation + Int_t lbl = seed->GetLabel(); + AliTRDtrack *track = new AliTRDtrack(*seed); + track->SetSeedLabel(lbl); + seed->UpdateTrackParams(track,AliESDtrack::kTRDbackup); // Make backup + fNseeds++; + Float_t p4 = track->GetC(); + Int_t expectedClr = FollowBackProlongation(*track); + fHBackfit->Fill(3); // Back prolongation done + fHX->Fill(track->GetX()); + + if ((TMath::Abs(track->GetC() - p4) / TMath::Abs(p4) < 0.2) || + (track->Pt() > 0.8)) { + + fHBackfit->Fill(4); + + // + // Make backup for back propagation + // + + Int_t foundClr = track->GetNumberOfClusters(); + if (foundClr >= foundMin) { + track->CookdEdx(); + track->CookdEdxTimBin(seed->GetID()); // A.Bercuci 25.07.07 + CookLabel(track,1 - fgkLabelFraction); + if (track->GetBackupTrack()) UseClusters(track->GetBackupTrack()); + + + // Sign only gold tracks + if (track->GetChi2() / track->GetNumberOfClusters() < 4) { + if ((seed->GetKinkIndex(0) == 0) && + (track->Pt() < 1.5)) { + UseClusters(track); + } + } + Bool_t isGold = kFALSE; + + // Full gold track + if (track->GetChi2() / track->GetNumberOfClusters() < 5) { + //seed->UpdateTrackParams(track, AliESDtrack::kTRDbackup); + if (track->GetBackupTrack()) { + seed->UpdateTrackParams(track->GetBackupTrack(),AliESDtrack::kTRDbackup); + } + isGold = kTRUE; + //fHBackfit->Fill() + } + + // Almost gold track + if ((!isGold) && (track->GetNCross() == 0) && + (track->GetChi2() / track->GetNumberOfClusters() < 7)) { + //seed->UpdateTrackParams(track, AliESDtrack::kTRDbackup); + if (track->GetBackupTrack()) { + seed->UpdateTrackParams(track->GetBackupTrack(),AliESDtrack::kTRDbackup); + } + isGold = kTRUE; + } + + if ((!isGold) && (track->GetBackupTrack())) { + if ((track->GetBackupTrack()->GetNumberOfClusters() > foundMin) && ((track->GetBackupTrack()->GetChi2()/(track->GetBackupTrack()->GetNumberOfClusters()+1)) < 7)) { + seed->UpdateTrackParams(track->GetBackupTrack(),AliESDtrack::kTRDbackup); + isGold = kTRUE; + } + } + + if ((track->StatusForTOF() > 0) && (track->GetNCross() == 0) && (Float_t(track->GetNumberOfClusters()) / Float_t(track->GetNExpected()) > 0.4)) { + //seed->UpdateTrackParams(track->GetBackupTrack(), AliESDtrack::kTRDbackup); + } + } + } + /**/ + + /**/ + // Debug part of tracking + TTreeSRedirector &cstream = *fDebugStreamer; + Int_t eventNrInFile = event->GetEventNumberInFile(); // This is most likely NOT the event number you'd like to use. It has nothing to do with the 'real' event number. + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { + if (track->GetBackupTrack()) { + cstream << "Tracks" + << "EventNrInFile=" << eventNrInFile + << "ESD.=" << seed + << "trd.=" << track + << "trdback.=" << track->GetBackupTrack() + << "\n"; + } + else { + cstream << "Tracks" + << "EventNrInFile=" << eventNrInFile + << "ESD.=" << seed + << "trd.=" << track + << "trdback.=" << track + << "\n"; + } + } + /**/ + + // Propagation to the TOF (I.Belikov) + if (track->GetStop() == kFALSE) { + fHBackfit->Fill(5); + + Double_t xtof = 371.0; + Double_t xTOF0 = 370.0; + + Double_t c2 = track->GetSnp() + track->GetC() * (xtof - track->GetX()); + if (TMath::Abs(c2) >= 0.99) { + fHBackfit->Fill(6); + delete track; + continue; + } + + PropagateToX(*track,xTOF0,fgkMaxStep); + + // Energy losses taken to the account - check one more time + c2 = track->GetSnp() + track->GetC() * (xtof - track->GetX()); + if (TMath::Abs(c2) >= 0.99) { + fHBackfit->Fill(7); + delete track; + continue; + } + + //if (!PropagateToX(*track,xTOF0,fgkMaxStep)) { + // fHBackfit->Fill(7); + //delete track; + // continue; + //} + + Double_t ymax = xtof * TMath::Tan(0.5 * AliTRDgeometry::GetAlpha()); + Double_t y; + track->GetYAt(xtof,GetBz(),y); + if (y > ymax) { + if (!track->Rotate( AliTRDgeometry::GetAlpha())) { + fHBackfit->Fill(8); + delete track; + continue; + } + } + else if (y < -ymax) { + if (!track->Rotate(-AliTRDgeometry::GetAlpha())) { + fHBackfit->Fill(9); + delete track; + continue; + } + } + + if (track->PropagateTo(xtof)) { + seed->UpdateTrackParams(track,AliESDtrack::kTRDout); + fHBackfit->Fill(10); + + seed->SetNumberOfTRDslices(AliTRDCalPID::kNSlicesLQ); + for (Int_t i = 0; i < AliTRDtrack::kNplane; i++) { + for (Int_t j = 0; j < AliTRDCalPID::kNSlicesLQ; j++) { + seed->SetTRDslice(track->GetPIDsignals(i,j),i,j); + } + seed->SetTRDTimBin(track->GetPIDTimBin(i),i); + } + //seed->SetTRDtrack(new AliTRDtrack(*track)); + if (track->GetNumberOfClusters() > foundMin) { + fHBackfit->Fill(11); + found++; + } + } + } + else { + fHBackfit->Fill(12); + + if ((track->GetNumberOfClusters() > 15) && + (track->GetNumberOfClusters() > 0.5*expectedClr)) { + seed->UpdateTrackParams(track,AliESDtrack::kTRDout); + fHBackfit->Fill(13); + + //seed->SetStatus(AliESDtrack::kTRDStop); + + seed->SetNumberOfTRDslices(AliTRDCalPID::kNSlicesLQ); + for (Int_t i = 0; i < AliTRDtrack::kNplane; i++) { + for (Int_t j = 0; j SetTRDslice(track->GetPIDsignals(i,j),i,j); + } + seed->SetTRDTimBin(track->GetPIDTimBin(i),i); + } + //seed->SetTRDtrack(new AliTRDtrack(*track)); + found++; + } + } + + seed->SetTRDQuality(track->StatusForTOF()); + seed->SetTRDBudget(track->GetBudget(0)); + + fHBackfit->Fill(14); + delete track; } - } - - } - else { - - fHBackfit->Fill(12); - - if ((track->GetNumberOfClusters() > 15) && - (track->GetNumberOfClusters() > 0.5*expectedClr)) { - seed->UpdateTrackParams(track,AliESDtrack::kTRDout); - fHBackfit->Fill(13); - - //seed->SetStatus(AliESDtrack::kTRDStop); - for (Int_t i = 0; i < AliESDtrack::kNPlane; i++) { - for (Int_t j = 0; j SetTRDsignals(track->GetPIDsignals(i,j),i,j); - } - seed->SetTRDTimBin(track->GetPIDTimBin(i),i); - } - //seed->SetTRDtrack(new AliTRDtrack(*track)); - found++; - } - - } - - seed->SetTRDQuality(track->StatusForTOF()); - seed->SetTRDBudget(track->GetBudget(0)); - - fHBackfit->Fill(14); - delete track; - } - - AliInfo(Form("Number of seeds: %d",fNseeds)); - AliInfo(Form("Number of back propagated TRD tracks: %d",found)); - - // New seeding - if (AliTRDReconstructor::SeedingOn()) { - MakeSeedsMI(3,5,event); - } - - fSeeds->Clear(); - fNseeds = 0; - - delete [] index; - delete [] quality; - - SaveLogHists(); + AliInfo(Form("Number of seeds: %d",fNseeds)); + AliInfo(Form("Number of back propagated TRD tracks: %d",found)); + + fSeeds->Clear(); + fNseeds = 0; + + delete [] index; + delete [] quality; + + SaveLogHists(); return 0; } //_____________________________________________________________________________ -Int_t AliTRDtracker::RefitInward(AliESD *event) +Int_t AliTRDtracker::RefitInward(AliESDEvent *event) { // // Refits tracks within the TRD. The ESD event is expected to contain seeds @@ -944,13 +670,20 @@ Int_t AliTRDtracker::RefitInward(AliESD *event) // Origin: Thomas KUHR (Thomas.Kuhr@cern.ch) // - Int_t timeBins = fTrSec[0]->GetNumberOfTimeBins(); - Float_t foundMin = fgkMinClustersInTrack * timeBins; + //Int_t timeBins = fTrSec[0]->GetNumberOfTimeBins(); + //Float_t foundMin = fgkMinClustersInTrack * timeBins; Int_t nseed = 0; Int_t found = 0; + Int_t pidQ = 0; //Int_t innerTB = fTrSec[0]->GetInnerTimeBin(); AliTRDtrack seed2; + // Calibration fill 2D + AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance(); + if (!calibra) { + AliInfo("Could not get Calibra instance\n"); + } + Int_t n = event->GetNumberOfTracks(); for (Int_t i = 0; i < n; i++) { @@ -980,69 +713,82 @@ Int_t AliTRDtracker::RefitInward(AliESD *event) seed2.ResetCovariance(50.0); AliTRDtrack *pt = new AliTRDtrack(seed2,seed2.GetAlpha()); - Int_t *indexes2 = seed2.GetIndexes(); - for (Int_t i = 0; i < AliESDtrack::kNPlane;i++) { - for (Int_t j = 0; j < AliESDtrack::kNSlice;j++) { - pt->SetPIDsignals(seed2.GetPIDsignals(i,j),i,j); + const Int_t *indexes2 = seed2.GetIndexes(); + for (Int_t l = 0; l < AliTRDtrack::kNplane;++l) { + for (Int_t j = 0; j < AliTRDCalPID::kNSlicesLQ;j++) { + pt->SetPIDsignals(seed2.GetPIDsignals(l,j),l,j); } - pt->SetPIDTimBin(seed2.GetPIDTimBin(i),i); + pt->SetPIDTimBin(seed2.GetPIDTimBin(l),l); } - Int_t *indexes3 = pt->GetBackupIndexes(); - for (Int_t i = 0; i < 200;i++) { - if (indexes2[i] == 0) { + Int_t *indexes3 = const_cast(pt->GetBackupIndexes()); + for (Int_t l = 0; l < 200;++l) { + if (indexes2[l] == 0) { break; } - indexes3[i] = indexes2[i]; + indexes3[l] = indexes2[l]; } - //AliTRDtrack *pt = seed2; - AliTRDtrack &t = *pt; - FollowProlongation(t); - if (t.GetNumberOfClusters() >= foundMin) { - //UseClusters(&t); - //CookLabel(pt, 1-fgkLabelFraction); - t.CookdEdx(); - CookdEdxTimBin(t); - } + FollowProlongation(*pt); + pt->CookdEdx(); + pt->CookdEdxTimBin(seed->GetID()); + + //calculate PID methods + pt->SetPIDMethod(AliTRDtrack::kLQ); + pt->CookPID(pidQ); + seed->SetTRDpid(pt->GetPID()); + seed->SetTRDntracklets(pidQ<<3); + + // update calibration + if(calibra->GetHisto2d()) calibra->UpdateHistograms(pt); found++; Double_t xTPC = 250.0; - if (PropagateToX(t,xTPC,fgkMaxStep)) { - + if (PropagateToX(*pt,xTPC,fgkMaxStep)) { seed->UpdateTrackParams(pt,AliESDtrack::kTRDrefit); fHRefit->Fill(5); - for (Int_t i = 0; i < AliESDtrack::kNPlane; i++) { - for (Int_t j = 0; j < AliESDtrack::kNSlice; j++) { - seed->SetTRDsignals(pt->GetPIDsignals(i,j),i,j); - } - seed->SetTRDTimBin(pt->GetPIDTimBin(i),i); + for (Int_t l = 0; l < AliTRDtrack::kNplane; ++l) { + for (Int_t j = 0; j < AliTRDCalPID::kNSlicesLQ; j++) { + seed->SetTRDslice(pt->GetPIDsignals(l,j),l,j); + } + seed->SetTRDTimBin(pt->GetPIDTimBin(l),l); } - } - else { + } else { // If not prolongation to TPC - propagate without update fHRefit->Fill(5); - AliTRDtrack *seed2 = new AliTRDtrack(*seed); - seed2->ResetCovariance(5.0); - AliTRDtrack *pt2 = new AliTRDtrack(*seed2,seed2->GetAlpha()); - delete seed2; + AliTRDtrack *seed2t = new AliTRDtrack(*seed); + seed2t->ResetCovariance(5.0); + AliTRDtrack *pt2 = new AliTRDtrack(*seed2t,seed2t->GetAlpha()); + delete seed2t; + if (PropagateToX(*pt2,xTPC,fgkMaxStep)) { - pt2->CookdEdx( ); - CookdEdxTimBin(*pt2); - seed->UpdateTrackParams(pt2,AliESDtrack::kTRDrefit); - fHRefit->Fill(6); - - for (Int_t i = 0; i < AliESDtrack::kNPlane; i++) { - for (Int_t j = 0; j < AliESDtrack::kNSlice; j++) { - seed->SetTRDsignals(pt2->GetPIDsignals(i,j),i,j); - } - seed->SetTRDTimBin(pt2->GetPIDTimBin(i),i); + pt2->CookdEdx(); + pt2->CookdEdxTimBin(seed->GetID()); + seed->UpdateTrackParams(pt2,AliESDtrack::kTRDrefit); + fHRefit->Fill(6); + + for (Int_t l = 0; l < AliTRDtrack::kNplane; ++l) { + for (Int_t j = 0; j < AliTRDCalPID::kNSlicesLQ; j++) { + seed->SetTRDslice(pt2->GetPIDsignals(l,j),l,j); + } + seed->SetTRDTimBin(pt2->GetPIDTimBin(l),l); } } + + // Add TRD track to ESDfriendTrack - maybe this tracks are + // not useful for post-processing - TODO make decision + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { + seed->AddCalibObject(new AliTRDtrack(*pt2/*, kTRUE*/)); + } delete pt2; + } + // Add TRD track to ESDfriendTrack + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { + seed->AddCalibObject(new AliTRDtrack(*pt/*, kTRUE*/)); + } delete pt; } @@ -1051,7 +797,9 @@ Int_t AliTRDtracker::RefitInward(AliESD *event) AliInfo(Form("Number of found tracks from loaded seeds: %d",found)); SaveLogHists(); + return 0; + } //_____________________________________________________________________________ @@ -1067,8 +815,8 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack &t) Int_t sector; Int_t lastplane = GetLastPlane(&t); - Double_t radLength = 0.0; - Double_t rho = 0.0; + Double_t xx0 = 0.0; + Double_t xrho= 0.0; Int_t expectedNumberOfClusters = 0; for (Int_t iplane = lastplane; iplane >= 0; iplane--) { @@ -1076,14 +824,12 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack &t) Int_t row0 = GetGlobalTimeBin(0,iplane,GetTimeBinsPerPlane()-1); Int_t rowlast = GetGlobalTimeBin(0,iplane,0); - // // Propagate track close to the plane if neccessary - // Double_t currentx = fTrSec[0]->GetLayer(rowlast)->GetX(); if (currentx < (-fgkMaxStep + t.GetX())) { - // Propagate closer to chamber - safety space fgkMaxStep + // Propagate closer to chamber - safety space fgkMaxStep if (!PropagateToX(t,currentx+fgkMaxStep,fgkMaxStep)) { - break; + break; } } @@ -1091,42 +837,50 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack &t) break; } - // // Get material budget - // Double_t xyz0[3]; Double_t xyz1[3]; - Double_t param[7]; + Double_t param[7]; Double_t x; Double_t y; Double_t z; // Starting global position - t.GetXYZ(xyz0); + t.GetXYZ(xyz0); // End global position x = fTrSec[0]->GetLayer(row0)->GetX(); if (!t.GetProlongation(x,y,z)) { break; } - xyz1[0] = x * TMath::Cos(t.GetAlpha()) - y * TMath::Sin(t.GetAlpha()); + xyz1[0] = x * TMath::Cos(t.GetAlpha()) - y * TMath::Sin(t.GetAlpha()); xyz1[1] = +x * TMath::Sin(t.GetAlpha()) + y * TMath::Cos(t.GetAlpha()); xyz1[2] = z; - AliKalmanTrack::MeanMaterialBudget(xyz0,xyz1,param); - rho = param[0]; - radLength = param[1]; // Get mean propagation parameters + AliTracker::MeanMaterialBudget(xyz0,xyz1,param); + xrho= param[0]*param[4]; + xx0 = param[1]; // Get mean propagation parameters + + // Flags for marking the track momentum and direction. The track is + // marked only if it has at least 1 cluster picked up in the current + // chamber. + Bool_t kUPDATED = kFALSE; + Bool_t kMARKED = kFALSE; - // // Propagate and update - // sector = t.GetSector(); //for (Int_t itime=GetTimeBinsPerPlane()-1;itime>=0;itime--) { for (Int_t itime = 0 ; itime < GetTimeBinsPerPlane(); itime++) { + // Mark track kinematics + if (itime > 10 && kUPDATED && !kMARKED) { + t.SetTrackSegmentDirMom(iplane); + kMARKED = kTRUE; + } + Int_t ilayer = GetGlobalTimeBin(0,iplane,itime); - expectedNumberOfClusters++; + expectedNumberOfClusters++; t.SetNExpected(t.GetNExpected() + 1); if (t.GetX() > 345.0) { - t.SetNExpectedLast(t.GetNExpectedLast() + 1); + t.SetNExpectedLast(t.GetNExpectedLast() + 1); } AliTRDpropagationLayer &timeBin = *(fTrSec[sector]->GetLayer(ilayer)); AliTRDcluster *cl = 0; @@ -1138,60 +892,64 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack &t) AliTRDcluster *cl0 = timeBin[0]; if (!cl0) { - // No clusters in given time bin - continue; + // No clusters in given time bin + continue; } - Int_t plane = fGeom->GetPlane(cl0->GetDetector()); - if (plane > lastplane) { - continue; + Int_t layer = fGeom->GetLayer(cl0->GetDetector()); + if (layer > lastplane) { + continue; } Int_t timebin = cl0->GetLocalTimeBin(); - AliTRDcluster *cl2 = GetCluster(&t,plane,timebin,index); + AliTRDcluster *cl2 = GetCluster(&t,layer,timebin,index); if (cl2) { - - cl = cl2; + cl = cl2; //Double_t h01 = GetTiltFactor(cl); //I.B's fix //maxChi2=t.GetPredictedChi2(cl,h01); + } - } - if (cl) { + if (cl) { - //if (cl->GetNPads()<5) + //if (cl->GetNPads()<5) Double_t dxsample = timeBin.GetdX(); - t.SetSampledEdx(TMath::Abs(cl->GetQ()/dxsample)); - Double_t h01 = GetTiltFactor(cl); - Int_t det = cl->GetDetector(); - Int_t plane = fGeom->GetPlane(det); + t.SetSampledEdx(TMath::Abs(cl->GetQ()/dxsample)); + Double_t h01 = GetTiltFactor(cl); + Int_t det = cl->GetDetector(); + Int_t llayer = fGeom->GetLayer(det); + if (t.GetX() > 345.0) { t.SetNLast(t.GetNLast() + 1); t.SetChi2Last(t.GetChi2Last() + maxChi2); } Double_t xcluster = cl->GetX(); - t.PropagateTo(xcluster,radLength,rho); - - if (!AdjustSector(&t)) { - break; //I.B's fix + t.PropagateTo(xcluster,xx0,xrho); + if (!AdjustSector(&t)) { + break; //I.B's fix } - maxChi2 = t.GetPredictedChi2(cl,h01); - - if (maxChi2<1e+10) - if (!t.UpdateMI(cl,maxChi2,index,h01,plane)) { + + maxChi2 = t.GetPredictedChi2(cl,h01); + if (maxChi2 < 1e+10) { + if (!t.UpdateMI(cl,maxChi2,index,h01,llayer)) { // ???? + } + else { + //SetCluster(cl, GetNumberOfClusters()-1); + kUPDATED = kTRUE; } + } - } + } } - } + } } - return expectedNumberOfClusters; + return expectedNumberOfClusters; } @@ -1200,98 +958,111 @@ Int_t AliTRDtracker::FollowBackProlongation(AliTRDtrack &t) { // // Starting from current radial position of track this function - // extrapolates the track up to outer timebin and in the sensitive + // extrapolates the track up to the outer timebin and in the sensitive // layers confirms prolongation if a close cluster is found. // Returns the number of clusters expected to be found in sensitive layers - // Use GEO manager for material Description + // Uses the geomanager for material description // // return number of assigned clusters ? // - Int_t sector; - Int_t clusters[1000]; - Double_t radLength = 0.0; - Double_t rho = 0.0; + + Double_t xx0 = 0.0; + Double_t xrho = 0.0; + + Float_t ratio0 = 0.0; + Int_t expectedNumberOfClusters = 0; - Float_t ratio0 = 0.0; - AliTRDtracklet tracklet; - // Calibration fill 2D - AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance(); - if (!calibra) { - AliInfo("Could not get Calibra instance\n"); - } - if (calibra->GetMITracking()) { - calibra->ResetTrack(); - } + AliTRDtracklet tracklet; - for (Int_t i = 0; i < 1000; i++) { + const Int_t kNclusters = 1000; + Int_t clusters[kNclusters]; + for (Int_t i = 0; i < kNclusters; i++) { clusters[i] = -1; } - for (Int_t iplane = 0; iplane < AliESDtrack::kNPlane; iplane++) { +// // Calibration fill 2D +// AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance(); +// if (!calibra) { +// AliInfo("Could not get Calibra instance\n"); +// } +// if (calibra->GetMITracking()) { +// calibra->ResetTrack(); +// } + + // Loop through the TRD planes + for (Int_t iplane = 0; iplane < AliTRDtrack::kNplane; iplane++) { - int hb = iplane * 10; + Int_t hb = iplane * 10; fHClSearch->Fill(hb); + // Get the global time bin numbers for the first an last + // local time bin of the given plane Int_t row0 = GetGlobalTimeBin(0,iplane,GetTimeBinsPerPlane()-1); Int_t rowlast = GetGlobalTimeBin(0,iplane,0); + + // Get the X coordinates of the propagation layer for the first time bin Double_t currentx = fTrSec[0]->GetLayer(row0)->GetX(); if (currentx < t.GetX()) { fHClSearch->Fill(hb+1); continue; } - // - // Propagate closer to chamber if neccessary - // + // Propagate closer to the current chamber if neccessary if (currentx > (fgkMaxStep + t.GetX())) { if (!PropagateToX(t,currentx-fgkMaxStep,fgkMaxStep)) { fHClSearch->Fill(hb+2); break; } } + + // Rotate track to adjacent sector if neccessary if (!AdjustSector(&t)) { fHClSearch->Fill(hb+3); break; } + + // Check whether azimuthal angle is getting too large if (TMath::Abs(t.GetSnp()) > fgkMaxSnp) { fHClSearch->Fill(hb+4); break; } - // - // Get material budget inside of chamber - // Double_t xyz0[3]; Double_t xyz1[3]; Double_t param[7]; Double_t x; Double_t y; Double_t z; - // Starting global position + // Global start position (beginning of chamber) t.GetXYZ(xyz0); - // End global position + // X-position of the end of the chamber x = fTrSec[0]->GetLayer(rowlast)->GetX(); + // Get local Y and Z at the X-position of the end of the chamber if (!t.GetProlongation(x,y,z)) { fHClSearch->Fill(hb+5); break; } + // Global end position (end of chamber) xyz1[0] = x * TMath::Cos(t.GetAlpha()) - y * TMath::Sin(t.GetAlpha()); xyz1[1] = +x * TMath::Sin(t.GetAlpha()) + y * TMath::Cos(t.GetAlpha()); xyz1[2] = z; - AliKalmanTrack::MeanMaterialBudget(xyz0,xyz1,param); - rho = param[0]; - radLength = param[1]; // Get mean propagation parameters - // - // Find clusters - // - sector = t.GetSector(); + // Calculate the mean material budget along the path inside the chamber + AliTracker::MeanMaterialBudget(xyz0,xyz1,param); + // The mean propagation parameters (density*length and radiation length) + xrho = param[0]*param[4]; + xx0 = param[1]; + + // Find the clusters and tracklet along the path inside the chamber + sector = t.GetSector(); Float_t ncl = FindClusters(sector,row0,rowlast,&t,clusters,tracklet); fHNCl->Fill(tracklet.GetN()); + // Discard if in less than 1/3 of the available timebins + // clusters are found if (tracklet.GetN() < GetTimeBinsPerPlane()/3) { fHClSearch->Fill(hb+6); continue; @@ -1301,7 +1072,6 @@ Int_t AliTRDtracker::FollowBackProlongation(AliTRDtrack &t) // Propagate and update track // for (Int_t itime = GetTimeBinsPerPlane()-1; itime >= 0; itime--) { - Int_t ilayer = GetGlobalTimeBin(0, iplane,itime); expectedNumberOfClusters++; t.SetNExpected(t.GetNExpected() + 1); @@ -1315,49 +1085,48 @@ Int_t AliTRDtracker::FollowBackProlongation(AliTRDtrack &t) x = timeBin.GetX(); if (timeBin) { - - if (clusters[ilayer] > 0) { - index = clusters[ilayer]; - cl = (AliTRDcluster *)GetCluster(index); - //Double_t h01 = GetTiltFactor(cl); // I.B's fix - //maxChi2=t.GetPredictedChi2(cl,h01); // - } + if (clusters[ilayer] > 0) { + index = clusters[ilayer]; + cl = (AliTRDcluster *)GetCluster(index); + //Double_t h01 = GetTiltFactor(cl); // I.B's fix + //maxChi2=t.GetPredictedChi2(cl,h01); // + } if (cl) { + //if (cl->GetNPads() < 5) + Double_t dxsample = timeBin.GetdX(); + t.SetSampledEdx(TMath::Abs(cl->GetQ()/dxsample)); + Double_t h01 = GetTiltFactor(cl); + Int_t det = cl->GetDetector(); + Int_t layer = fGeom->GetLayer(det); + if (t.GetX() > 345.0) { + t.SetNLast(t.GetNLast() + 1); + t.SetChi2Last(t.GetChi2Last() + maxChi2); + } + Double_t xcluster = cl->GetX(); + t.PropagateTo(xcluster,xx0,xrho); + maxChi2 = t.GetPredictedChi2(cl,h01); + + if (maxChi2<1e+10) + if (!t.UpdateMI(cl,maxChi2,index,h01,layer)) { + if (!t.Update(cl,maxChi2,index,h01)) { + // ???? + } + } // else SetCluster(cl, GetNumberOfClusters()-1); // A.Bercuci 25.07.07 + - //if (cl->GetNPads() < 5) - Double_t dxsample = timeBin.GetdX(); - t.SetSampledEdx(TMath::Abs(cl->GetQ()/dxsample)); - Double_t h01 = GetTiltFactor(cl); - Int_t det = cl->GetDetector(); - Int_t plane = fGeom->GetPlane(det); - if (t.GetX() > 345.0) { - t.SetNLast(t.GetNLast() + 1); - t.SetChi2Last(t.GetChi2Last() + maxChi2); - } - Double_t xcluster = cl->GetX(); - t.PropagateTo(xcluster,radLength,rho); - maxChi2 = t.GetPredictedChi2(cl,h01); - - if (maxChi2<1e+10) - if (!t.UpdateMI(cl,maxChi2,index,h01,plane)) { - if (!t.Update(cl,maxChi2,index,h01)) { - // ???? - } - } - - if (calibra->GetMITracking()) { - calibra->UpdateHistograms(cl,&t); - } - - // Reset material budget if 2 consecutive gold - if (plane > 0) { - if ((t.GetTracklets(plane).GetN() + t.GetTracklets(plane-1).GetN()) > 20) { - t.SetBudget(2,0.0); - } - } +// if (calibra->GetMITracking()) { +// calibra->UpdateHistograms(cl,&t); +// } - } + // Reset material budget if 2 consecutive gold + if (layer > 0) { + if ((t.GetTracklets(layer).GetN() + t.GetTracklets(layer-1).GetN()) > 20) { + t.SetBudget(2,0.0); + } + } + + } } @@ -1379,25 +1148,27 @@ Int_t AliTRDtracker::FollowBackProlongation(AliTRDtrack &t) } return expectedNumberOfClusters; + } //_____________________________________________________________________________ Int_t AliTRDtracker::PropagateToX(AliTRDtrack &t, Double_t xToGo, Double_t maxStep) { // - // Starting from current radial position of track this function + // Starting from current X-position of track this function // extrapolates the track up to radial position . // Returns 1 if track reaches the plane, and 0 otherwise // const Double_t kEpsilon = 0.00001; - //Double_t tanmax = TMath::Tan(0.5*AliTRDgeometry::GetAlpha()); + + // Current track X-position Double_t xpos = t.GetX(); - Double_t dir = (xpos kEpsilon) { + // Direction: inward or outward + Double_t dir = (xpos < xToGo) ? 1.0 : -1.0; - Double_t step = dir * TMath::Min(TMath::Abs(xToGo-xpos),maxStep); + while (((xToGo - xpos) * dir) > kEpsilon) { Double_t xyz0[3]; Double_t xyz1[3]; @@ -1405,23 +1176,39 @@ Int_t AliTRDtracker::PropagateToX(AliTRDtrack &t, Double_t xToGo, Double_t maxSt Double_t x; Double_t y; Double_t z; - // Starting global position - t.GetXYZ(xyz0); + + // The next step size + Double_t step = dir * TMath::Min(TMath::Abs(xToGo-xpos),maxStep); + + // Get the global position of the starting point + t.GetXYZ(xyz0); + + // X-position after next step x = xpos + step; + // Get local Y and Z at the X-position of the next step if (!t.GetProlongation(x,y,z)) { - return 0; // No prolongation + return 0; // No prolongation possible } + // The global position of the end point of this prolongation step xyz1[0] = x * TMath::Cos(t.GetAlpha()) - y * TMath::Sin(t.GetAlpha()); xyz1[1] = +x * TMath::Sin(t.GetAlpha()) + y * TMath::Cos(t.GetAlpha()); xyz1[2] = z; - AliKalmanTrack::MeanMaterialBudget(xyz0,xyz1,param); - if (!t.PropagateTo(x,param[1],param[0])) { + // Calculate the mean material budget between start and + // end point of this prolongation step + AliTracker::MeanMaterialBudget(xyz0,xyz1,param); + + // Propagate the track to the X-position after the next step + if (!t.PropagateTo(x,param[1],param[0]*param[4])) { return 0; } + + // Rotate the track if necessary AdjustSector(&t); + + // New track X-position xpos = t.GetX(); } @@ -1439,50 +1226,42 @@ Int_t AliTRDtracker::LoadClusters(TTree *cTree) // differs from that of TRD sectors // - if (ReadClusters(fClusters,cTree)) { - AliError("Problem with reading the clusters !"); - return 1; + + if (ReadClusters(fClusters, cTree)) { + AliError("Problem with reading the clusters !"); + return 1; } - Int_t ncl = fClusters->GetEntriesFast(); + Int_t ncl = fClusters->GetEntriesFast(); fNclusters = ncl; AliInfo(Form("Sorting %d clusters",ncl)); UInt_t index; - for (Int_t ichamber = 0; ichamber < 5; ichamber++) { - for (Int_t isector = 0; isector < 18; isector++) { - fHoles[ichamber][isector] = kTRUE; - } - } - while (ncl--) { AliTRDcluster *c = (AliTRDcluster *) fClusters->UncheckedAt(ncl); Int_t detector = c->GetDetector(); Int_t localTimeBin = c->GetLocalTimeBin(); Int_t sector = fGeom->GetSector(detector); - Int_t plane = fGeom->GetPlane(detector); + Int_t layer = fGeom->GetLayer(detector); Int_t trackingSector = sector; - //if (c->GetLabel(0) > 0) { - if (c->GetQ() > 10) { - Int_t chamber = fGeom->GetChamber(detector); - fHoles[chamber][trackingSector] = kFALSE; - } + //if (c->GetQ() > 10) { + // Int_t stack = fGeom->GetStack(detector); + //} - Int_t gtb = fTrSec[trackingSector]->CookTimeBinIndex(plane,localTimeBin); + Int_t gtb = fTrSec[trackingSector]->CookTimeBinIndex(layer,localTimeBin); if (gtb < 0) { continue; } - Int_t layer = fTrSec[trackingSector]->GetLayerNumber(gtb); + Int_t trLayer = fTrSec[trackingSector]->GetLayerNumber(gtb); index = ncl; - // Apply pos correction - Transform(c); fHXCl->Fill(c->GetX()); - fTrSec[trackingSector]->GetLayer(layer)->SetX(c->GetX()); - fTrSec[trackingSector]->GetLayer(layer)->InsertCluster(c,index); + fTrSec[trackingSector]->GetLayer(trLayer)->SetX(c->GetX()); + fTrSec[trackingSector]->GetLayer(trLayer)->InsertCluster(c,index); + } return 0; @@ -1515,7 +1294,7 @@ void AliTRDtracker::UnloadClusters() delete fTracks->RemoveAt(i); } - Int_t nsec = AliTRDgeometry::kNsect; + Int_t nsec = AliTRDgeometry::kNsector; for (i = 0; i < nsec; i++) { for(Int_t pl = 0; pl < fTrSec[i]->GetNumberOfLayers(); pl++) { fTrSec[i]->GetLayer(pl)->Clear(); @@ -1525,7 +1304,7 @@ void AliTRDtracker::UnloadClusters() } //_____________________________________________________________________________ -void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) +Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd) { // // Creates seeds using clusters between position inner plane and outer plane @@ -1544,7 +1323,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) const Double_t kRoad2z = 20.0; // Road in z for extrapolated cluster const Int_t kMaxSeed = 3000; - Int_t maxSec = AliTRDgeometry::kNsect; + Int_t maxSec = AliTRDgeometry::kNsector; // Linear fitters in planes TLinearFitter fitterTC(2,"hyp2"); // Fitting with tilting pads - kz fixed - kz= Z/x, + vertex const @@ -1563,22 +1342,22 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) } for (Int_t ns = 0; ns < maxSec; ns++) { for (Int_t ilayer = 0; ilayer < fTrSec[ns]->GetNumberOfLayers(); ilayer++) { - AliTRDpropagationLayer &layer = *(fTrSec[ns]->GetLayer(ilayer)); - if (layer == 0) { + AliTRDpropagationLayer &propLayer = *(fTrSec[ns]->GetLayer(ilayer)); + if (propLayer == 0) { continue; } - Int_t det = layer[0]->GetDetector(); - Int_t plane = fGeom->GetPlane(det); - if (ilayer < layers[plane][0]) { - layers[plane][0] = ilayer; + Int_t det = propLayer[0]->GetDetector(); + Int_t layer = fGeom->GetLayer(det); + if (ilayer < layers[layer][0]) { + layers[layer][0] = ilayer; } - if (ilayer > layers[plane][1]) { - layers[plane][1] = ilayer; + if (ilayer > layers[layer][1]) { + layers[layer][1] = ilayer; } } } - AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(0,0); + AliTRDpadPlane *padPlane = fGeom->GetPadPlane(0,0); Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle()); Double_t hL[6]; // Tilting angle Double_t xcl[6]; // X - position of reference cluster @@ -1785,7 +1564,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) isFake = kTRUE; } - if (AliTRDReconstructor::StreamLevel() > 0) { + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { if ((!isFake) || ((icl3%10) == 0)) { // Debugging print TTreeSRedirector &cstream = *fDebugStreamer; cstream << "Seeds0" @@ -1831,7 +1610,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) cseed[sLayer+jLayer].SetPadLength(padlength[sLayer+jLayer]); cseed[sLayer+jLayer].SetX0(xcl[sLayer+jLayer]); - for (Int_t iter = 0; iter < 2; iter++) { + for (Int_t jter = 0; jter < 2; jter++) { // // In iteration 0 we try only one pad-row @@ -1839,7 +1618,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) // AliTRDseed tseed = cseed[sLayer+jLayer]; Float_t roadz = padlength[sLayer+jLayer] * 0.5; - if (iter > 0) { + if (jter > 0) { roadz = padlength[sLayer+jLayer]; } @@ -1851,7 +1630,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) Double_t dxlayer = layer.GetX() - xcl[sLayer+jLayer]; Double_t zexp = cl[sLayer+jLayer]->GetZ(); - if (iter > 0) { + if (jter > 0) { // Try 2 pad-rows in second iteration zexp = tseed.GetZref(0) + tseed.GetZref(1) * dxlayer; if (zexp > cl[sLayer+jLayer]->GetZ()) { @@ -1867,13 +1646,13 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) if (index <= 0) { continue; } - AliTRDcluster *cl = (AliTRDcluster *) GetCluster(index); + AliTRDcluster *clu = (AliTRDcluster *) GetCluster(index); tseed.SetIndexes(iTime,index); - tseed.SetClusters(iTime,cl); // Register cluster - tseed.SetX(iTime,dxlayer); // Register cluster - tseed.SetY(iTime,cl->GetY()); // Register cluster - tseed.SetZ(iTime,cl->GetZ()); // Register cluster + tseed.SetClusters(iTime,clu); // Register cluster + tseed.SetX(iTime,dxlayer); // Register cluster + tseed.SetY(iTime,clu->GetY()); // Register cluster + tseed.SetZ(iTime,clu->GetZ()); // Register cluster } @@ -1884,7 +1663,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) Float_t tquality = (18.0 - tseed.GetN2()) / 2.0 + TMath::Abs(dangle) / 0.1 + TMath::Abs(tseed.GetYfit(0) - tseed.GetYref(0)) / 0.2 + 2.0 * TMath::Abs(tseed.GetMeanz() - tseed.GetZref(0)) / padlength[jLayer]; - if ((iter == 0) && tseed.IsOK()) { + if ((jter == 0) && tseed.IsOK()) { cseed[sLayer+jLayer] = tseed; quality = tquality; if (tquality < 5) { @@ -1895,7 +1674,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) cseed[sLayer+jLayer] = tseed; } - } // Loop: iter + } // Loop: jter if (!cseed[sLayer+jLayer].IsOK()) { isOK = kFALSE; @@ -2036,7 +1815,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) Float_t zexp = cseed[jLayer].GetZref(0); Double_t zroad = padlength[jLayer] * 0.5 + 1.0; - for (Int_t iter = 0; iter < 2; iter++) { + for (Int_t jter = 0; jter < 2; jter++) { AliTRDseed tseed = cseed[jLayer]; Float_t quality = 10000.0; @@ -2050,12 +1829,12 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) if (index <= 0) { continue; } - AliTRDcluster *cl = (AliTRDcluster *) GetCluster(index); + AliTRDcluster *clu = (AliTRDcluster *) GetCluster(index); tseed.SetIndexes(iTime,index); - tseed.SetClusters(iTime,cl); // Register cluster - tseed.SetX(iTime,dxlayer); // Register cluster - tseed.SetY(iTime,cl->GetY()); // Register cluster - tseed.SetZ(iTime,cl->GetZ()); // Register cluster + tseed.SetClusters(iTime,clu); // Register cluster + tseed.SetX(iTime,dxlayer); // Register cluster + tseed.SetY(iTime,clu->GetY()); // Register cluster + tseed.SetZ(iTime,clu->GetZ()); // Register cluster } tseed.Update(); @@ -2072,7 +1851,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) zroad *= 2.0; - } // Loop: iter + } // Loop: jter if ( cseed[jLayer].IsOK()) { cseed[jLayer].CookLabels(); @@ -2092,7 +1871,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) Float_t lastchi2 = 10000.0; Float_t chi2 = 1000.0; - for (Int_t iter = 0; iter < 4; iter++) { + for (Int_t jter = 0; jter < 4; jter++) { // Sort tracklets according "quality", try to "improve" 4 worst Float_t sumquality = 0.0; @@ -2121,7 +1900,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) } lastquality = sumquality; lastchi2 = chi2; - if (iter > 0) { + if (jter > 0) { for (Int_t jLayer = 0; jLayer < 6; jLayer++) { cseed[jLayer] = bseed[jLayer]; } @@ -2156,13 +1935,13 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) if (index <= 0) { continue; } - AliTRDcluster *cl = (AliTRDcluster *) GetCluster(index); + AliTRDcluster *clu = (AliTRDcluster *) GetCluster(index); tseed.SetIndexes(iTime,index); - tseed.SetClusters(iTime,cl); // Register cluster - tseed.SetX(iTime,dxlayer); // Register cluster - tseed.SetY(iTime,cl->GetY()); // Register cluster - tseed.SetZ(iTime,cl->GetZ()); // Register cluster + tseed.SetClusters(iTime,clu); // Register cluster + tseed.SetX(iTime,dxlayer); // Register cluster + tseed.SetY(iTime,clu->GetY()); // Register cluster + tseed.SetZ(iTime,clu->GetZ()); // Register cluster } @@ -2183,7 +1962,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) chi2 = AliTRDseed::FitRiemanTilt(bseed,kTRUE); - } // Loop: iter + } // Loop: jter nclusters = 0; nlayers = 0; @@ -2423,7 +2202,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) if (1 || (!isFake)) { Float_t zvertex = GetZ(); TTreeSRedirector &cstream = *fDebugStreamer; - if (AliTRDReconstructor::StreamLevel() > 0) { + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { cstream << "Seeds1" << "isFake=" << isFake << "Vertex=" << zvertex @@ -2506,7 +2285,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) signedseed[i] = kFALSE; } - for (Int_t iter = 0; iter < 5; iter++) { + for (Int_t jter = 0; jter < 5; jter++) { for (Int_t iseed = 0; iseed < registered; iseed++) { @@ -2554,7 +2333,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) continue; } - if (iter == 0) { + if (jter == 0) { if (nlayers < 6) { continue; } @@ -2563,7 +2342,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) } } - if (iter == 1) { + if (jter == 1) { if (nlayers < findable) { continue; } @@ -2572,7 +2351,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) } } - if (iter == 2) { + if (jter == 2) { if ((nlayers == findable) || (nlayers == 6)) { continue; @@ -2582,13 +2361,13 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) } } - if (iter == 3) { + if (jter == 3) { if (TMath::Log(0.000000001+seedquality2[index]) < -5.0) { continue; } } - if (iter == 4) { + if (jter == 4) { if (TMath::Log(0.000000001+seedquality2[index]) - nused/(nlayers-3.0) < -15.0) { continue; } @@ -2644,8 +2423,7 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) esdtrack.UpdateTrackParams(track,AliESDtrack::kTRDout); esdtrack.SetLabel(label); esd->AddTrack(&esdtrack); - TTreeSRedirector &cstream = *fDebugStreamer; - if (AliTRDReconstructor::StreamLevel() > 0) { + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { cstream << "Tracks" << "EventNrInFile=" << eventNrInFile << "ESD.=" << &esdtrack @@ -2655,9 +2433,9 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) } } - if (AliTRDReconstructor::StreamLevel() > 0) { + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { cstream << "Seeds2" - << "Iter=" << iter + << "Iter=" << jter << "Track.=" << track << "Like=" << seedquality[index] << "LikeF=" << seedquality2[index] @@ -2683,20 +2461,21 @@ void AliTRDtracker::MakeSeedsMI(Int_t /*inner*/, Int_t /*outer*/, AliESD *esd) } // Loop: iseed - } // Loop: iter + } // Loop: jter } // End of loop over sectors delete [] pseed; + return 0; } //_____________________________________________________________________________ Int_t AliTRDtracker::ReadClusters(TObjArray *array, TTree *clusterTree) const { // - // Reads AliTRDclusters (option >= 0) or AliTRDrecPoints (option < 0) - // from the file. The names of the cluster tree and branches + // Reads AliTRDclusters from the file. + // The names of the cluster tree and branches // should match the ones used in AliTRDclusterizer::WriteClusters() // @@ -2713,7 +2492,7 @@ Int_t AliTRDtracker::ReadClusters(TObjArray *array, TTree *clusterTree) const // Loop through all entries in the tree Int_t nEntries = (Int_t) clusterTree->GetEntries(); Int_t nbytes = 0; - AliTRDcluster *c = 0; + AliTRDcluster *c = NULL; for (Int_t iEntry = 0; iEntry < nEntries; iEntry++) { // Import the tree @@ -2721,17 +2500,15 @@ Int_t AliTRDtracker::ReadClusters(TObjArray *array, TTree *clusterTree) const // Get the number of points in the detector Int_t nCluster = clusterArray->GetEntriesFast(); - // Loop through all TRD digits for (Int_t iCluster = 0; iCluster < nCluster; iCluster++) { - c = (AliTRDcluster *) clusterArray->UncheckedAt(iCluster); - AliTRDcluster *co = c; - array->AddLast(co); + if(!(c = (AliTRDcluster *) clusterArray->UncheckedAt(iCluster))) continue; + array->AddLast(c); + //printf("Add cluster 0x%x.\n", c); clusterArray->RemoveAt(iCluster); } } - delete clusterArray; return 0; @@ -2747,40 +2524,40 @@ Bool_t AliTRDtracker::GetTrackPoint(Int_t index, AliTrackPoint &p) const // AliTRDcluster *cl = (AliTRDcluster *) fClusters->UncheckedAt(index); - Int_t idet = cl->GetDetector(); - Int_t isector = fGeom->GetSector(idet); - Int_t ichamber = fGeom->GetChamber(idet); - Int_t iplan = fGeom->GetPlane(idet); + Int_t idet = cl->GetDetector(); + Int_t isector = fGeom->GetSector(idet); + Int_t istack = fGeom->GetStack(idet); + Int_t ilayer = fGeom->GetLayer(idet); Double_t local[3]; - local[0] = GetX(isector,iplan,cl->GetLocalTimeBin()); + local[0] = GetX(isector,ilayer,cl->GetLocalTimeBin()); local[1] = cl->GetY(); local[2] = cl->GetZ(); Double_t global[3]; fGeom->RotateBack(idet,local,global); p.SetXYZ(global[0],global[1],global[2]); - AliAlignObj::ELayerID iLayer = AliAlignObj::kTRD1; - switch (iplan) { + AliGeomManager::ELayerID iGeoLayer = AliGeomManager::kTRD1; + switch (ilayer) { case 0: - iLayer = AliAlignObj::kTRD1; + iGeoLayer = AliGeomManager::kTRD1; break; case 1: - iLayer = AliAlignObj::kTRD2; + iGeoLayer = AliGeomManager::kTRD2; break; case 2: - iLayer = AliAlignObj::kTRD3; + iGeoLayer = AliGeomManager::kTRD3; break; case 3: - iLayer = AliAlignObj::kTRD4; + iGeoLayer = AliGeomManager::kTRD4; break; case 4: - iLayer = AliAlignObj::kTRD5; + iGeoLayer = AliGeomManager::kTRD5; break; case 5: - iLayer = AliAlignObj::kTRD6; + iGeoLayer = AliGeomManager::kTRD6; break; }; - Int_t modId = isector * fGeom->Ncham() + ichamber; - UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,modId); + Int_t modId = isector * fGeom->Nstack() + istack; + UShort_t volid = AliGeomManager::LayerToVolUID(iGeoLayer,modId); p.SetVolumeID(volid); return kTRUE; @@ -2886,11 +2663,11 @@ void AliTRDtracker::UseClusters(const AliKalmanTrack *t, Int_t from) const for (Int_t i = from; i < ncl; i++) { Int_t index = t->GetClusterIndex(i); AliTRDcluster *c = (AliTRDcluster *) fClusters->UncheckedAt(index); - Int_t iplane = fGeom->GetPlane(c->GetDetector()); - if (track->GetTracklets(iplane).GetChi2() > kmaxchi2) { + Int_t ilayer = fGeom->GetLayer(c->GetDetector()); + if (track->GetTracklets(ilayer).GetChi2() > kmaxchi2) { continue; } - if (track->GetTracklets(iplane).GetN() < kmincl) { + if (track->GetTracklets(ilayer).GetN() < kmincl) { continue; } if (!(c->IsUsed())) { @@ -2939,68 +2716,6 @@ Double_t AliTRDtracker::GetX(Int_t sector, Int_t plane, Int_t localTB) const } -//_____________________________________________________________________________ -AliTRDtracker::AliTRDpropagationLayer - ::AliTRDpropagationLayer(Double_t x, Double_t dx, Double_t rho - , Double_t radLength, Int_t tbIndex, Int_t plane) - :fN(0) - ,fSec(0) - ,fClusters(NULL) - ,fIndex(NULL) - ,fX(x) - ,fdX(dx) - ,fRho(rho) - ,fX0(radLength) - ,fTimeBinIndex(tbIndex) - ,fPlane(plane) - ,fYmax(0) - ,fYmaxSensitive(0) - ,fHole(kFALSE) - ,fHoleZc(0) - ,fHoleZmax(0) - ,fHoleYc(0) - ,fHoleYmax(0) - ,fHoleRho(0) - ,fHoleX0(0) -{ - // - // AliTRDpropagationLayer constructor - // - - for (Int_t i = 0; i < (Int_t) kZones; i++) { - fZc[i] = 0; - fZmax[i] = 0; - } - - if (fTimeBinIndex >= 0) { - fClusters = new AliTRDcluster*[kMaxClusterPerTimeBin]; - fIndex = new UInt_t[kMaxClusterPerTimeBin]; - } - - for (Int_t i = 0; i < 5; i++) { - fIsHole[i] = kFALSE; - } - -} - -//_____________________________________________________________________________ -void AliTRDtracker::AliTRDpropagationLayer - ::SetHole(Double_t Zmax, Double_t Ymax, Double_t rho - , Double_t radLength, Double_t Yc, Double_t Zc) -{ - // - // Sets hole in the layer - // - - fHole = kTRUE; - fHoleZc = Zc; - fHoleZmax = Zmax; - fHoleYc = Yc; - fHoleYmax = Ymax; - fHoleRho = rho; - fHoleX0 = radLength; - -} //_____________________________________________________________________________ AliTRDtracker::AliTRDtrackingSector @@ -3017,9 +2732,9 @@ AliTRDtracker::AliTRDtrackingSector AliTRDpropagationLayer *ppl = 0; // Get holes description from geometry - Bool_t holes[AliTRDgeometry::kNcham]; - for (Int_t icham = 0; icham < AliTRDgeometry::kNcham; icham++) { - holes[icham] = fGeom->IsHole(0,icham,gs); + Bool_t holes[AliTRDgeometry::kNstack]; + for (Int_t istack = 0; istack < AliTRDgeometry::kNstack; istack++) { + holes[istack] = fGeom->IsHole(0,istack,gs); } for (UInt_t i = 0; i < kMaxTimeBinIndex; i++) { @@ -3035,58 +2750,57 @@ AliTRDtracker::AliTRDtrackingSector Double_t dxAmp = (Double_t) fGeom->CamHght(); // Amplification region //Double_t dxDrift = (Double_t) fGeom->CdrHght(); // Drift region - const Int_t kNchambers = AliTRDgeometry::Ncham(); + const Int_t kNstacks = AliTRDgeometry::Nstack(); Int_t tbIndex; Double_t ymax = 0; Double_t ymaxsensitive = 0; - Double_t *zc = new Double_t[kNchambers]; - Double_t *zmax = new Double_t[kNchambers]; - Double_t *zmaxsensitive = new Double_t[kNchambers]; - - AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance(); - if (!commonParam) { - AliErrorGeneral("AliTRDtrackingSector::Ctor" - ,"Could not get common parameters\n"); - return; - } + Double_t *zc = new Double_t[kNstacks]; + Double_t *zmax = new Double_t[kNstacks]; + Double_t *zmaxsensitive = new Double_t[kNstacks]; - for (Int_t plane = 0; plane < AliTRDgeometry::Nplan(); plane++) { + for (Int_t layer = 0; layer < AliTRDgeometry::Nlayer(); layer++) { - ymax = fGeom->GetChamberWidth(plane) / 2.0; - padPlane = commonParam->GetPadPlane(plane,0); + ymax = fGeom->GetChamberWidth(layer) / 2.0; + padPlane = fGeom->GetPadPlane(layer,0); ymaxsensitive = (padPlane->GetColSize(1) * padPlane->GetNcols() - 4.0) / 2.0; - for (Int_t ch = 0; ch < kNchambers; ch++) { - zmax[ch] = fGeom->GetChamberLength(plane,ch) / 2.0; + for (Int_t st = 0; st < kNstacks; st++) { + zmax[st] = fGeom->GetChamberLength(layer,st) / 2.0; Float_t pad = padPlane->GetRowSize(1); - Float_t row0 = commonParam->GetRow0(plane,ch,0); - Int_t nPads = commonParam->GetRowMax(plane,ch,0); - zmaxsensitive[ch] = Float_t(nPads) * pad / 2.0; - zc[ch] = -(pad * nPads) / 2.0 + row0; + Float_t row0 = fGeom->GetRow0(layer,st,0); + Int_t nPads = fGeom->GetRowMax(layer,st,0); + zmaxsensitive[st] = Float_t(nPads) * pad / 2.0; + zc[st] = -(pad * nPads) / 2.0 + row0; } - dx = AliTRDcalibDB::Instance()->GetVdrift(0,0,0) - / commonParam->GetSamplingFrequency(); + AliTRDcalibDB *fCalibration = AliTRDcalibDB::Instance(); + dx = fCalibration->GetVdrift(0,0,0) + / AliTRDCommonParam::Instance()->GetSamplingFrequency(); rho = 0.00295 * 0.85; //???? radLength = 11.0; - Double_t x0 = (Double_t) AliTRDgeometry::GetTime0(plane); + Double_t x0 = (Double_t) AliTRDgeometry::GetTime0(layer); //Double_t xbottom = x0 - dxDrift; //Double_t xtop = x0 + dxAmp; + + //temporary !! (A.Bercuci) + Int_t t0 = (Int_t)fCalibration->GetT0Average(AliTRDgeometry::GetDetector(layer, 2, gs)); - Int_t nTimeBins = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); + Int_t nTimeBins = AliTRDcalibDB::Instance()->GetNumberOfTimeBinsDCS(); for (Int_t iTime = 0; iTime < nTimeBins; iTime++) { Double_t xlayer = iTime * dx - dxAmp; //if (xlayer<0) xlayer = dxAmp / 2.0; x = x0 - xlayer; - tbIndex = CookTimeBinIndex(plane,iTime); - ppl = new AliTRDpropagationLayer(x,dx,rho,radLength,tbIndex,plane); + tbIndex = CookTimeBinIndex(layer,iTime); + ppl = new AliTRDpropagationLayer(x,dx,rho,radLength,tbIndex,layer); ppl->SetYmax(ymax,ymaxsensitive); ppl->SetZ(zc,zmax,zmaxsensitive); ppl->SetHoles(holes); - InsertLayer(ppl); + if(iTime == t0) ppl->SetT0(); + + InsertLayer(ppl); } @@ -3113,17 +2827,31 @@ AliTRDtracker::AliTRDtrackingSector } +//_____________________________________________________________________________ +AliTRDtracker::AliTRDtrackingSector + ::~AliTRDtrackingSector() +{ + // + // Destructor + // + + for (Int_t i = 0; i < fN; i++) { + delete fLayers[i]; + } + +} + //_____________________________________________________________________________ Int_t AliTRDtracker::AliTRDtrackingSector ::CookTimeBinIndex(Int_t plane, Int_t localTB) const { // - // depending on the digitization parameters calculates "global" - // time bin index for timebin in plane - // + // Depending on the digitization parameters calculates global + // (i.e. for a whole TRD stack of 6 planes) time bin index for + // timebin in plane // - Int_t tbPerPlane = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); + Int_t tbPerPlane = AliTRDcalibDB::Instance()->GetNumberOfTimeBinsDCS(); Int_t gtb = (plane+1) * tbPerPlane - localTB - 1; if (localTB < 0) { return -1; @@ -3310,140 +3038,6 @@ Int_t AliTRDtracker::AliTRDtrackingSector } -//_____________________________________________________________________________ -void AliTRDtracker::AliTRDpropagationLayer - ::SetZ(Double_t *center, Double_t *w, Double_t *wsensitive ) -{ - // - // set centers and the width of sectors - // - - for (Int_t icham = 0; icham < AliTRDgeometry::kNcham; icham++) { - fZc[icham] = center[icham]; - fZmax[icham] = w[icham]; - fZmaxSensitive[icham] = wsensitive[icham]; - } - -} - -//_____________________________________________________________________________ -void AliTRDtracker::AliTRDpropagationLayer::SetHoles(Bool_t *holes) -{ - // - // set centers and the width of sectors - // - - fHole = kFALSE; - - for (Int_t icham = 0; icham < AliTRDgeometry::kNcham; icham++) { - fIsHole[icham] = holes[icham]; - if (holes[icham]) { - fHole = kTRUE; - } - } - -} - -//_____________________________________________________________________________ -void AliTRDtracker::AliTRDpropagationLayer - ::InsertCluster(AliTRDcluster *c, UInt_t index) -{ - // - // Insert cluster in cluster array. - // Clusters are sorted according to Y coordinate. - // - - if (fTimeBinIndex < 0) { - //AliWarning("Attempt to insert cluster into non-sensitive time bin!\n"); - return; - } - - if (fN == (Int_t) kMaxClusterPerTimeBin) { - //AliWarning("Too many clusters !\n"); - return; - } - - if (fN == 0) { - fIndex[0] = index; - fClusters[fN++] = c; - return; - } - - Int_t i = Find(c->GetY()); - memmove(fClusters+i+1,fClusters+i,(fN-i)*sizeof(AliTRDcluster*)); - memmove(fIndex +i+1,fIndex +i,(fN-i)*sizeof(UInt_t)); - fIndex[i] = index; - fClusters[i] = c; - fN++; - -} - -//_____________________________________________________________________________ -Int_t AliTRDtracker::AliTRDpropagationLayer::Find(Float_t y) const -{ - // - // Returns index of the cluster nearest in Y - // - - if (fN <= 0) { - return 0; - } - if (y <= fClusters[0]->GetY()) { - return 0; - } - if (y > fClusters[fN-1]->GetY()) { - return fN; - } - - Int_t b = 0; - Int_t e = fN - 1; - Int_t m = (b + e) / 2; - - for ( ; b < e; m = (b + e) / 2) { - if (y > fClusters[m]->GetY()) { - b = m + 1; - } - else { - e = m; - } - } - - return m; - -} - -//_____________________________________________________________________________ -Int_t AliTRDtracker::AliTRDpropagationLayer - ::FindNearestCluster(Float_t y, Float_t z, Float_t maxroad - , Float_t maxroadz) const -{ - // - // Returns index of the cluster nearest to the given y,z - // - - Int_t index = -1; - Int_t maxn = fN; - Float_t mindist = maxroad; - - for (Int_t i = Find(y-maxroad); i < maxn; i++) { - AliTRDcluster *c = (AliTRDcluster *) (fClusters[i]); - Float_t ycl = c->GetY(); - if (ycl > (y + maxroad)) { - break; - } - if (TMath::Abs(c->GetZ() - z) > maxroadz) { - continue; - } - if (TMath::Abs(ycl - y) < mindist) { - mindist = TMath::Abs(ycl - y); - index = fIndex[i]; - } - } - - return index; - -} - //_____________________________________________________________________________ Double_t AliTRDtracker::GetTiltFactor(const AliTRDcluster *c) { @@ -3452,8 +3046,8 @@ Double_t AliTRDtracker::GetTiltFactor(const AliTRDcluster *c) // Int_t det = c->GetDetector(); - Int_t plane = fGeom->GetPlane(det); - AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(plane,0); + Int_t layer = fGeom->GetLayer(det); + AliTRDpadPlane *padPlane = fGeom->GetPadPlane(layer,0); Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle()); if (fNoTilt) { @@ -3465,133 +3059,54 @@ Double_t AliTRDtracker::GetTiltFactor(const AliTRDcluster *c) } //_____________________________________________________________________________ -void AliTRDtracker::CookdEdxTimBin(AliTRDtrack &TRDtrack) +Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 + , AliTRDtrack *track + , Int_t *clusters + , AliTRDtracklet &tracklet) { // - // This is setting fdEdxPlane and fTimBinPlane - // Sums up the charge in each plane for track TRDtrack and also get the - // Time bin for Max. Cluster - // Prashant Shukla (shukla@physi.uni-heidelberg.de) + // Try to find the nearest clusters to the track in the time bins + // between and . + // Also the corresponding tracklet is calculated + // Correction coeficients - depend on TRD parameters - to be changed accordingly // - Double_t clscharge[AliESDtrack::kNPlane][AliESDtrack::kNSlice]; - Double_t maxclscharge[AliESDtrack::kNPlane]; - Int_t nCluster[AliESDtrack::kNPlane][AliESDtrack::kNSlice]; - Int_t timebin[AliESDtrack::kNPlane]; + const Int_t kN1 = 100; + const Int_t kN2 = 10; - // Initialization of cluster charge per plane. - for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++) { - for (Int_t iSlice = 0; iSlice < AliESDtrack::kNSlice; iSlice++) { - clscharge[iPlane][iSlice] = 0.0; - nCluster[iPlane][iSlice] = 0; - } - } + Double_t x[kN1]; + Double_t yt[kN1]; + Double_t zt[kN1]; + Float_t zmean[kN1]; + Float_t nmean[kN1]; - // Initialization of cluster charge per plane. - for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++) { - timebin[iPlane] = -1; - maxclscharge[iPlane] = 0.0; - } + Double_t dz[kN2][kN1]; + Double_t dy[kN2][kN1]; + Int_t indexes[kN2][kN1]; // Indexes of the clusters in the road + Int_t best[kN2][kN1]; // Index of best matching cluster + AliTRDcluster *cl[kN2][kN1]; // Pointers to the clusters in the road - // Loop through all clusters associated to track TRDtrack - Int_t nClus = TRDtrack.GetNumberOfClusters(); // from Kalmantrack - for (Int_t iClus = 0; iClus < nClus; iClus++) { - Double_t charge = TRDtrack.GetClusterdQdl(iClus); - Int_t index = TRDtrack.GetClusterIndex(iClus); - AliTRDcluster *pTRDcluster = (AliTRDcluster *) GetCluster(index); - if (!pTRDcluster) { - continue; - } - Int_t tb = pTRDcluster->GetLocalTimeBin(); - if (!tb) { - continue; - } - Int_t detector = pTRDcluster->GetDetector(); - Int_t iPlane = fGeom->GetPlane(detector); - if (iPlane >= AliESDtrack::kNPlane) { - AliError(Form("Wrong plane %d",iPlane)); - continue; - } - Int_t iSlice = tb * AliESDtrack::kNSlice - / AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); - if (iSlice >= AliESDtrack::kNSlice) { - AliError(Form("Wrong slice %d",iSlice)); - continue; - } - clscharge[iPlane][iSlice] = clscharge[iPlane][iSlice] + charge; - if (charge > maxclscharge[iPlane]) { - maxclscharge[iPlane] = charge; - timebin[iPlane] = tb; - } - nCluster[iPlane][iSlice]++; - } // End of loop over cluster - - // Setting the fdEdxPlane and fTimBinPlane variabales - Double_t totalCharge = 0.0; - - for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++) { - for (Int_t iSlice = 0; iSlice < AliESDtrack::kNSlice; iSlice++) { - if (nCluster[iPlane][iSlice]) { - clscharge[iPlane][iSlice] /= nCluster[iPlane][iSlice]; - } - TRDtrack.SetPIDsignals(clscharge[iPlane][iSlice],iPlane,iSlice); - totalCharge = totalCharge+clscharge[iPlane][iSlice]; - } - TRDtrack.SetPIDTimBin(timebin[iPlane],iPlane); - } - - // Still needed ???? - // Int_t i; - // Int_t nc=TRDtrack.GetNumberOfClusters(); - // Float_t dedx=0; - // for (i=0; iGetX(); @@ -3599,23 +3114,23 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 Int_t nall = 0; Int_t nfound = 0; Double_t h01 = 0.0; - Int_t plane = -1; + Int_t layer = -1; Int_t detector = -1; Float_t padlength = 0.0; + AliTRDtrack track2(* track); Float_t snpy = track->GetSnp(); - Float_t tany = TMath::Sqrt(snpy*snpy / (1.0 - snpy*snpy)); + Float_t tany = TMath::Sqrt(snpy*snpy / ((1.-snpy)*(1.+snpy))); if (snpy < 0.0) { tany *= -1.0; } - Double_t sy2 = ExpectedSigmaY2(x0,track->GetTgl(),track->GetPt()); + Double_t sy2 = ExpectedSigmaY2(x0,track->GetTgl(),track->GetSignedPt()); Double_t sz2 = ExpectedSigmaZ2(x0,track->GetTgl()); Double_t road = 15.0 * TMath::Sqrt(track->GetSigmaY2() + sy2); if (road > 6.0) { road = 6.0; } - //road = 20.0; for (Int_t it = 0; it < t1-t0; it++) { @@ -3639,33 +3154,30 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 // // Find 2 nearest cluster at given time bin // - int checkPoint[4] = {0,0,0,0}; - double minY = 123456789; - double minD[2] = {1,1}; + Int_t checkPoint[4] = { 0, 0, 0, 0 }; + Double_t minY = 123456789.0; + Double_t minD[2] = { 1.0, 1.0 }; for (Int_t i = timeBin.Find(y - road); i < maxn; i++) { - //for (Int_t i = 0; i < maxn; i++) { AliTRDcluster *c = (AliTRDcluster *) (timeBin[i]); h01 = GetTiltFactor(c); - if (plane < 0) { + if (layer < 0) { Int_t det = c->GetDetector(); - plane = fGeom->GetPlane(det); + layer = fGeom->GetLayer(det); padlength = TMath::Sqrt(c->GetSigmaZ2() * 12.0); } - //if (c->GetLocalTimeBin()==0) continue; if (c->GetY() > (y + road)) { break; } fHDeltaX->Fill(c->GetX() - x[it]); - //printf("%f\t%f\t%f \n", c->GetX(), x[it], c->GetX()-x[it]); if (TMath::Abs(c->GetY()-y) < TMath::Abs(minY)) { - minY = c->GetY()-y; - minD[0] = c->GetY()-y; - minD[1] = c->GetZ()-z; + minY = c->GetY() - y; + minD[0] = c->GetY() - y; + minD[1] = c->GetZ() - z; } checkPoint[0]++; @@ -3677,13 +3189,13 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 checkPoint[1]++; Double_t dist = TMath::Abs(c->GetZ() - z); - if (dist > (0.5 * padlength + 6.0 * sigmaz)) { // 0.5 + if (dist > (0.5 * padlength + 6.0 * sigmaz)) { continue; // 6 sigma boundary cut } checkPoint[2]++; - Double_t cost = 0.0; // Sigma boundary cost function + Double_t cost = 0.0; if (dist> (0.5 * padlength - sigmaz)){ cost = (dist - 0.5*padlength) / (2.0 * sigmaz); if (cost > -1) { @@ -3693,8 +3205,6 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 cost = 0.0; } } - //Int_t label = TMath::Abs(track->GetLabel()); - //if (c->GetLabel(0)!=label && c->GetLabel(1)!=label&&c->GetLabel(2)!=label) continue; chi2 = track2.GetPredictedChi2(c,h01) + cost; clfound++; @@ -3703,8 +3213,8 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 } checkPoint[3]++; - detector = c->GetDetector(); // Store the clusters in the road + detector = c->GetDetector(); for (Int_t ih = 2; ih < 9; ih++) { if (cl[ih][it] == 0) { cl[ih][it] = c; @@ -3728,15 +3238,19 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 } - for(int iCheckPoint = 0; iCheckPoint<4; iCheckPoint++) + for(int iCheckPoint = 0; iCheckPoint<4; iCheckPoint++) { fHFindCl[iCheckPoint]->Fill(checkPoint[iCheckPoint]); + } if (checkPoint[3]) { - if (track->GetPt() > 0) fHMinYPos->Fill(minY); - else fHMinYNeg->Fill(minY); - - fHMinD->Fill(minD[0], minD[1]); - } + if (track->GetSignedPt() > 0) { + fHMinYPos->Fill(minY); + } + else { + fHMinYNeg->Fill(minY); + } + fHMinD->Fill(minD[0],minD[1]); + } if (cl[0][it]) { nfound++; @@ -3754,7 +3268,6 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 // // Choose one of the variants // - Int_t changes[10]; Float_t sumz = 0.0; Float_t sum = 0.0; Double_t sumdy = 0.0; @@ -3764,36 +3277,38 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 Double_t sumx2 = 0.0; Double_t mpads = 0.0; - Int_t ngood[10]; - Int_t nbad[10]; + Int_t changes[kN2]; + + Int_t ngood[kN2]; + Int_t nbad[kN2]; - Double_t meanz[10]; - Double_t moffset[10]; // Mean offset - Double_t mean[10]; // Mean value - Double_t angle[10]; // Angle + Double_t meanz[kN2]; + Double_t moffset[kN2]; // Mean offset + Double_t mean[kN2]; // Mean value + Double_t angle[kN2]; // Angle - Double_t smoffset[10]; // Sigma of mean offset - Double_t smean[10]; // Sigma of mean value - Double_t sangle[10]; // Sigma of angle - Double_t smeanangle[10]; // Correlation + Double_t smoffset[kN2]; // Sigma of mean offset + Double_t smean[kN2]; // Sigma of mean value + Double_t sangle[kN2]; // Sigma of angle + Double_t smeanangle[kN2]; // Correlation - Double_t sigmas[10]; - Double_t tchi2s[10]; // Chi2s for tracklet + Double_t sigmas[kN2]; + Double_t tchi2s[kN2]; // Chi2s for tracklet - for (Int_t it = 0; it < 10; it++) { + for (Int_t it = 0; it < kN2; it++) { ngood[it] = 0; nbad[it] = 0; meanz[it] = 0.0; - moffset[it] = 0.0; // Mean offset - mean[it] = 0.0; // Mean value - angle[it] = 0.0; // Angle + moffset[it] = 0.0; // Mean offset + mean[it] = 0.0; // Mean value + angle[it] = 0.0; // Angle smoffset[it] = 1.0e5; // Sigma of mean offset smean[it] = 1.0e5; // Sigma of mean value sangle[it] = 1.0e5; // Sigma of angle - smeanangle[it] = 0.0; // Correlation + smeanangle[it] = 0.0; // Correlation sigmas[it] = 1.0e5; tchi2s[it] = 1.0e5; // Chi2s for tracklet @@ -3901,7 +3416,8 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 changes[iter]++; } - Double_t dx = x[it]-xmean; // Distance to reference x + // Distance to reference x + Double_t dx = x[it]-xmean; sumz += cl[best[iter][it]][it]->GetZ(); sum++; sumdy += dy[best[iter][it]][it]; @@ -3922,12 +3438,12 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 } // - // calculates line parameters + // Calculates line parameters // Double_t det = sum*sumx2 - sumx*sumx; angle[iter] = (sum*sumxy - sumx*sumdy) / det; mean[iter] = (sumx2*sumdy - sumx*sumxy) / det; - meanz[iter] = sumz / sum; + meanz[iter] = sumz / sum; moffset[iter] = sumdy / sum; mpads /= sum; // Mean number of pads @@ -3971,7 +3487,7 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 Double_t mindist = 100000.0; Int_t ihbest = 0; - for (Int_t ih = 0; ih < 10; ih++) { + for (Int_t ih = 0; ih < kN2; ih++) { if (!cl[ih][it]) { break; } @@ -3982,17 +3498,17 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 ihbest = ih; } } + best[iter+1][it] = ihbest; + } // // Update best hypothesy if better chi2 according tracklet position and angle // - Double_t sy2 = smean[iter] + track->GetSigmaY2(); + sy2 = smean[iter] + track->GetSigmaY2(); Double_t sa2 = sangle[iter] + track->GetSigmaSnp2(); // track->fCee; Double_t say = track->GetSigmaSnpY(); // track->fCey; - //Double_t chi20 = mean[bestiter]*mean[bestiter ] / sy2+angle[bestiter]*angle[bestiter]/sa2; - //Double_t chi21 = mean[iter]*mean[iter] / sy2+angle[iter]*angle[iter]/sa2; Double_t detchi = sy2*sa2 - say*say; Double_t invers[3] = {sa2/detchi,sy2/detchi,-say/detchi}; // Inverse value of covariance matrix @@ -4023,11 +3539,7 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 Short_t maxpos5 = -1; Float_t maxcharge5 = 0.0; - //if (tchi2s[bestiter]>25.) sigma2*=tchi2s[bestiter]/25.; - //if (tchi2s[bestiter]>25.) sigma2=1000.; // dont'accept - - Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(AliTRDcalibDB::Instance()->GetVdrift(0,0,0) - ,-AliTracker::GetBz()*0.1); + Double_t exB = AliTRDCommonParam::Instance()->GetOmegaTau(AliTRDcalibDB::Instance()->GetVdrift(0,0,0)); Double_t expectederr = sigma2*sigma2 + 0.01*0.01; if (mpads > 3.5) { expectederr += (mpads - 3.5) * 0.04; @@ -4036,8 +3548,6 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 expectederr += changes[bestiter] * 0.01; } expectederr += (0.03 * (tany-exB)*(tany-exB)) * 15.0; - //if (tchi2s[bestiter]>18.) expectederr*= tchi2s[bestiter]/18.; - //expectederr+=10000; for (Int_t it = 0; it < t1 - t0; it++) { @@ -4045,10 +3555,10 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 continue; } - cl[best[bestiter][it]][it]->SetSigmaY2(expectederr); // Set cluster error + // Set cluster error + ((AliCluster*)cl[best[bestiter][it]][it])->SetSigmaY2(expectederr); if (!cl[best[bestiter][it]][it]->IsUsed()) { cl[best[bestiter][it]][it]->SetY(cl[best[bestiter][it]][it]->GetY()); - //cl[best[bestiter][it]][it]->Use(); } // Time bins with maximal charge @@ -4093,16 +3603,9 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 clusters[it+t0] = indexes[best[bestiter][it]][it]; - // Still needed ???? - //if (cl[best[bestiter][it]][it]->GetLocalTimeBin()>4 && - //cl[best[bestiter][it]][it]->GetLocalTimeBin()<18) clusters[it+t0] - // = indexes[best[bestiter][it]][it]; //Test - } - // // Set tracklet parameters - // Double_t trackleterr2 = smoffset[bestiter] + 0.01*0.01; if (mpads > 3.5) { trackleterr2 += (mpads - 3.5) * 0.04; @@ -4111,7 +3614,6 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 trackleterr2 *= TMath::Max(14.0 - nfound,1.0); trackleterr2 += 0.2 * (tany-exB)*(tany-exB); - // Set tracklet parameters tracklet.Set(xmean ,track2.GetY() + moffset[bestiter] ,meanz[bestiter] @@ -4122,11 +3624,11 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 tracklet.SetP1(angle[bestiter]); tracklet.SetN(nfound); tracklet.SetNCross(changes[bestiter]); - tracklet.SetPlane(plane); + tracklet.SetPlane(layer); tracklet.SetSigma2(expectederr); tracklet.SetChi2(tchi2s[bestiter]); tracklet.SetMaxPos(maxpos,maxpos4,maxpos5); - track->SetTracklets(plane,tracklet); + track->SetTracklets(layer,tracklet); track->SetNWrong(track->GetNWrong() + nbad[0]); // @@ -4157,12 +3659,13 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 new(array1[it]) AliTRDcluster(dummy); } } + TGraph graph0(t1-t0,x,dy0); TGraph graph1(t1-t0,x,dyb); TGraph graphy(t1-t0,x,yt); TGraph graphz(t1-t0,x,zt); - if (AliTRDReconstructor::StreamLevel() > 0) { + if (fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kTracker) > 0) { cstream << "tracklet" << "track.=" << track // Track parameters << "tany=" << tany // Tangent of the local track angle @@ -4172,7 +3675,7 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 << "nfound=" << nfound // Number of found clusters << "clfound=" << clfound // Total number of found clusters in road << "mpads=" << mpads // Mean number of pads per cluster - << "plane=" << plane // Plane number + << "layer=" << layer // Layer number << "detector=" << detector // Detector number << "road=" << road // The width of the used road << "graph0.=" << &graph0 // x - y = dy for closest cluster @@ -4228,6 +3731,10 @@ Int_t AliTRDtracker::Freq(Int_t n, const Int_t *inlist // The size of output array has is 2*n // + if (n <= 0) { + return 0; + } + Int_t *sindexS = new Int_t[n]; // Temporary array for sorting Int_t *sindexF = new Int_t[2*n]; for (Int_t i = 0; i < n; i++) { @@ -4275,12 +3782,27 @@ Int_t AliTRDtracker::Freq(Int_t n, const Int_t *inlist } //_____________________________________________________________________________ -AliTRDtrack *AliTRDtracker::RegisterSeed(AliTRDseed *seeds, Double_t *params) +AliTRDtrack *AliTRDtracker::RegisterSeed(AliTRDseed * const seeds, Double_t *params) { // - // Register a seed + // Build a TRD track out of tracklet candidates + // + // Parameters : + // seeds : array of tracklets + // params : track parameters (see MakeSeeds() function body for a detailed description) + // + // Output : + // The TRD track. + // + // Detailed description + // + // To be discussed with Marian !! // + AliTRDcalibDB *cal = AliTRDcalibDB::Instance(); + Int_t nTimeBins = cal->GetNumberOfTimeBinsDCS(); + + Double_t alpha = AliTRDgeometry::GetAlpha(); Double_t shift = AliTRDgeometry::GetAlpha()/2.0; Double_t c[15]; @@ -4295,13 +3817,15 @@ AliTRDtrack *AliTRDtracker::RegisterSeed(AliTRDseed *seeds, Double_t *params) AliTRDcluster *cl = 0; for (Int_t ilayer = 0; ilayer < 6; ilayer++) { - if (seeds[ilayer].IsOK()) { - for (Int_t itime = 22; itime > 0; itime--) { - if (seeds[ilayer].GetIndexes(itime) > 0) { - index = seeds[ilayer].GetIndexes(itime); - cl = seeds[ilayer].GetClusters(itime); - break; - } + + if (seeds[ilayer].IsOK()) { + for (Int_t itime = nTimeBins-1; itime > 0; itime--) { + if (seeds[ilayer].GetIndexes(itime) > 0) { + index = seeds[ilayer].GetIndexes(itime); + cl = seeds[ilayer].GetClusters(itime); + //printf("l[%d] index[%d] tb[%d] cptr[%p]\n", ilayer, index, itime, cl); + break; + } } } if (index > 0) { @@ -4318,7 +3842,8 @@ AliTRDtrack *AliTRDtracker::RegisterSeed(AliTRDseed *seeds, Double_t *params) ,c ,params[0] ,params[6]*alpha+shift); - track->PropagateTo(params[0]-5.0); + // SetCluster(cl, 0); // A. Bercuci + track->PropagateTo(params[0]-5.0); track->ResetCovariance(1); Int_t rc = FollowBackProlongation(*track); @@ -4328,77 +3853,103 @@ AliTRDtrack *AliTRDtracker::RegisterSeed(AliTRDseed *seeds, Double_t *params) } else { track->CookdEdx(); - CookdEdxTimBin(*track); + track->CookdEdxTimBin(-1); CookLabel(track,0.9); } return track; -} -////////////////////////////////////////////////////////////////////////////////////////// +} -void AliTRDtracker::InitLogHists() { +//_____________________________________________________________________________ +void AliTRDtracker::InitLogHists() +{ + // + // Create the log histograms + // - fHBackfit = new TH1D("logTRD_backfit", "", 40, -0.5, 39.5); - fHRefit = new TH1D("logTRD_refit", "", 40, -0.5, 39.5); - fHClSearch = new TH1D("logTRD_clSearch", "", 60, -0.5, 59.5); + fHBackfit = new TH1D("logTRD_backfit" ,"" + , 40,-0.5, 39.5); + fHRefit = new TH1D("logTRD_refit" ,"" + , 40,-0.5, 39.5); + fHClSearch = new TH1D("logTRD_clSearch","" + , 60,-0.5, 59.5); - fHX = new TH1D("logTRD_X", ";x (cm)", 200, 50, 400); - fHNCl = new TH1D("logTRD_ncl", "", 40, -0.5, 39.5); - fHNClTrack = new TH1D("logTRD_nclTrack", "", 180, -0.5, 179.5); + fHX = new TH1D("logTRD_X" ,";x (cm)" + , 200, 50, 400); + fHNCl = new TH1D("logTRD_ncl" ,"" + , 40,-0.5, 39.5); + fHNClTrack = new TH1D("logTRD_nclTrack","" + , 180,-0.5,179.5); - fHMinYPos = new TH1D("logTRD_minYPos", ";#delta Y (cm)", 400, -6, 6); - fHMinYNeg = new TH1D("logTRD_minYNeg", ";#delta Y (cm)", 400, -6, 6); - fHMinZ = new TH1D("logTRD_minZ", ";#delta Z (cm)", 400, -20, 20); - fHMinD = new TH2D("logTRD_minD", ";#delta Y (cm);#delta Z (cm)", 100, -6, 6, 100, -50, 50); + fHMinYPos = new TH1D("logTRD_minYPos" ,";#delta Y (cm)" + , 400, -6, 6); + fHMinYNeg = new TH1D("logTRD_minYNeg" ,";#delta Y (cm)" + , 400, -6, 6); + fHMinZ = new TH1D("logTRD_minZ" ,";#delta Z (cm)" + , 400, -20, 20); + fHMinD = new TH2D("logTRD_minD" ,";#delta Y (cm);#delta Z (cm)" + , 100, -6, 6 + , 100, -50, 50); - fHDeltaX = new TH1D("logTRD_deltaX", ";#delta X (cm)", 100, -5, 5); - fHXCl = new TH1D("logTRD_xCl", ";cluster x position (cm)", 1000, 280, 380); + fHDeltaX = new TH1D("logTRD_deltaX" ,";#delta X (cm)" + , 100, -5, 5); + fHXCl = new TH1D("logTRD_xCl" ,";cluster x position (cm)" + ,1000, 280, 380); - const char *nameFindCl[4] = {"logTRD_clY", "logTRD_clZ", "logTRD_clB", "logTRD_clG"}; + const Char_t *nameFindCl[4] = { "logTRD_clY" + , "logTRD_clZ" + , "logTRD_clB" + , "logTRD_clG" }; - for(int i=0; i<4; i++) { - fHFindCl[i] = new TH1D(nameFindCl[i], "", 30, -0.5, 29.5); + for (Int_t i = 0; i < 4; i++) { + fHFindCl[i] = new TH1D(nameFindCl[i],"",30,-0.5,29.5); } -} -////////////////////////////////////////////////////////////////////////////////////////// +} -void AliTRDtracker::SaveLogHists() { +//_____________________________________________________________________________ +void AliTRDtracker::SaveLogHists() +{ + // + // Save the log histograms in AliESDs.root + // - TDirectory *sav = gDirectory; - TFile *logFile = 0; + TDirectory *sav = gDirectory; + TFile *logFile = 0; TSeqCollection *col = gROOT->GetListOfFiles(); - int N = col->GetEntries(); - for(int i=0; iAt(i); - if (strstr(logFile->GetName(), "AliESDs.root")) break; + Int_t nn = col->GetEntries(); + for (Int_t i = 0; i < nn; i++) { + logFile = (TFile *) col->At(i); + if (strstr(logFile->GetName(),"AliESDs.root")) { + break; + } } logFile->cd(); - fHBackfit->Write(fHBackfit->GetName(), TObject::kOverwrite); - fHRefit->Write(fHRefit->GetName(), TObject::kOverwrite); - fHClSearch->Write(fHClSearch->GetName(), TObject::kOverwrite); - fHX->Write(fHX->GetName(), TObject::kOverwrite); - fHNCl->Write(fHNCl->GetName(), TObject::kOverwrite); - fHNClTrack->Write(fHNClTrack->GetName(), TObject::kOverwrite); - - fHMinYPos->Write(fHMinYPos->GetName(), TObject::kOverwrite); - fHMinYNeg->Write(fHMinYNeg->GetName(), TObject::kOverwrite); - fHMinD->Write(fHMinD->GetName(), TObject::kOverwrite); - fHMinZ->Write(fHMinZ->GetName(), TObject::kOverwrite); - - fHDeltaX->Write(fHDeltaX->GetName(), TObject::kOverwrite); - fHXCl->Write(fHXCl->GetName(), TObject::kOverwrite); + fHBackfit->Write(fHBackfit->GetName(),TObject::kOverwrite); + fHRefit->Write(fHRefit->GetName(),TObject::kOverwrite); + fHClSearch->Write(fHClSearch->GetName(),TObject::kOverwrite); + fHX->Write(fHX->GetName(),TObject::kOverwrite); + fHNCl->Write(fHNCl->GetName(),TObject::kOverwrite); + fHNClTrack->Write(fHNClTrack->GetName(),TObject::kOverwrite); + + fHMinYPos->Write(fHMinYPos->GetName(),TObject::kOverwrite); + fHMinYNeg->Write(fHMinYNeg->GetName(),TObject::kOverwrite); + fHMinD->Write(fHMinD->GetName(),TObject::kOverwrite); + fHMinZ->Write(fHMinZ->GetName(),TObject::kOverwrite); + + fHDeltaX->Write(fHDeltaX->GetName(),TObject::kOverwrite); + fHXCl->Write(fHXCl->GetName(),TObject::kOverwrite); - for(int i=0; i<4; i++) - fHFindCl[i]->Write(fHFindCl[i]->GetName(), TObject::kOverwrite); + for (Int_t i = 0; i < 4; i++) { + fHFindCl[i]->Write(fHFindCl[i]->GetName(),TObject::kOverwrite); + } logFile->Flush(); sav->cd(); -} -////////////////////////////////////////////////////////////////////////////////////////// +}