R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BModule.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#include "R3BModule.h"
15#include "FairLogger.h"
16#include "TGeoManager.h"
17
19 : FairModule()
20{
21}
22
23R3BModule::R3BModule(const TString& name, const TString& title, const Bool_t active)
24 : FairModule(name, title, active)
25{
26}
27
28R3BModule::R3BModule(const TString& name,
29 const TString& title,
30 const Bool_t active,
31 const TString& geoFile,
32 const TGeoTranslation& trans,
33 const TGeoRotation& rot)
34 : R3BModule(name, title, active, geoFile, { trans, rot })
35{
36}
37
38R3BModule::R3BModule(const TString& name,
39 const TString& title,
40 const Bool_t active,
41 const TString& geoFile,
42 const TGeoCombiTrans& combi)
43 : FairModule(name, title, active)
44 , fCombiTrans(combi)
45{
46 SetGeometryFileName(geoFile);
47}
48
50{
51 if (!GetGeometryFileName().EndsWith(".root"))
52 {
53 LOG(fatal) << GetName() << " (which is a " << ClassName() << ") geometry file is not specified!";
54 }
56}
57
59{
60 LOG(info) << "R3BModule: Constructing " << GetName() << " (which is a " << ClassName()
61 << ") geometry from ROOT file " << GetGeometryFileName() << " ...";
62 FairModule::ConstructRootGeometry();
63
64 if (!fCombiTrans.IsIdentity())
65 {
66 auto n = gGeoManager->GetTopNode()->GetDaughter(gGeoManager->GetTopNode()->GetNdaughters() - 1);
67 (dynamic_cast<TGeoNodeMatrix*>(n))->SetMatrix(fCombiTrans.MakeClone());
68 }
69}
70
ClassImp(R3B::Neuland::Cal2HitPar)
virtual void ConstructGeometry() override
Construct geometry from root files.
Definition R3BModule.cxx:49
TGeoCombiTrans fCombiTrans
Definition R3BModule.h:52
virtual void ConstructRootGeometry(TGeoMatrix *p=nullptr) override
Definition R3BModule.cxx:58