]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Implemented new segmentation for global and local trigger (Ph. Crochet & Christian)
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Mar 2005 11:12:39 +0000 (11:12 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Mar 2005 11:12:39 +0000 (11:12 +0000)
MUON/AliMUONTriggerCircuit.cxx
MUON/AliMUONTriggerCircuit.h
MUON/AliMUONv1.cxx

index 767dfc3909aa2341e261c069ca257b00200db61f..d5a0900ef02ce6ea93c811f6e152c4f6150fe3c4 100644 (file)
@@ -22,6 +22,7 @@
 #include "AliMUON.h"
 #include "AliMUONTriggerConstants.h"
 #include "AliSegmentation.h"
+#include "AliMUONGeometrySegmentation.h"
 #include "AliMUONChamber.h"
 #include "AliMUONConstants.h"
 #include "AliLog.h"
@@ -30,13 +31,14 @@ ClassImp(AliMUONTriggerCircuit)
 
 //----------------------------------------------------------------------
 AliMUONTriggerCircuit::AliMUONTriggerCircuit()
-  : TObject() 
+  : TObject(),
+    fIdCircuit(0),
+    fX2m(0),
+    fX2ud(0)
+    //    fSegmentationType(1)
 {
 // Constructor
-  fSegmentation=0;
-  fIdCircuit=0;
-  fX2m=0;
-  fX2ud=0;
+
   fOrMud[0]=fOrMud[1]=0;
   Int_t i;  
   for (i=0; i<4; i++) {
@@ -76,11 +78,19 @@ AliMUONTriggerCircuit::operator=(const AliMUONTriggerCircuit& rhs)
 void AliMUONTriggerCircuit::Init(Int_t iCircuit) {
 // initialize circuit characteristics
   fIdCircuit=AliMUONTriggerConstants::CircuitId(iCircuit);
+  AliMUON *pMUON  = (AliMUON*)gAlice->GetModule("MUON");  
+
   LoadX2();
   LoadXCode();
   LoadYCode();
-  LoadXPos();
-  LoadYPos();
+
+  if (pMUON->WhichSegmentation() == 1) {
+    LoadXPos();
+    LoadYPos();
+  } else {
+    LoadXPos2();
+    LoadYPos2();
+  }
 }
 
 //----------------------------------------------------------------------
@@ -394,6 +404,108 @@ Float_t AliMUONTriggerCircuit::PtCal(Int_t istripX, Int_t idev, Int_t istripY){
   Float_t yf=yPosX2-((yPosX2-yPosX1)*(z2-zf))/(z2-z1);
   return (3.*0.3/TMath::Abs(thetaDev)) * TMath::Sqrt(xf*xf+yf*yf)/zf;
 }
+//---------------------------------------------------------------------
+//----------------------- 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.;
+    }
+  }   
+}
 
 //----------------------------------------------------------------------
 //--- methods which return member data related info
@@ -500,7 +612,13 @@ Float_t AliMUONTriggerCircuit::GetX11Pos(Int_t istrip) const {
 //----------------------------------------------------------------------
 
 
-
+Int_t AliMUONTriggerCircuit::DetElemId(Int_t ichamber, Int_t idModule)
+{
+// returns the detection element Id for given chamber and module
+// ichamber (from 11 to 14), idModule (from 11 to 97)
+    Int_t itmp = (idModule > 0) ? 0 : 50; // right=0, left=50   
+    return (ichamber*100)+itmp+(9-Int_t(TMath::Abs(idModule)/10));
+}
 
 
 
index 8688058a884a110f39f1b9dfcee8988731a4d96b..5f38dfe3f13e7882927150c6b2b7262bcebe28df 100644 (file)
@@ -9,7 +9,8 @@
 #include <TObject.h>
 #include <TObjArray.h>
 
-#include "AliSegmentation.h"
+class AliSegmentation;
+class AliMUONGeometrtSegmentation;
 
 class TObjArray;
 
@@ -43,11 +44,7 @@ class AliMUONTriggerCircuit : public TObject
   Float_t GetY11Pos(Int_t istrip) const;
   Float_t GetY21Pos(Int_t istrip) const;
   Float_t GetX11Pos(Int_t istrip) const;
-  //  Get reference to segmentation model
-  virtual AliSegmentation*  SegmentationModel(Int_t isec) {
-      return (AliSegmentation *) (*fSegmentation)[isec-1];
-  }
+  Int_t   DetElemId(Int_t ichamber, Int_t idModule);
 
  protected:
   // copy constructor
@@ -55,8 +52,6 @@ class AliMUONTriggerCircuit : public TObject
   // assignment operator
   AliMUONTriggerCircuit& operator=(const AliMUONTriggerCircuit& AliMUONTriggerCircuit); 
 
-  TObjArray            *fSegmentation;    // pointer to segmentation
-
  private:
   Int_t CircuitNumber(Int_t idCircuit) const;
   Int_t ModuleNumber(Int_t idModule) const; 
@@ -67,7 +62,9 @@ class AliMUONTriggerCircuit : public TObject
   void LoadYCode();
   void LoadYPos();
   void LoadXPos();
-  
+  void LoadYPos2();
+  void LoadXPos2();
+   
   ClassDef(AliMUONTriggerCircuit,1) // Trigger Circuit class
     
  private:    
@@ -80,6 +77,7 @@ class AliMUONTriggerCircuit : public TObject
   Float_t fXpos11[16];         // X position of Y strips in MC11
   Float_t fYpos11[31];         // Y position of X strips in MC11
   Float_t fYpos21[63];         // Y position of X strips in MC21
+  //  Int_t fSegmentationType;     // segmentation old / new
 
 };
 #endif
index b7de46f23eaacad32a3426e2e41a006d6455c31e..44ce3a7219da32e4adde00e0b2a0beba39e2964a 100644 (file)
@@ -170,7 +170,7 @@ void AliMUONv1::Init()
    Int_t i;
 
  
-  //
+   //
    // Initialize geometry
    //
    fGeometryBuilder->InitGeometry();
@@ -206,13 +206,12 @@ void AliMUONv1::Init()
        ( (AliMUONChamber*) (*fChambers)[i])->Init(fSegmentationType);// new segmentation
    }
  
-   if (fSegmentationType == 1) {
-    //cp 
-     AliDebug(1,"Start Init for Trigger Circuits");
-     for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) 
-       ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
-     AliDebug(1,"Finished Init for Trigger Circuits");
-   } 
+   // trigger circuit
+   // cp 
+   for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) 
+     ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
+   
+