BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnNdetGeo.h
Go to the documentation of this file.
1
// BmnNdetGeo.h
2
#ifndef BMNNDETGEO_H
3
#define BMNNDETGEO_H
4
5
#include "BmnGeoTemplate.h"
6
#include "
BmnNdetAddress.h
"
7
#include "
BmnNdetGeoPar.h
"
8
9
#include <regex>
10
11
static
const
std::regex
kNdetRegex
{
BmnNdetGeoPar::fElementPattern
};
12
static
const
std::regex
kArmRegex
{
BmnNdetGeoPar::fArmPattern
};
13
14
class
BmnNdetGeo
15
:
public
FairGeoSet
16
,
public
BmnGeoTemplate
<BmnNdetGeo>
17
{
18
public
:
19
BmnNdetGeo
()
20
:
FairGeoSet
()
21
{
22
SetName(
"BmnNdetGeo"
);
23
}
24
25
enum class
BoxFace
26
{
27
Unknown
,
28
Xminus
,
29
Xplus
,
30
Yminus
,
31
Yplus
,
32
Zminus
,
33
Zplus
34
};
35
enum class
Direction
36
{
37
Unknown
,
38
FromInside
,
39
FromOutside
40
};
41
static
std::pair<BoxFace, Direction>
GetEnteredFace
(
const
TVector3
& globalPos,
const
TVector3
& globalMom);
42
43
static
bool
CheckIfSensitive
(
const
std::string& vol) {
return
BmnNdetGeoPar::CheckIfSensitive
(vol); }
44
static
const
char
*
PathBeforeLocalSystem
() {
return
BmnNdetGeoPar::fPathBeforeLocalSystem
; }
45
static
const
char
*
DetectorVolumeName
() {
return
BmnNdetGeoPar::fDetectorVolumeName
; }
46
static
const
char
*
TopVolumeName
() {
return
BmnNdetGeoPar::fTopVolumeName
; }
47
48
uint32_t
GetAddressFromPath
(
const
std::string& spath)
const
49
{
50
LOG(debug4) << GetName() <<
": address from path "
<< spath;
51
std::smatch
m
;
52
if
(std::regex_search(spath,
m
,
kNdetRegex
) &&
m
.size() == 5) {
53
int
det = std::stoi(
m
[1]);
54
int
row = std::stoi(
m
[2]);
55
int
col = std::stoi(
m
[3]);
56
int
layer = std::stoi(
m
[4]);
57
return
BmnNdetAddress::GetAddress
(det, row, col, layer);
58
}
59
60
LOG(error) << GetName() <<
": no address for "
<< spath;
61
return
0;
62
}
63
64
uint8_t
GetArmFromPath
(
const
std::string& spath)
const
65
{
66
LOG(debug4) << GetName() <<
": address from path "
<< spath;
67
std::smatch
m
;
68
if
(std::regex_search(spath,
m
,
kArmRegex
) &&
m
.size() == 2) {
69
return
static_cast<
uint32_t
>
(std::stoi(
m
[1].str()));
70
}
71
72
LOG(error) << GetName() <<
": no address for "
<< spath;
73
return
0;
74
}
75
76
ClassDef
(
BmnNdetGeo
, 4)
77
};
78
79
#endif
// BMNNDETGEO_H
m
__m128 m
Definition
P4_F32vec4.h:27
ClassDef
#define ClassDef(name, id)
BmnGeoTemplate< BmnNdetGeo >::BmnGeoTemplate
BmnGeoTemplate()=default
BmnNdetAddress::GetAddress
static uint32_t GetAddress(uint32_t ArmId, uint32_t RowId, uint32_t ColumnId, uint32_t LayerId)
Return address.
Definition
BmnNdetAddress.h:39
BmnNdetGeoPar::fDetectorVolumeName
static const TString fDetectorVolumeName
Definition
BmnNdetGeoPar.h:40
BmnNdetGeoPar::fPathBeforeLocalSystem
static const TString fPathBeforeLocalSystem
Definition
BmnNdetGeoPar.h:59
BmnNdetGeoPar::fArmPattern
static const std::regex fArmPattern
Definition
BmnNdetGeoPar.h:62
BmnNdetGeoPar::CheckIfSensitive
static bool CheckIfSensitive(std::string name)
Definition
BmnNdetGeoPar.cxx:62
BmnNdetGeoPar::fElementPattern
static const std::regex fElementPattern
Definition
BmnNdetGeoPar.h:61
BmnNdetGeoPar::fTopVolumeName
static const TString fTopVolumeName
Definition
BmnNdetGeoPar.h:37
BmnNdetGeo
Definition
BmnNdetGeo.h:17
BmnNdetGeo::GetArmFromPath
uint8_t GetArmFromPath(const std::string &spath) const
Definition
BmnNdetGeo.h:64
BmnNdetGeo::CheckIfSensitive
static bool CheckIfSensitive(const std::string &vol)
Definition
BmnNdetGeo.h:43
BmnNdetGeo::PathBeforeLocalSystem
static const char * PathBeforeLocalSystem()
Definition
BmnNdetGeo.h:44
BmnNdetGeo::GetEnteredFace
static std::pair< BoxFace, Direction > GetEnteredFace(const TVector3 &globalPos, const TVector3 &globalMom)
Definition
BmnNdetGeo.cxx:7
BmnNdetGeo::BmnNdetGeo
BmnNdetGeo()
Definition
BmnNdetGeo.h:19
BmnNdetGeo::TopVolumeName
static const char * TopVolumeName()
Definition
BmnNdetGeo.h:46
BmnNdetGeo::GetAddressFromPath
uint32_t GetAddressFromPath(const std::string &spath) const
Definition
BmnNdetGeo.h:48
BmnNdetGeo::Direction
Direction
Definition
BmnNdetGeo.h:36
BmnNdetGeo::Direction::FromOutside
@ FromOutside
Definition
BmnNdetGeo.h:39
BmnNdetGeo::Direction::FromInside
@ FromInside
Definition
BmnNdetGeo.h:38
BmnNdetGeo::BoxFace
BoxFace
Definition
BmnNdetGeo.h:26
BmnNdetGeo::BoxFace::Zplus
@ Zplus
Definition
BmnNdetGeo.h:33
BmnNdetGeo::BoxFace::Yminus
@ Yminus
Definition
BmnNdetGeo.h:30
BmnNdetGeo::BoxFace::Unknown
@ Unknown
Definition
BmnNdetGeo.h:27
BmnNdetGeo::BoxFace::Zminus
@ Zminus
Definition
BmnNdetGeo.h:32
BmnNdetGeo::BoxFace::Xminus
@ Xminus
Definition
BmnNdetGeo.h:28
BmnNdetGeo::BoxFace::Yplus
@ Yplus
Definition
BmnNdetGeo.h:31
BmnNdetGeo::BoxFace::Xplus
@ Xplus
Definition
BmnNdetGeo.h:29
BmnNdetGeo::DetectorVolumeName
static const char * DetectorVolumeName()
Definition
BmnNdetGeo.h:45
FairGeoSet
TVector3
BmnNdetAddress.h
BmnNdetGeoPar.h
kArmRegex
static const std::regex kArmRegex
Definition
BmnNdetGeo.h:12
kNdetRegex
static const std::regex kNdetRegex
Definition
BmnNdetGeo.h:11
kArmRegex
static const std::regex kArmRegex
Definition
BmnNdetGeo.h:12
kNdetRegex
static const std::regex kNdetRegex
Definition
BmnNdetGeo.h:11
detectors
ndet
BmnNdetGeo.h
Generated on
for BmnRoot by
1.17.0