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*/
+ // const int NZROWSRCU = 56; /**<Number of rows per RCU*/
+ // const int NXCOLUMNSRCU = 16;
+ const int NZROWSMOD = 48; /**<Number of rows per module*/
+ const int NXCOLUMNSMOD = 24; /**<Number of columns per module*/
+
+ const int NRCUSPERSECTOR = 4;
+
+ /*
+ const int MIN_DDL_NUMBER = 4608;
+ const int MAX_DDL_NUMBER = 4631;
+ const int N_DDLS = MAX_DDL_NUMBER - MIN_DDL_NUMBER +1;
+ */
#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 double 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 NRCUS = 2; /**<Number of RCUs per Module*/
+ const int NRCUSPERMODULE = 2 ; /**<Number of RCUs per Module*/
const int NFEECS = 9; /**<Number of Frontend cards per branch*/
}
//AliHLTCaloMapper
-AliHLTEMCALMapper::AliHLTEMCALMapper()
+
+AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification)
{
- InitAltroMapping();
+ InitAltroMapping(specification);
InitDDLSpecificationMapping();
fIsInitializedMapping = true; //CRAP PTH, must check is the initilization actually went ok
}
+
AliHLTEMCALMapper::~AliHLTEMCALMapper()
{
}
-
void
-AliHLTEMCALMapper::InitAltroMapping()
+AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
{
- // 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 nChannels = 0;
+ int maxaddr = 0;
+ int tmpHwaddr = 0;
int tmpZRow = 0;
int tmpXCol = 0;
int tmpGain = 0;
if(base !=0)
{
- sprintf(fFilepath,"%s/PHOS/mapping/RCU0.data", base);
+ sprintf(fFilepath, "%s/EMCAL/mapping/%s", base, DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) );
+ cout << __FILE__ <<":"<< __LINE__ <<"mapping filename is " << fFilepath << endl;
+ // 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);
+ res = fscanf(fp, "%d\n", &nChannels);
+ res = fscanf(fp, "%d\n", &maxaddr);
fHw2geomapPtr = new fAltromap[maxaddr +1];
for(int i=0; i< maxaddr + 1 ; i ++)
for(int i=0; i<nChannels; i ++)
{
res = fscanf(fp, "%d %d %d %d\n", &tmpHwaddr, &tmpXCol, &tmpZRow, &tmpGain);
+
+ // cout << __FILE__ << __LINE__ << " tmpHwaddr = " << tmpHwaddr << ", tmpXCol = " << (int)tmpXCol << ", tmpZRow = "<< (int)tmpZRow << ", tmpGain= "<< (int)tmpGain << endl;
+
if(tmpGain < 2)
{
- fHw2geomapPtr[tmpHwaddr].fXCol = tmpXCol;
- fHw2geomapPtr[tmpHwaddr].fZRow = tmpZRow;
- fHw2geomapPtr[tmpHwaddr].fGain = tmpGain;
+ fHw2geomapPtr[tmpHwaddr].fXCol = (char)tmpXCol;
+ fHw2geomapPtr[tmpHwaddr].fZRow = (char)tmpZRow;
+ fHw2geomapPtr[tmpHwaddr].fGain = (char)tmpGain;
}
}
fIsInitializedMapping = true;
}
else
{
- fIsInitializedMapping = false;
+ cout << __FUNCTION__ << ":"<<__FILE__<<":"<< __LINE__ << "ERROR, could not open mapping file %s" << fFilepath << endl;
+ fIsInitializedMapping = false;
}
}
else
{
fIsInitializedMapping = false;
}
-
-
}
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);
+ fSpecificationMapPtr[ddl].fRcuX = 0;
+ fSpecificationMapPtr[ddl].fRcuZ = ddl%2;
+ // fSpecificationMapPtr[ddl].fRcuZOffset = NZROWSRCU*(fSpecificationMapPtr[ddl].fRcuZ);
+ // fSpecificationMapPtr[ddl].fRcuXOffset = NXCOLUMNSRCU*(fSpecificationMapPtr[ddl].fRcuX);
}
}
-const int
-AliHLTEMCALMapper::GetDDLFromSpec( const AliHLTUInt32_t specification )
+
+//RCU1C.data
+
+
+const char*
+AliHLTEMCALMapper::DDL2RcuMapFileName(const int ddlIndex) const //0=4608, 1=4607 etc...
{
- 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;
+ static char rname[256];
+ char tmpSide;
+
+ if ( ddlIndex%NRCUSPERSECTOR <2)
+ {
+ tmpSide = 'A';
+ }
+ else
+ {
+ tmpSide = 'C';
+ }
+
+ 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 ));
+}
+*/
-const int
-AliHLTEMCALMapper::GetChannelID(const AliHLTUInt32_t specification, const Int_t hwAddress )
+/*
+AliHLTEMCALMapper::GlobalX2ModuleId( const int globalX )
{
- //Short_t index = 0;
+ return globalX/NXCOLUMNSMOD;
+}
+*/
- Short_t index = GetDDLFromSpec( specification);
+ /*
+static const int
+AliHLTEMCALMapper::GlobalZ2ModuleId( const int globalZ )
+{
+ return globalZ/NZROWSMOD;
+ }
+ */
- 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);
+ /*
+ const int
+ AliHLTEMCALMapper::Global2ModuleId( const int globalZ, const int globalX )
+{
+ int tmpModX =
+
}
+ */
**************************************************************************/
+//#include "AliHLTCaloMapper.h"
#include "AliHLTCaloMapper.h"
class AliHLTEMCALMapper : public AliHLTCaloMapper
{
public:
- AliHLTEMCALMapper();
+ AliHLTEMCALMapper( const unsigned long specifiaction );
virtual ~AliHLTEMCALMapper();
- virtual void InitAltroMapping();
+ virtual void InitAltroMapping( const unsigned long specification );
virtual void InitDDLSpecificationMapping();
- const virtual int GetDDLFromSpec( const AliHLTUInt32_t spec );
- const virtual int GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
+
+ // static const int GlobalX2ModuleId(const int globalX);
+ // static const int GlobalZ2ModuleId(const int globalZ);
+
+ // static const int Global2ModuleId( const int globalZ, const int globalX );
+
+ // const virtual int GetDDLFromSpec( const AliHLTUInt32_t spec );
+ // const virtual int GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
private:
+ AliHLTEMCALMapper();
AliHLTEMCALMapper(const AliHLTEMCALMapper & );
AliHLTEMCALMapper & operator = (const AliHLTEMCALMapper &);
-
+ const char* DDL2RcuMapFileName(const int ddlid) const;
+
};
#endif
}
-
bool
AliHLTEMCALRawAnalyzerComponent::CheckInputDataType(const AliHLTComponentDataType &datatype)
{
}
-
void
-AliHLTEMCALRawAnalyzerComponent::InitMapping()
+AliHLTEMCALRawAnalyzerComponent::InitMapping( const int specification )
{
- fMapperPtr = new AliHLTEMCALMapper();
+
+ if ( fMapperPtr == 0 )
+ {
+ fMapperPtr = new AliHLTEMCALMapper( specification );
+ }
+
+ if(fMapperPtr->GetIsInitializedMapping() == false )
+ {
+ HLTError("%d:%d, ERROR, mapping not initialized ", __FILE__, __LINE__ );
+ exit(-2);
+ }
}
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;
-
+ virtual void InitMapping( const int specification );
};
#endif
fAnalyzerPtr = new AliHLTCaloRawAnalyzerCrude();
}
+
AliHLTEMCALRawAnalyzerCrudeComponent::~AliHLTEMCALRawAnalyzerCrudeComponent()
{
return "CaloRawCrude";
}
+
AliHLTComponent*
AliHLTEMCALRawAnalyzerCrudeComponent::Spawn()
{
private:
AliHLTEMCALRawAnalyzerCrudeComponent( const AliHLTEMCALRawAnalyzerCrudeComponent & );
AliHLTEMCALRawAnalyzerCrudeComponent & operator = (const AliHLTEMCALRawAnalyzerCrudeComponent &);
+
+ // bool TestBoolConst() { return false; };
+ bool TestBool() {return false; };
+
+
};
--- /dev/null
+//-*- Mode: C++ -*-
+// $Id: AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h 31490 2009-03-15 16:27:11Z odjuvsla $
+
+#ifndef ALIHLTPHOSRCUCELLACCUMULATEDENERGYDATASTRUCT_H
+#define ALIHLTPHOSRCUCELLACCUMULATEDENERGYDATASTRUCT_H
+
+/***************************************************************************
+ * Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * 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 "AliHLTPHOSCommonDefs.h"
+#include "AliHLTCaloConstants.h"
+// using namespace PhosHLTConst;
+using namespace CaloHLTConst;
+
+
+struct AliHLTCaloRcuCellAccumulatedEnergyDataStruct
+{
+ AliHLTUInt8_t fModuleID;
+ AliHLTUInt8_t fRcuX;
+ AliHLTUInt8_t fRcuZ;
+ float fAccumulatedEnergies[NXCOLUMNSMOD][NZROWSMOD][NGAINS];
+ AliHLTUInt32_t fHits[NXCOLUMNSMOD][NZROWSMOD][NGAINS];
+ AliHLTUInt32_t fDeadChannelMap[NXCOLUMNSMOD][NZROWSMOD][NGAINS];
+
+ /*
+ AliHLTUInt8_t fModuleID;
+ AliHLTUInt8_t fRcuX;
+ AliHLTUInt8_t fRcuZ;
+ float fAccumulatedEnergies[NXCOLUMNSRCU][NZROWSRCU][NGAINS];
+ AliHLTUInt32_t fHits[NXCOLUMNSRCU][NZROWSRCU][NGAINS];
+ AliHLTUInt32_t fDeadChannelMap[NXCOLUMNSRCU][NZROWSRCU][NGAINS];
+ */
+
+};
+
+
+#endif
AliHLTEMCALOnlineDisplayEventTab::GetRawData(TH1D *histPtr, int x, int z, int gain)
{
- int tmpModID = x/64;
+ // int tmpModID = x/64;
+
+ int tmpModID = (x*z)/(NZROWSMOD*NXCOLUMNSMOD);
+
+ // const int NZROWSMOD = 48; /**<Number of rows per module*/
+ // const int NXCOLUMNSMOD = 24;
+ //int tmpModID = x/64;
/*
int tmpRcuZ = z/32;
int tmpX = x%32;
*/
+ cout << __FILE__ << __LINE__ <<": Getting raw data for mod =" << tmpModID << ", z="<< z << ",x=" << x << endl;
+
for( int i=0; i < fNChannelSamples[tmpModID][z][x][gain] ; i++)
{
histPtr->SetBinContent(i, fChannelData[tmpModID][z][x][gain][i]);
for(int i=0; i < rawStr.nSamplesUsed; i++ )
{
- // cout << "i = " << i << endl;
- // fChannelData[ rawStr.fCoordinate.fModuleId ][ rawStr.fCoordinate.fZ ] [ rawStr.fCoordinate.fX ][ rawStr.fCoordinate.fGain ][i] = rawStr.fDataPtr[i];
- fChannelData[ rawStr.fCoordinate.fModuleId ][ rawStr.fCoordinate.fX ] [ rawStr.fCoordinate.fZ ][ rawStr.fCoordinate.fGain ][i] = rawStr.fDataPtr[i];
+ // cout << "i = " << i << endl;
+ fChannelData[ rawStr.fCoordinate.fModuleId ][ rawStr.fCoordinate.fZ ] [ rawStr.fCoordinate.fX ][ rawStr.fCoordinate.fGain ][i] = rawStr.fDataPtr[i];
+ // fChannelData[ rawStr.fCoordinate.fModuleId ][ rawStr.fCoordinate.fX ] [ rawStr.fCoordinate.fZ ][ rawStr.fCoordinate.fGain ][i] = rawStr.fDataPtr[i];
}