{
Float_t fEnergy;
Float_t fTime;
- // UShort_t fChannelID;
-
-
Short_t fCrazyness;
int fChannelID;
-
- // Short_t fRawDataSize; //the size of the raw data
- //private:
- // virtual ~AliHLTCaloChannelDataStruct(){};
-
- /*
- AliHLTCaloChannelDataStruct(): fEnergy(0),
- fTime(0),
- fChannelID(0),
- fCrazyness()
-
- {
- }
- */
-}
-;
+};
#endif
#include "AliHLTCaloDigitDataStruct.h"\r
#include "AliHLTCaloDigitContainerDataStruct.h"\r
#include "TClonesArray.h"\r
-\r
-//#include "AliHLTCaloConstants.h"\r
-\r
-#include "AliHLTCaloConstantsHandler.h"\r
#include "AliHLTCaloConstants.h"\r
\r
-//#include "AliHLTCaloClusterHandler.h"\r
-//#include "AliPHOSDigit.h"\r
\r
//#ifndef HAVENOT__PHOSRECOPARAMEMC // set from configure if EMC functionality not available in AliPHOSRecoParam\r
//#include "AliPHOSRecoParam.h"\r
ClassImp(AliHLTCaloClusterizer);\r
\r
AliHLTCaloClusterizer::AliHLTCaloClusterizer(TString det):\r
- AliHLTCaloConstantsHandler(det),\r
fRecPointDataPtr(0),\r
fDigitDataPtr(0),\r
fEmcClusteringThreshold(0),\r
fEmcTimeGate(0),\r
fDigitsInCluster(0),\r
fDigitContainerPtr(0),\r
- fMaxDigitIndexDiff(0)\r
+ fMaxDigitIndexDiff(0),\r
+ fCaloConstants(NULL)\r
{\r
//See header file for documentation\r
fEmcClusteringThreshold = 0.2;\r
fEmcTimeGate = 1.e-6 ;\r
\r
fMaxDigitIndexDiff = 2*fCaloConstants->GetNZROWSMOD();\r
+\r
+ fCaloConstants = new AliHLTCaloConstants(det);\r
+}//end\r
+\r
+AliHLTCaloClusterizer::AliHLTCaloClusterizer(const AliHLTCaloClusterizer &) :\r
+ fRecPointDataPtr(0),\r
+ fDigitDataPtr(0),\r
+ fEmcClusteringThreshold(0),\r
+ fEmcMinEnergyThreshold(0),\r
+ fEmcTimeGate(0),\r
+ fDigitsInCluster(0),\r
+ fDigitContainerPtr(0),\r
+ fMaxDigitIndexDiff(0),\r
+ fCaloConstants(NULL)\r
+{\r
+ // dummy copy constructor\r
}//end\r
\r
\r
#include "AliHLTCaloRecPointDataStruct.h"\r
#include "AliHLTCaloDigitContainerDataStruct.h"\r
#include "AliHLTCaloDigitDataStruct.h"\r
-#include "AliHLTCaloConstantsHandler.h"\r
#include "TString.h"\r
+#include "AliHLTCaloConstants.h"\r
\r
//#include "AliPHOSGeometry.h"\r
\r
\r
\r
\r
-class AliHLTCaloClusterizer : public AliHLTCaloConstantsHandler\r
+class AliHLTCaloClusterizer\r
{\r
\r
public:\r
// /** Copy constructor */ \r
// AliHLTCaloClusterizer(const AliHLTCaloClusterizer &) : \r
// // AliHLTCaloBase(),\r
-// AliHLTCaloConstantsHandler(new TString("BALLE")),\r
+// AliHLTCaloConstants(NULL),\r
// fRecPointDataPtr(0),\r
// fDigitDataPtr(0),\r
// fEmcClusteringThreshold(0),\r
/** Maximum difference in index to be a neighbour */\r
Int_t fMaxDigitIndexDiff; //COMMENT\r
\r
+ /** Instance of calorimeter constants */\r
+ AliHLTCaloConstants* fCaloConstants;\r
+\r
private:\r
\r
AliHLTCaloClusterizer();\r
\r
- // AliHLTCaloClusterizer (const AliHLTCaloClusterizer & );\r
- // AliHLTCaloClusterizer & operator = (const AliHLTCaloClusterizer &);\r
+ AliHLTCaloClusterizer (const AliHLTCaloClusterizer &);\r
+// AliHLTCaloClusterizer & operator = (const AliHLTCaloClusterizer &)\r
+// {\r
+// return *this;\r
+// }\r
\r
\r
ClassDef(AliHLTCaloClusterizer, 0);\r
+//-*- Mode: C++ -*-
+// $Id: AliHLTCaloConstants.cxx $
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Svein Lindal <slindal@fys.uio.no> *
+//* for The ALICE HLT Project. *
+//* *
+//* 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. *
+//**************************************************************************
+
+/// @file AliHLTCaloConstants.cxx
+/// @author Svein Lindal
+/// @date 2009-11-12
+/// @brief Class containing constants for EMCAL and PHOS
+/// loaded libraries
#include "AliHLTCaloConstants.h"
+#include "TString.h"
-AliHLTCaloConstants::AliHLTCaloConstants()
+AliHLTCaloConstants::AliHLTCaloConstants(TString det) :
+ fMAXHOSTS(20),
+ fDEFAULTEVENTPORT(42001),
+ fMAXBINVALUE(1023),
+ fHIGHGAIN(0),
+ fLOWGAIN(1),
+ fALTROMAXSAMPLES(1008),
+ fALTROMAXPRESAMPLES(15),
+ fNZROWSRCU(56),
+ fNXCOLUMNSRCU(16),
+ fNZROWSMOD((det == "EMCAL") ? 48 : 56),
+ fNXCOLUMNSMOD((det == "EMCAL") ? 24 : 64 ),
+ fNGAINS(2),
+ fNDATATYPES(10),
+ fPFMAXPATHLENGTH(256),
+ fPFDEFAULTNSAMPLES(70),
+ fPFDEFAULTSTARTINDEX(0),
+ fDEFAULTTAU((det == "EMCAL") ? 0.2 : 2),
+ fDEFAULTFS(10),
+ fMODULE0(0),
+ fMODULE1(1),
+ fMODULE2(2),
+ fMODULE3(3),
+ fMODULE4(4),
+ fCSPSPERFEE(32),
+ fRCU0(0),
+ fRCU1(1),
+ fRCU2(2),
+ fRCU3(3),
+ fZ0(0),
+ fZ1(1),
+ fX0(0),
+ fX1(1),
+ fNMODULES((det == "EMCAL") ? 13 : 5),
+ fNRCUS(4),
+ fNRCUSPERMODULE((det == "EMCAL") ? 2 : 4 ),
+ fNRCUSPERTOTAL(fNMODULES*fNRCUSPERMODULE),
+ fNFEECS((det == "EMCAL") ? 9 : 14),
+ fNALTROS(4),
+ fNALTROCHANNELS(16),
+ fNBRANCHES(2),
+ fCELLSTEP((det == "EMCAL") ? -9999999.9 : 2.2 ), ///XXX right value?
+ fNRCUSPERSECTOR(4)
{
//Default constructor
}
//-*- Mode: C++ -*-
-// $Id: AliHLTCALOConstant.h 34622 2009-09-04 13:22:01Z odjuvsla $
+// $Id: AliHLTCALOConstants.h $
-/**************************************************************************
- * This file is property of and copyright by the Experimental Nuclear *
- * Physics Group, Dep. of Physics *
- * University of Oslo, Norway, 2009 *
- * *
- * Author: Svein Lindal, slindal@fys.uio.no for the ALICE PHOS Project. *
- * Contributors are mentioned in the code where appropriate. *
- * Please report bugs to slindal@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. *
- **************************************************************************/
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* See cxx source for full Copyright notice */
+
+/// @file AliHLCaloConstants.h
+/// @author Svein Lindal
+/// @date
+/// @brief Class containing constants for PHOS and EMCAL
+/// loaded libraries
#ifndef ALIHLTCALOCONSTANTS_H
#define ALIHLTCALOCONSTANTS_H
+class TString;
class AliHLTCaloConstants
{
public:
- AliHLTCaloConstants();
+
+ AliHLTCaloConstants(TString det);
virtual ~AliHLTCaloConstants();
+
+ inline int GetMAXHOSTS() {return fMAXHOSTS; }
+ inline int GetDEFAULTEVENTPORT() { return fDEFAULTEVENTPORT; }
+ inline int GetMAXBINVALUE() { return fMAXBINVALUE; }
+ inline int GetHIGHGAIN() { return fHIGHGAIN; }
+ inline int GetLOWGAIN() { return fLOWGAIN; }
+ inline int GetALTROMAXSAMPLES() { return fALTROMAXSAMPLES; }
+ inline int GetALTROMAXPRESAMPLES() { return fALTROMAXPRESAMPLES; }
+ inline int GetNZROWSRCU() { return fNZROWSRCU; }
+ inline int GetNXCOLUMNSRCU() { return fNXCOLUMNSRCU; }
+ inline int GetNZROWSMOD() { return fNZROWSMOD; }
+ inline int GetNXCOLUMNSMOD() { return fNXCOLUMNSMOD; }
+ inline int GetNGAINS() { return fNGAINS; }
+ inline int GetNDATATYPES() { return fNDATATYPES; }
+ inline int GetPFMAXPATHLENGTH() { return fPFMAXPATHLENGTH; }
+ inline int GetPFDEFAULTNSAMPLES() { return fPFDEFAULTNSAMPLES; }
+ inline int GetPFDEFAULTSTARTINDEX() { return fPFDEFAULTSTARTINDEX; }
+ inline double GetDEFAULTTAU() { return fDEFAULTTAU; }
+ inline int GetDEFAULTFS() { return fDEFAULTFS; }
+ inline int GetMODULE0() { return fMODULE0; }
+ inline int GetMODULE1() { return fMODULE1; }
+ inline int GetMODULE2() { return fMODULE2; }
+ inline int GetMODULE3() { return fMODULE3; }
+ inline int GetMODULE4() { return fMODULE4; }
+ inline int GetCSPSPERFEE() { return fCSPSPERFEE; }
+ inline int GetRCU0() { return fRCU0; }
+ inline int GetRCU1() { return fRCU1; }
+ inline int GetRCU2() { return fRCU2; }
+ inline int GetRCU3() { return fRCU3; }
+ inline int GetZ0() { return fZ0; }
+ inline int GetZ1() { return fZ1; }
+ inline int GetX0() { return fX0; }
+ inline int GetX1() { return fX1; }
+ inline int GetNMODULES() { return fNMODULES; }
+ inline int GetNRCUS() { return fNRCUS; }
+ inline int GetNRCUSPERMODULE() { return fNRCUSPERMODULE; }
+ inline int GetNRCUSPERTOTAL() { return fNRCUSPERTOTAL; }
+ inline int GetNFEECS() { return fNFEECS; }
+ inline int GetNALTROS() { return fNALTROS; }
+ inline int GetNALTROCHANNELS() { return fNALTROCHANNELS; }
+ inline int GetNBRANCHES() { return fNBRANCHES; }
+ inline float GetCELLSTEP() {return fCELLSTEP; }
+ inline int GetNRCUSPERSECTOR() {return fNRCUSPERSECTOR; }
- virtual int GetMAXHOSTS() = 0;
- virtual int GetDEFAULTEVENTPORT() = 0;
- virtual int GetMAXBINVALUE() = 0;
- virtual int GetHIGHGAIN() = 0;
- virtual int GetLOWGAIN() = 0;
- virtual int GetALTROMAXSAMPLES() = 0;
- virtual int GetALTROMAXPRESAMPLES() = 0;
- virtual int GetNZROWSRCU() = 0;
- virtual int GetNXCOLUMNSRCU() = 0;
- virtual int GetNZROWSMOD() = 0;
- virtual int GetNXCOLUMNSMOD() = 0;
- virtual int GetNGAINS() = 0;
- virtual int GetNDATATYPES() = 0;
- virtual int GetPFMAXPATHLENGTH() = 0;
- virtual int GetPFDEFAULTNSAMPLES() = 0;
- virtual int GetPFDEFAULTSTARTINDEX() = 0;
- virtual int GetDEFAULTTAU() = 0;
- virtual int GetDEFAULTFS() = 0;
- virtual int GetMODULE0() = 0;
- virtual int GetMODULE1() = 0;
- virtual int GetMODULE2() = 0;
- virtual int GetMODULE3() = 0;
- virtual int GetMODULE4() = 0;
- virtual int GetCSPSPERFEE() = 0;
- virtual int GetRCU0() = 0;
- virtual int GetRCU1() = 0;
- virtual int GetRCU2() = 0;
- virtual int GetRCU3() = 0;
- virtual int GetZ0() = 0;
- virtual int GetZ1() = 0;
- virtual int GetX0() = 0;
- virtual int GetX1() = 0;
- virtual int GetNMODULES() = 0;
- virtual int GetNRCUS() = 0;
- virtual int GetNRCUSPERMODULE() = 0;
- virtual int GetNRCUSPERTOTAL() = 0;
- virtual int GetNFEECS() = 0;
- virtual int GetNALTROS() = 0;
- virtual int GetNALTROCHANNELS() = 0;
- virtual int GetNBRANCHES() = 0;
- virtual float GetCELLSTEP() = 0;
-
-// #ifndef __CINT__
-// const unsigned char PFVECTORDIR[] = "/HLT/PHOS/PFVectors";
-// #endif
+private:
+ AliHLTCaloConstants();
+ const int fMAXHOSTS;
+ const int fDEFAULTEVENTPORT;
+ const int fMAXBINVALUE; // 1023;
+ const int fHIGHGAIN; // 1;
+ const int fLOWGAIN; // 0;
+ const int fALTROMAXSAMPLES; // 1008; /**<The maximum number of samples of the ALTRO*/
+ const int fALTROMAXPRESAMPLES; // 15;
+ const int fNZROWSRCU; // 56; /**<Number of rows per module*/
+ const int fNXCOLUMNSRCU; // 16;
+ const int fNZROWSMOD; // 48; /**<Number of rows per module*/
+ const int fNXCOLUMNSMOD; // 24; /**<Number of columns per module*/
+ const int fNGAINS; // 2; /**<Number of gains per ALTRO channel*/
+ const int fNDATATYPES; // 10;
+ const int fPFMAXPATHLENGTH; // 256;
+ const int fPFDEFAULTNSAMPLES; // 70;
+ const int fPFDEFAULTSTARTINDEX; // 0;
+ const double fDEFAULTTAU; // 0.2; /**<Assume that the signal rise time of the altrp pulses is 2 us (nominal value of the electronics)*/
+ const int fDEFAULTFS; // 10; /**<Assume that the signal is samples with 10 MHZ samle rate*/
+ const int fMODULE0; // 0;
+ const int fMODULE1; // 1;
+ const int fMODULE2; // 2;
+ const int fMODULE3; // 3;
+ const int fMODULE4; // 4;
+ const int fCSPSPERFEE; // 32;
+ const int fRCU0; // 0;
+ const int fRCU1; // 1;
+ const int fRCU2; // 2;
+ const int fRCU3; // 3;
+ const int fZ0; // 0;
+ const int fZ1; // 1;
+ const int fX0; // 0;
+ const int fX1; // 1;
+ const int fNMODULES; // 13; /**<Number of modules of the EMCAL detector*/
+ const int fNRCUS; // 4; /**<Number of RCUs per Module*/
+ const int fNRCUSPERMODULE; // 2; /**<Number of RCUs per Module*/
+ const int fNRCUSPERTOTAL; // NMODULES*NRCUSPERMODULE; /**<Total number of RCUs for EMCAL*/
+ const int fNFEECS; // 9; /**<Number of Frontend cards per branch*/
+ const int fNALTROS; // 4; /**<Number of ALTROs per frontend card*/
+ const int fNALTROCHANNELS; // 16;
+ const int fNBRANCHES; // 2;
+ const float fCELLSTEP; // Obsolete variable? Called in Calomapper!
+ const int fNRCUSPERSECTOR; // 4;
};
-
#endif
AliHLTCaloConstantsHandler();
/** Keep the copy constructor private since it should not be used */
- // AliHLTCaloConstantsHandler(const AliHLTCaloConstantsHandler & );
+ AliHLTCaloConstantsHandler(const AliHLTCaloConstantsHandler & );
/** Keep the assignement operator private since it should not be used */
AliHLTCaloConstantsHandler & operator = (const AliHLTCaloConstantsHandler &);
///////////////////////////////////////////////////////////////////////////////
#include "AliHLTCaloDefinitions.h"
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkPhosHistDataType = { sizeof(AliHLTComponentDataType), {'H','I','S','T','O','G','R','A'},{'P','H','O','S'}};;
+ const AliHLTComponentDataType AliHLTCaloDefinitions::fgkPhosHistDataType = { sizeof(AliHLTComponentDataType), {'H','I','S','T','O','G','R','A'},{'P','H','O','S'}};;
//CRAP PTH
const AliHLTComponentDataType AliHLTCaloDefinitions::fgkFourierTransform = { sizeof(AliHLTComponentDataType), {'F','O','U','R','I','E','R','T'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkChannelDataType = { sizeof(AliHLTComponentDataType), {'C','H','A','N','N','E','L','T'},{'P','H','O','S'}};;
-//const AliHLTComponentDataType AliHLTCaloDefinitions::fgkDDLPackedRawDataType = { sizeof(AliHLTComponentDataType), {'D','D','L','_','R','W','P','K'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkDDLPackedRawDataType = { sizeof(AliHLTComponentDataType), {'D','D','L','_','R','A','W',' '},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellEnergyDataType = { sizeof(AliHLTComponentDataType), {'C','E','L','L','E','N','E','R'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellEnergyHistogramDataType = { sizeof(AliHLTComponentDataType), {'E','N','E','R','H','I','S','T'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellAverageEnergyDataType = { sizeof(AliHLTComponentDataType), {'E','N','E','R','A','V','E','R'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellAccumulatedEnergyDataType = { sizeof(AliHLTComponentDataType), {'E','N','E','R','A','C','C','U'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellTimingHistogramDataType = { sizeof(AliHLTComponentDataType), {'T','I','M','E','H','I','S','T'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellTimingAverageDataType = { sizeof(AliHLTComponentDataType), {'T','I','M','E','A','V','E','R'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellChannelDataDataType = { sizeof(AliHLTComponentDataType), {'C','H','A','N','D','A','T','A'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkClusterDataType = { sizeof(AliHLTComponentDataType), {'C','L','U','S','T','R','T','Y'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkRecPointDataType = { sizeof(AliHLTComponentDataType), {'R','E','C','P','O','I','N','T'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkHistDataType = { sizeof(AliHLTComponentDataType), {'H','I','S','T','O','G','R','A'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkSpectrumDataType = { sizeof(AliHLTComponentDataType), {'S','P','E','C','T','R','U','M'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkRootTreeDataType = { sizeof(AliHLTComponentDataType), {'R','O','O','T','T','R','E','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkBaselineDataType = { sizeof(AliHLTComponentDataType), {'B','A','S','E','L','I','N','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkDigitDataType = { sizeof(AliHLTComponentDataType), {'D','I','G','I','T','T','Y','P'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkNoiseMapDataType = { sizeof(AliHLTComponentDataType), {'N','O','I','S','E','M','A','P'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkMIPDataType = { sizeof(AliHLTComponentDataType), {'M','I','P','D','T','Y','P','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkSandboxDataType = { sizeof(AliHLTComponentDataType), {'S','A','N','D','B','O','X','T'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkEmcCalibDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','I','T','Y','P','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCaloClusterDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','C','L','U','S','T'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkESDCaloClusterDataType = { sizeof(AliHLTComponentDataType), {'E','S','D','C','L','U','S','T'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkESDCaloCellsDataType = { sizeof(AliHLTComponentDataType), {'E','S','D','C','E','L','L','S'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTCaloDefinitions::fgkPhysicsHistogramsDataType = { sizeof(AliHLTComponentDataType), {'P','H','Y','S','H','I','S','T'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkChannelDataType = { sizeof(AliHLTComponentDataType), {'C','H','A','N','N','E','L','T'},{'C','A','L','O'}};;
+//const AliHLTComponentDataType AliHLTCaloDefinitions::fgkDDLPackedRawDataType = { sizeof(AliHLTComponentDataType), {'D','D','L','_','R','W','P','K'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkDDLPackedRawDataType = { sizeof(AliHLTComponentDataType), {'D','D','L','_','R','A','W',' '},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellEnergyDataType = { sizeof(AliHLTComponentDataType), {'C','E','L','L','E','N','E','R'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellEnergyHistogramDataType = { sizeof(AliHLTComponentDataType), {'E','N','E','R','H','I','S','T'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellAverageEnergyDataType = { sizeof(AliHLTComponentDataType), {'E','N','E','R','A','V','E','R'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellAccumulatedEnergyDataType = { sizeof(AliHLTComponentDataType), {'E','N','E','R','A','C','C','U'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellTimingHistogramDataType = { sizeof(AliHLTComponentDataType), {'T','I','M','E','H','I','S','T'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellTimingAverageDataType = { sizeof(AliHLTComponentDataType), {'T','I','M','E','A','V','E','R'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCellChannelDataDataType = { sizeof(AliHLTComponentDataType), {'C','H','A','N','D','A','T','A'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkClusterDataType = { sizeof(AliHLTComponentDataType), {'C','L','U','S','T','R','T','Y'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkRecPointDataType = { sizeof(AliHLTComponentDataType), {'R','E','C','P','O','I','N','T'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkHistDataType = { sizeof(AliHLTComponentDataType), {'H','I','S','T','O','G','R','A'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkSpectrumDataType = { sizeof(AliHLTComponentDataType), {'S','P','E','C','T','R','U','M'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkRootTreeDataType = { sizeof(AliHLTComponentDataType), {'R','O','O','T','T','R','E','E'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkBaselineDataType = { sizeof(AliHLTComponentDataType), {'B','A','S','E','L','I','N','E'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkDigitDataType = { sizeof(AliHLTComponentDataType), {'D','I','G','I','T','T','Y','P'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkNoiseMapDataType = { sizeof(AliHLTComponentDataType), {'N','O','I','S','E','M','A','P'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkMIPDataType = { sizeof(AliHLTComponentDataType), {'M','I','P','D','T','Y','P','E'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkSandboxDataType = { sizeof(AliHLTComponentDataType), {'S','A','N','D','B','O','X','T'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkEmcCalibDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','I','T','Y','P','E'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkCaloClusterDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','C','L','U','S','T'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkESDCaloClusterDataType = { sizeof(AliHLTComponentDataType), {'E','S','D','C','L','U','S','T'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkESDCaloCellsDataType = { sizeof(AliHLTComponentDataType), {'E','S','D','C','E','L','L','S'},{'C','A','L','O'}};;
+const AliHLTComponentDataType AliHLTCaloDefinitions::fgkPhysicsHistogramsDataType = { sizeof(AliHLTComponentDataType), {'P','H','Y','S','H','I','S','T'},{'C','A','L','O'}};;
#include "AliHLTCaloSharedMemoryInterfacev2.h" // added by PTH\r
//#include "AliPHOSEMCAGeometry.h"\r
#include "TH2F.h"\r
-#include "AliHLTCaloConstantsHandler.h"\r
#include "AliHLTCaloConstants.h"\r
\r
ClassImp(AliHLTCaloDigitMaker);\r
//using namespace CaloHLTConst;\r
\r
AliHLTCaloDigitMaker::AliHLTCaloDigitMaker(TString det) :\r
- AliHLTCaloConstantsHandler(det),\r
fShmPtr(0),\r
fDigitStructPtr(0),\r
fDigitCount(0),\r
fHighGainFactors(0),\r
fLowGainFactors(0),\r
fBadChannelMask(0),\r
- fChannelBook(0)\r
+ fChannelBook(0),\r
+ fCaloConstants(NULL)\r
{\r
- //BALLE BALLE\r
- \r
- //Must set this in the child instance\r
- \r
// See header file for documentation\r
\r
fShmPtr = new AliHLTCaloSharedMemoryInterfacev2();\r
} \r
\r
//Must be set in child instance\r
-//fMapperPtr = new AliHLTCaloMapper(det);\r
+ //fMapperPtr = new AliHLTCaloMapper(det);\r
+ fCaloConstants = new AliHLTCaloConstants(det);\r
+\r
+}\r
+\r
+AliHLTCaloDigitMaker::AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &) :\r
+ fShmPtr(0),\r
+ fDigitStructPtr(0),\r
+ fDigitCount(0),\r
+ fOrdered(true),\r
+ fMapperPtr(0),\r
+ fHighGainFactors(0),\r
+ fLowGainFactors(0),\r
+ fBadChannelMask(0),\r
+ fChannelBook(0),\r
+ fCaloConstants(NULL)\r
+{\r
+ // Dummy copy constructor\r
+\r
}\r
- \r
+\r
AliHLTCaloDigitMaker::~AliHLTCaloDigitMaker() \r
{\r
//See header file for documentation\r
#include "AliHLTCaloChannelDataStruct.h"\r
#include "AliHLTDataTypes.h"\r
#include "TString.h"\r
-#include "AliHLTCaloConstantsHandler.h"\r
\r
/**\r
* @class AliHLTCaloDigitMaker\r
\r
\r
\r
-class AliHLTCaloDigitMaker : public AliHLTCaloConstantsHandler\r
+class AliHLTCaloDigitMaker\r
{\r
\r
public:\r
/** Channel book keeping variable */\r
AliHLTCaloDigitDataStruct ***fChannelBook; //! transient\r
\r
- // AliHLTCaloDigitMaker (const AliHLTCaloDigitMaker & );\r
+ /** Constants class */\r
+ AliHLTCaloConstants* fCaloConstants;\r
+\r
+ AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &);\r
// AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker &);\r
\r
ClassDef(AliHLTCaloDigitMaker, 0); \r
#include "unistd.h"
#include <iostream>
#include "AliHLTCaloCoordinate.h"
-#include "AliHLTCaloConstantsHandler.h"
#include "AliHLTCaloConstants.h"
//ClassImp(AliHLTCaloMapper)
AliHLTCaloMapper::AliHLTCaloMapper( const unsigned long specification , TString det) :
AliHLTLogging(),
- AliHLTCaloConstantsHandler(det),
fHw2geomapPtr(0),
fCellSize(0),
fSpecification(specification),
fIsInitializedMapping(false),
- fSpecificationMapPtr(0)
+ fSpecificationMapPtr(0),
+ fCaloConstants(NULL)
{
//see header file for class documentation
+
+ fCaloConstants = new AliHLTCaloConstants(det);
}
#include "AliHLTCaloConstants.h"
#include "Rtypes.h"
#include "AliHLTLogging.h"
-#include "AliHLTCaloConstantsHandler.h"
+#include "AliHLTCaloConstants.h"
class AliHLTCaloCoordinate;
class AliHLTCaloConstants;
-class AliHLTCaloMapper : public AliHLTLogging, public AliHLTCaloConstantsHandler
+class AliHLTCaloMapper : public AliHLTLogging
{
public:
int fSpecification;
bool fIsInitializedMapping;
fDDLSpecificationMap* fSpecificationMapPtr;
-
+ AliHLTCaloConstants* fCaloConstants;
+
private:
AliHLTCaloMapper();
AliHLTCaloMapper(const AliHLTCaloMapper & );
--- /dev/null
+// $Id: AliHLTCaloProcessor.cxx 35966 2009-10-26 12:47:19Z odjuvsla $
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Author: Per Thomas Hille <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 "AliHLTCaloProcessor.h"
+#include "unistd.h"
+
+
+
+const AliHLTComponentDataType AliHLTCaloProcessor::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
+
+
+AliHLTCaloProcessor::AliHLTCaloProcessor():AliHLTProcessor(),
+ fCaloEventCount(0),
+ fModuleID(2),
+ fPrintInfoModule(0),
+ fPrintInfoFrequncyModule(1000),
+ fRunNumber(0)
+{
+ // ScanRunNumberFromFile();
+}
+
+
+
+AliHLTCaloProcessor::~AliHLTCaloProcessor()
+{
+
+}
+
+
+bool
+AliHLTCaloProcessor::CheckFileLog(const char *origin, const char *filename, const char *opt)
+{
+ sprintf(fFilepath, "%s/%s", getenv("PWD"), filename);
+ FILE *fp = fopen(filename, opt);
+
+ if(fp == 0)
+ {
+ // if( (opt == "w") || (opt == "a")) \\OD
+ if( (!strcmp(opt,"w")) || (!strcmp(opt,"a")))
+ {
+ sprintf(fMessage, "for writing please check that the directory exists and that you have write access to it" );
+ }
+ else
+ {
+ sprintf(fMessage, "for reading please check that the directory exists and that you have read access to it" );
+ }
+ Logging(kHLTLogFatal, origin , "cannot open file" , "Was not able to open file %s %s", fFilepath, fMessage);
+ return false;
+ }
+ else
+ {
+ // if( (opt == "w") || (opt == "a")) \\OD
+ if( (!strcmp(opt,"w")) || (!strcmp(opt,"a")))
+ {
+ sprintf(fMessage, "for writing" );
+ }
+ else
+ {
+ sprintf(fMessage, "for reading");
+ }
+ // Logging(kHLTLogInfo, origin , "opening file" , "Sucessfully opening %s %s", fFilepath, fMessage);
+ fclose(fp);
+ return true;
+ }
+
+}
+
+
+void
+AliHLTCaloProcessor::DoneWritingLog(const char *origin, const char *filename)
+{
+ // char filepath[1024];
+ sprintf(fFilepath, "%s/%s", getenv("PWD"), filename);
+ Logging(kHLTLogInfo, origin , "finnished writing file" , "wrote file %s", fFilepath);
+}
+
+
+void
+AliHLTCaloProcessor::ScanRunNumberFromFile()
+{
+ char tmpDirectory[512];
+ char tmpFileName[512];
+ sprintf(tmpDirectory, "%s", getenv("HOME"));
+
+ //TODO, remove hardcoded file path
+
+
+ sprintf(tmpFileName, "%s%s", tmpDirectory, "/hlt/rundir/runNumber.txt");
+ int tmp = 0;
+ if(CheckFileLog( __FILE__ , tmpFileName , "r")== true)
+ {
+ FILE *fp = fopen(tmpFileName, "r");
+ tmp = fscanf(fp, "%d", &fRunNumber);
+ fclose(fp);
+ }
+
+
+
+
+ }
+
+const char*
+AliHLTCaloProcessor::IntToChar(int number)
+{
+ sprintf(lineNumber,"%d", number);
+ return lineNumber;
+}
+
+
+
+int
+AliHLTCaloProcessor::ScanArgumentsModule(int argc, const char** argv)
+{
+ fPrintInfoModule = kFALSE;
+ int iResult=0;
+ TString argument="";
+
+ for(int i=0; i<argc && iResult>=0; i++)
+ {
+ argument=argv[i];
+
+ if (argument.IsNull())
+ {
+ continue;
+ }
+
+ if (argument.CompareTo("-printinfo") == 0)
+ {
+ if(i+1 <= argc)
+ {
+ argument=argv[i+1];
+ fPrintInfoFrequncyModule = atoi(argv[i+1]);
+ fPrintInfoModule = kTRUE;
+ }
+ else
+ {
+ Logging(kHLTLogWarning, __FILE__ , "inconsistency during init" , "asking for event info, but no update frequency is specified, option is ignored");
+ }
+ }
+
+ }
+ return 0;
+}
+
--- /dev/null
+//-*- Mode: C++ -*-
+// $Id: AliHLTCaloProcessor.h 35107 2009-09-30 01:45:06Z phille $
+
+#ifndef ALIHLTCALOPROCESSOR_H
+#define ALIHLTCALOPROCESSOR_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+#include "AliHLTProcessor.h"
+//#include "AliHLTCaloBase.h"
+#include "AliHLTCaloDefinitions.h"
+#include "AliHLTDataTypes.h"
+#include "AliHLTCaloConstant.h"
+
+using namespace CaloHLTConst;
+
+//class AliHLTCaloProcessor:public AliHLTProcessor, public AliHLTCaloBase
+class AliHLTCaloProcessor:public AliHLTProcessor
+{
+
+ public:
+ AliHLTCaloProcessor();
+ virtual ~AliHLTCaloProcessor();
+ virtual int DoInit(int argc, const char** argv) = 0;
+ virtual int DoDeinit() = 0;
+ virtual const char* GetComponentID() = 0;
+ virtual void GetInputDataTypes( std::vector <AliHLTComponentDataType>& list) =0;
+ virtual AliHLTComponentDataType GetOutputDataType() =0;
+ virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) =0;
+ virtual AliHLTComponent* Spawn() = 0;
+
+
+ char lineNumber[256];
+ const char *IntToChar(int number);
+ /*
+ *Check file and write messages to AliLog system
+ */
+ bool CheckFileLog(const char *origin, const char *filename, const char *opt);
+ void DoneWritingLog(const char *origin, const char *filename);
+
+ using AliHLTProcessor::DoEvent;
+
+ protected:
+ void ScanRunNumberFromFile();
+ virtual int ScanArgumentsModule(int argc, const char** argv);
+ int fCaloEventCount; /**<Global event counter for this component*/
+ AliHLTUInt8_t fModuleID; /**<ID of the module this component read data from (0-4)*/
+
+ Bool_t fPrintInfoModule; /**<wether or not to print debugg info to std out*/
+ int fPrintInfoFrequncyModule; /**<Defines the update frequency for information printet to std out*/
+
+ static const AliHLTComponentDataType fgkInputDataTypes[]; /**<List of datatypes that can be given to this component*/
+ int fRunNumber;
+ char fFilepath[1024];
+ char fMessage[1024];
+
+ private:
+ AliHLTCaloProcessor(const AliHLTCaloProcessor & );
+ AliHLTCaloProcessor & operator = (const AliHLTCaloProcessor &);
+
+};
+
+
+#endif
#include "AliRawReaderMemory.h"
#include "AliAltroRawStreamV3.h"
#include "AliCaloRawStreamV3.h"
-#include "AliHLTCaloConstantsHandler.h"
#include "AliHLTCaloConstants.h"
+#include "AliHLTCaloRcuProcessor.h"
AliHLTCaloRawAnalyzerComponentv3::AliHLTCaloRawAnalyzerComponentv3(TString det):
- AliHLTCaloConstantsHandler(det),
- AliHLTProcessor(),
+ AliHLTCaloRcuProcessor(),
+ fCaloEventCount(0),
fAnalyzerPtr(0),
fMapperPtr(0),
- // fkDoPushRawData(false),
- fkDoPushRawData(false),
- fPhosEventCount(0),
+ fkDoPushRawData(false),
fSanityInspectorPtr(0),
fRawReaderMemoryPtr(0),
fAltroRawStreamPtr(0),
fBunchSizeCut(0),
fMinPeakPosition(0),
fMaxPeakPosition(100),
+ fCaloConstants(NULL),
fRawDataWriter(0)
{
//comment
// fMapperPtr = new AliHLTCaloMapper();
-
+
+ fCaloConstants = new AliHLTCaloConstants(det);
+
fRawReaderMemoryPtr = new AliRawReaderMemory();
-
+
fAltroRawStreamPtr = new AliAltroRawStreamV3(fRawReaderMemoryPtr);
-
+
fSanityInspectorPtr = new AliHLTCaloSanityInspector();
-
- // if( fkDoPushRawData == true )
- {
- fRawDataWriter = new RawDataWriter(fCaloConstants);
- }
-
- fAltroRawStreamPtr = new AliCaloRawStreamV3(fRawReaderMemoryPtr, TString("EMCAL"));
+
+ if( fkDoPushRawData == true )
+ {
+ fRawDataWriter = new RawDataWriter(fCaloConstants);
+ }
+
+ fAltroRawStreamPtr = new AliCaloRawStreamV3(fRawReaderMemoryPtr, det);
}
AliHLTCaloRawAnalyzerComponentv3::~AliHLTCaloRawAnalyzerComponentv3()
{
//comment
- Deinit();
+ DoDeinit();
+}
+
+
+
+int
+AliHLTCaloRawAnalyzerComponentv3::DoInit( int argc, const char** argv )
+{
+
+ //See base class for documentation
+ // fPrintInfo = kFALSE;
+
+ int iResult=0;
+
+ // fMapperPtr = new AliHLTCaloMapper();
+
+ //InitMapping();
+
+ for(int i = 0; i < argc; i++)
+ {
+ if(!strcmp("-offset", argv[i]))
+ {
+ fOffset = atoi(argv[i+1]);
+ }
+ if(!strcmp("-bunchsizecut", argv[i]))
+ {
+ fBunchSizeCut = atoi(argv[i+1]);
+ }
+ if(!strcmp("-minpeakposition", argv[i]))
+ {
+ fMinPeakPosition = atoi(argv[i+1]);
+ }
+ if(!strcmp("-maxpeakposition", argv[i]))
+ {
+ fMaxPeakPosition = atoi(argv[i+1]);
+ }
+ }
+
+ /*
+ if( fMapperPtr->GetIsInitializedMapping() == false)
+ {
+ Logging(kHLTLogFatal, __FILE__ , IntToChar( __LINE__ ) , "AliHLTCaloMapper::Could not initialise mapping from file %s, aborting", fMapperPtr->GetFilePath());
+ return -4;
+ }
+ */
+
+ return iResult;
}
+
+
int
-AliHLTCaloRawAnalyzerComponentv3::Deinit()
+AliHLTCaloRawAnalyzerComponentv3::DoDeinit()
{
//comment
+
if(fAnalyzerPtr)
{
delete fAnalyzerPtr;
fAnalyzerPtr = 0;
}
+
if(fMapperPtr)
{
delete fMapperPtr;
fMapperPtr = 0;
}
+
if(fRawReaderMemoryPtr)
{
delete fRawReaderMemoryPtr;
fRawReaderMemoryPtr = 0;
}
+
if(fAltroRawStreamPtr)
{
delete fAltroRawStreamPtr;
fAltroRawStreamPtr = 0;
}
+
return 0;
}
-/*
+
const char*
AliHLTCaloRawAnalyzerComponentv3::GetComponentID()
{
//comment
return "CaloRawAnalyzerv3";
}
-*/
- /*
+
+
void
AliHLTCaloRawAnalyzerComponentv3::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
{
list.clear();
list.push_back( AliHLTCaloDefinitions::fgkDDLPackedRawDataType | kAliHLTDataOriginPHOS);
}
- */
+
-AliHLTComponentDataType
+AliHLTComponentDataType
AliHLTCaloRawAnalyzerComponentv3::GetOutputDataType()
{
//comment
return AliHLTCaloDefinitions::fgkChannelDataType;
}
+
void
AliHLTCaloRawAnalyzerComponentv3::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
{
}
-int
-AliHLTCaloRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/,
- AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
-{
-
- /*
-
- if( fPhosEventCount%300 == 0 )
- {
- cout << __FILE__<<__LINE__<< " Processing event " << fPhosEventCount << endl;
- }
- */
-
- // Int_t blockSize = 0;
-
- Int_t blockSize = -1;
- UInt_t totSize = 0;
- const AliHLTComponentBlockData* iter = NULL;
- unsigned long ndx;
-
- for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
- {
- iter = blocks+ndx;
- if( CheckInputDataType( iter->fDataType ) == false )
- {
- continue;
- }
- else
- {
- InitMapping( iter->fSpecification);
-
- blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
-
- // blockSize = 1;
-
- if(blockSize == -1) // If the processing returns -1 we are out of buffer and return an error msg.
- {
- return -ENOBUFS;
- }
-
- totSize += blockSize; //Keeping track of the used size
- AliHLTComponentBlockData bdChannelData;
- FillBlockData( bdChannelData );
- bdChannelData.fOffset = 0; //FIXME
- bdChannelData.fSize = blockSize;
-
- // bdChannelData.fDataType = AliHLTPHOSDefinitions::fgkChannelDataType;
- bdChannelData.fDataType = AliHLTCaloDefinitions::fgkChannelDataType;
-
- bdChannelData.fSpecification = iter->fSpecification;
- outputBlocks.push_back(bdChannelData);
- outputPtr += blockSize; //Updating position of the output buffer
- }
-
- fPhosEventCount++;
- size = totSize; //telling the framework how much buffer space we have used.
- }
-
-
-return 0;
-
-}//end DoEvent
-
Int_t
totSize += sizeof( AliHLTCaloChannelDataStruct );
if(totSize > size)
{
- HLTError("Buffer overflow: Trying to write data of size: %d bytes. Output buffer available: %d bytes.", totSize, size);
+ //HLTError("Buffer overflow: Trying to write data of size: %d bytes. Output buffer available: %d bytes.", totSize, size);
return -1;
}
-int
-AliHLTCaloRawAnalyzerComponentv3::DoInit( int argc, const char** argv )
-{
-
- //See base class for documentation
- // fPrintInfo = kFALSE;
-
- int iResult=0;
-
- // fMapperPtr = new AliHLTCaloMapper();
-
- //InitMapping();
-
- for(int i = 0; i < argc; i++)
- {
- if(!strcmp("-offset", argv[i]))
- {
- fOffset = atoi(argv[i+1]);
- }
- if(!strcmp("-bunchsizecut", argv[i]))
- {
- fBunchSizeCut = atoi(argv[i+1]);
- }
- if(!strcmp("-minpeakposition", argv[i]))
- {
- fMinPeakPosition = atoi(argv[i+1]);
- }
- if(!strcmp("-maxpeakposition", argv[i]))
- {
- fMaxPeakPosition = atoi(argv[i+1]);
- }
- }
-
- /*
- if( fMapperPtr->GetIsInitializedMapping() == false)
- {
- Logging(kHLTLogFatal, __FILE__ , IntToChar( __LINE__ ) , "AliHLTCaloMapper::Could not initialise mapping from file %s, aborting", fMapperPtr->GetFilePath());
- return -4;
- }
- */
-
- return iResult;
-}
-
-
-
AliHLTCaloRawAnalyzerComponentv3::RawDataWriter::RawDataWriter(AliHLTCaloConstants* cConst) : //fIsFirstChannel(true),
fRawDataBuffer(0),
#include "AliHLTProcessor.h"
#include "AliHLTCaloDefinitions.h"
-#include "AliHLTCaloConstantsHandler.h"
+#include "AliHLTCaloConstants.h"
+#include "AliHLTCaloRcuProcessor.h"
class AliHLTCaloConstants;
class AliHLTCaloMapper;
//class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloRcuProcessor
-class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, public AliHLTProcessor
+class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloRcuProcessor
{
public:
/** Constructor must be initialized to specific calorimeter */
AliHLTCaloRawAnalyzerComponentv3(TString det);
-
-
/** Destructor */
virtual ~AliHLTCaloRawAnalyzerComponentv3();
virtual int DoInit(int argc =0, const char** argv = 0);
/** interface function, see @ref AliHLTComponent for description */
- virtual int Deinit();
+ virtual int DoDeinit();
/** interface function, see @ref AliHLTComponent for description */
virtual const char* GetComponentID() = 0;
/** interface function, see @ref AliHLTComponent for description */
- virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list) = 0;
+ virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
/** interface function, see @ref AliHLTComponent for description */
virtual AliHLTComponentDataType GetOutputDataType();
virtual AliHLTComponent* Spawn() = 0;
protected:
-virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype) = 0;
+
+ //virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype) = 0;
/** interface function, see @ref AliHLTComponent for description */
-// using AliHLTCaloRcuProcessor::DoEvent;
+ using AliHLTCaloRcuProcessor::DoEvent;
/** interface function, see @ref AliHLTComponent for description */
virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
- AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
+ AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks ) = 0;
/**
* Do the real processing in the component
*/
virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize);
+ unsigned long fCaloEventCount;
/** Pointer to an analyzer object used for raw data anlysis */
AliHLTCaloRawAnalyzer *fAnalyzerPtr; //COMMENT
+
AliHLTCaloMapper *fMapperPtr;
+
private:
/** Keep default constructor private since it should not be used */
AliHLTCaloRawAnalyzerComponentv3 & operator = (const AliHLTCaloRawAnalyzerComponentv3 &);
virtual void InitMapping(const int specification ) = 0;
+
const bool fkDoPushRawData;
/** Mapping from harware address to geometrical address */
// AliHLTCaloMapper *fMapperPtr; //!transient
- unsigned long fPhosEventCount;
+
/** Pointer to object which may check the integrity of the data */
AliHLTCaloSanityInspector *fSanityInspectorPtr; //!transient
// AliHLTCaloMapper *fMapperPtr;
+ /** Constants class instance */
+ AliHLTCaloConstants *fCaloConstants;
+
+
+
class RawDataWriter
{
public:
--- /dev/null
+// $Id: AliHLTCaloRcuProcessor.cxx 35109 2009-09-30 02:48:41Z phille $
+
+/**************************************************************************
+ * 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 "AliHLTCaloRcuProcessor.h"
+
+AliHLTCaloRcuProcessor::AliHLTCaloRcuProcessor():AliHLTCaloProcessor()
+
+{
+
+}
+
+
+AliHLTCaloRcuProcessor::~AliHLTCaloRcuProcessor()
+{
+
+}
+
+
+
public:
AliHLTCaloRcuProcessor();
virtual ~AliHLTCaloRcuProcessor();
+ virtual AliHLTComponentDataType GetOutputDataType() =0;
private:
AliHLTCaloRcuProcessor (const AliHLTCaloRcuProcessor & );
const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkCalibrationDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','I','B','R','A','H'},{'E','M','C','A'}};;
+const AliHLTComponentDataType AliHLTEMCALDefinitions::fgkChannelDataType = { sizeof(AliHLTComponentDataType), {'C','H','A','N','N','E','L','T'},{'E','M','C','A'}};;
+
AliHLTEMCALDefinitions::AliHLTEMCALDefinitions()
{
// see header file for class documentation
static const AliHLTComponentDataType fgkESDDataType; // global ESD data type - may change!!!
static const AliHLTComponentDataType fgkEMCALESDDataType; // ESD data type after emcal processing
static const AliHLTComponentDataType fgkCalibrationDataType; // Calibration
-
+ static const AliHLTComponentDataType fgkChannelDataType;
ClassDef(AliHLTEMCALDefinitions, 0)
};
#include "AliHLTEMCALRawAnalyzerComponent.h"
#include "AliHLTEMCALMapper.h"
#include "AliHLTEMCALDefinitions.h"
-
+#include "AliHLTCaloChannelDataHeaderStruct.h"
AliHLTEMCALRawAnalyzerComponent::AliHLTEMCALRawAnalyzerComponent() :
AliHLTCaloRawAnalyzerComponentv3("EMCAL")
}
+
+AliHLTComponentDataType
+AliHLTEMCALRawAnalyzerComponent::GetOutputDataType()
+{
+ //comment
+ return AliHLTEMCALDefinitions::fgkChannelDataType;
+}
+
+
+void
+AliHLTEMCALRawAnalyzerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+{
+ //comment
+ constBase = sizeof(AliHLTCaloChannelDataHeaderStruct);
+ inputMultiplier = 0.5;
+}
+
+
+void
+AliHLTEMCALRawAnalyzerComponent::DoInit()
+{
+
+}
+
bool
AliHLTEMCALRawAnalyzerComponent::CheckInputDataType(const AliHLTComponentDataType &datatype)
{
}
+
+
void
AliHLTEMCALRawAnalyzerComponent::InitMapping( const int specification )
{
exit(-2);
}
}
+
+int
+AliHLTEMCALRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/,
+ AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
+{
+
+ /*
+
+ if( fPhosEventCount%300 == 0 )
+ {
+ cout << __FILE__<<__LINE__<< " Processing event " << fPhosEventCount << endl;
+ }
+ */
+
+ // Int_t blockSize = 0;
+
+ Int_t blockSize = -1;
+ UInt_t totSize = 0;
+ const AliHLTComponentBlockData* iter = NULL;
+ unsigned long ndx;
+
+ for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
+ {
+ iter = blocks+ndx;
+ if( ! CheckInputDataType(iter->fDataType) )
+ {
+ continue;
+ }
+ else
+ {
+ InitMapping( iter->fSpecification);
+
+ blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
+
+ // blockSize = 1;
+
+ if(blockSize == -1) // If the processing returns -1 we are out of buffer and return an error msg.
+ {
+ return -ENOBUFS;
+ }
+
+ totSize += blockSize; //Keeping track of the used size
+ AliHLTComponentBlockData bdChannelData;
+ FillBlockData( bdChannelData );
+ bdChannelData.fOffset = 0; //FIXME
+ bdChannelData.fSize = blockSize;
+
+ // bdChannelData.fDataType = AliHLTPHOSDefinitions::fgkChannelDataType;
+ bdChannelData.fDataType = AliHLTEMCALDefinitions::fgkChannelDataType;
+
+ bdChannelData.fSpecification = iter->fSpecification;
+ outputBlocks.push_back(bdChannelData);
+ outputPtr += blockSize; //Updating position of the output buffer
+ }
+
+ fCaloEventCount++;
+ size = totSize; //telling the framework how much buffer space we have used.
+ }
+
+
+return 0;
+
+}//end DoEvent
+
AliHLTEMCALRawAnalyzerComponent();
virtual ~AliHLTEMCALRawAnalyzerComponent();
virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
+ virtual AliHLTComponentDataType GetOutputDataType();
+ virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+ virtual void DoInit();
+
virtual const char* GetComponentID() = 0;
virtual AliHLTComponent* Spawn() = 0;
protected:
+ virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
+ AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
+ AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
+
virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype);
private:
//AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
AliHLTPHOSRecPointDataStruct *recPoint = fRecPointDataPtr;
- UInt_t iDigit = 0;
+ // UInt_t iDigit = 0;
if(!recPoint) return 0;
for(Int_t iRecPoint=0; iRecPoint < fNRecPoints; iRecPoint++)
{
fClusterAnalyserPtr = new AliHLTPHOSClusterAnalyser();
- const char *path = "HLT/ConfigPHOS/ClusterAnalyserComponent";
+ // const char *path = "HLT/ConfigPHOS/ClusterAnalyserComponent";
GetGeometryFromCDB();
fMinX(-72.-10.),
fDetRadius(-99999),
+ fNModules(3),
fMatchDistanceSq(400),
fBestMatchesArray(NULL),
fTrackDistanceArray(NULL)
AliHLTCaloSharedMemoryInterfacev2.h \
AliHLTCaloFourier.h \
AliHLTCaloConstants.h \
-AliHLTCaloConstantsHandler.h \
AliHLTCaloClusterizer.h \
AliHLTCaloDigitMaker.h \
-AliHLTCaloClusterAnalyser.h
-
+AliHLTCaloClusterAnalyser.h \
+AliHLTCaloRcuProcessor.h \
+AliHLTCaloProcessor.h
## all source files of this module
## all source files corresponding to the class headers