BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMscRaw2Digit.h
Go to the documentation of this file.
1#ifndef BMNMSCRAW2DIGIT_H
2#define BMNMSCRAW2DIGIT_H
3
4#include "BmnEnums.h"
5#include "BmnEventHeader.h"
6#include "BmnMSCDigit.h"
7#include "BmnMath.h"
8#include "BmnSpillHeader.h"
9#include "BmnTrigInfo.h"
10#include "DigiRunHeader.h"
11
12#include <TClonesArray.h>
13#include <TDatime.h>
14#include <TString.h>
15#include <TTree.h>
16#include <fstream>
17#include <iostream>
18#include <map>
19#include <sstream>
20#include <vector>
21
22using namespace std;
23using namespace TMath;
24
25struct MscMap
26{
27 UInt_t serial;
29
30 UShort_t BT; ///< BeamTrigger index
31 UShort_t BTnBusy; ///< (BeamTrigger & !Busy)
37 UShort_t BC1H; ///< BC1 (high threshold)
38 UShort_t BC1BP; ///< BC1 (before protection)
43 UShort_t TrignBusy; ///< Trigger * !Busy
44};
45
47{
48 public:
50 Int_t run,
51 TString mappingFile,
52 TTree* spillTree = nullptr,
53 TTree* digiSpillTree = nullptr);
55
56 virtual ~BmnMscRaw2Digit() { fMap.clear(); };
57 // vector<MscMap>* GetMap() {
58 // return &fMap;
59 // }
60
61 BmnStatus ReadChannelMap(TString mappingFile);
62
64
65 BmnStatus SumEvent(TClonesArray* msc, BmnEventHeader* hdr, BmnSpillHeader* sh, UInt_t& nPedEvBySpill);
66 BmnStatus SumEvent7(TClonesArray* msc, BmnEventHeader* hdr, BmnSpillHeader* sh, UInt_t& nPedEvBySpill);
68
69 BmnStatus ParseTxtSpillLog(TString LogName, TString SchemeName);
70
72
74
76 {
77 fRawSpillTree = tree;
78 if (fRawSpillTree)
79 fRawSpillTree->GetEntry(iSpill);
80 }
81
82 void SetDigSpillTree(TTree* tree) { fDigSpillTree = tree; }
83
84 private:
85 BmnSetup fBmnSetup;
87 UInt_t fPeriodId;
88 UInt_t fRunId;
89 map<TDatime, vector<Int_t>> spill_map;
90 UInt_t iSpillMap = 0u;
94
96
98
99 vector<MscMap> fMap;
100 ifstream fMapFile;
102
103 unordered_map<UInt_t, vector<uint64_t>> fBoardSums;
104
107 UInt_t iSpill = 0u;
108
118
120};
121
122#endif /* BMNMSCRAW2DIGIT_H */
bool Bool_t
unsigned short UShort_t
int Int_t
unsigned int UInt_t
double Double_t
unsigned long long ULong64_t
#define ClassDef(name, id)
BmnStatus
Define status code.
Definition BmnEnums.h:93
unordered_map< UInt_t, vector< uint64_t > > fBoardSums
vector< MscMap > fMap
BmnStatus SumEvent7(TClonesArray *msc, BmnEventHeader *hdr, BmnSpillHeader *sh, UInt_t &nPedEvBySpill)
BmnStatus ParseTxtSpillLog(TString LogName, TString SchemeName)
BmnStatus SumEvent(TClonesArray *msc, BmnEventHeader *hdr, BmnSpillHeader *sh, UInt_t &nPedEvBySpill)
virtual ~BmnMscRaw2Digit()
map< TDatime, vector< Int_t > > spill_map
BmnStatus SumEventTemp(TClonesArray *msc)
void FillRunHeader(DigiRunHeader *rh)
void SetRawSpillTree(TTree *tree)
BmnMscRaw2Digit(Int_t period, Int_t run, TString mappingFile, TTree *spillTree=nullptr, TTree *digiSpillTree=nullptr)
TTree * GetDigSpillTree()
TTree * GetRawSpillTree()
BmnTrigInfo fTempTI
BmnStatus ReadChannelMap(TString mappingFile)
void SetDigSpillTree(TTree *tree)
Class BmnTrigInfo Trigger counters of the current spill from U40VE card.
Definition BmnTrigInfo.h:15
Definition json.hpp:4446
UShort_t L0
UShort_t BC1nBusy
UShort_t BTnBusy
(BeamTrigger & !Busy)
UInt_t serial
UShort_t BT
BeamTrigger index.
UShort_t TrignBusy
Trigger * !Busy.
UShort_t BC3
UShort_t BC1xBC2
UShort_t TriggerProtection
UShort_t IntTrig
UShort_t SRCTrig
UShort_t BC1BP
BC1 (before protection).
UShort_t BC1
UShort_t slot
UShort_t BC1H
BC1 (high threshold).
UShort_t BC2