R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BDetector.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2009-2026 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 "R3BDetector.h"
15#include "R3BLogger.h"
16#include <TGeoManager.h>
17
19 : FairDetector()
20{
21}
22
23R3BDetector::R3BDetector(const TString& name, const Int_t detId)
24 : FairDetector(name, kTRUE, detId)
26{
27 SetVerboseLevel(1);
28}
29
30R3BDetector::R3BDetector(const TString& name,
31 const Int_t detId,
32 const TString& geoFile,
33 const TGeoTranslation& trans,
34 const TGeoRotation& rot)
35 : R3BDetector(name, detId, geoFile, { trans, rot })
36{
37}
38
39R3BDetector::R3BDetector(const TString& name, const Int_t detId, const TString& geoFile, const TGeoCombiTrans& combi)
40 : FairDetector(name, kTRUE, detId)
42 , fCombiTrans(combi)
43{
44 SetVerboseLevel(1);
45 SetGeometryFileName(geoFile);
46}
47
49{
50 if (!GetGeometryFileName().EndsWith(".root"))
51 {
52 R3BLOG(fatal, GetName() << " (which is a " << ClassName() << ") geometry file is not specified");
53 }
55}
56
58{
59 R3BLOG(info,
60 "Constructing " << GetName() << " (which is a " << ClassName() << ") geometry from ROOT file "
61 << 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
constexpr double fCutEvalue
Definition R3BDetector.h:20
#define R3BLOG(severity, x)
Definition R3BLogger.h:33
ClassImp(R3B::Neuland::Cal2HitPar)
double fCutE
Definition R3BDetector.h:59
TGeoCombiTrans fCombiTrans
Definition R3BDetector.h:58
void ConstructGeometry() override
Construct geometry from root files.
void ConstructRootGeometry(TGeoMatrix *geo=nullptr) override