#ifndef _HCAmplitude_Chain_ #define _HCAmplitude_Chain_ #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" #include "particleType.h" #include "resonanceinfo.h" #include "HCAmplitude_Step.h" #include "TChannel_Basic.h" using namespace std; class Kinematics; class HCAmplitude_Chain : public UserAmplitude { public: HCAmplitude_Chain() : UserAmplitude(){} HCAmplitude_Chain(const vector& locArguments); string name() const{return "HCAmplitude_Chain";} complex calcAmplitude(GDouble** locKinematics) const; private: void ExtractInts_SingleUnderscore(string locInfoString, vector& locInfoVector); void ExtractInts_DoubleUnderscore(string locInfoString, vector >& locInfoVector); int BuildArray(const vector& locInputVector, int*& locArray) const; void Build_DecayAmplitudes(int locStepIndex, int locKidIndex, vector locCurrentHelicitiesTimes2, vector locCurrentJsTimes2, vector& locStepAmplitudes); void Create_DecayAmplitude(int locStepIndex, vector locCurrentHelicitiesTimes2, vector locCurrentJsTimes2, vector& locStepAmplitudes); bool Handle_HelicityDecursion(int& locStepIndex, deque& locResonanceHelicityIndices, deque& locResumeAtValues); void Find_AmplitudeIndices(const deque& locStepHelicityIndices); //For creating amplitude objects vector dExternalHelicitiesTimes2; vector dPIDs; vector dJXTimes2Vector; vector dL12Vector; vector dS12Times2Vector; vector dContractionIndexVector; vector > > dChainParticleIndices; deque > dChainAmplitudeIndices; //for HC-amplitude calculation int dNumSteps; int dNumAmplitudeCombos; int** dAmplitudeHelicityComboIndices; //2D: combo (size = dNumAmplitudeCombos), step (size = dNumSteps) int* dAmplitudeArrayPermutationSizes; //sizes of 2nd dimension of dDecayAmplitudes HCAmplitude_Step*** dDecayAmplitudes; //2D array of pointers: step (size = dNumSteps), permutation complex** dAmplitudeValues; //results of dDecayAmplitudes computations (has same size) //for other amplitude component calculations Amplitude* dOtherAmplitudeComponent; }; inline void HCAmplitude_Chain::ExtractInts_SingleUnderscore(string locInfoString, vector& locInfoVector) { 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 void HCAmplitude_Chain::ExtractInts_DoubleUnderscore(string locInfoString, vector >& locTotalInfoVector) { locTotalInfoVector.clear(); while(true) { size_t locDoubleUnderscoreIndex = locInfoString.find("__"); string locSubString = locInfoString.substr(0, locDoubleUnderscoreIndex); vector locInfoVector; ExtractInts_SingleUnderscore(locSubString, locInfoVector); locTotalInfoVector.push_back(locInfoVector); if(locDoubleUnderscoreIndex == string::npos) return; locInfoString = locInfoString.substr(locDoubleUnderscoreIndex + 2); } } inline int HCAmplitude_Chain::BuildArray(const vector& locInputVector, int*& locArray) const { 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