BmnRoot
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;
28 UShort_t slot;
29
30 UShort_t BT;
31 UShort_t BTnBusy;
32 UShort_t L0;
34 UShort_t BC1;
35 UShort_t BC2;
36 UShort_t BC3;
37 UShort_t BC1H;
38 UShort_t BC1BP;
39 UShort_t BC1xBC2;
40 UShort_t BC1nBusy;
41 UShort_t IntTrig;
42 UShort_t SRCTrig;
43 UShort_t TrignBusy;
44};
45
47{
48 public:
49 BmnMscRaw2Digit(Int_t period,
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);
67 BmnStatus SumEventTemp(TClonesArray* msc);
68
69 BmnStatus ParseTxtSpillLog(TString LogName, TString SchemeName);
70
71 TTree* GetRawSpillTree() { return fRawSpillTree; }
72
73 TTree* GetDigSpillTree() { return fDigSpillTree; }
74
75 void SetRawSpillTree(TTree* tree)
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;
86 Bool_t isValidSpillLog;
87 UInt_t fPeriodId;
88 UInt_t fRunId;
89 map<TDatime, vector<Int_t>> spill_map;
90 UInt_t iSpillMap = 0u;
91 TDatime dtStart;
92 TDatime dtEnd;
93 Int_t fLogShift;
94
95 Int_t fVerbose = 0;
96
97 BmnTrigInfo fTempTI;
98
99 vector<MscMap> fMap;
100 ifstream fMapFile;
101 TString fMapFileName;
102
103 unordered_map<UInt_t, vector<uint64_t>> fBoardSums;
104
105 TTree* fRawSpillTree = nullptr;
106 TTree* fDigSpillTree = nullptr;
107 UInt_t iSpill = 0u;
108
109 ULong64_t fBT = 0u;
110 ULong64_t fBTnBusy = 0u;
111 ULong64_t fAccepted = 0u;
112 ULong64_t fProtection = 0u;
113 ULong64_t fL0 = 0u;
114 Double_t fBTAccepted = 0.0;
115 ULong64_t fBC1 = 0u;
116 ULong64_t fBC2 = 0u;
117 ULong64_t fBC3 = 0u;
118
119 ClassDef(BmnMscRaw2Digit, 1);
120};
121
122#endif /* BMNMSCRAW2DIGIT_H */
BmnStatus
Definition BmnEnums.h:24
BmnSetup
Definition BmnEnums.h:89
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()
BmnStatus SumEventTemp(TClonesArray *msc)
void FillRunHeader(DigiRunHeader *rh)
void SetRawSpillTree(TTree *tree)
TTree * GetDigSpillTree()
TTree * GetRawSpillTree()
BmnStatus ReadChannelMap(TString mappingFile)
void SetDigSpillTree(TTree *tree)
-clang-format
STL namespace.
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