LCOV - code coverage report
Current view: top level - MUON/MUONgeometry - AliMUONSurveyDetElem.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 53 1.9 %
Date: 2016-06-14 17:26:59 Functions: 1 15 6.7 %

          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             : /// \class AliMUONSurveyDetElem
      17             : /// Class for the survey processing of the ALICE DiMuon spectrometer 
      18             : ///
      19             : /// This object provides the methods specific to the detection elements
      20             : ///
      21             : /// \author Javier Castillo
      22             : //-----------------------------------------------------------------------------
      23             : 
      24             : #include "TGeoMatrix.h"
      25             : 
      26             : #include "AliLog.h"
      27             : #include "AliSurveyObj.h"
      28             : 
      29             : #include "AliMUONSurveyChamber.h"
      30             : #include "AliMUONSurveyDetElem.h"
      31             : 
      32             : /// \cond CLASSIMP
      33          18 : ClassImp(AliMUONSurveyDetElem)
      34             : /// \endcond
      35             : 
      36             : AliMUONSurveyDetElem::AliMUONSurveyDetElem(Int_t lDetElemId) 
      37           0 :   : AliMUONSurveyObj() 
      38           0 :   , fDetElemId(lDetElemId)
      39           0 :   , fSurveyChamber(0x0)
      40           0 : {
      41             : /// Constructor with detection element id
      42           0 : }
      43             : 
      44             : AliMUONSurveyDetElem::AliMUONSurveyDetElem(Int_t lDetElemId, AliMUONSurveyChamber *lSurveyChamber) 
      45           0 :   : AliMUONSurveyObj() /// Constructor with mother chamber provided
      46           0 :   , fDetElemId(lDetElemId)
      47           0 :   , fSurveyChamber(lSurveyChamber)
      48           0 : {
      49             : /// Constructor with mother chamber provided
      50           0 : }
      51             : 
      52           0 : AliMUONSurveyDetElem::~AliMUONSurveyDetElem() {
      53             :   /// Destructor
      54           0 : }
      55             : 
      56             : Int_t AliMUONSurveyDetElem::AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
      57             :   /// Add a maximum of lTargetMax sticker targets with stBaseName from pArray of targets 
      58           0 :   return AliMUONSurveyObj::AddStickerTargets(pArray, stBaseName, lTargetMax);
      59           0 : }
      60             : 
      61             : Int_t AliMUONSurveyDetElem::AddStickerTargets(TString stBaseName, Int_t lTargetMax) {
      62             :   /// Add a maximum of lTargetMax sticker targets with stBaseName from internal SurveyObj
      63           0 :   if (!fSurveyChamber) {
      64           0 :     AliError("Pointer to mother chamber has not been set!");
      65           0 :     return 0;
      66             :   }
      67           0 :   if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
      68           0 :     AliError("Survey data is missing!");
      69           0 :     return 0;    
      70             :   }
      71           0 :   return AddStickerTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
      72           0 : }
      73             : 
      74             : Int_t AliMUONSurveyDetElem::AddGButtonTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
      75             :   /// Add a maximum of lTargetMax global button targets with stBaseName from pArray of targets 
      76           0 :   return AliMUONSurveyObj::AddGButtonTargets(pArray, stBaseName, lTargetMax);
      77           0 : }
      78             : 
      79             : Int_t AliMUONSurveyDetElem::AddGButtonTargets(TString stBaseName, Int_t lTargetMax) {
      80             :   /// Add a maximum of lTargetMax sticker targets with stBaseName from internal SurveyObj
      81           0 :   if (!fSurveyChamber) {
      82           0 :     AliError("Pointer to mother chamber has not been set!");
      83           0 :     return 0;
      84             :   }
      85           0 :   if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
      86           0 :     AliError("Survey data is missing!");
      87           0 :     return 0;    
      88             :   }
      89           0 :   return AddGButtonTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
      90           0 : }
      91             : 
      92             : void AliMUONSurveyDetElem::SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf) {
      93             :   /// Set the geometry transformation of this detection element
      94           0 :   AliMUONSurveyObj::SetLocalTransformation(localTrf,ownerLocalTrf);
      95           0 :   if (!fSurveyChamber) {
      96           0 :     AliWarning("Pointer to mother chamber has not been set!");
      97           0 :     AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);
      98           0 :   } else {
      99           0 :     if (fSurveyChamber->GetLocalTrf()){
     100           0 :       if (fSurveyChamber->GetAlignTrf()){
     101           0 :         AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*(fSurveyChamber->GetAlignTrf()))*(*localTrf)),kTRUE);
     102           0 :       } else {
     103           0 :         AliWarning("Mother chamber has not been aligned yet!");
     104           0 :         AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*localTrf)),kTRUE);
     105             :       }
     106             :     } else {
     107           0 :       AliWarning("Mother chamber has no local transformation");
     108           0 :       AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);      
     109             :     }
     110             :   }
     111           0 : }
     112             : 
     113             : void AliMUONSurveyDetElem::PrintLocalTrf() {
     114             :   /// Print the local transformation
     115           0 :   printf("DetElem%d Th",fDetElemId);
     116           0 :   AliMUONSurveyObj::PrintLocalTrf();
     117           0 : }
     118             : 
     119             : void AliMUONSurveyDetElem::PrintAlignTrf() {
     120             :   /// Print the alignment transformation
     121           0 :   printf("DetElem%d d",fDetElemId);
     122           0 :   AliMUONSurveyObj::PrintAlignTrf();
     123           0 : }

Generated by: LCOV version 1.11