LCOV - code coverage report
Current view: top level - ITSMFT/MFT/MFTbase - AliMFTGeometry.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 56 1.8 %
Date: 2016-06-14 17:26:59 Functions: 1 16 6.2 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : /* $Id$ */
      16             : 
      17             : //-----------------------------------------------------------------------------
      18             : /// \class AliMFTGeometry
      19             : ///
      20             : /// Geometry mananger for the MFT
      21             : ///
      22             : // author Raphael Tieulent <raphael.tieulent@cern.ch>
      23             : //-----------------------------------------------------------------------------
      24             : 
      25             : #include "TSystem.h"
      26             : #include "TGeoManager.h"
      27             : #include "TGeoVolume.h"
      28             : 
      29             : #include "AliMFTGeometry.h"
      30             : #include "AliMFTConstants.h"
      31             : #include "AliMFTGeometryBuilder.h"
      32             : #include "AliMFTSegmentation.h"
      33             : #include "AliMFTHalfSegmentation.h"
      34             : #include "AliMFTHalfDiskSegmentation.h"
      35             : #include "AliMFTLadderSegmentation.h"
      36             : #include "AliMFTChipSegmentation.h"
      37             : #include "AliLog.h"
      38             : 
      39             : /// \cond CLASSIMP
      40          14 : ClassImp(AliMFTGeometry);
      41             : /// \endcond
      42             : 
      43             : const Double_t AliMFTGeometry::kSensorLength=3.; //[cm]
      44             : const Double_t AliMFTGeometry::kSensorHeight=1.5; //[cm]
      45             : const Double_t AliMFTGeometry::kXPixelPitch=29.250e-4; // 29.15 micron // TODO : Check that
      46             : const Double_t AliMFTGeometry::kYPixelPitch=26.880e-4; // 26.88 micron // TODO : Check that
      47             : const Double_t AliMFTGeometry::kSensorMargin=29.120e-4; // 29.12 micron // TODO : Check that
      48             : 
      49             : const Double_t AliMFTGeometry::kSensorActiveWidth  = kNPixelX * kXPixelPitch; //[cm]
      50             : const Double_t AliMFTGeometry::kSensorActiveHeight = kNPixelY * kYPixelPitch; //[cm]
      51             : 
      52             : const Double_t AliMFTGeometry::kSensorInterspace = 0.01; //[cm]  Offset between two adjacent chip on a ladder
      53             : const Double_t AliMFTGeometry::kSensorSideOffset = 0.04; // [cm] Side Offset between the ladder edge and the chip edge
      54             : const Double_t AliMFTGeometry::kSensorTopOffset = 0.04; // [cm] Top Offset between the ladder edge and the chip edge
      55             : const Double_t AliMFTGeometry::kLadderOffsetToEnd = 4.7; // [cm] Offset between the last Chip and the end of the ladder toward the DAQ connector
      56             : const Double_t AliMFTGeometry::kSensorThickness = 50.e-4; // 50 microns
      57             : 
      58             : const Double_t AliMFTGeometry::fHeightActive = 1.3;
      59             : const Double_t AliMFTGeometry::fHeightReadout = 0.2;
      60             : 
      61             : // Allmost everything you wanted to know about the FPC
      62             : const Double_t AliMFTGeometry::kLineWidth= 100.e-4;         // line width, 100 microns
      63             : const Double_t AliMFTGeometry::kVarnishThickness= 20.e-4;   // 20 micron
      64             : const Double_t AliMFTGeometry::kAluThickness = 25.e-4;      // 25 microns
      65             : const Double_t AliMFTGeometry::kKaptonThickness = 75.e-4;   // 75 microns
      66             : const Double_t AliMFTGeometry::kFlexThickness = kKaptonThickness + 2*kAluThickness + 2*kVarnishThickness; // total thickness of a FPC
      67             : const Double_t AliMFTGeometry::kFlexHeight = 1.68;
      68             : const Double_t AliMFTGeometry::kClearance=300.e-4;      // 300 microns clearance without any conducting metal all around the FPC
      69             : const Double_t AliMFTGeometry::kRadiusHole1=0.125;      // diameter of the FPC crew, closest to the FPC electric connector
      70             : const Double_t AliMFTGeometry::kRadiusHole2=0.1;        // diameter of the FPC pin locator, after the previous hole crew
      71             : const Double_t AliMFTGeometry::kHoleShift1=2.8;        // shift of the FPC crew
      72             : const Double_t AliMFTGeometry::kHoleShift2=3.6;        // shift of the FPC pin locator
      73             : const Double_t AliMFTGeometry::kConnectorOffset=0.4;    // distance between the connector and the start of the FPC
      74             : const Double_t AliMFTGeometry::kCapacitorDx=0.05;
      75             : const Double_t AliMFTGeometry::kCapacitorDy=0.1;
      76             : const Double_t AliMFTGeometry::kCapacitorDz=0.05;
      77             : const Double_t AliMFTGeometry::kConnectorLength=0.1; 
      78             : const Double_t AliMFTGeometry::kConnectorWidth=0.025;
      79             : const Double_t AliMFTGeometry::kConnectorHeight=0.1;
      80             : const Double_t AliMFTGeometry::kConnectorThickness=0.01;
      81             : const Double_t AliMFTGeometry::kShiftDDGNDline=0.4; // positionning of the line to separate AVDD/DVDD et AGND/DGND on the FPC
      82             : const Double_t AliMFTGeometry::kShiftline=0.025; // positionning of the line along the FPC side
      83             : const Double_t AliMFTGeometry::kEpsilon=0.0001; // to see the removed volumes produced by TGeoSubtraction
      84             : 
      85             : const Double_t AliMFTGeometry::kGlueThickness=100.e-4; // 100 microns
      86             : const Double_t AliMFTGeometry::kGlueEdge=300.e-4; // in case the glue is not spreaded on the whole surface of the sensor
      87             : 
      88             : 
      89             : //____________________________________________________________________
      90             : 
      91             : 
      92             : AliMFTGeometry* AliMFTGeometry::fgInstance = 0;
      93             : 
      94             : //____________________________________________________________________
      95             : /// \brief Singleton access
      96             : AliMFTGeometry*
      97             : AliMFTGeometry::Instance()
      98             : {
      99           0 :   if (!fgInstance) fgInstance = new AliMFTGeometry("MFT");
     100           0 :   return fgInstance;
     101           0 : }
     102             : 
     103             : //____________________________________________________________________
     104             : /// \brief Constructor
     105             : AliMFTGeometry::AliMFTGeometry()
     106           0 : : AliGeometry("MFT", "Muon Forward Tracker"),
     107           0 : fBuilder(NULL),
     108           0 : fSegmentation(NULL),
     109           0 : fSensorVolumeId(0)
     110           0 : {
     111             :   
     112           0 : }
     113             : 
     114             : //____________________________________________________________________
     115             : /// \brief Default Constructor
     116             : AliMFTGeometry::AliMFTGeometry(const char* )
     117           0 : : AliGeometry("MFT", "Muon Forward Tracker"),
     118           0 : fBuilder(NULL),
     119           0 : fSegmentation(NULL),
     120           0 : fSensorVolumeId(0)
     121           0 : {
     122             : 
     123           0 : }
     124             : //____________________________________________________________________
     125             : 
     126           0 : AliMFTGeometry::~AliMFTGeometry() {
     127           0 :   delete fBuilder;
     128           0 :   delete fSegmentation;
     129           0 : }
     130             : 
     131             : //____________________________________________________________________
     132             : /// \brief Builf both the Virtual segmentation and the real volumes
     133             : /// Real part is delegates to AliMFTGeometryBuilder class
     134             : void AliMFTGeometry::Build()
     135             : {
     136           0 :   LoadSegmentation();
     137             : 
     138           0 :   if (!fBuilder) fBuilder = new AliMFTGeometryBuilder();
     139           0 :   fBuilder->BuildGeometry();
     140           0 :   delete fBuilder;
     141             :   
     142           0 : }
     143             : //____________________________________________________________________
     144             : /// \brief Creates the virtual Segmentation from the XML file
     145             : /// $(ALICE_ROOT)/ITSMFT/MFT/data/AliMFTGeometry.xml
     146             : void AliMFTGeometry::LoadSegmentation() {
     147             : 
     148           0 :   if(!fSegmentation) fSegmentation = new AliMFTSegmentation(gSystem->ExpandPathName("$(ALICE_ROOT)/ITSMFT/MFT/data/AliMFTGeometry.xml" ));
     149             :   
     150           0 : }
     151             : //____________________________________________________________________
     152             : /// \brief Returns the object Unique ID
     153             : /// \param [in] type: Type of the object (see AliMFTGeometry::ObjectTypes)
     154             : /// \param [in] half: Half-MFT ID
     155             : /// \param [in] disk: Half-Disk ID
     156             : /// \param [in] ladder: Ladder ID
     157             : /// \param [in] chip: Sensor ID
     158             : 
     159             : UInt_t AliMFTGeometry::GetObjectID(ObjectTypes type, Int_t half, Int_t disk, Int_t ladder, Int_t chip) const{
     160             : 
     161           0 :   UInt_t uniqueID = (type<<14) +  (half<<13) + (disk<<10) + (ladder<<4) + chip;
     162             : 
     163           0 :   return uniqueID;
     164             : }
     165             : //____________________________________________________________________
     166             : /// \brief Returns the pixel ID corresponding to a hit at (x,y,z) in the ALICE global frame
     167             : ///
     168             : /// \param [in] xHit Double_t : x Position of the Hit
     169             : /// \param [in] yHit Double_t : y Position of the Hit
     170             : /// \param [in] zHit Double_t : z Position of the Hit
     171             : /// \param [in] detElemID Int_t : Sensor Unique ID in which the hit occured
     172             : ///
     173             : /// \param [out] xPixel Int_t : x position of the pixel hit on the sensor matrix
     174             : /// \param [out] yPixel Int_t : y position of the pixel hit on the sensor matrix
     175             : /// \retval <kTRUE> if hit into the active part of the sensor
     176             : /// \retval <kFALSE> if hit outside the active part
     177             : 
     178             : Bool_t AliMFTGeometry::Hit2PixelID(Double_t xHit, Double_t yHit, Double_t zHit, Int_t detElemID, Int_t &xPixel, Int_t &yPixel) const{
     179             : 
     180           0 :   return (fSegmentation->Hit2PixelID(xHit, yHit, zHit,
     181           0 :                                      GetHalfMFTID(detElemID), GetHalfDiskID(detElemID), GetLadderID(detElemID), GetSensorID(detElemID),
     182             :                                      xPixel,  yPixel));
     183             : }
     184             : 
     185             : //____________________________________________________________________
     186             : /// \brief Returns the center of the pixel position in the ALICE global frame
     187             : ///
     188             : /// \param [in] xPixel Int_t : x position of the pixel hit on the sensor matrix
     189             : /// \param [in] yPixel Int_t : y position of the pixel hit on the sensor matrix
     190             : /// \param [in] detElemID Int_t : Sensor Unique ID in which the hit occured
     191             : /// \param [out] xCenter,yCenter,zCenter Double_t : (x,y,z) Position of the Hit in ALICE global frame
     192             : 
     193             : void AliMFTGeometry::GetPixelCenter(Int_t xPixel, Int_t yPixel, Int_t detElemID, Double_t &xCenter, Double_t &yCenter, Double_t &zCenter ) const{
     194             : 
     195           0 :   Double_t local[3];
     196           0 :   local[0] = (0.5+xPixel) * AliMFTConstants::kXPixelPitch + AliMFTConstants::kSensorMargin;
     197           0 :   local[1] = (0.5+yPixel) * AliMFTConstants::kYPixelPitch + (AliMFTConstants::kSensorHeight-AliMFTConstants::kSensorActiveHeight+ AliMFTConstants::kSensorMargin);
     198           0 :   local[2] = AliMFTConstants::kSensorThickness/2.;
     199             : 
     200           0 :   Double_t master[3];
     201             :   
     202           0 :   AliMFTHalfSegmentation * halfSeg = fSegmentation->GetHalf(GetHalfMFTID(detElemID));
     203           0 :   AliMFTHalfDiskSegmentation * diskSeg = halfSeg->GetHalfDisk(GetHalfDiskID(detElemID));
     204           0 :   AliMFTLadderSegmentation * ladderSeg = diskSeg->GetLadder(GetLadderID(detElemID));
     205           0 :   AliMFTChipSegmentation * chipSeg = ladderSeg->GetSensor(GetSensorID(detElemID));
     206             : 
     207           0 :   chipSeg->GetTransformation()->LocalToMaster(local, master);
     208           0 :   for (int i=0; i<3; i++) local[i] = master[i];
     209           0 :   ladderSeg->GetTransformation()->LocalToMaster(local, master);
     210           0 :   for (int i=0; i<3; i++) local[i] = master[i];
     211           0 :   diskSeg->GetTransformation()->LocalToMaster(local, master);
     212           0 :   for (int i=0; i<3; i++) local[i] = master[i];
     213           0 :   halfSeg->GetTransformation()->LocalToMaster(local, master);
     214             : 
     215           0 :   xCenter = master[0];
     216           0 :   yCenter = master[1];
     217           0 :   zCenter = master[2];
     218             : 
     219           0 : }
     220             : //____________________________________________________________________
     221             : /// \brief Returns the number of sensors on the entire disk (top+bottom)
     222             : /// \param [in] diskId Int_t: Disk ID = [0,4]
     223             : Int_t AliMFTGeometry::GetDiskNSensors(Int_t diskId) const{
     224             : 
     225             :   Int_t nSensors = 0;
     226           0 :   for (int iHalf=0; iHalf<2; iHalf++) {
     227           0 :     AliMFTHalfDiskSegmentation * diskSeg = fSegmentation->GetHalf(iHalf)->GetHalfDisk(diskId);
     228           0 :     if(diskSeg) nSensors += diskSeg->GetNChips();
     229             : 
     230             :   }
     231           0 :   return nSensors;
     232             : }
     233             : 
     234             : //____________________________________________________________________
     235             : /// \brief Returns the local ID of the sensor on the disk
     236             : /// \param [in] detElemID Int_t: Sensor Unique ID
     237             : 
     238             : Int_t AliMFTGeometry::GetDetElemLocalID(Int_t detElemID) const{
     239             :   
     240           0 :   return  fSegmentation->GetDetElemLocalID(GetHalfMFTID(detElemID), GetHalfDiskID(detElemID), GetLadderID(detElemID), GetSensorID(detElemID));
     241             :   
     242             : }
     243             : 

Generated by: LCOV version 1.11