Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PWGUD/AQC/udQC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("processMain")) {
Expand Down
2 changes: 1 addition & 1 deletion PWGUD/AQC/udQCmidRap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("processMain")) {
Expand Down
2 changes: 1 addition & 1 deletion PWGUD/AQC/udQcMuon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("processMain")) {
Expand Down
14 changes: 7 additions & 7 deletions PWGUD/TableProducer/DGBCCandProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>(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()) {
Expand All @@ -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<int32_t>(track.globalIndex()));
}
}

Expand Down Expand Up @@ -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<uint64_t>(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()) {
Expand All @@ -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<int32_t>(fwdTrack.globalIndex()));
}
}

Expand Down Expand Up @@ -385,7 +385,7 @@ struct DGBCCandProducer {

void init(InitContext& context)
{
diffCuts = (DGCutparHolder)DGCuts;
diffCuts = DGCutparHolder(DGCuts);

if (context.mOptions.get<bool>("processTinBCs")) {
registry.add("table/candCase", "#candCase", {HistType::kTH1F, {{4, -0.5, 3.5}}});
Expand Down
4 changes: 2 additions & 2 deletions PWGUD/TableProducer/SGCandProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions PWGUD/TableProducer/UPCCandidateProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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
Expand All @@ -2007,7 +2007,7 @@ struct UpcCandProducer {
createCandidatesCentral(barrelTracks, ambBarrelTracks,
bcs, collisions,
ft0s, fdds, fv0as, zdcs,
(o2::aod::McTrackLabels*)nullptr);
nullptr);
}

// MC processors
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion PWGUD/TableProducer/dgCandProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -610,7 +610,7 @@ struct UpcCandProducerGlobalMuon {
}
// Initialize FwdDCAFitter with magnetic field
if (fEnableMFT) {
o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
o2::field::MagneticField* field = dynamic_cast<o2::field::MagneticField*>(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;
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions PWGUD/TableProducer/upcCandProducerMuon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions PWGUD/TableProducer/upcCandProducerSemiFwd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion PWGUD/Tasks/dgCandAnalyzer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct DGCandAnalyzer {
// PDG
pdg = TDatabasePDG::Instance();

anaPars = (DGAnaparHolder)DGPars;
anaPars = DGAnaparHolder(DGPars);
pidsel.init(anaPars);
grsel.init(goodRunsFile);

Expand Down
2 changes: 1 addition & 1 deletion PWGUD/Tasks/diffMCDataScanner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ struct TrackTypes {
}
for (auto ii = 0; ii < nTypes; ii++) {
if ((fwdtrack.trackType() & (1 << ii)) > 0) {
registry.get<TH2>(HIST("FwdType"))->Fill((Double_t)(ii + 2), 0., 1.);
registry.get<TH2>(HIST("FwdType"))->Fill(static_cast<Double_t>(ii + 2), 0., 1.);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion PWGUD/Tasks/diffMCQA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("processMCTruth")) {
Expand Down
2 changes: 1 addition & 1 deletion PWGUD/Tasks/diffQA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("processMain")) {
Expand Down
4 changes: 2 additions & 2 deletions PWGUD/Tasks/flowLongRangeCorrUpc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>(0) || aod::udcollision::gapSide == static_cast<uint8_t>(1)) &&
(aod::upcservice::truegapside == 0 || aod::upcservice::truegapside == 1))
: ((aod::udcollision::gapSide == (uint8_t)cfgGapSide) &&
: ((aod::udcollision::gapSide == static_cast<uint8_t>(cfgGapSide)) &&
(aod::upcservice::truegapside == cfgGapSide));

using UDTracksFull = soa::Filtered<soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>>;
Expand Down
10 changes: 5 additions & 5 deletions PWGUD/Tasks/upcCandidateAnalyzer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion PWGUD/Tasks/upcMft.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
o2::field::MagneticField* field = dynamic_cast<o2::field::MagneticField*>(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;
Expand Down
8 changes: 4 additions & 4 deletions PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>(0)) {
return false;
}
if (useFV0 && collision.totalFV0AmplitudeA() > cutGapAFV0Amplitude) {
Expand All @@ -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<uint8_t>(1)) {
return false;
}
if (useFT0CGapC && (collision.totalFT0AmplitudeC() > cutGapCMyAmplitudeFT0C)) {
Expand Down Expand Up @@ -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<uint8_t>(0);
bool cutGapSideCVariable = useGapSideVariable && reconstructedCollision.gapSide() != static_cast<uint8_t>(1);
if (cutGapSideAVariable || cutGapSideCVariable) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion PWGUD/Tasks/upcVmRof.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ struct UpcVmRof {
auto alppar = ccdb->getForTimeStamp<o2::itsmft::DPLAlpideParam<0>>("ITS/Config/AlpideParam", sor);
rofShift = alppar->roFrameBiasInBC;
rofLength = alppar->roFrameLengthInBC;
rofPerOrbit = static_cast<int>(o2::constants::lhc::LHCMaxBunches / rofLength);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo the static_cast is not indeed needed here, but it is ill-coded anyway, because the result is not rounded, but truncated. We do not know the intentions of the author, maybe it is on purpose like that, so I would judge this as ok fix.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to add, in principle the truncation should not matter as one expects the LHCMaxBunches to be an integral multiple of ROF length. However, the ROF lenght is taken from a configuration file and hence it depends on human who writes the value there. A guard is missing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? rofLength is int regardless of what alppar->roFrameLengthInBC returns.

@rolavick rolavick Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, rofLength is always int, but the value is taken from a calibration file and can be, in principle, any integer. You have LHCMaxBunches = 3564 bunches and for PbPb we always had ROF of length 594. Then, your rofPerOrbit is exactly 6, which is what you want to learn here. But if someone makes a typo in the calibration file and write for example 595, then this code would return rofPerOrbit is 5. That does not look suspicious. The mistake would then propagate further, while not being easily trackable.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK, you meant that the task should have a sanity check verifying that LHCMaxBunches is divisible by rofLength. Thanks for the clarification.

rofPerOrbit = (o2::constants::lhc::LHCMaxBunches / rofLength);
}

//--------------------------------------------------------------------------------
Expand Down
Loading