59#define HEP_SHORT_NAMES
62#include <framework/core/Module.h>
63#include <framework/dataobjects/EventExtraInfo.h>
64#include <framework/datastore/StoreObjPtr.h>
65#include <framework/logging/Logger.h>
68#include <belle_legacy/belle.h>
69#include <belle_legacy/tables/run_info.h>
72#include <CLHEP/Matrix/SymMatrix.h>
73#include <CLHEP/Geometry/Point3D.h>
121 virtual void event()
override;
140 bool mcdata,
int exp,
int option)
142 return pi0resol(p, theta, side, mcdata, exp, option);
219 void scale_momenta(
float scale_data = 1.0,
float scale_mc = 1.0,
int mode = 0);
226 double vee_mass_nofit(
const Belle::Mdst_vee2& vee2,
float scale = 1.0);
249 const CLHEP::HepSymMatrix&);
251 const CLHEP::HepSymMatrix&);
253 static double pi0resol(
double,
double,
const char*,
bool,
int,
int);
259 double Benergy(
int expnum = 0,
int runnum = 0);
269 const int mode,
const int im,
270 const double pmom,
const double sgn,
293 double prob(
int,
int,
int,
int,
double)
const;
295 double probRange(
int,
int,
int,
int)
const;
297 double probRchisq(
int,
int,
int,
double)
const;
299 double probECL(
double,
double)
const;
301 void readDB(
const char*,
int&);
Declaration of class B2BIIFixMdst.
void Muid_end_run(void)
Called when the current run ends.
int m_expno
parameter ExpNo: Experiment number for muid (default=0) 0 ==> use experiment number stored in data fi...
std::string m_scale_error_dataset_name
Set scale_error_dataset name.
int m_benergy_db
Apply Benergy from DB or file.
void Muid_init(void)
Initialize the Muid module.
float m_scale_momenta_scale_mc
Set parameter scale_mc for scale_momenta.
bool m_saveResultExtraInfo
Whether to save result as EventExtraInfo.
int m_calib_dedx
Do dedx calibration.
int m_smear_trk
Do extra-smearing for MC tracks.
int m_scale_momenta
Apply scale_momenta.
void Muid_begin_run(const int, const int, const int)
Called for each new run.
int m_correct_ecl_option
Apply correct_ecl_option.
MuidProb * m_kaonprob
Pointer to kaons' prob-density object.
int m_use_ecl
parameter UseECL: Use (1) or don't use (0) ECL in muid (default=0)
int m_l4passed_only
Select level4-passed event only.
int m_correct_ecl
Apply correct_ecl.
double m_make_pi0_lower_limit
Set make_pi0 lower mass limit.
int m_make_pi0
Apply make_pi0 (after correct_ecl)
int m_shift_tof_mode
Do tof_correction.
int m_correct_ecl_primary_vertex
Apply correct_ecl_primary_vertex.
void Muid_event(void)
Called for each event.
static double get_Benergy()
Get Benergy.
int m_reprocess_version_specified
Specify reprocess version.
float m_scale_momenta_scale_data
Set parameter scale_data for scale_momenta.
int m_correct_ecl_version
Apply correct_ecl_version.
MuidProb * m_pionprob
Pointer to pions' prob-density object.
int m_scale_error
Apply scale_error.
int m_scale_momenta_mode
Set parameter mode for scale_momenta.
int m_check_version_consistency
Check consistency between environment variable and mdst version.
int m_table_size
Check table sizes.
void Muid_term(void)
Terminate the Muid module.
int m_limit_mdst_ecl_trk
Limit of mdst_ecl_trk table size.
int m_add_or_remove_extra_trk_vee2
(1) to add to Mdst_charged etc, (-1) to remove (move to Mdst_*_extra), (0) do nothing
int m_make_pi0_primary_vertex
Apply make_pi0_primary_vertex (after correct_ecl)
int m_correct_ecl_5s
For run indep.
int m_mapped_expno
Mapped value of m_old_exp_no.
int m_reprocess_version
Reprocess version (=0:old; =1:new)
int m_limit_mdst_klm_cluster_hit
Limit of mdst_klm_cluster_hit table size.
int m_hadron_b_only
Select Hadron B event only.
MuidProb * m_muonprob
Pointer to muons' prob-density object.
int m_old_expno
Most recently used experiment # in muid.
static double get_pi0resol(double p, double theta, const char *side, bool mcdata, int exp, int option)
Get pi0 resolution.
int m_benergy
Apply Benergy.
static const int m_muid_version
Version number of muid part.
int m_good_event
Select good event only.
int m_hadron_a_only
Select Hadron A event only.
int m_benergy_mcdb
Apply Benergy from DB or default value in MC.
double m_make_pi0_upper_limit
Set make_pi0 upper mass limit.
StoreObjPtr< EventExtraInfo > m_eventExtraInfo
Event ExtraInfo.
int m_5Srun
5S,2S,1S run or not
int m_eklm_max_layer
parameter Endcap_MX_layer: Max layer # of KLM endcap (default=11) 0 ==> use same value as was used by...
int m_make_pi0_option
Set make_pi0 option.
Class computes probability density for Muid calculation.
double fRchisq[2][4][kRchisq+1]
Reduced chi-squared pdf.
double fRchisqD2[2][4][kRchisq+1]
Second derivatives of Reduced chi-squared pdf.
static const int kRange
Array size of range.
double fRange[2][4][15][kRange]
Range pdf.
double probRange(int, int, int, int) const
Compute probability density for range.
double probECL(double, double) const
Compute probability density for ECL energy deposit.
double fRchisqD1[2][4][kRchisq+1]
First derivatives of Reduced chi-squared pdf.
double probRchisq(int, int, int, double) const
Compute probability density for reduced chi-squared.
static const int kRchisq
Array size of reduced chi-squared.
static const double kEEclMax
Overflow value of ECL energy.
double fEEclD1[kPTrk][kEEcl+1]
First derivatives of ECL energy pdf.
double fEEclD2[kPTrk][kEEcl+1]
Second derivatives of ECL energy pdf.
static const double kPTrkMax
Overflow value of CDC momentum.
double fEEclD3[kPTrk][kEEcl+1]
Third derivatives of ECL energy pdf.
double fRchisqN[2][4][15]
Non-overflow normalization.
static const int kEEcl
Array size of ECL energy.
double fRchisqD3[2][4][kRchisq+1]
Third derivatives of Reduced chi-squared pdf.
static const int kPTrk
Array size of CDC momentum.
static const double kRchisqMax
Overflow value of reduced chi-squared.
void readDB(const char *, int &)
Read in probability density functions from database.
double fEEcl[kPTrk][kEEcl+1]
ECL energy pdf.
Type-safe access to single objects in the data store.
void fix_pi0_brecon(void)
Fix relation gamma<->pi0 in brecon table.
void scale_momenta_set_v2(const int, const int, const int, double &)
Return scale factors set_v2.
void make_pi0(int, double, double)
Create Mdst_pi0 from Mdst_gamma and Mdst_ecl to let people get mass-constraint fitted momentum of pi0...
B2BIIFixMdstModule()
Constructor.
void shift_tof(const int mode)
Shift tof times to account for residuals.
virtual void initialize() override
Initialize the module.
void make_pi0_primary_vertex(int, double, double, const HepPoint3D &, const CLHEP::HepSymMatrix &)
Fill Mdst_pi0 based on the fit result.
virtual void event() override
Called for each event.
void smear_trk()
Apply track smearing (on MC)
double Benergy(int expnum=0, int runnum=0)
Return Beam energy.
virtual void terminate() override
Terminates the module.
int remove_extra_trk_vee2()
Remove extra tracks from Mdst_trk and Mdst_vee2.
void correct_ecl_primary_vertex(const HepPoint3D &, const CLHEP::HepSymMatrix &)
Correct ecl using primary vertex.
void correct_ecl(int, int)
Correct photon's momenta and error matrix.
virtual void beginRun() override
Called when a new run is started.
void scale_momenta_set_v1(const int, const int, const int, double &)
Return scale factors set_v1.
int add_extra_trk_vee2()
Add Mdst_trk_extra and Mdst_vee_extra to Mdst_trk and Mdst_vee2, respectively.
void shift_tof_set(const int expno, const int runno, const int mode, const int im, const double pmom, const double sgn, double &shift)
Return time shifts for different exp.
int set_primary_vertex(HepPoint3D &v, CLHEP::HepSymMatrix &ve)
Set primary vertex assuming all tracks are pions.
static double s_benergy_value
Beam energy.
void scale_momenta(float scale_data=1.0, float scale_mc=1.0, int mode=0)
Scale momenta of Mdst_trk.
bool good_event()
Check if event corresponds to the period when Belle detector not in good condition.
void scale_error(const int message_level=0)
Apply scale error.
void scale_momenta_set(const int, const int, const int, double &)
Return scale factors for 2001 summer confs.
int get_reprocess_version()
Get reprocess version of input mdst.
double vee_mass_nofit(const Belle::Mdst_vee2 &vee2, float scale=1.0)
Calculates V0 mass with non-constraint fit results.
static double pi0resol(double, double, const char *, bool, int, int)
Treat pi0 mass width as a func.
Abstract base class for different kinds of events.