X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSCpvRecPoint.cxx;h=2c515e3368bb80b80195df154540bcac4804d200;hb=da2ee9fc96ded6eef1542fbe2f1fe1fbb7cca5d7;hp=0aa12cb5cb76ae633e48220f89c6cacf94214512;hpb=21cd0c07a367c6e6836907ecf5222aef9cb05c05;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSCpvRecPoint.cxx b/PHOS/AliPHOSCpvRecPoint.cxx index 0aa12cb5cb7..2c515e3368b 100644 --- a/PHOS/AliPHOSCpvRecPoint.cxx +++ b/PHOS/AliPHOSCpvRecPoint.cxx @@ -15,6 +15,26 @@ /* $Id$ */ +/* History of cvs commits: + * + * $Log$ + * Revision 1.26 2007/06/18 07:02:44 kharlov + * Change the signature of EvalLocalPosition() to obey the method virtuality from the parent class + * + * Revision 1.25 2007/03/06 06:47:28 kharlov + * DP:Possibility to use actual vertex position added + * + * Revision 1.24 2006/08/28 10:01:56 kharlov + * Effective C++ warnings fixed (Timur Pocheptsov) + * + * Revision 1.23 2005/12/20 14:28:47 hristov + * Additional protection + * + * Revision 1.22 2005/05/28 14:19:04 schutz + * Compilation warnings fixed by T.P. + * + */ + //_________________________________________________________________________ // RecPoint implementation for PHOS-CPV // An CpvRecPoint is a cluster of digits @@ -23,37 +43,38 @@ // 30 October 2000 // --- ROOT system --- -#include "TPad.h" -#include "TH2.h" + #include "TMath.h" -#include "TCanvas.h" #include "TClonesArray.h" // --- Standard library --- // --- AliRoot header files --- - +#include "AliLog.h" +#include "AliPHOSGeometry.h" +#include "AliPHOSDigit.h" #include "AliPHOSCpvRecPoint.h" -#include "AliPHOSGetter.h" +#include "AliPHOSLoader.h" + ClassImp(AliPHOSCpvRecPoint) //____________________________________________________________________________ -AliPHOSCpvRecPoint::AliPHOSCpvRecPoint() : AliPHOSEmcRecPoint() +AliPHOSCpvRecPoint::AliPHOSCpvRecPoint() : + AliPHOSEmcRecPoint(), + fLengX(-1), + fLengZ(-1) { // ctor - - fLengX = -1; - fLengZ = -1; } //____________________________________________________________________________ -AliPHOSCpvRecPoint::AliPHOSCpvRecPoint(const char * opt) : AliPHOSEmcRecPoint(opt) +AliPHOSCpvRecPoint::AliPHOSCpvRecPoint(const char * opt) : + AliPHOSEmcRecPoint(opt), + fLengX(-1), + fLengZ(-1) { // ctor - - fLengX = -1; - fLengZ = -1; - } +} //____________________________________________________________________________ AliPHOSCpvRecPoint::~AliPHOSCpvRecPoint() @@ -68,8 +89,7 @@ Bool_t AliPHOSCpvRecPoint::AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * d Bool_t aren = kFALSE ; - AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; - AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry(); + AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry(); Int_t relid1[4] ; phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ; @@ -131,7 +151,7 @@ Int_t AliPHOSCpvRecPoint::Compare(const TObject * obj) const } //______________________________________________________________________________ -void AliPHOSCpvRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) const +void AliPHOSCpvRecPoint::ExecuteEvent(Int_t, Int_t, Int_t ) /*const*/ { // // Execute action corresponding to one event // // This member function is called when a AliPHOSRecPoint is clicked with the locator @@ -142,7 +162,7 @@ void AliPHOSCpvRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) const // // static Int_t pxold, pyold; -// AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; +// AliPHOSLoader * gime = AliPHOSLoader::GetInstance() ; // static TGraph * digitgraph = 0 ; @@ -239,14 +259,22 @@ void AliPHOSCpvRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) const } //____________________________________________________________________________ -void AliPHOSCpvRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits) +void AliPHOSCpvRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits) { - // wraps other methods + // Evaluate local coordinate assuming the vertex in (000) and no inclination + TVector3 vtx(0,0,0), vInc(0,1,0); AliPHOSEmcRecPoint::EvalAll(logWeight,digits) ; + EvalLocalPosition(logWeight, vtx, digits,vInc) ; EvalClusterLengths(digits) ; } //____________________________________________________________________________ -void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight,TClonesArray * digits) +void AliPHOSCpvRecPoint::EvalAll(Float_t logWeight, TVector3 &vtx, TClonesArray * digits) +{ + // wraps other methods + AliPHOSEmcRecPoint::EvalAll(logWeight,vtx,digits) ; +} +//____________________________________________________________________________ +void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight, TVector3 & /*vtx */, TClonesArray * digits, TVector3 &/* vInc */) { // Calculates the center of gravity in the local PHOS-module coordinates @@ -259,9 +287,8 @@ void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight,TClonesArray * digi AliPHOSDigit * digit ; - AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; - AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry(); - + AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry(); + Int_t iDigit; for(iDigit=0; iDigitAbsToRelNumbering(digit->GetId(), relid) ; phosgeom->RelPosInModule(relid, xi, zi); - Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ; - x += xi * w ; - z += zi * w ; - wtot += w ; + if (fAmp>0 && fEnergyList[iDigit]>0) { + Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ; + x += xi * w ; + z += zi * w ; + wtot += w ; + } + else + AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp)); } if (wtot != 0) { @@ -284,7 +315,7 @@ void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight,TClonesArray * digi x = -1e6 ; z = -1e6 ; if (fMulDigit != 0) - Warning(":EvalLocalPosition", "Too low log weight factor to evaluate cluster's center" ) ; + AliWarning(Form("Too low log weight factor to evaluate cluster's center" )) ; } fLocPos.SetX(x) ; fLocPos.SetY(0.) ; @@ -307,8 +338,7 @@ void AliPHOSCpvRecPoint::EvalClusterLengths(TClonesArray * digits) AliPHOSDigit * digit ; - AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; - AliPHOSGeometry * phosgeom = (AliPHOSGeometry*)gime->PHOSGeometry(); + AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry(); const Int_t kMaxLeng=20; Int_t idX[kMaxLeng], idZ[kMaxLeng]; @@ -340,31 +370,29 @@ void AliPHOSCpvRecPoint::EvalClusterLengths(TClonesArray * digits) } } - - //____________________________________________________________________________ -void AliPHOSCpvRecPoint::Print(Option_t * option) +void AliPHOSCpvRecPoint::Print(const Option_t *) const { // Print the list of digits belonging to the cluster TString message ; message = "AliPHOSCpvRecPoint: " ; message += "Digits # " ; - Info("Print", message.Data()) ; + AliInfo(Form(message.Data())) ; Int_t iDigit; for(iDigit=0; iDigit