X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSEvalRecPoint.cxx;h=fae088df97d587821b542dd1b719f6c6977dca80;hb=8a2a61d375044bcc5cef2a2bd11cf5b58fcb6303;hp=8ed06d3c5c67943e7c97caa4aff0480759e5b5b2;hpb=893081752a90f066744abd3afb3333345be60503;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSEvalRecPoint.cxx b/PHOS/AliPHOSEvalRecPoint.cxx index 8ed06d3c5c6..fae088df97d 100644 --- a/PHOS/AliPHOSEvalRecPoint.cxx +++ b/PHOS/AliPHOSEvalRecPoint.cxx @@ -12,10 +12,9 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Id: */ -/* $Log: - */ +/* $Id$ */ + //*-- Author: Boris Polichtchouk, IHEP ////////////////////////////////////////////////////////////////////////////// // Reconstructed point operations for the Clusterization class for IHEP reconstruction. @@ -23,14 +22,17 @@ // It differs from AliPHOSClusterizerv1 in neighbour definition only // ---- ROOT system --- -#include "TDirectory.h" -#include "TBranch.h" -#include "TTree.h" -#include "TROOT.h" -#include "TFolder.h" +#include +#include +#include +#include +#include +#include // --- AliRoot header files --- +#include "AliLog.h" #include "AliConfig.h" +#include "AliPHOSDigit.h" #include "AliPHOSClusterizer.h" #include "AliPHOSEvalRecPoint.h" #include "AliRun.h" @@ -38,22 +40,29 @@ #include "AliPHOSRecCpvManager.h" #include "AliPHOSRecEmcManager.h" #include "AliPHOSDigitizer.h" +#include "AliPHOSGeometry.h" // --- Standard library --- ClassImp(AliPHOSEvalRecPoint) - AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(): fEventFolderName(AliConfig::fgkDefaultEventFolderName) +AliPHOSEvalRecPoint::AliPHOSEvalRecPoint() : + fIsEmc(kFALSE), + fIsCpv(kTRUE), + fParent(-333), + fChi2Dof(-111), + fEventFolderName(AliConfig::GetDefaultEventFolderName()) { // default ctor - fParent=-333; - fChi2Dof=-111; - fIsCpv = kTRUE; - fIsEmc = kFALSE; } -AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Bool_t cpv, AliPHOSEvalRecPoint* parent) : AliPHOSCpvRecPoint() +AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Bool_t cpv, AliPHOSEvalRecPoint* parent) : + fIsEmc(kFALSE), + fIsCpv(kFALSE), + fParent(-333), + fChi2Dof(-111), + fEventFolderName("") { // ctor fParent=-333; @@ -62,11 +71,12 @@ AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Bool_t cpv, AliPHOSEvalRecPoint* parent // fParent=parent; TObjArray* wPool = (TObjArray*)GetWorkingPool(); if(!wPool) { - Error("AliPHOSEvalRecPoint", "Couldn't find working pool. Exit.") ; - exit(1); + Fatal("ctor", "Couldn't find working pool") ; } - fParent = wPool->IndexOf((TObject*)parent); + if(wPool) + fParent = wPool->IndexOf((TObject*)parent); + fChi2Dof = parent->Chi2Dof(); if(cpv) { @@ -83,12 +93,14 @@ AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Bool_t cpv, AliPHOSEvalRecPoint* parent } -AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Int_t i, Bool_t cpv) : fEventFolderName(AliConfig::fgkDefaultEventFolderName) +AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Int_t i, Bool_t cpv) : + fIsEmc(kFALSE), + fIsCpv(kFALSE), + fParent(-333), + fChi2Dof(-111), + fEventFolderName(AliConfig::GetDefaultEventFolderName()) { // ctor - fChi2Dof=-111; - fParent=-333; - AliPHOSEmcRecPoint* rp=0; AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); @@ -130,8 +142,7 @@ AliPHOSClusterizer* AliPHOSEvalRecPoint::GetClusterizer() TFolder* wPoolF = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/SmP"); AliPHOSClusterizer* clu = (AliPHOSClusterizer*)wPoolF->FindObject("PHOS:clu-v1"); if(!clu) { - Error("GetClusterizer", "Couldn't find Clusterizer. Exit.") ; - exit(1); + Fatal("GetClusterizer", "Couldn't find Clusterizer") ; } return clu; @@ -222,8 +233,7 @@ void AliPHOSEvalRecPoint::Init() // initialization AliPHOSClusterizer* clusterizer = GetClusterizer(); if(!clusterizer) { - Error("Init", "Cannot get clusterizer. Exit.") ; - exit(1); + AliFatal("Cannot get clusterizer") ; } TClonesArray* digits = AliPHOSLoader::GetPHOSLoader(fEventFolderName)->Digits(); @@ -236,7 +246,9 @@ void AliPHOSEvalRecPoint::Init() logWeight = clusterizer->GetCpvLogWeight(); } - EvalLocalPosition(logWeight,digits); // evaluate initial position + TVector3 vtx(0.,0.,0.) ; + TVector3 inc(0.,0.,0.) ; + EvalLocalPosition(logWeight,vtx,digits,inc); // evaluate initial position } @@ -280,7 +292,7 @@ void AliPHOSEvalRecPoint::InitTwoGam(Float_t* gamma1, Float_t* gamma2) Float_t yy = lpos.X(); Float_t e = GetEnergy(); - Info("InitTwoGam", "(x,z,e)[old] = (%f, %f, %f)", yy, xx, e) ; + AliInfo(Form("(x,z,e)[old] = (%f, %f, %f)", yy, xx, e)) ; // xx = XY(xx/e); // yy = XY(yy/e); @@ -303,7 +315,7 @@ void AliPHOSEvalRecPoint::InitTwoGam(Float_t* gamma1, Float_t* gamma2) Float_t cos2fi = 1.; AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); - const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry(); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; Int_t iDigit; //loop variable @@ -311,8 +323,8 @@ void AliPHOSEvalRecPoint::InitTwoGam(Float_t* gamma1, Float_t* gamma2) { digit = (AliPHOSDigit*)fLoader->Digits()->At( digits[iDigit] ); eDigit = energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; - fGeom->RelPosInModule(relid, iy, ix); + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, iy, ix); Float_t dx = ix - xx; Float_t dy = iy - yy; @@ -334,8 +346,8 @@ void AliPHOSEvalRecPoint::InitTwoGam(Float_t* gamma1, Float_t* gamma2) { digit = (AliPHOSDigit*)fLoader->Digits()->At( digits[iDigit] ); eDigit = energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; - fGeom->RelPosInModule(relid, iy, ix); + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, iy, ix); Float_t dx = ix - xx; Float_t dy = iy - yy; @@ -433,7 +445,7 @@ void AliPHOSEvalRecPoint::TwoGam(Float_t* gamma1, Float_t* gamma2) Int_t relid[4] ; AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); - const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry(); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; for(Int_t iter=0; iterDigits()->At( digits[iDigit] ); eDigit = energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; - fGeom->RelPosInModule(relid, iy, ix); + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, iy, ix); Float_t a1,gx1,gy1; Float_t a2,gx2,gy2; Float_t dx1 = x1c - ix; Float_t dy1 = y1c - iy; -// Info("TwoGam", "Mult %d dx1 %f dy1 %f", nDigits, dx1, dy1) ; -// AG(e1c,dx1,dy1,a1,gx1,gy1); + GetReconstructionManager()->AG(e1c,dx1,dy1,a1,gx1,gy1); Float_t dx2 = x2c - ix; Float_t dy2 = y2c - iy; -// Info("TwoGam", " dx2 %f dy2 %f", dx2, dy2) ; -// AG(e2c,dx2,dy2,a2,gx2,gy2); + GetReconstructionManager()->AG(e2c,dx2,dy2,a2,gx2,gy2); Float_t a = a1+a2; @@ -521,8 +531,8 @@ void AliPHOSEvalRecPoint::TwoGam(Float_t* gamma1, Float_t* gamma2) loop20: ; Float_t step = st*gr; - Info("TwoGam", "Iteration %d dof %d chisq/dof %f chstop/dof %f step %d stpmin %d", - iter, dof, ch/dof, chstop/dof, step, stpmin) ; + AliInfo(Form("Iteration %d dof %d chisq/dof %f chstop/dof %f step %f stpmin %f", + iter, dof, ch/dof, chstop/dof, step, stpmin)) ; if(stepPHOSGeometry(); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; for(Int_t iDigit=0; iDigitDigits()->At( digits[iDigit] ); Int_t relid[4] ; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; Float_t x,z; - fGeom->RelPosInModule(relid, x, z); + phosgeom->RelPosInModule(relid, x, z); Float_t gain = 0.; for(Int_t iMax=0; iMaxDigits()->At( digits[iDigit] ); Float_t eDigit = energies[iDigit]; Int_t relid[4] ; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; Float_t ix,iz; - fGeom->RelPosInModule(relid, ix, iz); + phosgeom->RelPosInModule(relid, ix, iz); Float_t dx = xMax - ix; Float_t dz = zMax - iz; @@ -660,8 +670,9 @@ void AliPHOSEvalRecPoint::UnfoldTwoMergedPoints(Float_t* gamma1, Float_t* gamma2 eDigit = eDigit*ratio; newRP->AddDigit(*digit,eDigit); } - Info("UnfoldTwoMergedPoints", "======= Split: daughter rec point %d =================", iMax) ; - newRP->Print(""); + AliInfo(Form("======= Split: daughter rec point %d =================", + iMax)) ; + newRP->Print(); } @@ -711,7 +722,7 @@ void AliPHOSEvalRecPoint::EvaluatePosition() Float_t chisqc; AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); - const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry(); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; for(Int_t iter=0; iterDigits()->At( digits[iDigit] ); eDigit = energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; - fGeom->RelPosInModule(relid, iy, ix); + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, iy, ix); dx = xc - ix; dy = yc - iy; @@ -738,7 +749,8 @@ void AliPHOSEvalRecPoint::EvaluatePosition() Float_t a; GetReconstructionManager()->AG(e,dx,dy,a,gx,gy); Float_t dd; - Info("EvaluatePosition", " (ix iy xc yc dx dy) %f %f %f %f %f %f", ix, iy, xc, yc, dx, dy) ; + AliInfo(Form(" (ix iy xc yc dx dy) %f %f %f %f %f %f", + ix, iy, xc, yc, dx, dy)) ; Float_t chi2dg = GetReconstructionManager()->OneGamChi2(a,eDigit,e,dd); // Exclude digit with too large chisquare. @@ -753,7 +765,7 @@ void AliPHOSEvalRecPoint::EvaluatePosition() Float_t grc = TMath::Sqrt(grxc*grxc + gryc*gryc); if(grc<1.e-10) grc=1.e-10; Float_t sc = 1. + chisqc/chisq; - Info("EvaluatePosition", " chisq: %f", chisq) ; + AliInfo(Form(" chisq: %f", chisq)) ; st = st/sc; if(chisqc>chisq) goto loop20; @@ -772,8 +784,8 @@ void AliPHOSEvalRecPoint::EvaluatePosition() loop20: ; Float_t step = st*gr; - Info("EvaluatePosition", " Iteration %d dof %d chisq/dof %f chstop/dof %f step %d stpMin %d", - iter, dof, chisq/dof, chisq/dof, chstop/dof, step, stpMin) ; + AliInfo(Form(" Iteration %d dof %d chisq/dof %f chstop/dof %f step %f stpMin %f", + iter, dof, chisq/dof, chstop/dof, step, stpMin)) ; if(stepKillGamMinEnergy(); if(GetEnergy()Print(""); - Info("MergeClosePoint", "+++++++ and point 2: ++++++++++") ; - ((AliPHOSEvalRecPoint*)rp)->Print(""); + AliInfo(Form("+++++++ Merging point 1: ++++++")) ; + this->Print(); + AliInfo(Form("+++++++ and point 2: ++++++++++")) ; + ((AliPHOSEvalRecPoint*)rp)->Print(); //merge two rec. points TVector3 lpos1; @@ -897,8 +909,8 @@ void AliPHOSEvalRecPoint::MergeClosePoint() RemoveFromWorkingPool(rp); delete rp; - Info("MergeClosePoint", "++++++ Resulting point: ++++++++") ; - this->Print(""); + AliInfo(Form("++++++ Resulting point: ++++++++")) ; + this->Print(); break; } @@ -925,8 +937,7 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() AliPHOSClusterizer* clusterizer = GetClusterizer(); if(!clusterizer) { - Error("UnfoldLocalMaxima", "Cannot get clusterizer. Exit.") ; - exit(1); + AliFatal(Form("Cannot get clusterizer")) ; } if(this->IsEmc()) { @@ -939,7 +950,7 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() } AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); - const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry(); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; TClonesArray* digits = fLoader->Digits(); // if number of local maxima less then 2 - nothing to unfold @@ -962,16 +973,16 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() { AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->At( digitsList[iDigit] ); - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; Float_t x,z; - fGeom->RelPosInModule(relid, x, z); + phosgeom->RelPosInModule(relid, x, z); for(Int_t iMax=0; iMaxAbsToRelNumbering(digitMax->GetId(), relid) ; - fGeom->RelPosInModule(relid, xMax, zMax); + phosgeom->AbsToRelNumbering(digitMax->GetId(), relid) ; + phosgeom->RelPosInModule(relid, xMax, zMax); Float_t dx = xMax - x; Float_t dz = zMax - z; Float_t amp,gx,gy; @@ -985,21 +996,21 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() for(Int_t iMax=0; iMaxAbsToRelNumbering(digitMax->GetId(), relid) ; - fGeom->RelPosInModule(relid, xMax, zMax); + phosgeom->AbsToRelNumbering(digitMax->GetId(), relid) ; + phosgeom->RelPosInModule(relid, xMax, zMax); Float_t eMax = maxAtEnergy[iMax]; AliPHOSEvalRecPoint* newRP = new AliPHOSEvalRecPoint(IsCPV(),this); newRP->AddDigit(*digitMax,maxAtEnergy[iMax]); //Neighbous ( matrix 3x3 around the local maximum) - for(Int_t iDigit=0; iDigitDigits()->At( digitsList[iDigit] ); Float_t eDigit = energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; Float_t ix,iz; - fGeom->RelPosInModule(relid, ix, iz); + phosgeom->RelPosInModule(relid, ix, iz); if(AreNeighbours(digitMax,digit)) { @@ -1009,15 +1020,18 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() GetReconstructionManager()->AG(eMax,dz,dx,singleShowerGain,gxMax,gyMax); Float_t totalGain = eFit[iDigit]; Float_t ratio = singleShowerGain/totalGain; - Info("UnfoldLocalMaxima", " ratio -> %f", ratio) ; + AliInfo(Form(" ratio -> %f", ratio)) ; eDigit = eDigit*ratio; newRP->AddDigit(*digit,eDigit); } } - newRP->EvalLocalPosition(logWeight,digits); - Info("UnfoldLocalMaxima", "======= Unfold: daughter rec point %d =================", iMax) ; - newRP->Print(""); + TVector3 vtx(0.,0.,0.) ; + TVector3 inc(0.,0.,0.) ; + newRP->EvalLocalPosition(logWeight,vtx,digits,inc); + AliInfo(Form("======= Unfold: daughter rec point %d =================", + iMax)) ; + newRP->Print(); } // RemoveFromWorkingPool(this); @@ -1028,10 +1042,10 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() } -void AliPHOSEvalRecPoint::PrintPoint(Option_t* opt) +void AliPHOSEvalRecPoint::PrintPoint() { // print rec.point to stdout - AliPHOSCpvRecPoint::Print(opt); + AliPHOSCpvRecPoint::Print(); TVector3 lpos; GetLocalPosition(lpos); @@ -1039,7 +1053,7 @@ void AliPHOSEvalRecPoint::PrintPoint(Option_t* opt) TString message ; message = " Chi2/dof = %f" ; message += " Local (x,z) = (%f, %f) in module %d" ; - Info("Print", message.Data(), Chi2Dof(), lpos.X(), lpos.Z(), GetPHOSMod()) ; + AliInfo(Form(message.Data(), Chi2Dof(), lpos.X(), lpos.Z(), GetPHOSMod())) ; } @@ -1050,8 +1064,7 @@ AliPHOSRecManager* AliPHOSEvalRecPoint::GetReconstructionManager() const TFolder* wPoolF = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/SmP"); AliPHOSRecManager* recMng = (AliPHOSRecManager*)wPoolF->FindObject("AliPHOSRecManager"); if(!recMng) { - Error("GetReconstructionManager", "Couldn't find Reconstruction Manager. Exit.") ; - exit(1); + AliFatal(Form("Couldn't find Reconstruction Manager")) ; } return recMng; @@ -1080,8 +1093,7 @@ const TObject* AliPHOSEvalRecPoint::GetWorkingPool() TFolder* wPoolF = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/SmP"); TObject* wPool = wPoolF->FindObject("SmartPoints"); if(!wPool) { - Error("GetWorkingPool", "Couldn't find Working Pool. Exit.") ; - exit(1); + AliFatal(Form("Couldn't find Working Pool")) ; } return wPool; @@ -1116,5 +1128,5 @@ void AliPHOSEvalRecPoint::RemoveFromWorkingPool(TObject* obj) void AliPHOSEvalRecPoint::PrintWorkingPool() { // print pool of rec.points to stdout - ((TObjArray*)GetWorkingPool())->Print(""); + ((TObjArray*)GetWorkingPool())->Print(); }