diff --git a/PWGUD/AQC/udQC.cxx b/PWGUD/AQC/udQC.cxx index 44c2f03a2e8..24117f9d6e2 100644 --- a/PWGUD/AQC/udQC.cxx +++ b/PWGUD/AQC/udQC.cxx @@ -97,7 +97,7 @@ struct UDQC { // initialize global variables maxdEdxTPC = 0.; maxdEdxTOF = 0.; - diffCuts = (DGCutparHolder)DGCuts; + diffCuts = DGCutparHolder(DGCuts); // add histograms for the different process functions if (context.mOptions.get("processMain")) { diff --git a/PWGUD/AQC/udQCmidRap.cxx b/PWGUD/AQC/udQCmidRap.cxx index 6a2ea533d4c..1aaff2bb186 100644 --- a/PWGUD/AQC/udQCmidRap.cxx +++ b/PWGUD/AQC/udQCmidRap.cxx @@ -86,7 +86,7 @@ struct UDQCmid { // initialize global variables maxdEdxTPC = 0.; maxdEdxTOF = 0.; - diffCuts = (DGCutparHolder)DGCuts; + diffCuts = DGCutparHolder(DGCuts); // add histograms for the different process functions if (context.mOptions.get("processMain")) { diff --git a/PWGUD/AQC/udQcMuon.cxx b/PWGUD/AQC/udQcMuon.cxx index 9f09ee2d2c9..995fcaa3fec 100644 --- a/PWGUD/AQC/udQcMuon.cxx +++ b/PWGUD/AQC/udQcMuon.cxx @@ -98,7 +98,7 @@ struct UdQcMuon { void init(InitContext& context) { - diffCuts = (DGCutparHolder)dgCuts; + diffCuts = DGCutparHolder(dgCuts); // add histograms for the different process functions if (context.mOptions.get("processMain")) { diff --git a/PWGUD/TableProducer/DGBCCandProducer.cxx b/PWGUD/TableProducer/DGBCCandProducer.cxx index cf62e50c84d..4719805c3e2 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.cxx +++ b/PWGUD/TableProducer/DGBCCandProducer.cxx @@ -131,8 +131,8 @@ struct tracksWGTInBCs { // compute the BC closest in time auto firstCompatibleBC = ambTracksSlice.begin().bc().begin().globalBC(); LOGF(debug, "First compatible BC %d Track time %f", firstCompatibleBC, track.trackTime()); - closestBC = (uint64_t)(firstCompatibleBC + - (track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS)); + closestBC = static_cast(firstCompatibleBC + + (track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS)); } else { // this track is not ambiguous, has hence a unique association to a collision/BC if (!track.has_collision()) { @@ -147,7 +147,7 @@ struct tracksWGTInBCs { // update tracksInBCList LOGF(debug, "Updating tracksInBCList with %d", closestBC); - tracksInBCList[closestBC].emplace_back((int32_t)track.globalIndex()); + tracksInBCList[closestBC].emplace_back(static_cast(track.globalIndex())); } } @@ -215,8 +215,8 @@ struct tracksWGTInBCs { // compute the BC closest in time auto firstCompatibleBC = ambFwdTracksSlice.begin().bc().begin().globalBC(); - closestBC = (uint64_t)(firstCompatibleBC + - (fwdTrack.trackTime() / o2::constants::lhc::LHCBunchSpacingNS)); + closestBC = static_cast(firstCompatibleBC + + (fwdTrack.trackTime() / o2::constants::lhc::LHCBunchSpacingNS)); } else { // this track is not ambiguous, has hence a unique association to a collision/BC if (!fwdTrack.has_collision()) { @@ -231,7 +231,7 @@ struct tracksWGTInBCs { // update tracksInBCList LOGF(debug, "Updating fwdTracksInBCList with %d", closestBC); - fwdTracksInBCList[closestBC].emplace_back((int32_t)fwdTrack.globalIndex()); + fwdTracksInBCList[closestBC].emplace_back(static_cast(fwdTrack.globalIndex())); } } @@ -385,7 +385,7 @@ struct DGBCCandProducer { void init(InitContext& context) { - diffCuts = (DGCutparHolder)DGCuts; + diffCuts = DGCutparHolder(DGCuts); if (context.mOptions.get("processTinBCs")) { registry.add("table/candCase", "#candCase", {HistType::kTH1F, {{4, -0.5, 3.5}}}); diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index 6574d613986..3e407e3c0b5 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -392,8 +392,8 @@ struct SGCandProducer { ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); ccdb->setFatalWhenNull(false); - sameCuts = (SGCutParHolder)SGCuts; - fitCuts = (FITCutParHolder)FITCuts; + sameCuts = SGCutParHolder(SGCuts); + fitCuts = FITCutParHolder(FITCuts); // add histograms for the different process functions histPointers.clear(); diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index f59c92ca55c..b5bcd1cd848 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -157,7 +157,7 @@ struct UpcCandProducer { fwdSelectors.resize(upchelpers::kNFwdSels - 1, false); barrelSelectors.resize(upchelpers::kNBarrelSels - 1, false); - upcCuts = (UPCCutparHolder)inputCuts; + upcCuts = UPCCutparHolder(inputCuts); // initialize RCT flag checker if (rctLabel.value != "none" && rctLabel.value != "muon" && rctLabel.value != "muon_glo") { @@ -1990,7 +1990,7 @@ struct UpcCandProducer { fwdTracks, fwdTrkClusters, ambFwdTracks, bcs, collisions, ft0s, fdds, fv0as, - (o2::aod::McTrackLabels*)nullptr, (o2::aod::McFwdTrackLabels*)nullptr); + nullptr, nullptr); } // create candidates for central region @@ -2007,7 +2007,7 @@ struct UpcCandProducer { createCandidatesCentral(barrelTracks, ambBarrelTracks, bcs, collisions, ft0s, fdds, fv0as, zdcs, - (o2::aod::McTrackLabels*)nullptr); + nullptr); } // MC processors @@ -2076,7 +2076,7 @@ struct UpcCandProducer { createCandidatesFwd(fwdTracks, fwdTrkClusters, ambFwdTracks, bcs, collisions, ft0s, fdds, fv0as, zdcs, - (o2::aod::McFwdTrackLabels*)nullptr); + nullptr); } void processForwardMC(ForwardTracks const& fwdTracks, @@ -2116,7 +2116,7 @@ struct UpcCandProducer { createCandidatesFwdGlobal(fwdTracks, fwdTrkClusters, ambFwdTracks, bcs, collisions, ft0s, fdds, fv0as, zdcs, - (o2::aod::McFwdTrackLabels*)nullptr); + nullptr); } void processForwardGlobalMC(ForwardTracks const& fwdTracks, diff --git a/PWGUD/TableProducer/dgCandProducer.cxx b/PWGUD/TableProducer/dgCandProducer.cxx index 97a3c423c3e..284f48f5e8e 100644 --- a/PWGUD/TableProducer/dgCandProducer.cxx +++ b/PWGUD/TableProducer/dgCandProducer.cxx @@ -456,7 +456,7 @@ struct DgCandProducer { ccdb->setFatalWhenNull(false); // DGCuts - diffCuts = (DGCutparHolder)DGCuts; + diffCuts = DGCutparHolder(DGCuts); // add histograms for the different process functions histPointers.clear(); diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index c418fd7c9c1..cdd76286241 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -124,7 +124,7 @@ struct UpcCandProducerGlobalMuon { void init(InitContext&) { - fUpcCuts = (UPCCutparHolder)fUpcCutsConf; + fUpcCuts = UPCCutparHolder(fUpcCutsConf); if (fUpcCuts.getUseFwdCuts() || fEnableMFT) { fCCDB->setURL("http://alice-ccdb.cern.ch"); fCCDB->setCaching(true); @@ -610,7 +610,7 @@ struct UpcCandProducerGlobalMuon { } // Initialize FwdDCAFitter with magnetic field if (fEnableMFT) { - o2::field::MagneticField* field = static_cast(TGeoGlobalMagField::Instance()->GetField()); + o2::field::MagneticField* field = dynamic_cast(TGeoGlobalMagField::Instance()->GetField()); static constexpr double kCenterMFT[3] = {0, 0, -61.4}; float bz = field->getBz(kCenterMFT); LOG(info) << "FwdDCAFitter magnetic field at MFT center: bZ = " << bz; @@ -922,7 +922,7 @@ struct UpcCandProducerGlobalMuon { o2::aod::Zdcs const& zdcs) { fDoMC = false; - createCandidates(fwdTracks, mftTracks, fwdTrkCls, ambFwdTracks, bcs, collisions, fv0s, zdcs, (o2::aod::McFwdTrackLabels*)nullptr); + createCandidates(fwdTracks, mftTracks, fwdTrkCls, ambFwdTracks, bcs, collisions, fv0s, zdcs, nullptr); } void processFwdMC(ForwardTracks const& fwdTracks, diff --git a/PWGUD/TableProducer/upcCandProducerMuon.cxx b/PWGUD/TableProducer/upcCandProducerMuon.cxx index 0ac8458d60f..b9f5edc7007 100644 --- a/PWGUD/TableProducer/upcCandProducerMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerMuon.cxx @@ -88,7 +88,7 @@ struct UpcCandProducerMuon { void init(InitContext&) { - fUpcCuts = (UPCCutparHolder)fUpcCutsConf; + fUpcCuts = UPCCutparHolder(fUpcCutsConf); if (fUpcCuts.getUseFwdCuts()) { fCCDB->setURL("http://alice-ccdb.cern.ch"); fCCDB->setCaching(true); @@ -520,7 +520,7 @@ struct UpcCandProducerMuon { o2::aod::Zdcs const& zdcs) { fDoMC = false; - createCandidates(fwdTracks, ambFwdTracks, bcs, collisions, fv0s, zdcs, (o2::aod::McFwdTrackLabels*)nullptr); + createCandidates(fwdTracks, ambFwdTracks, bcs, collisions, fv0s, zdcs, nullptr); } void processFwdMC(ForwardTracks const& fwdTracks, diff --git a/PWGUD/TableProducer/upcCandProducerSemiFwd.cxx b/PWGUD/TableProducer/upcCandProducerSemiFwd.cxx index cb6146aee7b..d99c57f5dc9 100644 --- a/PWGUD/TableProducer/upcCandProducerSemiFwd.cxx +++ b/PWGUD/TableProducer/upcCandProducerSemiFwd.cxx @@ -108,7 +108,7 @@ struct UpcCandProducerSemiFwd { void init(InitContext&) { - fUpcCuts = (UPCCutparHolder)fUpcCutsConf; + fUpcCuts = UPCCutparHolder(fUpcCutsConf); if (fUpcCuts.getUseFwdCuts()) { fCCDB->setURL("http://alice-ccdb.cern.ch"); fCCDB->setCaching(true); @@ -653,7 +653,7 @@ struct UpcCandProducerSemiFwd { { fDoMC = false; createCandidates(fwdTracks, ambFwdTracks, barrelTracks, ambBarrelTracks, bcs, collisions, fv0s, zdcs, - (o2::aod::McFwdTrackLabels*)nullptr, (o2::aod::McTrackLabels*)nullptr); + nullptr, nullptr); } void processSemiFwdMC(ForwardTracks const& fwdTracks, diff --git a/PWGUD/Tasks/dgCandAnalyzer.cxx b/PWGUD/Tasks/dgCandAnalyzer.cxx index 79b5b6c5f02..60547236485 100644 --- a/PWGUD/Tasks/dgCandAnalyzer.cxx +++ b/PWGUD/Tasks/dgCandAnalyzer.cxx @@ -144,7 +144,7 @@ struct DGCandAnalyzer { // PDG pdg = TDatabasePDG::Instance(); - anaPars = (DGAnaparHolder)DGPars; + anaPars = DGAnaparHolder(DGPars); pidsel.init(anaPars); grsel.init(goodRunsFile); diff --git a/PWGUD/Tasks/diffMCDataScanner.cxx b/PWGUD/Tasks/diffMCDataScanner.cxx index 6b945059121..369eca48921 100644 --- a/PWGUD/Tasks/diffMCDataScanner.cxx +++ b/PWGUD/Tasks/diffMCDataScanner.cxx @@ -360,7 +360,7 @@ struct TrackTypes { } for (auto ii = 0; ii < nTypes; ii++) { if ((fwdtrack.trackType() & (1 << ii)) > 0) { - registry.get(HIST("FwdType"))->Fill((Double_t)(ii + 2), 0., 1.); + registry.get(HIST("FwdType"))->Fill(static_cast(ii + 2), 0., 1.); } } } diff --git a/PWGUD/Tasks/diffMCQA.cxx b/PWGUD/Tasks/diffMCQA.cxx index c6b1f650db2..9c32645a1bd 100644 --- a/PWGUD/Tasks/diffMCQA.cxx +++ b/PWGUD/Tasks/diffMCQA.cxx @@ -88,7 +88,7 @@ struct DiffMCQA { { maxdEdxTPC = 0.; maxdEdxTOF = 0.; - diffCuts = (DGCutparHolder)DGCuts; + diffCuts = DGCutparHolder(DGCuts); // add histograms for the different process functions if (context.mOptions.get("processMCTruth")) { diff --git a/PWGUD/Tasks/diffQA.cxx b/PWGUD/Tasks/diffQA.cxx index edecda89087..adc79e0c37f 100644 --- a/PWGUD/Tasks/diffQA.cxx +++ b/PWGUD/Tasks/diffQA.cxx @@ -98,7 +98,7 @@ struct DiffQA { // initialize global variables maxdEdxTPC = 0.; maxdEdxTOF = 0.; - diffCuts = (DGCutparHolder)DGCuts; + diffCuts = DGCutparHolder(DGCuts); // add histograms for the different process functions if (context.mOptions.get("processMain")) { diff --git a/PWGUD/Tasks/flowLongRangeCorrUpc.cxx b/PWGUD/Tasks/flowLongRangeCorrUpc.cxx index 465285bd039..e5766de17f2 100644 --- a/PWGUD/Tasks/flowLongRangeCorrUpc.cxx +++ b/PWGUD/Tasks/flowLongRangeCorrUpc.cxx @@ -115,9 +115,9 @@ struct FlowLongRangeCorrUpc { // make the filters and cuts. Filter trackFilter = (aod::udtrack::isPVContributor == true); Filter collisionFilter = (cfgGapSideMerge == true) - ? ((aod::udcollision::gapSide == (uint8_t)0 || aod::udcollision::gapSide == (uint8_t)1) && + ? ((aod::udcollision::gapSide == static_cast(0) || aod::udcollision::gapSide == static_cast(1)) && (aod::upcservice::truegapside == 0 || aod::upcservice::truegapside == 1)) - : ((aod::udcollision::gapSide == (uint8_t)cfgGapSide) && + : ((aod::udcollision::gapSide == static_cast(cfgGapSide)) && (aod::upcservice::truegapside == cfgGapSide)); using UDTracksFull = soa::Filtered>; diff --git a/PWGUD/Tasks/upcCandidateAnalyzer.cxx b/PWGUD/Tasks/upcCandidateAnalyzer.cxx index dcf23797803..50a80cc11dd 100644 --- a/PWGUD/Tasks/upcCandidateAnalyzer.cxx +++ b/PWGUD/Tasks/upcCandidateAnalyzer.cxx @@ -608,7 +608,7 @@ struct UpcCandAnalyzer { const auto& cand = eventCandidates.iteratorAt(candID); const auto& tr1 = fwdTracks.iteratorAt(trId1); const auto& tr2 = fwdTracks.iteratorAt(trId2); - processCandidate<0>(cand, tr1, tr2, &mcParticles, (o2::aod::UDMcTrackLabels*)nullptr, &mcFwdTrackLabels); + processCandidate<0>(cand, tr1, tr2, &mcParticles, nullptr, &mcFwdTrackLabels); } } @@ -629,7 +629,7 @@ struct UpcCandAnalyzer { const auto& cand = eventCandidates.iteratorAt(candID); const auto& tr1 = fwdTracks.iteratorAt(trId1); const auto& tr2 = fwdTracks.iteratorAt(trId2); - processCandidate<0>(cand, tr1, tr2, (o2::aod::UDMcParticles*)nullptr, (o2::aod::UDMcTrackLabels*)nullptr, (o2::aod::UDMcFwdTrackLabels*)nullptr); + processCandidate<0>(cand, tr1, tr2, nullptr, nullptr, nullptr); } } @@ -687,7 +687,7 @@ struct UpcCandAnalyzer { const auto& cand = eventCandidates.iteratorAt(candID); const auto& tr1 = fwdTracks.iteratorAt(trId1); const auto& tr2 = barTracks.iteratorAt(trId2); - processCandidate<1>(cand, tr1, tr2, (o2::aod::UDMcParticles*)nullptr, (o2::aod::UDMcTrackLabels*)nullptr, (o2::aod::UDMcFwdTrackLabels*)nullptr); + processCandidate<1>(cand, tr1, tr2, nullptr, nullptr, nullptr); } } @@ -713,7 +713,7 @@ struct UpcCandAnalyzer { const auto& cand = eventCandidates.iteratorAt(candID); const auto& tr1 = barTracks.iteratorAt(trId1); const auto& tr2 = barTracks.iteratorAt(trId2); - processCandidate<2>(cand, tr1, tr2, &mcParticles, &mcTrackLabels, (o2::aod::UDMcFwdTrackLabels*)nullptr); + processCandidate<2>(cand, tr1, tr2, &mcParticles, &mcTrackLabels, nullptr); } } @@ -734,7 +734,7 @@ struct UpcCandAnalyzer { const auto& cand = eventCandidates.iteratorAt(candID); const auto& tr1 = barTracks.iteratorAt(trId1); const auto& tr2 = barTracks.iteratorAt(trId2); - processCandidate<2>(cand, tr1, tr2, (o2::aod::UDMcParticles*)nullptr, (o2::aod::UDMcTrackLabels*)nullptr, (o2::aod::UDMcFwdTrackLabels*)nullptr); + processCandidate<2>(cand, tr1, tr2, nullptr, nullptr, nullptr); } } diff --git a/PWGUD/Tasks/upcMft.cxx b/PWGUD/Tasks/upcMft.cxx index 6349589e6b4..18bb62bb7ea 100644 --- a/PWGUD/Tasks/upcMft.cxx +++ b/PWGUD/Tasks/upcMft.cxx @@ -127,7 +127,7 @@ struct UpcMftRec { o2::base::Propagator::initFieldFromGRP(grpmag); // for some reason this is necessary for the next next line runNumber = bc.runNumber(); - o2::field::MagneticField* field = static_cast(TGeoGlobalMagField::Instance()->GetField()); + o2::field::MagneticField* field = dynamic_cast(TGeoGlobalMagField::Instance()->GetField()); Bz = field->getBz(centerMFT); // gives error if the propagator is not initFielded LOG(info) << "The field at the center of the MFT is Bz = " << Bz; diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx index 6503f39c085..36b8d605947 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx @@ -447,7 +447,7 @@ struct UpcPhotonuclearAnalysisJMG { if (useEnergyZN && !((collision.energyCommonZNA() < cutGapAMyEnergyZNA) && (collision.energyCommonZNC() >= cutGapAMyEnergyZNC))) { return false; } // 0n - A side && Xn - C Side - if (useGapSideVariable && collision.gapSide() != uint8_t(0)) { + if (useGapSideVariable && collision.gapSide() != static_cast(0)) { return false; } if (useFV0 && collision.totalFV0AmplitudeA() > cutGapAFV0Amplitude) { @@ -464,7 +464,7 @@ struct UpcPhotonuclearAnalysisJMG { if (useEnergyZN && !((collision.energyCommonZNA() >= cutGapCMyEnergyZNA) && (collision.energyCommonZNC() < cutGapCMyEnergyZNC))) { return false; } // Xn - A side && 0n - C Side - if (useGapSideVariable && collision.gapSide() != uint8_t(1)) { + if (useGapSideVariable && collision.gapSide() != static_cast(1)) { return false; } if (useFT0CGapC && (collision.totalFT0AmplitudeC() > cutGapCMyAmplitudeFT0C)) { @@ -1007,8 +1007,8 @@ struct UpcPhotonuclearAnalysisJMG { return; } histos.fill(HIST("Events/hCollisionsFlow"), 11); - bool cutGapSideAVariable = useGapSideVariable && reconstructedCollision.gapSide() != uint8_t(0); - bool cutGapSideCVariable = useGapSideVariable && reconstructedCollision.gapSide() != uint8_t(1); + bool cutGapSideAVariable = useGapSideVariable && reconstructedCollision.gapSide() != static_cast(0); + bool cutGapSideCVariable = useGapSideVariable && reconstructedCollision.gapSide() != static_cast(1); if (cutGapSideAVariable || cutGapSideCVariable) { return; } diff --git a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx index 7e4996c13ba..7352dafee7c 100644 --- a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx +++ b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx @@ -538,13 +538,13 @@ struct upcQuarkoniaCentralBarrel { // Check the number of Protons and antiProtons // needs at least 1 of each if (!buildSameSignPairs && nProtons >= 1 && nAntiProtons >= 1) { - buildProtonAntiProtonPairs(fullTracks, (TObject*)nullptr, selProtonIndices, selAntiProtonIndices, selGapSide); + buildProtonAntiProtonPairs(fullTracks, nullptr, selProtonIndices, selAntiProtonIndices, selGapSide); } if (buildSameSignPairs && nProtons > 1) { - buildProtonAntiProtonPairs(fullTracks, (TObject*)nullptr, selProtonIndices, selProtonIndices, selGapSide); + buildProtonAntiProtonPairs(fullTracks, nullptr, selProtonIndices, selProtonIndices, selGapSide); } if (buildSameSignPairs && nAntiProtons > 1) { - buildProtonAntiProtonPairs(fullTracks, (TObject*)nullptr, selAntiProtonIndices, selAntiProtonIndices, selGapSide); + buildProtonAntiProtonPairs(fullTracks, nullptr, selAntiProtonIndices, selAntiProtonIndices, selGapSide); } } diff --git a/PWGUD/Tasks/upcVmRof.cxx b/PWGUD/Tasks/upcVmRof.cxx index 985a9b1ab1d..715c573afb6 100644 --- a/PWGUD/Tasks/upcVmRof.cxx +++ b/PWGUD/Tasks/upcVmRof.cxx @@ -322,7 +322,7 @@ struct UpcVmRof { auto alppar = ccdb->getForTimeStamp>("ITS/Config/AlpideParam", sor); rofShift = alppar->roFrameBiasInBC; rofLength = alppar->roFrameLengthInBC; - rofPerOrbit = static_cast(o2::constants::lhc::LHCMaxBunches / rofLength); + rofPerOrbit = (o2::constants::lhc::LHCMaxBunches / rofLength); } //--------------------------------------------------------------------------------