00001 // $Header: /cvs/lcd/slic/include/LcioMcpPrinter.hh,v 1.18 2007/04/27 01:54:32 jeremy Exp $ 00002 00003 #ifndef SLIC_LCIOMCPPRINTER_HH 00004 #define SLIC_LCIOMCPPRINTER_HH 1 00005 00006 // lcio 00007 #include "EVENT/LCCollection.h" 00008 #include "EVENT/MCParticle.h" 00009 00010 // slic 00011 #include "LcioMcpManager.hh" 00012 00013 // std 00014 #include <map> 00015 00016 namespace slic 00017 { 00018 00023 class LcioMcpPrinter : public Module 00024 { 00025 public: 00026 00027 typedef std::vector<int> IdxVec; 00028 00029 public: 00030 00031 LcioMcpPrinter(); 00032 virtual ~LcioMcpPrinter(); 00033 00034 public: 00035 00036 void printMcpCollection(const std::string& collName, EVENT::LCCollection* coll); 00037 00038 protected: 00039 00040 /* Print from member vars */ 00041 void printMcpCollection(); 00042 00043 /* Print a single MCParticle line */ 00044 void printMcp(EVENT::MCParticle* mcp); 00045 00046 // str conv 00047 static std::string makeDoubleArray3String(const double*); 00048 static std::string makeFloatArray3String(const float*); 00049 static std::string makeSimStatusCodesString(EVENT::MCParticle* mcp); 00050 static std::string makeIdxVecString(const IdxVec&); 00051 00052 IdxVec findDaughterIndices(EVENT::MCParticle* mcp); 00053 IdxVec findParentIndices(EVENT::MCParticle* mcp); 00054 00055 // index of a particle (-1 for not found) 00056 int findMcpIndex(EVENT::MCParticle* mcp); 00057 00058 // formatting chunks 00059 inline void sep(); 00060 inline void line(); 00061 inline void head(); 00062 inline void foot(); 00063 00064 // column labels 00065 void colLabels(); 00066 00067 // flag labels 00068 void flagLabels(); 00069 00070 public: 00071 00072 static const int idx_width; 00073 static const int ptr_width; 00074 static const int pdg_width; 00075 static const int par_width; 00076 static const int dau_width; 00077 static const int mom_width; 00078 static const int vtx_width; 00079 static const int end_width; 00080 static const int time_width; 00081 static const int mass_width; 00082 static const int chrg_width; 00083 static const int e_width; 00084 static const int stat_width; 00085 static const int flags_width; 00086 00087 private: 00088 00089 EVENT::LCCollection* m_coll; 00090 std::string m_collName; 00091 }; 00092 } 00093 00094 #endif
1.5.4