1#ifndef BMNTRIGRAWTODIGIT_H
2#define BMNTRIGRAWTODIGIT_H
9#include <unordered_map>
23#define CHANNEL_COUNT_MAX 72u
24#define TDC72_CHANNEL_COUNT 72u
25#define TQDC16_CHANNEL_COUNT 16u
26#define TDC_BIN_COUNT 1024
27#define HPTIMEBIN 0.02344
28#define INVHPTIMEBIN 42.6666
29#define ADC_CLOCK_TQDC16VS 8.0
31#define ADC_CLOCK_OLD 12.5
33#define TDC_CLOCK_OLD 25.0
38using std::unordered_map;
116 if (itPl.second->IsT0)
117 return itPl.second->CrateSerial;
130 TString inlFileName =
Form(
"%s-%04X-%04X.ini", boardName.
Data(), h, l);
137 TPRegexp reBoardName(
"(\\D+)(\\d+)(.*)");
140 if (reBoardName.
MatchB(channelCountStr)) {
143 reBoardName.
Substitute(channelCountStr,
"$2");
144 channelCount = strtoul(channelCountStr.
Data(),
nullptr, 10);
159 vector<BmnTrigChannelData>
fMap;
164 static constexpr size_t ADC_RANGE = SHRT_MAX - SHRT_MIN + 1;
#define ClassDef(name, id)
char * Form(const char *fmt,...)
BmnStatus
Define status code.
BmnSetup
Define experimental setup.
std::unordered_map< std::string, std::pair< uint32_t, uint16_t > > Name2SerCh
std::map< std::pair< uint32_t, uint16_t >, std::string > SerCh2Name
std::map< T0MapKey, uint16_t > T0ChMap
std::unordered_map< std::string, uint16_t > NameChMap
int16_t GetBaselineByMap(vector< int16_t > &iValue)
BmnStatus ReadINLFromFile(BmnTrigParameters *par)
static constexpr size_t ADC_RANGE
map< std::pair< uint32_t, uint16_t >, uint16_t > scalers2index_map
vector< BmnTrigChannelData > fMap
map< int16_t, uint16_t > fValsMap
Name2SerCh name2scaler_map
BmnTrigRaw2Digit(TString mappingFile, TString INLFile, std::function< void(TString, TClonesArray *)> BranchRegFun)
vector< string > & GetScalerIdx2NameMap()
vector< string > scalers_index2name_map
BmnStatus ReadChannelMap(TString mappingFile)
vector< TClonesArray * > * GetTrigArrays()
NameChMap & GetScalerName2IdxMap()
virtual ~BmnTrigRaw2Digit()
map< PlMapKey, BmnTrigParameters * > fPlacementMap
int16_t GetBaseline(vector< int16_t > &iValue)
BmnStatus FillEvent(TClonesArray *tdc, TClonesArray *adc, unordered_map< UInt_t, Long64_t > &tsMap)
NameChMap & GetTrcMap()
TRC bit map.
Name2SerCh & GetScalerMap()
MSC map.
map< uint16_t, uint16_t > trcIdx2scalerIdx
void ProcessWave(vector< int16_t > &iValue, Bool_t &isNeg)
void SetSetup(BmnSetup stp)
SerCh2Name & GetScaler2NameMap()
map< uint16_t, uint16_t > & GetTrcIdx2ScalerIdxMap()
SerCh2Name scalers2name_map
BmnTrigRaw2Digit(TString mappingFile, TString INLFile, TTree *digiTree=NULL)
map< std::pair< uint32_t, uint16_t >, uint16_t > & GetScaler2IdxMap()
NameChMap scalers_name2index_map
UInt_t ChanCntByName(TString channelCountStr)
T0ChMap & T0Map()
Raw T0 module map (from Sergeev txt).
TString Serial2FileName(TString boardName, UInt_t serial)
BmnStatus FillEvent(TClonesArray *tdc, unordered_map< UInt_t, Long64_t > &tsMap)
BmnStatus ReadPlacementMap(TString mappingFile)
vector< BmnTrigChannelData > * GetMap()
vector< TClonesArray * > trigArrays
Bool_t MatchB(const TString &s, const TString &mods="", Int_t start=0, Int_t nMaxMatch=10)
Int_t Substitute(TString &s, const TString &replace, const TString &mods="", Int_t start=0, Int_t nMatchMax=10)
const char * Data() const
const UShort_t kNCHANNELS
Define enumerations used in tracking.
#define CHANNEL_COUNT_MAX
TClonesArray * branchArrayPtr
Double_t INL[CHANNEL_COUNT_MAX][TDC_BIN_COUNT]
Bool_t NegativeMap[CHANNEL_COUNT_MAX]
TClonesArray * branchArrayPtr[CHANNEL_COUNT_MAX]
UShort_t ChannelMap[CHANNEL_COUNT_MAX]
Double_t t[CHANNEL_COUNT_MAX]