X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=HLT%2FPHOS%2FAliHLTPHOSClusterizerComponent.cxx;h=f0aea00c13be8368897d07aff6e425b36827831c;hb=c1e4a18c8c989337a189923561451b3195feeaf7;hp=a2f4e221802a741d80245a01dea1e11e3c31155d;hpb=c3d5fc1c3b6097c9aaba21bfb0792dace5abe59d;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/PHOS/AliHLTPHOSClusterizerComponent.cxx b/HLT/PHOS/AliHLTPHOSClusterizerComponent.cxx index a2f4e221802..f0aea00c13b 100644 --- a/HLT/PHOS/AliHLTPHOSClusterizerComponent.cxx +++ b/HLT/PHOS/AliHLTPHOSClusterizerComponent.cxx @@ -17,11 +17,11 @@ #include #include "AliHLTPHOSClusterizerComponent.h" -#include "AliHLTPHOSClusterizer.h" -#include "AliHLTPHOSRecPointDataStruct.h" -#include "AliHLTPHOSRecPointHeaderStruct.h" -#include "AliHLTPHOSDigitDataStruct.h" -#include "AliHLTPHOSDigitContainerDataStruct.h" +#include "AliHLTCaloRecPointDataStruct.h" +#include "AliHLTCaloRecPointHeaderStruct.h" +#include "AliHLTPHOSGeometry.h" +#include "AliHLTCaloClusterAnalyser.h" + @@ -36,55 +36,30 @@ // refer to README to build package // or // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +#include "AliHLTCaloDefinitions.h" +#include "AliHLTPHOSGeometry.h" +#include "AliHLTPHOSRecoParamHandler.h" AliHLTPHOSClusterizerComponent gAliHLTPHOSClusterizerComponent; AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent(): - AliHLTPHOSProcessor(), - fAllDigitsPtr(0), - fClusterizerPtr(0), - fDigitCount(0), - fNoCrazyness(0) -{ - //See headerfile for documentation -} - -AliHLTPHOSClusterizerComponent::~AliHLTPHOSClusterizerComponent() + AliHLTCaloClusterizerComponent("PHOS") { //See headerfile for documentation - if(fClusterizerPtr) - { - delete fClusterizerPtr; - fClusterizerPtr = 0; - } - if(fAllDigitsPtr) - { - delete fAllDigitsPtr; - fAllDigitsPtr = 0; - } -} - + fDataOrigin = const_cast(kAliHLTDataOriginPHOS); -int -AliHLTPHOSClusterizerComponent::Deinit() -{ - //See headerfile for documentation - - if (fClusterizerPtr) - { - delete fClusterizerPtr; - fClusterizerPtr = 0; - } - - return 0; + //AliHLTPHOSGeometry *geom = new AliHLTPHOSGeometry; + + fAnalyserPtr->SetGeometry(new AliHLTPHOSGeometry); + + fRecoParamsPtr = new AliHLTPHOSRecoParamHandler(); + } -const Char_t* -AliHLTPHOSClusterizerComponent::GetComponentID() +AliHLTPHOSClusterizerComponent::~AliHLTPHOSClusterizerComponent() { //See headerfile for documentation - return "PhosClusterizer"; } void @@ -92,14 +67,14 @@ AliHLTPHOSClusterizerComponent::GetInputDataTypes( vector& outputBlocks) -{ - //See headerfile for documentation - - UInt_t offset = 0; - UInt_t mysize = 0; - Int_t nRecPoints = 0; - Int_t nDigits = 0; - Int_t j = 0; - - AliHLTUInt8_t* outBPtr; - outBPtr = outputPtr; - const AliHLTComponentBlockData* iter = 0; - unsigned long ndx; - - UInt_t specification = 0; - - AliHLTPHOSDigitDataStruct *digitDataPtr = 0; - - AliHLTPHOSRecPointHeaderStruct* recPointHeaderPtr = reinterpret_cast(outBPtr); - - fClusterizerPtr->SetRecPointDataPtr(reinterpret_cast(outBPtr+sizeof(AliHLTPHOSRecPointHeaderStruct))); - - for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) - { - iter = blocks+ndx; - if (iter->fDataType == AliHLTPHOSDefinitions::fgkDigitDataType) - { - specification = specification|iter->fSpecification; - nDigits = iter->fSize/sizeof(AliHLTPHOSDigitDataStruct); - digitDataPtr = reinterpret_cast(iter->fPtr); - for (Int_t i = 0; i < nDigits; i++) - { - fAllDigitsPtr->fDigitDataStruct[j].fX = digitDataPtr->fX; - fAllDigitsPtr->fDigitDataStruct[j].fZ = digitDataPtr->fZ; - fAllDigitsPtr->fDigitDataStruct[j].fEnergy = digitDataPtr->fEnergy; - fAllDigitsPtr->fDigitDataStruct[j].fTime = digitDataPtr->fTime; - fAllDigitsPtr->fDigitDataStruct[j].fCrazyness = digitDataPtr->fCrazyness; - fAllDigitsPtr->fDigitDataStruct[j].fModule = digitDataPtr->fModule; - j++; - digitDataPtr++; - } - } - } - - fAllDigitsPtr->fNDigits = j; - HLTDebug("Number of digits: %d", j); - nRecPoints = fClusterizerPtr->ClusterizeEvent(size, mysize); - - if(nRecPoints == -1) - { - HLTError("Running out of buffer, exiting for safety."); - return -ENOBUFS; - } - - recPointHeaderPtr->fNRecPoints = nRecPoints; - mysize += sizeof(AliHLTPHOSRecPointHeaderStruct); - - HLTDebug("Number of clusters: %d", nRecPoints); - - AliHLTComponentBlockData clusterBd; - FillBlockData( clusterBd ); - clusterBd.fOffset = offset; - clusterBd.fSize = mysize; - clusterBd.fDataType = AliHLTPHOSDefinitions::fgkRecPointDataType; - clusterBd.fSpecification = specification; - outputBlocks.push_back( clusterBd ); - - if(false) - { - AliHLTComponentBlockData digitBd; - FillBlockData(digitBd); - } - - size = mysize; - - return 0; -} - -int -AliHLTPHOSClusterizerComponent::Reconfigure(const char* cdbEntry, const char* /*chainId*/) -{ - // see header file for class documentation - - const char* path="HLT/ConfigPHOS/ClusterizerComponent"; - - if (cdbEntry) path = cdbEntry; - - return ConfigureFromCDBTObjString(cdbEntry); -} - -int -AliHLTPHOSClusterizerComponent::ScanConfigurationArgument(int argc, const char **argv) -{ - //See header file for documentation - - if(argc <= 0) return 0; - - int i=0; - - TString argument=argv[i]; - - if (argument.CompareTo("-digitthreshold") == 0) - { - if (++i >= argc) return -EPROTO; - argument = argv[i]; - fClusterizerPtr->SetEmcMinEnergyThreshold(argument.Atof()); - return 1; - } - - if (argument.CompareTo("-recpointthreshold") == 0) - { - if (++i >= argc) return -EPROTO; - argument = argv[i]; - fClusterizerPtr->SetEmcClusteringThreshold(argument.Atof()); - return 1; - } - -} - -int -AliHLTPHOSClusterizerComponent::DoInit(int argc, const char** argv ) +const Char_t* +AliHLTPHOSClusterizerComponent::GetComponentID() { //See headerfile for documentation - - fAllDigitsPtr = new AliHLTPHOSDigitContainerDataStruct(); - fClusterizerPtr = new AliHLTPHOSClusterizer(); - fClusterizerPtr->SetDigitContainer(fAllDigitsPtr); - fNoCrazyness = false; - // - - const char *path = "HLT/ConfigPHOS/ClusterizerComponent"; - - ConfigureFromCDBTObjString(path); - - for (int i = 0; i < argc; i++) - { - ScanConfigurationArgument(i, argv[i]); - } - - return 0; + return "PhosClusterizer"; } AliHLTComponent*