LCOV - code coverage report
Current view: top level - ITSMFT/MFT/MFTbase - AliMFTHalfDisk.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 46 2.2 %
Date: 2016-06-14 17:26:59 Functions: 1 10 10.0 %

          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             : 
      16             : // $Id$
      17             : 
      18             : //-----------------------------------------------------------------------------
      19             : /// \class AliMFTHalfDisk
      20             : ///
      21             : /// Class describing geometry of one half of a MFT disk
      22             : ///
      23             : // author Raphael Tieulent <raphael.tieulent@cern.ch>
      24             : //-----------------------------------------------------------------------------
      25             : 
      26             : #include "TGeoMatrix.h"
      27             : #include "TGeoManager.h"
      28             : #include "TGeoBBox.h"
      29             : 
      30             : #include "AliMFTHalfDisk.h"
      31             : #include "AliMFTGeometry.h"
      32             : #include "AliMFTHalfDiskSegmentation.h"
      33             : #include "AliMFTLadder.h"
      34             : #include "AliMFTHeatExchanger.h"
      35             : #include "AliMFTSupport.h"
      36             : 
      37             : /// \cond CLASSIMP
      38          14 : ClassImp(AliMFTHalfDisk);
      39             : /// \endcond
      40             : 
      41             : //=============================================================================================
      42             : /// \brief Default constructor
      43             : 
      44             : AliMFTHalfDisk::AliMFTHalfDisk():
      45           0 : TNamed(), fMFTSupport(NULL),fMFTHeatExchanger(NULL),fSegmentation(NULL){
      46             :   
      47           0 : }
      48             : //=============================================================================================
      49             : /// \brief Constructor
      50           0 : AliMFTHalfDisk::AliMFTHalfDisk(AliMFTHalfDiskSegmentation *segmentation):TNamed(segmentation->GetName(),segmentation->GetName()),
      51           0 :   fMFTSupport(NULL),
      52           0 :   fMFTHeatExchanger(NULL),
      53           0 :   fSegmentation(segmentation)
      54           0 : {
      55           0 :   AliMFTGeometry * mftGeom = AliMFTGeometry::Instance();
      56           0 :   SetUniqueID(fSegmentation->GetUniqueID());
      57             : //  Int_t halfDiskID = mftGeom->GetHalfDiskID(GetUniqueID());
      58             : //  SetName(Form("D%d",halfDiskID));
      59             : 
      60           0 :   AliDebug(1,Form("Creating Half-Disk: %s Unique ID = %d ", GetName(), GetUniqueID()));
      61             : 
      62           0 :   fHalfDiskVolume = new TGeoVolumeAssembly(GetName());
      63             :   
      64             :   // Building MFT Support and PCBs
      65           0 :   fMFTSupport = new AliMFTSupport();
      66           0 :   TGeoVolumeAssembly * mftSupport = fMFTSupport->CreateVolume(mftGeom->GetHalfMFTID(GetUniqueID()),mftGeom->GetHalfDiskID(GetUniqueID()));
      67           0 :   fHalfDiskVolume->AddNode(mftSupport,1);
      68             : 
      69             :   // Building Heat Exchanger Between faces
      70           0 :         TGeoVolumeAssembly * heatExchangerVol = CreateHeatExchanger();
      71           0 :         fHalfDiskVolume->AddNode(heatExchangerVol,1);
      72             :         
      73             :   //   Building Front Face of the Half Disk
      74           0 :   CreateLadders();
      75             : 
      76           0 : }
      77             : 
      78             : 
      79             : //=============================================================================================
      80             : 
      81           0 : AliMFTHalfDisk::~AliMFTHalfDisk() {
      82           0 :   delete fMFTSupport;
      83           0 :   delete fMFTHeatExchanger;
      84           0 : }
      85             : 
      86             : //=============================================================================================
      87             : /// \brief Build Heat exchanger
      88             : /// \return Pointer to the volume assembly holding the heat exchanger
      89             : 
      90             : TGeoVolumeAssembly * AliMFTHalfDisk::CreateHeatExchanger(){
      91             :   
      92           0 :   AliMFTGeometry * mftGeom = AliMFTGeometry::Instance();
      93             : 
      94           0 :   AliMFTHeatExchanger * fMFTHeatExchanger = new AliMFTHeatExchanger();
      95             :   
      96           0 :   TGeoVolumeAssembly * vol = fMFTHeatExchanger->Create(mftGeom->GetHalfMFTID(GetUniqueID()), mftGeom->GetHalfDiskID(GetUniqueID()));
      97             :   
      98           0 :   return vol;
      99             :   
     100           0 : }
     101             : 
     102             : //=============================================================================================
     103             : /// \brief Build Ladders on the Half-disk
     104             : void AliMFTHalfDisk::CreateLadders(){
     105           0 :   AliDebug(1,"Start Building Ladders" );
     106           0 :         for (Int_t iLadder=0; iLadder<fSegmentation->GetNLadders(); iLadder++) {
     107             : 
     108           0 :     AliMFTLadderSegmentation * ladderSeg = fSegmentation->GetLadder(iLadder);
     109           0 :     if(!ladderSeg) AliFatal(Form("No Segmentation found for ladder %d ",iLadder));
     110           0 :     AliMFTLadder * ladder = new AliMFTLadder(ladderSeg);
     111           0 :     TGeoVolume * ladVol = ladder->CreateVolume();
     112             :     
     113             :     // Position of the center on the ladder volume in the ladder coordinate system
     114           0 :     TGeoBBox* shape = (TGeoBBox*)ladVol->GetShape();
     115           0 :     Double_t center[3];
     116           0 :     center[0] = shape->GetDX();
     117           0 :     center[1] = shape->GetDY();
     118           0 :     center[2] = shape->GetDZ();
     119             : 
     120           0 :     Double_t master[3];
     121           0 :     ladderSeg->GetTransformation()->LocalToMaster(center, master);
     122           0 :     Int_t ladderId = AliMFTGeometry::Instance()->GetLadderID(ladderSeg->GetUniqueID());
     123             :     
     124           0 :     fHalfDiskVolume->AddNode(ladVol,ladderId,new TGeoCombiTrans(master[0],master[1],master[2],ladderSeg->GetTransformation()->GetRotation()));
     125             :     
     126           0 :     delete ladder;
     127           0 :   }
     128             : 
     129           0 : }

Generated by: LCOV version 1.11