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: Jacek Otwinowski <Jacek.Otwinowski@gsi.de> *
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 AliHLTGlobalTrackMergerComponent.cxx
20 @author Jacek Otwinowski
22 @brief HLT global track merger component.
30 #include "AliESDEvent.h"
31 #include "AliTracker.h"
32 #include "AliHLTGlobalTrackMerger.h"
33 #include "AliHLTGlobalTrackMergerComponent.h"
37 /** ROOT macro for the implementation of ROOT specific class methods */
38 ClassImp(AliHLTGlobalTrackMergerComponent)
40 //_____________________________________________________________________________
41 AliHLTGlobalTrackMergerComponent::AliHLTGlobalTrackMergerComponent() : AliHLTGlobalEsdConverterComponent(),
46 //_____________________________________________________________________________
47 AliHLTGlobalTrackMergerComponent::~AliHLTGlobalTrackMergerComponent()
49 // see header file for class documentation
52 //_____________________________________________________________________________
53 const char* AliHLTGlobalTrackMergerComponent::GetComponentID()
55 // see header file for class documentation
56 return "GlobalTrackMerger";
59 //_____________________________________________________________________________
60 void AliHLTGlobalTrackMergerComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
62 // see header file for class documentation
63 list.push_back( kAliHLTDataTypeTrack );
66 //_____________________________________________________________________________
67 // AliHLTComponentDataType AliHLTGlobalTrackMergerComponent::GetOutputDataType()
69 // // see header file for class documentation
70 // return kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC;
73 //_____________________________________________________________________________
74 // void AliHLTGlobalTrackMergerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
76 // // see header file for class documentation
77 // // XXX TODO: Find more realistic values.
79 // inputMultiplier = 1.0;
82 //_____________________________________________________________________________
83 AliHLTComponent* AliHLTGlobalTrackMergerComponent::Spawn()
85 // see header file for class documentation
86 return new AliHLTGlobalTrackMergerComponent;
89 //_____________________________________________________________________________
90 void AliHLTGlobalTrackMergerComponent::SetMergerParameters(Double_t maxy,Double_t maxz,Double_t maxkappa,Double_t maxpsi,Double_t maxtgl)
92 // see header file for class documentation
93 fGlobalTrackMerger->SetParameter( maxy, maxz, maxkappa, maxpsi, maxtgl );
96 //_____________________________________________________________________________
97 int AliHLTGlobalTrackMergerComponent::DoInit( int /*argc*/, const char** /*argv*/ )
99 // see header file for class documentation
100 const char* argv = "-notree";
101 AliHLTGlobalEsdConverterComponent::DoInit(1,&argv);
106 fGlobalTrackMerger = new AliHLTGlobalTrackMerger();
108 if (!fGlobalTrackMerger ) {
109 HLTError("failed creating internal objects");
114 SetMergerParameters();
119 //_____________________________________________________________________________
120 int AliHLTGlobalTrackMergerComponent::DoDeinit()
122 // see header file for class documentation
123 if(fGlobalTrackMerger) delete fGlobalTrackMerger; fGlobalTrackMerger =0;
124 AliHLTGlobalEsdConverterComponent::DoDeinit();
128 //_____________________________________________________________________________
129 int AliHLTGlobalTrackMergerComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/,
130 AliHLTComponentTriggerData& /*trigData*/)
133 // global track merger function
134 // takes TRD and TPC tracks and merges them
136 HLTInfo("DoEvent processing data");
138 // see header file for class documentation
141 if(!fGlobalTrackMerger || !fESD) {
142 HLTError("component not initialized");
148 fESD->SetMagneticField(fSolenoidBz);
149 //fESD->SetMagneticField(AliTracker::GetBz());
151 if ((iResult=ProcessBlocks(NULL, fESD))<0) return iResult;
152 if(!fESD->GetNumberOfTracks()>0) return iResult;
155 Bool_t isMerged = fGlobalTrackMerger->Merge(fESD);
157 HLTInfo("No merged tracks");
160 // try to propagate all tracks to DCA to primary vertex
161 fGlobalTrackMerger->PropagateTracksToDCA(fESD);
163 // calculate specification
164 // AliHLTUInt32_t iSpecification = AliHLTTPCDefinitions::EncodeDataSpecification( minSlice, maxSlice, 0, 5 );
165 // HLTInfo("minSlice %d, maxSlice %d", minSlice, maxSlice);
168 //PushBack(fESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC, iSpecification);
169 PushBack(fESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginOut);
171 // clean ESD event content