Skip to content
Snippets Groups Projects
Commit 7af0d4da authored by Chandler Robert Baker's avatar Chandler Robert Baker
Browse files

Merge branch 'rigEgammaFastElectronReAlgo_keep_faster_default_only' into '23.0'

TrigEgammaFastElectronReAlgo keep only the faster default

See merge request atlas/athena!64227
parents 37fa340c c8bbeb26
3 merge requests!64323Daily merge of 23.0 into main,!64286Daily merge of 23.0 into main,!64227TrigEgammaFastElectronReAlgo keep only the faster default
......@@ -28,7 +28,6 @@ def fastElectronFexAlgCfg(flags, name="EgammaFastElectronFex_1", rois="EMRoIs"):
CaloTrackdEoverPHigh=999.0,
RCalBarrelFace=1470.0*mm,
ZCalEndcapFace=3800.0*mm,
useCaloInfoInExtrap=flags.Trigger.egamma.useCaloInfoInExtrap,
ParticleCaloExtensionTool=extTool,
ElectronsName=recordable("HLT_FastElectrons"),
RoIs=rois,
......
......@@ -290,74 +290,38 @@ bool TrigEgammaFastElectronReAlgo::extrapolate(
const xAOD::TrigEMCluster* clus, const xAOD::TrackParticle* trk,
double& etaAtCalo, double& phiAtCalo) const {
if (m_useCaloInfoInExtrap) {
// use the provided EM cluster to "guide" the extrapolation
// 1st figure which layer we want to shoot at
// in this case we chose between EMB2 or EME2
// given the cluster.
std::vector<CaloSampling::CaloSample> samples;
if (clus->energy(CaloSampling::CaloSample::EME2) >
clus->energy(CaloSampling::CaloSample::EMB2)) {
samples.push_back(CaloSampling::CaloSample::EME2);
} else {
samples.push_back(CaloSampling::CaloSample::EMB2);
}
// create the surfaces we want to reach.
// Aka either a cylinder for EME2 or a disc for EMB2
std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
m_caloExtensionTool->caloSurfacesFromLayers(samples, clus->eta(),
caloDD);
// use the provided EM cluster to "guide" the extrapolation
// 1st figure which layer we want to shoot at
// in this case we chose between EMB2 or EME2
// given the cluster.
std::vector<CaloSampling::CaloSample> samples;
if (clus->energy(CaloSampling::CaloSample::EME2) >
clus->energy(CaloSampling::CaloSample::EMB2)) {
samples.push_back(CaloSampling::CaloSample::EME2);
} else {
samples.push_back(CaloSampling::CaloSample::EMB2);
}
// And then try to reach them
const auto extension = m_caloExtensionTool->surfaceCaloExtension(
ctx, trk->perigeeParameters(), samples, caloSurfaces,
Trk::nonInteracting);
// create the surfaces we want to reach.
// Aka either a cylinder for EME2 or a disc for EMB2
std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
m_caloExtensionTool->caloSurfacesFromLayers(samples, clus->eta(), caloDD);
if (extension.empty()) {
ATH_MSG_VERBOSE("extrapolator failed 1");
return false;
}
// We target exactly one EMB2 or EME2 (the vector has 1 entry if not empty)
etaAtCalo = extension[0].second->position().eta();
phiAtCalo = extension[0].second->position().phi();
// And then try to reach them
const auto extension = m_caloExtensionTool->surfaceCaloExtension(
ctx, trk->perigeeParameters(), samples, caloSurfaces,
Trk::nonInteracting);
ATH_MSG_VERBOSE("Hit sampling :" << extension.at(0).first << " at eta : "
<< etaAtCalo << " at phi : " << phiAtCalo);
} else {
// Do the extrapolation to the full calo volume with
// navigation and possible material effects. Then just pick
// the intersection with the EMB2/EME2 sample
CaloExtensionHelpers::LayersToSelect layersToSelect;
layersToSelect.insert(CaloSampling::CaloSample::EMB2);
layersToSelect.insert(CaloSampling::CaloSample::EME2);
// extrapolate track using tool
// get calo extension
std::unique_ptr<Trk::CaloExtension> caloExtension =
m_caloExtensionTool->caloExtension(ctx, *trk);
if (!caloExtension || caloExtension->caloLayerIntersections().empty()) {
ATH_MSG_VERBOSE("extrapolator failed 1");
return false;
}
// extract eta/phi in EM2
CaloExtensionHelpers::EtaPhiPerLayerVector intersections;
CaloExtensionHelpers::midPointEtaPhiPerLayerVector(
*caloExtension, intersections, &layersToSelect);
if (intersections.empty()) {
ATH_MSG_VERBOSE("extrapolator failed 2");
return false;
}
// pick the correct sample in case of ambiguity
std::tuple<CaloSampling::CaloSample, double, double> etaPhiTuple =
intersections.front();
if (intersections.size() == 2)
if (clus->energy(CaloSampling::CaloSample::EME2) >
clus->energy(CaloSampling::CaloSample::EMB2))
etaPhiTuple = intersections.back();
etaAtCalo = std::get<1>(etaPhiTuple);
phiAtCalo = std::get<2>(etaPhiTuple);
if (extension.empty()) {
ATH_MSG_VERBOSE("extrapolator failed 1");
return false;
}
// We target exactly one EMB2 or EME2 (the vector has 1 entry if not empty)
etaAtCalo = extension[0].second->position().eta();
phiAtCalo = extension[0].second->position().phi();
ATH_MSG_VERBOSE("Hit sampling :" << extension.at(0).first << " at eta : "
<< etaAtCalo << " at phi : " << phiAtCalo);
return true;
}
......@@ -90,10 +90,6 @@ class TrigEgammaFastElectronReAlgo : public AthReentrantAlgorithm {
Gaudi::Property<float> m_RCAL {this, "RCalBarrelFace", 1470.0*Gaudi::Units::mm , "Radius of inner face of the barrel calorimeter"};
Gaudi::Property<float> m_ZCAL {this, "ZCalEndcapFace", 3800.0*Gaudi::Units::mm, "z of the inner face of endcap calorimeter"};
Gaudi::Property<bool> m_useCaloInfoInExtrap{
this, "useCaloInfoInExtrap", true,
"use knowledge of the cluster in extrapolation"};
//
ToolHandle<Trk::IParticleCaloExtensionTool> m_caloExtensionTool{
this, "ParticleCaloExtensionTool",
......
......@@ -22,9 +22,6 @@ def createTrigEgammaConfigFlags():
flags.addFlag('Trigger.egamma.Calib.precCaloMVAVersion' , 'egammaMVACalib/online/v7')
flags.addFlag('Trigger.egamma.Calib.precEgammaMVAVersion', 'egammaMVACalib/online/v7')
# calo info in extrap
flags.addFlag('Trigger.egamma.useCaloInfoInExtrap', True) #(is default now)
return flags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment