Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

McKludgeValsTool.cxx

Go to the documentation of this file.
00001 
00007 // Include files
00008 
00009 #include "ValBase.h"
00010 
00011 // for the moment, this code doesn't need any external data
00012 // so I've commented out most of the includes
00013 
00014 #include "GaudiKernel/MsgStream.h"
00015 //#include "GaudiKernel/IDataProviderSvc.h"
00016 //#include "GaudiKernel/SmartDataPtr.h"
00017 //#include "GaudiKernel/SmartDataLocator.h"
00018 //#include "GaudiKernel/AlgTool.h"
00019 #include "GaudiKernel/ToolFactory.h"
00020 #include "GaudiKernel/IToolSvc.h"
00021 //#include "GaudiKernel/IParticlePropertySvc.h"
00022 //#include "GaudiKernel/ParticleProperty.h"
00023 
00024 
00031 class McKludgeValsTool : public ValBase
00032 {
00033 public:
00034     
00035     McKludgeValsTool( const std::string& type, 
00036         const std::string& name, 
00037         const IInterface* parent);
00038     
00039     virtual ~McKludgeValsTool() { }
00040     
00041     StatusCode initialize();
00042     
00043     StatusCode calculate();
00044     
00045 private:
00046        
00047     //Pure MC Tuple Items
00048     float MC_SourceId;
00049     float MC_Tkr1DirErr;
00050     float MC_Energy;
00051     float MC_DirErr;
00052     float MC_DirErrN;
00053     float MC_DirErrN1;
00054     float MC_XDir;
00055     float MC_YDir;
00056     float MC_ZDir;
00057 
00058 
00059     // to decode the particle charge
00060     //IParticlePropertySvc* m_ppsvc;    
00061 };
00062 
00063 // Static factory for instantiation of algtool objects
00064 static ToolFactory<McKludgeValsTool> s_factory;
00065 const IToolFactory& McKludgeValsToolFactory = s_factory;
00066 
00067 // Standard Constructor
00068 McKludgeValsTool::McKludgeValsTool(const std::string& type, 
00069                        const std::string& name, 
00070                        const IInterface* parent)
00071                        : ValBase( type, name, parent )
00072 {    
00073     // Declare additional interface
00074     declareInterface<IValsTool>(this); 
00075 }
00076 
00103 StatusCode McKludgeValsTool::initialize()
00104 {
00105     StatusCode sc = StatusCode::SUCCESS;
00106     
00107     MsgStream log(msgSvc(), name());
00108 
00109     if( ValBase::initialize().isFailure()) return StatusCode::FAILURE;
00110     
00111     /* 
00112     if( serviceLocator() ) {
00113         if( service("ParticlePropertySvc", m_ppsvc, true).isFailure() ) {
00114             log << MSG::ERROR << "Service [ParticlePropertySvc] not found" << endreq;
00115         }
00116     } else {
00117         return StatusCode::FAILURE;
00118     }
00119     */
00120     
00121     // load up the map
00122 
00123     addItem("McSourceId",     &MC_SourceId);
00124     addItem("McEnergy",       &MC_Energy);  
00125     addItem("McDirErr",       &MC_DirErr);      
00126     addItem("McTkr1DirErr",   &MC_Tkr1DirErr); 
00127     addItem("McDirErrN",      &MC_DirErrN);      
00128     addItem("McDirErrN1",     &MC_DirErrN1);      
00129     addItem("McXDir",         &MC_XDir);
00130     addItem("McYDir",         &MC_YDir);
00131     addItem("McZDir",         &MC_ZDir);
00132     
00133     zeroVals();
00134     
00135     return sc;
00136 }
00137 
00138 
00139 StatusCode McKludgeValsTool::calculate()
00140 {
00141     StatusCode sc = StatusCode::SUCCESS;
00142 
00143     MC_SourceId   = -1.0f;
00144     MC_Energy     = -1.0f;
00145     MC_DirErr     = -1.0f;
00146     MC_Tkr1DirErr = -1.0f;
00147     MC_DirErrN    = -1.0f;
00148     MC_DirErrN1   = -1.0f;
00149     MC_XDir       = -2.0f;
00150     MC_YDir       = -2.0f;
00151     MC_ZDir       = -2.0f;
00152 
00153    
00154     return sc;
00155 }
00156 

Generated on Wed Nov 26 14:03:21 2008 by doxygen 1.3.3