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