Updated for new numbering of motif positions in mapping.
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Jun 2005 10:29:31 +0000 (10:29 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Jun 2005 10:29:31 +0000 (10:29 +0000)
(Ivana)

MUON/AliMUONSt1GeometryBuilderV2.cxx
MUON/AliMUONSt1GeometryBuilderV2.h
MUON/mapping/macros/testAnyPadIterators.C
MUON/mapping/macros/testIndicesLimits.C
MUON/mapping/macros/testNeighboursPadIterator.C
MUON/mapping/macros/testPadsUpEtc.C
MUON/mapping/macros/testReadSector.C

index 015888efec288b3e8731d599a63ad039ffac6a0e..b19e6ad28e6daa901f99d78f034c98baa09a02fb 100644 (file)
@@ -110,6 +110,7 @@ const char  AliMUONSt1GeometryBuilderV2::fgkFoamLayerSuffix='F';  // prefix for
 const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMLayerName="SQM";
 const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantNLayerName="SQN";
 const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantFLayerName="SQF";
+const Int_t AliMUONSt1GeometryBuilderV2::fgkDaughterCopyNoOffset=1000;
 
 //______________________________________________________________________________
 AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(AliMUON* muon)
@@ -485,16 +486,16 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber)
 
 #ifdef ST1_WITH_STL
   SpecialMap specialMap;
-  specialMap[1001] = AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.);
-  specialMap[1002] = AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36));
-  specialMap[1003] = AliMUONSt1SpecialMotif(TVector2(1.01, 0.36));
+  specialMap[76] = AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.);
+  specialMap[75] = AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36));
+  specialMap[47] = AliMUONSt1SpecialMotif(TVector2(1.01, 0.36));
 #endif
   
 #ifdef ST1_WITH_ROOT
   SpecialMap specialMap;
-  specialMap.Add(1001, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.));
-  specialMap.Add(1002, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36)));
-  specialMap.Add(1003, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)));
+  specialMap.Add(76, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.));
+  specialMap.Add(75, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36)));
+  specialMap.Add(47, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)));
 #endif
 
   AliMpReader reader1(kStation1, kBendingPlane);
@@ -506,22 +507,22 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber)
   
 #ifdef ST1_WITH_STL
   specialMap.clear();
-  specialMap[4001] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.);
-  specialMap[4002] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17));
-  specialMap[4003] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18));
-  specialMap[4004] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08));
-  specialMap[4005] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25));
-  specialMap[4006] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21));
+  specialMap[76] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.);
+  specialMap[75] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17));
+  specialMap[47] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18));
+  specialMap[20] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08));
+  specialMap[46] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25));
+  specialMap[74] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21));
 #endif
 
 #ifdef ST1_WITH_ROOT
   specialMap.Delete();
-  specialMap.Add(4001,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.));
-  specialMap.Add(4002,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.96, 0.17)));
-  specialMap.Add(4003,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.61,-1.18)));
-  specialMap.Add(4004,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)));
-  specialMap.Add(4005,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25)));
-  specialMap.Add(4006,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.28, 0.21)));
+  specialMap.Add(76,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.));
+  specialMap.Add(75,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.96, 0.17)));
+  specialMap.Add(47,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.61,-1.18)));
+  specialMap.Add(20,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)));
+  specialMap.Add(46,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25)));
+  specialMap.Add(74,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.28, 0.21)));
 #endif
 
   AliMpReader reader2(kStation1, kNonBendingPlane);
@@ -2136,14 +2137,20 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(AliMpSector* sector,SpecialMap spe
 
         // and place all the daughter boards of this segment
         for (Int_t motifNum=0;motifNum<seg->GetNofMotifs();motifNum++) {
+
+         // Copy number
           Int_t motifPosId = seg->GetMotifPositionId(motifNum);
           AliMpMotifPosition* motifPos = 
             sector->GetMotifMap()->FindMotifPosition(motifPosId);
+         Int_t copyNo = motifPosId;
+         if ( sector->GetDirection() == kX) copyNo += fgkDaughterCopyNoOffset;
   
+          // Position
           posX = where.X() + motifPos->Position().X()/10.+fgkOffsetX;
           posY = where.Y() + motifPos->Position().Y()/10.+fgkOffsetY;
          posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); 
-          gMC->Gspos(fgkDaughterName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY");
+
+          gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY");
         }  
         segNum++;
        
@@ -2176,19 +2183,23 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(AliMpSector* sector,SpecialMap spe
 
           AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId);
 
+          // Copy number
+         Int_t copyNo = motifPosId;
+         if ( sector->GetDirection() == kX) copyNo += fgkDaughterCopyNoOffset;
+
           // place the hole for the motif, wrt the requested rotation angle
           Int_t rot = ( spMot.GetRotAngle()<0.1 ) ? reflZ:rotMat;
 
           posX = where.X() + motifPos->Position().X()/10.+spMot.GetDelta().X();
           posY = where.Y() + motifPos->Position().Y()/10.+spMot.GetDelta().Y();
           posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane);
-          gMC->Gspos(fgkHoleName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
+          gMC->Gspos(fgkHoleName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
 
           // then place the daughter board for the motif, wrt the requested rotation angle
           posX = posX+fgkDeltaFilleEtamX;
           posY = posY+fgkDeltaFilleEtamY;
          posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); 
-          gMC->Gspos(fgkDaughterName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
+          gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
 
 #ifdef ST1_WITH_STL
           alreadyDone.push_back(motifPosId);// mark this motif as done
index a135b24fe1a8f4b182f52f6a5ba6b465883c7d44..b77652a8fd447ed3dac8f7cfd9292e7322d16829 100644 (file)
@@ -94,6 +94,8 @@ class AliMUONSt1GeometryBuilderV2 : public AliMUONVGeometryBuilder
     static const char* fgkQuadrantFLayerName;// prefix for automatic volume naming
     static const char* fgkDaughterName;      // prefix for automatic volume naming
     static const char  fgkFoamLayerSuffix;   // suffix for automatic volume naming
+    static const Int_t fgkDaughterCopyNoOffset; // copy number offset for daugher
+                                                // boards positions in non-bending plane
 
     // Methods
     //
index 3e3e196c4ef59782b56acda77c761024c077d356..555f3c4ec7fecdbd40506a7cf28a34d6465ca8ea 100644 (file)
@@ -41,7 +41,8 @@ void testAnyPadIterators(AliMpStationType station = kStation1,
   if (motif) {
     AliMpMotifType* motifType = motif->GetMotifType();
     MarkPads(AliMpMotifTypePadIterator(motifType),15,15);
-    cout<<"______________ MotifType ____________________________"<<endl;
+    cout<<"______________ MotifType " << motifType->GetID() 
+        <<"__________________________"<<endl;
   } else cout<<"No motif found at given position..."<<endl;
   
   canv->cd(3);
@@ -52,8 +53,8 @@ void testAnyPadIterators(AliMpStationType station = kStation1,
            ,i+8,j+8);
   cout<<"________________ Neighbours __________________________"<<endl;
   canv->cd(4);
-  Int_t motifPosId = 1010; 
-  if (plane == kNonBendingPlane) motifPosId = 4010;
+  Int_t motifPosId = 20; 
+  if (plane == kNonBendingPlane) motifPosId = 19;
   AliMpMotifPosition* motifPos = sect->GetMotifMap()->FindMotifPosition(motifPosId);
   if (motifPos){
     //MarkPads(*AliMpPadIteratorPtr(motifPos->CreateIterator()),15,15);
index 5d8cc1f1d6bafbeffbc13e0a5786b9f881accf6c..44948735b4cf8a5d3a08907d25741af18a5293f6 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 //
-// Test macro for reading sector data.
+// Test macro for indices limits.
 
 void testIndicesLimits(AliMpStationType station = kStation1,
                        AliMpPlaneType plane = kBendingPlane) 
index 8cca3104451aad8bc02badb7449f77e9cac773d0..f77e7fc5c27d27253b692188fadafe9c1f22c033 100644 (file)
@@ -34,5 +34,17 @@ void testNeighboursPadIterator(AliMpStationType station = kStation1,
     marker->Draw();
   }
   
+  AliMpVPadIterator* iter2
+    = segm.CreateIterator(AliMpArea(pad.Position(),2.*pad.Dimensions()*1.1));
+
+  Int_t i=0;
+  for( iter2->First(); !iter2->IsDone() && i<10; iter2->Next()) {
+    Int_t ix = iter2->CurrentItem().GetIndices().GetFirst();
+    Int_t iy = iter2->CurrentItem().GetIndices().GetSecond();
+    cout<<"Iterator number "<< i << " at "<< iter2->CurrentItem().GetIndices() <<endl;
+    i++;
+  }
+  
+  delete iter2;
   delete sect;
 }
index f24406c2dcd1470c609c01496eb730dedc2dd651..f05196df46d4062333af1546840a4cb1ce5161fd 100644 (file)
@@ -7,23 +7,24 @@
 void testPadsUpEtc(AliMpStationType station = kStation1,
                    AliMpPlaneType  planeType = kBendingPlane)
 {
-  AliMpPlane* plane = AliMpPlane::Create(station, planeType);
-  AliMpPlaneSegmentation planeSegmentation(plane);
+  AliMpReader reader(station, planeType);  
+  AliMpSector* sector = reader.BuildSector();
+  AliMpSectorSegmentation segmentation(sector);
   
-  //AliMpIntPair indices(85, 101);
-  AliMpIntPair indices(-129, 10);
+  AliMpIntPair indices(85, 101);
+  if( planeType == kNonBendingPlane) indices = AliMpIntPair(129, 10);
  
   AliMpPad pad;
-  if (planeSegmentation.HasPad(indices)) {
+  if (segmentation.HasPad(indices)) {
          
-    pad = planeSegmentation.PadByIndices(indices);
+    pad = segmentation.PadByIndices(indices);
     cout << "Pad:      "  << pad << endl << endl;
   
     cout << "######### GO UP  ############### " << endl;
 
     AliMpPadPair nextPads(pad, pad);
     while (nextPads.GetFirst().IsValid()) {
-      nextPads = planeSegmentation.PadsUp(nextPads.GetFirst());
+      nextPads = segmentation.PadsUp(nextPads.GetFirst());
       cout << " up    1: "  << nextPads.GetFirst() << endl;    
       cout << "       2: "  << nextPads.GetSecond() << endl;    
     }
@@ -32,7 +33,7 @@ void testPadsUpEtc(AliMpStationType station = kStation1,
 
     nextPads = AliMpPadPair(pad, pad);
     while (nextPads.GetFirst().IsValid()) {
-      nextPads = planeSegmentation.PadsDown(nextPads.GetFirst());
+      nextPads = segmentation.PadsDown(nextPads.GetFirst());
       cout << " down  1: "  << nextPads.GetFirst() << endl;    
       cout << "       2: "  << nextPads.GetSecond() << endl;    
     }
@@ -41,7 +42,7 @@ void testPadsUpEtc(AliMpStationType station = kStation1,
 
     nextPads = AliMpPadPair(pad, pad);
     while (nextPads.GetFirst().IsValid()) {
-      nextPads = planeSegmentation.PadsRight(nextPads.GetFirst());
+      nextPads = segmentation.PadsRight(nextPads.GetFirst());
       cout << " right 1: "  << nextPads.GetFirst() << endl;    
       cout << "       2: "  << nextPads.GetSecond() << endl;    
     }
@@ -50,7 +51,7 @@ void testPadsUpEtc(AliMpStationType station = kStation1,
 
     nextPads = AliMpPadPair(pad, pad);
     while (nextPads.GetFirst().IsValid()) {
-      nextPads = planeSegmentation.PadsLeft(nextPads.GetFirst());
+      nextPads = segmentation.PadsLeft(nextPads.GetFirst());
       cout << " left  1: "  << nextPads.GetFirst() << endl;    
       cout << "       2: "  << nextPads.GetSecond() << endl;    
     }
index 8edd61504f2ee3c678814bb92e12201fae2d8d65..4b606008f2eb2cde1be03c0f217e530c5adff971 100644 (file)
@@ -2,6 +2,8 @@
 //
 // Test macro for reading sector data.
 
+#include <iomanip>
+
 void testReadSector(AliMpStationType station = kStation1,
                     AliMpPlaneType plane = kBendingPlane) 
 {
@@ -30,29 +32,21 @@ void testReadSector(AliMpStationType station = kStation1,
   cout << endl;
   
   // Find motif position test
-  for (Int_t i=1; i<4 ; i++) {
-    for (Int_t j=0; j<5; j++) {
-
-      Int_t start = 0;
-      if (plane == kBendingPlane) start = 0;
-      if (plane == kNonBendingPlane) start = 3000;
-    
-      Int_t id = start + i*1010 + 5*j;
-
-      cout << "Motif pos " << id;
-      if (!sector->FindRowSegment(id)) {
-         cout << " not found." << endl;
-      }
-      else {    
-         cout << " found in : "
-              << sector->FindRow(id)->GetID() << " row, "
-              << " motif id: "
-              << sector->FindRowSegment(id)->GetMotif(0)->GetID().Data()
-             << endl;
-      }      
-    }     
+  Int_t ids[15] = { 19, 14, 9, 32, 36, 136, 187, 212, 207, 220, 1, 131, 239, 243, 250 };  
+  for (Int_t i=0; i<15 ; i++) {
+    Int_t id = ids[i];
+    cout << "Motif pos " << std::setw(3) << id;
+    if (!sector->FindRowSegment(id)) {
+       cout << " not found." << endl;
+    }
+    else {      
+       cout << " found in : "
+            << sector->FindRow(id)->GetID() << " row, "
+            << " motif id: "
+            << sector->FindRowSegment(id)->GetMotif(0)->GetID().Data()
+           << endl;
+    }      
   }
-
   cout << endl;
 
   // Find motif by coordinates test
@@ -69,9 +63,12 @@ void testReadSector(AliMpStationType station = kStation1,
   }
 
   // Find special motif test
-  if (plane == kNonBendingPlane)
+  if (plane == kNonBendingPlane) {
+  
+    Int_t ids[6] = { 20, 46, 47, 74, 75, 76 };
     for (Int_t i=0; i<6 ; i++) {
-      Int_t id = 4001 + i;
+      
+      Int_t id = ids[i];
       cout << "Motif pos " << id;
       if (!sector->FindRowSegment(id)) {
          cout << " not found." << endl;
@@ -83,7 +80,8 @@ void testReadSector(AliMpStationType station = kStation1,
              << sector->FindPosition(id).X() << "  " <<  sector->FindPosition(id).Y()
              << endl;
       }
-    }           
+    }
+  }             
   cout << endl;
 
   // Motif map