EvtPto3PAmpFactory Class Reference

#include <EvtPto3PAmpFactory.hh>

Inheritance diagram for EvtPto3PAmpFactory:

EvtAmpFactory< EvtDalitzPoint > List of all members.

Public Member Functions

 EvtPto3PAmpFactory (const EvtDalitzPlot &dp)
 EvtPto3PAmpFactory (const EvtPto3PAmpFactory &other)
virtual ~EvtPto3PAmpFactory ()
virtual EvtAmpFactory< EvtDalitzPoint > * clone () const
virtual void processAmp (EvtComplex c, std::vector< std::string > vv, bool conj)
virtual void build (const EvtMultiChannelParser &parser, int nItg)
bool isCPModel () const
double dm () const
void setVerbose ()
EvtAmplitudeSum< EvtDalitzPoint > * getAmp () const
EvtAmplitude< EvtDalitzPoint > * getAmp (int i) const
EvtAmplitudeSum< EvtDalitzPoint > * getAmpConj () const
EvtPdfSum< EvtDalitzPoint > * getPC () const
EvtPdf< EvtDalitzPoint > * getPC (int i) const
const char * compName (int i) const
EvtComplex getCoeff (int i) const
double getTermCoeff (int i) const
double getTermCoeff (int type, int i, int j) const

Protected Attributes

EvtAmplitudeSum< EvtDalitzPoint > * _amp
EvtAmplitudeSum< EvtDalitzPoint > * _ampConj
EvtPdfSum< EvtDalitzPoint > * _pc
std::vector< std::string_names
double _dm
bool _verbose

Private Attributes

EvtDalitzPlot _dp

Detailed Description

Definition at line 27 of file EvtPto3PAmpFactory.hh.


Constructor & Destructor Documentation

EvtPto3PAmpFactory::EvtPto3PAmpFactory ( const EvtDalitzPlot dp  )  [inline]

Definition at line 31 of file EvtPto3PAmpFactory.hh.

Referenced by clone().

00032     : EvtAmpFactory<EvtDalitzPoint>(), _dp(dp)
00033   {}

EvtPto3PAmpFactory::EvtPto3PAmpFactory ( const EvtPto3PAmpFactory other  )  [inline]

Definition at line 34 of file EvtPto3PAmpFactory.hh.

00035     : EvtAmpFactory<EvtDalitzPoint>(other), _dp(other._dp)
00036   {}

virtual EvtPto3PAmpFactory::~EvtPto3PAmpFactory (  )  [inline, virtual]

Definition at line 37 of file EvtPto3PAmpFactory.hh.

00038   {}


Member Function Documentation

virtual void EvtAmpFactory< EvtDalitzPoint >::build ( const EvtMultiChannelParser parser,
int  nItg 
) [inline, virtual, inherited]

Definition at line 57 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_amp, EvtAmpFactory< T >::_ampConj, EvtAmpFactory< T >::_pc, EvtMultiChannelParser::amp(), EvtMultiChannelParser::ampCoef(), EvtMultiChannelParser::ampConj(), EvtMultiChannelParser::ampConjCoef(), EvtMultiChannelParser::getNAmp(), EvtMultiChannelParser::getNAmpConj(), genRecEmupikp::i, EvtAmpFactory< T >::processAmp(), and v.

00058   {
00059     _amp = new EvtAmplitudeSum<T>();
00060     _ampConj = new EvtAmplitudeSum<T>();
00061     _pc = new EvtPdfSum<T>();
00062 
00063     printf("Amplitude with %d terms\n",parser.getNAmp());
00064     int i;
00065     for(i=0;i<parser.getNAmp();i++) {
00066       
00067       std::vector<std::string> v = parser.amp(i);
00068       EvtComplex c = parser.ampCoef(i);
00069       processAmp(c,v);
00070     }
00071     
00072     printf("Conj. amplitude with %d terms\n",parser.getNAmpConj());
00073     for(i=0;i<parser.getNAmpConj();i++) {      
00074 
00075       std::vector<std::string> v = parser.ampConj(i);
00076       EvtComplex c = parser.ampConjCoef(i);
00077       processAmp(c,v,true);
00078     }
00079    
00080     printf("Calculating pole compensator integrals %d steps\n",nItg);
00081     if(nItg > 0) _pc->getItg(nItg);
00082  
00083     printf("End build\n");
00084   }

virtual EvtAmpFactory<EvtDalitzPoint>* EvtPto3PAmpFactory::clone (  )  const [inline, virtual]

Implements EvtAmpFactory< EvtDalitzPoint >.

Definition at line 40 of file EvtPto3PAmpFactory.hh.

References EvtPto3PAmpFactory().

00041   { 
00042     return new EvtPto3PAmpFactory(*this); 
00043   }

const char* EvtAmpFactory< EvtDalitzPoint >::compName ( int  i  )  const [inline, inherited]

Definition at line 99 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_names.

00099 { return _names[i].c_str(); }

double EvtAmpFactory< EvtDalitzPoint >::dm (  )  const [inline, inherited]

Definition at line 89 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_dm.

00089 { return _dm; }

EvtAmplitude<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::getAmp ( int  i  )  const [inline, inherited]

Definition at line 97 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_amp.

00097 { return _amp->getTerm(i); }

EvtAmplitudeSum<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::getAmp (  )  const [inline, inherited]

Definition at line 94 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_amp.

00094 { return _amp; }

EvtAmplitudeSum<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::getAmpConj (  )  const [inline, inherited]

Definition at line 95 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_ampConj.

00095 { return _ampConj; }

EvtComplex EvtAmpFactory< EvtDalitzPoint >::getCoeff ( int  i  )  const [inline, inherited]

Definition at line 101 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_amp.

00101 { return _amp->c(i); }

EvtPdf<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::getPC ( int  i  )  const [inline, inherited]

Definition at line 98 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_pc.

00098 { return _pc->getPdf(i); }

EvtPdfSum<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::getPC (  )  const [inline, inherited]

Definition at line 96 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_pc.

00096 { return _pc; }

double EvtAmpFactory< EvtDalitzPoint >::getTermCoeff ( int  type,
int  i,
int  j 
) const [inline, inherited]

Definition at line 104 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_amp, conj(), and imag().

00105   {
00106     switch(type) {
00107 
00108     case 0: return 2*real(_amp->c(i)*conj(_amp->c(j)));  //posre
00109     case 1: return -2*real(_amp->c(i)*conj(_amp->c(j))); //negre
00110     case 2: return -2*imag(_amp->c(i)*conj(_amp->c(j)));  //posim
00111     case 3: return 2*imag(_amp->c(i)*conj(_amp->c(j)));  //negim
00112     default: assert(0);
00113     }
00114   }

double EvtAmpFactory< EvtDalitzPoint >::getTermCoeff ( int  i  )  const [inline, inherited]

Definition at line 103 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_amp, and abs2().

00103 { return abs2(_amp->c(i)); }

bool EvtAmpFactory< EvtDalitzPoint >::isCPModel (  )  const [inline, inherited]

Definition at line 88 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_ampConj.

00088 { return (_ampConj->nTerms() > 0 ? true : false); } 

void EvtPto3PAmpFactory::processAmp ( EvtComplex  c,
std::vector< std::string vv,
bool  conj 
) [virtual]

Implements EvtAmpFactory< EvtDalitzPoint >.

Definition at line 42 of file EvtPto3PAmpFactory.cc.

References EvtAmpFactory< EvtDalitzPoint >::_amp, EvtAmpFactory< EvtDalitzPoint >::_ampConj, _dp, EvtAmpFactory< EvtDalitzPoint >::_names, EvtAmpFactory< EvtDalitzPoint >::_pc, EvtAmpFactory< EvtDalitzPoint >::_verbose, abs2(), EvtPdfSum< T >::addOwnedTerm(), EvtAmplitudeSum< T >::addOwnedTerm(), EvtCyclic3::c_str(), EvtId::getId(), EvtPDL::getId(), EvtPDL::getMeanMass(), EvtPDL::getSpinType(), EvtPDL::getWidth(), genRecEmupikp::i, EvtPto3PAmp::NBW, rb::R(), EvtPto3PAmp::RBW_CLEO, EvtPto3PAmp::RBW_KUEHN, EvtPto3PAmp::RBW_ZEMACH, EvtSpinType::SCALAR, EvtPto3PAmp::set_fb(), EvtPto3PAmp::set_fd(), EvtSpinType::SPIN3, EvtSpinType::SPIN4, deljobs::string, EvtCyclic3::strToPair(), EvtSpinType::TENSOR, type, and EvtSpinType::VECTOR.

00043 {
00044   if(_verbose) {
00045     
00046     printf("Make amplitude\n");
00047     unsigned i;
00048     for(i=0;i<vv.size();i++) printf("%s\n",vv[i].c_str());
00049     printf("\n");
00050   }
00051   
00052   EvtAmplitude<EvtDalitzPoint>* amp = 0;
00053   EvtPdf<EvtDalitzPoint>* pdf = 0;
00054   std::string name;
00055   
00056   int i;
00057   if(vv[0] == "PHASESPACE") {
00058     
00059     pdf = new EvtDalitzFlatPdf(_dp);
00060     amp = new EvtFlatAmp<EvtDalitzPoint>();
00061     name = "NR";
00062   }
00063   else if(vv[0] == "RESONANCE") {
00064 
00065     EvtPto3PAmp* partAmp = 0;
00066       
00067     // RESONANCE stanza
00068     
00069     Pair pairRes = strToPair(vv[1].c_str());
00070     EvtSpinType::spintype spinR;
00071     double mR, gR;      
00072     name = vv[2];
00073     EvtId resId = EvtPDL::getId(vv[2]);
00074     if(_verbose) printf("Particles %s form resonance %s\n",vv[1].c_str(),vv[2].c_str());
00075 
00076     // If no valid particle name is given, assume that 
00077     // it is the spin, the mass and the width of the particle.
00078       
00079     if(resId.getId() == -1) {
00080         
00081       switch(atoi(vv[2].c_str())) {
00082         
00083       case 0: { spinR = EvtSpinType::SCALAR; break; }
00084       case 1: { spinR = EvtSpinType::VECTOR; break; }
00085       case 2: { spinR = EvtSpinType::TENSOR; break; }
00086       case 3: { spinR = EvtSpinType::SPIN3; break; }
00087       case 4: { spinR = EvtSpinType::SPIN4; break; }
00088       default: { assert(0); break; }
00089       }
00090         
00091       mR = strtod(vv[3].c_str(),0);
00092       gR = strtod(vv[4].c_str(),0);
00093       i = 4;
00094     }
00095     else {
00096       
00097       // For a valid particle get spin, mass and width
00098       
00099       spinR = EvtPDL::getSpinType(resId);
00100       mR = EvtPDL::getMeanMass(resId);
00101       gR = EvtPDL::getWidth(resId);
00102       i = 2;
00103       
00104       // It's possible to specify mass and width of a particle 
00105       // explicitly
00106       
00107       if(vv[3] != "ANGULAR") {
00108         
00109         if(_verbose) 
00110           printf("Setting m(%s)=%s g(%s)=%s\n",
00111                  vv[2].c_str(),vv[3].c_str(),vv[2].c_str(),vv[4].c_str());
00112 
00113         mR = strtod(vv[3].c_str(),0);
00114         gR = strtod(vv[4].c_str(),0);
00115         i = 4;
00116       }
00117     }
00118     
00119     // ANGULAR stanza
00120     
00121     if(vv[++i] != "ANGULAR") {
00122 
00123       printf("%s instead of ANGULAR\n",vv[i].c_str());
00124       exit(0);
00125     }
00126     Pair pairAng = strToPair(vv[++i].c_str());
00127     if(_verbose) printf("Angle is measured between particles %s\n",vv[i].c_str());
00128       
00129     // TYPE stanza
00130     
00131     assert(vv[++i] == "TYPE");
00132     std::string type = vv[++i];
00133     if(_verbose) printf("Propagator type %s\n",vv[i].c_str());
00134     
00135     if(type == "NBW") {      
00136 
00137       EvtPropBreitWigner prop(mR,gR);
00138       partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::NBW);
00139     }
00140     else if(type == "RBW_ZEMACH") {
00141       
00142       EvtPropBreitWignerRel prop(mR,gR);
00143       partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_ZEMACH);
00144     }
00145     else if(type == "RBW_KUEHN") {
00146       
00147       EvtPropBreitWignerRel prop(mR,gR);
00148       partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_KUEHN);
00149     }
00150     else if(type == "RBW_CLEO") {
00151       
00152       EvtPropBreitWignerRel prop(mR,gR);
00153       partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_CLEO);
00154     }     
00155     else assert(0);
00156       
00157     // Optional DVFF, BVFF stanzas
00158     
00159     if(i < vv.size() - 1) {
00160       if(vv[i+1] == "DVFF") {   
00161         i++;
00162         if(vv[++i] == "BLATTWEISSKOPF") {
00163           
00164           double R = strtod(vv[++i].c_str(),0);
00165           partAmp->set_fd(R);
00166         }
00167         else assert(0);
00168       }
00169     }
00170       
00171     if(i < vv.size() - 1) {
00172       if(vv[i+1] == "BVFF") {   
00173         i++;
00174         if(vv[++i] == "BLATTWEISSKOPF") {
00175 
00176           if(_verbose) printf("BVFF=%s\n",vv[i].c_str());
00177           double R = strtod(vv[++i].c_str(),0);
00178           partAmp->set_fb(R);
00179         }
00180         else assert(0);
00181       }
00182     }
00183       
00184     i++;
00185     
00186     pdf = new EvtDalitzResPdf(_dp,mR,gR,pairRes);
00187     amp = partAmp;
00188   }
00189 
00190   assert(amp);
00191   assert(pdf);
00192 
00193   if(!conj) {
00194 
00195     _amp->addOwnedTerm(c,amp);
00196     _pc->addOwnedTerm(abs2(c),pdf);
00197   }
00198   else {
00199     
00200     _ampConj->addOwnedTerm(c,amp);
00201     delete pdf;
00202   }
00203   _names.push_back(name);
00204 }

void EvtAmpFactory< EvtDalitzPoint >::setVerbose (  )  [inline, inherited]

Definition at line 91 of file EvtAmpFactory.hh.

References EvtAmpFactory< T >::_verbose.

00091 { _verbose = true; }


Member Data Documentation

EvtAmplitudeSum<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::_amp [protected, inherited]

Definition at line 118 of file EvtAmpFactory.hh.

Referenced by processAmp().

EvtAmplitudeSum<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::_ampConj [protected, inherited]

Definition at line 119 of file EvtAmpFactory.hh.

Referenced by processAmp().

double EvtAmpFactory< EvtDalitzPoint >::_dm [protected, inherited]

Definition at line 123 of file EvtAmpFactory.hh.

EvtDalitzPlot EvtPto3PAmpFactory::_dp [private]

Definition at line 49 of file EvtPto3PAmpFactory.hh.

Referenced by processAmp().

std::vector<std::string> EvtAmpFactory< EvtDalitzPoint >::_names [protected, inherited]

Definition at line 121 of file EvtAmpFactory.hh.

Referenced by processAmp().

EvtPdfSum<EvtDalitzPoint >* EvtAmpFactory< EvtDalitzPoint >::_pc [protected, inherited]

Definition at line 120 of file EvtAmpFactory.hh.

Referenced by processAmp().

bool EvtAmpFactory< EvtDalitzPoint >::_verbose [protected, inherited]

Definition at line 124 of file EvtAmpFactory.hh.

Referenced by processAmp().


Generated on Tue Nov 29 23:19:14 2016 for BOSS_7.0.2 by  doxygen 1.4.7