3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
10 //* Permission to use, copy, modify and distribute this software and its *
11 //* documentation strictly for non-commercial purposes is hereby granted *
12 //* without fee, provided that the above copyright notice appears in all *
13 //* copies and that both the copyright notice and this permission notice *
14 //* appear in the supporting documentation. The authors make no claims *
15 //* about the suitability of this software for any purpose. It is *
16 //* provided "as is" without express or implied warranty. *
17 //**************************************************************************
19 // @file AliHLTGlobalFlatEsdTestComponent.cxx
20 // @author Matthias Richter
22 // @brief Global ESD converter component.
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
32 #include "AliHLTGlobalFlatEsdTestComponent.h"
33 #include "AliFlatESDEvent.h"
34 #include "AliFlatESDTrack.h"
35 #include "AliFlatExternalTrackParam.h"
36 #include "AliExternalTrackParam.h"
38 #include "AliHLTGlobalBarrelTrack.h"
39 #include "AliHLTExternalTrackParam.h"
40 #include "AliHLTTrackMCLabel.h"
41 #include "AliHLTCTPData.h"
42 #include "AliHLTErrorGuard.h"
43 #include "AliESDEvent.h"
44 #include "AliESDfriend.h"
45 #include "AliESDtrack.h"
46 #include "AliESDMuonTrack.h"
47 #include "AliESDMuonCluster.h"
48 #include "AliCDBEntry.h"
49 #include "AliCDBManager.h"
53 #include "TClonesArray.h"
54 //#include "AliHLTESDCaloClusterMaker.h"
55 //#include "AliHLTCaloClusterDataStruct.h"
56 //#include "AliHLTCaloClusterReader.h"
57 //#include "AliESDCaloCluster.h"
58 //#include "AliESDVZERO.h"
59 #include "AliHLTGlobalVertexerComponent.h"
60 #include "AliHLTVertexFinderBase.h"
61 #include "AliHLTTPCSpacePointData.h"
62 #include "AliHLTTPCClusterDataFormat.h"
63 #include "AliHLTTPCDefinitions.h"
64 #include "AliHLTTPCClusterMCData.h"
65 #include "AliHLTTPCTransform.h"
67 /** ROOT macro for the implementation of ROOT specific class methods */
68 ClassImp(AliHLTGlobalFlatEsdTestComponent)
70 AliHLTGlobalFlatEsdTestComponent::AliHLTGlobalFlatEsdTestComponent()
74 , fSolenoidBz(-5.00668)
75 , fBenchmark("FlatEsdTest")
77 // see header file for class documentation
79 // refer to README to build package
81 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
84 AliHLTGlobalFlatEsdTestComponent::~AliHLTGlobalFlatEsdTestComponent()
86 // see header file for class documentation
89 int AliHLTGlobalFlatEsdTestComponent::Configure(const char* arguments)
91 // see header file for class documentation
93 if (!arguments) return iResult;
95 TString allArgs=arguments;
99 TObjArray* pTokens=allArgs.Tokenize(" ");
101 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
102 argument=((TObjString*)pTokens->At(i))->String();
103 if (argument.IsNull()) continue;
104 HLTError("unknown argument %s", argument.Data());
111 HLTError("missing parameter for argument %s", argument.Data());
118 int AliHLTGlobalFlatEsdTestComponent::Reconfigure(const char* cdbEntry, const char* chainId)
120 // see header file for class documentation
122 const char* path=NULL;
123 const char* defaultNotify="";
126 defaultNotify=" (default)";
129 HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
130 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
132 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
134 HLTInfo("received configuration object string: \'%s\'", pString->String().Data());
135 iResult=Configure(pString->String().Data());
137 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
140 HLTError("can not fetch object \"%s\" from CDB", path);
147 void AliHLTGlobalFlatEsdTestComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
149 // see header file for class documentation
150 list.push_back(kAliHLTDataTypeFlatESD|kAliHLTDataOriginOut);
151 list.push_back(kAliHLTDataTypeESDObject|kAliHLTDataOriginOut);
152 list.push_back(kAliHLTDataTypeESDfriendObject|kAliHLTDataOriginOut);
155 AliHLTComponentDataType AliHLTGlobalFlatEsdTestComponent::GetOutputDataType()
157 // see header file for class documentation
158 return kAliHLTDataTypeFlatESD|kAliHLTDataOriginOut;
161 void AliHLTGlobalFlatEsdTestComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
163 // see header file for class documentation
165 inputMultiplier=10.0;
168 int AliHLTGlobalFlatEsdTestComponent::DoInit(int argc, const char** argv)
170 // see header file for class documentation
175 // default list of skiped ESD objects
186 // "AliMultiplicity,"
189 // "SPDPileupVertices,"
190 // "TrkPileupVertices,"
193 "AliRawDataErrorLogs,"
196 iResult=Reconfigure(NULL, NULL);
197 TString allArgs = "";
198 for ( int i = 0; i < argc; i++ ) {
199 if ( !allArgs.IsNull() ) allArgs += " ";
203 TObjArray* pTokens=allArgs.Tokenize(" ");
205 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
206 argument=((TObjString*)pTokens->At(i))->String();
207 if (argument.IsNull()) continue;
210 if (argument.CompareTo("-noclusters")==0) {
213 } else if (argument.CompareTo("-clusters")==0) {
215 } else if (argument.Contains("-skipobject=")) {
216 argument.ReplaceAll("-skipobject=", "");
217 skipObjects=argument;
219 HLTError("unknown argument %s", argument.Data());
226 HLTError("missing parameter for argument %s", argument.Data());
236 fBenchmark.SetTimer(0,"total");
241 int AliHLTGlobalFlatEsdTestComponent::DoDeinit()
243 // see header file for class documentation
248 int AliHLTGlobalFlatEsdTestComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/,
249 const AliHLTComponentBlockData* /*blocks*/,
250 AliHLTComponentTriggerData& /*trigData*/,
251 AliHLTUInt8_t* /*outputPtr*/,
252 AliHLTUInt32_t& size,
253 AliHLTComponentBlockDataList& /*outputBlocks*/ )
255 // see header file for class documentation
258 if (!IsDataEvent()) return iResult;
260 fBenchmark.StartNewEvent();
265 for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDObject | kAliHLTDataOriginOut); iter != NULL; iter = GetNextInputObject() ) {
266 //fBenchmark.AddInput(pBlock->fSize);
267 cout<<"Found ESD in esd test component !!!"<<endl;
268 AliESDEvent *esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(iter));//dynamic_cast<const AliESDEvent*>(iter);
270 esd->GetStdContent();
271 cout<<"N ESD tracks: "<<esd->GetNumberOfTracks()<<endl;
273 cout<<"ESD pointer is NULL "<<endl;
277 for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDfriendObject | kAliHLTDataOriginOut); iter != NULL; iter = GetNextInputObject() ) {
278 //fBenchmark.AddInput(pBlock->fSize);
279 cout<<"Found ESD friend in esd test component !!!"<<endl;
280 const AliESDfriend *esdFriend = dynamic_cast<const AliESDfriend*>(iter);
282 cout<<"N friend tracks: "<<esdFriend->GetNumberOfTracks()<<endl;
284 cout<<"ESD friend pointer is NULL "<<endl;
288 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeFlatESD|kAliHLTDataOriginOut);
289 pBlock!=NULL; pBlock=NULL/*GetNextInputBlock() there is only one block*/) {
290 fBenchmark.AddInput(pBlock->fSize);
291 AliFlatESDEvent *flatEvent = reinterpret_cast<AliFlatESDEvent*>( pBlock->fPtr );
292 cout<<"N flat tracks: "<<flatEvent->GetNumberOfTracks()<<endl;
297 HLTWarning( fBenchmark.GetStatistics() );