48 return StatusCode::FAILURE;
71 return StatusCode::SUCCESS;
83 ATH_CHECK( trigElecColl.record (std::make_unique<xAOD::TrigElectronContainer>(),
84 std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
91 ATH_CHECK( trigDummyElecColl.record (std::make_unique<xAOD::TrigElectronContainer>(),
92 std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
98 if (roiCollection->size()==0) {
100 return StatusCode::SUCCESS;
106 <<
", Phi = " << (roiDescriptor)->
phi());
108 float calo_eta(999), calo_phi(999), calo_et(-1);
119 calo_eta = emCluster->
eta();
120 calo_phi = emCluster->
phi();
121 calo_et = emCluster->
et();
126 ATH_MSG_DEBUG(
"searching a matching track: loop over tracks");
132 if (tracks->size() == 0){
133 return StatusCode::SUCCESS;
136 size_t coll_size = tracks->size();
137 trigElecColl->reserve(coll_size);
140 std::vector<float> calotrkdeta_noextrap_mon;
147 auto caloTrackDEtaNoExtrapMon =
Monitored::Collection(
"CaloTrackdEtaNoExtrapMon", calotrkdeta_noextrap_mon );
149 auto mon =
Monitored::Group(
m_monTool, caloPtMon, trackPtMon, caloTrackDEtaMon, caloTrackDPhiMon, etOverPtMon, caloTrackDEtaNoExtrapMon );
156 trigDummyElecColl->push_back(trigDummyElec);
157 trigDummyElec->
init( 0, 0, 0, 0, clusEL, trackDummyEL);
166 for(
unsigned int track_index = 0; track_index < tracks->size(); track_index++)
179 float trkPt = std::abs((trkIter)->
pt());
180 float etoverpt = std::abs(calo_et/trkPt);
181 float calotrkdeta_noextrap = (trkIter)->
eta() - calo_eta;
183 double etaAtCalo=999.;
184 double phiAtCalo=999.;
186 if(!
extrapolate(ctx,*caloDD,emCluster,trkIter,etaAtCalo,phiAtCalo)){
192 " eta = " << etaAtCalo <<
" phi = " << phiAtCalo);
195 trigElecColl->push_back(trigElec);
198 etaAtCalo, phiAtCalo, etoverpt,
201 calotrkdeta_noextrap_mon.push_back(calotrkdeta_noextrap);
205 ATH_MSG_DEBUG(
"Apply cuts on track with index: "<<track_index);
211 ATH_MSG_DEBUG(
"Failed pre extrapolation calo track deta " << calotrkdeta_noextrap);
220 ATH_MSG_DEBUG(
"Failed pre extrapolation calo track deta for high et");
232 if(!
extrapolate(ctx,*caloDD,emCluster,trkIter,etaAtCalo,phiAtCalo)){
237 ATH_MSG_DEBUG(
"extrapolated eta/phi=" << etaAtCalo <<
"/" << phiAtCalo);
239 float dEtaCalo = std::abs(etaAtCalo - calo_eta);
246 float dPhiCalo = std::abs(phiAtCalo - calo_phi);
247 dPhiCalo = ( dPhiCalo <
M_PI ? dPhiCalo : 2*
M_PI - dPhiCalo );
262 " track index= " << track_index <<
" eta = " << etaAtCalo <<
" phi = " << phiAtCalo <<
263 " deta = " << dEtaCalo <<
"dphi = " << dPhiCalo);
265 trigElecColl->push_back(trigElec);
267 etaAtCalo, phiAtCalo, etoverpt,
272 <<
" dphi = " << dPhiCalo <<
" dphi = " << trigElec->
trkClusDphi()
273 <<
" caloEta = " << calo_eta <<
" caloEta = " << trigElec->
caloEta()
274 <<
" caloPhi = " << calo_phi <<
" calophi = " << trigElec->
caloPhi()
275 <<
" etaAtCalo = " << etaAtCalo <<
" etaAtCalo = " << trigElec->
trkEtaAtCalo()
276 <<
" phiAtCalo = " << phiAtCalo <<
" phiAtCalo = " << trigElec->
trkPhiAtCalo()
278 calotrkdeta_noextrap_mon.push_back(calotrkdeta_noextrap);
285 ATH_MSG_DEBUG(
"REGTEST: returning an xAOD::TrigElectronContainer with size "<< trigElecColl->size() <<
".");
287 return StatusCode::SUCCESS;
293 double& etaAtCalo,
double& phiAtCalo)
const {
299 std::vector<CaloSampling::CaloSample> samples;
300 if (clus->
energy(CaloSampling::CaloSample::EME2) >
301 clus->
energy(CaloSampling::CaloSample::EMB2)) {
302 samples.push_back(CaloSampling::CaloSample::EME2);
304 samples.push_back(CaloSampling::CaloSample::EMB2);
309 std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
317 if (extension.empty()) {
322 etaAtCalo = extension[0].second->position().eta();
323 phiAtCalo = extension[0].second->position().phi();
325 ATH_MSG_VERBOSE(
"Hit sampling :" << extension.at(0).first <<
" at eta : "
326 << etaAtCalo <<
" at phi : " << phiAtCalo);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
ElementLink()
Default constructor.
#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