+//---------------------------------------------------------------------
+//----------------------- New Segmentation ----------------------------
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+void AliMUONTriggerCircuit::LoadYPos2(){
+// fill fYpos11 and fYpos21 -> y position of X declusterized strips
+
+ Int_t chamber, cathode;
+ Int_t code, idModule, idStrip, idSector;
+ Float_t x, y, z, width;
+ Int_t istrip, idDE;
+
+ AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
+ AliMUONChamber* iChamber;
+ AliMUONGeometrySegmentation* segmentation;
+
+// first plane (11)
+ chamber=11;
+ cathode=1;
+ iChamber = &(pMUON->Chamber(chamber-1));
+ segmentation=iChamber->SegmentationModel2(cathode);
+
+ for (istrip=0; istrip<16; istrip++) {
+ code=fXcode[0][istrip]; // decode current strip
+ idModule=Int_t(code/100); // corresponding module Id.
+ idDE = DetElemId(chamber, idModule);
+ idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module
+ idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector
+ width=segmentation->Dpy(idDE, idSector); // corresponding strip width
+ segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position
+
+ fYpos11[2*istrip]=y;
+ if (istrip!=15) fYpos11[2*istrip+1]=y+width/2.;
+ }
+
+// second plane (21)
+ chamber=13;
+ cathode=1;
+ iChamber = &(pMUON->Chamber(chamber-1));
+ segmentation=iChamber->SegmentationModel2(cathode);
+
+ for (istrip=0; istrip<32; istrip++) {
+ code=fXcode[2][istrip]; // decode current strip
+ idModule=Int_t(code/100); // corresponding module Id.
+ idDE = DetElemId(chamber, idModule);
+ if (idModule == 0) continue;
+ idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module
+ idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector
+ width=segmentation->Dpy(idDE, idSector); // corresponding strip width
+ segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position
+
+// using idModule!=0 prevents to fill garbage in case of circuits
+// in the first and last rows
+ if (idModule!=0) {
+ fYpos21[2*istrip]=y;
+ if (istrip!=31) fYpos21[2*istrip+1]=y+width/2.;
+ }
+ }
+}
+
+//----------------------------------------------------------------------
+void AliMUONTriggerCircuit::LoadXPos2(){
+// fill fXpos11 -> x position of Y strips for the first plane only
+// fXpos11 contains the x position of Y strip for the current circuit
+// taking into account whether or nor not part(s) of the circuit
+// (middle, up or down) has(have) 16 strips
+
+ Float_t x, y, z;
+ Int_t istrip, idDE;
+
+ Int_t chamber=11;
+ Int_t cathode=2;
+ AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
+ AliMUONChamber* iChamber;
+ AliMUONGeometrySegmentation* segmentation;
+ iChamber = &(pMUON->Chamber(chamber-1));
+ segmentation=iChamber->SegmentationModel2(cathode);
+
+ Int_t idModule=Module(fIdCircuit); // corresponding module Id.
+// number of Y strips
+ idDE = DetElemId(chamber, idModule);
+ Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule));
+ Int_t idSector=segmentation->Sector(idDE, idModule,0); // corresp. sector
+ Float_t width=segmentation->Dpx(idDE, idSector); // corresponding strip width
+
+// first case : up middle and down parts have all 8 or 16 strip
+ if ((nStrY==16)||(nStrY==8&&fX2m==0&&fX2ud==0)) {
+ for (istrip=0; istrip<nStrY; istrip++) {
+ segmentation->GetPadC(idDE, idModule,istrip,x,y,z);
+ fXpos11[istrip]=x;
+ }
+// second case : mixing 8 and 16 strips within same circuit
+ } else {
+ for (istrip=0; istrip<nStrY; istrip++) {
+ if (nStrY!=8) { printf(" bug in LoadXpos \n");}
+ segmentation->GetPadC(idDE, idModule, istrip, x, y, z);
+ fXpos11[2*istrip]=x-width/4.;
+ fXpos11[2*istrip+1]=fXpos11[2*istrip]+width/2.;
+ }
+ }
+}