Skip to content
Snippets Groups Projects

Migrate CaloSinglePhotonAlg to ScalarTransformer

Merged Gerhard Raven requested to merge migrate-calo-singlephoton into future

NOTE: Rebased on top of !169 (merged) -- please make sure !169 (merged) is merged first, so this will be a single-commit instead of fifty commits... (and then delete this NOTE)

Use the scalar-to-vector adaptor of ScalarTransformer to do the loop over CaloClusters to create CaloHypos, only provide the scalar transform of CaloCluster to (optional) CaloHypo explicitly.

Merge request reports

Checking pipeline status.

Approval is optional

Merged by avatar (Jun 18, 2025 10:29am UTC)

Merge details

  • Changes merged into future with 32744204.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
190 continue ;
191 }
192 // check momentum after all corrections, and insert into container pass...
193 if( LHCb::CaloMomentum( hypo.get()).pt() >= m_eTcut ) hypos.insert ( hypo.release() ) ;
155 hypo.setHypothesis( LHCb::CaloHypo::Photon );
156 hypo.addToClusters( &cluster );
157 hypo.setPosition ( new LHCb::CaloPosition(cluster.position()) ); //@FIXME: why not CaloPosition by (optional) value?
194 158
195 } // end of the loop over all clusters
159 return boost::make_optional(
160 apply( m_corrections, hypo, "Error from Correction Tool, skip the cluster ", *this) && // loop over all corrections and apply corrections
161 apply( m_hypotools, hypo, "Error from Other Hypo Tool, skip the cluster ", *this) && // loop over other hypo tools (e.g. add extra digits)
162 apply( m_corrections2, hypo, "Error from Correction Tool 2 skip the cluster", *this) && // loop over all corrections and apply corrections
163 apply( m_hypotools2, hypo, "Error from Other Hypo Tool 2, skip the cluster", *this) && // loop over other hypo tools (e.g. add extra digits)
164 LHCb::CaloMomentum(&hypo).pt() >= m_eTcut, // check momentum after all corrections, and insert into container pass...
165 hypo );
  • Should switch from boost::optional to std::optional, or, in gcc 4.9, std::experimental::optional. The reason is that boost::make_optional accepts a const T& which will imply a copy in line 165. std::optional::make_optional on the other hand accepts T&& which implies we can std::move(hypo) here and avoid the copy...

  • Validation started with lhcb-future#103

  • Validation started with lhcb-future#104

  • Marco Cattaneo Status changed to merged

    Status changed to merged

  • Marco Cattaneo mentioned in commit 32744204

    mentioned in commit 32744204

  • Marco Cattaneo Mentioned in commit 32744204

    Mentioned in commit 32744204

  • Please register or sign in to reply
    Loading