|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "GaudiKernel/SystemOfUnits.h"
32 ISvcLocator* pSvcLocator ) :
57 return StatusCode::SUCCESS;
68 ATH_CHECK( previousDecisionsHandle.isValid() );
70 ATH_MSG_DEBUG(
"Running with " << previousDecisionsHandle->size() <<
" previous decisions" );
71 if( previousDecisionsHandle->size()!=1 ) {
72 ATH_MSG_ERROR(
"Previous decision handle size is not 1. It is" << previousDecisionsHandle->size() );
73 return StatusCode::FAILURE;
75 const Decision * previousDecision = previousDecisionsHandle->at(0);
80 for(
auto decisionID: previousDecisionIDs) {
ATH_MSG_VERBOSE(
" " << decisionID ); }
85 auto outputDecisions = outputHandle.
ptr();
92 ATH_MSG_DEBUG(
"dEdxTrk handle size: " << dEdxTrkHandle->size() );
97 ATH_MSG_DEBUG(
"dEdxHit handle size: " << dEdxHitHandle->size() );
102 if( dEdxTrksContainer ==
nullptr ) {
104 return StatusCode::FAILURE;
106 if( dEdxHitsContainer ==
nullptr ) {
108 return StatusCode::FAILURE;
112 auto HPtdEdxTrkContainer = std::make_unique<xAOD::TrigCompositeContainer>();
113 auto HPtdEdxTrkContainerAux = std::make_unique<xAOD::TrigCompositeAuxContainer>();
114 HPtdEdxTrkContainer->setStore(HPtdEdxTrkContainerAux.get());
121 ATH_MSG_DEBUG(
"nr of cands by createCandidates = " << n_cands );
123 std::vector<TrigdEdxTrackHypoTool::dEdxTrkHypoInfo> dEdxTrkHypoInputs;
125 for (
auto dedx : *dedxContainer ) {
134 dEdxTrkHypoInputs.push_back( hypoInfo );
147 while(
it != outputDecisions->end()) {
151 it = outputDecisions->erase(
it);
160 ATH_CHECK( HPtdEdxTrkHandle.
record( std::move( HPtdEdxTrkContainer ), std::move( HPtdEdxTrkContainerAux ) ) );
167 return StatusCode::SUCCESS;
180 auto monitorIt =
Monitored::Group(
m_monTool, monTrackdEdx, monTrackPtGeV, monTrackEta, monTracka0beam, monTrackNhighdEdxHits );
183 float trackPt = trk->getDetail<
float>(
"HPtdEdxTrk_pt");
184 float trackEta = trk->getDetail<
float>(
"HPtdEdxTrk_eta");
185 float tracka0beam = trk->getDetail<
float>(
"HPtdEdxTrk_a0beam");
186 float trackdEdx = trk->getDetail<
float>(
"HPtdEdxTrk_dedx");
187 int trackNhighdEdxHits = (
int)trk->getDetail<
int16_t>(
"HPtdEdxTrk_n_hdedx_hits_1p70");
188 monTrackPtGeV =
trackPt / 1000.0;
190 monTracka0beam = tracka0beam;
191 monTrackdEdx = trackdEdx;
192 monTrackNhighdEdxHits = trackNhighdEdxHits;
195 return StatusCode::SUCCESS;
210 float trackPt = trk->getDetail<
float>(
"dEdxTrk_pt");
211 float trackEta = trk->getDetail<
float>(
"dEdxTrk_eta");
212 float trackPhi = trk->getDetail<
float>(
"dEdxTrk_phi");
213 float tracka0beam = trk->getDetail<
float>(
"dEdxTrk_a0beam");
214 float trackdEdx = trk->getDetail<
float>(
"dEdxTrk_dedx");
215 int trackId = trk->getDetail<
int> (
"dEdxTrk_id");
216 ATH_MSG_VERBOSE(
"track pt / eta / a0beam / dEdx / Id = " <<
trackPt <<
" / " <<
trackEta <<
" / " << tracka0beam <<
" / " << trackdEdx <<
" / " << trackId );
218 std::vector<int16_t> n_hdedx_hits;
222 int id = hit->getDetail<
int>(
"dEdxHit_trkid");
223 if(
id != trackId )
continue;
224 float dedx = hit->getDetail<
float>(
"dEdxHit_dedx");
233 int16_t n_hits_innermost = (
int16_t)trk->getDetail<
int>(
"dEdxTrk_n_hits_innermost");
234 int16_t n_hits_inner = (
int16_t)trk->getDetail<
int>(
"dEdxTrk_n_hits_inner");
235 int16_t n_hits_pix = (
int16_t)trk->getDetail<
int>(
"dEdxTrk_n_hits_pix");
236 int16_t n_hits_sct = (
int16_t)trk->getDetail<
int>(
"dEdxTrk_n_hits_sct");
247 dedx->
setDetail<
float>(
"HPtdEdxTrk_a0beam",tracka0beam);
248 dedx->
setDetail<
float>(
"HPtdEdxTrk_dedx", trackdEdx);
260 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
Group
Properties of a chain group.
xAOD::TrigCompositeContainer DecisionContainer
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_dEdxTrkKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_HPtdEdxTrkKey
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
const std::string & hypoAlgNodeName()
const T * get(size_type n) const
Access an element, as an rvalue.
const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput() const
methods for derived classes to access handles of the base class input other read/write handles may be...
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_dEdxHitKey
StatusCode createCandidates(const xAOD::TrigCompositeContainer *, const xAOD::TrigCompositeContainer *, xAOD::TrigCompositeContainer *, int &) const
virtual StatusCode execute(const EventContext &context) const override
#define ATH_MSG_VERBOSE(x)
virtual StatusCode initialize() override
setScaleOne setStatusOne setSaturated int16_t
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput() const
methods for derived classes to access handles of the base class output other read/write handles may b...
bool isValid() const
Test to see if the link can be dereferenced.
ToolHandle< GenericMonitoringTool > m_monTool
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TrigdEdxTrackHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandleArray< TrigdEdxTrackHypoTool > m_hypoTools
StatusCode hypoBaseOutputProcessing(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
Base class function to be called once slice specific code has finished. Handles debug printing and va...
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
#define CHECK(...)
Evaluate an expression and check for errors.
Class used to describe composite objects in the HLT.
Header file to be included by clients of the Monitored infrastructure.
xAOD::TrigCompositeAuxContainer DecisionAuxContainer
bool trackPt(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
ElementLink implementation for ROOT usage.
const std::string & featureString()
std::vector< std::string > m_highdEdxHitDefNames
Hypothesis algorithms take the output of reco algorithms and the decision from the preceeding InputMa...
xAOD::TrigComposite Decision
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void makePrivateStore()
Create a new (empty) private store for this object.
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
std::vector< float > m_highdEdxHitDefThres
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
std::set< DecisionID > DecisionIDContainer
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
bool allFailed(const Decision *d)
return true if there is no positive decision stored
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Declare a monitored scalar variable.
StatusCode doMonitor(const xAOD::TrigCompositeContainer *) const
const std::string & viewString()
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)