9#include <tracking/modules/ipMonitor/BeamSpotMonitorModule.h>
10#include <framework/datastore/StoreObjPtr.h>
11#include <framework/dataobjects/EventMetaData.h>
13#include <TMatrixDSym.h>
29 setDescription(
"Module for the monitoring of the BeamSpot position and size");
32 addParam(
"outputFileName",
m_rootFileName,
"Name of output root file.", std::string(
"BeamSpotMonitor.root"));
39 TDirectory* olddir = gDirectory;
43 m_tree =
new TTree(
"bspt",
"RECREATE");
63 B2WARNING(
"No valid BeamSpot for the requested IoV");
74 B2DEBUG(25,
"monitoring beam spot for experiment = " <<
m_exp <<
", run = " <<
m_run);
102 TDirectory* olddir = gDirectory;
std::string m_rootFileName
root file name
TBranch * b_xErr
X position error of the beam spot.
TBranch * b_run
run number
TTree * m_tree
pointer to the tree
TBranch * b_xSize
X position size of the beam spot.
virtual void initialize() override
initialize the TTree
TBranch * b_zSize
Z position size of the beam spot.
double m_xSize
X position size of the beam spot.
TBranch * b_yErr
Y position error of the beam spot.
virtual void event() override
fill trees
double m_xErr
X position error of the beam spot.
TBranch * b_y
Y position of the beam spot.
TBranch * b_exp
experiment number
virtual void terminate() override
print the payloads uniqueID and write tree to the rootfile
TBranch * b_x
X position of the beam spot.
double m_x
X position of the beam spot.
double m_yErr
Y position error of the beam spot.
DBObjPtr< BeamSpot > m_BeamSpotDB
beam spot payload from the database
TBranch * b_ySize
Y position size of the beam spot.
virtual void beginRun() override
check BeamSpot payload validity
double m_zSize
Z position size of the beam spot.
int m_exp
experiment number
double m_zErr
Z position error of the beam spot.
TBranch * b_z
Z position of the beam spot.
double m_z
Z position of the beam spot.
BeamSpot m_BeamSpot
beam spot payload
double m_y
Y position of the beam spot.
TFile * m_rootFilePtr
pointer at root file used for storing histograms
BeamSpotMonitorModule()
Constructor: Sets the description, the properties and the parameters of the module.
StoreObjPtr< EventMetaData > m_EventMetaData
EventMetaData.
TBranch * b_zErr
Z position error of the beam spot.
double m_ySize
Y position size of the beam spot.
const TMatrixDSym & getSizeCovMatrix() const
Get the covariance matrix of the size of the IP position modeled as a gaussian.
const TMatrixDSym & getIPPositionCovMatrix() const
Get the covariance matrix of the measured IP position.
const TVector3 & getIPPosition() const
Get the IP position.
void setDescription(const std::string &description)
Sets the description of the module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.