Atlfast::TestTrackViewer Class Reference

#include <TestTrackViewer.h>

Collaboration diagram for Atlfast::TestTrackViewer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TestTrackViewer (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TestTrackViewer ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Member Functions

void testViewer (MsgStream &, std::vector< Track * > &)

Private Attributes

std::string m_trackLocation
int m_nevents
int m_ntracks
TesIOm_tesIO
std::string m_mcLocation

Detailed Description

This is an Test Algorithm designed to show new users of Athena/Atlfast how to access and use Atlfast objects from the TES.

Definition at line 66 of file TestTrackViewer.h.


Constructor & Destructor Documentation

Atlfast::TestTrackViewer::TestTrackViewer ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Athena-Algorithm Constructor

Definition at line 83 of file TestTrackViewer.cxx.

00085     : Algorithm( name, pSvcLocator ){
00086     
00087     // Setting the parameter defaults.
00088     m_trackLocation      = "/Event/AtlfastTracks";
00089     declareProperty( "TrackLocation",    m_trackLocation ) ;
00090     
00091   }

Atlfast::TestTrackViewer::~TestTrackViewer (  )  [virtual]

Default Constructor

Definition at line 94 of file TestTrackViewer.cxx.

00094                                     {
00095     MsgStream log( messageService(), name() ) ;
00096     log << MSG::INFO << "Destructor called" << endreq;
00097   } 


Member Function Documentation

StatusCode Atlfast::TestTrackViewer::initialize (  ) 

Standard Athena-Algorithm method

Definition at line 104 of file TestTrackViewer.cxx.

00104                                         {
00105     
00106     // We must here instantiate items which can only be made after
00107     // any job options have been set
00108     
00109     MsgStream log( messageService(), name() ) ;
00110     log << MSG::DEBUG << "Initialising" << endreq;
00111     HeaderPrinter hp("TestTrackViewer:",log);
00112     hp.add( "TrackLocation   ",   m_trackLocation ) ;
00113     hp.print();
00114 
00115     m_nevents = 0;
00116     m_ntracks = 0;
00117 
00118     GlobalEventData* ged = GlobalEventData::Instance();
00119     // load the location of the MC in StoreGate
00120     m_mcLocation       = ged -> mcLocation();
00121 
00122     //    m_tesIO = new TesIO(eventDataService());
00123     m_tesIO = new TesIO(m_mcLocation, ged->justHardScatter());
00124     
00125     return StatusCode::SUCCESS ;
00126   }

StatusCode Atlfast::TestTrackViewer::execute (  ) 

Standard Athena-Algorithm method

Definition at line 148 of file TestTrackViewer.cxx.

00148                                       {
00149     
00150     //................................
00151     // make a message logging stream 
00152     
00153     MsgStream log( messageService(), name() ) ;
00154     ++m_nevents;
00155     
00156     
00157     //.........................................................
00158     // This is how you extract the things you want to look at. 
00159     // Look at the userguide for details of ReconstructedParticle, Cell
00160     // and Cluster classes
00161     std::vector<Track*> tracks;
00162     if(!m_tesIO->copy<TrackCollection >(tracks, m_trackLocation)){
00163       log << MSG::DEBUG 
00164           << "No Tracks found in TES at " 
00165           << m_trackLocation 
00166           << endreq ;
00167     }else{
00168       log << MSG::DEBUG 
00169           << "No. of Tracks found in TES  = " 
00170           << tracks.size() 
00171           << endreq ;
00172     }
00173     
00174     //.........................................................
00175     // Here are example things you might do
00176     
00177     
00178     if( tracks.size() ) this->testViewer( log, tracks ) ;
00179     
00180     return StatusCode::SUCCESS ;
00181     
00182   }

StatusCode Atlfast::TestTrackViewer::finalize (  ) 

Standard Athena-Algorithm method

Definition at line 133 of file TestTrackViewer.cxx.

00133                                       {
00134     MsgStream log( messageService(), name() ) ;
00135     log << MSG::INFO << "Finalizing" << endreq;
00136     log<<  MSG::INFO  << "Events Processed: "<<m_nevents<<endreq;
00137     log<<  MSG::INFO  << "Tracks Processed: "<<m_ntracks<<endreq;
00138     return StatusCode::SUCCESS ;
00139   }

void Atlfast::TestTrackViewer::testViewer ( MsgStream &  ,
std::vector< Track * > &   
) [private]

Definition at line 189 of file TestTrackViewer.cxx.

00190                                                                {
00191     
00192     log << MSG::DEBUG << "Starting track view tester" << endreq ;
00193     
00194     
00195     
00196     // traverse collection of particles
00197     std::vector<Track*>::const_iterator track;
00198     
00199     for( track = tracks.begin(); track < tracks.end(); ++track ){
00200       
00201       log << MSG::DEBUG << *track << endreq;
00202       ++m_ntracks;
00203       TrackTrajectory traj = (*track)->trajectory();
00204       AtlfAna::AtlfTrackViewer trackViewer(*track);
00205       AtlfAna::ITrackParameterView& parameterView =  trackViewer;
00206       log<<MSG::DEBUG<<parameterView.trackParameters()<<endreq;
00207       const ITrackParameters& tp = parameterView.trackParameters();
00208       double eps = 0.0000001;
00209       TrackParameters testParam = (*track)->trajectory().parameters();
00210       ATL_ASSERT(abs( tp.eta()-testParam.eta() )                         < eps);
00211       ATL_ASSERT(abs( tp.phi()-testParam.phi() )                         < eps);
00212       ATL_ASSERT(abs( tp.cotTheta()-testParam.cotTheta() )               < eps);
00213       ATL_ASSERT(abs( tp.impactParameter()-testParam.impactParameter() ) < eps);
00214       ATL_ASSERT(abs( tp.zPerigee()-testParam.zPerigee() )               < eps);
00215       ATL_ASSERT(abs( tp.invPtCharge()-testParam.invPtCharge() )         < eps);
00216     }
00217     
00218   }


Member Data Documentation

std::string Atlfast::TestTrackViewer::m_trackLocation [private]

location within the TES to find collections of Atlfast output objects

Definition at line 106 of file TestTrackViewer.h.

int Atlfast::TestTrackViewer::m_nevents [private]

Definition at line 107 of file TestTrackViewer.h.

int Atlfast::TestTrackViewer::m_ntracks [private]

Definition at line 108 of file TestTrackViewer.h.

TesIO* Atlfast::TestTrackViewer::m_tesIO [private]

Definition at line 109 of file TestTrackViewer.h.

std::string Atlfast::TestTrackViewer::m_mcLocation [private]

Definition at line 111 of file TestTrackViewer.h.


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 14:19:42 2007 for AtlfastAlgs by  doxygen 1.5.1