]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUON.cxx
BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTrigger...
[u/mrichter/AliRoot.git] / MUON / AliMUON.cxx
index 04a6585d5c9ab11c69ad035d549c2b6af7c3eab0..b870e57bef557a65c5dff1ed05c45e6fcc8e931e 100644 (file)
  **************************************************************************/
 /*
 $Log$
+Revision 1.38  2000/11/06 09:20:43  morsch
+AliMUON delegates part of BuildGeometry() to AliMUONSegmentation using the
+Draw() method. This avoids code and parameter replication.
+
+Revision 1.37  2000/10/26 09:53:37  pcrochet
+put back trigger chambers in the display (there was a problem in buildgeometry)
+
+Revision 1.36  2000/10/25 19:51:18  morsch
+Correct x-position of chambers.
+
+Revision 1.35  2000/10/24 19:46:21  morsch
+BuildGeometry updated for slats in station 3-4.
+
+Revision 1.34  2000/10/18 11:42:06  morsch
+- AliMUONRawCluster contains z-position.
+- Some clean-up of useless print statements during initialisations.
+
+Revision 1.33  2000/10/09 14:01:57  morsch
+Unused variables removed.
+
+Revision 1.32  2000/10/06 09:08:10  morsch
+Built geometry includes slat geometry for event display.
+
+Revision 1.31  2000/10/02 21:28:08  fca
+Removal of useless dependecies via forward declarations
+
+Revision 1.30  2000/10/02 16:58:29  egangler
+Cleaning of the code :
+-> coding conventions
+-> void Streamers
+-> some useless includes removed or replaced by "class" statement
+
+Revision 1.29  2000/07/28 13:49:38  morsch
+SetAcceptance defines inner and outer chamber radii according to angular acceptance.
+Can be used for simple acceptance studies.
+
+Revision 1.28  2000/07/22 16:43:15  morsch
+Same comment as before, but now done correctly I hope (sorry it's Saturday evening)
+
+Revision 1.27  2000/07/22 16:36:50  morsch
+Change order of indices in creation (new) of xhit and yhit
+
+Revision 1.26  2000/07/03 11:54:57  morsch
+AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
+The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
+
+Revision 1.25  2000/06/29 12:34:09  morsch
+AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
+it usable with any other geometry class. The link to the object to which it belongs is
+established via an index. This assumes that there exists a global geometry manager
+from which the pointer to the parent object can be obtained (in our case gAlice).
+
+Revision 1.24  2000/06/28 15:16:35  morsch
+(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
+to allow development of slat-muon chamber simulation and reconstruction code in the MUON
+framework. The changes should have no side effects (mostly dummy arguments).
+(2) Hit disintegration uses 3-dim hit coordinates to allow simulation
+of chambers with overlapping modules (MakePadHits, Disintegration).
+
+Revision 1.23  2000/06/28 12:19:17  morsch
+More consequent seperation of global input data services (AliMUONClusterInput singleton) and the
+cluster and hit reconstruction algorithms in AliMUONClusterFinderVS.
+AliMUONClusterFinderVS becomes the base class for clustering and hit reconstruction.
+It requires two cathode planes. Small modifications in the code will make it usable for
+one cathode plane and, hence, more general (for test beam data).
+AliMUONClusterFinder is now obsolete.
+
 Revision 1.22  2000/06/28 08:06:10  morsch
 Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the
 algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton.
@@ -97,6 +164,7 @@ Log message added
 #include <TTUBE.h>
 #include <TBRIK.h>
 #include <TRotMatrix.h>
+#include <TGeometry.h>
 #include <TNode.h> 
 #include <TTree.h> 
 #include <TRandom.h> 
@@ -123,7 +191,8 @@ Log message added
 #include "AliMUONRawCluster.h"
 #include "AliMUONLocalTrigger.h"
 #include "AliMUONGlobalTrigger.h"
-#include "AliMUONHitMap.h"
+#include "AliMUONTriggerCircuit.h"
+#include "AliHitMap.h"
 #include "AliMUONHitMapA1.h"
 #include "AliMUONChamberTrigger.h"
 #include "AliMUONConstants.h"
@@ -167,6 +236,9 @@ AliMUON::AliMUON()
    fNLocalTrigger   = 0;
    fLocalTrigger    = 0;
    fNLocalTrigger   = 0;
+   fAccMin          = 0.;
+   fAccMax          = 0.;   
+   fAccCut          = kFALSE;
 }
  
 //___________________________________________
@@ -204,19 +276,12 @@ AliMUON::AliMUON(const char *name, const char *title)
        (*fRawClusters)[i] = new TClonesArray("AliMUONRawCluster",10000); 
        fNrawch[i]=0;
    }
-   cout << " here " << "\n";
 
    fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);    
    fNGlobalTrigger = 0;
    fLocalTrigger  = new TClonesArray("AliMUONLocalTrigger",234);    
    fNLocalTrigger = 0;
 
-//   
-// Transport angular cut
-   fAccCut=0;
-   fAccMin=2;
-   fAccMax=9;
-
    SetMarkerColor(kRed);
 //
 //
@@ -239,9 +304,9 @@ AliMUON::AliMUON(const char *name, const char *title)
            ch = 2 * st + stCH;
 //
            if (ch < AliMUONConstants::NTrackingCh()) {
-               (*fChambers)[ch] = new AliMUONChamber();
+               (*fChambers)[ch] = new AliMUONChamber(ch);
            } else {
-               (*fChambers)[ch] = new AliMUONChamberTrigger();
+               (*fChambers)[ch] = new AliMUONChamberTrigger(ch);
            }
            
            AliMUONChamber* chamber = (AliMUONChamber*) (*fChambers)[ch];
@@ -251,6 +316,7 @@ AliMUON::AliMUON(const char *name, const char *title)
            chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch));
 //
            chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch));
+//          Set chamber inner and outer radius to default
            chamber->SetRInner(AliMUONConstants::Dmin(st)/2);
            chamber->SetROuter(AliMUONConstants::Dmax(st)/2);
 //
@@ -263,6 +329,10 @@ AliMUON::AliMUON(const char *name, const char *title)
 //
    fMaxIterPad   = 0;
    fCurIterPad   = 0;
+//
+   fAccMin          = 0.;
+   fAccMax          = 0.;   
+   fAccCut          = kFALSE;
 
    // cp new design of AliMUONTriggerDecision
    fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit());
@@ -370,175 +440,14 @@ void AliMUON::AddLocalTrigger(Int_t *localtr)
 //___________________________________________
 void AliMUON::BuildGeometry()
 {
-    TNode *node, *nodeF, *top, *nodeS;
-    const int kColorMUON  = kBlue;
-    const int kColorMUON2 = kGreen; 
-    //
-    top=gAlice->GetGeometry()->GetNode("alice");
-// MUON
-//
-//  z-Positions of Chambers
-    const Float_t kCz[7]={511., 686., 971., 1245., 1445., 1600, 1700.};
-//  inner diameter (Xlenght for trigger chamber -> active area)
-    const Float_t kDmin[7]={ 35.,  47.,  67.,   86.,  100., 544., 544.};
-//  outer diameter (Ylenght for trigger chamber -> active area)
-    const Float_t kDmax[7]={183., 245., 346.,  520.,  520., 612., 612.};
-
-    TRotMatrix* rot000 = new TRotMatrix("Rot000"," ", 90,  0, 90, 90, 0, 0);
-    TRotMatrix* rot090 = new TRotMatrix("Rot090"," ", 90, 90, 90,180, 0, 0);
-    TRotMatrix* rot180 = new TRotMatrix("Rot180"," ", 90,180, 90,270, 0, 0);
-    TRotMatrix* rot270 = new TRotMatrix("Rot270"," ", 90,270, 90,  0, 0, 0);
-    
-    Float_t rmin, rmax, dx, dy, dz, dr, xpos, ypos, zpos;
-    Float_t dzc1=4.;           // tracking chambers
-    Float_t dzc2=15.;          // trigger chambers
-    Float_t hole=102.;          // x-y hole around beam pipe for trig. chambers
-    Float_t zscale;            // scaling parameter trigger chambers
-    Float_t halfx, halfy;   
-    char nameChamber[9], nameSense[9], nameFrame[9], nameNode[8];
-    char nameSense1[9], nameSense2[9];    
-    for (Int_t i=0; i<7; i++) {
-       for (Int_t j=0; j<2; j++) {
-           Int_t id=2*i+j+1;
-           if (i<5) {               // tracking chambers
-               if (j==0) {
-                   zpos=kCz[i]-dzc1;
-               } else {
-                   zpos=kCz[i]+dzc1;
-               }
-           } else {
-               if (j==0) {
-                   zpos=kCz[i];
-               } else {            
-                   zpos=kCz[i]+dzc2;
-               }
-           }
-           sprintf(nameChamber,"C_MUON%d",id);
-           sprintf(nameSense,"S_MUON%d",id);
-           sprintf(nameSense1,"S1_MUON%d",id);
-           sprintf(nameSense2,"S2_MUON%d",id);
-           sprintf(nameFrame,"F_MUON%d",id);   
-           if (i<5) {                        // tracking chambers
-               rmin = kDmin[i]/2.-3;
-               rmax = kDmax[i]/2.+3;
-               new TTUBE(nameChamber,"Mother","void",rmin,rmax,0.25,1.);
-               rmin = kDmin[i]/2.;
-               rmax = kDmax[i]/2.;
-               new TTUBE(nameSense,"Sens. region","void",rmin,rmax,0.25, 1.);
-               dx=(rmax-rmin)/2;
-               dy=3.;
-               dz=0.25;
-               TBRIK* frMUON = new TBRIK(nameFrame,"Frame","void",dx,dy,dz);
-               top->cd();
-               sprintf(nameNode,"MUON%d",100+id);
-               node = new TNode(nameNode,"ChamberNode",nameChamber,0,0,zpos,"");
-               node->SetLineColor(kColorMUON);
-               fNodes->Add(node);
-               node->cd();
-               sprintf(nameNode,"MUON%d",200+id);
-               node = new TNode(nameNode,"Sens. Region Node",nameSense,0,0,0,"");
-               node->SetLineColor(kColorMUON);
-               node->cd();
-               dr=dx+rmin;
-               sprintf(nameNode,"MUON%d",300+id);
-               nodeF = new TNode(nameNode,"Frame0",frMUON,dr, 0, 0,rot000,"");
-               nodeF->SetLineColor(kColorMUON);
-               node->cd();
-               sprintf(nameNode,"MUON%d",400+id);
-               nodeF = new TNode(nameNode,"Frame1",frMUON,0 ,dr,0,rot090,"");
-               nodeF->SetLineColor(kColorMUON);
-               node->cd();
-               sprintf(nameNode,"MUON%d",500+id);
-               nodeF = new TNode(nameNode,"Frame2",frMUON,-dr,0,0,rot180,"");
-               nodeF->SetLineColor(kColorMUON);
-               node  ->cd();
-               sprintf(nameNode,"MUON%d",600+id);   
-               nodeF = new TNode(nameNode,"Frame3",frMUON,0,-dr,0,rot270,"");
-               nodeF->SetLineColor(kColorMUON);
-           } else { 
-               zscale=zpos/kCz[5];
-               Float_t xsize=kDmin[i]*zscale;
-               Float_t ysize=kDmax[i]*zscale;
-               Float_t holeScaled=hole*zscale;
-               
-               halfx=xsize/2.+3.;
-               halfy=ysize/2.+3.;          
-               new TBRIK(nameChamber,"Mother","void",halfx,halfy,0.25);
-               top->cd();
-               sprintf(nameNode,"MUON%d",100+id);
-               node = new TNode(nameNode,"Chambernode",nameChamber,0,0,zpos,"");
-               node->SetLineColor(kColorMUON2);
-               fNodes->Add(node);
-               
-// up/down of beam pipe
-               halfx=xsize/2.;
-               halfy=(ysize/2.-holeScaled/2.)/2.;          
-               new TBRIK(nameSense,"Sens. region","void",halfx,halfy,0.25);
-               
-               node->cd();
-               ypos=holeScaled/2.+((ysize/2.-holeScaled/2.)/2.);
-               sprintf(nameNode,"MUON%d",200+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense,0,ypos,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-               
-               node->cd();
-               ypos=-1.*ypos;
-               sprintf(nameNode,"MUON%d",300+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense,0,ypos,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-               
-// left/right of beam pipe
-               halfx=(xsize/2.-holeScaled/2.)/2.;
-               halfy=holeScaled/2.;    
-               new TBRIK(nameSense1,"Sens. region","void",halfx,halfy,0.25);
-               
-               node->cd();
-               xpos=holeScaled/2.+((xsize/2.-holeScaled/2.)/2.);           
-               sprintf(nameNode,"MUON%d",400+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense1,xpos,0,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-               
-               node->cd();
-               xpos=-1.*xpos;
-               sprintf(nameNode,"MUON%d",500+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense1,xpos,0,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-               
-// missing corners
-               halfx=17.*zscale/2.;
-               halfy=halfx;
-               new TBRIK(nameSense2,"Sens. region","void",halfx,halfy,0.25);
-               
-               node->cd();
-               xpos=holeScaled/2.-halfx;
-               ypos=xpos;
-               sprintf(nameNode,"MUON%d",600+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-               
-               node->cd();
-               ypos=-1.*xpos;
-               sprintf(nameNode,"MUON%d",700+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-               
-               node->cd();
-               xpos=-1.*xpos;
-               sprintf(nameNode,"MUON%d",800+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-               
-               node->cd();
-               ypos=-1.*xpos;
-               sprintf(nameNode,"MUON%d",900+id);
-               nodeS = new TNode(nameNode,"Sens. Region Node",nameSense2,xpos,ypos,0,"");
-               nodeS->SetLineColor(kColorMUON2);
-           } 
-       }
+  for (Int_t i=0; i<7; i++) {
+    for (Int_t j=0; j<2; j++) {
+      Int_t id=2*i+j+1;
+      this->Chamber(id-1).SegmentationModel(1)->Draw("eventdisplay");
     }
+  }
 }
 
-
 //___________________________________________
 Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t )
 {
@@ -774,14 +683,26 @@ void AliMUON::SetMaxDestepAlu(Float_t p1)
     fMaxDestepAlu=p1;
 }
 //___________________________________________
-void AliMUON::SetMuonAcc(Bool_t acc, Float_t angmin, Float_t angmax)
+void AliMUON::SetAcceptance(Bool_t acc, Float_t angmin, Float_t angmax)
 {
    fAccCut=acc;
-   fAccMin=angmin;
-   fAccMax=angmax;
+   fAccMin=angmin*TMath::Pi()/180;
+   fAccMax=angmax*TMath::Pi()/180;
+   Int_t ch;
+   if (acc) {
+       for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
+          // Loop over 2 chambers in the station
+          for (Int_t stCH = 0; stCH < 2; stCH++) {
+              ch = 2 * st + stCH;
+//         Set chamber inner and outer radius according to acceptance cuts
+              Chamber(ch).SetRInner(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMin));
+              Chamber(ch).SetROuter(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMax));
+          } // chamber loop
+       } // station loop
+   }
 }
 //___________________________________________
-void   AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliMUONSegmentation *segmentation)
+void   AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliSegmentation *segmentation)
 {
     ((AliMUONChamber*) (*fChambers)[id])->SetSegmentationModel(isec, segmentation);
 
@@ -807,7 +728,7 @@ void   AliMUON::SetNsec(Int_t id, Int_t nsec)
 
 
 
-void AliMUON::MakePadHits(Float_t xhit,Float_t yhit,
+void AliMUON::MakePadHits(Float_t xhit,Float_t yhit, Float_t zhit,
                          Float_t eloss, Float_t tof,  Int_t idvol)
 {
 //
@@ -826,10 +747,13 @@ void AliMUON::MakePadHits(Float_t xhit,Float_t yhit,
     clhits[0]=fNhits+1;
 //
 //
+//    if (idvol == 6) printf("\n ->Disintegration %f %f %f", xhit, yhit, eloss );
+    
+
     ((AliMUONChamber*) (*fChambers)[idvol])
-       ->DisIntegration(eloss, tof, xhit, yhit, nnew, newclust);
+       ->DisIntegration(eloss, tof, xhit, yhit, zhit, nnew, newclust);
     Int_t ic=0;
-    
+//    if (idvol == 6) printf("\n nnew  %d \n", nnew);
 //
 //  Add new clusters
     for (Int_t i=0; i<nnew; i++) {
@@ -865,8 +789,8 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
     char *addBackground = strstr(option,"Add");
 
 
-    AliMUONChamber*  iChamber;
-    AliMUONSegmentation*  segmentation;
+    AliMUONChamber*   iChamber;
+    AliSegmentation*  segmentation;
 
     
     Int_t trk[50];
@@ -877,7 +801,7 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
     Int_t digits[5]; 
 
     AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
-    AliMUONHitMap** hitMap= new AliMUONHitMap* [AliMUONConstants::NCh()];
+    AliHitMap** hitMap= new AliHitMap* [AliMUONConstants::NCh()];
     for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {hitMap[i]=0;}
     if (addBackground ) {
        if(first) {
@@ -924,7 +848,7 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
     //
     // loop over cathodes
     //
-    AliMUONHitMap* hm;
+    AliHitMap* hm;
     Int_t countadr=0;
     for (int icat=0; icat<2; icat++) { 
        Int_t counter=0;
@@ -947,15 +871,15 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
        TTree *treeH = gAlice->TreeH();
        Int_t ntracks =(Int_t) treeH->GetEntries();
        Int_t jj;
-       Float_t ** xhit = new Float_t * [2];
-       for (jj=0; jj<2; jj++) xhit[jj] = new Float_t  [AliMUONConstants::NCh()];
-       Float_t ** yhit = new Float_t * [2];
-       for (jj=0; jj<2; jj++) yhit[jj] = new Float_t  [AliMUONConstants::NCh()];
-       
+
+       Float_t ** xhit = new Float_t * [AliMUONConstants::NCh()];
+       for (jj=0; jj<AliMUONConstants::NCh(); jj++) xhit[jj] = new Float_t[2];
+       Float_t ** yhit = new Float_t * [AliMUONConstants::NCh()];
+       for (jj=0; jj<AliMUONConstants::NCh(); jj++) yhit[jj] = new Float_t[2];
+
        for (Int_t track=0; track<ntracks; track++) {
            gAlice->ResetHits();
            treeH->GetEvent(track);
-           
 //
 //   Loop over hits
            for(AliMUONHit* mHit=(AliMUONHit*)pMUON->FirstHit(-1); 
@@ -964,14 +888,15 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
            {
                Int_t   nch   = mHit->fChamber-1;  // chamber number
                if (nch > AliMUONConstants::NCh()-1) continue;
+//             if (nch > 9) continue;
                iChamber = &(pMUON->Chamber(nch));
                 // new 17.07.99
                if (addBackground) {
 
                    if (mHit->fParticle == kMuonPlus 
                        || mHit->fParticle == kMuonMinus) {
-                       xhit[nch][nmuon[nch]]=mHit->fX;
-                       yhit[nch][nmuon[nch]]=mHit->fY;
+                       xhit[nch][nmuon[nch]]=mHit->X();
+                       yhit[nch][nmuon[nch]]=mHit->Y();
                        nmuon[nch]++;
                        if (nmuon[nch] >2) printf("nmuon %d\n",nmuon[nch]);
                    }
@@ -991,14 +916,15 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
                    Int_t ipx      = mPad->fPadX;       // pad number on X
                    Int_t ipy      = mPad->fPadY;       // pad number on Y
                    Int_t iqpad    = Int_t(mPad->fQpad);// charge per pad
+//                 printf("\n Pad: %d %d %d %d", ipx, ipy, cathode,nch);
 //
 //
                    
                    if (cathode != (icat+1)) continue;
                    // fill the info array
-                   Float_t thex, they;
+//                 Float_t thex, they, thez;
                    segmentation=iChamber->SegmentationModel(cathode);
-                   segmentation->GetPadCxy(ipx,ipy,thex,they);
+//                 segmentation->GetPadC(ipx,ipy,thex,they,thez);
 //                 Float_t rpad=TMath::Sqrt(thex*thex+they*they);
 //                 if (rpad < rmin || iqpad ==0 || rpad > rmax) continue;
 
@@ -1039,8 +965,8 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
                        Int_t lastEntry=trlist->GetLast();
                        TVector *pTrack=(TVector*)trlist->At(lastEntry);
                        TVector &ptrk=*pTrack;
-                       Int_t lastTrack=Int_t(ptrk(0));
-                       Int_t lastCharge=Int_t(ptrk(1));
+                       Int_t lastTrack  = Int_t(ptrk(0));
+                       Int_t lastCharge = Int_t(ptrk(1));
                        if (lastTrack==track) {
                            lastCharge+=iqpad;
                            trlist->RemoveAt(lastEntry);
@@ -1056,8 +982,8 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
                            for (Int_t tr=0;tr<nptracks;tr++) {
                                TVector *ppTrack=(TVector*)trlist->At(tr);
                                TVector &pptrk=*ppTrack;
-                               trk[tr]=Int_t(pptrk(0));
-                               chtrk[tr]=Int_t(pptrk(1));
+                               trk[tr]   = Int_t(pptrk(0));
+                               chtrk[tr] = Int_t(pptrk(1));
                            }
                        } // end if nptracks
                    } //  end if pdigit
@@ -1087,10 +1013,10 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
                    Int_t   nch   = mHit->fChamber-1;  // chamber number
                    if (nch >9) continue;
                    iChamber = &(pMUON->Chamber(nch));
-                   Int_t rmin = (Int_t)iChamber->RInner();
-                   Int_t rmax = (Int_t)iChamber->ROuter();
-                    Float_t xbgr=mHit->fX;
-                   Float_t ybgr=mHit->fY;
+//                 Int_t rmin = (Int_t)iChamber->RInner();
+//                 Int_t rmax = (Int_t)iChamber->ROuter();
+                    Float_t xbgr=mHit->X();
+                   Float_t ybgr=mHit->Y();
                    Bool_t cond=kFALSE;
                    
                    for (Int_t imuon =0; imuon < nmuon[nch]; imuon++) {
@@ -1114,11 +1040,13 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
                        Int_t iqpad    = Int_t(mPad->fQpad);// charge per pad
 
                        if (cathode != (icat+1)) continue;
-                       Float_t thex, they;
-                       segmentation=iChamber->SegmentationModel(cathode);
-                       segmentation->GetPadCxy(ipx,ipy,thex,they);
-                       Float_t rpad=TMath::Sqrt(thex*thex+they*they);
-                       if (rpad < rmin || iqpad ==0 || rpad > rmax) continue;
+                       printf("\n Pad: %d %d %d", ipx, ipy, cathode);
+                       
+//                     Float_t thex, they, thez;
+//                     segmentation=iChamber->SegmentationModel(cathode);
+//                     segmentation->GetPadC(ipx,ipy,thex,they,thez);
+//                     Float_t rpad=TMath::Sqrt(thex*thex+they*they);
+//                     if (rpad < rmin || iqpad ==0 || rpad > rmax) continue;
                        new((*pAddress)[countadr++]) TVector(2);
                        TVector &trinfo=*((TVector*) (*pAddress)[countadr-1]);
                        trinfo(0)=-1;  // tag background
@@ -1442,12 +1370,12 @@ void AliMUON::FindClusters(Int_t nev,Int_t lastEntry)
 void AliMUON::Streamer(TBuffer &R__b)
 {
    // Stream an object of class AliMUON.
-      AliMUONChamber       *iChamber;
+      AliMUONChamber        *iChamber;
       AliMUONTriggerCircuit *iTriggerCircuit;
-      AliMUONSegmentation  *segmentation;
-      AliMUONResponse      *response;
-      TClonesArray         *digitsaddress;
-      TClonesArray         *rawcladdress;
+      AliSegmentation       *segmentation;
+      AliMUONResponse       *response;
+      TClonesArray          *digitsaddress;
+      TClonesArray          *rawcladdress;
       Int_t i;
       if (R__b.IsReading()) {
          Version_t R__v = R__b.ReadVersion(); if (R__v) { }