|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/Service.h"
30 const std::string&
name ) :
43 ATH_CHECK( m_triggerTrkParticleName.initialize(
44 not m_triggerTrkParticleName.key().empty() ) );
48 return StatusCode::SUCCESS;
64 if(
r->composite() ) {
66 for(
unsigned i=
r->size() ;
i-- ; )
72 if(
r->isFullscan() )
return true;
76 bool contained_phi = (
r->phiMinus() <
r->phiPlus() ) ?
77 (
phi(
t) >
r->phiMinus() &&
phi(
t) <
r->phiPlus() ) :
78 (
phi(
t) >
r->phiMinus() ||
phi(
t) <
r->phiPlus() );
80 bool contained_zed = (
z0(
t) >
r->zedMinus() &&
z0(
t) <
r->zedPlus() );
84 bool contained_eta = (
eta(
t) <
r->etaPlus() &&
eta(
t) >
r->etaMinus() );
93 exitPoint_t exitPlus = getExitPoint(
r->zedPlus(),
r->etaPlus() );
94 exitPoint_t exitMinus = getExitPoint(
r->zedMinus(),
r->etaMinus() );
96 float cross0 =
exit.z * exitMinus.
r -
exit.r * exitMinus.
z;
97 float cross1 =
exit.z * exitPlus.
r -
exit.r * exitPlus.
z;
99 contained_eta = ( cross0>0 && cross1<0 ) ?
true :
false;
104 if( newphi < -999. )
return false;
106 if(
r->phiMinus() <
r->phiPlus() ) contained_phi &= ( newphi >
r->phiMinus() && newphi <
r->phiPlus() );
107 else contained_phi &= ( newphi >
r->phiMinus() || newphi <
r->phiPlus() );
109 if( contained_eta && contained_phi && contained_zed )
return true;
128 float pt,
float phi,
float r )
const {
134 float mqR = 10 *
pt / ( 2.99792458 * 2 );
135 float ratio = 0.5 *
r / mqR;
139 if( std::fabs(
ratio ) > 1 )
return -9999.;
142 newphi -= std::asin(
ratio );
145 while( newphi < -
M_PI ) newphi += 2 *
M_PI;
146 while( newphi >
M_PI ) newphi -= 2 *
M_PI;
156 float tz0,
float teta )
const {
159 float rexit(0.), zexit(0.);
160 const float maxRadius = 1000.;
161 const float maxZed = 2700.;
163 if ( teta < 0 ) zexit = -maxZed;
164 else if ( teta > 0 ) zexit = maxZed;
167 exitPoint.
r = maxRadius;
174 rexit = ( zexit - tz0 ) * tantheta;
177 if ( std::fabs(rexit) > maxRadius ) {
183 zexit = maxRadius / tantheta + tz0;
199 const std::vector< const T* >& tvec,
202 std::vector< const T* > selectedTracks;
204 for(
size_t it=0 ;
it<tvec.size() ;
it++ ) {
205 const T* thisTrack = tvec.at(
it);
206 if( accept<T>( *thisTrack,
r ) ) {
207 selectedTracks.push_back( thisTrack );
211 return selectedTracks;
215 template std::vector< const xAOD::TrackParticle* >
217 const std::vector< const xAOD::TrackParticle* >& tvec,
221 template std::vector< const xAOD::TruthParticle* >
223 const std::vector< const xAOD::TruthParticle* >& tvec,
230 std::vector< const xAOD::TrackParticle* >
240 m_trigDecTool->associateToEventView( handle, roiLink );
241 std::vector< const xAOD::TrackParticle* > selectedTrigTracks
242 (selTrigTrkItrPair.first, selTrigTrkItrPair.second);
244 return selectedTrigTracks;
258 ISvcLocator* svcLoc = Gaudi::svcLocator();
259 SmartIF<ITrackAnalysisDefinitionSvc> trkAnaDefSvc( svcLoc->service(
"TrkAnaDefSvc"+trkAnaColls.
anaTag() ) );
266 getTrigTracks( m_triggerTrkParticleName, roiLink ),
270 if( trkAnaDefSvc->useOffline() ) {
279 if( trkAnaDefSvc->useTruth() ) {
291 return StatusCode::SUCCESS;
StatusCode fillTrigTrackVec(const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
Trigger tracks.
Const iterator class for DataVector/DataList.
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.
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)
get 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)
std::string printInfo(Stage stage=FULL) const
print Information about tracks in the collection(s)
Class describing a TrackParticle.
const std::string & anaTag()
— Getter methods —