From 4e009ce430fdef1f71c93e14a43287c4998d2ff0 Mon Sep 17 00:00:00 2001 From: cblume Date: Fri, 8 Dec 2006 12:59:12 +0000 Subject: [PATCH] Some cleanup and effc++ modifications AliTRDtracker --- TRD/AliTRDCommonParam.cxx | 17 +--------- TRD/AliTRDCommonParam.h | 5 +-- TRD/AliTRDcalibDB.cxx | 22 ++++-------- TRD/AliTRDcalibDB.h | 1 + TRD/AliTRDdigitizer.cxx | 11 ++---- TRD/AliTRDgeometry.cxx | 2 +- TRD/AliTRDtracker.cxx | 70 ++++++++++++++++++++++++++++++--------- TRD/AliTRDtracker.h | 7 ++-- 8 files changed, 71 insertions(+), 64 deletions(-) diff --git a/TRD/AliTRDCommonParam.cxx b/TRD/AliTRDCommonParam.cxx index 7b3c68bec2c..cfbb617ef1d 100644 --- a/TRD/AliTRDCommonParam.cxx +++ b/TRD/AliTRDCommonParam.cxx @@ -79,7 +79,6 @@ void AliTRDCommonParam::Terminate() //_____________________________________________________________________________ AliTRDCommonParam::AliTRDCommonParam() :TObject() - ,fField(0) ,fExBOn(kFALSE) ,fPadPlaneArray(0) { @@ -99,19 +98,7 @@ void AliTRDCommonParam::Init() // // E x B effects - fExBOn = kTRUE; - - // The magnetic field strength in Tesla - fField = AliTracker::GetBz() * 0.1; - - if (TMath::Abs(fField) < 1e-5) { - Info("Init", "MC B field ... "); - Double_t x[3] = { 0.0, 0.0, 0.0 }; - Double_t b[3]; - gAlice->Field(x,b); // b[] is in kilo Gauss - fField = b[2] * 0.1; // Tesla - } - + fExBOn = kTRUE; // ---------------------------------------------------------------------------- // The pad planes @@ -146,7 +133,6 @@ AliTRDCommonParam::~AliTRDCommonParam() //_____________________________________________________________________________ AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p) :TObject(p) - ,fField(p.fField) ,fExBOn(p.fExBOn) ,fPadPlaneArray(0) { @@ -184,7 +170,6 @@ void AliTRDCommonParam::Copy(TObject &p) const } target->fExBOn = fExBOn; - target->fField = fField; } diff --git a/TRD/AliTRDCommonParam.h b/TRD/AliTRDCommonParam.h index 59e9a1e6a59..02a448ffbd0 100644 --- a/TRD/AliTRDCommonParam.h +++ b/TRD/AliTRDCommonParam.h @@ -31,10 +31,8 @@ class AliTRDCommonParam : public TObject virtual void Copy(TObject &p) const; - void SetField(Float_t field) { fField = field; }; void SetExB(Int_t exbOn = 1) { fExBOn = exbOn; }; - Float_t GetField() const { return fField; }; Bool_t ExBOn() const { return fExBOn; }; AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c) const; @@ -50,7 +48,6 @@ class AliTRDCommonParam : public TObject void Init(); - Float_t fField; // Magnetic field Int_t fExBOn; // Switch for the ExB effects TObjArray *fPadPlaneArray; //! Array of pad plane objects @@ -60,7 +57,7 @@ class AliTRDCommonParam : public TObject // This is a singleton, constructor is private! AliTRDCommonParam(); - ClassDef(AliTRDCommonParam,1) // The constant parameters common to simulation and reconstruction + ClassDef(AliTRDCommonParam,2) // The constant parameters common to simulation and reconstruction }; diff --git a/TRD/AliTRDcalibDB.cxx b/TRD/AliTRDcalibDB.cxx index 7168ade6b6a..366d268262d 100644 --- a/TRD/AliTRDcalibDB.cxx +++ b/TRD/AliTRDcalibDB.cxx @@ -73,8 +73,8 @@ AliTRDcalibDB* AliTRDcalibDB::Instance() fgInstance = new AliTRDcalibDB(); } - //cout << "Run id = " << fRun << endl; return fgInstance; + } //_____________________________________________________________________________ @@ -159,6 +159,7 @@ AliTRDcalibDB &AliTRDcalibDB::operator=(const AliTRDcalibDB &c) if (this != &c) { AliFatal("No assignment operator defined"); } + return *this; } @@ -767,26 +768,17 @@ const AliTRDCalMonitoring* AliTRDcalibDB::GetMonitoringObject() Float_t AliTRDcalibDB::GetOmegaTau(Float_t vdrift, Float_t bz) { // - // Returns omega*tau (tan(Lorentz-angle)) for a given drift velocity - // and a B-field for Xe/CO2 (15%). + // Returns omega*tau (tan(Lorentz-angle)) for a given drift velocity + // and a B-field for Xe/CO2 (15%). // The values are according to a GARFIELD simulation. // - // This function basically does not belong to the calibration class. It should be moved somewhere else. + // This function basically does not belong to the calibration class. + // It should be moved somewhere else. // However, currently it is in use by simulation and reconstruction. // - //AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance(); - //if (!commonParam) { - // return -1; - //} - - //Float_t fieldAbs = TMath::Abs(commonParam->GetField()); - //Float_t fieldSgn = 1.0; - //if (fieldAbs > 0.0) { - // fieldSgn = commonParam->GetField() / fieldAbs; - //} Float_t fieldAbs = TMath::Abs(bz); - Float_t fieldSgn = (bz > 0.0)? 1.0 : -1.0; + Float_t fieldSgn = (bz > 0.0) ? 1.0 : -1.0; const Int_t kNb = 5; Float_t p0[kNb] = { 0.004810, 0.007412, 0.010252, 0.013409, 0.016888 }; diff --git a/TRD/AliTRDcalibDB.h b/TRD/AliTRDcalibDB.h index bb0b680adbd..28697147663 100644 --- a/TRD/AliTRDcalibDB.h +++ b/TRD/AliTRDcalibDB.h @@ -66,6 +66,7 @@ class AliTRDcalibDB : public TObject { // Related functions, these depend on calibration data static Float_t GetOmegaTau(Float_t vdrift, Float_t bz); + Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const; protected: diff --git a/TRD/AliTRDdigitizer.cxx b/TRD/AliTRDdigitizer.cxx index ebfbb21c3f1..9532b0e0857 100644 --- a/TRD/AliTRDdigitizer.cxx +++ b/TRD/AliTRDdigitizer.cxx @@ -2528,15 +2528,11 @@ void AliTRDdigitizer::RecalcDiffusion(Float_t vdrift) return; } - //Float_t field = commonParam->GetField(); - - /**/ + // The magnetic field strength Double_t x[3] = { 0.0, 0.0, 0.0 }; Double_t b[3]; - gAlice->Field(x,b); // b[] is in kilo Gauss + gAlice->Field(x,b); // b[] is in kilo Gauss Float_t field = b[2] * 0.1; // Tesla - /**/ - fDiffLastVdrift = vdrift; @@ -2573,8 +2569,7 @@ void AliTRDdigitizer::RecalcDiffusion(Float_t vdrift) + p3T[ibT] * vdrift*vdrift*vdrift; // OmegaTau - fOmegaTau = calibration->GetOmegaTau(vdrift, field); - cout << fOmegaTau << "\t" << field << endl; + fOmegaTau = calibration->GetOmegaTau(vdrift,field); // Lorentzfactor if (commonParam->ExBOn()) { diff --git a/TRD/AliTRDgeometry.cxx b/TRD/AliTRDgeometry.cxx index 1a6d1d557dc..5efee505c6f 100644 --- a/TRD/AliTRDgeometry.cxx +++ b/TRD/AliTRDgeometry.cxx @@ -635,7 +635,7 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) for (Int_t isect = 0; isect < kNsect; isect++) { if (fSMstatus[isect]) { sprintf(cTagV,"BTRD%d",isect); - gMC->Gspos("UTR1",1,cTagV,xpos,ypos,zpos,0,"ONLY"); + gMC->Gspos("UTR1",1+isect,cTagV,xpos,ypos,zpos,0,"ONLY"); } } diff --git a/TRD/AliTRDtracker.cxx b/TRD/AliTRDtracker.cxx index aa8fd853a6f..60cd10192b3 100644 --- a/TRD/AliTRDtracker.cxx +++ b/TRD/AliTRDtracker.cxx @@ -64,18 +64,30 @@ const Double_t AliTRDtracker::fgkMaxStep = 2.0; // Maximal step si //_____________________________________________________________________________ AliTRDtracker::AliTRDtracker() - :AliTracker(), - fGeom(0), - fNclusters(0), - fClusters(0), - fNseeds(0), - fSeeds(0), - fNtracks(0), - fTracks(0), - fTimeBinsPerPlane(0), - fAddTRDseeds(kFALSE), - fNoTilt(kFALSE), - fDebugStreamer(0) + :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) + ,fGeom(0) + ,fNclusters(0) + ,fClusters(0) + ,fNseeds(0) + ,fSeeds(0) + ,fNtracks(0) + ,fTracks(0) + ,fTimeBinsPerPlane(0) + ,fAddTRDseeds(kFALSE) + ,fNoTilt(kFALSE) + ,fDebugStreamer(0) { // // Default constructor @@ -91,11 +103,24 @@ AliTRDtracker::AliTRDtracker() } InitLogHists(); + } //_____________________________________________________________________________ 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) ,fGeom(0) ,fNclusters(0) ,fClusters(0) @@ -111,11 +136,24 @@ AliTRDtracker::AliTRDtracker(const AliTRDtracker &t) // // Copy constructor // + } //_____________________________________________________________________________ AliTRDtracker::AliTRDtracker(const TFile *geomfile) :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) ,fGeom(0) ,fNclusters(0) ,fClusters(new TObjArray(2000)) @@ -323,7 +361,7 @@ Bool_t AliTRDtracker::Transform(AliTRDcluster *cluster) // ExB correction // Double_t vdrift = AliTRDcalibDB::Instance()->GetVdrift(cluster->GetDetector(),0,0); - Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift, -AliTracker::GetBz()*0.1); + Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift,-AliTracker::GetBz()*0.1); AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance(); AliTRDpadPlane *padPlane = commonParam->GetPadPlane(plane,chamber); @@ -401,7 +439,7 @@ Bool_t AliTRDtracker::Transform(AliTRDcluster *cluster) // // ExB correction // // // Double_t vdrift = AliTRDcalibDB::Instance()->GetVdrift(cluster->GetDetector(),0,0); -// Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift); +// Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift,-AliTracker::GetBz()*0.1); // // // AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance(); @@ -3972,8 +4010,8 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 //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 = AliTRDcalibDB::Instance()->GetOmegaTau(AliTRDcalibDB::Instance()->GetVdrift(0,0,0) + ,-AliTracker::GetBz()*0.1); Double_t expectederr = sigma2*sigma2 + 0.01*0.01; if (mpads > 3.5) { expectederr += (mpads - 3.5) * 0.04; diff --git a/TRD/AliTRDtracker.h b/TRD/AliTRDtracker.h index 7f8fd228cc0..35e131e4217 100644 --- a/TRD/AliTRDtracker.h +++ b/TRD/AliTRDtracker.h @@ -39,9 +39,9 @@ class TTreeSRedirector; class AliTRDtracker : public AliTracker { - // histograms - TH1D *fHBackfit; // histogram for back propagation - TH1D *fHClSearch; // cluster search + // Histograms + TH1D *fHBackfit; // Histogram for back propagation + TH1D *fHClSearch; // Cluster search TH1D *fHRefit; TH1D *fHX; @@ -60,7 +60,6 @@ class AliTRDtracker : public AliTracker { void InitLogHists(); void SaveLogHists(); - public: enum { kMaxLayersPerSector = 1000 -- 2.43.0