BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnRawToDigi.C
Go to the documentation of this file.
1
#include <FairLogger.h>
2
3
// file: full path to raw file
4
// nEvents: if 0 then decode all events
5
6
void
BmnRawToDigi
(
TString
file =
""
,
TString
outfile =
""
,
Long_t
nEvents = 0,
UInt_t
period = 8)
7
{
8
9
Int_t
iVerbose = 1;
///<- Verbosity level: 0 - Progress Bar; 1 - short info on passed events
10
FairLogger::GetLogger()->SetLogToScreen(
true
);
11
FairLogger::GetLogger()->SetLogScreenLevel(
"INFO"
);
12
13
TStopwatch
timer;
14
timer.
Start
();
15
16
BmnDecoder
* decoder =
new
BmnDecoder
(file, outfile, 0, 8);
17
decoder->
SetVerbose
(iVerbose);
18
BmnSetup
stp =
kBMNSETUP
;
19
std::map<DetectorId, bool> setup;
// flags to determine BM@N setup
20
setup.insert(std::make_pair(
kBC
, 1));
// TRIGGERS
21
// setup.insert(std::make_pair(kMWPC, 0)); // MWPC
22
setup.insert(std::make_pair(
kSILICON
, 1));
// SILICON
23
setup.insert(std::make_pair(
kGEM
, 1));
// GEM
24
setup.insert(std::make_pair(
kTOF1
, 1));
// TOF-400
25
setup.insert(std::make_pair(
kTOF
, 1));
// TOF-700
26
setup.insert(std::make_pair(
kDCH
, 1));
// DCH
27
// setup.insert(std::make_pair(kZDC, 0)); // ZDC
28
// setup.insert(std::make_pair(kECAL, 0)); // ECAL
29
setup.insert(std::make_pair(
kCSC
, 1));
// CSC
30
setup.insert(std::make_pair(
kSCWALL
, 1));
// SCWALL
31
setup.insert(std::make_pair(
kFHCAL
, 1));
// FHCAL
32
setup.insert(std::make_pair(
kHODO
, 1));
// HODO
33
setup.insert(std::make_pair(
kNDET
, 1));
// Neutron Calorimeter Prototype
34
setup.insert(std::make_pair(
kHGND
, 1));
// Neutron Calorimeter
35
setup.insert(std::make_pair(
kSiBT
, 1));
// SiBD
36
decoder->
SetDetectorSetup
(setup);
37
TString
PeriodSetupExt =
Form
(
"%d%s.txt"
, period, ((stp ==
kBMNSETUP
) ?
""
:
"_SRC"
));
38
decoder->
SetTrigPlaceMapping
(
TString
(
"Trig_PlaceMap_Run"
) + PeriodSetupExt);
39
decoder->
SetTrigChannelMapping
(
TString
(
"Trig_map_Run"
) + PeriodSetupExt);
40
decoder->
SetSiliconMapping
(
TString
(
"SILICON_map_run"
) + PeriodSetupExt);
41
decoder->
SetSiBTMapping
(
TString
(
"SiBT_map_period"
) + PeriodSetupExt);
42
decoder->
SetGemMapping
(
TString
(
"GEM_map_run"
) + PeriodSetupExt);
43
decoder->
SetCSCMapping
(
TString
(
"CSC_map_period"
)
44
+
Form
(
"%d%s%s.txt"
, period, ((stp ==
kBMNSETUP
) ?
""
:
"_SRC"
),
45
(decoder->
GetRunId
() < 7013 ?
"_before_run_7013"
:
""
)));
46
decoder->
SetMSCMapping
(
TString
(
"MSC_map_Run"
) + PeriodSetupExt);
47
// in case comment out the line decoder->SetTof400Mapping("...")
48
// the maps of TOF400 will be read from DB (only for JINR network)
49
decoder->
SetTOF700ReferenceRun
(7012);
50
decoder->
SetTof700Geom
(
TString
(
"TOF700_geometry_run"
) + PeriodSetupExt);
51
decoder->
SetTof400Mapping
(
TString
(
"TOF400_PlaceMap_RUN"
) + PeriodSetupExt,
52
TString
(
"TOF400_StripMap_RUN"
) + PeriodSetupExt);
53
if
(decoder->
GetRunId
() >= 4278 && decoder->
GetPeriodId
() == 7)
54
decoder->
SetTof700Mapping
(
TString
(
"TOF700_map_period_"
) +
Form
(
"%d_from_run_4278.txt"
, period));
55
else
56
decoder->
SetTof700Mapping
(
TString
(
"TOF700_map_period_"
) +
Form
(
"%d.txt"
, period));
57
// decoder->SetZDCMapping("ZDC_map_period_5.txt");
58
// decoder->SetZDCCalibration("zdc_muon_calibration.txt");
59
decoder->
SetScWallMapping
(
TString
(
"SCWALL_map_period"
) + PeriodSetupExt);
60
decoder->
SetScWallCalibration
(
TString
(
"SCWALL_calibration_period"
) + PeriodSetupExt);
61
decoder->
SetFHCalMapping
(
TString
(
"FHCAL_map_period"
) + PeriodSetupExt);
62
decoder->
SetFHCalCalibration
(
TString
(
"FHCAL_calibration_period"
) + PeriodSetupExt);
63
decoder->
SetHodoMapping
(
Form
(
"HODO_map_period%d%s.json"
, period, ((stp ==
kBMNSETUP
) ?
""
:
"_SRC"
)));
64
decoder->
SetHodoCalibration
(
Form
(
"HODO_Q_calibration_period%d%s.json"
, period, ((stp ==
kBMNSETUP
) ?
""
:
"_SRC"
)));
65
decoder->
SetNdetMapping
(
TString
(
"NDET_map_period"
) + PeriodSetupExt);
66
if
((decoder->
GetRunId
() >= 7506 && decoder->
GetRunId
() <= 7534)
67
|| (decoder->
GetRunId
() >= 8203 && decoder->
GetRunId
() <= 8258))
68
decoder->
SetNdetCalibration
(
TString
(
"NDET_calibration_period"
)
69
+
Form
(
"%d_run_7506_7534_or_8203_8258.txt"
, period));
70
else
71
decoder->
SetNdetCalibration
(
TString
(
"NDET_calibration_period"
) + PeriodSetupExt);
72
decoder->
SetHgndMapping
(
Form
(
"HGND_map_period%d.json"
, period));
73
decoder->
SetHgndCalibration
(
Form
(
"HGND_calibration_period%d.json"
, period));
74
// decoder->SetECALMapping(TString("ECAL_map_period_") + PeriodSetupExt);
75
// decoder->SetECALCalibration("");
76
// decoder->SetMwpcMapping(TString("MWPC_map_period") + ((period == 6 && decoder->GetRunId() < 1397) ? 5 :
77
// PeriodSetupExt));
78
79
decoder->
SetApplyThreshold
(
kTRUE
);
// set kFALSE to check pedestals
80
decoder->
SetUseCalibFile
(
kFALSE
);
// set kTRUE to save and load strip signal calibration data
81
decoder->
DecodeDataToDigi
();
82
83
timer.
Stop
();
84
printf(
"\tMacro finished successfully!\n\n"
);
// marker of successfully execution for software testing systems
85
Double_t
rtime = timer.
RealTime
();
86
Double_t
ctime = timer.
CpuTime
();
87
printf(
"Real time %f s, CPU time %f s\n"
, rtime, ctime);
88
delete
decoder;
89
}
Int_t
int Int_t
Long_t
long Long_t
UInt_t
unsigned int UInt_t
kFALSE
constexpr Bool_t kFALSE
Double_t
double Double_t
kTRUE
constexpr Bool_t kTRUE
Form
char * Form(const char *fmt,...)
kBC
@ kBC
Definition
BmnDetectorList.h:31
kSILICON
@ kSILICON
Definition
BmnDetectorList.h:25
kNDET
@ kNDET
Definition
BmnDetectorList.h:35
kGEM
@ kGEM
Definition
BmnDetectorList.h:15
kTOF
@ kTOF
Definition
BmnDetectorList.h:18
kHGND
@ kHGND
Definition
BmnDetectorList.h:36
kTOF1
@ kTOF1
Definition
BmnDetectorList.h:16
kFHCAL
@ kFHCAL
Definition
BmnDetectorList.h:34
kSCWALL
@ kSCWALL
Definition
BmnDetectorList.h:32
kCSC
@ kCSC
Definition
BmnDetectorList.h:24
kDCH
@ kDCH
Definition
BmnDetectorList.h:17
kSiBT
@ kSiBT
Definition
BmnDetectorList.h:28
kHODO
@ kHODO
Definition
BmnDetectorList.h:33
BmnSetup
BmnSetup
Define experimental setup.
Definition
BmnEnums.h:165
kBMNSETUP
@ kBMNSETUP
Definition
BmnEnums.h:166
BmnDecoder
Definition
BmnDecoder.h:60
BmnDecoder::SetApplyThreshold
void SetApplyThreshold(bool b)
Definition
BmnDecoder.h:128
BmnDecoder::SetTOF700ReferenceRun
void SetTOF700ReferenceRun(Int_t n)
Definition
BmnDecoder.h:120
BmnDecoder::GetPeriodId
UInt_t GetPeriodId() const
Definition
BmnDecoder.h:134
BmnDecoder::SetHgndMapping
void SetHgndMapping(TString map)
Definition
BmnDecoder.h:217
BmnDecoder::SetTof700Geom
void SetTof700Geom(TString geom)
Definition
BmnDecoder.h:192
BmnDecoder::SetFHCalCalibration
void SetFHCalCalibration(TString cal)
Definition
BmnDecoder.h:207
BmnDecoder::SetHgndCalibration
void SetHgndCalibration(TString cal)
Definition
BmnDecoder.h:219
BmnDecoder::SetDetectorSetup
void SetDetectorSetup(std::map< DetectorId, bool > setup)
Definition
BmnDecoder.h:229
BmnDecoder::SetFHCalMapping
void SetFHCalMapping(TString map)
Definition
BmnDecoder.h:205
BmnDecoder::SetMSCMapping
void SetMSCMapping(TString map)
Definition
BmnDecoder.h:225
BmnDecoder::SetUseCalibFile
void SetUseCalibFile(bool v)
Definition
BmnDecoder.h:243
BmnDecoder::SetNdetCalibration
void SetNdetCalibration(TString cal)
Definition
BmnDecoder.h:215
BmnDecoder::SetTrigPlaceMapping
void SetTrigPlaceMapping(TString map)
Definition
BmnDecoder.h:160
BmnDecoder::GetRunId
UInt_t GetRunId() const
Definition
BmnDecoder.h:132
BmnDecoder::SetGemMapping
void SetGemMapping(TString map)
Definition
BmnDecoder.h:174
BmnDecoder::DecodeDataToDigi
BmnStatus DecodeDataToDigi()
Definition
BmnDecoder.cxx:342
BmnDecoder::SetHodoCalibration
void SetHodoCalibration(TString cal)
Definition
BmnDecoder.h:211
BmnDecoder::SetTof700Mapping
void SetTof700Mapping(TString map)
Definition
BmnDecoder.h:190
BmnDecoder::SetTrigChannelMapping
void SetTrigChannelMapping(TString file)
Definition
BmnDecoder.h:168
BmnDecoder::SetScWallMapping
void SetScWallMapping(TString map)
Definition
BmnDecoder.h:201
BmnDecoder::SetCSCMapping
void SetCSCMapping(TString map)
Definition
BmnDecoder.h:166
BmnDecoder::SetSiliconMapping
void SetSiliconMapping(TString map)
Definition
BmnDecoder.h:162
BmnDecoder::SetVerbose
void SetVerbose(Int_t v)
Definition
BmnDecoder.h:239
BmnDecoder::SetTof400Mapping
void SetTof400Mapping(TString PlaceMap, TString StripMap)
Definition
BmnDecoder.h:178
BmnDecoder::SetScWallCalibration
void SetScWallCalibration(TString cal)
Definition
BmnDecoder.h:203
BmnDecoder::SetHodoMapping
void SetHodoMapping(TString map)
Definition
BmnDecoder.h:209
BmnDecoder::SetNdetMapping
void SetNdetMapping(TString map)
Definition
BmnDecoder.h:213
BmnDecoder::SetSiBTMapping
void SetSiBTMapping(TString map)
Definition
BmnDecoder.h:164
TStopwatch
TStopwatch::RealTime
Double_t RealTime()
TStopwatch::Start
void Start(Bool_t reset=kTRUE)
TStopwatch::CpuTime
Double_t CpuTime()
TStopwatch::Stop
void Stop()
TString
BmnRawToDigi
void BmnRawToDigi(TString file="", TString outfile="", Long_t nEvents=0, UInt_t period=8)
Definition
BmnRawToDigi.C:6
macro
raw
BmnRawToDigi.C
Generated on
for BmnRoot by
1.17.0