Events by default are selected.
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalEsdConverterComponent.cxx
CommitLineData
a1408c4b 1// $Id$
2
3//**************************************************************************
4//* This file is property of and copyright by the ALICE HLT Project *
5//* ALICE Experiment at CERN, All rights reserved. *
6//* *
7//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8//* for The ALICE HLT Project. *
9//* *
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//**************************************************************************
18
19/** @file AliHLTGlobalEsdConverterComponent.cxx
20 @author Matthias Richter
21 @date
22 @brief Global ESD converter component.
23*/
24
25// see header file for class documentation
26// or
27// refer to README to build package
28// or
29// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30
31#include <cassert>
32#include "AliHLTGlobalEsdConverterComponent.h"
33#include "AliHLTGlobalBarrelTrack.h"
34#include "AliHLTExternalTrackParam.h"
093b64dc 35#include "AliHLTTrackMCLabel.h"
6117ef63 36#include "AliHLTCTPData.h"
a1408c4b 37#include "AliESDEvent.h"
38#include "AliESDtrack.h"
f064ef44 39#include "AliESDMuonTrack.h"
a1408c4b 40#include "AliCDBEntry.h"
41#include "AliCDBManager.h"
18ada816 42#include "AliPID.h"
a1408c4b 43#include "TTree.h"
44#include "TList.h"
f064ef44 45#include "TClonesArray.h"
9a9467ed 46#include "AliHLTESDCaloClusterMaker.h"
47#include "AliHLTCaloClusterDataStruct.h"
48#include "AliHLTCaloClusterReader.h"
49#include "AliESDCaloCluster.h"
d9386025 50#include "AliHLTGlobalVertexerComponent.h"
a1408c4b 51
52/** ROOT macro for the implementation of ROOT specific class methods */
53ClassImp(AliHLTGlobalEsdConverterComponent)
54
55AliHLTGlobalEsdConverterComponent::AliHLTGlobalEsdConverterComponent()
56 : AliHLTProcessor()
a1408c4b 57 , fWriteTree(0)
093b64dc 58 , fVerbosity(0)
8b7a0f3c 59 , fESD(NULL)
a8714ffa 60 , fSolenoidBz(-5.00668)
a1408c4b 61{
62 // see header file for class documentation
63 // or
64 // refer to README to build package
65 // or
66 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
67}
68
69AliHLTGlobalEsdConverterComponent::~AliHLTGlobalEsdConverterComponent()
70{
71 // see header file for class documentation
72 if (fESD) delete fESD;
73 fESD=NULL;
74}
75
76int AliHLTGlobalEsdConverterComponent::Configure(const char* arguments)
77{
78 // see header file for class documentation
79 int iResult=0;
80 if (!arguments) return iResult;
81
82 TString allArgs=arguments;
83 TString argument;
84 int bMissingParam=0;
85
86 TObjArray* pTokens=allArgs.Tokenize(" ");
87 if (pTokens) {
88 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
fe0af255 89 argument=((TObjString*)pTokens->At(i))->GetString();
a1408c4b 90 if (argument.IsNull()) continue;
91
92 if (argument.CompareTo("-solenoidBz")==0) {
93 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
75970b8d 94 HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz());
a1408c4b 95 continue;
96 } else {
97 HLTError("unknown argument %s", argument.Data());
98 iResult=-EINVAL;
99 break;
100 }
101 }
102 delete pTokens;
103 }
104 if (bMissingParam) {
105 HLTError("missing parameter for argument %s", argument.Data());
106 iResult=-EINVAL;
107 }
108
109 return iResult;
110}
111
112int AliHLTGlobalEsdConverterComponent::Reconfigure(const char* cdbEntry, const char* chainId)
113{
114 // see header file for class documentation
115 int iResult=0;
75970b8d 116 const char* path=NULL;
a1408c4b 117 const char* defaultNotify="";
118 if (cdbEntry) {
119 path=cdbEntry;
120 defaultNotify=" (default)";
121 }
122 if (path) {
123 HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
124 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
125 if (pEntry) {
126 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
127 if (pString) {
128 HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
129 iResult=Configure(pString->GetString().Data());
130 } else {
131 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
132 }
133 } else {
134 HLTError("can not fetch object \"%s\" from CDB", path);
135 }
136 }
137
138 return iResult;
139}
140
141void AliHLTGlobalEsdConverterComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
142{
143 // see header file for class documentation
144 list.push_back(kAliHLTDataTypeTrack);
145 list.push_back(kAliHLTDataTypeTrackMC);
9a9467ed 146 list.push_back(kAliHLTDataTypeCaloCluster);
0973c527 147 list.push_back(kAliHLTDataTypedEdx );
7f167a74 148 list.push_back(kAliHLTDataTypeESDVertex );
f064ef44 149 list.push_back(kAliHLTDataTypeESDObject);
150 list.push_back(kAliHLTDataTypeTObject);
d9963894 151 list.push_back(kAliHLTDataTypeGlobalVertexer);
a1408c4b 152}
153
154AliHLTComponentDataType AliHLTGlobalEsdConverterComponent::GetOutputDataType()
155{
156 // see header file for class documentation
7a9de6d1 157 return kAliHLTDataTypeESDObject|kAliHLTDataOriginOut;
a1408c4b 158}
159
160void AliHLTGlobalEsdConverterComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
161{
162 // see header file for class documentation
163 constBase=2000000;
164 inputMultiplier=10.0;
165}
166
167int AliHLTGlobalEsdConverterComponent::DoInit(int argc, const char** argv)
168{
169 // see header file for class documentation
170 int iResult=0;
171 TString argument="";
172 int bMissingParam=0;
a1408c4b 173
f167b631 174 iResult=Reconfigure(NULL, NULL);
175 TString allArgs = "";
176 for ( int i = 0; i < argc; i++ ) {
177 if ( !allArgs.IsNull() ) allArgs += " ";
178 allArgs += argv[i];
179 }
a1408c4b 180
f167b631 181 TObjArray* pTokens=allArgs.Tokenize(" ");
182 if (pTokens) {
183 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
184 argument=((TObjString*)pTokens->At(i))->GetString();
185 if (argument.IsNull()) continue;
186
187 // -notree
188 if (argument.CompareTo("-notree")==0) {
189 fWriteTree=0;
190
191 // -tree
192 } else if (argument.CompareTo("-tree")==0) {
193 fWriteTree=1;
194 } else if (argument.CompareTo("-solenoidBz")==0) {
195 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
196 HLTInfo("Magnetic Field set to: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
197 fSolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof();
198 continue;
199 } else {
200 HLTError("unknown argument %s", argument.Data());
201 break;
202 }
a1408c4b 203 }
204 }
205 if (bMissingParam) {
206 HLTError("missing parameter for argument %s", argument.Data());
207 iResult=-EINVAL;
208 }
209
75970b8d 210 fSolenoidBz=GetBz();
211
a1408c4b 212 if (iResult>=0) {
a1408c4b 213 fESD = new AliESDEvent;
214 if (fESD) {
215 fESD->CreateStdContent();
216 } else {
217 iResult=-ENOMEM;
218 }
6117ef63 219
220 SetupCTPData();
a1408c4b 221 }
222
223 return iResult;
224}
225
226int AliHLTGlobalEsdConverterComponent::DoDeinit()
227{
228 // see header file for class documentation
229 if (fESD) delete fESD;
230 fESD=NULL;
231
232 return 0;
233}
234
235int AliHLTGlobalEsdConverterComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/,
6117ef63 236 AliHLTComponentTriggerData& trigData)
a1408c4b 237{
238 // see header file for class documentation
239 int iResult=0;
240 if (!fESD) return -ENODEV;
241
242 AliESDEvent* pESD = fESD;
243
244 pESD->Reset();
245 pESD->SetMagneticField(fSolenoidBz);
6117ef63 246 pESD->SetRunNumber(GetRunNo());
6700298e 247 pESD->SetPeriodNumber(GetPeriodNumber());
248 pESD->SetOrbitNumber(GetOrbitNumber());
249 pESD->SetBunchCrossNumber(GetBunchCrossNumber());
250 pESD->SetTimeStamp(GetTimeStamp());
a1408c4b 251
6117ef63 252 const AliHLTCTPData* pCTPData=CTPData();
253 if (pCTPData) {
254 AliHLTUInt64_t mask=pCTPData->ActiveTriggers(trigData);
255 for (int index=0; index<gkNCTPTriggerClasses; index++) {
256 if ((mask&((AliHLTUInt64_t)0x1<<index)) == 0) continue;
257 pESD->SetTriggerClass(pCTPData->Name(index), index);
258 }
259 pESD->SetTriggerMask(mask);
260 }
261
a1408c4b 262 TTree* pTree = NULL;
263 if (fWriteTree)
264 pTree = new TTree("esdTree", "Tree with HLT ESD objects");
265
266 if (pTree) {
267 pTree->SetDirectory(0);
268 }
269
81509fd3 270 if ((iResult=ProcessBlocks(pTree, pESD))>=0) {
a1408c4b 271 // TODO: set the specification correctly
272 if (pTree) {
273 // the esd structure is written to the user info and is
274 // needed in te ReadFromTree method to read all objects correctly
275 pTree->GetUserInfo()->Add(pESD);
276 pESD->WriteToTree(pTree);
7a9de6d1 277 iResult=PushBack(pTree, kAliHLTDataTypeESDTree|kAliHLTDataOriginOut, 0);
a1408c4b 278 } else {
7a9de6d1 279 iResult=PushBack(pESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginOut, 0);
a1408c4b 280 }
281 }
282 if (pTree) {
283 // clear user info list to prevent objects from being deleted
284 pTree->GetUserInfo()->Clear();
285 delete pTree;
286 }
287 return iResult;
288}
289
290int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* pESD)
291{
292 // see header file for class documentation
293
294 int iResult=0;
295 int iAddedDataBlocks=0;
296
297 // Barrel tracking
298
299 // in the first attempt this component reads the TPC tracks and updates in the
300 // second step from the ITS tracks
093b64dc 301
302
303 // first read MC information (if present)
304 std::map<int,int> mcLabels;
305
306 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrackMC|kAliHLTDataOriginTPC);
307 pBlock!=NULL; pBlock=GetNextInputBlock()) {
308 AliHLTTrackMCData* dataPtr = reinterpret_cast<AliHLTTrackMCData*>( pBlock->fPtr );
309 if (sizeof(AliHLTTrackMCData)+dataPtr->fCount*sizeof(AliHLTTrackMCLabel)==pBlock->fSize) {
310 for( unsigned int il=0; il<dataPtr->fCount; il++ ){
311 AliHLTTrackMCLabel &lab = dataPtr->fLabels[il];
312 mcLabels[lab.fTrackID] = lab.fMCLabel;
313 }
314 } else {
315 HLTWarning("data mismatch in block %s (0x%08x): count %d, size %d -> ignoring track MC information",
316 DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification,
317 dataPtr->fCount, pBlock->fSize);
318 }
319 }
320
0973c527 321 // read dEdx information (if present)
322
323 AliHLTFloat32_t *dEdxTPC = 0;
324 Int_t ndEdxTPC = 0;
325 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypedEdx|kAliHLTDataOriginTPC);
326 pBlock!=NULL; pBlock=GetNextInputBlock()) {
327 dEdxTPC = reinterpret_cast<AliHLTFloat32_t*>( pBlock->fPtr );
328 ndEdxTPC = pBlock->fSize / sizeof(AliHLTFloat32_t);
329 break;
330 }
331
cd60a73f 332 // convert the TPC tracks to ESD tracks
a1408c4b 333 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginTPC);
334 pBlock!=NULL; pBlock=GetNextInputBlock()) {
335 vector<AliHLTGlobalBarrelTrack> tracks;
81509fd3 336 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>=0) {
a1408c4b 337 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
338 element!=tracks.end(); element++) {
339 Float_t points[4] = {
340 element->GetX(),
341 element->GetY(),
342 element->GetLastPointX(),
343 element->GetLastPointY()
344 };
093b64dc 345
346 Int_t mcLabel = -1;
347 if( mcLabels.find(element->TrackID())!=mcLabels.end() )
348 mcLabel = mcLabels[element->TrackID()];
349 element->SetLabel( mcLabel );
350
a1408c4b 351 AliESDtrack iotrack;
550ecaab 352
353 // for the moment, the number of clusters are not set when processing the
354 // kTPCin update, only at kTPCout
355 // there ar emainly three parameters updated for kTPCout
356 // number of clusters
357 // chi2
358 // pid signal
359 // The first one can be updated already at that stage here, while the two others
360 // eventually require to update from the ITS tracks before. The exact scheme
361 // needs to be checked
c3261a7d 362 iotrack.SetID( element->TrackID() );
a1408c4b 363 iotrack.UpdateTrackParams(&(*element),AliESDtrack::kTPCin);
c3261a7d 364 {
f167b631 365 AliHLTGlobalBarrelTrack outPar(*element);
c3261a7d 366 outPar.AliExternalTrackParam::PropagateTo( element->GetLastPointX(), fSolenoidBz );
367 iotrack.UpdateTrackParams(&outPar,AliESDtrack::kTPCout);
368 }
a1408c4b 369 iotrack.SetTPCPoints(points);
0973c527 370 if( element->TrackID()<ndEdxTPC ){
7e32fedf 371 iotrack.SetTPCsignal( dEdxTPC[element->TrackID()], 0, 0 );
372 //AliTPCseed s;
373 //s.Set( element->GetX(), element->GetAlpha(),
374 //element->GetParameter(), element->GetCovariance() );
375 //s.SetdEdx( dEdxTPC[element->TrackID()] );
376 //s.CookPID();
377 //iotrack.SetTPCpid(s.TPCrPIDs() );
0973c527 378 } else {
379 if( dEdxTPC ) HLTWarning("Wrong number of dEdx TPC labels");
380 }
a1408c4b 381 pESD->AddTrack(&iotrack);
093b64dc 382 if (fVerbosity>0) element->Print();
a1408c4b 383 }
093b64dc 384 HLTInfo("converted %d track(s) to AliESDtrack and added to ESD", tracks.size());
a1408c4b 385 iAddedDataBlocks++;
386 } else if (iResult<0) {
093b64dc 387 HLTError("can not extract tracks from data block of type %s (specification %08x) of size %d: error %d",
388 DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification, pBlock->fSize, iResult);
a1408c4b 389 }
390 }
391
7f167a74 392
393 // Get ITS SPD vertex
394
395 for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS); iter != NULL; iter = GetNextInputObject() ) {
396 AliESDVertex *vtx = dynamic_cast<AliESDVertex*>(const_cast<TObject*>( iter ) );
397 pESD->SetPrimaryVertexSPD( vtx );
398 }
399
f167b631 400 // now update ESD tracks with the ITSOut info
401 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginITSOut);
cd60a73f 402 pBlock!=NULL; pBlock=GetNextInputBlock()) {
403 vector<AliHLTGlobalBarrelTrack> tracks;
404 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
405 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
406 element!=tracks.end(); element++) {
cd60a73f 407 int tpcID=element->TrackID();
408 // the ITS tracker assigns the TPC track used as seed for a certain track to
409 // the trackID
410 if( tpcID<0 || tpcID>=pESD->GetNumberOfTracks()) continue;
cd60a73f 411 AliESDtrack *tESD = pESD->GetTrack( tpcID );
f167b631 412 if( tESD ) tESD->UpdateTrackParams( &(*element), AliESDtrack::kITSout );
a1408c4b 413 }
cd60a73f 414 }
415 }
18ada816 416
f167b631 417 // now update ESD tracks with the ITS info
418 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginITS);
b7ed2eb4 419 pBlock!=NULL; pBlock=GetNextInputBlock()) {
420 vector<AliHLTGlobalBarrelTrack> tracks;
421 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
422 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
423 element!=tracks.end(); element++) {
b7ed2eb4 424 int tpcID=element->TrackID();
425 // the ITS tracker assigns the TPC track used as seed for a certain track to
426 // the trackID
427 if( tpcID<0 || tpcID>=pESD->GetNumberOfTracks()) continue;
428 AliESDtrack *tESD = pESD->GetTrack( tpcID );
f167b631 429 if( tESD ) tESD->UpdateTrackParams( &(*element), AliESDtrack::kITSin );
b7ed2eb4 430 }
431 }
432 }
433
d9386025 434 // update with vertices and vertex-fitted tracks
435
436 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeGlobalVertexer);
437 pBlock!=NULL; pBlock=GetNextInputBlock()) {
438
439 AliHLTGlobalVertexerComponent::FillESD( pESD, reinterpret_cast<AliHLTGlobalVertexerComponent::AliHLTGlobalVertexerData* >(pBlock->fPtr) );
440 }
441
b7ed2eb4 442
18ada816 443 // convert the HLT TRD tracks to ESD tracks
444 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack | kAliHLTDataOriginTRD);
445 pBlock!=NULL; pBlock=GetNextInputBlock()) {
446 vector<AliHLTGlobalBarrelTrack> tracks;
447 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
448 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
449 element!=tracks.end(); element++) {
450
451 Double_t TRDpid[AliPID::kSPECIES], eProb(0.2), restProb((1-eProb)/(AliPID::kSPECIES-1)); //eprob(element->GetTRDpid...);
452 for(Int_t i=0; i<AliPID::kSPECIES; i++){
453 switch(i){
454 case AliPID::kElectron: TRDpid[AliPID::kElectron]=eProb; break;
455 default: TRDpid[i]=restProb; break;
456 }
457 }
458
459 AliESDtrack iotrack;
460 iotrack.UpdateTrackParams(&(*element),AliESDtrack::kTRDin);
461 iotrack.SetTRDpid(TRDpid);
462
463 pESD->AddTrack(&iotrack);
464 if (fVerbosity>0) element->Print();
465 }
466 HLTInfo("converted %d track(s) to AliESDtrack and added to ESD", tracks.size());
467 iAddedDataBlocks++;
468 } else if (iResult<0) {
469 HLTError("can not extract tracks from data block of type %s (specification %08x) of size %d: error %d",
470 DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification, pBlock->fSize, iResult);
471 }
472 }
b4479a87 473 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeCaloCluster | kAliHLTDataOriginAny); pBlock!=NULL; pBlock=GetNextInputBlock())
9a9467ed 474 {
475 AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr = reinterpret_cast<AliHLTCaloClusterHeaderStruct*>(pBlock->fPtr);
476
477 HLTDebug("%d HLT clusters from spec: 0x%X", caloClusterHeaderPtr->fNClusters, pBlock->fSpecification);
478
479 AliHLTCaloClusterReader reader;
480 reader.SetMemory(caloClusterHeaderPtr);
481
482 AliHLTESDCaloClusterMaker clusterMaker;
483
484 int nClusters = clusterMaker.FillESD(pESD, caloClusterHeaderPtr);
485
486 HLTInfo("converted %d cluster(s) to AliESDCaloCluster and added to ESD", nClusters);
487 iAddedDataBlocks++;
488 }
f064ef44 489
490 // Add tracks from MUON.
491 for (const TObject* obj = GetFirstInputObject(kAliHLTAnyDataType | kAliHLTDataOriginMUON);
492 obj != NULL;
493 obj = GetNextInputObject()
494 )
495 {
496 const TClonesArray* tracklist = NULL;
497 if (obj->IsA() == AliESDEvent::Class())
498 {
499 const AliESDEvent* event = static_cast<const AliESDEvent*>(obj);
500 HLTDebug("Received a MUON ESD with specification: 0x%X", GetSpecification(obj));
501 if (event->GetList() == NULL) continue;
502 tracklist = dynamic_cast<const TClonesArray*>(event->GetList()->FindObject("MuonTracks"));
503 if (tracklist == NULL) continue;
504 }
505 else if (obj->IsA() == TClonesArray::Class())
506 {
507 tracklist = static_cast<const TClonesArray*>(obj);
508 HLTDebug("Received a MUON TClonesArray of tracks with specification: 0x%X", GetSpecification(obj));
509 }
510 else
511 {
512 // Cannot handle this object type.
513 continue;
514 }
515 HLTDebug("Received %d MUON tracks.", tracklist->GetEntriesFast());
516 if (tracklist->GetEntriesFast() > 0)
517 {
518 const AliESDMuonTrack* track = dynamic_cast<const AliESDMuonTrack*>(tracklist->UncheckedAt(0));
519 if (track == NULL)
520 {
521 HLTError(Form("%s from MUON does not contain AliESDMuonTrack objects.", obj->ClassName()));
522 continue;
a1408c4b 523 }
f064ef44 524 }
525 for (Int_t i = 0; i < tracklist->GetEntriesFast(); ++i)
526 {
527 const AliESDMuonTrack* track = static_cast<const AliESDMuonTrack*>(tracklist->UncheckedAt(i));
528 pESD->AddMuonTrack(track);
529 }
530 }
531
532 if (iAddedDataBlocks>0 && pTree) {
533 pTree->Fill();
534 }
a1408c4b 535
536 if (iResult>=0) iResult=iAddedDataBlocks;
537 return iResult;
538}