]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSDATreeDigit.cxx
addition to previous fix: remove unnecessary if in deleting the pointer
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDATreeDigit.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15 /* $Id$ */
16
17 // --
18 // --
19 // Implementation for TTree output in PHOS DA
20 // for calibrating energy by pi0 and MIP.
21 // --
22 // -- Author: Hisayuki Torii (Hiroshima Univ.)
23 // --
24 #include <iostream>
25 #include <math.h>
26 #include <Rtypes.h>
27 #include "AliPHOSDATreeDigit.h"
28
29 ClassImp(AliPHOSDATreeDigit)
30 //------------------------------------------------------------------------
31 bool AliPHOSDATreeDigit::IsNeighbor(const AliPHOSDATreeDigit& digit) const{
32   // Check wether the given digit is neighboring to this digit.
33   // Return true if yes.
34   if( fabs(this->GetRow() - digit.GetRow()) < 2 && fabs(this->GetCol() - digit.GetCol()) < 2 ){
35     return true;
36   }
37   return false;
38 }
39 //------------------------------------------------------------------------
40 void AliPHOSDATreeDigit::Print(Option_t *opt) const
41 {
42   // Print out
43   std::cout<<" AliPHOSDATreeDigit:: "<<opt<<" E="<<fEnergy<<" (row,col)=("
44            <<GetRow()<<","<<GetCol()<<") absid="<<fAbsId<<std::endl;
45 }
46 //------------------------------------------------------------------------
47 std::ostream& operator<<(std::ostream& out, const AliPHOSDATreeDigit& digit){
48   // Print out
49   //std::cout<<" AliPHOSDATreeDigit:: E="<<digit.GetEnergy()<<" (row,col)=("
50   //<<digit.GetRow()<<","<<digit.GetCol()<<") absid="<<digit.GetAbsId()<<std::endl;
51   out<<" AliPHOSDATreeDigit:: E="<<digit.fEnergy<<" (row,col)=("
52   <<(int)(digit.fAbsId/56)<<","<<digit.fAbsId%56<<") absid="<<digit.fAbsId;
53   return out;
54 }
55 //------------------------------------------------------------------------