8 #include <tracking/modules/BeamSpotCollector/BeamSpotCollectorModule.h>
10 #include <analysis/dataobjects/ParticleList.h>
11 #include <analysis/utility/ReferenceFrame.h>
12 #include <mdst/dataobjects/TrackFitResult.h>
29 m_evt(-99), m_exp(-99), m_run(-99),
31 m_mu0_d0(-99), m_mu0_z0(-99), m_mu0_phi0(-99), m_mu0_tanlambda(-99), m_mu0_omega(-99),
32 m_mu1_d0(-99), m_mu1_z0(-99), m_mu1_phi0(-99), m_mu1_tanlambda(-99), m_mu1_omega(-99)
36 setDescription(
"Collect data for BeamSpot calibration algorithm using the position of mu+mu- events");
37 setPropertyFlags(c_ParallelProcessingCertified);
39 addParam(
"Y4SPListName", m_Y4SPListName,
"Name of the Y4S particle list", std::string(
"Upsilon(4S):IPDQM"));
44 B2INFO(
"Init of the trees");
45 std::string objectName =
"events";
47 TTree* tree =
new TTree(objectName.c_str(),
"");
49 tree->Branch<
int>(
"event", &m_evt);
50 tree->Branch<
int>(
"exp", &m_exp);
51 tree->Branch<
int>(
"run", &m_run);
52 tree->Branch<
double>(
"time", &m_time);
54 tree->Branch<
double>(
"mu0_d0", &m_mu0_d0);
55 tree->Branch<
double>(
"mu0_z0", &m_mu0_z0);
56 tree->Branch<
double>(
"mu0_phi0", &m_mu0_phi0);
57 tree->Branch<
double>(
"mu0_tanlambda", &m_mu0_tanlambda);
59 tree->Branch<
double>(
"mu1_d0", &m_mu1_d0);
60 tree->Branch<
double>(
"mu1_z0", &m_mu1_z0);
61 tree->Branch<
double>(
"mu1_phi0", &m_mu1_phi0);
62 tree->Branch<
double>(
"mu1_tanlambda", &m_mu1_tanlambda);
68 registerObject<TTree>(objectName, tree);
74 m_evt = m_emd->getEvent();
75 m_run = m_emd->getRun();
76 m_exp = m_emd->getExperiment();
77 m_time = m_emd->getTime() / 1e9 / 3600.;
83 if (!Y4SParticles.
isValid() || abs(Y4SParticles->getPDGCode()) != 300553)
86 if (Y4SParticles->getListSize() != 1)
90 std::vector<int> indxes = Y4SParticles->getParticle(0)->getDaughterIndices();
91 if (indxes.size() != 2)
return;
93 const Particle* part0 = Y4SParticles->getParticle(0)->getDaughter(0);
94 const Particle* part1 = Y4SParticles->getParticle(0)->getDaughter(1);
98 m_mu0_d0 = tr0->
getD0();
99 m_mu0_z0 = tr0->
getZ0();
105 m_mu1_d0 = tr1->
getD0();
106 m_mu1_z0 = tr1->
getZ0();
112 getObjectPtr<TTree>(
"events")->Fill();
This collects the track parameters of the mu+mu- events for calibration of the BeamSpot using CAF and...
void prepare() override final
Initialize the module.
void collect() override final
Event processor The filling of the tree.
Calibration collector module base class.
Class to store reconstructed particles.
const TrackFitResult * getTrackFitResult() const
Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Tr...
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
Values of the result of a track fit with a given particle hypothesis.
double getOmega() const
Getter for omega.
double getD0() const
Getter for d0.
double getTanLambda() const
Getter for tanLambda.
double getZ0() const
Getter for z0.
double getPhi0() const
Getter for phi0.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.