From 55a829a54b1e406b33e78cef916f4e361a03cac6 Mon Sep 17 00:00:00 2001 From: dibari Date: Thu, 22 Nov 2007 14:25:38 +0000 Subject: [PATCH] New class AliHMPIDRecoParam added. AliHMPIDCluster now is derived from AliCluster3D. Modification to other files follows (L.M.) --- HMPID/AliHMPIDCluster.cxx | 63 ++++++++++++++++++++++++-- HMPID/AliHMPIDCluster.h | 42 +++++++++++------- HMPID/AliHMPIDRecoParam.cxx | 79 +++++++++++++++++++++++++++++++++ HMPID/AliHMPIDRecoParam.h | 73 ++++++++++++++++++++++++++++++ HMPID/AliHMPIDReconstructor.cxx | 18 ++++++-- HMPID/AliHMPIDReconstructor.h | 10 ++++- HMPID/AliHMPIDv2.cxx | 27 +++++++++-- HMPID/HMPIDrecLinkDef.h | 1 + HMPID/Hconfig.C | 19 +++++++- HMPID/libHMPIDrec.pkg | 2 +- 10 files changed, 302 insertions(+), 32 deletions(-) create mode 100644 HMPID/AliHMPIDRecoParam.cxx create mode 100644 HMPID/AliHMPIDRecoParam.h diff --git a/HMPID/AliHMPIDCluster.cxx b/HMPID/AliHMPIDCluster.cxx index 45aa58bafa5..779185591eb 100644 --- a/HMPID/AliHMPIDCluster.cxx +++ b/HMPID/AliHMPIDCluster.cxx @@ -19,13 +19,63 @@ #include //Draw() #include "AliLog.h" //FitFunc() - #include "AliHMPIDCluster.h" //class header Bool_t AliHMPIDCluster::fgDoCorrSin=kTRUE; ClassImp(AliHMPIDCluster) + +void AliHMPIDCluster::SetClusterParams(Double_t xL,Double_t yL,Int_t iCh ) +{ + //------------------------------------------------------------------------ + //Set the cluster properties for the AliCluster3D part + //------------------------------------------------------------------------ + + //Get the volume ID from the previously set PNEntry + UShort_t volId=AliGeomManager::LayerToVolUID(AliGeomManager::kHMPID,iCh); + + + //get L->T cs matrix for a given chamber + const TGeoHMatrix *t2l= AliGeomManager::GetTracking2LocalMatrix(volId); + + + + //transformation from the pad cs to local + xL -= 0.5*AliHMPIDParam::SizeAllX(); //size of all pads with dead zones included + yL -= 0.5*AliHMPIDParam::SizeAllY(); + + // Get the position in the tracking cs + Double_t posL[3]={xL, yL, 0.}; //this is the LORS of HMPID + Double_t posT[3]; + t2l->MasterToLocal(posL,posT); + + //Get the cluster covariance matrix in the tracking cs + Double_t covL[9] = { + 0.8*0.8/12., 0., 0.0, //pad size X + 0., 0.84*0.84/12., 0.0, //pad size Y + 0., 0., 0.1, //just 1 , no Z dimension ??? + }; + + TGeoHMatrix m; + m.SetRotation(covL); + m.Multiply(t2l); + m.MultiplyLeft(&t2l->Inverse()); + Double_t *covT = m.GetRotationMatrix(); + + new(this) AliCluster3D(volId, // Can be done safer + posT[0],posT[1],posT[2], + covT[0],covT[1],covT[2], + covT[4],covT[5], + covT[8], + 0x0); // No MC labels ? +} + + +AliHMPIDCluster::~AliHMPIDCluster(){ + if(fDigs) delete fDigs; fDigs=0; + } + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void AliHMPIDCluster::CoG() { @@ -63,6 +113,9 @@ void AliHMPIDCluster::CoG() fChi2=0; // no Chi2 to find fNlocMax=0; // proper status from this method fSt=kCoG; + + SetClusterParams(fX,fY,fCh); //need to fill the AliCluster3D part + }//CoG() //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void AliHMPIDCluster::CorrSin() @@ -198,7 +251,8 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) CoG(); //First calculate CoG for the given cluster Int_t iCluCnt=pCluLst->GetEntriesFast(); //get current number of clusters already stored in the list by previous operations if(isTryUnfold==kFALSE || Size()==1) { //if cluster contains single pad there is no way to improve the knowledge - fSt = (isTryUnfold) ? kSi1: kNot; + fSt = (isTryUnfold)? kSi1: kNot; + SetClusterParams(fX,fY,fCh); new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this); //add this raw cluster return 1; } @@ -269,7 +323,8 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) } // case 2 -> loc max found. Check # of loc maxima - if ( fNlocMax >= kMaxLocMax) { // if # of local maxima exceeds kMaxLocMax... + if ( fNlocMax >= kMaxLocMax) { + SetClusterParams(fX,fY,fCh); // if # of local maxima exceeds kMaxLocMax... fSt = kMax; new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this); //...add this raw cluster } else { //or resonable number of local maxima to fit and user requested it // Now ready for minimization step @@ -304,7 +359,9 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) if ( !IsInPc()) fSt = kEdg; // if Out of Pc if(fSt==kNoLoc) fNlocMax=0; // if with no loc max (pads with same charge..) } + SetClusterParams(fX,fY,fCh); //need to fill the AliCluster3D part new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this); //add new unfolded cluster + } } diff --git a/HMPID/AliHMPIDCluster.h b/HMPID/AliHMPIDCluster.h index 65e13f716c5..011dbf6e5ee 100644 --- a/HMPID/AliHMPIDCluster.h +++ b/HMPID/AliHMPIDCluster.h @@ -10,34 +10,32 @@ // several clusters (# local maxima in the raw cluster -> deconvolution // according to a Mathieson profile of the charge // +#include "AliGeomManager.h" +#include "AliCluster3D.h" #include "AliHMPIDDigit.h" //DigAdd() #include //DigAdd() class TClonesArray; //Solve() -class AliHMPIDCluster :public TObject +class AliHMPIDCluster :public AliCluster3D { public: enum EClusterStatus {kFrm,kCoG,kLo1,kUnf,kMax,kNot,kEdg,kSi1,kNoLoc,kAbn,kEmp=-1}; //status flags - AliHMPIDCluster():TObject( ),fCh(-1),fSi(-1),fSt(kEmp),fBox(-1),fNlocMax(-1),fMaxQpad(-1),fMaxQ(-1),fQRaw(0),fQ(0),fErrQ(-1),fX(0),fErrX(-1),fY(0),fErrY(-1),fChi2(-1),fDigs(0) {} //empty ctor + AliHMPIDCluster():AliCluster3D(), + fCh(-1),fSi(-1),fSt(kEmp),fBox(-1),fNlocMax(-1),fMaxQpad(-1),fMaxQ(-1),fQRaw(0),fQ(0),fErrQ(-1),fX(0),fErrX(-1),fY(0),fErrY(-1),fChi2(-1),fDigs(0) {} //empty ctor - - AliHMPIDCluster (const AliHMPIDCluster &c):TObject(c),fCh(c.fCh),fSi(c.fSi),fSt(c.fSt),fBox(c.fBox),fNlocMax(c.fNlocMax),fMaxQpad(c.fMaxQpad),fMaxQ(c.fMaxQ),fQRaw(c.fQRaw), - fQ (c.fQ ),fErrQ(c.fErrQ), - fX (c.fX ),fErrX(c.fErrX), - fY (c.fY ),fErrY(c.fErrY),fChi2(c.fChi2),fDigs(0) {}//copy ctor - AliHMPIDCluster &operator=(const AliHMPIDCluster &c) {if(this == &c)return *this;TObject::operator=(c); - fSi=c.fSi; fSt=c.fSt; fCh=c.fCh; fBox=c.fBox;fNlocMax=c.fNlocMax;fMaxQpad=c.fMaxQpad; fMaxQ=c.fMaxQ;fQRaw=c.fQRaw; - fQ=c.fQ; fErrQ=c.fErrQ; - fX=c.fX; fErrX=c.fErrX; - fY=c.fY; fErrY=c.fErrY; fChi2=c.fChi2;fDigs=c.fDigs ? new TObjArray(*c.fDigs):0; return *this;} - - virtual ~AliHMPIDCluster( ) {if(fDigs) delete fDigs; fDigs=0;} + + AliHMPIDCluster(const AliHMPIDCluster &c):AliCluster3D(c), + fCh(c.fCh),fSi(c.fSi),fSt(c.fSt),fBox(c.fBox),fNlocMax(c.fNlocMax),fMaxQpad(c.fMaxQpad),fMaxQ(c.fMaxQ),fQRaw(c.fQRaw), + fQ (c.fQ ),fErrQ(c.fErrQ), + fX (c.fX ),fErrX(c.fErrX), + fY (c.fY ),fErrY(c.fErrY),fChi2(c.fChi2),fDigs(0) {}//copy ctor + virtual ~AliHMPIDCluster();//dtor {if(fDigs) delete fDigs; fDigs=0;} //framework part void Draw (Option_t *opt="" ); //overloaded TObject::Print() to draw cluster in current canvas void Print (Option_t *opt="" )const; //overloaded TObject::Print() to print cluster info static void FitFunc(Int_t &iNpars, Double_t* /*deriv*/, Double_t &chi2, Double_t *par, Int_t iflag);//fit function to be used by MINUIT //private part - Int_t Box ( )const{return fBox; } + Int_t Box ( )const{return fBox; } //Dimension of the cluster void CoG ( ); //calculates center of gravity void CorrSin ( ); //sinoidal correction Int_t Ch ( )const{return fCh; } //chamber number @@ -45,6 +43,7 @@ public: AliHMPIDDigit* Dig (Int_t i )const{return (AliHMPIDDigit*)fDigs->At(i); } //pointer to i-th digi inline Bool_t IsInPc (); //check if is in the current PC inline void Reset ( ); //cleans the cluster + void SetClusterParams(Double_t xL,Double_t yL,Int_t iCh ); //Set AliCluster3D part Int_t Size ( )const{return fSi; } //returns number of pads in formed cluster Int_t Solve (TClonesArray *pCluLst,Bool_t isUnfold ); //solve cluster: MINUIT fit or CoG Int_t Status ( ) const{return fSt;} //Status of cluster @@ -59,6 +58,15 @@ public: void DoCorrSin(Bool_t doCorrSin ){fgDoCorrSin=doCorrSin;} // Set sinoidal correction void SetX (Double_t x ){fX=x;} // Setter void SetY (Double_t y ){fY=y;} // Setter + +private: +/* + AliHMPIDCluster &operator=(const AliHMPIDCluster &c) {if(this == &c)return *this;AliCluster3D::operator=(c); + fSi=c.fSi; fSt=c.fSt; fCh=c.fCh; fBox=c.fBox;fNlocMax=c.fNlocMax;fMaxQpad=c.fMaxQpad; fMaxQ=c.fMaxQ;fQRaw=c.fQRaw; + fQ=c.fQ; fErrQ=c.fErrQ; + fX=c.fX; fErrX=c.fErrX; + fY=c.fY; fErrY=c.fErrY; fChi2=c.fChi2;fDigs=c.fDigs ? new TObjArray(*c.fDigs):0; return *this;} +*/ protected: Int_t fCh; //chamber number Int_t fSi; //size of the formed cluster from which this cluster deduced @@ -77,8 +85,8 @@ protected: Double_t fChi2; //some estimator of the fit quality TObjArray *fDigs; //! list of digits forming this cluster static Bool_t fgDoCorrSin; //flag to switch on/off correction for Sinusoidal to cluster reco - ClassDef(AliHMPIDCluster,6) //HMPID cluster class -};//class AliHMPIDCluster + ClassDef(AliHMPIDCluster,7) //HMPID cluster class +}; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void AliHMPIDCluster::DigAdd(AliHMPIDDigit *pDig) diff --git a/HMPID/AliHMPIDRecoParam.cxx b/HMPID/AliHMPIDRecoParam.cxx new file mode 100644 index 00000000000..9df03a75cd3 --- /dev/null +++ b/HMPID/AliHMPIDRecoParam.cxx @@ -0,0 +1,79 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class to set HMPID reconstruction parameters (normal, HTA, UserCut ... // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +// +//Email: Levente.Molnar@ba.infn.it +// + +#include "AliHMPIDRecoParam.h" +#include "AliHMPIDParam.h" + +ClassImp(AliHMPIDRecoParam) + +//_____________________________________________________________________________ +AliHMPIDRecoParam::AliHMPIDRecoParam():TNamed(), + fRecoMode(kTRUE), + fUserCutMode(kTRUE) +{ + // + // ctor + // + for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fUserCut[iCh]=3; +} +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +AliHMPIDRecoParam::AliHMPIDRecoParam(const AliHMPIDRecoParam &p):TNamed(p), + fRecoMode(kTRUE), + fUserCutMode(kTRUE) +{ + //copy Ctor + + fRecoMode= p.fRecoMode; + for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fUserCut[iCh]=p.fUserCut[iCh]; + fUserCutMode = p.fUserCutMode; +} + +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +AliHMPIDRecoParam& AliHMPIDRecoParam::operator=(const AliHMPIDRecoParam &p) +{ +// +// assign. operator +// + this->fRecoMode= p.fRecoMode; + for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) this->fUserCut[iCh] = p.fUserCut[iCh]; + this->fUserCutMode = p.fUserCutMode; + return *this; +} +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +AliHMPIDRecoParam *AliHMPIDRecoParam::GetUserModeParam(){ + // + // Provide access to reconstruction parameters fro the rec.C + // + AliHMPIDRecoParam *hmpidRecoParam = new AliHMPIDRecoParam; + return hmpidRecoParam; +} +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +AliHMPIDRecoParam::~AliHMPIDRecoParam() +{ + // + // dtor + // +} diff --git a/HMPID/AliHMPIDRecoParam.h b/HMPID/AliHMPIDRecoParam.h new file mode 100644 index 00000000000..5f2431934ec --- /dev/null +++ b/HMPID/AliHMPIDRecoParam.h @@ -0,0 +1,73 @@ +#ifndef ALIHMPIDRECOPARAM_H +#define ALIHMPIDRECOPARAM_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class to set HMPID reconstruction parameters (normal, HTA, UserCut ... // +// // +/////////////////////////////////////////////////////////////////////////////// +// +//Email: Levente.Molnar@ba.infn.it +// + +#include "TNamed.h" + +class AliHMPIDRecoParam : public TNamed +{ + public: + + AliHMPIDRecoParam(); //ctor + AliHMPIDRecoParam(const AliHMPIDRecoParam &p); //copy ctor + AliHMPIDRecoParam& operator=(const AliHMPIDRecoParam &p); // ass. op. + virtual ~AliHMPIDRecoParam(); //dtor + + Bool_t GetRecoMode( ) const { return fRecoMode; } + inline Int_t GetUserCut(Int_t iCh ); + Bool_t GetUserCutMode( ) const { return fUserCutMode; } + + void SetRecoMode(Bool_t recoMode) { fRecoMode=recoMode; } + inline void SetUserCut(Int_t ucCh0,Int_t ucCh1,Int_t ucCh2,Int_t ucCh3,Int_t ucCh4,Int_t ucCh5,Int_t ucCh6);////set user cut + void SetUserCutMode(Bool_t userCutMode) { fUserCutMode=userCutMode; } + + static AliHMPIDRecoParam *GetUserModeParam(); // make reco parameters + + + protected: + + Bool_t fRecoMode; //kTRUE = normal tracking reco, kFALSE = HTA + Int_t fUserCut[7]; //user cut for the 7 chambers + Bool_t fUserCutMode; //kTRUE = get user cut from OCDB, kFALSE = get user cut from AliHMPIDRecoParam + + + ClassDef(AliHMPIDRecoParam, 1) +}; + +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +void AliHMPIDRecoParam::SetUserCut(Int_t ucCh0,Int_t ucCh1,Int_t ucCh2,Int_t ucCh3,Int_t ucCh4,Int_t ucCh5,Int_t ucCh6) +{ + // + // Set user cuts, ... make it nicer later ... + // + + fUserCut[0]=ucCh0; + fUserCut[1]=ucCh1; + fUserCut[2]=ucCh2; + fUserCut[3]=ucCh3; + fUserCut[4]=ucCh4; + fUserCut[5]=ucCh5; + fUserCut[6]=ucCh6; +} //SetUserCut() +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Int_t AliHMPIDRecoParam::GetUserCut(Int_t iCh) +{ + // + //Return the UserCut for a given chamber + // + if( iCh < 0 || iCh > 6 ) return 3; // return a basic value actually does nothing , ADD AliError??? + else return fUserCut[iCh]; // return the actual user cut + +} +#endif + diff --git a/HMPID/AliHMPIDReconstructor.cxx b/HMPID/AliHMPIDReconstructor.cxx index 4a4f076b1bb..2265284322c 100644 --- a/HMPID/AliHMPIDReconstructor.cxx +++ b/HMPID/AliHMPIDReconstructor.cxx @@ -26,8 +26,10 @@ #include //FillEsd() #include //Reconstruct() for raw digits #include "AliHMPIDRawStream.h" //ConvertDigits() +#include "AliHMPIDRecoParam.h" //ctor ClassImp(AliHMPIDReconstructor) +AliHMPIDRecoParam* AliHMPIDReconstructor::fgkRecoParam =0; // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AliHMPIDReconstructor::AliHMPIDReconstructor():AliReconstructor(),fUserCut(0),fDaqSig(0),fDig(0),fClu(0) { @@ -45,17 +47,25 @@ AliHMPIDReconstructor::AliHMPIDReconstructor():AliReconstructor(),fUserCut(0),fD pClus->SetUniqueID(i); fClu->AddAt(pClus,i); } - + + if(fgkRecoParam!=0x0 && fgkRecoParam->GetUserCutMode()==kFALSE) + { + for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) { + fUserCut[iCh] = fgkRecoParam->GetUserCut(iCh); + Printf("HMPID: UserCut successfully loaded (from RecoParam) for chamber %i -> %i ",iCh,fUserCut[iCh]); + } + } + else { AliCDBEntry *pUserCutEnt =AliCDBManager::Instance()->Get("HMPID/Calib/UserCut"); //contains TObjArray of 14 TObject with n. of sigmas to cut charge if(pUserCutEnt) { TObjArray *pUserCut = (TObjArray*)pUserCutEnt->GetObject(); for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){ //chambers loop fUserCut[iCh] = pUserCut->At(iCh)->GetUniqueID(); - Printf("HMPID: UserCut successfully loaded for chamber %i -> %i ",iCh,fUserCut[iCh]); + Printf("HMPID: UserCut successfully loaded (from OCDB) for chamber %i -> %i ",iCh,fUserCut[iCh]); } + } } - - + AliCDBEntry *pDaqSigEnt =AliCDBManager::Instance()->Get("HMPID/Calib/DaqSig"); //contains TObjArray of TObjArray 14 TMatrixF sigmas values for pads if(!pDaqSigEnt) AliFatal("No pedestals from DAQ!"); fDaqSig = (TObjArray*)pDaqSigEnt->GetObject(); diff --git a/HMPID/AliHMPIDReconstructor.h b/HMPID/AliHMPIDReconstructor.h index 60310b4c4dc..88acca81104 100644 --- a/HMPID/AliHMPIDReconstructor.h +++ b/HMPID/AliHMPIDReconstructor.h @@ -8,6 +8,7 @@ #include //base class #include "AliHMPIDTracker.h" //CreateTracker() #include "AliHMPIDDigit.h" //Dig2Clu(), UseDig() +#include "AliHMPIDRecoParam.h" //Init #include //UseDig() #include //UseDig() @@ -36,7 +37,12 @@ public: static inline AliHMPIDDigit* UseDig (Int_t padX,Int_t padY, TClonesArray *pDigLst,TMatrixF *pDigMap);//use this pad's digit to form a cluster inline Bool_t IsDigSurvive(AliHMPIDDigit *pDig )const;//check for sigma cut + void SetRecoParam(AliHMPIDRecoParam *recopar){ fgkRecoParam = recopar;} + static const AliHMPIDRecoParam* GetRecoParam(){ return fgkRecoParam;} + + protected: + static AliHMPIDRecoParam* fgkRecoParam; // Pointer to HMPID RecoParams Int_t *fUserCut; // n sigmas for pedestals decided by the User for each chamber(if in OCDB) TObjArray *fDaqSig; // container for the pad pedestal sigmas TObjArray *fDig; // tmp list of digits @@ -46,10 +52,10 @@ public: AliHMPIDReconstructor(const AliHMPIDReconstructor& r); //dummy copy constructor AliHMPIDReconstructor &operator=(const AliHMPIDReconstructor& r); //dummy assignment operator // - ClassDef(AliHMPIDReconstructor, 0) // class for the HMPID reconstruction + ClassDef(AliHMPIDReconstructor, 1) // class for the HMPID reconstruction }; -//__________________________________________________________________________________________________ +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AliHMPIDDigit* AliHMPIDReconstructor::UseDig(Int_t padX,Int_t padY,TClonesArray *pDigLst,TMatrixF *pPadMap) { //Digit map contains a matrix if digit numbers. diff --git a/HMPID/AliHMPIDv2.cxx b/HMPID/AliHMPIDv2.cxx index 3e5530a78eb..402bc7d4e59 100644 --- a/HMPID/AliHMPIDv2.cxx +++ b/HMPID/AliHMPIDv2.cxx @@ -49,10 +49,29 @@ void AliHMPIDv2::AddAlignableVolumes()const Double_t trans[3]={0.5*131.24,0.5*126.16,0}; //translation from LORS to TGeo RS (half size AllX, half size allY,0) pGm->SetTranslation(trans); - for(Int_t i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++) { - TGeoPNEntry *pPn=gGeoManager->SetAlignableEntry(Form("/HMPID/Chamber%i",i),Form("ALIC_1/Hmp_%i",i)); - if(pPn) pPn->SetMatrix(pGm); - } + Double_t ph[7]={10.,10., 30.,30.,30. ,50.,50}; + + for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) { + gGeoManager->SetAlignableEntry(Form("/HMPID/Chamber%i",iCh),Form("ALIC_1/Hmp_%i",iCh)); //aligment without AliCluster3D + //Get Tracking To Local matrcies for alignment with AliCluster3D + TGeoPNEntry *eCh = gGeoManager->GetAlignableEntry(Form("/HMPID/Chamber%i",iCh)); + if (eCh) { + const char *path = eCh->GetTitle(); + if (!gGeoManager->cd(path)) { + AliFatal(Form("Volume path %s not valid!",path)); + } + TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix(); + //Double_t phi = 20.0 * ((iCh+1) / 3) + 10.0; + Double_t phi = ph[iCh]; + TGeoHMatrix *t2l = new TGeoHMatrix(); + t2l->RotateZ(phi); + t2l->MultiplyLeft(&(globMatrix->Inverse())); + eCh->SetMatrix(t2l); + }//eCh + else { + AliError(Form("Alignable entry /HMPID/Chamber%i is not valid!",iCh)); + } + }//iCh loop } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void AliHMPIDv2::CreateMaterials() diff --git a/HMPID/HMPIDrecLinkDef.h b/HMPID/HMPIDrecLinkDef.h index ca28b734e87..cd6ae280f9d 100644 --- a/HMPID/HMPIDrecLinkDef.h +++ b/HMPID/HMPIDrecLinkDef.h @@ -6,5 +6,6 @@ #pragma link C++ class AliHMPIDReconstructor+; #pragma link C++ class AliHMPIDTracker+; #pragma link C++ class AliHMPIDRecon+; +#pragma link C++ class AliHMPIDRecoParam+; #pragma link C++ class AliHMPIDReconHTA+; #endif diff --git a/HMPID/Hconfig.C b/HMPID/Hconfig.C index 39d6cbe3577..b8beb0c7e88 100644 --- a/HMPID/Hconfig.C +++ b/HMPID/Hconfig.C @@ -26,7 +26,7 @@ public: enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kACORDE,kHALL,kPHOS,kT0,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD}; enum EProcesses {kDCAY=1,kPAIR,kCOMP,kPHOT,kPFIS,kDRAY,kANNI,kBREM,kMUNU,kCKOV,kHADR,kLOSS,kMULS,kRAYL,kALL}; - enum EBatchFlags{kAll=55,kHmp,kDdl,kDat,kRoo,kVtx,kTrk,kHlt,kPid,kAln}; + enum EBatchFlags{kAll=55,kHmp,kDdl,kDat,kRoo,kVtx,kTrk,kHlt,kPid,kAln,kRecoPar}; enum EMagField {kFld0,kFld2,kFld4,kFld5,kFld_2,kFld_4,kFld_5}; Float_t Eta2Theta (Float_t arg) const{return (180./TMath::Pi())*2.*TMath::ATan(TMath::Exp(-arg));} @@ -513,6 +513,9 @@ void HmpConfig::GuiBatch(TGHorizontalFrame *pMainF) new TGRadioButton(fCluBG, "No Clusters" ,kNo ); new TGRadioButton(fCluBG, "Clusters CORE" ,kAll ); new TGRadioButton(fCluBG, "Clusters HMPID" ,kHmp ); + + new TGCheckButton(fTrkBG, "Apply RecoParam" ,kRecoPar); + new TGCheckButton(fTrkBG, "Load Align data" ,kAln ); new TGCheckButton(fTrkBG, "Prim vertex" ,kVtx ); new TGCheckButton(fTrkBG, "ESD tracks" ,kTrk ); @@ -569,6 +572,7 @@ void HmpConfig::SlotRec(Bool_t isChk) fCluBG->GetButton(kAll)->SetState(kButtonEngaged); fCluBG->GetButton(kHmp)->SetState(kButtonDown); + fTrkBG->GetButton(kRecoPar)->SetState(kButtonEngaged); fTrkBG->GetButton(kAln)->SetState(kButtonEngaged); fTrkBG->GetButton(kVtx)->SetState(kButtonEngaged); fTrkBG->GetButton(kTrk)->SetState(kButtonEngaged); @@ -583,6 +587,7 @@ void HmpConfig::SlotRec(Bool_t isChk) fCluBG->GetButton(kAll)->SetState(kButtonDisabled); fCluBG->GetButton(kHmp)->SetState(kButtonDisabled); + fTrkBG->GetButton(kRecoPar)->SetState(kButtonDisabled); fTrkBG->GetButton(kAln)->SetState(kButtonDisabled); fTrkBG->GetButton(kVtx)->SetState(kButtonDisabled); fTrkBG->GetButton(kTrk)->SetState(kButtonDisabled); @@ -645,6 +650,16 @@ void HmpConfig::WriteBatch() if(fRecB->GetState()){ fprintf(fp," AliReconstruction *pRec=new AliReconstruction;\n"); + //--------------------------------------------- + if (fTrkBG->GetButton(kRecoPar)->GetState()) + { + fprintf(fp," AliHMPIDRecoParam * hmpidRecoParam = AliHMPIDRecoParam::GetUserModeParam(); //Get the HMPID reco param\n"); + fprintf(fp," hmpidRecoParam->SetUserCutMode(kFALSE); //Switch to RecoParam from OCDB cuts\n"); + fprintf(fp," hmpidRecoParam->SetUserCut(4,4,4,4,4,4,4); //eg cut for UserCutSigma (Values: ch0, ch1, ..,ch6)\n"); + fprintf(fp," AliHMPIDReconstructor::SetRecoParam(hmpidRecoParam); //Pass the RecoPar to the Reconstructor\n"); + } + //--------------------------------------------- + if (fInpBG->GetButton(kNo )->GetState()) fprintf(fp," pRec->SetInput(\"\"); //from digits\n"); else if(fInpBG->GetButton(kDdl)->GetState()) fprintf(fp," pRec->SetInput(\"./\"); //from raw data in DDL format\n"); else if(fInpBG->GetButton(kDat)->GetState()) fprintf(fp," pRec->SetInput(\"raw.date\"); //from raw data in DATE format\n"); @@ -654,6 +669,8 @@ void HmpConfig::WriteBatch() else if(fCluBG->GetButton(kHmp) ->GetState()) fprintf(fp," pRec->SetRunLocalReconstruction(\"HMPID\"); //clusters for HMPID only\n"); else if(fCluBG->GetButton(kNo) ->GetState()) fprintf(fp," pRec->SetRunLocalReconstruction(\"\"); //no clusters\n"); + + if (fTrkBG->GetButton(kAln)->GetState()) fprintf(fp," pRec->SetLoadAlignData(\"%s\"); //with misalignment\n",det.Data()); else fprintf(fp," pRec->SetLoadAlignData(\"\"); //no misalignment\n"); diff --git a/HMPID/libHMPIDrec.pkg b/HMPID/libHMPIDrec.pkg index 022cba8bc5c..9ec328a3799 100644 --- a/HMPID/libHMPIDrec.pkg +++ b/HMPID/libHMPIDrec.pkg @@ -1,4 +1,4 @@ -SRCS:= AliHMPIDReconstructor.cxx AliHMPIDTracker.cxx AliHMPIDRecon.cxx AliHMPIDReconHTA.cxx +SRCS:= AliHMPIDReconstructor.cxx AliHMPIDTracker.cxx AliHMPIDRecon.cxx AliHMPIDRecoParam.cxx AliHMPIDReconHTA.cxx HDRS:= $(SRCS:.cxx=.h) DHDR:= HMPIDrecLinkDef.h -- 2.43.0