#ifndef _TChannel_Basic_ #define _TChannel_Basic_ #include #include #include #include #include #include #include "CLHEP/Vector/LorentzVector.h" #include "CLHEP/Vector/LorentzRotation.h" #include "CLHEP/Vector/ThreeVector.h" #include "IUAmpTools/Amplitude.h" #include "IUAmpTools/AmpParameter.h" #include "IUAmpTools/UserAmplitude.h" using namespace std; class Kinematics; class TChannel_Basic : public UserAmplitude { public: TChannel_Basic() : UserAmplitude(){} TChannel_Basic(const vector& locArguments); string name() const{return "TChannel_Basic";} complex calcAmplitude(GDouble** pKin) const; void ExtractInts_SingleUnderscore(string locInfoString, vector& locInfoVector) const; int BuildArray(const vector& locInputVector, int*& locArray); private: //particle 4-vectors are sum of the particle indices set. if num == -1, is target int dNumParticleIndices; int* dParticleIndices; AmpParameter dTSlope; }; inline void TChannel_Basic::ExtractInts_SingleUnderscore(string locInfoString, vector& locInfoVector) const { locInfoVector.clear(); while(true) { size_t locUnderscoreIndex = locInfoString.find("_"); string locSubString = locInfoString.substr(0, locUnderscoreIndex); istringstream locTempStream(locSubString); int locInfoInt = -100; locTempStream >> locInfoInt; locInfoVector.push_back(locInfoInt); if(locUnderscoreIndex == string::npos) return; locInfoString = locInfoString.substr(locUnderscoreIndex + 1); } } inline int TChannel_Basic::BuildArray(const vector& locInputVector, int*& locArray) { locArray = new int[locInputVector.size()]; for(size_t loc_i = 0; loc_i < locInputVector.size(); ++loc_i) locArray[loc_i] = locInputVector[loc_i]; return locInputVector.size(); } #endif //_TChannel_Basic_