1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 Revision 1.22 2000/06/28 08:06:10 morsch
18 Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the
19 algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton.
20 It also naturally takes care of the TMinuit instance.
22 Revision 1.21 2000/06/27 08:54:41 morsch
23 Problems with on constant array sizes (in hitMap, nmuon, xhit, yhit) corrected.
25 Revision 1.20 2000/06/26 14:02:38 morsch
26 Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
28 Revision 1.19 2000/06/22 13:40:51 morsch
29 scope problem on HP, "i" declared once
30 pow changed to TMath::Power (PH, AM)
32 Revision 1.18 2000/06/15 07:58:48 morsch
33 Code from MUON-dev joined
35 Revision 1.14.4.17 2000/06/14 14:36:46 morsch
36 - add TriggerCircuit (PC)
37 - add GlobalTrigger and LocalTrigger and specific methods (PC)
39 Revision 1.14.4.16 2000/06/09 21:20:28 morsch
40 Most coding rule violations corrected
42 Revision 1.14.4.15 2000/05/02 09:54:32 morsch
43 RULE RN17 violations corrected
45 Revision 1.14.4.12 2000/04/26 12:25:02 morsch
46 Code revised by P. Crochet:
47 - Z position of TriggerChamber changed according to A.Tournaire Priv.Comm.
48 - ToF included in the method MakePadHits
49 - inner radius of flange between beam shielding and trigger corrected
50 - Trigger global volume updated (according to the new geometry)
52 Revision 1.14.4.11 2000/04/19 19:42:08 morsch
53 Some changes of variable names curing viols and methods concerning
54 correlated clusters removed.
56 Revision 1.14.4.10 2000/03/22 16:44:07 gosset
57 Memory leak suppressed in function Digitise:
58 p_adr->Delete() instead of Clear (I.Chevrot and A.Baldisseri)
60 Revision 1.14.4.9 2000/03/20 18:15:25 morsch
61 Positions of trigger chambers corrected (P.C.)
63 Revision 1.14.4.8 2000/02/21 15:38:01 morsch
64 Call to AddHitList introduced to make this version compatible with head.
66 Revision 1.14.4.7 2000/02/20 07:45:53 morsch
67 Bugs in Trigger part of BuildGeomemetry corrected (P.C)
69 Revision 1.14.4.6 2000/02/17 14:28:54 morsch
70 Trigger included into initialization and digitization
72 Revision 1.14.4.5 2000/02/15 10:02:58 morsch
73 Log messages of previous revisions added
75 Revision 1.14.4.2 2000/02/04 10:57:34 gosset
76 Z position of the chambers:
77 it was the Z position of the stations;
78 it is now really the Z position of the chambers.
79 !!!! WARNING: THE CALLS TO "AliMUONChamber::SetZPOS"
80 !!!! AND "AliMUONChamber::ZPosition"
81 !!!! HAVE TO BE CHANGED TO "AliMUONChamber::"SetZ"
82 !!!! AND "AliMUONChamber::Z"
84 Revision 1.14.4.3 2000/02/04 16:19:04 gosset
85 Correction for mis-spelling of NCH
87 Revision 1.14.4.4 2000/02/15 09:43:38 morsch
93 ///////////////////////////////////////////////
94 // Manager and hits classes for set:MUON //
95 ////////////////////////////////////////////////
99 #include <TRotMatrix.h>
105 #include <TObjArray.h>
107 #include <TParticle.h>
113 #include <TDirectory.h>
114 #include <TObjectTable.h>
119 #include "AliMUONHit.h"
120 #include "AliMUONPadHit.h"
121 #include "AliMUONDigit.h"
122 #include "AliMUONTransientDigit.h"
123 #include "AliMUONRawCluster.h"
124 #include "AliMUONLocalTrigger.h"
125 #include "AliMUONGlobalTrigger.h"
126 #include "AliMUONHitMap.h"
127 #include "AliMUONHitMapA1.h"
128 #include "AliMUONChamberTrigger.h"
129 #include "AliMUONConstants.h"
130 #include "AliMUONClusterFinderVS.h"
131 #include "AliMUONTriggerDecision.h"
134 #include "AliMUONClusterInput.h"
135 #include "iostream.h"
136 #include "AliCallf77.h"
137 #include "AliConst.h"
139 // Defaults parameters for Z positions of chambers
140 // taken from values for "stations" in AliMUON::AliMUON
141 // const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.};
142 // and from array "dstation" in AliMUONv1::CreateGeometry
143 // Float_t dstation[5]={20., 20., 20, 20., 20.};
144 // for tracking chambers,
145 // according to (Z1 = zch - dstation) and (Z2 = zch + dstation)
146 // for the first and second chambers in the station, respectively,
147 // and from "DTPLANES" in AliMUONv1::CreateGeometry
148 // const Float_t DTPLANES = 15.;
149 // for trigger chambers,
150 // according to (Z1 = zch) and (Z2 = zch + DTPLANES)
151 // for the first and second chambers in the station, respectively
154 //___________________________________________
162 fTriggerCircuits = 0; // cp new design of AliMUONTriggerDecision
172 //___________________________________________
173 AliMUON::AliMUON(const char *name, const char *title)
174 : AliDetector(name,title)
178 <img src="gif/alimuon.gif">
182 fHits = new TClonesArray("AliMUONHit",1000);
183 gAlice->AddHitList(fHits);
184 fPadHits = new TClonesArray("AliMUONPadHit",10000);
188 fNdch = new Int_t[AliMUONConstants::NCh()];
190 fDchambers = new TObjArray(AliMUONConstants::NCh());
194 for (i=0; i<AliMUONConstants::NCh() ;i++) {
195 (*fDchambers)[i] = new TClonesArray("AliMUONDigit",10000);
199 fNrawch = new Int_t[AliMUONConstants::NTrackingCh()];
201 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
203 for (i=0; i<AliMUONConstants::NTrackingCh();i++) {
204 (*fRawClusters)[i] = new TClonesArray("AliMUONRawCluster",10000);
207 cout << " here " << "\n";
209 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
211 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
215 // Transport angular cut
220 SetMarkerColor(kRed);
228 fChambers = new TObjArray(AliMUONConstants::NCh());
230 // Loop over stations
231 for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
232 // Loop over 2 chambers in the station
233 for (Int_t stCH = 0; stCH < 2; stCH++) {
236 // Default Parameters for Muon Tracking Stations
241 if (ch < AliMUONConstants::NTrackingCh()) {
242 (*fChambers)[ch] = new AliMUONChamber();
244 (*fChambers)[ch] = new AliMUONChamberTrigger();
247 AliMUONChamber* chamber = (AliMUONChamber*) (*fChambers)[ch];
250 // Default values for Z of chambers
251 chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch));
253 chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch));
254 chamber->SetRInner(AliMUONConstants::Dmin(st)/2);
255 chamber->SetROuter(AliMUONConstants::Dmax(st)/2);
257 } // Chamber stCH (0, 1) in
258 } // Station st (0...)
267 // cp new design of AliMUONTriggerDecision
268 fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit());
269 for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) {
270 (*fTriggerCircuits)[circ] = new AliMUONTriggerCircuit();
272 // cp new design of AliMUONTriggerDecision
276 //___________________________________________
277 AliMUON::AliMUON(const AliMUON& rMUON)
279 // Dummy copy constructor
286 printf("Calling AliMUON destructor !!!\n");
293 delete fGlobalTrigger;
296 delete fLocalTrigger;
299 for (i=0;i<AliMUONConstants::NCh();i++) {
300 delete (*fDchambers)[i];
305 for (i=0;i<AliMUONConstants::NTrackingCh();i++) {
306 delete (*fRawClusters)[i];
311 for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) {
312 delete (*fTriggerCircuits)[circ];
314 delete fTriggerCircuits;
317 //___________________________________________
318 void AliMUON::AddHit(Int_t track, Int_t *vol, Float_t *hits)
320 TClonesArray &lhits = *fHits;
321 new(lhits[fNhits++]) AliMUONHit(fIshunt,track,vol,hits);
323 //___________________________________________
324 void AliMUON::AddPadHit(Int_t *clhits)
326 TClonesArray &lclusters = *fPadHits;
327 new(lclusters[fNPadHits++]) AliMUONPadHit(clhits);
329 //_____________________________________________________________________________
330 void AliMUON::AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits)
333 // Add a MUON digit to the list
336 TClonesArray &ldigits = *((TClonesArray*)(*fDchambers)[id]);
337 new(ldigits[fNdch[id]++]) AliMUONDigit(tracks,charges,digits);
340 //_____________________________________________________________________________
341 void AliMUON::AddRawCluster(Int_t id, const AliMUONRawCluster& c)
344 // Add a MUON digit to the list
347 TClonesArray &lrawcl = *((TClonesArray*)(*fRawClusters)[id]);
348 new(lrawcl[fNrawch[id]++]) AliMUONRawCluster(c);
351 //___________________________________________
352 void AliMUON::AddGlobalTrigger(Int_t *singlePlus, Int_t *singleMinus,
354 Int_t *pairUnlike, Int_t *pairLike)
356 // add a MUON Global Trigger to the list (only one GlobalTrigger per event !)
357 TClonesArray &globalTrigger = *fGlobalTrigger;
358 new(globalTrigger[fNGlobalTrigger++])
359 AliMUONGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike,
362 //___________________________________________
363 void AliMUON::AddLocalTrigger(Int_t *localtr)
365 // add a MUON Local Trigger to the list
366 TClonesArray &localTrigger = *fLocalTrigger;
367 new(localTrigger[fNLocalTrigger++]) AliMUONLocalTrigger(localtr);
370 //___________________________________________
371 void AliMUON::BuildGeometry()
373 TNode *node, *nodeF, *top, *nodeS;
374 const int kColorMUON = kBlue;
375 const int kColorMUON2 = kGreen;
377 top=gAlice->GetGeometry()->GetNode("alice");
380 // z-Positions of Chambers
381 const Float_t kCz[7]={511., 686., 971., 1245., 1445., 1600, 1700.};
382 // inner diameter (Xlenght for trigger chamber -> active area)
383 const Float_t kDmin[7]={ 35., 47., 67., 86., 100., 544., 544.};
384 // outer diameter (Ylenght for trigger chamber -> active area)
385 const Float_t kDmax[7]={183., 245., 346., 520., 520., 612., 612.};
387 TRotMatrix* rot000 = new TRotMatrix("Rot000"," ", 90, 0, 90, 90, 0, 0);
388 TRotMatrix* rot090 = new TRotMatrix("Rot090"," ", 90, 90, 90,180, 0, 0);
389 TRotMatrix* rot180 = new TRotMatrix("Rot180"," ", 90,180, 90,270, 0, 0);
390 TRotMatrix* rot270 = new TRotMatrix("Rot270"," ", 90,270, 90, 0, 0, 0);
392 Float_t rmin, rmax, dx, dy, dz, dr, xpos, ypos, zpos;
393 Float_t dzc1=4.; // tracking chambers
394 Float_t dzc2=15.; // trigger chambers
395 Float_t hole=102.; // x-y hole around beam pipe for trig. chambers
396 Float_t zscale; // scaling parameter trigger chambers
397 Float_t halfx, halfy;
398 char nameChamber[9], nameSense[9], nameFrame[9], nameNode[8];
399 char nameSense1[9], nameSense2[9];
400 for (Int_t i=0; i<7; i++) {
401 for (Int_t j=0; j<2; j++) {
403 if (i<5) { // tracking chambers
416 sprintf(nameChamber,"C_MUON%d",id);
417 sprintf(nameSense,"S_MUON%d",id);
418 sprintf(nameSense1,"S1_MUON%d",id);
419 sprintf(nameSense2,"S2_MUON%d",id);
420 sprintf(nameFrame,"F_MUON%d",id);
421 if (i<5) { // tracking chambers
422 rmin = kDmin[i]/2.-3;
423 rmax = kDmax[i]/2.+3;
424 new TTUBE(nameChamber,"Mother","void",rmin,rmax,0.25,1.);
427 new TTUBE(nameSense,"Sens. region","void",rmin,rmax,0.25, 1.);
431 TBRIK* frMUON = new TBRIK(nameFrame,"Frame","void",dx,dy,dz);
433 sprintf(nameNode,"MUON%d",100+id);
434 node = new TNode(nameNode,"ChamberNode",nameChamber,0,0,zpos,"");
435 node->SetLineColor(kColorMUON);
438 sprintf(nameNode,"MUON%d",200+id);
439 node = new TNode(nameNode,"Sens. Region Node",nameSense,0,0,0,"");
440 node->SetLineColor(kColorMUON);
443 sprintf(nameNode,"MUON%d",300+id);
444 nodeF = new TNode(nameNode,"Frame0",frMUON,dr, 0, 0,rot000,"");
445 nodeF->SetLineColor(kColorMUON);
447 sprintf(nameNode,"MUON%d",400+id);
448 nodeF = new TNode(nameNode,"Frame1",frMUON,0 ,dr,0,rot090,"");
449 nodeF->SetLineColor(kColorMUON);
451 sprintf(nameNode,"MUON%d",500+id);
452 nodeF = new TNode(nameNode,"Frame2",frMUON,-dr,0,0,rot180,"");
453 nodeF->SetLineColor(kColorMUON);
455 sprintf(nameNode,"MUON%d",600+id);
456 nodeF = new TNode(nameNode,"Frame3",frMUON,0,-dr,0,rot270,"");
457 nodeF->SetLineColor(kColorMUON);
460 Float_t xsize=kDmin[i]*zscale;
461 Float_t ysize=kDmax[i]*zscale;
462 Float_t holeScaled=hole*zscale;
466 new TBRIK(nameChamber,"Mother","void",halfx,halfy,0.25);
468 sprintf(nameNode,"MUON%d",100+id);
469 node = new TNode(nameNode,"Chambernode",nameChamber,0,0,zpos,"");
470 node->SetLineColor(kColorMUON2);
473 // up/down of beam pipe
475 halfy=(ysize/2.-holeScaled/2.)/2.;
476 new TBRIK(nameSense,"Sens. region","void",halfx,halfy,0.25);
479 ypos=holeScaled/2.+((ysize/2.-holeScaled/2.)/2.);
480 sprintf(nameNode,"MUON%d",200+id);
481 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense,0,ypos,0,"");
482 nodeS->SetLineColor(kColorMUON2);
486 sprintf(nameNode,"MUON%d",300+id);
487 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense,0,ypos,0,"");
488 nodeS->SetLineColor(kColorMUON2);
490 // left/right of beam pipe
491 halfx=(xsize/2.-holeScaled/2.)/2.;
493 new TBRIK(nameSense1,"Sens. region","void",halfx,halfy,0.25);
496 xpos=holeScaled/2.+((xsize/2.-holeScaled/2.)/2.);
497 sprintf(nameNode,"MUON%d",400+id);
498 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense1,xpos,0,0,"");
499 nodeS->SetLineColor(kColorMUON2);
503 sprintf(nameNode,"MUON%d",500+id);
504 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense1,xpos,0,0,"");
505 nodeS->SetLineColor(kColorMUON2);
510 new TBRIK(nameSense2,"Sens. region","void",halfx,halfy,0.25);
513 xpos=holeScaled/2.-halfx;
515 sprintf(nameNode,"MUON%d",600+id);
516 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
517 nodeS->SetLineColor(kColorMUON2);
521 sprintf(nameNode,"MUON%d",700+id);
522 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
523 nodeS->SetLineColor(kColorMUON2);
527 sprintf(nameNode,"MUON%d",800+id);
528 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
529 nodeS->SetLineColor(kColorMUON2);
533 sprintf(nameNode,"MUON%d",900+id);
534 nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
535 nodeS->SetLineColor(kColorMUON2);
542 //___________________________________________
543 Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t )
548 //___________________________________________
549 void AliMUON::MakeBranch(Option_t* option)
551 // Create Tree branches for the MUON.
552 const Int_t kBufferSize = 4000;
554 sprintf(branchname,"%sCluster",GetName());
556 AliDetector::MakeBranch(option);
558 if (fPadHits && gAlice->TreeH()) {
559 gAlice->TreeH()->Branch(branchname,&fPadHits, kBufferSize);
560 printf("Making Branch %s for clusters\n",branchname);
563 // one branch for digits per chamber
566 for (i=0; i<AliMUONConstants::NCh() ;i++) {
567 sprintf(branchname,"%sDigits%d",GetName(),i+1);
569 if (fDchambers && gAlice->TreeD()) {
570 gAlice->TreeD()->Branch(branchname,&((*fDchambers)[i]), kBufferSize);
571 printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
575 printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
577 // one branch for raw clusters per chamber
578 for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
579 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
581 if (fRawClusters && gAlice->TreeR()) {
582 gAlice->TreeR()->Branch(branchname,&((*fRawClusters)[i]), kBufferSize);
583 printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1);
587 // one branch for global trigger
588 sprintf(branchname,"%sGlobalTrigger",GetName());
589 if (fGlobalTrigger && gAlice->TreeR()) {
590 gAlice->TreeR()->Branch(branchname,&fGlobalTrigger,kBufferSize);
591 printf("Making Branch %s for Global Trigger\n",branchname);
593 // one branch for local trigger
594 sprintf(branchname,"%sLocalTrigger",GetName());
595 if (fLocalTrigger && gAlice->TreeR()) {
596 gAlice->TreeR()->Branch(branchname,&fLocalTrigger,kBufferSize);
597 printf("Making Branch %s for Local Trigger\n",branchname);
602 //___________________________________________
603 void AliMUON::SetTreeAddress()
605 // Set branch address for the Hits and Digits Tree.
607 AliDetector::SetTreeAddress();
610 TTree *treeH = gAlice->TreeH();
611 TTree *treeD = gAlice->TreeD();
612 TTree *treeR = gAlice->TreeR();
616 branch = treeH->GetBranch("MUONCluster");
617 if (branch) branch->SetAddress(&fPadHits);
622 for (int i=0; i<AliMUONConstants::NCh(); i++) {
623 sprintf(branchname,"%sDigits%d",GetName(),i+1);
625 branch = treeD->GetBranch(branchname);
626 if (branch) branch->SetAddress(&((*fDchambers)[i]));
631 // printf("SetTreeAddress --- treeR address %p \n",treeR);
634 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
635 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
637 branch = treeR->GetBranch(branchname);
638 if (branch) branch->SetAddress(&((*fRawClusters)[i]));
643 branch = treeR->GetBranch("MUONLocalTrigger");
644 if (branch) branch->SetAddress(&fLocalTrigger);
646 if (fGlobalTrigger) {
647 branch = treeR->GetBranch("MUONGlobalTrigger");
648 if (branch) branch->SetAddress(&fGlobalTrigger);
652 //___________________________________________
653 void AliMUON::ResetHits()
655 // Reset number of clusters and the cluster array for this detector
656 AliDetector::ResetHits();
658 if (fPadHits) fPadHits->Clear();
661 //____________________________________________
662 void AliMUON::ResetDigits()
665 // Reset number of digits and the digits array for this detector
667 for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
668 if ((*fDchambers)[i]) ((TClonesArray*)(*fDchambers)[i])->Clear();
669 if (fNdch) fNdch[i]=0;
672 //____________________________________________
673 void AliMUON::ResetRawClusters()
676 // Reset number of raw clusters and the raw clust array for this detector
678 for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) {
679 if ((*fRawClusters)[i]) ((TClonesArray*)(*fRawClusters)[i])->Clear();
680 if (fNrawch) fNrawch[i]=0;
684 //____________________________________________
685 void AliMUON::ResetTrigger()
687 // Reset Local and Global Trigger
689 if (fGlobalTrigger) fGlobalTrigger->Clear();
691 if (fLocalTrigger) fLocalTrigger->Clear();
694 //____________________________________________
695 void AliMUON::SetPadSize(Int_t id, Int_t isec, Float_t p1, Float_t p2)
698 ((AliMUONChamber*) (*fChambers)[i]) ->SetPadSize(isec,p1,p2);
699 ((AliMUONChamber*) (*fChambers)[i+1])->SetPadSize(isec,p1,p2);
702 //___________________________________________
703 void AliMUON::SetChambersZ(const Float_t *Z)
705 // Set Z values for all chambers (tracking and trigger)
706 // from the array pointed to by "Z"
707 for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++)
708 ((AliMUONChamber*) ((*fChambers)[ch]))->SetZ(Z[ch]);
712 //___________________________________________
713 void AliMUON::SetChambersZToDefault()
715 // Set Z values for all chambers (tracking and trigger)
717 SetChambersZ(AliMUONConstants::DefaultChamberZ());
721 //___________________________________________
722 void AliMUON::SetChargeSlope(Int_t id, Float_t p1)
725 ((AliMUONChamber*) (*fChambers)[i])->SetChargeSlope(p1);
726 ((AliMUONChamber*) (*fChambers)[i+1])->SetChargeSlope(p1);
729 //___________________________________________
730 void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2)
733 ((AliMUONChamber*) (*fChambers)[i])->SetChargeSpread(p1,p2);
734 ((AliMUONChamber*) (*fChambers)[i+1])->SetChargeSpread(p1,p2);
737 //___________________________________________
738 void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1)
741 ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1);
742 ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1);
745 //___________________________________________
746 void AliMUON::SetMaxAdc(Int_t id, Int_t p1)
749 ((AliMUONChamber*) (*fChambers)[i])->SetMaxAdc(p1);
750 ((AliMUONChamber*) (*fChambers)[i+1])->SetMaxAdc(p1);
753 //___________________________________________
754 void AliMUON::SetMaxStepGas(Float_t p1)
759 //___________________________________________
760 void AliMUON::SetMaxStepAlu(Float_t p1)
765 //___________________________________________
766 void AliMUON::SetMaxDestepGas(Float_t p1)
771 //___________________________________________
772 void AliMUON::SetMaxDestepAlu(Float_t p1)
776 //___________________________________________
777 void AliMUON::SetMuonAcc(Bool_t acc, Float_t angmin, Float_t angmax)
783 //___________________________________________
784 void AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliMUONSegmentation *segmentation)
786 ((AliMUONChamber*) (*fChambers)[id])->SetSegmentationModel(isec, segmentation);
789 //___________________________________________
790 void AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response)
792 ((AliMUONChamber*) (*fChambers)[id])->SetResponseModel(response);
795 void AliMUON::SetReconstructionModel(Int_t id, AliMUONClusterFinderVS *reconst)
797 ((AliMUONChamber*) (*fChambers)[id])->SetReconstructionModel(reconst);
800 void AliMUON::SetNsec(Int_t id, Int_t nsec)
802 ((AliMUONChamber*) (*fChambers)[id])->SetNsec(nsec);
806 //___________________________________________
810 void AliMUON::MakePadHits(Float_t xhit,Float_t yhit,
811 Float_t eloss, Float_t tof, Int_t idvol)
814 // Calls the charge disintegration method of the current chamber and adds
815 // the simulated cluster to the root treee
818 Float_t newclust[6][500];
823 // Integrated pulse height on chamber
829 ((AliMUONChamber*) (*fChambers)[idvol])
830 ->DisIntegration(eloss, tof, xhit, yhit, nnew, newclust);
835 for (Int_t i=0; i<nnew; i++) {
836 if (Int_t(newclust[3][i]) > 0) {
839 clhits[1] = Int_t(newclust[5][i]);
841 clhits[2] = Int_t(newclust[0][i]);
843 clhits[3] = Int_t(newclust[1][i]);
845 clhits[4] = Int_t(newclust[2][i]);
847 clhits[5] = Int_t(newclust[3][i]);
848 // Pad: chamber sector
849 clhits[6] = Int_t(newclust[4][i]);
856 //----------------------------------------------------------------------
858 void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,Text_t *filename)
860 // keep galice.root for signal and name differently the file for
861 // background when add! otherwise the track info for signal will be lost !
863 static Bool_t first=kTRUE;
865 char *addBackground = strstr(option,"Add");
868 AliMUONChamber* iChamber;
869 AliMUONSegmentation* segmentation;
874 TObjArray *list=new TObjArray;
875 static TClonesArray *pAddress=0;
876 if(!pAddress) pAddress=new TClonesArray("TVector",1000);
879 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
880 AliMUONHitMap** hitMap= new AliMUONHitMap* [AliMUONConstants::NCh()];
881 for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {hitMap[i]=0;}
882 if (addBackground ) {
885 cout<<"filename"<<fFileName<<endl;
886 file=new TFile(fFileName);
887 cout<<"I have opened "<<fFileName<<" file "<<endl;
888 fHits2 = new TClonesArray("AliMUONHit",1000 );
889 fPadHits2 = new TClonesArray("AliMUONPadHit",10000);
894 // Get Hits Tree header from file
895 if(fHits2) fHits2->Clear();
896 if(fPadHits2) fPadHits2->Clear();
897 if(fTrH1) delete fTrH1;
901 sprintf(treeName,"TreeH%d",bgrEvent);
902 fTrH1 = (TTree*)gDirectory->Get(treeName);
903 //printf("fTrH1 %p of treename %s for event %d \n",fTrH1,treeName,bgrEvent);
906 printf("ERROR: cannot find Hits Tree for event:%d\n",bgrEvent);
908 // Set branch addresses
911 sprintf(branchname,"%s",GetName());
912 if (fTrH1 && fHits2) {
913 branch = fTrH1->GetBranch(branchname);
914 if (branch) branch->SetAddress(&fHits2);
916 if (fTrH1 && fPadHits2) {
917 branch = fTrH1->GetBranch("MUONCluster");
918 if (branch) branch->SetAddress(&fPadHits2);
921 //Int_t ntracks1 =(Int_t)fTrH1->GetEntries();
922 //printf("background - ntracks1 - %d\n",ntracks1);
925 // loop over cathodes
929 for (int icat=0; icat<2; icat++) {
931 Int_t * nmuon = new Int_t [AliMUONConstants::NCh()];
932 for (Int_t i =0; i<AliMUONConstants::NCh(); i++) {
933 iChamber=(AliMUONChamber*) (*fChambers)[i];
934 if (iChamber->Nsec()==1 && icat==1) {
937 segmentation=iChamber->SegmentationModel(icat+1);
939 hitMap[i] = new AliMUONHitMapA1(segmentation, list);
942 //printf("Start loop over tracks \n");
947 TTree *treeH = gAlice->TreeH();
948 Int_t ntracks =(Int_t) treeH->GetEntries();
950 Float_t ** xhit = new Float_t * [2];
951 for (jj=0; jj<2; jj++) xhit[jj] = new Float_t [AliMUONConstants::NCh()];
952 Float_t ** yhit = new Float_t * [2];
953 for (jj=0; jj<2; jj++) yhit[jj] = new Float_t [AliMUONConstants::NCh()];
955 for (Int_t track=0; track<ntracks; track++) {
957 treeH->GetEvent(track);
961 for(AliMUONHit* mHit=(AliMUONHit*)pMUON->FirstHit(-1);
963 mHit=(AliMUONHit*)pMUON->NextHit())
965 Int_t nch = mHit->fChamber-1; // chamber number
966 if (nch > AliMUONConstants::NCh()-1) continue;
967 iChamber = &(pMUON->Chamber(nch));
971 if (mHit->fParticle == kMuonPlus
972 || mHit->fParticle == kMuonMinus) {
973 xhit[nch][nmuon[nch]]=mHit->fX;
974 yhit[nch][nmuon[nch]]=mHit->fY;
976 if (nmuon[nch] >2) printf("nmuon %d\n",nmuon[nch]);
984 // Loop over pad hits
985 for (AliMUONPadHit* mPad=
986 (AliMUONPadHit*)pMUON->FirstPad(mHit,fPadHits);
988 mPad=(AliMUONPadHit*)pMUON->NextPad(fPadHits))
990 Int_t cathode = mPad->fCathode; // cathode number
991 Int_t ipx = mPad->fPadX; // pad number on X
992 Int_t ipy = mPad->fPadY; // pad number on Y
993 Int_t iqpad = Int_t(mPad->fQpad);// charge per pad
997 if (cathode != (icat+1)) continue;
998 // fill the info array
1000 segmentation=iChamber->SegmentationModel(cathode);
1001 segmentation->GetPadCxy(ipx,ipy,thex,they);
1002 // Float_t rpad=TMath::Sqrt(thex*thex+they*they);
1003 // if (rpad < rmin || iqpad ==0 || rpad > rmax) continue;
1005 new((*pAddress)[countadr++]) TVector(2);
1006 TVector &trinfo=*((TVector*) (*pAddress)[countadr-1]);
1007 trinfo(0)=(Float_t)track;
1008 trinfo(1)=(Float_t)iqpad;
1014 if (mHit->fParticle == kMuonPlus ||
1015 mHit->fParticle == kMuonMinus) {
1016 digits[4]=mPad->fHitNumber;
1017 } else digits[4]=-1;
1019 AliMUONTransientDigit* pdigit;
1020 // build the list of fired pads and update the info
1021 if (!hitMap[nch]->TestHit(ipx, ipy)) {
1023 list->AddAtAndExpand(
1024 new AliMUONTransientDigit(nch,digits),counter);
1026 hitMap[nch]->SetHit(ipx, ipy, counter);
1028 pdigit=(AliMUONTransientDigit*)list->At(list->GetLast());
1030 TObjArray *trlist=(TObjArray*)pdigit->TrackList();
1031 trlist->Add(&trinfo);
1033 pdigit=(AliMUONTransientDigit*) hitMap[nch]->GetHit(ipx, ipy);
1035 (*pdigit).fSignal+=iqpad;
1036 (*pdigit).fPhysics+=iqpad;
1037 // update list of tracks
1038 TObjArray* trlist=(TObjArray*)pdigit->TrackList();
1039 Int_t lastEntry=trlist->GetLast();
1040 TVector *pTrack=(TVector*)trlist->At(lastEntry);
1041 TVector &ptrk=*pTrack;
1042 Int_t lastTrack=Int_t(ptrk(0));
1043 Int_t lastCharge=Int_t(ptrk(1));
1044 if (lastTrack==track) {
1046 trlist->RemoveAt(lastEntry);
1047 trinfo(0)=lastTrack;
1048 trinfo(1)=lastCharge;
1049 trlist->AddAt(&trinfo,lastEntry);
1051 trlist->Add(&trinfo);
1053 // check the track list
1054 Int_t nptracks=trlist->GetEntriesFast();
1056 for (Int_t tr=0;tr<nptracks;tr++) {
1057 TVector *ppTrack=(TVector*)trlist->At(tr);
1058 TVector &pptrk=*ppTrack;
1059 trk[tr]=Int_t(pptrk(0));
1060 chtrk[tr]=Int_t(pptrk(1));
1062 } // end if nptracks
1064 } //end loop over clusters
1068 // open the file with background
1070 if (addBackground) {
1071 ntracks =(Int_t)fTrH1->GetEntries();
1075 for (Int_t track=0; track<ntracks; track++) {
1077 if (fHits2) fHits2->Clear();
1078 if (fPadHits2) fPadHits2->Clear();
1080 fTrH1->GetEvent(track);
1084 for(int i=0;i<fHits2->GetEntriesFast();++i)
1086 mHit=(AliMUONHit*) (*fHits2)[i];
1087 Int_t nch = mHit->fChamber-1; // chamber number
1088 if (nch >9) continue;
1089 iChamber = &(pMUON->Chamber(nch));
1090 Int_t rmin = (Int_t)iChamber->RInner();
1091 Int_t rmax = (Int_t)iChamber->ROuter();
1092 Float_t xbgr=mHit->fX;
1093 Float_t ybgr=mHit->fY;
1096 for (Int_t imuon =0; imuon < nmuon[nch]; imuon++) {
1097 Float_t dist= (xbgr-xhit[nch][imuon])*(xbgr-xhit[nch][imuon])
1098 +(ybgr-yhit[nch][imuon])*(ybgr-yhit[nch][imuon]);
1099 if (dist<100) cond=kTRUE;
1101 if (!cond) continue;
1104 // Loop over pad hits
1105 for (AliMUONPadHit* mPad=
1106 (AliMUONPadHit*)pMUON->FirstPad(mHit,fPadHits2);
1108 mPad=(AliMUONPadHit*)pMUON->NextPad(fPadHits2))
1110 // mPad = (AliMUONPadHit*) (*fPadHits2)[j];
1111 Int_t cathode = mPad->fCathode; // cathode number
1112 Int_t ipx = mPad->fPadX; // pad number on X
1113 Int_t ipy = mPad->fPadY; // pad number on Y
1114 Int_t iqpad = Int_t(mPad->fQpad);// charge per pad
1116 if (cathode != (icat+1)) continue;
1118 segmentation=iChamber->SegmentationModel(cathode);
1119 segmentation->GetPadCxy(ipx,ipy,thex,they);
1120 Float_t rpad=TMath::Sqrt(thex*thex+they*they);
1121 if (rpad < rmin || iqpad ==0 || rpad > rmax) continue;
1122 new((*pAddress)[countadr++]) TVector(2);
1123 TVector &trinfo=*((TVector*) (*pAddress)[countadr-1]);
1124 trinfo(0)=-1; // tag background
1133 AliMUONTransientDigit* pdigit;
1134 // build the list of fired pads and update the info
1135 if (!hitMap[nch]->TestHit(ipx, ipy)) {
1136 list->AddAtAndExpand(new AliMUONTransientDigit(nch,digits),counter);
1138 hitMap[nch]->SetHit(ipx, ipy, counter);
1141 pdigit=(AliMUONTransientDigit*)list->At(list->GetLast());
1143 TObjArray *trlist=(TObjArray*)pdigit->
1145 trlist->Add(&trinfo);
1147 pdigit=(AliMUONTransientDigit*) hitMap[nch]->GetHit(ipx, ipy);
1149 (*pdigit).fSignal+=iqpad;
1151 // update list of tracks
1152 TObjArray* trlist=(TObjArray*)pdigit->
1154 Int_t lastEntry=trlist->GetLast();
1155 TVector *pTrack=(TVector*)trlist->
1157 TVector &ptrk=*pTrack;
1158 Int_t lastTrack=Int_t(ptrk(0));
1159 if (lastTrack==-1) {
1162 trlist->Add(&trinfo);
1164 // check the track list
1165 Int_t nptracks=trlist->GetEntriesFast();
1167 for (Int_t tr=0;tr<nptracks;tr++) {
1168 TVector *ppTrack=(TVector*)trlist->At(tr);
1169 TVector &pptrk=*ppTrack;
1170 trk[tr]=Int_t(pptrk(0));
1171 chtrk[tr]=Int_t(pptrk(1));
1173 } // end if nptracks
1175 } //end loop over clusters
1178 //Int_t nentr2=list->GetEntriesFast();
1179 //printf(" \n counter2, nentr2 %d %d \n",counter,nentr2);
1180 TTree *fAli=gAlice->TreeK();
1183 if (fAli) file =fAli->GetCurrentFile();
1185 } // if addBackground
1191 Int_t nentries=list->GetEntriesFast();
1193 for (Int_t nent=0;nent<nentries;nent++) {
1194 AliMUONTransientDigit *address=(AliMUONTransientDigit*)list->At(nent);
1195 if (address==0) continue;
1196 Int_t ich=address->fChamber;
1197 Int_t q=address->fSignal;
1198 iChamber=(AliMUONChamber*) (*fChambers)[ich];
1200 // Digit Response (noise, threshold, saturation, ...)
1201 // if (address->fPhysics !=0 ) address->fPhysics+=(Int_t)Noise;
1202 AliMUONResponse * response=iChamber->ResponseModel();
1203 q=response->DigitResponse(q);
1207 digits[0]=address->fPadX;
1208 digits[1]=address->fPadY;
1210 digits[3]=address->fPhysics;
1211 digits[4]=address->fHit;
1213 TObjArray* trlist=(TObjArray*)address->TrackList();
1214 Int_t nptracks=trlist->GetEntriesFast();
1215 //printf("nptracks, trlist %d %p\n",nptracks,trlist);
1217 // this was changed to accomodate the real number of tracks
1218 if (nptracks > 10) {
1219 cout<<"Attention - nptracks > 10 "<<nptracks<<endl;
1223 printf("Attention - nptracks > 2 %d \n",nptracks);
1224 printf("cat,ich,ix,iy,q %d %d %d %d %d \n",icat,ich,digits[0],digits[1],q);
1226 for (Int_t tr=0;tr<nptracks;tr++) {
1227 TVector *ppP=(TVector*)trlist->At(tr);
1228 if(!ppP ) printf("ppP - %p\n",ppP);
1230 tracks[tr]=Int_t(pp(0));
1231 charges[tr]=Int_t(pp(1));
1232 //printf("tracks, charges - %d %d\n",tracks[tr],charges[tr]);
1233 } //end loop over list of tracks for one pad
1234 // Sort list of tracks according to charge
1236 SortTracks(tracks,charges,nptracks);
1238 if (nptracks < 10 ) {
1239 for (Int_t i=nptracks; i<10; i++) {
1246 pMUON->AddDigits(ich,tracks,charges,digits);
1249 //cout<<"I'm out of the loops for digitisation"<<endl;
1250 // gAlice->GetEvent(nev);
1251 gAlice->TreeD()->Fill();
1252 pMUON->ResetDigits();
1256 for(Int_t ii=0;ii<AliMUONConstants::NCh();++ii) {
1264 } //end loop over cathodes
1267 sprintf(hname,"TreeD%d",nev);
1268 gAlice->TreeD()->Write(hname);
1270 gAlice->TreeD()->Reset();
1274 // gObjectTable->Print();
1277 void AliMUON::SortTracks(Int_t *tracks,Int_t *charges,Int_t ntr)
1280 // Sort the list of tracks contributing to a given digit
1281 // Only the 3 most significant tracks are acctually sorted
1285 // Loop over signals, only 3 times
1290 Int_t idx[3] = {-2,-2,-2};
1291 Int_t jch[3] = {-2,-2,-2};
1292 Int_t jtr[3] = {-2,-2,-2};
1295 if (ntr<3) imax=ntr;
1297 for(i=0;i<imax;i++){
1303 if((i == 1 && j == idx[i-1])
1304 ||(i == 2 && (j == idx[i-1] || j == idx[i-2]))) continue;
1306 if(charges[j] > qmax) {
1314 jch[i]=charges[jmax];
1315 jtr[i]=tracks[jmax];
1332 //___________________________________________
1333 void AliMUON::Trigger(Int_t nev){
1334 // call the Trigger Algorithm and fill TreeR
1336 Int_t singlePlus[3] = {0,0,0};
1337 Int_t singleMinus[3] = {0,0,0};
1338 Int_t singleUndef[3] = {0,0,0};
1339 Int_t pairUnlike[3] = {0,0,0};
1340 Int_t pairLike[3] = {0,0,0};
1343 AliMUONTriggerDecision* decision= new AliMUONTriggerDecision(1);
1344 decision->Trigger();
1345 decision->GetGlobalTrigger(singlePlus, singleMinus, singleUndef,
1346 pairUnlike, pairLike);
1347 // add a local trigger in the list
1348 AddGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike);
1351 for (Int_t icirc=0; icirc<AliMUONConstants::NTriggerCircuit(); icirc++) {
1352 if(decision->GetITrigger(icirc)==1) {
1353 Int_t localtr[7]={0,0,0,0,0,0,0};
1354 Int_t loLpt[2]={0,0}; Int_t loHpt[2]={0,0}; Int_t loApt[2]={0,0};
1355 decision->GetLutOutput(icirc, loLpt, loHpt, loApt);
1357 localtr[1] = decision->GetStripX11(icirc);
1358 localtr[2] = decision->GetDev(icirc);
1359 localtr[3] = decision->GetStripY11(icirc);
1360 for (i=0; i<2; i++) { // convert the Lut output in 1 digit
1361 localtr[4] = localtr[4]+Int_t(loLpt[i]*TMath::Power(2,i));
1362 localtr[5] = localtr[5]+Int_t(loHpt[i]*TMath::Power(2,i));
1363 localtr[6] = localtr[6]+Int_t(loApt[i]*TMath::Power(2,i));
1365 AddLocalTrigger(localtr); // add a local trigger in the list
1370 gAlice->TreeR()->Fill();
1373 sprintf(hname,"TreeR%d",nev);
1374 gAlice->TreeR()->Write(hname);
1375 gAlice->TreeR()->Reset();
1376 printf("\n End of trigger for event %d", nev);
1380 //____________________________________________
1381 void AliMUON::FindClusters(Int_t nev,Int_t lastEntry)
1383 TClonesArray *dig1, *dig2;
1385 dig1 = new TClonesArray("AliMUONDigit",1000);
1386 dig2 = new TClonesArray("AliMUONDigit",1000);
1387 AliMUONDigit *digit;
1389 // Loop on chambers and on cathode planes
1392 for (Int_t ich=0;ich<10;ich++) {
1393 AliMUONChamber* iChamber=(AliMUONChamber*) (*fChambers)[ich];
1394 AliMUONClusterFinderVS* rec = iChamber->ReconstructionModel();
1395 gAlice->ResetDigits();
1396 gAlice->TreeD()->GetEvent(lastEntry);
1397 TClonesArray *muonDigits = this->DigitsAddress(ich);
1398 ndig=muonDigits->GetEntriesFast();
1399 printf("\n 1 Found %d digits in %p %d", ndig, muonDigits,ich);
1400 TClonesArray &lhits1 = *dig1;
1402 for (k=0; k<ndig; k++) {
1403 digit=(AliMUONDigit*) muonDigits->UncheckedAt(k);
1404 if (rec->TestTrack(digit->fTracks[0]))
1405 new(lhits1[n++]) AliMUONDigit(*digit);
1407 gAlice->ResetDigits();
1408 gAlice->TreeD()->GetEvent(lastEntry+1);
1409 muonDigits = this->DigitsAddress(ich);
1410 ndig=muonDigits->GetEntriesFast();
1411 printf("\n 2 Found %d digits in %p %d", ndig, muonDigits, ich);
1412 TClonesArray &lhits2 = *dig2;
1415 for (k=0; k<ndig; k++) {
1416 digit= (AliMUONDigit*) muonDigits->UncheckedAt(k);
1417 if (rec->TestTrack(digit->fTracks[0]))
1418 new(lhits2[n++]) AliMUONDigit(*digit);
1422 AliMUONClusterInput::Instance()->SetDigits(ich, dig1, dig2);
1423 rec->FindRawClusters();
1428 gAlice->TreeR()->Fill();
1431 sprintf(hname,"TreeR%d",nev);
1432 gAlice->TreeR()->Write(hname);
1433 gAlice->TreeR()->Reset();
1434 printf("\n End of cluster finding for event %d", nev);
1438 //gObjectTable->Print();
1442 void AliMUON::Streamer(TBuffer &R__b)
1444 // Stream an object of class AliMUON.
1445 AliMUONChamber *iChamber;
1446 AliMUONTriggerCircuit *iTriggerCircuit;
1447 AliMUONSegmentation *segmentation;
1448 AliMUONResponse *response;
1449 TClonesArray *digitsaddress;
1450 TClonesArray *rawcladdress;
1452 if (R__b.IsReading()) {
1453 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
1454 AliDetector::Streamer(R__b);
1456 R__b >> fPadHits; // diff
1457 R__b >> fNLocalTrigger;
1458 R__b >> fLocalTrigger;
1459 R__b >> fNGlobalTrigger;
1460 R__b >> fGlobalTrigger;
1462 R__b >> fRawClusters;
1463 R__b.ReadArray(fNdch);
1464 R__b.ReadArray(fNrawch);
1469 R__b >> fTriggerCircuits;
1470 for (i =0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1471 iTriggerCircuit=(AliMUONTriggerCircuit*) (*fTriggerCircuits)[i];
1472 iTriggerCircuit->Streamer(R__b);
1474 // Stream chamber related information
1475 for (i =0; i<AliMUONConstants::NCh(); i++) {
1476 iChamber=(AliMUONChamber*) (*fChambers)[i];
1477 iChamber->Streamer(R__b);
1478 if (iChamber->Nsec()==1) {
1479 segmentation=iChamber->SegmentationModel(1);
1481 segmentation->Streamer(R__b);
1483 segmentation=iChamber->SegmentationModel(1);
1485 segmentation->Streamer(R__b);
1487 segmentation=iChamber->SegmentationModel(2);
1488 segmentation->Streamer(R__b);
1490 response=iChamber->ResponseModel();
1492 response->Streamer(R__b);
1493 digitsaddress=(TClonesArray*) (*fDchambers)[i];
1494 digitsaddress->Streamer(R__b);
1495 if (i < AliMUONConstants::NTrackingCh()) {
1496 rawcladdress=(TClonesArray*) (*fRawClusters)[i];
1497 rawcladdress->Streamer(R__b);
1502 R__b.WriteVersion(AliMUON::IsA());
1503 AliDetector::Streamer(R__b);
1505 R__b << fPadHits; // diff
1506 R__b << fNLocalTrigger;
1507 R__b << fLocalTrigger;
1508 R__b << fNGlobalTrigger;
1509 R__b << fGlobalTrigger;
1511 R__b << fRawClusters;
1512 R__b.WriteArray(fNdch, AliMUONConstants::NCh());
1513 R__b.WriteArray(fNrawch, AliMUONConstants::NTrackingCh());
1520 R__b << fTriggerCircuits;
1521 for (i =0; i<AliMUONConstants::NTriggerCircuit(); i++) {
1522 iTriggerCircuit=(AliMUONTriggerCircuit*) (*fTriggerCircuits)[i];
1523 iTriggerCircuit->Streamer(R__b);
1525 for (i =0; i<AliMUONConstants::NCh(); i++) {
1526 iChamber=(AliMUONChamber*) (*fChambers)[i];
1527 iChamber->Streamer(R__b);
1528 if (iChamber->Nsec()==1) {
1529 segmentation=iChamber->SegmentationModel(1);
1531 segmentation->Streamer(R__b);
1533 segmentation=iChamber->SegmentationModel(1);
1535 segmentation->Streamer(R__b);
1536 segmentation=iChamber->SegmentationModel(2);
1538 segmentation->Streamer(R__b);
1540 response=iChamber->ResponseModel();
1542 response->Streamer(R__b);
1543 digitsaddress=(TClonesArray*) (*fDchambers)[i];
1544 digitsaddress->Streamer(R__b);
1545 if (i < AliMUONConstants::NTrackingCh()) {
1546 rawcladdress=(TClonesArray*) (*fRawClusters)[i];
1547 rawcladdress->Streamer(R__b);
1552 AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters)
1555 // Initialise the pad iterator
1556 // Return the address of the first padhit for hit
1557 TClonesArray *theClusters = clusters;
1558 Int_t nclust = theClusters->GetEntriesFast();
1559 if (nclust && hit->fPHlast > 0) {
1560 AliMUON::fMaxIterPad=hit->fPHlast;
1561 AliMUON::fCurIterPad=hit->fPHfirst;
1562 return (AliMUONPadHit*) clusters->UncheckedAt(AliMUON::fCurIterPad-1);
1568 AliMUONPadHit* AliMUON::NextPad(TClonesArray *clusters)
1570 AliMUON::fCurIterPad++;
1571 if (AliMUON::fCurIterPad <= AliMUON::fMaxIterPad) {
1572 return (AliMUONPadHit*) clusters->UncheckedAt(AliMUON::fCurIterPad-1);
1579 AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster)
1581 TClonesArray *muonRawCluster = RawClustAddress(ichamber);
1583 TTree *treeR = gAlice->TreeR();
1584 Int_t nent=(Int_t)treeR->GetEntries();
1585 treeR->GetEvent(nent-2+icathod-1);
1586 //treeR->GetEvent(icathod);
1587 //Int_t nrawcl = (Int_t)muonRawCluster->GetEntriesFast();
1589 AliMUONRawCluster * mRaw = (AliMUONRawCluster*)muonRawCluster->UncheckedAt(icluster);
1590 //printf("RawCluster _ nent nrawcl icluster mRaw %d %d %d%p\n",nent,nrawcl,icluster,mRaw);
1595 AliMUON& AliMUON::operator = (const AliMUON& rhs)