]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerCircuit.cxx
RAW QA only for calibration events
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerCircuit.cxx
index bc91a0b702038814afc4957d5bdc53ef454843f9..cb8d3505f66f555fecda860d992898e4c57b1d5e 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "AliMUONTriggerCircuit.h"
 #include "AliMUONConstants.h"
+#include "AliMUONGeometryTransformer.h"
 
 #include "AliMpTrigger.h"
 #include "AliMpSlat.h"
@@ -37,6 +38,8 @@
 #include "AliMpDDLStore.h"
 #include "AliMpLocalBoard.h"
 #include "AliMpConstants.h"
+#include "AliMpPad.h"
+#include "AliMpEncodePair.h"
 
 #include "AliRun.h"
 #include "AliLog.h"
@@ -51,8 +54,8 @@ ClassImp(AliMUONTriggerCircuit)
 //----------------------------------------------------------------------
 AliMUONTriggerCircuit::AliMUONTriggerCircuit(const AliMUONGeometryTransformer* transformer)
     : TObject(),
-      fTransformer(transformer),
-      fCurrentSeg(0x0),
+      fkTransformer(transformer),
+      fkCurrentSeg(0x0),
       fCurrentDetElem(0x0),
       fCurrentLocalBoard(0x0)
 {
@@ -96,8 +99,8 @@ AliMUONTriggerCircuit::~AliMUONTriggerCircuit()
 //----------------------------------------------------------------------
 AliMUONTriggerCircuit::AliMUONTriggerCircuit(const AliMUONTriggerCircuit& circuit)
     :  TObject(circuit),
-       fTransformer(circuit.fTransformer), // do not copy, just pointed to
-       fCurrentSeg(circuit.fCurrentSeg),
+       fkTransformer(circuit.fkTransformer), // do not copy, just pointed to
+       fkCurrentSeg(circuit.fkCurrentSeg),
        fCurrentDetElem(circuit.fCurrentDetElem),
        fCurrentLocalBoard(circuit.fCurrentLocalBoard)
 {
@@ -117,8 +120,8 @@ AliMUONTriggerCircuit& AliMUONTriggerCircuit::operator=(const AliMUONTriggerCirc
 
   if (this == &circuit) return *this;
 
-  fTransformer       = circuit.fTransformer;
-  fCurrentSeg        = circuit.fCurrentSeg;
+  fkTransformer      = circuit.fkTransformer;
+  fkCurrentSeg       = circuit.fkCurrentSeg;
   fCurrentDetElem    = circuit.fCurrentDetElem;
   fCurrentLocalBoard = circuit.fCurrentLocalBoard;
 
@@ -133,7 +136,7 @@ AliMUONTriggerCircuit& AliMUONTriggerCircuit::operator=(const AliMUONTriggerCirc
 }
 
 //---------------------------------------------------------------------
-void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
+void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* const localBoard)
 {
 /// fill fYpos11 and fYpos21 -> y position of X declusterized strips
   
@@ -144,15 +147,15 @@ void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
   Int_t zeroDown = localBoard->GetSwitch(AliMpLocalBoard::kZeroDown);
   Int_t zeroUp   = localBoard->GetSwitch(AliMpLocalBoard::kZeroUp);
  
-  Int_t iline = localBoard->GetPosition().GetFirst();
-  Int_t icol  = localBoard->GetPosition().GetSecond();
+  Int_t iline = AliMp::PairFirst(localBoard->GetPosition());
+  Int_t icol  = AliMp::PairSecond(localBoard->GetPosition());
   if ( iline == 5 ) --icol;
 
   //--- first plane 
   ichamber = 10;
   fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber);
 
-  fCurrentSeg = AliMpSegmentation::Instance()
+  fkCurrentSeg = AliMpSegmentation::Instance()
         ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode));  
 
   Int_t iFirstStrip = FirstStrip(localBoard);
@@ -166,7 +169,7 @@ void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
   ichamber = 12;
   fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber);
 
-  fCurrentSeg = AliMpSegmentation::Instance()
+  fkCurrentSeg = AliMpSegmentation::Instance()
         ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode));  
 
   // second plane middle part
@@ -184,7 +187,7 @@ void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
     Int_t icolUp = icol;
 
     // check if we need to move to another detElemId
-    AliMpPad pad = fCurrentSeg->PadByIndices(AliMpIntPair(icol-1,iLastStripMiddle+1),kFALSE);
+    AliMpPad pad = fkCurrentSeg->PadByIndices(icol-1,iLastStripMiddle+1,kFALSE);
 
     if (pad.IsValid()) { // upper strips within same detElemId
       iFirstStripUp = iLastStripMiddle;
@@ -194,7 +197,7 @@ void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
       fCurrentDetElem = AliMpDDLStore::Instance()->
                   GetNextDEfromLocalBoard(fCurrentLocalBoard, ichamber);
 
-      fCurrentSeg = AliMpSegmentation::Instance()
+      fkCurrentSeg = AliMpSegmentation::Instance()
             ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode));  
 
       iFirstStripUp = 0;
@@ -214,7 +217,7 @@ void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
   
   // restore current detElemId & segmentation
   fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber);
-  fCurrentSeg = AliMpSegmentation::Instance()
+  fkCurrentSeg = AliMpSegmentation::Instance()
       ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode));  
 
   // second plane lower part
@@ -224,7 +227,7 @@ void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
     Int_t icolDo = icol;
     
     // check if we need to move to another detElemId      
-    AliMpPad pad = fCurrentSeg->PadByIndices(AliMpIntPair(icol-1,iFirstStripMiddle-1),kFALSE);
+    AliMpPad pad = fkCurrentSeg->PadByIndices(icol-1,iFirstStripMiddle-1,kFALSE);
     if (pad.IsValid()) { // lower strips within same detElemId
       iFirstStripDo = iFirstStripMiddle - 8;
       iLastStripDo  = iFirstStripDo + 8;             
@@ -233,11 +236,11 @@ void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* localBoard)
       fCurrentDetElem = AliMpDDLStore::Instance()
          ->GetPreviousDEfromLocalBoard(fCurrentLocalBoard, ichamber);
 
-      fCurrentSeg = AliMpSegmentation::Instance()
+      fkCurrentSeg = AliMpSegmentation::Instance()
          ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode));  
 
       // get iFirstStrip in this module 
-      const AliMpTrigger* t = AliMpSegmentation::Instance()->GetTrigger(fCurrentSeg);
+      const AliMpTrigger* t = AliMpSegmentation::Instance()->GetTrigger(fkCurrentSeg);
       const AliMpSlat* slat = t->GetLayer(0);
 
       if (iline == 5) icolDo = icol + 1; // special case
@@ -268,14 +271,14 @@ void AliMUONTriggerCircuit::FillXstrips(const Int_t icol,
   Double_t xyGlobal[2] = {0.};
   for (Int_t istrip = iFirstStrip; istrip < iLastStrip; ++istrip) {
 
-    AliMpPad pad = fCurrentSeg->PadByIndices(AliMpIntPair(icol-1,istrip),kTRUE);
+    AliMpPad pad = fkCurrentSeg->PadByIndices(icol-1,istrip,kTRUE);
     if ( !pad.IsValid() ) {
       StdoutToAliError(cout << "Pad not found in seg " << endl;
-                       fCurrentSeg->Print();
+                       fkCurrentSeg->Print();
                        cout << " ix,iy=" << icol-1 << "," << istrip << endl;
                        );
     }
-    Float_t yDim = pad.Dimensions().Y(); // half size! 
+    Float_t yDim = pad.GetDimensionY(); // half size! 
 
     XYGlobal(pad,xyGlobal);
     
@@ -287,7 +290,7 @@ void AliMUONTriggerCircuit::FillXstrips(const Int_t icol,
 
 
 //----------------------------------------------------------------------
-void AliMUONTriggerCircuit::LoadXPos(AliMpLocalBoard* localBoard)
+void AliMUONTriggerCircuit::LoadXPos(AliMpLocalBoard* const localBoard)
 {
 /// fill fXpos11 -> x position of Y strips for the first plane only
 /// fXpos11 contains the x position of Y strip for the current circuit
@@ -309,13 +312,13 @@ void AliMUONTriggerCircuit::LoadXPos(AliMpLocalBoard* localBoard)
   Int_t  iLastStrip    = 0;
   Bool_t doubling      = kFALSE;
   
-  Int_t iline  = localBoard->GetPosition().GetFirst();
-  Int_t icol   = localBoard->GetPosition().GetSecond();
+  Int_t iline = AliMp::PairFirst(localBoard->GetPosition());
+  Int_t icol  = AliMp::PairSecond(localBoard->GetPosition());
   if ( iline == 5 ) --icol;
 
   fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber);
 
-  fCurrentSeg = AliMpSegmentation::Instance()
+  fkCurrentSeg = AliMpSegmentation::Instance()
         ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode));  
 
   // check if one needs a strip doubling or not
@@ -326,7 +329,7 @@ void AliMUONTriggerCircuit::LoadXPos(AliMpLocalBoard* localBoard)
   if (zeroAllYLSB) iStripCircuit = 8;
   
   // get iFirstStrip in this module 
-  const AliMpTrigger* t = AliMpSegmentation::Instance()->GetTrigger(fCurrentSeg);
+  const AliMpTrigger* t = AliMpSegmentation::Instance()->GetTrigger(fkCurrentSeg);
   const AliMpSlat* slat = t->GetLayer(0);
   
   const AliMpPCB* pcb = slat->GetPCB(icol-1);
@@ -349,16 +352,16 @@ void AliMUONTriggerCircuit::FillYstrips(const Int_t iFirstStrip, const Int_t iLa
 
   for (Int_t istrip = iFirstStrip; istrip < iLastStrip; ++istrip) {
 
-    AliMpPad pad = fCurrentSeg->PadByIndices(AliMpIntPair(istrip,0),kTRUE);
+    AliMpPad pad = fkCurrentSeg->PadByIndices(istrip,0,kTRUE);
 
     if ( !pad.IsValid() )
     {
        StdoutToAliError(cout << "Pad not found in seg " << endl;
-                        fCurrentSeg->Print();
+                        fkCurrentSeg->Print();
                         cout << " ix,iy=" << istrip << "," << 0 << endl;
                         );
     }
-    Float_t xDim = pad.Dimensions().X(); // half size!
+    Float_t xDim = pad.GetDimensionX(); // half size!
 
     XYGlobal(pad,xyGlobal);
     
@@ -386,12 +389,12 @@ void AliMUONTriggerCircuit::XYGlobal(const AliMpPad& pad,
 /// note: no need for transformation for pad dimensions
   
   // get the pad position and dimensions
-  Double_t xl1 = pad.Position().X();
-  Double_t yl1 = pad.Position().Y();
+  Double_t xl1 = pad.GetPositionX();
+  Double_t yl1 = pad.GetPositionY();
   Double_t zg1 = 0;
   
   // positions from local to global 
-  fTransformer->Local2Global(fCurrentDetElem, xl1, yl1, 0, 
+  fkTransformer->Local2Global(fCurrentDetElem, xl1, yl1, 0, 
                                  xyGlobal[0], xyGlobal[1], zg1);
 }
 
@@ -425,8 +428,8 @@ Int_t AliMUONTriggerCircuit::FirstStrip(AliMpLocalBoard* localBoard)
   Int_t iFirstStrip = -1;
   Int_t boardNumber = atoi(localBoard->GetName()+6);
 
-  Int_t iline = localBoard->GetPosition().GetFirst();
-  Int_t icol  = localBoard->GetPosition().GetSecond();
+  Int_t iline = AliMp::PairFirst(localBoard->GetPosition());
+  Int_t icol  = AliMp::PairSecond(localBoard->GetPosition());
   if ( iline == 5 ) --icol;
 
   switch (boardNumber)