52 StatusCode
sc = StatusCode::SUCCESS;
53 if (
sc.isFailure()) { }
59 msg(MSG::FATAL) <<
"Could not retrieve "<<
m_trackSelector <<
" (to select the tracks which are to be counted) "<<
endmsg;
60 msg(MSG::INFO) <<
"Set the ToolHandle to None if track selection is supposed to be disabled" <<
endmsg;
72 return StatusCode::FAILURE;
76 return StatusCode::SUCCESS;
88 return StatusCode::SUCCESS;
97 StatusCode
sc = StatusCode::SUCCESS;
109 return StatusCode::FAILURE;
121 return StatusCode::FAILURE;
126 for (;trackIterator!=trackCollection->
end();++trackIterator) {
135 TrackTruthCollection::const_iterator truthIterator
136 = trackTruthCollection->find( trackIterator - (*trackCollection).begin() );
137 if ( truthIterator == trackTruthCollection->end() ){
138 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
"No matching truth particle found for track" <<
endmsg;
140 trackTruth = &((*truthIterator).second);
142 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
"Link to generated particle information is not there - assuming a lost G4 particle ('fake fake')." <<
endmsg;
150 if ( genParticle && genParticle->pdg_id() == 0 ) {
151 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
"Associated Particle ID " << genParticle->pdg_id()
152 <<
" does not conform to PDG requirements... ignore it!" <<
endmsg;
153 genParticle =
nullptr;
158 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
159 "Associated Particle ID: " << genParticle->pdg_id() <<
endmsg;
161 if ( genParticle->production_vertex() )
162 generatedTrackPerigee =
m_truthToTrack->makePerigeeParameters( genParticle );
166 bool track_has_trthits(
false);
168 = (*trackIterator)->trackStateOnSurfaces();
170 = currentTSOSList->
begin();
171 for (;itTSOS!=currentTSOSList->
end();++itTSOS) {
174 if (
id.is_valid() &&
m_idHelper->is_trt(
id)) {
175 track_has_trthits=
true;
179 const TrackParameters* reconstructedPerigee = (*trackIterator)->perigeeParameters();
181 if (generatedTrackPerigee !=
nullptr) {
183 if (!reconstructedPerigee)
return StatusCode::FAILURE;
185 double this_eta = reconstructedPerigee->
eta();
187 double truth_over_recP = generatedTrackPerigee->parameters()[
Trk::qOverP]
189 if ( (truth_over_recP > 0.9) && (truth_over_recP < 1.1)) {
194 if (track_has_trthits) {
201 }
else if ( (truth_over_recP > 0.8) && (truth_over_recP < 1.2) ) {
205 if (track_has_trthits) {
210 }
else if ( (truth_over_recP > 0.5) && (truth_over_recP < 1.5) ) {
213 if (track_has_trthits) {
222 delete generatedTrackPerigee;
224 double this_eta = reconstructedPerigee->
eta();
234 return StatusCode::SUCCESS;
252 for (
unsigned int iref=100; iref<
m_nHundred[
iAll]; iref*=10, ++iw, d+=
" ") {}
253 std::cout <<
"---------------------------------------------------------------------------------" << std::endl;
254 std::cout <<
" "<< name() <<
" results "
255 << (
m_trackSelector.empty() ?
" " :
"(with track selection)") << std::endl;
256 std::cout <<
"---------------------------------------------------------------------------------" << std::endl;
257 std::cout <<
" q/p truth vicinity -- Any "<<d<<
" 50% "<<d<<
" 20% "<<d<<
" 10%"<<d<<
"noTruth " << std::endl;
258 std::cout <<
"---------------------------------------------------------------------------------" << std::endl;
259 std::cout <<
" total (Si+TRT) :" << std::setiosflags(std::ios::dec) << std::setw(iw+1)
261 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
263 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
265 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
267 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
270 std::cout <<
" barrel (Si+TRT) :" << std::setiosflags(std::ios::dec) << std::setw(iw+1)
272 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
274 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
276 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
278 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
281 std::cout <<
" transition :" << std::setiosflags(std::ios::dec) << std::setw(iw+1)
283 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
285 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
287 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
289 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
292 std::cout <<
" endcap (Si+TRT) :" << std::setiosflags(std::ios::dec) << std::setw(iw+1)
294 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
296 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
298 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
300 << std::setiosflags(std::ios::dec) << std::setw(iw+1)
303 std::cout <<
"---------------------------------------------------------------------------------" << std::endl << std::endl;
Scalar eta() const
pseudorapidity method
#define ATH_MSG_VERBOSE(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Extrapolation for HepMC particles.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool isValid() const
Validity check.
HepMC::ConstGenParticlePtr cptr() const
Dereference.
HepMC::ConstGenParticlePtr scptr() const
Dereference/smart pointer.
MC particle associated with a reco track + the quality of match.
const HepMcParticleLink & particleLink() const
This class is the pure abstract base class for all fittable tracking measurements.
double eta() const
Access method for pseudorapidity - from momentum.
std::vector< unsigned int > m_tTen
std::vector< unsigned int > m_tFifty
std::string m_inputTrackCollection
properties from JobOptions:
void printTable() const
method: make the output table
std::vector< unsigned int > m_nHundred
counters
std::vector< unsigned int > m_nTwenty
static void monitorTrackFits(std::vector< unsigned int > &, const double &)
const AtlasDetectorID * m_idHelper
RecMomentumQualityValidation(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
std::vector< unsigned int > m_tHundred
std::vector< unsigned int > m_tFakeOrLost
StatusCode execute()
standard Athena-Algorithm method
StatusCode finalize()
standard Athena-Algorithm method
ToolHandle< Trk::ITrackSelectorTool > m_trackSelector
Tool handle to Trk::ITrackSelectorTool.
std::vector< unsigned int > m_tTwenty
StatusCode initialize()
standard Athena-Algorithm method
std::vector< unsigned int > m_nFakeOrLost
~RecMomentumQualityValidation()
Default Destructor.
std::string m_trackTruthCollection
job option: the truth track collection name
std::vector< unsigned int > m_nFifty
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
Tool handle to Trk::ITruthToTrack tool.
std::vector< unsigned int > m_nTen
const GenParticle * ConstGenParticlePtr
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersBase< TrackParametersDim, Charged > TrackParameters