]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUON.cxx
Code revision:
[u/mrichter/AliRoot.git] / MUON / AliMUON.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
4c039060 15
88cb7938 16/* $Id$ */
17
a9e2aefa 18
19///////////////////////////////////////////////
fe4da5cc 20// Manager and hits classes for set:MUON //
21////////////////////////////////////////////////
22
88cb7938 23#include "Riostream.h"
24
25#include <AliPDG.h>
a897a37a 26#include <TBRIK.h>
88cb7938 27#include <TCanvas.h>
28#include <TDirectory.h>
29#include <TFile.h>
94de3818 30#include <TGeometry.h>
88cb7938 31#include <TMinuit.h>
fe4da5cc 32#include <TNode.h>
88cb7938 33#include <TNtuple.h>
fe4da5cc 34#include <TObjArray.h>
88cb7938 35#include <TObject.h>
36#include <TObjectTable.h>
37#include <TPad.h>
a897a37a 38#include <TParticle.h>
39#include <TROOT.h>
88cb7938 40#include <TRandom.h>
41#include <TRotMatrix.h>
42#include <TTUBE.h>
a9e2aefa 43#include <TTUBE.h>
88cb7938 44#include <TTree.h>
45#include <TVector.h>
46#include <TVirtualMC.h>
fe4da5cc 47
88cb7938 48#include "AliConst.h"
49#include "AliHeader.h"
50#include "AliHitMap.h"
51#include "AliLoader.h"
dbb4e169 52#include "AliRunDigitizer.h"
307d9d04 53#include "AliMC.h"
fac3a970 54#include "AliRun.h"
3fa6cfdd 55#include "AliMUONLoader.h"
fe4da5cc 56#include "AliMUON.h"
88cb7938 57#include "AliMUONChamberTrigger.h"
88cb7938 58#include "AliMUONConstants.h"
59#include "AliMUONDigit.h"
a9e2aefa 60#include "AliMUONHit.h"
88cb7938 61#include "AliMUONHitMapA1.h"
88cb7938 62#include "AliMUONMerger.h"
a9e2aefa 63#include "AliMUONPadHit.h"
a9e2aefa 64#include "AliMUONRawCluster.h"
88cb7938 65#include "AliMUONTransientDigit.h"
ecfa008b 66#include "AliMUONTriggerCircuit.h"
d1cd2474 67#include "AliMUONVGeometryBuilder.h"
dbb4e169 68#include "AliMUONDigitizerv2.h"
d1775029 69#include "AliMUONSDigitizerv1.h"
88cb7938 70
a9e2aefa 71
72// Defaults parameters for Z positions of chambers
73// taken from values for "stations" in AliMUON::AliMUON
74// const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.};
75// and from array "dstation" in AliMUONv1::CreateGeometry
76// Float_t dstation[5]={20., 20., 20, 20., 20.};
77// for tracking chambers,
78// according to (Z1 = zch - dstation) and (Z2 = zch + dstation)
79// for the first and second chambers in the station, respectively,
80// and from "DTPLANES" in AliMUONv1::CreateGeometry
81// const Float_t DTPLANES = 15.;
82// for trigger chambers,
83// according to (Z1 = zch) and (Z2 = zch + DTPLANES)
84// for the first and second chambers in the station, respectively
fe4da5cc 85
fe4da5cc 86ClassImp(AliMUON)
30178c30 87
ce3f5e87 88//__________________________________________________________________
fe4da5cc 89AliMUON::AliMUON()
30178c30 90 : AliDetector(),
91 fNCh(0),
92 fNTrackingCh(0),
93 fMUONData(0),
94 fSplitLevel(0),
95 fChambers(0),
96 fGeometryBuilders(0),
97 fTriggerCircuits(0),
98 fAccCut(kFALSE),
99 fAccMin(0.),
100 fAccMax(0.),
101 fMaxStepGas(0.),
102 fMaxStepAlu(0.),
103 fMaxDestepGas(0.),
104 fMaxDestepAlu(0.),
105 fMaxIterPad(0),
106 fCurIterPad(0),
107 fMerger(0)
fe4da5cc 108{
de05461e 109// Default Constructor
110//
1bd26093 111 fIshunt = 0;
fe4da5cc 112}
30178c30 113
ce3f5e87 114//__________________________________________________________________
fe4da5cc 115AliMUON::AliMUON(const char *name, const char *title)
30178c30 116 : AliDetector(name,title),
117 fNCh(AliMUONConstants::NCh()),
118 fNTrackingCh(AliMUONConstants::NTrackingCh()),
119 fMUONData(0),
120 fSplitLevel(0),
121 fChambers(0),
122 fGeometryBuilders(0),
123 fTriggerCircuits(0),
124 fAccCut(kFALSE),
125 fAccMin(0.),
126 fAccMax(0.),
127 fMaxStepGas(0.1),
128 fMaxStepAlu(0.1),
129 fMaxDestepGas(-1), // Negatives values are ignored by geant3 CONS200
130 fMaxDestepAlu(-1), // in the calculation of the tracking parameters
131 fMaxIterPad(0),
132 fCurIterPad(0),
133 fMerger(0)
fe4da5cc 134{
135//Begin_Html
136/*
a897a37a 137<img src="gif/alimuon.gif">
fe4da5cc 138*/
139//End_Html
f665c1ea 140
30178c30 141 fIshunt = 0;
a897a37a 142
ce3f5e87 143 SetMarkerColor(kRed);//
a9e2aefa 144//
ce3f5e87 145// Creating List of Chambers
a9e2aefa 146 Int_t ch;
f665c1ea 147 fChambers = new TObjArray(AliMUONConstants::NCh());
d1cd2474 148 fGeometryBuilders = new TObjArray(AliMUONConstants::NCh());
149
a9e2aefa 150 // Loop over stations
f665c1ea 151 for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
a9e2aefa 152 // Loop over 2 chambers in the station
ce3f5e87 153 for (Int_t stCH = 0; stCH < 2; stCH++) {
154 //
155 //
156 // Default Parameters for Muon Tracking Stations
157 ch = 2 * st + stCH;
158 if (ch < AliMUONConstants::NTrackingCh()) {
159 fChambers->AddAt(new AliMUONChamber(ch),ch);
160 } else {
161 fChambers->AddAt(new AliMUONChamberTrigger(ch),ch);
162 }
163 AliMUONChamber* chamber = (AliMUONChamber*) fChambers->At(ch);
d1cd2474 164 //chamber->SetGid(0);
ce3f5e87 165 // Default values for Z of chambers
166 chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch));
167 //
168 chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch));
169 // Set chamber inner and outer radius to default
170 chamber->SetRInner(AliMUONConstants::Dmin(st)/2);
171 chamber->SetROuter(AliMUONConstants::Dmax(st)/2);
172 //
173 } // Chamber stCH (0, 1) in
a9e2aefa 174 } // Station st (0...)
ce3f5e87 175
ce3f5e87 176 // cp new design of AliMUONTriggerDecision
177 fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit());
178 for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) {
179 fTriggerCircuits->AddAt(new AliMUONTriggerCircuit(),circ);
180 }
fe4da5cc 181}
30178c30 182
ce3f5e87 183//____________________________________________________________________
30178c30 184AliMUON::AliMUON(const AliMUON& rMUON)
185 : AliDetector(rMUON)
a9e2aefa 186{
30178c30 187// Protected copy constructor
188
189 Fatal("AliMUONMergerModule", "Not implemented.");
a9e2aefa 190}
30178c30 191
ce3f5e87 192//____________________________________________________________________
fe4da5cc 193AliMUON::~AliMUON()
194{
de05461e 195// Destructor
ce3f5e87 196 if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName());
197 fIshunt = 0;
198 if (fMerger) delete fMerger;
d1cd2474 199
200 if (fGeometryBuilders){
201 fGeometryBuilders->Delete();
202 delete fGeometryBuilders;
c6df4ef2 203 }
204 if (fChambers){
205 fChambers->Delete();
206 delete fChambers;
207 }
208 if (fTriggerCircuits){
209 fTriggerCircuits->Delete();
210 delete fTriggerCircuits;
211 }
212 delete fMUONData;
d1cd2474 213}
30178c30 214
215//________________________________________________________________________
216AliMUON& AliMUON::operator = (const AliMUON& rhs)
217{
218// Protected assignement operator
219
220 if (this == &rhs) return *this;
221
222 Fatal("operator=", "Not implemented.");
223
224 return *this;
225}
226
d1cd2474 227//_____________________________________________________________________________
228void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder)
229{
230// Adds the geometry builder to the list
231// ---
232
233 fGeometryBuilders->Add(geomBuilder);
a897a37a 234}
ce3f5e87 235//____________________________________________________________________
fe4da5cc 236void AliMUON::BuildGeometry()
237{
de05461e 238// Geometry for event display
5fd73042 239 for (Int_t i=0; i<7; i++) {
240 for (Int_t j=0; j<2; j++) {
241 Int_t id=2*i+j+1;
242 this->Chamber(id-1).SegmentationModel(1)->Draw("eventdisplay");
a897a37a 243 }
5fd73042 244 }
fe4da5cc 245}
ce3f5e87 246//__________________________________________________________________
247void AliMUON::SetTreeAddress()
a897a37a 248{
ce3f5e87 249 GetMUONData()->SetLoader(fLoader);
d1775029 250 // GetMUONData()->MakeBranch("D,S,RC");
251 // GetMUONData()->SetTreeAddress("H,D,S,RC");
52c9bc11 252 GetMUONData()->SetTreeAddress("H");
307d9d04 253 if (fHits != GetMUONData()->Hits()) {
ae31c826 254 if ( gAlice->GetMCApp() )
6d2f7cbd 255 if ( gAlice->GetMCApp()->GetHitLists() ) {
256 fHits = GetMUONData()->Hits();
257 gAlice->GetMCApp()->AddHitList(fHits); // For purifyKine, only necessary when Hit list is created in AliMUONData
258 }
307d9d04 259 }
6d2f7cbd 260 fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector
a9e2aefa 261}
262
ce3f5e87 263//____________________________________________________________________
a9e2aefa 264void AliMUON::SetPadSize(Int_t id, Int_t isec, Float_t p1, Float_t p2)
265{
de05461e 266// Set the pad size for chamber id and cathode isec
a9e2aefa 267 Int_t i=2*(id-1);
2682e810 268 ((AliMUONChamber*) fChambers->At(i)) ->SetPadSize(isec,p1,p2);
269 ((AliMUONChamber*) fChambers->At(i+1))->SetPadSize(isec,p1,p2);
a897a37a 270}
271
fe4da5cc 272//___________________________________________
a9e2aefa 273void AliMUON::SetChambersZ(const Float_t *Z)
274{
275 // Set Z values for all chambers (tracking and trigger)
276 // from the array pointed to by "Z"
f665c1ea 277 for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++)
2682e810 278 ((AliMUONChamber*) fChambers->At(ch))->SetZ(Z[ch]);
f665c1ea 279 return;
a9e2aefa 280}
ce3f5e87 281//_________________________________________________________________
a9e2aefa 282void AliMUON::SetChambersZToDefault()
fe4da5cc 283{
a9e2aefa 284 // Set Z values for all chambers (tracking and trigger)
285 // to default values
f665c1ea 286 SetChambersZ(AliMUONConstants::DefaultChamberZ());
a9e2aefa 287 return;
fe4da5cc 288}
ce3f5e87 289//_________________________________________________________________
a897a37a 290void AliMUON::SetChargeSlope(Int_t id, Float_t p1)
fe4da5cc 291{
de05461e 292// Set the inverse charge slope for chamber id
ce3f5e87 293 Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1);
294 //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1);
2682e810 295 ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1);
296 ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1);
fe4da5cc 297}
ce3f5e87 298//__________________________________________________________________
a897a37a 299void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2)
fe4da5cc 300{
de05461e 301// Set sigma of charge spread for chamber id
fe4da5cc 302 Int_t i=2*(id-1);
2682e810 303 ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2);
304 ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2);
fe4da5cc 305}
ce3f5e87 306//___________________________________________________________________
a897a37a 307void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1)
fe4da5cc 308{
de05461e 309// Set integration limits for charge spread
fe4da5cc 310 Int_t i=2*(id-1);
2682e810 311 ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1);
312 ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1);
fe4da5cc 313}
314
ce3f5e87 315//__________________________________________________________________
d09fafb0 316void AliMUON::SetMaxAdc(Int_t id, Int_t p1)
fe4da5cc 317{
de05461e 318// Set maximum number for ADCcounts (saturation)
fe4da5cc 319 Int_t i=2*(id-1);
2682e810 320 ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1);
321 ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1);
fe4da5cc 322}
ce3f5e87 323//__________________________________________________________________
a897a37a 324void AliMUON::SetMaxStepGas(Float_t p1)
fe4da5cc 325{
de05461e 326// Set stepsize in gas
ce3f5e87 327 fMaxStepGas=p1;
fe4da5cc 328}
ce3f5e87 329//__________________________________________________________________
a897a37a 330void AliMUON::SetMaxStepAlu(Float_t p1)
fe4da5cc 331{
de05461e 332// Set step size in Alu
fe4da5cc 333 fMaxStepAlu=p1;
334}
ce3f5e87 335//__________________________________________________________________
a897a37a 336void AliMUON::SetMaxDestepGas(Float_t p1)
fe4da5cc 337{
de05461e 338// Set maximum step size in Gas
fe4da5cc 339 fMaxDestepGas=p1;
340}
ce3f5e87 341//__________________________________________________________________
a897a37a 342void AliMUON::SetMaxDestepAlu(Float_t p1)
fe4da5cc 343{
de05461e 344// Set maximum step size in Alu
ce3f5e87 345 fMaxDestepAlu=p1;
fe4da5cc 346}
ce3f5e87 347//___________________________________________________________________
5c1f55c5 348void AliMUON::SetAcceptance(Bool_t acc, Float_t angmin, Float_t angmax)
fe4da5cc 349{
de05461e 350// Set acceptance cuts
ce3f5e87 351 fAccCut=acc;
352 fAccMin=angmin*TMath::Pi()/180;
353 fAccMax=angmax*TMath::Pi()/180;
354 Int_t ch;
355 if (acc) {
356 for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
357 // Loop over 2 chambers in the station
358 for (Int_t stCH = 0; stCH < 2; stCH++) {
359 ch = 2 * st + stCH;
360 // Set chamber inner and outer radius according to acceptance cuts
b13a15bc 361 Chamber(ch).SetRInner(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMin)));
362 Chamber(ch).SetROuter(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMax)));
ce3f5e87 363 } // chamber loop
364 } // station loop
365 }
fe4da5cc 366}
d1cd2474 367
368//____________________________________________________________________
369Float_t AliMUON::GetMaxStepGas() const
370{
371// Return stepsize in gas
372
373 return fMaxStepGas;
374}
375
376//____________________________________________________________________
377Float_t AliMUON::GetMaxStepAlu() const
378{
379// Return step size in Alu
380
381 return fMaxStepAlu;
382}
383
384//____________________________________________________________________
385Float_t AliMUON::GetMaxDestepGas() const
386{
387// Return maximum step size in Gas
388
389 return fMaxDestepGas;
390}
391
392//____________________________________________________________________
393Float_t AliMUON::GetMaxDestepAlu() const
394{
395// Return maximum step size in Gas
396
397 return fMaxDestepAlu;
398}
ce3f5e87 399//____________________________________________________________________
a30a000f 400void AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliSegmentation *segmentation)
fe4da5cc 401{
de05461e 402// Set the segmentation for chamber id cathode isec
2682e810 403 ((AliMUONChamber*) fChambers->At(id))->SetSegmentationModel(isec, segmentation);
fe4da5cc 404
405}
ce3f5e87 406//____________________________________________________________________
a9e2aefa 407void AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response)
fe4da5cc 408{
de05461e 409// Set the response for chamber id
2682e810 410 ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response);
fe4da5cc 411}
ce3f5e87 412//____________________________________________________________________
fe4da5cc 413void AliMUON::SetNsec(Int_t id, Int_t nsec)
414{
de05461e 415// Set number of segmented cathods for chamber id
2682e810 416 ((AliMUONChamber*) fChambers->At(id))->SetNsec(nsec);
fe4da5cc 417}
85a5290f 418//____________________________________________________________________
c92eb8ad 419AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const
85a5290f 420{
dbb4e169 421 return new AliMUONDigitizerv2(manager);
85a5290f 422}
ce3f5e87 423//_____________________________________________________________________
2ab0c725 424void AliMUON::SDigits2Digits()
425{
d963c261 426
427// write TreeD here
428
429 if (!fMerger) {
430 if (gAlice->GetDebug()>0) {
431 cerr<<"AliMUON::SDigits2Digits: create default AliMUONMerger "<<endl;
432 cerr<<" no merging, just digitization of 1 event will be done"<<endl;
433 }
434 fMerger = new AliMUONMerger();
2ab0c725 435 }
d963c261 436 fMerger->Init();
437 fMerger->Digitise();
438 char hname[30];
88cb7938 439 // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent());
440 fLoader->TreeD()->Write(hname,TObject::kOverwrite);
441 fLoader->TreeD()->Reset();
2ab0c725 442}
a9e2aefa 443
d1775029 444//_____________________________________________________________________
445void AliMUON::Hits2SDigits()
446{
dbb4e169 447 // Adaption of AliMUONSDigitizerv1 to be excuted by the AliSimulation framework
448 AliRunLoader* runLoader = fLoader->GetRunLoader();
449 AliRunDigitizer * manager = new AliRunDigitizer(1,1);
e191bb57 450 manager->SetInputStream(0,runLoader->GetFileName(),AliConfig::GetDefaultEventFolderName());
dbb4e169 451 AliMUONDigitizer * dMUON = new AliMUONSDigitizerv1(manager);
452 fLoader->LoadHits("READ");
453 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
454 runLoader->GetEvent(iEvent);
455 dMUON->Exec("");
456 }
457 fLoader->UnloadHits();
d1775029 458}
ce3f5e87 459//_______________________________________________________________________
3fa6cfdd 460AliLoader* AliMUON::MakeLoader(const char* topfoldername)
461{
462//builds standard getter (AliLoader type)
463//if detector wants to use castomized getter, it must overload this method
464
465 if (GetDebug())
466 Info("MakeLoader",
467 "Creating standard getter for detector %s. Top folder is %s.",
468 GetName(),topfoldername);
128843d9 469 fLoader = new AliLoader(GetName(),topfoldername);
ce3f5e87 470 fMUONData = new AliMUONData(fLoader,GetName(),GetName());
d652f85c 471 fMUONData->SetSplitLevel(fSplitLevel);
3fa6cfdd 472 return fLoader;
473}
ce3f5e87 474//_______________________________________________________________________
a9e2aefa 475AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters)
fe4da5cc 476{
5a35ac13 477// to be removed
fe4da5cc 478 // Initialise the pad iterator
479 // Return the address of the first padhit for hit
a897a37a 480 TClonesArray *theClusters = clusters;
fe4da5cc 481 Int_t nclust = theClusters->GetEntriesFast();
1bd28025 482 if (nclust && hit->PHlast() > 0) {
30178c30 483 fMaxIterPad=hit->PHlast();
484 fCurIterPad=hit->PHfirst();
485 return (AliMUONPadHit*) clusters->UncheckedAt(fCurIterPad-1);
fe4da5cc 486 } else {
487 return 0;
488 }
489}
ce3f5e87 490//_______________________________________________________________________
a9e2aefa 491AliMUONPadHit* AliMUON::NextPad(TClonesArray *clusters)
fe4da5cc 492{
5a35ac13 493 // To be removed
de05461e 494// Get next pad (in iterator)
495//
30178c30 496 fCurIterPad++;
497 if (fCurIterPad <= fMaxIterPad) {
498 return (AliMUONPadHit*) clusters->UncheckedAt(fCurIterPad-1);
fe4da5cc 499 } else {
500 return 0;
501 }
502}
ce3f5e87 503//_______________________________________________________________________
a897a37a 504
505AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster)
506{
de05461e 507//
508// Return rawcluster (icluster) for chamber ichamber and cathode icathod
509// Obsolete ??
ce3f5e87 510 TClonesArray *muonRawCluster = GetMUONData()->RawClusters(ichamber);
a897a37a 511 ResetRawClusters();
88cb7938 512 TTree *treeR = fLoader->TreeR();
a9e2aefa 513 Int_t nent=(Int_t)treeR->GetEntries();
514 treeR->GetEvent(nent-2+icathod-1);
515 //treeR->GetEvent(icathod);
516 //Int_t nrawcl = (Int_t)muonRawCluster->GetEntriesFast();
a897a37a 517
a9e2aefa 518 AliMUONRawCluster * mRaw = (AliMUONRawCluster*)muonRawCluster->UncheckedAt(icluster);
a897a37a 519 //printf("RawCluster _ nent nrawcl icluster mRaw %d %d %d%p\n",nent,nrawcl,icluster,mRaw);
520
521 return mRaw;
522}
ce3f5e87 523//________________________________________________________________________
1cae9436 524void AliMUON::SetMerger(AliMUONMerger* merger)
525{
526// Set pointer to merger
527 fMerger = merger;
528}
ce3f5e87 529//________________________________________________________________________
1cae9436 530AliMUONMerger* AliMUON::Merger()
531{
532// Return pointer to merger
533 return fMerger;
534}
ce3f5e87 535//________________________________________________________________________
48b32e42 536void AliMUON::RemapTrackHitIDs(Int_t* map)
537{
538// Remaps the track numbers in the hits arrays, so that they correspond
539// to the entry indices in the Kine tree.
540// The correspondance is not direct. To get the real index into the Kine tree
541// compute the particle index as follows:
542//
543// num_primaries = AliStack::GetNprimary();
544// num_tracks = AliStack::GetNtracks();
545// track = AliMUONHit::Track()
546//
547// if (track < num_primaries)
548// particleindex = track + num_tracks - num_primaries;
549// else
550// particleindex = track - num_primaries;
551
552 // Remap the track numbers based on the specified map.
553 AliMUONData* data = GetMUONData();
554 TClonesArray* hits = data->Hits();
555 for (Int_t i = 0; i < hits->GetEntriesFast(); i++)
556 {
557 AliMUONHit* hit = static_cast<AliMUONHit*>( hits->At(i) );
558 hit->SetTrack( map[hit->Track()] );
559 };
560};
561