Project
Loading...
Searching...
No Matches
ExternalModule.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_PASSIVE_EXTERNALMODULE_H
13#define ALICEO2_PASSIVE_EXTERNALMODULE_H
14
15#include "DetectorsPassive/PassiveBase.h" // base class of passive modules
16#include "Rtypes.h" // for Pipe::Class, ClassDef, Pipe::Streamer
17
18class TGeoVolume;
19class TGeoTransformation;
20
21namespace o2
22{
23namespace passive
24{
25
26// options used to configure a generic plug and play external module
28 std::string root_macro_file; // the file where to lookup the ROOT geometry building macro
29 std::string top_volume; // the volume to be added
30 std::string anchor_volume; // the volume into which the detector will be hooked
31 TGeoMatrix const* placement = nullptr; // how to place the module inside anchor_volume
32};
33
34// a module (passive material) defined externally (ROOT macro / GDML / TGeo geometry)
36{
37 public:
38 ExternalModule(const char* name, const char* long_title, ExternalModuleOptions options);
39 ExternalModule() = default; // default constructor
40
41 ~ExternalModule() override = default;
42 void ConstructGeometry() override;
43
45 FairModule* CloneModule() const override { return nullptr; }
46
47 typedef std::function<TGeoVolume const*()> GeomBuilderFcn; // function hook for external geometry builder
48
49 private:
50 // void createMaterials();
51 ExternalModule(const ExternalModule& orig);
52 ExternalModule& operator=(const ExternalModule&);
53
54 GeomBuilderFcn mGeomHook;
55 ExternalModuleOptions mOptions;
56
57 bool initGeomBuilderHook(); // function to load/JIT Geometry builder hook
58 void remapMedia(TGeoVolume* vol); // performs a remapping of materials/media IDs after registration with VMC
59
60 // ClassDefOverride(ExternalModule, 0);
61};
62} // namespace passive
63} // namespace o2
64#endif
~ExternalModule() override=default
std::function< TGeoVolume const *()> GeomBuilderFcn
FairModule * CloneModule() const override
Clone this object (used in MT mode only)
a common base class for passive modules - implementing generic functions
Definition PassiveBase.h:24
GLuint const GLchar * name
Definition glcorearb.h:781
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...