1
0
Fork 0
mirror of https://github.com/gwm17/Mask.git synced 2024-11-23 02:38:51 -05:00
Mask/include/SabreDeadChannelMap.h

34 lines
717 B
C
Raw Normal View History

#ifndef SABREDEADCHANNELMAP_H
#define SABREDEADCHANNELMAP_H
#include <string>
#include <iostream>
#include <unordered_map>
class SabreDeadChannelMap
{
public:
SabreDeadChannelMap();
SabreDeadChannelMap(const std::string& name);
~SabreDeadChannelMap();
void LoadMapfile(const std::string& name);
bool IsDead(int det, int channel, int ringwedgeFlag);
bool IsValid() { return validFlag; };
private:
std::unordered_map<int, bool> dcMap;
bool validFlag;
static constexpr int RING = 0;
static constexpr int WEDGE = 1;
/*
Channel identifier calculated like detector*24 + 16*(RING or WEDGE) + channel
Example:
Detector 1 ring 15
1*24 + 16*0 + 15 = 39
Detector 1 wedge 0
1*24 + 16*1 +0= 40
*/
};
#endif