]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/EMCAL/AliHLTEMCALMapper.cxx
compilation error fixed
[u/mrichter/AliRoot.git] / HLT / EMCAL / AliHLTEMCALMapper.cxx
index 87fbdc1148c3bd3a558b9d769a4ca3aff6db432a..cd97529191c362ee11bfe05470085570e8dc3113 100644 (file)
 #include "AliHLTEMCALMapper.h"
 
 #include "AliHLTEMCALConstants.h"
+#include "assert.h"
 
 using namespace EmcalHLTConst;
 
-//AliHLTCaloMapper
 
 
-AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification) 
+
+AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification, "EMCAL")
 {
+  fCellSize = 6;
   InitAltroMapping(specification);
   InitDDLSpecificationMapping();
   fIsInitializedMapping = true; //CRAP PTH, must check is the initilization actually went ok
@@ -36,6 +38,18 @@ AliHLTEMCALMapper::~AliHLTEMCALMapper()
 {
 
 }
+  
+
+
+// channelCoord[0] = (static_cast<Float_t>(channelId&0x3f) - NXCOLUMNSMOD/2)* fCellStep;
+// channelCoord[1] = (static_cast<Float_t>((channelId >> 6)&0x3f) - NZROWSMOD/2) * fCellStep;
+
+void 
+AliHLTEMCALMapper::GetLocalCoord(const int channelId, Float_t* localCoord) const
+{
+  localCoord[0] = ( ( Float_t )(channelId&0x3f) - NXCOLUMNSMOD/2)  * fCellSize;
+  localCoord[1] = ( (Float_t)((channelId >> 6)&0x3f) - NZROWSMOD/2) * fCellSize;
+}
 
 
 void 
@@ -52,7 +66,14 @@ AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
   
   if(base !=0)
     {
+      //      int tmpddlindex =  GetDDLFromSpec( specification )%2; 
+
+      sprintf(fFilepath, "%s/EMCAL/mapping/%s", base,   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
       sprintf(fFilepath, "%s/EMCAL/mapping/%s", base,   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
+
+      //   assert("DDL spec is  %d", GetDDLFromSpec( specification ) );
+     
+      cout << __FILE__ <<":"<< __LINE__ <<"DDL spec is " <<   GetDDLFromSpec( specification )  << endl;
       cout << __FILE__ <<":"<< __LINE__ <<"mapping filename is " <<  fFilepath << endl;
        // sprintf(fFilepath,"%s/PHOS/mapping/RCU0.data", base);
       FILE *fp = fopen(fFilepath, "r");
@@ -104,19 +125,10 @@ AliHLTEMCALMapper::InitDDLSpecificationMapping()
   
   for(Int_t ddl = 0; ddl < EmcalHLTConst::NMODULES*EmcalHLTConst::NRCUSPERMODULE; ddl++)
     {
-      fSpecificationMapPtr[ddl].fModId = ddl/EmcalHLTConst::NRCUSPERMODULE;
-      fSpecificationMapPtr[ddl].fRcuX = 0; 
-      fSpecificationMapPtr[ddl].fRcuZ = ddl%2; 
-      //      fSpecificationMapPtr[ddl].fRcuZOffset = NZROWSRCU*(fSpecificationMapPtr[ddl].fRcuZ);
-      //      fSpecificationMapPtr[ddl].fRcuXOffset = NXCOLUMNSRCU*(fSpecificationMapPtr[ddl].fRcuX);
+      fSpecificationMapPtr[ddl].fModId = ddl/(EmcalHLTConst::NRCUSPERMODULE);
     }
 }
 
-
-
-//RCU1C.data
-
-
 const char* 
 AliHLTEMCALMapper::DDL2RcuMapFileName(const int ddlIndex) const //0=4608, 1=4607 etc...
 {
@@ -131,42 +143,9 @@ AliHLTEMCALMapper::DDL2RcuMapFileName(const int ddlIndex) const //0=4608, 1=4607
     {
       tmpSide  = 'C';
     }
-  
-  sprintf(rname,"RCU%d%c.data", ddlIndex/NRCUSPERSECTOR, tmpSide );
+  int tmprcuindex = ddlIndex%2;
+  sprintf(rname,"RCU%d%c.data",  tmprcuindex,  tmpSide );
+  //sprintf(rname,"RCU%d%c.data", ddlIndex/NRCUSPERSECTOR, tmpSide );
   return rname;
-  // rname.fSector = ddlIndex/NRCUSPERSECTOR;
-}
-
-/*
-unsigned long 
-AliHLTEMCALMapper::GetSpecFromDDLIndex( const int ddlindex )
-{
-  return ( (unsigned long)1  <<  ddlindex ));
-}
-*/
-
-/*
-AliHLTEMCALMapper::GlobalX2ModuleId( const int globalX )
-{
-  return globalX/NXCOLUMNSMOD;  
 }
-*/
-
- /*
-static  const int 
-AliHLTEMCALMapper::GlobalZ2ModuleId( const int globalZ )
-{
-  return globalZ/NZROWSMOD;
-  }
- */
-
-
-  /*
- const int 
- AliHLTEMCALMapper::Global2ModuleId( const int globalZ,  const int globalX )
-{
-  int tmpModX = 
  
-}
-  */