1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
6 * Permission to use, copy, modify and distribute this software and its *
7 * documentation strictly for non-commercial purposes is hereby granted *
8 * without fee, provided that the above copyright notice appears in all *
9 * copies and that both the copyright notice and this permission notice *
10 * appear in the supporting documentation. The authors make no claims *
11 * about the suitability of this software for any purpose. It is *
12 * provided "as is" without express or implied warranty. *
13 **************************************************************************/
18 #include "AliHLTPHOSESDMakerComponent.h"
19 #include "AliHLTPHOSESDMaker.h"
20 #include "AliHLTPHOSCaloClusterContainerStruct.h"
21 #include "AliESDEvent.h"
22 #include "AliHLTPHOSDefinitions.h"
23 #include "AliHLTDataTypes.h"
24 #include "AliESDCaloCluster.h"
26 /** @file AliHLTPHOSESDMakerComponent.cxx
27 @author Oystein Djuvsland
29 @brief An ESD maker component for PHOS HLT
32 // see header file for class documentation
34 // refer to README to build package
36 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
42 const AliHLTComponentDataType AliHLTPHOSESDMakerComponent::fgkInputDataTypes[]=
44 kAliHLTVoidDataType,{0,"",""}
47 AliHLTPHOSESDMakerComponent gAliHLTPHOSESDMakerComponent;
50 AliHLTPHOSESDMakerComponent::AliHLTPHOSESDMakerComponent():
51 AliHLTPHOSProcessor(),
55 //See headerfile for documentation
58 AliHLTPHOSESDMakerComponent::~AliHLTPHOSESDMakerComponent()
60 //See headerfile for documentation
77 AliHLTPHOSESDMakerComponent::Deinit()
79 //See headerfile for documentation
96 AliHLTPHOSESDMakerComponent::GetComponentID()
98 //See headerfile for documentation
100 return "PhosEsdMaker";
104 AliHLTPHOSESDMakerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
106 //See headerfile for documentation
108 list.push_back(AliHLTPHOSDefinitions::fgkClusterDataType);
109 // const AliHLTComponentDataType* pType=fgkInputDataTypes;
110 // while (pType->fID!=0)
112 // list.push_back(*pType);
117 AliHLTComponentDataType
118 AliHLTPHOSESDMakerComponent::GetOutputDataType()
120 //See headerfile for documentation
122 return kAliHLTDataTypeESDObject;
126 AliHLTPHOSESDMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
129 //See headerfile for documentation
136 AliHLTPHOSESDMakerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ )
138 // see header file for class documentation
141 AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr = 0;
143 const AliHLTComponentBlockData* iter = 0;
145 UInt_t specification = 0;
147 fESDMakerPtr->ResetESD();
149 fESDEventPtr = new AliESDEvent();
150 fESDEventPtr->CreateStdContent();
151 fESDMakerPtr->SetESDEvent(fESDEventPtr);
153 for ( iter = GetFirstInputBlock(AliHLTPHOSDefinitions::fgkCaloClusterDataType); iter != 0; iter = GetNextInputBlock())
155 specification = specification|iter->fSpecification;
156 caloClusterContainerPtr = reinterpret_cast<AliHLTPHOSCaloClusterContainerStruct*>(iter->fPtr);
157 fESDMakerPtr->FillESDEvent(caloClusterContainerPtr);
158 // fESDMakerPtr->SetCaloClusterContainer(caloClusterContainerPtr);
161 PushBack(fESDEventPtr, kAliHLTDataTypeESDObject|kAliHLTDataOriginPHOS, specification);
170 if(fPrintInfoModule == kTRUE)
172 if(fPhosEventCount%fPrintInfoFrequncyModule == 0)
174 Logging(kHLTLogInfo, __FILE__ , "writing data" , "Made ESD from event %lu", fPhosEventCount);
182 AliHLTPHOSESDMakerComponent::DoInit(int argc, const char** argv )
184 //See headerfile for documentation
186 fESDMakerPtr = new AliHLTPHOSESDMaker();
187 //fESDMakerPtr->SetESDEvent(fESDEventPtr);
189 ScanArgumentsModule(argc, argv);
190 for (int i = 0; i < argc; i++)
199 AliHLTPHOSESDMakerComponent::Spawn()
201 //See headerfile for documentation
203 return new AliHLTPHOSESDMakerComponent();