Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/Service.h"
31 const std::string&
name ) :
44 ATH_CHECK( m_triggerTrkParticleName.initialize(
45 not m_triggerTrkParticleName.key().empty() ) );
49 return StatusCode::SUCCESS;
65 if(
r->composite() ) {
67 for(
unsigned i=
r->size() ;
i-- ; )
73 if(
r->isFullscan() )
return true;
77 bool contained_phi = (
r->phiMinus() <
r->phiPlus() ) ?
78 (
phi(
t) >
r->phiMinus() &&
phi(
t) <
r->phiPlus() ) :
79 (
phi(
t) >
r->phiMinus() ||
phi(
t) <
r->phiPlus() );
81 bool contained_zed = (
z0(
t) >
r->zedMinus() &&
z0(
t) <
r->zedPlus() );
85 bool contained_eta = (
eta(
t) <
r->etaPlus() &&
eta(
t) >
r->etaMinus() );
94 exitPoint_t exitPlus = getExitPoint(
r->zedPlus(),
r->etaPlus() );
95 exitPoint_t exitMinus = getExitPoint(
r->zedMinus(),
r->etaMinus() );
97 float cross0 =
exit.z * exitMinus.
r -
exit.r * exitMinus.
z;
98 float cross1 =
exit.z * exitPlus.
r -
exit.r * exitPlus.
z;
100 contained_eta = ( cross0>0 && cross1<0 ) ?
true :
false;
105 if( newphi < -999. )
return false;
107 if(
r->phiMinus() <
r->phiPlus() ) contained_phi &= ( newphi >
r->phiMinus() && newphi <
r->phiPlus() );
108 else contained_phi &= ( newphi >
r->phiMinus() || newphi <
r->phiPlus() );
110 if( contained_eta && contained_phi && contained_zed )
return true;
129 float pt,
float phi,
float r )
const {
135 float mqR = 10 *
pt / ( 2.99792458 * 2 );
136 float ratio = 0.5 *
r / mqR;
140 if( std::fabs(
ratio ) > 1 )
return -9999.;
143 newphi -= std::asin(
ratio );
146 while( newphi < -
M_PI ) newphi += 2 *
M_PI;
147 while( newphi >
M_PI ) newphi -= 2 *
M_PI;
157 float tz0,
float teta )
const {
160 float rexit(0.), zexit(0.);
161 const float maxRadius = 1000.;
162 const float maxZed = 2700.;
164 if ( teta < 0 ) zexit = -maxZed;
165 else if ( teta > 0 ) zexit = maxZed;
168 exitPoint.
r = maxRadius;
175 rexit = ( zexit - tz0 ) * tantheta;
178 if ( std::fabs(rexit) > maxRadius ) {
184 zexit = maxRadius / tantheta + tz0;
200 const std::vector< const T* >& tvec,
203 std::vector< const T* > selectedTracks;
205 for(
size_t it=0 ;
it<tvec.size() ;
it++ ) {
206 const T* thisTrack = tvec.at(
it);
207 if( accept<T>( *thisTrack,
r ) ) {
208 selectedTracks.push_back( thisTrack );
212 return selectedTracks;
216 template std::vector< const xAOD::TrackParticle* >
218 const std::vector< const xAOD::TrackParticle* >& tvec,
222 template std::vector< const xAOD::TruthParticle* >
224 const std::vector< const xAOD::TruthParticle* >& tvec,
231 std::vector< const xAOD::TrackParticle* >
233 const std::vector< const xAOD::TrackParticle* >& tvec,
242 m_trigDecTool->associateToEventView( handle, roiLink );
245 std::vector< const xAOD::TrackParticle* > selectedTrigTracks;
247 for( trkItr = trigTrkItrPair.first ; trkItr != trigTrkItrPair.second ; ++trkItr ) {
250 if(
std::find( tvec.begin(), tvec.end(), *trkItr ) == tvec.end() ) {
251 ATH_MSG_DEBUG(
"Trigger track does not pass quality selection. Skipping." );
254 selectedTrigTracks.push_back( *trkItr );
257 return selectedTrigTracks;
271 ISvcLocator* svcLoc = Gaudi::svcLocator();
272 SmartIF< ITrackAnalysisDefinitionSvc > trkAnaDefSvc(
273 svcLoc->service(
"TrkAnaDefSvc"+trkAnaColls.
anaTag() ) );
280 if( not m_triggerTrkParticleName.key().empty() ) {
289 if( trkAnaDefSvc->useOffline() ) {
298 if( trkAnaDefSvc->useTruth() ) {
310 return StatusCode::SUCCESS;
std::string printInfo(Stage stage=FULL, bool printVertex=true) const
print information about tracks in the collection(s)
StatusCode fillTrigTrackVec(const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
Trigger tracks.
Const iterator class for DataVector/DataList.
std::string find(const std::string &s)
return a remapped string
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
StatusCode accept(const xAOD::Muon *mu)
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
float pTsig(const U &p)
Accessor utility function for getting the value of signed pT.
const std::vector< const xAOD::TrackParticle * > & trigTrackVec(Stage stage=FULL)
Class to hold for each event collections needed in the TrkAnalsis.
StatusCode fillOfflTrackVec(const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
Offline tracks.
StatusCode fillTruthPartVec(const std::vector< const xAOD::TruthParticle * > &vec, Stage stage=FULL)
fill truth/offline/trigger track vector (TEST or REFERENCE)
Utility methods to access track/truth particles parmeters in a consitent way in this package.
float eta(const U &p)
Accessor utility function for getting the value of eta.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
const std::vector< const xAOD::TrackParticle * > & offlTrackVec(Stage stage=FULL)
ElementConstPointer cptr() const
Return a pointer to the referenced element.
const std::vector< const xAOD::TruthParticle * > & truthPartVec(Stage stage=FULL)
get truth/offline/trigger track vector (TEST or REFERENCE)
Class describing a TrackParticle.
const std::string & anaTag()
— Getter methods —