Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

TrackToTrgTrack.cpp

Go to the documentation of this file.
00001 #include "TrackToTrgTrack.h"
00002 
00003 #include "GaudiKernel/AlgFactory.h"
00004 #include "GaudiKernel/SmartDataPtr.h"
00005 #include "CLHEP/Units/SystemOfUnits.h"
00006 
00007 //-----------------------------------------------------------------------------
00008 // Implementation file for class : TrackToTrgTrack
00009 //
00010 // 13/01/2005 : Jose A. Hernando
00011 //-----------------------------------------------------------------------------
00012 
00013 // Declaration of the Algorithm Factory
00014 static const  AlgFactory<TrackToTrgTrack>           s_traToTrgTraFact ;
00015 const        IAlgFactory& TrackToTrgTrackFactory  = s_traToTrgTraFact ;
00016 
00017 
00018 TrackToTrgTrack::TrackToTrgTrack( const std::string& name,
00019                                   ISvcLocator* pSvcLocator)
00020   : GaudiAlgorithm ( name , pSvcLocator )
00021 {
00022 
00023   declareProperty( "TracksLocation" ,
00024                    m_tracksLocation = "/Event/Tracks" );
00025 
00026   declareProperty( "TrgTracksLocation" ,
00027                    m_trgTracksLocation  = "/Event/TrgTracks" );
00028 }
00029 
00030 TrackToTrgTrack::~TrackToTrgTrack() {};
00031 
00032 StatusCode TrackToTrgTrack::initialize() {
00033 
00034   // initialize the gaudi-algorithm
00035   StatusCode sc = GaudiAlgorithm::initialize();
00036   if ( sc.isFailure() ) return sc;
00037 
00038   info() << " -- parameters of TrackToTrgTrack -- " << endreq;
00039   info() << " Track input contaner "  << m_tracksLocation << endreq;
00040   info() << " TrgTrack output  container " << m_trgTracksLocation << endreq;
00041   info() << " ----------------------------------- " << endreq;
00042 
00043   return StatusCode::SUCCESS;
00044 }
00045 
00046 StatusCode TrackToTrgTrack::execute() {
00047   
00048   Tracks* tracks = get<Tracks>(m_tracksLocation);
00049 
00050   TrgTracks* gtracks = new TrgTracks();
00051 
00052   for (Tracks::const_iterator it = tracks->begin(); 
00053        it != tracks->end(); it++) {
00054     const Track& track = *(*it);
00055     TrgTrack* gtrack = new TrgTrack();
00056     TrgTrackConverter::toTrgTrack(track,*gtrack);
00057     gtracks->insert(gtrack);
00058     debug() << " Track: \t " << track << endreq;
00059     debug() << " TrgTrack: \t" << *gtrack << endreq;
00060   }
00061   
00062   // locate the tracks in the TES
00063   put(gtracks, m_trgTracksLocation);
00064 
00065   debug() << " # of Input Tracks " << tracks->size() << std::endl;
00066   debug() << " number of converted TrgTracks " << gtracks->size() << endreq;
00067 
00068   return StatusCode::SUCCESS;
00069   
00070 }
00071 
00072 StatusCode TrackToTrgTrack::finalize() {
00073   return StatusCode::SUCCESS;
00074 }
00075 

Generated on Fri May 27 13:59:37 2005 for New Track Event Model by doxygen 1.4.1