* 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.
// 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 <TMath.h>
+#include <TDirectory.h>
+#include <TBranch.h>
+#include <TTree.h>
+#include <TROOT.h>
+#include <TFolder.h>
// --- AliRoot header files ---
+#include "AliLog.h"
#include "AliConfig.h"
+#include "AliPHOSDigit.h"
#include "AliPHOSClusterizer.h"
#include "AliPHOSEvalRecPoint.h"
#include "AliRun.h"
#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;
// 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);
}
-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);
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;
// initialization
AliPHOSClusterizer* clusterizer = GetClusterizer();
if(!clusterizer) {
- Error("Init", "Cannot get clusterizer. Exit.") ;
- exit(1);
+ Fatal("Init", "Cannot get clusterizer") ;
}
TClonesArray* digits = AliPHOSLoader::GetPHOSLoader(fEventFolderName)->Digits();
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
}
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);
Float_t cos2fi = 1.;
AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName);
- const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
Int_t iDigit; //loop variable
{
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;
{
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;
Int_t relid[4] ;
AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName);
- const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
for(Int_t iter=0; iter<nIter; iter++)
{
{
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 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;
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 %d stpmin %d",
+ iter, dof, ch/dof, chstop/dof, step, stpmin)) ;
if(step<stpmin)
TString message ;
message = " (x,z,e)[1 fit] = (%f, %f, %f)\n" ;
message = " (x,z,e)[2 fit] = (%f, %f, %f)\n" ;
- Info("TwoGam", message.Data(),
+ AliInfo(Form(message.Data(),
x1New, z1New, e1New,
- x2New, z2New, e2New) ;
+ x2New, z2New, e2New)) ;
fChi2Dof = chisq;
Float_t* eFit = new Float_t[nDigits];
AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName);
- const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
for(Int_t iDigit=0; iDigit<nDigits; 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; iMax<nMax; iMax++)
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;
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();
}
Float_t chisqc;
AliPHOSLoader* fLoader = AliPHOSLoader::GetPHOSLoader(fEventFolderName);
- const AliPHOSGeometry* fGeom = fLoader->PHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
for(Int_t iter=0; iter<nIter; iter++)
{
Int_t* digits = GetDigitsList();
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);
dx = xc - ix;
dy = yc - iy;
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.
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;
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 %d stpMin %d",
+ iter, dof, chisq/dof, chisq/dof, chstop/dof, step, stpMin)) ;
if(step<stpMin)
Float_t thr0 = GetReconstructionManager()->KillGamMinEnergy();
if(GetEnergy()<thr0) {
- Info("KillWeakPoint", "+++++++ Killing this rec point ++++++++++") ;
+ AliInfo(Form("+++++++ Killing this rec point ++++++++++")) ;
RemoveFromWorkingPool(this);
return kTRUE;
}
{
if(TooClose(rp))
{
- Info("MergeClosePoint", "+++++++ Merging point 1: ++++++") ;
- this->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;
RemoveFromWorkingPool(rp);
delete rp;
- Info("MergeClosePoint", "++++++ Resulting point: ++++++++") ;
- this->Print("");
+ AliInfo(Form("++++++ Resulting point: ++++++++")) ;
+ this->Print();
break;
}
AliPHOSClusterizer* clusterizer = GetClusterizer();
if(!clusterizer) {
- Error("UnfoldLocalMaxima", "Cannot get clusterizer. Exit.") ;
- exit(1);
+ AliFatal(Form("Cannot get clusterizer")) ;
}
if(this->IsEmc()) {
}
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
{
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; iMax<nMax; iMax++)
{
AliPHOSDigit* digitMax = maxAt[iMax];
Float_t eMax = maxAtEnergy[iMax];
- fGeom->AbsToRelNumbering(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;
for(Int_t iMax=0; iMax<nMax; iMax++)
{
AliPHOSDigit* digitMax = maxAt[iMax];
- fGeom->AbsToRelNumbering(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; iDigit<nDigits; iDigit++)
+ for(iDigit=0; iDigit<nDigits; iDigit++)
{
AliPHOSDigit* digit = (AliPHOSDigit*)fLoader->Digits()->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))
{
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);
}
-void AliPHOSEvalRecPoint::PrintPoint(Option_t* opt)
+void AliPHOSEvalRecPoint::PrintPoint()
{
// print rec.point to stdout
- AliPHOSCpvRecPoint::Print(opt);
+ AliPHOSCpvRecPoint::Print();
TVector3 lpos;
GetLocalPosition(lpos);
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())) ;
}
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;
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;
void AliPHOSEvalRecPoint::PrintWorkingPool()
{
// print pool of rec.points to stdout
- ((TObjArray*)GetWorkingPool())->Print("");
+ ((TObjArray*)GetWorkingPool())->Print();
}