+//-*- Mode: C++ -*-
+// $Id$
+
#ifndef ALIHLTPHOSMAPPER_H
#define ALIHLTPHOSMAPPER_H
+
/**************************************************************************
* This file is property of and copyright by the Experimental Nuclear *
* Physics Group, Dep. of Physics *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//#include "PhosFeeClient.h"
+//#include "AliHLTPHOSBase.h"
-#include "stdio.h"
-#include <iostream>
-#include <assert.h>
-#include "AliHLTPHOSCommonDefs.h"
-#include "AliHLTPHOSConstants.h"
-
-// PhosHLTConst
-using namespace PhosHLTConst;
+//using namespace PhosHLTConst;
+#include "Rtypes.h"
+#include "AliHLTCaloMapper.h"
+#include "AliPHOSEMCAGeometry.h"
-class AliHLTPHOSMapper
+class AliHLTCaloCoordinate;
+class AliHLTPHOSCoordinate;
+
+class AliHLTPHOSMapper : public AliHLTCaloMapper
{
public:
+
AliHLTPHOSMapper();
- struct FEE_CSP_MAP{
- int row;
- int col;
- int gain;
- int csp;
- int num;
- };
-
- struct ALTRO_GEO_MAP{
- int mod;
- int gain;
- int row;
- int col;
- int rcu;
- int branch;
- int card;
- int chip;
- int chan;
- int csp;
- int num;
- int hid;
- };
-
-
- void AddCsp(int csp, int chip, int chHi, int chLo, int numHi, int numLo);
-
-
- //Function to generate Active Channel List (ACL)for each of the four readout partitions
- //Of the Phos Module. The ACL register is 256x16 bit big.
- void GenerateACL(int startZ, int endZ, int startX, int endX, int mID, int acl[RCUS_PER_MODULE][256], unsigned long int afl[RCUS_PER_MODULE]);
-
- void InitAltroCspMapping();
-
- /*
- inline int Geo2hid(int mod, int gain, int row, int col);
- inline int Hid2mod(int hid);
- inline int Hid2gain(int hid);
- inline int Hid2row(int hid);
- inline int Hid2col(int hid);
- inline int ExtractHid(char *objName);
-
- inline void InitAltroMapping(int saveMapping);
- inline void PrintHistMapInfo(char *objName);
- */
-
- int Geo2hid(int mod, int gain, int row, int col);
- int Hid2mod(int hid);
- int Hid2gain(int hid);
- int Hid2row(int hid);
- int Hid2col(int hid);
- int ExtractHid(char *objName);
-
- void InitAltroMapping(int saveMapping);
- void PrintHistMapInfo(char *objName);
-
- FEE_CSP_MAP CSP_MAP[FEE_ALTROS][FEE_CHANS];
- ALTRO_GEO_MAP ALTRO_MAP[PHOS_MODS*FEE_RCUS*FEE_BRANCHS*FEE_FECS*FEE_ALTROS*FEE_CHANS];
- int hdw2geo[PHOS_MODS][FEE_RCUS][FEE_BRANCHS][FEE_FECS][FEE_ALTROS][FEE_CHANS];
- int geo2hdw[PHOS_MODS][PHOS_GAINS][PHOS_ROWS][PHOS_COLS];
+ virtual ~AliHLTPHOSMapper();
+
+ Bool_t InitAltroMapping(const unsigned long specification);
+ void InitDDLSpecificationMapping();
+ bool GetIsInitializedMapping();
+ // char* GetFilePath(const int ddlId);
+
+ Int_t GetChannelID(Int_t hwAddress);
+ Int_t GetChannelID(AliHLTUInt32_t specification, Int_t hwAddress);
+
+ //static void GetChannelCoord(const Int_t channelId, UShort_t* channelCoord);
+ //static void ChannelId2Coordinate(const Int_t channelId, AliHLTCaloCoordinate &channelCoord );
+ //static void GetLocalCoord(const Int_t channelId, Float_t* localCoord);
+ int GetDDLFromSpec(AliHLTUInt32_t specification);
+ int GetModuleFromSpec(AliHLTUInt32_t specification);
+
+// struct fDDLSpecificationMap{
+// UInt_t fRcuX; // Coordinate in Z direction (beam direction) relatve too one RCU
+// UInt_t fRcuZ; // Coordinate in X direction (perpendicular too beam direction an parallell to ground) relatve too one RCU
+// UInt_t fRcuXOffset;
+// UInt_t fRcuZOffset;
+// int fModId;
+// };
+
+// fAltromap *fHw2geomapPtr; //pointer to structure holding information about geometrical address
+
+
+ char fFilepath[1024];
private:
-
-
-
+ bool fIsInitializedMapping;
+
+ AliHLTPHOSMapper(const AliHLTPHOSMapper & );
+ AliHLTPHOSMapper & operator = (const AliHLTPHOSMapper &);
+
+ // fDDLSpecificationMap* fSpecificationMapPtr;
+ //AliPHOSEMCAGeometry fPHOSGeometry;
+ static const Float_t fCellStep = 2.2;//2.*fPHOSGeometry.GetAirCellHalfSize()[0];
+
+ Int_t fModuleId;
+ int fDDLId;
};
#endif