

When version number 0 is used for the function TPntDB::Get (it is the default value), the latest version data for that run is loaded.







The information of primary vertex distribution is stored in the database.
Usually there is no need to use these tables directly. Please use "IpProfile" class.Panther tables :
IP_Profile_General : IP profile information for users.These tables are defined in run_info.tdf.
It contains IP profile in the form of mean position and
its error matrix. And quality flag means0 : Not calculated correctly.Generally you should use quality > 0.
1 : It is calculated from Bhabha information only.
2 : It is calculated from Hadron information only.
3 : Hadron and Bhabha information is converged.IP_Profile_Hadron : IP profile information from HadronC data.
This is for experts.IP_Profile_Bhabha : IP profile information from Bhabha data.
This is for experts.Accelerator_info : Beam size information from accelerator.
Relation between PntDB version and BELLE_LEVEL is shown here.
To get data from database :
...
#include "panther/panther.h"#include RUN_INFO_H
// for database access
#include "pntdb/TPntFDDB.h"
#include "pntdb/TPntDB.h"...
// @begin_run
// Get Panther table managers
Ip_profile_general_Manager& General_mgr = Ip_profile_general_Manager::get_manager();
Ip_profile_hadron_Manager& Hadron_mgr = Ip_profile_hadron_Manager::get_manager();
Ip_profile_bhabha_Manager& Bhabha_mgr = Ip_profile_bhabha_Manager::get_manager();
Accelerator_info_Manager& Ainfo_mgr = Accelerator_info_Manager::get_manager();// Remove old tables
General_mgr.remove();
Hadron_mgr.remove();
Bhabha_mgr.remove();
Ainfo_mgr.remove();// Open database
TPntFDDB fddb("rif");
TPntDB db(fddb, "beam_profile");
if(!db.IsOK()){
cerr << "Error : Cannot access rif::beam_profile.\n";
return 1;
}// Get data from database
// function Get returns size nRead
// <= 0 error
// You can check whether DB is filled or not.
if(db.Get(exp, run, version) <= 0){
cerr << "Error : Cannot get data from database correctly.\n";
return 1;
}// Set non_clear flag
db.non_clear(IP_PROFILE_GENERAL);
db.non_clear(IP_PROFILE_HADRON);
db.non_clear(IP_PROFILE_BHABHA);
db.non_clear(ACCELERATOR_INFO);...
To obtain primary vertex from KFitter and IP profile :
...
#include "panther/panther.h"#include RUN_INFO_H
#include "particle/utility.h"
#include "kfitter/kvertexfitter.h"
...
// Get Panther table manager
Ip_profile_general_Manager& IP_mgr = Ip_profile_general_Manager::get_manager();// Get IP_Profile_General table
vector<Ip_profile_general>::iterator itip = IP_mgr.begin();
if(!itip) return;// Check quality flag
// <= 0 : error
if(itip->quality() <= 0) return;// IP mean position
HepPoint3D ip_position(itip->IPx(), itip->IPy(), itip->IPz());// Fill error matrix
HepSymMatrix ip_err(3, 0);
ip_err(1, 1) = itip->IPerror(0);
ip_err(2, 1) = itip->IPerror(1);
ip_err(2, 2) = itip->IPerror(2);
ip_err(3, 1) = itip->IPerror(3);
ip_err(3, 2) = itip->IPerror(4);
ip_err(3, 3) = itip->IPerror(5);kvertexfitter kv;
// Add particle that comes from IP
addTrack2fit(kv, Particle);
// Add IP profile information
addBeam2fit(kv, ip_position, ip_err);// Fit
unsigned int err = kv.fit();
if(err) return;...
To compile codes using pntdb, some Postgres header files and libraries are required. Please refer to
$BELLE_TOP_DIR/docsrc/examples/pntdb/examples/basf_if/Makefile (for basf modules)
or
$BELLE_TOP_DIR/docsrc/examples/pntdb/examples/basics/Makefile .
It is calculated by EvtVtx module.
EvtVtx module fills Evtvtx_Primary_Vertex Panther table.
The tracks used in primary vertex calculation are stored in
Evtvtx_trk Panther table. These tables are defined in evtvtx.tdf.