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