BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnSlewingTOF700.h
Go to the documentation of this file.
1#ifndef BmnSlewingTOF700_H
2#define BmnSlewingTOF700_H 1
3
4#include <bitset>
5#include <cstdio>
6#include <cstdlib>
7#include <deque>
8#include <fstream>
9#include <iostream>
10#include <list>
11#include <map>
12#include <stdio.h>
13#include <stdlib.h>
14#include <vector>
15// ROOT
16#include "TClonesArray.h"
17#include "TFile.h"
18#include "TString.h"
19#include "TSystem.h"
20#include "TTimeStamp.h"
21#include "TTree.h"
22// BmnRoot
23#include "BmnADCDigit.h"
24#include "BmnCscRaw2Digit.h"
25#include "BmnDchRaw2Digit.h"
26#include "BmnECALRaw2Digit.h"
27#include "BmnEnums.h"
28#include "BmnEventHeader.h"
29#include "BmnGemRaw2Digit.h"
30#include "BmnGemStripDigit.h"
31#include "BmnHRBDigit.h"
32#include "BmnMwpcRaw2Digit.h"
33#include "BmnSiliconRaw2Digit.h"
34#include "BmnSyncDigit.h"
35#include "BmnTDCDigit.h"
36#include "BmnTQDCADCDigit.h"
37#include "BmnTof1Raw2Digit.h"
38#include "BmnTof2Raw2DigitNew.h"
39#include "BmnTrigRaw2Digit.h"
40#include "BmnZDCRaw2Digit.h"
41#include "DigiArrays.h"
42#include "RawTypes.h"
43
44const UInt_t kRUNNUMBERSYNC1 = 0x236E7552;
45const size_t kWORDSIZE1 = sizeof(UInt_t);
46
47/********************************************************/
48
49// wait limit for input data (ms)
50using namespace std;
51
53{
54 public:
55 BmnSlewingTOF700(TString file, ULong_t nEvents = 0, ULong_t period = 4);
57 virtual ~BmnSlewingTOF700();
58
61
69
72
73 void SetQue(deque<UInt_t>* v) { fDataQueue = v; }
74
75 deque<UInt_t>* GetQue() { return fDataQueue; }
76
77 void SetRunId(UInt_t v) { fRunId = v; }
78
79 void SetPeriodId(UInt_t v) { fPeriodId = v; }
80
81 map<UInt_t, Long64_t> GetTimeShifts() { return fTimeShifts; }
82
83 UInt_t GetRunId() const { return fRunId; }
84
85 UInt_t GetPeriodId() const { return fPeriodId; }
86
87 UInt_t GetNevents() const { return fNevents; }
88
89 UInt_t GetEventId() const { return fEventId; }
90
92
94
96
98
100
102 {
103 for (Int_t i = 0; i < 11; ++i) {
104 fDetectorSetup[i] = setup[i];
105 }
106
107 return kBMNSUCCESS;
108 }
109
110 void SetBmnSetup(BmnSetup v) { this->fBmnSetup = v; }
111
112 BmnSetup GetBmnSetup() const { return fBmnSetup; }
113
114 private:
115 const TTimeStamp TimeZero = TTimeStamp(time_t(0), 0);
116
117 // 9 bits correspond to detectors which we need to decode
119
121
123
125
126 UInt_t fRunId;
129 UInt_t fPeriodId;
130 UInt_t fEventId;
131 UInt_t fNevents;
132 // for event
135 // for run
140
143
152
153 ifstream fTrigMapFile;
154 ifstream fTrigINLFile;
155
159
160 // DAQ arrays
164 TClonesArray* adc; // zdc & ecal
171 // TClonesArray *runHeaderDAQ;
173
174 // header array
176
177 UInt_t data[10000000];
178 ULong_t fMaxEvent;
179
180 UInt_t fDat; // current 32-bits word
184 BmnEventType fCurEventType;
185 BmnEventType fPrevEventType;
186 BmnSetup fBmnSetup;
187 UInt_t fT0Serial;
188 deque<UInt_t>* fDataQueue;
189
190 // Map to store pairs <Crate serial> - <crate time - T0 time>
191 map<UInt_t, Long64_t> fTimeShifts;
194
195 map<TTimeStamp, Int_t> leaps;
198
199 BmnStatus GetT0Info(Double_t& t0time, Double_t& t0width);
201 BmnStatus FillTimeShiftsMapNoDB(UInt_t t0serial);
202};
203
204#endif
Define enumerations used in tracking.
BmnStatus
Define status code.
Definition BmnEnums.h:93
@ kBMNSUCCESS
Success.
Definition BmnEnums.h:94
const size_t kWORDSIZE1
const UInt_t kRUNNUMBERSYNC1
__m128 v
Definition P4_F32vec4.h:1
int i
Definition P4_F32vec4.h:22
bool Bool_t
int Int_t
unsigned int UInt_t
double Double_t
long long Long64_t
TClonesArray * eventHeader
BmnStatus FillTimeShiftsMap()
TClonesArray * pedestalAdc
BmnStatus FillTimeShiftsMapNoDB(UInt_t t0serial)
BmnStatus PreparationTOF700Init()
TClonesArray * hrb
BmnTof2Raw2DigitNew * GetTof700Mapper()
UInt_t GetEventId() const
BmnSlewingTOF700(TString file, ULong_t nEvents=0, ULong_t period=4)
BmnTrigRaw2Digit * fTrigMapper
BmnEventType fCurEventType
UInt_t data[10000000]
void ResetDecoder(TString file)
BmnEventType fPrevEventType
BmnStatus SlewingTOF700Init()
Int_t GetUTCShift(TTimeStamp t)
map< UInt_t, Long64_t > GetTimeShifts()
TString GetSubNameAfterRunId(TString name, Int_t RunID)
void SetTrigPlaceMapping(TString map)
BmnStatus DisposeDecoder()
TClonesArray * sync
const TTimeStamp TimeZero
TString fTrigChannelMapFileName
TClonesArray * tqdc_adc
TClonesArray * msc
BmnStatus InitMaps()
void SetTof700Mapping(TString map)
Int_t GetRunIdFromFile(TString name)
void SetQue(deque< UInt_t > *v)
TString GetRootFileName()
BmnSetup GetBmnSetup() const
void SetRunId(UInt_t v)
TClonesArray * adc128
TClonesArray * eventHeaderDAQ
BmnTof2Raw2DigitNew * fTof700Mapper
deque< UInt_t > * GetQue()
TClonesArray * tdc
void SetPeriodId(UInt_t v)
BmnStatus PreparationTOF700()
TClonesArray * adc32
TClonesArray * tqdc_tdc
BmnStatus SetDetectorSetup(Bool_t *setup)
deque< UInt_t > * fDataQueue
UInt_t GetNevents() const
Long64_t fCurentPositionRawFile
UInt_t GetRunId() const
BmnStatus InitDecoder()
void SetTrigChannelMapping(TString file)
Bool_t fDetectorSetup[11]
void SetBmnSetup(BmnSetup v)
BmnStatus ClearArrays()
TClonesArray * adc
BmnStatus GetT0Info(Double_t &t0time, Double_t &t0width)
map< UInt_t, Long64_t > fTimeShifts
UInt_t GetPeriodId() const
map< TTimeStamp, Int_t > leaps