160#include <b2bii/modules/B2BIIMdstInput/B2BIIFixMdstModule.h>
167#include "CLHEP/Vector/ThreeVector.h"
168#include "CLHEP/Matrix/Vector.h"
171#include "belle_legacy/helix/Helix.h"
173#include "belle_legacy/tables/mdst.h"
174#include "belle_legacy/tables/belletdf.h"
175#include "belle_legacy/tables/evtvtx.h"
176#include "belle_legacy/ip/IpProfile.h"
179#include <analysis/VertexFitting/KFit/VertexFitKFit.h>
195 HepPoint3D vtx(vee2.vx(), vee2.vy(), vee2.vz());
197 const double pion_mass = 0.13956995;
198 const double proton_mass = 0.93827231;
199 const double electron_mass = 0.000511;
201 double massp(0.0), massm(0.0);
202 if (1 == vee2.kind()) {
205 }
else if (2 == vee2.kind()) {
208 }
else if (3 == vee2.kind()) {
211 }
else if (4 == vee2.kind()) {
212 massp = electron_mass;
213 massm = electron_mass;
221 Belle::Mdst_vee_daughters& vdau = vee2.daut();
223 CLHEP::HepVector a(5);
224 a[0] = vdau.helix_p(0); a[1] = vdau.helix_p(1);
225 a[2] = vdau.helix_p(2) / scale;
226 a[3] = vdau.helix_p(3); a[4] = vdau.helix_p(4);
227 Belle::Helix helixp(vtx, a);
229 a[0] = vdau.helix_m(0); a[1] = vdau.helix_m(1);
230 a[2] = vdau.helix_m(2) / scale;
231 a[3] = vdau.helix_m(3); a[4] = vdau.helix_m(4);
232 Belle::Helix helixm(vtx, a);
234 CLHEP::HepLorentzVector v0 = helixp.momentum(0., massp) + helixm.momentum(0., massm);
240 Belle::Mdst_charged& chargedp = vee2.chgd(0);
241 Belle::Mdst_trk& trkp = chargedp.trk();
242 Belle::Mdst_trk_fit& trkfp = trkp.mhyp(2);
243 HepPoint3D pvtp(trkfp.pivot_x(), trkfp.pivot_y(), trkfp.pivot_z());
244 CLHEP::HepVector a(5);
245 a[0] = trkfp.helix(0); a[1] = trkfp.helix(1);
246 a[2] = trkfp.helix(2);
247 a[3] = trkfp.helix(3); a[4] = trkfp.helix(4);
248 Belle::Helix helixp(pvtp, a);
249 helixp.bFieldZ(14.6);
255 Belle::Mdst_charged& chargedm = vee2.chgd(1);
256 Belle::Mdst_trk& trkm = chargedm.trk();
257 Belle::Mdst_trk_fit& trkfm = trkm.mhyp(2);
258 HepPoint3D pvtm(trkfm.pivot_x(), trkfm.pivot_y(), trkfm.pivot_z());
259 a[0] = trkfm.helix(0); a[1] = trkfm.helix(1);
260 a[2] = trkfm.helix(2);
261 a[3] = trkfm.helix(3); a[4] = trkfm.helix(4);
262 Belle::Helix helixm(pvtm, a);
263 helixm.bFieldZ(14.6);
269 CLHEP::HepLorentzVector v0 = helixp.momentum(0., massp) + helixm.momentum(0., massm);
287 Belle::Belle_event_Manager& evtmgr = Belle::Belle_event_Manager::get_manager();
289 if (0 == evtmgr.count())
return;
292 Belle::Mdst_event_add_Manager& mevtmgr = Belle::Mdst_event_add_Manager::get_manager();
293 if (mevtmgr.count() > 0 && 1 == mevtmgr[0].flag_scale())
return;
296 if (mode < 0 || mode > 2) {
297 B2ERROR(
"scale_momenta: invalid mode specified;");
298 B2ERROR(
"mode must be 0, 1, 2");
303 int expmc = evtmgr[0].ExpMC();
304 int expno = evtmgr[0].ExpNo();
305 int runno = evtmgr[0].RunNo();
319 }
else if (2 == expmc) {
323 if (1. == scale)
return;
327 if (mevtmgr.count() > 0) {
328 mevtmgr[0].flag_scale(1);
329 mevtmgr[0].scale(scale);
331 Belle::Mdst_event_add& meadd = mevtmgr.add();
340 Belle::Mdst_charged_Manager& chgmgr = Belle::Mdst_charged_Manager::get_manager();
341 for (std::vector<Belle::Mdst_charged>::iterator it = chgmgr.begin();
342 it != chgmgr.end(); ++it) {
343 Belle::Mdst_charged& charged = *it;
344 charged.px(scale * charged.px());
345 charged.py(scale * charged.py());
346 charged.pz(scale * charged.pz());
350 Belle::Mdst_vee2_Manager& vee2mgr = Belle::Mdst_vee2_Manager::get_manager();
351 for (std::vector<Belle::Mdst_vee2>::iterator it = vee2mgr.begin();
352 it != vee2mgr.end(); ++it) {
353 Belle::Mdst_vee2& vee2 = *it;
357 (v0mass_scale - v0mass_noscl) * (v0mass_scale + v0mass_noscl)
358 + vee2.energy() * vee2.energy() +
359 (scale - 1.) * (scale + 1.) * (vee2.px() * vee2.px() +
360 vee2.py() * vee2.py() +
361 vee2.pz() * vee2.pz());
362 vee2.energy(std::sqrt(esq_scale));
363 vee2.px(scale * vee2.px());
364 vee2.py(scale * vee2.py());
365 vee2.pz(scale * vee2.pz());
369 double scalei = 1. / scale;
370 double scalei2 = scalei / scale;
372 Belle::Mdst_trk_fit_Manager& trkfmgr = Belle::Mdst_trk_fit_Manager::get_manager();
373 for (std::vector<Belle::Mdst_trk_fit>::iterator it = trkfmgr.begin();
374 it != trkfmgr.end(); ++it) {
375 Belle::Mdst_trk_fit& trkf = *it;
376 trkf.helix(2, scalei * trkf.helix(2));
377 trkf.error(3, scalei * trkf.error(3));
378 trkf.error(4, scalei * trkf.error(4));
379 trkf.error(5, scalei2 * trkf.error(5));
380 trkf.error(8, scalei * trkf.error(8));
381 trkf.error(12, scalei * trkf.error(12));
385 Belle::Mdst_vee_daughters_Manager& vdaumgr = Belle::Mdst_vee_daughters_Manager::get_manager();
386 for (std::vector<Belle::Mdst_vee_daughters>::iterator it = vdaumgr.begin();
387 it != vdaumgr.end(); ++it) {
388 Belle::Mdst_vee_daughters& vdau = *it;
389 vdau.helix_p(2, scalei * vdau.helix_p(2));
390 vdau.error_p(3, scalei * vdau.error_p(3));
391 vdau.error_p(4, scalei * vdau.error_p(4));
392 vdau.error_p(5, scalei2 * vdau.error_p(5));
393 vdau.error_p(8, scalei * vdau.error_p(8));
394 vdau.error_p(12, scalei * vdau.error_p(12));
396 vdau.helix_m(2, scalei * vdau.helix_m(2));
397 vdau.error_m(3, scalei * vdau.error_m(3));
398 vdau.error_m(4, scalei * vdau.error_m(4));
399 vdau.error_m(5, scalei2 * vdau.error_m(5));
400 vdau.error_m(8, scalei * vdau.error_m(8));
401 vdau.error_m(12, scalei * vdau.error_m(12));
407 const int runno,
double& scale)
415 if (expno == 7) {scale = 1.001932;
return;}
416 if (expno == 9) {scale = 1.001413;
return;}
417 if (expno == 11) {scale = 1.001366;
return;}
419 if (expno == 13) {scale = 1.001460;
return;}
420 if (expno >= 15) {B2ERROR(
"scale_momenta mode=1: not ready for exp >=15");}
425 if (runno >= 0 && runno <= 99) {scale = 1.00262126;
return;}
426 if (runno >= 100 && runno <= 199) {scale = 1.00253537;
return;}
427 if (runno >= 200 && runno <= 299) {scale = 1.00246555;
return;}
428 if (runno >= 300 && runno <= 399) {scale = 1.0026452 ;
return;}
429 if (runno >= 400 && runno <= 499) {scale = 1.00290386;
return;}
430 if (runno >= 500 && runno <= 599) {scale = 1.00287753;
return;}
431 if (runno >= 600 && runno <= 699) {scale = 1.00266845;
return;}
432 if (runno >= 700 && runno <= 799) {scale = 1.00184472;
return;}
433 if (runno >= 800 && runno <= 899) {scale = 1.00200021;
return;}
434 if (runno >= 900 && runno <= 999) {scale = 1.00178485;
return;}
435 if (runno >= 1000 && runno <= 1099) {scale = 1.00196071;
return;}
436 if (runno >= 1100 && runno <= 1199) {scale = 1.00224453;
return;}
437 if (runno >= 1200 && runno <= 1299) {scale = 1.00209138;
return;}
438 if (runno >= 1300 && runno <= 1399) {scale = 1.00145455;
return;}
439 if (runno >= 1400 && runno <= 1499) {scale = 1.00119243;
return;}
440 if (runno >= 1500 && runno <= 1599) {scale = 1.00115572;
return;}
441 if (runno >= 1600 && runno <= 1699) {scale = 1.00133916;
return;}
442 if (runno >= 1700 && runno <= 1799) {scale = 1.00186441;
return;}
443 if (runno >= 1800 && runno <= 1899) {scale = 1.00206786;
return;}
444 if (runno >= 1900 && runno <= 1999) {scale = 1.00184794;
return;}
445 if (runno >= 2000 && runno <= 2099) {scale = 1.00187219;
return;}
446 if (runno >= 2100 && runno <= 2199) {scale = 1.00214844;
return;}
447 if (runno >= 2200 && runno <= 2299) {scale = 1.00154502;
return;}
448 if (runno >= 2300 && runno <= 2399) {scale = 1.00179518;
return;}
449 if (runno >= 2400 && runno <= 2499) {scale = 1.00198983;
return;}
450 if (runno >= 2500 && runno <= 2599) {scale = 1.00219242;
return;}
451 if (runno >= 2600 && runno <= 2699) {scale = 1.00227363;
return;}
452 if (runno >= 2700 && runno <= 2799) {scale = 1.00202328;
return;}
453 if (runno >= 2800 && runno <= 2899) {scale = 1.00193147;
return;}
454 }
else if (expno == 9) {
455 if (runno >= 0 && runno <= 99) {scale = 1.00126754;
return;}
456 if (runno >= 100 && runno <= 199) {scale = 1.00119683;
return;}
457 if (runno >= 200 && runno <= 299) {scale = 1.00123771;
return;}
458 if (runno >= 300 && runno <= 399) {scale = 1.00142625;
return;}
459 if (runno >= 400 && runno <= 499) {scale = 1.00134481;
return;}
460 if (runno >= 500 && runno <= 599) {scale = 1.00131973;
return;}
461 if (runno >= 600 && runno <= 699) {scale = 1.00145963;
return;}
462 if (runno >= 700 && runno <= 799) {scale = 1.00161304;
return;}
463 if (runno >= 800 && runno <= 899) {scale = 1.00141795;
return;}
464 if (runno >= 900 && runno <= 999) {scale = 1.00137157;
return;}
465 if (runno >= 1000 && runno <= 1099) {scale = 1.00126209;
return;}
466 if (runno >= 1100 && runno <= 1199) {scale = 1.00147941;
return;}
467 if (runno >= 1200 && runno <= 1299) {scale = 1.00145555;
return;}
468 }
else if (expno == 11) {
469 if (runno >= 0 && runno <= 99) {scale = 1.00149576;
return;}
470 if (runno >= 100 && runno <= 199) {scale = 1.00155153;
return;}
471 if (runno >= 200 && runno <= 299) {scale = 1.0013597 ;
return;}
472 if (runno >= 300 && runno <= 399) {scale = 1.00147504;
return;}
473 if (runno >= 400 && runno <= 499) {scale = 1.00138242;
return;}
474 if (runno >= 500 && runno <= 599) {scale = 1.00144554;
return;}
475 if (runno >= 600 && runno <= 699) {scale = 1.00136961;
return;}
476 if (runno >= 700 && runno <= 799) {scale = 1.00141443;
return;}
477 if (runno >= 800 && runno <= 899) {scale = 1.00136617;
return;}
478 if (runno >= 900 && runno <= 999) {scale = 1.00126262;
return;}
479 if (runno >= 1000 && runno <= 1099) {scale = 1.00133337;
return;}
480 if (runno >= 1100 && runno <= 1199) {scale = 1.00137906;
return;}
481 if (runno >= 1200 && runno <= 1299) {scale = 1.00127944;
return;}
483 if (runno >= 1300 && runno <= 1399) {scale = 1.00127944;
return;}
484 }
else if (expno == 13) {
485 if (runno >= 0 && runno <= 99) {scale = 1.00110691;
return;}
486 if (runno >= 100 && runno <= 199) {scale = 1.00106123;
return;}
487 if (runno >= 200 && runno <= 299) {scale = 1.00109934;
return;}
488 if (runno >= 300 && runno <= 399) {scale = 1.00105759;
return;}
489 if (runno >= 400 && runno <= 499) {scale = 1.000986887;
return;}
490 if (runno >= 500 && runno <= 599) {scale = 1.000928764;
return;}
491 if (runno >= 600 && runno <= 699) {scale = 1.00103925;
return;}
492 if (runno >= 700 && runno <= 799) {scale = 1.0010591 ;
return;}
493 if (runno >= 800 && runno <= 899) {scale = 1.00127043;
return;}
494 if (runno >= 900 && runno <= 999) {scale = 1.00154033;
return;}
495 if (runno >= 1000 && runno <= 1099) {scale = 1.00180656;
return;}
496 if (runno >= 1100 && runno <= 1199) {scale = 1.00202059;
return;}
497 if (runno >= 1200 && runno <= 1299) {scale = 1.00184308;
return;}
498 if (runno >= 1300 && runno <= 1399) {scale = 1.00180153;
return;}
499 if (runno >= 1400 && runno <= 1499) {scale = 1.00189577;
return;}
500 if (runno >= 1500 && runno <= 1599) {scale = 1.00176026;
return;}
502 if (runno >= 1600 && runno <= 1699) {scale = 1.00176026;
return;}
504 }
else if (expno == 15) {
505 if (runno >= 0 && runno <= 99) {scale = 1.00178719;
return;}
506 if (runno >= 100 && runno <= 199) {scale = 1.00205712;
return;}
507 if (runno >= 200 && runno <= 299) {scale = 1.00197622;
return;}
508 if (runno >= 300 && runno <= 399) {scale = 1.00191558;
return;}
509 if (runno >= 400 && runno <= 499) {scale = 1.00207795;
return;}
510 if (runno >= 500 && runno <= 599) {scale = 1.00191871;
return;}
511 if (runno >= 600 && runno <= 699) {scale = 1.00187917;
return;}
512 if (runno >= 700 && runno <= 799) {scale = 1.0019573 ;
return;}
513 if (runno >= 800 && runno <= 899) {scale = 1.00196562;
return;}
514 if (runno >= 900 && runno <= 999) {scale = 1.00205215;
return;}
515 if (runno >= 1000 && runno <= 1099) {scale = 1.00200559;
return;}
516 if (runno >= 1100 && runno <= 1199) {scale = 1.00198568;
return;}
517 if (runno >= 1200 && runno <= 1299) {scale = 1.00212539;
return;}
518 if (runno >= 1300 && runno <= 1399) {scale = 1.00199158;
return;}
519 if (runno >= 1400 && runno <= 1499) {scale = 1.00208257;
return;}
521 }
else if (expno >= 17) { B2ERROR(
"scale_momenta mode=2: not ready for exp >=17");}
529 const int runno,
double& scale)
538 B2ERROR(
"scale_momenta mode=1 not ready for exp " << expno);
544 if (runno >= 0 && runno <= 99) {scale = 1.00284313;
return;}
545 if (runno >= 100 && runno <= 199) {scale = 1.00272563;
return;}
546 if (runno >= 200 && runno <= 299) {scale = 1.00276953;
return;}
547 if (runno >= 300 && runno <= 399) {scale = 1.00286722;
return;}
548 if (runno >= 400 && runno <= 499) {scale = 1.00318492;
return;}
549 if (runno >= 500 && runno <= 599) {scale = 1.00304208;
return;}
550 if (runno >= 600 && runno <= 699) {scale = 1.00292413;
return;}
551 if (runno >= 700 && runno <= 799) {scale = 1.00201286;
return;}
552 if (runno >= 800 && runno <= 899) {scale = 1.00225237;
return;}
553 if (runno >= 900 && runno <= 999) {scale = 1.00210375;
return;}
554 if (runno >= 1000 && runno <= 1099) {scale = 1.00213222;
return;}
555 if (runno >= 1100 && runno <= 1199) {scale = 1.00253683;
return;}
556 if (runno >= 1200 && runno <= 1299) {scale = 1.00234023;
return;}
557 if (runno >= 1300 && runno <= 1399) {scale = 1.00168421;
return;}
558 if (runno >= 1400 && runno <= 1499) {scale = 1.00136169;
return;}
559 if (runno >= 1500 && runno <= 1599) {scale = 1.00138431;
return;}
560 if (runno >= 1600 && runno <= 1699) {scale = 1.00154521;
return;}
561 if (runno >= 1700 && runno <= 1799) {scale = 1.00204405;
return;}
562 if (runno >= 1800 && runno <= 1899) {scale = 1.00223498;
return;}
563 if (runno >= 1900 && runno <= 1999) {scale = 1.00198975;
return;}
564 if (runno >= 2000 && runno <= 2099) {scale = 1.00201868;
return;}
565 if (runno >= 2100 && runno <= 2199) {scale = 1.00233875;
return;}
566 if (runno >= 2200 && runno <= 2299) {scale = 1.00175269;
return;}
567 if (runno >= 2300 && runno <= 2399) {scale = 1.00192858;
return;}
568 if (runno >= 2400 && runno <= 2499) {scale = 1.00217693;
return;}
569 if (runno >= 2500 && runno <= 2599) {scale = 1.00209337;
return;}
570 if (runno >= 2600 && runno <= 2699) {scale = 1.00244277;
return;}
571 if (runno >= 2700 && runno <= 2799) {scale = 1.00221485;
return;}
572 if (runno >= 2800 && runno <= 2899) {scale = 1.00214678;
return;}
573 }
else if (expno == 9) {
574 if (runno >= 0 && runno <= 99) {scale = 1.00127702;
return;}
575 if (runno >= 100 && runno <= 199) {scale = 1.00119957;
return;}
576 if (runno >= 200 && runno <= 299) {scale = 1.00132677;
return;}
577 if (runno >= 300 && runno <= 399) {scale = 1.0014785 ;
return;}
578 if (runno >= 400 && runno <= 499) {scale = 1.00144872;
return;}
579 if (runno >= 500 && runno <= 599) {scale = 1.00145376;
return;}
580 if (runno >= 600 && runno <= 699) {scale = 1.00151659;
return;}
581 if (runno >= 700 && runno <= 799) {scale = 1.00167384;
return;}
582 if (runno >= 800 && runno <= 899) {scale = 1.00153754;
return;}
583 if (runno >= 900 && runno <= 999) {scale = 1.0014984 ;
return;}
584 if (runno >= 1000 && runno <= 1099) {scale = 1.0013764 ;
return;}
585 if (runno >= 1100 && runno <= 1199) {scale = 1.00145545;
return;}
586 if (runno >= 1200 && runno <= 1299) {scale = 1.0017164 ;
return;}
587 }
else if (expno == 11) {
588 if (runno >= 0 && runno <= 99) {scale = 1.00159624;
return;}
589 if (runno >= 100 && runno <= 199) {scale = 1.00153365;
return;}
590 if (runno >= 200 && runno <= 299) {scale = 1.00143809;
return;}
591 if (runno >= 300 && runno <= 399) {scale = 1.00148495;
return;}
592 if (runno >= 400 && runno <= 499) {scale = 1.00143193;
return;}
593 if (runno >= 500 && runno <= 599) {scale = 1.00141905;
return;}
594 if (runno >= 600 && runno <= 699) {scale = 1.0013992 ;
return;}
595 if (runno >= 700 && runno <= 799) {scale = 1.00148836;
return;}
596 if (runno >= 800 && runno <= 899) {scale = 1.00139019;
return;}
597 if (runno >= 900 && runno <= 999) {scale = 1.00151389;
return;}
598 if (runno >= 1000 && runno <= 1099) {scale = 1.00142988;
return;}
599 if (runno >= 1100 && runno <= 1199) {scale = 1.00143519;
return;}
600 if (runno >= 1200 && runno <= 1299) {scale = 1.00132641;
return;}
601 }
else if (expno == 13) {
602 if (runno >= 0 && runno <= 99) {scale = 1.00126317;
return;}
603 if (runno >= 100 && runno <= 199) {scale = 1.00118837;
return;}
604 if (runno >= 200 && runno <= 299) {scale = 1.00122276;
return;}
605 if (runno >= 300 && runno <= 399) {scale = 1.00113233;
return;}
606 if (runno >= 400 && runno <= 499) {scale = 1.00111677;
return;}
607 if (runno >= 500 && runno <= 599) {scale = 1.00100963;
return;}
608 if (runno >= 600 && runno <= 699) {scale = 1.0011474 ;
return;}
609 if (runno >= 700 && runno <= 799) {scale = 1.00116245;
return;}
610 if (runno >= 800 && runno <= 899) {scale = 1.00139826;
return;}
611 if (runno >= 900 && runno <= 999) {scale = 1.0017014 ;
return;}
612 if (runno >= 1000 && runno <= 1099) {scale = 1.00190706;
return;}
613 if (runno >= 1100 && runno <= 1199) {scale = 1.00214688;
return;}
614 if (runno >= 1200 && runno <= 1299) {scale = 1.00207336;
return;}
615 if (runno >= 1300 && runno <= 1399) {scale = 1.00192885;
return;}
616 if (runno >= 1400 && runno <= 1499) {scale = 1.00196289;
return;}
617 if (runno >= 1500 && runno <= 1599) {scale = 1.00185017;
return;}
618 if (runno >= 1600 && runno <= 1699) {scale = 1.00191256;
return;}
619 }
else if (expno == 15) {
620 if (runno >= 0 && runno <= 99) {scale = 1.001953;
return;}
621 if (runno >= 100 && runno <= 199) {scale = 1.00210508;
return;}
622 if (runno >= 200 && runno <= 299) {scale = 1.002139;
return;}
623 if (runno >= 300 && runno <= 399) {scale = 1.00207803;
return;}
624 if (runno >= 400 && runno <= 499) {scale = 1.0022331;
return;}
625 if (runno >= 500 && runno <= 599) {scale = 1.00206421;
return;}
626 if (runno >= 600 && runno <= 699) {scale = 1.00205153;
return;}
627 if (runno >= 700 && runno <= 799) {scale = 1.00214664;
return;}
628 if (runno >= 800 && runno <= 899) {scale = 1.0021456;
return;}
629 if (runno >= 900 && runno <= 999) {scale = 1.00221055;
return;}
630 if (runno >= 1000 && runno <= 1099) {scale = 1.00216472;
return;}
631 if (runno >= 1100 && runno <= 1199) {scale = 1.00214208;
return;}
632 if (runno >= 1200 && runno <= 1299) {scale = 1.00228874;
return;}
633 if (runno >= 1300 && runno <= 1399) {scale = 1.00215047;
return;}
634 if (runno >= 1400 && runno <= 1499) {scale = 1.00219808;
return;}
635 }
else if (expno == 17) {
636 if (runno >= 0 && runno <= 99) {scale = 1.00216742;
return;}
637 if (runno >= 100 && runno <= 199) {scale = 1.00229433;
return;}
638 if (runno >= 200 && runno <= 299) {scale = 1.0022749 ;
return;}
639 if (runno >= 300 && runno <= 399) {scale = 1.00231283;
return;}
640 if (runno >= 400 && runno <= 499) {scale = 1.00223654;
return;}
641 if (runno >= 500 && runno <= 599) {scale = 1.00236524;
return;}
642 if (runno >= 600 && runno <= 699) {scale = 1.00229312;
return;}
643 if (runno >= 700 && runno <= 799) {scale = 1.002262 ;
return;}
644 if (runno >= 800 && runno <= 899) {scale = 1.00220104;
return;}
645 if (runno >= 900 && runno <= 999) {scale = 1.00215475;
return;}
646 }
else if (expno == 19) {
647 if (runno >= 0 && runno <= 99) {scale = 1.00227682;
return;}
648 if (runno >= 100 && runno <= 199) {scale = 1.00235795;
return;}
649 if (runno >= 200 && runno <= 299) {scale = 1.00251509;
return;}
650 if (runno >= 300 && runno <= 399) {scale = 1.0022106 ;
return;}
651 if (runno >= 400 && runno <= 499) {scale = 1.00230963;
return;}
652 if (runno >= 500 && runno <= 599) {scale = 1.002229 ;
return;}
653 if (runno >= 600 && runno <= 699) {scale = 1.00215402;
return;}
654 if (runno >= 700 && runno <= 799) {scale = 1.00217892;
return;}
655 if (runno >= 800 && runno <= 899) {scale = 1.0022305 ;
return;}
656 if (runno >= 900 && runno <= 999) {scale = 1.0021458 ;
return;}
657 if (runno >= 1000 && runno <= 1099) {scale = 1.00215792;
return;}
658 if (runno >= 1100 && runno <= 1199) {scale = 1.0022667 ;
return;}
659 if (runno >= 1200 && runno <= 1299) {scale = 1.00219581;
return;}
660 if (runno >= 1300 && runno <= 1399) {scale = 1.00218378;
return;}
661 if (runno >= 1400 && runno <= 1499) {scale = 1.00232172;
return;}
662 if (runno >= 1500 && runno <= 1599) {scale = 1.00217172;
return;}
663 if (runno >= 1600 && runno <= 1700) {scale = 1.00208639;
return;}
664 if (runno >= 1700 && runno <= 1799) {scale = 1.00188253;
return;}
666 B2ERROR(
"scale_momenta not ready for this exp,run "
667 << expno <<
"," << runno);
669 }
else if (expno == 21) {
670 if (runno >= 0 && runno <= 99) {scale = 1.00228182;
return;}
671 if (runno >= 100 && runno <= 199) {scale = 1.00233446;
return;}
672 if (runno >= 200 && runno <= 299) {scale = 1.00238846;
return;}
673 if (runno >= 300 && runno <= 399) {scale = 1.00238061 ;
return;}
675 B2ERROR(
"scale_momenta not ready for this exp,run "
676 << expno <<
"," << runno);
678 }
else if (expno == 23) {
679 if (runno >= 0 && runno <= 99) {scale = 1.00216089;
return;}
680 if (runno >= 100 && runno <= 199) {scale = 1.0019783;
return;}
681 if (runno >= 200 && runno <= 299) {scale = 1.00172162;
return;}
682 if (runno >= 300 && runno <= 399) {scale = 1.0017938 ;
return;}
683 if (runno >= 400 && runno <= 499) {scale = 1.00177832 ;
return;}
684 if (runno >= 500 && runno <= 599) {scale = 1.0017609 ;
return;}
685 if (runno >= 600 && runno <= 699) {scale = 1.0017756 ;
return;}
687 B2ERROR(
"scale_momenta not ready for this exp,run "
688 << expno <<
"," << runno);
690 }
else if (expno == 25) {
691 if (runno >= 0 && runno <= 99) {scale = 1.00190068;
return;}
692 if (runno >= 100 && runno <= 199) {scale = 1.00199038;
return;}
693 if (runno >= 200 && runno <= 299) {scale = 1.00196171;
return;}
694 if (runno >= 300 && runno <= 399) {scale = 1.00200167;
return;}
695 if (runno >= 400 && runno <= 499) {scale = 1.0019667 ;
return;}
696 if (runno >= 500 && runno <= 599) {scale = 1.00212109;
return;}
697 if (runno >= 600 && runno <= 699) {scale = 1.00202115;
return;}
698 if (runno >= 700 && runno <= 799) {scale = 1.00196456;
return;}
699 if (runno >= 800 && runno <= 899) {scale = 1.00200392;
return;}
700 if (runno >= 900 && runno <= 999) {scale = 1.00199495;
return;}
701 if (runno >= 1000 && runno <= 1099) {scale = 1.00202212;
return;}
702 if (runno >= 1100 && runno <= 1199) {scale = 1.00205312;
return;}
703 if (runno >= 1200 && runno <= 1299) {scale = 1.00200891;
return;}
704 if (runno >= 1300 && runno <= 1399) {scale = 1.00196866;
return;}
705 if (runno >= 1400 && runno <= 1499) {scale = 1.0020257 ;
return;}
706 if (runno >= 1500 && runno <= 1599) {scale = 1.00196995;
return;}
707 if (runno >= 1600 && runno <= 1699) {scale = 1.00189232;
return;}
708 if (runno >= 1700 && runno <= 1799) {scale = 1.00179028;
return;}
709 if (runno >= 1800 && runno <= 1899) {scale = 1.00179459;
return;}
710 if (runno >= 1900 && runno <= 1999) {scale = 1.001762 ;
return;}
711 if (runno >= 2000 && runno <= 2099) {scale = 1.00179514;
return;}
712 if (runno >= 2100 && runno <= 2199) {scale = 1.00175211;
return;}
714 B2ERROR(
"scale_momenta not ready for this exp,run "
715 << expno <<
"," << runno);
717 }
else if (expno == 27) {
718 if (runno >= 0 && runno <= 99) {scale = 1.00192647;
return;}
719 if (runno >= 100 && runno <= 199) {scale = 1.0019717 ;
return;}
720 if (runno >= 200 && runno <= 299) {scale = 1.00196428;
return;}
721 if (runno >= 300 && runno <= 399) {scale = 1.00190998;
return;}
722 if (runno >= 400 && runno <= 499) {scale = 1.00204645;
return;}
723 if (runno >= 500 && runno <= 599) {scale = 1.0020687 ;
return;}
724 if (runno >= 600 && runno <= 699) {scale = 1.00198209;
return;}
726 if (runno >= 700 && runno <= 800) {scale = 1.00187505;
return;}
727 if (runno >= 801 && runno <= 900) {scale = 1.00186805;
return;}
728 if (runno >= 901 && runno <= 1000) {scale = 1.00185576;
return;}
729 if (runno >= 1001 && runno <= 1079) {scale = 1.00177176;
return;}
730 if (runno >= 1080 && runno <= 1100) {scale = 1.00177184;
return;}
731 if (runno >= 1101 && runno <= 1200) {scale = 1.00174057;
return;}
732 if (runno >= 1201 && runno <= 1251) {scale = 1.00189649;
return;}
733 if (runno >= 1252 && runno <= 1300) {scale = 1.00189999;
return;}
734 if (runno >= 1301 && runno <= 1400) {scale = 1.0018818 ;
return;}
735 if (runno >= 1401 && runno <= 1500) {scale = 1.00200148;
return;}
736 if (runno >= 1501 && runno <= 1600) {scale = 1.00220137;
return;}
737 if (runno >= 1601 && runno <= 1632) {scale = 1.00217034;
return;}
739 B2ERROR(
"scale_momenta not ready for this exp,run "
740 << expno <<
"," << runno);
742 }
else if (expno == 31) {
743 if (runno >= 0 && runno <= 99) {scale = 1.000373374;
return;}
744 if (runno >= 100 && runno <= 199) {scale = 1.000684843;
return;}
745 if (runno >= 200 && runno <= 299) {scale = 1.000741216;
return;}
746 if (runno >= 300 && runno <= 399) {scale = 1.00092523 ;
return;}
747 if (runno >= 400 && runno <= 499) {scale = 1.00104576 ;
return;}
748 if (runno >= 500 && runno <= 599) {scale = 1.00103982 ;
return;}
749 if (runno >= 600 && runno <= 699) {scale = 1.0010601 ;
return;}
750 if (runno >= 700 && runno <= 799) {scale = 1.000982515;
return;}
751 if (runno >= 800 && runno <= 899) {scale = 1.00101577 ;
return;}
752 if (runno >= 900 && runno <= 999) {scale = 1.000972193;
return;}
753 if (runno >= 1000 && runno <= 1099) {scale = 1.00102536 ;
return;}
754 if (runno >= 1100 && runno <= 1199) {scale = 1.00127571 ;
return;}
755 if (runno >= 1200 && runno <= 1299) {scale = 1.00117938 ;
return;}
756 if (runno >= 1300 && runno <= 1399) {scale = 1.00121084 ;
return;}
757 if (runno >= 1400 && runno <= 1499) {scale = 1.00125911 ;
return;}
758 if (runno >= 1500 && runno <= 1599) {scale = 1.0012907 ;
return;}
759 if (runno >= 1600 && runno <= 1699) {scale = 1.00125362 ;
return;}
760 if (runno >= 1700 && runno <= 1799) {scale = 1.00131686 ;
return;}
762 B2ERROR(
"scale_momenta not ready for this exp,run "
763 << expno <<
"," << runno);
765 }
else if (expno == 33) {
766 if (runno >= 0 && runno <= 99) {scale = 1.00136407;
return;}
767 if (runno >= 100 && runno <= 199) {scale = 1.0013701 ;
return;}
768 if (runno >= 200 && runno <= 299) {scale = 1.00156244;
return;}
769 if (runno >= 300 && runno <= 399) {scale = 1.00138501;
return;}
770 if (runno >= 400 && runno <= 499) {scale = 1.00148468;
return;}
771 if (runno >= 500 && runno <= 599) {scale = 1.0013797 ;
return;}
772 if (runno >= 600 && runno <= 699) {scale = 1.00152298;
return;}
773 if (runno >= 700 && runno <= 799) {scale = 1.001524 ;
return;}
774 if (runno >= 800 && runno <= 899) {scale = 1.0014635 ;
return;}
776 B2ERROR(
"scale_momenta not ready for this exp,run "
777 << expno <<
"," << runno);
779 }
else if (expno == 35) {
780 if (runno >= 0 && runno <= 99) {scale = 1.00135452;
return;}
781 if (runno >= 100 && runno <= 199) {scale = 1.00135798;
return;}
782 if (runno >= 200 && runno <= 299) {scale = 1.00139979;
return;}
783 if (runno >= 300 && runno <= 399) {scale = 1.00136061;
return;}
784 if (runno >= 400 && runno <= 499) {scale = 1.00135776;
return;}
785 if (runno >= 500 && runno <= 599) {scale = 1.00118666;
return;}
786 if (runno >= 600 && runno <= 699) {scale = 1.0011346 ;
return;}
788 B2ERROR(
"scale_momenta not ready for this exp,run "
789 << expno <<
"," << runno);
791 }
else if (expno == 37) {
792 if (runno >= 0 && runno <= 99) {scale = 1.00076522 ;
return;}
793 if (runno >= 100 && runno <= 199) {scale = 1.000875154;
return;}
794 if (runno >= 200 && runno <= 299) {scale = 1.000946763;
return;}
795 if (runno >= 300 && runno <= 399) {scale = 1.000868444;
return;}
796 if (runno >= 400 && runno <= 499) {scale = 1.000781409;
return;}
797 if (runno >= 500 && runno <= 599) {scale = 1.000781171;
return;}
798 if (runno >= 600 && runno <= 699) {scale = 1.000857962;
return;}
799 if (runno >= 700 && runno <= 799) {scale = 1.000756082;
return;}
800 if (runno >= 800 && runno <= 899) {scale = 1.000727355;
return;}
801 if (runno >= 900 && runno <= 999) {scale = 1.000740236;
return;}
802 if (runno >= 1000 && runno <= 1099) {scale = 1.000499606;
return;}
803 if (runno >= 1100 && runno <= 1199) {scale = 1.000481664;
return;}
804 if (runno >= 1200 && runno <= 1299) {scale = 1.000706924;
return;}
805 if (runno >= 1300 && runno <= 1399) {scale = 1.000673738;
return;}
806 if (runno >= 1400 && runno <= 1499) {scale = 1.000662648;
return;}
807 if (runno >= 1500 && runno <= 1599) {scale = 1.000671198;
return;}
808 if (runno >= 1600 && runno <= 1699) {scale = 1.000604364;
return;}
809 if (runno >= 1700 && runno <= 1799) {scale = 1.000717372;
return;}
810 if (runno >= 1800 && runno <= 1899) {scale = 1.000512399;
return;}
811 if (runno >= 1900 && runno <= 1999) {scale = 1.000436958;
return;}
813 B2ERROR(
"scale_momenta not ready for this exp,run "
814 << expno <<
"," << runno);
816 }
else if (expno == 39) {
817 if (runno >= 0 && runno <= 99) {scale = 1.000504342;
return;}
818 if (runno >= 100 && runno <= 199) {scale = 1.000704544;
return;}
819 if (runno >= 200 && runno <= 299) {scale = 1.00094335 ;
return;}
820 if (runno >= 300 && runno <= 399) {scale = 1.000928819;
return;}
821 if (runno >= 400 && runno <= 499) {scale = 1.000884638;
return;}
822 if (runno >= 500 && runno <= 599) {scale = 1.00083459 ;
return;}
823 if (runno >= 600 && runno <= 699) {scale = 1.000767604;
return;}
824 if (runno >= 700 && runno <= 799) {scale = 1.000882219;
return;}
825 if (runno >= 800 && runno <= 899) {scale = 1.000781437;
return;}
826 if (runno >= 900 && runno <= 999) {scale = 1.000853168;
return;}
827 if (runno >= 1000 && runno <= 1099) {scale = 1.000926527;
return;}
828 if (runno >= 1100 && runno <= 1199) {scale = 1.000942882;
return;}
829 if (runno >= 1200 && runno <= 1299) {scale = 1.000932802;
return;}
830 if (runno >= 1300 && runno <= 1399) {scale = 1.000898892;
return;}
832 B2ERROR(
"scale_momenta not ready for this exp,run "
833 << expno <<
"," << runno);
835 }
else if (expno == 41) {
836 if (runno >= 0 && runno <= 99) {scale = 1.00178427;
return;}
837 if (runno >= 100 && runno <= 199) {scale = 1.00188559;
return;}
838 if (runno >= 200 && runno <= 299) {scale = 1.0019292 ;
return;}
839 if (runno >= 300 && runno <= 399) {scale = 1.00196352;
return;}
840 if (runno >= 400 && runno <= 499) {scale = 1.0019078 ;
return;}
841 if (runno >= 500 && runno <= 599) {scale = 1.00185598;
return;}
842 if (runno >= 600 && runno <= 699) {scale = 1.00191314;
return;}
843 if (runno >= 700 && runno <= 799) {scale = 1.00179647;
return;}
844 if (runno >= 800 && runno <= 899) {scale = 1.00189776;
return;}
845 if (runno >= 900 && runno <= 999) {scale = 1.00184798;
return;}
846 if (runno >= 1000 && runno <= 1099) {scale = 1.00177963;
return;}
847 if (runno >= 1100 && runno <= 1199) {scale = 1.00176408;
return;}
848 if (runno >= 1200 && runno <= 1299) {scale = 1.00171371;
return;}
850 B2ERROR(
"scale_momenta not ready for this exp,run "
851 << expno <<
"," << runno);
853 }
else if (expno == 43) {
854 if (runno >= 0 && runno <= 99) {scale = 1.00142307;
return;}
855 if (runno >= 100 && runno <= 199) {scale = 1.000979455;
return;}
856 if (runno >= 200 && runno <= 299) {scale = 1.000974458;
return;}
857 if (runno >= 300 && runno <= 399) {scale = 1.00103301;
return;}
858 if (runno >= 400 && runno <= 499) {scale = 1.001111994;
return;}
859 if (runno >= 500 && runno <= 599) {scale = 1.00100635;
return;}
860 if (runno >= 600 && runno <= 699) {scale = 1.00105078;
return;}
861 if (runno >= 700 && runno <= 799) {scale = 1.00103593;
return;}
862 if (runno >= 800 && runno <= 899) {scale = 1.00105158;
return;}
863 if (runno >= 900 && runno <= 999) {scale = 1.000955608;
return;}
864 if (runno >= 1000 && runno <= 1099) {scale = 1.00099199;
return;}
865 if (runno >= 1100 && runno <= 1199) {scale = 1.0011439;
return;}
867 B2ERROR(
"scale_momenta not ready for this exp,run "
868 << expno <<
"," << runno);
870 }
else if (expno == 45) {
871 if (runno >= 0 && runno <= 99) {scale = 1.00126261;
return;}
872 if (runno >= 100 && runno <= 199) {scale = 1.00138601;
return;}
873 if (runno >= 200 && runno <= 299) {scale = 1.00135372;
return;}
874 if (runno >= 300 && runno <= 399) {scale = 1.00141286;
return;}
875 if (runno >= 400 && runno <= 499) {scale = 1.00147822;
return;}
877 B2ERROR(
"scale_momenta not ready for this exp,run "
878 << expno <<
"," << runno);
880 }
else if (expno == 47) {
881 if (runno >= 0 && runno <= 99) {scale = 1.00156977;
return;}
882 if (runno >= 100 && runno <= 199) {scale = 1.00155614;
return;}
883 if (runno >= 200 && runno <= 299) {scale = 1.0016555;
return;}
884 if (runno >= 300 && runno <= 399) {scale = 1.00167046;
return;}
885 if (runno >= 400 && runno <= 499) {scale = 1.00168705;
return;}
886 if (runno >= 500 && runno <= 599) {scale = 1.00169555;
return;}
887 if (runno >= 600 && runno <= 699) {scale = 1.00175653;
return;}
888 if (runno >= 700 && runno <= 799) {scale = 1.00174358;
return;}
889 if (runno >= 800 && runno <= 899) {scale = 1.00174004;
return;}
891 B2ERROR(
"scale_momenta not ready for this exp,run "
892 << expno <<
"," << runno);
894 }
else if (expno == 49) {
895 if (runno >= 0 && runno <= 99) {scale = 1.00158837;
return;}
896 if (runno >= 100 && runno <= 199) {scale = 1.00163884;
return;}
897 if (runno >= 200 && runno <= 299) {scale = 1.00160595;
return;}
898 if (runno >= 300 && runno <= 399) {scale = 1.00149916;
return;}
899 if (runno >= 400 && runno <= 499) {scale = 1.0014956 ;
return;}
900 if (runno >= 500 && runno <= 599) {scale = 1.00156212;
return;}
901 if (runno >= 600 && runno <= 699) {scale = 1.00121868;
return;}
902 if (runno >= 700 && runno <= 799) {scale = 1.00134613;
return;}
903 if (runno >= 800 && runno <= 899) {scale = 1.00138985;
return;}
904 if (runno >= 900 && runno <= 999) {scale = 1.00129356;
return;}
905 if (runno >= 1000 && runno <= 1099) {scale = 1.00119732;
return;}
906 if (runno >= 1100 && runno <= 1199) {scale = 1.00121481;
return;}
907 if (runno >= 1200 && runno <= 1299) {scale = 1.00121108;
return;}
909 B2ERROR(
"scale_momenta not ready for this exp,run "
910 << expno <<
"," << runno);
912 }
else if (expno == 51) {
913 if (runno >= 0 && runno <= 99) {scale = 1.00160252;
return;}
914 if (runno >= 100 && runno <= 199) {scale = 1.00156099;
return;}
915 if (runno >= 200 && runno <= 299) {scale = 1.00154760;
return;}
916 if (runno >= 300 && runno <= 399) {scale = 1.00146316;
return;}
917 if (runno >= 400 && runno <= 499) {scale = 1.00145525;
return;}
918 if (runno >= 500 && runno <= 599) {scale = 1.00134429;
return;}
919 if (runno >= 600 && runno <= 699) {scale = 1.00135581;
return;}
920 if (runno >= 700 && runno <= 799) {scale = 1.00134382;
return;}
921 if (runno >= 800 && runno <= 899) {scale = 1.00126462;
return;}
922 if (runno >= 900 && runno <= 999) {scale = 1.00130752;
return;}
923 if (runno >= 1000 && runno <= 1099) {scale = 1.00130452;
return;}
924 if (runno >= 1100 && runno <= 1199) {scale = 1.00131440;
return;}
925 if (runno >= 1200 && runno <= 1299) {scale = 1.00130864;
return;}
926 if (runno >= 1300 && runno <= 1399) {scale = 1.00105290;
return;}
927 if (runno >= 1400 && runno <= 1499) {scale = 1.00126645;
return;}
928 if (runno >= 1500 && runno <= 1599) {scale = 1.00126383;
return;}
929 if (runno >= 1600 && runno <= 1699) {scale = 1.00141111;
return;}
930 if (runno >= 1700 && runno <= 1799) {scale = 1.00126220;
return;}
931 if (runno >= 1800 && runno <= 1899) {scale = 1.00105098;
return;}
933 B2ERROR(
"scale_momenta not ready for this exp,run "
934 << expno <<
"," << runno);
936 }
else if (expno == 53) {
937 if (runno >= 0 && runno <= 99) {scale = 1.0011516;
return;}
938 if (runno >= 100 && runno <= 199) {scale = 1.00115527;
return;}
939 if (runno >= 200 && runno <= 299) {scale = 1.00114844;
return;}
941 B2ERROR(
"scale_momenta not ready for this exp,run "
942 << expno <<
"," << runno);
944 }
else if (expno == 55) {
945 if (runno >= 0 && runno <= 99) {scale = 1.00114284;
return;}
946 if (runno >= 100 && runno <= 199) {scale = 1.00111458;
return;}
947 if (runno >= 200 && runno <= 299) {scale = 1.00109686;
return;}
948 if (runno >= 300 && runno <= 399) {scale = 1.00119475;
return;}
949 if (runno >= 400 && runno <= 499) {scale = 1.00117818;
return;}
950 if (runno >= 500 && runno <= 599) {scale = 1.00115789;
return;}
951 if (runno >= 600 && runno <= 699) {scale = 1.00122261;
return;}
952 if (runno >= 700 && runno <= 799) {scale = 1.00118454;
return;}
953 if (runno >= 800 && runno <= 899) {scale = 1.00118042;
return;}
954 if (runno >= 900 && runno <= 999) {scale = 1.00124759;
return;}
955 if (runno >= 1000 && runno <= 1099) {scale = 1.00128055;
return;}
956 if (runno >= 1100 && runno <= 1199) {scale = 1.00119131;
return;}
957 if (runno >= 1200 && runno <= 1299) {scale = 1.00122238;
return;}
958 if (runno >= 1300 && runno <= 1399) {scale = 1.00129538;
return;}
959 if (runno >= 1400 && runno <= 1499) {scale = 1.00130387;
return;}
960 if (runno >= 1500 && runno <= 1599) {scale = 1.00130858;
return;}
961 if (runno >= 1600 && runno <= 1699) {scale = 1.00111854;
return;}
962 if (runno >= 1700 && runno <= 1799) {scale = 1.00136261;
return;}
964 B2ERROR(
"scale_momenta not ready for this exp,run "
965 << expno <<
"," << runno);
967 }
else if (expno == 61) {
968 if (runno >= 0 && runno <= 99) {scale = 1.0009992;
return;}
969 if (runno >= 100 && runno <= 199) {scale = 1.00113704;
return;}
970 if (runno >= 200 && runno <= 299) {scale = 1.00129904;
return;}
971 if (runno >= 300 && runno <= 399) {scale = 1.00141879;
return;}
972 if (runno >= 400 && runno <= 499) {scale = 1.00146707;
return;}
973 if (runno >= 500 && runno <= 599) {scale = 1.00150101;
return;}
974 if (runno >= 600 && runno <= 699) {scale = 1.00147322;
return;}
975 if (runno >= 700 && runno <= 799) {scale = 1.00153929;
return;}
976 if (runno >= 800 && runno <= 899) {scale = 1.00159997;
return;}
977 if (runno >= 900 && runno <= 999) {scale = 1.00164032;
return;}
978 if (runno >= 1000 && runno <= 1099) {scale = 1.00165878;
return;}
979 if (runno >= 1100 && runno <= 1199) {scale = 1.00163475;
return;}
980 if (runno >= 1200 && runno <= 1207) {scale = 1.00166193;
return;}
981 if (runno >= 1208 && runno <= 1299) {scale = 1.00235824;
return;}
982 if (runno >= 1300 && runno <= 1399) {scale = 1.00242282;
return;}
984 B2ERROR(
"scale_momenta not ready for this exp,run "
985 << expno <<
"," << runno);
987 }
else if (expno == 65) {
989 B2ERROR(
"scale_momenta not ready for this exp,run "
990 << expno <<
"," << runno);
992 if (runno >= 1000 && runno <= 1336) {scale = 1.00145234;
return;}
994 B2ERROR(
"scale_momenta not ready for this exp,run "
995 << expno <<
"," << runno);
998 B2ERROR(
"scale_momenta mode=2 not ready for exp " << expno);
1005 const int runno,
double& scale)
1014 B2ERROR(
"scale_momenta mode=1 not ready for exp " << expno);
1021 }
else if (expno == 9) {
1023 }
else if (expno == 11) {
1025 }
else if (expno == 13) {
1027 }
else if (expno == 15) {
1029 }
else if (expno == 17) {
1031 }
else if (expno == 19) {
1032 B2ERROR(
"scale_momenta not ready for this exp,run "
1033 << expno <<
"," << runno);
1035 }
else if (expno == 21) {
1036 B2ERROR(
"scale_momenta not ready for this exp,run "
1037 << expno <<
"," << runno);
1039 }
else if (expno == 23) {
1040 B2ERROR(
"scale_momenta not ready for this exp,run "
1041 << expno <<
"," << runno);
1043 }
else if (expno == 25) {
1044 B2ERROR(
"scale_momenta not ready for this exp,run "
1045 << expno <<
"," << runno);
1047 }
else if (expno == 27) {
1048 B2ERROR(
"scale_momenta not ready for this exp,run "
1049 << expno <<
"," << runno);
1051 }
else if (expno == 31) {
1052 if (runno >= 0 && runno <= 137) {
1053 B2ERROR(
"scale_momenta not ready for this exp,run "
1054 << expno <<
"," << runno);
1056 if (runno >= 138 && runno <= 199) {scale = 1.000931841;
return;}
1057 if (runno >= 200 && runno <= 299) {scale = 1.000916397;
return;}
1058 if (runno >= 300 && runno <= 399) {scale = 1.00108023 ;
return;}
1059 if (runno >= 400 && runno <= 499) {scale = 1.00118662 ;
return;}
1060 if (runno >= 500 && runno <= 599) {scale = 1.00117739 ;
return;}
1061 if (runno >= 600 && runno <= 699) {scale = 1.00119542 ;
return;}
1062 if (runno >= 700 && runno <= 799) {scale = 1.00110396 ;
return;}
1063 if (runno >= 800 && runno <= 899) {scale = 1.00109603 ;
return;}
1064 if (runno >= 900 && runno <= 999) {scale = 1.00112795 ;
return;}
1065 if (runno >= 1000 && runno <= 1099) {scale = 1.00118365 ;
return;}
1066 if (runno >= 1100 && runno <= 1199) {scale = 1.00142214 ;
return;}
1067 if (runno >= 1200 && runno <= 1299) {scale = 1.00133150 ;
return;}
1068 if (runno >= 1300 && runno <= 1399) {scale = 1.00132831 ;
return;}
1069 if (runno >= 1400 && runno <= 1499) {scale = 1.00136554 ;
return;}
1070 if (runno >= 1500 && runno <= 1599) {scale = 1.00141187 ;
return;}
1071 if (runno >= 1600 && runno <= 1699) {scale = 1.00136628 ;
return;}
1072 if (runno >= 1700 && runno <= 1799) {scale = 1.00139273 ;
return;}
1073 if (runno >= 1800) {
1074 B2ERROR(
"scale_momenta not ready for this exp,run "
1075 << expno <<
"," << runno);
1077 }
else if (expno == 33) {
1078 if (runno >= 0 && runno <= 99) {scale = 1.00149319;
return;}
1079 if (runno >= 100 && runno <= 199) {scale = 1.00150915;
return;}
1080 if (runno >= 200 && runno <= 299) {scale = 1.00173040;
return;}
1081 if (runno >= 300 && runno <= 399) {scale = 1.00150449;
return;}
1082 if (runno >= 400 && runno <= 499) {scale = 1.00161519;
return;}
1083 if (runno >= 500 && runno <= 599) {scale = 1.00151670;
return;}
1084 if (runno >= 600 && runno <= 699) {scale = 1.00164347;
return;}
1085 if (runno >= 700 && runno <= 799) {scale = 1.00164165;
return;}
1086 if (runno >= 800 && runno <= 899) {scale = 1.00161369;
return;}
1088 B2ERROR(
"scale_momenta not ready for this exp,run "
1089 << expno <<
"," << runno);
1091 }
else if (expno == 35) {
1092 if (runno >= 0 && runno <= 99) {scale = 1.00147034;
return;}
1093 if (runno >= 100 && runno <= 199) {scale = 1.00148523;
return;}
1094 if (runno >= 200 && runno <= 299) {scale = 1.00153372;
return;}
1095 if (runno >= 300 && runno <= 399) {scale = 1.00148256;
return;}
1096 if (runno >= 400 && runno <= 499) {scale = 1.00144902;
return;}
1097 if (runno >= 500 && runno <= 599) {scale = 1.00131501;
return;}
1098 if (runno >= 600 && runno <= 699) {scale = 1.00126371;
return;}
1100 B2ERROR(
"scale_momenta not ready for this exp,run "
1101 << expno <<
"," << runno);
1103 }
else if (expno == 37) {
1104 if (runno >= 0 && runno <= 99) {scale = 1.000916277;
return;}
1105 if (runno >= 100 && runno <= 199) {scale = 1.001035310;
return;}
1106 if (runno >= 200 && runno <= 299) {scale = 1.001123403;
return;}
1107 if (runno >= 300 && runno <= 399) {scale = 1.001017718;
return;}
1108 if (runno >= 400 && runno <= 499) {scale = 1.000932890;
return;}
1109 if (runno >= 500 && runno <= 599) {scale = 1.000928479;
return;}
1110 if (runno >= 600 && runno <= 699) {scale = 1.000997938;
return;}
1111 if (runno >= 700 && runno <= 799) {scale = 1.000899663;
return;}
1112 if (runno >= 800 && runno <= 899) {scale = 1.000860910;
return;}
1113 if (runno >= 900 && runno <= 999) {scale = 1.000882920;
return;}
1114 if (runno >= 1000 && runno <= 1099) {scale = 1.000616966;
return;}
1115 if (runno >= 1100 && runno <= 1199) {scale = 1.000613018;
return;}
1116 if (runno >= 1200 && runno <= 1299) {scale = 1.000832338;
return;}
1117 if (runno >= 1300 && runno <= 1399) {scale = 1.000803640;
return;}
1118 if (runno >= 1400 && runno <= 1499) {scale = 1.000770454;
return;}
1119 if (runno >= 1500 && runno <= 1599) {scale = 1.000786608;
return;}
1120 if (runno >= 1600 && runno <= 1699) {scale = 1.000718089;
return;}
1121 if (runno >= 1700 && runno <= 1799) {scale = 1.000826042;
return;}
1122 if (runno >= 1800 && runno <= 1899) {scale = 1.000638150;
return;}
1123 if (runno >= 1900 && runno <= 1999) {scale = 1.000529173;
return;}
1124 if (runno >= 2000) {
1125 B2ERROR(
"scale_momenta not ready for this exp,run "
1126 << expno <<
"," << runno);
1128 }
else if (expno == 39) {
1129 if (runno >= 0 && runno <= 99) {scale = 1.000610857;
return;}
1130 if (runno >= 100 && runno <= 199) {scale = 1.000838583;
return;}
1131 if (runno >= 200 && runno <= 299) {scale = 1.00105918 ;
return;}
1132 if (runno >= 300 && runno <= 399) {scale = 1.00105841 ;
return;}
1133 if (runno >= 400 && runno <= 499) {scale = 1.001025523;
return;}
1134 if (runno >= 500 && runno <= 599) {scale = 1.000967373;
return;}
1135 if (runno >= 600 && runno <= 699) {scale = 1.000898585;
return;}
1136 if (runno >= 700 && runno <= 799) {scale = 1.001003199;
return;}
1137 if (runno >= 800 && runno <= 899) {scale = 1.000897072;
return;}
1138 if (runno >= 900 && runno <= 999) {scale = 1.000972551;
return;}
1139 if (runno >= 1000 && runno <= 1099) {scale = 1.001044677;
return;}
1140 if (runno >= 1100 && runno <= 1199) {scale = 1.00106451 ;
return;}
1141 if (runno >= 1200 && runno <= 1299) {scale = 1.00108570 ;
return;}
1142 if (runno >= 1300 && runno <= 1399) {scale = 1.00102381 ;
return;}
1143 if (runno >= 1400) {
1144 B2ERROR(
"scale_momenta not ready for this exp,run "
1145 << expno <<
"," << runno);
1147 }
else if (expno == 41) {
1148 if (runno >= 0 && runno <= 99) {scale = 1.00189378;
return;}
1149 if (runno >= 100 && runno <= 199) {scale = 1.00197304;
return;}
1150 if (runno >= 200 && runno <= 299) {scale = 1.00204049;
return;}
1151 if (runno >= 300 && runno <= 399) {scale = 1.00205065;
return;}
1152 if (runno >= 400 && runno <= 499) {scale = 1.00199205;
return;}
1153 if (runno >= 500 && runno <= 599) {scale = 1.00195618;
return;}
1154 if (runno >= 600 && runno <= 699) {scale = 1.00200889;
return;}
1155 if (runno >= 700 && runno <= 799) {scale = 1.00190365;
return;}
1156 if (runno >= 800 && runno <= 899) {scale = 1.00204192;
return;}
1157 if (runno >= 900 && runno <= 999) {scale = 1.00196542;
return;}
1158 if (runno >= 1000 && runno <= 1099) {scale = 1.00189706;
return;}
1159 if (runno >= 1100 && runno <= 1199) {scale = 1.00187422;
return;}
1160 if (runno >= 1200 && runno <= 1299) {scale = 1.00183714;
return;}
1161 if (runno >= 1300) {
1162 B2ERROR(
"scale_momenta not ready for this exp,run "
1163 << expno <<
"," << runno);
1165 }
else if (expno == 43) {
1166 if (runno >= 0 && runno <= 99) {scale = 1.00151737;
return;}
1167 if (runno >= 100 && runno <= 199) {scale = 1.00110489;
return;}
1168 if (runno >= 200 && runno <= 299) {scale = 1.00108144;
return;}
1169 if (runno >= 300 && runno <= 399) {scale = 1.00114918;
return;}
1170 if (runno >= 400 && runno <= 499) {scale = 1.00122723;
return;}
1171 if (runno >= 500 && runno <= 599) {scale = 1.00111069;
return;}
1172 if (runno >= 600 && runno <= 699) {scale = 1.00115667;
return;}
1173 if (runno >= 700 && runno <= 799) {scale = 1.00113759;
return;}
1174 if (runno >= 800 && runno <= 899) {scale = 1.00115609;
return;}
1175 if (runno >= 900 && runno <= 999) {scale = 1.00105426;
return;}
1179 if (runno >= 1000 && runno <= 1099) {scale = 1.00111210;
return;}
1180 if (runno >= 1100 && runno <= 1199) {scale = 1.00123104;
return;}
1181 if (runno >= 1200) {
1182 B2ERROR(
"scale_momenta not ready for this exp,run "
1183 << expno <<
"," << runno);
1185 }
else if (expno == 45) {
1186 if (runno >= 0 && runno <= 99) {scale = 1.00136477;
return;}
1187 if (runno >= 100 && runno <= 199) {scale = 1.00151600;
return;}
1188 if (runno >= 200 && runno <= 299) {scale = 1.00146757;
return;}
1189 if (runno >= 300 && runno <= 399) {scale = 1.00153299;
return;}
1190 if (runno >= 400 && runno <= 499) {scale = 1.00159018;
return;}
1192 B2ERROR(
"scale_momenta not ready for this exp,run "
1193 << expno <<
"," << runno);
1195 }
else if (expno == 47) {
1196 if (runno >= 0 && runno <= 99) {scale = 1.00166672;
return;}
1197 if (runno >= 100 && runno <= 199) {scale = 1.00165120;
return;}
1198 if (runno >= 200 && runno <= 299) {scale = 1.00175597;
return;}
1199 if (runno >= 300 && runno <= 399) {scale = 1.00177319;
return;}
1200 if (runno >= 400 && runno <= 499) {scale = 1.00179552;
return;}
1201 if (runno >= 500 && runno <= 599) {scale = 1.00179413;
return;}
1202 if (runno >= 600 && runno <= 699) {scale = 1.00186237;
return;}
1203 if (runno >= 700 && runno <= 799) {scale = 1.00183016;
return;}
1204 if (runno >= 800 && runno <= 899) {scale = 1.00184324;
return;}
1206 B2ERROR(
"scale_momenta not ready for this exp,run "
1207 << expno <<
"," << runno);
1209 }
else if (expno == 49) {
1210 if (runno >= 0 && runno <= 99) {scale = 1.00171645;
return;}
1211 if (runno >= 100 && runno <= 199) {scale = 1.00177728;
return;}
1212 if (runno >= 200 && runno <= 299) {scale = 1.00173301;
return;}
1213 if (runno >= 300 && runno <= 399) {scale = 1.00162075;
return;}
1214 if (runno >= 400 && runno <= 499) {scale = 1.00163153;
return;}
1215 if (runno >= 500 && runno <= 599) {scale = 1.00168559;
return;}
1216 if (runno >= 600 && runno <= 699) {scale = 1.00139227;
return;}
1217 if (runno >= 700 && runno <= 799) {scale = 1.00148583;
return;}
1218 if (runno >= 800 && runno <= 899) {scale = 1.00150403;
return;}
1219 if (runno >= 900 && runno <= 999) {scale = 1.00142759;
return;}
1220 if (runno >= 1000 && runno <= 1099) {scale = 1.00134573;
return;}
1221 if (runno >= 1100 && runno <= 1199) {scale = 1.00138313;
return;}
1222 if (runno >= 1200 && runno <= 1299) {scale = 1.00151369;
return;}
1223 if (runno >= 1300) {
1224 B2ERROR(
"scale_momenta not ready for this exp,run "
1225 << expno <<
"," << runno);
1227 }
else if (expno == 51) {
1228 if (runno >= 0 && runno <= 99) {scale = 1.00165035;
return;}
1229 if (runno >= 100 && runno <= 199) {scale = 1.00161504;
return;}
1230 if (runno >= 200 && runno <= 299) {scale = 1.00160162;
return;}
1231 if (runno >= 300 && runno <= 399) {scale = 1.00152725;
return;}
1232 if (runno >= 400 && runno <= 499) {scale = 1.00149943;
return;}
1233 if (runno >= 500 && runno <= 599) {scale = 1.00141294;
return;}
1234 if (runno >= 600 && runno <= 699) {scale = 1.00140154;
return;}
1235 if (runno >= 700 && runno <= 799) {scale = 1.00140759;
return;}
1236 if (runno >= 800 && runno <= 899) {scale = 1.00133671;
return;}
1237 if (runno >= 900 && runno <= 999) {scale = 1.00136792;
return;}
1238 if (runno >= 1000 && runno <= 1099) {scale = 1.00135251;
return;}
1239 if (runno >= 1100 && runno <= 1199) {scale = 1.00138229;
return;}
1240 if (runno >= 1200 && runno <= 1299) {scale = 1.00134938;
return;}
1241 if (runno >= 1300 && runno <= 1399) {scale = 1.00106240;
return;}
1242 if (runno >= 1400 && runno <= 1499) {scale = 1.00132666;
return;}
1243 if (runno >= 1500 && runno <= 1599) {scale = 1.00132654;
return;}
1244 if (runno >= 1600 && runno <= 1699) {scale = 1.00146619;
return;}
1245 if (runno >= 1700 && runno <= 1799) {scale = 1.00131902;
return;}
1246 if (runno >= 1800 && runno <= 1899) {scale = 1.00114243;
return;}
1247 if (runno >= 1900) {
1248 B2ERROR(
"scale_momenta not ready for this exp,run "
1249 << expno <<
"," << runno);
1251 }
else if (expno == 53) {
1252 if (runno >= 0 && runno <= 99) {scale = 1.00125475;
return;}
1253 if (runno >= 100 && runno <= 199) {scale = 1.00124954;
return;}
1254 if (runno >= 200 && runno <= 299) {scale = 1.00122914;
return;}
1256 B2ERROR(
"scale_momenta not ready for this exp,run "
1257 << expno <<
"," << runno);
1259 }
else if (expno == 55) {
1260 if (runno >= 0 && runno <= 99) {scale = 1.00119352;
return;}
1261 if (runno >= 100 && runno <= 199) {scale = 1.00117130;
return;}
1262 if (runno >= 200 && runno <= 299) {scale = 1.00115825;
return;}
1263 if (runno >= 300 && runno <= 399) {scale = 1.00125005;
return;}
1264 if (runno >= 400 && runno <= 499) {scale = 1.00124720;
return;}
1265 if (runno >= 500 && runno <= 599) {scale = 1.00122234;
return;}
1266 if (runno >= 600 && runno <= 699) {scale = 1.00128709;
return;}
1267 if (runno >= 700 && runno <= 799) {scale = 1.00123081;
return;}
1268 if (runno >= 800 && runno <= 899) {scale = 1.00124198;
return;}
1269 if (runno >= 900 && runno <= 999) {scale = 1.00131118;
return;}
1270 if (runno >= 1000 && runno <= 1099) {scale = 1.00132496;
return;}
1271 if (runno >= 1100 && runno <= 1199) {scale = 1.00126186;
return;}
1272 if (runno >= 1200 && runno <= 1299) {scale = 1.00127849;
return;}
1273 if (runno >= 1300 && runno <= 1399) {scale = 1.00135312;
return;}
1274 if (runno >= 1400 && runno <= 1499) {scale = 1.00136637;
return;}
1275 if (runno >= 1500 && runno <= 1599) {scale = 1.00136270;
return;}
1276 if (runno >= 1600 && runno <= 1699) {scale = 1.00118422;
return;}
1277 if (runno >= 1700 && runno <= 1799) {scale = 1.00142667;
return;}
1278 if (runno >= 1800) {
1279 B2ERROR(
"scale_momenta not ready for this exp,run "
1280 << expno <<
"," << runno);
1282 }
else if (expno == 61) {
1283 if (runno >= 0 && runno <= 99) {scale = 1.00103013;
return;}
1284 if (runno >= 100 && runno <= 199) {scale = 1.00116185;
return;}
1285 if (runno >= 200 && runno <= 299) {scale = 1.00133560;
return;}
1286 if (runno >= 300 && runno <= 399) {scale = 1.00145027;
return;}
1287 if (runno >= 400 && runno <= 499) {scale = 1.00147949;
return;}
1288 if (runno >= 500 && runno <= 599) {scale = 1.00151022;
return;}
1289 if (runno >= 600 && runno <= 699) {scale = 1.00150439;
return;}
1290 if (runno >= 700 && runno <= 799) {scale = 1.00155006;
return;}
1291 if (runno >= 800 && runno <= 899) {scale = 1.00162396;
return;}
1292 if (runno >= 900 && runno <= 999) {scale = 1.00168542;
return;}
1293 if (runno >= 1000 && runno <= 1099) {scale = 1.00168249;
return;}
1294 if (runno >= 1100 && runno <= 1207) {scale = 1.00166891;
return;}
1295 if (runno >= 1208 && runno <= 1299) {scale = 1.00249956;
return;}
1296 if (runno >= 1300 && runno <= 1399) {scale = 1.00255134;
return;}
1297 if (runno >= 1400) {
1298 B2ERROR(
"scale_momenta not ready for this exp,run "
1299 << expno <<
"," << runno);
1301 }
else if (expno == 63) {
1302 if (runno >= 0 && runno <= 99) {scale = 1.00129667;
return;}
1303 if (runno >= 100 && runno <= 199) {scale = 1.00123725;
return;}
1304 if (runno >= 200 && runno <= 299) {scale = 1.00126795;
return;}
1305 if (runno >= 300 && runno <= 399) {scale = 1.00122458;
return;}
1306 if (runno >= 400 && runno <= 499) {scale = 1.00116489;
return;}
1307 if (runno >= 500 && runno <= 599) {scale = 1.00116968;
return;}
1308 if (runno >= 600 && runno <= 699) {scale = 1.000918379;
return;}
1309 if (runno >= 700 && runno <= 799) {scale = 1.0010429;
return;}
1311 B2ERROR(
"scale_momenta not ready for this exp,run "
1312 << expno <<
"," << runno);
1314 }
else if (expno == 65) {
1315 if (runno >= 0 && runno <= 99) {scale = 1.00116975;
return;}
1316 if (runno >= 100 && runno <= 199) {scale = 1.00111926;
return;}
1317 if (runno >= 200 && runno <= 299) {scale = 1.00110162;
return;}
1318 if (runno >= 300 && runno <= 399) {scale = 1.00109524;
return;}
1319 if (runno >= 400 && runno <= 499) {scale = 1.00106913;
return;}
1320 if (runno >= 500 && runno <= 599) {scale = 1.00110941;
return;}
1321 if (runno >= 600 && runno <= 699) {scale = 1.000897865;
return;}
1322 if (runno >= 700 && runno <= 999) {scale = 1.00104385;
return;}
1323 if (runno >= 1000 && runno <= 1299) {scale = 1.000876489;
return;}
1324 if (runno >= 1000) {
1325 B2ERROR(
"scale_momenta not ready for this exp,run "
1326 << expno <<
"," << runno);
1328 }
else if (expno == 67) {
1329 if (runno >= 0 && runno <= 199) {scale = 1.000826364;
return;}
1330 if (runno >= 200 && runno <= 299) {scale = 1.000836576;
return;}
1331 if (runno >= 300 && runno <= 399) {scale = 1.000904815;
return;}
1332 if (runno >= 400 && runno <= 499) {scale = 1.000966045;
return;}
1333 if (runno >= 500 && runno <= 599) {scale = 1.000988147;
return;}
1334 if (runno >= 600 && runno <= 699) {scale = 1.000988147;
return;}
1335 if (runno >= 700 && runno <= 742) {scale = 1.000837414;
return;}
1336 if (runno >= 1000 && runno <= 1099) {scale = 1.000984865;
return;}
1337 if (runno >= 1100 && runno <= 1123) {scale = 1.00105248 ;
return;}
1338 if (runno >= 1124) {
1339 B2ERROR(
"scale_momenta not ready for this exp,run "
1340 << expno <<
"," << runno);
1342 }
else if (expno == 69) {
1343 if (runno >= 0 && runno <= 99) {scale = 1.000791450;
return;}
1344 if (runno >= 100 && runno <= 199) {scale = 1.000891748;
return;}
1345 if (runno >= 200 && runno <= 299) {scale = 1.000866165;
return;}
1346 if (runno >= 300 && runno <= 399) {scale = 1.000838834;
return;}
1347 if (runno >= 400 && runno <= 499) {scale = 1.000811878;
return;}
1348 if (runno >= 500 && runno <= 599) {scale = 1.000779810;
return;}
1349 if (runno >= 600 && runno <= 699) {scale = 1.000799086;
return;}
1350 if (runno >= 700 && runno <= 799) {scale = 1.000833797;
return;}
1351 if (runno >= 800 && runno <= 899) {scale = 1.000875203;
return;}
1352 if (runno >= 900 && runno <= 999) {scale = 1.000891998;
return;}
1353 if (runno >= 1000 && runno <= 1099) {scale = 1.000921074;
return;}
1354 if (runno >= 1100 && runno <= 1199) {scale = 1.000900829;
return;}
1355 if (runno >= 1200 && runno <= 1299) {scale = 1.000958405;
return;}
1356 if (runno >= 1300 && runno <= 1399) {scale = 1.000836841;
return;}
1357 if (runno >= 1400) {
1358 B2ERROR(
"scale_momenta not ready for this exp,run "
1359 << expno <<
"," << runno);
1361 }
else if (expno == 71) {
1362 if (runno >= 0 && runno <= 99) {scale = 1.000962999;
return;}
1363 if (runno >= 100 && runno <= 199) {scale = 1.001478932;
return;}
1364 if (runno >= 200 && runno <= 300) {scale = 1.001486524;
return;}
1365 if (runno >= 301 && runno <= 384) {scale = 1.001430843;
return;}
1366 if (runno >= 385 && runno <= 499) {scale = 1.001505696;
return;}
1367 if (runno >= 500 && runno <= 599) {scale = 1.001523980;
return;}
1368 if (runno >= 600 && runno <= 699) {scale = 1.001480830;
return;}
1369 if (runno >= 1000 && runno <= 1013) {scale = 1.001480830;
return;}
1370 if (runno >= 2000 && runno <= 2099) {scale = 1.001617882;
return;}
1371 if (runno >= 2100 && runno <= 2199) {scale = 1.001644395;
return;}
1372 if (runno >= 2200 && runno <= 2299) {scale = 1.001722184;
return;}
1373 if (runno >= 700 && runno <= 999) {
1374 B2ERROR(
"scale_momenta not ready for this exp,run "
1375 << expno <<
"," << runno);
1377 if (runno >= 1014 && runno <= 1999) {
1378 B2ERROR(
"scale_momenta not ready for this exp,run "
1379 << expno <<
"," << runno);
1381 if (runno >= 2299) {
1382 B2ERROR(
"scale_momenta not ready for this exp,run "
1383 << expno <<
"," << runno);
1385 }
else if (expno == 73) {
1386 if (runno >= 0 && runno <= 99) {scale = 1.000721587;
return;}
1387 if (runno >= 100 && runno <= 199) {scale = 1.000707089;
return;}
1388 if (runno >= 200 && runno <= 299) {scale = 1.000722517;
return;}
1389 if (runno >= 300 && runno <= 399) {scale = 1.000722517;
return;}
1390 if (runno >= 400 && runno <= 499) {scale = 1.000750776;
return;}
1391 if (runno >= 500 && runno <= 599) {scale = 1.000729771;
return;}
1392 if (runno >= 600 && runno <= 699) {scale = 1.000751190;
return;}
1393 if (runno >= 700 && runno <= 799) {scale = 1.000702455;
return;}
1394 if (runno >= 800 && runno <= 899) {scale = 1.000771074;
return;}
1395 if (runno >= 900 && runno <= 999) {scale = 1.000868463;
return;}
1396 if (runno >= 1000) {
1397 B2ERROR(
"scale_momenta not ready for this exp,run "
1398 << expno <<
"," << runno);
1402 B2ERROR(
"scale_momenta mode=2 not ready for exp " << expno);
1469 get_event_id(
int* no_exp,
int* no_run,
int* no_evt,
int* no_frm,
int* expmc)
1471 *no_exp = -1, *no_run = -1, *no_evt = -1, *no_frm = -1;
1473 belle_event* belle_event;
1474 belle_event = (
struct belle_event*)BsGetEnt(BELLE_EVENT, 1, BBS_No_Index);
1476 *no_exp = belle_event->m_ExpNo;
1477 *no_run = belle_event->m_RunNo;
1478 *no_evt = belle_event->m_EvtNo & 0x0fffffff;
1479 *no_frm = (
unsigned int)belle_event->m_EvtNo >> 28;
1480 *expmc = belle_event->m_ExpMC;
1488 Belle::Mdst_event_add_Manager& addmgr = Belle::Mdst_event_add_Manager::get_manager();
1489 if (addmgr.count() >= 1) {
1491 if (addmgr[0].flag_error() == 1) {
1496 addmgr[0].flag_error(1);
1502 static int first = 1;
1503 B2ERROR(
"scale_error: no Mdst_event_add");
1505 B2ERROR(
"scale_error: analysis continues");
1506 B2ERROR(
"scale_error: scale_error will not be applied");
1519 vfunc(
const double x,
const double x1,
const double yc,
const double a1,
const double a2)
1521 return x < x1 ? (x - x1) * a1 + yc :
1522 (x - x1) * a2 + yc ;
1526 cupfunc(
const double x,
const double x1,
const double x2,
const double yc,
const double a1,
const double a2)
1528 return x < x1 ? (x - x1) * a1 + yc :
1529 x > x2 ? (x - x2) * a2 + yc : yc;
1533 rootfunc(
const double x,
const double x1,
const double x2,
const double yc,
const double a1,
const double a2)
1535 return x < x1 ? (x - x1) * a1 + yc :
1536 x > x2 ? (x2 - x1) * a2 + yc : (x - x1) * a2 + yc;
1541 lambdafunc(
const double x,
const double x1,
const double x2,
const double yc,
const double a1,
const double a2,
const double a3)
1543 return x < x1 ? (x - x1) * a1 + yc :
1544 x < x2 ? (x - x1) * a2 + yc : (x - x2) * a3 + (x2 - x1) * a2 + yc;
1562 scale[0] = +1.0115E+00 - 3.6966E-02 * pt;
1563 scale[1] = +9.8369E-01 + 3.2783E-02 * pt;
1564 scale[2] = +6.8401E-01 + 1.0190E-01 * pt;
1565 scale[3] = +1.0968E+00 - 3.3011E-02 * pt;
1566 scale[4] = +1.0992E+00 - 2.7929E-02 * pt;
1578 scale[0] = +1.0257E+00 - 0.30671E-01 * pt;
1579 scale[1] = +1.0503E+00 + 0.97257E-02 * pt;
1580 scale[2] = +0.70751E+00 + 0.93039E-01 * pt;
1581 scale[3] = +1.0720E+00 - 0.15976E-01 * pt;
1582 scale[4] = +1.0530E+00 + 0.63696E-02 * pt;
1594 scale[0] = 1.0874 - 0.26640E-01 * pt;
1595 scale[1] = 1.0320 + 0.18869E-01 * pt;
1596 scale[2] = 0.75302 + 0.89109E-01 * pt;
1597 scale[3] = 1.1435 - 0.73830E-01 * pt;
1598 scale[4] = 1.1227 - 0.19112E-01 * pt;
1616 scale[0] = 1.1197 - 0.15104E-01 * pt;
1617 scale[1] = 1.0502 + 0.22138E-01 * pt;
1618 scale[2] = 0.75267 + 0.85377E-01 * pt;
1621 scale[3] = 1.1608 - 0.43478E-01 * pt;
1622 scale[4] = 1.0936 + 0.18447E-01 * pt;
1625 scale[0] = 0.98971 - 0.12162E-01 * pt;
1626 scale[1] = 1.0132 + 0.22283E-01 * pt;
1627 scale[2] = 0.74947 + 0.81233E-01 * pt;
1628 scale[3] = 1.0601 - 0.54626E-01 * pt;
1629 scale[4] = 1.0454 - 0.33036E-02 * pt;
1647 scale[0] = 1.0835 + 0.79781E-02 * pt;
1648 scale[1] = 1.0685 + 0.13339E-01 * pt;
1649 scale[2] = 0.72615 + 0.96936E-01 * pt;
1650 scale[3] = 1.1298 - 0.35734E-01 * pt;
1651 scale[4] = 1.0994 + 0.13150E-01 * pt;
1667 scale[0] = 1.0694 - 0.19048E-01 * pt;
1668 scale[1] = 1.0732 + 0.95531E-02 * pt;
1669 scale[2] = 0.74888 + 0.89957E-01 * pt;
1670 scale[3] = 1.1107 - 0.57216E-01 * pt;
1671 scale[4] = 1.1098 - 0.13305E-01 * pt;
1684 scale[0] = 1.055465 - 0.2863498E-01 * pt;
1685 scale[1] = 1.005986 + 0.2709512E-01 * pt;
1686 scale[2] = 0.7459061 + 0.8352030E-01 * pt;
1687 scale[3] = 1.056039 - 0.6258768E-01 * pt;
1688 scale[4] = 1.043329 - 0.2975207E-03 * pt;
1700 scale[0] = 1.013759 - 0.8743831E-02 * pt;
1701 scale[1] = 1.071626 - 0.1333353E-01 * pt;
1702 scale[2] = 0.7507483 + 0.8399138E-01 * pt;
1703 scale[3] = 1.054345 - 0.5644758E-01 * pt;
1704 scale[4] = 1.020721 + 0.1323117E-01 * pt;
1716 scale[0] = 1.011008 - 0.2272887E-01 * pt;
1717 scale[1] = 1.030603 + 0.8892579E-02 * pt;
1718 scale[2] = 0.7181793 + 0.9717058E-01 * pt;
1719 scale[3] = 1.065804 - 0.6852337E-01 * pt;
1720 scale[4] = 1.085136 - 0.2324515E-01 * pt;
1732 scale[0] = 0.9806778 - 0.2010826E-02 * pt;
1733 scale[1] = 0.9996797 + 0.2633917E-01 * pt;
1734 scale[2] = 0.7450445 + 0.7637244E-01 * pt;
1735 scale[3] = 1.084419 - 0.6828102E-01 * pt;
1736 scale[4] = 1.013550 + 0.1201861E-01 * pt;
1748 scale[0] = 1.000635 - 0.1659129E-01 * pt;
1749 scale[1] = 1.046513 - 0.2994663E-02 * pt;
1750 scale[2] = 0.7241409 + 0.9558808E-01 * pt;
1751 scale[3] = 1.062597 - 0.6663921E-01 * pt;
1752 scale[4] = 1.076486 - 0.2023062E-01 * pt;
1764 scale[0] = 0.98242 - 0.71780E-02 * pt;
1765 scale[1] = 1.0465 + 0.44401E-03 * pt;
1766 scale[2] = 0.71433 + 0.10176 * pt;
1767 scale[3] = 1.0875 - 0.80972E-01 * pt;
1768 scale[4] = 1.0777 - 0.20428E-01 * pt;
1780 scale[0] = 0.99832 - 0.17290E-01 * pt;
1781 scale[1] = 1.0434 + 0.47995E-02 * pt;
1782 scale[2] = 0.72111 + 0.10093 * pt;
1783 scale[3] = 1.1022 - 0.87951E-01 * pt;
1784 scale[4] = 1.0643 - 0.11962E-01 * pt;
1796 scale[0] = 0.98871 - 0.88399E-02 * pt;
1797 scale[1] = 1.0159 + 0.16468E-01 * pt;
1798 scale[2] = 0.72813 + 0.94737E-01 * pt;
1799 scale[3] = 1.1060 - 0.88323E-01 * pt;
1800 scale[4] = 1.0914 - 0.30607E-01 * pt;
1812 scale[0] = 0.97322 - 0.29003E-02 * pt;
1813 scale[1] = 0.94704 + 0.44719E-01 * pt;
1814 scale[2] = 0.73547 + 0.98431E-01 * pt;
1815 scale[3] = 1.0752 - 0.77818E-01 * pt;
1816 scale[4] = 1.0759 - 0.27057E-01 * pt;
1819 scale[0] *= 0.99600 - 0.97573E-02 * tanl;
1820 scale[1] *= 1.0080 - 0.37122E-01 * tanl;
1821 scale[2] *= 0.99150 - 0.13390E-01 * tanl;
1822 scale[3] *= 0.99758 - 0.43508E-01 * tanl;
1823 scale[4] *= 0.99913 + 0.34211E-01 * tanl;
1835 scale[0] = 0.99845 - 0.18739E-01 * pt;
1836 scale[1] = 1.0024 + 0.17833E-01 * pt;
1837 scale[2] = 0.72369 + 0.96994E-01 * pt;
1838 scale[3] = 1.0605 - 0.64072E-01 * pt;
1839 scale[4] = 1.0623 - 0.14320E-01 * pt;
1842 scale[0] *= 0.99597 - 0.13069E-01 * tanl;
1843 scale[1] *= 1.0072 - 0.18622E-01 * tanl;
1844 scale[2] *= 0.99515 - 0.16591E-01 * tanl;
1845 scale[3] *= 0.99466 - 0.14489E-02 * tanl;
1846 scale[4] *= 1.0036 - 0.15095E-01 * tanl;
1861 scale[0] = 0.96783 - 0.37174E-02 * pt;
1862 scale[1] = 0.97888 + 0.34689E-01 * pt;
1863 scale[2] = 0.80870 + 0.68302E-01 * pt;
1864 scale[3] = 1.0615 - 0.60750E-01 * pt;
1865 scale[4] = 1.0372 - 0.52332E-03 * pt;
1868 scale[0] *= 0.99897 + 0.62207E-02 * tanl;
1869 scale[1] *= 1.0037 + 0.10714E-01 * tanl;
1870 scale[2] *= 0.99129 - 0.92521E-02 * tanl;
1871 scale[3] *= 0.99483 - 0.43402E-02 * tanl;
1872 scale[4] *= 1.0062 + 0.15306E-01 * tanl;
1885 scale[0] = +1.1280E+00 - 7.6839E-03 * pt;
1886 scale[1] = +1.1368E+00 + 2.8106E-02 * pt;
1887 scale[2] = +7.6448E-01 + 1.1248E-01 * pt;
1888 scale[3] = +1.1396E+00 - 3.6738E-02 * pt;
1889 scale[4] = +1.1766E+00 - 2.7477E-02 * pt;
1901 scale[0] = +1.1002E+00 + 3.9852E-02 * pt;
1902 scale[1] =
rootfunc(pt, 1.0015, 1.6591, 1.0420, -0.31809, 0.17149);
1903 scale[2] = +8.4706E-01 + 0.8914E-01 * pt;
1904 scale[3] = +1.1067E+00 + 1.0304E-02 * pt;
1905 scale[4] = +1.0495E+00 + 3.9923E-02 * pt;
1917 scale[0] = 1.1908 + 0.20678E-02 * pt;
1918 scale[1] = 1.0304 + 0.54826E-01 * pt;
1919 scale[2] = 1.0806 + 0.33829E-01 * pt;
1920 scale[3] = 1.1325 - 0.34811E-01 * pt;
1921 scale[4] = 1.1549 - 0.20974E-01 * pt;
1938 scale[0] = 1.2175 + 0.14290E-01 * pt;
1939 scale[1] = 1.0362 + 0.80614E-01 * pt;
1940 scale[2] = 1.0313 + 0.12930E-01 * pt;
1941 scale[3] = 1.0411 + 0.17319E-01 * pt;
1942 scale[4] = 1.0445 + 0.27526E-01 * pt;
1945 scale[0] = 1.2712 - 0.42098E-01 * pt;
1946 scale[1] = 1.0634 - 0.13652E-01 * pt;
1947 scale[2] = 0.95435 + 0.64895E-01 * pt;
1948 scale[3] = 1.0758 + 0.10778E-01 * pt;
1949 scale[4] = 1.0892 - 0.75700E-02 * pt;
1968 scale[0] = 1.1084 + 0.45825E-01 * pt;
1969 scale[1] = 1.1014 + 0.14211E-01 * pt;
1970 scale[2] = 0.99716 + 0.52509E-01 * pt;
1971 scale[3] = 1.1361 - 0.25355E-01 * pt;
1972 scale[4] = 1.1079 - 0.92563E-02 * pt;
1987 scale[0] = 1.2129 + 0.36787E-01 * pt;
1988 scale[1] = 1.0750 + 0.32722E-01 * pt;
1989 scale[2] = 0.98340 + 0.39096E-01 * pt;
1990 scale[3] = 1.1768 - 0.43894E-01 * pt;
1991 scale[4] = 1.1275 - 0.12562E-02 * pt;
2003 scale[0] = 1.182285 + 0.4142677E-01 * pt;
2004 scale[1] = 1.090022 + 0.2995044E-01 * pt;
2005 scale[2] = 0.9581690 + 0.5764173E-01 * pt;
2006 scale[3] = 1.119173 - 0.2177483E-01 * pt;
2007 scale[4] = 1.126323 - 0.3786523E-02 * pt;
2019 scale[0] = 1.262359 + 0.1411302E-01 * pt;
2020 scale[1] = 1.051793 + 0.6225422E-01 * pt;
2021 scale[2] = 0.9668697 + 0.5492099E-01 * pt;
2022 scale[3] = 1.110838 - 0.2386986E-01 * pt;
2023 scale[4] = 1.106516 + 0.1239970E-01 * pt;
2035 scale[0] = 1.164526 + 0.7671143E-01 * pt;
2036 scale[1] = 1.094987 + 0.2949413E-01 * pt;
2037 scale[2] = 1.084826 + 0.2513991E-01 * pt;
2038 scale[3] = 1.099221 - 0.2389658E-02 * pt;
2039 scale[4] = 1.146892 + 0.2682884E-02 * pt;
2051 scale[0] = 1.243211 + 0.5776083E-01 * pt;
2052 scale[1] = 1.209483 - 0.3366023E-01 * pt;
2053 scale[2] = 1.059087 + 0.4300838E-01 * pt;
2054 scale[3] = 1.123665 + 0.6342933E-02 * pt;
2055 scale[4] = 1.208850 - 0.3171053E-01 * pt;
2067 scale[0] = 1.2097 + 0.36177E-01 * pt;
2068 scale[1] = 1.2218 - 0.84772E-02 * pt;
2069 scale[2] = 0.97937 + 0.26397E-01 * pt;
2070 scale[3] = 1.0944 - 0.12745E-02 * pt;
2071 scale[4] = 1.2140 - 0.56809E-01 * pt;
2074 scale[0] *= 1.0492 + 0.72972E-01 * tanl;
2075 scale[1] *= 1.0298 + 0.40625E-02 * tanl;
2076 scale[2] *= 0.93367 + 0.11969E-01 * tanl;
2077 scale[3] *= 1.0170 + 0.41039E-01 * tanl;
2078 scale[4] *= 1.0677 - 0.41684E-01 * tanl;
2090 scale[0] = 1.2587 + 0.32782E-01 * pt;
2091 scale[1] = 1.2413 - 0.36535E-01 * pt;
2092 scale[2] = 0.97465 + 0.22937E-01 * pt;
2093 scale[3] = 1.1197 - 0.59050E-02 * pt;
2094 scale[4] = 1.1877 - 0.32893E-01 * pt;
2106 scale[0] = 1.2654 + 0.15660E-01 * pt;
2107 scale[1] = 1.0278 + 0.81680E-01 * pt;
2108 scale[2] = 0.94291 + 0.54575E-01 * pt;
2109 scale[3] = 1.1151 - 0.52387E-02 * pt;
2110 scale[4] = 1.1020 + 0.10518E-01 * pt;
2113 scale[0] *= 1.0334 + 0.10236E-01 * tanl;
2114 scale[1] *= 1.0346 + 0.11024E-01 * tanl;
2116 scale[3] *= 1.0140 + 0.19030E-01 * tanl;
2117 scale[4] *= 1.0345 - 0.90291E-01 * tanl;
2129 scale[0] = 1.1184 + 0.55671E-01 * pt;
2130 scale[1] = 1.1142 + 0.74526E-02 * pt;
2131 scale[2] = 0.93626 + 0.66670E-01 * pt;
2132 scale[3] = 1.1003 - 0.11587E-01 * pt;
2133 scale[4] = 1.1589 - 0.40223E-01 * pt;
2136 scale[0] *= 1.0442 - 0.46775E-01 * tanl;
2137 scale[1] *= 1.0337 + 0.44071E-01 * tanl;
2139 scale[3] *= 1.0037 + 0.29736E-01 * tanl;
2140 scale[4] *= 1.0378 - 0.73239E-01 * tanl;
2152 scale[0] = 1.1598 + 0.28880E-01 * pt;
2153 scale[1] = 1.0844 + 0.23384E-01 * pt;
2154 scale[2] = 0.94566 + 0.53157E-01 * pt;
2155 scale[3] = 1.1578 - 0.31156E-01 * pt;
2156 scale[4] = 1.0725 + 0.13714E-01 * pt;
2159 scale[0] *= 1.0223 - 0.56165E-02 * tanl;
2160 scale[1] *= 1.0203 - 0.81857E-02 * tanl;
2162 scale[3] *= 0.99703 + 0.14976E-01 * tanl;
2163 scale[4] *= 1.0212 + 0.41300E-01 * tanl;
2178 scale[0] = 1.2101 + 0.29496E-01 * pt;
2179 scale[1] = 1.0723 + 0.13773E-01 * pt;
2180 scale[2] = 0.90988 + 0.78667E-01 * pt;
2181 scale[3] = 1.1444 - 0.20780E-01 * pt;
2182 scale[4] = 1.0962 + 0.83309E-02 * pt;
2185 scale[0] *= 1.0207 - 0.17810E-01 * tanl;
2186 scale[1] *= 1.0272 + 0.61498E-01 * tanl;
2188 scale[3] *= 0.99766 + 0.32434E-01 * tanl;
2189 scale[4] *= 1.0200 - 0.14935E-01 * tanl;
2202 scale[0] =
vfunc(pt, 0.34602, 1.0605, -0.36011, 0.38189E-01);
2204 scale[2] =
cupfunc(pt, 0.44599, 1.2989, 0.85646, -0.73968, 0.17425);
2205 scale[3] = 1.1460 - 0.57101E-01 * pt;
2209 scale[0] *= +1.0122E+00 + 1.3568E-04 * tanl + 1.9856E-02 * tanl * tanl;
2210 scale[1] *= +1.0002E+00 - 4.5128E-03 * tanl + 1.6211E-02 * tanl * tanl;
2211 scale[2] *= +9.7051E-01 + 2.6876E-02 * tanl + 8.2365E-02 * tanl * tanl;
2212 scale[3] *= +9.7198E-01 + 3.8373E-02 * tanl + 4.9111E-02 * tanl * tanl;
2213 scale[4] *= +9.8880E-01 + 2.2090E-02 * tanl + 2.2701E-02 * tanl * tanl;
2225 scale[0] = 1.092E+00 - 0.86138E-01 * pt;
2226 scale[1] = 1.0448E+00 - 0.26158E-01 * pt;
2227 scale[2] = 1.1942E+00 - 1.0025E+00 * pt + 0.85334 * pt * pt - 0.20305 * pt * pt * pt;
2228 scale[3] = 1.1260E+00 - 0.46048E-01 * pt;
2229 scale[4] = 1.0378E+00 + 0.5109E-01 * pt;
2232 scale[0] *= +1.0136E+00 + 0.15293E-01 * tanl;
2233 scale[1] *= +0.9936E+00 + 0.71983E-02 * tanl + 0.14004E-01 * tanl * tanl;
2234 scale[2] *= +0.97532E+00 + 0.22718E-01 * tanl + 0.73556E-01 * tanl * tanl;
2235 scale[3] *=
vfunc(tanl, -0.26650, 0.92765, -0.13393, 0.11704);
2236 scale[4] *= +0.98203E+00 + 0.21612E-01 * tanl + 0.32751E-01 * tanl * tanl;
2248 scale[0] = 1.2619 - 0.11170 * pt;
2249 scale[1] = 1.2263 - 0.24619E-01 * pt;
2250 scale[2] =
vfunc(pt, 1.1432, 0.87555, -0.24211, 0.10876);
2251 scale[3] = 1.3254 - 0.21162 * pt;
2252 scale[4] = 1.1609 + 0.73808E-02 * pt;
2255 scale[3] *=
vfunc(tanl, -0.12026, 0.95892, -0.71461E-01, 0.69535E-01);
2270 scale[0] = 1.3083 - 0.10894 * pt;
2271 scale[1] = 1.2471 - 0.30959E-01 * pt;
2273 scale[2] =
vfunc(pt, 0.79736, 0.90954, -0.45673, 0.37072E-02);
2274 scale[3] = 1.3307 - 0.17559 * pt;
2275 scale[4] = 1.2408 - 0.29914E-01 * pt;
2279 scale[3] *=
vfunc(tanl, -0.63864E-01, 0.95936, -0.11035, 0.10057);
2282 scale[0] =
vfunc(pt, 1.4506, 1.0599, -0.10534, -0.14118);
2283 scale[1] =
lambdafunc(pt, 0.23691, 0.47860, 1.1996, -0.39938E-01, 0.23518, -0.62661E-01);
2284 scale[2] =
lambdafunc(pt, 0.45865, 0.92603, 0.95622, -0.51715, -0.12868, 0.45187E-01);
2285 scale[3] = 1.2555 - 0.19038 * pt;
2286 scale[4] =
vfunc(pt, 0.68946, 1.1772, 0.15927, -0.79017E-01);
2310 scale[0] = 1.2548 - 0.87786E-01 * pt;
2311 scale[1] = 1.2562 - 0.89296E-03 * pt;
2312 scale[2] =
vfunc(pt, 0.67905, 0.91705, -0.57837, -0.37276E-02);
2313 scale[3] = 1.3180 - 0.19459 * pt;
2314 scale[4] = 1.1652 + 0.33812E-01 * pt;
2317 scale[3] *=
vfunc(tanl, -0.47522E-01, 0.96537, -0.41720E-01, 0.68031E-01);
2330 scale[0] = 1.236096 - 0.1015809 * pt;
2331 scale[1] = 1.248921 - 0.1130577E-01 * pt;
2332 scale[2] =
vfunc(pt, 0.5129282, 0.9300365, -0.9450958, -0.1157168E-01);
2333 scale[3] =
vfunc(pt, 1.650362, 0.9371865, -0.2142342, 0.7384746E-01);
2334 scale[4] =
vfunc(pt, 0.7497343, 1.204451, 0.1333454, -0.7826934E-01);
2346 scale[0] = 1.240166 - 0.1051634 * pt;
2347 scale[1] = 1.257180 - 0.3122512E-01 * pt;
2348 scale[2] =
vfunc(pt, 0.5272015, 0.9386514, -0.9648152, -0.1623573E-01);
2349 scale[3] = 1.280515 - 0.1991213 * pt;
2350 scale[4] =
vfunc(pt, 0.6579201, 1.192409, 0.1197880, -0.5404800E-01);
2362 scale[0] = 1.213823 - .1029683 * pt;
2363 scale[1] = 1.239279 - .3706657E-01 * pt;
2364 scale[2] =
vfunc(pt, 0.6145123, 0.8834459, -.4620622, 0.2099150E-01);
2365 scale[3] = 1.253126 - .1884352 * pt;
2366 scale[4] =
vfunc(pt, 0.4928604, 1.169158, 0.2063893, -.5428730E-01);
2369 scale[2] *=
vfunc(tanl, -.1240821, 0.9274375, -.8750933E-01, 0.8611448E-01);
2381 scale[0] = 1.218633 - .1078999 * pt;
2382 scale[1] = 1.237288 - .2890434E-01 * pt;
2383 scale[2] =
vfunc(pt, 0.4334312, 0.9027213, -.7119852, 0.1031877E-01);
2384 scale[3] = 1.252394 - .1835607 * pt;
2385 scale[4] =
vfunc(pt, 0.6194937, 1.168190, 0.1285120, -.5815693E-01);
2397 scale[0] = 1.217751 - .1075724 * pt;
2398 scale[1] = 1.233774 - .3122749E-01 * pt;
2399 scale[2] =
vfunc(pt, 0.5276512, 0.8852152, -.7025786, 0.3136450E-01);
2400 scale[3] = 1.258038 - .1949899 * pt;
2401 scale[4] =
vfunc(pt, 0.5924365, 1.162905, 0.9632715E-01, -.6221822E-01);
2414 scale[0] =
vfunc(pt, 0.35776, 1.1919, 0.84229E-01, -0.88550E-01);
2415 scale[1] =
vfunc(pt, 0.37833, 1.2394, 0.34089, -0.54440E-01);
2416 scale[2] =
lambdafunc(pt, 0.87688, 1.4065, 0.86733, -0.23657, 0.21714E-01, 0.20876);
2417 scale[3] =
lambdafunc(pt, 0.39825, 1.0950, 1.2104, 0.11718E-01, -0.21145, -0.89681E-01);
2418 scale[4] =
vfunc(pt, 0.48051, 1.1672, 0.19241, -0.32273E-01);
2421 scale[2] *=
vfunc(tanl, -0.40697, 0.92948, -0.29453, 0.59416E-01);
2433 scale[0] =
lambdafunc(pt, 0.50681, 1.2150, 1.2266, 0.99662E-01, -0.23508, -0.52268E-01);
2434 scale[1] =
lambdafunc(pt, 0.50787, 1.2308, 1.3108, 0.42334, -0.25502, -0.13522E-01);
2435 scale[2] =
vfunc(pt, 1.2149, 0.88700, -0.15323, 0.97993E-01);
2436 scale[3] =
lambdafunc(pt, 0.45595, 1.1561, 1.2383, 0.17605, -0.34753, -0.97049E-01);
2437 scale[4] =
vfunc(pt, 0.55269, 1.2261, 0.39706, -0.12333);
2449 scale[0] =
vfunc(pt, 0.34925, 1.1780, 0.89069E-01, -0.10090);
2450 scale[1] =
vfunc(pt, 0.35168, 1.2380, 0.41479, -0.63250E-01);
2451 scale[2] =
vfunc(pt, 1.2497, 0.88495, -0.14338, 0.94307E-01);
2452 scale[3] =
lambdafunc(pt, 0.29565, 1.4502, 1.2139, 0.14353, -0.21211, -0.82968E-01);
2453 scale[4] =
vfunc(pt, 1.2496, 1.1216, 0.97174E-02, -0.41166E-01);
2465 scale[0] =
vfunc(pt, 1.4501, 1.0348, -0.12125, -0.27519E-01);
2466 scale[1] =
lambdafunc(pt, 0.48988, 1.5501, 1.2544, 0.21014, -0.10419, 0.74755E-01);
2467 scale[2] =
lambdafunc(pt, 0.44993, 1.3616, 0.93316, -0.58441, -0.30814E-01, 0.90806E-01);
2468 scale[3] = 1.2385 - 0.17733 * pt;
2469 scale[4] =
vfunc(pt, 0.75590, 1.1726, 0.12749, -0.75183E-01);
2481 scale[0] =
vfunc(pt, 1.0501, 1.0852, -0.14604, -0.66317E-01);
2482 scale[1] =
lambdafunc(pt, 0.37538, 2.5672, 1.2362, 0.14203, -0.58242E-01, 0.28431E-02);
2483 scale[2] =
lambdafunc(pt, 0.52700, 1.3506, 0.90327, -0.55627, 0.13131E-02, 0.11059);
2484 scale[3] = 1.2577 - 0.19572 * pt;
2485 scale[4] =
vfunc(pt, 0.69484, 1.1636, 0.96169E-01, -0.80421E-01);
2500 scale[0] =
vfunc(pt, 1.7258, 1.0126, -0.12693, 0.31924E-01);
2501 scale[1] =
lambdafunc(pt, 0.37552, 1.2217, 1.2532, 0.37276, -0.77830E-01, -0.31378E-01);
2502 scale[2] =
lambdafunc(pt, 0.40176, 1.1748, 0.95524, -0.72331, -0.53213E-01, 0.90074E-01);
2503 scale[3] = 1.2644 - 0.19783 * pt;
2504 scale[4] =
vfunc(pt, 0.56934, 1.1649, 0.13098, -0.52232E-01);
2511 static const struct cal_scale_error_func_set_t
2623 static cal_scale_error_func_set_t
2650 const double pt,
const double tanl,
2651 const int expmc,
const int no_exp,
const int no_run)
2653 double scale_error_hadronic_mc[5] = {1.0, 1.0, 1.0, 1.0, 1.0};
2654 double scale_error_cosmic_mc[5] = {1.0, 1.0, 1.0, 1.0, 1.0};
2655 double scale_error_cosmic_data[5] = {1.0, 1.0, 1.0, 1.0, 1.0};
2660 B2ERROR(
"!!!! scale_error: FATAL: FATAL ERROR occured. Abort !!!!");
2666 static bool first =
true;
2667 static int belle_scale_error_debug_mode = 0;
2670 char* belle_scale_error_debug = getenv(
"BELLE_SCALE_ERROR_DEBUG");
2673 if (!belle_scale_error_debug)
2674 belle_scale_error_debug_mode = 0;
2675 else if (!strcasecmp(belle_scale_error_debug,
"none"))
2676 belle_scale_error_debug_mode = 1;
2677 else if (!strcasecmp(belle_scale_error_debug,
"cosmic_mc"))
2678 belle_scale_error_debug_mode = 2;
2679 else if (!strcasecmp(belle_scale_error_debug,
"cosmic_data"))
2680 belle_scale_error_debug_mode = 3;
2681 else if (!strcasecmp(belle_scale_error_debug,
"hadron_mc") || !strcasecmp(belle_scale_error_debug,
"hadronic_mc"))
2682 belle_scale_error_debug_mode = 4;
2684 B2ERROR(
"BELLE_SCALE_ERROR_DEBUG=" << belle_scale_error_debug <<
": bad directive");
2688 if (belle_scale_error_debug)
2689 B2ERROR(
"BELLE_SCALE_ERROR_DEBUG=" << belle_scale_error_debug <<
": applied");
2693 switch (belle_scale_error_debug_mode) {
2695 (cal_func.
m_hadMC)(scale_error_hadronic_mc, pt, tanl);
2697 if (
SE_Message_Level >= 2) B2ERROR(
"scale_error: info: scale on real data");
2698 (cal_func.
m_cosMC)(scale_error_cosmic_mc, pt, tanl);
2699 (cal_func.
m_cosDATA)(scale_error_cosmic_data, pt, tanl);
2710 (cal_func.
m_cosMC)(scale_error_hadronic_mc, pt, tanl);
2714 (cal_func.
m_cosDATA)(scale_error_hadronic_mc, pt, tanl);
2718 (cal_func.
m_hadMC)(scale_error_hadronic_mc, pt, tanl);
2724 for (
int i = 0; i < 5; i++)
2725 scale[i] = scale_error_hadronic_mc[i] * scale_error_cosmic_data[i] / scale_error_cosmic_mc[i];
2730 B2ERROR(
"scale_error: info: hadronic MC: "
2731 << scale_error_hadronic_mc[0] <<
" " << scale_error_hadronic_mc[1] <<
" "
2732 << scale_error_hadronic_mc[2] <<
" " << scale_error_hadronic_mc[3] <<
" "
2733 << scale_error_hadronic_mc[4]);
2735 B2ERROR(
"scale_error: info: cosmic MC: "
2736 << scale_error_cosmic_mc[0] <<
" " << scale_error_cosmic_mc[1] <<
" "
2737 << scale_error_cosmic_mc[2] <<
" " << scale_error_cosmic_mc[3] <<
" "
2738 << scale_error_cosmic_mc[4]);
2740 B2ERROR(
"scale_error: info: cosmic data: "
2741 << scale_error_cosmic_data[0] <<
" " << scale_error_cosmic_data[1] <<
" "
2742 << scale_error_cosmic_data[2] <<
" " << scale_error_cosmic_data[3] <<
" "
2743 << scale_error_cosmic_data[4]);
2745 B2ERROR(
"scale_error: info: final scale: "
2746 << scale[0] <<
" " << scale[1] <<
" " << scale[2] <<
" "
2747 << scale[3] <<
" " << scale[4]);
2750 const double scale_lo = 0.5, scale_hi = 4.0;
2751 bool too_lo =
false, too_hi =
false;
2752 for (
int i = 0; i < 5; i++) {
2753 if (scale[i] < scale_lo) { scale[i] = scale_lo; too_lo =
true;}
2754 if (scale[i] > scale_hi) { scale[i] = scale_hi; too_hi =
true;}
2758 B2ERROR(
"scale_error: warning: scale factor beyond the limit: "
2759 << scale_error_hadronic_mc[0] * scale_error_cosmic_data[0] / scale_error_cosmic_mc[0] <<
" "
2760 << scale_error_hadronic_mc[1] * scale_error_cosmic_data[1] / scale_error_cosmic_mc[1] <<
" "
2761 << scale_error_hadronic_mc[2] * scale_error_cosmic_data[2] / scale_error_cosmic_mc[2] <<
" "
2762 << scale_error_hadronic_mc[3] * scale_error_cosmic_data[3] / scale_error_cosmic_mc[3] <<
" "
2763 << scale_error_hadronic_mc[4] * scale_error_cosmic_data[4] / scale_error_cosmic_mc[4]);
2780 int no_exp{0}, no_run{0}, no_evt{0}, no_frm{0}, expmc{0};
2781 get_event_id(&no_exp, &no_run, &no_evt, &no_frm, &expmc);
2786 static int first_exp73 =
true;
2787 if (no_exp == 73 && first_exp73) {
2788 first_exp73 =
false;
2790 "scale_error: warning: scale parameters for exp#71 are tentatively used for exp#73.");
2803 Belle::Mdst_trk_fit_Manager& fitmgr = Belle::Mdst_trk_fit_Manager::get_manager();
2804 for (std::vector<Belle::Mdst_trk_fit>::iterator it = fitmgr.begin(); it != fitmgr.end(); ++it) {
2805 Belle::Mdst_trk_fit& fit = *it;
2806 if (fit.helix(2) == 0.)
continue;
2808 const double pt = 1. / fabs(fit.helix(2));
2809 const double tanl = fit.helix(4);
2813 fit.error(0, scale[0]*scale[0]*fit.error(0));
2814 fit.error(1, scale[1]*scale[0]*fit.error(1));
2815 fit.error(2, scale[1]*scale[1]*fit.error(2));
2816 fit.error(3, scale[2]*scale[0]*fit.error(3));
2817 fit.error(4, scale[2]*scale[1]*fit.error(4));
2818 fit.error(5, scale[2]*scale[2]*fit.error(5));
2819 fit.error(6, scale[3]*scale[0]*fit.error(6));
2820 fit.error(7, scale[3]*scale[1]*fit.error(7));
2821 fit.error(8, scale[3]*scale[2]*fit.error(8));
2822 fit.error(9, scale[3]*scale[3]*fit.error(9));
2823 fit.error(10, scale[4]*scale[0]*fit.error(10));
2824 fit.error(11, scale[4]*scale[1]*fit.error(11));
2825 fit.error(12, scale[4]*scale[2]*fit.error(12));
2826 fit.error(13, scale[4]*scale[3]*fit.error(13));
2827 fit.error(14, scale[4]*scale[4]*fit.error(14));
2832 Belle::Mdst_vee_daughters_Manager& daumgr = Belle::Mdst_vee_daughters_Manager::get_manager();
2833 for (std::vector<Belle::Mdst_vee_daughters>::iterator it = daumgr.begin(); it != daumgr.end(); ++it) {
2834 Belle::Mdst_vee_daughters& dau = *it;
2835 if (dau.helix_p(2) == 0. || dau.helix_m(2) == 0.)
continue;
2838 const double pt_p = 1. / fabs(dau.helix_p(2));
2839 const double tanl_p = dau.helix_p(4);
2843 dau.error_p(0, scale[0]*scale[0]*dau.error_p(0));
2844 dau.error_p(1, scale[1]*scale[0]*dau.error_p(1));
2845 dau.error_p(2, scale[1]*scale[1]*dau.error_p(2));
2846 dau.error_p(3, scale[2]*scale[0]*dau.error_p(3));
2847 dau.error_p(4, scale[2]*scale[1]*dau.error_p(4));
2848 dau.error_p(5, scale[2]*scale[2]*dau.error_p(5));
2849 dau.error_p(6, scale[3]*scale[0]*dau.error_p(6));
2850 dau.error_p(7, scale[3]*scale[1]*dau.error_p(7));
2851 dau.error_p(8, scale[3]*scale[2]*dau.error_p(8));
2852 dau.error_p(9, scale[3]*scale[3]*dau.error_p(9));
2853 dau.error_p(10, scale[4]*scale[0]*dau.error_p(10));
2854 dau.error_p(11, scale[4]*scale[1]*dau.error_p(11));
2855 dau.error_p(12, scale[4]*scale[2]*dau.error_p(12));
2856 dau.error_p(13, scale[4]*scale[3]*dau.error_p(13));
2857 dau.error_p(14, scale[4]*scale[4]*dau.error_p(14));
2860 const double pt_m = 1. / fabs(dau.helix_m(2));
2861 const double tanl_m = dau.helix_m(4);
2865 dau.error_m(0, scale[0]*scale[0]*dau.error_m(0));
2866 dau.error_m(1, scale[1]*scale[0]*dau.error_m(1));
2867 dau.error_m(2, scale[1]*scale[1]*dau.error_m(2));
2868 dau.error_m(3, scale[2]*scale[0]*dau.error_m(3));
2869 dau.error_m(4, scale[2]*scale[1]*dau.error_m(4));
2870 dau.error_m(5, scale[2]*scale[2]*dau.error_m(5));
2871 dau.error_m(6, scale[3]*scale[0]*dau.error_m(6));
2872 dau.error_m(7, scale[3]*scale[1]*dau.error_m(7));
2873 dau.error_m(8, scale[3]*scale[2]*dau.error_m(8));
2874 dau.error_m(9, scale[3]*scale[3]*dau.error_m(9));
2875 dau.error_m(10, scale[4]*scale[0]*dau.error_m(10));
2876 dau.error_m(11, scale[4]*scale[1]*dau.error_m(11));
2877 dau.error_m(12, scale[4]*scale[2]*dau.error_m(12));
2878 dau.error_m(13, scale[4]*scale[3]*dau.error_m(13));
2879 dau.error_m(14, scale[4]*scale[4]*dau.error_m(14));
2888 static int result_before = -1;
2892 if (result != result_before) {
2896 "scale_error: info: scale error is properly applied.");
2902 "scale_error: warning: scale error is not applied. Reason: it has been already applied.");
2907 int no_exp, no_run, no_evt, no_frm, expmc;
2908 get_event_id(&no_exp, &no_run, &no_evt, &no_frm, &expmc);
2910 "scale_error: error: scale error is not applied. Reason: it is not available for exp " << no_exp <<
". Exit! (I'll crash job.)");
2918 result_before = result;
2929 CLHEP::HepSymMatrix& epvtx_err)
2932 Belle::Evtvtx_primary_vertex_Manager& evtvtx_mgr
2933 = Belle::Evtvtx_primary_vertex_Manager::get_manager();
2935 Belle::Evtvtx_trk_Manager& evttrk_mgr = Belle::Evtvtx_trk_Manager::get_manager();
2937 Belle::Evtvtx_primary_vertex_Manager::iterator itvtx = evtvtx_mgr.begin();
2938 if (itvtx == evtvtx_mgr.end())
return 4;
2940 if (!(itvtx->quality() == 2 || itvtx->quality() == 3))
return 3;
2945 HepPoint3D pvtx(itvtx->PV_x(), itvtx->PV_y(), itvtx->PV_z());
2949 unsigned int nchrgd(0);
2950 for (Belle::Evtvtx_trk_Manager::iterator i = evttrk_mgr.begin(); i != evttrk_mgr.end(); ++i) {
2952 const Belle::Mdst_charged& p = i->charged();
2953 if (p.trk().mhyp(2).nhits(3) < 2)
continue;
2954 if (p.trk().mhyp(2).nhits(4) < 2)
continue;
2957 const HepPoint3D pivot(p.trk().mhyp(hyp).pivot_x(),
2958 p.trk().mhyp(hyp).pivot_y(),
2959 p.trk().mhyp(hyp).pivot_z());
2960 CLHEP::HepVector a(5);
2961 a[0] = p.trk().mhyp(hyp).helix(0);
2962 a[1] = p.trk().mhyp(hyp).helix(1);
2963 a[2] = p.trk().mhyp(hyp).helix(2);
2964 a[3] = p.trk().mhyp(hyp).helix(3);
2965 a[4] = p.trk().mhyp(hyp).helix(4);
2966 CLHEP::HepSymMatrix Ea(5, 0);
2967 Ea[0][0] = p.trk().mhyp(hyp).error(0);
2968 Ea[1][0] = p.trk().mhyp(hyp).error(1);
2969 Ea[1][1] = p.trk().mhyp(hyp).error(2);
2970 Ea[2][0] = p.trk().mhyp(hyp).error(3);
2971 Ea[2][1] = p.trk().mhyp(hyp).error(4);
2972 Ea[2][2] = p.trk().mhyp(hyp).error(5);
2973 Ea[3][0] = p.trk().mhyp(hyp).error(6);
2974 Ea[3][1] = p.trk().mhyp(hyp).error(7);
2975 Ea[3][2] = p.trk().mhyp(hyp).error(8);
2976 Ea[3][3] = p.trk().mhyp(hyp).error(9);
2977 Ea[4][0] = p.trk().mhyp(hyp).error(10);
2978 Ea[4][1] = p.trk().mhyp(hyp).error(11);
2979 Ea[4][2] = p.trk().mhyp(hyp).error(12);
2980 Ea[4][3] = p.trk().mhyp(hyp).error(13);
2981 Ea[4][4] = p.trk().mhyp(hyp).error(14);
2982 Belle::Helix helix(pivot, a, Ea);
2984 CLHEP::HepLorentzVector mom;
2985 CLHEP::HepSymMatrix err(7, 0);
2986 HepPoint3D pos(0, 0, 0);
2987 if (pivot.x() != 0. ||
2990 helix.pivot(HepPoint3D(0., 0., 0.));
2991 mom = helix.momentum(0., 0.13957f, pos, err);
2993 mom = helix.momentum(0., 0.13957f, pos, err);
2996 kv.
addTrack(mom, pos, err, p.charge());
3000 if (Belle::IpProfile::usable()) {
3002 HepPoint3D ip_position = Belle::IpProfile::e_position();
3003 CLHEP::HepSymMatrix ip_err = Belle::IpProfile::e_position_err();
3007 unsigned int err(1);
3008 if (nchrgd > 2 || (nchrgd > 0 && Belle::IpProfile::usable())) err = kv.
doFit();
3068 float[],
float[],
int*);
3073 Belle::Mdst_event_add_Manager& mevtmgr = Belle::Mdst_event_add_Manager::get_manager();
3074 if (mevtmgr.count() == 0) {
3076 }
else if (mevtmgr.count() == 1) {
3079 unsigned flag(mevtmgr[1].flag(0));
3080 if (flag != 0)
return -1;
3081 Belle::Mdst_trk_extra_Manager& teMgr(Belle::Mdst_trk_extra_Manager::get_manager());
3082 Belle::Mdst_trk_Manager& tMgr(Belle::Mdst_trk_Manager::get_manager());
3083 Belle::Mdst_charged_Manager& chMgr(Belle::Mdst_charged_Manager::get_manager());
3084 const int i_ch(chMgr.count() + 1);
3085 const int i_trk(tMgr.count() + 1);
3086 for (std::vector<Belle::Mdst_trk_extra>::const_iterator i = teMgr.begin();
3087 i != teMgr.end(); ++i) {
3088 Belle::Mdst_trk& trk(tMgr.add());
3089 trk.quality((*i).quality());
3090 for (
int j = 0; j < 5; j++) trk.mhyp(j, (*i).mhyp(j));
3094 if (!(trk.quality() & 15u)) {
3095 B2FATAL(
"recsim_mdst_propgt_ is missing");
3125 B2ERROR(
"Warning from B2BIIFixMdst: strange track in Belle::Mdst_trk_extra: quality="
3131 Belle::Mdst_sim_trk_extra_Manager& steMgr
3132 (Belle::Mdst_sim_trk_extra_Manager::get_manager());
3133 Belle::Mdst_sim_trk_Manager& stMgr(Belle::Mdst_sim_trk_Manager::get_manager());
3135 for (std::vector<Belle::Mdst_sim_trk_extra>::const_iterator i = steMgr.begin();
3136 i != steMgr.end(); ++i) {
3137 Belle::Mdst_sim_trk& strk(stMgr.add());
3138 int argn = tMgr.count() - teMgr.count() + ist;
3139 if (argn < tMgr.count()) {
3140 strk.trk(tMgr[argn]);
3143 strk.hepevt((*i).hepevt());
3144 strk.relation(0, (*i).relation(0));
3145 strk.relation(1, (*i).relation(1));
3146 strk.relation(2, (*i).relation(2));
3150 Belle::Mdst_svd_hit_extra_Manager& sheMgr
3151 (Belle::Mdst_svd_hit_extra_Manager::get_manager());
3152 Belle::Mdst_svd_hit_Manager& shMgr(Belle::Mdst_svd_hit_Manager::get_manager());
3153 for (std::vector<Belle::Mdst_svd_hit_extra>::iterator it = sheMgr.begin();
3154 it != sheMgr.end(); ++it) {
3155 Belle::Mdst_svd_hit_extra& she = *it;
3156 Belle::Mdst_svd_hit& sh(shMgr.add());
3158 sh.width(she.width());
3159 sh.electrons(she.electrons());
3160 sh.dssd(she.dssd());
3161 sh.type(she.type());
3162 int argn = tMgr.count() - teMgr.count() + she.trk().get_ID() - 1;
3163 if (argn < tMgr.count()) {
3169 Belle::Mdst_vee2_Manager& vMgr(Belle::Mdst_vee2_Manager::get_manager());
3170 Belle::Mdst_vee2_extra_Manager& veMgr(Belle::Mdst_vee2_extra_Manager::get_manager());
3171 const int i_vee2(vMgr.count() + 1);
3172 for (std::vector<Belle::Mdst_vee2_extra>::const_iterator i = veMgr.begin();
3173 i != veMgr.end(); ++i) {
3174 Belle::Mdst_vee2& vee(vMgr.add());
3175 vee.kind((*i).kind());
3177 if ((*i).extra_ID(0)) {
3178 Belle::Mdst_charged& tmp(chMgr[(*i).extra_ID(0) + i_ch - 2]);
3181 vee.chgd(0, (*i).chgd());
3184 if ((*i).extra_ID(1)) {
3185 Belle::Mdst_charged& tmp(chMgr[(*i).extra_ID(1) + i_ch - 2]);
3188 vee.chgd(1, (*i).chgd());
3194 vee.energy((*i).energy());
3198 vee.z_dist((*i).z_dist());
3199 vee.chisq((*i).chisq());
3200 vee.type((*i).type());
3201 vee.daut((*i).daut());
3207 if (i_ch & 0xffffff00) B2ERROR(
"Warning from B2BIIFixMdst: overflow! i_ch = " << i_ch);
3208 if (i_trk & 0xffffff00) B2ERROR(
"Warning from B2BIIFixMdst: overflow! i_trk = " << i_trk);
3209 if (i_vee2 & 0xffffff00) B2ERROR(
"Warning from B2BIIFixMdst: overflow! i_vee2 = " << i_vee2);
3211 flag |= ((i_trk & 0xff) << 8);
3212 flag |= ((i_vee2 & 0xff) << 16);
3213 mevtmgr[1].flag(0, flag);
3220 Belle::Mdst_event_add_Manager& mevtmgr = Belle::Mdst_event_add_Manager::get_manager();
3221 if (mevtmgr.count() <= 1) {
3224 unsigned flag(mevtmgr[1].flag(0));
3225 if (0 == flag)
return -1;
3226 const int i_ch(flag & 0xff);
3227 const int i_trk((flag >> 8) & 0xff);
3228 const int i_vee2((flag >> 16) & 0xff);
3229 Belle::Mdst_charged_Manager& chMgr(Belle::Mdst_charged_Manager::get_manager());
3230 Belle::Mdst_trk_Manager& tMgr(Belle::Mdst_trk_Manager::get_manager());
3231 Belle::Mdst_vee2_Manager& veeMgr(Belle::Mdst_vee2_Manager::get_manager());
3233 while (chMgr.count() >= i_ch) chMgr.remove(chMgr[chMgr.count() - 1]);
3236 while (tMgr.count() >= i_trk) tMgr.remove(tMgr[tMgr.count() - 1]);
3239 while (veeMgr.count() >= i_vee2) veeMgr.remove(veeMgr[veeMgr.count() - 1]);
3242 mevtmgr[1].flag(0, flag);
3249 Belle::Mdst_event_add_Manager& mevtmgr = Belle::Mdst_event_add_Manager::get_manager();
3250 if (mevtmgr.count() <= 1) {
3253 unsigned flag(mevtmgr[1].flag(0));
3254 if (0 == flag)
return -1;
3255 const int i_ch(flag & 0xff);
3256 const int i_trk((flag >> 8) & 0xff);
3257 const int i_vee2((flag >> 16) & 0xff);
3259 Belle::Mdst_trk_Manager& tMgr(Belle::Mdst_trk_Manager::get_manager());
3260 Belle::Mdst_vee2_Manager& veeMgr(Belle::Mdst_vee2_Manager::get_manager());
3261 Belle::Mdst_trk_extra_Manager& teMgr(Belle::Mdst_trk_extra_Manager::get_manager());
3262 Belle::Mdst_vee2_extra_Manager& veeeMgr(Belle::Mdst_vee2_extra_Manager::get_manager());
3264 std::vector<int> extra_ID;
3265 if (teMgr.count()) teMgr.remove();
3266 for (std::vector<Belle::Mdst_trk>::iterator i = tMgr.begin();
3267 i != tMgr.end(); ++i) {
3268 if ((*i).get_ID() < i_trk) {
3269 extra_ID.push_back(0);
3272 if (!((*i).quality() & 16u)) {
3273 B2ERROR(
"Warning from B2BIIFixMdst: inconsistency between Belle::Mdst_trk and Belle::Mdst_evet_add"
3276 Belle::Mdst_trk_extra& trk(teMgr.add());
3277 for (
int j = 0; j < 5; j++) trk.mhyp(j, (*i).mhyp(j));
3278 trk.quality((*i).quality());
3279 extra_ID.push_back(trk.get_ID());
3282 if (veeeMgr.count()) veeeMgr.remove();
3283 for (std::vector<Belle::Mdst_vee2>::iterator i = veeMgr.begin();
3284 i != veeMgr.end(); ++i) {
3285 if ((*i).get_ID() < i_vee2)
continue;
3286 if (!((*i).chgd(0).trk().quality() & 16u) && !((*i).chgd(1).trk().quality() & 16u)) {
3287 B2ERROR(
"Warning from B2BIIFixMdst: inconsistency between Belle::Mdst_vee2 and Belle::Mdst_evet_add"
3290 Belle::Mdst_vee2_extra& vee(veeeMgr.add());
3291 vee.kind((*i).kind());
3292 const int extra_id0(extra_ID[(*i).chgd(0).trk_ID() - 1]);
3293 const int extra_id1(extra_ID[(*i).chgd(1).trk_ID() - 1]);
3295 vee.extra(0, teMgr[extra_id0 - 1]);
3297 vee.chgd((*i).chgd(0));
3300 vee.extra(1, teMgr[extra_id1 - 1]);
3302 if (vee.chgd_ID()) {
3303 B2ERROR(
"Warning from B2BIIFixMdst: both tracks of Belle::Mdst_vee2_extra are good track"
3306 vee.chgd((*i).chgd(1));
3312 vee.energy((*i).energy());
3316 vee.z_dist((*i).z_dist());
3317 vee.chisq((*i).chisq());
3318 vee.type((*i).type());
3319 vee.daut((*i).daut());
3321 int id = BsCouTab(MDST_VEE2);
3322 while (
id >= i_vee2) BsDelEnt(MDST_VEE2,
id--);
3324 int id = BsCouTab(MDST_TRK);
3325 while (
id >= i_trk) BsDelEnt(MDST_TRK,
id--);
3328 int id = BsCouTab(MDST_CHARGED);
3329 while (
id >= i_ch) BsDelEnt(MDST_CHARGED,
id--);
3332 mevtmgr[1].flag(0, flag);
3341 static void scale_err_ms(Belle::Mdst_trk_fit& fit,
const double scale[]);
3342 static void smear_trk_ms(Belle::Mdst_trk_fit& fit,
const double scale[]);
3349 int expNo = 0, runNo = 0, expmc = 1;
3350 Belle::Belle_event_Manager& evtMgr = Belle::Belle_event_Manager::get_manager();
3351 if (evtMgr.count()) {
3352 expNo = evtMgr[0].ExpNo();
3353 runNo = evtMgr[0].RunNo();
3354 expmc = evtMgr[0].ExpMC();
3356 if (expmc == 1)
return;
3358 Belle::Mdst_event_add_Manager& addmgr = Belle::Mdst_event_add_Manager::get_manager();
3359 if (addmgr.count() == 0) {
3360 B2ERROR(
"No Belle::Mdst_event_add table -> kill the job");
3362 }
else if (addmgr.count() >= 2) {
3363 if (addmgr[1].flag(1) != 0)
return;
3366 int flag_err = addmgr[0].flag_error();
3368 static bool start =
true;
3371 B2INFO(
"smear_trk: MC events -> track smearing is ON\n");
3374 double scale_mc[5] = {1, 1, 1, 1, 1};
3375 double scale_rd[5] = {1, 1, 1, 1, 1};
3378 Belle::Mdst_trk_fit_Manager& fitmgr = Belle::Mdst_trk_fit_Manager::get_manager();
3379 for (std::vector<Belle::Mdst_trk_fit>::iterator it = fitmgr.begin(); it != fitmgr.end(); ++it) {
3380 Belle::Mdst_trk_fit& fit = *it;
3381 if (fit.helix(2) == 0.)
continue;
3383 double pt = 1. / fabs(fit.helix(2));
3384 double tanl = fit.helix(4);
3388 for (
int i = 0; i < 5; i++) scale[i] = scale_rd[i] / scale_mc[i];
3398 addmgr[0].flag_error(1);
3401 if (addmgr.count() == 1) {
3402 Belle::Mdst_event_add& meadd = addmgr.add();
3404 }
else if (addmgr.count() >= 2) {
3405 addmgr[1].flag(1, 1);
3414 fit.error(0, scale[0]*scale[0]*fit.error(0));
3415 fit.error(1, scale[1]*scale[0]*fit.error(1));
3416 fit.error(2, scale[1]*scale[1]*fit.error(2));
3417 fit.error(3, scale[2]*scale[0]*fit.error(3));
3418 fit.error(4, scale[2]*scale[1]*fit.error(4));
3419 fit.error(5, scale[2]*scale[2]*fit.error(5));
3420 fit.error(6, scale[3]*scale[0]*fit.error(6));
3421 fit.error(7, scale[3]*scale[1]*fit.error(7));
3422 fit.error(8, scale[3]*scale[2]*fit.error(8));
3423 fit.error(9, scale[3]*scale[3]*fit.error(9));
3424 fit.error(10, scale[4]*scale[0]*fit.error(10));
3425 fit.error(11, scale[4]*scale[1]*fit.error(11));
3426 fit.error(12, scale[4]*scale[2]*fit.error(12));
3427 fit.error(13, scale[4]*scale[3]*fit.error(13));
3428 fit.error(14, scale[4]*scale[4]*fit.error(14));
3439 for (
int i = 0; i < n; i++) {
3440 for (
int j = 0; j <= i; j++) {
3441 a[i][j] = fit.error(k) * (scale[i] * scale[j] - 1.0);
3442 if (i != j) a[j][i] = a[i][j];
3449 for (
int j = 0; j < n; j++) {
3451 for (
int k2 = 0; k2 < j; k2++) s -= u[j][k2] * u[j][k2];
3454 for (
int i = j + 1; i < n; i++) {
3456 for (
int k3 = 0; k3 < j; k3++) s -= u[i][k3] * u[j][k3];
3457 u[i][j] = s / u[j][j];
3460 for (
int i = j; i < n; i++) u[i][j] = 0;
3466 for (
int i = 0; i < n; i++) g[i] = gRandom->Gaus();
3468 for (
int i = 0; i < n; i++) {
3471 for (
int j = 0; j <= i; j++) x[i] += u[i][j] * g[j];
3474 for (
int i = 0; i < n; i++) fit.helix(i, fit.helix(i) + x[i]);
3482 Belle::Mdst_charged_Manager& chgmgr = Belle::Mdst_charged_Manager::get_manager();
3483 for (std::vector<Belle::Mdst_charged>::iterator it = chgmgr.begin(); it != chgmgr.end(); ++it) {
3484 Belle::Mdst_charged& c = *it;
3485 Belle::Mdst_trk_fit& t = c.trk().mhyp(2);
3487 double kp = std::abs(t.helix(2));
3488 kp = std::max(kp, 1.e-10);
3489 kp = std::min(kp, 1.e10);
3490 c.px(-sin(t.helix(1)) / kp);
3491 c.py(cos(t.helix(1)) / kp);
3492 c.pz(t.helix(4) / kp);
int m_smear_trk
Do extra-smearing for MC tracks.
int m_reprocess_version
Reprocess version (=0:old; =1:new)
enum KFitError::ECode addTrack(const KFitTrack &kp)
Add a track to the fitter object.
VertexFitKFit is a derived class from KFitBase to perform vertex-constraint kinematical fit.
enum KFitError::ECode setInitialVertex(const HepPoint3D &v)
Set an initial vertex point for the vertex-vertex constraint fit.
const CLHEP::HepSymMatrix getVertexError(void) const
Get a fitted vertex error matrix.
enum KFitError::ECode doFit(void)
Perform a vertex-constraint fit.
enum KFitError::ECode setIpProfile(const HepPoint3D &ip, const CLHEP::HepSymMatrix &ipe)
Set an IP-ellipsoid shape for the vertex constraint fit.
const HepPoint3D getVertex(const int flag=KFitConst::kAfterFit) const
Get a vertex position.
bool operator==(const DecayNode &node1, const DecayNode &node2)
Compare two Decay Nodes: They are equal if All daughter decay nodes are equal or one of the daughter ...
static const struct cal_scale_error_func_set_t EXP6165_scale
Scale error for Exp.61-65.
static void smear_trk_ms(Belle::Mdst_trk_fit &fit, const double scale[])
Smear MC tracks.
static void cal_scale_error_EXP55_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.55 Cosmic MC.
void scale_momenta_set_v2(const int, const int, const int, double &)
Return scale factors set_v2.
static void cal_scale_error_EXP43_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.43 Cosmic MC.
static void cal_scale_error_EXP31_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.31 Cosmic MC.
static const struct cal_scale_error_func_set_t EXP2527_scale
Scale error for Exp.25-27.
static void cal_scale_error_EXP0723_cosmic_data(double scale[5], const double pt, const double)
Scale error for Exp.7-23 Cosmic data.
static void cal_scale_error_EXP51_hadronic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.51 Hadron MC.
static const struct cal_scale_error_func_set_t EXP45_scale
Scale error for Exp.45.
double lambdafunc(const double x, const double x1, const double x2, const double yc, const double a1, const double a2, const double a3)
lambdafunc
static void cal_scale_error_EXP35_hadronic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.33,35 Hadron MC.
static void null_scale(double[5], double, double)
Dummy function.
static void get_event_id(int *no_exp, int *no_run, int *no_evt, int *no_frm, int *expmc)
Get event ID.
static void cal_scale_error_EXP31_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.31 Cosmic data.
static const struct cal_scale_error_func_set_t EXP3941_scale
Scale error for Exp.39,41.
static const struct cal_scale_error_func_set_t EXP31_scale
Scale error for Exp.31.
double rootfunc(const double x, const double x1, const double x2, const double yc, const double a1, const double a2)
rootfunc
static void cal_scale_error_EXP2527_cosmic_data(double scale[5], const double pt, const double)
Scale error for Exp.25-27 Cosmic data.
static void cal_scale_error_EXP43_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.43 Hadron MC.
static const struct cal_scale_error_func_set_t EXP6971_scale
Scale error for Exp.69-71.
static int SE_Reprocess_Version
Reprocess verison used in scale_error()
static void smear_charged()
Smear tracks in Mdst_Charged.
static void cal_scale_error_EXP47_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.47 Hadron MC.
void smear_trk()
Apply track smearing (on MC)
static void cal_scale_error_EXP53_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.53 Cosmic MC.
static void cal_scale_error_EXP6165_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.61-65 Hadron MC.
double vfunc(const double x, const double x1, const double yc, const double a1, const double a2)
vfunc
static void cal_scale_error_EXP53_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.53 Hadron MC.
static void cal_scale_error_EXP3941_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.39,41 Cosmic MC.
static void cal_scale_error_EXP67_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.67 Hadron MC.
static const struct cal_scale_error_func_set_t EXP43_scale
Scale error for Exp.43.
int remove_extra_trk_vee2()
Remove extra tracks from Mdst_trk and Mdst_vee2.
static const struct cal_scale_error_func_set_t EXP47_scale
Scale error for Exp.47.
double cupfunc(const double x, const double x1, const double x2, const double yc, const double a1, const double a2)
cupfunc
static void cal_scale_error_EXP35_cosmic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.35 Cosmic MC.
static void cal_scale_error_EXP43_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.43 Cosmic data.
static const struct cal_scale_error_func_set_t EXP53_scale
Scale error for Exp.53.
static void cal_scale_error_EXP0723_cosmic_mc(double scale[5], const double pt, const double)
Scale error for Exp.7-23 Cosmic MC.
static void cal_scale_error_EXP3941_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.39,41 Hadron MC.
static void cal_scale_error_EXP55_cosmic_data(double scale[5], double pt, double tanl)
Scale error for Exp.55 Cosmic data.
static void cal_scale_error_EXP55_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.55 Hadron MC.
static const struct cal_scale_error_func_set_t EXP0723_scale
Scale error for Exp.7-23.
static const struct cal_scale_error_func_set_t EXP51_scale
Scale error for Exp.51.
static void cal_scale_error_EXP35_cosmic_data(double scale[5], double pt, double tanl)
Scale error for Exp.35 Cosmic data.
static const struct cal_scale_error_func_set_t EXP67_scale
Scale error for Exp.67.
static void cal_scale_error_EXP4547_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.45,47 Cosmic data.
void scale_momenta_set_v1(const int, const int, const int, double &)
Return scale factors set_v1.
static void cal_scale_error_EXP0723_hadronic_mc(double scale[5], const double pt, const double tanl)
Scale error for Exp.7-23 Hadron MC.
static void cal_scale_error_EXP6971_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.69,71 Hadron MC.
static void cal_scale_error_EXP37_hadronic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.37 Hadron MC.
static void cal_scale_error_EXP49_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.49 Cosmic data.
static void cal_scale_error_EXP6971_cosmic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.69-71 Cosmic MC.
static void cal_scale_error_EXP67_cosmic_data(double scale[5], double pt, double tanl)
Scale error for Exp.67 Cosmic data.
int add_extra_trk_vee2()
Add Mdst_trk_extra and Mdst_vee_extra to Mdst_trk and Mdst_vee2, respectively.
static void cal_scale_error_EXP33_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.33 Cosmic data.
static void cal_scale_error_EXP49_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.49 Cosmic MC.
static int SE_Message_Level
Message level of scale_error().
static const struct cal_scale_error_func_set_t DUMMY_scale
Dummy scale.
static void cal_scale_error_EXP2527_cosmic_mc(double scale[5], const double pt, const double)
Scale error for Exp.25-27 Cosmic MC.
static void cal_scale_error_EXP37_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.37 Cosmic data.
void(* cal_scale_error_func_t)(double scale[5], const double pt, const double tanl)
Function pointer type.
int set_primary_vertex(HepPoint3D &v, CLHEP::HepSymMatrix &ve)
Set primary vertex assuming all tracks are pions.
static const struct cal_scale_error_func_set_t EXP35_scale
Scale error for Exp.35.
static void cal_scale_error_EXP53_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.53 Cosmic data.
static void cal_scale_error_EXP31_hadronic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.31 Hadron MC.
static void cal_scale_error(double scale[5], const double pt, const double tanl, const int expmc, const int no_exp, const int no_run)
Calculate scale error.
void scale_momenta(float scale_data=1.0, float scale_mc=1.0, int mode=0)
Scale momenta of Mdst_trk.
static void cal_scale_error_EXP2527_hadronic_mc(double scale[5], const double pt, const double tanl)
Scale error for Exp.25-27 Hadron MC.
static void cal_scale_error_EXP51_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.51 Cosmic MC.
static void cal_scale_error_EXP33_hadronic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.33,35 Hadron MC.
static void scale_err_ms(Belle::Mdst_trk_fit &fit, const double scale[])
Scale error.
static const struct cal_scale_error_func_set_t EXP49_scale
Scale error for Exp.49.
void scale_error(const int message_level=0)
Apply scale error.
static void cal_scale_error_EXP33_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.33 Cosmic MC.
static int scale_error_impl(const int message_level, const int reprocess_version)
The implementation of B2BIIFixMdstModule::scale_error()
static const struct cal_scale_error_func_set_t EXP37_scale
Scale error for Exp.37.
void scale_momenta_set(const int, const int, const int, double &)
Return scale factors for 2001 summer confs.
static cal_scale_error_func_set_t get_scale_error_func_for_exprun(const int no_exp, const int)
Get scale error fucntion for different Exp.
static void cal_scale_error_EXP47_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.47 Cosmic MC.
static void cal_scale_error_EXP37_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.37 Cosmic MC.
static const struct cal_scale_error_func_set_t EXP33_scale
Scale error for Exp.33.
static void cal_scale_error_EXP6165_cosmic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.61-65 Cosmic MC.
static void cal_scale_error_EXP49_hadronic_mc(double scale[5], double pt, double)
Scale error for Exp.49 Hadron MC.
static void cal_scale_error_EXP67_cosmic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.67 Cosmic MC.
static void cal_scale_error_EXP45_hadronic_mc(double scale[5], double pt, double tanl)
Scale error for Exp.45 Hadron MC.
double vee_mass_nofit(const Belle::Mdst_vee2 &vee2, float scale=1.0)
Calculates V0 mass with non-constraint fit results.
static const struct cal_scale_error_func_set_t EXP55_scale
Scale error for Exp.55.
static void cal_scale_error_EXP6971_cosmic_data(double scale[5], double pt, double tanl)
Scale error for Exp.69,71 Cosmic data.
static void cal_scale_error_EXP51_cosmic_data(double scale[5], double pt, double tanl)
Scale error for Exp.51 Cosmic data.
void recsim_mdst_propgt_(float *, float[], float[], float[], float[], float[], int *)
recsim_mdst_propgt from legacy C code
static bool is_already_scaled(void)
Check if event is already scaled.
static void cal_scale_error_EXP6165_cosmic_data(double scale[5], double pt, double tanl)
Scale error for Exp.61-65 Cosmic data.
static void cal_scale_error_EXP3941_cosmic_data(double scale[5], double pt, double)
Scale error for Exp.39-41 Cosmic data.
static void cal_scale_error_EXP45_cosmic_mc(double scale[5], double pt, double)
Scale error for Exp.45 Cosmic MC.
Abstract base class for different kinds of events.
Structure type cal_scale_error_func_set_t.
cal_scale_error_func_t m_cosMC
For cosmic MC.
cal_scale_error_func_t m_cosDATA
For cosmic data.
cal_scale_error_func_t m_hadMC
For hadronic MC.