46 return StatusCode::FAILURE;
69 return StatusCode::SUCCESS;
81 ATH_CHECK( trigElecColl.record (std::make_unique<xAOD::TrigElectronContainer>(),
82 std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
89 ATH_CHECK( trigDummyElecColl.record (std::make_unique<xAOD::TrigElectronContainer>(),
90 std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
96 if (roiCollection->size()==0) {
98 return StatusCode::SUCCESS;
104 <<
", Phi = " << (roiDescriptor)->
phi());
106 float calo_eta(999), calo_phi(999), calo_et(-1);
117 calo_eta = emCluster->
eta();
118 calo_phi = emCluster->
phi();
119 calo_et = emCluster->
et();
124 ATH_MSG_DEBUG(
"searching a matching track: loop over tracks");
130 if (tracks->size() == 0){
131 return StatusCode::SUCCESS;
134 size_t coll_size = tracks->size();
135 trigElecColl->reserve(coll_size);
138 std::vector<float> calotrkdeta_noextrap_mon;
145 auto caloTrackDEtaNoExtrapMon =
Monitored::Collection(
"CaloTrackdEtaNoExtrapMon", calotrkdeta_noextrap_mon );
147 auto mon =
Monitored::Group(
m_monTool, caloPtMon, trackPtMon, caloTrackDEtaMon, caloTrackDPhiMon, etOverPtMon, caloTrackDEtaNoExtrapMon );
154 trigDummyElecColl->push_back(trigDummyElec);
155 trigDummyElec->
init( 0, 0, 0, 0, clusEL, trackDummyEL);
164 for(
unsigned int track_index = 0; track_index < tracks->size(); track_index++)
177 float trkPt = std::abs((trkIter)->
pt());
178 float etoverpt = std::abs(calo_et/trkPt);
179 float calotrkdeta_noextrap = (trkIter)->
eta() - calo_eta;
181 double etaAtCalo=999.;
182 double phiAtCalo=999.;
184 if(!
extrapolate(ctx,*caloDD,emCluster,trkIter,etaAtCalo,phiAtCalo)){
190 " eta = " << etaAtCalo <<
" phi = " << phiAtCalo);
193 trigElecColl->push_back(trigElec);
196 etaAtCalo, phiAtCalo, etoverpt,
199 calotrkdeta_noextrap_mon.push_back(calotrkdeta_noextrap);
203 ATH_MSG_DEBUG(
"Apply cuts on track with index: "<<track_index);
209 ATH_MSG_DEBUG(
"Failed pre extrapolation calo track deta " << calotrkdeta_noextrap);
218 ATH_MSG_DEBUG(
"Failed pre extrapolation calo track deta for high et");
230 if(!
extrapolate(ctx,*caloDD,emCluster,trkIter,etaAtCalo,phiAtCalo)){
235 ATH_MSG_DEBUG(
"extrapolated eta/phi=" << etaAtCalo <<
"/" << phiAtCalo);
237 float dEtaCalo = std::abs(etaAtCalo - calo_eta);
244 float dPhiCalo = std::abs(phiAtCalo - calo_phi);
245 dPhiCalo = ( dPhiCalo <
M_PI ? dPhiCalo : 2*
M_PI - dPhiCalo );
260 " track index= " << track_index <<
" eta = " << etaAtCalo <<
" phi = " << phiAtCalo <<
261 " deta = " << dEtaCalo <<
"dphi = " << dPhiCalo);
263 trigElecColl->push_back(trigElec);
265 etaAtCalo, phiAtCalo, etoverpt,
270 <<
" dphi = " << dPhiCalo <<
" dphi = " << trigElec->
trkClusDphi()
271 <<
" caloEta = " << calo_eta <<
" caloEta = " << trigElec->
caloEta()
272 <<
" caloPhi = " << calo_phi <<
" calophi = " << trigElec->
caloPhi()
273 <<
" etaAtCalo = " << etaAtCalo <<
" etaAtCalo = " << trigElec->
trkEtaAtCalo()
274 <<
" phiAtCalo = " << phiAtCalo <<
" phiAtCalo = " << trigElec->
trkPhiAtCalo()
276 calotrkdeta_noextrap_mon.push_back(calotrkdeta_noextrap);
283 ATH_MSG_DEBUG(
"REGTEST: returning an xAOD::TrigElectronContainer with size "<< trigElecColl->size() <<
".");
285 return StatusCode::SUCCESS;
291 double& etaAtCalo,
double& phiAtCalo)
const {
297 std::vector<CaloSampling::CaloSample> samples;
298 if (clus->
energy(CaloSampling::CaloSample::EME2) >
299 clus->
energy(CaloSampling::CaloSample::EMB2)) {
300 samples.push_back(CaloSampling::CaloSample::EME2);
302 samples.push_back(CaloSampling::CaloSample::EMB2);
307 std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
315 if (extension.empty()) {
320 etaAtCalo = extension[0].second->position().eta();
321 phiAtCalo = extension[0].second->position().phi();
323 ATH_MSG_VERBOSE(
"Hit sampling :" << extension.at(0).first <<
" at eta : "
324 << etaAtCalo <<
" at phi : " << phiAtCalo);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
An algorithm that can be simultaneously executed in multiple threads.
This class provides the client interface for accessing the detector description information common to...
ElementLink implementation for ROOT usage.
index_type index() const
Get the index of the element inside of its container.
Group of local monitoring quantities and retain correlation when filling histograms
Gaudi::Property< float > m_calotrackdeoverp_high
SG::WriteHandleKey< xAOD::TrigElectronContainer > m_outputElectronsKey
static double getCaloPt(const xAOD::TrigElectron *el)
Gaudi::Property< float > m_calotrkdeta_noextrap_highet
Gaudi::Property< bool > m_acceptAll
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Gaudi::Property< float > m_trackPtthr_highet
SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_TrigEMClusterContainerKey
bool extrapolate(const EventContext &ctx, const CaloDetDescrManager &caloDD, const xAOD::TrigEMCluster *, const xAOD::TrackParticle *, double &, double &) const
Gaudi::Property< float > m_calotrkdeta_noextrap
TrigEgammaFastElectronReAlgo(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackParticleContainerKey
static double getTkPt(const xAOD::TrigElectron *el)
Gaudi::Property< float > m_calotrackdeoverp_low
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Gaudi::Property< float > m_trackPtthr
Gaudi::Property< float > m_calotrackdeta
SG::WriteHandleKey< xAOD::TrigElectronContainer > m_outputDummyElectronsKey
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< float > m_calotrackdphi
Gaudi::Property< float > m_clusEtthr
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
virtual unsigned int roiWord() const override final
Class describing a TrackParticle.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
float et() const
get Et (calibrated)
float eta() const
get Eta (calibrated)
float phi() const
get Phi (calibrated)
float energy() const
get Energy (calibrated)
float trkClusDeta() const
The absolute value of the track-calo eta measurement difference.
float trkEtaAtCalo() const
Get the track's pseudorapidity extrapolated to the calorimeter.
float trkPhiAtCalo() const
Get the track's azimuthal angle extrapolated to the calorimeter.
float etOverPt() const
Get for the electron.
float caloEta() const
Pseudorapidity ( ) of the electron in the calorimeter.
void init(uint32_t roi, float trkEtaAtCalo, float trkPhiAtCalo, float etOverPt, const EMClusterLink_t &clLink, const TrackParticleLink_t &tpLink)
Initialisation function, setting most properties of the object.
float caloPhi() const
Azimuthal angle ( ) of the electron in the calorimeter.
float trkClusDphi() const
The absolute value of the track-calo phi measurement difference.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrigElectron_v1 TrigElectron
Declare the latest version of the class.
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.
setTeId setLumiBlock roiId