Newer
Older
Julian Pychy
committed
//************************************************************************//
// //
// Copyright 2013 Bertram Kopf (bertram@ep1.rub.de) //
// Julian Pychy (julian@ep1.rub.de) //
// - Ruhr-Universität Bochum //
// //
// This file is part of Pawian. //
// //
// Pawian is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Pawian is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Pawian. If not, see <http://www.gnu.org/licenses/>. //
// //
//************************************************************************//
// PbarpChannelEnv class definition file. -*- C++ -*-
// Copyright 2013 Julian Pychy
#include "Particle/ParticleTable.hh"
#include "Particle/Particle.hh"
#include "pbarpUtils/PbarpChannelEnv.hh"
Bertram Kopf
committed
#include "ConfigParser/pbarpParser.hh"
Julian Pychy
committed
#include "pbarpUtils/pbarpReaction.hh"
#include "pbarpUtils/pbarpHist.hh"
Julian Pychy
committed
#include "PwaUtils/GlobalEnv.hh"
#include "PwaUtils/AbsDecay.hh"
#include "PwaUtils/AbsDecayList.hh"
#include "PwaUtils/IsobarLSDecay.hh"
#include "PwaUtils/IsobarHeliDecay.hh"
#include "PwaUtils/IsobarTensorDecay.hh"
#include "ErrLogger/ErrLogger.hh"
PbarpChannelEnv::PbarpChannelEnv(pbarpParser* theParser) : AbsChannelEnv(theParser, AbsChannelEnv::CHANNEL_PBARP)
Julian Pychy
committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
,_lmax(0)
,_pbarMomentum(0)
,_theParser(theParser)
{
}
void PbarpChannelEnv::setup(ChannelID id){
AbsChannelEnv::setup(id);
//Antiproton momentum
_pbarMomentum = _theParser->getpbarMomentum();
double pMass=GlobalEnv::instance()->particleTable()->particle("proton")->mass();
double antipMass=GlobalEnv::instance()->particleTable()->particle("antiproton")->mass();
_initial4Vec = Vector4<double>(pMass+sqrt(antipMass*antipMass+_pbarMomentum*_pbarMomentum), 0., 0., _pbarMomentum);
//Lmax
_lmax=_theParser->getLMax();
// individual Lmax settings
std::vector<std::string> theDropPbarpLForParticles = _theParser->dropPbarpLForParticle();
for(auto ldropIt = theDropPbarpLForParticles.begin(); ldropIt != theDropPbarpLForParticles.end(); ++ldropIt){
std::string particle;
short l;
std::stringstream stringStr;
stringStr << (*ldropIt);
stringStr >> particle >> l;
_dropPbarpLForParticleData[particle].push_back(l);
}
std::vector<std::string>::const_iterator itStr;
//pbarp reaction
_pbarpReaction=std::shared_ptr<pbarpReaction>(new pbarpReaction(_producedParticlePairs, id,_lmax));
//fill prodDecayList
if(_theParser->productionFormalism()=="Cano"){
std::vector< std::shared_ptr<IsobarLSDecay> > prodDecs= _pbarpReaction->productionDecays();
std::vector< std::shared_ptr<IsobarLSDecay> >::iterator itDec;
for (itDec=prodDecs.begin(); itDec!=prodDecs.end(); ++itDec){
_prodDecList->addDecay(*itDec);
}
}
else if(_theParser->productionFormalism()=="Tensor"){
std::vector< std::shared_ptr<IsobarTensorDecay> > prodDecs= _pbarpReaction->productionTensorDecays();
std::vector< std::shared_ptr<IsobarTensorDecay> >::iterator itDec;
for (itDec=prodDecs.begin(); itDec!=prodDecs.end(); ++itDec){
_prodDecList->addDecay(*itDec);
}
}
else if(_theParser->productionFormalism()=="Heli"){
std::vector< std::shared_ptr<IsobarHeliDecay> > prodDecs= _pbarpReaction->productionHeliDecays();
std::vector< std::shared_ptr<IsobarHeliDecay> >::iterator itDec;
for (itDec=prodDecs.begin(); itDec!=prodDecs.end(); ++itDec){
_prodDecList->addDecay(*itDec);
}
}
else{
Alert <<"production formalism\t" << _theParser->productionFormalism() << "\t is not supported!!!" << endmsg;
exit(0);
}
//set prefactor for production and decay amplitudes
std::map<std::string, double>::iterator strDoubleIt;
for(strDoubleIt=_preFactorMap.begin(); strDoubleIt!=_preFactorMap.end(); ++strDoubleIt){
std::string currentAmplitudeName=strDoubleIt->first;
double currentPrefactor=strDoubleIt->second;
std::shared_ptr<AbsDecay> currentDec=_prodDecList->decay(currentAmplitudeName);
if(0!=currentDec){
currentDec->setPreFactor(currentPrefactor);
// Info << "Set prefactor " << currentPrefactor << " for amplitude " << currentAmplitudeName << endmsg;
currentDec->disableIsospin();
Info << "Disable isospin coupling and set prefactor " << currentPrefactor << " for amplitude " << currentAmplitudeName << endmsg;
}
else{
// look in decay amplitudes
currentDec=_absDecList->decay(currentAmplitudeName);
if(0!=currentDec){
currentDec->setPreFactor(currentPrefactor);
Info << "Set prefactor " << currentPrefactor << " for amplitude " << currentAmplitudeName << endmsg;
}
else{
Alert << "Amplitude with name\t" << currentAmplitudeName << "\tnot found!!!" << endmsg;
exit(0);
}
}
}
//set suffixes
std::vector<std::string> suffixVec = _theParser->replaceSuffixNames();
std::map<std::string, std::string> decSuffixNames;
for ( itStr = suffixVec.begin(); itStr != suffixVec.end(); ++itStr){
std::stringstream stringStr;
stringStr << (*itStr);
std::string classStr;
stringStr >> classStr;
std::string suffixStr;
stringStr >> suffixStr;
decSuffixNames[classStr]=suffixStr;
}
//set suffixes for decay classes
std::map<std::string, std::string>::iterator itMapStrStr;
for (itMapStrStr=decSuffixNames.begin(); itMapStrStr!=decSuffixNames.end(); ++itMapStrStr){
_absDecList->replaceSuffix(itMapStrStr->first, itMapStrStr->second);
_prodDecList->replaceSuffix(itMapStrStr->first, itMapStrStr->second);
// std::shared_ptr<IsobarDecay> theDec=_decList->decay(itMapStrStr->first);
}
//replace mass key
std::vector<std::string> replMassKeyVec = _theParser->replaceMassKey();
std::map<std::string, std::string> decRepMassKeyNames;
for ( itStr = replMassKeyVec.begin(); itStr != replMassKeyVec.end(); ++itStr){
std::stringstream stringStr;
stringStr << (*itStr);
std::string oldStr;
stringStr >> oldStr;
std::string newStr;
stringStr >> newStr;
decRepMassKeyNames[oldStr]=newStr;
}
for (itMapStrStr=decRepMassKeyNames.begin(); itMapStrStr!=decRepMassKeyNames.end(); ++itMapStrStr){
_absDecList->replaceMassKey(itMapStrStr->first, itMapStrStr->second);
}
//add dynamics
std::vector<std::shared_ptr<AbsDecay> > absDecList= _absDecList->getList();
std::vector<std::string> decDynVec = _theParser->decayDynamics();
for ( itStr = decDynVec.begin(); itStr != decDynVec.end(); ++itStr){
std::stringstream stringStr;
stringStr << (*itStr);
std::string particleStr;
stringStr >> particleStr;
std::string dynStr;
stringStr >> dynStr;
std::string tmpName;
std::vector<std::string> additionalStringVec;
while(stringStr >> tmpName){
additionalStringVec.push_back(tmpName);
}
std::vector<std::shared_ptr<AbsDecay> >::iterator itDec;
for (itDec=absDecList.begin(); itDec!=absDecList.end(); ++itDec){
std::string theDecName=(*itDec)->name();
std::string toFind=particleStr+"To";
size_t found;
found = theDecName.find(toFind);
if (found!=string::npos && found==0){
(*itDec)->enableDynamics(dynStr, additionalStringVec);
}
}
}
// spin density particles
_spinDensity = _theParser->spinDensityNames();
}
void PbarpChannelEnv::CreateHistInstance(std::shared_ptr<AbsLh> theLh, fitParams& theFitParams, std::string additionalSuffix){
pbarpHist(theLh, theFitParams, additionalSuffix);
}