diff --git a/AUTHORS b/AUTHORS old mode 100755 new mode 100644 diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/CONTRIBUTORS b/CONTRIBUTORS old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/at/CMakeLists.txt b/at/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/at/SofAtLinkDef.h b/at/SofAtLinkDef.h old mode 100755 new mode 100644 diff --git a/sci/CMakeLists.txt b/sci/CMakeLists.txt old mode 100755 new mode 100644 index 5cd282ad..fc3594c0 --- a/sci/CMakeLists.txt +++ b/sci/CMakeLists.txt @@ -1,9 +1,9 @@ ############################################################################## -# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH # -# Copyright (C) 2019 University of Santiago de Compostela # -# Copyright (C) 2019 CEA-DAM-DIF, Université Paris-Saclay # -# Copyright (C) 2023 University of Coruña # -# Copyright (C) 2019-2025 Members of R3B Collaboration # +# Copyright (C) 2018 GSI Helmholtzzentrum für Schwerionenforschung GmbH # +# Copyright (C) 2018 University of Santiago de Compostela # +# Copyright (C) 2018-2026 CEA-DAM-DIF, Université Paris-Saclay # +# Copyright (C) 2023-2026 University of Coruña # +# Copyright (C) 2018-2026 Members of R3B Collaboration # # # # This software is distributed under the terms of the # # GNU General Public Licence (GPL) version 3, # @@ -15,34 +15,34 @@ ############################################################################## set(SRCS - R3BSofSci.cxx - R3BSofSciContFact.cxx - R3BSofSciRawPosPar.cxx - R3BSofSciMapped2TcalPar.cxx - R3BSofSciTcal2RawPosPar.cxx - R3BSofSciTcal2RawTofPar.cxx - R3BSofSciCalPosPar.cxx - R3BSofSciCalTofPar.cxx - R3BSofSciSingleTcal2CalPosCaveCPar.cxx - R3BSofSciMapped2Tcal.cxx - R3BSofSciTcal2SingleTcal.cxx - R3BSofSciSingleTcal2Cal.cxx - R3BSofSciSingleTcal2Hit.cxx) + ./sim/R3BSofSci.cxx + ./pars/R3BSofSciContFact.cxx + ./pars/R3BSofSciRawPosPar.cxx + ./pars/R3BSofSciMapped2TcalPar.cxx + ./pars/R3BSofSciTcal2RawPosPar.cxx + ./pars/R3BSofSciTcal2RawTofPar.cxx + ./pars/R3BSofSciCalPosPar.cxx + ./pars/R3BSofSciCalTofPar.cxx + ./pars/R3BSofSciSingleTcal2CalPosCaveCPar.cxx + ./calibration/R3BSofSciMapped2Tcal.cxx + ./calibration/R3BSofSciTcal2SingleTcal.cxx + ./calibration/R3BSofSciSingleTcal2Cal.cxx + ./calibration/R3BSofSciSingleTcal2Hit.cxx) set(HEADERS - R3BSofSci.h - R3BSofSciContFact.h - R3BSofSciRawPosPar.h - R3BSofSciMapped2TcalPar.h - R3BSofSciTcal2RawPosPar.h - R3BSofSciTcal2RawTofPar.h - R3BSofSciCalPosPar.h - R3BSofSciCalTofPar.h - R3BSofSciSingleTcal2CalPosCaveCPar.h - R3BSofSciMapped2Tcal.h - R3BSofSciTcal2SingleTcal.h - R3BSofSciSingleTcal2Cal.h - R3BSofSciSingleTcal2Hit.h) + ./sim/R3BSofSci.h + ./pars/R3BSofSciContFact.h + ./pars/R3BSofSciRawPosPar.h + ./pars/R3BSofSciMapped2TcalPar.h + ./pars/R3BSofSciTcal2RawPosPar.h + ./pars/R3BSofSciTcal2RawTofPar.h + ./pars/R3BSofSciCalPosPar.h + ./pars/R3BSofSciCalTofPar.h + ./pars/R3BSofSciSingleTcal2CalPosCaveCPar.h + ./calibration/R3BSofSciMapped2Tcal.h + ./calibration/R3BSofSciTcal2SingleTcal.h + ./calibration/R3BSofSciSingleTcal2Cal.h + ./calibration/R3BSofSciSingleTcal2Hit.h) add_library_with_dictionary( LIBNAME @@ -55,6 +55,9 @@ add_library_with_dictionary( ${SRCS} INCLUDEDIRS ${CMAKE_CURRENT_SOURCE_DIR} + sim + pars + calibration DEPENDENCIES R3BSofTcal R3BSofData diff --git a/sci/SofSciLinkDef.h b/sci/SofSciLinkDef.h old mode 100755 new mode 100644 index b6acd3e5..129b0f2c --- a/sci/SofSciLinkDef.h +++ b/sci/SofSciLinkDef.h @@ -1,10 +1,10 @@ // clang-format off /****************************************************************************** - * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2019 University of Santiago de Compostela * - * Copyright (C) 2019 CEA-DAM-DIF, Université Paris-Saclay * - * Copyright (C) 2023 University of Coruña * - * Copyright (C) 2019-2025 Members of R3B Collaboration * + * Copyright (C) 2018 GSI Helmholtzzentrum für Schwerionenforschung GmbH * + * Copyright (C) 2018 University of Santiago de Compostela * + * Copyright (C) 2018-2026 CEA-DAM-DIF, Université Paris-Saclay * + * Copyright (C) 2023-2026 University of Coruña * + * Copyright (C) 2018-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * diff --git a/sci/R3BSofSciMapped2Tcal.cxx b/sci/calibration/R3BSofSciMapped2Tcal.cxx similarity index 100% rename from sci/R3BSofSciMapped2Tcal.cxx rename to sci/calibration/R3BSofSciMapped2Tcal.cxx diff --git a/sci/R3BSofSciMapped2Tcal.h b/sci/calibration/R3BSofSciMapped2Tcal.h similarity index 100% rename from sci/R3BSofSciMapped2Tcal.h rename to sci/calibration/R3BSofSciMapped2Tcal.h diff --git a/sci/R3BSofSciSingleTcal2Cal.cxx b/sci/calibration/R3BSofSciSingleTcal2Cal.cxx similarity index 100% rename from sci/R3BSofSciSingleTcal2Cal.cxx rename to sci/calibration/R3BSofSciSingleTcal2Cal.cxx diff --git a/sci/R3BSofSciSingleTcal2Cal.h b/sci/calibration/R3BSofSciSingleTcal2Cal.h similarity index 100% rename from sci/R3BSofSciSingleTcal2Cal.h rename to sci/calibration/R3BSofSciSingleTcal2Cal.h diff --git a/sci/R3BSofSciSingleTcal2Hit.cxx b/sci/calibration/R3BSofSciSingleTcal2Hit.cxx similarity index 100% rename from sci/R3BSofSciSingleTcal2Hit.cxx rename to sci/calibration/R3BSofSciSingleTcal2Hit.cxx diff --git a/sci/R3BSofSciSingleTcal2Hit.h b/sci/calibration/R3BSofSciSingleTcal2Hit.h similarity index 100% rename from sci/R3BSofSciSingleTcal2Hit.h rename to sci/calibration/R3BSofSciSingleTcal2Hit.h diff --git a/sci/R3BSofSciTcal2SingleTcal.cxx b/sci/calibration/R3BSofSciTcal2SingleTcal.cxx similarity index 100% rename from sci/R3BSofSciTcal2SingleTcal.cxx rename to sci/calibration/R3BSofSciTcal2SingleTcal.cxx diff --git a/sci/R3BSofSciTcal2SingleTcal.h b/sci/calibration/R3BSofSciTcal2SingleTcal.h similarity index 100% rename from sci/R3BSofSciTcal2SingleTcal.h rename to sci/calibration/R3BSofSciTcal2SingleTcal.h diff --git a/sci/R3BSofSciCalPosPar.cxx b/sci/pars/R3BSofSciCalPosPar.cxx similarity index 100% rename from sci/R3BSofSciCalPosPar.cxx rename to sci/pars/R3BSofSciCalPosPar.cxx diff --git a/sci/R3BSofSciCalPosPar.h b/sci/pars/R3BSofSciCalPosPar.h similarity index 100% rename from sci/R3BSofSciCalPosPar.h rename to sci/pars/R3BSofSciCalPosPar.h diff --git a/sci/R3BSofSciCalTofPar.cxx b/sci/pars/R3BSofSciCalTofPar.cxx similarity index 100% rename from sci/R3BSofSciCalTofPar.cxx rename to sci/pars/R3BSofSciCalTofPar.cxx diff --git a/sci/R3BSofSciCalTofPar.h b/sci/pars/R3BSofSciCalTofPar.h similarity index 100% rename from sci/R3BSofSciCalTofPar.h rename to sci/pars/R3BSofSciCalTofPar.h diff --git a/sci/R3BSofSciContFact.cxx b/sci/pars/R3BSofSciContFact.cxx similarity index 100% rename from sci/R3BSofSciContFact.cxx rename to sci/pars/R3BSofSciContFact.cxx diff --git a/sci/R3BSofSciContFact.h b/sci/pars/R3BSofSciContFact.h similarity index 100% rename from sci/R3BSofSciContFact.h rename to sci/pars/R3BSofSciContFact.h diff --git a/sci/R3BSofSciMapped2TcalPar.cxx b/sci/pars/R3BSofSciMapped2TcalPar.cxx similarity index 100% rename from sci/R3BSofSciMapped2TcalPar.cxx rename to sci/pars/R3BSofSciMapped2TcalPar.cxx diff --git a/sci/R3BSofSciMapped2TcalPar.h b/sci/pars/R3BSofSciMapped2TcalPar.h similarity index 100% rename from sci/R3BSofSciMapped2TcalPar.h rename to sci/pars/R3BSofSciMapped2TcalPar.h diff --git a/sci/R3BSofSciRawPosPar.cxx b/sci/pars/R3BSofSciRawPosPar.cxx similarity index 100% rename from sci/R3BSofSciRawPosPar.cxx rename to sci/pars/R3BSofSciRawPosPar.cxx diff --git a/sci/R3BSofSciRawPosPar.h b/sci/pars/R3BSofSciRawPosPar.h similarity index 100% rename from sci/R3BSofSciRawPosPar.h rename to sci/pars/R3BSofSciRawPosPar.h diff --git a/sci/R3BSofSciSingleTcal2CalPosCaveCPar.cxx b/sci/pars/R3BSofSciSingleTcal2CalPosCaveCPar.cxx similarity index 100% rename from sci/R3BSofSciSingleTcal2CalPosCaveCPar.cxx rename to sci/pars/R3BSofSciSingleTcal2CalPosCaveCPar.cxx diff --git a/sci/R3BSofSciSingleTcal2CalPosCaveCPar.h b/sci/pars/R3BSofSciSingleTcal2CalPosCaveCPar.h similarity index 100% rename from sci/R3BSofSciSingleTcal2CalPosCaveCPar.h rename to sci/pars/R3BSofSciSingleTcal2CalPosCaveCPar.h diff --git a/sci/R3BSofSciTcal2RawPosPar.cxx b/sci/pars/R3BSofSciTcal2RawPosPar.cxx similarity index 100% rename from sci/R3BSofSciTcal2RawPosPar.cxx rename to sci/pars/R3BSofSciTcal2RawPosPar.cxx diff --git a/sci/R3BSofSciTcal2RawPosPar.h b/sci/pars/R3BSofSciTcal2RawPosPar.h similarity index 100% rename from sci/R3BSofSciTcal2RawPosPar.h rename to sci/pars/R3BSofSciTcal2RawPosPar.h diff --git a/sci/R3BSofSciTcal2RawTofPar.cxx b/sci/pars/R3BSofSciTcal2RawTofPar.cxx similarity index 100% rename from sci/R3BSofSciTcal2RawTofPar.cxx rename to sci/pars/R3BSofSciTcal2RawTofPar.cxx diff --git a/sci/R3BSofSciTcal2RawTofPar.h b/sci/pars/R3BSofSciTcal2RawTofPar.h similarity index 100% rename from sci/R3BSofSciTcal2RawTofPar.h rename to sci/pars/R3BSofSciTcal2RawTofPar.h diff --git a/sci/R3BSofSci.cxx b/sci/sim/R3BSofSci.cxx similarity index 100% rename from sci/R3BSofSci.cxx rename to sci/sim/R3BSofSci.cxx diff --git a/sci/R3BSofSci.h b/sci/sim/R3BSofSci.h similarity index 100% rename from sci/R3BSofSci.h rename to sci/sim/R3BSofSci.h diff --git a/sofana/CMakeLists.txt b/sofana/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/sofana/R3BSofFrsAnaPar.h b/sofana/R3BSofFrsAnaPar.h old mode 100755 new mode 100644 diff --git a/sofana/SofAnaLinkDef.h b/sofana/SofAnaLinkDef.h old mode 100755 new mode 100644 index cf82daa5..22ae40d3 --- a/sofana/SofAnaLinkDef.h +++ b/sofana/SofAnaLinkDef.h @@ -2,9 +2,9 @@ /****************************************************************************** * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH * * Copyright (C) 2019 University of Santiago de Compostela * - * Copyright (C) 2019 CEA-DAM-DIF, Université Paris-Saclay * - * Copyright (C) 2023 University of Coruña * - * Copyright (C) 2019-2025 Members of R3B Collaboration * + * Copyright (C) 2019-2026 CEA-DAM-DIF, Université Paris-Saclay * + * Copyright (C) 2023-2026 University of Coruña * + * Copyright (C) 2019-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * diff --git a/sofonline/CMakeLists.txt b/sofonline/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/sofonline/R3BAmsCorrelationOnlineSpectra.h b/sofonline/R3BAmsCorrelationOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofAtOnlineSpectra.h b/sofonline/R3BSofAtOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofFrsOnlineSpectra.h b/sofonline/R3BSofFrsOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofMwpcvsMusicOnlineSpectra.h b/sofonline/R3BSofMwpcvsMusicOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofSciVsMwpc0OnlineSpectra.h b/sofonline/R3BSofSciVsMwpc0OnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofStatusOnlineSpectra.h b/sofonline/R3BSofStatusOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofTofWOnlineSpectra.h b/sofonline/R3BSofTofWOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofTrackingFissionOnlineSpectra.h b/sofonline/R3BSofTrackingFissionOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofTrackingOnlineSpectra.h b/sofonline/R3BSofTrackingOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofTrimVsTofwOnlineSpectra.h b/sofonline/R3BSofTrimVsTofwOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofTwimvsMusicOnlineSpectra.h b/sofonline/R3BSofTwimvsMusicOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/R3BSofTwimvsTrimOnlineSpectra.h b/sofonline/R3BSofTwimvsTrimOnlineSpectra.h old mode 100755 new mode 100644 diff --git a/sofonline/SofOnlineLinkDef.h b/sofonline/SofOnlineLinkDef.h old mode 100755 new mode 100644 diff --git a/tcal/CMakeLists.txt b/tcal/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/tcal/SofTcalLinkDef.h b/tcal/SofTcalLinkDef.h old mode 100755 new mode 100644 diff --git a/tofwall/digi/R3BSofTofWDigitizer.cxx b/tofwall/digi/R3BSofTofWDigitizer.cxx index 024cc3e4..db0fd170 100644 --- a/tofwall/digi/R3BSofTofWDigitizer.cxx +++ b/tofwall/digi/R3BSofTofWDigitizer.cxx @@ -86,11 +86,11 @@ InitStatus R3BSofTofWDigitizer::Init() R3BLOG(info, ""); // Get input array - FairRootManager* ioman = FairRootManager::Instance(); + auto* ioman = FairRootManager::Instance(); R3BLOG_IF(fatal, !ioman, "FairRootManager not found."); - fMCTrack = (TClonesArray*)ioman->GetObject("MCTrack"); - fTofPoints = (TClonesArray*)ioman->GetObject("SofTofWPoint"); + fMCTrack = dynamic_cast(ioman->GetObject("MCTrack")); + fTofPoints = dynamic_cast(ioman->GetObject("SofTofWPoint")); // Register output array fTofHits fTofHits = new TClonesArray("R3BSofTofWHitData"); @@ -125,12 +125,12 @@ void R3BSofTofWDigitizer::Exec(Option_t*) if (PID > 1000080160) // Z=8 and A=16 { - Double_t fX_in = pointData->GetXIn(); - Double_t fY_in = pointData->GetYIn(); - Double_t fZ_in = pointData->GetZIn(); - Double_t fX_out = pointData->GetXOut(); - Double_t fY_out = pointData->GetYOut(); - Double_t fZ_out = pointData->GetZOut(); + auto fX_in = pointData->GetXIn(); + auto fY_in = pointData->GetYIn(); + auto fZ_in = pointData->GetZIn(); + auto fX_out = pointData->GetXOut(); + auto fY_out = pointData->GetYOut(); + auto fZ_out = pointData->GetZOut(); paddle = pointData->GetDetCopyID() + 1; // std::cout<TrackMomentum(fMomIn); } - Double_t M_in = TVirtualMC::GetMC()->TrackMass() * 1000.; + auto M_in = TVirtualMC::GetMC()->TrackMass() * 1000.; // Charge and mass are now obtained from PDG Code - Double_t fZ_in = int(TVirtualMC::GetMC()->TrackPid() / 10000) - 100000.; - Double_t fA_in = 0.1 * (TVirtualMC::GetMC()->TrackPid() - (100000 + fZ_in) * 10000.); + auto fZ_in = int(TVirtualMC::GetMC()->TrackPid() / 10000) - 100000.; + auto fA_in = 0.1 * (TVirtualMC::GetMC()->TrackPid() - (100000 + fZ_in) * 10000.); fELoss += TVirtualMC::GetMC()->Edep(); if (fELoss > 0) @@ -138,7 +137,7 @@ void R3BSofTofW::EndOfEvent() // ----- Public method Register ------------------------------------------- void R3BSofTofW::Register() { - FairRootManager::Instance()->Register("SofTofWPoint", GetName(), fSofTofWallCollection, kTRUE); + FairRootManager::Instance()->Register("SofTofWPoint", GetName(), fSofTofWallCollection, true); } // ----- Public method GetCollection -------------------------------------- @@ -158,7 +157,7 @@ TClonesArray* R3BSofTofW::GetCollection(Int_t iColl) const void R3BSofTofW::Print(Option_t*) const { auto nHits = fSofTofWallCollection->GetEntriesFast(); - R3BLOG(info, nHits << " points registered in this event"); + LOG(info) << "R3BSofTofW: " << nHits << " points registered in this event"; } // ----- Public method Reset ---------------------------------------------- diff --git a/tofwall/sim/R3BSofTofW.h b/tofwall/sim/R3BSofTofW.h index fb160491..b246391d 100644 --- a/tofwall/sim/R3BSofTofW.h +++ b/tofwall/sim/R3BSofTofW.h @@ -51,7 +51,7 @@ class R3BSofTofW : public R3BDetector ** to the collection. *@param vol Pointer to the active volume **/ - Bool_t ProcessHits(FairVolume* vol = 0) override; + bool ProcessHits(FairVolume* vol = 0) override; /** Virtual method EndOfEvent ** @@ -67,7 +67,7 @@ class R3BSofTofW : public R3BDetector void Register() override; /** Gets the produced collections */ - TClonesArray* GetCollection(Int_t iColl) const override; + TClonesArray* GetCollection(int iColl) const override; /** Virtual method Print ** @@ -85,18 +85,17 @@ class R3BSofTofW : public R3BDetector private: /** Track information to be stored until the track leaves the active volume. **/ - Int_t fTrackID; //! track index - Int_t fTrackPID; //! particle identification - Int_t fVolumeID; //! volume id - Int_t fDetCopyID; //! Det volume id - Double_t fZ; //! atomic number fragment - Double_t fA; //! mass number fragment + int fTrackID; //! track index + int fTrackPID; //! particle identification + int fVolumeID; //! volume id + int fDetCopyID; //! Det volume id + double fZ; //! atomic number fragment + double fA; //! mass number fragment TLorentzVector fPosIn, fPosOut; //! position TLorentzVector fMomIn, fMomOut; //! momentum - Double32_t fTime; //! time - Double32_t fLength; //! length - Double32_t fELoss; //! energy loss - Int_t fPosIndex; //! + double fTime; //! time + double fLength; //! length + double fELoss; //! energy loss TClonesArray* fSofTofWallCollection; // The point collection @@ -104,9 +103,9 @@ class R3BSofTofW : public R3BDetector ** ** Adds a SofTofWallPoint to the HitCollection **/ - R3BSofTofWPoint* AddPoint(Int_t trackID, - Int_t detID, - Int_t volid, + R3BSofTofWPoint* AddPoint(int trackID, + int detID, + int volid, Double_t Z, Double_t A, TVector3 posIn, @@ -138,5 +137,4 @@ inline void R3BSofTofW::ResetParameters() fMomIn.SetXYZM(0.0, 0.0, 0.0, 0.0); fMomOut.SetXYZM(0.0, 0.0, 0.0, 0.0); fTime = fLength = fELoss = fZ = fA = 0; - fPosIndex = 0; }; diff --git a/trim/CMakeLists.txt b/trim/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/trim/README.md b/trim/README.md old mode 100755 new mode 100644 diff --git a/trim/SofTrimLinkDef.h b/trim/SofTrimLinkDef.h old mode 100755 new mode 100644 diff --git a/trim/calibration/R3BSofTrimCal2Hit.cxx b/trim/calibration/R3BSofTrimCal2Hit.cxx index 7ca73663..738e07b4 100644 --- a/trim/calibration/R3BSofTrimCal2Hit.cxx +++ b/trim/calibration/R3BSofTrimCal2Hit.cxx @@ -71,16 +71,16 @@ R3BSofTrimCal2Hit::~R3BSofTrimCal2Hit() void R3BSofTrimCal2Hit::SetParContainers() { - FairRuntimeDb* rtdb = FairRuntimeDb::instance(); + auto* rtdb = FairRuntimeDb::instance(); if (!rtdb) { - LOG(error) << "FairRuntimeDb not opened!"; + LOG(fatal) << "FairRuntimeDb not opened!"; } - fTrimHitPar = (R3BSofTrimHitPar*)rtdb->getContainer("trimHitPar"); + fTrimHitPar = dynamic_cast(rtdb->getContainer("trimHitPar")); if (!fTrimHitPar) { - LOG(error) << "R3BSofTrimCal2HitPar::Init() Couldn't get handle on trimHitPar container"; + LOG(fatal) << "R3BSofTrimCal2HitPar::Init() Couldn't get handle on trimHitPar container"; return; } else @@ -105,19 +105,17 @@ InitStatus R3BSofTrimCal2Hit::Init() { LOG(info) << "R3BSofTrimCal2Hit::Init()"; - FairRootManager* rootManager = FairRootManager::Instance(); + auto* rootManager = FairRootManager::Instance(); if (!rootManager) { return kFATAL; } - header = (R3BEventHeader*)rootManager->GetObject("EventHeader."); - if (!header) - header = (R3BEventHeader*)rootManager->GetObject("R3BEventHeader"); + header = dynamic_cast(rootManager->GetObject("EventHeader.")); // --- ------------------------------- --- // // --- INPUT CAL DATA FOR TRIPLE-MUSIC --- // // --- ------------------------------- --- // - fTrimCalData = (TClonesArray*)rootManager->GetObject("TrimCalData"); + fTrimCalData = dynamic_cast(rootManager->GetObject("TrimCalData")); if (!fTrimCalData) { LOG(warn) << "R3BSofTrimCal2Hit::Init() TrimCalData not found"; @@ -126,7 +124,7 @@ InitStatus R3BSofTrimCal2Hit::Init() // --- ---------------------- --- // // --- INPUT CAL DATA FOR SCI --- // // --- ---------------------- --- // - fSciCalData = (TClonesArray*)rootManager->GetObject("SofSciCalData"); + fSciCalData = dynamic_cast(rootManager->GetObject("SofSciCalData")); if (!fSciCalData) { LOG(warn) << "R3BSofTrimCal2Hit::Init() SofSciCalData not found"; @@ -149,7 +147,7 @@ InitStatus R3BSofTrimCal2Hit::ReInit() } // ----- Public method Execution -------------------------------------------- -void R3BSofTrimCal2Hit::Exec(Option_t* option) +void R3BSofTrimCal2Hit::Exec(Option_t*) { int expid = fExpId != 0 ? fExpId : header->GetExpId(); if (expid == 455 && fCoulex) @@ -166,12 +164,6 @@ void R3BSofTrimCal2Hit::S455_Coulex() // Reset entries in output arrays, local arrays Reset(); - // Get the parameters - if (!fTrimHitPar) - { - LOG(error) << "R3BSofTrimCal2Hit::Exec() TrimHitPar Container not found"; - } - // Local variables at Cal Level Int_t iSec, iAnode; UInt_t mult[fNumSections * fNumAnodes]; @@ -188,7 +180,7 @@ void R3BSofTrimCal2Hit::S455_Coulex() Float_t eal[fNumSections * nAligned]; Float_t dtal[fNumSections * nAligned]; Float_t sumRaw, sumBeta, sumDT, sumTheta, zval, dtSection, Ddt; - Double_t correction; + double correction = 0.; // Initialization of the local variables for (Int_t s = 0; s < fNumSections; s++) @@ -209,14 +201,14 @@ void R3BSofTrimCal2Hit::S455_Coulex() // Get the number of entries of the SciCalData TClonesArray and extract the beam velocity if (fSciCalData) { - Int_t nHitsCalSci = fSciCalData->GetEntries(); + int nHitsCalSci = fSciCalData->GetEntriesFast(); if (!nHitsCalSci) { return; } - for (Int_t entry = 0; entry < nHitsCalSci; entry++) + for (auto entry = 0; entry < nHitsCalSci; entry++) { - R3BSofSciCalData* iSciCalData = (R3BSofSciCalData*)fSciCalData->At(entry); + auto* iSciCalData = dynamic_cast(fSciCalData->At(entry)); if (iSciCalData->GetDetector() == fIdCaveC) { betaFromS2 = iSciCalData->GetBeta_S2(); @@ -227,14 +219,14 @@ void R3BSofTrimCal2Hit::S455_Coulex() // Get the number of entries of the TrimCalData TClonesArray and loop over it if (fTrimCalData) { - Int_t nHitsCalTrim = fTrimCalData->GetEntries(); + auto nHitsCalTrim = fTrimCalData->GetEntriesFast(); if (!nHitsCalTrim) { return; } - for (Int_t entry = 0; entry < nHitsCalTrim; entry++) + for (auto entry = 0; entry < nHitsCalTrim; entry++) { - R3BSofTrimCalData* iCalData = (R3BSofTrimCalData*)fTrimCalData->At(entry); + auto* iCalData = dynamic_cast(fTrimCalData->At(entry)); iSec = iCalData->GetSecID() - 1; iAnode = iCalData->GetAnodeID() - 1; mult[iAnode + iSec * fNumAnodes]++; @@ -358,12 +350,6 @@ void R3BSofTrimCal2Hit::S455_P2p() // Reset entries in output arrays, local arrays Reset(); - // Get the parameters - if (!fTrimHitPar) - { - LOG(error) << "R3BSofTrimCal2Hit::Exec() TrimHitPar Container not found"; - } - // Local variables at Cal Level Int_t iSec, iAnode; UInt_t mult[fNumSections * fNumAnodes]; @@ -380,7 +366,7 @@ void R3BSofTrimCal2Hit::S455_P2p() Float_t eal[fNumSections * nAligned]; Float_t dtal[fNumSections * nAligned]; Float_t sumRaw, sumDT, sumTheta, zval, dtSection, Ddt; - Double_t correction; + double correction = 0.; // Initialization of the local variables for (Int_t s = 0; s < fNumSections; s++) @@ -401,14 +387,14 @@ void R3BSofTrimCal2Hit::S455_P2p() // Get the number of entries of the TrimCalData TClonesArray and loop over it if (fTrimCalData) { - Int_t nHitsCalTrim = fTrimCalData->GetEntries(); + auto nHitsCalTrim = fTrimCalData->GetEntriesFast(); if (!nHitsCalTrim) { return; } - for (Int_t entry = 0; entry < nHitsCalTrim; entry++) + for (auto entry = 0; entry < nHitsCalTrim; entry++) { - R3BSofTrimCalData* iCalData = (R3BSofTrimCalData*)fTrimCalData->At(entry); + auto* iCalData = dynamic_cast(fTrimCalData->At(entry)); iSec = iCalData->GetSecID() - 1; iAnode = iCalData->GetAnodeID() - 1; mult[iAnode + iSec * fNumAnodes]++; @@ -497,9 +483,6 @@ void R3BSofTrimCal2Hit::S455_P2p() return; } -// ----- Protected method Finish -------------------------------------------- -void R3BSofTrimCal2Hit::Finish() {} - // ----- Public method Reset ------------------------------------------------ void R3BSofTrimCal2Hit::Reset() { @@ -520,7 +503,7 @@ R3BSofTrimHitData* R3BSofTrimCal2Hit::AddHitData(Int_t secID, Float_t Z) { TClonesArray& clref = *fTrimHitData; - Int_t size = clref.GetEntriesFast(); + auto size = clref.GetEntriesFast(); return new (clref[size]) R3BSofTrimHitData(secID, e1, e2, e3, Eraw, Ebeta, Edt, Etheta, Z); } diff --git a/trim/calibration/R3BSofTrimCal2Hit.h b/trim/calibration/R3BSofTrimCal2Hit.h index cf61c2aa..5ddb1156 100644 --- a/trim/calibration/R3BSofTrimCal2Hit.h +++ b/trim/calibration/R3BSofTrimCal2Hit.h @@ -2,8 +2,7 @@ // ----- R3BSofTrimCal2Hit ----- // -------------------------------------------------------------- -#ifndef R3BSofTrimCal2Hit_H -#define R3BSofTrimCal2Hit_H +#pragma once #include "FairTask.h" #include "R3BEventHeader.h" @@ -19,7 +18,6 @@ class R3BSofTrimHitPar; class R3BSofTrimCal2Hit : public FairTask { - public: /** Default constructor **/ R3BSofTrimCal2Hit(); @@ -45,9 +43,6 @@ class R3BSofTrimCal2Hit : public FairTask /** Virtual method ReInit **/ virtual InitStatus ReInit(); - /** Virtual method Finish **/ - virtual void Finish(); - /** Method to set up the experiment ID **/ void SetExpId(Int_t exp) { fExpId = exp; } void SetCoulex(Bool_t opt) { fCoulex = opt; } @@ -91,5 +86,3 @@ class R3BSofTrimCal2Hit : public FairTask //--- Class definition --- // ClassDef(R3BSofTrimCal2Hit, 1) }; - -#endif diff --git a/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.cxx b/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.cxx index 7ce2737e..3ad2a348 100644 --- a/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.cxx +++ b/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.cxx @@ -21,30 +21,16 @@ // R3BSofTrimCalculateDriftTimeOffsetPar: Default Constructor -------------------------- R3BSofTrimCalculateDriftTimeOffsetPar::R3BSofTrimCalculateDriftTimeOffsetPar() - : FairTask("R3BSofTrimCalculateDriftTimeOffsetPar", 1) - , fNumSections(3) - , fNumAnodes(6) - , fMinStatistics(0) - , fTrimCalData(NULL) - , fMwpc0HitData(NULL) - , fMwpc1HitData(NULL) - , fCalPar(NULL) - , fMwpc0GeoPar(NULL) - , fMwpc1GeoPar(NULL) - , fTrimGeoPar(NULL) - , fWidthAnode(25) // mm - , fDistInterSection(50) // mm 2*edge anodes of 20 mm + 1*10 mm gap - , fDriftVelocity(60) // mm/micros, distance from anode to FG: 80 mm with a difference of V = 2700V - , fOutputFile(NULL) + : R3BSofTrimCalculateDriftTimeOffsetPar("R3BSofTrimCalculateDriftTimeOffsetPar", 1) { } // R3BSofTrimCalculateDriftTimeOffsetPar: Standard Constructor -------------------------- R3BSofTrimCalculateDriftTimeOffsetPar::R3BSofTrimCalculateDriftTimeOffsetPar(const char* name, Int_t iVerbose) : FairTask(name, iVerbose) - , fNumSections(0) - , fNumAnodes(0) - , fMinStatistics(0) + , fNumSections(3) + , fNumAnodes(6) + , fMinStatistics(100) , fTrimCalData(NULL) , fMwpc0HitData(NULL) , fMwpc1HitData(NULL) @@ -78,10 +64,9 @@ R3BSofTrimCalculateDriftTimeOffsetPar::~R3BSofTrimCalculateDriftTimeOffsetPar() // ----- Public method Init -------------------------------------------- InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() { - LOG(info) << "R3BSofTrimCalculateDriftTimeOffsetPar: Init"; - FairRootManager* rm = FairRootManager::Instance(); + auto* rm = FairRootManager::Instance(); if (!rm) { return kFATAL; @@ -91,7 +76,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- INPUT TRIM CAL DATA --- // // --- ------------------- --- // - fTrimCalData = (TClonesArray*)rm->GetObject("TrimCalData"); + fTrimCalData = dynamic_cast(rm->GetObject("TrimCalData")); if (!fTrimCalData) { LOG(error) << "R3BSofTrimCalculateDriftTimeOffsetPar::Init() Couldn't get handle on TrimCalData"; @@ -102,7 +87,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- INPUT MWPC0 HIT DATA --- // // --- -------------------- --- // - fMwpc0HitData = (TClonesArray*)rm->GetObject("Mwpc0HitData"); + fMwpc0HitData = dynamic_cast(rm->GetObject("Mwpc0HitData")); if (!fMwpc0HitData) { LOG(error) << "R3BSofTrimCalculateDriftTimeOffsetPar::Init() Couldn't get handle on Mwpc0HitData"; @@ -113,7 +98,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- INPUT MWPC1 HIT DATA --- // // --- -------------------- --- // - fMwpc1HitData = (TClonesArray*)rm->GetObject("Mwpc1HitData"); + fMwpc1HitData = dynamic_cast(rm->GetObject("Mwpc1HitData")); if (!fMwpc1HitData) { LOG(error) << "R3BSofTrimCalculateDriftTimeOffsetPar::Init() Couldn't get handle on Mwpc1HitData"; @@ -124,7 +109,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- RUN TIME DATA BASE --- // // --- ------------------ --- // - FairRuntimeDb* rtdb = FairRuntimeDb::instance(); + auto* rtdb = FairRuntimeDb::instance(); if (!rtdb) { return kFATAL; @@ -134,7 +119,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- SOF TRIM TRIANGLE CAL PARAMETERS CONTAINER --- // // --- ------------------------------------------ --- // - fCalPar = (R3BSofTrimCalPar*)rtdb->getContainer("trimCalPar"); + fCalPar = dynamic_cast(rtdb->getContainer("trimCalPar")); if (!fCalPar) { LOG(error) << "R3BSofTrimCalculateDriftTimeOffsetPar::Init() Couldn't get handle on trimCalPar container"; @@ -151,7 +136,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- ---------------------- --- // // --- GEOMETRY OF THE MWPC0 --- // // --- ---------------------- --- // - fMwpc0GeoPar = (R3BTGeoPar*)rtdb->getContainer("Mwpc0GeoPar"); + fMwpc0GeoPar = dynamic_cast(rtdb->getContainer("Mwpc0GeoPar")); if (!fMwpc0GeoPar) { LOG(error) << "R3BSofTrimCalculateDriftTimeOffsetPar::SetParContainers() : Could not get access to mwpc0GeoPar " @@ -164,7 +149,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- ---------------------- --- // // --- GEOMETRY OF THE MWPC1 --- // // --- ---------------------- --- // - fMwpc1GeoPar = (R3BTGeoPar*)rtdb->getContainer("Mwpc1GeoPar"); + fMwpc1GeoPar = dynamic_cast(rtdb->getContainer("Mwpc1GeoPar")); if (!fMwpc1GeoPar) { LOG(error) << "R3BSofTrimCalculateDriftTimeOffsetPar::SetParContainers() : Could not get access to mwpc1GeoPar " @@ -177,7 +162,7 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() // --- ----------------------------- --- // // --- GEOMETRY OF THE TRIPLE-MUSIC --- // // --- ----------------------------- --- // - fTrimGeoPar = (R3BTGeoPar*)rtdb->getContainer("TrimGeoPar"); + fTrimGeoPar = dynamic_cast(rtdb->getContainer("TrimGeoPar")); if (!fTrimGeoPar) { LOG(error) << "R3BSofTrimCalculateDriftTimeOffsetPar::SetParContainers() : Could not get access to trimGeoPar " @@ -211,9 +196,8 @@ InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::Init() InitStatus R3BSofTrimCalculateDriftTimeOffsetPar::ReInit() { return kSUCCESS; } // ----- Public method Exec -------------------------------------------- -void R3BSofTrimCalculateDriftTimeOffsetPar::Exec(Option_t* opt) +void R3BSofTrimCalculateDriftTimeOffsetPar::Exec(Option_t*) { - Int_t iSec, iAnode; Double_t geoX0, geoX1, geoZ0, geoZ1, geoDZ; Double_t X0, X1, DX; @@ -241,8 +225,8 @@ void R3BSofTrimCalculateDriftTimeOffsetPar::Exec(Option_t* opt) // --- -------------- --- // // --- MWPCs HIT DATA --- // // --- -------------- --- // - nHitsMw0 = fMwpc0HitData->GetEntries(); - nHitsMw1 = fMwpc1HitData->GetEntries(); + nHitsMw0 = fMwpc0HitData->GetEntriesFast(); + nHitsMw1 = fMwpc1HitData->GetEntriesFast(); // if (nHitsMw0 != 0) //{ // std::cout << std::endl; @@ -250,8 +234,8 @@ void R3BSofTrimCalculateDriftTimeOffsetPar::Exec(Option_t* opt) //} if (nHitsMw0 == 1 && nHitsMw1 == 1) { - R3BMwpcHitData* hitMwpc0 = (R3BMwpcHitData*)fMwpc0HitData->At(0); - R3BMwpcHitData* hitMwpc1 = (R3BMwpcHitData*)fMwpc1HitData->At(0); + auto* hitMwpc0 = dynamic_cast(fMwpc0HitData->At(0)); + auto* hitMwpc1 = dynamic_cast(fMwpc1HitData->At(0)); X0 = hitMwpc0->GetX() + geoX0; X1 = hitMwpc1->GetX() + geoX1; DX = X1 - X0; @@ -259,12 +243,12 @@ void R3BSofTrimCalculateDriftTimeOffsetPar::Exec(Option_t* opt) // --- --------------------------------------- --- // // --- LOOP OVER TRIANGLE CAL HITS FOR SofTrim --- // // --- --------------------------------------- --- // - nHits = fTrimCalData->GetEntries(); + nHits = fTrimCalData->GetEntriesFast(); if (!nHits) return; for (Int_t ihit = 0; ihit < nHits; ihit++) { - R3BSofTrimCalData* hit = (R3BSofTrimCalData*)fTrimCalData->At(ihit); + auto* hit = dynamic_cast(fTrimCalData->At(ihit)); iSec = hit->GetSecID() - 1; iAnode = hit->GetAnodeID() - 1; DTraw = hit->GetDriftTimeRaw(); @@ -280,11 +264,6 @@ void R3BSofTrimCalculateDriftTimeOffsetPar::Exec(Option_t* opt) } } -// ---- Public method Reset -------------------------------------------------- -void R3BSofTrimCalculateDriftTimeOffsetPar::Reset() {} - -void R3BSofTrimCalculateDriftTimeOffsetPar::FinishEvent() {} - // ---- Public method Finish -------------------------------------------------- void R3BSofTrimCalculateDriftTimeOffsetPar::FinishTask() { diff --git a/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.h b/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.h index 108487e1..9356b555 100644 --- a/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.h +++ b/trim/calibration/R3BSofTrimCalculateDriftTimeOffsetPar.h @@ -1,5 +1,4 @@ -#ifndef __R3BSofTrimDTOffsetPar_H__ -#define __R3BSofTrimDTOffsetPar_H__ +#pragma once #include "FairTask.h" #include "R3BSofTrimCalPar.h" @@ -11,7 +10,6 @@ class R3BEventHeader; class R3BSofTrimCalculateDriftTimeOffsetPar : public FairTask { - public: /** Default constructor **/ R3BSofTrimCalculateDriftTimeOffsetPar(); @@ -28,15 +26,9 @@ class R3BSofTrimCalculateDriftTimeOffsetPar : public FairTask /** Virtual method Exec **/ virtual void Exec(Option_t* opt); - /** Virtual method FinishEvent **/ - virtual void FinishEvent(); - /** Virtual method FinishTask **/ virtual void FinishTask(); - /** Virtual method Reset **/ - virtual void Reset(); - /** Virtual method ReInit **/ virtual InitStatus ReInit(); @@ -62,7 +54,7 @@ class R3BSofTrimCalculateDriftTimeOffsetPar : public FairTask void SetDistInterSection(Double_t d) { fDistInterSection = d; } void SetDriftVelocity(Double_t v) { fDriftVelocity = v; } - protected: + private: Int_t fNumSections; Int_t fNumAnodes; Int_t fMinStatistics; // minimum statistics to proceed to the calibration @@ -92,5 +84,3 @@ class R3BSofTrimCalculateDriftTimeOffsetPar : public FairTask public: ClassDef(R3BSofTrimCalculateDriftTimeOffsetPar, 0); }; - -#endif //__R3BSofTrimDTOffsetPar_H__ diff --git a/trim/calibration/R3BSofTrimCalculateMatchGainPar.cxx b/trim/calibration/R3BSofTrimCalculateMatchGainPar.cxx index 9b994a65..b0bc831a 100644 --- a/trim/calibration/R3BSofTrimCalculateMatchGainPar.cxx +++ b/trim/calibration/R3BSofTrimCalculateMatchGainPar.cxx @@ -1,35 +1,24 @@ #include "R3BSofTrimCalculateMatchGainPar.h" +#include "R3BSofTrimCalData.h" +#include "R3BSofTrimCalPar.h" #include "FairLogger.h" #include "FairRootManager.h" #include "FairRunAna.h" #include "FairRuntimeDb.h" -#include "R3BEventHeader.h" -#include "R3BSofTrimCalData.h" -#include "R3BSofTrimCalPar.h" + #include "TClonesArray.h" -#include "TGeoManager.h" -#include "TGeoMatrix.h" #include "TMath.h" #include "TObjArray.h" #include "TRandom.h" #include "TVector3.h" - #include #include // R3BSofTrimCalculateMatchGainPar: Default Constructor -------------------------- R3BSofTrimCalculateMatchGainPar::R3BSofTrimCalculateMatchGainPar() - : FairTask("R3BSofTrimCalculateMatchGainPar", 1) - , fNumSections(3) - , fNumAnodes(6) - , fNumPairsPerSection(3) - , fCalData(NULL) - , fCalPar(NULL) - , fEpsilon(0.01) - , fOutputFile(NULL) + : R3BSofTrimCalculateMatchGainPar("R3BSofTrimCalculateMatchGainPar", 1) { - fGainMin = new TArrayF(9); } // R3BSofTrimCalculateMatchGainPar: Standard Constructor -------------------------- @@ -56,10 +45,9 @@ R3BSofTrimCalculateMatchGainPar::~R3BSofTrimCalculateMatchGainPar() // ----- Public method Init -------------------------------------------- InitStatus R3BSofTrimCalculateMatchGainPar::Init() { - LOG(info) << "R3BSofTrimCalculateMatchGainPar: Init"; - FairRootManager* rm = FairRootManager::Instance(); + auto* rm = FairRootManager::Instance(); if (!rm) { return kFATAL; @@ -69,7 +57,7 @@ InitStatus R3BSofTrimCalculateMatchGainPar::Init() // --- INPUT CAL DATA --- // // --- -------------- --- // - fCalData = (TClonesArray*)rm->GetObject("TrimCalData"); + fCalData = dynamic_cast(rm->GetObject("TrimCalData")); if (!fCalData) { LOG(error) << "R3BSofTrimCalculateMatchGainPar::Init() Couldn't get handle on TrimCalData"; @@ -80,13 +68,13 @@ InitStatus R3BSofTrimCalculateMatchGainPar::Init() // --- SOF TRIM TRIANGLE CAL PARAMETERS CONTAINER --- // // --- ------------------------------------------ --- // - FairRuntimeDb* rtdb = FairRuntimeDb::instance(); + auto* rtdb = FairRuntimeDb::instance(); if (!rtdb) { return kFATAL; } - fCalPar = (R3BSofTrimCalPar*)rtdb->getContainer("trimCalPar"); + fCalPar = dynamic_cast(rtdb->getContainer("trimCalPar")); if (!fCalPar) { LOG(error) << "R3BSofTrimCalculateMatchGainPar::Init() Couldn't get handle on trimCalPar container"; @@ -131,9 +119,8 @@ InitStatus R3BSofTrimCalculateMatchGainPar::Init() InitStatus R3BSofTrimCalculateMatchGainPar::ReInit() { return kSUCCESS; } // ----- Public method Exec -------------------------------------------- -void R3BSofTrimCalculateMatchGainPar::Exec(Option_t* opt) +void R3BSofTrimCalculateMatchGainPar::Exec(Option_t*) { - Int_t iSec, iAnode, iPair; Double_t Esub[fNumSections * fNumAnodes]; Double_t EsubDown; @@ -147,12 +134,12 @@ void R3BSofTrimCalculateMatchGainPar::Exec(Option_t* opt) // --- ------------------------------ --- // // --- LOOP OVER CAL DATA FOR SofTrim --- // // --- ------------------------------ --- // - UInt_t nHits = fCalData->GetEntries(); + auto nHits = fCalData->GetEntries(); if (!nHits) return; - for (Int_t ihit = 0; ihit < nHits; ihit++) + for (auto ihit = 0; ihit < nHits; ihit++) { - R3BSofTrimCalData* hit = (R3BSofTrimCalData*)fCalData->At(ihit); + auto* hit = dynamic_cast(fCalData->At(ihit)); iSec = hit->GetSecID() - 1; iAnode = hit->GetAnodeID() - 1; mult[iAnode + iSec * fNumAnodes]++; @@ -186,11 +173,6 @@ void R3BSofTrimCalculateMatchGainPar::Exec(Option_t* opt) } // end of loop over the sections } -// ---- Public method Reset -------------------------------------------------- -void R3BSofTrimCalculateMatchGainPar::Reset() {} - -void R3BSofTrimCalculateMatchGainPar::FinishEvent() {} - // ---- Public method Finish -------------------------------------------------- void R3BSofTrimCalculateMatchGainPar::FinishTask() { diff --git a/trim/calibration/R3BSofTrimCalculateMatchGainPar.h b/trim/calibration/R3BSofTrimCalculateMatchGainPar.h index c2acbf91..00bd6aa2 100644 --- a/trim/calibration/R3BSofTrimCalculateMatchGainPar.h +++ b/trim/calibration/R3BSofTrimCalculateMatchGainPar.h @@ -1,5 +1,4 @@ -#ifndef __R3BSOFTRIMMATCHGAINPAR_H__ -#define __R3BSOFTRIMMATCHGAINPAR_H__ +#pragma once #include "FairTask.h" #include "TCanvas.h" @@ -14,7 +13,6 @@ class R3BEventHeader; class R3BSofTrimCalculateMatchGainPar : public FairTask { - public: /** Default constructor **/ R3BSofTrimCalculateMatchGainPar(); @@ -31,15 +29,9 @@ class R3BSofTrimCalculateMatchGainPar : public FairTask /** Virtual method Exec **/ virtual void Exec(Option_t* opt); - /** Virtual method FinishEvent **/ - virtual void FinishEvent(); - /** Virtual method FinishTask **/ virtual void FinishTask(); - /** Virtual method Reset **/ - virtual void Reset(); - /** Virtual method ReInit **/ virtual InitStatus ReInit(); @@ -72,5 +64,3 @@ class R3BSofTrimCalculateMatchGainPar : public FairTask public: ClassDef(R3BSofTrimCalculateMatchGainPar, 0); }; - -#endif //__R3BSOFTRIMMATCHGAINPAR_H__ diff --git a/trim/calibration/R3BSofTrimMapped2Cal.cxx b/trim/calibration/R3BSofTrimMapped2Cal.cxx index 8644e58b..1e22e2d8 100644 --- a/trim/calibration/R3BSofTrimMapped2Cal.cxx +++ b/trim/calibration/R3BSofTrimMapped2Cal.cxx @@ -58,16 +58,16 @@ R3BSofTrimMapped2Cal::~R3BSofTrimMapped2Cal() void R3BSofTrimMapped2Cal::SetParContainers() { - FairRuntimeDb* rtdb = FairRuntimeDb::instance(); + auto* rtdb = FairRuntimeDb::instance(); if (!rtdb) { - LOG(error) << "FairRuntimeDb not opened!"; + LOG(fatal) << "FairRuntimeDb not opened!"; } - fCal_Par = (R3BSofTrimCalPar*)rtdb->getContainer("trimCalPar"); + fCal_Par = dynamic_cast(rtdb->getContainer("trimCalPar")); if (!fCal_Par) { - LOG(error) << "R3BSofTrimMapped2CalPar::Init() Couldn't get handle on trimCalPar container"; + LOG(fatal) << "R3BSofTrimMapped2CalPar::Init() Couldn't get handle on trimCalPar container"; return; } else @@ -88,7 +88,7 @@ InitStatus R3BSofTrimMapped2Cal::Init() { LOG(info) << "R3BSofTrimMapped2Cal::Init()"; - FairRootManager* rootManager = FairRootManager::Instance(); + auto* rootManager = FairRootManager::Instance(); if (!rootManager) { return kFATAL; @@ -97,7 +97,7 @@ InitStatus R3BSofTrimMapped2Cal::Init() // --- ----------------- --- // // --- INPUT MAPPED DATA --- // // --- ----------------- --- // - fTrimMappedData = (TClonesArray*)rootManager->GetObject("TrimMappedData"); + fTrimMappedData = dynamic_cast(rootManager->GetObject("TrimMappedData")); if (!fTrimMappedData) { return kFATAL; @@ -106,7 +106,7 @@ InitStatus R3BSofTrimMapped2Cal::Init() // --- --------------- --- // // --- OUTPUT CAL DATA --- // // --- --------------- --- // - fTrimCalData = new TClonesArray("R3BSofTrimCalData", MAX_MULT_TRIM_CAL * 8); + fTrimCalData = new TClonesArray("R3BSofTrimCalData"); rootManager->Register("TrimCalData", "Trim Cal", fTrimCalData, !fOnline); return kSUCCESS; @@ -120,17 +120,11 @@ InitStatus R3BSofTrimMapped2Cal::ReInit() } // ----- Public method Execution -------------------------------------------- -void R3BSofTrimMapped2Cal::Exec(Option_t* option) +void R3BSofTrimMapped2Cal::Exec(Option_t*) { // Reset entries in output arrays, local arrays Reset(); - // get the parameters - if (!fCal_Par) - { - LOG(error) << "R3BSofTrimMapped2Cal: NOT Container Parameter!!"; - } - // Reading input mapped data per anode // --> number of channels = number of anodes (6: id=1..6) // + number of Tref (1: id=fNumAnodes+1) @@ -200,9 +194,6 @@ void R3BSofTrimMapped2Cal::Exec(Option_t* option) return; } -// ----- Protected method Finish -------------------------------------------- -void R3BSofTrimMapped2Cal::Finish() {} - // ----- Public method Reset ------------------------------------------------ void R3BSofTrimMapped2Cal::Reset() { diff --git a/trim/calibration/R3BSofTrimMapped2Cal.h b/trim/calibration/R3BSofTrimMapped2Cal.h index f32e0cb8..539c789b 100644 --- a/trim/calibration/R3BSofTrimMapped2Cal.h +++ b/trim/calibration/R3BSofTrimMapped2Cal.h @@ -2,8 +2,7 @@ // ----- R3BSofTrimMapped2Cal ----- // ----------------------------------------------------------------- -#ifndef R3BSofTrimMapped2Cal_H -#define R3BSofTrimMapped2Cal_H +#pragma once #include "FairTask.h" #include "R3BSofTrimCalData.h" @@ -19,7 +18,6 @@ class R3BSofTrimCalPar; class R3BSofTrimMapped2Cal : public FairTask { - public: /** Default constructor **/ R3BSofTrimMapped2Cal(); @@ -45,9 +43,6 @@ class R3BSofTrimMapped2Cal : public FairTask /** Virtual method ReInit **/ virtual InitStatus ReInit(); - /** Virtual method Finish **/ - virtual void Finish(); - void SetOnline(Bool_t option) { fOnline = option; } private: @@ -73,5 +68,3 @@ class R3BSofTrimMapped2Cal : public FairTask // Class definition ClassDef(R3BSofTrimMapped2Cal, 1) }; - -#endif diff --git a/trim/pars/R3BSofTrimCalPar.h b/trim/pars/R3BSofTrimCalPar.h index 42ef2986..db9c6dad 100644 --- a/trim/pars/R3BSofTrimCalPar.h +++ b/trim/pars/R3BSofTrimCalPar.h @@ -2,10 +2,9 @@ // ----- R3BSofTrimCalPar source file ----- // ------------------------------------------------------------------ -#ifndef R3BSofTrimCalPar_H -#define R3BSofTrimCalPar_H +#pragma once -#include "FairParGenericSet.h" // for FairParGenericSet +#include "FairParGenericSet.h" #include "TArrayD.h" #include "TArrayF.h" #include "TObjArray.h" @@ -17,7 +16,6 @@ class FairParamList; class R3BSofTrimCalPar : public FairParGenericSet { - public: /** Standard constructor **/ R3BSofTrimCalPar(const char* name = "trimCalPar", @@ -86,7 +84,6 @@ class R3BSofTrimCalPar : public FairParGenericSet R3BSofTrimCalPar(const R3BSofTrimCalPar&); /*< a copy constructor >*/ + public: ClassDef(R3BSofTrimCalPar, 1); }; - -#endif diff --git a/trim/pars/R3BSofTrimContFact.cxx b/trim/pars/R3BSofTrimContFact.cxx index c1c0cc7a..69cedf1e 100644 --- a/trim/pars/R3BSofTrimContFact.cxx +++ b/trim/pars/R3BSofTrimContFact.cxx @@ -3,13 +3,13 @@ // --------------------------------------------------------------- #include "R3BSofTrimContFact.h" - -#include "FairLogger.h" -#include "FairRuntimeDb.h" #include "R3BSofTrimCalPar.h" #include "R3BSofTrimHitPar.h" #include "R3BTGeoPar.h" -#include "TClass.h" +#include + +#include +#include static R3BSofTrimContFact gR3BSofTrimContFact; @@ -25,43 +25,42 @@ R3BSofTrimContFact::R3BSofTrimContFact() void R3BSofTrimContFact::setAllContainers() { // Creates the Container objects with all accepted contexts and adds them to - // the list of containers for the STS library. + // the list of containers for the SofTrim library. - FairContainer* p1 = new FairContainer("trimCalPar", "Triple MUSIC Cal Parameters", "TrimCalParContext"); + auto* p1 = new FairContainer("trimCalPar", "Triple MUSIC Cal Parameters", "TrimCalParContext"); p1->addContext("TrimCalParContext"); containers->Add(p1); - FairContainer* p2 = new FairContainer("trimHitPar", "Triple MUSIC Hit Parameters", "TrimHitParContext"); + auto* p2 = new FairContainer("trimHitPar", "Triple MUSIC Hit Parameters", "TrimHitParContext"); p2->addContext("TrimHitParContext"); containers->Add(p2); - FairContainer* p3 = new FairContainer("TrimGeoPar", "Triple MUSIC geometry parameters", "GeometryParameterContext"); + auto* p3 = new FairContainer("TrimGeoPar", "Triple MUSIC geometry parameters", "GeometryParameterContext"); p3->addContext("GeometryParameterContext"); containers->Add(p3); } FairParSet* R3BSofTrimContFact::createContainer(FairContainer* c) { - // Trails the constructor of the corresponding parameter container. // For an actual context, which is not an empty string and not the default context // of this container, the name is concatenated with the context. + const std::string name(c->GetName()); + R3BLOG(info, "Create container name: " << name.c_str()); - const char* name = c->GetName(); - LOG(info) << "R3BSofTrimContFact: Create container name: " << name; - FairParSet* p = 0; - if (strcmp(name, "trimCalPar") == 0) + FairParSet* p = nullptr; + if (name == "trimCalPar") { p = new R3BSofTrimCalPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } - else if (strcmp(name, "trimHitPar") == 0) + else if (name == "trimHitPar") { p = new R3BSofTrimHitPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } - else if (strcmp(name, "TrimGeoPar") == 0) + else if (name == "TrimGeoPar") { p = new R3BTGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } return p; } -ClassImp(R3BSofTrimContFact); +ClassImp(R3BSofTrimContFact) diff --git a/trim/pars/R3BSofTrimContFact.h b/trim/pars/R3BSofTrimContFact.h index 03d1d494..2be513a5 100644 --- a/trim/pars/R3BSofTrimContFact.h +++ b/trim/pars/R3BSofTrimContFact.h @@ -2,10 +2,9 @@ // ----- R3BSofTrimContFact source file ----- // ------------------------------------------------------------------ -#ifndef R3BSofTrimContFact_H -#define R3BSofTrimContFact_H +#pragma once -#include "FairContFact.h" +#include class FairContainer; @@ -16,9 +15,9 @@ class R3BSofTrimContFact : public FairContFact public: R3BSofTrimContFact(); - ~R3BSofTrimContFact() {} + ~R3BSofTrimContFact() = default; + FairParSet* createContainer(FairContainer*); - ClassDef(R3BSofTrimContFact, 0) // Factory for all R3BSofTrim parameter containers -}; -#endif /* R3BSofTrimContFact_H */ + ClassDef(R3BSofTrimContFact, 0); // Factory for all R3BSofTrim parameter containers +}; diff --git a/trim/sim/R3BSofTrim.cxx b/trim/sim/R3BSofTrim.cxx index 7e866592..487837c0 100644 --- a/trim/sim/R3BSofTrim.cxx +++ b/trim/sim/R3BSofTrim.cxx @@ -1,21 +1,34 @@ +/****************************************************************************** + * Copyright (C) 2017 GSI Helmholtzzentrum für Schwerionenforschung GmbH * + * Copyright (C) 2017-2026 Members of R3B Collaboration * + * * + * This software is distributed under the terms of the * + * GNU General Public Licence (GPL) version 3, * + * copied verbatim in the file "LICENSE". * + * * + * In applying this license GSI does not waive the privileges and immunities * + * granted to it by virtue of its status as an Intergovernmental Organization * + * or submit itself to any jurisdiction. * + ******************************************************************************/ + // ------------------------------------------------------------------------- // ----- R3BSofTrim source file ----- // ----- Created 24/11/17 by H.Alvarez-Pol ----- // ------------------------------------------------------------------------- -#include "FairLogger.h" -#include "FairRootManager.h" -#include "FairVolume.h" - +#include "R3BSofTrim.h" #include "R3BLogger.h" #include "R3BMCStack.h" -#include "R3BSofTrim.h" #include "R3BSofTrimPoint.h" -#include "TClonesArray.h" -#include "TGeoManager.h" -#include "TParticle.h" -#include "TVirtualMC.h" +#include +#include +#include + +#include +#include +#include +#include #define U_MEV 931.4940954 @@ -55,12 +68,12 @@ void R3BSofTrim::Initialize() } // ----- Public method ProcessHits -------------------------------------- -Bool_t R3BSofTrim::ProcessHits(FairVolume* vol) +bool R3BSofTrim::ProcessHits(FairVolume* vol) { if (gMC->IsTrackEntering()) { gGeoManager->cd(gMC->CurrentVolPath()); - Int_t nodeId = gGeoManager->GetNodeId(); + int nodeId = gGeoManager->GetNodeId(); fELoss = 0.; fNSteps = 0; // FIXME fTime = gMC->TrackTime() * 1.0e09; @@ -79,7 +92,6 @@ Bool_t R3BSofTrim::ProcessHits(FairVolume* vol) if (fELoss > 0) { - fNSteps++; // Set additional parameters at exit of active volume. Create R3BSofTrimPoint. @@ -112,7 +124,7 @@ Bool_t R3BSofTrim::ProcessHits(FairVolume* vol) fELoss); // Increment number of SofTRIMPoints for this track - R3BStack* stack = static_cast(TVirtualMC::GetMC()->GetStack()); + auto* stack = static_cast(TVirtualMC::GetMC()->GetStack()); stack->AddPoint(kSOFTRIM); ResetParameters(); } @@ -133,11 +145,11 @@ void R3BSofTrim::EndOfEvent() // ----- Public method Register ------------------------------------------- void R3BSofTrim::Register() { - FairRootManager::Instance()->Register("SofTrimPoint", GetName(), fSofTRIMCollection, kTRUE); + FairRootManager::Instance()->Register("SofTrimPoint", GetName(), fSofTRIMCollection, true); } // ----- Public method GetCollection -------------------------------------- -TClonesArray* R3BSofTrim::GetCollection(Int_t iColl) const +TClonesArray* R3BSofTrim::GetCollection(int iColl) const { if (iColl == 0) { @@ -150,10 +162,10 @@ TClonesArray* R3BSofTrim::GetCollection(Int_t iColl) const } // ----- Public method Print ---------------------------------------------- -void R3BSofTrim::Print(Option_t* option) const +void R3BSofTrim::Print(Option_t*) const { - Int_t nHits = fSofTRIMCollection->GetEntriesFast(); - R3BLOG(info, nHits << " points registered in this event"); + auto nHits = fSofTRIMCollection->GetEntriesFast(); + LOG(info) << "R3BSofTrim: " << nHits << " points registered in this event"; } // ----- Public method Reset ---------------------------------------------- @@ -164,27 +176,27 @@ void R3BSofTrim::Reset() } // ----- Private method AddPoint -------------------------------------------- -R3BSofTrimPoint* R3BSofTrim::AddPoint(Int_t trackID, - Int_t detID, - Int_t detCopyID, - Double_t zf, - Double_t af, +R3BSofTrimPoint* R3BSofTrim::AddPoint(int trackID, + int detID, + int detCopyID, + double zf, + double af, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, - Double_t time, - Double_t length, - Double_t eLoss) + double time, + double length, + double eLoss) { TClonesArray& clref = *fSofTRIMCollection; - Int_t size = clref.GetEntriesFast(); + auto size = clref.GetEntriesFast(); return new (clref[size]) R3BSofTrimPoint(trackID, detID, detCopyID, zf, af, posIn, posOut, momIn, momOut, time, length, eLoss); } // ----- Public method CheckIfSensitive ---------------------------------- -Bool_t R3BSofTrim::CheckIfSensitive(std::string name) +bool R3BSofTrim::CheckIfSensitive(std::string name) { if (TString(name).Contains("TrimAnode")) { @@ -193,4 +205,4 @@ Bool_t R3BSofTrim::CheckIfSensitive(std::string name) return kFALSE; } -ClassImp(R3BSofTrim); +ClassImp(R3BSofTrim) diff --git a/trim/sim/R3BSofTrim.h b/trim/sim/R3BSofTrim.h index f0441764..3b344c65 100644 --- a/trim/sim/R3BSofTrim.h +++ b/trim/sim/R3BSofTrim.h @@ -1,5 +1,17 @@ -#ifndef R3BSofTrim_H -#define R3BSofTrim_H 1 +/****************************************************************************** + * Copyright (C) 2017 GSI Helmholtzzentrum für Schwerionenforschung GmbH * + * Copyright (C) 2017-2026 Members of R3B Collaboration * + * * + * This software is distributed under the terms of the * + * GNU General Public Licence (GPL) version 3, * + * copied verbatim in the file "LICENSE". * + * * + * In applying this license GSI does not waive the privileges and immunities * + * granted to it by virtue of its status as an Intergovernmental Organization * + * or submit itself to any jurisdiction. * + ******************************************************************************/ + +#pragma once #include "R3BDetector.h" #include "TLorentzVector.h" @@ -35,7 +47,7 @@ class R3BSofTrim : public R3BDetector ** to the collection. *@param vol Pointer to the active volume **/ - Bool_t ProcessHits(FairVolume* vol = 0) override; + bool ProcessHits(FairVolume* vol = 0) override; /** method EndOfEvent ** @@ -51,7 +63,7 @@ class R3BSofTrim : public R3BDetector void Register() override; /** Accessor to the hit collection **/ - TClonesArray* GetCollection(Int_t iColl) const override; + TClonesArray* GetCollection(int iColl) const override; /** method Print ** @@ -65,26 +77,26 @@ class R3BSofTrim : public R3BDetector **/ void Reset() override; - Bool_t CheckIfSensitive(std::string name) override; + bool CheckIfSensitive(std::string name) override; void Initialize() override; private: /** Track information to be stored until the track leaves the active volume. **/ - Int_t fTrackID; //! track index - Int_t fTrackPID; //! particle identification - Int_t fVolumeID; //! volume id - Int_t fDetCopyID; - Double_t fZ; - Double_t fA; - Int_t fUniqueID; //! particle unique id (e.g. if Delta electron, fUniqueID=9) + int fTrackID; //! track index + int fTrackPID; //! particle identification + int fVolumeID; //! volume id + int fDetCopyID; + double fZ; + double fA; + int fUniqueID; //! particle unique id (e.g. if Delta electron, fUniqueID=9) TLorentzVector fPosIn, fPosOut; //! position TLorentzVector fMomIn, fMomOut; //! momentum - Double32_t fTime; //! time - Double32_t fLength; //! length - Double32_t fELoss; //! energy loss - Int_t fNSteps; //! Number of steps in the active volume + double fTime; //! time + double fLength; //! length + double fELoss; //! energy loss + int fNSteps; //! Number of steps in the active volume TClonesArray* fSofTRIMCollection; //! The point collection @@ -92,18 +104,18 @@ class R3BSofTrim : public R3BDetector ** ** Adds a SofTRIMPoint to the HitCollection **/ - R3BSofTrimPoint* AddPoint(Int_t trackID, - Int_t detID, - Int_t detCopyID, - Double_t zf, - Double_t af, + R3BSofTrimPoint* AddPoint(int trackID, + int detID, + int detCopyID, + double zf, + double af, TVector3 posIn, TVector3 pos_out, TVector3 momIn, TVector3 momOut, - Double_t time, - Double_t length, - Double_t eLoss); + double time, + double length, + double eLoss); /** Private method ResetParameters ** @@ -125,5 +137,3 @@ inline void R3BSofTrim::ResetParameters() fTime = fLength = fZ = fA = fELoss = 0.; fNSteps = 0; }; - -#endif diff --git a/update_zenodo.py b/update_zenodo.py old mode 100755 new mode 100644