er  dev
ERSetup.h
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 #ifndef ERSetup_H
10 #define ERSetup_H
11 
12 #include "ERGeoComponent.h"
13 #include "ERGeoSubAssembly.h"
14 
15 class ERSetup {
16 public:
17  ERSetup() = default;
18  virtual ~ERSetup() = default;
19  /* Modifiers */
20  void SetXMLParametersFile(const TString& xmlFileName) {fParamsXMLFileName = xmlFileName;}
21  void SetGeoName(const TString& name) {fGeoName = name;}
22  void AddSubAssembly(ERGeoSubAssembly* subAssembly);
23  void AddSubAssembly(ERGeoSubAssembly* subAssembly, const TVector3& position, const TVector3& rotation);
24  /* Accessors */
25  TString GetGeoFileName() const {return (fGeoName + ".temp.root");}
26  TString GetGeoName() const {return fGeoName;}
27  TString GetXMLParametersFile(void) const {return fParamsXMLFileName;}
28  std::list<ERGeoComponent*> GetAllComponents();
29  ERGeoComponent* GetComponent(const TString& path);
30 public:
31  virtual void ReadGeoParamsFromParContainer() = 0;
32  virtual Int_t SetParContainers();
33  virtual void ConstructGeometry();
34 protected:
35  TString fParamsXMLFileName;
36  std::map<TString, ERGeoSubAssembly*> fSubAssemblies;
37  TString fGeoName;
38 
39  ClassDef(ERSetup,1)
40 };
41 #endif