3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
20 #include "AliHLTPHOSESDMakerComponent.h"
21 #include "AliHLTPHOSESDMaker.h"
22 #include "AliHLTPHOSCaloClusterContainerStruct.h"
23 #include "AliESDEvent.h"
24 #include "AliHLTPHOSDefinitions.h"
25 #include "AliHLTDataTypes.h"
26 #include "AliESDCaloCluster.h"
28 /** @file AliHLTPHOSESDMakerComponent.cxx
29 @author Oystein Djuvsland
31 @brief An ESD 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 const AliHLTComponentDataType AliHLTPHOSESDMakerComponent::fgkInputDataTypes[]=
46 kAliHLTVoidDataType,{0,"",""}
49 AliHLTPHOSESDMakerComponent gAliHLTPHOSESDMakerComponent;
52 AliHLTPHOSESDMakerComponent::AliHLTPHOSESDMakerComponent():
53 AliHLTPHOSProcessor(),
57 //See headerfile for documentation
60 AliHLTPHOSESDMakerComponent::~AliHLTPHOSESDMakerComponent()
62 //See headerfile for documentation
79 AliHLTPHOSESDMakerComponent::Deinit()
81 //See headerfile for documentation
98 AliHLTPHOSESDMakerComponent::GetComponentID()
100 //See headerfile for documentation
102 return "PhosEsdMaker";
106 AliHLTPHOSESDMakerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
108 //See headerfile for documentation
110 list.push_back(AliHLTPHOSDefinitions::fgkClusterDataType);
111 // const AliHLTComponentDataType* pType=fgkInputDataTypes;
112 // while (pType->fID!=0)
114 // list.push_back(*pType);
119 AliHLTComponentDataType
120 AliHLTPHOSESDMakerComponent::GetOutputDataType()
122 //See headerfile for documentation
124 return kAliHLTDataTypeESDObject;
128 AliHLTPHOSESDMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
131 //See headerfile for documentation
138 AliHLTPHOSESDMakerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ )
140 // see header file for class documentation
143 AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr = 0;
145 const AliHLTComponentBlockData* iter = 0;
147 UInt_t specification = 0;
149 fESDMakerPtr->ResetESD();
151 fESDEventPtr = new AliESDEvent();
152 fESDEventPtr->CreateStdContent();
153 fESDMakerPtr->SetESDEvent(fESDEventPtr);
155 for ( iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkCaloClusterDataType); iter != 0; iter = GetNextInputBlock())
157 specification = specification|iter->fSpecification;
158 caloClusterContainerPtr = reinterpret_cast<AliHLTPHOSCaloClusterContainerStruct*>(iter->fPtr);
159 fESDMakerPtr->FillESDEvent(caloClusterContainerPtr);
160 // fESDMakerPtr->SetCaloClusterContainer(caloClusterContainerPtr);
163 PushBack(fESDEventPtr, kAliHLTDataTypeESDObject|kAliHLTDataOriginPHOS, specification);
172 if(fPrintInfoModule == kTRUE)
174 if(fPhosEventCount%fPrintInfoFrequncyModule == 0)
176 Logging(kHLTLogInfo, __FILE__ , "writing data" , "Made ESD from event %lu", fPhosEventCount);
184 AliHLTPHOSESDMakerComponent::DoInit(int argc, const char** argv )
186 //See headerfile for documentation
188 fESDMakerPtr = new AliHLTPHOSESDMaker();
189 //fESDMakerPtr->SetESDEvent(fESDEventPtr);
191 ScanArgumentsModule(argc, argv);
192 for (int i = 0; i < argc; i++)
201 AliHLTPHOSESDMakerComponent::Spawn()
203 //See headerfile for documentation
205 return new AliHLTPHOSESDMakerComponent();