]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/CALO/AliHLTCaloMapper.cxx
Refactoring and moving some PHOS code which will be used for both calorimeters to...
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloMapper.cxx
1 // $Id: AliHLTCalorimeterMapper.cxx 34622 2009-09-04 13:22:01Z odjuvsla $
2
3 /**************************************************************************
4  * This file is property of and copyright by the Experimental Nuclear     *
5  * Physics Group, Dep. of Physics                                         *
6  * University of Oslo, Norway, 2006                                       *
7  *                                                                        * 
8  * Author: Per Thomas Hille perthi@fys.uio.no for the ALICE DCS Project.  *
9  * Contributors are mentioned in the code where appropriate.              *
10  * Please report bugs to perthi@fys.uio.no                                * 
11  *                                                                        *
12  * Permission to use, copy, modify and distribute this software and its   *
13  * documentation strictly for non-commercial purposes is hereby granted   *
14  * without fee, provided that the above copyright notice appears in all   *
15  * copies and that both the copyright notice and this permission notice   *
16  * appear in the supporting documentation. The authors make no claims     *
17  * about the suitability of this software for any purpose. It is          *
18  * provided "as is" without express or implied warranty.                  *
19  **************************************************************************/
20
21 //
22 // Mapping class fro mapping
23 // from hardware address to geometrical address
24 //
25 //
26
27 #include "AliHLTCaloMapper.h"
28 #include "AliHLTLogging.h"
29 #include "Rtypes.h"
30 #include "unistd.h"
31 #include <iostream>
32 #include "AliHLTCaloCoordinate.h"
33
34 using namespace CaloHLTConst;
35
36 //ClassImp(AliHLTCaloMapper)
37
38 AliHLTCaloMapper::AliHLTCaloMapper() :  
39   AliHLTLogging(), 
40   fHw2geomapPtr(0),
41   fIsInitializedMapping(false),
42   fSpecificationMapPtr(0)
43 {  
44   //see header file for class documentation
45 }
46
47
48 AliHLTCaloMapper::~AliHLTCaloMapper()
49 {
50   // See header file for documentation
51   delete []  fHw2geomapPtr;
52   fHw2geomapPtr = 0;
53 }
54
55
56 //void AliHLTCaloMapper::InitAltroMapping(){
57   //Virtual base class
58 //}
59
60 //void AliHLTCaloMapper::InitDDLSpecificationMapping() {
61   //Virtual base class
62 //}
63
64
65
66 bool 
67 AliHLTCaloMapper::GetIsInitializedMapping()
68 {
69   // See header file for documentation
70   return  fIsInitializedMapping;
71 }
72
73
74 char* 
75 AliHLTCaloMapper::GetFilePath()
76 {
77   // See header file for documentation
78   return  fFilepath;
79 }
80
81
82 void
83 //AliHLTPHOSMapper::GetChannelCoord(const UShort_t channelId,    &AliHLTPHOSCoordinate channelCoord)
84 AliHLTCaloMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTCaloCoordinate &channelCoord)
85 {
86   // TODO: change format to facilitate for EMCal (more modules)
87   channelCoord.fX = channelId&0x3f;
88   channelCoord.fZ = (channelId >> 6)&0x3f;
89   channelCoord.fGain = (channelId >> 12)&0x1;
90   channelCoord.fModuleId  = (channelId >> 13)&0x1f;
91   //  printf("Channel ID: 0x%X Coordinates: x = %d, z = %d, gain = %d\n", channelId, channelCoord[0], channelCoord[1], channelCoord[2]);
92 }