From 5f91c9e8258ef2957fffa70b9de7d628bcd95b9f Mon Sep 17 00:00:00 2001 From: hristov Date: Fri, 2 May 2003 15:09:39 +0000 Subject: [PATCH] Code for MUON Station1 (I.Hrivnacova) --- MUON/AliMUONSt1Decoder.cxx | 6 +- MUON/AliMUONSt1Decoder.h | 6 +- MUON/AliMUONSt1ElectronicElement.cxx | 6 +- MUON/AliMUONSt1ElectronicElement.h | 4 +- MUON/AliMUONSt1IniReader.cxx | 28 +- MUON/AliMUONSt1IniReader.h | 7 +- MUON/AliMUONSt1Response.cxx | 47 +- MUON/AliMUONSt1Response.h | 25 +- MUON/AliMUONSt1ResponseParameter.h | 10 +- MUON/AliMUONSt1ResponseRule.cxx | 6 +- MUON/AliMUONSt1ResponseRule.h | 4 +- MUON/AliMUONSt1Segmentation.cxx | 43 +- MUON/AliMUONSt1Segmentation.h | 20 +- MUON/AliMUONSt1Types.h | 42 + MUON/AliMUONv1.cxx | 32 +- MUON/AliMUONv1.h | 1 + MUON/AliMUONv2.cxx | 3376 +++++++++++------ MUON/AliMUONv2.h | 172 +- MUON/MUONLinkDef.h | 8 +- MUON/MUONLinkDefMapping.h | 75 + MUON/libMUON.pkg | 27 +- MUON/libMUON.pkg.mapping | 73 + MUON/mapping/AliMpArea.cxx | 162 + MUON/mapping/AliMpArea.h | 60 + MUON/mapping/AliMpBasicTypes.h | 22 + MUON/mapping/AliMpConnection.cxx | 42 + MUON/mapping/AliMpConnection.h | 58 + MUON/mapping/AliMpConstants.cxx | 50 + MUON/mapping/AliMpConstants.h | 50 + MUON/mapping/AliMpDirection.h | 19 + MUON/mapping/AliMpFiles.cxx | 173 + MUON/mapping/AliMpFiles.h | 83 + MUON/mapping/AliMpGraphContext.cxx | 92 + MUON/mapping/AliMpGraphContext.h | 71 + MUON/mapping/AliMpGraphicsTypes.h | 23 + MUON/mapping/AliMpIntPair.cxx | 176 + MUON/mapping/AliMpIntPair.h | 60 + MUON/mapping/AliMpMotif.cxx | 86 + MUON/mapping/AliMpMotif.h | 52 + MUON/mapping/AliMpMotifMap.cxx | 434 +++ MUON/mapping/AliMpMotifMap.h | 82 + MUON/mapping/AliMpMotifPainter.cxx | 149 + MUON/mapping/AliMpMotifPainter.h | 32 + MUON/mapping/AliMpMotifPosition.cxx | 57 + MUON/mapping/AliMpMotifPosition.h | 63 + .../mapping/AliMpMotifPositionPadIterator.cxx | 143 + MUON/mapping/AliMpMotifPositionPadIterator.h | 48 + MUON/mapping/AliMpMotifSpecial.cxx | 217 ++ MUON/mapping/AliMpMotifSpecial.h | 55 + MUON/mapping/AliMpMotifType.cxx | 273 ++ MUON/mapping/AliMpMotifType.h | 87 + MUON/mapping/AliMpMotifTypePadIterator.cxx | 178 + MUON/mapping/AliMpMotifTypePadIterator.h | 49 + MUON/mapping/AliMpMotifTypes.h | 49 + MUON/mapping/AliMpNeighboursPadIterator.cxx | 288 ++ MUON/mapping/AliMpNeighboursPadIterator.h | 66 + MUON/mapping/AliMpPad.cxx | 163 + MUON/mapping/AliMpPad.h | 63 + MUON/mapping/AliMpPadIteratorPtr.cxx | 26 + MUON/mapping/AliMpPadIteratorPtr.h | 43 + MUON/mapping/AliMpPadPair.cxx | 69 + MUON/mapping/AliMpPadPair.h | 47 + MUON/mapping/AliMpPadRow.cxx | 137 + MUON/mapping/AliMpPadRow.h | 50 + MUON/mapping/AliMpPadRowSegment.cxx | 165 + MUON/mapping/AliMpPadRowSegment.h | 61 + MUON/mapping/AliMpPlane.cxx | 154 + MUON/mapping/AliMpPlane.h | 73 + MUON/mapping/AliMpPlaneAreaPadIterator.cxx | 184 + MUON/mapping/AliMpPlaneAreaPadIterator.h | 60 + MUON/mapping/AliMpPlaneSegmentation.cxx | 375 ++ MUON/mapping/AliMpPlaneSegmentation.h | 83 + MUON/mapping/AliMpPlaneType.h | 19 + MUON/mapping/AliMpPlaneTypes.h | 31 + MUON/mapping/AliMpReader.cxx | 703 ++++ MUON/mapping/AliMpReader.h | 81 + MUON/mapping/AliMpRow.cxx | 398 ++ MUON/mapping/AliMpRow.h | 78 + MUON/mapping/AliMpRowPainter.cxx | 117 + MUON/mapping/AliMpRowPainter.h | 31 + MUON/mapping/AliMpRowSegment.cxx | 363 ++ MUON/mapping/AliMpRowSegment.h | 77 + MUON/mapping/AliMpRowSegmentPainter.cxx | 118 + MUON/mapping/AliMpRowSegmentPainter.h | 31 + MUON/mapping/AliMpRowSegmentSpecial.cxx | 597 +++ MUON/mapping/AliMpRowSegmentSpecial.h | 83 + MUON/mapping/AliMpSector.cxx | 402 ++ MUON/mapping/AliMpSector.h | 99 + MUON/mapping/AliMpSectorAreaHPadIterator.cxx | 191 + MUON/mapping/AliMpSectorAreaHPadIterator.h | 59 + MUON/mapping/AliMpSectorAreaVPadIterator.cxx | 191 + MUON/mapping/AliMpSectorAreaVPadIterator.h | 58 + MUON/mapping/AliMpSectorPadIterator.cxx | 217 ++ MUON/mapping/AliMpSectorPadIterator.h | 55 + MUON/mapping/AliMpSectorPainter.cxx | 217 ++ MUON/mapping/AliMpSectorPainter.h | 31 + MUON/mapping/AliMpSectorPosition.cxx | 41 + MUON/mapping/AliMpSectorPosition.h | 56 + MUON/mapping/AliMpSectorSegmentation.cxx | 505 +++ MUON/mapping/AliMpSectorSegmentation.h | 79 + MUON/mapping/AliMpSectorTypes.h | 62 + MUON/mapping/AliMpSubZone.cxx | 94 + MUON/mapping/AliMpSubZone.h | 48 + MUON/mapping/AliMpSubZonePainter.cxx | 198 + MUON/mapping/AliMpSubZonePainter.h | 34 + MUON/mapping/AliMpTransformPadIterator.cxx | 121 + MUON/mapping/AliMpTransformPadIterator.h | 44 + MUON/mapping/AliMpTransformer.cxx | 192 + MUON/mapping/AliMpTransformer.h | 71 + MUON/mapping/AliMpVIndexed.cxx | 68 + MUON/mapping/AliMpVIndexed.h | 62 + MUON/mapping/AliMpVMotif.cxx | 87 + MUON/mapping/AliMpVMotif.h | 59 + MUON/mapping/AliMpVPadIterator.cxx | 52 + MUON/mapping/AliMpVPadIterator.h | 37 + MUON/mapping/AliMpVPainter.cxx | 201 + MUON/mapping/AliMpVPainter.h | 60 + MUON/mapping/AliMpVRowSegment.cxx | 40 + MUON/mapping/AliMpVRowSegment.h | 58 + MUON/mapping/AliMpVSegmentation.cxx | 126 + MUON/mapping/AliMpVSegmentation.h | 59 + MUON/mapping/AliMpZone.cxx | 86 + MUON/mapping/AliMpZone.h | 63 + MUON/mapping/AliMpZonePainter.cxx | 230 ++ MUON/mapping/AliMpZonePainter.h | 34 + MUON/mapping/data/bending_plane/motifA.dat | 84 + MUON/mapping/data/bending_plane/motifB.dat | 84 + MUON/mapping/data/bending_plane/motifC.dat | 84 + MUON/mapping/data/bending_plane/motifD.dat | 84 + MUON/mapping/data/bending_plane/motifE.dat | 84 + MUON/mapping/data/bending_plane/motifF.dat | 84 + MUON/mapping/data/bending_plane/motifG.dat | 84 + MUON/mapping/data/bending_plane/motifH.dat | 84 + MUON/mapping/data/bending_plane/motifI.dat | 83 + .../data/bending_plane/motifSpecial8.2.dat | 64 + .../data/bending_plane/motifSpecial8.3.dat | 64 + .../data/bending_plane/motifSpecial8.dat | 64 + MUON/mapping/data/bending_plane/padPosA.dat | 65 + MUON/mapping/data/bending_plane/padPosB.dat | 64 + MUON/mapping/data/bending_plane/padPosC.dat | 64 + MUON/mapping/data/bending_plane/padPosD.dat | 64 + MUON/mapping/data/bending_plane/padPosE.dat | 48 + MUON/mapping/data/bending_plane/padPosF.dat | 63 + MUON/mapping/data/bending_plane/padPosG.dat | 64 + MUON/mapping/data/bending_plane/padPosH.dat | 46 + MUON/mapping/data/bending_plane/padPosI.dat | 32 + MUON/mapping/data/bending_plane/zones.dat | 71 + MUON/mapping/data/bergToGC.dat | 80 + .../mapping/data/non-bending_plane/motifA.dat | 84 + .../mapping/data/non-bending_plane/motifB.dat | 84 + .../mapping/data/non-bending_plane/motifC.dat | 82 + .../mapping/data/non-bending_plane/motifD.dat | 84 + .../mapping/data/non-bending_plane/motifE.dat | 84 + .../mapping/data/non-bending_plane/motifF.dat | 84 + .../mapping/data/non-bending_plane/motifG.dat | 84 + .../mapping/data/non-bending_plane/motifH.dat | 84 + .../mapping/data/non-bending_plane/motifI.dat | 84 + .../mapping/data/non-bending_plane/motifJ.dat | 84 + .../mapping/data/non-bending_plane/motifK.dat | 84 + .../mapping/data/non-bending_plane/motifL.dat | 84 + .../mapping/data/non-bending_plane/motifM.dat | 84 + .../mapping/data/non-bending_plane/motifN.dat | 84 + .../non-bending_plane/motifSpecial14.10.dat | 48 + .../data/non-bending_plane/motifSpecial14.dat | 64 + .../data/non-bending_plane/padPosA.dat | 64 + .../data/non-bending_plane/padPosB.dat | 64 + .../data/non-bending_plane/padPosC.dat | 64 + .../data/non-bending_plane/padPosD.dat | 64 + .../data/non-bending_plane/padPosE.dat | 64 + .../data/non-bending_plane/padPosF.dat | 64 + .../data/non-bending_plane/padPosG.dat | 64 + .../data/non-bending_plane/padPosH.dat | 48 + .../data/non-bending_plane/padPosI.dat | 56 + .../data/non-bending_plane/padPosJ.dat | 40 + .../data/non-bending_plane/padPosK.dat | 40 + .../data/non-bending_plane/padPosL.dat | 64 + .../data/non-bending_plane/padPosM.dat | 64 + .../data/non-bending_plane/padPosN.dat | 64 + MUON/mapping/data/non-bending_plane/zones.dat | 65 + .../data/non-bending_plane/zones_special.dat | 101 + 180 files changed, 18875 insertions(+), 1443 deletions(-) create mode 100644 MUON/AliMUONSt1Types.h create mode 100644 MUON/MUONLinkDefMapping.h create mode 100644 MUON/libMUON.pkg.mapping create mode 100755 MUON/mapping/AliMpArea.cxx create mode 100755 MUON/mapping/AliMpArea.h create mode 100755 MUON/mapping/AliMpBasicTypes.h create mode 100755 MUON/mapping/AliMpConnection.cxx create mode 100755 MUON/mapping/AliMpConnection.h create mode 100755 MUON/mapping/AliMpConstants.cxx create mode 100755 MUON/mapping/AliMpConstants.h create mode 100755 MUON/mapping/AliMpDirection.h create mode 100755 MUON/mapping/AliMpFiles.cxx create mode 100755 MUON/mapping/AliMpFiles.h create mode 100755 MUON/mapping/AliMpGraphContext.cxx create mode 100755 MUON/mapping/AliMpGraphContext.h create mode 100644 MUON/mapping/AliMpGraphicsTypes.h create mode 100755 MUON/mapping/AliMpIntPair.cxx create mode 100755 MUON/mapping/AliMpIntPair.h create mode 100755 MUON/mapping/AliMpMotif.cxx create mode 100755 MUON/mapping/AliMpMotif.h create mode 100755 MUON/mapping/AliMpMotifMap.cxx create mode 100755 MUON/mapping/AliMpMotifMap.h create mode 100755 MUON/mapping/AliMpMotifPainter.cxx create mode 100755 MUON/mapping/AliMpMotifPainter.h create mode 100755 MUON/mapping/AliMpMotifPosition.cxx create mode 100755 MUON/mapping/AliMpMotifPosition.h create mode 100755 MUON/mapping/AliMpMotifPositionPadIterator.cxx create mode 100755 MUON/mapping/AliMpMotifPositionPadIterator.h create mode 100755 MUON/mapping/AliMpMotifSpecial.cxx create mode 100755 MUON/mapping/AliMpMotifSpecial.h create mode 100755 MUON/mapping/AliMpMotifType.cxx create mode 100755 MUON/mapping/AliMpMotifType.h create mode 100755 MUON/mapping/AliMpMotifTypePadIterator.cxx create mode 100755 MUON/mapping/AliMpMotifTypePadIterator.h create mode 100644 MUON/mapping/AliMpMotifTypes.h create mode 100755 MUON/mapping/AliMpNeighboursPadIterator.cxx create mode 100755 MUON/mapping/AliMpNeighboursPadIterator.h create mode 100755 MUON/mapping/AliMpPad.cxx create mode 100755 MUON/mapping/AliMpPad.h create mode 100755 MUON/mapping/AliMpPadIteratorPtr.cxx create mode 100755 MUON/mapping/AliMpPadIteratorPtr.h create mode 100644 MUON/mapping/AliMpPadPair.cxx create mode 100644 MUON/mapping/AliMpPadPair.h create mode 100755 MUON/mapping/AliMpPadRow.cxx create mode 100755 MUON/mapping/AliMpPadRow.h create mode 100755 MUON/mapping/AliMpPadRowSegment.cxx create mode 100755 MUON/mapping/AliMpPadRowSegment.h create mode 100644 MUON/mapping/AliMpPlane.cxx create mode 100644 MUON/mapping/AliMpPlane.h create mode 100755 MUON/mapping/AliMpPlaneAreaPadIterator.cxx create mode 100755 MUON/mapping/AliMpPlaneAreaPadIterator.h create mode 100644 MUON/mapping/AliMpPlaneSegmentation.cxx create mode 100644 MUON/mapping/AliMpPlaneSegmentation.h create mode 100755 MUON/mapping/AliMpPlaneType.h create mode 100644 MUON/mapping/AliMpPlaneTypes.h create mode 100755 MUON/mapping/AliMpReader.cxx create mode 100755 MUON/mapping/AliMpReader.h create mode 100755 MUON/mapping/AliMpRow.cxx create mode 100755 MUON/mapping/AliMpRow.h create mode 100755 MUON/mapping/AliMpRowPainter.cxx create mode 100755 MUON/mapping/AliMpRowPainter.h create mode 100755 MUON/mapping/AliMpRowSegment.cxx create mode 100755 MUON/mapping/AliMpRowSegment.h create mode 100755 MUON/mapping/AliMpRowSegmentPainter.cxx create mode 100755 MUON/mapping/AliMpRowSegmentPainter.h create mode 100755 MUON/mapping/AliMpRowSegmentSpecial.cxx create mode 100755 MUON/mapping/AliMpRowSegmentSpecial.h create mode 100755 MUON/mapping/AliMpSector.cxx create mode 100755 MUON/mapping/AliMpSector.h create mode 100755 MUON/mapping/AliMpSectorAreaHPadIterator.cxx create mode 100755 MUON/mapping/AliMpSectorAreaHPadIterator.h create mode 100644 MUON/mapping/AliMpSectorAreaVPadIterator.cxx create mode 100644 MUON/mapping/AliMpSectorAreaVPadIterator.h create mode 100755 MUON/mapping/AliMpSectorPadIterator.cxx create mode 100755 MUON/mapping/AliMpSectorPadIterator.h create mode 100755 MUON/mapping/AliMpSectorPainter.cxx create mode 100755 MUON/mapping/AliMpSectorPainter.h create mode 100644 MUON/mapping/AliMpSectorPosition.cxx create mode 100644 MUON/mapping/AliMpSectorPosition.h create mode 100755 MUON/mapping/AliMpSectorSegmentation.cxx create mode 100755 MUON/mapping/AliMpSectorSegmentation.h create mode 100644 MUON/mapping/AliMpSectorTypes.h create mode 100755 MUON/mapping/AliMpSubZone.cxx create mode 100755 MUON/mapping/AliMpSubZone.h create mode 100755 MUON/mapping/AliMpSubZonePainter.cxx create mode 100755 MUON/mapping/AliMpSubZonePainter.h create mode 100755 MUON/mapping/AliMpTransformPadIterator.cxx create mode 100755 MUON/mapping/AliMpTransformPadIterator.h create mode 100644 MUON/mapping/AliMpTransformer.cxx create mode 100644 MUON/mapping/AliMpTransformer.h create mode 100755 MUON/mapping/AliMpVIndexed.cxx create mode 100755 MUON/mapping/AliMpVIndexed.h create mode 100755 MUON/mapping/AliMpVMotif.cxx create mode 100755 MUON/mapping/AliMpVMotif.h create mode 100755 MUON/mapping/AliMpVPadIterator.cxx create mode 100755 MUON/mapping/AliMpVPadIterator.h create mode 100755 MUON/mapping/AliMpVPainter.cxx create mode 100755 MUON/mapping/AliMpVPainter.h create mode 100755 MUON/mapping/AliMpVRowSegment.cxx create mode 100755 MUON/mapping/AliMpVRowSegment.h create mode 100644 MUON/mapping/AliMpVSegmentation.cxx create mode 100644 MUON/mapping/AliMpVSegmentation.h create mode 100755 MUON/mapping/AliMpZone.cxx create mode 100755 MUON/mapping/AliMpZone.h create mode 100755 MUON/mapping/AliMpZonePainter.cxx create mode 100755 MUON/mapping/AliMpZonePainter.h create mode 100755 MUON/mapping/data/bending_plane/motifA.dat create mode 100755 MUON/mapping/data/bending_plane/motifB.dat create mode 100755 MUON/mapping/data/bending_plane/motifC.dat create mode 100755 MUON/mapping/data/bending_plane/motifD.dat create mode 100755 MUON/mapping/data/bending_plane/motifE.dat create mode 100755 MUON/mapping/data/bending_plane/motifF.dat create mode 100755 MUON/mapping/data/bending_plane/motifG.dat create mode 100755 MUON/mapping/data/bending_plane/motifH.dat create mode 100755 MUON/mapping/data/bending_plane/motifI.dat create mode 100755 MUON/mapping/data/bending_plane/motifSpecial8.2.dat create mode 100755 MUON/mapping/data/bending_plane/motifSpecial8.3.dat create mode 100755 MUON/mapping/data/bending_plane/motifSpecial8.dat create mode 100755 MUON/mapping/data/bending_plane/padPosA.dat create mode 100755 MUON/mapping/data/bending_plane/padPosB.dat create mode 100755 MUON/mapping/data/bending_plane/padPosC.dat create mode 100755 MUON/mapping/data/bending_plane/padPosD.dat create mode 100755 MUON/mapping/data/bending_plane/padPosE.dat create mode 100755 MUON/mapping/data/bending_plane/padPosF.dat create mode 100755 MUON/mapping/data/bending_plane/padPosG.dat create mode 100755 MUON/mapping/data/bending_plane/padPosH.dat create mode 100755 MUON/mapping/data/bending_plane/padPosI.dat create mode 100755 MUON/mapping/data/bending_plane/zones.dat create mode 100755 MUON/mapping/data/bergToGC.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifA.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifB.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifC.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifD.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifE.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifF.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifG.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifH.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifI.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifJ.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifK.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifL.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifM.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifN.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifSpecial14.10.dat create mode 100755 MUON/mapping/data/non-bending_plane/motifSpecial14.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosA.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosB.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosC.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosD.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosE.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosF.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosG.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosH.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosI.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosJ.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosK.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosL.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosM.dat create mode 100755 MUON/mapping/data/non-bending_plane/padPosN.dat create mode 100755 MUON/mapping/data/non-bending_plane/zones.dat create mode 100755 MUON/mapping/data/non-bending_plane/zones_special.dat diff --git a/MUON/AliMUONSt1Decoder.cxx b/MUON/AliMUONSt1Decoder.cxx index 1cf5869ebd6..5334752e575 100644 --- a/MUON/AliMUONSt1Decoder.cxx +++ b/MUON/AliMUONSt1Decoder.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.1 2003/01/28 13:21:06 morsch +Improved response simulation for station 1. +(M. Mac Cormick, I. Hrivnacova, D. Guez) + */ // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay @@ -33,8 +37,6 @@ $Log$ #include "AliMUONSt1Decoder.h" -using namespace std; - //_____________________________________________________________________ vector decoder::SplitNtuples(const string& s, const string& leftSep, diff --git a/MUON/AliMUONSt1Decoder.h b/MUON/AliMUONSt1Decoder.h index 85630763f3c..ec99e001187 100644 --- a/MUON/AliMUONSt1Decoder.h +++ b/MUON/AliMUONSt1Decoder.h @@ -22,13 +22,11 @@ #include #include #include -#include + +#include "AliMUONSt1Types.h" namespace decoder { - using std::vector; - using std::pair; - using std::string; vector SplitNtuples(const string& s, const string& leftSep ="({[\"'/", const string& rightSep=")}]\"'/"); diff --git a/MUON/AliMUONSt1ElectronicElement.cxx b/MUON/AliMUONSt1ElectronicElement.cxx index 3ea8d6587ee..7e63ca5f5b6 100644 --- a/MUON/AliMUONSt1ElectronicElement.cxx +++ b/MUON/AliMUONSt1ElectronicElement.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.1 2003/01/28 13:21:06 morsch +Improved response simulation for station 1. +(M. Mac Cormick, I. Hrivnacova, D. Guez) + */ // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay @@ -105,7 +109,7 @@ Bool_t AliMUONSt1ElectronicElement::IsInRange(Int_t numVar,Double_t x) const } //______________________________________________________________________________ -Bool_t AliMUONSt1ElectronicElement::Contains(const MPad& pad) const +Bool_t AliMUONSt1ElectronicElement::Contains(const AliMpPad& pad) const { // is the pad contained in this range // --- diff --git a/MUON/AliMUONSt1ElectronicElement.h b/MUON/AliMUONSt1ElectronicElement.h index ab7705920e9..00a658050c3 100644 --- a/MUON/AliMUONSt1ElectronicElement.h +++ b/MUON/AliMUONSt1ElectronicElement.h @@ -16,7 +16,7 @@ // a range of MANU numbers or, finally, // a range of gassiplex/MANAS numbers, in a given range of MANU addresses -#include +#include "AliMpPad.h" class AliMUONSt1ElectronicElement : public TObject { @@ -29,7 +29,7 @@ class AliMUONSt1ElectronicElement : public TObject virtual ~AliMUONSt1ElectronicElement(); // methods - Bool_t Contains(const MPad& pad) const; + Bool_t Contains(const AliMpPad& pad) const; void SetRange(Int_t numVar,Int_t i1,Int_t i2); void SetRange(Int_t numVar,Double_t x1,Double_t x2); Bool_t IsInRange(Int_t numVar,Int_t i) const; diff --git a/MUON/AliMUONSt1IniReader.cxx b/MUON/AliMUONSt1IniReader.cxx index 38fa1da2032..1a22e158c51 100644 --- a/MUON/AliMUONSt1IniReader.cxx +++ b/MUON/AliMUONSt1IniReader.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.1 2003/01/28 13:21:06 morsch +Improved response simulation for station 1. +(M. Mac Cormick, I. Hrivnacova, D. Guez) + */ // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay @@ -30,12 +34,14 @@ $Log$ // comment lines can be introduced if the first non-blank character // is either ';' or '#' -#include -#include +#if !defined(__HP_aCC) && !defined(__alpha) + #include +#endif -#include "AliMUONSt1IniReader.h" +#include +#include -using namespace std; +#include "AliMUONSt1IniReader.h" //______________________________________________________________________ AliMUONSt1IniReader::AliMUONSt1IniReader() @@ -92,7 +98,12 @@ bool AliMUONSt1IniReader::ReadNextLine() if ( line.empty()) { // this is a blank line return ReadNextLine(); } +#if defined (__HP_aCC) || (__alpha) + strstream l; + l << line; +#else istringstream l(line); +#endif char c; @@ -122,8 +133,9 @@ bool AliMUONSt1IniReader::ReadNextLine() return false; } } - fCurrentType=kUndef; - return false; + // fCurrentType=kUndef; + // return false; + // unreachable } //______________________________________________________________________ @@ -170,7 +182,9 @@ AliMUONSt1IniReader::TChapterList AliMUONSt1IniReader::MakeChapterList() if (fCurrentType==kChapter) { string s= fCurrentName; ReadNextLine(); - ans.insert(TChapter(s,MakeCurrentValueList())); + //ans.insert(TChapter(s,MakeCurrentValueList())); + // does not compile on SunOS + ans.insert(TChapterList::value_type(s,MakeCurrentValueList())); } else ReadNextLine(); if (fEndOfFile) break; } diff --git a/MUON/AliMUONSt1IniReader.h b/MUON/AliMUONSt1IniReader.h index ca747a862b7..ba5767ef956 100644 --- a/MUON/AliMUONSt1IniReader.h +++ b/MUON/AliMUONSt1IniReader.h @@ -25,16 +25,13 @@ #include #include -using std::string; -using std::vector; -using std::multimap; -using std::ifstream; -using std::pair; +#include "AliMUONSt1Types.h" class AliMUONSt1IniReader { public: enum TType {kUndef,kChapter,kValue}; + typedef pair TValuePair; typedef vector TValueList; typedef pair TChapter; diff --git a/MUON/AliMUONSt1Response.cxx b/MUON/AliMUONSt1Response.cxx index 3c728345e48..0f0aa448900 100644 --- a/MUON/AliMUONSt1Response.cxx +++ b/MUON/AliMUONSt1Response.cxx @@ -24,20 +24,19 @@ // The current pulse height responses do not contain any physics #include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "AliMpIntPair.h" +#include "AliMpPlaneSegmentation.h" +#include "AliMpPad.h" +#include "AliMpMotifMap.h" +#include "AliMpSector.h" +#include "AliMpPlane.h" +#include "AliMpZone.h" +#include "AliMpSubZone.h" +#include "AliMpVRowSegment.h" #include "AliMUONSt1Response.h" #include "AliMUONSt1ResponseParameter.h" #include "AliMUONSt1ResponseRule.h" @@ -422,10 +421,10 @@ void AliMUONSt1Response::ReadFiles() } } //book memory and fill them with .ini files - fPlane[0]=MPlane::Create(kBendingPlane); - fPlane[1]=MPlane::Create(kNonBendingPlane); + fPlane[0]=AliMpPlane::Create(kBendingPlane); + fPlane[1]=AliMpPlane::Create(kNonBendingPlane); for (i=0;i<2;i++){ - fPlaneSegmentation[i]= new MPlaneSegmentation(fPlane[i]); + fPlaneSegmentation[i]= new AliMpPlaneSegmentation(fPlane[i]); ReadIniFile(i); } } @@ -448,13 +447,13 @@ Float_t AliMUONSt1Response::IntPH(Float_t eloss) //__________________________________________________________________________ -MZone* AliMUONSt1Response::FindZone(MSector* sector,Int_t posId) +AliMpZone* AliMUONSt1Response::FindZone(AliMpSector* sector,Int_t posId) { -// to be moved to MSector:: +// to be moved to AliMpSector:: for (Int_t izone=1;izone<=sector->GetNofZones();izone++){ - MZone* zone = sector->GetZone(izone); + AliMpZone* zone = sector->GetZone(izone); for (Int_t isub=0;isubGetNofSubZones();isub++){ - MSubZone* sub=zone->GetSubZone(isub); + AliMpSubZone* sub=zone->GetSubZone(isub); for (Int_t iseg=0;isegGetNofRowSegments();iseg++){ if (sub->GetRowSegment(iseg)->HasMotifPosition(posId)) return zone; } @@ -479,21 +478,21 @@ Int_t AliMUONSt1Response::DigitResponse(Int_t digit,AliMUONTransientDigit* wher fCountNofCalls++; - MIntPair indices(where->PadX(),where->PadY()); - MPad pad = fPlaneSegmentation[where->Cathode()]->PadByIndices(indices,kFALSE); + AliMpIntPair indices(where->PadX(),where->PadY()); + AliMpPad pad = fPlaneSegmentation[where->Cathode()]->PadByIndices(indices,kFALSE); Int_t GC=0; Int_t numZone=0; - MZone* zone=0; + AliMpZone* zone=0; if (pad.IsValid()) { - MIntPair location = pad.GetLocation(); + AliMpIntPair location = pad.GetLocation(); //cout<GetFrontSector()->GetMotifMap()->FindMotifPosition(posId)) - sector=(MSector*)fPlane[0]->GetFrontSector(); + sector=(AliMpSector*)fPlane[0]->GetFrontSector(); else if (fPlane[0]->GetBackSector()->GetMotifMap()->FindMotifPosition(posId)) - sector=(MSector*)fPlane[0]->GetBackSector(); + sector=(AliMpSector*)fPlane[0]->GetBackSector(); if (sector) zone=FindZone(sector,posId); if (zone){ diff --git a/MUON/AliMUONSt1Response.h b/MUON/AliMUONSt1Response.h index 531d41dbc2c..542c6b39970 100644 --- a/MUON/AliMUONSt1Response.h +++ b/MUON/AliMUONSt1Response.h @@ -14,20 +14,16 @@ // Individual pedestals or noise levels can be controlled separately. // The current pulse height responses do not contain any physics -#include -#include #include #include #include "AliMUONResponseV0.h" +#include "AliMUONSt1Types.h" #include "AliMUONSt1ElectronicElement.h" -using std::string; -using std::map; - -class MPlane; -class MPlaneSegmentation; -class MZone; -class MSector; +class AliMpPlane; +class AliMpPlaneSegmentation; +class AliMpZone; +class AliMpSector; class TArrayF; class TObjArray; class AliMUONSt1ResponseParameter; @@ -51,10 +47,7 @@ public: private: - - //private types - typedef map TParamsMap; - typedef map TListMap; + //private constants static const Int_t fgkNofZones=4; static const TString fgkTopDir; static const TString fgkDataDir; @@ -86,7 +79,7 @@ private: static const TString fgkNofSigmaName ; //protected methods - MZone* FindZone(MSector* sector,Int_t posId); // to be moved in MSector:: + AliMpZone* FindZone(AliMpSector* sector,Int_t posId); // to be moved in AliMpSector:: void ReadFiles(); void ReadIniFile(Int_t plane,const TString& fileName,Bool_t rdParam,Bool_t rdRegion,Bool_t rdRule); void ReadIniFile(Int_t plane); @@ -97,8 +90,8 @@ private: //data members - MPlane* fPlane[2]; // !The mapping planes - MPlaneSegmentation* fPlaneSegmentation[2]; // !The mapping plane segmentation + AliMpPlane* fPlane[2]; // !The mapping planes + AliMpPlaneSegmentation* fPlaneSegmentation[2]; // !The mapping plane segmentation TString fIniFileName[2];// file names for initialisation of each cathode AliMUONSt1ResponseParameter* fDefaultParameters[2][fgkNofZones]; // !Response for each zone diff --git a/MUON/AliMUONSt1ResponseParameter.h b/MUON/AliMUONSt1ResponseParameter.h index 4a47a744e0c..44c8fa71d23 100644 --- a/MUON/AliMUONSt1ResponseParameter.h +++ b/MUON/AliMUONSt1ResponseParameter.h @@ -20,6 +20,10 @@ class AliMUONSt1ResponseParameter : public TNamed { + public: + typedef enum {kNone,kValue,kGauss,kFile} TMode; + typedef struct {Double_t mean; Double_t sigma;} TGaussParam; + public: AliMUONSt1ResponseParameter(); AliMUONSt1ResponseParameter(const TString& name,const TString& title); @@ -40,12 +44,12 @@ class AliMUONSt1ResponseParameter : public TNamed Int_t ApplyStickyBits(Int_t base) const; Bool_t HasPedestal() const {return fPedestalMode != kNone;} Bool_t GetState() const {return fState;} + private: static const Int_t fgkNofChannels=64; - typedef enum {kNone,kValue,kGauss,kFile} TMode; - typedef struct {Double_t mean; Double_t sigma;} TGaussParam; typedef union { - Double_t values[fgkNofChannels]; + //Double_t values[fgkNofChannels]; + Double_t values[64]; Double_t value; TGaussParam gauss; } TParam; diff --git a/MUON/AliMUONSt1ResponseRule.cxx b/MUON/AliMUONSt1ResponseRule.cxx index 37dc0c2ad96..f08b4bd451b 100644 --- a/MUON/AliMUONSt1ResponseRule.cxx +++ b/MUON/AliMUONSt1ResponseRule.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.1 2003/01/28 13:21:06 morsch +Improved response simulation for station 1. +(M. Mac Cormick, I. Hrivnacova, D. Guez) + */ // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay @@ -66,7 +70,7 @@ void AliMUONSt1ResponseRule::AddParameter(AliMUONSt1ResponseParameter* param) } //__________________________________________________________________________ -Bool_t AliMUONSt1ResponseRule::Contains(const MPad& pad) const +Bool_t AliMUONSt1ResponseRule::Contains(const AliMpPad& pad) const { // Is this pad is contained in this rule's list // --- diff --git a/MUON/AliMUONSt1ResponseRule.h b/MUON/AliMUONSt1ResponseRule.h index 9ff39a7feda..4f8cf381319 100644 --- a/MUON/AliMUONSt1ResponseRule.h +++ b/MUON/AliMUONSt1ResponseRule.h @@ -16,7 +16,7 @@ #include #include -#include +#include "AliMpPad.h" class AliMUONSt1ElectronicElement; class AliMUONSt1ResponseParameter; @@ -29,7 +29,7 @@ class AliMUONSt1ResponseRule : public TObject void AddElement(AliMUONSt1ElectronicElement* element); void AddParameter(AliMUONSt1ResponseParameter* param); - Bool_t Contains(const MPad& pad) const; + Bool_t Contains(const AliMpPad& pad) const; TList* GetParameters() {return &fParameters;} private: diff --git a/MUON/AliMUONSt1Segmentation.cxx b/MUON/AliMUONSt1Segmentation.cxx index d1c1e0de488..5e38c8db1b9 100644 --- a/MUON/AliMUONSt1Segmentation.cxx +++ b/MUON/AliMUONSt1Segmentation.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.1 2003/01/28 13:21:06 morsch +Improved response simulation for station 1. +(M. Mac Cormick, I. Hrivnacova, D. Guez) + */ // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay @@ -24,21 +28,16 @@ $Log$ // Segmentation for MUON station 1 using the external // mapping package -#include - #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include "AliMUONSt1Segmentation.h" #include "AliRun.h" @@ -51,7 +50,7 @@ const Float_t AliMUONSt1Segmentation::fgkWireD = 0.20; const Float_t AliMUONSt1Segmentation::fgkLengthUnit = 0.1; //______________________________________________________________________________ -AliMUONSt1Segmentation::AliMUONSt1Segmentation(const MPlaneType planeType) +AliMUONSt1Segmentation::AliMUONSt1Segmentation(const AliMpPlaneType planeType) : AliSegmentation(), fPlane(0), fPlaneSegmentation(0), @@ -77,8 +76,8 @@ AliMUONSt1Segmentation::AliMUONSt1Segmentation(const MPlaneType planeType) fCorrA(0) { // Normal constructor - fPlane = MPlane::Create(planeType); - fPlaneSegmentation = new MPlaneSegmentation(fPlane); + fPlane = AliMpPlane::Create(planeType); + fPlaneSegmentation = new AliMpPlaneSegmentation(fPlane); fCorrA = new TObjArray(3); fCorrA->AddAt(0,0); @@ -155,7 +154,7 @@ AliMUONSt1Segmentation::operator=(const AliMUONSt1Segmentation& rhs) // //______________________________________________________________________________ -void AliMUONSt1Segmentation::UpdateCurrentPadValues(const MPad& pad) +void AliMUONSt1Segmentation::UpdateCurrentPadValues(const AliMpPad& pad) { // Updates current pad values. // --- @@ -221,7 +220,7 @@ void AliMUONSt1Segmentation::GetPadI(Float_t x, Float_t y, // If there is no pad, ix = 0, iy = 0 are returned. // --- - MPad pad = fPlaneSegmentation + AliMpPad pad = fPlaneSegmentation ->PadByPosition(TVector2(x/fgkLengthUnit, y/fgkLengthUnit), false); ix = pad.GetIndices().GetFirst(); @@ -247,7 +246,7 @@ void AliMUONSt1Segmentation::GetPadC(Int_t ix, Int_t iy, // If there is no pad, x = 0., y = 0. are returned. // --- - MPad pad = fPlaneSegmentation->PadByIndices(MIntPair(ix,iy)); + AliMpPad pad = fPlaneSegmentation->PadByIndices(AliMpIntPair(ix,iy)); x = pad.Position().X() * fgkLengthUnit; y = pad.Position().Y() * fgkLengthUnit; @@ -371,8 +370,8 @@ void AliMUONSt1Segmentation::FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, fPlaneIterator = fPlaneSegmentation - ->CreateIterator(MArea(TVector2(fXhit/fgkLengthUnit, fYhit/fgkLengthUnit), - TVector2(dx/fgkLengthUnit, dy/fgkLengthUnit))); + ->CreateIterator(AliMpArea(TVector2(fXhit/fgkLengthUnit, fYhit/fgkLengthUnit), + TVector2(dx/fgkLengthUnit, dy/fgkLengthUnit))); fPlaneIterator->First(); @@ -412,7 +411,7 @@ Float_t AliMUONSt1Segmentation::Distance2AndOffset(Int_t iX, Int_t iY, // labelled by its channel numbers and a coordinate // --- - MPad pad = fPlaneSegmentation->PadByIndices(MIntPair(iX, iY)); + AliMpPad pad = fPlaneSegmentation->PadByIndices(AliMpIntPair(iX, iY)); if (!pad.IsValid()) Fatal("Distance2AndOffset", "Cannot locate pad."); @@ -440,12 +439,12 @@ void AliMUONSt1Segmentation::Neighbours(Int_t iX, Int_t iY, // Get next neighbours // --- - MPad pad = fPlaneSegmentation->PadByIndices(MIntPair(iX,iY)); + AliMpPad pad = fPlaneSegmentation->PadByIndices(AliMpIntPair(iX,iY)); Int_t &i = *Nlist; i=0; - MVPadIterator* iter + AliMpVPadIterator* iter = fPlaneSegmentation - ->CreateIterator(MArea(pad.Position(),2.*pad.Dimensions()*1.1)); + ->CreateIterator(AliMpArea(pad.Position(),2.*pad.Dimensions()*1.1)); for( iter->First(); !iter->IsDone() && i<10; iter->Next()) { Xlist[i] = iter->CurrentItem().GetIndices().GetFirst(); @@ -492,7 +491,7 @@ Int_t AliMUONSt1Segmentation::Sector(Int_t ix, Int_t iy) // --- return fPlaneSegmentation - ->Zone(fPlaneSegmentation->PadByIndices(MIntPair(ix, iy))); + ->Zone(fPlaneSegmentation->PadByIndices(AliMpIntPair(ix, iy))); } //______________________________________________________________________________ diff --git a/MUON/AliMUONSt1Segmentation.h b/MUON/AliMUONSt1Segmentation.h index 5df1429a4cc..33a0c117566 100644 --- a/MUON/AliMUONSt1Segmentation.h +++ b/MUON/AliMUONSt1Segmentation.h @@ -13,23 +13,23 @@ // Segmentation for MUON station 1 using the external // mapping package -#include -#include +#include "AliMpPad.h" +#include "AliMpPlaneType.h" #include "AliSegmentation.h" class TObjArray; -class MPlane; -class MPlaneSegmentation; -class MVPadIterator; +class AliMpPlane; +class AliMpPlaneSegmentation; +class AliMpVPadIterator; class AliMUONChamber; class AliMUONSt1Segmentation : public AliSegmentation { public: - AliMUONSt1Segmentation(const MPlaneType planeType); + AliMUONSt1Segmentation(const AliMpPlaneType planeType); AliMUONSt1Segmentation(const AliMUONSt1Segmentation& rhs); AliMUONSt1Segmentation(); @@ -139,7 +139,7 @@ class AliMUONSt1Segmentation : public AliSegmentation AliMUONSt1Segmentation& operator=(const AliMUONSt1Segmentation & rhs); // methods - void UpdateCurrentPadValues(const MPad& pad); + void UpdateCurrentPadValues(const AliMpPad& pad); // constants static const Float_t fgkWireD; // default wire pitch @@ -150,9 +150,9 @@ class AliMUONSt1Segmentation : public AliSegmentation // From mapping // - MPlane* fPlane; // plane (from mapping) - MPlaneSegmentation* fPlaneSegmentation;// plane segmantation (from mapping) - MVPadIterator* fPlaneIterator; // ! iterator over pads + AliMpPlane* fPlane; // plane (from mapping) + AliMpPlaneSegmentation* fPlaneSegmentation;// plane segmantation (from mapping) + AliMpVPadIterator* fPlaneIterator; // ! iterator over pads // Wire pitch // diff --git a/MUON/AliMUONSt1Types.h b/MUON/AliMUONSt1Types.h new file mode 100644 index 00000000000..36b6feafaad --- /dev/null +++ b/MUON/AliMUONSt1Types.h @@ -0,0 +1,42 @@ +#ifndef ALI_MUON_ST1_TYPES_H +#define ALI_MUON_ST1_TYPES_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +// AliMUONSt1Types +// --------------- +// System dependent types definitions for MUON Station1. +// +// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay +// + +#include +#include +#include +#include + +#include "AliMUONSt1SpecialMotif.h" + +class TString; +class AliMUONSt1ResponseParameter; + +#ifdef __HP_aCC + typedef vector IntVector; + typedef map TSpecialMap; + typedef map TParamsMap; + typedef map TListMap; +#else + using std::string; + using std::vector; + using std::multimap; + using std::pair; + + typedef std::vector IntVector; + typedef std::map TSpecialMap; + typedef std::map TParamsMap; + typedef std::map TListMap; +#endif + +#endif //ALI_MUON_ST1_TYPES_H diff --git a/MUON/AliMUONv1.cxx b/MUON/AliMUONv1.cxx index cdb90947271..a1a8f3588f7 100644 --- a/MUON/AliMUONv1.cxx +++ b/MUON/AliMUONv1.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.40 2003/01/28 13:21:06 morsch +Improved response simulation for station 1. +(M. Mac Cormick, I. Hrivnacova, D. Guez) + Revision 1.39 2003/01/14 10:50:19 alibrary Cleanup of STEER coding conventions @@ -2085,6 +2089,20 @@ void AliMUONv1::Init() } +//___________________________________________ +Int_t AliMUONv1::GetChamberId(Int_t volId) const +{ +// Check if the volume with specified volId is a sensitive volume (gas) +// of some chamber and returns the chamber number; +// if not sensitive volume - return 0. +// --- + + for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) + if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i; + + return 0; +} + //___________________________________________ void AliMUONv1::StepManager() { @@ -2110,16 +2128,12 @@ void AliMUONv1::StepManager() // // Only gas gap inside chamber // Tag chambers and record hits when track enters - idvol=-1; id=gMC->CurrentVolID(copy); - - for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) { - if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){ - vol[0] = i; - idvol = i-1; - } - } - if (idvol == -1) return; + vol[0] = GetChamberId(id); + idvol = vol[0] -1; + + if (idvol == -1) return; + // // Get current particle id (ipart), track position (pos) and momentum (mom) gMC->TrackPosition(pos); diff --git a/MUON/AliMUONv1.h b/MUON/AliMUONv1.h index 82dff56e20f..f0119ea1258 100644 --- a/MUON/AliMUONv1.h +++ b/MUON/AliMUONv1.h @@ -22,6 +22,7 @@ public: virtual Int_t IsVersion() const {return 1;} virtual void StepManager(); protected: + virtual Int_t GetChamberId(Int_t volId) const; Int_t* fStations; //! allow to externally set which station to create private: ClassDef(AliMUONv1,1) // MUON Detector class Version 1 diff --git a/MUON/AliMUONv2.cxx b/MUON/AliMUONv2.cxx index d2e56a5db76..d0ab102f7b8 100644 --- a/MUON/AliMUONv2.cxx +++ b/MUON/AliMUONv2.cxx @@ -25,14 +25,22 @@ $Log$ // geometrical description of station 1 #include -#include - -#include +#include #include #include #include +#include +#include +#include +#include "AliMpFiles.h" +#include "AliMpReader.h" +#include "AliMpSector.h" +#include "AliMpRow.h" +#include "AliMpVRowSegment.h" +#include "AliMpMotifMap.h" +#include "AliMpMotifPosition.h" #include "AliMUONv2.h" #include "AliMUONConstants.h" @@ -40,42 +48,36 @@ $Log$ #include "AliRun.h" #include "AliMagF.h" #include "AliConst.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include +#include "AliMUONChamber.h" ClassImp(AliMUONv2) - - -const GReal_t AliMUONv2::fgkHzPadPlane=0.0148/2.; //Pad plane -const GReal_t AliMUONv2::fgkHzFoam = 2.083/2.; // Foam of mechanicalplane -const GReal_t AliMUONv2::fgkHzFR4 = 0.0031/2.; // FR4 of mechanical plane -const GReal_t AliMUONv2::fgkHzSnPb = 0.0091/2.; //Pad/Kapton connection (66 pt) -const GReal_t AliMUONv2::fgkHzKapton = 0.0122/2.; //Kapton -const GReal_t AliMUONv2::fgkHzBergPlastic = 0.3062/2.; //Berg connector +// Thickness Constants +const GReal_t AliMUONv2::fgkHzPadPlane=0.0148/2.; //Pad plane +const GReal_t AliMUONv2::fgkHzFoam = 2.083/2.; //Foam of mechanicalplane +const GReal_t AliMUONv2::fgkHzFR4 = 0.0031/2.; //FR4 of mechanical plane +const GReal_t AliMUONv2::fgkHzSnPb = 0.0091/2.; //Pad/Kapton connection (66 pt) +const GReal_t AliMUONv2::fgkHzKapton = 0.0122/2.; //Kapton +const GReal_t AliMUONv2::fgkHzBergPlastic = 0.3062/2.;//Berg connector const GReal_t AliMUONv2::fgkHzBergCopper = 0.1882/2.; //Berg connector -const GReal_t AliMUONv2::fgkHzDaughter = 0.0156/2.; //Daughter board -const GReal_t AliMUONv2::fgkHzGas = 0.2/2.; //Gas -const GReal_t AliMUONv2::fgkHxQuadrant = 94.69/2.; //Box surrounding quadrant -const GReal_t AliMUONv2::fgkHyQuadrant = 100.31/2.; //Box surrounding quadrant -const GReal_t AliMUONv2::fgkMotherIR = 18.3; -const GReal_t AliMUONv2::fgkMotherOR = 104.974; -const GReal_t AliMUONv2::fgkMotherThick = 6.5/2; //6.5cm between two quadrants -const GReal_t AliMUONv2::fgkMotherPhiL = 0.; -const GReal_t AliMUONv2::fgkMotherPhiU = 90.; - - +const GReal_t AliMUONv2::fgkHzDaughter = 0.0156/2.; //Daughter board +const GReal_t AliMUONv2::fgkHzGas = 0.2/2.; //Gas thickness + +// Quadrant Mother volume - TUBS1 - Middle layer of model +const GReal_t AliMUONv2::fgkMotherIR1 = 18.3; +const GReal_t AliMUONv2::fgkMotherOR1 = 105.673; +const GReal_t AliMUONv2::fgkMotherThick1 = 6.5/2; +const GReal_t AliMUONv2::fgkMotherPhiL1 = 0.; +const GReal_t AliMUONv2::fgkMotherPhiU1 = 90.; + +// Quadrant Mother volume - TUBS2 - near and far layers of model +const GReal_t AliMUONv2::fgkMotherIR2 = 20.7; +const GReal_t AliMUONv2::fgkMotherOR2 = 100.073; +const GReal_t AliMUONv2::fgkMotherThick2 = 3.0/2; +const GReal_t AliMUONv2::fgkMotherPhiL2 = 0.; +const GReal_t AliMUONv2::fgkMotherPhiU2 = 90.; + +// Sensitive copper pads, foam layer, PCB and electronics model parameters const GReal_t AliMUONv2::fgkHxHole=1.5/2.; const GReal_t AliMUONv2::fgkHyHole=6./2.; const GReal_t AliMUONv2::fgkHxBergPlastic=0.74/2.; @@ -88,150 +90,399 @@ const GReal_t AliMUONv2::fgkHxDaughter=2.3/2.; const GReal_t AliMUONv2::fgkHyDaughter=6.3/2.; const GReal_t AliMUONv2::fgkOffsetX=1.46; const GReal_t AliMUONv2::fgkOffsetY=0.71; -const GReal_t AliMUONv2::fgkDeltaFilleEtamX=0.; -const GReal_t AliMUONv2::fgkDeltaFilleEtamY=0.5; +const GReal_t AliMUONv2::fgkDeltaFilleEtamX=1.46; +const GReal_t AliMUONv2::fgkDeltaFilleEtamY=0.051; -const char* AliMUONv2::fgkHoleName="MCHL"; -const char* AliMUONv2::fgkDaughterName="MCDB"; -const char AliMUONv2::fgkFoamLayerSuffix='F'; -const char* AliMUONv2::fgkQuadrantName="QUA"; +const GReal_t AliMUONv2::fgkDeltaQuadLHC=2.6; // LHC Origin wrt Quadrant Origin +const GReal_t AliMUONv2::fgkFrameOffset=5.0; -//___________________________________________ +const char* AliMUONv2::fgkHoleName="MCHL"; +const char* AliMUONv2::fgkDaughterName="MCDB"; +const char AliMUONv2::fgkFoamLayerSuffix='F'; // prefix for automatic volume naming +const char* AliMUONv2::fgkQuadrantMLayerName="SQM"; +const char* AliMUONv2::fgkQuadrantNLayerName="SQN"; +const char* AliMUONv2::fgkQuadrantFLayerName="SQF"; + +//______________________________________________________________________________ AliMUONv2::AliMUONv2() - : AliMUONv1(), - fIdSens(0) + : AliMUONv1() { // Default Constructor -// - +// -- + fChamberV2[0] = 0; + fChamberV2[1] = 0; + // keep secondaries SetIshunt(0); + + // set path to mapping data files + if (! gSystem->Getenv("MINSTALL")) { + TString dirPath = gSystem->Getenv("ALICE_ROOT"); + dirPath += "/MUON/mapping"; + AliMpFiles::Instance()->SetTopPath(dirPath); + gSystem->Setenv("MINSTALL", dirPath.Data()); + //cout << "AliMpFiles top path set to " << dirPath << endl; + } + //else + // cout << gSystem->Getenv("MINSTALL") << endl; } -//___________________________________________ +//______________________________________________________________________________ AliMUONv2::AliMUONv2(const char *name, const char *title) - : AliMUONv1(name,title), - fIdSens(0) + : AliMUONv1(name,title) { + fChamberV2[0] = 0; + fChamberV2[1] = 0; + // keep secondaries SetIshunt(0); - - // create hits array - fHits = new TClonesArray("AliMUONHit",1000); - gAlice->AddHitList(fHits); + + // set path to mapping data files + if (! gSystem->Getenv("MINSTALL")) { + TString dirPath = gSystem->Getenv("ALICE_ROOT"); + dirPath += "/MUON/mapping"; + AliMpFiles::Instance()->SetTopPath(dirPath); + gSystem->Setenv("MINSTALL", dirPath.Data()); + //cout << "AliMpFiles top path set to " << dirPath << endl; + } + //else + // cout << gSystem->Getenv("MINSTALL") << endl; } -//___________________________________________ +//______________________________________________________________________________ AliMUONv2::AliMUONv2(const AliMUONv2& rMUON) { // Dummy copy constructor } -//___________________________________________ +//______________________________________________________________________________ AliMUONv2::~AliMUONv2() { // Destructor - if(fDebug) printf("%s: Calling AliMUONv2 destructor !!!\n",ClassName()); - - if (fHits) { - fHits->Delete(); - delete fHits; - } } -//___________________________________________ -void AliMUONv2::CreateGeometry() +// +// Private methods +// + +//______________________________________________________________________________ +void AliMUONv2::CreateHole() { -// Create the GEANT geometry for the dimuon arm. -// Use the parent's method for stations 2, 3, 4 and 5. -// Use the detailed code for the first station. +// Create all the elements found inside a foam hole // -- - cout << "AliMUONv2::CreateGeometry()" << endl; - cout << "_________________________________________" << endl; - - // tracking medias Int_t* idtmed = fIdtmed->GetArray()-1099; - Int_t idAir = idtmed[1100]; // medium 1 + Int_t idAir = idtmed[1100]; // medium 1 + Int_t idCopper = idtmed[1109]; // medium 10 = copper + GReal_t par[3]; + GReal_t posX,posY,posZ; + + par[0] = fgkHxHole; + par[1] = fgkHyHole; + par[2] = fgkHzFoam; + gMC->Gsvolu(fgkHoleName,"BOX",idAir,par,3); + par[0] = fgkHxKapton; + par[1] = fgkHyKapton; + par[2] = fgkHzSnPb; + gMC->Gsvolu("SNPB", "BOX", idCopper, par, 3); + posX = 0.; + posY = 0.; + posZ = -fgkHzFoam+fgkHzSnPb; + gMC->Gspos("SNPB",1,fgkHoleName, posX, posY, posZ, 0,"ONLY"); - //create reflexion matrix - Int_t reflXZ,reflYZ,reflXY; - AliMatrix(reflXZ, 90., 180., 90., 90., 180., 0.); - AliMatrix(reflYZ, 90., 0., 90.,-90., 180., 0.); - AliMatrix(reflXY, 90., 180., 90., 270., 0., 0.); + par[0] = fgkHxHole; + par[1] = fgkHyBergPlastic; + par[2] = fgkHzKapton; + gMC->Gsvolu("KAPT", "BOX", idCopper, par, 3); + posX = 0.; + posY = 0.; + posZ = 0.; + gMC->Gspos("KAPT",1,fgkHoleName, posX, posY, posZ, 0,"ONLY"); +} - CreateHole(); - CreateDaughterBoard(); +//______________________________________________________________________________ +void AliMUONv2::CreateDaughterBoard() +{ +// Create all the elements in a daughter board +// -- + Int_t* idtmed = fIdtmed->GetArray()-1099; + Int_t idAir = idtmed[1100]; // medium 1 + Int_t idCopper = idtmed[1109]; // medium 10 = copper + Int_t idPlastic =idtmed[1116]; // medium 17 = Plastic - //build the quadrant - CreateQuadrant(1); - CreateQuadrant(2); - GReal_t par[5]; - par[0] = fgkMotherIR; - par[1] = fgkMotherOR; - par[2] = fgkHzGas; - par[3] = fgkMotherPhiL; - par[4] = fgkMotherPhiU; - - gMC->Gsvolu("S01G","TUBS",idAir,par,5); - gMC->Gspos("S01G",1,QuadrantName(1),0,0,0,0,"ONLY"); - gMC->Gsvolu("S02G","TUBS",idAir,par,5); - gMC->Gspos("S02G",1,QuadrantName(2),0,0,0,0,"ONLY"); - - // place the four copies of it - - //parameters - TVector3 pos[4]; - Int_t rotm[4]; + GReal_t par[3]; + GReal_t posX,posY,posZ; + + par[0]=fgkHxDaughter; + par[1]=fgkHyDaughter; + par[2]=TotalHzDaughter(); + gMC->Gsvolu(fgkDaughterName,"BOX",idAir,par,3); - Double_t deltaZ = 6.5/2.; - pos[0]=TVector3(-2.6,-2.6,AliMUONConstants::DefaultChamberZ(0)+deltaZ); - rotm[0]=0; - pos[1]=TVector3(2.6,-2.6,AliMUONConstants::DefaultChamberZ(0)-deltaZ); - rotm[1]=reflXZ; - pos[2]=TVector3(2.6,2.6,AliMUONConstants::DefaultChamberZ(0)+deltaZ); - rotm[2]=reflXY; - pos[3]=TVector3(-2.6,2.6,AliMUONConstants::DefaultChamberZ(0)-deltaZ); - rotm[3]=reflYZ; + par[0]=fgkHxBergPlastic; + par[1]=fgkHyBergPlastic; + par[2]=fgkHzBergPlastic; + gMC->Gsvolu("BRGP","BOX",idPlastic,par,3); + posX=0.; + posY=0.; + posZ = -TotalHzDaughter() + fgkHzBergPlastic; + gMC->Gspos("BRGP",1,fgkDaughterName,posX,posY,posZ,0,"ONLY"); + + par[0]=fgkHxBergCopper; + par[1]=fgkHyBergCopper; + par[2]=fgkHzBergCopper; + gMC->Gsvolu("BRGC","BOX",idCopper,par,3); + posX=0.; + posY=0.; + posZ=0.; + gMC->Gspos("BRGC",1,"BRGP",posX,posY,posZ,0,"ONLY"); + + par[0]=fgkHxDaughter; + par[1]=fgkHyDaughter; + par[2]=fgkHzDaughter; + gMC->Gsvolu("DGHT","BOX",idCopper,par,3); + posX=0.; + posY=0.; + posZ = -TotalHzDaughter() + 2.*fgkHzBergPlastic + fgkHzDaughter; + gMC->Gspos("DGHT",1,fgkDaughterName,posX,posY,posZ,0,"ONLY"); +} + +//______________________________________________________________________________ +void AliMUONv2::CreateInnerLayers() +{ +// Create the layer of sensitive volumes with gas +// and the copper layer. +// -- + +// Gas Medium + Int_t* idtmed = fIdtmed->GetArray()-1099; + Int_t idArCO2 = idtmed[1108]; // medium 9 (ArCO2 80%) + Int_t idCopper = idtmed[1109]; // medium 10 = copper + + Float_t par[11]; + +//Make gas volume - composed of 11 trapezoids +// section 1 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 71.33/2.; + par[4] = 9.76/2.; + par[5] = 48.77/2.; + par[6] = 15.3; + par[7] = 71.33/2.; + par[8] = 9.76/2.; + par[9] = 48.77/2.; + par[10] = 15.3; + + gMC->Gsvolu("SA1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SA2G", "TRAP", idArCO2, par, 11); - //placing - GReal_t posX,posY,posZ; - for (Int_t i=0;i<4;i++){ - posX=pos[i].X(); - posY=pos[i].Y(); - // the 1st chamber - posZ=pos[i].Z(); - gMC->Gspos(QuadrantName(1),i+1,"ALIC",posX,posY,posZ,rotm[i],"ONLY"); - // the 2nd chamber - posZ=pos[i].Z()+AliMUONConstants::DefaultChamberZ(1) - -AliMUONConstants::DefaultChamberZ(0); - gMC->Gspos(QuadrantName(2),i+5,"ALIC",posX,posY,posZ,rotm[i],"ONLY"); - } - static Int_t stations[5]={0,1,1,1,1}; - fStations=stations; - AliMUONv1::CreateGeometry(); + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SA1C", "TRAP", idCopper,par, 11); + +// section 2 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 79.68/2.; + par[4] = 10.4/2.; + par[5] = 57.0/2.; + par[6] = 0.; + par[7] = 79.68/2.; + par[8] = 10.4/2.; + par[9] = 57.0/2.; + par[10] = 0.; + gMC->Gsvolu("SB1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SB2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SB1C", "TRAP", idCopper,par, 11); + +// section 3 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 71.33/2.; + par[4] = 48.77/2.; + par[5] = 9.73/2.; + par[6] = -15.3; + par[7] = 71.33/2.; + par[8] = 48.77/2.; + par[9] = 9.73/2.; + par[10] = -15.3; + + gMC->Gsvolu("SC1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SC2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SC1C", "TRAP", idCopper,par, 11); + +// section 4 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 6.00/2.; + par[4] = 0.; + par[5] = 1.56/2.; + par[6] = 7.41; + par[7] = 6.00/2.; + par[8] = 0.; + par[9] = 1.56/2.; + par[10] = 7.41; + gMC->Gsvolu("SD1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SD2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SD1C", "TRAP", idCopper,par, 11); + +// section 5 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 1.516/2.; + par[4] = 0.; + par[5] = 0.829/2.; + par[6] = 15.3; + par[7] = 1.516/2.; + par[8] = 0.; + par[9] = 0.829/2.; + par[10] = 15.3; + gMC->Gsvolu("SE1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SE2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SE1C", "TRAP", idCopper,par, 11); + +// section 6 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 3.92/2.; + par[4] = 0.; + par[5] = 0.562/2.; + par[6] = -4.1; + par[7] = 3.92/2.; + par[8] = 0.; + par[9] = 0.562/2.; + par[10] = -4.1; + gMC->Gsvolu("SF1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SF2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SF1C", "TRAP", idCopper,par, 11); + +// section 7 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 0.941/2.; + par[4] = 0.562/2.; + par[5] = 0.; + par[6] = -16.6; + par[7] = 0.941/2.; + par[8] = 0.562/2.; + par[9] = 0.; + par[10] =-16.6; + gMC->Gsvolu("SG1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SG2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SG1C", "TRAP", idCopper,par, 11); + +// section 8 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 3.94/2.; + par[4] = 0.57/2.; + par[5] = 0.; + par[6] = 4.14; + par[7] = 3.94/2.; + par[8] = 0.57/2.; + par[9] = 0.; + par[10] = 4.14; + gMC->Gsvolu("SH1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SH2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SH1C", "TRAP", idCopper,par, 11); + +// section 9 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 0.95/2.; + par[4] = 0.; + par[5] = 0.57/2; + par[6] = 16.7; + par[7] = 0.95/2.; + par[8] = 0.; + par[9] = 0.57/2; + par[10] = 16.7; + gMC->Gsvolu("SI1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SI2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SI1C", "TRAP", idCopper,par, 11); + +// section 10 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 1.49/2.; + par[4] = 0.; + par[5] = 0.817/2.; + par[6] = -15.4; + par[7] = 1.49/2.; + par[8] = 0.; + par[9] = 0.817/2.; + par[10] = -15.4; + gMC->Gsvolu("SJ1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SJ2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SJ1C", "TRAP", idCopper,par, 11); + +// section 11 of 11 + par[0] = fgkHzGas; + par[1] = 0.; + par[2] = 0.; + par[3] = 5.93/2.; + par[4] = 0.; + par[5] = 1.49/2.; + par[6] = -7.16; + par[7] = 5.93/2.; + par[8] = 0.; + par[9] = 1.49/2.; + par[10] = -7.16; + gMC->Gsvolu("SK1G", "TRAP", idArCO2, par, 11); + gMC->Gsvolu("SK2G", "TRAP", idArCO2, par, 11); + + par[0] = fgkHzPadPlane; + gMC->Gsvolu("SK1C", "TRAP", idCopper,par, 11); } -//___________________________________________ + +//______________________________________________________________________________ void AliMUONv2::CreateQuadrant(Int_t chamber) { // create the quadrant (bending and non-bending planes) // for the given chamber // -- + CreateFrame(chamber); - TSpecialMap specialMap; + TSpecialMap 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)); + AliMpReader reader1(kBendingPlane); + AliMpSector* sector1 = reader1.BuildSector(); - TVector3 where; - specialMap[1001] = AliMUONSt1SpecialMotif(TVector2(0.1 ,0.84),90.); - specialMap[1002] = AliMUONSt1SpecialMotif(TVector2(0.5 ,0.76)); - specialMap[1003] = AliMUONSt1SpecialMotif(TVector2(1.01,0.76)); - MReader reader1(kBendingPlane); - MSector* sector1 = reader1.BuildSector(); - where=TVector3(0.185+2.6,-0.52+2.6,totalHz()+fgkHzGas); - PlaceSector(sector1,specialMap,where,chamber); + Bool_t reflectZ = true; + TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.); + PlaceSector(sector1, specialMap, where, reflectZ, chamber); - specialMap.clear(); specialMap[4001] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.); specialMap[4002] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17)); @@ -239,787 +490,1302 @@ void AliMUONv2::CreateQuadrant(Int_t chamber) specialMap[4004] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)); specialMap[4005] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25)); specialMap[4006] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21)); + AliMpReader reader2(kNonBendingPlane); + AliMpSector* sector2 = reader2.BuildSector(); - MReader reader2(kNonBendingPlane); - MSector* sector2 = reader2.BuildSector(); - where=TVector3(-0.13+2.6,-0.1775+2.6,-totalHz()-fgkHzGas); - PlaceSector(sector2,specialMap,where,chamber); + reflectZ = false; + where = TVector3(where.X()+0.63/2.,where.Y()+0.42/2., 0.); //add a half pad shift + PlaceSector(sector2, specialMap, where, reflectZ, chamber); } -//___________________________________________ -void AliMUONv2::CreateMaterials() +//______________________________________________________________________________ +void AliMUONv2::CreateFoamBox(const char* name,const TVector2& dimensions) { -// --- Define the various mixtures for GEANT --- - - // Ar-CO2 gas (80%+20%) - Float_t ag1[2] = { 39.95,44.01}; - Float_t zg1[2] = { 18.,22.}; - Float_t dg1 = .001821; - Float_t wg1[2] = { .8,0.2}; - // use wg1 weighting factors (6th arg > 0) - AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 2, wg1); +// create all the elements in the copper plane +// -- - // Ar-buthane-freon gas -- trigger chambers - Float_t atr1[4] = { 39.95,12.01,1.01,19. }; - Float_t ztr1[4] = { 18.,6.,1.,9. }; - Float_t wtr1[4] = { .56,.1262857,.2857143,.028 }; - Float_t dtr1 = .002599; - AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1); + Int_t* idtmed = fIdtmed->GetArray()-1099; + Int_t idAir = idtmed[1100]; // medium 1 + Int_t idFoam = idtmed[1115]; // medium 16 = Foam + Int_t idFR4 = idtmed[1114]; // medium 15 = FR4 - // Rohacell 51 - imide methacrylique - Float_t aRohacell51[4] = {12.01,1.01,16.00,14.01}; - Float_t zRohacell51[4] = {6.,1.,8.,7.}; - Float_t dRohacell51 = 0.052; - Float_t wRohacell51[4] = {9.,13.,2.,1.}; - // use relative A (molecular) values (6th arg < 0) - AliMixture(32, "FOAM$",aRohacell51,zRohacell51,dRohacell51,-4,wRohacell51); - - Float_t aSnPb[2] = {118.69,207.19}; - Float_t zSnPb[2] = {50,82}; - Float_t dSnPb = 8.926; - Float_t wSnPb[2] = {0.6, 0.4} ; - // use wSnPb weighting factors (6th arg > 0) - AliMixture(35, "SnPb$", aSnPb,zSnPb,dSnPb,2,wSnPb); + // mother volume + GReal_t par[3]; + par[0] = dimensions.X(); + par[1] = dimensions.Y(); + par[2] = TotalHzPlane(); + gMC->Gsvolu(name,"BOX",idAir,par,3); + + // foam layer + GReal_t posX,posY,posZ; + char eName[5]; + strcpy(eName,name); + eName[3]=fgkFoamLayerSuffix; + par[0] = dimensions.X(); + par[1] = dimensions.Y(); + par[2] = fgkHzFoam; + gMC->Gsvolu(eName,"BOX",idFoam,par,3); + posX=0.; + posY=0.; + posZ = -TotalHzPlane() + fgkHzFoam; + gMC->Gspos(eName,1,name,posX,posY,posZ,0,"ONLY"); - // plastic definition from K5, Freiburg (found on web) - Float_t aPlastic[2]={1.01,12.01}; - Float_t zPlastic[2]={1,6}; - Float_t denPlastic=1.107; - Float_t wPlastic[2]={1,1}; - // use relative A (molecular) values (6th arg < 0)...no other info... - AliMixture( 33, "Plastic$",aPlastic,zPlastic,denPlastic,-2,wPlastic); - - // from CERN note NUFACT Note023, Oct.2000 - // Inox/Stainless Steel (18%Cr, 9%Ni) - Float_t aInox[3] = {55.847,51.9961,58.6934}; - Float_t zInox[3] = {26.,24.,28.}; - Float_t denInox = 7.930; - Float_t wInox[3] = {0.73,0.18,0.09}; - // use wInox weighting factors (6th arg > 0) - AliMixture(37, "StainlessSteel$",aInox,zInox,denInox,3,wInox); + // mechanical plane FR4 layer + eName[3]='R'; + par[0] = dimensions.X(); + par[1] = dimensions.Y(); + par[2] = fgkHzFR4; + gMC->Gsvolu(eName,"BOX",idFR4,par,3); + posX=0.; + posY=0.; + posZ = -TotalHzPlane()+ 2.*fgkHzFoam + fgkHzFR4; + gMC->Gspos(eName,1,name,posX,posY,posZ,0,"ONLY"); +} - // bakelite - Float_t abak[3] = {12.01 , 1.01 , 16.}; - Float_t zbak[3] = {6. , 1. , 8.}; - Float_t wbak[3] = {6. , 6. , 1.}; - Float_t dbak = 1.4; - AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak); +//______________________________________________________________________________ +void AliMUONv2::CreatePlaneSegment(const char* name,const TVector2& dimensions, + Int_t nofHoles) +{ +// Create a segment of a plane (this includes a foam layer, +// holes in the foam to feed the kaptons through, kapton connectors +// and the mother board.) +// -- - // Ar-Isobutane gas (80%+20%) - Float_t ag[3] = { 39.95,12.01,1.01 }; - Float_t zg[3] = { 18.,6.,1. }; - Float_t wg[3] = { .8,.057,.143 }; - Float_t dg = .0019596; - AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg); + CreateFoamBox(name,dimensions); - // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger - Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 }; - Float_t ztrig[5] = { 18.,6.,1.,9.,16. }; - Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 }; - Float_t dtrig = .0031463; - AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig); + char eName[5]; + strcpy(eName,name); + eName[3]=fgkFoamLayerSuffix; - // Ar-CO2 gas - Float_t agas[3] = { 39.95,12.01,16. }; - Float_t zgas[3] = { 18.,6.,8. }; - Float_t wgas[3] = { .74,.086684,.173316 }; - Float_t dgas = .0018327; - AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas); - -// --- Define the various AliMaterials for GEANT --- - // from PDG and "The Particle Detector BriefBook", Bock and Vasilescu, P.18 - AliMaterial( 9, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1); - AliMaterial(10, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1); - AliMaterial(15, "air$", 14.61, 7.3, .001205, -30423.24, 67500); - AliMaterial(30, "Copper$", 63.546,29.,8.96,-1.43,9.6); - AliMaterial(31, "FR4$", 17.749, 8.875, 1.7, -19.4, 999.); // from DPG - AliMaterial(34, "Kapton$", 12.01,6,1.42,-28.6,999); // from DPG - // Density of FrameEpoxy only from manufacturer's specifications - // Frame composite epoxy , X0 in g/cm**2 (guestimation!) - AliMaterial(36, "FrameEpoxy",12.24,6.0,1.85,-19.14,999); + for (Int_t holeNum=0;holeNumGspos(fgkHoleName,holeNum+1,eName,posX,posY,posZ,0,"ONLY"); + } +} - Int_t iSXFLD = gAlice->Field()->Integ(); - Float_t sXMGMX = gAlice->Field()->Max(); +//______________________________________________________________________________ +void AliMUONv2::CreateFrame(Int_t chamber) +{ +// Create the non-sensitive elements of the frame for the +// +// +// Model and notation: +// +// The Quadrant volume name starts with SQ +// The volume segments are numbered 00 to XX. +// +// OutTopFrame +// (SQ02-16) +// ------------ +// OutEdgeFrame / | +// (SQ17-24) / | InVFrame (SQ00-01) +// / | +// | | +// OutVFrame | _- - +// (SQ25-39) | | InArcFrame (SQ42-45) +// | | +// ------------- +// InHFrame (SQ40-41) +// +// +// 06 February 2003 - Overlapping volumes resolved. +// One quarter chamber is comprised of three TUBS volumes: SQMx, SQNx, and SQFx, +// where SQMx is the Quadrant Middle layer for chamber ( posZ in [-3.25,3.25]), +// SQNx is the Quadrant Near side layer for chamber ( posZ in [-6.25,3-.25) ), and +// SQFx is the Quadrant Far side layer for chamber ( posZ in (3.25,6.25] ). +//--- - AliMedium(1, "AIR_CH_US$", 15, 1, iSXFLD, sXMGMX, tmaxfd, - stemax, deemax, epsil, stmin); - AliMedium(4, "ALU_CH_US$", 9, 0, iSXFLD, sXMGMX, tmaxfd, - maxStepAlu, maxDestepAlu, epsil, stmin); - AliMedium(5, "ALU_CH_US$", 10, 0, iSXFLD, sXMGMX, tmaxfd, - maxStepAlu,maxDestepAlu, epsil, stmin); - AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, - tmaxfd, fMaxStepGas,fMaxDestepGas, epsil, stmin); - - // Ar-Isobuthane-Forane-SF6 gas - AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, - tmaxfd, stemax, deemax, epsil, stmin); - AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, - tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin); +const Float_t fgkNearFarLHC=2.4; // Near and Far TUBS Origin wrt LHC Origin - AliMedium(9, "ARG_CO2$", 22, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas, - maxDestepAlu, epsil, stmin); - AliMedium(10, "COPPER_CH$", 30, 0, iSXFLD, sXMGMX, tmaxfd, - maxStepAlu, maxDestepAlu, epsil, stmin); - AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd, - fMaxStepAlu, fMaxDestepAlu, epsil, stmin); - AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd, - fMaxStepAlu, fMaxDestepAlu, epsil, stmin); - AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd, - fMaxStepAlu, fMaxDestepAlu, epsil, stmin); - AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd, - fMaxStepAlu, fMaxDestepAlu, epsil, stmin); - AliMedium(15, "FR4_CH$", 31, 0,iSXFLD, sXMGMX, 10., .01,.1, .003, .003); - AliMedium(16, "FOAM_CH$", 32, 0, - iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ; - AliMedium(17, "Plastic$", 33, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); - AliMedium(18, "Kapton$", 34, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); - AliMedium(19, "SnPb$", 35, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); - AliMedium(20, "FrameCH$", 36, 1,iSXFLD, sXMGMX, 10., .001, 0.001, .001, .001); - AliMedium(21, "InoxBolts$", 37,1,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); -} - -void AliMUONv2::CreateFrame(Int_t chamber) -{ -// Create the non-sensitive elements of the frame for the - - -// Matrices - Int_t idrotm[1199]; -// To Be Checked.... -// Rotation matrices in the x-y plane -// phi = -45 deg - AliMatrix(idrotm[1101], 90., 315., 90., 45., 0., 0.); -// phi = -90 deg - AliMatrix(idrotm[1102], 90., 90., 90., 180., 0., 0.); -// theta = +90 deg - AliMatrix(idrotm[1103], 180., 0., 90., 90.,90., 0.); - -// phi = +45 deg - AliMatrix(idrotm[1104], 90., 45., 90., 135., 0., 0.); -// phi = +45 deg + rotation 180° around Y - AliMatrix(idrotm[1105], 90., 45., 90., 315., 180., 0.); - -// Translation matrices in the x-y plane -// X -> X ; Y -> Y; Z -> Z - AliMatrix(idrotm[1110], 90., 0., 90., 90., 0., 0.); -// X->-X; Y -> Y; Z -> -Z - AliMatrix(idrotm[1111], 90., 180., 90., 90., 180., 0.); -// X->-X; Y ->-Y; Z -> Z - AliMatrix(idrotm[1112], 90., 180., 90., 270., 0., 0.); -// X->X; Y ->-Y; Z -> -Z - AliMatrix(idrotm[1113], 90., 0., 90., 270., 180., 0.); -// - // tracking medias Int_t* idtmed = fIdtmed->GetArray()-1099; - + Int_t idAir = idtmed[1100]; // medium 1 - Int_t idSolder = idtmed[1118]; // medium 19 - Int_t idFrameEpoxy = idtmed[1119]; // medium 20 = Frame Epoxy ME730 - Int_t idInox = idtmed[1120]; // medium 21 Stainless Steel (18%Cr,9%Ni,Fe) - -//________________________________________________________________ -// -// Original model: -// -// Epoxy Frame segments + Int_t idFrameEpoxy = idtmed[1115]; // medium 16 = Frame Epoxy ME730 + Int_t idInox = idtmed[1116]; // medium 17 Stainless Steel (18%Cr,9%Ni,Fe) + Int_t idFR4 = idtmed[1110]; // medium 11 FR4 + Int_t idCopper = idtmed[1109]; // medium 10 Copper + Int_t idAlu = idtmed[1103]; // medium 4 Aluminium + + +// Rotation Matrices + Int_t rot1, rot2, rot3; + +// Rotation matrices + AliMatrix(rot1, 90., 90., 90., 180., 0., 0.); // +90 deg in x-y plane + AliMatrix(rot2, 90., 45., 90., 135., 0., 0.); // +45 deg in x-y plane + AliMatrix(rot3, 90., 45., 90., 315.,180., 0.); // +45 deg in x-y + rotation 180° around y + +// Translation matrices ... NOT USED +// AliMatrix(trans1, 90., 0., 90., 90., 0., 0.); // X-> X; Y -> Y; Z -> Z +// AliMatrix(trans2, 90., 180., 90., 90., 180., 0.); // X->-X; Y -> Y; Z ->-Z +// AliMatrix(trans3, 90., 180., 90., 270., 0., 0.); // X->-X; Y ->-Y; Z -> Z +// AliMatrix(trans4, 90., 0., 90., 270., 180., 0.); // X-> X; Y ->-Y; Z ->-Z // -// OutTopTrapFrame -// ------------ | -// OutEdgeTrapFrame / | -// / | InVFrame -// OutCornerTrapFrame / | -// | --| -// OutVFrame | _- InArcFrame -// |___________| -// InHFrame -// -// -// DATE: 27 NOVEMBER 2002 - MODEL UPDATED. THE MOTHER VOLUME IS A TUBS. -//__________________________________________________________________ + // ___________________Volume thicknesses________________________ - const Float_t hzFrameThickness = 1.186/2.; //equivalent thickness - const Float_t hzOuterFrameEpoxy = 1.23/2.; //equivalent thickness - const Float_t hzOuterFrameSolder = 0.032/2.; //equivalent thickness - const Float_t hzOuterFrameInox = 0.035/2.; //equivalent thickness - - // InHFrame parameters - const Float_t hxInHFrame = 75.8/2.; - const Float_t hyInHFrame = 2.5/2.; - const Float_t hzInHFrame = hzFrameThickness; - - // InVFrame parameters - const Float_t hxInVFrame = 2.5/2.; - const Float_t hyInVFrame = 73.3/2.; + const Float_t hzFrameThickness = 1.59/2.; //equivalent thickness + const Float_t hzOuterFrameEpoxy = 1.19/2.; //equivalent thickness + const Float_t hzOuterFrameInox = 0.1/2.; //equivalent thickness + const Float_t hzFoam = 2.083/2.; //evaluated elsewhere + +// Pertaining to the top outer area + const Float_t hzTopAnodeSteel1 = 0.185/2.; //equivalent thickness + const Float_t hzTopAnodeSteel2 = 0.51/2.; //equivalent thickness + const Float_t hzAnodeFR4 = 0.08/2.; //equivalent thickness + const Float_t hzTopEarthFaceCu = 0.364/2.; //equivalent thickness + const Float_t hzTopEarthProfileCu = 1.1/2.; //equivalent thickness + const Float_t hzTopPositionerSteel = 1.45/2.; //should really be 2.125/2.; + const Float_t hzTopGasSupportAl = 0.85/2.; //equivalent thickness + +// Pertaining to the vertical outer area + const Float_t hzVerticalCradleAl = 0.8/2.; //equivalent thickness + const Float_t hzLateralSightAl = 0.975/2.; //equivalent thickness + const Float_t hzLateralPosnInoxFace = 2.125/2.;//equivalent thickness + const Float_t hzLatPosInoxProfM = 6.4/2.; //equivalent thickness + const Float_t hzLatPosInoxProfNF = 1.45/2.; //equivalent thickness + const Float_t hzLateralPosnAl = 0.5/2.; //equivalent thickness + const Float_t hzVertEarthFaceCu = 0.367/2.; //equivalent thickness + const Float_t hzVertBarSteel = 0.198/2.; //equivalent thickness + const Float_t hzVertEarthProfCu = 1.1/2.; //equivalent thickness + + //_______________Parameter definitions in sequence _________ + +// InVFrame parameters + const Float_t hxInVFrame = 1.85/2.; + const Float_t hyInVFrame = 73.95/2.; const Float_t hzInVFrame = hzFrameThickness; - //Flat 1mm vertical section - const Float_t hxV1mm = 0.1/2.; - const Float_t hyV1mm = 2.5/2.; +//Flat 7.5mm vertical section + const Float_t hxV1mm = 0.75/2.; + const Float_t hyV1mm = 1.85/2.; const Float_t hzV1mm = hzFrameThickness; - - //Flat 1mm horizontal section - const Float_t hxH1mm = 2.5/2.; - const Float_t hyH1mm = 0.1/2.; - const Float_t hzH1mm = hzFrameThickness; - - // InArcFrame parameters - const Float_t IAF = 15.70; - const Float_t OAF = 18.20; - const Float_t hzAF = hzFrameThickness; - const Float_t AFphi1 = 0.0; - const Float_t AFphi2 = 90.0; - // ScrewsInFrame parameters HEAD - const Float_t SCRUHMI = 0.; - const Float_t SCRUHMA = 0.690/2.; - const Float_t SCRUHLE = 0.4/2.; - // ScrewsInFrame parameters MIDDLE - const Float_t SCRUMMI = 0.; - const Float_t SCRUMMA = 0.39/2.; - const Float_t SCRUMLE = hzFrameThickness; - // ScrewsInFrame parameters NUT - const Float_t SCRUNMI = 0.; - const Float_t SCRUNMA = 0.78/2.; - const Float_t SCRUNLE = 0.8/2.; - - // OutVFrame parameters - const Float_t hxOutVFrame = 2.5/2.; - const Float_t hyOutVFrame = 43.927/2.; - const Float_t hzOutVFrame = hzFrameThickness; +// OuterTopFrame Structure +// +// FRAME +// The frame is composed of a cuboid and two trapezoids +// (TopFrameAnode, TopFrameAnodeA, TopFrameAnodeB). +// Each shape is composed of two layers (Epoxy and Inox) and +// takes the frame's inner anode circuitry into account in the material budget. +// +// ANODE +// The overhanging anode part is composed froma cuboid and two trapezoids +// (TopAnode, TopAnode1, and TopAnode2). These surfaces neglect implanted +// resistors, but accounts for the major Cu, Pb/Sn, and FR4 material +// contributions. +// The stainless steel anode supports have been included. +// +// EARTHING (TopEarthFace, TopEarthProfile) +// Al GAS SUPPORT (TopGasSupport) +// +// ALIGNMENT (TopPositioner) - Alignment system, three sights per quarter +// chamber. This sight is forseen for the alignment of the horizontal level +// (parallel to the OY axis of LHC). Its position will be evaluated relative +// to a system of sights places on the cradles; +// +//--- -/////////////////////////////////////////////////////// - -// OutTopCuboidFrame Epoxy parameters - const Float_t hxOutHFrame = 31.9304/2.; - const Float_t hyOutHFrame = 8.4/2.; - const Float_t hzOutHFrame = hzOuterFrameEpoxy; +//TopFrameAnode parameters - cuboid, 2 layers + const Float_t hxTFA = 34.1433/2.; + const Float_t hyTFA = 7.75/2.; + const Float_t hzTFAE = hzOuterFrameEpoxy; // layer 1 thickness + const Float_t hzTFAI = hzOuterFrameInox; // layer 3 thickness -// OutTopTrapFrameA Epoxy parameters - const Float_t hzOTTFA = hzOuterFrameEpoxy; - const Float_t tetOTTFA = 0.; - const Float_t phiOTTFA = 0.; - const Float_t h1OTTFA = 9.6716/2.; - const Float_t bl1OTTFA = 4.7787/2.; - const Float_t tl1OTTFA = 8.4/2.; - const Float_t alp1OTTFA = 10.6; - const Float_t h2OTTFA = 9.6716/2.; - const Float_t bl2OTTFA = 4.7787/2.; - const Float_t tl2OTTFA = 8.4/2.; - const Float_t alp2OTTFA = 10.6; +// TopFrameAnodeA parameters - trapezoid, 2 layers + const Float_t hzFAAE = hzOuterFrameEpoxy; // layer 1 thickness + const Float_t hzFAAI = hzOuterFrameInox; // layer 3 thickness + const Float_t tetFAA = 0.; + const Float_t phiFAA = 0.; + const Float_t h1FAA = 8.7/2.; + const Float_t bl1FAA = 4.35/2.; + const Float_t tl1FAA = 7.75/2.; + const Float_t alp1FAA = 11.06; + const Float_t h2FAA = 8.7/2.; + const Float_t bl2FAA = 4.35/2.; + const Float_t tl2FAA = 7.75/2.; + const Float_t alp2FAA = 11.06; -// OutTopTrapFrameB Epoxy parameters - const Float_t hzOTTFB = hzOuterFrameEpoxy; - const Float_t tetOTTFB = 0.; - const Float_t phiOTTFB = 0.; - const Float_t h1OTTFB = 9.6716/2.; - const Float_t bl1OTTFB = 0.; - const Float_t tl1OTTFB = 4.7787/2.; - const Float_t alp1OTTFB = 13.88; - const Float_t h2OTTFB = 9.6716/2.; - const Float_t bl2OTTFB = 0.; - const Float_t tl2OTTFB = 4.7787/2.; - const Float_t alp2OTTFB = 13.88; - - // OutTopTrapFrame Solder parameters - const Float_t hzOTTFS = hzOuterFrameSolder; +// TopFrameAnodeB parameters - trapezoid, 2 layers + const Float_t hzFABE = hzOuterFrameEpoxy; // layer 1 thickness + const Float_t hzFABI = hzOuterFrameInox; // layer 3 thickness + const Float_t tetFAB = 0.; + const Float_t phiFAB = 0.; + const Float_t h1FAB = 8.70/2.; + const Float_t bl1FAB = 0.; + const Float_t tl1FAB = 4.35/2.; + const Float_t alp1FAB = 14.03; + const Float_t h2FAB = 8.70/2.; + const Float_t bl2FAB = 0.; + const Float_t tl2FAB = 4.35/2.; + const Float_t alp2FAB = 14.03; - // OutTopTrapFrame Inox parameters - const Float_t hzOTTFI = hzOuterFrameInox; - -///////////////////////////////////////////////////////// - - // OutEdgeTrapFrame parameters - // TRAPEZE 1 - const Float_t hzOETF = hzOuterFrameEpoxy; - const Float_t tetOETF = 0.; - const Float_t phiOETF = 0.; - const Float_t h1OETF = 7.129/2.; - const Float_t bl1OETF1 = 3.705/2; - const Float_t tl1OETF1 = 3.9471/2.; - const Float_t alp1OETF1 = 0.97; - const Float_t h2OETF = 7.129/2.; - const Float_t bl2OETF1 = 3.705/2; - const Float_t tl2OETF1 = 3.9471/2.; - const Float_t alp2OETF1 = 0.97; +// TopAnode parameters - cuboid (part 1 of 3 parts) + const Float_t hxTA1 = 16.2/2.; + const Float_t hyTA1 = 3.5/2.; + const Float_t hzTA11 = hzTopAnodeSteel1; // layer 1 + const Float_t hzTA12 = hzAnodeFR4; // layer 2 + +// TopAnode parameters - trapezoid 1 (part 2 of 3 parts) + const Float_t hzTA21 = hzTopAnodeSteel2; // layer 1 + const Float_t hzTA22 = hzAnodeFR4; // layer 2 + const Float_t tetTA2 = 0.; + const Float_t phiTA2= 0.; + const Float_t h1TA2 = 7.268/2.; + const Float_t bl1TA2 = 2.03/2.; + const Float_t tl1TA2 = 3.5/2.; + const Float_t alp1TA2 = 5.78; + const Float_t h2TA2 = 7.268/2.; + const Float_t bl2TA2 = 2.03/2.; + const Float_t tl2TA2 = 3.5/2.; + const Float_t alp2TA2 = 5.78; + +// TopAnode parameters - trapezoid 2 (part 3 of 3 parts) + const Float_t hzTA3 = hzAnodeFR4; // layer 1 + const Float_t tetTA3 = 0.; + const Float_t phiTA3 = 0.; + const Float_t h1TA3 = 7.268/2.; + const Float_t bl1TA3 = 0.; + const Float_t tl1TA3 = 2.03/2.; + const Float_t alp1TA3 = 7.95; + const Float_t h2TA3 = 7.268/2.; + const Float_t bl2TA3 = 0.; + const Float_t tl2TA3 = 2.03/2.; + const Float_t alp2TA3 = 7.95; - // TRAPEZE 2 - const Float_t bl1OETF2 = 2.9744/2.; - const Float_t tl1OETF2 = 3.705/2; - const Float_t alp1OETF2 = 2.93; - - const Float_t bl2OETF2 = 2.9744/2.; - const Float_t tl2OETF2 = 3.705/2; - const Float_t alp2OETF2 = 2.93; +// TopEarthFace parameters - single trapezoid + const Float_t hzTEF = hzTopEarthFaceCu; + const Float_t tetTEF = 0.; + const Float_t phiTEF = 0.; + const Float_t h1TEF = 1.200/2.; + const Float_t bl1TEF = 21.323/2.; + const Float_t tl1TEF = 17.963/2.; + const Float_t alp1TEF = -54.46; + const Float_t h2TEF = 1.200/2.; + const Float_t bl2TEF = 21.323/2.; + const Float_t tl2TEF = 17.963/2.; + const Float_t alp2TEF = -54.46; + +// TopEarthProfile parameters - single trapezoid + const Float_t hzTEP = hzTopEarthProfileCu; + const Float_t tetTEP = 0.; + const Float_t phiTEP = 0.; + const Float_t h1TEP = 0.40/2.; + const Float_t bl1TEP = 31.766/2.; + const Float_t tl1TEP = 30.535/2.; + const Float_t alp1TEP = -56.98; + const Float_t h2TEP = 0.40/2.; + const Float_t bl2TEP = 31.766/2.; + const Float_t tl2TEP = 30.535/2.; + const Float_t alp2TEP = -56.98; + +// TopPositioner parameters - single Stainless Steel trapezoid + const Float_t hzTP = hzTopPositionerSteel; + const Float_t tetTP = 0.; + const Float_t phiTP = 0.; + const Float_t h1TP = 3.00/2.; + const Float_t bl1TP = 7.023/2.; + const Float_t tl1TP = 7.314/2.; + const Float_t alp1TP = 2.78; + const Float_t h2TP = 3.00/2.; + const Float_t bl2TP = 7.023/2.; + const Float_t tl2TP = 7.314/2.; + const Float_t alp2TP = 2.78; + +// TopGasSupport parameters - single cuboid + const Float_t hxTGS = 8.50/2.; + const Float_t hyTGS = 3.00/2.; + const Float_t hzTGS = hzTopGasSupportAl; + +// OutEdgeFrame parameters - 4 trapezoidal sections, 2 layers of material +// +//--- + +// Trapezoid 1 + const Float_t hzOETFE = hzOuterFrameEpoxy; // layer 1 + const Float_t hzOETFI = hzOuterFrameInox; // layer 3 - // TRAPEZE 3 - const Float_t bl1OETF3 = 1.7455/2.; - const Float_t tl1OETF3 = 2.9744/2.; - const Float_t alp1OETF3 = 4.93; + const Float_t tetOETF = 0.; // common to all 4 trapezoids + const Float_t phiOETF = 0.; // common to all 4 trapezoids + + const Float_t h1OETF = 7.196/2.; // common to all 4 trapezoids + const Float_t h2OETF = 7.196/2.; // common to all 4 trapezoids + + const Float_t bl1OETF1 = 3.75/2; + const Float_t tl1OETF1 = 3.996/2.; + const Float_t alp1OETF1 = 0.98; + + const Float_t bl2OETF1 = 3.75/2; + const Float_t tl2OETF1 = 3.996/2.; + const Float_t alp2OETF1 = 0.98; + +// Trapezoid 2 + const Float_t bl1OETF2 = 3.01/2.; + const Float_t tl1OETF2 = 3.75/2; + const Float_t alp1OETF2 = 2.94; - const Float_t bl2OETF3 = 1.7455/2.; - const Float_t tl2OETF3 = 2.9744/2.; - const Float_t alp2OETF3 = 4.93; + const Float_t bl2OETF2 = 3.01/2.; + const Float_t tl2OETF2 = 3.75/2; + const Float_t alp2OETF2 = 2.94; + +// Trapezoid 3 + const Float_t bl1OETF3 = 1.767/2.; + const Float_t tl1OETF3 = 3.01/2.; + const Float_t alp1OETF3 = 4.94; + + const Float_t bl2OETF3 = 1.767/2.; + const Float_t tl2OETF3 = 3.01/2.; + const Float_t alp2OETF3 = 4.94; - // TRAPEZE 4 +// Trapezoid 4 const Float_t bl1OETF4 = 0.; - const Float_t tl1OETF4 = 1.7455/2.; - const Float_t alp1OETF4 = 6.98; + const Float_t tl1OETF4 = 1.77/2.; + const Float_t alp1OETF4 = 7.01; const Float_t bl2OETF4 = 0.; - const Float_t tl2OETF4 = 1.7455/2.; - const Float_t alp2OETF4 = 6.98; - - /////////////////////////////////////////////////// - - // OutCornerTrapFrame parameters + const Float_t tl2OETF4 = 1.77/2.; + const Float_t alp2OETF4 = 7.01; + +// Frame Structure (OutVFrame): +// +// OutVFrame and corner (OutVFrame cuboid, OutVFrame trapezoid) +// EARTHING (VertEarthFaceCu,VertEarthSteel,VertEarthProfCu), +// DETECTOR POSITIONNING (SuppLateralPositionner, LateralPositionner), +// CRADLE (VertCradle), and +// ALIGNMENT (LateralSightSupport, LateralSight) +// +//--- + +// OutVFrame parameters - cuboid + const Float_t hxOutVFrame = 1.85/2.; + const Float_t hyOutVFrame = 46.23/2.; + const Float_t hzOutVFrame = hzFrameThickness; + +// OutVFrame corner parameters - trapezoid const Float_t hzOCTF = hzFrameThickness; const Float_t tetOCTF = 0.; const Float_t phiOCTF = 0.; - const Float_t h1OCTF = 2.5/2.; + const Float_t h1OCTF = 1.85/2.; const Float_t bl1OCTF = 0.; - const Float_t tl1OCTF = 4.7469/2.; - const Float_t alp1OCTF = 43.51; - const Float_t h2OCTF = 2.5/2.; + const Float_t tl1OCTF = 3.66/2.; + const Float_t alp1OCTF = 44.67; + const Float_t h2OCTF = 1.85/2.; const Float_t bl2OCTF = 0.; - const Float_t tl2OCTF = 4.7469/2.; - const Float_t alp2OCTF = 43.51; - - // Reference point - MIRE (3 per quadrant, only 1 programmed) - const Float_t MIREInRad = 0.6; - const Float_t MIREOutRad = 1.3; - const Float_t MIRELen = hzFrameThickness; - - Float_t par[11]; - Float_t posX,posY,posZ; - -// ___________________Make volumes________________________ - -// Quadrant volume - par[0] = fgkMotherIR; - par[1] = fgkMotherOR; - par[2] = fgkMotherThick; - par[3] = fgkMotherPhiL; - par[4] = fgkMotherPhiU; - - //Quadrant volume.....positionned at the end - gMC->Gsvolu(QuadrantName(chamber),"TUBS",idAir,par,5); - -// _______________________________________________________ -// InVFrame - if (chamber==1) { - // simple epoxy layer...must be inside sensitive surface for tracking - par[0] = hxInVFrame; - par[1] = hyInVFrame; - par[2] = hzInVFrame; - - gMC->Gsvolu("IVEF","BOX",idFrameEpoxy,par,3); - - // InHFrame - par[0] = hxInHFrame; - par[1] = hyInHFrame; - par[2] = hzInHFrame; - - gMC->Gsvolu("IHEF","BOX",idFrameEpoxy,par,3); + const Float_t tl2OCTF = 3.66/2.; + const Float_t alp2OCTF = 44.67; + +// VertEarthFaceCu parameters - single trapezoid + const Float_t hzVFC = hzVertEarthFaceCu; + const Float_t tetVFC = 0.; + const Float_t phiVFC = 0.; + const Float_t h1VFC = 1.200/2.; + const Float_t bl1VFC = 46.11/2.; + const Float_t tl1VFC = 48.236/2.; + const Float_t alp1VFC = 41.54; + const Float_t h2VFC = 1.200/2.; + const Float_t bl2VFC = 46.11/2.; + const Float_t tl2VFC = 48.236/2.; + const Float_t alp2VFC = 41.54; + +// VertEarthSteel parameters - single trapezoid + const Float_t hzVES = hzVertBarSteel; + const Float_t tetVES = 0.; + const Float_t phiVES = 0.; + const Float_t h1VES = 1.200/2.; + const Float_t bl1VES = 30.486/2.; + const Float_t tl1VES = 32.777/2.; + const Float_t alp1VES = 43.67; + const Float_t h2VES = 1.200/2.; + const Float_t bl2VES = 30.486/2.; + const Float_t tl2VES = 32.777/2.; + const Float_t alp2VES = 43.67; + +// VertEarthProfCu parameters - single trapezoid + const Float_t hzVPC = hzVertEarthProfCu; + const Float_t tetVPC = 0.; + const Float_t phiVPC = 0.; + const Float_t h1VPC = 0.400/2.; + const Float_t bl1VPC = 29.287/2.; + const Float_t tl1VPC = 30.091/2.; + const Float_t alp1VPC = 45.14; + const Float_t h2VPC = 0.400/2.; + const Float_t bl2VPC = 29.287/2.; + const Float_t tl2VPC = 30.091/2.; + const Float_t alp2VPC = 45.14; + +// SuppLateralPositionner - single cuboid + const Float_t hxSLP = 2.80/2.; + const Float_t hySLP = 5.00/2.; + const Float_t hzSLP = hzLateralPosnAl; + +// LateralPositionner - squared off U bend, face view + const Float_t hxLPF = 5.2/2.; + const Float_t hyLPF = 3.0/2.; + const Float_t hzLPF = hzLateralPosnInoxFace; + +// LateralPositionner - squared off U bend, profile view + const Float_t hxLPP = 0.425/2.; + const Float_t hyLPP = 3.0/2.; + const Float_t hzLPP = hzLatPosInoxProfM; // middle layer + const Float_t hzLPNF = hzLatPosInoxProfNF; // near and far layers + +// VertCradle, 3 layers (copies), each composed of 4 trapezoids +// VertCradleA + const Float_t hzVC1 = hzVerticalCradleAl; + const Float_t tetVC1 = 0.; + const Float_t phiVC1 = 0.; + const Float_t h1VC1 = 10.25/2.; + const Float_t bl1VC1 = 3.70/2.; + const Float_t tl1VC1 = 0.; + const Float_t alp1VC1 = -10.23; + const Float_t h2VC1 = 10.25/2.; + const Float_t bl2VC1 = 3.70/2.; + const Float_t tl2VC1 = 0.; + const Float_t alp2VC1 = -10.23; + +// VertCradleB + const Float_t hzVC2 = hzVerticalCradleAl; + const Float_t tetVC2 = 0.; + const Float_t phiVC2 = 0.; + const Float_t h1VC2 = 10.25/2.; + const Float_t bl1VC2 = 6.266/2.; + const Float_t tl1VC2 = 3.70/2.; + const Float_t alp1VC2 = -7.13; + const Float_t h2VC2 = 10.25/2.; + const Float_t bl2VC2 = 6.266/2.; + const Float_t tl2VC2 = 3.70/2.; + const Float_t alp2VC2 = -7.13; + +// VertCradleC + const Float_t hzVC3 = hzVerticalCradleAl; + const Float_t tetVC3 = 0.; + const Float_t phiVC3 = 0.; + const Float_t h1VC3 = 10.25/2.; + const Float_t bl1VC3 = 7.75/2.; + const Float_t tl1VC3 = 6.266/2.; + const Float_t alp1VC3 = -4.14; + const Float_t h2VC3 = 10.25/2.; + const Float_t bl2VC3 = 7.75/2.; + const Float_t tl2VC3 = 6.266/2.; + const Float_t alp2VC3 = -4.14; + +// VertCradleD + const Float_t hzVC4 = hzVerticalCradleAl; + const Float_t tetVC4 = 0.; + const Float_t phiVC4 = 0.; + const Float_t h1VC4 = 10.27/2.; + const Float_t bl1VC4 = 8.273/2.; + const Float_t tl1VC4 = 7.75/2.; + const Float_t alp1VC4 = -1.46; + const Float_t h2VC4 = 10.27/2.; + const Float_t bl2VC4 = 8.273/2.; + const Float_t tl2VC4 = 7.75/2.; + const Float_t alp2VC4 = -1.46; + +// LateralSightSupport - single trapezoid + const Float_t hzVSS = hzLateralSightAl; + const Float_t tetVSS = 0.; + const Float_t phiVSS = 0.; + const Float_t h1VSS = 5.00/2.; + const Float_t bl1VSS = 7.747/2; + const Float_t tl1VSS = 7.188/2.; + const Float_t alp1VSS = -3.20; + const Float_t h2VSS = 5.00/2.; + const Float_t bl2VSS = 7.747/2.; + const Float_t tl2VSS = 7.188/2.; + const Float_t alp2VSS = -3.20; + +// LateralSight (reference point) - 3 per quadrant, only 1 programmed for now + const Float_t VSInRad = 0.6; + const Float_t VSOutRad = 1.3; + const Float_t VSLen = hzFrameThickness; + +//--- - //Flat 1mm vertical section - par[0] = hxV1mm; - par[1] = hyV1mm; - par[2] = hzV1mm; +// InHFrame parameters + const Float_t hxInHFrame = 75.8/2.; + const Float_t hyInHFrame = 1.85/2.; + const Float_t hzInHFrame = hzFrameThickness; + +//Flat 7.5mm horizontal section + const Float_t hxH1mm = 1.85/2.; + const Float_t hyH1mm = 0.75/2.; + const Float_t hzH1mm = hzFrameThickness; - gMC->Gsvolu("FVMM","BOX",idFrameEpoxy,par,3); +//--- - //Flat 1mm vertical section - par[0] = hxH1mm; - par[1] = hyH1mm; - par[2] = hzH1mm; +// InArcFrame parameters + const Float_t IAF = 15.70; + const Float_t OAF = 17.55; + const Float_t hzAF = hzFrameThickness; + const Float_t AFphi1 = 0.0; + const Float_t AFphi2 = 90.0; - gMC->Gsvolu("FHMM","BOX",idFrameEpoxy,par,3); +//--- - // OutVFrame - par[0] = hxOutVFrame; - par[1] = hyOutVFrame; - par[2] = hzOutVFrame; +// ScrewsInFrame parameters HEAD + const Float_t SCRUHMI = 0.; + const Float_t SCRUHMA = 0.690/2.; + const Float_t SCRUHLE = 0.4/2.; +// ScrewsInFrame parameters MIDDLE + const Float_t SCRUMMI = 0.; + const Float_t SCRUMMA = 0.39/2.; + const Float_t SCRUMLE = hzFrameThickness; +// ScrewsInFrame parameters NUT + const Float_t SCRUNMI = 0.; + const Float_t SCRUNMA = 0.78/2.; + const Float_t SCRUNLE = 0.8/2.; + + // ___________________Make volumes________________________ - gMC->Gsvolu("OVEF","BOX",idFrameEpoxy,par,3); + Float_t par[11]; + Float_t posX,posY,posZ; - // InArcFrame - par[0] = IAF; - par[1] = OAF; - par[2] = hzAF; - par[3] = AFphi1; - par[4] = AFphi2 ; +// Quadrant volume TUBS1, positioned at the end + par[0] = fgkMotherIR1; + par[1] = fgkMotherOR1; + par[2] = fgkMotherThick1; + par[3] = fgkMotherPhiL1; + par[4] = fgkMotherPhiU1; + gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5); - gMC->Gsvolu("IAF1","TUBS",idFrameEpoxy,par,5); +// Quadrant volume TUBS2, positioned at the end + par[0] = fgkMotherIR2; + par[1] = fgkMotherOR2; + par[2] = fgkMotherThick2; + par[3] = fgkMotherPhiL2; + par[4] = fgkMotherPhiU2; - // ScrewsInFrame - 3 sections in order to avoid overlapping volumes - // Screw Head, in air - par[0] = SCRUHMI; - par[1] = SCRUHMA; - par[2] = SCRUHLE; + gMC->Gsvolu(QuadrantNLayerName(chamber),"TUBS",idAir,par,5); + gMC->Gsvolu(QuadrantFLayerName(chamber),"TUBS",idAir,par,5); - gMC->Gsvolu("SCRH","TUBE",idInox,par,3); + if (chamber==1) { + // InVFrame + par[0] = hxInVFrame; + par[1] = hyInVFrame; + par[2] = hzInVFrame; + gMC->Gsvolu("SQ00","BOX",idFrameEpoxy,par,3); + + //Flat 1mm vertical section + par[0] = hxV1mm; + par[1] = hyV1mm; + par[2] = hzV1mm; + gMC->Gsvolu("SQ01","BOX",idFrameEpoxy,par,3); + +// OutTopFrame +// +// - 3 components (a cuboid and 2 trapezes) and 2 layers (Epoxy/Inox) +// +//--- - // Middle part, in the Epoxy - par[0] = SCRUMMI; - par[1] = SCRUMMA; - par[2] = SCRUMLE; + // TopFrameAnode - layer 1 of 2 + par[0] = hxTFA; + par[1] = hyTFA; + par[2] = hzTFAE; + gMC->Gsvolu("SQ02","BOX",idFrameEpoxy,par,3); + + // TopFrameAnode - layer 2 of 2 + par[2] = hzTFAI; + gMC->Gsvolu("SQ03","BOX",idInox,par,3); + + // TopFrameAnodeA - layer 1 of 2 + par[0] = hzFAAE; + par[1] = tetFAA; + par[2] = phiFAA; + par[3] = h1FAA; + par[4] = bl1FAA; + par[5] = tl1FAA; + par[6] = alp1FAA; + par[7] = h2FAA; + par[8] = bl2FAA; + par[9] = tl2FAA; + par[10] = alp2FAA; + gMC->Gsvolu("SQ04","TRAP",idFrameEpoxy,par,11); + + // TopFrameAnodeA - layer 2 of 2 + par[0] = hzFAAI; + gMC->Gsvolu("SQ05","TRAP",idInox,par,11); - gMC->Gsvolu("SCRM","TUBE",idInox,par,3); - - // Screw nut, in air - par[0] = SCRUNMI; - par[1] = SCRUNMA; - par[2] = SCRUNLE; - - gMC->Gsvolu("SCRN","TUBE",idInox,par,3); + // TopFrameAnodeB - layer 1 of 2 + par[0] = hzFABE; + par[1] = tetFAB; + par[2] = phiFAB; + par[3] = h1FAB; + par[4] = bl1FAB; + par[5] = tl1FAB; + par[6] = alp1FAB; + par[7] = h2FAB; + par[8] = bl2FAB; + par[9] = tl2FAB; + par[10] = alp2FAB; + gMC->Gsvolu("SQ06","TRAP",idFrameEpoxy,par,11); + + // OutTopTrapFrameB - layer 2 of 2 + par[0] = hzFABI; + gMC->Gsvolu("SQ07","TRAP",idInox,par,11); + + // TopAnode1 - layer 1 of 2 + par[0] = hxTA1; + par[1] = hyTA1; + par[2] = hzTA11; + gMC->Gsvolu("SQ08","BOX",idInox,par,3); + + // TopAnode1 - layer 2 of 2 + par[2] = hzTA12; + gMC->Gsvolu("SQ09","BOX",idFR4,par,11); + + // TopAnode2 - layer 1 of 2 + par[0] = hzTA21; + par[1] = tetTA2; + par[2] = phiTA2; + par[3] = h1TA2; + par[4] = bl1TA2; + par[5] = tl1TA2; + par[6] = alp1TA2; + par[7] = h2TA2; + par[8] = bl2TA2; + par[9] = tl2TA2; + par[10] = alp2TA2; + gMC->Gsvolu("SQ10","TRAP",idInox,par,11); + + // TopAnode2 - layer 2 of 2 + par[0] = hzTA22; + gMC->Gsvolu("SQ11","TRAP",idFR4,par,11); + + // TopAnode3 - layer 1 of 1 + par[0] = hzTA3; + par[1] = tetTA3; + par[2] = phiTA3; + par[3] = h1TA3; + par[4] = bl1TA3; + par[5] = tl1TA3; + par[6] = alp1TA3; + par[7] = h2TA3; + par[8] = bl2TA3; + par[9] = tl2TA3; + par[10] = alp2TA3; + gMC->Gsvolu("SQ12","TRAP",idFR4,par,11); + + // TopEarthFace + par[0] = hzTEF; + par[1] = tetTEF; + par[2] = phiTEF; + par[3] = h1TEF; + par[4] = bl1TEF; + par[5] = tl1TEF; + par[6] = alp1TEF; + par[7] = h2TEF; + par[8] = bl2TEF; + par[9] = tl2TEF; + par[10] = alp2TEF; + gMC->Gsvolu("SQ13","TRAP",idCopper,par,11); + + // TopEarthProfile + par[0] = hzTEP; + par[1] = tetTEP; + par[2] = phiTEP; + par[3] = h1TEP; + par[4] = bl1TEP; + par[5] = tl1TEP; + par[6] = alp1TEP; + par[7] = h2TEP; + par[8] = bl2TEP; + par[9] = tl2TEP; + par[10] = alp2TEP; + gMC->Gsvolu("SQ14","TRAP",idCopper,par,11); + + // TopGasSupport + par[0] = hxTGS; + par[1] = hyTGS; + par[2] = hzTGS; + gMC->Gsvolu("SQ15","BOX",idAlu,par,3); + + // TopPositioner parameters - single Stainless Steel trapezoid + par[0] = hzTP; + par[1] = tetTP; + par[2] = phiTP; + par[3] = h1TP; + par[4] = bl1TP; + par[5] = tl1TP; + par[6] = alp1TP; + par[7] = h2TP; + par[8] = bl2TP; + par[9] = tl2TP; + par[10] = alp2TP; + gMC->Gsvolu("SQ16","TRAP",idInox,par,11); - /////////////////////////////////////////// +// +// OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox) +// +//--- + // Trapezoid 1 - 2 layers + par[1] = tetOETF; + par[2] = phiOETF; + par[3] = h1OETF; + par[4] = bl1OETF1; + par[5] = tl1OETF1; + par[6] = alp1OETF1; + par[7] = h2OETF; + par[8] = bl2OETF1; + par[9] = tl2OETF1; + par[10] = alp2OETF1; + + par[0] = hzOETFE; + gMC->Gsvolu("SQ17","TRAP",idFrameEpoxy,par,11); + par[0] = hzOETFI; + gMC->Gsvolu("SQ18","TRAP",idInox,par,11); + + // Trapezoid 2 - 2 layers + par[4] = bl1OETF2; + par[5] = tl1OETF2; + par[6] = alp1OETF2; + + par[8] = bl2OETF2; + par[9] = tl2OETF2; + par[10] = alp2OETF2; + + par[0] = hzOETFE; + gMC->Gsvolu("SQ19","TRAP",idFrameEpoxy,par,11); + par[0] = hzOETFI; + gMC->Gsvolu("SQ20","TRAP",idInox,par,11); + + // Trapezoid 3 - 2 layers + par[4] = bl1OETF3; + par[5] = tl1OETF3; + par[6] = alp1OETF3; + + par[8] = bl2OETF3; + par[9] = tl2OETF3; + par[10] = alp2OETF3; + + par[0] = hzOETFE; + gMC->Gsvolu("SQ21","TRAP",idFrameEpoxy,par,11); + par[0] = hzOETFI; + gMC->Gsvolu("SQ22","TRAP",idInox,par,11); + + // Trapezoid 4 - 2 layers - // OutTopTrapFrame Epoxy - // - 3 components (cuboid and 2 trapezes) and 3 layers (Epoxy/Inox/Solder) + par[4] = bl1OETF4; + par[5] = tl1OETF4; + par[6] = alp1OETF4; - // OutTopCuboidFrame Epoxy - par[0] = hxOutHFrame; - par[1] = hyOutHFrame; - par[2] = hzOutHFrame; - - gMC->Gsvolu("OHEA","BOX",idFrameEpoxy,par,3); - - // OutTopTrapFrameA Epoxy parameters - par[0] = hzOTTFA; - par[1] = tetOTTFA; - par[2] = phiOTTFA; - par[3] = h1OTTFA; - par[4] = bl1OTTFA; - par[5] = tl1OTTFA; - par[6] = alp1OTTFA; - par[7] = h2OTTFA; - par[8] = bl2OTTFA; - par[9] = tl2OTTFA; - par[10] = alp2OTTFA; - - gMC->Gsvolu("OHEB","TRAP",idFrameEpoxy,par,11); - - // OutTopTrapFrameB Epoxy parameters - par[0] = hzOTTFB; - par[1] = tetOTTFB; - par[2] = phiOTTFB; - par[3] = h1OTTFB; - par[4] = bl1OTTFB; - par[5] = tl1OTTFB; - par[6] = alp1OTTFB; - par[7] = h2OTTFB; - par[8] = bl2OTTFB; - par[9] = tl2OTTFB; - par[10] = alp2OTTFB; - - gMC->Gsvolu("OHEC","TRAP",idFrameEpoxy,par,11); - - // OutTopCuboidFrame Solder - par[0] = hxOutHFrame; - par[1] = hyOutHFrame; - par[2] = hzOTTFS; - gMC->Gsvolu("OHSA","BOX",idSolder,par,3); - - // OutTopTrapFrameA Solder - par[0] = hzOTTFS; - par[1] = tetOTTFA; - par[2] = phiOTTFA; - par[3] = h1OTTFA; - par[4] = bl1OTTFA; - par[5] = tl1OTTFA; - par[6] = alp1OTTFA; - par[7] = h2OTTFA; - par[8] = bl2OTTFA; - par[9] = tl2OTTFA; - par[10] = alp2OTTFA; - - gMC->Gsvolu("OHSB","TRAP",idSolder,par,11); - - - // OutTopTrapFrameB Solder - par[0] = hzOTTFI; - par[1] = tetOTTFB; - par[2] = phiOTTFB; - par[3] = h1OTTFB; - par[4] = bl1OTTFB; - par[5] = tl1OTTFB; - par[6] = alp1OTTFB; - par[7] = h2OTTFB; - par[8] = bl2OTTFB; - par[9] = tl2OTTFB; - par[10] = alp2OTTFB; - - gMC->Gsvolu("OHSC","TRAP",idSolder,par,11); - - // OutTopCuboidFrame Solder - par[0] = hxOutHFrame; - par[1] = hyOutHFrame; - par[2] = hzOTTFI; - gMC->Gsvolu("OHIA","BOX",idInox,par,3); - - // OutTopTrapFrameA Inox - par[0] = hzOTTFI; - par[1] = tetOTTFA; - par[2] = phiOTTFA; - par[3] = h1OTTFA; - par[4] = bl1OTTFA; - par[5] = tl1OTTFA; - par[6] = alp1OTTFA; - par[7] = h2OTTFA; - par[8] = bl2OTTFA; - par[9] = tl2OTTFA; - par[10] = alp2OTTFA; - - gMC->Gsvolu("OHIB","TRAP",idInox,par,11); - - // OutTopTrapFrameB Inox - par[0] = hzOTTFI; - par[1] = tetOTTFB; - par[2] = phiOTTFB; - par[3] = h1OTTFB; - par[4] = bl1OTTFB; - par[5] = tl1OTTFB; - par[6] = alp1OTTFB; - par[7] = h2OTTFB; - par[8] = bl2OTTFB; - par[9] = tl2OTTFB; - par[10] = alp2OTTFB; - - gMC->Gsvolu("OHIC","TRAP",idInox,par,11); - - ///////////////////////////////// - - // OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*3 layers (Epoxy/Inox/Solder) - // TRAPEZE 1 - par[0] = hzOETF; - par[1] = tetOETF; - par[2] = phiOETF; - par[3] = h1OETF; - par[4] = bl1OETF1; - par[5] = tl1OETF1; - par[6] = alp1OETF1; - par[7] = h2OETF; - par[8] = bl2OETF1; - par[9] = tl2OETF1; - par[10] = alp2OETF1; - - gMC->Gsvolu("EDE1","TRAP",idFrameEpoxy,par,11); - - // TRAPEZE 2 - par[4] = bl1OETF2; - par[5] = tl1OETF2; - par[6] = alp1OETF2; - - par[8] = bl2OETF2; - par[9] = tl2OETF2; - par[10] = alp2OETF2; - gMC->Gsvolu("EDE2","TRAP",idFrameEpoxy,par,11); - - // TRAPEZE 3 - par[4] = bl1OETF3; - par[5] = tl1OETF3; - par[6] = alp1OETF3; - - par[8] = bl2OETF3; - par[9] = tl2OETF3; - par[10] = alp2OETF3; - gMC->Gsvolu("EDE3","TRAP",idFrameEpoxy,par,11); - - // TRAPEZE 4 - par[4] = bl1OETF4; - par[5] = tl1OETF4; - par[6] = alp1OETF4; - - par[8] = bl2OETF4; - par[9] = tl2OETF4; - par[10] = alp2OETF4; - gMC->Gsvolu("EDE4","TRAP",idFrameEpoxy,par,11); - - //////////////////////////////// - - // TRAPEZE 1 - par[0] = hzOuterFrameInox; - par[1] = tetOETF; - par[2] = phiOETF; - par[3] = h1OETF; - par[4] = bl1OETF1; - par[5] = tl1OETF1; - par[6] = alp1OETF1; - par[7] = h2OETF; - par[8] = bl2OETF1; - par[9] = tl2OETF1; - par[10] = alp2OETF1; - - gMC->Gsvolu("EDI1","TRAP",idInox,par,11); - - // TRAPEZE 2 - par[4] = bl1OETF2; - par[5] = tl1OETF2; - par[6] = alp1OETF2; - - par[8] = bl2OETF2; - par[9] = tl2OETF2; - par[10] = alp2OETF2; - gMC->Gsvolu("EDI2","TRAP",idInox,par,11); - - // TRAPEZE 3 - par[4] = bl1OETF3; - par[5] = tl1OETF3; - par[6] = alp1OETF3; - - par[8] = bl2OETF3; - par[9] = tl2OETF3; - par[10] = alp2OETF3; - gMC->Gsvolu("EDI3","TRAP",idInox,par,11); - - // TRAPEZE 4 - par[4] = bl1OETF4; - par[5] = tl1OETF4; - par[6] = alp1OETF4; - - par[8] = bl2OETF4; - par[9] = tl2OETF4; - par[10] = alp2OETF4; - gMC->Gsvolu("EDI4","TRAP",idInox,par,11); - - - //////////////////////////////// - - // TRAPEZE 1 - par[0] = hzOuterFrameSolder; - par[1] = tetOETF; - par[2] = phiOETF; - par[3] = h1OETF; - par[4] = bl1OETF1; - par[5] = tl1OETF1; - par[6] = alp1OETF1; - par[7] = h2OETF; - par[8] = bl2OETF1; - par[9] = tl2OETF1; - par[10] = alp2OETF1; - - gMC->Gsvolu("EDS1","TRAP",idSolder,par,11); - - // TRAPEZE 2 - par[4] = bl1OETF2; - par[5] = tl1OETF2; - par[6] = alp1OETF2; - - par[8] = bl2OETF2; - par[9] = tl2OETF2; - par[10] = alp2OETF2; - gMC->Gsvolu("EDS2","TRAP",idSolder,par,11); - - // TRAPEZE 3 - par[4] = bl1OETF3; - par[5] = tl1OETF3; - par[6] = alp1OETF3; - - par[8] = bl2OETF3; - par[9] = tl2OETF3; - par[10] = alp2OETF3; - gMC->Gsvolu("EDS3","TRAP",idSolder,par,11); - - // TRAPEZE 4 - par[4] = bl1OETF4; - par[5] = tl1OETF4; - par[6] = alp1OETF4; - - par[8] = bl2OETF4; - par[9] = tl2OETF4; - par[10] = alp2OETF4; - gMC->Gsvolu("EDS4","TRAP",idSolder,par,11); - - ////////////////////////////////// - - // OutCornerTrapFrame - par[0] = hzOCTF; - par[1] = tetOCTF; - par[2] = phiOCTF; - par[3] = h1OCTF; - par[4] = bl1OCTF; - par[5] = tl1OCTF; - par[6] = alp1OCTF; - par[7] = h2OCTF; - par[8] = bl2OCTF; - par[9] = tl2OCTF; - par[10] = alp2OCTF; - - gMC->Gsvolu("TCOR","TRAP",idFrameEpoxy,par,11); - - // MIRE - par[0] = MIREInRad; - par[1] = MIREOutRad; - par[2] = MIRELen; - - gMC->Gsvolu("MIRE","TUBE",idFrameEpoxy,par,3); - } + par[8] = bl2OETF4; + par[9] = tl2OETF4; + par[10] = alp2OETF4; + + par[0] = hzOETFE; + gMC->Gsvolu("SQ23","TRAP",idFrameEpoxy,par,11); + par[0] = hzOETFI; + gMC->Gsvolu("SQ24","TRAP",idInox,par,11); -// __________________Place volumes in the quadrant ____________ - - const Float_t BeamOX = 2.6; - const Float_t BeamOY = 2.6; - - // Coordinates of the frame corner wrt the beam axis defined at (0,0) - Float_t QuadOX = 0.; - Float_t QuadOY = 0.; +//--- + // OutVFrame + par[0] = hxOutVFrame; + par[1] = hyOutVFrame; + par[2] = hzOutVFrame; + gMC->Gsvolu("SQ25","BOX",idFrameEpoxy,par,3); + + // OutVFrame corner + par[0] = hzOCTF; + par[1] = tetOCTF; + par[2] = phiOCTF; + par[3] = h1OCTF; + par[4] = bl1OCTF; + par[5] = tl1OCTF; + par[6] = alp1OCTF; + par[7] = h2OCTF; + par[8] = bl2OCTF; + par[9] = tl2OCTF; + par[10] = alp2OCTF; + gMC->Gsvolu("SQ26","TRAP",idFrameEpoxy,par,11); + + // EarthFaceCu trapezoid + par[0] = hzVFC; + par[1] = tetVFC; + par[2] = phiVFC; + par[3] = h1VFC; + par[4] = bl1VFC; + par[5] = tl1VFC; + par[6] = alp1VFC; + par[7] = h2VFC; + par[8] = bl2VFC; + par[9] = tl2VFC; + par[10] = alp2VFC; + gMC->Gsvolu("SQ27","TRAP",idCopper,par,11); + + // VertEarthSteel trapezoid + par[0] = hzVES; + par[1] = tetVES; + par[2] = phiVES; + par[3] = h1VES; + par[4] = bl1VES; + par[5] = tl1VES; + par[6] = alp1VES; + par[7] = h2VES; + par[8] = bl2VES; + par[9] = tl2VES; + par[10] = alp2VES; + gMC->Gsvolu("SQ28","TRAP",idInox,par,11); + + // VertEarthProfCu trapezoid + par[0] = hzVPC; + par[1] = tetVPC; + par[2] = phiVPC; + par[3] = h1VPC; + par[4] = bl1VPC; + par[5] = tl1VPC; + par[6] = alp1VPC; + par[7] = h2VPC; + par[8] = bl2VPC; + par[9] = tl2VPC; + par[10] = alp2VPC; + gMC->Gsvolu("SQ29","TRAP",idCopper,par,11); + + // SuppLateralPositionner cuboid + par[0] = hxSLP; + par[1] = hySLP; + par[2] = hzSLP; + gMC->Gsvolu("SQ30","BOX",idAlu,par,3); + + // LateralPositionerFace + par[0] = hxLPF; + par[1] = hyLPF; + par[2] = hzLPF; + gMC->Gsvolu("SQ31","BOX",idInox,par,3); + + // LateralPositionerProfile + par[0] = hxLPP; + par[1] = hyLPP; + par[2] = hzLPP; + gMC->Gsvolu("SQ32","BOX",idInox,par,3); // middle layer + + par[0] = hxLPP; + par[1] = hyLPP; + par[2] = hzLPNF; + gMC->Gsvolu("SQ33","BOX",idInox,par,3); // near and far layers + + // VertCradleA - 1st trapezoid + par[0] = hzVC1; + par[1] = tetVC1; + par[2] = phiVC1; + par[3] = h1VC1; + par[4] = bl1VC1; + par[5] = tl1VC1; + par[6] = alp1VC1; + par[7] = h2VC1; + par[8] = bl2VC1; + par[9] = tl2VC1; + par[10] = alp2VC1; + gMC->Gsvolu("SQ34","TRAP",idAlu,par,11); + + // VertCradleB - 2nd trapezoid + par[0] = hzVC2; + par[1] = tetVC2; + par[2] = phiVC2; + par[3] = h1VC2; + par[4] = bl1VC2; + par[5] = tl1VC2; + par[6] = alp1VC2; + par[7] = h2VC2; + par[8] = bl2VC2; + par[9] = tl2VC2; + par[10] = alp2VC2; + gMC->Gsvolu("SQ35","TRAP",idAlu,par,11); + + // VertCradleC - 3rd trapezoid + par[0] = hzVC3; + par[1] = tetVC3; + par[2] = phiVC3; + par[3] = h1VC3; + par[4] = bl1VC3; + par[5] = tl1VC3; + par[6] = alp1VC3; + par[7] = h2VC3; + par[8] = bl2VC3; + par[9] = tl2VC3; + par[10] = alp2VC3; + gMC->Gsvolu("SQ36","TRAP",idAlu,par,11); + + // VertCradleD - 4th trapezoid + par[0] = hzVC4; + par[1] = tetVC4; + par[2] = phiVC4; + par[3] = h1VC4; + par[4] = bl1VC4; + par[5] = tl1VC4; + par[6] = alp1VC4; + par[7] = h2VC4; + par[8] = bl2VC4; + par[9] = tl2VC4; + par[10] = alp2VC4; + gMC->Gsvolu("SQ37","TRAP",idAlu,par,11); + + // LateralSightSupport trapezoid + par[0] = hzVSS; + par[1] = tetVSS; + par[2] = phiVSS; + par[3] = h1VSS; + par[4] = bl1VSS; + par[5] = tl1VSS; + par[6] = alp1VSS; + par[7] = h2VSS; + par[8] = bl2VSS; + par[9] = tl2VSS; + par[10] = alp2VSS; + gMC->Gsvolu("SQ38","TRAP",idAlu,par,11); + + // LateralSight + par[0] = VSInRad; + par[1] = VSOutRad; + par[2] = VSLen; + gMC->Gsvolu("SQ39","TUBE",idFrameEpoxy,par,3); + +//--- + // InHFrame + par[0] = hxInHFrame; + par[1] = hyInHFrame; + par[2] = hzInHFrame; + gMC->Gsvolu("SQ40","BOX",idFrameEpoxy,par,3); + + //Flat 7.5mm horizontal section + par[0] = hxH1mm; + par[1] = hyH1mm; + par[2] = hzH1mm; + gMC->Gsvolu("SQ41","BOX",idFrameEpoxy,par,3); + + // InArcFrame + par[0] = IAF; + par[1] = OAF; + par[2] = hzAF; + par[3] = AFphi1; + par[4] = AFphi2; + + gMC->Gsvolu("SQ42","TUBS",idFrameEpoxy,par,5); + +//--- + // ScrewsInFrame - 3 sections in order to avoid overlapping volumes + // Screw Head, in air + par[0] = SCRUHMI; + par[1] = SCRUHMA; + par[2] = SCRUHLE; + + gMC->Gsvolu("SQ43","TUBE",idInox,par,3); -// InVFrame + // Middle part, in the Epoxy + par[0] = SCRUMMI; + par[1] = SCRUMMA; + par[2] = SCRUMLE; + gMC->Gsvolu("SQ44","TUBE",idInox,par,3); + + // Screw nut, in air + par[0] = SCRUNMI; + par[1] = SCRUNMA; + par[2] = SCRUNLE; + gMC->Gsvolu("SQ45","TUBE",idInox,par,3); + } + +// __________________Place volumes in the quadrant ____________ + + // InVFrame posX = hxInVFrame; posY = 2.0*hyInHFrame+2.*hyH1mm+IAF+hyInVFrame; - posZ = 0.; - gMC->Gspos("IVEF",1,QuadrantName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = 0.; + gMC->Gspos("SQ00",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); -// InHFrame - posX = 2.0*hxInVFrame+2.*hxV1mm+IAF+hxInHFrame; - posY = hyInHFrame; - posZ = 0.; - gMC->Gspos("IHEF",1,QuadrantName(chamber),posX, posY, posZ, 0, "ONLY"); + //Flat 7.5mm vertical section + posX = 2.0*hxInVFrame+hxV1mm; + posY = 2.0*hyInHFrame+2.*hyH1mm+IAF+hyV1mm; + posZ = 0.; + gMC->Gspos("SQ01",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); + + // TopFrameAnode place 2 layers of TopFrameAnode cuboids + posX = hxTFA; + posY = 2.*hyInHFrame+2.*hyH1mm+IAF+2.*hyInVFrame+hyTFA; + posZ = hzOuterFrameInox; + gMC->Gspos("SQ02",1,QuadrantMLayerName(chamber),posX, posY, posZ,0,"ONLY"); + posZ = posZ+hzOuterFrameInox; + gMC->Gspos("SQ03",1,QuadrantMLayerName(chamber),posX, posY, posZ,0,"ONLY"); + + // place 2 layers of TopFrameAnodeA trapezoids + posX = 35.8932+fgkDeltaQuadLHC; + posY = 92.6745+fgkDeltaQuadLHC; + posZ = hzOuterFrameInox; + gMC->Gspos("SQ04",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + posZ = posZ+hzOuterFrameInox; + gMC->Gspos("SQ05",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + + // place 2 layers of TopFrameAnodeB trapezoids + posX = 44.593+fgkDeltaQuadLHC; + posY = 90.737+fgkDeltaQuadLHC; + posZ = hzOuterFrameInox; + gMC->Gspos("SQ06",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + posZ = posZ+hzOuterFrameInox; + gMC->Gspos("SQ07",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + + // TopAnode1 place 2 layers + posX = 6.8+fgkDeltaQuadLHC; + posY = 99.85+fgkDeltaQuadLHC; + posZ = -1.*hzAnodeFR4; + gMC->Gspos("SQ08",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + posZ = posZ+hzTopAnodeSteel1; + gMC->Gspos("SQ09",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + + // TopAnode2 place 2 layers + posX = 18.534+fgkDeltaQuadLHC; + posY = 99.482+fgkDeltaQuadLHC; + posZ = -1.*hzAnodeFR4; + gMC->Gspos("SQ10",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + posZ = posZ+hzTopAnodeSteel2; + gMC->Gspos("SQ11",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + + // TopAnode3 place 1 layer + posX = 25.80+fgkDeltaQuadLHC; + posY = 98.61+fgkDeltaQuadLHC; + posZ = 0.; + gMC->Gspos("SQ12",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + + // TopEarthFace - 2 copies + posX = 23.122+fgkDeltaQuadLHC; + posY = 96.90+fgkDeltaQuadLHC; + posZ = hzOuterFrameEpoxy+hzOuterFrameInox+hzTopEarthFaceCu; + gMC->Gspos("SQ13",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + posZ = -1.*posZ; + gMC->Gspos("SQ13",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + + // TopEarthProfile + posX = 14.475+fgkDeltaQuadLHC; + posY = 97.900+fgkDeltaQuadLHC; + posZ = hzTopEarthProfileCu; + gMC->Gspos("SQ14",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ14",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + + // TopGasSupport - 2 copies + posX = 4.9500+fgkDeltaQuadLHC; + posY = 96.200+fgkDeltaQuadLHC; + posZ = hzOuterFrameEpoxy+hzOuterFrameInox+hzTopGasSupportAl; + gMC->Gspos("SQ15",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + posZ = -1.*posZ; + gMC->Gspos("SQ15",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + + // TopPositioner parameters - single Stainless Steel trapezoid - 2 copies + posX = 7.60+fgkDeltaQuadLHC; + posY = 98.98+fgkDeltaQuadLHC; + posZ = hzOuterFrameEpoxy+hzOuterFrameInox+2.*hzTopGasSupportAl+hzTopPositionerSteel; + gMC->Gspos("SQ16",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + posZ = -1.*posZ; + gMC->Gspos("SQ16",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + + // OutEdgeFrame + Float_t XCenter[8]; + Float_t YCenter[8]; + + XCenter[0] = 73.201 + fgkDeltaQuadLHC; + XCenter[1] = 78.124 + fgkDeltaQuadLHC; + XCenter[2] = 82.862 + fgkDeltaQuadLHC; + XCenter[3] = 87.418 + fgkDeltaQuadLHC; + + YCenter[0] = 68.122 + fgkDeltaQuadLHC; + YCenter[1] = 62.860 + fgkDeltaQuadLHC; + YCenter[2] = 57.420 + fgkDeltaQuadLHC; + YCenter[3] = 51.800 + fgkDeltaQuadLHC; + + XCenter[4] = 68.122 + fgkDeltaQuadLHC; + XCenter[5] = 62.860 + fgkDeltaQuadLHC; + XCenter[6] = 57.420 + fgkDeltaQuadLHC; + XCenter[7] = 51.800 + fgkDeltaQuadLHC; + + YCenter[4] = 73.210 + fgkDeltaQuadLHC; + YCenter[5] = 78.124 + fgkDeltaQuadLHC; + YCenter[6] = 82.862 + fgkDeltaQuadLHC; + YCenter[7] = 87.418 + fgkDeltaQuadLHC; + + posZ = -1.0*hzOuterFrameInox; + gMC->Gspos("SQ17",1,QuadrantMLayerName(chamber), XCenter[0], YCenter[0], posZ, rot2,"ONLY"); + gMC->Gspos("SQ17",2,QuadrantMLayerName(chamber), XCenter[4], YCenter[4], posZ, rot3,"ONLY"); + + gMC->Gspos("SQ19",1,QuadrantMLayerName(chamber), XCenter[1], YCenter[1], posZ, rot2,"ONLY"); + gMC->Gspos("SQ19",2,QuadrantMLayerName(chamber), XCenter[5], YCenter[5], posZ, rot3,"ONLY"); + + gMC->Gspos("SQ21",1,QuadrantMLayerName(chamber), XCenter[2], YCenter[2], posZ, rot2,"ONLY"); + gMC->Gspos("SQ21",2,QuadrantMLayerName(chamber), XCenter[6], YCenter[6], posZ, rot3,"ONLY"); + + gMC->Gspos("SQ23",1,QuadrantMLayerName(chamber), XCenter[3], YCenter[3], posZ, rot2,"ONLY"); + gMC->Gspos("SQ23",2,QuadrantMLayerName(chamber), XCenter[7], YCenter[7], posZ, rot3,"ONLY"); + + posZ = posZ+hzOuterFrameEpoxy; + + gMC->Gspos("SQ18",1,QuadrantMLayerName(chamber), XCenter[0], YCenter[0], posZ, rot2,"ONLY"); + gMC->Gspos("SQ18",2,QuadrantMLayerName(chamber), XCenter[4], YCenter[4], posZ, rot3,"ONLY"); + gMC->Gspos("SQ20",1,QuadrantMLayerName(chamber), XCenter[1], YCenter[1], posZ, rot2,"ONLY"); + gMC->Gspos("SQ20",2,QuadrantMLayerName(chamber), XCenter[5], YCenter[5], posZ, rot3,"ONLY"); + + gMC->Gspos("SQ22",1,QuadrantMLayerName(chamber), XCenter[2], YCenter[2], posZ, rot2,"ONLY"); + gMC->Gspos("SQ22",2,QuadrantMLayerName(chamber), XCenter[6], YCenter[6], posZ, rot3,"ONLY"); + + gMC->Gspos("SQ24",1,QuadrantMLayerName(chamber), XCenter[3], YCenter[3], posZ, rot2,"ONLY"); + gMC->Gspos("SQ24",2,QuadrantMLayerName(chamber), XCenter[7], YCenter[7], posZ, rot3,"ONLY"); + +//--- + // OutVFrame posX = 2.*hxInVFrame+IAF+2.*hxInHFrame-hxOutVFrame+2.*hxV1mm; posY = 2.*hyInHFrame+hyOutVFrame; posZ = 0.; - gMC->Gspos("OVEF",1,QuadrantName(chamber),posX, posY, posZ, 0, "ONLY"); -// cout << " Outer vertical frame at " << posX << " " << posY << " " -// << posZ << " and half length " << hyOutVFrame << endl; + gMC->Gspos("SQ25",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + const Float_t TOPY = posY+hyOutVFrame; const Float_t OUTX = posX; -//Flat 1mm vertical section - posX = 2.0*hxInVFrame+hxV1mm; - posY = 2.0*hyInHFrame+2.*hyH1mm+IAF+hyV1mm; +// OutVFrame corner + posX = OUTX; + posY = TOPY+((bl1OCTF+tl1OCTF)/2.); + posZ = 0.; + gMC->Gspos("SQ26",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + +// VertEarthFaceCu - 2 copies + posX = 89.4000+fgkDeltaQuadLHC; + posY = 25.79+fgkDeltaQuadLHC; + posZ = hzFrameThickness+2.0*hzFoam+hzVertEarthFaceCu; + gMC->Gspos("SQ27",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ27",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + +// VertEarthSteel - 2 copies + posX = 91.00+fgkDeltaQuadLHC; + posY = 30.616+fgkDeltaQuadLHC; + posZ = hzFrameThickness+2.0*hzFoam+hzVertBarSteel; + gMC->Gspos("SQ28",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ28",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + +// VertEarthProfCu - 2 copies + posX = 92.000+fgkDeltaQuadLHC; + posY = 29.64+fgkDeltaQuadLHC; + posZ = hzFrameThickness; + gMC->Gspos("SQ29",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ29",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + +// SuppLateralPositionner - 2 copies + posX = 90.2-fgkNearFarLHC; + posY = 5.00-fgkNearFarLHC; + posZ = hzLateralPosnAl-fgkMotherThick2; + gMC->Gspos("SQ30",1,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ30",2,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + +// LateralPositionner - 2 copies - Face view + posX = 92.175-fgkNearFarLHC-2.*hxLPP; + posY = 5.00-fgkNearFarLHC; + posZ =2.0*hzLateralPosnAl+hzLateralPosnInoxFace-fgkMotherThick2; + gMC->Gspos("SQ31",1,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ31",2,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + +// LateralPositionner - Profile view + posX = 92.175+fgkDeltaQuadLHC+hxLPF-hxLPP; + posY = 5.00+fgkDeltaQuadLHC; + posZ = 0.; + gMC->Gspos("SQ32",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // middle layer + + posX = 92.175-fgkNearFarLHC+hxLPF-hxLPP; + posY = 5.0000-fgkNearFarLHC; + posZ = fgkMotherThick2-hzLPNF; + gMC->Gspos("SQ33",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // near layer + posZ = -1.*posZ; + gMC->Gspos("SQ33",2,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // far layer + +// VertCradleA 1st Trapezoid - 3 copies + posX = 95.73+fgkDeltaQuadLHC; + posY = 33.26+fgkDeltaQuadLHC; + posZ = 0.; + gMC->Gspos("SQ34",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + + posX = 95.73-fgkNearFarLHC; + posY = 33.26-fgkNearFarLHC; + posZ = 2.0*hzLateralSightAl+hzVerticalCradleAl-fgkMotherThick2; + gMC->Gspos("SQ34",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ34",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + +// VertCradleB 2nd Trapezoid - 3 copies + posX = 97.29+fgkDeltaQuadLHC; + posY = 23.02+fgkDeltaQuadLHC; + posZ = 0.; + gMC->Gspos("SQ35",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + + posX = 97.29-fgkNearFarLHC; + posY = 23.02-fgkNearFarLHC; + posZ = 2.0*hzLateralSightAl+hzVerticalCradleAl-fgkMotherThick2; + gMC->Gspos("SQ35",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ35",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + +// OutVertCradleC 3rd Trapeze - 3 copies + posX = 98.31+fgkDeltaQuadLHC; + posY = 12.77+fgkDeltaQuadLHC; + posZ = 0.; + gMC->Gspos("SQ36",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + + posX = 98.31-fgkNearFarLHC; + posY = 12.77-fgkNearFarLHC; + + posZ = 2.0*hzLateralSightAl+hzVerticalCradleAl-fgkMotherThick2; + gMC->Gspos("SQ36",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ36",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + +// OutVertCradleD 4th Trapeze - 3 copies + posX = 98.81+fgkDeltaQuadLHC; + posY = 2.52+fgkDeltaQuadLHC; + posZ = 0.; + gMC->Gspos("SQ37",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + + posZ = fgkMotherThick1-hzVerticalCradleAl; + gMC->Gspos("SQ37",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ37",3,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + +// LateralSightSupport - 2 copies + posX = 98.53-fgkNearFarLHC; + posY = 10.00-fgkNearFarLHC; + posZ = hzLateralSightAl-fgkMotherThick2; + gMC->Gspos("SQ38",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = -1.0*posZ; + gMC->Gspos("SQ38",2,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + +// Mire placement + posX = 92.84+fgkDeltaQuadLHC; + posY = 8.13+fgkDeltaQuadLHC; posZ = 0.; - gMC->Gspos("FVMM",1,QuadrantName(chamber),posX, posY, posZ,0, "ONLY"); + gMC->Gspos("SQ39",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + +//--- + +// InHFrame + posX = 2.0*hxInVFrame+2.*hxV1mm+IAF+hxInHFrame; + posY = hyInHFrame; + posZ = 0.; + gMC->Gspos("SQ40",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); -// Flat 1mm horizontal section +// Flat 7.5mm horizontal section posX = 2.0*hxInVFrame+2.*hxV1mm+IAF+hxH1mm; posY = 2.0*hyInHFrame+hyH1mm; posZ = 0.; - gMC->Gspos("FHMM",1,QuadrantName(chamber),posX, posY, posZ,0, "ONLY"); + gMC->Gspos("SQ41",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); // InArcFrame posX = 2.0*hxInVFrame+2.*hxV1mm; posY = 2.0*hyInHFrame+2.*hyH1mm; posZ = 0.; - gMC->Gspos("IAF1",1,QuadrantName(chamber),posX, posY, posZ,0, "ONLY"); - - -// ScrewsInFrame + gMC->Gspos("SQ42",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); -// Only place screws that are inside the sensitive volume. +// ScrewsInFrame - in sensitive volume Float_t scruX[64]; Float_t scruY[64]; @@ -1039,22 +1805,22 @@ void AliMUONv2::CreateFrame(Int_t chamber) } // Position the volumes on the frames for (Int_t i = 0;iGspos("SCRH",i+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); - gMC->Gspos("SCRM",i+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY"); - gMC->Gspos("SCRN",i+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ43",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ44",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); + gMC->Gspos("SQ45",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); } // special screw coordinates scruX[63] = 16.3; scruY[63] = -2.23; - posX = BeamOX + scruX[63]; - posY = BeamOY + scruY[63]; + posX = fgkDeltaQuadLHC + scruX[63]; + posY = fgkDeltaQuadLHC + scruY[63]; posZ = 0.; - gMC->Gspos("SCRH",64,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); - gMC->Gspos("SCRM",64,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY"); - gMC->Gspos("SCRN",64,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ43",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ44",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); + gMC->Gspos("SQ45",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); // Screws on the IVEpoxyFrame @@ -1076,12 +1842,12 @@ void AliMUONv2::CreateFrame(Int_t chamber) } for (Int_t i = 0;iGspos("SCRH",i+LastScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); - gMC->Gspos("SCRM",i+LastScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY"); - gMC->Gspos("SCRN",i+LastScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ43",i+LastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ44",i+LastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); + gMC->Gspos("SQ45",i+LastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); } // Screws on the OVEpoxyFrame @@ -1101,12 +1867,12 @@ void AliMUONv2::CreateFrame(Int_t chamber) scruY[i] = scruY[i-1]+offY; } for (Int_t i = 0;iGspos("SCRH",i+FirstScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); - gMC->Gspos("SCRM",i+FirstScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY"); - gMC->Gspos("SCRN",i+FirstScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ43",i+FirstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ44",i+FirstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); + gMC->Gspos("SQ45",i+FirstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); } // Inner Arc of Frame, screw positions and numbers-1 @@ -1117,437 +1883,553 @@ void AliMUONv2::CreateFrame(Int_t chamber) scruX[58] = 1.401 ; scruY[58] = 16.009; for (Int_t i = 0;i<5;i++){ - posX = BeamOX + scruX[i+58]; - posY = BeamOY + scruY[i+58]; + posX = fgkDeltaQuadLHC + scruX[i+58]; + posY = fgkDeltaQuadLHC + scruY[i+58]; posZ = 0.; - gMC->Gspos("SCRH",i+58+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); - gMC->Gspos("SCRM",i+58+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY"); - gMC->Gspos("SCRN",i+58+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); - } - -// OutTopTrapFrame - posX = hxOutHFrame; - posY = 2.*hyInHFrame+IAF+2.*hyInVFrame+hyOutHFrame+2.*hyH1mm; - posZ = 0.; + gMC->Gspos("SQ43",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ44",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ, 0, "ONLY"); + gMC->Gspos("SQ45",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY"); + } +} -// place 3 layers of cuboids - posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox); - gMC->Gspos("OHEA",1,QuadrantName(chamber),posX, posY, posZ,0,"ONLY"); - posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder; - gMC->Gspos("OHSA",1,QuadrantName(chamber),posX, posY, posZ,0,"ONLY"); - posZ = posZ+hzOuterFrameSolder+hzOuterFrameInox; - gMC->Gspos("OHIA",1,QuadrantName(chamber),posX, posY, posZ,0,"ONLY"); - -// place 3 layers of trapezoid A - posX = 34.1663+2.6; - posY = 92.2946+2.6; - posZ = 0.; - - posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox); - gMC->Gspos("OHEB",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY"); - posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder; - gMC->Gspos("OHSB",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY"); - posZ = posZ+hzOuterFrameSolder+hzOuterFrameInox; - gMC->Gspos("OHIB",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY"); - -// place 3 layers of trapezoid B - posX = 43.8379+2.6; - posY = 90.1946+2.6; - posZ = 0.; - - posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox); - gMC->Gspos("OHEC",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY"); - posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder; - gMC->Gspos("OHSC",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY"); - posZ = posZ+hzOuterFrameSolder+hzOuterFrameInox; - gMC->Gspos("OHIC",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY"); - -/////////////////////////////////////////////////// - -// OutEdgeTrapFrame - - const Float_t refY = 70.13685; - const Float_t refX = 71.43685; - - posX = refX; - posY = refY; - posZ = 0.; - - Float_t XCenter[8]; - Float_t YCenter[8]; - - XCenter[0] = 72.7099 + 2.6; - XCenter[1] = 77.5787 + 2.6; - XCenter[2] = 82.2732 + 2.6; - XCenter[3] = 86.7882 + 2.6; - - YCenter[0] = 67.6691 + 2.6; - YCenter[1] = 62.4564 + 2.6; - YCenter[2] = 57.0693 + 2.6; - YCenter[3] = 51.5027 + 2.6; - - XCenter[4] = 67.6691 + 2.6; - XCenter[5] = 62.4564 + 2.6; - XCenter[6] = 57.0693 + 2.6; - XCenter[7] = 51.5027 + 2.6; - - YCenter[4] = 72.7099 + 2.6; - YCenter[5] = 77.5787 + 2.6; - YCenter[6] = 82.2732 + 2.6; - YCenter[7] = 86.7882 + 2.6; - - posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox); - gMC->Gspos("EDE1",1,QuadrantName(chamber), XCenter[0], YCenter[0], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDE1",2,QuadrantName(chamber), XCenter[4], YCenter[4],posZ, idrotm[1105],"ONLY"); +//______________________________________________________________________________ +void AliMUONv2::PlaceInnerLayers(Int_t chamber) +{ +// Place the gas and copper layers for the specified chamber. +// -- +// Rotation Matrices + Int_t rot1, rot2, rot3, rot4; - gMC->Gspos("EDE2",1,QuadrantName(chamber), XCenter[1], YCenter[1], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDE2",2,QuadrantName(chamber), XCenter[5], YCenter[5], posZ, idrotm[1105],"ONLY"); + AliMatrix(rot1, 90., 315., 90., 45., 0., 0.); // -45 deg + AliMatrix(rot2, 90., 90., 90., 180., 0., 0.); // 90 deg + AliMatrix(rot3, 90., 270., 90., 0., 0., 0.); // -90 deg + AliMatrix(rot4, 90., 45., 90., 135., 0., 0.); // deg - gMC->Gspos("EDE3",1,QuadrantName(chamber), XCenter[2], YCenter[2], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDE3",2,QuadrantName(chamber), XCenter[6], YCenter[6], posZ, idrotm[1105],"ONLY"); - - - gMC->Gspos("EDE4",1,QuadrantName(chamber), XCenter[3], YCenter[3], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDE4",2,QuadrantName(chamber), XCenter[7], YCenter[7], posZ, idrotm[1105],"ONLY"); + GReal_t x; + GReal_t y; + GReal_t zg = 0.; + GReal_t zc = fgkHzGas + fgkHzPadPlane; + Int_t dpos = (chamber-1)*2; + TString name; + + x = 14.53 + fgkDeltaQuadLHC; + y = 53.34 + fgkDeltaQuadLHC; + name = GasVolumeName("SAG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY"); + gMC->Gspos("SA1C", 1+dpos, QuadrantMLayerName(chamber),x,y, zc,0,"ONLY"); + gMC->Gspos("SA1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY"); + + x = 40.67 + fgkDeltaQuadLHC; + y = 40.66 + fgkDeltaQuadLHC; + name = GasVolumeName("SBG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot1,"ONLY"); + gMC->Gspos("SB1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot1,"ONLY"); + gMC->Gspos("SB1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,rot1,"ONLY"); + + x = 53.34 + fgkDeltaQuadLHC; + y = 14.52 + fgkDeltaQuadLHC; + name = GasVolumeName("SCG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot2,"ONLY"); + gMC->Gspos("SC1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot2,"ONLY"); + gMC->Gspos("SC1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot2,"ONLY"); + + x = 5.83 + fgkDeltaQuadLHC; + y = 17.29 + fgkDeltaQuadLHC; + name = GasVolumeName("SDG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot3,"ONLY"); + gMC->Gspos("SD1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot3,"ONLY"); + gMC->Gspos("SD1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot3,"ONLY"); + + x = 9.04 + fgkDeltaQuadLHC; + y = 16.91 + fgkDeltaQuadLHC; + name = GasVolumeName("SEG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY"); + gMC->Gspos("SE1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,0,"ONLY"); + gMC->Gspos("SE1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY"); + + x = 10.12 + fgkDeltaQuadLHC; + y = 14.67 + fgkDeltaQuadLHC; + name = GasVolumeName("SFG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); + gMC->Gspos("SF1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); + gMC->Gspos("SF1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); + + x = 8.2042 + fgkDeltaQuadLHC; + y = 16.19 + fgkDeltaQuadLHC; + name = GasVolumeName("SGG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); + gMC->Gspos("SG1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); + gMC->Gspos("SG1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); + + x = 14.68 + fgkDeltaQuadLHC; + y = 10.10 + fgkDeltaQuadLHC; + name = GasVolumeName("SHG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); + gMC->Gspos("SH1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); + gMC->Gspos("SH1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); + + x = 16.21 + fgkDeltaQuadLHC; + y = 8.17 + fgkDeltaQuadLHC; + name = GasVolumeName("SIG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); + gMC->Gspos("SI1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); + gMC->Gspos("SI1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); + + x = 16.92 + fgkDeltaQuadLHC; + y = 9.02 + fgkDeltaQuadLHC; + name = GasVolumeName("SJG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot3,"ONLY"); + gMC->Gspos("SJ1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot3,"ONLY"); + gMC->Gspos("SJ1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot3,"ONLY"); + + x = 17.30 + fgkDeltaQuadLHC; + y = 5.85 + fgkDeltaQuadLHC; + name = GasVolumeName("SKG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY"); + gMC->Gspos("SK1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,0,"ONLY"); + gMC->Gspos("SK1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY"); +} +//______________________________________________________________________________ +void AliMUONv2::PlaceSector(AliMpSector* sector,TSpecialMap specialMap, + const TVector3& where, Bool_t reflectZ, Int_t chamber) +{ +// Place all the segments in the mother volume, at the position defined +// by the sector's data. +// -- - - posZ = posZ+hzOuterFrameEpoxy+hzOuterFrameInox; - - gMC->Gspos("EDI1",1,QuadrantName(chamber), XCenter[0], YCenter[0], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDI1",2,QuadrantName(chamber), XCenter[4], YCenter[4], posZ, idrotm[1105],"ONLY"); - - gMC->Gspos("EDI2",1,QuadrantName(chamber), XCenter[1], YCenter[1], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDI2",2,QuadrantName(chamber), XCenter[5], YCenter[5], posZ, idrotm[1105],"ONLY"); + static Int_t segNum=1; + Int_t sgn; + Int_t reflZ; + Int_t rotMat; + + if (!reflectZ) { + sgn= 1; + reflZ=0; // no reflection along z... nothing + AliMatrix(rotMat, 90.,90.,90,180.,0.,0.); // 90° rotation around z, NO reflection along z + } else { + sgn=-1; + AliMatrix(reflZ, 90.,0.,90,90.,180.,0.); // reflection along z + AliMatrix(rotMat, 90.,90.,90,180.,180.,0.); // 90° rotation around z AND reflection along z + } + + GReal_t posX,posY,posZ; + + IntVector already_done; + for (Int_t irow=0;irowGetNofRows();irow++){ // for each row + AliMpRow* row = sector->GetRow(irow); - gMC->Gspos("EDI3",1,QuadrantName(chamber), XCenter[2], YCenter[2], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDI3",2,QuadrantName(chamber), XCenter[6], YCenter[6], posZ, idrotm[1105],"ONLY"); - - gMC->Gspos("EDI4",1,QuadrantName(chamber), XCenter[3], YCenter[3], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDI4",2,QuadrantName(chamber), XCenter[7], YCenter[7], posZ, idrotm[1105],"ONLY"); - - posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder; - - gMC->Gspos("EDS1",1,QuadrantName(chamber), XCenter[0], YCenter[0], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDS1",2,QuadrantName(chamber), XCenter[4], YCenter[4], posZ, idrotm[1105],"ONLY"); - - gMC->Gspos("EDS2",1,QuadrantName(chamber), XCenter[1], YCenter[1], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDS2",2,QuadrantName(chamber), XCenter[5], YCenter[5], posZ, idrotm[1105],"ONLY"); + for (Int_t iseg=0;isegGetNofRowSegments();iseg++){ // for each row segment + AliMpVRowSegment* seg = row->GetRowSegment(iseg); + char segName[5]; + + TSpecialMap::iterator iter + = specialMap.find(seg->GetMotifPositionId(0)); - gMC->Gspos("EDS3",1,QuadrantName(chamber), XCenter[2], YCenter[2], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDS3",2,QuadrantName(chamber), XCenter[6], YCenter[6], posZ, idrotm[1105],"ONLY"); - - gMC->Gspos("EDS4",1,QuadrantName(chamber), XCenter[3], YCenter[3], posZ, idrotm[1104],"ONLY"); - gMC->Gspos("EDS4",2,QuadrantName(chamber), XCenter[7], YCenter[7], posZ, idrotm[1105],"ONLY"); - + if ( iter == specialMap.end()){ //if this is a normal segment (ie. not part of ) + + // create the cathode part + sprintf(segName,"%.3dM", segNum); + CreatePlaneSegment(segName, seg->Dimensions()/10., seg->GetNofMotifs()); -// OutCornerTrapFrame - posX = OUTX; - posY = TOPY+((bl1OCTF+tl1OCTF)/2.); - posZ = 0.; - gMC->Gspos("TCOR",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY"); - -// Mire placement - posX = OUTX+hxOutVFrame+1.3; - posY = 8.13+2.6; - posZ = 0.; - gMC->Gspos("MIRE",1,QuadrantName(chamber),posX, posY, posZ, 0,"ONLY"); - -} + posX = where.X() + seg->Position().X()/10.; + posY = where.Y() + seg->Position().Y()/10.; + posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane); + gMC->Gspos(segName, 1, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY"); + + // and place all the daughter boards of this segment + for (Int_t motifNum=0;motifNumGetNofMotifs();motifNum++) { + Int_t motifPosId = seg->GetMotifPositionId(motifNum); + AliMpMotifPosition* motifPos = + sector->GetMotifMap()->FindMotifPosition(motifPosId); + + 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"); + } + segNum++; + + } else { + + // if this is a special segment + for (Int_t motifNum=0;motifNumGetNofMotifs();motifNum++) {// for each motif + + Int_t motifPosId = seg->GetMotifPositionId(motifNum); + + if (find(already_done.begin(),already_done.end(),motifPosId) + != already_done.end()) continue; // don't treat the same motif twice + + AliMUONSt1SpecialMotif spMot = specialMap[motifPosId]; + AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId); + + // 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"); + + // 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"); + + already_done.push_back(motifPosId);// mark this motif as done + } + }// end of special motif case + } + } +} -//___________________________________________ -void AliMUONv2::CreateHole() +//______________________________________________________________________________ +TString AliMUONv2::GasVolumeName(const TString& name, Int_t chamber) const { -// Create all the element inside a foam hole -// -- - Int_t* idtmed = fIdtmed->GetArray()-1099; - Int_t idAir = idtmed[1100]; // medium 1 - Int_t idCopper = idtmed[1109]; // medium 10 = copper +// Inserts the chamber number into the name. +// --- - GReal_t par[3]; - GReal_t posX,posY,posZ; - - par[0] = fgkHxHole; - par[1] = fgkHyHole; - par[2] = fgkHzFoam; - gMC->Gsvolu(fgkHoleName,"BOX",idAir,par,3); - - par[0] = fgkHxKapton; - par[1] = fgkHyKapton; - par[2] = fgkHzSnPb; - gMC->Gsvolu("SNPB", "BOX", idCopper, par, 3); - posX = 0.; - posY = 0.; - posZ = -fgkHzFoam+fgkHzSnPb; - gMC->Gspos("SNPB",1,fgkHoleName, posX, posY, posZ, 0,"ONLY"); + TString newString(name); + + TString number(""); + number += chamber; - par[0] = fgkHxHole; - par[1] = fgkHyBergPlastic; - par[2] = fgkHzKapton; - gMC->Gsvolu("KAPT", "BOX", idCopper, par, 3); - posX = 0.; - posY = 0.; - posZ = 0.; - gMC->Gspos("KAPT",1,fgkHoleName, posX, posY, posZ, 0,"ONLY"); + newString.Insert(2, number); + + return newString; } -//___________________________________________ -void AliMUONv2::CreateDaughterBoard() +//______________________________________________________________________________ +Bool_t AliMUONv2::IsInChamber(Int_t ich, Int_t volGid) const { -// Create all the elements in a daughter board -// -- - Int_t* idtmed = fIdtmed->GetArray()-1099; - Int_t idAir = idtmed[1100]; // medium 1 - Int_t idCopper = idtmed[1109]; // medium 10 = copper - Int_t idPlastic =idtmed[1116]; // medium 17 = Plastic +// True if volume is part of the sensitive +// volumes of chamber +// --- + for (Int_t i = 0; i < fChamberV2[ich]->GetSize(); i++) { + if (fChamberV2[ich]->At(i) == volGid) return kTRUE; + } + return kFALSE; +} - GReal_t par[3]; - GReal_t posX,posY,posZ; +// +// protected methods +// - par[0]=fgkHxDaughter; - par[1]=fgkHyDaughter; - par[2]=totalHzDaughter(); - gMC->Gsvolu(fgkDaughterName,"BOX",idAir,par,3); - - par[0]=fgkHxBergPlastic; - par[1]=fgkHyBergPlastic; - par[2]=fgkHzBergPlastic; - gMC->Gsvolu("BRGP","BOX",idPlastic,par,3); - posX=0.; - posY=0.; - posZ = -totalHzDaughter() + fgkHzBergPlastic; - gMC->Gspos("BRGP",1,fgkDaughterName,posX,posY,posZ,0,"ONLY"); +//______________________________________________________________________________ +Int_t AliMUONv2::GetChamberId(Int_t volId) const +{ +// Check if the volume with specified volId is a sensitive volume (gas) +// of some chamber and returns the chamber number; +// if not sensitive volume - return 0. +// --- - par[0]=fgkHxBergCopper; - par[1]=fgkHyBergCopper; - par[2]=fgkHzBergCopper; - gMC->Gsvolu("BRGC","BOX",idCopper,par,3); - posX=0.; - posY=0.; - posZ=0.; - gMC->Gspos("BRGC",1,"BRGC",posX,posY,posZ,0,"ONLY"); + for (Int_t i = 1; i <=2; i++) + if (IsInChamber(i-1,volId)) return i; + + for (Int_t i = 3; i <= AliMUONConstants::NCh(); i++) + if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i; - par[0]=fgkHxDaughter; - par[1]=fgkHyDaughter; - par[2]=fgkHzDaughter; - gMC->Gsvolu("DGHT","BOX",idCopper,par,3); - posX=0.; - posY=0.; - posZ = -totalHzDaughter() + 2.*fgkHzBergPlastic + fgkHzDaughter; - gMC->Gspos("DGHT",1,fgkDaughterName,posX,posY,posZ,0,"ONLY"); + return 0; } -//___________________________________________ -void AliMUONv2::CreatePlaneBox(const char* name,const TVector2& dimensions) -{ -// create all the elements in the copper plane -// -- - Int_t* idtmed = fIdtmed->GetArray()-1099; - Int_t idAir = idtmed[1100]; // medium 1 - Int_t idCopper = idtmed[1109]; // medium 10 = copper - Int_t idFoam = idtmed[1115]; // medium 16 = Foam - Int_t idFR4 =idtmed[1114]; // medium 15 = FR4 - - GReal_t par[3]; - GReal_t posX,posY,posZ; +// +// public methods +// - // mother volume - par[0] = dimensions.X(); - par[1] = dimensions.Y(); - par[2] = totalHzPlane(); - gMC->Gsvolu(name,"BOX",idAir,par,3); +//______________________________________________________________________________ +void AliMUONv2::CreateMaterials() +{ +// --- Define the various mixtures for GEANT --- - // pad plane - char* planeName = strdup(name); - planeName[3]='P'; - par[0] = dimensions.X(); - par[1] = dimensions.Y(); - par[2] = fgkHzPadPlane; - gMC->Gsvolu(planeName,"BOX",idCopper,par,3); - posX=0.; - posY=0.; - posZ = -totalHzPlane()+fgkHzPadPlane; - gMC->Gspos(planeName,1,name,posX,posY,posZ,0,"ONLY"); + // Ar-CO2 gas (80%+20%) + Float_t ag1[2] = { 39.95,44.01}; + Float_t zg1[2] = { 18.,22.}; + Float_t dg1 = .001821; + Float_t wg1[2] = { .8,0.2}; + // use wg1 weighting factors (6th arg > 0) + AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 2, wg1); - //foam layer - char* foamName = strdup(name); - foamName[3]=fgkFoamLayerSuffix; - par[0] = dimensions.X(); - par[1] = dimensions.Y(); - par[2] = fgkHzFoam; - gMC->Gsvolu(foamName,"BOX",idFoam,par,3); - posX=0.; - posY=0.; - posZ = -totalHzPlane()+2.*fgkHzPadPlane+fgkHzFoam; - gMC->Gspos(foamName,1,name,posX,posY,posZ,0,"ONLY"); + // Ar-buthane-freon gas -- trigger chambers + Float_t atr1[4] = { 39.95,12.01,1.01,19. }; + Float_t ztr1[4] = { 18.,6.,1.,9. }; + Float_t wtr1[4] = { .56,.1262857,.2857143,.028 }; + Float_t dtr1 = .002599; + AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1); - // mechanical plane FR4 layer - char* fr4Name = strdup(name); - fr4Name[3]='R'; - par[0] = dimensions.X(); - par[1] = dimensions.Y(); - par[2] = fgkHzFR4; - gMC->Gsvolu(fr4Name,"BOX",idFR4,par,3); - posX=0.; - posY=0.; - posZ = -totalHzPlane()+2.*fgkHzPadPlane+2.*fgkHzFoam+fgkHzFR4; - gMC->Gspos(fr4Name,1,name,posX,posY,posZ,0,"ONLY"); -} + // Rohacell 51 - imide methacrylique + Float_t aRohacell51[4] = {12.01,1.01,16.00,14.01}; + Float_t zRohacell51[4] = {6.,1.,8.,7.}; + Float_t dRohacell51 = 0.052; + Float_t wRohacell51[4] = {9.,13.,2.,1.}; + // use relative A (molecular) values (6th arg < 0) + AliMixture(32, "FOAM$",aRohacell51,zRohacell51,dRohacell51,-4,wRohacell51); + + Float_t aSnPb[2] = {118.69,207.19}; + Float_t zSnPb[2] = {50,82}; + Float_t dSnPb = 8.926; + Float_t wSnPb[2] = {0.6, 0.4} ; + // use wSnPb weighting factors (6th arg > 0) + AliMixture(35, "SnPb$", aSnPb,zSnPb,dSnPb,2,wSnPb); -//___________________________________________ -void AliMUONv2::CreatePlaneSegment(const char* name,const TVector2& dimensions - ,Int_t nofHoles) -{ -// Create a segment of a plane (this includes a copper layer, foam, hole, -// and kapton as well as the mother board.) -// -- - static Int_t holeNum=1; - - GReal_t posX,posY,posZ; + // plastic definition from K5, Freiburg (found on web) + Float_t aPlastic[2]={1.01,12.01}; + Float_t zPlastic[2]={1,6}; + Float_t denPlastic=1.107; + Float_t wPlastic[2]={1,1}; + // use relative A (molecular) values (6th arg < 0)...no other info... + AliMixture( 33, "Plastic$",aPlastic,zPlastic,denPlastic,-2,wPlastic); + + // from CERN note NUFACT Note023, Oct.2000 + // Inox/Stainless Steel (18%Cr, 9%Ni) + Float_t aInox[3] = {55.847,51.9961,58.6934}; + Float_t zInox[3] = {26.,24.,28.}; + Float_t denInox = 7.930; + Float_t wInox[3] = {0.73,0.18,0.09}; + // use wInox weighting factors (6th arg > 0) + AliMixture(37, "StainlessSteel$",aInox,zInox,denInox,3,wInox); + + // bakelite + Float_t abak[3] = {12.01 , 1.01 , 16.}; + Float_t zbak[3] = {6. , 1. , 8.}; + Float_t wbak[3] = {6. , 6. , 1.}; + Float_t dbak = 1.4; + AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak); - CreatePlaneBox(name,dimensions); - char holeName[5]; - strcpy(holeName,name); - holeName[3]=fgkFoamLayerSuffix; - // is a motif on the pad plane - char* dname = strdup(name); - dname[3]='D'; - gMC->Gsdvn(dname,holeName,nofHoles,1); + // Ar-Isobutane gas (80%+20%) + Float_t ag[3] = { 39.95,12.01,1.01 }; + Float_t zg[3] = { 18.,6.,1. }; + Float_t wg[3] = { .8,.057,.143 }; + Float_t dg = .0019596; + AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg); + + // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger + Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 }; + Float_t ztrig[5] = { 18.,6.,1.,9.,16. }; + Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 }; + Float_t dtrig = .0031463; + AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig); + +// --- Define the various AliMaterials for GEANT --- + // from PDG and "The Particle Detector BriefBook", Bock and Vasilescu, P.18 + AliMaterial( 9, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1); + AliMaterial(10, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1); + AliMaterial(15, "air$", 14.61, 7.3, .001205, -30423.24, 67500); + AliMaterial(30, "Copper$", 63.546,29.,8.96,-1.43,9.6); + AliMaterial(31, "FR4$", 17.749, 8.875, 1.7, -19.4, 999.); // from DPG + AliMaterial(34, "Kapton$", 12.01,6,1.42,-28.6,999); // from DPG + // Density of FrameEpoxy only from manufacturer's specifications + // Frame composite epoxy , X0 in g/cm**2 (guestimation!) + AliMaterial(36, "FrameEpoxy",12.24,6.0,1.85,-19.14,999);// use 16.75cm - posX=0.; - posY=0.; - posZ= fgkHzPadPlane; - gMC->Gspos(fgkHoleName,holeNum++,dname,posX,posY,posZ,0,"ONLY"); +// --- Define the tracking medias (AliMediums) for GEANT --- + GReal_t epsil = .001; // Tracking precision, + GReal_t stemax = -1.; // Maximum displacement for multiple scat + GReal_t tmaxfd = -20.; // Maximum angle due to field deflection + GReal_t deemax = -.3; // Maximum fractional energy loss, DLS + GReal_t stmin = -.8; + GReal_t maxStepAlu = 0.001; // from AliMUON.cxx + GReal_t maxDestepAlu = -1.; // from AliMUON.cxx + GReal_t maxStepGas=0.01; // from AliMUON.cxx + + Int_t iSXFLD = gAlice->Field()->Integ(); + Float_t sXMGMX = gAlice->Field()->Max(); + + AliMedium(1, "AIR_CH_US$", 15, 1, iSXFLD, sXMGMX, tmaxfd, + stemax, deemax, epsil, stmin); + AliMedium(4, "ALU_CH_US$", 9, 0, iSXFLD, sXMGMX, tmaxfd, + maxStepAlu, maxDestepAlu, epsil, stmin); + AliMedium(5, "ALU_CH_US$", 10, 0, iSXFLD, sXMGMX, tmaxfd, + maxStepAlu,maxDestepAlu, epsil, stmin); + AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, + tmaxfd, fMaxStepGas,fMaxDestepGas, epsil, stmin); + + // Ar-Isobuthane-Forane-SF6 gas + AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, + tmaxfd, stemax, deemax, epsil, stmin); + AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, + tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin); + + AliMedium(9, "ArCO2 80%$", 22, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas, + maxDestepAlu, epsil, stmin); + AliMedium(10, "COPPER_CH$", 30, 0, iSXFLD, sXMGMX, tmaxfd, + maxStepAlu, maxDestepAlu, epsil, stmin); + AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd, + fMaxStepAlu, fMaxDestepAlu, epsil, stmin); + AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd, + fMaxStepAlu, fMaxDestepAlu, epsil, stmin); + AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd, + fMaxStepAlu, fMaxDestepAlu, epsil, stmin); + AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd, + fMaxStepAlu, fMaxDestepAlu, epsil, stmin); + AliMedium(15, "FR4_CH$", 31, 0,iSXFLD, sXMGMX, 10., .01,.1, .003, .003); + AliMedium(16, "FOAM_CH$", 32, 0, + iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ; + AliMedium(17, "Plastic$", 33, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); + AliMedium(18, "Kapton$", 34, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); + AliMedium(19, "SnPb$", 35, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); + AliMedium(20, "FrameCH$", 36, 1,iSXFLD, sXMGMX, 10., .001, 0.001, .001, .001); + AliMedium(21, "InoxBolts$", 37,1,iSXFLD, sXMGMX, 10., .01, 1., .003, .003); + +// store the parameters + Float_t a, z, dens, absl; + char matName[5]; + AliGetMaterial(30,matName,a,z,dens,fRadlCopper,absl); + AliGetMaterial(31,matName,a,z,dens,fRadlFR4,absl); + AliGetMaterial(32,matName,a,z,dens,fRadlFoam,absl); } -//___________________________________________ -void AliMUONv2::CreateDaughterSegment(const char* name,const TVector2& dimensions, - Int_t nofHoles) +//______________________________________________________________________________ +void AliMUONv2::CreateGeometry() { -// Create a segment of a daughter board layer +// Create the GEANT geometry for the dimuon arm. +// Use the parent's method for stations 2, 3, 4 and 5. +// Use the detailed code for the first station. // -- - static Int_t holeNum=1; - Int_t* idtmed = fIdtmed->GetArray()-1099; - Int_t idAir = idtmed[1100]; // medium 1 + cout << "AliMUONv2::CreateGeometry()" << endl; + cout << "_________________________________________" << endl; - GReal_t par[3]; - GReal_t posX,posY,posZ; + // Create basic volumes + // + CreateHole(); + CreateDaughterBoard(); + CreateInnerLayers(); - par[0] = dimensions.X(); - par[1] = dimensions.Y(); - par[2] = totalHzDaughter(); - gMC->Gsvolu(name,"BOX",idAir,par,3); + // Create reflexion matrices + // + Int_t reflXZ, reflYZ, reflXY; + AliMatrix(reflXZ, 90., 180., 90., 90., 180., 0.); + AliMatrix(reflYZ, 90., 0., 90.,-90., 180., 0.); + AliMatrix(reflXY, 90., 180., 90., 270., 0., 0.); + + // Define transformations for each quadrant + // + // II. | I. + // _____ | ____ + // | + // III. | IV. + // + Int_t rotm[4]; + rotm[0]=0; // quadrant I + rotm[1]=reflXZ; // quadrant II + rotm[2]=reflXY; // quadrant III + rotm[3]=reflYZ; // quadrant IV - // is a motif on pad plane - char* dname = strdup(name); - dname[3]='D'; - gMC->Gsdvn(dname,name,nofHoles,1); + TVector3 scale[4]; + scale[0] = TVector3( 1, 1, 1); // quadrant I + scale[1] = TVector3(-1, 1, -1); // quadrant II + scale[2] = TVector3(-1, -1, 1); // quadrant III + scale[3] = TVector3( 1, -1, -1); // quadrant IV - posX=0.; - posY=0.; - posZ=0.; - gMC->Gspos(fgkDaughterName,holeNum++,dname,posX,posY,posZ,0,"ONLY"); + // Shift in Z of the middle layer + Double_t deltaZ = 6.5/2.; + + // Position of quadrant I wrt to the chamber position + TVector3 pos0(-fgkDeltaQuadLHC, -fgkDeltaQuadLHC, deltaZ); + + // Shift for near/far layers + GReal_t shiftXY = fgkFrameOffset; + GReal_t shiftZ = fgkMotherThick1+fgkMotherThick2; + + // Build two chambers + // + for (Int_t ich=1; ich<3; ich++) { + + // Create quadrant volume + CreateQuadrant(ich); + + // Place gas volumes + PlaceInnerLayers(ich); + + // Place the quadrant + for (Int_t i=0; i<4; i++) { + + // Middle layer + GReal_t posx = pos0.X() * scale[i].X(); + GReal_t posy = pos0.Y() * scale[i].Y(); + GReal_t posz = pos0.Z() * scale[i].Z() + AliMUONConstants::DefaultChamberZ(ich-1); + gMC->Gspos(QuadrantMLayerName(ich), i+1, "ALIC", posx, posy, posz, rotm[i], "ONLY"); + + // Near/far layers + Real_t posx2 = posx + shiftXY * scale[i].X(); + Real_t posy2 = posy + shiftXY * scale[i].Y(); + Real_t posz2 = posz - scale[i].Z()*shiftZ; + gMC->Gspos(QuadrantNLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY"); + + posz2 = posz + scale[i].Z()*shiftZ; + gMC->Gspos(QuadrantFLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY"); + } + } + + static Int_t stations[5]={0,1,1,1,1}; + fStations=stations; + AliMUONv1::CreateGeometry(); } -//___________________________________________ -void AliMUONv2::PlaceSector(MSector* sector,TSpecialMap specialMap - ,const TVector3& where,Int_t chamber) +//______________________________________________________________________________ +void AliMUONv2::Init() { -// Place all the segments in the mother volume, in the position defined -// by the sector's data. -// -- - static Int_t segNum=1; - - GReal_t posX,posY,posZ; - - vector already_done; - Int_t rotNum; - AliMatrix(rotNum, 90.,90.,90,180.,0.,0.); - - for (Int_t irow=0;irowGetNofRows();irow++){ - MRow* row = sector->GetRow(irow); - for (Int_t iseg=0;isegGetNofRowSegments();iseg++){ - MVRowSegment* seg = row->GetRowSegment(iseg); - char* segName; - - TSpecialMap::iterator iter - = specialMap.find(seg->GetMotifPositionId(0)); - if ( iter == specialMap.end()){ - segName = strdup(Form("%.3dM",segNum*2)); - CreatePlaneSegment(segName,seg->Dimensions()/10.,seg->GetNofMotifs()); - posX = where.X()+seg->Position().X()/10.-fgkOffsetX/2.; - posY = where.Y()+seg->Position().Y()/10.-fgkOffsetY/2.; - posZ = where.Z()-totalHz()+totalHzPlane(); - gMC->Gspos(segName,1,QuadrantName(chamber),posX,posY,posZ,0,"ONLY"); - - segName = strdup(Form("%.3dM",segNum*2+1)); - CreateDaughterSegment(segName,seg->Dimensions()/10.,seg->GetNofMotifs()); - posX = where.X()+seg->Position().X()/10.+fgkOffsetX/2.; - posY = where.Y()+seg->Position().Y()/10.-+fgkOffsetY/2.; - posZ = where.Z()-totalHz()+2.*totalHzPlane()+totalHzDaughter(); - gMC->Gspos(segName,1,QuadrantName(chamber),posX,posY,posZ,0,"ONLY"); - segNum++; - } else { - for (Int_t motifNum=0;motifNumGetNofMotifs();motifNum++) { - Int_t motifPosId = seg->GetMotifPositionId(motifNum); - - if (find(already_done.begin(),already_done.end(),motifPosId) - != already_done.end()) continue; - - AliMUONSt1SpecialMotif spMot = specialMap[motifPosId]; - - MMotifPosition* motifPos = - sector->GetMotifMap()->FindMotifPosition(motifPosId); - MMotifType* mType = motifPos->GetMotif()->GetMotifType(); - for (Int_t line=0;lineGetNofPadsY();line++) { - Int_t iMin=-1,iMax=-1,col; - for (col=0;colGetNofPadsX();col++) { - if (mType->HasPad(MIntPair(col,line))) { - iMin=col; - break; - } - } - for (col=mType->GetNofPadsX()-1;col>=0;col--) { - if (mType->HasPad(MIntPair(col,line))) { - iMax=col; - break; - } - } - if ( (iMin>=0) && (iMax>=0) ) { - TVector2 dim = - motifPos->GetMotif()->GetPadDimensions(MIntPair(iMin,line))/10.; - TVector2 lineDim(dim.X()*(iMax-iMin+1),dim.Y()); - char* boxName = strdup(Form("%.3dM",segNum*2)); - CreatePlaneBox(boxName,lineDim); - TVector2 posLLline = TVector2(dim.X()*2.*iMin,dim.Y()*2.*line) - +motifPos->Position()/10.-motifPos->Dimensions()/10.; - TVector2 centerLine = posLLline + lineDim; - posX = where.X()+centerLine.X()-fgkOffsetX/2.; - posY = where.Y()+centerLine.Y()-fgkOffsetY/2.; - posZ = where.Z()-totalHz()+totalHzPlane(); - gMC->Gspos(boxName,1,QuadrantName(chamber),posX,posY,posZ,0,"ONLY"); - } - - segNum++; - } - - Int_t rot = ( spMot.GetRotAngle()<0.1 ) ? 0:rotNum; - - posX = where.X()+motifPos->Position().X()/10.-fgkOffsetX/2.+spMot.GetDelta().X(); - posY = where.Y()+motifPos->Position().Y()/10.-fgkOffsetY/2.+spMot.GetDelta().Y(); - posZ = where.Z()-fgkHzPadPlane; - gMC->Gspos(fgkHoleName,motifPosId,QuadrantName(chamber),posX,posY,posZ,rot,"ONLY"); - - posX = where.X()+motifPos->Position().X()/10.+fgkOffsetX/2.-fgkDeltaFilleEtamX+spMot.GetDelta().X(); - posY = where.Y()+motifPos->Position().Y()/10.-+fgkOffsetY/2.-fgkDeltaFilleEtamY+spMot.GetDelta().Y(); - posZ = where.Z()-totalHz()+2.*totalHzPlane()+totalHzDaughter(); - gMC->Gspos(fgkDaughterName,motifPosId,QuadrantName(chamber),posX,posY,posZ,rot,"ONLY"); - - already_done.push_back(motifPosId); - } - } - } - } + // Initialize Station 1 Tracking Chambers + + // + // Set the chamber (sensitive region) GEANT identifier + fChamberV2[0] = new TArrayI(11); // Chamber 1 sensitive volume Id array + fChamberV2[1] = new TArrayI(11); // Chamber 2 sensitive volume Id array + + AddChamberGid(0,gMC->VolId("SA1G"),0); + AddChamberGid(0,gMC->VolId("SB1G"),1); + AddChamberGid(0,gMC->VolId("SC1G"),2); + AddChamberGid(0,gMC->VolId("SD1G"),3); + AddChamberGid(0,gMC->VolId("SE1G"),4); + AddChamberGid(0,gMC->VolId("SF1G"),5); + AddChamberGid(0,gMC->VolId("SG1G"),6); + AddChamberGid(0,gMC->VolId("SH1G"),7); + AddChamberGid(0,gMC->VolId("SI1G"),8); + AddChamberGid(0,gMC->VolId("SJ1G"),9); + AddChamberGid(0,gMC->VolId("SK1G"),10); + + + AddChamberGid(1,gMC->VolId("SA2G"),0); + AddChamberGid(1,gMC->VolId("SB2G"),1); + AddChamberGid(1,gMC->VolId("SC2G"),2); + AddChamberGid(1,gMC->VolId("SD2G"),3); + AddChamberGid(1,gMC->VolId("SE2G"),4); + AddChamberGid(1,gMC->VolId("SF2G"),5); + AddChamberGid(1,gMC->VolId("SG2G"),6); + AddChamberGid(1,gMC->VolId("SH2G"),7); + AddChamberGid(1,gMC->VolId("SI2G"),8); + AddChamberGid(1,gMC->VolId("SJ2G"),9); + AddChamberGid(1,gMC->VolId("SK2G"),10); + + Int_t i; +// now do the other stations as in AliMUONv1 + for (i=0; iInit(); + } + + // + // Set the chamber (sensitive region) GEANT identifier + ((AliMUONChamber*)(*fChambers)[0])->SetGid(-1); // joker + ((AliMUONChamber*)(*fChambers)[1])->SetGid(-1); // joker + + ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("S03G")); + ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("S04G")); + + ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G")); + ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G")); + + ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G")); + ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G")); + + ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G")); + ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G")); + + ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("SG1A")); + ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("SG2A")); + ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("SG3A")); + ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("SG4A")); + } + diff --git a/MUON/AliMUONv2.h b/MUON/AliMUONv2.h index 66062bbeadb..90c2f8acf97 100644 --- a/MUON/AliMUONv2.h +++ b/MUON/AliMUONv2.h @@ -12,23 +12,22 @@ // Inherits from AliMUONv1 but with a more detailed // geometrical description of station 1 -#include +#include +#include #include "AliMUONv1.h" +#include "AliMUONSt1Types.h" #include "AliMUONSt1SpecialMotif.h" -#include -#include - -typedef Float_t GReal_t; // for AliGeant3 -//typedef Double_t GReal_t; // for VirtualMC +//typedef Float_t GReal_t; // for AliGeant3 +typedef Double_t GReal_t; // for VirtualMC class TTree; -class MSector; -using std::map; - +class TArrayI; +class AliMpSector; -class AliMUONv2 : public AliMUONv1 { +class AliMUONv2 : public AliMUONv1 +{ public: AliMUONv2(); AliMUONv2(const char* name, const char* title); @@ -36,30 +35,56 @@ class AliMUONv2 : public AliMUONv1 { virtual ~AliMUONv2(); virtual Int_t IsVersion() const; - virtual void CreateGeometry(); virtual void CreateMaterials(); - + virtual void CreateGeometry(); + virtual void Init(); + protected: // Copy Operator - AliMUONv2& operator = (const AliMUONv2& rhs); - + AliMUONv2& operator = (const AliMUONv2& rhs); + virtual Int_t GetChamberId(Int_t volId) const; + private: - - typedef map< Int_t , AliMUONSt1SpecialMotif > TSpecialMap; - static const GReal_t fgkHzPadPlane; // Pad plane - static const GReal_t fgkHzFoam; // Foam of mechanicalplane - static const GReal_t fgkHzFR4; // FR4 of mechanical plane - static const GReal_t fgkHzSnPb; //Pad/Kapton connection (66 pt) - static const GReal_t fgkHzKapton; //Kapton - static const GReal_t fgkHzBergPlastic; //Berg connector - static const GReal_t fgkHzBergCopper; //Berg connector (80 pt) - static const GReal_t fgkHzDaughter; //Daughter board - static const GReal_t fgkHzGas ; // ArCO2 Gas - - GReal_t totalHzPlane() const ; //Total mechanical plane half Size - GReal_t totalHzDaughter() const ; //Total daughter plane half Size - GReal_t totalHz() const ; //Total plane half Size + // Methods + // + void CreateHole(); + void CreateDaughterBoard(); + void CreateInnerLayers(); + void CreateQuadrant(Int_t chamber); + void CreateFoamBox(const char* name,const TVector2& dimensions); + void CreatePlaneSegment(const char* name,const TVector2& dimensions, + Int_t nofHoles); + void CreateFrame(Int_t chamber); + void PlaceInnerLayers(Int_t chamber); + void PlaceSector(AliMpSector* sector, TSpecialMap specialMap, + const TVector3& where, Bool_t reflectZ, Int_t chamber); + + TString QuadrantMLayerName(Int_t chamber) const; + TString QuadrantNLayerName(Int_t chamber) const; + TString QuadrantFLayerName(Int_t chamber) const; + TString GasVolumeName(const TString& name, Int_t chamber) const; + + void AddChamberGid(Int_t id,Int_t volName,Int_t idx); + Bool_t IsInChamber(Int_t ich, Int_t volGid) const; + + GReal_t TotalHzPlane() const ; // Total mechanical plane half Size + GReal_t TotalHzDaughter() const ; // Total daughter plane half Size + GReal_t TotalHz() const ; // Total plane half Size + + // Constants + // + static const GReal_t fgkHzPadPlane; // Pad plane + static const GReal_t fgkHzFoam; // Foam of mechanicalplane + static const GReal_t fgkHzFR4; // FR4 of mechanical plane + static const GReal_t fgkHzSnPb; // Pad/Kapton connection (66 pt) + static const GReal_t fgkHzKapton; // Kapton + static const GReal_t fgkHzBergPlastic; // Berg connector + static const GReal_t fgkHzBergCopper; // Berg connector (80 pt) + static const GReal_t fgkHzDaughter; // Daughter board + static const GReal_t fgkHzGas; // ArCO2 Gas + + // Sensitive copper pads, foam layer, PCB and electronics model parameters static const GReal_t fgkHxHole; static const GReal_t fgkHyHole; static const GReal_t fgkHxBergPlastic; @@ -74,50 +99,67 @@ class AliMUONv2 : public AliMUONv1 { static const GReal_t fgkOffsetY; static const GReal_t fgkDeltaFilleEtamX; static const GReal_t fgkDeltaFilleEtamY; - static const GReal_t fgkHxQuadrant; - static const GReal_t fgkHyQuadrant; - static const GReal_t fgkMotherIR; - static const GReal_t fgkMotherOR; - static const GReal_t fgkMotherThick; - static const GReal_t fgkMotherPhiL; - static const GReal_t fgkMotherPhiU; - - static const char* fgkHoleName; - static const char* fgkQuadrantName; - static const char* fgkDaughterName; - static const char fgkFoamLayerSuffix; - - void CreateHole(); - void CreateDaughterBoard(); - void CreateFrame(Int_t chamber); - void CreateQuadrant(Int_t chamber); - void CreatePlaneBox(const char* name,const TVector2& dimensions); - void CreatePlaneSegment(const char* name,const TVector2& dimensions - ,Int_t nofHoles); - void CreateDaughterSegment(const char* name,const TVector2& dimensions - ,Int_t nofHoles); - void PlaceSector(MSector* sector,TSpecialMap specialMap - ,const TVector3& where,Int_t chamber); - TString QuadrantName(Int_t chamber); - Int_t fIdSens; // Sensitive volume identifier + static const GReal_t fgkDeltaQuadLHC; //LHC Origin wrt Quadrant Origin + static const GReal_t fgkFrameOffset; + + // Quadrant Mother volume - TUBS1 + static const GReal_t fgkMotherIR1; + static const GReal_t fgkMotherOR1; + static const GReal_t fgkMotherThick1; + static const GReal_t fgkMotherPhiL1; + static const GReal_t fgkMotherPhiU1; + + // Quadrant Mother volume - TUBS2 (2 copies at different Z's) + static const GReal_t fgkMotherIR2; + static const GReal_t fgkMotherOR2; + static const GReal_t fgkMotherThick2; + static const GReal_t fgkMotherPhiL2; + static const GReal_t fgkMotherPhiU2; + + static const char* fgkHoleName; // prefix for automatic volume naming + static const char* fgkQuadrantMLayerName;// prefix for automatic volume naming + static const char* fgkQuadrantNLayerName;// prefix for automatic volume naming + 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 + + // Data members + // + Float_t fRadlCopper; //! copper computed radiation length + Float_t fRadlFoam; //! foam computed radiation length + Float_t fRadlFR4; //! FR4 computed radiation length + TArrayI* fChamberV2[2];// Sensitive volumes IDs - ClassDef(AliMUONv2,1) // MUON Detector base class }; // inline functions inline Int_t AliMUONv2::IsVersion () const - { return 2; } -inline GReal_t AliMUONv2::totalHzPlane() const - { return fgkHzPadPlane + fgkHzFoam + fgkHzFR4;} -inline GReal_t AliMUONv2::totalHzDaughter() const - { return fgkHzBergPlastic + fgkHzDaughter;} -inline GReal_t AliMUONv2::totalHz() const - { return totalHzPlane() + totalHzDaughter();} -inline TString AliMUONv2::QuadrantName(Int_t chamber) -{return Form("%s%d",fgkQuadrantName,chamber);} +{ return 2; } + +inline GReal_t AliMUONv2::TotalHzPlane() const +//{ return fgkHzPadPlane + fgkHzFoam + fgkHzFR4; } +{ return fgkHzFoam + fgkHzFR4; } + +inline GReal_t AliMUONv2::TotalHzDaughter() const +{ return fgkHzBergPlastic + fgkHzDaughter; } + +inline GReal_t AliMUONv2::TotalHz() const +{ return TotalHzPlane() + TotalHzDaughter(); } + +inline TString AliMUONv2::QuadrantMLayerName(Int_t chamber) const +{ return Form("%s%d",fgkQuadrantMLayerName,chamber); } + +inline TString AliMUONv2::QuadrantNLayerName(Int_t chamber) const +{ return Form("%s%d",fgkQuadrantNLayerName,chamber); } + +inline TString AliMUONv2::QuadrantFLayerName(Int_t chamber) const +{ return Form("%s%d",fgkQuadrantFLayerName,chamber); } + +inline void AliMUONv2::AddChamberGid(Int_t id,Int_t volName,Int_t idx) +{ fChamberV2[id]->AddAt(volName,idx); } #endif //ALI_MUON_V2_H diff --git a/MUON/MUONLinkDef.h b/MUON/MUONLinkDef.h index fb2a003577f..c7339ed5491 100644 --- a/MUON/MUONLinkDef.h +++ b/MUON/MUONLinkDef.h @@ -5,7 +5,6 @@ #pragma link C++ class AliMUON+; #pragma link C++ class AliMUONv0+; #pragma link C++ class AliMUONv1+; -#pragma link C++ class AliMUONv3+; #pragma link C++ class AliMUONHit+; #pragma link C++ class AliMUONPadHit+; #pragma link C++ class AliMUONDigit+; @@ -55,12 +54,9 @@ #pragma link C++ class AliMUONMerger+; #pragma link C++ class AliMUONFactory+; #pragma link C++ class AliMUONDigitizer+; -#pragma link C++ class AliMUONDigitizerv1+; #pragma link C++ class AliMUONTrackK+; #pragma link C++ class AliMUONPixel+; #pragma link C++ class AliMUONClusterFinderAZ+; - -#ifdef USE_MUON_MAPPING #pragma link C++ class AliMUONv2+; #pragma link C++ class AliMUONSt1Segmentation+; #pragma link C++ class AliMUONSt1Response+; @@ -68,6 +64,8 @@ #pragma link C++ class AliMUONSt1SpecialMotif+; #pragma link C++ class AliMUONSt1ResponseParameter+; #pragma link C++ class AliMUONSt1ResponseRule+; -#endif + +#include "MUONLinkDefMapping.h" #endif + diff --git a/MUON/MUONLinkDefMapping.h b/MUON/MUONLinkDefMapping.h new file mode 100644 index 00000000000..ffb9549e3d0 --- /dev/null +++ b/MUON/MUONLinkDefMapping.h @@ -0,0 +1,75 @@ +// $Id$ + +#pragma link C++ class AliMpArea+; +#pragma link C++ class AliMpConstants+; +#pragma link C++ class AliMpIntPair+; +#pragma link C++ class AliMpPad+; +#pragma link C++ class AliMpPadPair+; +#pragma link C++ class AliMpVIndexed+; +#pragma link C++ class AliMpVSegmentation+; +#pragma link C++ class AliMpTransformer+; +#pragma link C++ class AliMpVPadIterator+; +#pragma link C++ class AliMpPadIteratorPtr+; +#pragma link C++ class AliMpTransformPadIterator+; + +#pragma link C++ enum AliMpDirection; + + +#pragma link C++ function operator-(const AliMpIntPair& ,const AliMpIntPair& ); +#pragma link C++ function operator+(const AliMpIntPair& ,const AliMpIntPair& ); +#pragma link C++ function operator<<(ostream& ,const AliMpIntPair& ); +#pragma link C++ function operator<<(ostream& ,const AliMpPad& ); +#pragma link C++ function operator<<(ostream& ,const AliMpArea& ); +#pragma link C++ function operator<(const AliMpPad& ,const AliMpPad& ); + +// $Id$ + +#pragma link C++ class AliMpMotifMap+; +#pragma link C++ class AliMpVMotif+; +#pragma link C++ class AliMpMotif+; +#pragma link C++ class AliMpMotifSpecial+; +#pragma link C++ class AliMpMotifType+; +#pragma link C++ class AliMpMotifTypePadIterator+; +#pragma link C++ class AliMpMotifPosition+; +#pragma link C++ class AliMpMotifPositionPadIterator+; +#pragma link C++ class AliMpConnection+; + +// $Id$ + +#pragma link C++ class AliMpReader+; +#pragma link C++ class AliMpFiles+; +#pragma link C++ class AliMpSector+; +#pragma link C++ class AliMpSectorPadIterator+; +#pragma link C++ class AliMpSectorAreaHPadIterator+; +#pragma link C++ class AliMpSectorAreaVPadIterator+; +#pragma link C++ class AliMpSectorSegmentation+; +#pragma link C++ class AliMpNeighboursPadIterator+; +#pragma link C++ class AliMpZone+; +#pragma link C++ class AliMpSubZone+; +#pragma link C++ class AliMpRow+; +#pragma link C++ class AliMpVRowSegment+; +#pragma link C++ class AliMpRowSegment+; +#pragma link C++ class AliMpRowSegmentSpecial+; +#pragma link C++ class AliMpPadRow+; +#pragma link C++ class AliMpPadRowSegment+; + +#pragma link C++ enum AliMpPlaneType; + +// $Id$ + +#pragma link C++ class AliMpSectorPosition+; +#pragma link C++ class AliMpPlane+; +#pragma link C++ class AliMpPlaneSegmentation+; +#pragma link C++ class AliMpPlaneAreaPadIterator+; + +// $Id$ + +#pragma link C++ class AliMpGraphContext+; +#pragma link C++ class AliMpVPainter+; +#pragma link C++ class AliMpMotifPainter+; +#pragma link C++ class AliMpRowPainter+; +#pragma link C++ class AliMpRowSegmentPainter+; +#pragma link C++ class AliMpSectorPainter+; +#pragma link C++ class AliMpSubZonePainter+; +#pragma link C++ class AliMpZonePainter+; + diff --git a/MUON/libMUON.pkg b/MUON/libMUON.pkg index 8750ef41e98..0be60a18cea 100644 --- a/MUON/libMUON.pkg +++ b/MUON/libMUON.pkg @@ -9,7 +9,7 @@ SRCS = AliMUONChamber.cxx AliMUONChamberTrigger.cxx \ AliMUONSegmentationTrigger.cxx AliMUONResponseTrigger.cxx\ AliMUONResponseTriggerV1.cxx\ AliMUONSegmentationTriggerX.cxx AliMUONSegmentationTriggerY.cxx \ - AliMUONSegmentationV1.cxx AliMUON.cxx AliMUONv0.cxx AliMUONv1.cxx AliMUONv3.cxx \ + AliMUONSegmentationV1.cxx AliMUON.cxx AliMUONv0.cxx AliMUONv1.cxx \ AliMUONDisplay.cxx AliMUONPoints.cxx \ AliMUONClusterFinderVS.cxx \ AliMUONHitMapA1.cxx \ @@ -27,9 +27,14 @@ SRCS = AliMUONChamber.cxx AliMUONChamberTrigger.cxx \ AliMUONSegmentationSlatModule.cxx AliMUONSegmentationSlatModuleN.cxx \ AliMUONSegmentationSlat.cxx AliMUONSegmentationSlatN.cxx \ AliMUONRecoEvent.cxx AliMUONRecoDisplay.cxx \ - AliMUONMerger.cxx AliMUONFactory.cxx AliMUONDigitizer.cxx AliMUONDigitizerv1.cxx\ + AliMUONMerger.cxx AliMUONFactory.cxx AliMUONDigitizer.cxx \ AliMUONTrackK.cxx AliMUONClusterFinderAZ.cxx AliMUONPixel.cxx +SRCS += AliMUONv2.cxx AliMUONSt1Segmentation.cxx AliMUONSt1Response.cxx \ + AliMUONSt1ElectronicElement.cxx AliMUONSt1SpecialMotif.cxx \ + AliMUONSt1ResponseParameter.cxx AliMUONSt1ResponseRule.cxx \ + AliMUONSt1IniReader.cxx AliMUONSt1Decoder.cxx \ + HDRS = $(SRCS:.cxx=.h) EHDRS = $(ROOTSYS)/include/TF1.h \ @@ -37,22 +42,8 @@ EHDRS = $(ROOTSYS)/include/TF1.h \ $(ROOTSYS)/include/TMarker3DBox.h \ $(ROOTSYS)/include/TMatrix.h \ $(ROOTSYS)/include/TTree.h \ + $(ROOTSYS)/include/TArrayF.h \ DHDR:= MUONLinkDef.h -ifneq ($(MINSTALL),) - -SRCS += AliMUONv2.cxx AliMUONSt1Segmentation.cxx AliMUONSt1Response.cxx \ - AliMUONSt1ElectronicElement.cxx AliMUONSt1SpecialMotif.cxx \ - AliMUONSt1ResponseParameter.cxx AliMUONSt1ResponseRule.cxx \ - AliMUONSt1IniReader.cxx AliMUONSt1Decoder.cxx \ - -EHDRS += $(ROOTSYS)/include/TArrayF.h \ - -EINCLUDE := $(MINSTALL)/include -ELIBSDIR := $(MINSTALL)/lib/$(MPSYSTEM) -ELIBS := basic graphics motif sector plane - -CINTFLAGS += -DUSE_MUON_MAPPING - -endif +include MUON/libMUON.pkg.mapping diff --git a/MUON/libMUON.pkg.mapping b/MUON/libMUON.pkg.mapping new file mode 100644 index 00000000000..8ef7ccd465f --- /dev/null +++ b/MUON/libMUON.pkg.mapping @@ -0,0 +1,73 @@ +# +# mapping +# + +# Category basic +# +SRCS += \ + mapping/AliMpArea.cxx \ + mapping/AliMpConstants.cxx \ + mapping/AliMpIntPair.cxx \ + mapping/AliMpPad.cxx \ + mapping/AliMpPadIteratorPtr.cxx \ + mapping/AliMpPadPair.cxx \ + mapping/AliMpTransformer.cxx \ + mapping/AliMpTransformPadIterator.cxx \ + mapping/AliMpVIndexed.cxx \ + mapping/AliMpVPadIterator.cxx \ + mapping/AliMpVSegmentation.cxx \ + +# Category motif +# +SRCS += \ + mapping/AliMpConnection.cxx \ + mapping/AliMpMotif.cxx \ + mapping/AliMpMotifMap.cxx \ + mapping/AliMpMotifPosition.cxx \ + mapping/AliMpMotifPositionPadIterator.cxx \ + mapping/AliMpMotifSpecial.cxx \ + mapping/AliMpMotifType.cxx \ + mapping/AliMpMotifTypePadIterator.cxx \ + mapping/AliMpVMotif.cxx \ + +# Category sector +# +SRCS += \ + mapping/AliMpFiles.cxx \ + mapping/AliMpNeighboursPadIterator.cxx \ + mapping/AliMpPadRow.cxx \ + mapping/AliMpPadRowSegment.cxx \ + mapping/AliMpReader.cxx \ + mapping/AliMpRow.cxx \ + mapping/AliMpRowSegment.cxx \ + mapping/AliMpRowSegmentSpecial.cxx \ + mapping/AliMpSectorAreaHPadIterator.cxx \ + mapping/AliMpSectorAreaVPadIterator.cxx \ + mapping/AliMpSector.cxx \ + mapping/AliMpSectorPadIterator.cxx \ + mapping/AliMpSectorSegmentation.cxx \ + mapping/AliMpSubZone.cxx \ + mapping/AliMpVRowSegment.cxx \ + mapping/AliMpZone.cxx \ + +# Category plane +# +SRCS += \ + mapping/AliMpPlaneAreaPadIterator.cxx \ + mapping/AliMpPlane.cxx \ + mapping/AliMpPlaneSegmentation.cxx \ + mapping/AliMpSectorPosition.cxx \ + +# Category graphics +# +SRCS += \ + mapping/AliMpGraphContext.cxx \ + mapping/AliMpMotifPainter.cxx \ + mapping/AliMpRowPainter.cxx \ + mapping/AliMpRowSegmentPainter.cxx \ + mapping/AliMpSectorPainter.cxx \ + mapping/AliMpSubZonePainter.cxx \ + mapping/AliMpVPainter.cxx \ + mapping/AliMpZonePainter.cxx \ + +EINCLUDE := $(ALICE_ROOT)/MUON/mapping diff --git a/MUON/mapping/AliMpArea.cxx b/MUON/mapping/AliMpArea.cxx new file mode 100755 index 00000000000..3ae92ab4459 --- /dev/null +++ b/MUON/mapping/AliMpArea.cxx @@ -0,0 +1,162 @@ +// $Id$ +// Category: basic +// +// Class AliMpArea +// ---------------- +// Class that defines a rectangle area positioned in plane.. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpArea.h" + +ClassImp(AliMpArea) + + +//_____________________________________________________________________________ +AliMpArea::AliMpArea(const TVector2& position, const TVector2& dimensions) + : TObject(), + fPosition(position), + fDimensions(dimensions), + fValidity(true) { +// + // Check dimensions + if (fDimensions.X() <= 0. || fDimensions.Y() <=0.) { + fDimensions = TVector2(); + fValidity = false; + } +} + +//_____________________________________________________________________________ +AliMpArea::AliMpArea() + : TObject(), + fPosition(TVector2()), + fDimensions(TVector2()), + fValidity(false) { +// +} + +//_____________________________________________________________________________ +AliMpArea::AliMpArea(const AliMpArea& rhs): + TObject(rhs), + fPosition(rhs.fPosition), + fDimensions(rhs.fDimensions) { +// +} + +//_____________________________________________________________________________ +AliMpArea::~AliMpArea() { +// +} + +// +// operators +// + +//______________________________________________________________________________ +AliMpArea& AliMpArea::operator = (const AliMpArea& right) +{ +// Assignement operator + + // check assignement to self + if (this == &right) return *this; + + // base class assignement + TObject::operator=(right); + + fPosition = right.fPosition; + fDimensions = right.fDimensions; + fValidity = right.fValidity; + + return *this; +} + +// +// public methods +// + +//_____________________________________________________________________________ +Double_t AliMpArea::LeftBorder() const +{ +// Returns the position of the left edge. +// -- + + return fPosition.X() - fDimensions.X(); +} + +//_____________________________________________________________________________ +Double_t AliMpArea::RightBorder() const +{ +// Returns the position of right edge. +// -- + + return fPosition.X() + fDimensions.X(); +} + +//_____________________________________________________________________________ +Double_t AliMpArea::UpBorder() const +{ +// Returns the position of the up edge. +// -- + + return fPosition.Y() + fDimensions.Y(); +} + +//_____________________________________________________________________________ +Double_t AliMpArea::DownBorder() const +{ +// Returns the position of the down edge. +// -- + + return fPosition.Y() - fDimensions.Y(); +} + +//_____________________________________________________________________________ +TVector2 AliMpArea::LeftDownCorner() const +{ +// Returns position of the left down corner. +// -- + + return TVector2(LeftBorder(), DownBorder()); +} + +//_____________________________________________________________________________ +TVector2 AliMpArea::LeftUpCorner() const +{ +// Returns position of the left up corner. +// -- + + return TVector2(LeftBorder(), UpBorder()); +} + +//_____________________________________________________________________________ +TVector2 AliMpArea::RightDownCorner() const +{ +// Returns position of the right down corner. +// -- + + return TVector2(RightBorder(), DownBorder()); +} + + +//_____________________________________________________________________________ +TVector2 AliMpArea::RightUpCorner() const +{ +// Returns position of the right up corner. +// -- + + return TVector2(RightBorder(), UpBorder()); +} + +//_____________________________________________________________________________ +ostream& operator<< (ostream &stream,const AliMpArea& area) +{ + stream << "Area: position: (" + << area.Position().X() << ", " << area.Position().Y() << ") " + << " dimensions: (" + << area.Dimensions().X() << ", " << area.Dimensions().Y() << ") " + << endl; + return stream; +} + diff --git a/MUON/mapping/AliMpArea.h b/MUON/mapping/AliMpArea.h new file mode 100755 index 00000000000..e863f80a673 --- /dev/null +++ b/MUON/mapping/AliMpArea.h @@ -0,0 +1,60 @@ +// $Id$ +// Category: basic +// +// Class AliMpArea +// ---------------- +// Class that defines a rectangle area positioned in plane.. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_AREA_H +#define ALI_MP_AREA_H + +#include +#include + +class AliMpArea : public TObject +{ + public: + AliMpArea(const TVector2& position, const TVector2& dimensions); + AliMpArea(const AliMpArea& rhs); + AliMpArea(); + virtual ~AliMpArea(); + + // operators + AliMpArea& operator = (const AliMpArea& right); + + // methods + Double_t LeftBorder() const; + Double_t RightBorder() const; + Double_t UpBorder() const; + Double_t DownBorder() const; + + TVector2 LeftDownCorner() const; + TVector2 LeftUpCorner() const; + TVector2 RightDownCorner() const; + TVector2 RightUpCorner() const; + + // get methods + TVector2 Position() const; + TVector2 Dimensions() const; + Bool_t IsValid() const; + + private: + // data members + TVector2 fPosition; // position + TVector2 fDimensions;// dimensions (half lengths) + Bool_t fValidity; // validity + + ClassDef(AliMpArea,1) //utility class for area iterators +}; + +ostream& operator << (ostream &stream,const AliMpArea& area); + +// inline functions + +inline TVector2 AliMpArea::Position() const { return fPosition; } +inline TVector2 AliMpArea::Dimensions() const { return fDimensions; } +inline Bool_t AliMpArea::IsValid() const { return fValidity; } + +#endif //ALI_MP_AREA_H diff --git a/MUON/mapping/AliMpBasicTypes.h b/MUON/mapping/AliMpBasicTypes.h new file mode 100755 index 00000000000..1972396e872 --- /dev/null +++ b/MUON/mapping/AliMpBasicTypes.h @@ -0,0 +1,22 @@ +// $Id$ +// Category: basic +// +// AliMpBasicTypes +// --------------- +// Sytem dependent types definitions for basic category. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_BASIC_TYPES_H +#define ALI_MP_BASIC_TYPES_H + +#include +#include "AliMpPad.h" + +#ifdef __HP_aCC + typedef pair PadPair; +#else + typedef std::pair PadPair; +#endif + +#endif //ALI_MP_BASIC_TYPES_H diff --git a/MUON/mapping/AliMpConnection.cxx b/MUON/mapping/AliMpConnection.cxx new file mode 100755 index 00000000000..504f3493979 --- /dev/null +++ b/MUON/mapping/AliMpConnection.cxx @@ -0,0 +1,42 @@ +// $Id$ +// Category: motif +// +// Class AliMpConnection +// ---------------- +// Class that defines a connexion properties. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include "AliMpConnection.h" + +ClassImp(AliMpConnection) + +//_____________________________________________________________________________ +AliMpConnection::AliMpConnection(Int_t padNum, Int_t bergNum,Int_t kaptonNum, + Int_t gassiNum) + : TObject(), + fPadNum(padNum), + fBergNum(bergNum), + fKaptonNum(kaptonNum), + fGassiNum(gassiNum), + fOwner(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpConnection::AliMpConnection() + : TObject(), + fPadNum(-1), + fBergNum(-1), + fKaptonNum(-1), + fGassiNum(-1), + fOwner(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpConnection::~AliMpConnection() { +// +} diff --git a/MUON/mapping/AliMpConnection.h b/MUON/mapping/AliMpConnection.h new file mode 100755 index 00000000000..c3d933edf94 --- /dev/null +++ b/MUON/mapping/AliMpConnection.h @@ -0,0 +1,58 @@ +// $Id$ +// Category: motif +// +// Class AliMpConnection +// --------------------- +// Class that defines a connexion properties. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_CONNECTION_H +#define ALI_MP_CONNECTION_H + +#include + +#include "AliMpMotifType.h" +#include "AliMpIntPair.h" + +class AliMpConnection : public TObject +{ + public: + AliMpConnection(); + AliMpConnection(Int_t padNum,Int_t bergNum,Int_t kaptonNum,Int_t gassiNum); + virtual ~AliMpConnection(); + + // methods + + // accessors + Int_t GetBergNum() const {return fBergNum;} + Int_t GetKaptonNum() const {return fKaptonNum;} + Int_t GetGassiNum() const {return fGassiNum;} + Int_t GetPadNum() const {return fPadNum;} + AliMpMotifType *GetOwner() const {return fOwner;} + + AliMpIntPair LocalIndices() const; + TString PadName() const; + // modifiers + void SetOwner(AliMpMotifType *owner) {fOwner=owner;} + + private: + // data members + Int_t fPadNum; // Pad number + Int_t fBergNum; // Berg connector number + Int_t fKaptonNum; // Kapton connector number + Int_t fGassiNum; // Gassiplex channel number + AliMpMotifType *fOwner; //The motif type which contains this connection + + ClassDef(AliMpConnection,1) // Connection description +}; + +// inline functions + +inline TString AliMpConnection::PadName() const +{ return fOwner->PadName(fPadNum); } + +inline AliMpIntPair AliMpConnection::LocalIndices() const +{ return fOwner->FindLocalIndicesByConnection(this);} + +#endif //ALI_MP_CONNECTION_H diff --git a/MUON/mapping/AliMpConstants.cxx b/MUON/mapping/AliMpConstants.cxx new file mode 100755 index 00000000000..d4c4c37d953 --- /dev/null +++ b/MUON/mapping/AliMpConstants.cxx @@ -0,0 +1,50 @@ +// $Id$ +// Category: basic +// +// Class AliMpConstants +// -------------------- +// Class for globally used constants definition. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpConstants.h" + +ClassImp(AliMpConstants) + +// static data +const Double_t AliMpConstants::fgkLengthTolerance = 1e-04; // 0.1 mum; +const Double_t AliMpConstants::fgkLengthStep = 1.; // 1 mm; +const Int_t AliMpConstants::fgkStartPadIndex = 1; + +//_____________________________________________________________________________ +AliMpConstants::AliMpConstants() + : TObject() { +// +} + +//_____________________________________________________________________________ +AliMpConstants::~AliMpConstants() { +// +} + +//_____________________________________________________________________________ +Bool_t AliMpConstants::IsEqual(Double_t length1, Double_t length2) +{ +// Compares lengths within the length tolerance. +// --- + + return TMath::Abs(length1 - length2) < fgkLengthTolerance; +} + + +//_____________________________________________________________________________ +Bool_t AliMpConstants::IsEqual(const TVector2& v1, const TVector2& v2) +{ +// Compares x, y vector coordinates within the length tolerance. +// --- + + return ( TMath::Abs(v1.X() - v2.X()) + + TMath::Abs(v1.Y() - v2.Y())) < 2.*fgkLengthTolerance; +} diff --git a/MUON/mapping/AliMpConstants.h b/MUON/mapping/AliMpConstants.h new file mode 100755 index 00000000000..50ba66eaab5 --- /dev/null +++ b/MUON/mapping/AliMpConstants.h @@ -0,0 +1,50 @@ +// $Id$ +// Category: basic +// +// Class AliMpConstants +// -------------------- +// Class for globally used constants definition. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_CONSTANTS_H +#define ALI_MP_CONSTANTS_H + +#include +#include + +class AliMpConstants : public TObject +{ + public: + AliMpConstants(); + virtual ~AliMpConstants(); + + // static compare methods + static Bool_t IsEqual(Double_t length1, Double_t length2); + static Bool_t IsEqual(const TVector2& v1, const TVector2& v2); + + // static get methods + static Double_t LengthTolerance(); + static Double_t LengthStep(); + static Int_t StartPadIndex(); + + private: + // unused derived functions + virtual Bool_t IsEqual(const TObject*) const { return true; } + + // static data members + static const Double_t fgkLengthTolerance;// the length precision for tests + static const Double_t fgkLengthStep; // the step in length used to move from + // a geometric border inside (pad, motif) + static const Int_t fgkStartPadIndex; // global pad indices start value + + ClassDef(AliMpConstants,1) //Class for globally used constants definition +}; + +// inline functions + +inline Double_t AliMpConstants::LengthTolerance() {return fgkLengthTolerance;} +inline Double_t AliMpConstants::LengthStep() {return fgkLengthStep;} +inline Int_t AliMpConstants::StartPadIndex() {return fgkStartPadIndex;} + +#endif //ALI_MP_CONSTANTS_H diff --git a/MUON/mapping/AliMpDirection.h b/MUON/mapping/AliMpDirection.h new file mode 100755 index 00000000000..4377414fcae --- /dev/null +++ b/MUON/mapping/AliMpDirection.h @@ -0,0 +1,19 @@ +// $Id$ +// Category: basic +// +// Enum AliMpDirection +// ------------------- +// Enumeration for the directions in a plane. +// +// Authors: David Guez, IPN Orsay + +#ifndef ALI_MP_DIRECTION_H +#define ALI_MP_DIRECTION_H + +enum AliMpDirection +{ + kX, // direction in x + kY // direction in y +}; + +#endif //ALI_MP_DIRECTION_H diff --git a/MUON/mapping/AliMpFiles.cxx b/MUON/mapping/AliMpFiles.cxx new file mode 100755 index 00000000000..307bde5e90e --- /dev/null +++ b/MUON/mapping/AliMpFiles.cxx @@ -0,0 +1,173 @@ +// $Id$ +// Category: sector +// +// Class AliMpFiles +// ---------------- +// Class for generating file names and paths. +// The input files: +// zones.dat, zones_special.dat - sector description +// motif*.dat - motif description (generated from Exceed) +// padPos*.dat - pad positions in motif +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpFiles.h" + +ClassImp(AliMpFiles) + +// static data members + +AliMpFiles* AliMpFiles::fgInstance = 0; +const TString AliMpFiles::fgkDefaultTop = getenv("MINSTALL"); +const TString AliMpFiles::fgkDataDir = "/data";; +const TString AliMpFiles::fgkBendingDir = "/bending_plane/";; +const TString AliMpFiles::fgkNonBendingDir = "/non-bending_plane/";; +const TString AliMpFiles::fgkSector = "zones"; +const TString AliMpFiles::fgkSectorSpecial = "zones_special"; +const TString AliMpFiles::fgkMotifPrefix = "motif"; +const TString AliMpFiles::fgkMotifSpecialPrefix ="motifSpecial"; +const TString AliMpFiles::fgkPadPosPrefix = "padPos"; +const TString AliMpFiles::fgkDataExt = ".dat"; +const TString AliMpFiles::fgkBergToGCFileName = "/bergToGC"; + +//______________________________________________________________________________ +AliMpFiles::AliMpFiles() + : fTop(fgkDefaultTop) +{ +// + if (fgInstance) { + Fatal("AliMpFiles", + "AliMpFiles: attempt to create two instances of singleton."); + } + + fgInstance = this; +} + +//______________________________________________________________________________ +AliMpFiles::AliMpFiles(const AliMpFiles& right) { +// + Fatal("AliMpFiles", "Attempt to copy AliMpFiles singleton."); +} + + +//______________________________________________________________________________ +AliMpFiles::~AliMpFiles() { +// + + fgInstance = 0; +} + +// operators + +//______________________________________________________________________________ +AliMpFiles& AliMpFiles::operator=(const AliMpFiles& right) +{ + // check assignement to self + if (this == &right) return *this; + + Fatal("operator=", "Attempt to assign AliMpFiles singleton."); + + return *this; +} + +// +// private methods +// + +//______________________________________________________________________________ +TString AliMpFiles::PlaneDataDir(AliMpPlaneType plane) const +{ +// Returns path to data files with sector description +// for a specified plane. +// --- + + switch (plane) { + case kBendingPlane: + return fTop + fgkDataDir + fgkBendingDir; + ;; + case kNonBendingPlane: + return fTop + fgkDataDir + fgkNonBendingDir; + ;; + } + + Fatal("PlaneDataDir", "Incomplete switch on AliMpPlaneType"); + return TString(); +} + +// +// public methods +// + +//______________________________________________________________________________ +AliMpFiles* AliMpFiles::Instance() +{ +// Return the singleton instance; +// Creates it if it does not yet exist, +// +// --- + + if (!fgInstance) fgInstance = new AliMpFiles(); + + return fgInstance; +} + +//______________________________________________________________________________ +TString AliMpFiles::SectorFilePath(AliMpPlaneType plane) const +{ +// Returns path to data file with sector description. +// --- + + return TString(PlaneDataDir(plane) + fgkSector + fgkDataExt); +} + +//______________________________________________________________________________ +TString AliMpFiles::SectorSpecialFilePath(AliMpPlaneType plane) const +{ +// Returns path to data file with sector special description (irregular motifs). +// --- + + return TString(PlaneDataDir(plane) + fgkSectorSpecial + fgkDataExt); +} + +//______________________________________________________________________________ +TString AliMpFiles::MotifFilePath(AliMpPlaneType plane, + const TString& motifTypeID) const +{ +// Returns path to data file for a given motif type. +// --- + + return TString(PlaneDataDir(plane) + fgkMotifPrefix + motifTypeID + fgkDataExt); +} + +//______________________________________________________________________________ +TString AliMpFiles::PadPosFilePath(AliMpPlaneType plane, + const TString& motifTypeID) const +{ +// Returns path to data file with pad positions for a given motif type. +// --- + + return TString(PlaneDataDir(plane) + fgkPadPosPrefix + motifTypeID + fgkDataExt); +} + +//______________________________________________________________________________ +TString AliMpFiles::MotifSpecialFilePath(AliMpPlaneType plane, + const TString& motifID) const +{ +// Returns path to data file with pad dimensions for a given motif ID. +// --- + + return TString(PlaneDataDir(plane) + fgkMotifSpecialPrefix + motifID + fgkDataExt); + +} + +//______________________________________________________________________________ +TString AliMpFiles::BergToGCFilePath() const +{ +// Returns the path of the file which describes the correspondance between +// the berg number and the gassiplex channel. +// --- + + return fTop+fgkDataDir+fgkBergToGCFileName+fgkDataExt; +} diff --git a/MUON/mapping/AliMpFiles.h b/MUON/mapping/AliMpFiles.h new file mode 100755 index 00000000000..5aacc301c61 --- /dev/null +++ b/MUON/mapping/AliMpFiles.h @@ -0,0 +1,83 @@ +// $Id$ +// Category: sector +// +// Class AliMpFiles +// ---------------- +// Class for generating file names and paths. +// The input files: +// zones.dat, zones_special.dat - sector description +// motif*.dat - motif description (generated from Exceed) +// padPos*.dat - pad positions in motif +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef M_FILES_H +#define M_FILES_H + +#include +#include + +#include "AliMpPlaneType.h" + +class AliMpFiles : public TObject +{ + public: + AliMpFiles(); + // --> protected + //AliMpFiles(const AliMpFiles& right); + virtual ~AliMpFiles(); + + // static access method + static AliMpFiles* Instance(); + + // methods + TString SectorFilePath(AliMpPlaneType plane) const; + TString SectorSpecialFilePath(AliMpPlaneType plane) const; + TString MotifFilePath(AliMpPlaneType plane, + const TString& motifTypeID) const; + TString MotifSpecialFilePath(AliMpPlaneType plane, + const TString& motifID) const; + TString PadPosFilePath(AliMpPlaneType plane, + const TString& motifTypeID) const; + TString BergToGCFilePath() const; + + // set methods + void SetTopPath(const TString& topPath); + + protected: + AliMpFiles(const AliMpFiles& right); + + // operators + AliMpFiles& operator=(const AliMpFiles& right); + + private: + // methods + TString PlaneDataDir(AliMpPlaneType plane) const; + + // static data members + static AliMpFiles* fgInstance; //this instance + static const TString fgkDefaultTop; //top directory path (default) + static const TString fgkDataDir; //data directory + static const TString fgkBendingDir; //bending plane directory + static const TString fgkNonBendingDir;//non-bending plane directory + static const TString fgkSector; //sector data file name + static const TString fgkSectorSpecial;//sector special data file name + static const TString fgkMotifPrefix; //motif data file name + static const TString fgkMotifSpecialPrefix; //special motif data file name + static const TString fgkPadPosPrefix; //pad position data file name + static const TString fgkDataExt; //file extension + static const TString fgkBergToGCFileName; //name of the file with BergToGC mapping + + // data members + TString fTop; // top directory path + + + ClassDef(AliMpFiles, 1) //File names and paths +}; + +// inline functions + +inline void AliMpFiles::SetTopPath(const TString& topPath) +{ fTop = topPath; } + +#endif //M_FILES_H diff --git a/MUON/mapping/AliMpGraphContext.cxx b/MUON/mapping/AliMpGraphContext.cxx new file mode 100755 index 00000000000..d21fa68af52 --- /dev/null +++ b/MUON/mapping/AliMpGraphContext.cxx @@ -0,0 +1,92 @@ +// $Id$ +// Category: graphics +// +// Class AliMpGraphContext +// ----------------------- +// Class describing a the correspondance between a given area +// in pad, and a zone of real (cm) position +// +// Author: David GUEZ, IPN Orsay + +#include "AliMpGraphContext.h" + +ClassImp(AliMpGraphContext) + +AliMpGraphContext *AliMpGraphContext::fgInstance = 0; +GraphContextVector AliMpGraphContext::fgStack; + +// private constructor +AliMpGraphContext::AliMpGraphContext(): + TObject(), + fPadPosition(TVector2(0.5,0.5)), + fPadDimensions(TVector2(0.49,0.49)), + fRealPosition(TVector2(0.,0.)), + fRealDimensions(TVector2(1,1)) +{ + fColor = 20; + // default constructor (private) +} +AliMpGraphContext *AliMpGraphContext::Instance() +{ + // return or create a unique instance of this class + if (fgInstance) return fgInstance; + fgInstance = new AliMpGraphContext; + return fgInstance; +} + +TVector2 AliMpGraphContext::RealToPad(const TVector2 &position) const +{ + // transform a real position into its equivalent position in the pad + Double_t x=position.X(); + Double_t y=position.Y(); + x-= (fRealPosition.X()-fRealDimensions.X()); + x/=fRealDimensions.X(); + x*=fPadDimensions.X(); + x+= (fPadPosition.X()-fPadDimensions.X() ); + + y-= (fRealPosition.Y()-fRealDimensions.Y()); + y/=fRealDimensions.Y(); + y*=fPadDimensions.Y(); + y+= (fPadPosition.Y()-fPadDimensions.Y() ); + + return TVector2(x,y); +} + + + +void AliMpGraphContext::RealToPad(const TVector2 &position, + const TVector2 &dimensions, + TVector2 &padPosition, + TVector2 &padDimensions) const +{ + // transform the real area (position,dimensions) to + // its equivalent pad area + padPosition = RealToPad(position); + padDimensions = + TVector2(dimensions.X()*fPadDimensions.X()/fRealDimensions.X(), + dimensions.Y()*fPadDimensions.Y()/fRealDimensions.Y()); + +} +void AliMpGraphContext::SetPadPosForReal(const TVector2 &position, + const TVector2 &dimensions) +{ + // Set the pad area from the actual one + // corresponding to the given real area. + RealToPad(position,dimensions,fPadPosition,fPadDimensions); +} +void AliMpGraphContext::Push() const +{ + // Store the current configuration + AliMpGraphContext *save = new AliMpGraphContext(*this); + fgStack.push_back(save); +} +void AliMpGraphContext::Pop() +{ + // restore the last saved configuration + if (!fgStack.empty()){ + AliMpGraphContext *obj = fgStack.back(); + *this = *obj; + fgStack.pop_back(); + delete obj; + } +} diff --git a/MUON/mapping/AliMpGraphContext.h b/MUON/mapping/AliMpGraphContext.h new file mode 100755 index 00000000000..0fef553b514 --- /dev/null +++ b/MUON/mapping/AliMpGraphContext.h @@ -0,0 +1,71 @@ +// $Id$ +// Category: graphics +// +// Class AliMpGraphContext +// ----------------------- +// Class describing the correspondance between a given area +// in pad, and a zone of real (cm) position +// +// Author: David GUEZ, IPN Orsay + +#ifndef ALI_MP_GRAPH_CONTEXT +#define ALI_MP_GRAPH_CONTEXT + +#include +#include + +#include "AliMpGraphicsTypes.h" + +class MPainter; + +class AliMpGraphContext : public TObject{ + public: + void Push() const; + void Pop(); + static AliMpGraphContext *Instance(); + + // set methods + + void SetPadPosition(const TVector2 &position){fPadPosition=position;} + void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;} + void SetRealPosition(const TVector2 &position){fRealPosition=position;} + void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;} + void SetColor(Int_t color){fColor=color;} + + // get methods + TVector2 GetPadPosition() const {return fPadPosition;} + TVector2 GetPadDimensions() const {return fPadDimensions;} + TVector2 GetRealPosition() const{return fRealPosition;} + TVector2 GetRealDimensions() const{return fRealDimensions;} + Int_t GetColor() const {return fColor;} + + //methods + TVector2 RealToPad(const TVector2 &position) const; + void RealToPad(const TVector2 &position + ,const TVector2 &dimensions, + TVector2 &padPosition, + TVector2 &padDimensions) const; + void SetPadPosForReal(const TVector2 &position,const TVector2 &dimensions); + + private: + //private constructor (not instanciable from outside) + AliMpGraphContext(); + + // static data members + static AliMpGraphContext *fgInstance; // the global instance + static GraphContextVector fgStack; // the object statck + + //data members + Int_t fColor; // color to use + TVector2 fPadPosition; // Position of the pad area where to draw + TVector2 fPadDimensions; // Dimensions of the pad area where to draw + + TVector2 fRealPosition; // Position of the real area to draw + TVector2 fRealDimensions; // Dimensions of the real area to draw + + ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world +}; + +#endif //ALI_MP_GRAPH_CONTEXT + + diff --git a/MUON/mapping/AliMpGraphicsTypes.h b/MUON/mapping/AliMpGraphicsTypes.h new file mode 100644 index 00000000000..9a39b93d047 --- /dev/null +++ b/MUON/mapping/AliMpGraphicsTypes.h @@ -0,0 +1,23 @@ +// $Id$ +// Category: graphics +// +// AliMpGraphicsTypes +// ------------------ +// Sytem dependent types definitions for graphics category. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_GRAPHICS_TYPES_H +#define ALI_MP_GRAPHICS_TYPES_H + +#include + +class AliMpGraphContext; + +#ifdef __HP_aCC + typedef vector GraphContextVector; +#else + typedef std::vector GraphContextVector; +#endif + +#endif //ALI_MP_GRAPHICS_TYPES_H diff --git a/MUON/mapping/AliMpIntPair.cxx b/MUON/mapping/AliMpIntPair.cxx new file mode 100755 index 00000000000..ee3b20aab9c --- /dev/null +++ b/MUON/mapping/AliMpIntPair.cxx @@ -0,0 +1,176 @@ +// $Id$ +// Category: basic +// +// Class AliMpIntPair +// -------------- +// Class that defines the pair of integers. +// The pair created by the default constructor is in invalide state, +// setting one of values changes the state to valid. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpIntPair.h" + +ClassImp(AliMpIntPair) + + +/////////////////////////////////////////////////// +// +// This class is a replacement for the standard STL +// pair class, which can not be handed +// by the normal ROOT automatic streamer +// (at least in the ROOT version 3.03/03) +// +/////////////////////////////////////////////////// + + +//_____________________________________________________________________________ +AliMpIntPair::AliMpIntPair(Int_t ix,Int_t iy) + : TObject(), + fFirst(ix), + fSecond(iy), + fValidity(true) { +// +} + +//_____________________________________________________________________________ +AliMpIntPair::AliMpIntPair(Int_t ix,Int_t iy, Bool_t validity) + : TObject(), + fFirst(ix), + fSecond(iy), + fValidity(validity) { +// +} + +//_____________________________________________________________________________ +AliMpIntPair::AliMpIntPair() + : TObject(), + //fFirst(9999), + //fSecond(9999), + fFirst(0), + fSecond(0), + fValidity(false) { +// +} +//_____________________________________________________________________________ +AliMpIntPair::AliMpIntPair(const AliMpIntPair& src): + TObject(src), + fFirst(src.fFirst), + fSecond(src.fSecond), + fValidity(src.fValidity) +{ + +} + +//_____________________________________________________________________________ +AliMpIntPair::~AliMpIntPair() { +// +} + +//_____________________________________________________________________________ +Bool_t AliMpIntPair::operator< (const AliMpIntPair& pos2) const +{ + // fFirst prior to fSecond + if (fFirstpos2.fFirst) return kFALSE; + if (fSecond + +class AliMpIntPair : public TObject +{ + public: + AliMpIntPair(Int_t ix,Int_t iy); + AliMpIntPair(Int_t ix,Int_t iy, Bool_t validity); + AliMpIntPair(const AliMpIntPair& right); + AliMpIntPair(); + virtual ~AliMpIntPair(); + + // operators + Bool_t operator < (const AliMpIntPair& pos2) const; + Bool_t operator == (const AliMpIntPair& pos2) const; + Bool_t operator != (const AliMpIntPair& pos2) const; + AliMpIntPair& operator = (const AliMpIntPair& src) ; + void operator += (const AliMpIntPair& op); + void operator -= (const AliMpIntPair& op); + + // static get methods + static AliMpIntPair Invalid() {return AliMpIntPair();} + + // get methods + Int_t GetFirst() const {return fFirst;} + Int_t GetSecond() const {return fSecond;} + Bool_t IsValid() const {return fValidity;} + + // set methods + void SetFirst(Int_t ix) {fFirst=ix; fValidity=true; } + void SetSecond(Int_t iy) {fSecond=iy; fValidity=true;} + + private: + // data members + Int_t fFirst; // position along x + Int_t fSecond; // position along y + Bool_t fValidity; // validity + + ClassDef(AliMpIntPair,1) //utility class for the motif type +}; + +AliMpIntPair operator + (const AliMpIntPair& op1,const AliMpIntPair& op2); +AliMpIntPair operator - (const AliMpIntPair& op1,const AliMpIntPair& op2); +AliMpIntPair operator * (const AliMpIntPair& op1,const AliMpIntPair& op2); +ostream& operator << (ostream &stream,const AliMpIntPair& op); + +#endif //ALI_MP_INT_PAIR_H diff --git a/MUON/mapping/AliMpMotif.cxx b/MUON/mapping/AliMpMotif.cxx new file mode 100755 index 00000000000..88830e61d62 --- /dev/null +++ b/MUON/mapping/AliMpMotif.cxx @@ -0,0 +1,86 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotif +// ---------------- +// Class that defines a motif with its unique ID +// and the motif type. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include "AliMpMotif.h" +#include "AliMpMotifType.h" +#include "AliMpIntPair.h" + +ClassImp(AliMpMotif) + +//_____________________________________________________________________________ +AliMpMotif::AliMpMotif() + : AliMpVMotif(), + fPadDimensions(TVector2(0.,0.)) +{ + //default dummy constructor +} + +//_____________________________________________________________________________ +AliMpMotif::AliMpMotif(const TString &id, AliMpMotifType *motifType, + const TVector2& padDimension) + : AliMpVMotif(id,motifType), + fPadDimensions(padDimension) +{ + // Normal constructor. + // The dimension in a given direction is calculated by + // multiplying the total dimension by the number of pads + +} + +//_____________________________________________________________________________ +TVector2 AliMpMotif::GetPadDimensions(const AliMpIntPair& localIndices) const +{ + // gives the dimension of the specified pad in the motif + + if (GetMotifType()->HasPad(localIndices)) + return fPadDimensions; + else { + Warning("GetPadDimensions","indices outside range"); + return TVector2(0.,0.); + } +} + +//_____________________________________________________________________________ +TVector2 AliMpMotif::Dimensions() const +{ + // gives the dimension of the motif + + return TVector2(GetMotifType()->GetNofPadsX()*fPadDimensions.X(), + GetMotifType()->GetNofPadsY()*fPadDimensions.Y()); +} + +//_____________________________________________________________________________ +TVector2 AliMpMotif::PadPositionLocal(const AliMpIntPair& localIndices) const +{ + // gives the local position of the pad number (ix,iy) + // (0,0 is the center of the motif) + + TVector2 dim=Dimensions(); + return TVector2((2.*localIndices.GetFirst()+1.)*fPadDimensions.X()-dim.X(), + (2.*localIndices.GetSecond()+1.)*fPadDimensions.Y()-dim.Y()); +} + +//_____________________________________________________________________________ +AliMpIntPair AliMpMotif::PadIndicesLocal(const TVector2& localPos) const +{ + // return the pad indices from a given local position + // or (-1,-1) if this position doesn't correspond to any valid + // connection + + TVector2 lowerLeft = localPos+Dimensions(); + Int_t ix = (Int_t)(lowerLeft.X()/(2.*fPadDimensions.X())); + Int_t iy = (Int_t)(lowerLeft.Y()/(2.*fPadDimensions.Y())); + + if (!GetMotifType()->FindConnectionByLocalIndices(AliMpIntPair(ix,iy))) { + //Warning("PadIndicesLocal","Position outside motif"); + return AliMpIntPair::Invalid(); + } + return AliMpIntPair(ix,iy); +} diff --git a/MUON/mapping/AliMpMotif.h b/MUON/mapping/AliMpMotif.h new file mode 100755 index 00000000000..ef2ac537ba2 --- /dev/null +++ b/MUON/mapping/AliMpMotif.h @@ -0,0 +1,52 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotif +// ---------------- +// Class that defines a motif with its unique ID +// and the motif type. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef M_MOTIF_H +#define M_MOTIF_H + +#include +#include +#include + +#include "AliMpVMotif.h" + +class AliMpMotif : public AliMpVMotif +{ + public: + AliMpMotif(const TString &id,AliMpMotifType *motifType, const TVector2& padDimension); + AliMpMotif(); + + // Access methods + virtual Int_t GetNofPadDimensions() const; + virtual TVector2 GetPadDimensions(Int_t i = 0) const; + virtual TVector2 GetPadDimensions(const AliMpIntPair& localIndices) const; + + // Geometry + virtual TVector2 Dimensions() const; + + // Other methods + virtual TVector2 PadPositionLocal(const AliMpIntPair& localIndices) const; + virtual AliMpIntPair PadIndicesLocal(const TVector2& localPos) const; + + private: + // methods + + // data members + TVector2 fPadDimensions; //pad dimensions (halflength x, y size) + + ClassDef(AliMpMotif,1) // A motif with its ID +}; + +// inline functions + +inline Int_t AliMpMotif::GetNofPadDimensions() const { return 1; } +inline TVector2 AliMpMotif::GetPadDimensions(Int_t i) const { return fPadDimensions; } + +#endif //M_MOTIF_H diff --git a/MUON/mapping/AliMpMotifMap.cxx b/MUON/mapping/AliMpMotifMap.cxx new file mode 100755 index 00000000000..1e6b5f32586 --- /dev/null +++ b/MUON/mapping/AliMpMotifMap.cxx @@ -0,0 +1,434 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifMap +// ------------------- +// Class describing the motif map container, where motifs are +// mapped to their string IDs. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpMotifMap.h" +#include "AliMpVMotif.h" +#include "AliMpMotif.h" +#include "AliMpMotifSpecial.h" +#include "AliMpMotifType.h" +#include "AliMpMotifPosition.h" + +ClassImp(AliMpMotifMap) + +//_____________________________________________________________________________ +AliMpMotifMap::AliMpMotifMap() + : TObject() +{ +// +} + +//_____________________________________________________________________________ +AliMpMotifMap::~AliMpMotifMap() { +// + + // Delete all registered motifs, motif types, motif positions + + for (MotifMapIterator im=fMotifs.begin(); im != fMotifs.end(); im++) { + delete im->second; + } + + for (MotifTypeMapIterator it=fMotifTypes.begin(); + it != fMotifTypes.end(); it++) { + delete it->second; + } + + for (MotifPositionMapIterator ip=fMotifPositions.begin(); + ip != fMotifPositions.end(); ip++) { + delete ip->second; + } +} + +// +// private methods +// + +//_____________________________________________________________________________ +void AliMpMotifMap::PrintMotifs() const +{ +// Prints all the motifs and their motif types +// for all motifs in the motifs map. +// --- + + if (fMotifs.size()) { + cout << "Dump of Motif Map - " << fMotifs.size() << " entries:" << endl; + Int_t counter = 0; + for (MotifMapIterator i=fMotifs.begin(); i != fMotifs.end(); i++) { + const TString& id = (*i).first; + AliMpVMotif* motif = (*i).second; + cout << "Map element " + << setw(3) << counter++ << " " + << id.Data() << " " + << motif->GetID().Data() << " " + << motif->GetMotifType()->GetID() << " " + << motif->Dimensions().X() << " " + << motif->Dimensions().Y() + << endl; + } + cout << endl; + } +} + +//_____________________________________________________________________________ +void AliMpMotifMap::PrintMotifTypes() const +{ +// Prints all the the motifs types and their motif dimensions +// for all motif types in the motif types map. +// --- + + if (fMotifTypes.size()) { + cout << "Dump of Motif Type Map - " << fMotifTypes.size() << " entries:" << endl; + Int_t counter = 0; + for (MotifTypeMapIterator i=fMotifTypes.begin(); i != fMotifTypes.end(); i++) { + const TString& id = (*i).first; + AliMpMotifType* motifType = (*i).second; + cout << "Map element " + << setw(3) << counter++ << " " + << id.Data() << " " + << motifType->GetID().Data() << " " + << motifType->GetNofPadsX() << " " + << motifType->GetNofPadsY() << " " + << endl; + } + cout << endl; + } +} + +//_____________________________________________________________________________ +void AliMpMotifMap::PrintMotifPositions() const +{ +// Prints all the the motifs positions. +// --- + + if (fMotifPositions.size()) { + cout << "Dump of Motif Position Map - " << fMotifPositions.size() << " entries:" << endl; + Int_t counter = 0; + for (MotifPositionMapIterator i=fMotifPositions.begin(); + i != fMotifPositions.end(); i++) { + + AliMpMotifPosition* motifPosition = (*i).second; + cout << "Map element " + << setw(3) << counter++ << " " + << motifPosition->GetID() << " " + << motifPosition->GetMotif()->GetID() << " " + << motifPosition->Position().X() << " " + << motifPosition->Position().Y() << " " + << endl; + } + cout << endl; + } +} + +//_____________________________________________________________________________ +void AliMpMotifMap::PrintMotifPositions2() const +{ +// Prints all the the motifs positions from the second map +// (by global indices) +// --- + + if (fMotifPositions2.size()) { + cout << "Dump of Motif Position Map 2 - " << fMotifPositions2.size() << " entries:" << endl; + Int_t counter = 0; + for (MotifPositionMap2Iterator i=fMotifPositions2.begin(); + i != fMotifPositions2.end(); i++) { + + AliMpMotifPosition* motifPosition = (*i).second; + cout << "Map element " + << setw(3) << counter++ << " " + << setw(3) << motifPosition->GetLowIndicesLimit().GetFirst() << " " + << setw(3) << motifPosition->GetLowIndicesLimit().GetSecond() << " " + << setw(3) << motifPosition->GetHighIndicesLimit().GetFirst() << " " + << setw(3) << motifPosition->GetHighIndicesLimit().GetSecond() << " " + << motifPosition->GetID() << " " + << endl; + } + cout << endl; + } +} + +// +// public methods +// + +//_____________________________________________________________________________ +Bool_t AliMpMotifMap::AddMotif(AliMpVMotif* motif, Bool_t warn) +{ +// Adds the specified motif +// if the motif with this ID is not yet present. +// --- + + AliMpVMotif* found = FindMotif(motif->GetID()); + if (found) { + if (warn && found == motif) + Warning("AddMotif", "The motif is already in map."); + if (warn && found != motif) + Warning("AddMotif", "Another motif with the same ID is already in map."); + return false; + } + + fMotifs[motif->GetID()] = motif; + return true; +} + +//_____________________________________________________________________________ +Bool_t AliMpMotifMap::AddMotifType(AliMpMotifType* motifType, Bool_t warn) +{ +// Adds the specified motif type +// if the motif with this ID is not yet present. +// --- + + AliMpMotifType* found = FindMotifType(motifType->GetID()); + if (found) { + if (warn && found == motifType) + Warning("AddMotifType", "The motif type is already in map."); + if (warn && found != motifType) + Warning("AddMotifType", + "Another motif type with the same ID is already in map."); + return false; + } + + fMotifTypes[motifType->GetID()] = motifType; + return true; +} + +//_____________________________________________________________________________ +Bool_t AliMpMotifMap::AddMotifPosition(AliMpMotifPosition* motifPosition, Bool_t warn) +{ +// Adds the specified motif position +// if this position is not yet present. +// --- + + AliMpMotifPosition* found = FindMotifPosition(motifPosition->GetID()); + if (found) { + if (warn && found == motifPosition) + Warning("AddMotifPosition", "This motif position is already in map."); + if (warn && found != motifPosition) + Warning("AddMotifposition", + "Another motif position with the same ID is already in map."); + return false; + } + + fMotifPositions[motifPosition->GetID()] = motifPosition; + return true; +} + +//_____________________________________________________________________________ +void AliMpMotifMap::FillMotifPositionMap2() +{ +// Fills the second map (by global indices) of motif positions. +// --- + + if (fMotifPositions2.size() > 0 ) { + Warning("FillMotifPositionMap2", "Map has been already filled."); + return; + } + + for (MotifPositionMapIterator ip=fMotifPositions.begin(); + ip != fMotifPositions.end(); ip++) { + + fMotifPositions2[(*ip).second->GetLowIndicesLimit()] = (*ip).second; + } + +} + +//_____________________________________________________________________________ +void AliMpMotifMap::Print() const +{ +// Prints the motifs and motif types maps. +// --- + + PrintMotifs(); + PrintMotifTypes(); + PrintMotifPositions(); + PrintMotifPositions2(); +} + +//_____________________________________________________________________________ +void AliMpMotifMap::PrintGlobalIndices(const char* fileName) const +{ +// Prints all the motifs positions and their global indices. +// --- + + ofstream out(fileName, ios::out); + + if (fMotifPositions.size()) { + for (MotifPositionMapIterator i=fMotifPositions.begin(); + i != fMotifPositions.end(); i++) { + + AliMpMotifPosition* motifPosition = (*i).second; + out << setw(5) << motifPosition->GetID() << " " + << setw(3) << motifPosition->GetLowIndicesLimit().GetFirst() << " " + << setw(3) << motifPosition->GetLowIndicesLimit().GetSecond() + << endl; + } + out << endl; + } +} + +//_____________________________________________________________________________ +void AliMpMotifMap::UpdateGlobalIndices(const char* fileName) +{ +// Updates the motifs positions global indices +// from the file. +// --- + + ifstream in(fileName, ios::in); + + Int_t motifPositionId, offx, offy; + + do { + in >> motifPositionId >> offx >> offy; + + if (in.eof()) { + FillMotifPositionMap2(); + return; + } + + AliMpMotifPosition* motifPosition = FindMotifPosition(motifPositionId); + + if (motifPosition) { + cout << "Processing " + << motifPosition->GetID() << " " << offx << " " << offy << endl; + + motifPosition->SetLowIndicesLimit(AliMpIntPair(offx, offy)); + + Int_t offx2 + = offx + motifPosition->GetMotif()->GetMotifType()->GetNofPadsX() - 1; + + Int_t offy2 + = offy + motifPosition->GetMotif()->GetMotifType()->GetNofPadsY() - 1; + + motifPosition->SetHighIndicesLimit(AliMpIntPair(offx2, offy2)); + } + else { + cerr <<"Motif position " << motifPositionId << endl; + Warning("UpdateGlobalIndices", "Motif position not found !!!"); + } + } + while (!in.eof()); +} + + +//_____________________________________________________________________________ +AliMpVMotif* AliMpMotifMap::FindMotif(const TString& motifID) const +{ +// Finds the motif with the specified ID. +// --- + + MotifMapIterator i = fMotifs.find(motifID); + + if (i != fMotifs.end()) + return (*i).second; + else + return 0; +} + +//_____________________________________________________________________________ +AliMpVMotif* AliMpMotifMap::FindMotif(const TString& motifID, + const TString& motifTypeID, + TVector2 padDimensions ) const +{ +// Finds the motif with the specified ID and returns it +// only if its motif type and motif dimensions agree +// with the given motifTypeID and motifDimensions. +// Disagreement causes fatal error. +// --- + + AliMpVMotif* motif = FindMotif(motifID); + + if (motif && motif->GetMotifType()->GetID() != motifTypeID) { + Fatal("FindMotif", + "Motif has been already defined with a different type."); + return 0; + } + + // check pad dimension in case of a normal motif + if (motif && + dynamic_cast(motif) && + ( motif->GetPadDimensions(0).X() != padDimensions.X() || + motif->GetPadDimensions(0).Y() != padDimensions.Y())) { + + Fatal("FindMotifType", + "Motif type has been already defined with different dimensions."); + return 0; + + } + + // check case of a special motif + if (motif && + (padDimensions.X() == 0. && padDimensions.Y() == 0.) && + !dynamic_cast(motif)) { + + Fatal("FindMotifType", + "Motif type has been already defined with different dimensions."); + return 0; + + } + + return motif; +} + +//_____________________________________________________________________________ +AliMpMotifType* AliMpMotifMap::FindMotifType(const TString& motifTypeID) const +{ +// Finds the motif type with the specified motif type ID. +// --- + + MotifTypeMapIterator i = fMotifTypes.find(motifTypeID); + + if (i != fMotifTypes.end()) + return (*i).second; + else + return 0; +} + +//_____________________________________________________________________________ +AliMpMotifPosition* AliMpMotifMap::FindMotifPosition(Int_t motifPositionID) const +{ +// Finds the motif position with the specified motif position ID. +// --- + + MotifPositionMapIterator i = fMotifPositions.find(motifPositionID); + + if (i != fMotifPositions.end()) + return (*i).second; + else + return 0; +} + +//_____________________________________________________________________________ +AliMpMotifPosition* AliMpMotifMap::FindMotifPosition(AliMpIntPair indices) const +{ +// Finds the last motif position which has the global indices (low limit) +// less then the indices specified. +// --- + + MotifPositionMap2Iterator found + = fMotifPositions2.lower_bound(indices); + + if (found == fMotifPositions2.end()) found--; + + MotifPositionMap2Iterator i=found; + do { + AliMpIntPair low = (*i).second->GetLowIndicesLimit(); + AliMpIntPair up = (*i).second->GetHighIndicesLimit(); + + if ( indices.GetFirst() >= low.GetFirst() && + indices.GetSecond() >= low.GetSecond() && + indices.GetFirst() <= up.GetFirst() && + indices.GetSecond() <= up.GetSecond()) + + return (*i).second; + } + while ( i-- != fMotifPositions2.begin()); + + return 0; +} diff --git a/MUON/mapping/AliMpMotifMap.h b/MUON/mapping/AliMpMotifMap.h new file mode 100755 index 00000000000..e53f85ed9cc --- /dev/null +++ b/MUON/mapping/AliMpMotifMap.h @@ -0,0 +1,82 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifMap +// ------------------- +// Class describing the motif map container, where motifs are +// mapped to their string IDs. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_MOTIF_MAP_H +#define ALI_MP_MOTIF_MAP_H + +#include + +#include +#include +#include + +#include "AliMpMotifTypes.h" +#include "AliMpIntPair.h" + +class AliMpVMotif; +class AliMpMotifType; +class AliMpMotifPosition; + +class AliMpMotifMap : public TObject +{ + public: + AliMpMotifMap(); + virtual ~AliMpMotifMap(); + + // methods + Bool_t AddMotif(AliMpVMotif* motif, Bool_t warn = true); + Bool_t AddMotifType(AliMpMotifType* motifType, Bool_t warn = true); + Bool_t AddMotifPosition(AliMpMotifPosition* motifType, Bool_t warn = true); + void FillMotifPositionMap2(); + void Print() const; + void PrintGlobalIndices(const char* fileName) const; + void UpdateGlobalIndices(const char* fileName); + + // find methods + AliMpVMotif* FindMotif(const TString& motifID) const; + AliMpVMotif* FindMotif(const TString& motifID, const TString& motifTypeID, + TVector2 padDimensions) const; + AliMpMotifType* FindMotifType(const TString& motifTypeID) const; + AliMpMotifPosition* FindMotifPosition(Int_t motifPositionID) const; + AliMpMotifPosition* FindMotifPosition(AliMpIntPair indices) const; + + private: + // methods + void PrintMotifs() const; + void PrintMotifTypes() const; + void PrintMotifPositions() const; + void PrintMotifPositions2() const; + + // unused derrived functions + virtual void Print(const char* option) const {} + +#ifdef __HP_aCC + // data members + // EXCLUDED FOR CINT (does not compile on HP) + MotifMap fMotifs; //! motifs map + MotifTypeMap fMotifTypes; //!motif types map + //MotifPositionMap fMotifPositions; //! motif positions map + // not taken by cint + map fMotifPositions; //! motif positions map by Id + MotifPositionMap2 fMotifPositions2; //! motif positions map +#else + // data members + MotifMap fMotifs; // motifs map + MotifTypeMap fMotifTypes; // motif types map + //MotifPositionMap fMotifPositions; // motif positions map + // not taken by cint + std::map fMotifPositions; // motif positions map by Id + MotifPositionMap2 fMotifPositions2; // motif positions map +#endif + + ClassDef(AliMpMotifMap,1) // motif map +}; + +#endif //ALI_MP_MOTIF_MAP_H diff --git a/MUON/mapping/AliMpMotifPainter.cxx b/MUON/mapping/AliMpMotifPainter.cxx new file mode 100755 index 00000000000..48ad555a1b1 --- /dev/null +++ b/MUON/mapping/AliMpMotifPainter.cxx @@ -0,0 +1,149 @@ +// $Id$ +// Category: graphics +// +// Class AliMpMotifPainter +// ----------------------- +// Class for drawing a motif into canvas +// +// Authors: David Guez, IPN Orsay + +#include + +#include "AliMpMotifPainter.h" +#include "AliMpGraphContext.h" +#include "AliMpMotifPosition.h" +#include "AliMpMotifType.h" +#include "AliMpConnection.h" +#include "AliMpIntPair.h" + +ClassImp(AliMpMotifPainter) + +//_______________________________________________________________________ +AliMpMotifPainter::AliMpMotifPainter() + : AliMpVPainter(), + fMotifPos(0) +{ + // default dummy constructor +} +//_______________________________________________________________________ +AliMpMotifPainter::AliMpMotifPainter(AliMpMotifPosition *motifPos) + : AliMpVPainter(), + fMotifPos(motifPos) +{ + // normal constructor + +} +//_______________________________________________________________________ +void AliMpMotifPainter::DumpObject() +{ +// Draw the owned object + fMotifPos->Dump(); + +} + +//_______________________________________________________________________ +TVector2 AliMpMotifPainter::GetPosition() const +{ +// Get the owned object's position + return fMotifPos->Position(); + +} +//_______________________________________________________________________ +TVector2 AliMpMotifPainter::GetDimensions() const +{ +// Get the owned object's dimensions + return fMotifPos->Dimensions(); + +} + +//_______________________________________________________________________ +void AliMpMotifPainter::Paint(Option_t *option) +{ +// Paint the object + AliMpGraphContext *gr = AliMpGraphContext::Instance(); + if (!fMotifPos) return; + Int_t col=gVirtualX->GetFillColor(); + gr->Push(); + gPad->Range(0.,0.,1.,1.); + InitGraphContext(); + + switch (option[0]){ + case 'T': + case 'I': + case 'X': + { + PaintWholeBox(); + Float_t textSize = gVirtualX->GetTextSize(); + gVirtualX->SetTextSize(10); + TString str; + switch (option[0]) { + case 'T' : + str = Form("%d",fMotifPos->GetID()); + break; + case 'I':{ + switch (option[1]){ + case '+' : + str = Form("(%d,%d)",fMotifPos->GetHighIndicesLimit().GetFirst(), + fMotifPos->GetHighIndicesLimit().GetSecond()); + break; + default: + str = Form("(%d,%d)",fMotifPos->GetLowIndicesLimit().GetFirst(), + fMotifPos->GetLowIndicesLimit().GetSecond()); + } + } + break; + case 'X' : + str = Form("(%f,%f)",(GetPosition()-GetDimensions()).X(), + (GetPosition()-GetDimensions()).Y()); + break; + } + gPad->PaintText(GetPadPosition().X()-0.01,GetPadPosition().Y()-0.01,str); + + gVirtualX->SetTextSize(textSize); + } + break; + case 'P': + { + //PaintWholeBox(kFALSE); + AliMpMotifType *motifType = fMotifPos->GetMotif()->GetMotifType(); + for (Int_t j=motifType->GetNofPadsY()-1;j>=0;j--){ + for (Int_t i=0;iGetNofPadsX();i++){ + AliMpIntPair indices = AliMpIntPair(i,j); + AliMpConnection* connect = + motifType->FindConnectionByLocalIndices(indices); + if (connect){ + TVector2 realPadPos = + GetPosition()+fMotifPos->GetMotif()->PadPositionLocal(indices); + TVector2 padPadPos,padPadDim; + gr->RealToPad(realPadPos, + fMotifPos->GetMotif()->GetPadDimensions(indices), + padPadPos,padPadDim); + TVector2 bl = padPadPos - padPadDim; + TVector2 ur = padPadPos + padPadDim; + + + Style_t sty = gVirtualX->GetFillStyle(); + gVirtualX->SetFillStyle(1); + gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y()); + gVirtualX->SetFillStyle(0); + gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y()); + gVirtualX->SetFillStyle(sty); + if (option[1]=='T'){ + Float_t textSize = gVirtualX->GetTextSize(); + gVirtualX->SetTextSize(10); + gPad->PaintText(padPadPos.X()-0.01,padPadPos.Y()-0.01, + Form("%d",connect->GetGassiNum())); + + gVirtualX->SetTextSize(textSize); + } + } + } + } + } + break; + default: + PaintWholeBox(kFALSE); + } + gr->Pop(); + gVirtualX->SetFillColor(col); +} diff --git a/MUON/mapping/AliMpMotifPainter.h b/MUON/mapping/AliMpMotifPainter.h new file mode 100755 index 00000000000..5f3cb8f89b7 --- /dev/null +++ b/MUON/mapping/AliMpMotifPainter.h @@ -0,0 +1,32 @@ +// $Id$ +// Category: graphics +// +// Class AliMpMotifPainter +// ----------------------- +// Class for drawing a motif into canvas +// +// Authors: David Guez, IPN Orsay + +#ifndef ALI_MP_MOTIF_PAINTER_H +#define ALI_MP_MOTIF_PAINTER_H + +#include "AliMpVPainter.h" + +class AliMpMotifPosition; + +class AliMpMotifPainter : public AliMpVPainter +{ + public: + AliMpMotifPainter(); + AliMpMotifPainter(AliMpMotifPosition *motifPos); + virtual void DumpObject(); //-MENU- + virtual void Paint(Option_t *option); + virtual TVector2 GetPosition() const; + virtual TVector2 GetDimensions() const; + + private: + AliMpMotifPosition *fMotifPos; // the motif to draw + + ClassDef(AliMpMotifPainter,1) // Motif painter +}; +#endif //ALI_MP_MOTIF_PAINTER_H diff --git a/MUON/mapping/AliMpMotifPosition.cxx b/MUON/mapping/AliMpMotifPosition.cxx new file mode 100755 index 00000000000..b4b11e53828 --- /dev/null +++ b/MUON/mapping/AliMpMotifPosition.cxx @@ -0,0 +1,57 @@ +// $Id$ +// +// Author: Ivana Hrivnacova, IPN Orsay + +#include "AliMpMotifPosition.h" +#include "AliMpMotifPositionPadIterator.h" +#include "AliMpMotifType.h" + +ClassImp(AliMpMotifPosition) + +//______________________________________________________________________________ +AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif, + TVector2 position) + : AliMpVIndexed(), + fID(id), + fMotif(motif), + fPosition(position) { +// +} + +//______________________________________________________________________________ +AliMpMotifPosition::AliMpMotifPosition() + : AliMpVIndexed(), + fID(0), + fMotif(0), + fPosition(TVector2(0.,0.)) { +// +} + +//______________________________________________________________________________ +AliMpMotifPosition::~AliMpMotifPosition(){ +// +} + +//______________________________________________________________________________ +AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const +{ +// Iterator is not yet implemented. +// + + return new AliMpMotifPositionPadIterator(this); +} + +//______________________________________________________________________________ +Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const +{ +// Returns true if pad with the specified indices exists in +// this motif position. +// --- + + if (!HasIndices(indices)) return kFALSE; + + if (fMotif->GetMotifType()->IsFull()) return kTRUE; + + return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit()); +} + diff --git a/MUON/mapping/AliMpMotifPosition.h b/MUON/mapping/AliMpMotifPosition.h new file mode 100755 index 00000000000..bd3077e49c6 --- /dev/null +++ b/MUON/mapping/AliMpMotifPosition.h @@ -0,0 +1,63 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifPosition +// ------------------------ +// Class that represents a placed motif. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_MOTIF_POSITION_H +#define ALI_MP_MOTIF_POSITION_H + +#include + +#include "AliMpVIndexed.h" +#include "AliMpVMotif.h" + +class AliMpVPadIterator; + +class AliMpMotifPosition : public AliMpVIndexed +{ + public: + AliMpMotifPosition(Int_t id, AliMpVMotif* motif, TVector2 position); + AliMpMotifPosition(); + virtual ~AliMpMotifPosition(); + + // methods + virtual AliMpVPadIterator* CreateIterator() const; + + // get methods + Int_t GetID() const; + AliMpVMotif* GetMotif() const; + Bool_t HasPad(const AliMpIntPair& indices) const; + + // Geometry + TVector2 Position() const; + TVector2 Dimensions() const; + + private: + // methods + // data members + Int_t fID; //identifier + AliMpVMotif* fMotif; //motif + TVector2 fPosition; //position + + ClassDef(AliMpMotifPosition,1) // A motif position +}; + +// inline functions + +inline Int_t AliMpMotifPosition::GetID() const +{ return fID; } + +inline AliMpVMotif* AliMpMotifPosition::GetMotif() const +{ return fMotif; } + +inline TVector2 AliMpMotifPosition::Position() const +{ return fPosition; } + +inline TVector2 AliMpMotifPosition::Dimensions() const +{ return fMotif->Dimensions(); } + +#endif //ALI_MP_MOTIF_POSITION_H diff --git a/MUON/mapping/AliMpMotifPositionPadIterator.cxx b/MUON/mapping/AliMpMotifPositionPadIterator.cxx new file mode 100755 index 00000000000..c9cb635d490 --- /dev/null +++ b/MUON/mapping/AliMpMotifPositionPadIterator.cxx @@ -0,0 +1,143 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifPositionPadIterator +// ----------------------------------- +// Class, which defines an iterator over the pads of a given motif type +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include "AliMpMotifPositionPadIterator.h" +#include "AliMpMotifPosition.h" +#include "AliMpMotifType.h" +#include "AliMpConnection.h" + +ClassImp(AliMpMotifPositionPadIterator) + +//______________________________________________________________________________ +AliMpMotifPositionPadIterator::AliMpMotifPositionPadIterator(): + AliMpVPadIterator(), + fMotifPos(0), + fIterator() +{ +// default constructor, set the current position to "invalid" +} + +//______________________________________________________________________________ + +AliMpMotifPositionPadIterator::AliMpMotifPositionPadIterator( + const AliMpMotifPosition* motifPos) + : AliMpVPadIterator(), + fMotifPos(motifPos), + fIterator(motifPos->GetMotif()->GetMotifType()) +{ +// normal constructor, let *this to invalid position +} + +//______________________________________________________________________________ +AliMpMotifPositionPadIterator::AliMpMotifPositionPadIterator( + const AliMpMotifPositionPadIterator& right) + : AliMpVPadIterator(right), + fMotifPos(right.fMotifPos), + fIterator(right.fIterator) + +{ +// copy constructor +} + +//______________________________________________________________________________ +AliMpMotifPositionPadIterator::~AliMpMotifPositionPadIterator() +{ +// destructor +} + +// operators + +//______________________________________________________________________________ +AliMpMotifPositionPadIterator& +AliMpMotifPositionPadIterator::operator = (const AliMpMotifPositionPadIterator& right) +{ +// assignement operator +// if the right hand iterator isn't of good type +// the current operator is invalidated + + // check assignement to self + if (this == &right) return *this; + + // base class assignement + AliMpVPadIterator::operator=(right); + + fMotifPos = right.fMotifPos; + fIterator = right.fIterator; + + return *this; +} + +//private methods + + +//______________________________________________________________________________ +Bool_t AliMpMotifPositionPadIterator::IsValid() const +{ +// Is the iterator in a valid position? + + return (fMotifPos!=0) && (!fIterator.IsDone()); +} + +//public methods + +//______________________________________________________________________________ +void AliMpMotifPositionPadIterator::First() +{ +// Reset the iterator, so that it points to the first available +// pad in the motif type + + if (!fMotifPos) { + Invalidate(); + return ; + } + + fIterator.First(); + return; +} + +//______________________________________________________________________________ +void AliMpMotifPositionPadIterator::Next() +{ +// Move the iterator to the next valid pad. + fIterator.Next(); +} + +//______________________________________________________________________________ +Bool_t AliMpMotifPositionPadIterator::IsDone() const +{ +// + return !IsValid(); +} + +//______________________________________________________________________________ +AliMpPad AliMpMotifPositionPadIterator::CurrentItem() const +{ +// Returns current pad. + + if (!fMotifPos) + return AliMpPad::Invalid(); + else { + AliMpIntPair ind = fIterator.CurrentItem().GetIndices(); + AliMpMotifType* mt = fMotifPos->GetMotif()->GetMotifType(); + AliMpConnection* connect = + mt->FindConnectionByLocalIndices(ind); + return AliMpPad(AliMpIntPair(fMotifPos->GetID(),connect->GetGassiNum()), + fMotifPos->GlobalIndices(ind), + fMotifPos->Position()+fMotifPos->GetMotif()->PadPositionLocal(ind), + fMotifPos->GetMotif()->GetPadDimensions(ind)); + } +} + +//______________________________________________________________________________ +void AliMpMotifPositionPadIterator::Invalidate() +{ +// Let the iterator points to the invalid position + fIterator.Invalidate(); +} + diff --git a/MUON/mapping/AliMpMotifPositionPadIterator.h b/MUON/mapping/AliMpMotifPositionPadIterator.h new file mode 100755 index 00000000000..ab0d7933164 --- /dev/null +++ b/MUON/mapping/AliMpMotifPositionPadIterator.h @@ -0,0 +1,48 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifPositionPadIterator +// ----------------------------------- +// Class, which defines an iterator over the pads of a given motif type +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_MOTIF_POSITION_PAD_ITERATOR_H +#define ALI_MP_MOTIF_POSITION_PAD_ITERATOR_H + +#include "AliMpVPadIterator.h" +#include "AliMpIntPair.h" +#include "AliMpMotifTypePadIterator.h" + +class AliMpMotifPosition; + +class AliMpMotifPositionPadIterator : public AliMpVPadIterator +{ + public: + AliMpMotifPositionPadIterator(); + AliMpMotifPositionPadIterator(const AliMpMotifPosition* motifPos); + AliMpMotifPositionPadIterator(const AliMpMotifPositionPadIterator& right); + virtual ~AliMpMotifPositionPadIterator(); + + // operators + AliMpMotifPositionPadIterator& + operator = (const AliMpMotifPositionPadIterator& right); + + virtual void First(); + virtual void Next(); + virtual Bool_t IsDone() const; + virtual AliMpPad CurrentItem() const; + virtual void Invalidate(); + + private: + // private methods + Bool_t IsValid() const; + + // private data members + const AliMpMotifPosition* fMotifPos; // the AliMpMotifPosition over which iterate + AliMpMotifTypePadIterator fIterator; // Iterator over the motif type + + ClassDef(AliMpMotifPositionPadIterator,1) // iterator over motif's pads +}; + +#endif // ALI_MP_MOTIF_POSITION_PAD_ITERATOR_H diff --git a/MUON/mapping/AliMpMotifSpecial.cxx b/MUON/mapping/AliMpMotifSpecial.cxx new file mode 100755 index 00000000000..216c3c0514e --- /dev/null +++ b/MUON/mapping/AliMpMotifSpecial.cxx @@ -0,0 +1,217 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifSpecial +// ----------------------- +// Class that defines a motif with its unique ID +// and the motif type. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include "AliMpMotifSpecial.h" +#include "AliMpMotifType.h" +#include "AliMpIntPair.h" +#include "AliMpConstants.h" + +ClassImp(AliMpMotifSpecial) + + +// private methods +//______________________________________________________________________________ +Int_t AliMpMotifSpecial::VectorIndex(const AliMpIntPair& indices) const +{ +// transform indices to linear vector index + return indices.GetFirst()*GetMotifType()->GetNofPadsY() + indices.GetSecond(); +} + + + +//public methods +//______________________________________________________________________________ +AliMpMotifSpecial::AliMpMotifSpecial(): + AliMpVMotif(), + fPadDimensionsVector(), + fPadDimensionsVector2() +{ + //default dummy constructor +} + + +//______________________________________________________________________________ +AliMpMotifSpecial::AliMpMotifSpecial(const TString &id, + AliMpMotifType *motifType) + : AliMpVMotif(id,motifType), + fPadDimensionsVector(), + fPadDimensionsVector2() + +{ + // Normal constructor. + + fPadDimensionsVector.resize(motifType->GetNofPadsX()*motifType->GetNofPadsY()); +} + +//______________________________________________________________________________ +TVector2 +AliMpMotifSpecial::GetPadDimensions(const AliMpIntPair& localIndices) const +{ +// returns the dimensions of pad located at the given indices + if (GetMotifType()->HasPad(localIndices)) + return fPadDimensionsVector[VectorIndex(localIndices)]; + else { + Warning("GetPadDimensions","Indices outside limits"); + return TVector2(0.,0.); + } +} + +//______________________________________________________________________________ +Int_t AliMpMotifSpecial::GetNofPadDimensions() const +{ +// returns number of different pad dimensions in this motif + + return fPadDimensionsVector2.size(); +} + +//______________________________________________________________________________ +TVector2 AliMpMotifSpecial::GetPadDimensions(Int_t i) const +{ +// returns the i-th different pad dimensions + + if (i<0 || i>GetNofPadDimensions()) { + Fatal("GetPadDimensions(i)", "Index outside limits."); + return TVector2(); + } + + return fPadDimensionsVector2[i]; +} + +//______________________________________________________________________________ +TVector2 AliMpMotifSpecial::Dimensions() const +{ + // gives the dimension of the motif + + + Int_t i,j; + Double_t sizeY=0.; + Double_t sizeX=0.; + + Double_t* tabSizeX = new Double_t[GetMotifType()->GetNofPadsY()]; + for (j=0;jGetNofPadsY();++j) tabSizeX[j]=0.0; + + for (i=0;iGetNofPadsX();++i) { + Double_t trSizeY=0.; + for (j=0;jGetNofPadsY();++j) { + TVector2 dim = GetPadDimensions(AliMpIntPair(i,j)); + trSizeY+=dim.Y(); + tabSizeX[j]+=dim.X(); + } + if (trSizeY>sizeY) sizeY=trSizeY; + } + for (j=0;jGetNofPadsY();++j) { + if (tabSizeX[j]>sizeX) sizeX = tabSizeX[j]; + } + + delete tabSizeX; + + return TVector2(sizeX,sizeY); +} + +//______________________________________________________________________________ +TVector2 +AliMpMotifSpecial::PadPositionLocal(const AliMpIntPair& localIndices) const +{ + // gives the local position of the pad number (ix,iy) + // (0,0 is the center of the motif) + + TVector2 dim = GetPadDimensions(localIndices); + + Double_t posX= dim.X(); + for (Int_t i=0;iGetNofPadsY()) { + TVector2 padDim = GetPadDimensions(AliMpIntPair(0,j)); + y-=2.*padDim.Y(); + if (y<0.) break; + j++; + } + + // Test if it's outside limits + if (j==GetMotifType()->GetNofPadsY()){ + Warning("PadIndicesLocal","The position is outside the motif"); + return AliMpIntPair::Invalid(); + } + + + // now find the i index, in the j_th row + Int_t i=0; + Double_t x=pos.X(); + + while (iGetNofPadsX()) { + TVector2 padDim = GetPadDimensions(AliMpIntPair(i,j)); + x-=2.*padDim.X(); + if (x<0.) break; + i++; + } + + + // Test if it's outside limits + + if (i==GetMotifType()->GetNofPadsX()){ + Warning("PadIndicesLocal","The position is outside the motif"); + return AliMpIntPair::Invalid(); + } + + // then return the found (i,j) + return AliMpIntPair(i,j); +} +//______________________________________________________________________________ +void AliMpMotifSpecial::SetPadDimensions(const AliMpIntPair& localIndices, + const TVector2& dimensions) +{ + // set the dimensions of the pad located at to the given + // + + if ( !GetMotifType()->HasPad(localIndices)){ + Warning("SetPadDimensions","Pad indices outside limits"); + return; + } + + // fill the dimensions map vector + fPadDimensionsVector[VectorIndex(localIndices)]=dimensions; + + // fill the vector of different pad dimensions + // only if these dimensions are not yet present + Bool_t isPresent = false; + for (Int_t i=0; i +#include +#include + +#include "AliMpMotifTypes.h" +#include "AliMpVMotif.h" + +class AliMpMotifSpecial : public AliMpVMotif +{ + public: + AliMpMotifSpecial(const TString &id, AliMpMotifType *motifType); + AliMpMotifSpecial(); + + // Access methods + virtual TVector2 GetPadDimensions(const AliMpIntPair& localIndices) const; + virtual Int_t GetNofPadDimensions() const; + virtual TVector2 GetPadDimensions(Int_t i) const; + + // Set methods + void SetPadDimensions(const AliMpIntPair& localIndices, + const TVector2& dimensions); + + // Geometry + virtual TVector2 Dimensions() const; + + // Other methods + virtual TVector2 PadPositionLocal(const AliMpIntPair& localIndices) const; + virtual AliMpIntPair PadIndicesLocal(const TVector2& localPos) const; + + private: + + // methods + Int_t VectorIndex(const AliMpIntPair& indices) const; + + // data members + DimensionsMap fPadDimensionsVector; // the vector of pad dimensions + DimensionsMap fPadDimensionsVector2; // the vector of different pad dimensions + + ClassDef(AliMpMotifSpecial,1) // A motif with its ID +}; + +#endif //ALI_MP_MOTIF_SPECIAL_H diff --git a/MUON/mapping/AliMpMotifType.cxx b/MUON/mapping/AliMpMotifType.cxx new file mode 100755 index 00000000000..2f6eade16a9 --- /dev/null +++ b/MUON/mapping/AliMpMotifType.cxx @@ -0,0 +1,273 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifType +// -------------------- +// Class that defines the motif properties. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpMotifType.h" +#include "AliMpMotifTypePadIterator.h" +#include "AliMpConnection.h" + +ClassImp(AliMpMotifType) + +const Int_t AliMpMotifType::fgkPadNumForA = 65; + + + +//______________________________________________________________________________ +AliMpMotifType::AliMpMotifType(const TString &id) + : TObject(), + fID(id), + fNofPadsX(0), + fNofPadsY(0), + fVerboseLevel(0), + fConnections() +{ + // Constructor +} + +//______________________________________________________________________________ +AliMpMotifType::AliMpMotifType() + : TObject(), + fID(""), + fNofPadsX(0), + fNofPadsY(0), + fVerboseLevel(0), + fConnections() +{ + // Default constructor (dummy) +} + +//______________________________________________________________________________ +AliMpMotifType::~AliMpMotifType() { +// Destructor + + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + delete i->second; + + fConnections.erase(fConnections.begin(),fConnections.end()); +} + +//______________________________________________________________________________ +AliMpVPadIterator* AliMpMotifType::CreateIterator() const +{ + return new AliMpMotifTypePadIterator(this); +} + +//______________________________________________________________________________ +void AliMpMotifType::SetNofPads(Int_t nofPadsX, Int_t nofPadsY) +{ + // Change the number of pads in this motif + + fNofPadsX = nofPadsX; + fNofPadsY = nofPadsY; +} + + +//______________________________________________________________________________ +Int_t AliMpMotifType::PadNum(const TString &padName) const +{ + // Transform a pad name into the equivalent pad number + if ( (padName[0]>='A') && (padName[0]<='Z') ) + return fgkPadNumForA+padName[0]-'A'; + else + return atoi(padName.Data()); +} + +//______________________________________________________________________________ +TString AliMpMotifType::PadName(Int_t padNum) const +{ + // Transform a pad number into its equivalent pad name + if (padNumSetOwner(this); +} +//______________________________________________________________________________ +AliMpConnection *AliMpMotifType::FindConnectionByPadNum(Int_t padNum) const +{ + // Retrive the AliMpConnection pointer from its pad num + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetPadNum()==padNum) return i->second; + return 0; +} + +//______________________________________________________________________________ +AliMpConnection *AliMpMotifType::FindConnectionByLocalIndices( + AliMpIntPair localIndices) const +{ + if (!localIndices.IsValid()) return 0; + + // Retrive the AliMpConnection pointer from its position (in pad unit) + ConnectionMap_t::const_iterator i = fConnections.find(localIndices); + if (i != fConnections.end()) + return i->second; + else return 0; +} + +//______________________________________________________________________________ +AliMpConnection *AliMpMotifType::FindConnectionByGassiNum(Int_t gassiNum) const +{ + // return the connection for the given gassiplex number + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetGassiNum()==gassiNum) return i->second; + return 0; +} +//______________________________________________________________________________ +AliMpConnection *AliMpMotifType::FindConnectionByKaptonNum(Int_t kaptonNum) const +{ + // Gives the connection related to the given kapton number + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetKaptonNum()==kaptonNum) return i->second; + return 0; +} +//______________________________________________________________________________ +AliMpConnection *AliMpMotifType::FindConnectionByBergNum(Int_t bergNum) const +{ + // Retrieve the connection from a Berg connector number + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetBergNum()==bergNum) return i->second; + return 0; +} + + +//______________________________________________________________________________ +AliMpIntPair AliMpMotifType::FindLocalIndicesByConnection( + const AliMpConnection* connection) +{ + // Retrieve the pad position from the connection pointer. + // Not to be used widely, since it use a search in the + // connection list... + + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second==connection) return i->first; + + return AliMpIntPair::Invalid(); +} + +//______________________________________________________________________________ +AliMpIntPair AliMpMotifType::FindLocalIndicesByPadNum(Int_t padNum) const +{ + // Retrive the AliMpConnection pointer from its pad num + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetPadNum()==padNum) return i->first; + + return AliMpIntPair::Invalid(); +} + +//______________________________________________________________________________ +AliMpIntPair AliMpMotifType::FindLocalIndicesByGassiNum(Int_t gassiNum) const +{ + // return the connection for the given gassiplex number + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetGassiNum()==gassiNum) return i->first; + + return AliMpIntPair::Invalid(); +} + +//______________________________________________________________________________ +AliMpIntPair AliMpMotifType::FindLocalIndicesByKaptonNum(Int_t kaptonNum) const +{ + // Gives the connection related to the given kapton number + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetKaptonNum()==kaptonNum) return i->first; + + return AliMpIntPair::Invalid(); +} + +//______________________________________________________________________________ +AliMpIntPair AliMpMotifType::FindLocalIndicesByBergNum(Int_t bergNum) const +{ + // Retrieve the connection from a Berg connector number + for(ConnectionMap_t::const_iterator i = fConnections.begin(); + i!=fConnections.end();++i) + if (i->second->GetBergNum()==bergNum) return i->first; + + return AliMpIntPair::Invalid(); +} + +//______________________________________________________________________________ +Bool_t AliMpMotifType::HasPad(const AliMpIntPair& localIndices) const +{ + if (!localIndices.IsValid()) return false; + + // return true if the pad indexed by has a connection + return fConnections.find(localIndices)!=fConnections.end(); + +} + +//______________________________________________________________________________ +void AliMpMotifType::Print(Option_t *option) const +{ + // Print the map of the motif. In each cel, the value + // printed depends of option, as the following: + // option="N" the "name" of the pad is written + // option="K" the Kapton connect. number attached to the pad is written + // option="B" the Berg connect. number attached to the pad is written + // option="G" the Gassiplex channel number attached to the pad is written + // otherwise the number of the pad is written + + // NOTE : this method is really not optimized, in case 'N' or '', + // but the Print() this should not be very important in a Print() method + + switch (option[0]){ + case 'N':cout<<"Name mapping"; + break; + case 'K':cout<<"Kapton mapping"; + break; + case 'B':cout<<"Berg mapping"; + break; + case 'G':cout<<"Gassiplex number mapping"; + break; + default:cout<<"Pad mapping"; + } + cout<<" in the motif "<=0;j--){ + for (Int_t i=0;iGetPadNum()); + break; + case 'K':str=Form("%d",connexion->GetKaptonNum()); + break; + case 'B':str=Form("%d",connexion->GetBergNum()); + break; + case 'G':str=Form("%d",connexion->GetGassiNum()); + break; + default:str= Form("%d",connexion->GetPadNum()); + } + cout< +#include +#include +#include + +#include "AliMpMotifTypes.h" +#include "AliMpIntPair.h" + +class AliMpConnection; +class AliMpVPadIterator; + +class AliMpMotifType : public TObject +{ + public: + AliMpMotifType(const TString &id); + AliMpMotifType(); + virtual ~AliMpMotifType(); + + virtual AliMpVPadIterator* CreateIterator() const; + + // find methods + AliMpConnection *FindConnectionByPadNum(Int_t padNum) const; + AliMpConnection *FindConnectionByLocalIndices(AliMpIntPair localIndices) const; + AliMpConnection *FindConnectionByGassiNum(Int_t gassiNum) const; + AliMpConnection *FindConnectionByKaptonNum(Int_t kaptonNum) const; + AliMpConnection *FindConnectionByBergNum(Int_t bergNum) const; + + AliMpIntPair FindLocalIndicesByPadNum(Int_t padNum) const; + AliMpIntPair FindLocalIndicesByGassiNum(Int_t gassiNum) const; + AliMpIntPair FindLocalIndicesByKaptonNum(Int_t kaptonNum) const; + AliMpIntPair FindLocalIndicesByBergNum(Int_t bergNum) const; + AliMpIntPair FindLocalIndicesByConnection(const AliMpConnection* connection); + + // set methods + void SetNofPads(Int_t nofPadsX, Int_t nofPadY); + void SetVerboseLevel(Int_t level){fVerboseLevel=level;} + + // get methods + TString GetID() const {return fID;} + Int_t GetNofPadsX() const {return fNofPadsX;} + Int_t GetNofPadsY() const {return fNofPadsY;} + Int_t GetNofPads() const {return fConnections.size();} + + // Other methods + void AddConnection(const AliMpIntPair &localIndices, + AliMpConnection* connection); + virtual void Print(Option_t *option) const; + Int_t PadNum(const TString &padName) const; + TString PadName(Int_t padNum) const; + Bool_t HasPad(const AliMpIntPair& localIndices) const; + Bool_t IsFull() const; + + private: + // static data members + static const Int_t fgkPadNumForA; + + // data members + TString fID; // unique motif ID + Int_t fNofPadsX; // number of pads in x direction + Int_t fNofPadsY; // number of pads in y direction + Int_t fVerboseLevel; // verbose level + + ConnectionMap_t fConnections; //! Map (ix,iy) of connections + // EXCLUDED FOR CINT (does not compile on HP) + + ClassDef(AliMpMotifType,1) //Motif type +}; + +// inline functions + +inline Bool_t AliMpMotifType::IsFull() const +{ return GetNofPads() == fNofPadsX*fNofPadsY; } + +#endif //ALI_MP_MOTIF_TYPE_H + diff --git a/MUON/mapping/AliMpMotifTypePadIterator.cxx b/MUON/mapping/AliMpMotifTypePadIterator.cxx new file mode 100755 index 00000000000..a77aa84ae02 --- /dev/null +++ b/MUON/mapping/AliMpMotifTypePadIterator.cxx @@ -0,0 +1,178 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifTypePadIterator +// ------------------------------- +// Class, which defines an iterator over the pads of a given motif type +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include "AliMpMotifTypePadIterator.h" +#include "AliMpMotifType.h" + +ClassImp(AliMpMotifTypePadIterator) + +//______________________________________________________________________________ +AliMpMotifTypePadIterator::AliMpMotifTypePadIterator(): + AliMpVPadIterator(), + fMotifType(0), + fCurrentPosition(AliMpIntPair::Invalid()) +{ +// default constructor, set the current position to "invalid" +} + +//______________________________________________________________________________ +AliMpMotifTypePadIterator::AliMpMotifTypePadIterator( + const AliMpMotifType* motifType) + : AliMpVPadIterator(), + fMotifType(motifType), + fCurrentPosition(AliMpIntPair::Invalid()) +{ +// normal constructor, let *this to invalid position +} + +//______________________________________________________________________________ +AliMpMotifTypePadIterator::AliMpMotifTypePadIterator( + const AliMpMotifTypePadIterator& right) + : AliMpVPadIterator(right), + fMotifType(right.fMotifType), + fCurrentPosition(right.fCurrentPosition) + +{ +// copy constructor +} + +//______________________________________________________________________________ +AliMpMotifTypePadIterator::~AliMpMotifTypePadIterator() +{ +// destructor +} + +// operators + +//______________________________________________________________________________ +AliMpMotifTypePadIterator& +AliMpMotifTypePadIterator::operator = (const AliMpMotifTypePadIterator& right) +{ +// assignement operator +// if the right hand iterator isn't of good type +// the current operator is invalidated + + // check assignement to self + if (this == &right) return *this; + + // base class assignement + AliMpVPadIterator::operator=(right); + + fMotifType = right.fMotifType; + fCurrentPosition = right.fCurrentPosition; + + return *this; +} + +// +//private methods +// + +//______________________________________________________________________________ +AliMpIntPair +AliMpMotifTypePadIterator::FindFirstPadInLine(AliMpIntPair indices) const +{ +// Find the indices of the first pad in the same line +// as the , and in column, at least equal, to the +// one of + + if (!fMotifType) return AliMpIntPair::Invalid(); + + while (indices.GetFirst() < fMotifType->GetNofPadsX()) { + if (fMotifType->HasPad(indices)) return indices; + indices += AliMpIntPair(1,0); + } + return AliMpIntPair::Invalid(); +} + +//______________________________________________________________________________ +Bool_t AliMpMotifTypePadIterator::IsValid() const +{ +// Is the iterator in a valid position? + + return fMotifType!=0 && fCurrentPosition.IsValid(); +} + +// +//public methods +// + +//______________________________________________________________________________ +void AliMpMotifTypePadIterator::First() +{ +// Reset the iterator, so that it points to the first available +// pad in the motif type + + if (!fMotifType) { + Invalidate(); + return ; + } + fCurrentPosition = AliMpIntPair(0,0); + if (fMotifType->HasPad(fCurrentPosition)) return; + + + // if (0,0) is not available + // place itself to the first avalable motif after (0,0) (if exists) + // ++(*this); + Next(); + + return; +} + +//______________________________________________________________________________ +void AliMpMotifTypePadIterator::Next() +{ +// Move the iterator to the next valid pad. + + //if (!IsValid()) return *this; + if (!IsValid()) return; + + while (fCurrentPosition.GetSecond() < fMotifType->GetNofPadsY()){ + AliMpIntPair nextTry + = FindFirstPadInLine(fCurrentPosition + AliMpIntPair(1,0)); + if (nextTry.IsValid()){ + fCurrentPosition = nextTry; + return; + } + fCurrentPosition.SetFirst(-1); + fCurrentPosition.SetSecond(fCurrentPosition.GetSecond()+1); + } + + // if the loop is finished, there's not available pads at all... + Invalidate(); + return; +} + +//______________________________________________________________________________ +Bool_t AliMpMotifTypePadIterator::IsDone() const +{ +// + return !IsValid(); +} + +//______________________________________________________________________________ +AliMpPad AliMpMotifTypePadIterator::CurrentItem() const +{ +// Returns current pad. + + if (!fMotifType) + return AliMpPad::Invalid(); + else + return AliMpPad(AliMpIntPair::Invalid(), + fCurrentPosition,TVector2(),TVector2()); +} + +//______________________________________________________________________________ +void AliMpMotifTypePadIterator::Invalidate() +{ +// Let the iterator points to the invalid position + fCurrentPosition = AliMpIntPair::Invalid(); + +} + diff --git a/MUON/mapping/AliMpMotifTypePadIterator.h b/MUON/mapping/AliMpMotifTypePadIterator.h new file mode 100755 index 00000000000..e63c8e7bb40 --- /dev/null +++ b/MUON/mapping/AliMpMotifTypePadIterator.h @@ -0,0 +1,49 @@ +// $Id$ +// Category: motif +// +// Class AliMpMotifTypePadIterator +// ------------------------------- +// Class, which defines an iterator over the pads of a given motif type +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_MOTIF_TYPE_PAD_ITERATOR_H +#define ALI_MP_MOTIF_TYPE_PAD_ITERATOR_H + +#include "AliMpVPadIterator.h" +#include "AliMpIntPair.h" + +class AliMpMotifType; + +class AliMpMotifTypePadIterator : public AliMpVPadIterator +{ + public: + AliMpMotifTypePadIterator(); + AliMpMotifTypePadIterator(const AliMpMotifType* motifType); + AliMpMotifTypePadIterator(const AliMpMotifTypePadIterator& right); + virtual ~AliMpMotifTypePadIterator(); + + // operators + AliMpMotifTypePadIterator& + operator = (const AliMpMotifTypePadIterator& right); + + virtual void First(); + virtual void Next(); + virtual Bool_t IsDone() const; + virtual AliMpPad CurrentItem() const; + virtual void Invalidate(); + + private: + // private methods + AliMpIntPair FindFirstPadInLine(AliMpIntPair indices) const; + Bool_t IsValid() const; + + // private data members + const AliMpMotifType* fMotifType;// the motif type over which iterate + AliMpIntPair fCurrentPosition; //! the current position inside the motif type + // EXCLUDED FOR CINT (does not compile on HP) + + ClassDef(AliMpMotifTypePadIterator,1) // iterator over motif's pads +}; + +#endif // ALI_MP_MOTIF_TYPE_PAD_ITERATOR_H diff --git a/MUON/mapping/AliMpMotifTypes.h b/MUON/mapping/AliMpMotifTypes.h new file mode 100644 index 00000000000..b1da32cdeb4 --- /dev/null +++ b/MUON/mapping/AliMpMotifTypes.h @@ -0,0 +1,49 @@ +// $Id$ +// Category: motif +// +// AliMpMotifTypes +// --------------- +// Sytem dependent types definitions for motif category. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_MOTIF_TYPES_H +#define ALI_MP_MOTIF_TYPES_H + +#include +#include + +#include + +#include "AliMpIntPair.h" + +class AliMpConnection; +class AliMpVMotif; +class AliMpMotifType; +class AliMpMotifPosition; + +#ifdef __HP_aCC + typedef map ConnectionMap_t; + typedef map MotifMap; + typedef MotifMap::const_iterator MotifMapIterator; + typedef map MotifTypeMap; + typedef MotifTypeMap::const_iterator MotifTypeMapIterator; + typedef map MotiPositionMap; + typedef MotiPositionMap::const_iterator MotifPositionMapIterator; + typedef map MotifPositionMap2; + typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator; + typedef vector DimensionsMap; +#else + typedef std::map< AliMpIntPair, AliMpConnection* > ConnectionMap_t; + typedef std::map MotifMap; + typedef MotifMap::const_iterator MotifMapIterator; + typedef std::map MotifTypeMap; + typedef MotifTypeMap::const_iterator MotifTypeMapIterator; + typedef std::map MotiPositionMap; + typedef MotiPositionMap::const_iterator MotifPositionMapIterator; + typedef std::map MotifPositionMap2; + typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator; + typedef std::vector< TVector2 > DimensionsMap; +#endif + +#endif //ALI_MP_MOTIF_TYPES_H diff --git a/MUON/mapping/AliMpNeighboursPadIterator.cxx b/MUON/mapping/AliMpNeighboursPadIterator.cxx new file mode 100755 index 00000000000..1219d36e241 --- /dev/null +++ b/MUON/mapping/AliMpNeighboursPadIterator.cxx @@ -0,0 +1,288 @@ +// $Id$ +// Category: sector +// +// Class AliMpNeighboursPadIterator +// -------------------------------- +// Class, which defines an iterator over the pads surrounding a given pad +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include + +#include "AliMpNeighboursPadIterator.h" +#include "AliMpIntPair.h" +#include "AliMpSectorSegmentation.h" +#include "AliMpRow.h" +#include "AliMpConstants.h" + +ClassImp(AliMpNeighboursPadIterator) + +const UInt_t AliMpNeighboursPadIterator::fgkInvalidIndex = 9999; + //never so much neighbours... + +//______________________________________________________________________________ +AliMpNeighboursPadIterator::AliMpNeighboursPadIterator() + : AliMpVPadIterator(), + fkSegmentation(0), + fCenterPad(AliMpPad::Invalid()), + fPads(), + fIndex(fgkInvalidIndex) +{ +// default constructor, set the current position to "invalid" +} + +//______________________________________________________________________________ +AliMpNeighboursPadIterator::AliMpNeighboursPadIterator( + const AliMpSectorSegmentation* segmentation, + const AliMpPad& centerPad, + Bool_t includeCenter) + : AliMpVPadIterator(), + fkSegmentation(segmentation), + fCenterPad(centerPad), + fIndex(fgkInvalidIndex) +{ +// normal constructor, set *this to invalid position + + FillPadsVector(includeCenter); +} + +//______________________________________________________________________________ +AliMpNeighboursPadIterator::AliMpNeighboursPadIterator( + const AliMpNeighboursPadIterator& right) + : AliMpVPadIterator(right) +{ +// copy constructor + + *this = right; +} + +//______________________________________________________________________________ +AliMpNeighboursPadIterator::~AliMpNeighboursPadIterator() +{ +// destructor +} + +// operators + +//______________________________________________________________________________ +AliMpNeighboursPadIterator& +AliMpNeighboursPadIterator::operator = (const AliMpNeighboursPadIterator& right) +{ +// assignement operator +// if the right hand iterator isn't of good type +// the current operator is invalidated + + // check assignement to self + if (this == &right) return *this; + + // base class assignement + AliMpVPadIterator::operator=(right); + + fkSegmentation = right.fkSegmentation; + fCenterPad = right.fCenterPad; + fPads = right.fPads; + fIndex = right.fIndex; + + + return *this; +} + +//private methods + +//______________________________________________________________________________ +Bool_t AliMpNeighboursPadIterator::IsNeighbours(const AliMpPad& pad) const +{ +// true if the pad located by is a neighbours of those +// located at + + + TVector2 relPos = pad.Position() - fCenterPad.Position(); + TVector2 bounds = pad.Dimensions() + fCenterPad.Dimensions(); + return (TMath::Abs(relPos.X())- bounds.X(), in a given line +// starting from and moving by + + AliMpPad current = from; + PadVector ans; + Bool_t cont=kTRUE; + do { + if (IsNeighbours(current)) + ans.push_back(current); + else + cont=kFALSE; + TVector2 nextPos = current.Position() + TVector2( + current.Dimensions().X()*(AliMpConstants::LengthStep()+1.)*direction.GetFirst(), + current.Dimensions().Y()*(AliMpConstants::LengthStep()+1.)*direction.GetSecond()); + current = fkSegmentation->PadByPosition(nextPos); + } while (cont); + return ans; +} + +//______________________________________________________________________________ +void AliMpNeighboursPadIterator::FillPadsVector(Bool_t includeCenter) +{ +// Fill the indices vector with all indices of pads which have common +// parts with the pad located at + + if (!fkSegmentation || !fCenterPad.IsValid()) return; + + + AliMpPad from; + AliMpIntPair direction; + PadVector found; + + // repare a unique simple associative container + // --> no doublons, rapid insersion + PadSet setTotal; + + ///////////// Left side + + ////////////////// up direction + + from = fkSegmentation->PadsLeft(fCenterPad).GetFirst(); + direction = AliMpIntPair(0,1); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + + ////////////////// down direction + + from = fkSegmentation->PadsDown(from).GetFirst(); // the Pad down is already added + direction = AliMpIntPair(0,-1); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + ///////////// Up side + + ////////////////// right direction + + from = fkSegmentation->PadsUp(fCenterPad).GetFirst(); + direction = AliMpIntPair(1,0); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + ////////////////// left direction + + from = fkSegmentation->PadsLeft(from).GetFirst(); // the pad up is already added + direction = AliMpIntPair(-1,0); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + ///////////// Right side + + ////////////////// Up direction + + from = fkSegmentation->PadsRight(fCenterPad).GetFirst(); + direction = AliMpIntPair(0,1); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + ////////////////// down direction + + from = fkSegmentation->PadsDown(from).GetFirst(); // the pad right is already added + direction = AliMpIntPair(0,-1); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + ///////////// Down side + + ////////////////// Right direction + + from = fkSegmentation->PadsDown(fCenterPad).GetFirst(); + direction = AliMpIntPair(1,0); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + ////////////////// left direction + + from = fkSegmentation->PadsLeft(from).GetFirst(); // the pad down is already added + direction = AliMpIntPair(-1,0); + found = PadVectorLine(from,direction); + setTotal.insert(found.begin(),found.end()); + + + // fill the fIndices vector with the set (-->pass from a rapid insertion, + // to rapid and indexed access, for the rest of the job) + + fPads.clear(); + // include the center pad if requiered + if (includeCenter) fPads.push_back(fCenterPad); + //fPads.insert(fPads.end(),setTotal.begin(),setTotal.end()); + + PadSetIterator it; + for (it = setTotal.begin(); it != setTotal.end(); it++) + fPads.push_back((*it)); +} + +//______________________________________________________________________________ +Bool_t AliMpNeighboursPadIterator::IsValid() const +{ +// Is the iterator in a valid position? + return (fkSegmentation!=0 && fIndex!=fgkInvalidIndex); +} + +//public methods + +//______________________________________________________________________________ +void AliMpNeighboursPadIterator::First() +{ +// Reset the iterator, so that it points to the first available +// pad in the sector + + if ((fkSegmentation != 0) && (fPads.size() != 0)) + fIndex=0; + else + fIndex=fgkInvalidIndex; + +} + +//______________________________________________________________________________ +void AliMpNeighboursPadIterator::Next() +{ +// pre-increment operator. Should be used by default for iterating over +// pads + + + if (!IsValid()) return; + + if (fIndex < fPads.size()-1) + fIndex++; + else + Invalidate(); +} + +//______________________________________________________________________________ +Bool_t AliMpNeighboursPadIterator::IsDone() const +{ +// + return !IsValid(); +} + +//______________________________________________________________________________ +AliMpPad AliMpNeighboursPadIterator::CurrentItem() const +{ +// dereferencement operator + if (!IsValid()) + return AliMpPad::Invalid(); + else + return fPads[fIndex]; +} + +//______________________________________________________________________________ +void AliMpNeighboursPadIterator::Invalidate() +{ +// Let the iterator points to the invalid position + fIndex=fgkInvalidIndex; +} + diff --git a/MUON/mapping/AliMpNeighboursPadIterator.h b/MUON/mapping/AliMpNeighboursPadIterator.h new file mode 100755 index 00000000000..5fe9ae1ac01 --- /dev/null +++ b/MUON/mapping/AliMpNeighboursPadIterator.h @@ -0,0 +1,66 @@ +// $Id$ +// Category: sector +// +// Class AliMpNeighboursPadIterator +// -------------------------------- +// Class, which defines an iterator over the pads surrounding a given pad +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_NEIGHBOURS_PAD_ITERATOR_H +#define ALI_MP_NEIGHBOURS_PAD_ITERATOR_H + +#include +#include + +#include "AliMpSectorTypes.h" +#include "AliMpVPadIterator.h" +#include "AliMpMotifTypePadIterator.h" +#include "AliMpIntPair.h" +#include "AliMpPad.h" + +class AliMpSectorSegmentation; + +class AliMpNeighboursPadIterator : public AliMpVPadIterator +{ + public: + AliMpNeighboursPadIterator(); + AliMpNeighboursPadIterator(const AliMpSectorSegmentation* segmentation, + const AliMpPad& centerPad, + Bool_t includeCenter=kFALSE); + AliMpNeighboursPadIterator(const AliMpNeighboursPadIterator& right); + virtual ~AliMpNeighboursPadIterator(); + + // operators + AliMpNeighboursPadIterator& + operator = (const AliMpNeighboursPadIterator& right); + + // methods + virtual void First(); + virtual void Next(); + virtual Bool_t IsDone() const; + virtual AliMpPad CurrentItem() const; + virtual void Invalidate(); + + private: + // static members + static const UInt_t fgkInvalidIndex; + + // private methods + Bool_t IsNeighbours(const AliMpPad& pad) const; + PadVector PadVectorLine(const AliMpPad& from, + const AliMpIntPair& direction) const; + void FillPadsVector(Bool_t includeCenter); + Bool_t IsValid() const; + + // private data members + const AliMpSectorSegmentation* fkSegmentation; // The sector segmentation + // over which to iterate + AliMpPad fCenterPad; // Pad arround which we iterate + PadVector fPads; // The list of pad arround fCenterIndices + UInt_t fIndex; // Current index inside the fPads vector + + ClassDef(AliMpNeighboursPadIterator,1) // iterator over motif's pads +}; + +#endif // ALI_MP_NEIGHBOURS_PAD_ITERATOR_H diff --git a/MUON/mapping/AliMpPad.cxx b/MUON/mapping/AliMpPad.cxx new file mode 100755 index 00000000000..81cf2fb2b0c --- /dev/null +++ b/MUON/mapping/AliMpPad.cxx @@ -0,0 +1,163 @@ +// $Id$ +// Category: basic +// +// Class AliMpPad +// --------------- +// Class which encapsuate all informations about a pad +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpPad.h" + +ClassImp(AliMpPad) + +////////////////////////////////////////////////////////// +// +// This class encapsulate all the information about a pad +// +////////////////////////////////////////////////////////// + +// +// foreign operators +// + +//_____________________________________________________________________________ +Bool_t operator==(const TVector2& v1,const TVector2& v2) +{ +return v1.X()==v2.X() && v1.Y()==v2.Y(); +} + + +//_____________________________________________________________________________ +ostream& operator<<(ostream& out,const TVector2& v) +{ + out << '(' << v.X() << ',' << v.Y() << ')'; + return out; +} + +//_____________________________________________________________________________ +AliMpPad::AliMpPad(const AliMpIntPair& location,const AliMpIntPair& indices, + const TVector2& position,const TVector2& dimensions, + Bool_t validity) + : TObject(), + fLocation(location), + fIndices(indices), + fPosition(position), + fDimensions(dimensions), + fValidity(validity) +{ +// Be carefull : this constructor doesn't check the validity of +// the correspondance between location and indices. +// By default, validity is set true. +// It is aimed to be used by MSegmentation methods, and never from outside.... +} + + +//_____________________________________________________________________________ +AliMpPad::AliMpPad() + : TObject(), + fLocation(AliMpIntPair::Invalid()), + fIndices(AliMpIntPair::Invalid()), + fPosition(-1.,-1.), + fDimensions(0.,0.), + fValidity(false) +{ +// Default constructor - creates pad in invalid state +} + + +//_____________________________________________________________________________ +AliMpPad::AliMpPad(const AliMpPad& src) + : TObject(src) +{ + *this = src; +} + +//_____________________________________________________________________________ +AliMpPad::~AliMpPad() { +// +} + +//_____________________________________________________________________________ +AliMpPad& AliMpPad::operator = (const AliMpPad& src) +{ + // check assignement to self + if (this == &src) return *this; + + // base class assignement + TObject::operator=(src); + + // assignement operator + fLocation = src.fLocation; + fIndices = src.fIndices; + fPosition.Set(src.fPosition); + fDimensions.Set(src.fDimensions); + fValidity = src.fValidity; + + return *this; +} + +//_____________________________________________________________________________ +Bool_t AliMpPad::operator == (const AliMpPad& pos2) const +{ + // are this and pos2 equals? + + // one valid, one invalid + if (fValidity != pos2.fValidity) return false; + + // both invalid + if (!fValidity) return true; + + // both valid + return (fLocation==pos2.fLocation) && (fIndices ==pos2.fIndices ) + && (fPosition==pos2.fPosition) && (fDimensions==pos2.fDimensions); +} +//_____________________________________________________________________________ +Bool_t AliMpPad::operator!= (const AliMpPad& pos2) const +{ + // are this and pos2 equals? + return !(*this==pos2); +} + +//_____________________________________________________________________________ +ostream& operator<< (ostream &out, const AliMpPad& op) +{ + if (op.IsValid()) { + out << "Pad: Location " << op.GetLocation() + << " Indices " << op.GetIndices() + << " Position " << op.Position() + << " Dimensions " << op.Dimensions(); + return out; + } + else { + out << "Pad::Invalid"; + return out; + } +} + +//_____________________________________________________________________________ +Bool_t operator < (const AliMpPad& left, const AliMpPad& right) +{ +return left.GetIndices() +#include + +#include "AliMpIntPair.h" + +class AliMpPad : public TObject +{ + public: + AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices, + const TVector2& position, const TVector2& dimensions, + Bool_t validity = true); + AliMpPad(); + AliMpPad(const AliMpPad& src); + virtual ~AliMpPad(); + + // operators + Bool_t operator == (const AliMpPad& pos2) const; + Bool_t operator != (const AliMpPad& pos2) const; + AliMpPad& operator = (const AliMpPad& src) ; + + // methods + void Print() const; + + // static get methods + static AliMpPad Invalid() {return AliMpPad();} + + // get methods + AliMpIntPair GetLocation() const {return fLocation ;} + AliMpIntPair GetIndices() const {return fIndices ;} + TVector2 Position() const {return fPosition ;} + TVector2 Dimensions() const {return fDimensions;} + Bool_t IsValid() const {return fValidity ;} + + private: + // unused derived functions + virtual void Print(const char* option) const {} + + // data members + AliMpIntPair fLocation; //pad location + AliMpIntPair fIndices; //pad indices + TVector2 fPosition; // the pad position (in cm) + TVector2 fDimensions;// the pad dimensions (in cm) + Bool_t fValidity; // validity + + ClassDef(AliMpPad,1) //utility class for the motif type +}; + +ostream& operator << (ostream &out, const AliMpPad& op); +Bool_t operator < (const AliMpPad& left, const AliMpPad& right); + +#endif //ALI_MP_PAD_H diff --git a/MUON/mapping/AliMpPadIteratorPtr.cxx b/MUON/mapping/AliMpPadIteratorPtr.cxx new file mode 100755 index 00000000000..155302ede04 --- /dev/null +++ b/MUON/mapping/AliMpPadIteratorPtr.cxx @@ -0,0 +1,26 @@ +// $Id$ +// Category: basic +// +// Class AliMpPadIteratorPtr +// -------------------------- +// Pointer to the virtual pad iterator; +// enables to allocate the virtual pad iterator on stack. +// Usage: +// MVIndexed* myIndexed = MyIndexed() +// MVIterator& it = *AliMpPadIteratorPtr(myIndexed->CreateIterator()); +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include "AliMpPadIteratorPtr.h" + +ClassImp(AliMpPadIteratorPtr) + +AliMpPadIteratorPtr::AliMpPadIteratorPtr(AliMpVPadIterator* it) + : fIterator(it) +{} + +AliMpPadIteratorPtr::~AliMpPadIteratorPtr() { +// + delete fIterator; +} + diff --git a/MUON/mapping/AliMpPadIteratorPtr.h b/MUON/mapping/AliMpPadIteratorPtr.h new file mode 100755 index 00000000000..d83fbf83a46 --- /dev/null +++ b/MUON/mapping/AliMpPadIteratorPtr.h @@ -0,0 +1,43 @@ +// $Id$ +// Category: basic +// +// Class AliMpPadIteratorPtr +// -------------------------- +// Pointer to the virtual pad iterator; +// enables to allocate the virtual pad iterator on stack. +// Usage: +// AliMpVIndexed* myIndexed = MyIndexed() +// MVIterator& it = *AliMpPadIteratorPtr(myIndexed->CreateIterator()); +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_PAD_ITERATOR_PTR_H +#define ALI_MP_PAD_ITERATOR_PTR_H + +#include + +#include "AliMpVPadIterator.h" + +class AliMpPadIteratorPtr : public TObject +{ + public: + AliMpPadIteratorPtr(AliMpVPadIterator* it); + // AliMpPadIteratorPtr(const AliMpPadIteratorPtr& right); --> private + virtual ~AliMpPadIteratorPtr(); + + AliMpVPadIterator* operator->() { return fIterator; } + AliMpVPadIterator& operator*() { return *fIterator; } + + private: + // disallow copy and assignment to avoid + // multiple deletion of fIterator + AliMpPadIteratorPtr(const AliMpPadIteratorPtr& right); + AliMpPadIteratorPtr& operator=(const AliMpPadIteratorPtr& right); + + // data members + AliMpVPadIterator* fIterator; //The pad iterator + + ClassDef(AliMpPadIteratorPtr,1) // Pointer to abstract pad iterator +}; + +#endif // ALI_MP_PAD_ITERATOR_PTR_H diff --git a/MUON/mapping/AliMpPadPair.cxx b/MUON/mapping/AliMpPadPair.cxx new file mode 100644 index 00000000000..c716cb51020 --- /dev/null +++ b/MUON/mapping/AliMpPadPair.cxx @@ -0,0 +1,69 @@ +// $Id$ +// Category: basic +// +// Class AliMpPadPair +// ------------------ +// Wrap up for std::pair +// to avoid problems with CINT. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include "AliMpPadPair.h" + +ClassImp(AliMpPadPair) + + +//_____________________________________________________________________________ +AliMpPadPair::AliMpPadPair(const AliMpPad& pad1, const AliMpPad& pad2) + : TObject(), + fPair(pad1, pad2) { +// +} + +//_____________________________________________________________________________ +AliMpPadPair::AliMpPadPair(const AliMpPadPair& right) + : TObject(), + fPair(right.GetFirst(), right.GetSecond()) { +// +} + +//_____________________________________________________________________________ +AliMpPadPair::AliMpPadPair() + : TObject(), + fPair(AliMpPad::Invalid(), AliMpPad::Invalid()) { +// +} + +//_____________________________________________________________________________ +AliMpPadPair::~AliMpPadPair() { +// +} + +//_____________________________________________________________________________ +Bool_t AliMpPadPair::operator == (const AliMpPadPair& right) const +{ + return fPair == right.fPair; +} + +//_____________________________________________________________________________ +Bool_t AliMpPadPair::operator!= (const AliMpPadPair& right) const +{ + return !(*this == right); +} + +//_____________________________________________________________________________ +AliMpPadPair& AliMpPadPair::operator = (const AliMpPadPair& right) +{ + // check assignement to self + if (this == &right) return *this; + + // base class assignement + TObject::operator=(right); + + // assignement operator + fPair = right.fPair; + + return *this; +} + + diff --git a/MUON/mapping/AliMpPadPair.h b/MUON/mapping/AliMpPadPair.h new file mode 100644 index 00000000000..bdcaa95c6ae --- /dev/null +++ b/MUON/mapping/AliMpPadPair.h @@ -0,0 +1,47 @@ +// $Id$ +// Category: basic +// +// Class AliMpPadPair +// ------------------ +// Wrap up for std::pair +// to avoid problems with CINT. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_PAD_PAIR_H +#define ALI_MP_PAD_PAIR_H + +#include "AliMpBasicTypes.h" +#include "AliMpPad.h" + +class AliMpPadPair : public TObject +{ + public: + AliMpPadPair(const AliMpPad& pad1, const AliMpPad& pad2); + AliMpPadPair(const AliMpPadPair& pair); + AliMpPadPair(); + virtual ~AliMpPadPair(); + + // operators + Bool_t operator == (const AliMpPadPair& right) const; + Bool_t operator != (const AliMpPadPair& right) const; + AliMpPadPair& operator = (const AliMpPadPair& right); + + // methods + AliMpPad GetFirst() const; + AliMpPad GetSecond() const; + + private: + // data members + PadPair fPair; + + ClassDef(AliMpPadPair,1) //utility class for the motif type +}; + +// inline functions + +inline AliMpPad AliMpPadPair::GetFirst() const { return fPair.first; } +inline AliMpPad AliMpPadPair::GetSecond() const { return fPair.second; } + + +#endif //ALI_MP_PAD_PAIR_H diff --git a/MUON/mapping/AliMpPadRow.cxx b/MUON/mapping/AliMpPadRow.cxx new file mode 100755 index 00000000000..78cd1de9830 --- /dev/null +++ b/MUON/mapping/AliMpPadRow.cxx @@ -0,0 +1,137 @@ +// $Id$ +// -------------------------------------------------------- +// Category: sector +// +// Class AliMpPadRow +// ----------------- +// Class describing a pad row composed of the pad row segments. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpPadRow.h" +#include "AliMpPadRowSegment.h" + +ClassImp(AliMpPadRow) + +//_____________________________________________________________________________ +AliMpPadRow::AliMpPadRow() + : TObject(), + fID(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpPadRow::~AliMpPadRow() { +// + + for (Int_t i=0; iSetOffsetX(fOffsetX); + else + padRowSegment + ->SetOffsetX(GetPadRowSegment(GetNofPadRowSegments()-1)->LeftBorderX()); + + // Adds the pad row segment + fSegments.push_back(padRowSegment); +} + +//_____________________________________________________________________________ +AliMpPadRowSegment* AliMpPadRow::FindPadRowSegment(Double_t x) const +{ +// Finds the row segment for the specified x position; +// returns 0 if no row segment is found. +// --- + + for (Int_t i=0; i= rs->LeftBorderX() && x <= rs->RightBorderX()) + return rs; + } + + return 0; +} + +//_____________________________________________________________________________ +Double_t AliMpPadRow::HalfSizeY() const +{ + return GetPadRowSegment(0)->HalfSizeY(); +} + +//_____________________________________________________________________________ +void AliMpPadRow::SetID(Int_t id) +{ +// Sets the ID. +// --- + + fID = id; +} + +//_____________________________________________________________________________ +void AliMpPadRow::SetOffsetX(Double_t offsetX) +{ +// Sets the x offset. +// --- + + fOffsetX = offsetX; +} + +//_____________________________________________________________________________ +Int_t AliMpPadRow::GetID() const +{ +// Returns the row ID. +// --- + + return fID; +} + +//_____________________________________________________________________________ +Int_t AliMpPadRow::GetNofPadRowSegments() const +{ +// Returns number of row segments. +// --- + + return fSegments.size(); +} + +//_____________________________________________________________________________ +AliMpPadRowSegment* AliMpPadRow::GetPadRowSegment(Int_t i) const +{ + if (i<0 || i>=GetNofPadRowSegments()) { + Warning("GetRowSegment", "Index outside range"); + return 0; + } + + return fSegments[i]; +} + +//_____________________________________________________________________________ +Int_t AliMpPadRow::GetNofPads() const +{ +// Returns number of pads in this pad row. +// --- + + Int_t nofPads=0; + for (Int_t i=0; iGetNofPads(); + + return nofPads; +} + diff --git a/MUON/mapping/AliMpPadRow.h b/MUON/mapping/AliMpPadRow.h new file mode 100755 index 00000000000..1fbaef9d4c0 --- /dev/null +++ b/MUON/mapping/AliMpPadRow.h @@ -0,0 +1,50 @@ +// $Id$ +// Category: sector +// +// Class AliMpPadRow +// ----------------- +// Class describing a pad row composed of the pad row segments. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_PAD_ROW_H +#define ALI_MP_PAD_ROW_H + +#include + +#include "AliMpSectorTypes.h" + +class AliMpPadRowSegment; + +class AliMpPadRow : public TObject +{ + public: + AliMpPadRow(); + virtual ~AliMpPadRow(); + + // methods + void AddPadRowSegment(AliMpPadRowSegment* padRowSegment); + AliMpPadRowSegment* FindPadRowSegment(Double_t x) const; + Double_t HalfSizeY() const; + + // set methods + void SetID(Int_t id); + void SetOffsetX(Double_t offsetX); + + // get methods + Int_t GetID() const; + Int_t GetNofPadRowSegments() const; + AliMpPadRowSegment* GetPadRowSegment(Int_t i) const; + Int_t GetNofPads() const; + + private: + // data members + Int_t fID; + Double_t fOffsetX; //the x position of the right border + PadRowSegmentVector fSegments; + + ClassDef(AliMpPadRow,1) //Pad row +}; + +#endif //ALI_MP_PAD_ROW_H + diff --git a/MUON/mapping/AliMpPadRowSegment.cxx b/MUON/mapping/AliMpPadRowSegment.cxx new file mode 100755 index 00000000000..1104af298f8 --- /dev/null +++ b/MUON/mapping/AliMpPadRowSegment.cxx @@ -0,0 +1,165 @@ +// $Id$ +// Category: sector +// +// Class AliMpPadRowSegment +// -------------------- +// Class describing a pad row segment composed of the +// the identic pads. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpPadRowSegment.h" +#include "AliMpPadRow.h" +#include "AliMpMotif.h" +#include "AliMpMotifType.h" + +ClassImp(AliMpPadRowSegment) + +//_____________________________________________________________________________ +AliMpPadRowSegment::AliMpPadRowSegment(AliMpPadRow* padRow, AliMpMotif* motif, + Int_t motifPositionId, Int_t nofPads) + : TObject(), + fNofPads(nofPads), + fOffsetX(0.), + fPadRow(padRow), + fMotif(motif), + fMotifPositionId(motifPositionId) +{ +// +} + +//_____________________________________________________________________________ +AliMpPadRowSegment::AliMpPadRowSegment() + : TObject(), + fNofPads(0), + fOffsetX(0.), + fPadRow(0), + fMotif(0), + fMotifPositionId(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpPadRowSegment::~AliMpPadRowSegment() { +// +} + +// +// private methods +// + +//_____________________________________________________________________________ +Double_t AliMpPadRowSegment::FirstPadCenterX() const +{ +// Returns the x coordinate of the first (the most right) pad center +// in global coordinate system. +// --- + + return fOffsetX - fMotif->GetPadDimensions().X(); +} + +//_____________________________________________________________________________ +Double_t AliMpPadRowSegment::LastPadCenterX() const +{ +// Returns the x coordinate of the last (the most left) pad center +// in global coordinate system. +// !! numbering of pads is in (-x) direction +// --- + + return fOffsetX - (2.*fNofPads - 1)*fMotif->GetPadDimensions().X(); +} + +//_____________________________________________________________________________ +Double_t AliMpPadRowSegment::FirstPadBorderX() const +{ +// Returns the x coordinate of the right border of the first (the most right) +// pad in global coordinate system. +// --- + + return fOffsetX; + // Also could be + // return FirstPadCenterX() + fMotif->GetPadDimensions().X(); +} + +//_____________________________________________________________________________ +Double_t AliMpPadRowSegment::LastPadBorderX() const +{ +// Returns the x coordinate of the left border of the last (the most left) +// pad in global coordinate system. +// --- + + return LastPadCenterX() - fMotif->GetPadDimensions().X(); +} + +// +// public methods +// + +//_____________________________________________________________________________ +Double_t AliMpPadRowSegment::LeftBorderX() const +{ +// Returns the x coordinate of the left row segment border +// in global coordinate system. +// --- + + return LastPadBorderX(); +} + +//_____________________________________________________________________________ +Double_t AliMpPadRowSegment::RightBorderX() const +{ +// Returns the x coordinate of the right row segment border +// in global coordinate system. +// --- + + return FirstPadBorderX(); +} + +//_____________________________________________________________________________ +Double_t AliMpPadRowSegment::HalfSizeY() const +{ +// Returns the size in y of this row segment. +// --- + + return fMotif->GetPadDimensions().Y(); +} + +//_____________________________________________________________________________ +AliMpPadRow* AliMpPadRowSegment::GetPadRow() const +{ +// Returns the pad row.which this pad row segment belongs to. +// --- + + return fPadRow; +} + +//_____________________________________________________________________________ +AliMpMotif* AliMpPadRowSegment::GetMotif() const +{ +// Returns the motif of this pad row segment. +// --- + + return fMotif; +} + +//_____________________________________________________________________________ +Int_t AliMpPadRowSegment::GetMotifPositionId() const +{ +// Returns the motif of this pad row segment. +// --- + + return fMotifPositionId; +} + +//_____________________________________________________________________________ +void AliMpPadRowSegment::SetOffsetX(Double_t offsetX) +{ +// Sets the x offset. +// --- + + fOffsetX = offsetX; +} + diff --git a/MUON/mapping/AliMpPadRowSegment.h b/MUON/mapping/AliMpPadRowSegment.h new file mode 100755 index 00000000000..bb94cc1d16a --- /dev/null +++ b/MUON/mapping/AliMpPadRowSegment.h @@ -0,0 +1,61 @@ +// $Id$ +// --------------------------------------------------------------- +// Category: sector +// +// Class AliMpPadRowSegment +// ------------------------ +// Class describing a pad row segment composed of the +// the identic pads. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef M_PAD_ROW_SEGMENT_H +#define M_PAD_ROW_SEGMENT_H + +#include +#include + +class AliMpPadRow; +class AliMpMotif; + +class AliMpPadRowSegment : public TObject +{ + public: + AliMpPadRowSegment(AliMpPadRow* padRow, AliMpMotif* motif, Int_t motifPositionId, + Int_t nofPads); + AliMpPadRowSegment(); + virtual ~AliMpPadRowSegment(); + + // methods + virtual Double_t LeftBorderX() const; + virtual Double_t RightBorderX() const; + virtual Double_t HalfSizeY() const; + + // get methods + virtual AliMpPadRow* GetPadRow() const; + virtual AliMpMotif* GetMotif() const; + virtual Int_t GetMotifPositionId() const; + Int_t GetNofPads() const {return fNofPads;} + + // set methods + void SetOffsetX(Double_t offsetX); + + private: + // methods + Double_t FirstPadCenterX() const; + Double_t LastPadCenterX() const; + Double_t FirstPadBorderX() const; + Double_t LastPadBorderX() const; + + // data members + Int_t fNofPads; //number of pads + Double_t fOffsetX; //the x position of the right border + AliMpPadRow* fPadRow; //the pad row containing this segment + AliMpMotif* fMotif; //the motif + Int_t fMotifPositionId; // the motif position id + + ClassDef(AliMpPadRowSegment,1) //Row segment +}; + +#endif //M_PAD_ROW_SEGMENT_H + diff --git a/MUON/mapping/AliMpPlane.cxx b/MUON/mapping/AliMpPlane.cxx new file mode 100644 index 00000000000..83adcc59493 --- /dev/null +++ b/MUON/mapping/AliMpPlane.cxx @@ -0,0 +1,154 @@ +// $Id$ +// Category: plane +// +// Class AliMpPlane +// ---------------- +// Class represents the plane composed of 4 sector positions: +// +// I. FS II. | I. +// II. BS inverted in x _____ | ____ +// III. FS inverted in x, y | +// IV. BS inverted in y III. | IV. +// +// FS - front sector +// BS - back sector +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include + +#include "AliMpPlane.h" +#include "AliMpReader.h" +#include "AliMpSector.h" +#include "AliMpSectorPosition.h" + +ClassImp(AliMpPlane) + +// +// static methods +// + +//______________________________________________________________________________ +AliMpPlane* +AliMpPlane::Create(AliMpPlaneType type, + const TVector2& q1Position, const TVector2& q2Position, + const TVector2& q3Position, const TVector2& q4Position) +{ +// Factory method for creating planes. +// --- + + // Build sectors + AliMpReader bReader(kBendingPlane); + // bReader.SetVerboseLevel(1); + AliMpSector* bSector = bReader.BuildSector(); + cout << "bending sector is built" << endl; + + AliMpReader nbReader(kNonBendingPlane); + // nbReader.SetVerboseLevel(1); + AliMpSector* nbSector = nbReader.BuildSector(); + cout << "non-bending sector is built" << endl; + + if (type == kBendingPlane) + return new AliMpPlane(bSector, nbSector, + q1Position, q2Position, q3Position, q4Position ); + else + return new AliMpPlane(nbSector, bSector, + q1Position, q2Position, q3Position, q4Position ); +} + +//______________________________________________________________________________ +AliMpPlane* AliMpPlane::Create(AliMpPlaneType type) +{ +// Factory method for creating planes with +// not shifted qudrants. +// --- + + return Create(type, TVector2(), TVector2(), TVector2(), TVector2()); +} + +// +// constructors, destructors +// + +//______________________________________________________________________________ +AliMpPlane::AliMpPlane(AliMpSector* frontSector, AliMpSector* backSector, + const TVector2& q1Position, const TVector2& q2Position, + const TVector2& q3Position, const TVector2& q4Position) + : TObject(), + fkFrontSector(frontSector), + fkBackSector(backSector), + fSectorPositions() +{ +// + + // Create sector positions + fSectorPositions.push_back( + new AliMpSectorPosition(fkFrontSector, q1Position, AliMpIntPair( 1, 1))); + fSectorPositions.push_back( + new AliMpSectorPosition(fkBackSector, q2Position, AliMpIntPair(-1, 1))); + fSectorPositions.push_back( + new AliMpSectorPosition(fkFrontSector, q3Position, AliMpIntPair(-1,-1))); + fSectorPositions.push_back( + new AliMpSectorPosition(fkBackSector, q4Position, AliMpIntPair( 1,-1))); +} + + +//______________________________________________________________________________ +AliMpPlane::AliMpPlane() + : TObject(), + fkFrontSector(0), + fkBackSector(0), + fSectorPositions() +{ +// +} + +//______________________________________________________________________________ +AliMpPlane::~AliMpPlane() { +// + + delete fkFrontSector; + delete fkBackSector; + + for (Int_t i=0; iGetScale() == scale) return GetSectorPosition(i); + + Fatal("SectorPosition", "Wrong scale"); + return 0; +} + +//______________________________________________________________________________ +Int_t AliMpPlane::GetNofSectorPositions() const +{ +// Returns number of sector positions. +// --- + + return fSectorPositions.size(); +} + + +//______________________________________________________________________________ +AliMpSectorPosition* AliMpPlane::GetSectorPosition(Int_t i) const +{ +// Returns i-th sector position. +// --- + + return fSectorPositions[i]; +} + + diff --git a/MUON/mapping/AliMpPlane.h b/MUON/mapping/AliMpPlane.h new file mode 100644 index 00000000000..e31b75d4401 --- /dev/null +++ b/MUON/mapping/AliMpPlane.h @@ -0,0 +1,73 @@ +// $Id$ +// Category: plane +// +// Class AliMpPlane +// ---------------- +// Class represents the plane composed of 4 sector positions: +// +// I. FS II. | I. +// II. BS inverted in x _____ | ____ +// III. FS inverted in x, y | +// IV. BS inverted in y III. | IV. +// +// FS - front sector +// BS - back sector +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_PLANE_H +#define ALI_MP_PLANE_H + +#include +#include + +#include "AliMpPlaneTypes.h" +#include "AliMpPlaneType.h" +#include "AliMpIntPair.h" + +class AliMpSector; +class AliMpSectorPosition; + +class AliMpPlane : public TObject +{ + public: + AliMpPlane(AliMpSector* frontSector, AliMpSector* backSector, + const TVector2& q1Position, const TVector2& q2Position, + const TVector2& q3Position, const TVector2& q4Position); + AliMpPlane(); + virtual ~AliMpPlane(); + + // factory methods + static AliMpPlane* Create(AliMpPlaneType type, + const TVector2& q1Position, const TVector2& q2Position, + const TVector2& q3Position, const TVector2& q4Position); + static AliMpPlane* Create(AliMpPlaneType type); + + // methods + const AliMpSectorPosition* SectorPosition(const AliMpIntPair& scale) const; + + // get methods + const AliMpSector* GetFrontSector() const; + const AliMpSector* GetBackSector() const; + Int_t GetNofSectorPositions() const; + AliMpSectorPosition* GetSectorPosition(Int_t i) const; + + private: + // data members + const AliMpSector* fkFrontSector; // front sector in the 1st quadrant + const AliMpSector* fkBackSector; // back sector in the 1st quadrant + SectorPositionVector fSectorPositions; // sector positions + + ClassDef(AliMpPlane,1) //Plane +}; + +// inline functions + +inline const AliMpSector* AliMpPlane::GetFrontSector() const +{ return fkFrontSector; } + +inline const AliMpSector* AliMpPlane::GetBackSector() const +{ return fkBackSector; } + +#endif //ALI_MP_PLANE_H + diff --git a/MUON/mapping/AliMpPlaneAreaPadIterator.cxx b/MUON/mapping/AliMpPlaneAreaPadIterator.cxx new file mode 100755 index 00000000000..0ed2925e3aa --- /dev/null +++ b/MUON/mapping/AliMpPlaneAreaPadIterator.cxx @@ -0,0 +1,184 @@ +// $Id$ +// Category: plane +// +// Class AliMpPlaneAreaPadIterator +// ------------------------------- +// Class, which defines an iterator over the pads +// inside a given area in a plane in horizontal direction. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include +#include + +#include "AliMpPlaneAreaPadIterator.h" +#include "AliMpTransformPadIterator.h" +#include "AliMpPlaneSegmentation.h" +#include "AliMpSectorSegmentation.h" + +ClassImp(AliMpPlaneAreaPadIterator) + +//______________________________________________________________________________ +AliMpPlaneAreaPadIterator::AliMpPlaneAreaPadIterator( + const AliMpPlaneSegmentation* segmentation, + const AliMpArea& area) + : AliMpVPadIterator(), + fkPlaneSegmentation(segmentation), + fkArea(area), + fPadIterators() +{ +// Normal constructor, start in invalid position + + DecomposeArea(); + + fCurrentIterator = fPadIterators.end(); +} + +//______________________________________________________________________________ +AliMpPlaneAreaPadIterator::AliMpPlaneAreaPadIterator( + const AliMpPlaneAreaPadIterator& right) + : AliMpVPadIterator(right) +{ +// copy constructor + + Fatal("Copy constructor", "Not implemented"); +} + +//______________________________________________________________________________ +AliMpPlaneAreaPadIterator::AliMpPlaneAreaPadIterator() + : AliMpVPadIterator(), + fkPlaneSegmentation(0), + fkArea(AliMpArea()), + fPadIterators() +{ +// Dummy default constructor. +} + +//______________________________________________________________________________ +AliMpPlaneAreaPadIterator::~AliMpPlaneAreaPadIterator() +{ +// destructor + + // delete created iterators here +} + +// +// operators +// + +//______________________________________________________________________________ +AliMpPlaneAreaPadIterator& +AliMpPlaneAreaPadIterator::operator = (const AliMpPlaneAreaPadIterator& right) +{ +// Assignement operator + + Fatal("operator =", "Not implemented."); + return *this; +} + +// +// private methods +// + +//______________________________________________________________________________ +void AliMpPlaneAreaPadIterator::DecomposeArea() +{ +// Decompose the area into areas belonging to the quadrants. +// -- + + for (Int_t i=0; iGetNofTransformers(); i++) { + + AliMpTransformer* transformer = fkPlaneSegmentation->GetTransformer(i); + AliMpArea area = transformer->CutArea(fkArea); + + if (area.IsValid()) { + + AliMpSectorSegmentation* segmentation + = fkPlaneSegmentation->GetSectorSegmentation(transformer->GetScale()); + + AliMpVPadIterator* sectorIt + = segmentation->CreateIterator(area); + + fPadIterators.push_back( + new AliMpTransformPadIterator(sectorIt, transformer)); + } + } +} + +// +// public methods +// + +//______________________________________________________________________________ +void AliMpPlaneAreaPadIterator::First() +{ +// Reset the iterator, so that it points to the first available +// pad in the area +// --- + if (fPadIterators.size()==0) return; + + fCurrentIterator = fPadIterators.begin(); + (*fCurrentIterator)->First(); + + while ( fCurrentIterator != fPadIterators.end() && + (*fCurrentIterator)->IsDone()) { + + fCurrentIterator++; + if (fCurrentIterator != fPadIterators.end()) { + (*fCurrentIterator)->First(); + } + } +} + +//______________________________________________________________________________ +void AliMpPlaneAreaPadIterator::Next() +{ +// Move the iterator to the next valid pad. +// --- + + (*fCurrentIterator)->Next(); + + while ( fCurrentIterator != fPadIterators.end() && + (*fCurrentIterator)->IsDone()) { + + fCurrentIterator++; + if (fCurrentIterator != fPadIterators.end()) { + (*fCurrentIterator)->First(); + } + } +} + +//______________________________________________________________________________ +Bool_t AliMpPlaneAreaPadIterator::IsDone() const +{ +// + return fCurrentIterator == fPadIterators.end(); +} + +//______________________________________________________________________________ +AliMpPad AliMpPlaneAreaPadIterator::CurrentItem() const +{ +// Returns the current pad. +// --- + + if (fCurrentIterator != fPadIterators.end()) + return (*fCurrentIterator)->CurrentItem(); + else + return AliMpPad::Invalid(); +} + +//______________________________________________________________________________ +void AliMpPlaneAreaPadIterator::Invalidate() +{ +// Invalidates all sector iterators and sets the current +// iterator to invalid position. +// --- + + PadIteratorVectorIterator it; + for (it=fPadIterators.begin(); it !=fPadIterators.end(); it++) { + (*it)->Invalidate(); + } + + fCurrentIterator = fPadIterators.end(); +} + diff --git a/MUON/mapping/AliMpPlaneAreaPadIterator.h b/MUON/mapping/AliMpPlaneAreaPadIterator.h new file mode 100755 index 00000000000..7cf40e401e7 --- /dev/null +++ b/MUON/mapping/AliMpPlaneAreaPadIterator.h @@ -0,0 +1,60 @@ +// $Id$ +// Category: plane +// +// Class AliMpPlaneAreaPadIterator +// ------------------------------- +// Class, which defines an iterator over the pads +// inside a given area in a plane in horizontal direction. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_PLANE_AREA_PAD_ITERATOR_H +#define ALI_MP_PLANE_AREA_PAD_ITERATOR_H + +#include + +#include "AliMpPlaneTypes.h" +#include "AliMpVPadIterator.h" +#include "AliMpTransformPadIterator.h" +#include "AliMpArea.h" +#include "AliMpPad.h" + +class AliMpPlaneSegmentation; + +class AliMpPlaneAreaPadIterator : public AliMpVPadIterator +{ + public: + AliMpPlaneAreaPadIterator(const AliMpPlaneSegmentation* segmentation, + const AliMpArea& area); + AliMpPlaneAreaPadIterator(const AliMpPlaneAreaPadIterator& src); + AliMpPlaneAreaPadIterator(); + virtual ~AliMpPlaneAreaPadIterator(); + + // operators + AliMpPlaneAreaPadIterator& + operator = (const AliMpPlaneAreaPadIterator& right); + + // methods + virtual void First(); + virtual void Next(); + virtual Bool_t IsDone() const; + virtual AliMpPad CurrentItem() const; + virtual void Invalidate(); + + private: + // private methods + void DecomposeArea(); + + // private data members + const AliMpPlaneSegmentation* fkPlaneSegmentation; // the plane segmentation + // over which we iterate + //const AliMpArea fkArea; // the area + // (const caused problem with CINT) + AliMpArea fkArea; // the area + PadIteratorVector fPadIterators; // pad iterators + PadIteratorVectorIterator fCurrentIterator;// the current iterator + // in the vector of pad iterators + + ClassDef(AliMpPlaneAreaPadIterator,1) // iterator over motif's pads +}; +#endif // ALI_MP_PLANE_AREA_PAD_ITERATOR_H diff --git a/MUON/mapping/AliMpPlaneSegmentation.cxx b/MUON/mapping/AliMpPlaneSegmentation.cxx new file mode 100644 index 00000000000..12bbcebe243 --- /dev/null +++ b/MUON/mapping/AliMpPlaneSegmentation.cxx @@ -0,0 +1,375 @@ +// $Id$ +// Category: plane +// +// Class AliMpPlaneSegmentation +// ---------------------------- +// Class describing the segmentation of the plane. +// +// Transformation of pad characteristics according to sectors: +// +// I. ( posId, Guassi ), ( i, j), ( x, y) II. | I. +// II. ( posId', Guassi'), (-i, j), (-x, y) _____ | ____ +// III. (-posId, Guassi), (-i,-j), (-x,-y) | +// IV. (-posId', Guassi'), ( i,-j), ( x,-y) III. | IV. +// +// Where (posId', Guassi') is the location of the pad +// in the clipped sector. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include +#include + +#include "AliMpPlaneSegmentation.h" +#include "AliMpPlaneAreaPadIterator.h" +#include "AliMpPlane.h" +#include "AliMpSectorPosition.h" +#include "AliMpSectorSegmentation.h" + +ClassImp(AliMpPlaneSegmentation) + +//_____________________________________________________________________________ +AliMpPlaneSegmentation::AliMpPlaneSegmentation(const AliMpPlane* plane) + : AliMpVSegmentation(), + fkPlane(plane), + fFrontSectorSegmentation(0), + fBackSectorSegmentation(0) +{ +// + fFrontSectorSegmentation = new AliMpSectorSegmentation(plane->GetFrontSector()); + fBackSectorSegmentation = new AliMpSectorSegmentation(plane->GetBackSector()); + + for (Int_t i=0; iGetNofSectorPositions(); i++) { + fTransformers.push_back( + new AliMpTransformer(fkPlane->GetSectorPosition(i)->GetOffset(), + fkPlane->GetSectorPosition(i)->GetScale())); + } +} + +///_____________________________________________________________________________ +AliMpPlaneSegmentation::AliMpPlaneSegmentation() + : AliMpVSegmentation(), + fkPlane(0), + fFrontSectorSegmentation(0), + fBackSectorSegmentation(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpPlaneSegmentation::~AliMpPlaneSegmentation() { +// + delete fFrontSectorSegmentation; + delete fBackSectorSegmentation; + + for (Int_t i=0; iGetScale() == scale) return fTransformers[i]; + + Fatal("GetTransformer", "Wrong scale"); + return 0; +} + +//_____________________________________________________________________________ +AliMpIntPair AliMpPlaneSegmentation::GetScale(const AliMpIntPair& pair) const +{ +// Returns pair of the signs of the values of the given pair. +// --- + + AliMpIntPair scale(1, 1); + + if (pair.GetFirst() < 0) scale.SetFirst(-1); + if (pair.GetSecond() < 0) scale.SetSecond(-1); + + return scale; +} + +//_____________________________________________________________________________ +AliMpIntPair AliMpPlaneSegmentation::GetScale(const TVector2& vector) const +{ +// Returns pair of the signs of the values of the given vector. +// --- + + AliMpIntPair scale(1, 1); + + if (vector.X() < 0) scale.SetFirst(-1); + if (vector.Y() < 0) scale.SetSecond(-1); + + return scale; +} + +//_____________________________________________________________________________ +AliMpIntPair +AliMpPlaneSegmentation::GetLocationScale(const AliMpIntPair& location) const +{ +// Returns the scale transformation of the specified location. +// --- + + // Find the sector + Bool_t inFront; + if (fFrontSectorSegmentation + ->HasMotifPosition(TMath::Abs(location.GetFirst()))) + inFront = true; + else if (fBackSectorSegmentation + ->HasMotifPosition(TMath::Abs(location.GetFirst()))) + inFront = false; + else { + Fatal("GetLocationScale", "Motif position not found."); + return AliMpIntPair(); + } + + if (inFront && location.GetFirst() > 0) return AliMpIntPair(1, 1); + else if (inFront && location.GetFirst() < 0) return AliMpIntPair(-1, -1); + else if (!inFront && location.GetFirst() > 0) return AliMpIntPair(-1, 1); + else if (!inFront && location.GetFirst() < 0) return AliMpIntPair( 1,-1); + + // cannot get there + Fatal("GetLocationScale", "Condition failed."); + return AliMpIntPair(); +} + + +//_____________________________________________________________________________ +AliMpSectorSegmentation* +AliMpPlaneSegmentation::GetSectorSegmentation(const AliMpIntPair& scale) const +{ +// Returns front sector or back sector segmentation +// according to quadrant specified by scale. +// --- + + if (scale.GetFirst()*scale.GetSecond() > 0) { + // quadrant I or III + return fFrontSectorSegmentation; + } + else { + // quadrant II or IV + return fBackSectorSegmentation; + } +} + +//_____________________________________________________________________________ +AliMpSectorSegmentation* +AliMpPlaneSegmentation::GetSectorSegmentation(Int_t motifPositionId) const +{ +// Returns front sector or back sector segmentation +// according to specified motifPositionId +// --- + + if (fFrontSectorSegmentation->HasMotifPosition(motifPositionId)) + return fFrontSectorSegmentation; + else if (fBackSectorSegmentation->HasMotifPosition(motifPositionId)) + return fBackSectorSegmentation; + else { + Fatal("GetSectorSegmentation", "Motif position not found."); + return 0; + } +} + +// +// public methods +// + +//_____________________________________________________________________________ +AliMpVPadIterator* +AliMpPlaneSegmentation::CreateIterator(const AliMpArea& area) const +{ +// Creates the are iterator. +// (The inherited method cannot be used) +// --- + + return new AliMpPlaneAreaPadIterator(this, area); +} + +//______________________________________________________________________________ +AliMpPad AliMpPlaneSegmentation::PadByLocation(const AliMpIntPair& location, + Bool_t warning) const +{ +// Find the pad which corresponds to the given location +// --- + + // Get segmentation + AliMpSectorSegmentation* segmentation + = GetSectorSegmentation(TMath::Abs(location.GetFirst())); + + // Get pad in the segmentation + AliMpPad pad + = segmentation + ->PadByLocation( + AliMpIntPair(TMath::Abs(location.GetFirst()),location.GetSecond())); + + + // Get transformation + AliMpIntPair scale = GetLocationScale(location); + const AliMpTransformer* kTransformer = GetTransformer(scale); + + // Transform pad characteristics + return kTransformer->Transform(pad); +} + +//______________________________________________________________________________ +AliMpPad AliMpPlaneSegmentation::PadByIndices (const AliMpIntPair& indices, + Bool_t warning ) const +{ +// Find the pad which corresponds to the given indices +// + + AliMpIntPair scale = GetScale(indices); + const AliMpTransformer* kTransformer = GetTransformer(scale); + + AliMpIntPair scaledIndices = kTransformer->Scale(indices); + AliMpPad pad + = GetSectorSegmentation(scale)->PadByIndices(scaledIndices, warning); + + return kTransformer->Transform(pad); +} + +//_____________________________________________________________________________ +AliMpPad AliMpPlaneSegmentation::PadByPosition(const TVector2& position, + Bool_t warning) const +{ +// Find the pad which corresponds to the given position +// --- + + AliMpIntPair scale = GetScale(position); + const AliMpTransformer* kTransformer = GetTransformer(scale); + + TVector2 scaledPosition = kTransformer->ITransform(position); + AliMpPad pad + = GetSectorSegmentation(scale)->PadByPosition(scaledPosition, warning); + + return kTransformer->Transform(pad); +} + +//_____________________________________________________________________________ +Bool_t AliMpPlaneSegmentation::HasPad(const AliMpIntPair& indices) const +{ +// Does the pad located by exists ? +// --- + + AliMpIntPair scale = GetScale(indices); + const AliMpTransformer* kTransformer = GetTransformer(scale); + + AliMpIntPair scaledIndices = kTransformer->Scale(indices); + + return GetSectorSegmentation(scale)->HasPad(scaledIndices); +} + +//_____________________________________________________________________________ +Int_t AliMpPlaneSegmentation::Zone(const AliMpPad& pad, Bool_t warning) const +{ +// Returns the zone index of the zone containing the specified pad. +// This zone index is different from the zone ID, +// as it is unique for each pad dimensions. +// It is composed in this way: +// sectorID*100 + zoneID*10 + specific index +// Where sectorID = 0,1 for front/back sector. +// Specific index is present only for zones containing special motifs. +// --- + + if (!pad.IsValid()) { + if (warning) Warning("Zone(AliMpPad)", "Invalid pad"); + return 0; + } + + AliMpIntPair scale = GetScale(pad.GetIndices()); + const AliMpTransformer* kTransformer = GetTransformer(scale); + + AliMpPad scaledPad = kTransformer->ITransform(pad); + + AliMpSectorSegmentation* segmentation = GetSectorSegmentation(scale); + Int_t zoneID = segmentation->Zone(scaledPad, warning); + + // Distinguish zones from front/back sector + // For back sector - add 10 + if (segmentation == fBackSectorSegmentation) zoneID += 100; + + return zoneID; +} + +//_____________________________________________________________________________ +TVector2 +AliMpPlaneSegmentation::PadDimensions(Int_t zone, Bool_t warning) const +{ +// Returns the pad dimensions for the zone with the specified zone index. +// --- + + if (zone < 100) + return fFrontSectorSegmentation->PadDimensions(zone, warning); + else + return fBackSectorSegmentation->PadDimensions(zone - 100, warning); +} + +//_____________________________________________________________________________ +Bool_t AliMpPlaneSegmentation::CircleTest(const AliMpIntPair& indices) const +{ +// Verifies that all methods for retrieving pads are consistents between them. +// Returns true if the pad with specified indices was found and verified, +// false otherwise. +// --- + + if (!HasPad(indices)) return false; + + // Verify the indice->location->position->indice way + AliMpIntPair location = PadByIndices(indices).GetLocation(); + TVector2 position = PadByLocation(location).Position(); + AliMpIntPair retIndices = PadByPosition(position).GetIndices(); + + if (retIndices != indices) { + cout << "Pad " << indices << " lead to inconsistency" << endl; + cout << "in indice->location->position->indice way..." << endl; + cout << "starting from " << indices << "-->" << location << "-->" + << '(' << position.X() << ',' << position.Y() << ')' + << " and retIndices: " << retIndices << endl; + } + + + // Verify the indice->position->location->indice way + position = PadByIndices(indices).Position(); + location = PadByPosition(position).GetLocation(); + retIndices = PadByLocation(location).GetIndices(); + + if (retIndices != indices) { + cout << "Pad " << indices << " lead to inconsistency" << endl; + cout << "in indice->position->location->indice way..." < + +#include "AliMpPlaneTypes.h" +#include "AliMpVSegmentation.h" +#include "AliMpIntPair.h" +#include "AliMpPad.h" +#include "AliMpTransformer.h" + +class AliMpPlane; +class AliMpSectorSegmentation; +class AliMpVPadIterator; + +class AliMpPlaneSegmentation : public AliMpVSegmentation +{ + public: + AliMpPlaneSegmentation(const AliMpPlane* plane); + AliMpPlaneSegmentation(); + virtual ~AliMpPlaneSegmentation(); + + // factory method + virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const; + + // methods + virtual AliMpPad PadByLocation(const AliMpIntPair& location, + Bool_t warning = kTRUE) const; + virtual AliMpPad PadByIndices (const AliMpIntPair& indices, + Bool_t warning = kTRUE) const; + virtual AliMpPad PadByPosition(const TVector2& position, + Bool_t warning = kTRUE) const; + + virtual Int_t Zone(const AliMpPad& pad, Bool_t warning = kTRUE) const; + virtual TVector2 PadDimensions(Int_t zone, Bool_t warning = kTRUE) const; + + virtual Bool_t HasPad(const AliMpIntPair& indices) const; + Bool_t CircleTest(const AliMpIntPair& indices) const; + + // get methods + Int_t GetNofTransformers() const; + AliMpTransformer* GetTransformer(Int_t i) const; + AliMpSectorSegmentation* GetSectorSegmentation( + const AliMpIntPair& scale) const; + + private: + // methods + const AliMpTransformer* GetTransformer(const AliMpIntPair& scale) const; + AliMpIntPair GetScale(const AliMpIntPair& pair) const; + AliMpIntPair GetScale(const TVector2& vector) const; + AliMpIntPair GetLocationScale(const AliMpIntPair& location) const; + AliMpSectorSegmentation* GetSectorSegmentation(Int_t motifPositionId) const; + + // data members + const AliMpPlane* fkPlane; // plane + AliMpSectorSegmentation* fFrontSectorSegmentation;// front sector segmentation + AliMpSectorSegmentation* fBackSectorSegmentation; // back sector segmentation + TransformerVector fTransformers; // transformer for each quadrant + + ClassDef(AliMpPlaneSegmentation,1) // Plane segmentation +}; + +#endif //ALI_MP_PLANE_SEGMENTATION_H + diff --git a/MUON/mapping/AliMpPlaneType.h b/MUON/mapping/AliMpPlaneType.h new file mode 100755 index 00000000000..66aa3e9839b --- /dev/null +++ b/MUON/mapping/AliMpPlaneType.h @@ -0,0 +1,19 @@ +// $Id$ +// Category: sector +// +// Enum AliMpPlaneType +// ------------------- +// Enumeration for refering to bending and non-bending planes. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_PLANE_TYPE_H +#define ALI_MP_PLANE_TYPE_H + +enum AliMpPlaneType +{ + kBendingPlane, // bending plane + kNonBendingPlane // non-bending plane +}; + +#endif //ALI_MP_PLANE_TYPE_H diff --git a/MUON/mapping/AliMpPlaneTypes.h b/MUON/mapping/AliMpPlaneTypes.h new file mode 100644 index 00000000000..5eb622619e5 --- /dev/null +++ b/MUON/mapping/AliMpPlaneTypes.h @@ -0,0 +1,31 @@ +// $Id$ +// Category: plane +// +// AliMpPlaneTypes +// --------------- +// Sytem dependent types definitions for plane category. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_PLANE_TYPES_H +#define ALI_MP_PLANE_TYPES_H + +#include + +class AliMpSectorPosition; +class AliMpTransformPadIterator; +class AliMpTransformer; + +#ifdef __HP_aCC + typedef vector SectorPositionVector; + typedef vector PadIteratorVector; + typedef PadIteratorVector::iterator PadIteratorVectorIterator; + typedef vector TransformerVector; +#else + typedef std::vector SectorPositionVector; + typedef std::vector PadIteratorVector; + typedef PadIteratorVector::iterator PadIteratorVectorIterator; + typedef std::vector TransformerVector; +#endif + +#endif //ALI_MP_PLANE_TYPES_H diff --git a/MUON/mapping/AliMpReader.cxx b/MUON/mapping/AliMpReader.cxx new file mode 100755 index 00000000000..3fed44c77ca --- /dev/null +++ b/MUON/mapping/AliMpReader.cxx @@ -0,0 +1,703 @@ +// $Id$ +// Category: sector +// +// Class AliMpReader +// ------------------- +// Class that takes care of reading the sector data. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include +#if !defined(__HP_aCC) && !defined(__alpha) + #include +#endif + +#include +#include +#include +#include +#include + +#include "AliMpReader.h" +#include "AliMpSector.h" +#include "AliMpFiles.h" +#include "AliMpZone.h" +#include "AliMpSubZone.h" +#include "AliMpRow.h" +#include "AliMpVRowSegment.h" +#include "AliMpRowSegment.h" +#include "AliMpRowSegmentSpecial.h" +#include "AliMpPadRow.h" +#include "AliMpPadRowSegment.h" +#include "AliMpMotifMap.h" +#include "AliMpMotif.h" +#include "AliMpMotifSpecial.h" +#include "AliMpMotifType.h" +#include "AliMpConnection.h" +#include "AliMpIntPair.h" +#include "AliMpDirection.h" + +ClassImp(AliMpReader) + +const TString AliMpReader::fgkSectorKeyword = "SECTOR_DATA"; +const TString AliMpReader::fgkZoneKeyword = "ZONE"; +const TString AliMpReader::fgkSubZoneKeyword = "SUBZONE"; +const TString AliMpReader::fgkRowKeyword = "ROW_SEGMENT"; +const TString AliMpReader::fgkEofKeyword = "EOF"; +const TString AliMpReader::fgkSectorSpecialKeyword = "SECTOR_SPECIAL_DATA"; +const TString AliMpReader::fgkMotifKeyword = "MOTIF"; +const TString AliMpReader::fgkRowSpecialKeyword = "ROW"; +const TString AliMpReader::fgkPadRowsKeyword = "PAD_ROWS"; +const TString AliMpReader::fgkPadRowSegmentKeyword = "PAD_ROW_SEGMENT"; + +//_____________________________________________________________________________ +AliMpReader::AliMpReader(AliMpPlaneType plane) + : TObject(), + fPlaneType(plane), + fSector(0), + fVerboseLevel(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpReader::AliMpReader() + : TObject(), + fPlaneType(kBendingPlane), + fSector(0), + fVerboseLevel(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpReader::~AliMpReader() { +// +} + +// +// private methods +// + +//_____________________________________________________________________________ +void AliMpReader::ReadSectorData(ifstream& in) +{ +// Reads sector input data; +// prepares zones and rows vectors to be filled in. +// --- + + TString keyword; + in >> keyword; + + if (fVerboseLevel>0) + cout << keyword << endl; + + if (keyword != fgkSectorKeyword) { + Fatal("ReadSectorData", "Wrong file format."); + return; + } + + Int_t nofZones, nofRows; + TString directionStr; + in >> nofZones; + in >> nofRows; + in >> directionStr; + + AliMpDirection direction; + direction = (directionStr == "Y") ? kY : kX; + if (fVerboseLevel>0) + cout << nofZones << " " << nofRows << endl; + + fSector = new AliMpSector("Not defined", nofZones, nofRows,direction); + + TString nextKeyword; + in >> nextKeyword; + + if (nextKeyword != fgkZoneKeyword) { + Fatal("ReadSectorData", "Wrong file format."); + return; + } + + ReadZoneData(in); +} + +//_____________________________________________________________________________ +void AliMpReader::ReadZoneData(ifstream& in) +{ +// Reads zone input data; +// creates zone and adds it to zones vector. +// --- + + Int_t zoneID; + Double_t sizex, sizey; + in >> zoneID; + in >> sizex; + in >> sizey; + if (fVerboseLevel>0) + cout << fgkZoneKeyword << " " << zoneID << " " + << sizex << " " << sizey << endl; + + AliMpZone* zone = fSector->GetZone(zoneID); + zone->SetPadDimensions(TVector2(sizex/2.,sizey/2.)); + + TString nextKeyword; + in >> nextKeyword; + + if (nextKeyword != fgkSubZoneKeyword) { + Fatal("ReadZoneData", "Wrong file format."); + return; + } + + ReadSubZoneData(in, zone); +} + +//_____________________________________________________________________________ +void AliMpReader::ReadSubZoneData(ifstream& in, AliMpZone* zone) +{ +// Reads subzone input data; +// creates subzone and its to the specified zone. +// --- + + if (fVerboseLevel>0) + cout << fgkSubZoneKeyword << " "; + + AliMpVMotif* motif = ReadMotifData(in, zone); + AliMpSubZone* subZone = new AliMpSubZone(motif); + zone->AddSubZone(subZone); + + TString nextKeyword; + in >> nextKeyword; + + if (nextKeyword != fgkRowKeyword) { + Fatal("ReadSubZoneData", "Wrong file format."); + return; + } + + ReadRowSegmentsData(in, zone, subZone); +} + +//_____________________________________________________________________________ +AliMpVMotif* AliMpReader::ReadMotifData(ifstream& in, AliMpZone* zone) +{ +// Reads the motif input data. +// --- + + TString motifID; + TString motifTypeID; + in >> motifID; + in >> motifTypeID; + if (fVerboseLevel>0) { + cout << motifID << " " + << motifTypeID << endl; + } + + AliMpMotifMap* motifMap = fSector->GetMotifMap(); + + AliMpMotifType* motifType = 0; + AliMpVMotif* motif + = motifMap->FindMotif(motifID, motifTypeID, zone->GetPadDimensions()); + if (!motif) { + motifType = motifMap->FindMotifType(motifTypeID); + if (!motifType) { + motifType = BuildMotifType(motifTypeID); + motifMap->AddMotifType(motifType); + } + + if (zone->GetPadDimensions().X() != 0. && zone->GetPadDimensions().Y() != 0.) + motif = new AliMpMotif(motifID, motifType, zone->GetPadDimensions()); + else + motif = BuildMotifSpecial(motifID, motifType); + + if (motif) + motifMap->AddMotif(motif); + + } + + return motif; +} + +//_____________________________________________________________________________ +void AliMpReader::ReadRowSegmentsData(ifstream& in, + AliMpZone* zone, AliMpSubZone* subZone) +{ +// Reads row segments input data of a specified zone and subzone; +// creates row segment and adds it to the specified subzone +// and a corresponding row in the rows vector. +// --- + + TString nextKeyword; + do { + // + // Read data from file + // + Int_t offX, offY, inRow, nofMotifs, firstMotifPositionId, firstMotifPositionDId; + in >> offX; + in >> offY; + in >> inRow; + in >> nofMotifs; + in >> firstMotifPositionId; + in >> firstMotifPositionDId; + if (fVerboseLevel>0) + cout << fgkRowKeyword << " " + << offX << " " << offY << " " << inRow << " " << nofMotifs << " " + << firstMotifPositionId << " " << firstMotifPositionDId + << endl; + + in >> nextKeyword; + + // + // Process data + // + AliMpRow* row = fSector->GetRow(inRow); + AliMpVMotif* motif = subZone->GetMotif(); + + // Create row segment and add it to its zone, row + AliMpVRowSegment* rowSegment + = new AliMpRowSegment(row, motif, AliMpIntPair(offX, offY), nofMotifs, + firstMotifPositionId, firstMotifPositionDId); + + subZone->AddRowSegment(rowSegment); + row->AddRowSegment(rowSegment); + } + while (!in.eof() && (nextKeyword == fgkRowKeyword)); + + if (in.eof()) return; + + if (nextKeyword == fgkZoneKeyword) { + ReadZoneData(in); + } + else if (nextKeyword == fgkSubZoneKeyword) { + ReadSubZoneData(in, zone); + } + else { + Fatal("ReadRowSegmentsData", "Wrong file format."); + } +} + +//_____________________________________________________________________________ +void AliMpReader::ReadSectorSpecialData(ifstream& in) +{ +// Reads sector input data +// with a special (irregular) motifs. +// --- + + TString keyword; + in >> keyword; + if (fVerboseLevel>0) + cout << keyword << endl; + + if (keyword != fgkSectorSpecialKeyword) { + Fatal("ReadSectorSpecialData", "Wrong file format."); + return; + } + + TString nextKeyword; + in >> nextKeyword; + if (fVerboseLevel>0) + cout << keyword << endl; + + if (nextKeyword != fgkMotifKeyword) { + Fatal("ReadSectorSpecialData", "Wrong file format."); + return; + } + + ReadMotifsSpecialData(in); + ReadRowSpecialData(in); +} + +//_____________________________________________________________________________ +void AliMpReader::ReadMotifsSpecialData(ifstream& in) +{ +// Reads the special (irregular) motifs input data. +// --- + + if (fVerboseLevel>0) + cout << fgkMotifKeyword << " "; + + TString nextKeyword; + do { + + AliMpVMotif* motif = ReadMotifData(in, fSector->GetZone(1)); + AliMpSubZone* subZone = new AliMpSubZone(motif); + fSector->GetZone(1)->AddSubZone(subZone); + // special row segments are always in zone 1 + + in >> nextKeyword; + if (fVerboseLevel>0) + cout << nextKeyword << " "; + } + while (nextKeyword == fgkMotifKeyword); + + if (nextKeyword != fgkRowSpecialKeyword) { + Fatal("ReadMotifSpecialData", "Wrong file format."); + return; + } +} + +//_____________________________________________________________________________ +void AliMpReader::ReadRowSpecialData(ifstream& in) +{ +// Reads row input data +// with a special (irregular) motifs. +// --- + + Int_t id; + in >> id; + if (fVerboseLevel>0) + cout << id << endl; + + // Get the row and its border + AliMpRow* row = fSector->GetRow(id); + AliMpVRowSegment* firstNormalSeg = row->GetRowSegment(0); + Double_t offsetX = firstNormalSeg->LeftBorderX(); + + // Create a special row segment + AliMpRowSegmentSpecial* segment = new AliMpRowSegmentSpecial(row, offsetX); + row->AddRowSegmentInFront(segment); + + TString nextKeyword; + in >> nextKeyword; + if (fVerboseLevel>0) + cout << nextKeyword << " "; + + if (nextKeyword != fgkPadRowsKeyword) { + Fatal("ReadRowSpecialData", "Wrong file format."); + return; + } + + ReadRowSegmentSpecialData(in, segment); + + // Update row segment and set it to all subzones associated with + // contained motifs + + segment->UpdateMotifVector(); + segment->UpdatePadsOffset(); + + for (Int_t i=0; iGetNofMotifs(); i++) + fSector->GetZone(1)->FindSubZone(segment->GetMotif(i))->AddRowSegment(segment); +} + +//_____________________________________________________________________________ +void AliMpReader::ReadRowSegmentSpecialData(ifstream& in, + AliMpRowSegmentSpecial* segment) +{ +// Reads row segment input data +// with a special (irregular) motifs. +// --- + + Int_t nofPadRows; + in >> nofPadRows; + if (fVerboseLevel>0) + cout << nofPadRows << endl; + + TString keyword; + in >> keyword; + if (fVerboseLevel>0) + cout << keyword << " "; + + if (keyword != fgkPadRowSegmentKeyword) { + Fatal("ReadRowSegmentSpecialData", "Wrong file format."); + return; + } + + // + // Process data + // + + PadRowVector newPadRows; + for (Int_t i=0; iAddPadRow(padRow); + + // Keep the new rows in a temporary vector + newPadRows.push_back(padRow); + } + + TString nextKeyword; + do { + // + // Read data from file + // + Int_t nofPadsInRow, motifPositionId; + TString motifId, motifTypeId; + in >> nofPadsInRow; + in >> motifId; + in >> motifPositionId; + + if (fVerboseLevel>0) + cout << nofPadsInRow << " " << motifId << " " << motifPositionId << endl; + + in >> nextKeyword; + if (fVerboseLevel>0) + cout << nextKeyword << " "; + + // + // Process data + // + + for (Int_t i=0; iGetMotifMap()->FindMotif(motifId); + + if (!motif) { + Fatal("ReadRowSegmentSpecialData", "Unknown motif."); + return; + } + + // Create pad row segment + AliMpPadRowSegment* padRowSegment + = new AliMpPadRowSegment(padRow, dynamic_cast(motif), + motifPositionId, nofPadsInRow); + padRow->AddPadRowSegment(padRowSegment); + } + } + while (!in.eof() && (nextKeyword == fgkPadRowSegmentKeyword)); + + if (in.eof()) return; + + if (nextKeyword == fgkPadRowsKeyword) { + ReadRowSegmentSpecialData(in, segment); + } + else if (nextKeyword == fgkRowSpecialKeyword) { + ReadRowSpecialData(in); + } + else { + Fatal("ReadRowSegmentSpecialData", "Wrong file format."); + } +} + +// +// public methods +// + +//_____________________________________________________________________________ +AliMpSector* AliMpReader::BuildSector() +{ +// Reads the mapping data from ascii file +// $MINSTALL/data/fileName and creates the basic objects: +// zones, subzones, rows, row segments, motifs. +// --- + + // Open input file + ifstream in(AliMpFiles::Instance()->SectorFilePath(fPlaneType).Data(), ios::in); + if (!in) { + Error("Read", "File not found."); + return 0; + } + + ReadSectorData(in); + fSector->SetRowSegmentOffsets(); + + // Open second input file + TString sectorSpecialFileName + = AliMpFiles::Instance()->SectorSpecialFilePath(fPlaneType); + if (!gSystem->AccessPathName(sectorSpecialFileName.Data())) { + ifstream in2(sectorSpecialFileName.Data(), ios::in); + if (!in2) { + Error("Read", "File not found."); + return 0; + } + + ReadSectorSpecialData(in2); + } + + fSector->Initialize(); + + return fSector; +} + +//_____________________________________________________________________________ +AliMpMotifType* AliMpReader::BuildMotifType(TString motifTypeId) +{ + + // Read the files describing a motif in the "$MINSTALL/data" directory + // and fill the AliMpMotifType structure with. + // The files mentioned are are named padPos.dat + // and connect.dat + + AliMpMotifType* motifType = new AliMpMotifType(motifTypeId); + + TString strPadPos + = AliMpFiles::Instance()->PadPosFilePath(fPlaneType,motifTypeId); + ifstream padPos(strPadPos.Data()); + if (fVerboseLevel>0) cout<<"Opening file "<>key; + if ((key=="#") || (key=="") ) continue; + + int i,j; + strline>>i>>j; + positions[key].first=i; + positions[key].second=j; + } while (!padPos.eof()); + + padPos.close(); + + if (fVerboseLevel>0) cout <<"Opening file " + <BergToGCFilePath() + <BergToGCFilePath()); + Int_t GassiChannel[80]; + while(1) { + Int_t bergNum; + TString GCStr; + bergToGCFile>>bergNum>>GCStr; + if (!bergToGCFile.good()) break; + if (GCStr=="GND") continue; + if (bergNum>80) { + Fatal("BuildMotifType","Berg number > 80 ..."); + continue; + } + GassiChannel[bergNum-1]= atoi(GCStr); + } + bergToGCFile.close(); + + TString strMotif + = AliMpFiles::Instance()->MotifFilePath(fPlaneType,motifTypeId); + ifstream motif(strMotif); + if (fVerboseLevel>0) cout<<"Opening file "<0) && (token[0]=='#') ) continue; // this is a comment line + + numBerg = atoi(token.Data()); + if (numBerg==0) { + Warning("BuildMotifType","Berg number invalid"); + continue; + } + + token.ReadToken(tokenList); + if (!tokenList.good()) continue; // column is missing... + numKapton = atoi(token.Data()); + if (numKapton==0) continue; + + + token.ReadToken(tokenList); + if (!tokenList.good()) continue; // column is missing... + if (token=="GND") continue; + string padName = token.Data(); + padNum = motifType->PadNum(token); + + token.ReadToken(tokenList); + if (token.IsNull() ) continue; // column is missing... +// if (token[0]!='E') { +// cerr<<"Problem : gassinumber isn't begining with E:"<80) ) { + Warning("BuildMotifType","Berg number outside range"); + continue; + } + + gassiNum = GassiChannel[numBerg-1]; + + PadMapTypeIterator iter = positions.find(padName); + if (iter==positions.end()) { + cerr<<"Problem: Pad number "<second.first; + iy= iter->second.second; + + motifType->AddConnection(AliMpIntPair(ix,iy), + new AliMpConnection(padNum,numBerg,numKapton,gassiNum)); + + if (ix>=nofPadsX) nofPadsX=ix+1; + if (iy>=nofPadsY) nofPadsY=iy+1; + + } while (!motif.eof()); + + + motifType->SetNofPads(nofPadsX, nofPadsY); + + motif.close(); + + return motifType; +} + + +//_____________________________________________________________________________ +AliMpMotifSpecial* +AliMpReader::BuildMotifSpecial(TString motifID,AliMpMotifType* motifType) +{ +// Build a special motif by reading the file motifSpecial.dat +// in the data directory +// --- + + // Open the input file + ifstream in(AliMpFiles::Instance() + ->MotifSpecialFilePath(fPlaneType, motifID).Data(), ios::in); + if (!in) { + Error("BuildMotifSpecial", "File not found."); + return 0; + } + + AliMpMotifSpecial* res = new AliMpMotifSpecial(motifID,motifType); + Int_t i,j; + Double_t x,y; + in >> i; + while (!in.eof()){ + in >>j >>x >> y; + res->SetPadDimensions(AliMpIntPair(i,j),TVector2(x/2.,y/2.)); + in >> i; + } + + in.close(); + return res; +} + + +//_____________________________________________________________________________ +void AliMpReader::SetVerboseLevel(Int_t verboseLevel) +{ +// Sets verbose level. +// --- + + fVerboseLevel = verboseLevel; +} + diff --git a/MUON/mapping/AliMpReader.h b/MUON/mapping/AliMpReader.h new file mode 100755 index 00000000000..59b072b1aa2 --- /dev/null +++ b/MUON/mapping/AliMpReader.h @@ -0,0 +1,81 @@ +// $Id$ +// Category: sector +// +// Class AliMpReader +// ------------------- +// Class that takes care of reading the sector data. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_READER_H +#define ALI_MP_READER_H + +#include + +#include +#include +#include + +#include "AliMpPlaneType.h" + +class AliMpSector; +class AliMpZone; +class AliMpSubZone; +class AliMpRow; +class AliMpRowSegmentSpecial; +class AliMpVMotif; +class AliMpMotifSpecial; +class AliMpMotifType; + +class AliMpReader : public TObject +{ + public: + AliMpReader(AliMpPlaneType plane); + AliMpReader(); + virtual ~AliMpReader(); + + // methods + AliMpSector* BuildSector(); + AliMpMotifType* BuildMotifType(TString motifTypeId); + AliMpMotifSpecial* BuildMotifSpecial(TString motifID, + AliMpMotifType* motifType); + + // set methods + void SetVerboseLevel(Int_t verboseLevel); + + private: + // methods + void ReadSectorData(ifstream& in); + void ReadZoneData(ifstream& in); + void ReadSubZoneData(ifstream& in, AliMpZone* zone); + void ReadRowSegmentsData(ifstream& in, + AliMpZone* zone, AliMpSubZone* subZone); + AliMpVMotif* ReadMotifData(ifstream& in, AliMpZone* zone); + void ReadSectorSpecialData(ifstream& in); + void ReadMotifsSpecialData(ifstream& in); + void ReadRowSpecialData(ifstream& in); + void ReadRowSegmentSpecialData(ifstream& in, + AliMpRowSegmentSpecial* segment); + + // static data members + static const TString fgkSectorKeyword; + static const TString fgkZoneKeyword; + static const TString fgkSubZoneKeyword; + static const TString fgkRowKeyword; + static const TString fgkEofKeyword; + static const TString fgkSectorSpecialKeyword; + static const TString fgkMotifKeyword; + static const TString fgkRowSpecialKeyword; + static const TString fgkPadRowsKeyword; + static const TString fgkPadRowSegmentKeyword; + + // data members + AliMpPlaneType fPlaneType; // plane type + AliMpSector* fSector; // sector + Int_t fVerboseLevel;// verbose level + + ClassDef(AliMpReader,1) // Data reader +}; + +#endif //ALI_MP_READER_H + diff --git a/MUON/mapping/AliMpRow.cxx b/MUON/mapping/AliMpRow.cxx new file mode 100755 index 00000000000..dddf80cf23d --- /dev/null +++ b/MUON/mapping/AliMpRow.cxx @@ -0,0 +1,398 @@ +// $Id$ +// Category: sector +// +// Class AliMpRow +// -------------- +// Class describing a row composed of the row segments. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#include +#include +#include + +#include "AliMpRow.h" +#include "AliMpVRowSegment.h" +#include "AliMpRowSegmentSpecial.h" +#include "AliMpVMotif.h" +#include "AliMpMotifType.h" +#include "AliMpMotifPosition.h" +#include "AliMpMotifMap.h" +#include "AliMpConstants.h" + +ClassImp(AliMpRow) + +//_____________________________________________________________________________ +AliMpRow::AliMpRow(Int_t id, AliMpMotifMap* motifMap) + : AliMpVIndexed(), + fID(id), + fOffsetY(0.), + fSegments(), + fMotifMap(motifMap) +{ +// +} + +//_____________________________________________________________________________ +AliMpRow::AliMpRow() + : AliMpVIndexed(), + fID(0), + fOffsetY(0.), + fSegments(), + fMotifMap(0) +{ +// +} + +//_____________________________________________________________________________ +AliMpRow::~AliMpRow() { +// + + for (Int_t i=0; i= ix. +// --- + + for (Int_t i=0; i(segment) && + segment->GetHighIndicesLimit().GetFirst() >= ix) + + return segment; + } + + return 0; +} + +//_____________________________________________________________________________ +AliMpMotifPosition* +AliMpRow::FindMotifPosition(AliMpVRowSegment* segment, Int_t ix) const +{ +// Finds first motif position in the specified row segment +// with high indices limit >= ix. +// --- + + if (!segment) return 0; + + for (Int_t i=0; iGetNofMotifs(); i++){ + AliMpMotifPosition* motifPosition + = GetMotifMap()->FindMotifPosition(segment->GetMotifPositionId(i)); + + if(!motifPosition) { + Fatal("FindMotifPosition", "Not found."); + return 0; + } + + if (motifPosition->GetHighIndicesLimit().GetFirst()>=ix) + return motifPosition; + } + + return 0; +} + + +//_____________________________________________________________________________ +void AliMpRow::SetHighIndicesLimits(Int_t iy) +{ +// Sets the global indices high limit to its row segments, +// motif positions with a given value. +// Keeps ix unmodified. +// --- + + for (Int_t j=0; jSetHighIndicesLimit( + AliMpIntPair(rowSegment->GetHighIndicesLimit().GetFirst(),iy)); + + for (Int_t k=0; kGetNofMotifs(); k++) { + + Int_t motifPositionId = rowSegment->GetMotifPositionId(k); + AliMpMotifPosition* motifPosition + = GetMotifMap()->FindMotifPosition(motifPositionId); + + motifPosition + ->SetHighIndicesLimit( + AliMpIntPair(motifPosition->GetHighIndicesLimit().GetFirst(), iy)); + + } + } +} + +//_____________________________________________________________________________ +void AliMpRow::CheckEmpty() const +{ +// Give a fatal if row is empty. +// --- + + if (GetNofRowSegments() == 0) + Fatal("CheckEmpty", "Empty row"); +} + +// +// public methods +// + +//_____________________________________________________________________________ +void AliMpRow::AddRowSegment(AliMpVRowSegment* rowSegment) +{ +// Adds row segment at the end. +// --- + + fSegments.push_back(rowSegment); +} + +//_____________________________________________________________________________ +void AliMpRow::AddRowSegmentInFront(AliMpVRowSegment* rowSegment) +{ +// Inserts row segment in the first vector position. +// --- + + fSegments.insert(fSegments.begin(), rowSegment); +} + +//_____________________________________________________________________________ +AliMpVRowSegment* AliMpRow::FindRowSegment(Double_t x) const +{ +// Finds the row segment for the specified x position; +// returns 0 if no row segment is found. +// --- + + for (Int_t i=0; i= rs->LeftBorderX() && x <= rs->RightBorderX()) + return rs; + } + + return 0; +} + +//_____________________________________________________________________________ +Double_t AliMpRow::LowBorderY() const +{ +// Returns the lowest row offset (the Y coordinate of the position of the +// low border of motif). +// --- + + CheckEmpty(); + + return fOffsetY - GetRowSegment(0)->HalfSizeY(); +} + +//_____________________________________________________________________________ +Double_t AliMpRow::UpperBorderY() const +{ +// Returns the uppermost row offset (the Y coordinate of the position of the +// upper border of motif). +// --- + + CheckEmpty(); + + return fOffsetY + GetRowSegment(0)->HalfSizeY(); +} + +//_____________________________________________________________________________ +AliMpVPadIterator* AliMpRow::CreateIterator() const +{ +// Iterator is not yet implemented. +// --- + + Fatal("CreateIterator", "Iterator is not yet implemented."); + + return 0; +} + +//_____________________________________________________________________________ +void AliMpRow::SetMotifPositions() +{ +// Creates motif positions objects and fills them in the motif map. +// --- + + CheckEmpty(); + + for (Int_t j=0; jGetNofMotifs(); k++) { + // Get values + Int_t motifPositionId = rowSegment->GetMotifPositionId(k); + AliMpVMotif* motif = rowSegment->GetMotif(k); + TVector2 position = rowSegment->MotifCenter(motifPositionId); + + AliMpMotifPosition* motifPosition + = new AliMpMotifPosition(motifPositionId, motif, position); + // set the initial value to of HighIndicesLimit() Invalid() + // (this is used for calculation of indices in case of + // special row segments) + motifPosition->SetHighIndicesLimit(AliMpIntPair::Invalid()); + + Bool_t warn = (rowSegment->GetNofMotifs()==1); + // supress warnings for special row segments + // which motifs can overlap the row borders + + Bool_t added = GetMotifMap()->AddMotifPosition(motifPosition, warn); + + if (!added) delete motifPosition; + } + } +} + +//_____________________________________________________________________________ +void AliMpRow::SetGlobalIndices(AliMpDirection constPadSizeDirection, + AliMpRow* rowBefore) +{ +// Sets the global indices limits to its row segments, +// motif positions. +// --- + + Int_t ix = AliMpConstants::StartPadIndex(); + Int_t iy = AliMpConstants::StartPadIndex(); + + for (Int_t j=0; jGetLowIndicesLimit().GetFirst(); + + for (Int_t k=0; kGetNofMotifs(); k++) { + + // Find the y index value of the low edge + if (rowBefore) { + if (constPadSizeDirection == kY) { + iy = rowBefore->GetHighIndicesLimit().GetSecond()+1; + } + else { + AliMpVRowSegment* seg = rowBefore->FindRowSegment(ix); + AliMpMotifPosition* motPos = FindMotifPosition(seg, ix); + if (!motPos) + Fatal("SetGlobalIndices", "Motif position in rowBefore not found."); + + iy = motPos->GetHighIndicesLimit().GetSecond()+1; + } + } + + // Set (ix, iy) to k-th motif position and update ix + ix = rowSegment->SetIndicesToMotifPosition(k, AliMpIntPair(ix, iy)); + } + rowSegment->SetGlobalIndices(); + } + + SetLowIndicesLimit(GetRowSegment(0)->GetLowIndicesLimit()); + SetHighIndicesLimit(GetRowSegment(GetNofRowSegments()-1)->GetHighIndicesLimit()); + + return ; +} + +//_____________________________________________________________________________ +TVector2 AliMpRow::Position() const +{ +// Returns the position of the row centre. +// --- + + Double_t x = (GetRowSegment(0)->LeftBorderX() + + GetRowSegment(GetNofRowSegments()-1)->RightBorderX())/2.; + + Double_t y = fOffsetY; + + return TVector2(x, y); +} + +//_____________________________________________________________________________ +TVector2 AliMpRow::Dimensions() const +{ +// Returns the maximum halflengths of the row in x, y. +// --- + + Double_t x = (GetRowSegment(GetNofRowSegments()-1)->RightBorderX() - + GetRowSegment(0)->LeftBorderX())/2.; + + Double_t y = GetRowSegment(0)->HalfSizeY(); + + return TVector2(x, y); +} + +//_____________________________________________________________________________ +void AliMpRow::SetRowSegmentOffsets(const TVector2& offset) +{ +// Sets the row segments offsets in X . +// --- + + CheckEmpty(); + + AliMpVRowSegment* previous = 0; + + for (Int_t j=0; jRightBorderX(); + else + offsetX = offset.X(); + + rowSegment->SetOffset(TVector2(offsetX, 0.)); + previous = rowSegment; + } +} + + +//_____________________________________________________________________________ +Double_t AliMpRow::SetOffsetY(Double_t offsetY) +{ +// Sets the row offset (the Y coordinate of the position of the +// center of motif) and returns the offset of the top border. +// --- + + CheckEmpty(); + + AliMpVRowSegment* first = GetRowSegment(0); + Double_t rowSizeY = first->HalfSizeY(); + + // Check if all next row segments have motif of + // the same size in y + for (Int_t i=1; iHalfSizeY(); + + if (TMath::Abs(sizeY - rowSizeY) >= AliMpConstants::LengthTolerance()) { + cout << GetID() << "th row " << i << "th segment " + << sizeY << " " << rowSizeY << endl; + Fatal("SetOffsetY", "Motif with different Y size in one row"); + return 0.; + } + } + + offsetY += rowSizeY ; + + fOffsetY = offsetY; + + return offsetY += rowSizeY; +} + +//_____________________________________________________________________________ +Int_t AliMpRow::GetNofRowSegments() const +{ +// Returns number of row segments. + + return fSegments.size(); +} + +//_____________________________________________________________________________ +AliMpVRowSegment* AliMpRow::GetRowSegment(Int_t i) const +{ + if (i<0 || i>=GetNofRowSegments()) { + Warning("GetRowSegment", "Index outside range"); + return 0; + } + + return fSegments[i]; +} + diff --git a/MUON/mapping/AliMpRow.h b/MUON/mapping/AliMpRow.h new file mode 100755 index 00000000000..f92fcfcafbe --- /dev/null +++ b/MUON/mapping/AliMpRow.h @@ -0,0 +1,78 @@ +// $Id$ +// Category: sector +// +// Class AliMpRow +// -------------- +// Class describing a row composed of the row segments. +// +// Authors: David Guez, Ivana Hrivnacova; IPN Orsay + +#ifndef ALI_MP_ROW_H +#define ALI_MP_ROW_H + +#include +#include + +#include "AliMpSectorTypes.h" +#include "AliMpVIndexed.h" +#include "AliMpDirection.h" + +class AliMpVRowSegment; +class AliMpVPadIterator; +class AliMpMotifPosition; +class AliMpMotifMap; + +class AliMpRow : public AliMpVIndexed +{ + public: + AliMpRow(Int_t id, AliMpMotifMap* motifMap); + AliMpRow(); + virtual ~AliMpRow(); + + // methods + void AddRowSegment(AliMpVRowSegment* rowSegment); + void AddRowSegmentInFront(AliMpVRowSegment* rowSegment); + AliMpVRowSegment* FindRowSegment(Double_t x) const; + Double_t LowBorderY() const; + Double_t UpperBorderY() const; + virtual AliMpVPadIterator* CreateIterator() const; + + void SetRowSegmentOffsets(const TVector2& offset); + Double_t SetOffsetY(Double_t offsetY); + void SetMotifPositions(); + void SetGlobalIndices(AliMpDirection constPadSizeDirection, + AliMpRow* rowBefore); + + // geometry + TVector2 Position() const; + TVector2 Dimensions() const; + + // get methods + UInt_t GetID() const; + Int_t GetNofRowSegments() const; + AliMpVRowSegment* GetRowSegment(Int_t i) const; + AliMpMotifMap* GetMotifMap() const; + + private: + // methods + AliMpVRowSegment* FindRowSegment(Int_t ix) const; + AliMpMotifPosition* FindMotifPosition(AliMpVRowSegment* segment, Int_t ix) const; + void SetHighIndicesLimits(Int_t iy); + void CheckEmpty() const; + + // data members + UInt_t fID; // row ID + Double_t fOffsetY; // the y position of the centre of motifs + RowSegmentVector fSegments;// row segments + AliMpMotifMap* fMotifMap;// the motif map associated with its sector + + ClassDef(AliMpRow,1) //Row +}; + +// inline functions + +inline UInt_t AliMpRow::GetID() const { return fID; } +inline AliMpMotifMap* AliMpRow::GetMotifMap() const { return fMotifMap; } + +#endif //ALI_MP_ROW_H + diff --git a/MUON/mapping/AliMpRowPainter.cxx b/MUON/mapping/AliMpRowPainter.cxx new file mode 100755 index 00000000000..ea100928171 --- /dev/null +++ b/MUON/mapping/AliMpRowPainter.cxx @@ -0,0 +1,117 @@ +// $Id$ +// Category: graphics +// +// Class AliMpRowPainter +// --------------------- +// Class for drawing a row into canvas +// +// Authors: David Guez, IPN Orsay + +#include "AliMpRowPainter.h" +#include "AliMpGraphContext.h" +#include "AliMpRow.h" +#include "AliMpRowSegment.h" + +ClassImp(AliMpRowPainter) + +//_______________________________________________________________________ +AliMpRowPainter::AliMpRowPainter() + : AliMpVPainter(), + fRow(0) +{ + // default dummy constructor +} + +//_______________________________________________________________________ +AliMpRowPainter::AliMpRowPainter(AliMpRow *row) + :AliMpVPainter(), + fRow(row) +{ + // normal constructor +} + +//_______________________________________________________________________ +void AliMpRowPainter::DumpObject() +{ +// Draw the owned object + fRow->Dump(); + +} + +//_______________________________________________________________________ +TVector2 AliMpRowPainter::GetPosition() const +{ +// Get the owned object's position + return fRow->Position(); + +} + +//_______________________________________________________________________ +TVector2 AliMpRowPainter::GetDimensions() const +{ +// Get the owned object's dimensions + return fRow->Dimensions(); + +} + +//_______________________________________________________________________ +void AliMpRowPainter::Draw(Option_t *option) +{ +// Draw the sector on the current pad +// The first letter of