BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnDataToRoot.C
Go to the documentation of this file.
1#include <Rtypes.h>
2R__ADD_INCLUDE_PATH($VMCWORKDIR)
3#include "bmndata/BmnEnums.h"
4#include "macro/run/bmnloadlibs.C"
5
6// file: full path to raw-file
7// nEvents: if 0 then decode all events
8// doConvert: convert RAW --> ROOT before decoding or use file converted before
9
10void BmnDataToRoot(TString file, Long_t nEvents = 0, Bool_t doConvert = kTRUE)
11{
12 bmnloadlibs(); // load BmnRoot libraries
13 UInt_t period = 7;
14 BmnSetup stp = kBMNSETUP; // use kSRCSETUP for Short-Range Correlation program and kBMNSETUP otherwise
15 // BmnSetup stp = kSRCSETUP; // use kSRCSETUP for Short-Range Correlation program and kBMNSETUP otherwise
16 BmnRawDataDecoder* decoder = new BmnRawDataDecoder(file, nEvents, period);
17 decoder->SetBmnSetup(stp);
18
19 Bool_t setup[11]; // array of flags to determine BM@N setup
20 // Just put "0" to exclude detector from decoding
21 setup[0] = 1; // TRIGGERS
22 setup[1] = 0; // MWPC
23 setup[2] = 0; // SILICON
24 setup[3] = 0; // GEM
25 setup[4] = 0; // TOF-400
26 setup[5] = 1; // TOF-700
27 setup[6] = 0; // DCH
28 setup[7] = 0; // ZDC
29 setup[8] = 0; // ECAL
30 setup[9] = 0; // LAND
31 setup[10] = 0; // CSC
32 decoder->SetDetectorSetup(setup);
33
34 TString PeriodSetupExt = Form("%d%s.txt", period, ((stp == kBMNSETUP) ? "" : "_SRC"));
35 decoder->SetTrigPlaceMapping(TString("Trig_PlaceMap_Run") + PeriodSetupExt);
36 decoder->SetTrigChannelMapping(TString("Trig_map_Run") + PeriodSetupExt);
37 decoder->SetSiliconMapping("SILICON_map_run7.txt");
38 decoder->SetGemMapping(TString("GEM_map_run") + PeriodSetupExt);
39 decoder->SetCSCMapping(TString("CSC_map_period") + PeriodSetupExt);
40 // in case comment out the line decoder->SetTof400Mapping("...")
41 // the maps of TOF400 will be read from DB (only for JINR network)
42 decoder->SetTof400Mapping(TString("TOF400_PlaceMap_RUN") + PeriodSetupExt,
43 TString("TOF400_StripMap_RUN") + PeriodSetupExt);
44 decoder->SetTof700Mapping("TOF700_map_period_7.txt");
45 decoder->SetTof700Geom("TOF700_geometry_run7.txt");
46 // decoder->SetTOF700ReferenceRun(9649); // slewing run for Agron, field 1250A
47 // decoder->SetTOF700ReferenceRun(5070); // slewing run for Krypton,field 1150A
48 decoder->SetZDCMapping("ZDC_map_period_5.txt");
49 decoder->SetZDCCalibration("zdc_muon_calibration.txt");
50 decoder->SetECALMapping("ECAL_map_period_7.txt");
51 decoder->SetECALCalibration("");
52 decoder->SetMwpcMapping(TString("MWPC_map_period") + PeriodSetupExt);
53 decoder->SetLANDMapping("land_mapping_jinr_triplex.txt");
54 decoder->SetLANDPedestal("r0030_land_clock.hh");
55 decoder->SetLANDTCal("r0030_land_tcal.hh");
56 decoder->SetLANDDiffSync("r352_cosmic1.hh");
57 decoder->SetLANDVScint("neuland_sync_2.txt");
58 decoder->InitMaps();
59 if (doConvert)
60 decoder
61 ->ConvertRawToRoot(); // Convert raw data in .data format into adc-,tdc-, ..., sync-digits in .root format
62 decoder->DecodeDataToDigi(); // Decode data into detector-digits using current mappings.
63
64 delete decoder;
65}
bool Bool_t
long Long_t
unsigned int UInt_t
constexpr Bool_t kTRUE
#define R__ADD_INCLUDE_PATH(PATH)
char * Form(const char *fmt,...)
BmnSetup
Define experimental setup.
Definition BmnEnums.h:165
@ kBMNSETUP
Definition BmnEnums.h:166
void SetDetectorSetup(std::map< DetectorId, bool > setup)
void SetBmnSetup(BmnSetup v)