34 if(eff_hits.size() == 0) {
35 for(
unsigned int i=0; i<trk->
getNumReps(); i++) {
43 for(
unsigned int j=0; j<eff_hits.size(); j++) mini_trk->
addHit(eff_hits.at(j));
47 for(
unsigned int i=0; i<trk->
getNumReps(); i++) {
54 for(
unsigned int iBeta=0; iBeta<
fBeta.size(); iBeta++) {
56 for(
unsigned int j=0; j<mini_trk->
getNumHits(); j++) {
67 if(iBeta !=
fBeta.size()-1 )
93 std::vector<std::vector<double> > ret_val;
95 for(
unsigned int i=0; i<trk->
getNumHits(); i++) {
98 std::vector<double>
phi;
102 std::vector<double> weights;
105 TMatrixT<double> smoothedState,smoothedCov;
107 if(x_smoo.GetNrows() == 0) {
109 std::cout<<
"Assumed weight 0.5!!"<<std::endl;
110 ret_val.push_back(weights);
114 for(
unsigned int j=0; j<eff_hit->
getNumHits(); j++) {
117 TMatrixT<double>
m,Vorig;
127 TMatrixT<double> V( beta * Vorig);
128 TMatrixT<double> resid(m - x_smoo);
129 TMatrixT<double> resid_T(resid);
131 double detV = V.Determinant();
132 TMatrixT<double> Vinv;
135 phi.push_back((1./(pow(2.*TMath::Pi(),V.GetNrows()/2.)*sqrt(detV)))*exp(-0.5*(resid_T * Vinv * resid)[0][0]));
136 phi_sum += phi.at(j);
139 assert(cutVal>1.E-6);
140 phi_cut += (1./(pow(2.*TMath::Pi(),V.GetNrows()/2.)*sqrt(detV)))*exp(-0.5*cutVal/beta);
144 for(
unsigned int j=0; j<eff_hit->
getNumHits(); j++) {
146 weights.push_back(phi.at(j)/(phi_sum+phi_cut));
149 ret_val.push_back(weights);
159 if(fabs(val-0.01)<1.E-10){
166 else if(fabs(val-0.005)<1.E-10){
173 else if(fabs(val-0.001)<1.E-10){
181 GFException exc(
"GFDafsetProbCut() value is not supported",__LINE__,__FILE__);
188 void GFDaf::setBetas(
double b1,
double b2,
double b3,
double b4,
double b5,
double b6,
double b7,
double b8,
double b9,
double b10){
190 assert(b1>0);
fBeta.push_back(b1);
192 assert(b2<=b1);
fBeta.push_back(b2);
194 assert(b3<=b2);
fBeta.push_back(b3);
196 assert(b4<=b3);
fBeta.push_back(b4);
198 assert(b5<=b4);
fBeta.push_back(b5);
200 assert(b6<=b5);
fBeta.push_back(b6);
202 assert(b7<=b6);
fBeta.push_back(b7);
204 assert(b8<=b7);
fBeta.push_back(b8);
206 assert(b9<=b8);
fBeta.push_back(b9);
208 assert(b10<=b9);
fBeta.push_back(b10);
222 std::vector<GFDafHit*> eff_hits;
224 std::vector< std::vector<int>* > planes;
226 int nPlanes = planes.size();
228 for(
int i=0; i<nPlanes; i++) {
230 std::vector<GFAbsRecoHit*> hits;
232 for(
unsigned int j=0; j<planes.at(i)->size(); j++) {
233 hits.push_back(trk->
getHit(planes.at(i)->at(j)) );
237 eff_hits.push_back(eff_hit);
241 for(
unsigned int i=0; i<trk->
getNumReps(); i++) {
242 std::vector<std::vector<double> > rep_weights;
243 for(
unsigned int j=0; j<eff_hits.size(); j++) {
244 std::vector<double> single_weights;
245 single_weights.assign(eff_hits.at(j)->getNumHits(),1.);
246 rep_weights.push_back(single_weights);
257 for(
unsigned int i=0; i<target->
getNumReps(); i++) {
260 bool already_there =
false;
261 for(
unsigned int j=0; j<mat_keys.size(); j++) {
262 if(mat_keys.at(j) ==
"fUpSt") already_there =
true;
281 for(
unsigned int pl_i=0; pl_i<source->
getNumHits(); pl_i++) {
285 for(
unsigned int hit_i=0; hit_i<eff_hit->
getNumHits(); hit_i++) {
287 TMatrixT<double> fUpSt, fUpCov, bUpSt, bUpCov, fAuxInfo, bAuxInfo;
300 target->
getBK(target_irep)->
setMatrix(
"fAuxInfo",hit_count,fAuxInfo);
301 target->
getBK(target_irep)->
setMatrix(
"bAuxInfo",hit_count,bAuxInfo);
323 for(
unsigned int rep_i = 0; rep_i < weights.size(); rep_i++) {
326 unsigned int hit_i = 0;
327 for(
unsigned int dafhit_i = 0; dafhit_i < weights.at(rep_i).size(); dafhit_i++) {
328 for(
unsigned int hit_on_pl_i = 0; hit_on_pl_i < weights.at(rep_i).at(dafhit_i).size(); hit_on_pl_i++) {
329 bk->
setNumber(
"dafWeight", hit_i, weights.at(rep_i).at(dafhit_i).at(hit_on_pl_i));