er  dev
ERGeoSubAssembly.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 ERGeoSubAssembly_H
10 #define ERGeoSubAssembly_H
11 
12 #include "ERGeoComponent.h"
13 
14 #include "TString.h"
15 #include "TVector3.h"
16 #include "TGeoVolume.h"
17 #include "TGeoMatrix.h"
18 
20 public:
21  ERGeoSubAssembly() = default;
22  ERGeoSubAssembly(const TString& name) : ERGeoComponent(name) {}
23  ERGeoSubAssembly(const TString& name, const TVector3& position, const TVector3& rotation)
24  : ERGeoComponent(name, position, rotation) {}
25  /* Modifiers */
26  void AddComponent(ERGeoComponent* component);
27  void AddComponent(ERGeoComponent* component, const TVector3& position, const TVector3& rotation);
28  /* Accessors */
29  const TGeoVolume* GetVolume() const {return fVolume;}
30  const std::map<TString, ERGeoComponent*>& GetComponents() const { return fComponents; }
31  std::list<TString> GetComponentNames() const;
32  virtual std::list<TString> GetBranchNames(ERDataObjectType object) const {
33  LOG(FATAL) << "SubAssembly does not produce branches\n";
34  return {};
35  }
36  void ConstructGeometryVolume();
37 protected:
38  virtual void ParseXmlParameters() {}
39  std::map<TString, ERGeoComponent*> fComponents;
40  ClassDef(ERGeoSubAssembly,1)
41 };
42 #endif