Presenting to the outside world a (x,y) reference located at the center of the slat...
[u/mrichter/AliRoot.git] / MUON / AliMUONReconstructor.cxx
CommitLineData
cac2eb58 1/**************************************************************************
9ffe3ef4 2
cac2eb58 3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
9ffe3ef4 4
cac2eb58 5 * *
9ffe3ef4 6
cac2eb58 7 * Author: The ALICE Off-line Project. *
9ffe3ef4 8
cac2eb58 9 * Contributors are mentioned in the code where appropriate. *
9ffe3ef4 10
cac2eb58 11 * *
9ffe3ef4 12
cac2eb58 13 * Permission to use, copy, modify and distribute this software and its *
9ffe3ef4 14
cac2eb58 15 * documentation strictly for non-commercial purposes is hereby granted *
9ffe3ef4 16
cac2eb58 17 * without fee, provided that the above copyright notice appears in all *
9ffe3ef4 18
cac2eb58 19 * copies and that both the copyright notice and this permission notice *
9ffe3ef4 20
cac2eb58 21 * appear in the supporting documentation. The authors make no claims *
9ffe3ef4 22
cac2eb58 23 * about the suitability of this software for any purpose. It is *
9ffe3ef4 24
cac2eb58 25 * provided "as is" without express or implied warranty. *
9ffe3ef4 26
cac2eb58 27 **************************************************************************/
9ffe3ef4 28
cac2eb58 29/* $Id$ */
30
9ffe3ef4 31
32
cac2eb58 33///////////////////////////////////////////////////////////////////////////////
9ffe3ef4 34
cac2eb58 35// //
9ffe3ef4 36
b002ac70 37// class for MUON reconstruction //
9ffe3ef4 38
cac2eb58 39// //
9ffe3ef4 40
cac2eb58 41///////////////////////////////////////////////////////////////////////////////
9ffe3ef4 42
b002ac70 43#include <TParticle.h>
9ffe3ef4 44
30178c30 45#include <TArrayF.h>
46
9ffe3ef4 47
48
cac2eb58 49#include "AliRunLoader.h"
9ffe3ef4 50
b002ac70 51#include "AliHeader.h"
9ffe3ef4 52
b002ac70 53#include "AliGenEventHeader.h"
9ffe3ef4 54
cac2eb58 55#include "AliESD.h"
9ffe3ef4 56
cf464691 57#include "AliMUONReconstructor.h"
9ffe3ef4 58
29f1b13a 59
9ffe3ef4 60
cac2eb58 61#include "AliMUONData.h"
9ffe3ef4 62
29f1b13a 63#include "AliMUONTrackReconstructor.h"
9ffe3ef4 64
cac2eb58 65#include "AliMUONClusterReconstructor.h"
9ffe3ef4 66
cac2eb58 67#include "AliMUONClusterFinderVS.h"
9ffe3ef4 68
346fb008 69#include "AliMUONClusterFinderAZ.h"
9ffe3ef4 70
cac2eb58 71#include "AliMUONTrack.h"
9ffe3ef4 72
cac2eb58 73#include "AliMUONTrackParam.h"
9ffe3ef4 74
cac2eb58 75#include "AliMUONTriggerTrack.h"
9ffe3ef4 76
cac2eb58 77#include "AliESDMuonTrack.h"
9ffe3ef4 78
1197ff51 79#include "AliMUONRawData.h"
80
9ffe3ef4 81
82
cf464691 83#include "AliRawReader.h"
cac2eb58 84
29f1b13a 85
9ffe3ef4 86
87
88
cac2eb58 89ClassImp(AliMUONReconstructor)
9ffe3ef4 90
cac2eb58 91//_____________________________________________________________________________
9ffe3ef4 92
cac2eb58 93AliMUONReconstructor::AliMUONReconstructor()
9ffe3ef4 94
30178c30 95 : AliReconstructor()
9ffe3ef4 96
8789635b 97{
9ffe3ef4 98
8789635b 99}
9ffe3ef4 100
8789635b 101//_____________________________________________________________________________
9ffe3ef4 102
8789635b 103AliMUONReconstructor::~AliMUONReconstructor()
9ffe3ef4 104
cac2eb58 105{
9ffe3ef4 106
cac2eb58 107}
9ffe3ef4 108
cac2eb58 109//_____________________________________________________________________________
9ffe3ef4 110
cac2eb58 111void AliMUONReconstructor::Reconstruct(AliRunLoader* runLoader) const
9ffe3ef4 112
cac2eb58 113{
9ffe3ef4 114
cac2eb58 115// AliLoader
9ffe3ef4 116
cac2eb58 117 AliLoader* loader = runLoader->GetLoader("MUONLoader");
9ffe3ef4 118
cac2eb58 119 Int_t nEvents = runLoader->GetNumberOfEvents();
120
9ffe3ef4 121
122
cac2eb58 123// used local container for each method
9ffe3ef4 124
cac2eb58 125// passing fLoader as argument, could be avoided ???
9ffe3ef4 126
29f1b13a 127 AliMUONTrackReconstructor* recoEvent = new AliMUONTrackReconstructor(loader);
9ffe3ef4 128
cac2eb58 129 AliMUONData* dataEvent = recoEvent->GetMUONData();
9ffe3ef4 130
131 if (strstr(GetOption(),"Kalman")) recoEvent->SetTrackMethod(2); // Kalman
132
133 else recoEvent->SetTrackMethod(1); // original
134
135
cac2eb58 136
137 AliMUONClusterReconstructor* recoCluster = new AliMUONClusterReconstructor(loader);
9ffe3ef4 138
cac2eb58 139 AliMUONData* dataCluster = recoCluster->GetMUONData();
9ffe3ef4 140
7e4a628d 141 AliMUONClusterFinderVS *recModel = recoCluster->GetRecoModel();
9ffe3ef4 142
143 if (strstr(GetOption(),"AZ")) {
144
145 recModel = (AliMUONClusterFinderVS*) new AliMUONClusterFinderAZ(0,1);
146
147 recoCluster->SetRecoModel(recModel);
148
149 }
150
7e4a628d 151 recModel->SetGhostChi2Cut(10);
cac2eb58 152
9ffe3ef4 153
154
cac2eb58 155 loader->LoadDigits("READ");
9ffe3ef4 156
cac2eb58 157 loader->LoadRecPoints("RECREATE");
9ffe3ef4 158
cac2eb58 159 loader->LoadTracks("RECREATE");
9ffe3ef4 160
cac2eb58 161
9ffe3ef4 162
cac2eb58 163 // Loop over events
9ffe3ef4 164
cac2eb58 165 for(Int_t ievent = 0; ievent < nEvents; ievent++) {
9ffe3ef4 166
cac2eb58 167 printf("Event %d\n",ievent);
9ffe3ef4 168
cac2eb58 169 runLoader->GetEvent(ievent);
170
9ffe3ef4 171
172
8210cb40 173 //----------------------- digit2cluster & Trigger2Trigger -------------------
9ffe3ef4 174
cac2eb58 175 if (!loader->TreeR()) loader->MakeRecPointsContainer();
9ffe3ef4 176
cac2eb58 177
9ffe3ef4 178
cac2eb58 179 // tracking branch
9ffe3ef4 180
cac2eb58 181 dataCluster->MakeBranch("RC");
9ffe3ef4 182
cac2eb58 183 dataCluster->SetTreeAddress("D,RC");
9ffe3ef4 184
cac2eb58 185 recoCluster->Digits2Clusters();
9ffe3ef4 186
cac2eb58 187 dataCluster->Fill("RC");
188
9ffe3ef4 189
190
cac2eb58 191 // trigger branch
9ffe3ef4 192
ce3e25a8 193 dataCluster->MakeBranch("TC");
9ffe3ef4 194
ce3e25a8 195 dataCluster->SetTreeAddress("TC");
9ffe3ef4 196
7e4a628d 197 recoCluster->Trigger2Trigger();
9ffe3ef4 198
ce3e25a8 199 dataCluster->Fill("TC");
cac2eb58 200
9ffe3ef4 201
202
cac2eb58 203 loader->WriteRecPoints("OVERWRITE");
204
9ffe3ef4 205
206
cac2eb58 207 //---------------------------- Track & TriggerTrack ---------------------
9ffe3ef4 208
cac2eb58 209 if (!loader->TreeT()) loader->MakeTracksContainer();
210
9ffe3ef4 211
212
cac2eb58 213 // trigger branch
9ffe3ef4 214
cac2eb58 215 dataEvent->MakeBranch("RL"); //trigger track
9ffe3ef4 216
cac2eb58 217 dataEvent->SetTreeAddress("RL");
9ffe3ef4 218
cac2eb58 219 recoEvent->EventReconstructTrigger();
9ffe3ef4 220
cac2eb58 221 dataEvent->Fill("RL");
222
9ffe3ef4 223
224
cac2eb58 225 // tracking branch
9ffe3ef4 226
cac2eb58 227 dataEvent->MakeBranch("RT"); //track
9ffe3ef4 228
cac2eb58 229 dataEvent->SetTreeAddress("RT");
9ffe3ef4 230
cac2eb58 231 recoEvent->EventReconstruct();
9ffe3ef4 232
cac2eb58 233 dataEvent->Fill("RT");
234
9ffe3ef4 235
236
29f1b13a 237 loader->WriteTracks("OVERWRITE");
9ffe3ef4 238
cac2eb58 239
9ffe3ef4 240
cac2eb58 241 //--------------------------- Resetting branches -----------------------
9ffe3ef4 242
cac2eb58 243 dataCluster->ResetDigits();
9ffe3ef4 244
cac2eb58 245 dataCluster->ResetRawClusters();
9ffe3ef4 246
ce3e25a8 247 dataCluster->ResetTrigger();
cac2eb58 248
9ffe3ef4 249
250
cac2eb58 251 dataEvent->ResetRawClusters();
9ffe3ef4 252
cac2eb58 253 dataEvent->ResetTrigger();
9ffe3ef4 254
29f1b13a 255 dataEvent->ResetRecTracks();
9ffe3ef4 256
cac2eb58 257 dataEvent->ResetRecTriggerTracks();
29f1b13a 258
9ffe3ef4 259
260
cac2eb58 261 }
9ffe3ef4 262
cac2eb58 263 loader->UnloadDigits();
9ffe3ef4 264
cac2eb58 265 loader->UnloadRecPoints();
9ffe3ef4 266
cac2eb58 267 loader->UnloadTracks();
268
9ffe3ef4 269
270
cac2eb58 271 delete recoCluster;
9ffe3ef4 272
cac2eb58 273 delete recoEvent;
9ffe3ef4 274
cac2eb58 275}
cf464691 276
9ffe3ef4 277
278
cf464691 279//_____________________________________________________________________________
9ffe3ef4 280
cf464691 281void AliMUONReconstructor::Reconstruct(AliRunLoader* runLoader, AliRawReader* rawReader) const
9ffe3ef4 282
cf464691 283{
9ffe3ef4 284
cf464691 285// AliLoader
9ffe3ef4 286
cf464691 287 AliLoader* loader = runLoader->GetLoader("MUONLoader");
288
9ffe3ef4 289
290
cf464691 291// used local container for each method
9ffe3ef4 292
cf464691 293// passing fLoader as argument, could be avoided ???
9ffe3ef4 294
29f1b13a 295 AliMUONTrackReconstructor* recoEvent = new AliMUONTrackReconstructor(loader);
9ffe3ef4 296
cf464691 297 AliMUONData* dataEvent = recoEvent->GetMUONData();
298
9ffe3ef4 299
300
1197ff51 301 AliMUONRawData* rawData = new AliMUONRawData(loader);
9ffe3ef4 302
1197ff51 303 AliMUONData* dataCluster = rawData->GetMUONData();
304
9ffe3ef4 305
306
1197ff51 307 AliMUONClusterReconstructor* recoCluster = new AliMUONClusterReconstructor(loader, dataCluster);
9ffe3ef4 308
7e4a628d 309 AliMUONClusterFinderVS *recModel = recoCluster->GetRecoModel();
9ffe3ef4 310
7e4a628d 311 recModel->SetGhostChi2Cut(10);
cf464691 312
9ffe3ef4 313
314
cf464691 315 loader->LoadRecPoints("RECREATE");
9ffe3ef4 316
cf464691 317 loader->LoadTracks("RECREATE");
9ffe3ef4 318
ce6a659c 319 loader->LoadDigits("RECREATE");
320
321
9ffe3ef4 322
323
324
cf464691 325 // Loop over events
9ffe3ef4 326
8210cb40 327 Int_t iEvent = 0;
9ffe3ef4 328
cf464691 329
9ffe3ef4 330
8210cb40 331 while (rawReader->NextEvent()) {
9ffe3ef4 332
cf464691 333 printf("Event %d\n",iEvent);
9ffe3ef4 334
cf464691 335 runLoader->GetEvent(iEvent++);
ce6a659c 336
9ffe3ef4 337
338
ce6a659c 339 //----------------------- raw2digits & raw2trigger-------------------
9ffe3ef4 340
ce6a659c 341 if (!loader->TreeD()) loader->MakeDigitsContainer();
342
9ffe3ef4 343
344
a2da7817 345 // tracking branch
9ffe3ef4 346
a2da7817 347 dataCluster->MakeBranch("D");
9ffe3ef4 348
a2da7817 349 dataCluster->SetTreeAddress("D");
9ffe3ef4 350
a2da7817 351 rawData->ReadTrackerDDL(rawReader);
9ffe3ef4 352
a2da7817 353 dataCluster->Fill("D");
354
9ffe3ef4 355
356
a2da7817 357 // trigger branch
9ffe3ef4 358
a2da7817 359 dataCluster->MakeBranch("GLT");
9ffe3ef4 360
a2da7817 361 dataCluster->SetTreeAddress("GLT");
9ffe3ef4 362
a2da7817 363 rawData->ReadTriggerDDL(rawReader);
9ffe3ef4 364
a2da7817 365 dataCluster->Fill("GLT");
ce6a659c 366
9ffe3ef4 367
368
ce6a659c 369 loader->WriteDigits("OVERWRITE");
cf464691 370
9ffe3ef4 371
372
8210cb40 373 //----------------------- digit2cluster & Trigger2Trigger -------------------
9ffe3ef4 374
cf464691 375 if (!loader->TreeR()) loader->MakeRecPointsContainer();
9ffe3ef4 376
cf464691 377
9ffe3ef4 378
cf464691 379 // tracking branch
9ffe3ef4 380
cf464691 381 dataCluster->MakeBranch("RC");
9ffe3ef4 382
a2da7817 383 dataCluster->SetTreeAddress("RC");
9ffe3ef4 384
1197ff51 385 recoCluster->Digits2Clusters();
9ffe3ef4 386
cf464691 387 dataCluster->Fill("RC");
388
9ffe3ef4 389
390
cf464691 391 // trigger branch
9ffe3ef4 392
cf464691 393 dataCluster->MakeBranch("TC");
9ffe3ef4 394
cf464691 395 dataCluster->SetTreeAddress("TC");
9ffe3ef4 396
1197ff51 397 recoCluster->Trigger2Trigger();
9ffe3ef4 398
cf464691 399 dataCluster->Fill("TC");
400
9ffe3ef4 401
402
cf464691 403 loader->WriteRecPoints("OVERWRITE");
404
9ffe3ef4 405
406
cf464691 407 //---------------------------- Track & TriggerTrack ---------------------
9ffe3ef4 408
cf464691 409 if (!loader->TreeT()) loader->MakeTracksContainer();
410
9ffe3ef4 411
412
cf464691 413 // trigger branch
9ffe3ef4 414
cf464691 415 dataEvent->MakeBranch("RL"); //trigger track
9ffe3ef4 416
cf464691 417 dataEvent->SetTreeAddress("RL");
9ffe3ef4 418
cf464691 419 recoEvent->EventReconstructTrigger();
9ffe3ef4 420
cf464691 421 dataEvent->Fill("RL");
422
9ffe3ef4 423
424
cf464691 425 // tracking branch
9ffe3ef4 426
cf464691 427 dataEvent->MakeBranch("RT"); //track
9ffe3ef4 428
cf464691 429 dataEvent->SetTreeAddress("RT");
9ffe3ef4 430
cf464691 431 recoEvent->EventReconstruct();
9ffe3ef4 432
cf464691 433 dataEvent->Fill("RT");
434
9ffe3ef4 435
436
cf464691 437 loader->WriteTracks("OVERWRITE");
9ffe3ef4 438
cf464691 439
9ffe3ef4 440
cf464691 441 //--------------------------- Resetting branches -----------------------
9ffe3ef4 442
cf464691 443 dataCluster->ResetDigits();
9ffe3ef4 444
cf464691 445 dataCluster->ResetRawClusters();
9ffe3ef4 446
cf464691 447 dataCluster->ResetTrigger();
448
9ffe3ef4 449
450
cf464691 451 dataEvent->ResetRawClusters();
9ffe3ef4 452
cf464691 453 dataEvent->ResetTrigger();
9ffe3ef4 454
cf464691 455 dataEvent->ResetRecTracks();
9ffe3ef4 456
cf464691 457 dataEvent->ResetRecTriggerTracks();
9ffe3ef4 458
cf464691 459
9ffe3ef4 460
cf464691 461 }
9ffe3ef4 462
cf464691 463 loader->UnloadRecPoints();
9ffe3ef4 464
cf464691 465 loader->UnloadTracks();
9ffe3ef4 466
ce6a659c 467 loader->UnloadDigits();
cf464691 468
9ffe3ef4 469
470
cf464691 471 delete recoCluster;
9ffe3ef4 472
cf464691 473 delete recoEvent;
9ffe3ef4 474
cf464691 475}
476
9ffe3ef4 477
478
cac2eb58 479//_____________________________________________________________________________
9ffe3ef4 480
cac2eb58 481void AliMUONReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
9ffe3ef4 482
cac2eb58 483{
9ffe3ef4 484
cac2eb58 485 TClonesArray* recTracksArray = 0;
9ffe3ef4 486
cac2eb58 487 TClonesArray* recTrigTracksArray = 0;
9ffe3ef4 488
cac2eb58 489
9ffe3ef4 490
cac2eb58 491 AliLoader* loader = runLoader->GetLoader("MUONLoader");
9ffe3ef4 492
cac2eb58 493 loader->LoadTracks("READ");
9ffe3ef4 494
cac2eb58 495 AliMUONData* muonData = new AliMUONData(loader,"MUON","MUON");
496
9ffe3ef4 497
498
cac2eb58 499 // declaration
9ffe3ef4 500
a2da7817 501 Int_t iEvent;// nPart;
9ffe3ef4 502
a2da7817 503 Int_t nTrackHits;// nPrimary;
9ffe3ef4 504
cac2eb58 505 Double_t fitFmin;
9ffe3ef4 506
b002ac70 507 TArrayF vertex(3);
cac2eb58 508
9ffe3ef4 509
510
cac2eb58 511 Double_t bendingSlope, nonBendingSlope, inverseBendingMomentum;
9ffe3ef4 512
cac2eb58 513 Double_t xRec, yRec, zRec, chi2MatchTrigger;
9ffe3ef4 514
cac2eb58 515 Bool_t matchTrigger;
516
9ffe3ef4 517
518
b002ac70 519 // setting pointer for tracks, triggertracks & trackparam at vertex
9ffe3ef4 520
cac2eb58 521 AliMUONTrack* recTrack = 0;
9ffe3ef4 522
cac2eb58 523 AliMUONTrackParam* trackParam = 0;
9ffe3ef4 524
cac2eb58 525 AliMUONTriggerTrack* recTriggerTrack = 0;
9ffe3ef4 526
a2da7817 527// TParticle* particle = new TParticle();
9ffe3ef4 528
a2da7817 529// AliGenEventHeader* header = 0;
9ffe3ef4 530
cac2eb58 531 iEvent = runLoader->GetEventNumber();
9ffe3ef4 532
cac2eb58 533 runLoader->GetEvent(iEvent);
534
9ffe3ef4 535
536
b002ac70 537 // vertex calculation (maybe it exists already somewhere else)
9ffe3ef4 538
b002ac70 539 vertex[0] = vertex[1] = vertex[2] = 0.;
9ffe3ef4 540
a2da7817 541 // nPrimary = 0;
9ffe3ef4 542
a2da7817 543// if ( (header = runLoader->GetHeader()->GenEventHeader()) ) {
9ffe3ef4 544
a2da7817 545// header->PrimaryVertex(vertex);
9ffe3ef4 546
a2da7817 547// } else {
9ffe3ef4 548
a2da7817 549// runLoader->LoadKinematics("READ");
9ffe3ef4 550
a2da7817 551// runLoader->TreeK()->GetBranch("Particles")->SetAddress(&particle);
9ffe3ef4 552
a2da7817 553// nPart = (Int_t)runLoader->TreeK()->GetEntries();
9ffe3ef4 554
a2da7817 555// for(Int_t iPart = 0; iPart < nPart; iPart++) {
9ffe3ef4 556
a2da7817 557// runLoader->TreeK()->GetEvent(iPart);
9ffe3ef4 558
a2da7817 559// if (particle->GetFirstMother() == -1) {
9ffe3ef4 560
a2da7817 561// vertex[0] += particle->Vx();
9ffe3ef4 562
a2da7817 563// vertex[1] += particle->Vy();
9ffe3ef4 564
a2da7817 565// vertex[2] += particle->Vz();
9ffe3ef4 566
a2da7817 567// nPrimary++;
9ffe3ef4 568
a2da7817 569// }
9ffe3ef4 570
a2da7817 571// if (nPrimary) {
9ffe3ef4 572
a2da7817 573// vertex[0] /= (double)nPrimary;
9ffe3ef4 574
a2da7817 575// vertex[1] /= (double)nPrimary;
9ffe3ef4 576
a2da7817 577// vertex[2] /= (double)nPrimary;
9ffe3ef4 578
a2da7817 579// }
9ffe3ef4 580
a2da7817 581// }
9ffe3ef4 582
a2da7817 583// }
9ffe3ef4 584
cac2eb58 585 // setting ESD MUON class
9ffe3ef4 586
30178c30 587 AliESDMuonTrack* theESDTrack = new AliESDMuonTrack() ;
cac2eb58 588
9ffe3ef4 589
590
cac2eb58 591 //-------------------- trigger tracks-------------
9ffe3ef4 592
cac2eb58 593 Long_t trigPat = 0;
9ffe3ef4 594
cac2eb58 595 muonData->SetTreeAddress("RL");
9ffe3ef4 596
cac2eb58 597 muonData->GetRecTriggerTracks();
9ffe3ef4 598
cac2eb58 599 recTrigTracksArray = muonData->RecTriggerTracks();
600
9ffe3ef4 601
602
cac2eb58 603 // ready global trigger pattern from first track
9ffe3ef4 604
cac2eb58 605 if (recTrigTracksArray)
9ffe3ef4 606
cac2eb58 607 recTriggerTrack = (AliMUONTriggerTrack*) recTrigTracksArray->First();
9ffe3ef4 608
cac2eb58 609 if (recTriggerTrack) trigPat = recTriggerTrack->GetGTPattern();
610
9ffe3ef4 611
612
cac2eb58 613 //printf(">>> Event %d Number of Recconstructed tracks %d \n",iEvent, nrectracks);
9ffe3ef4 614
cac2eb58 615
9ffe3ef4 616
cac2eb58 617 // -------------------- tracks-------------
9ffe3ef4 618
cac2eb58 619 muonData->SetTreeAddress("RT");
9ffe3ef4 620
cac2eb58 621 muonData->GetRecTracks();
9ffe3ef4 622
cac2eb58 623 recTracksArray = muonData->RecTracks();
9ffe3ef4 624
cac2eb58 625
9ffe3ef4 626
cac2eb58 627 Int_t nRecTracks = 0;
9ffe3ef4 628
cac2eb58 629 if (recTracksArray)
9ffe3ef4 630
cac2eb58 631 nRecTracks = (Int_t) recTracksArray->GetEntriesFast(); //
9ffe3ef4 632
cac2eb58 633
9ffe3ef4 634
cac2eb58 635 // loop over tracks
9ffe3ef4 636
cac2eb58 637 for (Int_t iRecTracks = 0; iRecTracks < nRecTracks; iRecTracks++) {
638
9ffe3ef4 639
640
cac2eb58 641 // reading info from tracks
9ffe3ef4 642
cac2eb58 643 recTrack = (AliMUONTrack*) recTracksArray->At(iRecTracks);
644
9ffe3ef4 645
646
889a0215 647 trackParam = (AliMUONTrackParam*) (recTrack->GetTrackParamAtHit())->First();
9ffe3ef4 648
889a0215 649 trackParam->ExtrapToVertex(vertex[0],vertex[1],vertex[2]);
cac2eb58 650
9ffe3ef4 651
652
cac2eb58 653 bendingSlope = trackParam->GetBendingSlope();
9ffe3ef4 654
cac2eb58 655 nonBendingSlope = trackParam->GetNonBendingSlope();
9ffe3ef4 656
cac2eb58 657 inverseBendingMomentum = trackParam->GetInverseBendingMomentum();
9ffe3ef4 658
cac2eb58 659 xRec = trackParam->GetNonBendingCoor();
9ffe3ef4 660
cac2eb58 661 yRec = trackParam->GetBendingCoor();
9ffe3ef4 662
cac2eb58 663 zRec = trackParam->GetZ();
664
9ffe3ef4 665
666
cac2eb58 667 nTrackHits = recTrack->GetNTrackHits();
9ffe3ef4 668
cac2eb58 669 fitFmin = recTrack->GetFitFMin();
9ffe3ef4 670
cac2eb58 671 matchTrigger = recTrack->GetMatchTrigger();
9ffe3ef4 672
cac2eb58 673 chi2MatchTrigger = recTrack->GetChi2MatchTrigger();
674
9ffe3ef4 675
676
cac2eb58 677 // setting data member of ESD MUON
9ffe3ef4 678
30178c30 679 theESDTrack->SetInverseBendingMomentum(inverseBendingMomentum);
9ffe3ef4 680
30178c30 681 theESDTrack->SetThetaX(TMath::ATan(nonBendingSlope));
9ffe3ef4 682
30178c30 683 theESDTrack->SetThetaY(TMath::ATan(bendingSlope));
9ffe3ef4 684
889a0215 685 theESDTrack->SetZ(zRec);
9ffe3ef4 686
889a0215 687 theESDTrack->SetBendingCoor(yRec); // calculate vertex at ESD or Tracking level ?
9ffe3ef4 688
889a0215 689 theESDTrack->SetNonBendingCoor(xRec);
9ffe3ef4 690
30178c30 691 theESDTrack->SetChi2(fitFmin);
9ffe3ef4 692
30178c30 693 theESDTrack->SetNHit(nTrackHits);
9ffe3ef4 694
30178c30 695 theESDTrack->SetMatchTrigger(matchTrigger);
9ffe3ef4 696
30178c30 697 theESDTrack->SetChi2MatchTrigger(chi2MatchTrigger);
cac2eb58 698
9ffe3ef4 699
700
cac2eb58 701 // storing ESD MUON Track into ESD Event
9ffe3ef4 702
cac2eb58 703 if (nRecTracks != 0)
9ffe3ef4 704
30178c30 705 esd->AddMuonTrack(theESDTrack);
9ffe3ef4 706
cac2eb58 707 } // end loop tracks
708
9ffe3ef4 709
710
cac2eb58 711 // add global trigger pattern
9ffe3ef4 712
cac2eb58 713 if (nRecTracks != 0)
9ffe3ef4 714
cac2eb58 715 esd->SetTrigger(trigPat);
716
9ffe3ef4 717
718
cac2eb58 719 // reset muondata
9ffe3ef4 720
cac2eb58 721 muonData->ResetRecTracks();
9ffe3ef4 722
cac2eb58 723 muonData->ResetRecTriggerTracks();
724
9ffe3ef4 725
726
cac2eb58 727 //} // end loop on event
9ffe3ef4 728
cac2eb58 729 loader->UnloadTracks();
9ffe3ef4 730
a2da7817 731 // if (!header)
9ffe3ef4 732
a2da7817 733// runLoader->UnloadKinematics();
9ffe3ef4 734
30178c30 735 delete theESDTrack;
9ffe3ef4 736
cac2eb58 737 delete muonData;
9ffe3ef4 738
b002ac70 739 // delete particle;
9ffe3ef4 740
a2da7817 741}//_____________________________________________________________________________
9ffe3ef4 742
a2da7817 743void AliMUONReconstructor::FillESD(AliRunLoader* runLoader, AliRawReader* /*rawReader*/, AliESD* esd) const
9ffe3ef4 744
a2da7817 745{
9ffe3ef4 746
a2da7817 747 // don't need rawReader ???
9ffe3ef4 748
a2da7817 749 FillESD(runLoader, esd);
9ffe3ef4 750
cac2eb58 751}
9ffe3ef4 752