BmnRoot
Loading...
Searching...
No Matches
BmnScWallGeo.h
Go to the documentation of this file.
1#ifndef BMNSCWALLGEO_H
2#define BMNSCWALLGEO_H
3
4#include "BmnGeoTemplate.h"
5#include "BmnScWallAddress.h"
6#include "BmnScWallGeoPar.h"
7
8#include <regex>
9
10static const std::regex kScWallRegex{BmnScWallGeoPar::fElementPattern};
11
13 : public FairGeoSet
14 , public BmnGeoTemplate<BmnScWallGeo>
15{
16 public:
18 : FairGeoSet()
19 {
20 SetName("BmnScWallGeo");
21 }
22
23 static bool CheckIfSensitive(const std::string& vol) { return BmnScWallGeoPar::CheckIfSensitive(vol); }
26 static const char* TopVolumeName() { return BmnScWallGeoPar::fTopVolumeName; }
27
28 uint32_t GetAddressFromPath(const std::string& spath) const
29 {
30 std::smatch m;
31 if (std::regex_search(spath, m, kScWallRegex) && m.size() == 2) {
32 return BmnScWallAddress::GetAddress(std::stoi(m[1]));
33 }
34 LOG(error) << GetName() << ": no address for " << spath;
35 return 0;
36 }
37
38 int GetMaxCellId() const
39 {
40 uint32_t mx = 0;
41 for (auto& kv : fPositionMap) {
42 mx = std::max(mx, BmnScWallAddress::GetCellId(kv.first));
43 }
44 return mx;
45 }
46
47 ClassDef(BmnScWallGeo, 2)
48};
49
50#endif // BMNSCWALLGEO_H
__m128 m
Definition P4_F32vec4.h:27
std::map< uint32_t, std::pair< TVector3, TVector3 > > fPositionMap
static uint32_t GetCellId(uint32_t address)
Return Cell id from address.
static uint32_t GetAddress(uint32_t CellId)
Return address from system ID, Cell ID.
static bool CheckIfSensitive(std::string name)
static const TString fDetectorVolumeName
static const TString fTopVolumeName
static const TString fPathBeforeLocalSystem
static const std::regex fElementPattern
int GetMaxCellId() const
static bool CheckIfSensitive(const std::string &vol)
static const char * TopVolumeName()
uint32_t GetAddressFromPath(const std::string &spath) const
static const char * DetectorVolumeName()
static const char * PathBeforeLocalSystem()