Making modifications so that the full tracker, ESD maker and decision components...
[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);
a1408c4b 151}
152
153AliHLTComponentDataType AliHLTGlobalEsdConverterComponent::GetOutputDataType()
154{
155 // see header file for class documentation
7a9de6d1 156 return kAliHLTDataTypeESDObject|kAliHLTDataOriginOut;
a1408c4b 157}
158
159void AliHLTGlobalEsdConverterComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
160{
161 // see header file for class documentation
162 constBase=2000000;
163 inputMultiplier=10.0;
164}
165
166int AliHLTGlobalEsdConverterComponent::DoInit(int argc, const char** argv)
167{
168 // see header file for class documentation
169 int iResult=0;
170 TString argument="";
171 int bMissingParam=0;
a1408c4b 172
f167b631 173 iResult=Reconfigure(NULL, NULL);
174 TString allArgs = "";
175 for ( int i = 0; i < argc; i++ ) {
176 if ( !allArgs.IsNull() ) allArgs += " ";
177 allArgs += argv[i];
178 }
a1408c4b 179
f167b631 180 TObjArray* pTokens=allArgs.Tokenize(" ");
181 if (pTokens) {
182 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
183 argument=((TObjString*)pTokens->At(i))->GetString();
184 if (argument.IsNull()) continue;
185
186 // -notree
187 if (argument.CompareTo("-notree")==0) {
188 fWriteTree=0;
189
190 // -tree
191 } else if (argument.CompareTo("-tree")==0) {
192 fWriteTree=1;
193 } else if (argument.CompareTo("-solenoidBz")==0) {
194 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
195 HLTInfo("Magnetic Field set to: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
196 fSolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof();
197 continue;
198 } else {
199 HLTError("unknown argument %s", argument.Data());
200 break;
201 }
a1408c4b 202 }
203 }
204 if (bMissingParam) {
205 HLTError("missing parameter for argument %s", argument.Data());
206 iResult=-EINVAL;
207 }
208
75970b8d 209 fSolenoidBz=GetBz();
210
a1408c4b 211 if (iResult>=0) {
a1408c4b 212 fESD = new AliESDEvent;
213 if (fESD) {
214 fESD->CreateStdContent();
215 } else {
216 iResult=-ENOMEM;
217 }
6117ef63 218
219 SetupCTPData();
a1408c4b 220 }
221
222 return iResult;
223}
224
225int AliHLTGlobalEsdConverterComponent::DoDeinit()
226{
227 // see header file for class documentation
228 if (fESD) delete fESD;
229 fESD=NULL;
230
231 return 0;
232}
233
234int AliHLTGlobalEsdConverterComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/,
6117ef63 235 AliHLTComponentTriggerData& trigData)
a1408c4b 236{
237 // see header file for class documentation
238 int iResult=0;
239 if (!fESD) return -ENODEV;
240
241 AliESDEvent* pESD = fESD;
242
243 pESD->Reset();
244 pESD->SetMagneticField(fSolenoidBz);
6117ef63 245 pESD->SetRunNumber(GetRunNo());
6700298e 246 pESD->SetPeriodNumber(GetPeriodNumber());
247 pESD->SetOrbitNumber(GetOrbitNumber());
248 pESD->SetBunchCrossNumber(GetBunchCrossNumber());
249 pESD->SetTimeStamp(GetTimeStamp());
a1408c4b 250
6117ef63 251 const AliHLTCTPData* pCTPData=CTPData();
252 if (pCTPData) {
253 AliHLTUInt64_t mask=pCTPData->ActiveTriggers(trigData);
254 for (int index=0; index<gkNCTPTriggerClasses; index++) {
255 if ((mask&((AliHLTUInt64_t)0x1<<index)) == 0) continue;
256 pESD->SetTriggerClass(pCTPData->Name(index), index);
257 }
258 pESD->SetTriggerMask(mask);
259 }
260
a1408c4b 261 TTree* pTree = NULL;
262 if (fWriteTree)
263 pTree = new TTree("esdTree", "Tree with HLT ESD objects");
264
265 if (pTree) {
266 pTree->SetDirectory(0);
267 }
268
81509fd3 269 if ((iResult=ProcessBlocks(pTree, pESD))>=0) {
a1408c4b 270 // TODO: set the specification correctly
271 if (pTree) {
272 // the esd structure is written to the user info and is
273 // needed in te ReadFromTree method to read all objects correctly
274 pTree->GetUserInfo()->Add(pESD);
275 pESD->WriteToTree(pTree);
7a9de6d1 276 iResult=PushBack(pTree, kAliHLTDataTypeESDTree|kAliHLTDataOriginOut, 0);
a1408c4b 277 } else {
7a9de6d1 278 iResult=PushBack(pESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginOut, 0);
a1408c4b 279 }
280 }
281 if (pTree) {
282 // clear user info list to prevent objects from being deleted
283 pTree->GetUserInfo()->Clear();
284 delete pTree;
285 }
286 return iResult;
287}
288
289int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* pESD)
290{
291 // see header file for class documentation
292
293 int iResult=0;
294 int iAddedDataBlocks=0;
295
296 // Barrel tracking
297
298 // in the first attempt this component reads the TPC tracks and updates in the
299 // second step from the ITS tracks
093b64dc 300
301
302 // first read MC information (if present)
303 std::map<int,int> mcLabels;
304
305 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrackMC|kAliHLTDataOriginTPC);
306 pBlock!=NULL; pBlock=GetNextInputBlock()) {
307 AliHLTTrackMCData* dataPtr = reinterpret_cast<AliHLTTrackMCData*>( pBlock->fPtr );
308 if (sizeof(AliHLTTrackMCData)+dataPtr->fCount*sizeof(AliHLTTrackMCLabel)==pBlock->fSize) {
309 for( unsigned int il=0; il<dataPtr->fCount; il++ ){
310 AliHLTTrackMCLabel &lab = dataPtr->fLabels[il];
311 mcLabels[lab.fTrackID] = lab.fMCLabel;
312 }
313 } else {
314 HLTWarning("data mismatch in block %s (0x%08x): count %d, size %d -> ignoring track MC information",
315 DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification,
316 dataPtr->fCount, pBlock->fSize);
317 }
318 }
319
0973c527 320 // read dEdx information (if present)
321
322 AliHLTFloat32_t *dEdxTPC = 0;
323 Int_t ndEdxTPC = 0;
324 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypedEdx|kAliHLTDataOriginTPC);
325 pBlock!=NULL; pBlock=GetNextInputBlock()) {
326 dEdxTPC = reinterpret_cast<AliHLTFloat32_t*>( pBlock->fPtr );
327 ndEdxTPC = pBlock->fSize / sizeof(AliHLTFloat32_t);
328 break;
329 }
330
cd60a73f 331 // convert the TPC tracks to ESD tracks
a1408c4b 332 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginTPC);
333 pBlock!=NULL; pBlock=GetNextInputBlock()) {
334 vector<AliHLTGlobalBarrelTrack> tracks;
81509fd3 335 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>=0) {
a1408c4b 336 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
337 element!=tracks.end(); element++) {
338 Float_t points[4] = {
339 element->GetX(),
340 element->GetY(),
341 element->GetLastPointX(),
342 element->GetLastPointY()
343 };
093b64dc 344
345 Int_t mcLabel = -1;
346 if( mcLabels.find(element->TrackID())!=mcLabels.end() )
347 mcLabel = mcLabels[element->TrackID()];
348 element->SetLabel( mcLabel );
349
a1408c4b 350 AliESDtrack iotrack;
550ecaab 351
352 // for the moment, the number of clusters are not set when processing the
353 // kTPCin update, only at kTPCout
354 // there ar emainly three parameters updated for kTPCout
355 // number of clusters
356 // chi2
357 // pid signal
358 // The first one can be updated already at that stage here, while the two others
359 // eventually require to update from the ITS tracks before. The exact scheme
360 // needs to be checked
c3261a7d 361 iotrack.SetID( element->TrackID() );
a1408c4b 362 iotrack.UpdateTrackParams(&(*element),AliESDtrack::kTPCin);
c3261a7d 363 {
f167b631 364 AliHLTGlobalBarrelTrack outPar(*element);
c3261a7d 365 outPar.AliExternalTrackParam::PropagateTo( element->GetLastPointX(), fSolenoidBz );
366 iotrack.UpdateTrackParams(&outPar,AliESDtrack::kTPCout);
367 }
a1408c4b 368 iotrack.SetTPCPoints(points);
0973c527 369 if( element->TrackID()<ndEdxTPC ){
7e32fedf 370 iotrack.SetTPCsignal( dEdxTPC[element->TrackID()], 0, 0 );
371 //AliTPCseed s;
372 //s.Set( element->GetX(), element->GetAlpha(),
373 //element->GetParameter(), element->GetCovariance() );
374 //s.SetdEdx( dEdxTPC[element->TrackID()] );
375 //s.CookPID();
376 //iotrack.SetTPCpid(s.TPCrPIDs() );
0973c527 377 } else {
378 if( dEdxTPC ) HLTWarning("Wrong number of dEdx TPC labels");
379 }
a1408c4b 380 pESD->AddTrack(&iotrack);
093b64dc 381 if (fVerbosity>0) element->Print();
a1408c4b 382 }
093b64dc 383 HLTInfo("converted %d track(s) to AliESDtrack and added to ESD", tracks.size());
a1408c4b 384 iAddedDataBlocks++;
385 } else if (iResult<0) {
093b64dc 386 HLTError("can not extract tracks from data block of type %s (specification %08x) of size %d: error %d",
387 DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification, pBlock->fSize, iResult);
a1408c4b 388 }
389 }
390
7f167a74 391
392 // Get ITS SPD vertex
393
394 for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS); iter != NULL; iter = GetNextInputObject() ) {
395 AliESDVertex *vtx = dynamic_cast<AliESDVertex*>(const_cast<TObject*>( iter ) );
396 pESD->SetPrimaryVertexSPD( vtx );
397 }
398
f167b631 399 // now update ESD tracks with the ITSOut info
400 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginITSOut);
cd60a73f 401 pBlock!=NULL; pBlock=GetNextInputBlock()) {
402 vector<AliHLTGlobalBarrelTrack> tracks;
403 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
404 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
405 element!=tracks.end(); element++) {
cd60a73f 406 int tpcID=element->TrackID();
407 // the ITS tracker assigns the TPC track used as seed for a certain track to
408 // the trackID
409 if( tpcID<0 || tpcID>=pESD->GetNumberOfTracks()) continue;
cd60a73f 410 AliESDtrack *tESD = pESD->GetTrack( tpcID );
f167b631 411 if( tESD ) tESD->UpdateTrackParams( &(*element), AliESDtrack::kITSout );
a1408c4b 412 }
cd60a73f 413 }
414 }
18ada816 415
f167b631 416 // now update ESD tracks with the ITS info
417 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack|kAliHLTDataOriginITS);
b7ed2eb4 418 pBlock!=NULL; pBlock=GetNextInputBlock()) {
419 vector<AliHLTGlobalBarrelTrack> tracks;
420 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
421 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
422 element!=tracks.end(); element++) {
b7ed2eb4 423 int tpcID=element->TrackID();
424 // the ITS tracker assigns the TPC track used as seed for a certain track to
425 // the trackID
426 if( tpcID<0 || tpcID>=pESD->GetNumberOfTracks()) continue;
427 AliESDtrack *tESD = pESD->GetTrack( tpcID );
f167b631 428 if( tESD ) tESD->UpdateTrackParams( &(*element), AliESDtrack::kITSin );
b7ed2eb4 429 }
430 }
431 }
432
d9386025 433 // update with vertices and vertex-fitted tracks
434
435 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeGlobalVertexer);
436 pBlock!=NULL; pBlock=GetNextInputBlock()) {
437
438 AliHLTGlobalVertexerComponent::FillESD( pESD, reinterpret_cast<AliHLTGlobalVertexerComponent::AliHLTGlobalVertexerData* >(pBlock->fPtr) );
439 }
440
b7ed2eb4 441
18ada816 442 // convert the HLT TRD tracks to ESD tracks
443 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTrack | kAliHLTDataOriginTRD);
444 pBlock!=NULL; pBlock=GetNextInputBlock()) {
445 vector<AliHLTGlobalBarrelTrack> tracks;
446 if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
447 for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
448 element!=tracks.end(); element++) {
449
450 Double_t TRDpid[AliPID::kSPECIES], eProb(0.2), restProb((1-eProb)/(AliPID::kSPECIES-1)); //eprob(element->GetTRDpid...);
451 for(Int_t i=0; i<AliPID::kSPECIES; i++){
452 switch(i){
453 case AliPID::kElectron: TRDpid[AliPID::kElectron]=eProb; break;
454 default: TRDpid[i]=restProb; break;
455 }
456 }
457
458 AliESDtrack iotrack;
459 iotrack.UpdateTrackParams(&(*element),AliESDtrack::kTRDin);
460 iotrack.SetTRDpid(TRDpid);
461
462 pESD->AddTrack(&iotrack);
463 if (fVerbosity>0) element->Print();
464 }
465 HLTInfo("converted %d track(s) to AliESDtrack and added to ESD", tracks.size());
466 iAddedDataBlocks++;
467 } else if (iResult<0) {
468 HLTError("can not extract tracks from data block of type %s (specification %08x) of size %d: error %d",
469 DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification, pBlock->fSize, iResult);
470 }
471 }
b4479a87 472 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeCaloCluster | kAliHLTDataOriginAny); pBlock!=NULL; pBlock=GetNextInputBlock())
9a9467ed 473 {
474 AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr = reinterpret_cast<AliHLTCaloClusterHeaderStruct*>(pBlock->fPtr);
475
476 HLTDebug("%d HLT clusters from spec: 0x%X", caloClusterHeaderPtr->fNClusters, pBlock->fSpecification);
477
478 AliHLTCaloClusterReader reader;
479 reader.SetMemory(caloClusterHeaderPtr);
480
481 AliHLTESDCaloClusterMaker clusterMaker;
482
483 int nClusters = clusterMaker.FillESD(pESD, caloClusterHeaderPtr);
484
485 HLTInfo("converted %d cluster(s) to AliESDCaloCluster and added to ESD", nClusters);
486 iAddedDataBlocks++;
487 }
f064ef44 488
489 // Add tracks from MUON.
490 for (const TObject* obj = GetFirstInputObject(kAliHLTAnyDataType | kAliHLTDataOriginMUON);
491 obj != NULL;
492 obj = GetNextInputObject()
493 )
494 {
495 const TClonesArray* tracklist = NULL;
496 if (obj->IsA() == AliESDEvent::Class())
497 {
498 const AliESDEvent* event = static_cast<const AliESDEvent*>(obj);
499 HLTDebug("Received a MUON ESD with specification: 0x%X", GetSpecification(obj));
500 if (event->GetList() == NULL) continue;
501 tracklist = dynamic_cast<const TClonesArray*>(event->GetList()->FindObject("MuonTracks"));
502 if (tracklist == NULL) continue;
503 }
504 else if (obj->IsA() == TClonesArray::Class())
505 {
506 tracklist = static_cast<const TClonesArray*>(obj);
507 HLTDebug("Received a MUON TClonesArray of tracks with specification: 0x%X", GetSpecification(obj));
508 }
509 else
510 {
511 // Cannot handle this object type.
512 continue;
513 }
514 HLTDebug("Received %d MUON tracks.", tracklist->GetEntriesFast());
515 if (tracklist->GetEntriesFast() > 0)
516 {
517 const AliESDMuonTrack* track = dynamic_cast<const AliESDMuonTrack*>(tracklist->UncheckedAt(0));
518 if (track == NULL)
519 {
520 HLTError(Form("%s from MUON does not contain AliESDMuonTrack objects.", obj->ClassName()));
521 continue;
a1408c4b 522 }
f064ef44 523 }
524 for (Int_t i = 0; i < tracklist->GetEntriesFast(); ++i)
525 {
526 const AliESDMuonTrack* track = static_cast<const AliESDMuonTrack*>(tracklist->UncheckedAt(i));
527 pESD->AddMuonTrack(track);
528 }
529 }
530
531 if (iAddedDataBlocks>0 && pTree) {
532 pTree->Fill();
533 }
a1408c4b 534
535 if (iResult>=0) iResult=iAddedDataBlocks;
536 return iResult;
537}