32 std::vector<int>::const_iterator it = resfind.begin();
33 for( ; it != resfind.end(); ++it ) {
47 std::vector<double>::const_iterator it =
vars_.begin();
48 for( ; it !=
vars_.end(); ++it ) {
49 initpar.push_back(*it);
54 void setParameters(
double* Start,
double*
Step,
double* Mini,
double* Maxi,
int* ind, TString* parname,
55 const std::vector<double> & parCrossSection,
const std::vector<int> & parCrossSectionOrder,
56 const std::vector<int> & resfind )
61 double thisStep[] = {0.001, 0.001, 0.001, 0.001, 0.001};
62 TString thisParName[] = {
"cross section var 1",
63 "cross section var 2",
64 "cross section var 3",
65 "cross section var 4",
66 "cross section var 5"};
67 double thisMini[] = {0., 0., 0., 0., 0.};
68 double thisMaxi[] = {1000., 1000., 1000., 1000., 1000.};
73 ind[iPar] = parCrossSectionOrder[iPar];
77 for(
unsigned int iPar=0; iPar<
parNum_; ++iPar ) {
78 Start[iPar] =
vars_[iPar];
79 Step[iPar] = thisStep[iPar];
80 Mini[iPar] = thisMini[iPar];
81 Maxi[iPar] = thisMaxi[iPar];
82 parname[iPar] = thisParName[iPar];
88 bool releaseParameters( TMinuit & rmin,
const std::vector<int> & resfind,
const std::vector<int> & parfix,
89 const int * ind,
const int iorder,
const unsigned int shift )
92 unsigned int freeParNum = 0;
94 if( (parfix[shift+ipar]==0) && (ind[shift+ipar]<=iorder) && (resfind[ipar] == 1) ) {
98 if( freeParNum > 0 ) {
99 freeParNum = freeParNum - 1;
101 for(
unsigned int i=0;
i<freeParNum; ++
i ) {
102 rmin.Release( shift+
i );
128 partialProduct[
i] = std::accumulate(variables, variables +
i, 1., std::multiplies<double>());
129 norm += partialProduct[
i];
131 for(
unsigned int i=0;
i<parNum_+1; ++
i ) {
134 delete[] partialProduct;
137 std::vector<double> allRelativeCrossSections;
138 std::vector<int>::const_iterator it = resfind.begin();
139 int smallerVectorIndex = 0;
140 for( ; it != resfind.end(); ++it ) {
142 allRelativeCrossSections.push_back(0.);
146 ++smallerVectorIndex;
150 return allRelativeCrossSections;
163 double normalization = 0.;
164 for(
unsigned int ires = 0;
ires < resfind.size(); ++
ires ) {
165 if( resfind[
ires] ) {
166 normalization += crossSection[
ires];
169 if( normalization != 0. ) {
170 for(
unsigned int ires = 0;
ires < resfind.size(); ++
ires ) {
171 if( resfind[
ires] ) {
182 for(
unsigned int iVar = 0; iVar <
parNum_; ++iVar ) {
void setParameters(double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const std::vector< double > &parCrossSection, const std::vector< int > &parCrossSectionOrder, const std::vector< int > &resfind)
Initializes the arrays needed by Minuit.
void computeRelativeCrossSections(const std::vector< double > &crossSection, const std::vector< int > &resfind)
std::vector< double > vars_
std::vector< double > relativeCrossSectionVec_
bool releaseParameters(TMinuit &rmin, const std::vector< int > &resfind, const std::vector< int > &parfix, const int *ind, const int iorder, const unsigned int shift)
Use the information in resfind, parorder and parfix to release the N-1 variables. ...
unsigned int numberOfResonances_
void imposeConstraint()
Change of variables so that we move from N to N-1 variables using the constraint that Sum(x_i) = 1...
std::vector< double > relativeCrossSections(const double *variables, const std::vector< int > &resfind)
Perform a variable transformation from N-1 to relative cross sections.
CrossSectionHandler(const std::vector< double > &crossSection, const std::vector< int > &resfind)
static unsigned int const shift
tuple size
Write out results.
void addParameters(std::vector< double > &initpar)
Inputs the vars in a vector.