R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BDetector.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 "R3BDetector.h"
15#include "R3BLogger.h"
16#include <TGeoManager.h>
17
19 : FairDetector()
20 , fCutE(1e-3)
21{
22}
23
24R3BDetector::R3BDetector(const TString& name, const Int_t detId)
25 : FairDetector(name, kTRUE, detId)
26 , fCutE(1e-3)
27{
28 SetVerboseLevel(1);
29}
30
31R3BDetector::R3BDetector(const TString& name,
32 const Int_t detId,
33 const TString& geoFile,
34 const TGeoTranslation& trans,
35 const TGeoRotation& rot)
36 : R3BDetector(name, detId, geoFile, { trans, rot })
37{
38}
39
40R3BDetector::R3BDetector(const TString& name, const Int_t detId, const TString& geoFile, const TGeoCombiTrans& combi)
41 : FairDetector(name, kTRUE, detId)
42 , fCutE(1e-3)
43 , fCombiTrans(combi)
44{
45 SetVerboseLevel(1);
46 SetGeometryFileName(geoFile);
47}
48
50{
51 if (!GetGeometryFileName().EndsWith(".root"))
52 {
53 R3BLOG(fatal, GetName() << " (which is a " << ClassName() << ") geometry file is not specified");
54 }
56}
57
59{
60 R3BLOG(info,
61 "Constructing " << GetName() << " (which is a " << ClassName() << ") geometry from ROOT file "
62 << GetGeometryFileName() << " ...");
63 FairModule::ConstructRootGeometry();
64
65 if (!fCombiTrans.IsIdentity())
66 {
67 auto n = gGeoManager->GetTopNode()->GetDaughter(gGeoManager->GetTopNode()->GetNdaughters() - 1);
68 (dynamic_cast<TGeoNodeMatrix*>(n))->SetMatrix(fCombiTrans.MakeClone());
69 }
70}
71
#define R3BLOG(severity, x)
Definition R3BLogger.h:35
ClassImp(R3B::Neuland::Cal2HitPar)
TGeoCombiTrans fCombiTrans
Definition R3BDetector.h:56
void ConstructGeometry() override
Construct geometry from root files.
Double_t fCutE
Definition R3BDetector.h:57
void ConstructRootGeometry(TGeoMatrix *geo=nullptr) override