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)
#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);
#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);
// 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++;
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
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;
}
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;
}
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;
}
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;
}
//
// Test macro for reading sector data.
+#include <iomanip>
+
void testReadSector(AliMpStationType station = kStation1,
AliMpPlaneType plane = kBendingPlane)
{
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
}
// 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;
<< sector->FindPosition(id).X() << " " << sector->FindPosition(id).Y()
<< endl;
}
- }
+ }
+ }
cout << endl;
// Motif map