Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Esteban Rubio
cbmroot
Commits
83c719bf
Commit
83c719bf
authored
3 years ago
by
Esteban Rubio
Browse files
Options
Downloads
Patches
Plain Diff
Move print_tsa_data.C inside git project
parent
1d916bed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
print_tsa_data.C
+85
-0
85 additions, 0 deletions
print_tsa_data.C
with
85 additions
and
0 deletions
print_tsa_data.C
0 → 100644
+
85
−
0
View file @
83c719bf
/* Copyright (C) 2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pierre-Alain Loizeau [committer] */
/** @file MCBM DATA print CRI debug data from a tsa file for TOF
** @author P.-A. Loizeau
** @date 01.07.2019
** ROOT macro to read tsa files which have been produced with the new data transport
** Convert tsa data to root data while keeping raw message format (loses the microslide meta data!).
** Uses CbmMcbm2018Source as source task.
*/
// --- Specify number of TS to be converted.
// --- -1 means run until the end of the input file.
void
print_tsa_data
(
TString
inFile
=
""
,
Int_t
nrEvents
=
0
)
{
TString
srcDir
=
gSystem
->
Getenv
(
"VMCWORKDIR"
);
// --- Specify number of events to be produced.
// --- -1 means run until the end of the input file.
Int_t
nEvents
=
-
1
;
// --- Specify output file name (this is just an example)
TString
outFile
=
"output.root"
;
// --- Set log output levels
FairLogger
::
GetLogger
();
gLogger
->
SetLogScreenLevel
(
"INFO"
);
//gLogger->SetLogScreenLevel("DEBUG");
gLogger
->
SetLogVerbosityLevel
(
"MEDIUM"
);
// --- Set debug level
gDebug
=
0
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
">>> convert_tsa_gdpb: output file is "
<<
outFile
<<
std
::
endl
;
// ========================================================================
// ========================================================================
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
">>> print_tsa_data: Initialising..."
<<
std
::
endl
;
CbmCriGet4RawPrint
*
raw_print_tof
=
new
CbmCriGet4RawPrint
();
raw_print_tof
->
SetIgnoreOverlapMs
();
// --- Source task
CbmMcbm2018Source
*
source
=
new
CbmMcbm2018Source
();
source
->
SetFileName
(
inFile
);
source
->
AddUnpacker
(
raw_print_tof
,
0x60
,
ECbmModuleId
::
kTof
);
//gDPB A & B & C
source
->
AddUnpacker
(
raw_print_tof
,
0x90
,
ECbmModuleId
::
kTof
);
//gDPB T0 A & B
source
->
AddUnpacker
(
raw_print_tof
,
0xc0
,
ECbmModuleId
::
kTof
);
//CRI TOF DEBUG
// --- Run
FairRunOnline
*
run
=
new
FairRunOnline
(
source
);
run
->
SetOutputFile
(
outFile
);
run
->
Init
();
// --- Start run
TStopwatch
timer
;
timer
.
Start
();
std
::
cout
<<
">>> print_tsa_data: Starting run..."
<<
std
::
endl
;
if
(
0
==
nrEvents
)
{
run
->
Run
(
nEvents
,
0
);
// run until end of input file
}
else
{
run
->
Run
(
0
,
nrEvents
);
// process N Events
}
timer
.
Stop
();
std
::
cout
<<
"Processed "
<<
std
::
dec
<<
source
->
GetTsCount
()
<<
" timeslices"
<<
std
::
endl
;
// --- End-of-run info
Double_t
rtime
=
timer
.
RealTime
();
Double_t
ctime
=
timer
.
CpuTime
();
std
::
cout
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
">>> print_tsa_data: Macro finished successfully."
<<
std
::
endl
;
std
::
cout
<<
">>> print_tsa_data: Output file is "
<<
outFile
<<
std
::
endl
;
std
::
cout
<<
">>> print_tsa_data: Real time "
<<
rtime
<<
" s, CPU time "
<<
ctime
<<
" s"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
/// --- Screen output for automatic tests
std
::
cout
<<
" Test passed"
<<
std
::
endl
;
std
::
cout
<<
" All ok "
<<
std
::
endl
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment