25 class TestCrossSectionHandler;
35 std::vector<int>::const_iterator it = resfind.begin();
36 for (; it != resfind.end(); ++it) {
51 std::vector<double>::const_iterator it =
vars_.begin();
52 for (; it !=
vars_.end(); ++it) {
53 initpar.push_back(*it);
64 const std::vector<double>& parCrossSection,
65 const std::vector<int>& parCrossSectionOrder,
66 const std::vector<int>& resfind) {
70 double thisStep[] = {0.001, 0.001, 0.001, 0.001, 0.001};
71 TString thisParName[] = {
"cross section var 1",
72 "cross section var 2",
73 "cross section var 3",
74 "cross section var 4",
75 "cross section var 5"};
76 double thisMini[] = {0., 0., 0., 0., 0.};
77 double thisMaxi[] = {1000., 1000., 1000., 1000., 1000.};
82 ind[iPar] = parCrossSectionOrder[iPar];
86 for (
unsigned int iPar = 0; iPar <
parNum_; ++iPar) {
87 Start[iPar] =
vars_[iPar];
88 Step[iPar] = thisStep[iPar];
89 Mini[iPar] = thisMini[iPar];
90 Maxi[iPar] = thisMaxi[iPar];
91 parname[iPar] = thisParName[iPar];
98 const std::vector<int>& resfind,
99 const std::vector<int>& parfix,
102 const unsigned int shift) {
104 unsigned int freeParNum = 0;
106 if ((parfix[shift + ipar] == 0) && (ind[shift + ipar] <= iorder) && (resfind[ipar] == 1)) {
110 if (freeParNum > 0) {
111 freeParNum = freeParNum - 1;
113 for (
unsigned int i = 0;
i < freeParNum; ++
i) {
114 rmin.Release(shift +
i);
135 for (
unsigned int i = 0;
i <
parNum_ + 1; ++
i) {
136 partialProduct[
i] = std::accumulate(variables, variables +
i, 1., std::multiplies<double>());
137 norm += partialProduct[
i];
139 for (
unsigned int i = 0;
i < parNum_ + 1; ++
i) {
142 delete[] partialProduct;
145 std::vector<double> allRelativeCrossSections;
146 std::vector<int>::const_iterator it = resfind.begin();
147 int smallerVectorIndex = 0;
148 for (; it != resfind.end(); ++it) {
150 allRelativeCrossSections.push_back(0.);
153 ++smallerVectorIndex;
157 return allRelativeCrossSections;
169 double normalization = 0.;
170 for (
unsigned int ires = 0;
ires < resfind.size(); ++
ires) {
172 normalization += crossSection[
ires];
175 if (normalization != 0.) {
176 for (
unsigned int ires = 0;
ires < resfind.size(); ++
ires) {
187 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.