]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Correcting a long standing bug in the mapping of short slats
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jul 2008 17:10:48 +0000 (17:10 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jul 2008 17:10:48 +0000 (17:10 +0000)
MUON/Calib/MappingData/Run0_999999999_v0_s0.root
MUON/mapping/data/station345/112200SR2.Bending.slat
MUON/mapping/data/station345/122000SR1.Bending.slat
MUON/mapping/data/station345/122200S.Bending.slat
MUON/mapping/data/station345/S2B+.pcb [new file with mode: 0644]
MUON/mapping/data/station345/S2B-.pcb [new file with mode: 0644]
MUON/mapping/data/station345/flipPCB.C
MUON/mapping/data/station345/makePadPos.C
MUON/mapping/macros/testGraphicsSlat.C

index f48e44120ed2ea0fed516d41e9c2c4d5efe74492..c31942676bab6626951bf941db9237f1a0641d04 100644 (file)
Binary files a/MUON/Calib/MappingData/Run0_999999999_v0_s0.root and b/MUON/Calib/MappingData/Run0_999999999_v0_s0.root differ
index 4a8ec35a4056f8c63c5c595b4d1d479c8df9d55f..d07cd11e4f4e301d462a13acda6734d1e8e7e4c8 100644 (file)
@@ -2,4 +2,4 @@
 PCB R2B 6-4;413-401;7
 PCB B1  127-118;232-223
 PCB B2  113-109;215-211
-PCB S2B 105-101;207-204
+PCB S2B+ 105-101;207-204
index ca391aede36968dd0a8068cb8a803801cb0f95ce..6440da5493ed673b4c1e44f7f46d3a9d8d71fea8 100644 (file)
@@ -2,4 +2,4 @@
 PCB R1B 1-3;304-307
 PCB B1  6-15;315-324
 PCB B2  111-115;209-213
-PCB S2B 104-107;201-205
+PCB S2B+ 104-107;201-205
index 7bb2289abc786f0ad2141eea4b3949c8d35dc607..e03b72ea9992f0ed38fd50d1ec2302278f908cac 100644 (file)
@@ -1,4 +1,4 @@
 PCB B1  1-10;308-317
 PCB B2  119-123;218-222
 PCB B2  111-115;209-213
-PCB S2B 104-107;201-205
+PCB S2B- 104-107;201-205
diff --git a/MUON/mapping/data/station345/S2B+.pcb b/MUON/mapping/data/station345/S2B+.pcb
new file mode 100644 (file)
index 0000000..58b8f15
--- /dev/null
@@ -0,0 +1,15 @@
+# Bending PCB. Density 2. Short.
+# Placing motifs starting bottom left and going counter-clockwise
+
+SIZES 5 0.5 40 40
+
+MOTIF L21  0 0
+MOTIF  Z6  1 0
+MOTIF O11  3 0
+MOTIF L22  4 0
+MOTIF  I1  6 0
+
+MOTIF Z7   4 40
+MOTIF O12  3 48
+MOTIF Z8   1 40
+MOTIF L23  0 40
diff --git a/MUON/mapping/data/station345/S2B-.pcb b/MUON/mapping/data/station345/S2B-.pcb
new file mode 100644 (file)
index 0000000..723f78a
--- /dev/null
@@ -0,0 +1,19 @@
+# Bending PCB. Density 2. Short.
+# Placing motifs starting bottom left and going counter-clockwise
+
+SIZES 5 0.5 40 40
+
+MOTIF I1  0 0
+MOTIF L18 1 0
+MOTIF O10 2 0
+MOTIF Z4  3 0
+MOTIF L8  5 0
+
+MOTIF L6  5 40
+MOTIF Z2  3 40
+MOTIF O9  2 48
+MOTIF Z5  0 40
+
+
+
+
index 17faed8e5fee937088d3699e536c197d2848901f..708e2908a3e8743164377ac8dbc1eff33625770d 100644 (file)
@@ -1,6 +1,9 @@
 
 #include "flipPCB.h"
 
+#include "AliMpDataMap.h"
+#include "AliMpDataProcessor.h"
+#include "AliMpDataStreams.h"
 #include "AliMpMotif.h"
 #include "AliMpMotifType.h"
 #include "AliMpMotifPosition.h"
@@ -96,15 +99,21 @@ void flipPCB(const char* srcName)
 {
   // flip PCB in X-direction
 
-  AliMpSlatMotifMap* srcMotifs = new AliMpSlatMotifMap;
-  AliMpSlatMotifMap* destMotifs = new AliMpSlatMotifMap;
+//  AliMpSlatMotifMap* srcMotifs = new AliMpSlatMotifMap;
+//  AliMpSlatMotifMap* destMotifs = new AliMpSlatMotifMap;
+
+  AliMpDataProcessor mp;
+  AliMpDataMap* dataMap = mp.CreateDataMap("data");
+  AliMpDataStreams dataStream(dataMap);
   
-  AliMpSt345Reader reader(*srcMotifs);
+  AliMpSt345Reader reader(dataStream);
 
   AliMpPCB* src = reader.ReadPCB(srcName);
   
   if (!src) return;
 
+  AliMpSlatMotifMap* destMotifs = reader.MotifMap();
+  
   AliMpPCB* dest = flipX(*src,*destMotifs);
     
   if (!dest)
index b95f696da5dee5caff9f012d53fa783ffa9594f5..c66a4d7a58a5b8e22365494b3bca76733bed9362 100644 (file)
@@ -12,12 +12,12 @@ std::vector<std::pair<int,int> > make_pattern(const std::string& what)
 {
   std::vector<std::pair<int,int> > cols;
 
-  if ( what == "L5" )
+  if ( what == "L5" || what == "L23" )
     {
       cols.push_back(std::make_pair<int,int>(0,40)); // starting at zero, length = 40
       cols.push_back(std::make_pair<int,int>(0,24));
     }
-  else if ( what == "Z1" || what == "Z5" )
+  else if ( what == "Z1" || what == "Z5" || what == "Z8" )
     {
       cols.push_back(std::make_pair<int,int>(24,16));
       cols.push_back(std::make_pair<int,int>(0,40));
@@ -29,7 +29,7 @@ std::vector<std::pair<int,int> > make_pattern(const std::string& what)
       add(cols,0,32);
       add(cols,0,32);
     }
-  else if ( what == "Z2" )
+  else if ( what == "Z2" || what == "Z7" )
     {
       cols.push_back(std::make_pair<int,int>(0,8));
       cols.push_back(std::make_pair<int,int>(0,40));
@@ -40,12 +40,12 @@ std::vector<std::pair<int,int> > make_pattern(const std::string& what)
       cols.push_back(std::make_pair<int,int>(0,24));
       cols.push_back(std::make_pair<int,int>(0,40));
     }
-  else if ( what == "L7" )
+  else if ( what == "L7" || what == "L21" )
     {
       cols.push_back(std::make_pair<int,int>(0,40));
       cols.push_back(std::make_pair<int,int>(16,24));
     }
-  else if ( what == "Z3" )
+  else if ( what == "Z3" || what == "Z6" )
     {
       cols.push_back(std::make_pair<int,int>(0,16));
       cols.push_back(std::make_pair<int,int>(0,40));
@@ -468,6 +468,11 @@ std::vector<std::pair<int,int> > make_pattern(const std::string& what)
       add(cols,0,40);
       add(cols,32,8);
     }
+  else if ( what == "L22" )
+  {
+    add(cols,32,8);
+    add(cols,0,40);
+  }
   else if ( what == "L19" )
     {
       add(cols,0,48);
index d80c0747f233c5854fb2585551f697801226444a..61c2fb225fa31da92c6c70e118ba716473842ef3 100644 (file)
@@ -24,6 +24,7 @@
 
 // MUON includes
 #include "AliMpSt345Reader.h"
+#include "AliMpPCB.h"
 #include "AliMpSlat.h"
 #include "AliMpVPainter.h"
 #include "AliMpMotifReader.h"
 #include "AliMpSlatMotifMap.h"
 #include "TVector2.h"
 #include "TCanvas.h"
+#include "AliMpDataStreams.h"
 #endif
 
-void testGraphicsMotif(Option_t* motifType = "R43", const TVector2& padSizes = TVector2(2.5,0.5))
+void testGraphicsMotif(Option_t* motifType = "R43", const TVector2& padSizes = TVector2(5,0.5))
 {
   // Warning : this function leaks memory. But should be fine as only used 
   // interactively to check a few motifs at once...
   //
-  AliMpMotifReader reader(AliMp::kStation345,AliMp::kBendingPlane);
+  AliMpDataStreams ds;
+  AliMpMotifReader reader(ds,AliMp::kStation345,AliMp::kBendingPlane);
   AliMpMotifType* type = reader.BuildMotifType(motifType);
   if (!type)
   {
     cerr << "Motif not found" << endl;
     return;
   }
+  type->Print("G");
   AliMpMotif* motif = new AliMpMotif(motifType,type,padSizes);
   AliMpMotifPosition* pos = new AliMpMotifPosition(0,motif,TVector2(0,0));
   AliMpVPainter* painter = AliMpVPainter::CreatePainter(pos);
@@ -55,8 +59,8 @@ void testGraphicsMotif(Option_t* motifType = "R43", const TVector2& padSizes = T
     cerr << "Could not get a painter !" << endl;
     return;
   }
-  TCanvas* c = new TCanvas();
-  painter->Draw("MP");
+  new TCanvas(motifType,motifType);
+  painter->Draw("PT");
 }
 
 //112230N
@@ -73,6 +77,8 @@ void testGraphicsSlat(AliMp::PlaneType planeType = AliMp::kBendingPlane,
   // P pad
   // I indices
 
+  // PMPT to get manu channels numbering
+  
   Char_t *slatName[19] = {"122000SR1", "112200SR2", "122200S", "222000N", "220000N",
                          "122000NR1", "112200NR2", "122200N",
                          "122330N", "112233NR3", "112230N", "222330N", "223300N", "333000N", "330000N",
@@ -82,13 +88,13 @@ void testGraphicsSlat(AliMp::PlaneType planeType = AliMp::kBendingPlane,
   Char_t c1Name[255];
   Char_t c1NameJpg[255];
   
-  for (Int_t i = 0; i < 19; i++) {
+  for (Int_t i = 0; i < 2; i++) {
     sprintf(c1Name, "%s%d", "c1", i);
     c1[i]= new TCanvas(c1Name,slatName[i],10,10,1200,800);     
 
     Char_t* slatType = slatName[i];
-    AliMpSlatMotifMap* smm = new AliMpSlatMotifMap;
-    AliMpSt345Reader* reader = new AliMpSt345Reader(*smm);
+    AliMpDataStreams ds;
+    AliMpSt345Reader* reader = new AliMpSt345Reader(ds);
     AliMpSlat* slat = reader->ReadSlat(slatType, planeType);
     AliMpVPainter* painter = AliMpVPainter::CreatePainter(slat);
     painter->Draw(option);
@@ -102,3 +108,26 @@ void testGraphicsSlat(AliMp::PlaneType planeType = AliMp::kBendingPlane,
   }
  
 }
+
+void testGraphicsPCB(const char* pcbName="S2B",
+                      Option_t* option = "MZT",
+                      Bool_t savePNG = false)
+{
+  
+  TCanvas* c = new TCanvas(pcbName,pcbName,10,10,1200,800);     
+    
+  AliMpDataStreams ds;
+  AliMpSt345Reader* reader = new AliMpSt345Reader(ds);
+  AliMpPCB* pcb = reader->ReadPCB(pcbName);
+  if (!pcb) 
+  {
+    cerr << "PCB " << pcbName << " does not exist" << endl;
+    return;
+  }
+  
+  AliMpVPainter* painter = AliMpVPainter::CreatePainter(pcb);
+  painter->Draw(option);
+    
+  if (savePNG) c->Print(Form("%s-%s.png",pcbName,option));
+  
+}