Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TestAnalysis.h

Go to the documentation of this file.
00001 // ================================================
00002 // TestAnalysis class descriptionn
00003 // ================================================
00004 //
00005 // THIS TEXT TO BE REPLACED BY ATLAS STANDARD FORMAT
00006 //
00007 // Namespace Atlfast::
00008 //
00009 // class: TestAnalysis
00010 //
00011 // Description: 
00012 //
00013 //  This is an Test Algorithm designed to show new users
00014 //  of Athena/Atlfast how to access and use Atlfast objects from
00015 //  the TES.
00016 //
00017 //
00018 // ................................................................
00019 //
00020 
00021 
00022 #ifndef __Atlfast_Test__
00023 #define __Atlfast_Test__
00024 
00025 // STL
00026 #include <string>
00027 #include <vector>
00028 
00029 // Athena/Gaudi 
00030 #include "GaudiKernel/ISvcLocator.h"
00031 #include "GaudiKernel/IAlgorithm.h"
00032 #include "GaudiKernel/Algorithm.h"
00033 #include "GaudiKernel/MsgStream.h"
00034 #include "GaudiKernel/DataObject.h"
00035 #include "GaudiKernel/ObjectVector.h"
00036 #include "GaudiKernel/IHistogram1D.h"
00037 #include "GaudiKernel/IHistogram2D.h"
00038 #include "GaudiKernel/IHistogramSvc.h"
00039 
00040 // Things needed for using MC truth information
00041 #include "HepMC/GenParticle.h"
00042 #include "AtlfastCode/HepMC_helper.h"
00043 
00044 // Things needed to use objects through the IKinematic interface
00045 #include "AtlfastCode/IKinematic.h"
00046 #include "AtlfastCode/KinematicHelper.h"
00047 
00048 // Atlfast output objects (and their collection types)
00049 #include "AtlfastCode/ReconstructedParticle.h"
00050 #include "AtlfastCode/ReconstructedParticleCollection.h"
00051 #include "AtlfastCode/Cell.h"
00052 #include "AtlfastCode/CellCollection.h"
00053 #include "AtlfastCode/Cluster.h"
00054 #include "AtlfastCode/ClusterCollection.h"
00055 #include "AtlfastCode/Track.h"
00056 #include "AtlfastCode/TrackCollection.h"
00057 #include "AtlfastCode/TesIO.h"
00058 
00059 
00060 
00061 //********************************************
00062 //Default for parameters of this algorithm
00063 //These can be overridden by job options.
00064 //Descriptions are given in the class declaration
00065 //********************************************
00066 
00067 #define DEFAULT_rCellIsolation       0.2  
00068 
00069 #define DEFAULT_particleLocation     "/Event/AtlfastIsolatedElectrons" 
00070 #define DEFAULT_cellLocation         "/Event/AtlfastCells" 
00071 #define DEFAULT_clusterLocation      "/Event/AtlfastClusters" 
00072 #define DEFAULT_trackLocation        "/Event/AtlfastTracks" 
00073 
00074 #define DEFAULT_histStart            1000
00075 
00076 
00077 
00078 //***************************************************************
00079 //                 TestAnalysis class declaration
00080 //
00081 // An "Athena algorithm" is something which gets scheduled and controlled
00082 // by the framework. In its simplest definition it is something which
00083 //  - gets called for each event 
00084 //  - can get anything it wants out of the Transient Event Store"
00085 //  - can put anything it makes into the store.
00086 //
00087 // It must inherit from the  Algorithm base class
00088 //****************************************************************
00089 
00090 namespace Atlfast {
00095 class TestAnalysis : public Algorithm
00096 {
00097 
00098  public:
00099 
00100   //-------------------------
00101   // Constructors/Destructors
00102   //
00103   // Athena requires that the constructor takes certain arguments
00104   // (and passes them directly to the constructor of the base class)
00105   //-------------------------
00107   TestAnalysis( const std::string& name, ISvcLocator* pSvcLocator ) ; 
00109   virtual ~TestAnalysis();
00110 
00111 
00112   //------------------------------------------------------
00113   // Methods used by Athena to run the algorithm
00114   //------------------------------------------------------
00116   StatusCode initialize() ;
00118   StatusCode execute() ;
00120   StatusCode finalize() ;
00121 
00122 
00123 
00124  private:
00125 
00126   //---------------------------------------------------
00127   // Member variables
00128   //---------------------------------------------------
00129   TesIO* m_tesIO;
00131   IHistogram1D* m_hist_pT;
00132 
00134   IHistogram1D* m_hist_isolation;
00135 
00137   IHistogram2D* m_hist_cellFlow;
00138   IHistogram2D* m_hist_clusterFlow;
00139 
00140 
00141   //---------------------------------------------------
00142   // Parameters of this algorithm
00143   //---------------------------------------------------
00144 
00145   // Example of a parameter to be set via jobOptions.
00148   double        m_rCellIsolation;     
00149 
00151   std::string   m_particleLocation ;
00152   std::string   m_cellLocation ;
00153   std::string   m_clusterLocation ;
00154   std::string   m_trackLocation ;
00155 
00157   int m_histStart ;
00158 
00159 
00160   //-------------------------------
00161   // Objects used by this class to do its job
00162   //-------------------------------
00163 
00164   // This contains some trivial but oft used procedures
00165   // See the WWW documentation for details.
00167   KinematicHelper m_kinehelp ; 
00168 
00169 
00170 
00171   //-------------------------------
00172   // Private methods
00173   //-------------------------------
00174 
00175   /* To iterate through a collection of ReconstructedParticles and dump out
00176    * to the MsgStream specified, and also plot pT() */
00177   void dumpParticles( MsgStream&, 
00178                       std::vector<ReconstructedParticle*>& );
00179 
00181   void plotIsolation( MsgStream&, 
00182                       std::vector<ReconstructedParticle*>&, 
00183                       std::vector<Cell*>& );
00184 
00186   void plotEnergyFlow(  MsgStream&, 
00187                         std::vector<Cluster*>&, 
00188                         std::vector<Cell*>& );
00189 
00190 };
00191 
00192 } // end of namespace bracket
00193 
00194 
00195 #endif
00196 
00197 
00198 
00199 
00200 
00201 
00202 
00203 
00204 
00205 
00206 

Generated on Wed Jan 23 12:58:32 2002 for Atlfast by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001