25 class TestCrossSectionHandler;
38 std::vector<int>::const_iterator it = resfind.begin();
39 for( ; it != resfind.end(); ++it ) {
53 std::vector<double>::const_iterator it =
vars_.begin();
54 for( ; it !=
vars_.end(); ++it ) {
55 initpar.push_back(*it);
60 void setParameters(
double* Start,
double*
Step,
double* Mini,
double* Maxi,
int* ind, TString* parname,
61 const std::vector<double> & parCrossSection,
const std::vector<int> & parCrossSectionOrder,
62 const std::vector<int> & resfind )
67 double thisStep[] = {0.001, 0.001, 0.001, 0.001, 0.001};
68 TString thisParName[] = {
"cross section var 1",
69 "cross section var 2",
70 "cross section var 3",
71 "cross section var 4",
72 "cross section var 5"};
73 double thisMini[] = {0., 0., 0., 0., 0.};
74 double thisMaxi[] = {1000., 1000., 1000., 1000., 1000.};
79 ind[iPar] = parCrossSectionOrder[iPar];
83 for(
unsigned int iPar=0; iPar<
parNum_; ++iPar ) {
84 Start[iPar] =
vars_[iPar];
85 Step[iPar] = thisStep[iPar];
86 Mini[iPar] = thisMini[iPar];
87 Maxi[iPar] = thisMaxi[iPar];
88 parname[iPar] = thisParName[iPar];
94 bool releaseParameters( TMinuit & rmin,
const std::vector<int> & resfind,
const std::vector<int> & parfix,
95 const int * ind,
const int iorder,
const unsigned int shift )
98 unsigned int freeParNum = 0;
100 if( (parfix[shift+ipar]==0) && (ind[shift+ipar]<=iorder) && (resfind[ipar] == 1) ) {
104 if( freeParNum > 0 ) {
105 freeParNum = freeParNum - 1;
107 for(
unsigned int i=0;
i<freeParNum; ++
i ) {
108 rmin.Release( shift+
i );
134 partialProduct[
i] = std::accumulate(variables, variables +
i, 1., std::multiplies<double>());
135 norm += partialProduct[
i];
137 for(
unsigned int i=0;
i<parNum_+1; ++
i ) {
140 delete[] partialProduct;
143 std::vector<double> allRelativeCrossSections;
144 std::vector<int>::const_iterator it = resfind.begin();
145 int smallerVectorIndex = 0;
146 for( ; it != resfind.end(); ++it ) {
148 allRelativeCrossSections.push_back(0.);
152 ++smallerVectorIndex;
156 return allRelativeCrossSections;
169 double normalization = 0.;
170 for(
unsigned int ires = 0;
ires < resfind.size(); ++
ires ) {
171 if( resfind[
ires] ) {
172 normalization += crossSection[
ires];
175 if( normalization != 0. ) {
176 for(
unsigned int ires = 0;
ires < resfind.size(); ++
ires ) {
177 if( resfind[
ires] ) {
188 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)
friend class TestCrossSectionHandler
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.