120 {
121
122 char** tc = 0;
123
124
125
126
127 if (
v[0] == std::string(
"MAXPDF" ) )
128 {
129
130 _pdfMax = strtod(
v[1].
c_str(), tc );
131 if ( _pdfMax <= 0 )
132 {
133 printf( "Bad pdfMax=%f\n", _pdfMax );
134 assert( 0 );
135 }
136 }
137 else if (
v[0] == std::string(
"SCANPDF" ) ) { _nScan = atoi(
v[1].
c_str() ); }
138 else
139 {
140
141 printf( "Error parsing decay file\n" );
142 assert( 0 );
143 }
144
145
146
147 bool conjugate = false;
148 int i = 2;
150
151 while ( i <
v.size() )
152 {
153
154 int i0 = i;
155
156
157 if (
v[i] == std::string(
"CONJUGATE" ) )
158 {
159
160 assert( conjugate == false );
161 conjugate = true;
163 _dm = strtod(
v[i].
c_str(), tc );
164 i++;
165 }
166
167 std::vector<std::string> params;
168 EvtComplex c;
169 int format;
170
171 if ( !conjugate &&
v[i] == std::string(
"AMPLITUDE" ) )
172 {
173
174 while ( !
isKeyword(
v[++i] ) ) params.push_back(
v[i] );
175 _amp.push_back( params );
176
178 _ampCoef.push_back( c );
179 _coefFormat.push_back( format );
180 continue;
181 }
182 else if ( conjugate &&
v[i] == std::string(
"AMPLITUDE" ) )
183 {
184
185 while ( !
isKeyword(
v[++i] ) ) params.push_back(
v[i] );
186 _ampConj.push_back( params );
188 _ampConjCoef.push_back( c );
189 _coefConjFormat.push_back( format );
190 continue;
191 }
192 else
193 {
194
195 printf(
"Expect keyword, found parameter %s\n",
v[i].
c_str() );
196 assert( 0 );
197 }
198
199 assert( i > i0 );
200 }
201
202 printf( "PARSING SUCCESSFUL\n" );
203 printf( "%d amplitude terms\n", _amp.size() );
204 printf( "%d conj amplitude terms\n", _ampConj.size() );
205}
static void parseComplexCoef(int &i, const std::vector< std::string > &v, EvtComplex &c, int &format)
static bool isKeyword(const std::string &s)