Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Computing
cbmroot
Commits
e3864c95
Commit
e3864c95
authored
4 years ago
by
Dominik Smith
Committed by
Dominik Smith
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
CbmTaskBuildRawEvents: Implemented timing using TStopwatch.
parent
d687c5f0
No related branches found
No related tags found
1 merge request
!250
Added unpack_tsa_mcbm_with_eb.C to /macro/beamtime/mcbm2020. This extends the...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx
+22
-0
22 additions, 0 deletions
reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx
reco/eventbuilder/digis/CbmTaskBuildRawEvents.h
+6
-0
6 additions, 0 deletions
reco/eventbuilder/digis/CbmTaskBuildRawEvents.h
with
28 additions
and
0 deletions
reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx
+
22
−
0
View file @
e3864c95
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include
<TH1.h>
#include
<TH1.h>
#include
<TH2.h>
#include
<TH2.h>
#include
<THttpServer.h>
#include
<THttpServer.h>
#include
<TStopwatch.h>
#include
<iomanip>
#include
<iomanip>
...
@@ -64,6 +65,11 @@ void CbmTaskBuildRawEvents::AddSeedTimeFillerToList(RawEventBuilderDetector seed
...
@@ -64,6 +65,11 @@ void CbmTaskBuildRawEvents::AddSeedTimeFillerToList(RawEventBuilderDetector seed
InitStatus
CbmTaskBuildRawEvents
::
Init
()
InitStatus
CbmTaskBuildRawEvents
::
Init
()
{
{
if
(
fbGetTimings
)
{
fTimer
=
new
TStopwatch
;
fTimer
->
Start
();
}
/// Get a handle from the IO manager
/// Get a handle from the IO manager
FairRootManager
*
ioman
=
FairRootManager
::
Instance
();
FairRootManager
*
ioman
=
FairRootManager
::
Instance
();
...
@@ -146,6 +152,8 @@ InitStatus CbmTaskBuildRawEvents::Init()
...
@@ -146,6 +152,8 @@ InitStatus CbmTaskBuildRawEvents::Init()
if
(
kTRUE
==
fpAlgo
->
InitAlgo
())
return
kSUCCESS
;
if
(
kTRUE
==
fpAlgo
->
InitAlgo
())
return
kSUCCESS
;
else
else
return
kFATAL
;
return
kFATAL
;
if
(
fTimer
!=
nullptr
)
{
fTimer
->
Stop
();
}
}
}
...
@@ -153,6 +161,7 @@ InitStatus CbmTaskBuildRawEvents::ReInit() { return kSUCCESS; }
...
@@ -153,6 +161,7 @@ InitStatus CbmTaskBuildRawEvents::ReInit() { return kSUCCESS; }
void
CbmTaskBuildRawEvents
::
Exec
(
Option_t
*
/*option*/
)
void
CbmTaskBuildRawEvents
::
Exec
(
Option_t
*
/*option*/
)
{
{
if
(
fTimer
!=
nullptr
)
{
fTimer
->
Start
(
kFALSE
);
}
LOG
(
debug2
)
<<
"CbmTaskBuildRawEvents::Exec => Starting sequence"
;
LOG
(
debug2
)
<<
"CbmTaskBuildRawEvents::Exec => Starting sequence"
;
//Warning: Int_t must be used for the loop counters instead of UInt_t,
//Warning: Int_t must be used for the loop counters instead of UInt_t,
//as the digi manager can return -1, which would be casted to +1
//as the digi manager can return -1, which would be casted to +1
...
@@ -258,6 +267,8 @@ void CbmTaskBuildRawEvents::Exec(Option_t* /*option*/)
...
@@ -258,6 +267,8 @@ void CbmTaskBuildRawEvents::Exec(Option_t* /*option*/)
/// Save the resulting vector of events in TClonesArray
/// Save the resulting vector of events in TClonesArray
FillOutput
();
FillOutput
();
LOG
(
debug2
)
<<
"CbmTaskBuildRawEvents::Exec => Done"
;
LOG
(
debug2
)
<<
"CbmTaskBuildRawEvents::Exec => Done"
;
if
(
fTimer
!=
nullptr
)
{
fTimer
->
Stop
();
}
}
}
void
CbmTaskBuildRawEvents
::
FillSeedTimesFromDetList
()
void
CbmTaskBuildRawEvents
::
FillSeedTimesFromDetList
()
...
@@ -356,11 +367,22 @@ UInt_t CbmTaskBuildRawEvents::GetNofDigis(ECbmModuleId _system)
...
@@ -356,11 +367,22 @@ UInt_t CbmTaskBuildRawEvents::GetNofDigis(ECbmModuleId _system)
return
0
;
return
0
;
}
}
void
CbmTaskBuildRawEvents
::
PrintTimings
()
{
if
(
fTimer
==
nullptr
)
{
LOG
(
fatal
)
<<
"Trying to print timings but timer not set"
;
}
else
{
Double_t
rtime
=
fTimer
->
RealTime
();
Double_t
ctime
=
fTimer
->
CpuTime
();
LOG
(
info
)
<<
"CbmTaskBuildRawEvents: Real time "
<<
rtime
<<
" s, CPU time "
<<
ctime
<<
" s"
;
}
}
void
CbmTaskBuildRawEvents
::
Finish
()
void
CbmTaskBuildRawEvents
::
Finish
()
{
{
/// Call Algo finish method
/// Call Algo finish method
fpAlgo
->
Finish
();
fpAlgo
->
Finish
();
if
(
fbFillHistos
)
{
SaveHistos
();
}
if
(
fbFillHistos
)
{
SaveHistos
();
}
if
(
fbGetTimings
)
{
PrintTimings
();
}
}
}
void
CbmTaskBuildRawEvents
::
FillOutput
()
void
CbmTaskBuildRawEvents
::
FillOutput
()
...
...
This diff is collapsed.
Click to expand it.
reco/eventbuilder/digis/CbmTaskBuildRawEvents.h
+
6
−
0
View file @
e3864c95
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
class
CbmDigiManager
;
class
CbmDigiManager
;
class
RawEventBuilderDetector
;
class
RawEventBuilderDetector
;
class
TClonesArray
;
class
TClonesArray
;
class
TStopwatch
;
enum
class
EOverlapModeRaw
;
enum
class
EOverlapModeRaw
;
...
@@ -118,8 +119,10 @@ public:
...
@@ -118,8 +119,10 @@ public:
void
SetTimings
(
Bool_t
bFlagIn
=
kTRUE
)
void
SetTimings
(
Bool_t
bFlagIn
=
kTRUE
)
{
{
if
(
nullptr
!=
fpAlgo
)
fpAlgo
->
SetTimings
(
bFlagIn
);
if
(
nullptr
!=
fpAlgo
)
fpAlgo
->
SetTimings
(
bFlagIn
);
fbGetTimings
=
bFlagIn
;
}
}
void
PrintTimings
();
void
SetSeedTimeFiller
(
RawEventBuilderDetector
seedDet
);
void
SetSeedTimeFiller
(
RawEventBuilderDetector
seedDet
);
void
AddSeedTimeFillerToList
(
RawEventBuilderDetector
seedDet
);
void
AddSeedTimeFillerToList
(
RawEventBuilderDetector
seedDet
);
void
DumpSeedTimesFromDetList
();
void
DumpSeedTimesFromDetList
();
...
@@ -150,12 +153,15 @@ private:
...
@@ -150,12 +153,15 @@ private:
void
FillSeedTimesFromDetList
();
void
FillSeedTimesFromDetList
();
TStopwatch
*
fTimer
=
nullptr
;
//! is create when fbGetTimings is set before init
CbmAlgoBuildRawEvents
*
fpAlgo
=
nullptr
;
CbmAlgoBuildRawEvents
*
fpAlgo
=
nullptr
;
TClonesArray
*
fEvents
=
nullptr
;
//! output container of CbmEvents
TClonesArray
*
fEvents
=
nullptr
;
//! output container of CbmEvents
Bool_t
fbFillHistos
{
kTRUE
};
//! Switch ON/OFF filling of histograms
Bool_t
fbFillHistos
{
kTRUE
};
//! Switch ON/OFF filling of histograms
Bool_t
fbWriteHistosToFairSink
{
kTRUE
};
//! Write histos to FairRootManager instead of separate file
Bool_t
fbWriteHistosToFairSink
{
kTRUE
};
//! Write histos to FairRootManager instead of separate file
Bool_t
fbGetTimings
=
kFALSE
;
//! Measure CPU time using stopwatch
/** Name of the histogram output file **/
/** Name of the histogram output file **/
TString
fsOutFileName
{
"data/HistosEvtWin.root"
};
TString
fsOutFileName
{
"data/HistosEvtWin.root"
};
...
...
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