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