X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=PHOS%2FAliPHOSEvalRecPoint.cxx;h=f0e46c64260b2a21a1bbfcd81112db33decdf7e4;hb=f8b468657705805f0c80bc532ebeedc2823f7103;hp=e837b84396b78c5c739f8408f86803f5b8ddfc95;hpb=a06363618723fa95236bb217e2b637b4b8af3578;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSEvalRecPoint.cxx b/PHOS/AliPHOSEvalRecPoint.cxx index e837b84396b..f0e46c64260 100644 --- a/PHOS/AliPHOSEvalRecPoint.cxx +++ b/PHOS/AliPHOSEvalRecPoint.cxx @@ -1,43 +1,77 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* $Id$ */ + +//*-- Author: Boris Polichtchouk, IHEP +////////////////////////////////////////////////////////////////////////////// +// Reconstructed point operations for the Clusterization class for IHEP reconstruction. +// Performs clusterization (collects neighbouring active cells) +// 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" -#include "AliPHOSGetter.h" +#include "AliPHOSLoader.h" #include "AliPHOSRecCpvManager.h" #include "AliPHOSRecEmcManager.h" #include "AliPHOSDigitizer.h" +#include "AliPHOSGeometry.h" // --- Standard library --- -#include ClassImp(AliPHOSEvalRecPoint) - AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(): AliPHOSCpvRecPoint() +AliPHOSEvalRecPoint::AliPHOSEvalRecPoint() : + fIsEmc(kFALSE), + fIsCpv(kTRUE), + fParent(-333), + fChi2Dof(-111), + fEventFolderName(AliConfig::GetDefaultEventFolderName()) { - fParent=-333; - fChi2Dof=-111; - fIsCpv = kTRUE; - fIsEmc = kFALSE; + // default ctor } -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; fChi2Dof=-111; // fParent=parent; TObjArray* wPool = (TObjArray*)GetWorkingPool(); if(!wPool) { - cout<<" Couldn't find working pool. Exit."<IndexOf((TObject*)parent); @@ -57,34 +91,36 @@ AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Bool_t cpv, AliPHOSEvalRecPoint* parent } -AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Int_t i, Bool_t cpv) : AliPHOSCpvRecPoint() +AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Int_t i, Bool_t cpv) : + fIsEmc(kFALSE), + fIsCpv(kFALSE), + fParent(-333), + fChi2Dof(-111), + fEventFolderName(AliConfig::GetDefaultEventFolderName()) { - - fChi2Dof=-111; - fParent=-333; - + // ctor AliPHOSEmcRecPoint* rp=0; - AliPHOSGetter* fGetter = AliPHOSGetter::GetInstance(); + AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); if(cpv) { - rp = (AliPHOSCpvRecPoint*)fGetter->CpvRecPoints()->At(i); + rp = (AliPHOSCpvRecPoint*)fLoader->CpvRecPoints()->At(i); fIsEmc = kFALSE; fIsCpv = kTRUE; } else { - rp = (AliPHOSEmcRecPoint*)fGetter->EmcRecPoints()->At(i); + rp = (AliPHOSEmcRecPoint*)fLoader->EmcRecPoints()->At(i); fIsEmc = kTRUE; fIsCpv = kFALSE; } - Int_t* Digits = rp->GetDigitsList(); - Float_t* Energies = rp->GetEnergiesList(); + Int_t* digits = rp->GetDigitsList(); + Float_t* energies = rp->GetEnergiesList(); Int_t nDigits = rp->GetMultiplicity(); for(Int_t iDigit=0; iDigitDigits()->At( Digits[iDigit] ); - Float_t eDigit = Energies[iDigit]; + AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->At( digits[iDigit] ); + Float_t eDigit = energies[iDigit]; this->AddDigit(*digit,eDigit); } @@ -99,12 +135,12 @@ AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Int_t i, Bool_t cpv) : AliPHOSCpvRecPoi AliPHOSClusterizer* AliPHOSEvalRecPoint::GetClusterizer() { + // returns clusterizer task TFolder* aliceF = (TFolder*)gROOT->FindObjectAny("YSAlice"); TFolder* wPoolF = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/SmP"); AliPHOSClusterizer* clu = (AliPHOSClusterizer*)wPoolF->FindObject("PHOS:clu-v1"); if(!clu) { - cout<<" Couldn't find Clusterizer. Exit."<GetLocalPosition(her_pos); - this->GetLocalPosition(my_pos); - Float_t dx = her_pos.X() - my_pos.X(); - Float_t dz = her_pos.Z() - my_pos.Z(); + // check if a rec.point pt is too close to this one + TVector3 herPos; + TVector3 myPos; + pt->GetLocalPosition(herPos); + this->GetLocalPosition(myPos); + Float_t dx = herPos.X() - myPos.X(); + Float_t dz = herPos.Z() - myPos.Z(); Float_t dr = TMath::Sqrt(dx*dx + dz*dz); if(drMergeGammasMinDistanceCut()) @@ -129,17 +166,19 @@ Bool_t AliPHOSEvalRecPoint::TooClose(AliPHOSRecPoint* pt) const Bool_t AliPHOSEvalRecPoint::NeedToSplit() const { + // rec.point needs to be split return kFALSE; } void AliPHOSEvalRecPoint::DeleteParent() { + // delete parent fParent=-333; } void AliPHOSEvalRecPoint::UpdateWorkingPool() { - + // update pool of rec.points Int_t i; //loop variable for(i=0; iInWorkingPool(); i++) { @@ -175,6 +214,7 @@ void AliPHOSEvalRecPoint::UpdateWorkingPool() Int_t AliPHOSEvalRecPoint::HasChild(TObjArray& children) { + // returns the number of children for(Int_t iChild=0; iChildDigits(); - Float_t LogWeight=0; + TClonesArray* digits = AliPHOSLoader::GetPHOSLoader(fEventFolderName)->Digits(); + Float_t logWeight=0; if(this->IsEmc()) { - LogWeight = clusterizer->GetEmcLogWeight(); + logWeight = clusterizer->GetEmcLogWeight(); } else { - LogWeight = clusterizer->GetCpvLogWeight(); + 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 } @@ -247,19 +288,19 @@ void AliPHOSEvalRecPoint::InitTwoGam(Float_t* gamma1, Float_t* gamma2) GetLocalPosition(lpos); Float_t xx = lpos.Z(); Float_t yy = lpos.X(); - Float_t E = GetEnergy(); + Float_t e = GetEnergy(); - cout<<" (x,z,E)[old] = ("<PHOSGeometry(); + AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; Int_t iDigit; //loop variable for(iDigit = 0 ; iDigit < nDigits ; iDigit ++) { - digit = (AliPHOSDigit*)fGetter->Digits()->At( Digits[iDigit] ); - eDigit = Energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; - fGeom->RelPosInModule(relid, iy, ix); + digit = (AliPHOSDigit*)fLoader->Digits()->At( digits[iDigit] ); + eDigit = energies[iDigit]; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, iy, ix); Float_t dx = ix - xx; Float_t dy = iy - yy; @@ -301,10 +342,10 @@ void AliPHOSEvalRecPoint::InitTwoGam(Float_t* gamma1, Float_t* gamma2) Float_t eu3 = 0; for(iDigit = 0 ; iDigit < nDigits ; iDigit ++) { - digit = (AliPHOSDigit*)fGetter->Digits()->At( Digits[iDigit] ); - eDigit = Energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; - fGeom->RelPosInModule(relid, iy, ix); + digit = (AliPHOSDigit*)fLoader->Digits()->At( digits[iDigit] ); + eDigit = energies[iDigit]; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, iy, ix); Float_t dx = ix - xx; Float_t dy = iy - yy; @@ -312,16 +353,16 @@ void AliPHOSEvalRecPoint::InitTwoGam(Float_t* gamma1, Float_t* gamma2) eu3 += eDigit*du*du*du; } - Float_t c = E*eu3*eu3/(euu*euu*euu)/2.; + Float_t c = e*eu3*eu3/(euu*euu*euu)/2.; Float_t sign = 1.; if(eu3<0) sign = -1.; Float_t r = 1.+ c + sign*TMath::Sqrt(2.*c + c*c); Float_t u = 0; if(TMath::Abs(r-1.)>0.1) u = eu3/euu*(r+1.)/(r-1.); - if(TMath::Abs(r-1.)<0.1) u = TMath::Sqrt(sqr/E/r)*(1.+r); + if(TMath::Abs(r-1.)<0.1) u = TMath::Sqrt(sqr/e/r)*(1.+r); - Float_t e2c = E/(1.+r); - Float_t e1c = E-e2c; + Float_t e2c = e/(1.+r); + Float_t e1c = e-e2c; Float_t u1 = -u/(1.+r); Float_t u2 = u+u1; @@ -359,7 +400,7 @@ void AliPHOSEvalRecPoint::TwoGam(Float_t* gamma1, Float_t* gamma2) Float_t chmin = GetReconstructionManager()->TwoGamChisqMin(); Float_t emin = GetReconstructionManager()->TwoGamEmin(); Float_t stpmin = GetReconstructionManager()->TwoGamStepMin(); - Int_t Niter = GetReconstructionManager()->TwoGamNumOfIterations(); // Number of iterations. + Int_t nIter = GetReconstructionManager()->TwoGamNumOfIterations(); // Number of iterations. Float_t chisq = 100.; //Initial chisquare. @@ -389,22 +430,22 @@ void AliPHOSEvalRecPoint::TwoGam(Float_t* gamma1, Float_t* gamma2) Float_t y2c = gamma2[1]; Float_t x2c = gamma2[2]; - Float_t E = GetEnergy(); + Float_t e = GetEnergy(); Float_t eDigit ; AliPHOSDigit * digit ; Int_t nDigits = GetMultiplicity(); - Int_t * Digits = GetDigitsList(); - Float_t * Energies = GetEnergiesList(); + Int_t * digits = GetDigitsList(); + Float_t * energies = GetEnergiesList(); Float_t ix ; Float_t iy ; Int_t relid[4] ; - AliPHOSGetter* fGetter = AliPHOSGetter::GetInstance(); - const AliPHOSGeometry* fGeom = fGetter->PHOSGeometry(); + AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); + 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); + digit = (AliPHOSDigit*)fLoader->Digits()->At( digits[iDigit] ); + eDigit = energies[iDigit]; + 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; -// cout<<" Mult "<AG(e1c,dx1,dy1,a1,gx1,gy1); Float_t dx2 = x2c - ix; Float_t dy2 = y2c - iy; -// cout<<" "<<" dx2 "<AG(e2c,dx2,dy2,a2,gx2,gy2); - Float_t A = a1+a2; -// Float_t D = Const*A*(1. - A/E); + Float_t a = a1+a2; +// Float_t D = Const*a*(1. - a/e); // if(D<0) D=0; // // D = 9.; // ???? -// Float_t da = A - eDigit; +// Float_t da = a - eDigit; // chisqc += da*da/D; // Float_t dd = da/D; -// dd = dd*(2.-dd*Const*(1.-2.*A/E)); +// dd = dd*(2.-dd*Const*(1.-2.*a/e)); Float_t dd; - chisqc += GetReconstructionManager()->TwoGamChi2(A,eDigit,E,dd); + chisqc += GetReconstructionManager()->TwoGamChi2(a,eDigit,e,dd); grx1c += gx1*dd; gry1c += gy1*dd; grx2c += gx2*dd; gry2c += gy2*dd; - grec += (a1/e1c - a2/e2c)*E*dd; + grec += (a1/e1c - a2/e2c)*e*dd; } @@ -490,14 +529,14 @@ void AliPHOSEvalRecPoint::TwoGam(Float_t* gamma1, Float_t* gamma2) loop20: ; Float_t step = st*gr; - - cout<<" Iteration "<PHOSGeometry(); + AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; for(Int_t iDigit=0; iDigitDigits()->At( Digits[iDigit] ); + AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->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; iMaxAG(eMax,dz,dx,Amp,gx,gy); - gain += Amp; + Float_t amp,gx,gy; + GetReconstructionManager()->AG(eMax,dz,dx,amp,gx,gy); + gain += amp; } eFit[iDigit] = gain; } - for( Int_t iMax=0; iMaxDigits()->At( Digits[iDigit] ); - Float_t eDigit = Energies[iDigit]; + AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->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; - Float_t single_shower_gain,gxMax,gyMax; - GetReconstructionManager()->AG(eMax,dz,dx,single_shower_gain,gxMax,gyMax); - Float_t total_gain = eFit[iDigit]; - Float_t ratio = single_shower_gain/total_gain; -// cout<<" ratio -> "<AG(eMax,dz,dx,singleShowerGain,gxMax,gyMax); + Float_t totalGain = eFit[iDigit]; + Float_t ratio = singleShowerGain/totalGain; eDigit = eDigit*ratio; newRP->AddDigit(*digit,eDigit); } - - cout<<"======= Split: daughter rec point "<Print(""); + AliInfo(Form("======= Split: daughter rec point %d =================", + iMax)) ; + newRP->Print(); } delete[] eFit; - cout<OneGamNumOfIterations(); // number of iterations - Float_t St0 = GetReconstructionManager()->OneGamInitialStep(); // initial step -// const Float_t Stpmin = 0.005; - Float_t Stpmin = GetReconstructionManager()->OneGamStepMin(); + Int_t nIter = GetReconstructionManager()->OneGamNumOfIterations(); // number of iterations + Float_t st0 = GetReconstructionManager()->OneGamInitialStep(); // initial step +// const Float_t stpMin = 0.005; + Float_t stpMin = GetReconstructionManager()->OneGamStepMin(); Float_t chmin = GetReconstructionManager()->OneGamChisqMin(); TVector3 locpos; @@ -662,11 +703,11 @@ void AliPHOSEvalRecPoint::EvaluatePosition() Float_t ix, iy; GetLocalPosition(locpos); - Float_t E = GetEnergy(); + Float_t e = GetEnergy(); Float_t xc = locpos.Z(); Float_t yc = locpos.X(); Float_t dx,dy,gx,gy,grxc,gryc; - Float_t st = St0; + Float_t st = st0; Float_t chisq = 1.e+20; Float_t gr = 1.; Float_t grx = 0.; @@ -678,10 +719,10 @@ void AliPHOSEvalRecPoint::EvaluatePosition() Float_t cosi,x1=0,y1=0; Float_t chisqc; - AliPHOSGetter* fGetter = AliPHOSGetter::GetInstance(); - const AliPHOSGeometry* fGeom = fGetter->PHOSGeometry(); + AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); + 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); + Float_t* energies = GetEnergiesList(); + Int_t* digits = GetDigitsList(); + digit = (AliPHOSDigit*)fLoader->Digits()->At( digits[iDigit] ); + eDigit = energies[iDigit]; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; + phosgeom->RelPosInModule(relid, iy, ix); dx = xc - ix; dy = yc - iy; @@ -703,11 +744,12 @@ void AliPHOSEvalRecPoint::EvaluatePosition() if(!dx) dx=dy; if(!dy) dy=dx; - Float_t A; - GetReconstructionManager()->AG(E,dx,dy,A,gx,gy); + Float_t a; + GetReconstructionManager()->AG(e,dx,dy,a,gx,gy); Float_t dd; - cout<<" (ix iy xc yc dx dy) "<OneGamChi2(A,eDigit,E,dd); + 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. if(chi2dg > 10) { continue; } @@ -721,7 +763,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; - cout<<" chisq: "<chisq) goto loop20; @@ -740,11 +782,11 @@ void AliPHOSEvalRecPoint::EvaluatePosition() loop20: ; Float_t step = st*gr; - - cout<<" Iteration "<1.) @@ -762,7 +804,7 @@ void AliPHOSEvalRecPoint::EvaluatePosition() // } Float_t gamma1[3]; - gamma1[0] = E; + gamma1[0] = e; gamma1[1] = y1; gamma1[2] = x1; @@ -770,15 +812,12 @@ void AliPHOSEvalRecPoint::EvaluatePosition() //SetLocalPosition(newpos); fLocPos=newpos; - fAmp=E; + fAmp=e; // TVector3 pos; // RP->GetLocalPosition(pos); -// cout<<" (x,z)[old] = ("<KillGamMinEnergy(); + Float_t thr0 = GetReconstructionManager()->KillGamMinEnergy(); - if(GetEnergy()Digitizer(); + // merge rec.points if they are too close + AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); +// AliPHOSDigitizer* digitizer = fLoader->Digitizer(); // Float_t fPedestal = digitizer->GetPedestal(); // YVK 30.09.2001 // Float_t fSlope = digitizer->GetSlope(); @@ -837,10 +876,10 @@ void AliPHOSEvalRecPoint::MergeClosePoint() { if(TooClose(rp)) { - cout<<"+++++++ Merging point 1: ++++++"<Print(""); - cout<<"+++++++ and point 2: ++++++++++"<Print(""); + AliInfo(Form("+++++++ Merging point 1: ++++++")) ; + this->Print(); + AliInfo(Form("+++++++ and point 2: ++++++++++")) ; + ((AliPHOSEvalRecPoint*)rp)->Print(); //merge two rec. points TVector3 lpos1; @@ -848,28 +887,28 @@ void AliPHOSEvalRecPoint::MergeClosePoint() this->GetLocalPosition(lpos1); rp->GetLocalPosition(lpos2); - Int_t* Digits = rp->GetDigitsList(); + Int_t* digits = rp->GetDigitsList(); Float_t dE = rp->GetEnergy()/(rp->GetEnergy()+this->GetEnergy()); - Float_t new_x = lpos1.X()*dE + lpos2.X()*(1.-dE); - Float_t new_z = lpos1.Z()*dE + lpos2.Z()*(1.-dE); - Float_t new_E = rp->GetEnergy()+this->GetEnergy(); - Float_t* Energies = ((AliPHOSEmcRecPoint*)rp)->GetEnergiesList(); + Float_t newX = lpos1.X()*dE + lpos2.X()*(1.-dE); + Float_t newZ = lpos1.Z()*dE + lpos2.Z()*(1.-dE); + Float_t newE = rp->GetEnergy()+this->GetEnergy(); + Float_t* energies = ((AliPHOSEmcRecPoint*)rp)->GetEnergiesList(); for(Int_t iDigit=0; iDigitGetDigitsMultiplicity(); iDigit++) { - AliPHOSDigit* digit = (AliPHOSDigit*)fGetter->Digits()->At(Digits[iDigit]); - Float_t eDigit = Energies[iDigit]; + AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->At(digits[iDigit]); + Float_t eDigit = energies[iDigit]; this->AddDigit(*digit,eDigit); } - TVector3 newpos(new_x,0,new_z); + TVector3 newpos(newX,0,newZ); fLocPos = newpos; - fAmp = new_E; + fAmp = newE; RemoveFromWorkingPool(rp); delete rp; - cout<<"++++++ Resulting point: ++++++++"<Print(""); + AliInfo(Form("++++++ Resulting point: ++++++++")) ; + this->Print(); break; } @@ -889,38 +928,36 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() AliPHOSDigit * maxAt[1000]; Float_t maxAtEnergy[1000]; - Float_t LocMaxCut, LogWeight; + Float_t locMaxCut, logWeight; Int_t relid[4] ; Float_t xMax; Float_t zMax; -// AliPHOSClusterizer* clusterizer = fGetter->Clusterizer("PHOSclu-v1"); AliPHOSClusterizer* clusterizer = GetClusterizer(); if(!clusterizer) { - cout<<" Cannot get clusterizer. Exit."<IsEmc()) { - LocMaxCut = clusterizer->GetEmcLocalMaxCut(); - LogWeight = clusterizer->GetEmcLogWeight(); + locMaxCut = clusterizer->GetEmcLocalMaxCut(); + logWeight = clusterizer->GetEmcLogWeight(); } else { - LocMaxCut = clusterizer->GetCpvLocalMaxCut(); - LogWeight = clusterizer->GetCpvLogWeight(); + locMaxCut = clusterizer->GetCpvLocalMaxCut(); + logWeight = clusterizer->GetCpvLogWeight(); } - AliPHOSGetter* fGetter = AliPHOSGetter::GetInstance(); - const AliPHOSGeometry* fGeom = fGetter->PHOSGeometry(); - TClonesArray* digits = fGetter->Digits(); + AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName); + AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ; + TClonesArray* digits = fLoader->Digits(); // if number of local maxima less then 2 - nothing to unfold - Int_t Nmax = GetNumberOfLocalMax(maxAt,maxAtEnergy,LocMaxCut,digits); - if(Nmax<2) return Nmax; + Int_t nMax = GetNumberOfLocalMax(maxAt,maxAtEnergy,locMaxCut,digits); + if(nMax<2) return nMax; - Int_t* Digits = GetDigitsList(); + Int_t* digitsList = GetDigitsList(); Int_t nDigits = GetMultiplicity(); - Float_t* Energies = GetEnergiesList(); + Float_t* energies = GetEnergiesList(); Float_t* eFit = new Float_t[nDigits]; Int_t iDigit; //loop variable @@ -933,96 +970,99 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() for(iDigit=0; iDigitDigits()->At( Digits[iDigit] ); - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; + AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->At( digitsList[iDigit] ); + 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; - GetReconstructionManager()->AG(eMax,dz,dx,Amp,gx,gy); -// Amp = Amp + 0.5; - eFit[iDigit] += Amp; + Float_t amp,gx,gy; + GetReconstructionManager()->AG(eMax,dz,dx,amp,gx,gy); +// amp = amp + 0.5; + eFit[iDigit] += amp; } } - 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( Digits[iDigit] ); - Float_t eDigit = Energies[iDigit]; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; + AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->At( digitsList[iDigit] ); + Float_t eDigit = energies[iDigit]; + phosgeom->AbsToRelNumbering(digit->GetId(), relid) ; Float_t ix,iz; - fGeom->RelPosInModule(relid, ix, iz); + phosgeom->RelPosInModule(relid, ix, iz); if(AreNeighbours(digitMax,digit)) { Float_t dx = xMax - ix; Float_t dz = zMax - iz; - Float_t single_shower_gain,gxMax,gyMax; - GetReconstructionManager()->AG(eMax,dz,dx,single_shower_gain,gxMax,gyMax); - Float_t total_gain = eFit[iDigit]; - Float_t ratio = single_shower_gain/total_gain; - cout<<" ratio -> "<AG(eMax,dz,dx,singleShowerGain,gxMax,gyMax); + Float_t totalGain = eFit[iDigit]; + Float_t ratio = singleShowerGain/totalGain; + AliInfo(Form(" ratio -> %f", ratio)) ; eDigit = eDigit*ratio; newRP->AddDigit(*digit,eDigit); } } - newRP->EvalLocalPosition(LogWeight,digits); - cout<<"======= Unfold: daughter rec point "<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); delete[] eFit; - cout<FindObjectAny("YSAlice"); TFolder* wPoolF = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/SmP"); AliPHOSRecManager* recMng = (AliPHOSRecManager*)wPoolF->FindObject("AliPHOSRecManager"); if(!recMng) { - cout<<" Couldn't find Reconstruction Manager. Exit."<FindObjectAny("YSAlice"); TFolder* wPoolF = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/SmP"); TObject* wPool = wPoolF->FindObject("SmartPoints"); if(!wPool) { - cout<<" Couldn't find Working Pool. Exit."<Add(obj); } TObject* AliPHOSEvalRecPoint::GetFromWorkingPool(Int_t i) { + // return a rec.point from a pool at an index i // return fWorkingPool->At(i); return ((TObjArray*)GetWorkingPool())->At(i); } Int_t AliPHOSEvalRecPoint::InWorkingPool() { + // return the number of rec.points in a pool return ((TObjArray*)GetWorkingPool())->GetEntries(); } void AliPHOSEvalRecPoint::RemoveFromWorkingPool(TObject* obj) { + // remove a rec.point from a pool ((TObjArray*)GetWorkingPool())->Remove(obj); ((TObjArray*)GetWorkingPool())->Compress(); } void AliPHOSEvalRecPoint::PrintWorkingPool() { - ((TObjArray*)GetWorkingPool())->Print(""); + // print pool of rec.points to stdout + ((TObjArray*)GetWorkingPool())->Print(); } - - - - - - - - - - - - - - -