--- /dev/null
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Oystein Djuvsland *
+//* *
+//* 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 AliHLTPHOSAgent.cxx
+ @author Oystein Djuvsland
+ @date
+ @brief Agent of the libAliHLTPHOS library
+*/
+
+#include "AliHLTPHOSAgent.h"
+#include "AliHLTConfiguration.h"
+#include "AliHLTPHOSDefinitions.h"
+#include "AliHLTOUT.h"
+#include "AliHLTOUTHandlerChain.h"
+#include "AliRunLoader.h"
+#include "AliCDBManager.h"
+#include "AliCDBEntry.h"
+#include "AliHLTPHOSConstants.h"
+#include "AliHLTPHOSMapper.h"
+
+/** global instance for agent registration */
+AliHLTPHOSAgent gAliHLTPHOSAgent;
+
+// component headers
+#include "AliHLTPHOSCalibrationComponent.h"
+#include "AliHLTPHOSClusterAnalyserComponent.h"
+#include "AliHLTPHOSClusterizerComponent.h"
+#include "AliHLTPHOSDigitMakerComponent.h"
+#include "AliHLTPHOSESDEntriesMakerComponent.h"
+#include "AliHLTPHOSHistogramProducerComponent.h"
+#include "AliHLTPHOSModuleCalibrationProcessorComponent.h"
+#include "AliHLTPHOSMonitorTriggerComponent.h"
+#include "AliHLTPHOSRawAnalyzerComponent.h"
+#include "AliHLTPHOSRawAnalyzerCrudeComponentv2.h"
+#include "AliHLTPHOSRawAnalyzerPeakFinderComponent.h"
+#include "AliHLTPHOSRcuCalibrationProcessorComponent.h"
+#include "AliHLTPHOSRcuDAComponent.h"
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTPHOSAgent)
+
+AliHLTPHOSAgent::AliHLTPHOSAgent()
+ :
+ AliHLTModuleAgent("PHOS"),
+ fRawDataHandler(NULL)
+{
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTPHOSAgent::~AliHLTPHOSAgent()
+{
+ // see header file for class documentation
+}
+
+int AliHLTPHOSAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
+ AliRawReader* /*rawReader*/,
+ AliRunLoader* /*runloader*/) const
+{
+ // see header file for class documentation
+ if (handler)
+ {
+ // const char* cdbEntry="PHOS/Calib/Parameters";
+ // AliCDBManager* pMan=AliCDBManager::Instance();
+// AliPHOSParam* pPHOSParam=NULL;
+// if (pMan)
+// {
+// AliCDBEntry *pEntry = pMan->Get(cdbEntry);
+// if (pEntry &&
+// pEntry->GetObject() &&
+// (pPHOSParam=dynamic_cast<AliPHOSParam*>(pEntry->GetObject())))
+// {
+// } else
+// {
+// HLTWarning("can not load AliPHOSParam from CDB entry %s", cdbEntry);
+// }
+// }
+
+
+ int moduleStart = 0;
+ int moduleEnd = PhosHLTConst::NMODULES - 1;
+ int rcuStart = 0;
+ int rcuEnd = PhosHLTConst::NRCUSPERMODULE - 1;
+
+ TString mergerInput;
+ TString sinkClusterInput;
+ TString emInput;
+ for (int module = moduleStart; module < moduleEnd; module++)
+ {
+ TString clInput;
+
+ for(int rcu = rcuStart; rcu < rcuEnd; rcu++)
+ {
+ TString arg, publisher, ra, dm;
+ // raw data publisher components
+ publisher.Form("PHOS-RP_%02d_%d", module, rcu);
+
+ arg.Form("-datatype 'DDL_RAW ' 'PHOS' -dataspec 0x ", 0x1 << (module*PhosHLTConst::NRCUSPERMODULE + rcu));
+ handler->CreateConfiguration(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
+
+ // Raw analyzer
+ arg = "";
+ ra.Form("PHOS-RA_%02d_%d", module, rcu);
+ handler->CreateConfiguration(ra.Data(), "PhosRawCrudev2", publisher.Data(), arg.Data());
+
+ // digit maker components
+ dm.Form("PHOS-DM_%02d_%d", module, rcu);
+ arg="";
+ arg.Form("-sethighgainfactor 0.005 -setlowgainfactor 0.08 -setdigitthresholds 0.005 0.002");
+ handler->CreateConfiguration(dm.Data(), "PhosDigitMaker", ra.Data(), arg.Data());
+
+ if(clInput.Length() > 0) clInput += " ";
+ clInput+=dm;
+ }
+ TString arg, cl, ca;
+
+ cl.Form("PHOS-CF_%02d", module);
+ arg = "";
+ arg.Form("-digitthreshold 0.005 -recpointthreshold 0.1 -modulemode");
+ handler->CreateConfiguration(cl.Data(), "PhosClusterizer", clInput.Data(), arg.Data());
+
+ ca.Form("PHOS-CA_%02d", module);
+ arg = " ";
+ handler->CreateConfiguration(ca.Data(), "PhosClusterAnalyser", cl.Data(), arg.Data());
+
+ if(emInput.Length() > 0) emInput += " ";
+ emInput += ca;
+ }
+
+ TString arg, em;
+
+ // tracker finder components
+ em.Form("PHOS-EM");
+ arg = " ";
+ handler->CreateConfiguration(em.Data(), "PhosEsdEntriesMaker", emInput.Data(), " ");
+ }
+ return 0;
+}
+
+const char* AliHLTPHOSAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
+ AliRunLoader* runloader) const
+{
+ // see header file for class documentation
+ if (runloader) {
+ // reconstruction chains for AliRoot simulation
+ // Note: run loader is only available while running embedded into
+ // AliRoot simulation
+ if (runloader->GetLoader("PHOSLoader") != NULL)
+ return "PHOS-EM";
+ }
+ return NULL;
+}
+
+const char* AliHLTPHOSAgent::GetRequiredComponentLibraries() const
+{
+ // see header file for class documentation
+ return NULL;
+}
+
+int AliHLTPHOSAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
+{
+ // see header file for class documentation
+ if (!pHandler) return -EINVAL;
+ pHandler->AddComponent(new AliHLTPHOSRawAnalyzerCrudeComponentv2);
+ pHandler->AddComponent(new AliHLTPHOSDigitMakerComponent);
+ pHandler->AddComponent(new AliHLTPHOSClusterizerComponent);
+ pHandler->AddComponent(new AliHLTPHOSClusterAnalyserComponent);
+ pHandler->AddComponent(new AliHLTPHOSESDEntriesMakerComponent);
+
+ return 0;
+}
+
+int AliHLTPHOSAgent::GetHandlerDescription(AliHLTComponentDataType dt,
+ AliHLTUInt32_t spec,
+ AliHLTOUTHandlerDesc& desc) const
+{
+ // see header file for class documentation
+
+ AliHLTPHOSMapper mapper;
+ mapper.InitDDLSpecificationMapping();
+
+ // raw data blocks to be fed into offline reconstruction
+ if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginPHOS))
+ {
+ if(mapper.GetDDLFromSpec(spec) >= 0)
+ {
+ desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
+ return 1;
+ }
+ else
+ {
+ HLTWarning("Handler can not process data inconsistent with a single PHOS DDL from specification % d", spec);
+ return 0;
+ }
+ }
+ return 0;
+}
+
+AliHLTOUTHandler* AliHLTPHOSAgent::GetOutputHandler(AliHLTComponentDataType dt,
+ AliHLTUInt32_t /*spec*/)
+{
+ // see header file for class documentation
+
+ // raw data blocks to be fed into offline reconstruction
+ if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginPHOS))
+ {
+ if (!fRawDataHandler)
+ {
+ fRawDataHandler = new AliHLTPHOSAgent::AliHLTPHOSRawDataHandler;
+ }
+ return fRawDataHandler;
+ }
+
+ return NULL;
+}
+
+int AliHLTPHOSAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
+{
+ // see header file for class documentation
+ if (pInstance==NULL) return -EINVAL;
+
+ if (pInstance==fRawDataHandler) {
+ delete fRawDataHandler;
+ fRawDataHandler=NULL;
+ }
+ return 0;
+}
+
+AliHLTPHOSAgent::AliHLTPHOSRawDataHandler::AliHLTPHOSRawDataHandler()
+{
+ // see header file for class documentation
+}
+
+AliHLTPHOSAgent::AliHLTPHOSRawDataHandler::~AliHLTPHOSRawDataHandler()
+{
+ // see header file for class documentation
+}
+
+int AliHLTPHOSAgent::AliHLTPHOSRawDataHandler::ProcessData(AliHLTOUT* pData)
+{
+ // see header file for class documentation
+ if (!pData) return -EINVAL;
+
+ AliHLTPHOSMapper mapper;
+ mapper.InitDDLSpecificationMapping();
+
+ AliHLTComponentDataType dt = kAliHLTVoidDataType;
+ AliHLTUInt32_t spec=kAliHLTVoidDataSpec;
+ int iResult = pData->GetDataBlockDescription(dt, spec);
+ if (iResult>=0)
+ {
+ int ddl = -1;
+ if((ddl = mapper.GetDDLFromSpec(spec)) >=0)
+ {
+ iResult = ddl;
+ }
+ }
+ else
+ {
+ HLTError("Handler can not process data inconsistent with a single PHOS DDL from specification % d", spec);
+ iResult=-EBADMSG;
+ }
+ return iResult;
+}
--- /dev/null
+
+#ifndef ALIHLTPHOSAGENT_H
+#define ALIHLTPHOSAGENT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/** @file AliHLTPHOSAgent.h
+ @author Oystein Djuvsland
+ @date
+ @brief Agent of the libAliHLTPHOS library
+*/
+
+#include "AliHLTModuleAgent.h"
+#include "AliHLTOUTHandlerEquId.h"
+
+class AliHLTOUTHandlerChain;
+
+/**
+ * @class AliHLTPHOSAgent
+ * This is the agent for the AliHLTPHOS library.
+ *
+ * @ingroup alihlt_system
+ */
+class AliHLTPHOSAgent : public AliHLTModuleAgent {
+ public:
+ /**
+ * standard constructor. The agent is automatically registered in the
+ * global agent manager
+ */
+ AliHLTPHOSAgent();
+ /** destructor */
+ virtual ~AliHLTPHOSAgent();
+
+ /**
+ * Register all configurations belonging to this module with the
+ * AliHLTConfigurationHandler. The agent can adapt the configurations
+ * to be registered to the current AliRoot setup by checking the
+ * runloader.
+ * @param handler the configuration handler
+ * @param rawReader AliRawReader instance
+ * @param runloader AliRoot runloader
+ * @return neg. error code if failed
+ */
+ int CreateConfigurations(AliHLTConfigurationHandler* handler,
+ AliRawReader* rawReader=NULL,
+ AliRunLoader* runloader=NULL) const;
+
+ /**
+ * Get the top configurations belonging to this module.
+ * A top configuration describes a processing chain. It can simply be
+ * described by the last configuration(s) in the chain.
+ * The agent can adapt the configurations to be registered to the current
+ * AliRoot setup by checking the runloader.
+ * @param rawReader AliRawReader instance
+ * @param runloader AliRoot runloader
+ * @return number of configurations, neg. error code if failed
+ */
+ const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
+ AliRunLoader* runloader=NULL) const;
+
+ /**
+ * Component libraries which the configurations of this agent depend on.
+ * @return list of component libraries as a blank-separated string.
+ */
+ const char* GetRequiredComponentLibraries() const;
+
+ /**
+ * Register components for the AliHLTPHOS library.
+ * @param pHandler [in] instance of the component handler
+ */
+ int RegisterComponents(AliHLTComponentHandler* pHandler) const;
+
+ /**
+ * Get handler decription for PHOS data in the HLTOUT data stream.
+ * @param dt [in] data type of the block
+ * @param spec [in] specification of the block
+ * @param desc [out] handler description
+ * @return 1 if the agent can provide a handler, 0 if not
+ */
+ int GetHandlerDescription(AliHLTComponentDataType dt,
+ AliHLTUInt32_t spec,
+ AliHLTOUTHandlerDesc& desc) const;
+
+ /**
+ * Get specific handler for PHOS data in the HLTOUT data stream.
+ * @param dt [in] data type of the block
+ * @param spec [in] specification of the block
+ * @return pointer to handler
+ */
+ AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
+ AliHLTUInt32_t spec);
+
+ /**
+ * Delete an HLTOUT handler.
+ * @param pInstance pointer to handler
+ */
+ int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
+
+ /**
+ * The handler for PHOS RAW data in the HLTOUT stream.
+ */
+ class AliHLTPHOSRawDataHandler : public AliHLTOUTHandlerEquId {
+ public:
+ /** constructor */
+ AliHLTPHOSRawDataHandler();
+ /** destructor */
+ ~AliHLTPHOSRawDataHandler();
+
+ /**
+ * Process a data block.
+ * Decode specification and return equipment id of the data block.
+ * The data itsself i untouched.
+ * @return equipment id the block should be used for.
+ */
+ int ProcessData(AliHLTOUT* pData);
+
+ private:
+
+ };
+
+ protected:
+
+ private:
+ /** copy constructor prohibited */
+ AliHLTPHOSAgent(const AliHLTPHOSAgent&);
+ /** assignment operator prohibited */
+ AliHLTPHOSAgent& operator=(const AliHLTPHOSAgent&);
+
+ /** handler for PHOS raw data in the HLTOUT stream */
+ AliHLTPHOSRawDataHandler* fRawDataHandler; //!transient
+
+ ClassDef(AliHLTPHOSAgent, 1);
+};
+
+#endif
#include "AliHLTLogging.h"
using namespace PhosHLTConst;
-using namespace std;
+
//
// Base class for all PHOS HLT classes.
struct AliHLTPHOSCaloClusterHeaderStruct
{
- // Int_t fShmAddress;
- Short_t fNClusters;
+ Short_t fNClusters;
};
#endif
--- /dev/null
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * 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 "AliHLTPHOSCaloClusterReader.h"
+#include "AliHLTPHOSCaloClusterDataStruct.h"
+#include "AliHLTPHOSCaloClusterHeaderStruct.h"
+
+AliHLTPHOSCaloClusterReader::AliHLTPHOSCaloClusterReader():
+ fCurrentClusterPtr(0),
+ fIsSetMemory(false),
+ fMaxCnt(0),
+ fCurrentCnt(0)
+{
+ //See header file for documentation
+}
+
+
+AliHLTPHOSCaloClusterReader::~AliHLTPHOSCaloClusterReader()
+{
+ //See header file for documentation
+}
+
+
+AliHLTPHOSCaloClusterDataStruct*
+AliHLTPHOSCaloClusterReader::NextCluster()
+{
+ // See header file for documentation
+ AliHLTPHOSCaloClusterDataStruct* tmpChannelPtr = 0;
+ if(fIsSetMemory == false)
+ {
+ return 0;
+ }
+ if(fCurrentCnt < fMaxCnt)
+ {
+ //cout << "Reader: E = " << fCurrentClusterPtr->fEnergy << endl;
+ tmpChannelPtr = reinterpret_cast<AliHLTPHOSCaloClusterDataStruct*>(fCurrentClusterPtr);
+ fCurrentCnt++;
+ fCurrentClusterPtr = (AliHLTPHOSCaloClusterDataStruct*)((UChar_t*)fCurrentClusterPtr + sizeof(AliHLTPHOSCaloClusterDataStruct) + (fCurrentClusterPtr->fNCells-1)*(sizeof(Float_t) + sizeof(Short_t)));
+ return tmpChannelPtr;
+ }
+ else
+ {
+ Reset();
+ return 0;
+ }
+ return 0;
+}
+
+void
+AliHLTPHOSCaloClusterReader::SetMemory(AliHLTPHOSCaloClusterHeaderStruct* clusterHeaderPtr)
+{
+ //See header file for documentation
+ fMaxCnt = clusterHeaderPtr->fNClusters;
+ fCurrentClusterPtr = reinterpret_cast<AliHLTPHOSCaloClusterDataStruct*>((UChar_t*)(clusterHeaderPtr) + sizeof(AliHLTPHOSCaloClusterHeaderStruct));
+ fIsSetMemory = true;
+}
+
+
+void
+AliHLTPHOSCaloClusterReader::Reset()
+{
+ //See header file for documentation
+ fCurrentCnt = 0;
+ fIsSetMemory = false;
+}
--- /dev/null
+
+#ifndef ALIHLTPHOSCALOCLUSTERREADER_H
+#define ALIHLTPHOSCALOCLUSTERREADER_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 "Rtypes.h"
+#include "AliHLTPHOSBase.h"
+
+class AliHLTPHOSCaloClusterDataStruct;
+class AliHLTPHOSCaloClusterHeaderStruct;
+
+class AliHLTPHOSCaloClusterReader
+{
+ public:
+ AliHLTPHOSCaloClusterReader();
+ virtual ~AliHLTPHOSCaloClusterReader();
+ AliHLTPHOSCaloClusterDataStruct* NextCluster();
+ void SetMemory(AliHLTPHOSCaloClusterHeaderStruct* clusterHeaderPtr);
+ void Reset();
+
+ private:
+ AliHLTPHOSCaloClusterReader(const AliHLTPHOSCaloClusterReader & );
+ AliHLTPHOSCaloClusterReader & operator = (const AliHLTPHOSCaloClusterReader &);
+
+ /* Pointer to the current cluster to be read */
+ AliHLTPHOSCaloClusterDataStruct* fCurrentClusterPtr; // !transient Pointer to the current cluster to be read
+
+ /* Check if the memory has been set */
+ bool fIsSetMemory; //Check if the memory has been set
+
+ /* Max number of clusters */
+ int fMaxCnt; // Max number of clusters
+
+ /* The current number of clusters */
+ int fCurrentCnt; // The current number of clusters
+
+};
+
+#endif
#include "AliHLTPHOSCaloClusterHeaderStruct.h"
#include "AliHLTPHOSCaloClusterDataStruct.h"
#include "AliHLTPHOSPhysicsAnalyzer.h"
-#include "AliPHOSGeometry.h"
+#include "AliPHOSGeoUtils.h"
#include "TMath.h"
+#include "TVector3.h"
ClassImp(AliHLTPHOSClusterAnalyser);
fLogWeight = 4.5;
fAnalyzerPtr = new AliHLTPHOSPhysicsAnalyzer();
- fPHOSGeometry = AliPHOSGeometry::GetInstance("noCPV");
+ // fPHOSGeometry = AliPHOSGeometry::GetInstance("noCPV");
+ fPHOSGeometry = new AliPHOSGeoUtils("PHOS", "noCPV");
}
AliHLTPHOSClusterAnalyser::~AliHLTPHOSClusterAnalyser()
xi = digit->fX;
zi = digit->fZ;
- //cout << "COG digits (x:z:amp:time): " << xi << " : " << zi << " : " << digit->fEnergy << " : " << digit->fTime << endl;
+ // cout << "COG digits (x:z:E:time): " << xi << " : " << zi << " : " << digit->fEnergy << " : " << digit->fTime << endl;
if (recPoint->fAmp > 0 && digit->fEnergy > 0)
{
Float_t w = TMath::Max( 0., fLogWeight + TMath::Log( digit->fEnergy / recPoint->fAmp ) ) ;
UShort_t* cellIDPtr = &(caloClusterPtr->fCellsAbsId);
Float_t* cellAmpFracPtr = &(caloClusterPtr->fCellsAmpFraction);
- Float_t localPos[2];
-
- Float_t globalPos[3];
Int_t id = -1;
-
- //fPHOSGeometry = AliPHOSGeometry::GetInstance("noCPV");
+ TVector3 globalPos;
- for(Int_t i = 0; i < fNRecPoints; i++) //FIXME needs fix when we start unfolding (number of clusters not necessarily same as number of recpoints gotten from the clusterizer
+ for(Int_t i = 0; i < fNRecPoints; i++) //TODO needs fix when we start unfolding (number of clusters not necessarily same as number of recpoints gotten from the clusterizer
{
if(availableSize < (totSize + maxClusterSize))
{
return -1; //Might get out of buffer, exiting
}
- localPos[0] = recPointPtr->fX;
- localPos[1] = recPointPtr->fZ;
+ // localPos[0] = recPointPtr->fX;
+ // localPos[1] = recPointPtr->fZ;
+ // fAnalyzerPtr->GlobalPosition( localPos, globalPos, recPointPtr->fModule);
- fAnalyzerPtr->GlobalPosition( localPos, globalPos, recPointPtr->fModule);
+
+ // cout << "Local Position (x:z:module): " << recPointPtr->fX << " : "<< recPointPtr->fZ << " : " << recPointPtr->fModule << endl;
+ fPHOSGeometry->Local2Global(recPointPtr->fModule + 1, recPointPtr->fX, recPointPtr->fZ, globalPos);
+ // cout << "Global Position (x:y:z): " << globalPos[0] << " : "<< globalPos[1] << " : " << globalPos[2] << endl << endl;
caloClusterPtr->fGlobalPos[0] = globalPos[0];
caloClusterPtr->fGlobalPos[1] = globalPos[1];
caloClusterPtr->fGlobalPos[2] = globalPos[2];
- //cout << "Local Position (x:z:module): " << localPos[0] << " : "<< localPos[1] << " : " << recPointPtr->fModule << endl;
-
- //cout << "Global Position (x:y:z): " << globalPos[0] << " : "<< globalPos[1] << " : " << globalPos[2] << endl << endl;
-
caloClusterPtr->fNCells = recPointPtr->fMultiplicity;
cellIDPtr = &(caloClusterPtr->fCellsAbsId);
for(UInt_t j = 0; j < caloClusterPtr->fNCells; j++)
{
- // fPHOSGeometry->RelPosToAbsId((Int_t)(recPointPtr->fModule + 1), (double)(digitPtr->fX), (double)(digitPtr->fZ), id);
+ fPHOSGeometry->RelPosToAbsId((Int_t)(recPointPtr->fModule + 1), (double)(digitPtr->fX), (double)(digitPtr->fZ), id);
*cellIDPtr = id;
*cellAmpFracPtr = digitPtr->fEnergy/recPointPtr->fAmp;
digitPtr++;
}
caloClusterPtr->fEnergy = recPointPtr->fAmp;
-
+ // cout << "CA: Energy End: " << caloClusterPtr->fEnergy << endl;
if(fDoClusterFit)
{
FitCluster(recPointPtr);
}
caloClusterPtr->fClusterType = '\0';
- totSize += sizeof(AliHLTPHOSCaloClusterDataStruct) + (caloClusterPtr->fNCells)*(sizeof(Short_t) +sizeof(Float_t)-1);
+ // totSize += sizeof(AliHLTPHOSCaloClusterDataStruct) + (caloClusterPtr->fNCells)*(sizeof(Short_t) +sizeof(Float_t)-1);
+ totSize += sizeof(AliHLTPHOSCaloClusterDataStruct) + (caloClusterPtr->fNCells-1)*(sizeof(Short_t) + sizeof(Float_t));
- caloClusterPtr = reinterpret_cast<AliHLTPHOSCaloClusterDataStruct*>(cellAmpFracPtr);
+ // caloClusterPtr = reinterpret_cast<AliHLTPHOSCaloClusterDataStruct*>(cellAmpFracPtr);
+ caloClusterPtr = reinterpret_cast<AliHLTPHOSCaloClusterDataStruct*>(cellIDPtr);
recPointPtr = reinterpret_cast<AliHLTPHOSRecPointDataStruct*>(digitPtr);
digitPtr = &(recPointPtr->fDigits);
}
-
+ // cout << "CA: Energy End: " << fCaloClusterDataPtr->fEnergy << endl;
+ //cout << "CA totSize: " << totSize << endl;
return fNRecPoints;
}
class AliHLTPHOSRecPointDataStruct;
class AliHLTPHOSCaloClusterHeaderStruct;
class AliHLTPHOSCaloClusterDataStruct;
-class AliPHOSGeometry;
+class AliPHOSGeoUtils;
/**
* @class AliHLTPHOSClusterAnalyser
AliHLTPHOSCaloClusterHeaderStruct *fCaloClusterHeaderPtr; //! transient
/** Instance of the PHOS geometry */
- AliPHOSGeometry *fPHOSGeometry; //! transient
+ AliPHOSGeoUtils *fPHOSGeometry; //! transient
//TODO: should not use PhysicsAnalyzer for global coord!
/** */
#include "AliHLTPHOSClusterAnalyserComponent.h"
#include "AliHLTPHOSClusterAnalyser.h"
-#include "AliHLTPHOSRecPointContainerStruct.h"
+#include "AliHLTPHOSRecPointHeaderStruct.h"
#include "AliHLTPHOSCaloClusterDataStruct.h"
#include "AliHLTPHOSCaloClusterHeaderStruct.h"
{
//See headerfile for documentation
- return AliHLTPHOSDefinitions::fgkClusterDataType;
+ return AliHLTPHOSDefinitions::fgkCaloClusterDataType;
}
void
}
specification = specification|iter->fSpecification;
fClusterAnalyserPtr->SetRecPointDataPtr(reinterpret_cast<AliHLTPHOSRecPointHeaderStruct*>(iter->fPtr));
+ HLTDebug("Number of rec points: %d", (reinterpret_cast<AliHLTPHOSRecPointHeaderStruct*>(iter->fPtr))->fNRecPoints);
+
if(fDoDeconvolution)
{
fClusterAnalyserPtr->DeconvoluteClusters();
HLTError("Running out of buffer, exiting for safety.");
return -ENOBUFS;
}
+ for(int i = 0; i < nClusters; i++)
+ {
+
+ }
+
HLTDebug("Number of clusters: %d", nClusters);
caloClusterHeaderPtr->fNClusters = nClusters;
mysize += sizeof(AliHLTPHOSCaloClusterHeaderStruct);
void
AliHLTPHOSClusterizer::SetRecPointDataPtr(AliHLTPHOSRecPointDataStruct* recPointDataPtr)
{
+ // See header file for documentation
fRecPointDataPtr = recPointDataPtr;
}
fRecPointDataPtr->fAmp = 0;
fRecPointDataPtr->fModule = fDigitContainerPtr->fDigitDataStruct[i].fModule;
+
// Assigning digit data to the digit pointer
fRecPointDataPtr->fDigits = fDigitContainerPtr->fDigitDataStruct[i];
//see header file for documentation
if ( (digit1->fModule == digit2->fModule) /*&& (coord1[1]==coord2[1])*/ ) // inside the same PHOS module
{
- Int_t rowdiff = TMath::Abs( digit1->fZ - digit2->fZ );
- Int_t coldiff = TMath::Abs( digit1->fX - digit2->fX );
- if (( coldiff <= 1 && rowdiff < 1 ) || ( coldiff < 1 && rowdiff <= 1 ))
+// Int_t rowdiff = TMath::Abs( digit1->fZ - digit2->fZ );
+// Int_t coldiff = TMath::Abs( digit1->fX - digit2->fX );
+// if (( coldiff <= 1 && rowdiff == 0 ) || ( coldiff == 0 && rowdiff <= 1 ))
+// {
+// cout << "Are neighbours: digit (E = " << digit1->fEnergy << ") with x = " << digit1->fX << " and z = " << digit1->fZ <<
+// " is neighbour with digit (E = " << digit2->fEnergy << ") with x = " << digit2->fX << " and z = " << digit2->fZ << endl;
+
+// if(TMath::Abs(digit1->fTime - digit2->fTime ) < fEmcTimeGate)
+// {
+// return 1;
+// }
+// }
+
+ Float_t rowdiff = TMath::Abs( digit1->fZ - digit2->fZ );
+ Float_t coldiff = TMath::Abs( digit1->fX - digit2->fX );
+ if (( coldiff <= 2.4 && rowdiff < 0.4 ) || ( coldiff < 0.4 && rowdiff <= 2.4 ))
{
+ // cout << "Are neighbours: digit (E = " << digit1->fEnergy << ") with x = " << digit1->fX << " and z = " << digit1->fZ <<
+ // " is neighbour with digit (E = " << digit2->fEnergy << ") with x = " << digit2->fX << " and z = " << digit2->fZ << endl;
+
if(TMath::Abs(digit1->fTime - digit2->fTime ) < fEmcTimeGate)
{
return 1;
}
}
+ else
+ {
+ // cout << "Not neighbours: digit (E = " << digit1->fEnergy << ") with x = " << digit1->fX << " and z = " << digit1->fZ <<
+ // " is not neighbour with digit (E = " << digit2->fEnergy << ") with x = " << digit2->fX << " and z = " << digit2->fZ << endl;
+ }
}
return 0;
}
/** Maximum difference in index to be a neighbour */
Int_t fMaxDigitIndexDiff; //COMMENT
- ClassDef(AliHLTPHOSClusterizer, 1);
+ ClassDef(AliHLTPHOSClusterizer, 0);
};
#endif
using namespace std;
#endif
-const AliHLTComponentDataType AliHLTPHOSClusterizerComponent::fgkInputDataTypes[]=
- {
- kAliHLTVoidDataType,{0,"",""}
- };
+// const AliHLTComponentDataType AliHLTPHOSClusterizerComponent::fgkInputDataTypes[]=
+// {
+// kAliHLTVoidDataType,{0,"",""}
+// };
AliHLTPHOSClusterizerComponent gAliHLTPHOSClusterizerComponent;
AliHLTPHOSClusterizerComponent::GetComponentID()
{
//See headerfile for documentation
-
return "PhosClusterizer";
}
void
AliHLTPHOSClusterizerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
{
+ //See headerfile for documentation
list.clear();
list.push_back(AliHLTPHOSDefinitions::fgkDigitDataType);
}
{
//See headerfile for documentation
- UInt_t tSize = 0;
UInt_t offset = 0;
UInt_t mysize = 0;
Int_t nRecPoints = 0;
fAllDigitsPtr->fDigitDataStruct[j].fX = digitDataPtr->fX;
fAllDigitsPtr->fDigitDataStruct[j].fZ = digitDataPtr->fZ;
fAllDigitsPtr->fDigitDataStruct[j].fEnergy = digitDataPtr->fEnergy;
- // HLTDebug("Digit energy: %f", digitDataPtr->fEnergy);
+ //HLTDebug("Digit energy: %f", 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)
HLTDebug("Number of clusters: %d", nRecPoints);
- AliHLTComponentBlockData bd;
- FillBlockData( bd );
- bd.fOffset = offset;
- bd.fSize = mysize;
- bd.fDataType = AliHLTPHOSDefinitions::fgkClusterDataType;
- bd.fSpecification = specification;
- outputBlocks.push_back( bd );
-
- if ( tSize > size )
+// if(nRecPoints > 0)
+// {
+
+ AliHLTComponentBlockData clusterBd;
+ FillBlockData( clusterBd );
+ clusterBd.fOffset = offset;
+ clusterBd.fSize = mysize;
+ clusterBd.fDataType = AliHLTPHOSDefinitions::fgkRecPointDataType;
+ clusterBd.fSpecification = specification;
+ outputBlocks.push_back( clusterBd );
+// }
+
+ // if(fAllDigitsPtr->fNDigits)
+ if(false)
{
- Logging( kHLTLogFatal, "HLT::AliHLTPHOSClusterizerComponent::DoEvent", "Too much data",
- "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu."
- , tSize, size );
- return EMSGSIZE;
+ AliHLTComponentBlockData digitBd;
+ FillBlockData(digitBd);
}
-
+
+
size = mysize;
return 0;
* rec point
* @ingroup alihlt_phos
*/
+
+/**
+ * @class AliHLTPHOSClusterizerComponent
+ *
+ * Class for running clusterization for PHOS in HLT.
+ *
+ * <h2>General properties:</h2>
+ *
+ * Component ID: \b PhosClusterizer <br>
+ * Library: \b libAliHLTPHOS.so <br>
+ * Input Data Types: @ref AliHLTPHOSDefinitions::fgkDigitDataType<br>
+ * Output Data Types: @ref AliHLTPHOSDefinitions::fgkRecPointDataType<br>
+ *
+ * <h2>Mandatory arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li No mandatory arguments for component <br>
+ *
+ * <h2>Optional arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -digitthreshold <i> value </i> <br>
+ * threshold for a digit to be added to a rec point in GeV (default value: 0.03)
+ * \li -recpointthreshold <i> value </i> <br>
+ * threshold for starting a new rec point (default value: 0.2)
+ * \li -partitionmode
+ * if we want to do clusterisation on the partition level (not available...) (defaul value: false)
+ *
+ * <h2>Configuration:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li No configuration arguments
+ *
+ * <h2>Default CDB entries:</h2>
+ * \li No CDB entry yet, will come.
+ *
+ * <h2>Performance:</h2>
+ * Pretty good (~ 3 kHz), depends on amount of data...
+ *
+ * <h2>Memory consumption:</h2>
+ * Depends on the amount of data, but pretty godd
+ *
+ * <h2>Output size:</h2>
+ * Depends on the amount of data...
+ *
+ * More detailed description. (At some point...)
+ *
+ * @ingroup alihlt_phos
+ */
+
class AliHLTPHOSClusterizerComponent: public AliHLTPHOSProcessor
{
public:
Bool_t fNoCrazyness; //COMMENT
/** interface function, see @ref AliHLTComponent for description */
- static const AliHLTComponentDataType fgkInputDataTypes[]; //COMMENT
+ // static const AliHLTComponentDataType fgkInputDataTypes[]; //COMMENT
};
#endif
const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkSandboxDataType = { sizeof(AliHLTComponentDataType), {'S','A','N','D','B','O','X','T'},{'P','H','O','S'}};;
const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkEmcCalibDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','I','T','Y','P','E'},{'P','H','O','S'}};;
const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkCaloClusterDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','C','L','U','S','T'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkESDCaloClusterDataType = { sizeof(AliHLTComponentDataType), {'E','S','D','C','L','U','S','T'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkESDCaloCellsDataType = { sizeof(AliHLTComponentDataType), {'E','S','D','C','E','L','L','S'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType = { sizeof(AliHLTComponentDataType), {'P','H','Y','S','H','I','S','T'},{'P','H','O','S'}};;
static const AliHLTComponentDataType fgkSandboxDataType; //General data type
static const AliHLTComponentDataType fgkEmcCalibDataType; //Calibration data type
static const AliHLTComponentDataType fgkCaloClusterDataType; //Calo cluster data type
+ static const AliHLTComponentDataType fgkESDCaloClusterDataType; //Calo cluster data type
+ static const AliHLTComponentDataType fgkESDCaloCellsDataType; //Calo cells data type
+ static const AliHLTComponentDataType fgkPhysicsHistogramsDataType; //hist data type
+
};
#endif
#include "AliHLTPHOSChannelDataHeaderStruct.h"
#include "AliHLTPHOSDigitDataStruct.h"
#include "AliHLTPHOSSharedMemoryInterfacev2.h" // added by PTH
-
+#include "AliPHOSEMCAGeometry.h"
#include "TH2F.h"
ClassImp(AliHLTPHOSDigitMaker);
}
}
fMapperPtr = new AliHLTPHOSMapper();
-
}
AliHLTPHOSDigitMaker::~AliHLTPHOSDigitMaker()
UShort_t coord1[4];
UShort_t coord2[4];
+ Float_t locCoord[3];
AliHLTPHOSChannelDataStruct* currentchannel = 0;
if(currentchannel->fEnergy < MAXBINVALUE) // Make sure we don't have signal overflow
{
-
- AddDigit(currentchannel, coord1);
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(currentchannel, coord1, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
else // Ooops, overflow, we try the next channel...
{
+
currentchannel = fShmPtr->NextChannel();
if(currentchannel != 0) // There was a next channel
{
AliHLTPHOSMapper::GetChannelCoord(currentchannel->fChannelID, coord2);
if(coord2[0] == coord1[0] && coord2[1] == coord1[1]) // It is a low gain channel with the same coordinates, we may use it
{
-
- AddDigit(currentchannel, coord2);
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(currentchannel, coord2, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
currentchannel = fShmPtr->NextChannel();
else // No low gain channel with information about the overflow channel so we just use the overflowed one...
{
- AddDigit(tmpchannel, coord1);
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(tmpchannel, coord1, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
// no need to get the next channel here, we already did...
}
}
else // Well, there seem to be missing a high gain channel for this crystal, let's use the low gain one
- {
- AddDigit(tmpchannel, coord1);
+ {
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(tmpchannel, coord1, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
currentchannel = fShmPtr->NextChannel();
{
if(currentchannel->fEnergy < MAXBINVALUE) // To overflow or not to overflow?
{
-
- AddDigit(currentchannel, coord2);
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(currentchannel, coord2, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
currentchannel = fShmPtr->NextChannel();
}
else // Oh well, better use the low gain channel then
{
- AddDigit(currentchannelLG, coord1);
+ // cout << "Reverse: Overflow!" << endl;
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(currentchannelLG, coord1, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
currentchannel = fShmPtr->NextChannel();
}
else // No available high gain channel for this crystal, adding the low gain one
{
- AddDigit(currentchannelLG, coord1);
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(currentchannelLG, coord1, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
}
}
else //Fine, no more channels, better add this one...
{
- AddDigit(currentchannelLG, coord1);
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(currentchannelLG, coord1, locCoord);
j++;
totSize += sizeof(AliHLTPHOSDigitDataStruct);
}
}
else // Cool, no annoying low gain channel for this channel
{
- AddDigit(currentchannel, coord1);
+ AliHLTPHOSMapper::GetLocalCoord(currentchannel->fChannelID, locCoord);
+ AddDigit(currentchannel, coord1, locCoord);
j++;
currentchannel = fShmPtr->NextChannel();
}
* @param channelData is the channel data
* @param coordinates is the coordinates of the channel, including gain and module
*/
- void AddDigit(AliHLTPHOSChannelDataStruct* channelData, UShort_t* coordinates)
+ void AddDigit(AliHLTPHOSChannelDataStruct* channelData, UShort_t* channelCoordinates, Float_t* localCoordinates)
{
- fDigitStructPtr->fX = coordinates[0];
- fDigitStructPtr->fZ = coordinates[1];
- if(coordinates[2] == HIGHGAIN)
- fDigitStructPtr->fAmplitude = channelData->fEnergy*fHighGainFactors[coordinates[0]][coordinates[1]];
+ fDigitStructPtr->fX = localCoordinates[0];
+ fDigitStructPtr->fZ = localCoordinates[1];
+ if(channelCoordinates[2] == HIGHGAIN)
+ {
+ fDigitStructPtr->fEnergy = channelData->fEnergy*fHighGainFactors[channelCoordinates[0]][channelCoordinates[1]];
+ }
else
- fDigitStructPtr->fAmplitude = channelData->fEnergy*fLowGainFactors[coordinates[0]][coordinates[1]];
- fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //CRAP
+ {
+ fDigitStructPtr->fEnergy = channelData->fEnergy*fLowGainFactors[channelCoordinates[0]][channelCoordinates[1]];
+ }
+ fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //TODO
fDigitStructPtr->fCrazyness = channelData->fCrazyness;
- fDigitStructPtr->fModule = coordinates[3];
+ fDigitStructPtr->fModule = channelCoordinates[3];
fDigitStructPtr++;
}
/** Bad channel mask */
Float_t fBadChannelMask[NXCOLUMNSMOD][NZROWSMOD][NGAINS]; //COMMENT
- ClassDef(AliHLTPHOSDigitMaker, 1);
+
+ ClassDef(AliHLTPHOSDigitMaker, 0);
};
-// $Id$
+ // $Id$
/**************************************************************************
* This file is property of and copyright by the ALICE HLT Project *
std::vector<AliHLTComponentBlockData>& outputBlocks)
{
//see header file for documentation
- UInt_t tSize = 0;
UInt_t offset = 0;
UInt_t mysize = 0;
Int_t digitCount = 0;
digitCount += ret;
}
- mysize = digitCount*sizeof(AliHLTPHOSDigitDataStruct);
+ mysize += digitCount*sizeof(AliHLTPHOSDigitDataStruct);
HLTDebug("# of digits: %d, used memory size: %d, available size: %d", digitCount, mysize, size);
-
- AliHLTComponentBlockData bd;
- FillBlockData( bd );
- bd.fOffset = offset;
- bd.fSize = mysize;
- bd.fDataType = AliHLTPHOSDefinitions::fgkDigitDataType;
- bd.fSpecification = specification;
- outputBlocks.push_back(bd);
-
- if( tSize > size )
+
+
+ if(mysize > 0)
{
- Logging( kHLTLogFatal, "HLT::AliHLTPHOSDigitMakerComponent::DoEvent", "Too much data", "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.", tSize, size );
- return EMSGSIZE;
+ AliHLTComponentBlockData bd;
+ FillBlockData( bd );
+ bd.fOffset = offset;
+ bd.fSize = mysize;
+ bd.fDataType = AliHLTPHOSDefinitions::fgkDigitDataType;
+ bd.fSpecification = specification;
+ outputBlocks.push_back(bd);
}
-
fDigitMakerPtr->Reset();
size = mysize;
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * 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 AliHLTPHOSESDCaloClusterMaker.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief ESD Calo Cluster maker for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSESDCaloClusterMaker.h"
+#include "AliHLTPHOSCaloClusterHeaderStruct.h"
+#include "AliHLTPHOSBase.h"
+#include "AliHLTPHOSCaloClusterDataStruct.h"
+#include "AliESDCaloCluster.h"
+#include "TClonesArray.h"
+#include "AliHLTPHOSCaloClusterReader.h"
+#include "TH1F.h"
+#include "TFile.h"
+#include "TNtuple.h"
+
+ClassImp(AliHLTPHOSESDCaloClusterMaker);
+
+
+
+AliHLTPHOSESDCaloClusterMaker::AliHLTPHOSESDCaloClusterMaker() :
+ AliHLTPHOSBase(),
+ fNCaloClusters(0),
+ fClusterReaderPtr(0),
+ fESDCaloClusterPtr(0)
+{
+ //See header file for documentation
+ fClusterReaderPtr = new AliHLTPHOSCaloClusterReader();
+ fESDCaloClusterPtr = new AliESDCaloCluster();
+
+}
+
+AliHLTPHOSESDCaloClusterMaker::~AliHLTPHOSESDCaloClusterMaker()
+{
+ //See header file for documentation
+
+}
+
+Int_t
+AliHLTPHOSESDCaloClusterMaker::FillESDCaloClusters(TClonesArray* esdClustersPtr, AliHLTPHOSCaloClusterHeaderStruct* caloClusterHeaderPtr)
+{
+ //See header file for documentation
+
+ // AliESDCaloCluster* caloCluster = 0;
+ AliHLTPHOSCaloClusterDataStruct* caloClusterStructPtr = 0;
+ fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
+
+ // fESDCaloClusterPtr = new AliESDCaloCluster();
+ // fNCaloClusters = 0;
+ fNCaloClusters = esdClustersPtr->GetEntries();
+ int count = 0;
+ while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0)
+ {
+ new((*esdClustersPtr)[fNCaloClusters]) AliESDCaloCluster();
+ fESDCaloClusterPtr = static_cast<AliESDCaloCluster*>((*esdClustersPtr)[fNCaloClusters]);
+
+ fESDCaloClusterPtr->SetID(caloClusterStructPtr->fID);
+ fESDCaloClusterPtr->SetClusterType(caloClusterStructPtr->fClusterType);
+ fESDCaloClusterPtr->SetPosition((Float_t*)&caloClusterStructPtr->fGlobalPos[0]);
+ fESDCaloClusterPtr->SetE(caloClusterStructPtr->fEnergy);
+ fESDCaloClusterPtr->SetTOF(caloClusterStructPtr->fTOF);
+ fESDCaloClusterPtr->SetClusterDisp(caloClusterStructPtr->fDispersion);
+ fESDCaloClusterPtr->SetClusterChi2(caloClusterStructPtr->fFitQuality);
+ fESDCaloClusterPtr->SetPid((Float_t*)&caloClusterStructPtr->fPID[0]);
+ fESDCaloClusterPtr->SetM20(caloClusterStructPtr->fM20);
+ fESDCaloClusterPtr->SetM02(caloClusterStructPtr->fM02);
+ fESDCaloClusterPtr->SetNExMax(caloClusterStructPtr->fNExMax);
+ fESDCaloClusterPtr->SetEmcCpvDistance(caloClusterStructPtr->fEmcCpvDistance);
+ fESDCaloClusterPtr->SetDistanceToBadChannel(caloClusterStructPtr->fDistToBadChannel);
+ fESDCaloClusterPtr->SetNCells(caloClusterStructPtr->fNCells);
+ // fESDCaloClusterPtr->SetCellsAbsId(caloClusterStructPtr->fCellsAbsId);
+ // fESDCaloClusterPtr->SetCellsAmplitudeFraction(caloClusterStructPtr->fCellsAmpFraction);
+ fNCaloClusters++;
+ count++;
+ }
+ // delete fESDCaloClusterPtr;
+ return count;
+
+}
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * 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 ALIHLTPHOSESDCALOCLUSTERMAKER_H
+#define ALIHLTPHOSESDCALOCLUSTERMAKER_H
+
+/**
+ * Class writes ESDs
+ *
+ * @file AliHLTPHOSESDCaloClusterMaker.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief ESD writer for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSBase.h"
+
+class AliHLTPHOSCaloClusterHeaderStruct;
+class AliHLTPHOSCaloClusterReader;
+class TClonesArray;
+class AliESDCaloCluster;
+
+/**
+ * @class AliHLTPHOSESDCaloClusterMaker
+ * Makes ESD Clusters out of AliHLTPHOSCaloClusterContainerStructs
+ * @ingroup alihlt_phos
+ */
+
+class AliHLTPHOSESDCaloClusterMaker : public AliHLTPHOSBase
+{
+
+ public:
+
+
+ /** Constructor */
+ AliHLTPHOSESDCaloClusterMaker();
+
+ /** Destructor */
+ virtual ~AliHLTPHOSESDCaloClusterMaker();
+
+ /** Copy constructor */
+ AliHLTPHOSESDCaloClusterMaker(const AliHLTPHOSESDCaloClusterMaker &) :
+ AliHLTPHOSBase(),
+ fNCaloClusters(0),
+ fClusterReaderPtr(0),
+ fESDCaloClusterPtr(0)
+ {
+ //Copy constructor not implemented
+ }
+
+ /** Assignment */
+ AliHLTPHOSESDCaloClusterMaker & operator = (const AliHLTPHOSESDCaloClusterMaker)
+ {
+ //Assignment
+ return *this;
+ }
+
+ /**
+ * Create AliESDCaloClusters from the AliHLTPHOSCaloClusterContainerStruct
+ * @return number of clusters created
+ */
+ Int_t FillESDCaloClusters(TClonesArray* esdClusters, AliHLTPHOSCaloClusterHeaderStruct* clusterContainer);
+
+ private:
+
+ /* Number of clusters */
+ Int_t fNCaloClusters; // Number of clusters
+
+ /* The reader */
+ AliHLTPHOSCaloClusterReader* fClusterReaderPtr; // !transient The reader
+
+ /* An ESD Calo Cluster */
+ AliESDCaloCluster* fESDCaloClusterPtr; // !transient An ESD Calo Cluster
+
+ ClassDef(AliHLTPHOSESDCaloClusterMaker, 0);
+};
+
+#endif
--- /dev/null
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Authors: Oystein Djuvsland <oysteind@ift.uib.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 <iostream>
+
+#include "AliHLTPHOSESDCaloClusterMakerComponent.h"
+#include "AliHLTPHOSESDCaloClusterMaker.h"
+#include "AliHLTPHOSCaloClusterContainerStruct.h"
+#include "AliESDEvent.h"
+#include "AliHLTPHOSDefinitions.h"
+#include "AliHLTDataTypes.h"
+#include "AliESDCaloCluster.h"
+
+/** @file AliHLTPHOSESDCaloClusterMakerComponent.cxx
+ @author Oystein Djuvsland
+ @date
+ @brief An ESD maker component for PHOS HLT
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+
+AliHLTPHOSESDCaloClusterMakerComponent::AliHLTPHOSESDCaloClusterMakerComponent():
+ AliHLTPHOSProcessor(),
+ fESDCaloClusterMakerPtr(0),
+ fESDCaloClustersPtr(0)
+{
+ //See headerfile for documentation
+}
+
+AliHLTPHOSESDCaloClusterMakerComponent::~AliHLTPHOSESDCaloClusterMakerComponent()
+{
+ //See headerfile for documentation
+
+ if (fESDCaloClusterMakerPtr)
+ {
+ delete fESDCaloClusterMakerPtr;
+ fESDCaloClusterMakerPtr = 0;
+ }
+}
+
+
+int
+AliHLTPHOSESDCaloClusterMakerComponent::Deinit()
+{
+ //See headerfile for documentation
+
+ if (fESDCaloClusterMakerPtr)
+ {
+ delete fESDCaloClusterMakerPtr;
+ fESDCaloClusterMakerPtr = 0;
+ }
+ return 0;
+}
+
+const Char_t*
+AliHLTPHOSESDCaloClusterMakerComponent::GetComponentID()
+{
+ //See headerfile for documentation
+
+ return "PhosEsdCaloClusterMaker";
+}
+
+void
+AliHLTPHOSESDCaloClusterMakerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+ //See headerfile for documentation
+ list.clear();
+ list.push_back(AliHLTPHOSDefinitions::fgkCaloClusterDataType);
+// const AliHLTComponentDataType* pType=fgkInputDataTypes;
+// while (pType->fID!=0)
+// {
+// list.push_back(*pType);
+// pType++;
+// }
+}
+
+AliHLTComponentDataType
+AliHLTPHOSESDCaloClusterMakerComponent::GetOutputDataType()
+{
+ //See headerfile for documentation
+
+ return AliHLTPHOSDefinitions::fgkCaloClusterDataType;
+}
+
+void
+AliHLTPHOSESDCaloClusterMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+
+{
+ //See headerfile for documentation
+
+ constBase = 30;
+ inputMultiplier = 2;
+}
+
+Int_t
+AliHLTPHOSESDCaloClusterMakerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ )
+{
+
+ // see header file for class documentation
+
+// fESDCaloClustersPtr->Delete();
+// AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr = 0;
+
+// const AliHLTComponentBlockData* iter = 0;
+
+// UInt_t specification = 0;
+
+// for ( iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkCaloClusterDataType); iter != 0; iter = GetNextInputBlock())
+// {
+// specification = specification|iter->fSpecification;
+// caloClusterContainerPtr = reinterpret_cast<AliHLTPHOSCaloClusterContainerStruct*>(iter->fPtr);
+// fESDCaloClusterMakerPtr->FillESDCaloClusters(fESDCaloClustersPtr, caloClusterContainerPtr);
+// // fESDCaloClusterMakerPtr->SetCaloClusterContainer(caloClusterContainerPtr);
+// }
+
+// PushBack(fESDCaloClustersPtr, AliHLTPHOSDefinitions::fgkESDCaloClusterDataType|kAliHLTDataOriginPHOS, specification);
+
+ return 0;
+}
+
+
+int
+AliHLTPHOSESDCaloClusterMakerComponent::DoInit(int argc, const char** argv )
+{
+ //See headerfile for documentation
+
+// fESDCaloClusterMakerPtr = new AliHLTPHOSESDCaloClusterMaker();
+
+// fESDCaloClustersPtr = new TClonesArray("AliESDCaloCluster", 0);
+
+// ScanArgumentsModule(argc, argv);
+// for (int i = 0; i < argc; i++)
+// {
+
+// }
+
+ return 0;
+}
+
+AliHLTComponent*
+AliHLTPHOSESDCaloClusterMakerComponent::Spawn()
+{
+ //See headerfile for documentation
+
+ return new AliHLTPHOSESDCaloClusterMakerComponent();
+}
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * 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 ALIHLTPHOSESDCALOCLUSTERMAKERCOMPONENT_H
+#define ALIHLTPHOSESDCALOCLUSTERMAKERCOMPONENT_H
+
+
+
+
+/**
+ * ESD maker component for PHOS HLT
+ *
+ * @file AliHLTPHOSESDCaloClusterMakerComponent.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief An ESD maker component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSProcessor.h"
+
+class AliHLTPHOSESDCaloClusterMaker;
+class AliHLTPHOSCaloClusterContainerStruct;
+class TClonesArray;
+
+/**
+ * @class AliHLTPHOSESDCaloClusterMakerComponent
+ *
+ * HLT component for making AliESDEvent from AliHLTPHOSCaloClusterDataStructs
+ *
+ * @ingroup alihlt_phos
+ */
+class AliHLTPHOSESDCaloClusterMakerComponent: public AliHLTPHOSProcessor
+{
+ public:
+
+ /** Constructor */
+
+ AliHLTPHOSESDCaloClusterMakerComponent();
+
+ /** Destructor */
+ virtual ~AliHLTPHOSESDCaloClusterMakerComponent();
+
+ /** Copy constructor */
+ AliHLTPHOSESDCaloClusterMakerComponent(const AliHLTPHOSESDCaloClusterMakerComponent &) :
+ AliHLTPHOSProcessor(),
+ fESDCaloClusterMakerPtr(0),
+ fESDCaloClustersPtr(0)
+ {
+ //Copy constructor not implemented
+ }
+
+ /** Assignment */
+ AliHLTPHOSESDCaloClusterMakerComponent & operator = (const AliHLTPHOSESDCaloClusterMakerComponent)
+ {
+ //Assignment
+ return *this;
+ }
+
+ /** interface function, see @ref AliHLTComponent for description */
+ const char* GetComponentID();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponentDataType GetOutputDataType();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ using AliHLTPHOSProcessor::DoEvent;
+ Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponent* Spawn();
+
+protected:
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int DoInit(int argc, const char** argv);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int Deinit();
+
+private:
+
+ /** Pointer to the ESD maker it self */
+ AliHLTPHOSESDCaloClusterMaker* fESDCaloClusterMakerPtr; //! transient
+
+ /** Pointer to the ESD calo cluster array*/
+ TClonesArray* fESDCaloClustersPtr; //! transient
+
+};
+
+
+#endif
+
--- /dev/null
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Authors: Oystein Djuvsland <oysteind@ift.uib.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 <iostream>
+
+#include "AliHLTPHOSESDCaloClusterWriterComponent.h"
+#include "AliESDCaloCluster.h"
+#include "TTree.h"
+#include "TClonesArray.h"
+#include "TFile.h"
+
+/** @file AliHLTPHOSESDCaloClusterWriterComponent.cxx
+ @author Oystein Djuvsland
+ @date
+ @brief An ESD calo cluster writer component for PHOS HLT
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+AliHLTPHOSESDCaloClusterWriterComponent gAliHLTPHOSESDCaloClusterWriterComponent;
+
+AliHLTPHOSESDCaloClusterWriterComponent::AliHLTPHOSESDCaloClusterWriterComponent():
+ AliHLTPHOSProcessor(),
+ fOutfile(0),
+ fOutfileName(0),
+ fWriteModulo(1000),
+ fESDCaloClusterTreePtr(0),
+ fESDCaloClustersPtr(0)
+{
+ //See headerfile for documentation
+}
+
+AliHLTPHOSESDCaloClusterWriterComponent::~AliHLTPHOSESDCaloClusterWriterComponent()
+{
+ //See headerfile for documentation
+
+ if(fESDCaloClustersPtr)
+ {
+ fESDCaloClustersPtr->Write();
+ delete fESDCaloClustersPtr;
+ fESDCaloClustersPtr = 0;
+ }
+ if (fOutfile)
+ {
+ fOutfile->Close();
+ delete fOutfile;
+ fOutfile = 0;
+ }
+}
+
+
+int
+AliHLTPHOSESDCaloClusterWriterComponent::Deinit()
+{
+ //See headerfile for documentation
+
+ if(fESDCaloClustersPtr)
+ {
+ fESDCaloClustersPtr->Write();
+ delete fESDCaloClustersPtr;
+ fESDCaloClustersPtr = 0;
+ }
+ if (fOutfile)
+ {
+ fOutfile->Close();
+ delete fOutfile;
+ fOutfile = 0;
+ }
+ return 0;
+}
+
+const Char_t*
+AliHLTPHOSESDCaloClusterWriterComponent::GetComponentID()
+{
+ //See headerfile for documentation
+
+ return "PhosEsdCaloClusterWriter";
+}
+
+void
+AliHLTPHOSESDCaloClusterWriterComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+ //See headerfile for documentation
+ list.clear();
+ list.push_back(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
+
+}
+
+AliHLTComponentDataType
+AliHLTPHOSESDCaloClusterWriterComponent::GetOutputDataType()
+{
+ //See headerfile for documentation
+ return kAliHLTAnyDataType;
+}
+
+void
+AliHLTPHOSESDCaloClusterWriterComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+
+{
+ //See headerfile for documentation
+
+ constBase = 30;
+ inputMultiplier = 2;
+}
+
+Int_t
+AliHLTPHOSESDCaloClusterWriterComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ )
+{
+ // see header file for class documentation
+
+ const TObject* iter = 0;
+ // const AliHLTComponentBlockData* iter = 0;
+
+ //UInt_t specification = 0;
+ // iter = GetFirstInputObject(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
+ //cout << iter << endl;
+ for(iter = GetFirstInputObject(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType); iter != NULL; iter = GetNextInputObject())
+ {
+
+
+ //fESDCaloClustersPtr->AddAll(reinterpret_cast<const TClonesArray*>(iter));
+ fESDCaloClustersPtr = reinterpret_cast<TClonesArray*>(const_cast<TObject*>(iter)->Clone());
+
+ }
+
+
+
+ // iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
+
+// if(iter)
+// {
+// specification = specification|iter->fSpecification;
+// cout << (reinterpret_cast<TClonesArray*>(iter->fPtr))->GetEntries() << endl;
+// // fESDCaloClustersPtr->AddAll(reinterpret_cast<TClonesArray*>(iter->fPtr));
+// while((iter = GetNextInputBlock()))
+// {
+// // fESDCaloClustersPtr->AddAll(reinterpret_cast<TClonesArray*>(iter->fPtr));
+// }
+
+// }
+// HLTError("Number of clusters: %d", fESDCaloClustersPtr->GetEntries());
+ fESDCaloClusterTreePtr->Fill();
+
+ fPhosEventCount++;
+
+ if(fPhosEventCount % fWriteModulo == 0)
+ {
+ WriteTree();
+ }
+
+ //fESDCaloClustersPtr->Delete();
+
+ return 0;
+}
+
+int
+AliHLTPHOSESDCaloClusterWriterComponent::WriteTree()
+{
+
+ // See headerfile for documentation
+ char tmpFilename[128];
+ sprintf(tmpFilename, "%s_%d.root", fOutfileName, fPhosEventCount/fWriteModulo);
+
+ fOutfile = TFile::Open(tmpFilename, "RECREATE");
+ if(fOutfile == 0)
+ {
+ HLTError("Could not open file %s for writing", tmpFilename);
+ return -1;
+ }
+ fESDCaloClusterTreePtr->Write();
+ fOutfile->Close();
+ fESDCaloClusterTreePtr->Reset();
+ return 0;
+}
+
+int
+AliHLTPHOSESDCaloClusterWriterComponent::DoInit(int argc, const char** argv )
+{
+ //See headerfile for documentation
+ fOutfileName = new char[128];
+ char tmpFilename[128];
+ ScanArgumentsModule(argc, argv);
+ for (int i = 0; i < argc; i++)
+ {
+ if(!strcmp("-filename", argv[i]))
+ {
+ sprintf(fOutfileName, "/tmp/%s", argv[i+1]);
+ sprintf(tmpFilename, "%s_0.root", fOutfileName);
+ }
+ if(!strcmp("-writemodulo", argv[i]))
+ {
+ fWriteModulo = atoi(argv[i+1]);
+ }
+ }
+ // fESDCaloClustersPtr = new TClonesArray(AliESDCaloCluster::Class(), 0);
+ fESDCaloClusterTreePtr = new TTree("caloClusterTree", "Tree containing AliESDCaloClusters reconstructed in HLT");
+ fESDCaloClusterTreePtr->Branch("CaloClusters", &fESDCaloClustersPtr);
+
+ //fESDCaloClusterTreePtr->SetBranchAddress("CaloClusters", &fESDCaloClustersPtr);
+
+ return 0;
+}
+
+AliHLTComponent*
+AliHLTPHOSESDCaloClusterWriterComponent::Spawn()
+{
+ //See headerfile for documentation
+
+ return new AliHLTPHOSESDCaloClusterWriterComponent();
+}
+
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * 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 ALIHLTPHOSESDCALOCLUSTERWRITERCOMPONENT_H
+#define ALIHLTPHOSESDCALOCLUSTERWRITERCOMPONENT_H
+
+/**
+ * ESD Calo cluster writer component for PHOS HLT
+ *
+ * @file AliHLTPHOSESDCaloClusterWriterComponent.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief An ESD maker component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSProcessor.h"
+
+class TClonesArray;
+class TTree;
+class TFile;
+/**
+ * @class AliHLTPHOSESDCaloClusterWriterComponent
+ *
+ * HLT component for making AliESDEvent from AliHLTPHOSCaloClusterDataStructs
+ *
+ * @ingroup alihlt_phos
+ */
+class AliHLTPHOSESDCaloClusterWriterComponent: public AliHLTPHOSProcessor
+{
+ public:
+
+ /** Constructor */
+
+ AliHLTPHOSESDCaloClusterWriterComponent();
+
+ /** Destructor */
+ virtual ~AliHLTPHOSESDCaloClusterWriterComponent();
+
+ /** Copy constructor */
+ AliHLTPHOSESDCaloClusterWriterComponent(const AliHLTPHOSESDCaloClusterWriterComponent &) :
+ AliHLTPHOSProcessor(),
+ fOutfile(0),
+ fOutfileName(0),
+ fWriteModulo(1000),
+ fESDCaloClusterTreePtr(0),
+ fESDCaloClustersPtr(0)
+ {
+ //Copy constructor not implemented
+ }
+
+ /** Assignment */
+ AliHLTPHOSESDCaloClusterWriterComponent & operator = (const AliHLTPHOSESDCaloClusterWriterComponent)
+ {
+ //Assignment
+ return *this;
+ }
+
+ /** interface function, see @ref AliHLTComponent for description */
+ const char* GetComponentID();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponentDataType GetOutputDataType();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ using AliHLTPHOSProcessor::DoEvent;
+ Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponent* Spawn();
+
+ /** Function for writing the tree containing the clusters */
+ int WriteTree();
+
+protected:
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int DoInit(int argc, const char** argv);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int Deinit();
+
+private:
+
+
+ /** The file to which we will write */
+ TFile* fOutfile;
+
+ /** The filename */
+ char* fOutfileName;
+
+ /** Write modulo */
+ UInt_t fWriteModulo;
+
+ /** Pointer to the ESD calo cluster tree*/
+ TTree* fESDCaloClusterTreePtr; //! transient
+
+ /** Pointer to the array of clusters */
+ TClonesArray* fESDCaloClustersPtr; //! transient
+
+
+};
+
+
+#endif
--- /dev/null
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Authors: Oystein Djuvsland <oysteind@ift.uib.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 <iostream>
+
+#include "AliHLTPHOSESDEntriesMakerComponent.h"
+#include "AliHLTPHOSESDCaloClusterMaker.h"
+#include "AliHLTPHOSCaloClusterHeaderStruct.h"
+#include "AliHLTPHOSDigitDataStruct.h"
+#include "AliESDEvent.h"
+#include "AliHLTPHOSDefinitions.h"
+#include "AliHLTDataTypes.h"
+#include "AliESDCaloCluster.h"
+
+/** @file AliHLTPHOSESDEntriesMakerComponent.cxx
+ @author Oystein Djuvsland
+ @date
+ @brief An ESD entries maker component for PHOS HLT
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+AliHLTPHOSESDEntriesMakerComponent gAliHLTPHOSESDEntriesMakerComponent;
+
+AliHLTPHOSESDEntriesMakerComponent::AliHLTPHOSESDEntriesMakerComponent():
+ AliHLTPHOSProcessor(),
+ fESDCaloClusterMakerPtr(0),
+ fESDCaloClustersPtr(0)
+{
+ //See headerfile for documentation
+}
+
+AliHLTPHOSESDEntriesMakerComponent::~AliHLTPHOSESDEntriesMakerComponent()
+{
+ //See headerfile for documentation
+ if (fESDCaloClusterMakerPtr)
+ {
+ delete fESDCaloClusterMakerPtr;
+ fESDCaloClusterMakerPtr = 0;
+ }
+}
+
+int
+AliHLTPHOSESDEntriesMakerComponent::Deinit()
+{
+ //See headerfile for documentation
+ if (fESDCaloClusterMakerPtr)
+ {
+ delete fESDCaloClusterMakerPtr;
+ fESDCaloClusterMakerPtr = 0;
+ }
+ return 0;
+}
+
+const Char_t*
+AliHLTPHOSESDEntriesMakerComponent::GetComponentID()
+{
+ //See headerfile for documentation
+ return "PhosEsdEntriesMaker";
+}
+
+void
+AliHLTPHOSESDEntriesMakerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+ //See headerfile for documentation
+ list.clear();
+ list.push_back(AliHLTPHOSDefinitions::fgkCaloClusterDataType);
+}
+
+AliHLTComponentDataType
+AliHLTPHOSESDEntriesMakerComponent::GetOutputDataType()
+{
+ //See headerfile for documentation
+ return AliHLTPHOSDefinitions::fgkESDCaloClusterDataType;
+}
+
+void
+AliHLTPHOSESDEntriesMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+
+{
+ //See headerfile for documentation
+ constBase = 30;
+ inputMultiplier = 2;
+}
+
+Int_t
+AliHLTPHOSESDEntriesMakerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ )
+{
+
+ // see header file for class documentation
+
+ fESDCaloClustersPtr->Delete();
+ //fESDCaloClustersPtr = new TClonesArray(AliESDCaloCluster::Class(), 10);
+ AliHLTPHOSCaloClusterHeaderStruct* caloClusterHeaderPtr = 0;
+
+ const AliHLTComponentBlockData* iter = 0;
+ UInt_t nClusters = 0;
+
+ UInt_t clusterSpecification = 0;
+ // UInt_t digitSpecification = 0;
+ //UInt_t nDigits = 0;
+
+ for ( iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkCaloClusterDataType); iter != 0; iter = GetNextInputBlock())
+ {
+ clusterSpecification = clusterSpecification|iter->fSpecification;
+ caloClusterHeaderPtr = reinterpret_cast<AliHLTPHOSCaloClusterHeaderStruct*>(iter->fPtr);
+ HLTDebug("%d HLT clusters", caloClusterHeaderPtr->fNClusters);
+ nClusters = fESDCaloClusterMakerPtr->FillESDCaloClusters(fESDCaloClustersPtr, caloClusterHeaderPtr);
+ }
+
+// for(iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkDigitDataType); iter != 0; iter =GetNextInputBlock())
+// {
+// digitSpecification = digitSpecification|iter->fSpecification;
+// digitsPtr = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(iter->fPtr);
+// nDigits = iter->fSize/sizeof(AliHLTPHOSDigitDataStruct);
+// fESDCaloCellMaker->FillESDCaloCells(fESDCaloCellsPtr, digitsPtr, nDigits);
+// }
+
+ // for(int i = 0; i < nClusters; i++)
+ // {
+ // HLTDebug("Cluster energy: %f", ((AliESDCaloCluster*)(fESDCaloClustersPtr->At(i)))->E());
+ // }
+
+ /// HLTError("Number of ESD clusters: %d", nClusters);
+ PushBack(fESDCaloClustersPtr, AliHLTPHOSDefinitions::fgkESDCaloClusterDataType|kAliHLTDataOriginPHOS);
+ // PushBack(fESDCaloCellsPtr, AliHLTPHOSDefinitions::fgkESDCaloCellsDataType|kAliHLTDataOriginPHOS, digitSpecification);
+
+ //delete fESDCaloClustersPtr;
+
+ return 0;
+}
+
+
+int
+AliHLTPHOSESDEntriesMakerComponent::DoInit(int argc, const char** argv )
+{
+ //See headerfile for documentation
+
+ fESDCaloClusterMakerPtr = new AliHLTPHOSESDCaloClusterMaker();
+
+ fESDCaloClustersPtr = new TClonesArray(AliESDCaloCluster::Class(), 10);
+
+ ScanArgumentsModule(argc, argv);
+ for (int i = 0; i < argc; i++)
+ {
+
+ }
+
+ return 0;
+}
+
+AliHLTComponent*
+AliHLTPHOSESDEntriesMakerComponent::Spawn()
+{
+ //See headerfile for documentation
+
+ return new AliHLTPHOSESDEntriesMakerComponent();
+}
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * 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 ALIHLTPHOSESDENTRIESMAKERCOMPONENT_H
+#define ALIHLTPHOSESDENTRIESMAKERCOMPONENT_H
+
+
+
+
+/**
+ * ESD maker component for PHOS HLT
+ *
+ * @file AliHLTPHOSESDEntriesMakerComponent.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief An ESD maker component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSProcessor.h"
+
+class AliHLTPHOSESDCaloClusterMaker;
+class AliHLTPHOSCaloClusterContainerStruct;
+class TClonesArray;
+
+/**
+ * @class AliHLTPHOSESDEntriesMakerComponent
+ *
+ * HLT component for making AliESDEvent from AliHLTPHOSCaloClusterDataStructs
+ *
+ * @ingroup alihlt_phos
+ */
+class AliHLTPHOSESDEntriesMakerComponent: public AliHLTPHOSProcessor
+{
+ public:
+
+ /** Constructor */
+
+ AliHLTPHOSESDEntriesMakerComponent();
+
+ /** Destructor */
+ virtual ~AliHLTPHOSESDEntriesMakerComponent();
+
+ /** Copy constructor */
+ AliHLTPHOSESDEntriesMakerComponent(const AliHLTPHOSESDEntriesMakerComponent &) :
+ AliHLTPHOSProcessor(),
+ fESDCaloClusterMakerPtr(0),
+ fESDCaloClustersPtr(0)
+ {
+ //Copy constructor not implemented
+ }
+
+ /** Assignment */
+ AliHLTPHOSESDEntriesMakerComponent & operator = (const AliHLTPHOSESDEntriesMakerComponent)
+ {
+ //Assignment
+ return *this;
+ }
+
+ /** interface function, see @ref AliHLTComponent for description */
+ const char* GetComponentID();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponentDataType GetOutputDataType();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ using AliHLTPHOSProcessor::DoEvent;
+ Int_t DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponent* Spawn();
+
+protected:
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int DoInit(int argc, const char** argv);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int Deinit();
+
+private:
+
+ /** Pointer to the ESD cluster maker */
+ AliHLTPHOSESDCaloClusterMaker* fESDCaloClusterMakerPtr; //! transient
+
+ /** Pointer to the ESD calo cluster array*/
+ TClonesArray* fESDCaloClustersPtr; //! transient
+
+// /** Pointer to the cell maker */
+// AliHLTPHOSCaloCellMaker* fCaloCellMaker; //! transient
+
+};
+
+
+#endif
+
/** The AliHLTPHOSCaloClusterContainerStruct */
AliHLTPHOSCaloClusterContainerStruct* fCaloClusterContainerPtr; //! transient
- ClassDef(AliHLTPHOSESDMaker, 1);
+ ClassDef(AliHLTPHOSESDMaker, 0);
};
#endif
-// $Id$
-
/**************************************************************************
* This file is property of and copyright by the ALICE HLT Project *
* All rights reserved. *
-//-*- Mode: C++ -*-
-// $Id$
-
/**************************************************************************
* This file is property of and copyright by the ALICE HLT Project *
* All rights reserved. *
AliHLTPHOSHistogramProducer();
~AliHLTPHOSHistogramProducer();
-
- AliHLTPHOSHistogramProducer(const AliHLTPHOSHistogramProducer &) :
- AliHLTPHOSBase(),
- fClusterEnergiesHistPtr(0),
- fMultiplicitiesHistPtr(0),
- fClusterNtuplePtr(0),
- fFillClusterEnergies(false),
- fFillMultiplicities(false),
- fFillNtuple(false),
- fMaxNtupleEntries(1000000000)
- {
- //comment
- }
-
- AliHLTPHOSHistogramProducer & operator = (const AliHLTPHOSHistogramProducer)
- {
- //Assignment
- return *this;
- }
-
Int_t Fill(AliHLTPHOSCaloClusterContainerStruct* clusterContainerPtr);
Int_t InitializeObjects();
void SetMaxNtupleEntries(Int_t n) { fMaxNtupleEntries = n; }
private:
-
+AliHLTPHOSHistogramProducer(const AliHLTPHOSHistogramProducer & );
+AliHLTPHOSHistogramProducer & operator = (const AliHLTPHOSHistogramProducer &);
TH1D* fClusterEnergiesHistPtr;
TH1D* fMultiplicitiesHistPtr;
TNtuple* fClusterNtuplePtr;
#include "AliHLTPHOSProcessor.h"
#include "TH1D.h"
#include "TNtuple.h"
+#include "TFile.h"
#include "AliHLTPHOSHistogramProducer.h"
+#include "AliHLTPHOSPhysicsHistogramProducer.h"
#include "AliHLTPHOSCaloClusterContainerStruct.h"
-
+#include "TClonesArray.h"
/**
* @file AliHLTPHOSHistogramProducerComponent.cxx
* @author Oystein Djuvsland
* @date
- * @brief A digit maker component for PHOS HLT
+ * @brief A histogram producer component for PHOS HLT
*/
// see below for class documentation
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-const AliHLTComponentDataType AliHLTPHOSHistogramProducerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
-
AliHLTPHOSHistogramProducerComponent gAliHLTPHOSHistogramProducerComponent;
AliHLTPHOSHistogramProducerComponent::AliHLTPHOSHistogramProducerComponent() :
AliHLTPHOSProcessor(),
- fClusterEnergiesHistPtr(0),
- fMultiplicitiesHistPtr(0),
- fClusterNtuplePtr(0),
- fDoFillClusterEnergies(false),
- fDoFillMultiplicities(false),
- fDoFillNtuple(false),
- fHistogramProducerPtr(0)
+ fPhysicsHistogramProducerPtr(0),
+ fPushModulo(1)
{
//see header file for documentation
}
AliHLTPHOSHistogramProducerComponent::Deinit()
{
//see header file for documentation
+ if(fPhysicsHistogramProducerPtr != 0)
+ {
+ delete fPhysicsHistogramProducerPtr;
+ fPhysicsHistogramProducerPtr = 0;
+ }
+
return 0;
}
{
//see header file for documentation
list.clear();
- list.push_back(AliHLTPHOSDefinitions::fgkChannelDataType);
+ list.push_back(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
+ list.push_back(AliHLTPHOSDefinitions::fgkESDCaloCellsDataType);
-// const AliHLTComponentDataType* pType=fgkInputDataTypes;
-// while (pType->fID!=0) {
-// list.push_back(*pType);
-// pType++;
-// }
}
AliHLTComponentDataType
{
//see header file for documentation
- // UInt_t specification = 0;
-
- // AliHLTPHOSCaloClusterContainerStruct* tmpClusters = 0;
-
- const AliHLTComponentBlockData* block = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkClusterDataType);
+ const AliHLTComponentBlockData* block = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
- while(block != 0)
+ if(block != 0)
{
- fHistogramProducerPtr->Fill(reinterpret_cast<AliHLTPHOSCaloClusterContainerStruct*>(block->fPtr));
- block = GetNextInputBlock();
+ HLTError("Number of clusters: %d", reinterpret_cast<TClonesArray*>(const_cast<AliHLTComponentBlockData*>(block))->GetEntries());
+ fPhysicsHistogramProducerPtr->AnalyseClusters(reinterpret_cast<TClonesArray*>(const_cast<AliHLTComponentBlockData*>(block)));
}
- if(fDoFillClusterEnergies)
- {
- PushBack(fClusterEnergiesHistPtr, AliHLTPHOSDefinitions::fgkPhosHistDataType);
- }
- if(fDoFillMultiplicities)
- {
- PushBack(fMultiplicitiesHistPtr, AliHLTPHOSDefinitions::fgkPhosHistDataType);
- }
- if(fDoFillNtuple)
+ // block = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkESDCaloCellsDataType);
+
+
+ if(block != 0)
{
- PushBack(fClusterNtuplePtr, AliHLTPHOSDefinitions::fgkPhosHistDataType);
+
}
+ // if(fEventCount%fPushModulo == 0)
+ // {
+
+ HLTError("WRITING HISTOGRAMS!");
+ TFile* file = TFile::Open("/tmp/hist.root", "RECREATE");
+ (fPhysicsHistogramProducerPtr->GetHistograms())->Write();
+ file->Close();
+ PushBack(fPhysicsHistogramProducerPtr->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
+ // }
return 0;
}
{
//see header file for documentation
- fHistogramProducerPtr = new AliHLTPHOSHistogramProducer();
+ fPhysicsHistogramProducerPtr = new AliHLTPHOSPhysicsHistogramProducer();
for(int i = 0; i < argc; i++)
{
- if(!strcmp("-dofillclusterenergies", argv[i]))
- {
- fHistogramProducerPtr->SetFillClusterEnergies(true);
- fDoFillClusterEnergies = true;
- }
- if(!strcmp("-dofillmultiplicities", argv[i]))
- {
- fHistogramProducerPtr->SetFillMultiplicities(true);
- fDoFillMultiplicities = true;
- }
- if(!strcmp("-dofillntuple", argv[i]))
+ if(!strcmp("-pushmodulo", argv[i]))
{
- fHistogramProducerPtr->SetFillClusterNtuple(true);
- fDoFillNtuple = true;
- }
- if(!strcmp("-maxntupleentries", argv[i]))
- {
- fHistogramProducerPtr->SetMaxNtupleEntries(atoi(argv[i+1]));
+
+ fPushModulo = atoi(argv[i+1]);
}
}
-
- fHistogramProducerPtr->InitializeObjects();
-
- if(fDoFillClusterEnergies)
- {
- fClusterEnergiesHistPtr = fHistogramProducerPtr->GetClusterEnergiesHistogram();
- }
- if(fDoFillMultiplicities)
- {
- fMultiplicitiesHistPtr = fHistogramProducerPtr->GetMultiplicitiesHistogram();
- }
- if(fDoFillNtuple)
- {
- fClusterNtuplePtr = fHistogramProducerPtr->GetClusterNtuple();
- }
-
- //fDigitMakerPtr->SetDigitThreshold(2);
return 0;
}
#include "AliHLTPHOSProcessor.h"
-class TH1D;
-class TNtuple;
-class AliHLTPHOSHistogramProducer;
-class AliHLTPHOSCaloClusterContainerStruct;
-
+class AliHLTPHOSPhysicsHistogramProducer;
/**
* @class AliHLTPHOSHistogramProducerComponent
*
virtual ~AliHLTPHOSHistogramProducerComponent();
/** Copy constructor */
- AliHLTPHOSHistogramProducerComponent(const AliHLTPHOSHistogramProducerComponent &) :
+ AliHLTPHOSHistogramProducerComponent(const AliHLTPHOSHistogramProducerComponent & ) :
AliHLTPHOSProcessor(),
- fClusterEnergiesHistPtr(0),
- fMultiplicitiesHistPtr(0),
- fClusterNtuplePtr(0),
- fDoFillClusterEnergies(false),
- fDoFillMultiplicities(false),
- fDoFillNtuple(false),
- fHistogramProducerPtr(0)
+ fPhysicsHistogramProducerPtr(0),
+ fPushModulo(0)
{
//Copy constructor not implemented
}
private:
- TH1D* fClusterEnergiesHistPtr;
- TH1D* fMultiplicitiesHistPtr;
- TNtuple* fClusterNtuplePtr;
-
- bool fDoFillClusterEnergies;
- bool fDoFillMultiplicities;
- bool fDoFillNtuple;
+ AliHLTPHOSPhysicsHistogramProducer* fPhysicsHistogramProducerPtr;
+ UInt_t fPushModulo;
- AliHLTPHOSHistogramProducer* fHistogramProducerPtr;
-
- /** interface function, see @ref AliHLTComponent for description */
- static const AliHLTComponentDataType fgkInputDataTypes[]; //COMMENT
};
#endif
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliHLTPHOSClusterizer;
+//#pragma link C++ class AliHLTPHOSAgent+;
+#pragma link C++ class AliHLTPHOSClusterizer+;
+#pragma link C++ class AliHLTPHOSESDCaloClusterMaker+;
#pragma link C++ class AliHLTPHOSEmcCalibData+;
#pragma link C++ class AliHLTPHOSPhysicsAnalyzer+;
#pragma link C++ class AliHLTPHOSPulseGenerator+;
#pragma link C++ class AliHLTPHOSSanityInspector+;
#pragma link C++ class AliHLTPHOSESDMaker+;
#pragma link C++ class AliHLTPHOSClusterAnalyser+;
+#pragma link C++ class AliHLTPHOSPhysicsHistogramProducer+;
//#pragma link C++ class AliHLTPHOSChannelBadness+;
//
//
+#include "AliPHOSEMCAGeometry.h"
#include "AliHLTPHOSMapper.h"
#include "AliHLTPHOSConstants.h"
#include "AliHLTLogging.h"
fHw2geomapPtr(0),
fIsInitializedMapping(false),
fSpecificationMapPtr(0)
+ // fPHOSGeometry(0)
{
InitAltroMapping();
InitDDLSpecificationMapping();
+ // fPHOSGeometry = new AliPHOSEMCAGeometry();
+
}
int tmpZRow = 0;
int tmpXCol = 0;
int tmpGain = 0;
- int res = 0; //OD to get rid of warnings
+ int res = 0;
if(base !=0)
{
sprintf(fFilepath,"%s/PHOS/mapping/RCU0.data", base);
else if(specification == 0x80000) index = 19;
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) |
channelCoord[2] = (channelId >> 12)&0x1;
channelCoord[3] = (channelId >> 13)&0x1f;
}
+
+void
+AliHLTPHOSMapper::GetLocalCoord(UShort_t channelId, Float_t* channelCoord)
+{
+ channelCoord[0] = (static_cast<Float_t>(channelId&0x3f) - NXCOLUMNSMOD/2)* fCellStep;
+ channelCoord[1] = (static_cast<Float_t>((channelId >> 6)&0x3f) - NZROWSMOD/2) * fCellStep;
+ channelCoord[2] = (channelId >> 12)&0x1;
+ channelCoord[2] = (channelId >> 13)&0x1f;
+}
+
+Int_t
+AliHLTPHOSMapper::GetDDLFromSpec(Int_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;
+}
//using namespace PhosHLTConst;
#include "Rtypes.h"
#include "AliHLTLogging.h"
+
+#include "AliPHOSEMCAGeometry.h"
+
class AliHLTPHOSMapper : public AliHLTLogging
//class AliHLTPHOSMapper
{
UShort_t GetChannelID(Int_t specification, Int_t hwAddress);
static void GetChannelCoord(UShort_t channelId, UShort_t* channelCoord);
+ static void GetLocalCoord(UShort_t channelId, Float_t* localCoord);
+ int GetDDLFromSpec(Int_t specification);
struct fAltromap{
int fZRow; // Coordinate in Z direction (beam direction) relatve too one RCU
AliHLTPHOSMapper & operator = (const AliHLTPHOSMapper &);
fDDLSpecificationMap* fSpecificationMapPtr;
-
+ //AliPHOSEMCAGeometry fPHOSGeometry;
+ static const Float_t fCellStep = 2.2;//2.*fPHOSGeometry.GetAirCellHalfSize()[0];
};
#endif
{
//See header file for documentation
- cout << "Int_t AliHLTPHOSModuleCalibrationProcessorComponent::DeinitCalibration()" << endl;
//AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ) {
AliHLTComponentEventData dummyEvtData;
Int_t
-AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ) {
+AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ )
+{
+
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP0" << endl;
//://:ShipDataToFXS(
// see header file for class documentation
// ** PushBack data to FXS ...
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP0.1" << endl;
Char_t filename[200];
for(int i=0; i < 200; i++)
{
filename[i] = 0;
}
-
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP0.2" << endl;
fPHOSDAPtr->GetModule();
sprintf(filename, "PHOS_Module%d_Calib_HLT.root", fPHOSDAPtr->GetModule() );
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP0.3" << endl;
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP1" << endl;
for(Int_t x = 0; x < NXCOLUMNSRCU; x++)
{
for(Int_t z = 0; z < NZROWSRCU; z++)
{
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP2" << endl;
PushToFXS( (TObject*) fPHOSDAPtr->GetHgLgRatioHistogram(x, z), "PHOS", filename);
for(Int_t gain = 0; gain < NGAINS; gain++)
{
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP3" << endl;
PushToFXS( (TObject*) fPHOSDAPtr->GetTimeEnergyHistogram(x, z, gain), "PHOS", filename);
- cout << "AliHLTPHOSModuleCalibrationProcessorComponent::ShipDataToFXS TP4" << endl;
}
}
}
{
//Constructor
//See header file for documentation
- AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV");
+ // AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV");
+ AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("IHEP");
// fPHOSRadius = geom->GetIPtoCrystalSurface();
fPHOSRadius = geom->GetIPtoCrystalSurface();
for(int i = 0; i < NMODULES; i++)
{
-// fRotParametersCos[i] = cos((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360);
-// fRotParametersSin[i] = sin((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360);
- fRotParametersCos[i] = cos((geom->GetPHOSAngle(i))*2*TMath::Pi()/360);
- fRotParametersSin[i] = sin((geom->GetPHOSAngle(i))*2*TMath::Pi()/360);
+ fRotParametersCos[i] = cos((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360);
+ fRotParametersSin[i] = sin((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360);
+// fRotParametersCos[i] = cos((geom->GetPHOSAngle(i))*2*TMath::Pi()/360);
+// fRotParametersSin[i] = sin((geom->GetPHOSAngle(i))*2*TMath::Pi()/360);
}
}
positionPtr[1] = kCRYSTALSIZE*(locPositionPtr[0]-NXCOLUMNSMOD/2)*fRotParametersSin[module] - fPHOSRadius*fRotParametersCos[module];
- positionPtr[2] = kCRYSTALSIZE*(locPositionPtr[1]-NZROWSMOD);
+ positionPtr[2] = kCRYSTALSIZE*(locPositionPtr[1]-NZROWSMOD/2);
}
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Albin Gaignette
+ * *
+ * 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 AliHLTPHOSPhysicsHistogramProducer
+ * @author Albin Gaignette
+ * @date
+ * @brief Histogram producer for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSPhysicsHistogramProducer.h"
+#include "AliESDCaloCluster.h"
+#include "TMath.h"
+#include "TClonesArray.h"
+#include <iostream>
+#include "TH1F.h"
+#include "TH2F.h"
+
+AliHLTPHOSPhysicsHistogramProducer::AliHLTPHOSPhysicsHistogramProducer() :
+ AliHLTPHOSBase(),
+ fHistNcls(0),
+ fHistEnergy(0),
+ fHistTotEnergy(0),
+ fHistTwoClusterInvMass(0),
+ fHistNcells(0),
+ fHistNcellsPercentage(0),
+ fHistCellsEnergy(0),
+ fHistNclusterTotE(0),
+ fHistNcellsSumCells(0),
+ fHistArrayPtr(0)
+{
+ // See header file for documentation
+ fHistArrayPtr = new TObjArray;
+
+ fHistNcls = new TH1F("fHistNcls", "Number of clusters per event", 20, 0, 20);
+ fHistNcls->GetXaxis()->SetTitle("Number of clusters per event");
+ fHistNcls->GetYaxis()->SetTitle("# of counts");
+ fHistArrayPtr ->AddLast(fHistNcls);
+
+ fHistEnergy = new TH1F("fHistEnergy", "Energy in each cluster", 200, 0, 100);
+ fHistEnergy->GetXaxis()->SetTitle("E_{T} GeV");
+ fHistEnergy->GetYaxis()->SetTitle("# of counts");
+ fHistEnergy->SetMarkerStyle(21);
+ fHistArrayPtr->AddLast(fHistEnergy);
+
+ fHistTotEnergy = new TH1F("fHistTotEnergy", "Total energy in each event", 200, 0, 200);
+ fHistTotEnergy->GetXaxis()->SetTitle("E_{T} GeV");
+ fHistTotEnergy->GetYaxis()->SetTitle("# of counts");
+ fHistTotEnergy->SetMarkerStyle(21);
+ fHistArrayPtr ->AddLast(fHistTotEnergy);
+
+ fHistTwoClusterInvMass = new TH1F("fHistTwoClusterInvMass", "Invariant mass of two clusters", 200, 0, 1);
+ fHistTwoClusterInvMass->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV");
+ fHistTwoClusterInvMass->GetYaxis()->SetTitle("Number of counts");
+ fHistTwoClusterInvMass->SetMarkerStyle(21);
+ fHistArrayPtr->AddLast(fHistTwoClusterInvMass);
+
+ fHistNcells = new TH1F("fHistNcells", "Number of cells in each cluster", 200, 0, 100);
+ fHistNcells->GetXaxis()->SetTitle("# of cells in the cluster");
+ fHistNcells->GetYaxis()->SetTitle("# of counts");
+ fHistNcells->SetMarkerStyle(21);
+ fHistArrayPtr ->AddLast(fHistNcells);
+
+ fHistNcellsPercentage = new TH1F("fHistNcellsPercentage", "Percentage of cells in the cluster", 200, 0, 10);
+ fHistNcellsPercentage->GetXaxis()->SetTitle("100* #frac{Total # of cells in the cluster}{Total # of cells in PHOS}");
+ fHistNcellsPercentage->GetYaxis()->SetTitle("# of counts");
+ fHistNcellsPercentage->SetMarkerStyle(21);
+ fHistArrayPtr ->AddLast(fHistNcellsPercentage);
+
+ fHistCellsEnergy = new TH2F("fHistCellsEnergy","# of cells in the cluster vs cluster Energy",100,0,60,100,1,60);
+ fHistCellsEnergy->GetXaxis()->SetTitle("Cluster Energy [GeV]");
+ fHistCellsEnergy->GetYaxis()->SetTitle("# of cells in the cluster");
+ fHistArrayPtr ->AddLast(fHistCellsEnergy);
+
+ fHistNclusterTotE = new TH2F("fHistNclusterTotE","# of clusters vs total Energy",100,0,200,100,1,15);
+ fHistNclusterTotE->GetXaxis()->SetTitle("total Energy in the event [GeV]");
+ fHistNclusterTotE->GetYaxis()->SetTitle("# of clusters in each event");
+ fHistArrayPtr ->AddLast(fHistNclusterTotE);
+
+ fHistNcellsSumCells = new TH2F("fHistNcellsSumCells","# of cells in PHOS vs sum cells in the clusters",100,0,300,100,17910,17930);
+ fHistNcellsSumCells->GetXaxis()->SetTitle("# of cells in the clusters");
+ fHistNcellsSumCells->GetYaxis()->SetTitle("Total # of cells in PHOS");
+ fHistArrayPtr->AddLast(fHistNcellsSumCells);
+}
+
+AliHLTPHOSPhysicsHistogramProducer::~AliHLTPHOSPhysicsHistogramProducer()
+{
+ // See header file for documentation
+ if(fHistNcls)
+ {
+ delete fHistNcls;
+ fHistNcls = 0;
+ }
+ if(fHistEnergy)
+ {
+ delete fHistEnergy;
+ fHistEnergy = 0;
+ }
+ if(fHistTotEnergy)
+ {
+ delete fHistTotEnergy;
+ fHistTotEnergy = 0;
+ }
+ if(fHistTwoClusterInvMass)
+ {
+ delete fHistTwoClusterInvMass;
+ fHistTwoClusterInvMass = 0;
+ }
+ if(fHistNcells)
+ {
+ delete fHistNcells;
+ fHistNcells = 0;
+ }
+ if(fHistNcellsPercentage)
+ {
+ delete fHistNcellsPercentage;
+ fHistNcellsPercentage = 0;
+ }
+ if(fHistCellsEnergy)
+ {
+ delete fHistCellsEnergy;
+ fHistCellsEnergy = 0;
+ }
+ if(fHistNclusterTotE)
+ {
+ delete fHistNclusterTotE;
+ fHistNclusterTotE = 0;
+ }
+ if(fHistNcellsSumCells)
+ {
+ delete fHistNcellsSumCells;
+ fHistNcellsSumCells = 0;
+ }
+ if(fHistArrayPtr)
+ {
+ delete fHistArrayPtr;
+ fHistArrayPtr = 0;
+ }
+}
+
+TObjArray* AliHLTPHOSPhysicsHistogramProducer::GetHistograms()
+{
+ // See header file for documentation
+ return fHistArrayPtr;
+}
+
+Int_t AliHLTPHOSPhysicsHistogramProducer::AnalyseClusters(TClonesArray* clusters)
+{
+ // See header file for documentation
+ Int_t nPHOSModules = 3;
+ Int_t totClustersAll=0;
+ Int_t totClustersAllwithprob=0;
+ Int_t totClustersFile=0;
+ Int_t totClustersFilewithprob=0;
+ Double_t theta=0.0;
+ Double_t m=0.0;
+ Double_t TotalCells =0;
+ Double_t TotalCellsPHOS= NXCOLUMNSMOD*NZROWSMOD * nPHOSModules;
+ // 3584 crystals * 3 modules
+ Double_t Nclusters =0;
+ Double_t TotEnergy = 0.0;
+
+ Int_t ncls = clusters->GetEntriesFast();
+
+ fHistNcls->Fill(ncls);
+ totClustersAll+=ncls;
+ totClustersFile+=ncls;
+ Double_t totE = 0;
+
+ Nclusters=0;
+ TotEnergy=0.0;
+ TotalCells=0;
+
+ Float_t** tabposition = new Float_t*[ncls];
+ Double_t* tabenergy=new Double_t[ncls];
+
+ for(Int_t icls = 0; icls < ncls; icls++)
+ {
+ AliESDCaloCluster* cluster = (AliESDCaloCluster*)clusters->At(icls);
+
+ totClustersFilewithprob+=icls;
+ totClustersAllwithprob+=icls;
+ totE += cluster->E();
+ fHistEnergy->Fill(cluster->E());
+
+ tabposition[icls] = new Float_t[3];
+ cluster->GetPosition(tabposition[icls]);
+ tabenergy[icls] = cluster->E();
+
+ TotalCells += cluster -> GetNCells();
+ fHistNcells->Fill(cluster -> GetNCells());
+ fHistCellsEnergy->Fill(cluster -> GetNCells(),cluster->E());
+ TotEnergy += cluster->E();
+ Nclusters++;
+ }
+
+ fHistNcellsPercentage->Fill(100*(TotalCells/TotalCellsPHOS));
+ fHistNclusterTotE->Fill(TotEnergy,Nclusters);
+ fHistNcellsSumCells->Fill(TotalCells,TotalCellsPHOS);
+
+ if(totE > 0)
+ fHistTotEnergy->Fill(totE);
+
+ for(Int_t ipho = 0; ipho<(ncls-1) ; ipho++)
+ {
+ for(Int_t jpho = ipho+1 ; jpho<ncls ; jpho++)
+ {
+ // Calcul of the theta angle between two photons
+ theta =(2* asin(0.5*TMath::Sqrt((tabposition[ipho][0]-tabposition[jpho][0])*(tabposition[ipho][0]-tabposition[jpho][0]) +(tabposition[ipho][1]-tabposition[jpho][1])*(tabposition[ipho][1]-tabposition[jpho][1]))/460));
+
+ // Calcul of the mass m of the pion
+ m =(TMath::Sqrt(2 * tabenergy[ipho]* tabenergy[jpho]*(1-TMath::Cos(theta))));
+ fHistTwoClusterInvMass->Fill(m);
+ }
+ }
+
+ for(Int_t j=0 ; j<ncls;j++)
+ {
+ delete[] tabposition[j];
+ }
+
+ delete[] tabposition;
+ delete[] tabenergy;
+
+ return 0;
+}
+
+
+
+
--- /dev/null
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Albin Gaignette *
+ * *
+ * 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 ALIHLTPHOSPHYSICSHISTOGRAMPRODUCER_H
+#define ALIHLTPHOSPHYSICSHISTOGRAMPRODUCER_H
+
+/**
+ * @file AliHLTPHOSPhysicsHistogramProducer
+ * @author Albin Gaignette
+ * @date
+ * @brief Histogram producer for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSBase.h"
+
+class TObjArray;
+class TH1F;
+class TH2F;
+
+
+/**
+ * @class AliHLTPHOSPhysicsHistogramProducer
+ *
+ * Class produces physics histograms for PHOS. It takes a TClonesArray
+ * of AliESDCalocluster as input and fills several histograms
+ *
+ * Histograms (1D):
+ * - Total number of clusters per event
+ * - Energy distribution of clusters
+ * - Total energy in event
+ * - Invariant mass of two clusters
+ * - Number of cells in clusters
+ * - Fraction of cells with energy deposit
+ *
+ * Histograms (2D):
+ * - Number of cells in cluster vs cluster energy
+ * - Number of clusters vs total energy
+ *
+ * @ingroup alihlt_phos
+ */
+
+
+
+class AliHLTPHOSPhysicsHistogramProducer : public AliHLTPHOSBase
+{
+ public:
+
+ /** Constructor */
+ AliHLTPHOSPhysicsHistogramProducer();
+
+ /** Destructor */
+ virtual ~AliHLTPHOSPhysicsHistogramProducer();
+
+ /** Copy constructor */
+ AliHLTPHOSPhysicsHistogramProducer(const AliHLTPHOSPhysicsHistogramProducer &) :
+ AliHLTPHOSBase(),
+ fHistNcls(0),
+ fHistEnergy(0),
+ fHistTotEnergy(0),
+ fHistTwoClusterInvMass(0),
+ fHistNcells(0),
+ fHistNcellsPercentage(0),
+ fHistCellsEnergy(0),
+ fHistNclusterTotE(0),
+ fHistNcellsSumCells(0),
+ fHistArrayPtr(0)
+ {
+ // Copy constructor not implemented
+ }
+
+ /** Assignment operator */
+ AliHLTPHOSPhysicsHistogramProducer & operator= (const AliHLTPHOSPhysicsHistogramProducer)
+ {
+ // assignment
+ return *this;
+ }
+
+ /** Analyse the clusters in the event */
+ Int_t AnalyseClusters(TClonesArray* clusters);
+
+ /** Get a pointer to the TObjArray of histograms */
+ TObjArray *GetHistograms();
+
+ private:
+
+ /** Histogram of number of clusters */
+ TH1F *fHistNcls; //!transient
+
+ /** Histogram of the cluster energies */
+ TH1F *fHistEnergy; //!transient
+
+ /** Histogram of the total energy in PHOS */
+ TH1F *fHistTotEnergy; //!transient
+
+ /** Histogram of the 2 cluster invariant mass */
+ TH1F *fHistTwoClusterInvMass; //!transient
+
+ /** Histogram of the number of cells with energy */
+ TH1F *fHistNcells; //!transient
+
+ /** Histogram of the fraction of cells with energy deposit */
+ TH1F *fHistNcellsPercentage; //!transient
+
+ /** Histogram of number of cells in cluster vs cluster energy */
+ TH2F *fHistCellsEnergy; //!transient
+
+ /** Histogram of number of clusters vs total energy */
+ TH2F *fHistNclusterTotE; //!transient
+
+ /** Histogram of number of cells in the cluster vs total number of cells in PHOS */
+ TH2F *fHistNcellsSumCells; //!transient
+
+ /** Pointer to the array of histograms */
+ TObjArray *fHistArrayPtr; //!transient
+
+ ClassDef(AliHLTPHOSPhysicsHistogramProducer, 0);
+
+};
+
+#endif
#include "AliHLTPHOSRawAnalyzer.h"
#include "AliHLTPHOSUtilities.h"
-AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer(): AliHLTPHOSBase(),
+AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer(): AliHLTPHOSBase(),
// fDoCorrectBaselineUsingFirstFiveSamples(false),
fDoCorrectBaselineUsingFirstFiveSamples(true),
fDoubleDataPtr(0),
fIntDataPtr(0),
+ fShortDataPtr(0),
fSampleFrequency(10),
fDTofGuess(-1),
fDAmplGuess(-1),
fDTof(99999),
fDAmpl(99999),
fStartIndex(0),
+ fUseShortValues(false),
fUtilitiesPtr(0)
+
{
// fIntDataPtr = new UInt_t[1008];
fDoCorrectBaselineUsingFirstFiveSamples(false),
fDoubleDataPtr(0),
fIntDataPtr(0),
+ fShortDataPtr(0),
fSampleFrequency(10),
fDTofGuess(-1),
fDAmplGuess(-1),
fDTof(99999),
fDAmpl(99999),
fStartIndex(0),
+ fUseShortValues(false),
fUtilitiesPtr(0)
+
{
fSampleFrequency = fs;
} //end
}
+void
+ AliHLTPHOSRawAnalyzer::SetData(const UShort_t *data, const int length)
+ // AliHLTPHOSRawAnalyzer::SetData(UInt_t *data, const int length)
+// AliHLTPHOSRawAnalyzer::SetData(int *data, const int length)
+ {
+
+ fShortDataPtr = const_cast<UShort_t *>(data);
+ fUseShortValues = true;
+ if(fDoCorrectBaselineUsingFirstFiveSamples == true)
+ {
+ CorrectBaselineUsingFirstFiveSamples(fIntDataPtr, length);
+ }
+
+ // fIntDataPtr = data;
+
+ }
+
// void SetData(const double *data);
void SetData(const UInt_t *data, const int length);
+ void SetData(const UShort_t *data, const int length);
// void SetData(UInt_t *data, const int length);
// void SetData(double *data, const int length);
double *fDoubleDataPtr; /**<Float representation of data that should be fitted */
UInt_t *fIntDataPtr; /**<data that should be fitted */
+ UShort_t *fShortDataPtr; /**<data that should be fitted */
// int *fIntDataPtr; /**<data that should be fitted */
// double unsigned fTest;
+ bool fUseShortValues;
+
protected:
AliHLTPHOSUtilities *fUtilitiesPtr;
fAltroBunchPtr = new AliAltroBunch();
fDecoderPtr = new AliAltroDecoder();
fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
+
}
//Adding to the total size of data written
totSize += sizeof(AliHLTPHOSChannelDataHeaderStruct);
-
+
//Decoding data
fDecoderPtr->SetMemory(reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize);
fDecoderPtr->Decode();
* <h2>Output size:</h2>
* Depends on the amount of data...
*
- * More detailed description. (Soon)
+ * More detailed description. (At some point...)
*
* @ingroup alihlt_phos
*/
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Per Thomas Hille, Oystein Djuvsland *
+ * *
+ * 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 "AliHLTPHOSRawAnalyzer.h"
+#include "AliHLTPHOSRawAnalyzerComponentv3.h"
+#include "AliHLTPHOSChannelDataHeaderStruct.h"
+#include "AliHLTPHOSChannelDataStruct.h"
+#include "AliHLTPHOSMapper.h"
+#include "AliHLTPHOSSanityInspector.h"
+#include "AliAltroRawStreamV3.h"
+#include "AliRawReaderMemory.h"
+
+
+AliHLTPHOSRawAnalyzerComponentv3::AliHLTPHOSRawAnalyzerComponentv3():
+ AliHLTPHOSRcuProcessor(),
+ fAnalyzerPtr(0),
+ fMapperPtr(0),
+ fSanityInspectorPtr(0),
+ fRawReaderMemoryPtr(0),
+ fAltroRawStreamPtr(0),
+ fAlgorithm(0),
+ fOffset(0),
+ fBunchSizeCut(0),
+ fMinPeakPosition(0),
+ fMaxPeakPosition(100)
+{
+ //comment
+ fMapperPtr = new AliHLTPHOSMapper();
+
+ fRawReaderMemoryPtr = new AliRawReaderMemory();
+
+ fAltroRawStreamPtr = new AliAltroRawStreamV3(fRawReaderMemoryPtr);
+
+ fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
+
+}
+
+
+AliHLTPHOSRawAnalyzerComponentv3::~AliHLTPHOSRawAnalyzerComponentv3()
+{
+ //comment
+ Deinit();
+}
+
+int
+AliHLTPHOSRawAnalyzerComponentv3::Deinit()
+{
+ //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*
+AliHLTPHOSRawAnalyzerComponentv3::GetComponentID()
+{
+ //comment
+ return "PhosRawAnalyzerv3";
+}
+
+
+void
+AliHLTPHOSRawAnalyzerComponentv3::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+ //comment
+ list.clear();
+ list.push_back( AliHLTPHOSDefinitions::fgkDDLPackedRawDataType | kAliHLTDataOriginPHOS);
+}
+
+AliHLTComponentDataType
+AliHLTPHOSRawAnalyzerComponentv3::GetOutputDataType()
+{
+ //comment
+ return AliHLTPHOSDefinitions::fgkChannelDataType;
+}
+
+void
+AliHLTPHOSRawAnalyzerComponentv3::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+{
+ //comment
+ constBase = sizeof(AliHLTPHOSChannelDataHeaderStruct);
+ inputMultiplier = 0.5;
+}
+
+int
+AliHLTPHOSRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/,
+ AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
+{
+ //comment
+ Int_t blockSize = 0;
+ UInt_t totSize = 0;
+
+ const AliHLTComponentBlockData* iter = NULL;
+ unsigned long ndx;
+
+ for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
+ {
+ iter = blocks+ndx;
+ if ( iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType )
+ {
+ HLTDebug("Data block is not of type fgkDDLPackedRawDataType");
+ continue;
+ }
+
+ blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
+ 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
+ // HLTDebug("Output data size: %d - Input data size: %d", totSize, iter->fSize);
+
+ //Filling the block data
+ AliHLTComponentBlockData bdChannelData;
+ FillBlockData( bdChannelData );
+ bdChannelData.fOffset = 0; //FIXME
+ bdChannelData.fSize = blockSize;
+ bdChannelData.fDataType = AliHLTPHOSDefinitions::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
+AliHLTPHOSRawAnalyzerComponentv3::DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize)
+{
+
+ //comment
+ Int_t crazyness = 0;
+ Int_t nSamples = 0;
+ Short_t channelCount = 0;
+
+ // Firs we want to write a header to the output
+ AliHLTPHOSChannelDataHeaderStruct *channelDataHeaderPtr = reinterpret_cast<AliHLTPHOSChannelDataHeaderStruct*>(outputPtr);
+
+ // Then comes the channel data
+ AliHLTPHOSChannelDataStruct *channelDataPtr = reinterpret_cast<AliHLTPHOSChannelDataStruct*>(outputPtr+sizeof(AliHLTPHOSChannelDataHeaderStruct));
+
+ //Adding to the total size of data written
+ totSize += sizeof(AliHLTPHOSChannelDataHeaderStruct);
+
+ fRawReaderMemoryPtr->SetMemory(reinterpret_cast<UChar_t*>(iter->fPtr), static_cast<ULong_t>(size));
+ fRawReaderMemoryPtr->SetEquipmentID(fMapperPtr->GetDDLFromSpec(iter->fSpecification));
+ fRawReaderMemoryPtr->Reset();
+ fRawReaderMemoryPtr->NextEvent();
+
+ fAltroRawStreamPtr->NextDDL();
+
+ //Looping over data
+ while(fAltroRawStreamPtr->NextChannel())
+ {
+ //Want to get the "first in time" "bunch"
+ while(fAltroRawStreamPtr->NextBunch()) {}
+
+ totSize += sizeof(AliHLTPHOSChannelDataStruct);
+ if(totSize > size)
+ {
+ HLTError("Buffer overflow: Trying to write data of size: %d bytes. Output buffer available: %d bytes.", totSize, size);
+ return -1;
+ }
+
+ nSamples = fAltroRawStreamPtr->GetBunchLength();
+
+ //crazyness = fSanityInspectorPtr->CheckInsanity(static_cast<const UInt_t*>(fAltroBunchPtr->GetData()), static_cast<const Int_t>(fAltroBunchPtr->GetBunchSize()));
+
+ for(int i = 0; i < nSamples; i++)
+ {
+ cout << (fAltroRawStreamPtr->GetSignals())[i] << endl;
+ }
+
+ //Evalute signal amplitude and timing
+ fAnalyzerPtr->SetData(fAltroRawStreamPtr->GetSignals(), nSamples);
+ fAnalyzerPtr->Evaluate(0, nSamples);
+
+ //Checking for sane timing...
+ if(fAnalyzerPtr->GetTiming() > fMinPeakPosition && fAnalyzerPtr->GetTiming() < fMaxPeakPosition)
+ {
+ // Writing to the output buffer
+ channelDataPtr->fChannelID = fMapperPtr->GetChannelID(iter->fSpecification, fAltroRawStreamPtr->GetHWAddress());
+ //channelDataPtr->fChannelID = fMapperPtr->GetChannelID(1, fAltroDataPtr->GetHadd());
+ channelDataPtr->fEnergy = static_cast<Float_t>(fAnalyzerPtr->GetEnergy()) - fOffset;
+ channelDataPtr->fTime = static_cast<Float_t>(fAnalyzerPtr->GetTiming());
+ channelDataPtr->fCrazyness = static_cast<Short_t>(crazyness);
+ channelCount++;
+ channelDataPtr++; // Updating position of the free output.
+ }
+ }
+
+ //Writing the header
+ channelDataHeaderPtr->fNChannels = channelCount;
+ channelDataHeaderPtr->fAlgorithm = fAlgorithm;
+ channelDataHeaderPtr->fInfo = 0;
+ channelDataHeaderPtr->fHasRawData = false;
+
+ HLTDebug("Number of channels: %d", channelCount);
+
+ //returning the size used
+ return sizeof(AliHLTPHOSChannelDataStruct)*channelCount + sizeof(AliHLTPHOSChannelDataHeaderStruct);
+}
+
+int
+AliHLTPHOSRawAnalyzerComponentv3::DoInit( int argc, const char** argv )
+{
+
+ //See base class for documentation
+ fPrintInfo = kFALSE;
+ int iResult=0;
+ fMapperPtr = new AliHLTPHOSMapper();
+
+ 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__ ) , "AliHLTPHOSMapper::Could not initialise mapping from file %s, aborting", fMapperPtr->GetFilePath());
+ return -4;
+ }
+
+ return iResult;
+}
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Per Thomas Hille, Oystein Djuvsland *
+ * *
+ * 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 ALIHLTPHOSRAWANALYZERCOMPONENTV3_H
+#define ALIHLTPHOSRAWANALYZERCOMPONENTV3_H
+
+
+/**
+ * Raw data analyzer component base class for PHOS HLT
+ *
+ * @file AliHLTPHOSRawAnalyzerComponentv3.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief A clusterizer component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTPHOSRcuProcessor.h"
+
+
+class AliHLTPHOSRawAnalyzer;
+class AliHLTPHOSRcuCellEnergyDataStruct;
+class AliHLTPHOSMapper;
+class AliHLTPHOSSanityInspector;
+class AliHLTPHOSDigitMaker;
+class AliHLTPHOSDigitContainerDataStruct;
+class AliRawReaderMemory;
+class AliAltroRawStreamV3;
+
+/**
+ * @class AliHLTPHOSRawAnalyzerComponentv3
+ * This the new and fast version of the component taking care of the decoding and energy and timing
+ * extraction of the raw data from PHOS.
+ *
+ * <h2>General properties:</h2>
+ *
+ * Component ID: \b PhosRawAnalyzerv3 <br>
+ * Library: \b libAliHLTPHOS.so <br>
+ * Input Data Types: @ref <br>
+ * Output Data Types: @ref AliHLTPHOSDefinitions::fgkChannelDataType<br>
+ *
+ * <h2>Mandatory arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li No mandatory arguments for component <br>
+ *
+ * <h2>Optional arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -offset <i> value </i> <br>
+ * gives the offset added to the data during zero suppression (default value: 0)
+ * \li -bunchsizecut <i> value </i> <br>
+ * minimum number of samples a bunch must contain to be considered (default value: 0)
+ * \li -minpeakposition <i> value </i> <br>
+ * cut on minimum postion of the peak in the bunch (defaul value: 0)
+ * \li -maxpeakposition <i> value </i> <br>
+ * cut on maximum postion of the peak in the bunch (defaul value: 100)
+ *
+ * <h2>Configuration:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li No configuration arguments
+ *
+ * <h2>Default CDB entries:</h2>
+ * \li No CDB entry yet, will come.
+ *
+ * <h2>Performance:</h2>
+ * Pretty good (~ 3 kHz), depends on amount of data...
+ *
+ * <h2>Memory consumption:</h2>
+ * Depends on the amount of data, but pretty godd
+ *
+ * <h2>Output size:</h2>
+ * Depends on the amount of data...
+ *
+ * More detailed description. (Soon)
+ *
+ * @ingroup alihlt_phos
+ */
+
+
+class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTPHOSRcuProcessor
+{
+ public:
+
+ /** Standard constructor */
+ AliHLTPHOSRawAnalyzerComponentv3();
+
+ /** Destructor */
+ virtual ~AliHLTPHOSRawAnalyzerComponentv3();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ virtual int DoInit(int argc =0, const char** argv = 0);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ virtual int Deinit();
+
+ /** 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);
+
+ /** 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:
+
+ /** interface function, see @ref AliHLTComponent for description */
+ using AliHLTPHOSRcuProcessor::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 );
+
+ /**
+ * Do the real processing in the component
+ * @param iter is the pointer to the data blocks
+ * @param outputPtr is the pointer to the output buffer
+ * @param size is the available size for output
+ * @param totSize is the total size used for output
+ * @return the size output size used
+ */
+ virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize);
+
+
+ /** Pointer to an analyzer object used for raw data anlysis */
+ AliHLTPHOSRawAnalyzer *fAnalyzerPtr; //COMMENT
+
+ private:
+
+ /** Keep the copy constructor private since it should not be used */
+ AliHLTPHOSRawAnalyzerComponentv3(const AliHLTPHOSRawAnalyzerComponentv3 & );
+
+ /** Keep the assignement operator private since it should not be used */
+ AliHLTPHOSRawAnalyzerComponentv3 & operator = (const AliHLTPHOSRawAnalyzerComponentv3 &);
+
+ /** Mapping from harware address to geometrical address */
+ AliHLTPHOSMapper *fMapperPtr; //!transient
+
+ /** Pointer to object which may check the integrity of the data */
+ AliHLTPHOSSanityInspector *fSanityInspectorPtr; //!transient
+
+ /** Pointer to the raw data reader which reads from memory */
+ AliRawReaderMemory* fRawReaderMemoryPtr; //!transient
+
+ /** Pointer to the raw stream */
+ AliAltroRawStreamV3* fAltroRawStreamPtr; //!transient
+
+ /** Describing which algorithm we are using */
+ Short_t fAlgorithm; //COMMENT
+
+ /** The offset applied before ZS */
+ Int_t fOffset; //COMMENT
+
+ /** The minimum length a bunch can have to be considered */
+ Int_t fBunchSizeCut; //COMMENT
+
+ /** The lowest position a peak can have to be considered */
+ Int_t fMinPeakPosition; //COMMENT
+
+ /** The maximum position a peak can have to be considered */
+ Int_t fMaxPeakPosition; //COMMENT
+
+};
+
+#endif
+
// DumpData(fDoubleDataPtr,50, 25);
+ if(fUseShortValues == true)
+ {
+ EvaluateShort(start, length);
+ }
+ else
+ {
+
+ double tmpAmplitudeMax =0;
+ double tmpTime = 0;
+
+ for(int i=start; i<length; i++)
+ {
+ // if(fDoubleDataPtr[i] > tmpAmplitudeMax && i > 5)
+ if(fIntDataPtr[i] > tmpAmplitudeMax && i > 5)
+ {
+ // tmpAmplitudeMax = fDoubleDataPtr[i];
+ tmpAmplitudeMax = fIntDataPtr[i];
+ tmpTime = i;
+ }
+ }
+
+ fDAmpl = tmpAmplitudeMax;
+ fDTof = tmpTime;
+ }
+
+ //thats all
+} //end Crude
+
+void
+AliHLTPHOSRawAnalyzerCrude::EvaluateShort(int start, int length)
+{
+ // cout << "AliHLTPHOSRawAnalyzerCrude::Evaluate TP0" << endl;
+
+ //DumpData(T
+
+ // DumpData(fDoubleDataPtr,50, 25);
+
double tmpAmplitudeMax =0;
double tmpTime = 0;
for(int i=start; i<length; i++)
{
// if(fDoubleDataPtr[i] > tmpAmplitudeMax && i > 5)
- if(fIntDataPtr[i] > tmpAmplitudeMax && i > 5)
+ if(fShortDataPtr[i] > tmpAmplitudeMax && i > 5)
{
// tmpAmplitudeMax = fDoubleDataPtr[i];
- tmpAmplitudeMax = fIntDataPtr[i];
+ tmpAmplitudeMax = fShortDataPtr[i];
tmpTime = i;
}
}
AliHLTPHOSRawAnalyzerCrude();
virtual ~AliHLTPHOSRawAnalyzerCrude();
virtual void Evaluate(int start = 0, int lenght = 100);
+ virtual void EvaluateShort(int start = 0, int lenght = 100);
private:
// ClassDef(AliHLTPHOSRawAnalyzerCrude, 2)
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Per Thomas Hille, Oystein Djuvsland *
+ * *
+ * 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 "AliHLTPHOSRawAnalyzerCrudeComponentv3.h"
+#include "AliHLTPHOSRawAnalyzerCrude.h"
+
+AliHLTPHOSRawAnalyzerCrudeComponentv3 gAliHLTPHOSRawAnalyzerCrudeComponentv3;
+
+//___________________________________________________________________________
+AliHLTPHOSRawAnalyzerCrudeComponentv3::AliHLTPHOSRawAnalyzerCrudeComponentv3()
+{
+ fAnalyzerPtr = new AliHLTPHOSRawAnalyzerCrude();
+}
+
+//___________________________________________________________________________
+AliHLTPHOSRawAnalyzerCrudeComponentv3::~AliHLTPHOSRawAnalyzerCrudeComponentv3()
+{
+ if(fAnalyzerPtr)
+ {
+ delete fAnalyzerPtr;
+ fAnalyzerPtr = 0;
+ }
+}
+
+//___________________________________________________________________________
+AliHLTPHOSRawAnalyzerCrudeComponentv3::AliHLTPHOSRawAnalyzerCrudeComponentv3(const AliHLTPHOSRawAnalyzerCrudeComponentv3 & ):AliHLTPHOSRawAnalyzerComponentv3()
+{
+
+}
+
+int
+AliHLTPHOSRawAnalyzerCrudeComponentv3::Deinit()
+{
+
+ if(fAnalyzerPtr)
+ {
+ delete fAnalyzerPtr;
+ fAnalyzerPtr = 0;
+ }
+ return 0;
+}
+
+//___________________________________________________________________________
+const char*
+AliHLTPHOSRawAnalyzerCrudeComponentv3::GetComponentID()
+{
+ return "PhosRawCrudev3";
+}
+
+//___________________________________________________________________________
+AliHLTComponent*
+AliHLTPHOSRawAnalyzerCrudeComponentv3::Spawn()
+{
+ return new AliHLTPHOSRawAnalyzerCrudeComponentv3;
+}
--- /dev/null
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Per Thomas Hille, Oystein Djuvsland *
+ * *
+ * 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 ALIHLTPHOSRAWANALYZERCRUDECOMPONENTV3_H
+#define ALIHLTPHOSRAWANALYZERCRUDECOMPONENTV3_H
+
+#include "AliHLTPHOSRawAnalyzerComponentv3.h"
+
+
+class AliHLTPHOSRawAnalyzerCrudeComponentv3: public AliHLTPHOSRawAnalyzerComponentv3
+{
+ public:
+ AliHLTPHOSRawAnalyzerCrudeComponentv3();
+ virtual ~AliHLTPHOSRawAnalyzerCrudeComponentv3();
+ AliHLTPHOSRawAnalyzerCrudeComponentv3(const AliHLTPHOSRawAnalyzerCrudeComponentv3 & );
+ AliHLTPHOSRawAnalyzerCrudeComponentv3 & operator = (const AliHLTPHOSRawAnalyzerCrudeComponentv3)
+ {
+ return *this;
+ };
+
+ virtual int Deinit();
+ virtual const char* GetComponentID();
+ virtual AliHLTComponent* Spawn();
+};
+
+#endif
UInt_t specification = 0;
const AliHLTComponentBlockData* iter = 0;
- iter = GetFirstInputBlock( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC);
+ iter = GetFirstInputBlock();
AliHLTPHOSRcuCellEnergyDataStruct* cellDataPtr = 0;
AliHLTPHOSValidCellDataStruct* currentChannel = 0;
int totalSamples = 1;
fRcuX = 1;
fRcuZ = 1;
}
+
+ // if( fRcuID == 0)
+ // {
+ // fRcuX = 0;
+ // fRcuZ = 0;
+ // }
+
+ // if( fRcuID == 1)
+ // {
+ // fRcuX = 1;
+ // fRcuZ = 0;
+ // }
+
+ // if( fRcuID == 2)
+ // {
+ // fRcuX = 2;
+ // fRcuZ = 0;
+ // }
+
+ // if( fRcuID == 3)
+ // {
+ // fRcuX = 3;
+ // fRcuZ = 0;
+ // }
fRcuZOffset = NZROWSRCU*fRcuZ;
fRcuXOffset = NXCOLUMNSRCU*fRcuX;
**************************************************************************/
#include "AliHLTPHOSUtilities.h"
#include <cstdlib>
-
+#include <cstdio>
AliHLTPHOSUtilities::AliHLTPHOSUtilities()
{
**************************************************************************/
#include <iostream>
-#include <stdio.h>
using namespace std;
{
if((i%nPerLine == 0) && (i != 0))
{
- printf("\n");
+ //printf("\n");
+ cout << endl;
}
cout << array[i]<< "\t";
}
- printf("\n");
+ // printf("\n");
+ cout << endl;
}
template<typename T>
tmpMax = array[i];
}
}
-
return tmpMax;
}
#ROOTLIBS = `root-config --libs --glibs` -lGed -lFTGL -lRGL -lEve -lEG -lGeom -lTreePlayer -lProofPlayer -lProof
-ROOTLIBS = `root-config --libs --glibs` -lGed -lEG -lGeom -lTreePlayer -lProofPlayer -lProof
+ROOTLIBS = `root-config --libs --glibs` -lGed -lEG -lGeom -lTreePlayer -lProofPlayer -lProof -lXMLParser
ALIROOTLIBS = -L$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET) -lHLTbase -lAliHLTHOMER -lAliHLTPHOS -lRAWDatarec -lRAWDatabase -lESD -lSTEER -lSTEERBase -lCDB -lMinuit -lVMC -lPHOSbase -lPHOSshuttle -lPHOSUtils
ALIHLTLIBS = -L$(ALIHLT_LIBDIR) -lHLTbase -lAliHLTHOMER -lAliHLTPHOS
--- /dev/null
+
+#include "AliHLTPHOSConstants.h"
+
+//void rec_hlt_phos(const char* input="./")//, char* opt="decoder ESD")
+void rec_hlt_phos()//, char* opt="decoder ESD")
+{
+ if(!gSystem->AccessPathName("galice.root")){
+ cerr << "please delete the galice.root or run at different place." << endl;
+ return;
+ }
+
+// if (!input) {
+// cerr << "please specify input or run without arguments" << endl;
+// return;
+// }
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // init the HLT system in order to define the analysis chain below
+ //
+ AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // define the analysis chain to be run
+ //
+
+ int moduleStart = 2;
+ int moduleEnd = 4;
+ int rcuStart = 0;
+ int rcuEnd = 3;
+ TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so loglevel=0x7f chains=ESD_WRITER";
+ //TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so loglevel=0x7f chains=PHS-EM";
+ TString emInput;
+
+ for (int module = moduleStart; module <= moduleEnd; module++)
+ {
+ TString clInput;
+
+ for(int rcu = rcuStart; rcu <= rcuEnd; rcu++)
+ {
+ TString arg, publisher, ra, dm;
+ // raw data publisher components
+ publisher.Form("PHS-RP_%02d_%d", module, rcu);
+ arg.Form("-minid %d -datatype 'DDL_RAW ' 'PHOS' -dataspec 0x%x ", 1792 + module*(PhosHLTConst::NRCUSPERMODULE) + rcu, 0x1 << (module*PhosHLTConst::NRCUSPERMODULE + rcu));
+ cout << arg << endl;
+ AliHLTConfiguration pubConf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
+
+ // Raw analyzer
+ arg = "";
+ ra.Form("PHS-RA_%02d_%d", module, rcu);
+ AliHLTConfiguration rawConf(ra.Data(), "PhosRawCrudev3", publisher.Data(), arg.Data());
+
+ // digit maker components
+ dm.Form("PHS-DM_%02d_%d", module, rcu);
+ arg="";
+ arg.Form("-sethighgainfactor 0.005 -setlowgainfactor 0.08 -setdigitthresholds 0.005 0.002");
+ cout << arg << endl;
+ AliHLTConfiguration dmConf(dm.Data(), "PhosDigitMaker", ra.Data(), arg.Data());
+
+ if(clInput.Length() > 0) clInput += " ";
+ clInput+=dm;
+ }
+ cout << clInput << endl;
+ TString arg, cl, ca;
+
+ cl.Form("PHS-CL_%02d", module);
+ arg = "";
+ arg.Form("-digitthreshold 0.005 -recpointthreshold 0.1 -modulemode");
+ cout << arg << endl;
+ AliHLTConfiguration clConf(cl.Data(), "PhosClusterizer", clInput.Data(), arg.Data());
+
+ ca.Form("PHS-CA_%02d", module);
+ arg = "";
+ AliHLTConfiguration caConf(ca.Data(), "PhosClusterAnalyser", cl.Data(), arg.Data());
+
+ if(emInput.Length() > 0) emInput += " ";
+ emInput += ca;
+ }
+
+ TString arg, em;
+
+ // tracker finder components
+ em.Form("PHS-EM");
+ arg = "";
+
+ AliHLTConfiguration emConf(em.Data(), "PhosEsdEntriesMaker", emInput.Data(), " ");
+
+
+
+ // AliHLTConfiguration writerConf("ESD_WRITER", "PhosEsdCaloClusterWriter", em.Data(), "-filename test.root -writemodulo 5");
+
+ // AliHLTConfiguration esdWriter("ESD_WRITER", "ROOTFileWriter" , "PHS-EM", "PhosEsdEntriesMaker", "-datafile ESDClusters -concatenate-events -overwrite");
+ AliHLTConfiguration esdWriter("ESD_WRITER", "ROOTFileWriter" , em.Data(), "-datafile ESDClusters -concatenate-events -overwrite");
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Init and run the reconstruction
+ // All but HLT reconstructio is switched off
+ //
+ AliReconstruction rec;
+ // rec.SetInput(input);
+ rec.SetInput("./");
+ rec.SetRunVertexFinder(kFALSE);
+ rec.SetRunLocalReconstruction("HLT PHOS");
+ rec.SetRunTracking(":");
+ rec.SetLoadAlignFromCDB(0);
+ rec.SetRunQA(":");
+
+ // NOTE: FillESD is a step in the AliReconstruction sequence and has
+ // nothing to do with the fact that this macro writes ESD output
+ // HLT processes the HLTOUT during FillESD and extracts data which
+ // has already been prepared. This step is currently not necessary for
+ // this macro
+ // rec.SetRunLocalReconstruction("PHOS") ;
+
+ rec.SetFillESD("PHOS");
+ rec.SetOption("HLT", option);
+ // rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so loglevel=0x7f chains=ESD_WRITER" )
+ rec.Run();
+}
--- /dev/null
+
+#include "AliHLTPHOSConstants.h"
+
+//void rec_hlt_phos(const char* input="./")//, char* opt="decoder ESD")
+void rec_hlt_phos()//, char* opt="decoder ESD")
+{
+ if(!gSystem->AccessPathName("galice.root")){
+ cerr << "please delete the galice.root or run at different place." << endl;
+ return;
+ }
+
+// if (!input) {
+// cerr << "please specify input or run without arguments" << endl;
+// return;
+// }
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // init the HLT system in order to define the analysis chain below
+ //
+ AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // define the analysis chain to be run
+ //
+
+ int moduleStart = 2;
+ int moduleEnd = 4;
+ int rcuStart = 0;
+ int rcuEnd = 3;
+ TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so loglevel=0x7f chains=ESD_WRITER";
+ //TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so loglevel=0x7f chains=PHS-HIST_PROD";
+ //TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so loglevel=0x7f chains=PHS-EM";
+ TString emInput;
+
+ for (int module = moduleStart; module <= moduleEnd; module++)
+ {
+ TString clInput;
+
+ for(int rcu = rcuStart; rcu <= rcuEnd; rcu++)
+ {
+ TString arg, publisher, ra, dm;
+ // raw data publisher components
+ publisher.Form("PHS-RP_%02d_%d", module, rcu);
+ arg.Form("-minid %d -datatype 'DDL_RAW ' 'PHOS' -dataspec 0x%x ", 1792 + module*(PhosHLTConst::NRCUSPERMODULE) + rcu, 0x1 << (module*PhosHLTConst::NRCUSPERMODULE + rcu));
+ cout << arg << endl;
+ AliHLTConfiguration pubConf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
+
+ // Raw analyzer
+ arg = "";
+ ra.Form("PHS-RA_%02d_%d", module, rcu);
+ AliHLTConfiguration rawConf(ra.Data(), "PhosRawCrudev2", publisher.Data(), arg.Data());
+
+ // digit maker components
+ dm.Form("PHS-DM_%02d_%d", module, rcu);
+ arg="";
+ arg.Form("-sethighgainfactor 0.005 -setlowgainfactor 0.08 -setdigitthresholds 0.005 0.002");
+ cout << arg << endl;
+ AliHLTConfiguration dmConf(dm.Data(), "PhosDigitMaker", ra.Data(), arg.Data());
+
+ if(clInput.Length() > 0) clInput += " ";
+ clInput+=dm;
+ }
+ //cout << clInput << endl;
+ TString arg, cl, ca;
+
+ cl.Form("PHS-CL_%02d", module);
+ arg = "";
+ arg.Form("-digitthreshold 0.005 -recpointthreshold 0.1 -modulemode");
+ cout << arg << endl;
+ AliHLTConfiguration clConf(cl.Data(), "PhosClusterizer", clInput.Data(), arg.Data());
+
+ ca.Form("PHS-CA_%02d", module);
+ arg = "";
+ AliHLTConfiguration caConf(ca.Data(), "PhosClusterAnalyser", cl.Data(), arg.Data());
+
+ if(emInput.Length() > 0) emInput += " ";
+ emInput += ca;
+ }
+
+ TString arg, em, hp;
+
+ // tracker finder components
+ em.Form("PHS-EM");
+ arg = "";
+
+ AliHLTConfiguration emConf(em.Data(), "PhosEsdEntriesMaker", emInput.Data(), " ");
+
+ hp.Form("PHS-HIST_PROD");
+ arg = "";
+
+ AliHLTConfiguration histConf(hp.Data(), "PhosHistoProducer", em.Data(), " ");
+
+ // AliHLTConfiguration writerConf("ESD_WRITER", "PhosEsdCaloClusterWriter", em.Data(), "-filename test.root -writemodulo 5");
+
+ // AliHLTConfiguration esdWriter("ESD_WRITER", "ROOTFileWriter" , "PHS-EM", "PhosEsdEntriesMaker", "-datafile ESDClusters -concatenate-events -overwrite");
+ AliHLTConfiguration esdWriter("ESD_WRITER", "ROOTFileWriter" , em.Data(), "-datafile ESDClusters -concatenate-events -overwrite");
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // Init and run the reconstruction
+ // All but HLT reconstructio is switched off
+ //
+ AliReconstruction rec;
+ // rec.SetInput(input);
+ rec.SetInput("./");
+ rec.SetRunVertexFinder(kFALSE);
+ rec.SetRunLocalReconstruction("HLT PHOS");
+ rec.SetRunTracking(":");
+ rec.SetLoadAlignFromCDB(0);
+ rec.SetRunQA(":");
+
+ // NOTE: FillESD is a step in the AliReconstruction sequence and has
+ // nothing to do with the fact that this macro writes ESD output
+ // HLT processes the HLTOUT during FillESD and extracts data which
+ // has already been prepared. This step is currently not necessary for
+ // this macro
+ // rec.SetRunLocalReconstruction("PHOS") ;
+
+ rec.SetFillESD("PHOS");
+ rec.SetOption("HLT", option);
+ // rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so loglevel=0x7f chains=ESD_WRITER" )
+ rec.Run();
+}
include $(MODDIR)/hlt.conf
+#CLASS_HDRS:= AliHLTPHOSAgent.h
+
CLASS_HDRS:= AliHLTPHOSBase.h \
AliHLTPHOSClusterizer.h \
AliHLTPHOSClusterizerComponent.h \
AliHLTPHOSRawAnalyzerChiSquareFit.h \
AliHLTPHOSRawAnalyzerComponent.h \
AliHLTPHOSRawAnalyzerComponentv2.h \
+ AliHLTPHOSRawAnalyzerComponentv3.h \
AliHLTPHOSRawAnalyzerCrude.h \
AliHLTPHOSRawAnalyzerCrudeComponent.h \
AliHLTPHOSRawAnalyzerCrudeComponentv2.h \
+ AliHLTPHOSRawAnalyzerCrudeComponentv3.h \
AliHLTPHOSRawAnalyzerKLevel.h \
AliHLTPHOSRawAnalyzerLMS.h \
AliHLTPHOSRawAnalyzerPeakFinderComponent.h \
AliHLTPHOSFourierComponent.h \
AliHLTPHOSHistogramProducer.h \
AliHLTPHOSHistogramProducerComponent.h \
- AliHLTPHOSMonitorTriggerComponent.h
+ AliHLTPHOSMonitorTriggerComponent.h \
+ AliHLTPHOSESDCaloClusterMaker.h \
+ AliHLTPHOSESDEntriesMakerComponent.h \
+ AliHLTPHOSESDCaloClusterWriterComponent.h \
+ AliHLTPHOSCaloClusterReader.h \
+ AliHLTPHOSPhysicsHistogramProducer.h
+# AliHLTPHOSESDCaloClusterMakerComponent.h
# AliHLTPHOSTreeMaker.h \
# AliHLTPHOSTreeMakerComponent.h \
# AliHLTPHOSEmcCalibrationHistogramProducer.h
MODULE_HDRS:= $(CLASS_HDRS) \
AliHLTPHOSCommonDefs.h \
AliHLTPHOSConstants.h \
- AliHLTPHOSRecPointDataStruct.h \
AliHLTPHOSRawAnalyzer.h \
AliHLTPHOSDefinitions.h \
AliHLTPHOSModuleCellEnergyDataStruct.h\
AliHLTPHOSModuleCellAverageEnergyDataStruct.h \
AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h \
AliHLTPHOSRcuCellAverageEnergyDataStruct.h \
+ AliHLTPHOSRecPointDataStruct.h \
AliHLTPHOSRecPointContainerStruct.h \
AliHLTPHOSDigitContainerDataStruct.h \
AliHLTPHOSRcuDigitContainerDataStruct.h \