er  dev
ERTelescopeGeoComponentPassive.cxx
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #include "ERTelescopeGeoComponentPassive.h"
10 
11 //--------------------------------------------------------------------------------
12 ERTelescopeGeoComponentPassive::ERTelescopeGeoComponentPassive(
13  const TString& fileName, const TString& topVolumeName,
14  const TVector3& position, const TVector3& rotation)
15  : ERGeoComponent("None", fileName, position, rotation), fFileName(fileName),
16  fTopVolumeName(topVolumeName) {
17  fGeoFile = new TFile(fileName, "READ");
18  if (!fGeoFile->IsOpen())
19  LOG(FATAL) << "Can not open file: " << fileName << FairLogger::endl;
20 }
21 //--------------------------------------------------------------------------------
22 void ERTelescopeGeoComponentPassive::ConstructGeometryVolume() {
23  fVolume = static_cast<TGeoVolume*>(fGeoFile->Get(fTopVolumeName));
24  if (!fVolume)
25  LOG(FATAL) << "Volume " << fTopVolumeName << " not found in file " << fFileName
26  << FairLogger::endl;
27 }
28 //--------------------------------------------------------------------------------