X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCParam.cxx;h=0a3c340f1c7e64c456a93ca0a6864a0c6984b886;hb=629e03fcadfa48aeac979e40c91d2a97e73a3201;hp=7835205c877c843f864c6761051c8806845b5248;hpb=995d5cc2242b0fd60810db60edb621352e2331d8;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCParam.cxx b/TPC/AliTPCParam.cxx index 7835205c877..0a3c340f1c7 100644 --- a/TPC/AliTPCParam.cxx +++ b/TPC/AliTPCParam.cxx @@ -143,29 +143,10 @@ AliTPCParam::~AliTPCParam() if (fResponseWeight!=0) delete [] fResponseWeight; if (fRotAngle !=0) delete [] fRotAngle; - if (fTrackingMatrix) { - for(Int_t i = 0; i < fNSector; i++) - delete fTrackingMatrix[i]; - delete [] fTrackingMatrix; - } - - if (fClusterMatrix) { - for(Int_t i = 0; i < fNSector; i++) - delete fClusterMatrix[i]; - delete [] fClusterMatrix; - } - - if (fGlobalMatrix) { - for(Int_t i = 0; i < fNSector; i++) - delete fGlobalMatrix[i]; - delete [] fGlobalMatrix; - } + CleanGeoMatrices(); } - - - Int_t AliTPCParam::Transform0to1(Float_t *xyz, Int_t * index) const { // @@ -607,7 +588,31 @@ Bool_t AliTPCParam::Update() return kTRUE; } +void AliTPCParam::CleanGeoMatrices(){ + // + // clean geo matrices + // + if (fTrackingMatrix) { + for(Int_t i = 0; i < fNSector; i++) + delete fTrackingMatrix[i]; + delete [] fTrackingMatrix; + } + + if (fClusterMatrix) { + for(Int_t i = 0; i < fNSector; i++) + delete fClusterMatrix[i]; + delete [] fClusterMatrix; + } + + if (fGlobalMatrix) { + for(Int_t i = 0; i < fNSector; i++) + delete fGlobalMatrix[i]; + delete [] fGlobalMatrix; + } + + return; +} Bool_t AliTPCParam::ReadGeoMatrices(){ // @@ -618,11 +623,13 @@ Bool_t AliTPCParam::ReadGeoMatrices(){ } AliAlignObjParams o; // - if (fTrackingMatrix) delete [] fTrackingMatrix; + + // clean geo matrices + CleanGeoMatrices(); + + // create new geo matrices fTrackingMatrix = new TGeoHMatrix*[fNSector]; - if (fClusterMatrix) delete [] fClusterMatrix; fClusterMatrix = new TGeoHMatrix*[fNSector]; - if (fGlobalMatrix) delete [] fGlobalMatrix; fGlobalMatrix = new TGeoHMatrix*[fNSector]; for (Int_t isec=0; isec