EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
IrtGeo.h
Go to the documentation of this file.
1// Copyright (C) 2022, 2023, Christopher Dilks
2// Subject to the terms in the LICENSE file found in the top-level directory.
3
4// bind IRT and DD4hep geometries for the RICHes
5#pragma once
6
7#include <DD4hep/DetElement.h>
8#include <DD4hep/Detector.h>
9#include <DD4hep/Objects.h>
10#include <DDRec/CellIDPositionConverter.h>
11#include <DDRec/DetectorData.h>
12#include <IRT/CherenkovDetector.h>
13#include <IRT/CherenkovDetectorCollection.h>
14#include <Math/GenVector/Cartesian3D.h>
15#include <Math/GenVector/DisplacementVector3D.h>
16#include <spdlog/logger.h>
17#include <gsl/pointers>
18#include <memory>
19#include <string>
20#include <unordered_map>
21
22// local
23#include "RichGeo.h"
24
25namespace richgeo {
26class IrtGeo {
27public:
28 // constructor: creates IRT-DD4hep bindings using main `Detector` handle `*det_`
29 IrtGeo(std::string detName_, gsl::not_null<const dd4hep::Detector*> det_,
30 gsl::not_null<const dd4hep::rec::CellIDPositionConverter*> conv_,
31 std::shared_ptr<spdlog::logger> log_);
32 virtual ~IrtGeo();
33
34 // access the full IRT geometry
35 CherenkovDetectorCollection* GetIrtDetectorCollection() const { return m_irtDetectorCollection; }
36
37protected:
38 // protected methods
39 virtual void DD4hep_to_IRT() = 0; // given DD4hep geometry, produce IRT geometry
40 void
41 SetReadoutIDToPositionLambda(); // define the `cell ID -> pixel position` converter, correcting to sensor surface
42 void SetRefractiveIndexTable(); // fill table of refractive indices
43 // read `VariantParameters` for a vector
44 template <class VecT>
45 VecT GetVectorFromVariantParameters(dd4hep::rec::VariantParameters* pars, std::string key) const {
46 return VecT(pars->get<double>(key + "_x"), pars->get<double>(key + "_y"),
47 pars->get<double>(key + "_z"));
48 }
49
50 // inputs
51 std::string m_detName;
52
53 // DD4hep geometry handles
54 gsl::not_null<const dd4hep::Detector*> m_det;
55 dd4hep::DetElement m_detRich;
56 dd4hep::Position m_posRich;
57
58 // cell ID conversion
59 gsl::not_null<const dd4hep::rec::CellIDPositionConverter*> m_converter;
60 std::unordered_map<int, richgeo::Sensor> m_sensor_info; // sensor ID -> sensor info
61
62 // IRT geometry handles
63 CherenkovDetectorCollection* m_irtDetectorCollection{};
64 CherenkovDetector* m_irtDetector{};
65
66 // logger
67 std::shared_ptr<spdlog::logger> m_log;
68
69private:
70 // set all geometry handles
71 void Bind();
72};
73} // namespace richgeo
Definition IrtGeo.h:26
dd4hep::Position m_posRich
Definition IrtGeo.h:56
virtual ~IrtGeo()
Definition IrtGeo.cc:97
VecT GetVectorFromVariantParameters(dd4hep::rec::VariantParameters *pars, std::string key) const
Definition IrtGeo.h:45
CherenkovDetector * m_irtDetector
Definition IrtGeo.h:64
std::string m_detName
Definition IrtGeo.h:51
dd4hep::DetElement m_detRich
Definition IrtGeo.h:55
virtual void DD4hep_to_IRT()=0
void SetRefractiveIndexTable()
Definition IrtGeo.cc:80
std::shared_ptr< spdlog::logger > m_log
Definition IrtGeo.h:67
CherenkovDetectorCollection * m_irtDetectorCollection
Definition IrtGeo.h:63
void SetReadoutIDToPositionLambda()
Definition IrtGeo.cc:47
CherenkovDetectorCollection * GetIrtDetectorCollection() const
Definition IrtGeo.h:35
gsl::not_null< const dd4hep::rec::CellIDPositionConverter * > m_converter
Definition IrtGeo.h:59
gsl::not_null< const dd4hep::Detector * > m_det
Definition IrtGeo.h:54
std::unordered_map< int, richgeo::Sensor > m_sensor_info
Definition IrtGeo.h:60
Definition ActsGeo.h:18