Skip to content
Snippets Groups Projects
Commit 2e995b15 authored by Nikita Belyaev's avatar Nikita Belyaev
Browse files

Adding MT-safe calculation for LumiVsTime histogram

parent 72f3fff5
No related branches found
No related tags found
No related merge requests found
......@@ -138,8 +138,9 @@ private:
int m_min_trt_hits;
int m_minTRThits;
float m_minP;
float m_min_pT;
float m_min_pT;
mutable std::atomic<int> m_maxtimestamp{0};
// Deciphers status HT to GasType Enumerator
inline GasType Straw_Gastype(int stat) const {
......
......@@ -1269,8 +1269,6 @@ for (; p_trk != trackCollection.end(); ++p_trk) {
StatusCode TRTMonitoringRun3ESD_Alg::fillTRTHighThreshold(const xAOD::TrackParticleContainer& trackCollection,
const xAOD::EventInfo& eventInfo, const EventContext& ctx) const {
//----------------------------------------------------------------------------------//
int maxtimestamp = 0.; // ToDo - this should be outside the function,
// but such thing is restricted by the MT-safe paradigm
auto IntLum = Monitored::Scalar<float>("IntLum", 0.0);
auto LBvsLum = Monitored::Scalar<float>("LBvsLum", 0.0);
......@@ -1284,15 +1282,15 @@ StatusCode TRTMonitoringRun3ESD_Alg::fillTRTHighThreshold(const xAOD::TrackParti
lumiBlockNumber = eventInfo.lumiBlock();
timeStamp = eventInfo.timeStamp();
if (timeStamp > maxtimestamp) {
maxtimestamp = timeStamp;
if (timeStamp > m_maxtimestamp) {
m_maxtimestamp = timeStamp;
}
int runNumber;
runNumber = eventInfo.runNumber();
// get Online Luminosity
double intLum = (lbDuration(ctx) * lbAverageLuminosity(ctx));
double timeStampAverage = (maxtimestamp - 0.5*lbDuration(ctx));
double timeStampAverage = (m_maxtimestamp - 0.5*lbDuration(ctx));
IntLum = 0.5;
IntLumWeight = intLum;
fill("SmryHistograms", IntLumWeight, IntLum);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment