2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
19 #include "AliHLTPHOSESDEntriesMakerComponent.h"
20 #include "AliHLTCaloClusterDataStruct.h"
21 #include "AliHLTPHOSDigitDataStruct.h"
22 #include "AliESDEvent.h"
23 #include "AliHLTPHOSDefinitions.h"
24 #include "AliHLTDataTypes.h"
25 #include "AliESDCaloCluster.h"
26 #include "AliHLTESDCaloClusterMaker.h"
28 /** @file AliHLTPHOSESDEntriesMakerComponent.cxx
29 @author Oystein Djuvsland
31 @brief An ESD entries maker component for PHOS HLT
34 // see header file for class documentation
36 // refer to README to build package
38 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
44 AliHLTPHOSESDEntriesMakerComponent gAliHLTPHOSESDEntriesMakerComponent;
46 AliHLTPHOSESDEntriesMakerComponent::AliHLTPHOSESDEntriesMakerComponent():
47 AliHLTPHOSProcessor(),
48 fESDCaloClusterMakerPtr(0),
49 fESDCaloClustersPtr(0)
51 //See headerfile for documentation
54 AliHLTPHOSESDEntriesMakerComponent::~AliHLTPHOSESDEntriesMakerComponent()
56 //See headerfile for documentation
57 if (fESDCaloClusterMakerPtr)
59 delete fESDCaloClusterMakerPtr;
60 fESDCaloClusterMakerPtr = 0;
65 AliHLTPHOSESDEntriesMakerComponent::Deinit()
67 //See headerfile for documentation
68 if (fESDCaloClusterMakerPtr)
70 delete fESDCaloClusterMakerPtr;
71 fESDCaloClusterMakerPtr = 0;
77 AliHLTPHOSESDEntriesMakerComponent::GetComponentID()
79 //See headerfile for documentation
80 return "PhosEsdEntriesMaker";
84 AliHLTPHOSESDEntriesMakerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
86 //See headerfile for documentation
88 list.push_back(AliHLTPHOSDefinitions::fgkCaloClusterDataType);
91 AliHLTComponentDataType
92 AliHLTPHOSESDEntriesMakerComponent::GetOutputDataType()
94 //See headerfile for documentation
95 return AliHLTPHOSDefinitions::fgkESDCaloClusterDataType;
99 AliHLTPHOSESDEntriesMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
102 //See headerfile for documentation
108 AliHLTPHOSESDEntriesMakerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ )
111 // see header file for class documentation
113 fESDCaloClustersPtr->Delete();
114 //fESDCaloClustersPtr = new TClonesArray(AliESDCaloCluster::Class(), 10);
115 AliHLTCaloClusterHeaderStruct* caloClusterHeaderPtr = 0;
117 const AliHLTComponentBlockData* iter = 0;
118 // UInt_t nClusters = 0;
120 UInt_t clusterSpecification = 0;
121 // UInt_t digitSpecification = 0;
122 //UInt_t nDigits = 0;
124 for ( iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkCaloClusterDataType); iter != 0; iter = GetNextInputBlock())
126 clusterSpecification = clusterSpecification|iter->fSpecification;
127 caloClusterHeaderPtr = reinterpret_cast<AliHLTCaloClusterHeaderStruct*>(iter->fPtr);
128 HLTDebug("%d HLT clusters", caloClusterHeaderPtr->fNClusters);
129 // nClusters = fESDCaloClusterMakerPtr->FillESDCaloClusters(fESDCaloClustersPtr, caloClusterHeaderPtr);
132 // for(iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkDigitDataType); iter != 0; iter =GetNextInputBlock())
134 // digitSpecification = digitSpecification|iter->fSpecification;
135 // digitsPtr = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(iter->fPtr);
136 // nDigits = iter->fSize/sizeof(AliHLTPHOSDigitDataStruct);
137 // fESDCaloCellMaker->FillESDCaloCells(fESDCaloCellsPtr, digitsPtr, nDigits);
140 // for(int i = 0; i < nClusters; i++)
142 // HLTDebug("Cluster energy: %f", ((AliESDCaloCluster*)(fESDCaloClustersPtr->At(i)))->E());
145 /// HLTError("Number of ESD clusters: %d", nClusters);
146 PushBack(fESDCaloClustersPtr, AliHLTPHOSDefinitions::fgkESDCaloClusterDataType|kAliHLTDataOriginPHOS);
147 // PushBack(fESDCaloCellsPtr, AliHLTPHOSDefinitions::fgkESDCaloCellsDataType|kAliHLTDataOriginPHOS, digitSpecification);
149 //delete fESDCaloClustersPtr;
156 AliHLTPHOSESDEntriesMakerComponent::DoInit(int argc, const char** argv )
158 //See headerfile for documentation
160 fESDCaloClusterMakerPtr = new AliHLTESDCaloClusterMaker();
162 fESDCaloClustersPtr = new TClonesArray(AliESDCaloCluster::Class(), 10);
164 ScanArgumentsModule(argc, argv);
165 for (int i = 0; i < argc; i++)
174 AliHLTPHOSESDEntriesMakerComponent::Spawn()
176 //See headerfile for documentation
178 return new AliHLTPHOSESDEntriesMakerComponent();