From 4cfdae6ded1948441f484943c38469463c1b1115 Mon Sep 17 00:00:00 2001
From: Florian Uhlig <f.uhlig@gsi.de>
Date: Tue, 15 Nov 2022 13:34:11 +0100
Subject: [PATCH] fix

---
 MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx | 20 ++++++++------------
 MQ/mcbm/CbmDeviceDigiEventSink.cxx       | 13 +++++--------
 2 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx b/MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx
index 9279dfdb59..b7f333053f 100644
--- a/MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx
+++ b/MQ/hitbuilder/CbmDeviceHitBuilderTof.cxx
@@ -56,7 +56,6 @@
 #include "TROOT.h"
 #include "TRandom3.h"
 #include "TVector3.h"
-#include <thread>  // this_thread::sleep_for
 
 #include <boost/archive/binary_iarchive.hpp>
 #include <boost/archive/binary_oarchive.hpp>
@@ -66,6 +65,7 @@
 #include <iomanip>
 #include <stdexcept>
 #include <string>
+#include <thread>  // this_thread::sleep_for
 struct InitTaskError : std::runtime_error {
   using std::runtime_error::runtime_error;
 };
@@ -372,9 +372,7 @@ Bool_t CbmDeviceHitBuilderTof::InitRootOutput()
     fEvtHeader->SetRunId(iRunId);
     rootMgr->Register("EventHeader.", "Event", fEvtHeader, kTRUE);
     auto source = rootMgr->GetSource();
-    if (source) {
-      source->FillEventHeader(fEvtHeader);
-    }
+    if (source) { source->FillEventHeader(fEvtHeader); }
 
     // rootMgr->Register("CbmTofDigi", "Tof raw Digi", fTofCalDigisColl, kTRUE);
     //    fOutRootFile->cd();
@@ -513,9 +511,9 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
 
   if (!InitCalibParameter()) return kFALSE;  // ChangeState(PAUSE); // for debugging
 
-  fDutAddr      = CbmTofAddress::GetUniqueAddress(fDutSm, fDutRpc, 0, 0, fDutId);
-  fSelAddr      = CbmTofAddress::GetUniqueAddress(fSelSm, fSelRpc, 0, 0, fSelId);
-  fSel2Addr     = CbmTofAddress::GetUniqueAddress(fSel2Sm, fSel2Rpc, 0, 0, fSel2Id);
+  fDutAddr  = CbmTofAddress::GetUniqueAddress(fDutSm, fDutRpc, 0, 0, fDutId);
+  fSelAddr  = CbmTofAddress::GetUniqueAddress(fSelSm, fSelRpc, 0, 0, fSelId);
+  fSel2Addr = CbmTofAddress::GetUniqueAddress(fSel2Sm, fSel2Rpc, 0, 0, fSel2Id);
   if (fiBeamRefType > -1) {
     if (fiBeamRefDet > -1) {
       fiBeamRefAddr = CbmTofAddress::GetUniqueAddress(fiBeamRefSm, fiBeamRefDet, 0, 0, fiBeamRefType);
@@ -528,7 +526,7 @@ Bool_t CbmDeviceHitBuilderTof::InitContainers()
   else
     fiBeamRefAddr = -1;
 
-  iIndexDut     = fDigiBdfPar->GetDetInd(fDutAddr);
+  iIndexDut = fDigiBdfPar->GetDetInd(fDutAddr);
   LOG(info) << Form("Use Dut 0x%08x, Sel 0x%08x, Sel2 0x%08x, BRef 0x%08x", fDutAddr, fSelAddr, fSel2Addr,
                     fiBeamRefAddr);
   return initOK;
@@ -699,9 +697,7 @@ bool CbmDeviceHitBuilderTof::HandleData(FairMQParts& parts, int /*index*/)
   if (NULL != fOutRootFile) {  // CbmEvent output to root file
     fEvtHeader->SetEventTime((double) fEventHeader[4]);
     auto source = rootMgr->GetSource();
-    if (source) {
-      source->FillEventHeader(fEvtHeader);
-    }
+    if (source) { source->FillEventHeader(fEvtHeader); }
     //LOG(info) << "Fill WriteOutBuffer with rootMgr at " << rootMgr;
     fOutRootFile->cd();
     rootMgr->Fill();
@@ -1045,7 +1041,7 @@ void CbmDeviceHitBuilderTof::CreateHistograms()
     LOG(info) << "Index map entry " << iDetIndx << ": TSR " << iSmType << iSmId << iRpcId
               << Form(", addr 0x%08x", iUniqueId);
 
-    fhRpcDigiTot[iDetIndx]    = new TH2F(
+    fhRpcDigiTot[iDetIndx] = new TH2F(
       Form("hDigiTot_SmT%01d_sm%03d_rpc%03d", iSmType, iSmId, iRpcId),
       Form("Digi Tot of Rpc #%03d in Sm %03d of type %d; digi 0; digi 1", iRpcId, iSmId, iSmType),
       2 * fDigiBdfPar->GetNbChan(iSmType, iRpcId), 0, 2 * fDigiBdfPar->GetNbChan(iSmType, iRpcId), 256, 0, 256);
diff --git a/MQ/mcbm/CbmDeviceDigiEventSink.cxx b/MQ/mcbm/CbmDeviceDigiEventSink.cxx
index ab09df14e2..9b488628d6 100644
--- a/MQ/mcbm/CbmDeviceDigiEventSink.cxx
+++ b/MQ/mcbm/CbmDeviceDigiEventSink.cxx
@@ -44,12 +44,11 @@
 #include <boost/serialization/utility.hpp>
 
 /// C/C++ headers
-#include <thread>  // this_thread::sleep_for
-
 #include <array>
 #include <iomanip>
 #include <stdexcept>
 #include <string>
+#include <thread>  // this_thread::sleep_for
 struct InitTaskError : std::runtime_error {
   using std::runtime_error::runtime_error;
 };
@@ -124,9 +123,9 @@ try {
 
   /// Prepare root output
   if ("" != fsOutputFileName) {
-    fpRun         = new FairRunOnline();
+    fpRun                   = new FairRunOnline();
     FairRootFileSink* pSink = new FairRootFileSink(fsOutputFileName);
-    fpFairRootMgr = FairRootManager::Instance();
+    fpFairRootMgr           = FairRootManager::Instance();
     fpFairRootMgr->SetSink(pSink);
     if (nullptr == fpFairRootMgr->GetOutFile()) {
       throw InitTaskError("Could not open root file");
@@ -137,7 +136,7 @@ try {
     }
     /// Set global size limit for all TTree in this process/Root instance
     TTree::SetMaxTreeSize(fiTreeFileMaxSize);
-  }    // if( "" != fsOutputFileName )
+  }  // if( "" != fsOutputFileName )
   else {
     throw InitTaskError("Empty output filename!");
   }  // else of if( "" != fsOutputFileName )
@@ -657,9 +656,7 @@ void CbmDeviceDigiEventSink::DumpTreeEntry()
   /// FairRunOnline style
   fpFairRootMgr->StoreWriteoutBufferData(fpFairRootMgr->GetEventTime());
   auto source = fpFairRootMgr->GetSource();
-  if (source) {
-    source->FillEventHeader(fEvtHeader);
-  }
+  if (source) { source->FillEventHeader(fEvtHeader); }
   fpFairRootMgr->Fill();
   fpFairRootMgr->DeleteOldWriteoutBufferData();
   //  fpFairRootMgr->Write();
-- 
GitLab