00001 //----------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: EvtMultiChannelParser.hh,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $ 00004 // 00005 // Environment: 00006 // This software is part of the EvtGen package developed jointly 00007 // for the BaBar and CLEO collaborations. If you use all or part 00008 // of it, please give an appropriate acknowledgement. 00009 // 00010 // Copyright Information: 00011 // Copyright (C) 1998 Caltech, UCSB 00012 // 00013 // Module creator: 00014 // Alexei Dvoretskii, Caltech, 2001-2002. 00015 //----------------------------------------------------------------------- 00016 00017 // Parse decay file tokens from a file or a vector 00018 00019 #ifndef EVT_MULTI_CHANNEL_PARSER 00020 #define EVT_MULTI_CHANNEL_PARSER 00021 00022 00023 #include <vector> 00024 #include <string> 00025 #include "EvtGenBase/EvtComplex.hh" 00026 00027 class EvtDecayMode; 00028 00029 enum {POLAR_RAD,POLAR_DEG,CARTESIAN}; 00030 00031 class EvtMultiChannelParser { 00032 00033 public: 00034 00035 EvtMultiChannelParser() : _pdfMax(-1.), _nScan(0), _dm(0.) {} 00036 ~EvtMultiChannelParser() {} 00037 00038 static EvtDecayMode getDecayMode(const char* file); 00039 00040 void parse(const char* file, const char* model); 00041 void parse(const std::vector<std::string>& v); 00042 00043 static void parseComplexCoef(int& i, const std::vector<std::string>& v, 00044 EvtComplex& c, int& format); 00045 static double parseRealCoef(int& i, const std::vector<std::string>& v); 00046 static bool isKeyword(const std::string& s); 00047 00048 inline double pdfMax() const { return _pdfMax; } 00049 inline int nScan() const { return _nScan; } 00050 inline double dm() const { return _dm; } 00051 00052 inline std::vector<std::string> amp(int i) const { return _amp[i]; } 00053 inline std::vector<std::string> ampConj(int i) const { return _ampConj[i]; } 00054 inline EvtComplex ampCoef(int i) const { return _ampCoef[i]; } 00055 inline EvtComplex ampConjCoef(int i) const { return _ampConjCoef[i]; } 00056 00057 inline int coefFormat(int i) const { return _coefFormat[i]; } 00058 inline int coefConjFormat(int i) const { return _coefConjFormat[i]; } 00059 00060 inline int getNAmp() const { return _amp.size(); } 00061 inline int getNAmpConj() const { return _ampConj.size(); } 00062 00063 private: 00064 00065 double _pdfMax; 00066 int _nScan; 00067 double _dm; 00068 00069 std::vector<std::vector<std::string> > _amp; 00070 std::vector<std::vector<std::string> > _ampConj; 00071 std::vector<EvtComplex> _ampCoef; 00072 std::vector<int> _coefFormat; 00073 std::vector<EvtComplex> _ampConjCoef; 00074 std::vector<int> _coefConjFormat; 00075 }; 00076 00077 #endif 00078 00079 00080 00081 00082