Skip to content

Commit c1faef8

Browse files
author
Laura Gansbartl
committed
Fixed Formating
1 parent 28bb6f0 commit c1faef8

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ struct Pi0EtaToGammaGammaMC {
278278
}
279279

280280
// In case override, don't proceed, please - no CCDB access required
281-
if (d_bz_input > -990) {
281+
constexpr float bzInput = -990.0f;
282+
if (d_bz_input > bzInput) {
282283
d_bz = d_bz_input;
283284
o2::parameters::GRPMagField grpmag;
284285
if (std::fabs(d_bz) > 1e-5) {
@@ -580,18 +581,19 @@ struct Pi0EtaToGammaGammaMC {
580581
TMCCollisions const& mccollisions, TMCParticles const& mcparticles,
581582
TLegs const& /*legs*/ = nullptr, TMatchedTracks const& matchedTracks = nullptr, TMatchedSecondaries const& matchedSecondaries = nullptr)
582583
{
583-
for (auto& collision : collisions) {
584+
for (auto const& collision : collisions) {
584585
initCCDB(collision);
585586
if ((pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPHOSPHOS || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) && !collision.alias_bit(triggerAliases::kTVXinPHOS)) {
586587
continue;
587588
}
588589

589590
float weight = 1.f;
591+
float weightThreshold = 1e-10;
590592
if constexpr (std::is_same_v<std::decay_t<TCollisions>, o2::soa::Filtered<o2::soa::Join<o2::soa::Join<o2::aod::PMEvents, o2::aod::EMEventsAlias, o2::aod::EMEventsMult_000, o2::aod::EMEventsCent_000, o2::aod::EMMCEventLabels>, o2::aod::EMEventsWeight>>>) {
591593
weight = collision.weight();
592594
}
593595

594-
if (eventcuts.onlyKeepWeightedEvents && std::fabs(weight - 1.0) < 1e-10) {
596+
if (eventcuts.onlyKeepWeightedEvents && std::fabs(weight - 1.0) < weightThreshold) {
595597
continue;
596598
}
597599

@@ -728,9 +730,9 @@ struct Pi0EtaToGammaGammaMC {
728730
}
729731

730732
if (g1mc.globalIndex() == g2mc.globalIndex()) {
731-
if (o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(g1mc, mcparticles) == 111)
733+
if (o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(g1mc, mcparticles) == PDG_t::kPi0)
732734
fRegistry.fill(HIST("Pair/Pi0/hs_FromSameGamma"), v12.M(), v12.Pt(), wpair);
733-
else if (o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(g1mc, mcparticles) == 221)
735+
else if (o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(g1mc, mcparticles) == o2::constants::physics::Pdg::kEta)
734736
fRegistry.fill(HIST("Pair/Eta/hs_FromSameGamma"), v12.M(), v12.Pt(), wpair);
735737
continue;
736738
}
@@ -807,7 +809,7 @@ struct Pi0EtaToGammaGammaMC {
807809
int photon2pdg = photon2.pdgCode();
808810
int photon2mothid = photon2.mothersIds()[0];
809811
auto photon2moth = mcparticles.iteratorAt(photon2mothid);
810-
if (photon2pdg == 22 && (o2::aod::pwgem::photonmeson::utils::mcutil::isGammaGammaDecay(photon2moth, mcparticles))) {
812+
if (photon2pdg == PDG_t::kGamma && (o2::aod::pwgem::photonmeson::utils::mcutil::isGammaGammaDecay(photon2moth, mcparticles))) {
811813
int mothID = o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(photon2, mcparticles);
812814
if (mothID == o2::constants::physics::Pdg::kEta) {
813815
fRegistry.fill(HIST("Event/hNGGContamEta"), photon2moth.pt());
@@ -929,23 +931,24 @@ struct Pi0EtaToGammaGammaMC {
929931
// loop over mc stack and fill histograms for pure MC truth signals
930932
// all MC tracks which belong to the MC event corresponding to the current reconstructed event
931933

932-
for (auto& mccollision : mccollisions) {
934+
for (auto const& mccollision : mccollisions) {
933935
auto collision_per_mccoll = collisions.sliceBy(rec_perMcCollision, mccollision.globalIndex());
934936
int nrec_per_mc = collision_per_mccoll.size();
935937
fRegistry.fill(HIST("Event/hNrecPerMCCollision"), nrec_per_mc);
936938
}
937939

938-
for (auto& collision : collisions) {
940+
for (auto const& collision : collisions) {
939941
if ((pairtype == o2::aod::pwgem::photonmeson::photonpair::kPHOSPHOS || pairtype == o2::aod::pwgem::photonmeson::photonpair::kPCMPHOS) && !collision.alias_bit(triggerAliases::kTVXinPHOS)) {
940942
continue; // I don't know why this is necessary in simulation.
941943
}
942944

943945
float weight = 1.f;
946+
float weightTreshhold = 1e-10;
944947
if constexpr (std::is_same_v<std::decay_t<TCollisions>, o2::soa::Filtered<o2::soa::Join<o2::soa::Join<o2::aod::PMEvents, o2::aod::EMEventsAlias, o2::aod::EMEventsMult_000, o2::aod::EMEventsCent_000, o2::aod::EMMCEventLabels>, o2::aod::EMEventsWeight>>>) {
945948
weight = collision.weight();
946949
}
947950

948-
if (eventcuts.onlyKeepWeightedEvents && std::fabs(weight - 1.0) < 1e-10) {
951+
if (eventcuts.onlyKeepWeightedEvents && std::fabs(weight - 1.0) < weightTreshhold) {
949952
continue;
950953
}
951954

0 commit comments

Comments
 (0)