From e527a1b91c98b7aac923301b486b4d90a4d9bf82 Mon Sep 17 00:00:00 2001 From: marian Date: Sat, 1 May 2010 10:30:03 +0000 Subject: [PATCH] M AliTPCcalibCalib.cxx - start refit form TPC out instead of track outer param M AliTPCComposedCorrection.h - All other - init functions M AliTPCCorrection.h M AliTPCExBBShape.h M AliTPCExBTwist.h M AliTPCGGVoltError.h M AliTPCInverseCorrection.h M AliTPCComposedCorrection.cxx M AliTPCCorrection.cxx M AliTPCExBBShape.cxx M AliTPCExBTwist.cxx M AliTPCGGVoltError.cxx M AliTPCInverseCorrection.cxx (Stefan) --- TPC/AliTPCComposedCorrection.cxx | 30 +++++++++++++++++++ TPC/AliTPCComposedCorrection.h | 5 ++++ TPC/AliTPCCorrection.cxx | 7 +++++ TPC/AliTPCCorrection.h | 4 ++- TPC/AliTPCExBBShape.cxx | 49 ++++++++++++++++++++++++++++++++ TPC/AliTPCExBBShape.h | 4 +++ TPC/AliTPCExBTwist.cxx | 44 ++++++++++++++++++++++++++++ TPC/AliTPCExBTwist.h | 5 ++++ TPC/AliTPCGGVoltError.cxx | 44 ++++++++++++++++++++++++++++ TPC/AliTPCGGVoltError.h | 4 +++ TPC/AliTPCInverseCorrection.cxx | 19 +++++++++++++ TPC/AliTPCInverseCorrection.h | 7 +++++ TPC/AliTPCcalibCalib.cxx | 15 ++++++---- 13 files changed, 231 insertions(+), 6 deletions(-) diff --git a/TPC/AliTPCComposedCorrection.cxx b/TPC/AliTPCComposedCorrection.cxx index 454f88180e2..1268b382323 100644 --- a/TPC/AliTPCComposedCorrection.cxx +++ b/TPC/AliTPCComposedCorrection.cxx @@ -56,6 +56,7 @@ #include #include +#include #include "AliTPCComposedCorrection.h" @@ -171,10 +172,39 @@ void AliTPCComposedCorrection::Print(Option_t* option) const { } ++in; } + if (in==1) printf(" Info: The correction compound is empty: No corrections set\n"); delete i; } +void AliTPCComposedCorrection::Init() { + // + // Initialization funtion (not used at the moment) + // + + TIterator *i=fCorrections->MakeIterator(); + AliTPCCorrection *c; + while (0!=(c=dynamic_cast(i->Next()))) + c->Init(); + delete i; + +} + +void AliTPCComposedCorrection::Update(const TTimeStamp &timeStamp) { + // + // Update function + // + + TIterator *i=fCorrections->MakeIterator(); + AliTPCCorrection *c; + while (0!=(c=dynamic_cast(i->Next()))) + c->Update(timeStamp); + delete i; + +} + + + void AliTPCComposedCorrection::SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) { // // Gives the possibility to set the OmegaTau plus Tensor corrections T1 and T2 (effective omega Tau) diff --git a/TPC/AliTPCComposedCorrection.h b/TPC/AliTPCComposedCorrection.h index f89d985b51a..c4e6fe9eebb 100644 --- a/TPC/AliTPCComposedCorrection.h +++ b/TPC/AliTPCComposedCorrection.h @@ -50,6 +50,11 @@ public: virtual void Print(Option_t* option="") const; + // initialization and update functions + virtual void Init(); + virtual void Update(const TTimeStamp &timeStamp); + + private: TCollection *fCorrections; // The corrections this one is composed of. CompositionType fMode; // The way to apply the corrections (see general class documentation) diff --git a/TPC/AliTPCCorrection.cxx b/TPC/AliTPCCorrection.cxx index 81c38127813..112a14fd18f 100644 --- a/TPC/AliTPCCorrection.cxx +++ b/TPC/AliTPCCorrection.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include "AliExternalTrackParam.h" #include "AliTrackPointArray.h" @@ -198,6 +199,12 @@ void AliTPCCorrection::Init() { // } +void AliTPCCorrection::Update(const TTimeStamp &/*timeStamp*/) { + // + // Update function + // +} + void AliTPCCorrection::Print(Option_t* /*option*/) const { // // Print function to check which correction classes are used diff --git a/TPC/AliTPCCorrection.h b/TPC/AliTPCCorrection.h index cc79df9fd42..33d99db845e 100644 --- a/TPC/AliTPCCorrection.h +++ b/TPC/AliTPCCorrection.h @@ -33,6 +33,7 @@ #include class TH2F; +class TTimeStamp; class TCollection; class TTreeSRedirector; class AliExternalTrackParam; @@ -56,8 +57,9 @@ public: void DistortPoint (const Float_t x[],const Short_t roc,Float_t xp[]); virtual void GetDistortion(const Float_t x[],const Short_t roc,Float_t dx[]); - // initialization + // initialization and update functions virtual void Init(); + virtual void Update(const TTimeStamp &timeStamp); // convenience functions virtual void Print(Option_t* option="") const; diff --git a/TPC/AliTPCExBBShape.cxx b/TPC/AliTPCExBBShape.cxx index deed3330482..09ffbd5bad6 100644 --- a/TPC/AliTPCExBBShape.cxx +++ b/TPC/AliTPCExBBShape.cxx @@ -53,6 +53,55 @@ AliTPCExBBShape::~AliTPCExBBShape() { // } +void AliTPCExBBShape::Init() { + // + // Initialization funtion (not used at the moment) + // + + // Set default parameters + // FIXME: Ask the database for these entries + + + AliMagF * mag = new AliMagF("mag","mag"); // from database (GRP?) + SetBField(mag); + + Double_t vdrift = 2.6; // [cm/us] // From dataBase: to be updated: per second (ideally) + Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run + + Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) + Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; + + // Correction Terms for effective omegaTau; obtained by a laser calibration run + Double_t t1 = 0.9; // ideally from database + Double_t t2 = 1.5; // ideally from database + + SetOmegaTauT1T2(wt,t1,t2); + + +} + +void AliTPCExBBShape::Update(const TTimeStamp &/*timeStamp*/) { + // + // Update function + // + + Double_t vdrift = 2.6; // [cm/us] // From dataBase: to be updated: per second (ideally) + Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run + + Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) + Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; + + // Correction Terms for effective omegaTau; obtained by a laser calibration run + Double_t t1 = 0.9; // ideally from database + Double_t t2 = 1.5; // ideally from database + + SetOmegaTauT1T2(wt,t1,t2); + + +} + + + void AliTPCExBBShape::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) { // // Calculates the space point corrections of the B field inperfections (B field shape) diff --git a/TPC/AliTPCExBBShape.h b/TPC/AliTPCExBBShape.h index 9f8ed026375..62c627df4e1 100644 --- a/TPC/AliTPCExBBShape.h +++ b/TPC/AliTPCExBBShape.h @@ -25,6 +25,10 @@ public: AliTPCExBBShape(); virtual ~AliTPCExBBShape(); + // initialization and update functions + virtual void Init(); + virtual void Update(const TTimeStamp &timeStamp); + // common setters and getters for ExB virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) { const Float_t wt1=t1*omegaTau; diff --git a/TPC/AliTPCExBTwist.cxx b/TPC/AliTPCExBTwist.cxx index 04d259d13f8..6dbc5f818f8 100644 --- a/TPC/AliTPCExBTwist.cxx +++ b/TPC/AliTPCExBTwist.cxx @@ -49,6 +49,50 @@ AliTPCExBTwist::~AliTPCExBTwist() { // } +void AliTPCExBTwist::Init() { + // + // Initialization funtion (not used at the moment) + // + + // Set default parameters + // FIXME: Ask the database for these entries + + Double_t vdrift = 2.6; // [cm/us] // From dataBase: to be updated: per second (ideally) + Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run + + Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) + Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; + + // Correction Terms for effective omegaTau; obtained by a laser calibration run + Double_t t1 = 0.9; // ideally from database + Double_t t2 = 1.5; // ideally from database + + SetOmegaTauT1T2(wt,t1,t2); + + SetXTwist(0.0);// ideally from the database + SetYTwist(0.0);// ideally from the database +} + +void AliTPCExBTwist::Update(const TTimeStamp &/*timeStamp*/) { + // + // Update function + // + + Double_t vdrift = 2.6; // [cm/us] // From dataBase: to be updated: per second (ideally) + Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run + + Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) + Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; + + // Correction Terms for effective omegaTau; obtained by a laser calibration run + Double_t t1 = 0.9; // ideally from database + Double_t t2 = 1.5; // ideally from database + + SetOmegaTauT1T2(wt,t1,t2); +} + + + void AliTPCExBTwist::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) { // // Calculates the correction of a mismatch between the E and B field axis diff --git a/TPC/AliTPCExBTwist.h b/TPC/AliTPCExBTwist.h index 5cbf248b6ea..d722ed30b9d 100644 --- a/TPC/AliTPCExBTwist.h +++ b/TPC/AliTPCExBTwist.h @@ -22,6 +22,11 @@ public: AliTPCExBTwist(); virtual ~AliTPCExBTwist(); + // initialization and update functions + virtual void Init(); + virtual void Update(const TTimeStamp &timeStamp); + + // common setters and getters for ExB virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) { const Float_t wt1=t1*omegaTau; diff --git a/TPC/AliTPCGGVoltError.cxx b/TPC/AliTPCGGVoltError.cxx index 3444485e8bc..bc679a6fc64 100644 --- a/TPC/AliTPCGGVoltError.cxx +++ b/TPC/AliTPCGGVoltError.cxx @@ -55,6 +55,50 @@ AliTPCGGVoltError::~AliTPCGGVoltError() { // } +void AliTPCGGVoltError::Init() { + // + // Initialization funtion (not used at the moment) + // + + // Set default parameters + // FIXME: Ask the database for these entries + + Double_t vdrift = 2.6; // [cm/us] // From dataBase: to be updated: per second (ideally) + Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run + + Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) + Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; + + // Correction Terms for effective omegaTau; obtained by a laser calibration run + Double_t t1 = 0.9; // ideally from database + Double_t t2 = 1.5; // ideally from database + + SetOmegaTauT1T2(wt,t1,t2); + + SetDeltaVGGA(0.0);// ideally from the database + SetDeltaVGGC(0.0);// ideally from the database +} + +void AliTPCGGVoltError::Update(const TTimeStamp &/*timeStamp*/) { + // + // Update function + // + + Double_t vdrift = 2.6; // [cm/us] // From dataBase: to be updated: per second (ideally) + Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run + + Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) + Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; + + // Correction Terms for effective omegaTau; obtained by a laser calibration run + Double_t t1 = 0.9; // ideally from database + Double_t t2 = 1.5; // ideally from database + + SetOmegaTauT1T2(wt,t1,t2); +} + + + void AliTPCGGVoltError::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) { // diff --git a/TPC/AliTPCGGVoltError.h b/TPC/AliTPCGGVoltError.h index b02854c309e..2627f3d3c17 100644 --- a/TPC/AliTPCGGVoltError.h +++ b/TPC/AliTPCGGVoltError.h @@ -23,6 +23,10 @@ public: AliTPCGGVoltError(); virtual ~AliTPCGGVoltError(); + // initialization and update functions + virtual void Init(); + virtual void Update(const TTimeStamp &timeStamp); + // common setters and getters for ExB virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) { const Double_t wt0=t2*omegaTau; diff --git a/TPC/AliTPCInverseCorrection.cxx b/TPC/AliTPCInverseCorrection.cxx index 4a07df20803..ad5b008a5fb 100644 --- a/TPC/AliTPCInverseCorrection.cxx +++ b/TPC/AliTPCInverseCorrection.cxx @@ -30,6 +30,8 @@ #include #include "AliTPCInverseCorrection.h" +#include + AliTPCInverseCorrection::AliTPCInverseCorrection() : fCorrection(0) { @@ -61,6 +63,23 @@ AliTPCInverseCorrection::~AliTPCInverseCorrection() { // } + +void AliTPCInverseCorrection::Init() { + // + // Initialization funtion (not used at the moment) + // + if (fCorrection) fCorrection->Init(); + +} + +void AliTPCInverseCorrection::Update(const TTimeStamp &timeStamp) { + // + // Update function + // + if (fCorrection) fCorrection->Update(timeStamp); + +} + void AliTPCInverseCorrection::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) { // // This is just calling the CalculateInverseCorrection of the wrapped diff --git a/TPC/AliTPCInverseCorrection.h b/TPC/AliTPCInverseCorrection.h index c38ae31ab17..21d10890886 100644 --- a/TPC/AliTPCInverseCorrection.h +++ b/TPC/AliTPCInverseCorrection.h @@ -21,6 +21,7 @@ #include "AliTPCCorrection.h" + class AliTPCInverseCorrection : public AliTPCCorrection { public: AliTPCInverseCorrection(); @@ -31,6 +32,12 @@ public: AliTPCCorrection* GetCorrection() const {return fCorrection;} virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]); virtual void GetDistortion(const Float_t x[],const Short_t roc,Float_t dx[]); + + // initialization and update functions + virtual void Init(); + virtual void Update(const TTimeStamp &timeStamp); + + private: AliTPCCorrection *fCorrection; // The correction to be inverted. diff --git a/TPC/AliTPCcalibCalib.cxx b/TPC/AliTPCcalibCalib.cxx index 63edd3340d4..db4544942e8 100644 --- a/TPC/AliTPCcalibCalib.cxx +++ b/TPC/AliTPCcalibCalib.cxx @@ -151,8 +151,9 @@ void AliTPCcalibCalib::Process(AliESDEvent *event){ for (Int_t i=0;iGetTrack(i); - AliESDfriendTrack *friendTrack = ESDfriend->GetTrack(i); - + AliESDfriendTrack *friendTrack = (AliESDfriendTrack*) ESDfriend->GetTrack(i); + if (!friendTrack) continue; + track->SetFriendTrack(friendTrack); const AliExternalTrackParam * trackIn = track->GetInnerParam(); const AliExternalTrackParam * trackOut = track->GetOuterParam(); AliExternalTrackParam * tpcOut = (AliExternalTrackParam *)friendTrack->GetTPCOut(); @@ -165,7 +166,7 @@ void AliTPCcalibCalib::Process(AliESDEvent *event){ if ((seed=dynamic_cast(calibObject))) break; } if (!seed) continue; - RefitTrack(track, seed,event->GetMagneticField()); + RefitTrack(track, seed, event->GetMagneticField()); (*tpcOut)=*(track->GetOuterParam()); } return; @@ -179,6 +180,8 @@ Bool_t AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa // // 0 - Setup transform object // + AliESDfriendTrack *friendTrack = (AliESDfriendTrack *)track->GetFriendTrack(); + AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ; AliTPCParam *param = AliTPCcalibDB::Instance()->GetParameters(); transform->SetCurrentRun(fRun); @@ -316,8 +319,9 @@ Bool_t AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa // And now do refit // AliExternalTrackParam * trackInOld = (AliExternalTrackParam*)track->GetInnerParam(); - AliExternalTrackParam * trackOutOld = (AliExternalTrackParam*)track->GetOuterParam(); - + AliExternalTrackParam * trackOuter = (AliExternalTrackParam*)track->GetOuterParam(); + AliExternalTrackParam * trackOutOld = (AliExternalTrackParam *)friendTrack->GetTPCOut(); + AliExternalTrackParam trackIn = *trackOutOld; trackIn.ResetCovariance(kResetCov); @@ -468,6 +472,7 @@ Bool_t AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa (*trackInOld) = trackIn; (*trackOutOld) = trackOut; + (*trackOuter) = trackOut; AliExternalTrackParam *t = &trackIn; track->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); seed->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); -- 2.39.3