1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //_________________________________________________________________________
17 // RecPoint in the PHOS PPSD: a list of AliPHOSDigit's
18 //*-- Author : Yves Schutz SUBATECH
19 //////////////////////////////////////////////////////////////////////////////
21 // --- ROOT system ---
23 // --- Standard library ---
27 // --- AliRoot header files ---
29 #include "AliPHOSGeometry.h"
30 #include "AliPHOSPpsdRecPoint.h"
33 ClassImp(AliPHOSPpsdRecPoint)
35 //____________________________________________________________________________
36 AliPHOSPpsdRecPoint::AliPHOSPpsdRecPoint(void)
39 AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ;
40 fDelta = geom->GetCrystalSize(0) ;
41 fLocPos.SetX(1000000.) ; //Local position should be evaluated
44 //____________________________________________________________________________
45 AliPHOSPpsdRecPoint::~AliPHOSPpsdRecPoint(void) // dtor
50 //____________________________________________________________________________
51 void AliPHOSPpsdRecPoint::AddDigit(AliDigitNew & digit, Float_t Energy)
53 // adds a digit to the digits list
54 // and accumulates the total amplitude and the multiplicity
57 if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
58 int * tempo = new ( int[fMaxDigit*=2] ) ;
61 for ( index = 0 ; index < fMulDigit ; index++ )
62 tempo[index] = fDigitsList[index] ;
68 fDigitsList[fMulDigit++] = (int) &digit ;
75 //____________________________________________________________________________
76 Int_t AliPHOSPpsdRecPoint::Compare(TObject * obj)
80 AliPHOSPpsdRecPoint * clu = (AliPHOSPpsdRecPoint *)obj ;
92 if(GetUp()) // upper layer
97 if(clu->GetUp()) // upper layer
103 this->GetLocalPosition(PosLoc) ;
106 PhosMod1 = this->GetPHOSMod();
107 clu->GetLocalPosition(PosLoc) ;
110 PhosMod2 = clu->GetPHOSMod();
112 if(PhosMod1 == PhosMod2 ) {
115 Int_t rowdif = (Int_t)TMath::Ceil(x1/fDelta) - (Int_t) TMath::Ceil(x2/fDelta) ;
129 if(up1 < up2 ) // Upper level first (up = True or False, True > False)
135 } // if PhosMod1 == PhosMod2
139 if(PhosMod1 < PhosMod2 )
149 //____________________________________________________________________________
150 void AliPHOSPpsdRecPoint::GetLocalPosition(TVector3 &LPos){
152 if( fLocPos.X() < 1000000.) { //allready evaluated
162 AliPHOSGeometry * PHOSGeom = (AliPHOSGeometry *) fGeom ;
164 AliPHOSDigit * digit ;
167 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
168 digit = (AliPHOSDigit *) fDigitsList[iDigit];
172 PHOSGeom->AbsToRelNumbering(digit->GetId(), relid) ;
173 PHOSGeom->RelPosInModule(relid, xi, zi);
188 //____________________________________________________________________________
189 Bool_t AliPHOSPpsdRecPoint::GetUp()
193 AliPHOSGeometry * PHOSGeom = (AliPHOSGeometry *) fGeom ;
195 AliPHOSDigit *digit = (AliPHOSDigit *)fDigitsList[0] ;
197 PHOSGeom->AbsToRelNumbering(digit->GetId(),relid);
200 if((Int_t)TMath::Ceil((Float_t)relid[1]/
201 (PHOSGeom->GetNumberOfModulesPhi()*PHOSGeom->GetNumberOfModulesZ())-0.0001 ) > 1)
209 //____________________________________________________________________________
210 void AliPHOSPpsdRecPoint::Print(Option_t * option)
212 cout << "AliPHOSPpsdRecPoint: " << endl ;
214 AliPHOSDigit * digit ;
218 for(iDigit=0; iDigit<fMulDigit; iDigit++) {
219 digit = (AliPHOSDigit *) fDigitsList[iDigit];
220 cout << " digit Id = " << digit->GetId()
221 << " digit Energy = " << digit->GetAmp() << endl ;
223 cout << " Multiplicity = " << fMulDigit << endl ;
227 // //____________________________________________________________________________
228 // AliPHOSPpsdRecPoint& AliPHOSPpsdRecPoint::operator = (AliPHOSPpsdRecPoint Clu)
230 // int* DL = Clu.GetDigitsList() ;
233 // delete fDigitsList ;
235 // AliPHOSDigit * digit ;
239 // for(iDigit=0; iDigit<fMulDigit; iDigit++) {
240 // digit = (AliPHOSDigit *) DL[iDigit];
241 // AddDigit(*digit) ;
244 // fDelta = Clu.GetDelta() ;
247 // fAmp = Clu.GetEnergy() ;
248 // fGeom = Clu.GetGeom() ;
250 // Clu.GetLocalPosition(LocPos) ;
252 // fMulDigit = Clu.GetMultiplicity() ;
253 // fMaxDigit = Clu.GetMaximumMultiplicity() ;
254 // fPHOSMod = Clu.GetPHOSMod() ;