--- /dev/null
+//-*- Mode: C++ -*-
+// $Id: AliHLTPHOSConstants.h 34622 2009-09-04 13:22:01Z odjuvsla $
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2006 *
+ * *
+ * Author: Per Thomas Hille perthi@fys.uio.no for the ALICE DCS Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+#ifndef ALIHLTEMCALCONSTANTS_H
+#define ALIHLTEMCALCONSTANTS_H
+
+namespace EmcalHLTConst
+{
+ const int NZROWSRCU = 56; /**<Number of rows per module*/
+ const int NXCOLUMNSRCU = 16;
+ const int NZROWSMOD = 56; /**<Number of rows per module*/
+ const int NXCOLUMNSMOD = 64; /**<Number of columns per module*/
+
+#ifndef __CINT__
+ const unsigned char PFVECTORDIR[] = "/HLT/PHOS/PFVectors";
+#endif
+ const int PFDEFAULTNSAMPLES = 70;
+ const int PFDEFAULTSTARTINDEX = 0;
+ const int DEFAULTTAU = 0.2; /**<Assume that the signal rise time of the altrp pulses is 2 us (nominal value of the electronics)*/
+ const int DEFAULTFS = 10; /**<Assume that the signal is samples with 10 MHZ samle rate*/
+ const int NMODULES = 13; /**<Number of modules of the EMCAL detector*/
+ const int NRCUS = 2; /**<Number of RCUs per Module*/
+ const int NRCUSPERMODULE = 4 ; /**<Number of RCUs per Module*/
+ const int NFEECS = 9; /**<Number of Frontend cards per branch*/
+}
+
+
+#endif
+
+
ClassImp(AliHLTEMCALDefinitions)
-const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkDDLRawDataType = { sizeof(AliHLTComponentDataType), {'D','D','L','_','R','A','W',' '},{'E','M','C','L'}};;
+const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkDDLRawDataType = { sizeof(AliHLTComponentDataType), {'D','D','L','_','R','A','W',' '},{'E','M','C','A'}};;
-const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkDigitDataType = { sizeof(AliHLTComponentDataType), {'D','I','G','I','T',' ',' ',' '},{'E','M','C','L'}};;
+const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkDigitDataType = { sizeof(AliHLTComponentDataType), {'D','I','G','I','T',' ',' ',' '},{'E','M','C','A'}};;
-const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkClusterDataType = { sizeof(AliHLTComponentDataType), {'C','L','U','S','T','E','R','S'},{'E','M','C','L'}};;
+const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkClusterDataType = { sizeof(AliHLTComponentDataType), {'C','L','U','S','T','E','R','S'},{'E','M','C','A'}};;
-const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkESDDataType = { sizeof(AliHLTComponentDataType), {'G','L','O','B','L','E','S','D'},{'E','M','C','L'}};;
+const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkESDDataType = { sizeof(AliHLTComponentDataType), {'G','L','O','B','L','E','S','D'},{'E','M','C','A'}};;
-const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkEMCALESDDataType = { sizeof(AliHLTComponentDataType), {'E','M','C','A','L','E','S','D'},{'E','M','C','L'}};;
+const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkEMCALESDDataType = { sizeof(AliHLTComponentDataType), {'E','M','C','A','L','E','S','D'},{'E','M','C','A'}};;
-const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkCalibrationDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','I','B','R','A','H'},{'E','M','C','L'}};;
+const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkCalibrationDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','I','B','R','A','H'},{'E','M','C','A'}};;
AliHLTEMCALDefinitions::AliHLTEMCALDefinitions()
{
///////////////////////////////////////////////////////////////////////////////
// //
-// The HLT definitions for EMCAL //
+// The HLT definitions for EMCAL //
// //
// //
///////////////////////////////////////////////////////////////////////////////
--- /dev/null
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2007 *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+#include "AliHLTEMCALMapper.h"
+
+#include "AliHLTEMCALConstants.h"
+
+using namespace EmcalHLTConst;
+
+//AliHLTCaloMapper
+
+AliHLTEMCALMapper::AliHLTEMCALMapper()
+{
+ InitAltroMapping();
+ InitDDLSpecificationMapping();
+ fIsInitializedMapping = true; //CRAP PTH, must check is the initilization actually went ok
+}
+
+AliHLTEMCALMapper::~AliHLTEMCALMapper()
+{
+
+}
+
+
+
+void
+AliHLTEMCALMapper::InitAltroMapping()
+{
+ // Loads mapping between Altro addresses and geometrical addresses from file
+ // char filename[256];
+ char *base = getenv("ALICE_ROOT");
+ int nChannels = 0;
+ int maxaddr = 0;
+ int tmpHwaddr = 0;
+ int tmpZRow = 0;
+ int tmpXCol = 0;
+ int tmpGain = 0;
+ int res = 0;
+
+ if(base !=0)
+ {
+ sprintf(fFilepath,"%s/PHOS/mapping/RCU0.data", base);
+ FILE *fp = fopen(fFilepath, "r");
+ if(fp != 0)
+ {
+ res = fscanf(fp, "%d", &nChannels);
+ res = fscanf(fp, "%d", &maxaddr);
+ fHw2geomapPtr = new fAltromap[maxaddr +1];
+
+ for(int i=0; i< maxaddr + 1 ; i ++)
+ {
+ fHw2geomapPtr[i].fXCol = 0;
+ fHw2geomapPtr[i].fZRow = 0;
+ fHw2geomapPtr[i].fGain = 0;
+ }
+ for(int i=0; i<nChannels; i ++)
+ {
+ res = fscanf(fp, "%d %d %d %d\n", &tmpHwaddr, &tmpXCol, &tmpZRow, &tmpGain);
+ if(tmpGain < 2)
+ {
+ fHw2geomapPtr[tmpHwaddr].fXCol = tmpXCol;
+ fHw2geomapPtr[tmpHwaddr].fZRow = tmpZRow;
+ fHw2geomapPtr[tmpHwaddr].fGain = tmpGain;
+ }
+ }
+ fIsInitializedMapping = true;
+ fclose(fp);
+ }
+ else
+ {
+ fIsInitializedMapping = false;
+ }
+ }
+ else
+ {
+ fIsInitializedMapping = false;
+ }
+
+
+}
+
+
+void
+AliHLTEMCALMapper::InitDDLSpecificationMapping()
+{
+ fSpecificationMapPtr = new fDDLSpecificationMap[EmcalHLTConst::NMODULES*EmcalHLTConst::NRCUSPERMODULE];
+
+ for(Int_t ddl = 0; ddl < EmcalHLTConst::NMODULES*EmcalHLTConst::NRCUSPERMODULE; ddl++)
+ {
+
+ fSpecificationMapPtr[ddl].fModId = ddl/EmcalHLTConst::NRCUSPERMODULE;
+
+ if(ddl%4 == 0)
+ {
+ fSpecificationMapPtr[ddl].fRcuX = 0;
+ fSpecificationMapPtr[ddl].fRcuZ = 0;
+ }
+
+ else if(ddl%4 == 1)
+ {
+ fSpecificationMapPtr[ddl].fRcuX = 1;
+ fSpecificationMapPtr[ddl].fRcuZ = 0;
+ }
+
+ else if( ddl%4 == 2)
+ {
+ fSpecificationMapPtr[ddl].fRcuX = 2;
+ fSpecificationMapPtr[ddl].fRcuZ = 0;
+ }
+ else
+ {
+ fSpecificationMapPtr[ddl].fRcuX = 3;
+ fSpecificationMapPtr[ddl].fRcuZ = 0;
+ }
+
+ fSpecificationMapPtr[ddl].fRcuZOffset = NZROWSRCU*(fSpecificationMapPtr[ddl].fRcuZ);
+ fSpecificationMapPtr[ddl].fRcuXOffset = NXCOLUMNSRCU*(fSpecificationMapPtr[ddl].fRcuX);
+ }
+}
+
+
+const int
+AliHLTEMCALMapper::GetDDLFromSpec( const AliHLTUInt32_t specification )
+{
+ Int_t index = -1;
+ if(specification == 0x00001) index = 0;
+ else if(specification == 0x00002) index = 1;
+ else if(specification == 0x00004) index = 2;
+ else if(specification == 0x00008) index = 3;
+
+ else if(specification == 0x00010) index = 4;
+ else if(specification == 0x00020) index = 5;
+ else if(specification == 0x00040) index = 6;
+ else if(specification == 0x00080) index = 7;
+
+ else if(specification == 0x00100) index = 8;
+ else if(specification == 0x00200) index = 9;
+ else if(specification == 0x00400) index = 10;
+ else if(specification == 0x00800) index = 11;
+
+ else if(specification == 0x01000) index = 12;
+ else if(specification == 0x02000) index = 13;
+ else if(specification == 0x04000) index = 14;
+ else if(specification == 0x08000) index = 15;
+
+ else if(specification == 0x10000) index = 16;
+ else if(specification == 0x20000) index = 17;
+ else if(specification == 0x40000) index = 18;
+ else if(specification == 0x80000) index = 19;
+
+ else HLTError("Specification 0x%X not consistent with single DDL in PHOS", specification);
+
+ return index;
+}
+
+
+const int
+AliHLTEMCALMapper::GetChannelID(const AliHLTUInt32_t specification, const Int_t hwAddress )
+{
+ //Short_t index = 0;
+
+ Short_t index = GetDDLFromSpec( specification);
+
+ if(index < 0)
+ {
+ HLTError("Specification 0x%X not consistent with single DDL in PHOS", specification);
+ }
+
+ // else HLTError("Specification 0x%X not consistent with single DDL in PHOS", specification);
+
+ return ((fHw2geomapPtr[hwAddress].fXCol + fSpecificationMapPtr[index].fRcuXOffset) |
+ ((fHw2geomapPtr[hwAddress].fZRow + fSpecificationMapPtr[index].fRcuZOffset) << 6) |
+ (fHw2geomapPtr[hwAddress].fGain << 12) |
+ fSpecificationMapPtr[index].fModId << 13);
+}
--- /dev/null
+#ifndef ALIHLTEMCALMAPPER_H
+#define ALIHLTEMCALMAPPER_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2007 *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+#include "AliHLTCaloMapper.h"
+
+
+class AliHLTEMCALMapper : public AliHLTCaloMapper
+{
+ public:
+ AliHLTEMCALMapper();
+ virtual ~AliHLTEMCALMapper();
+ virtual void InitAltroMapping();
+ virtual void InitDDLSpecificationMapping();
+ const virtual int GetDDLFromSpec( const AliHLTUInt32_t spec );
+ const virtual int GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
+
+ private:
+ AliHLTEMCALMapper(const AliHLTEMCALMapper & );
+ AliHLTEMCALMapper & operator = (const AliHLTEMCALMapper &);
+
+};
+
+#endif
--- /dev/null
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2007 *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+#include "AliHLTEMCALRawAnalyzerComponent.h"
+#include "AliHLTEMCALMapper.h"
+#include "AliHLTEMCALDefinitions.h"
+
+
+AliHLTEMCALRawAnalyzerComponent::AliHLTEMCALRawAnalyzerComponent() : AliHLTCaloRawAnalyzerComponentv3()
+{
+
+
+}
+
+
+AliHLTEMCALRawAnalyzerComponent::~AliHLTEMCALRawAnalyzerComponent()
+{
+
+}
+
+
+
+void
+AliHLTEMCALRawAnalyzerComponent::GetInputDataTypes( vector <AliHLTComponentDataType>& list)
+{
+ list.clear();
+ list.push_back( AliHLTEMCALDefinitions::fgkDDLRawDataType | kAliHLTDataOriginEMCAL );
+}
+
+
+
+bool
+AliHLTEMCALRawAnalyzerComponent::CheckInputDataType(const AliHLTComponentDataType &datatype)
+{
+ if ( datatype == AliHLTEMCALDefinitions::fgkDDLRawDataType )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+
+void
+AliHLTEMCALRawAnalyzerComponent::InitMapping()
+{
+ fMapperPtr = new AliHLTEMCALMapper();
+}
--- /dev/null
+#ifndef ALIHLTEMCALRAWANALYZERCOMPONENT_H
+#define ALIHLTEMCALRAWANALYZERCOMPONENT_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2007 *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTCaloRawAnalyzerComponentv3.h"
+
+//class AliHLTCaloMapper;
+
+class AliHLTEMCALRawAnalyzerComponent : public AliHLTCaloRawAnalyzerComponentv3
+{
+ public:
+ AliHLTEMCALRawAnalyzerComponent();
+ virtual ~AliHLTEMCALRawAnalyzerComponent();
+ // virtual int DoInit(int argc =0, const char** argv = 0);
+ // virtual int Deinit() {} ;
+ // virtual const char* GetComponentID() = 0;
+ virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
+
+ virtual const char* GetComponentID() = 0;
+ /** interface function, see @ref AliHLTComponent for description */
+
+ // virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
+ // virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ // virtual AliHLTComponentDataType GetOutputDataType();
+
+ /** interface function, see @ref AliHLTComponent for description */
+
+ // virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ virtual AliHLTComponent* Spawn() = 0;
+
+ protected:
+ // virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype) = 0;
+ virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype);
+
+
+ private:
+ AliHLTEMCALRawAnalyzerComponent(const AliHLTEMCALRawAnalyzerComponent & );
+
+ /** Keep the assignement operator private since it should not be used */
+ AliHLTEMCALRawAnalyzerComponent & operator = (const AliHLTEMCALRawAnalyzerComponent &);
+
+ virtual void InitMapping();
+
+ // AliHLTCaloMapper *fMapperPtr;
+
+};
+
+#endif
--- /dev/null
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2007 *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+#include "AliHLTEMCALRawAnalyzerCrudeComponent.h"
+#include "AliHLTCaloRawAnalyzerCrude.h"
+
+AliHLTEMCALRawAnalyzerCrudeComponent gAliHLTEMCALRawAnalyzerCrudeComponent;
+
+AliHLTEMCALRawAnalyzerCrudeComponent::AliHLTEMCALRawAnalyzerCrudeComponent()
+{
+ fAnalyzerPtr = new AliHLTCaloRawAnalyzerCrude();
+}
+
+AliHLTEMCALRawAnalyzerCrudeComponent::~AliHLTEMCALRawAnalyzerCrudeComponent()
+{
+
+}
+
+
+const char*
+AliHLTEMCALRawAnalyzerCrudeComponent::GetComponentID()
+{
+ return "CaloRawCrude";
+}
+
+AliHLTComponent*
+AliHLTEMCALRawAnalyzerCrudeComponent::Spawn()
+{
+ return new AliHLTEMCALRawAnalyzerCrudeComponent();
+}
+
--- /dev/null
+#ifndef ALIHLTEMCALRAWANALYZERCRUDECOMPONENT_H
+#define ALIHLTEMCALRAWANALYZERCRUDECOMPONENT_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2007 *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTEMCALRawAnalyzerComponent.h"
+
+class AliHLTEMCALRawAnalyzerCrudeComponent : public AliHLTEMCALRawAnalyzerComponent
+{
+ public:
+ AliHLTEMCALRawAnalyzerCrudeComponent();
+ virtual ~AliHLTEMCALRawAnalyzerCrudeComponent();
+ virtual const char* GetComponentID();
+ virtual AliHLTComponent* Spawn();
+ // virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
+ private:
+ AliHLTEMCALRawAnalyzerCrudeComponent( const AliHLTEMCALRawAnalyzerCrudeComponent & );
+ AliHLTEMCALRawAnalyzerCrudeComponent & operator = (const AliHLTEMCALRawAnalyzerCrudeComponent &);
+
+};
+
+#endif