Belle II Software development
PhysicsObjectsMiraBelleDst2Module.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <dqm/modules/PhysicsObjectsMiraBelle/PhysicsObjectsMiraBelleDst2Module.h>
10#include <analysis/dataobjects/ParticleList.h>
11#include <analysis/variables/Variables.h>
12#include <framework/datastore/StoreObjPtr.h>
13#include <mdst/dataobjects/SoftwareTriggerResult.h>
14#include <TDirectory.h>
15#include <map>
16
17using namespace Belle2;
18
19REG_MODULE(PhysicsObjectsMiraBelleDst2);
20
22{
23 setDescription("Monitor Physics Objects Quality");
25
26 addParam("TriggerIdentifier", m_triggerIdentifier,
27 "Trigger identifier string used to select events for the histograms", std::string("software_trigger_cut&skim&accept_hadron"));
28 addParam("DstListName", m_dstListName, "Name of the D*+ particle list", std::string("D*+:physMiraBelle"));
29}
30
32{
33 TDirectory* oldDir = gDirectory;
34 oldDir->mkdir("PhysicsObjectsMiraBelleDst2");
35 oldDir->cd("PhysicsObjectsMiraBelleDst2");
36
37 // Mass distributions
38 m_h_D0_pi0_InvM = new TH1F("hist_D0_pi0_InvM", "#pi^{0} mass of D^{*}#rightarrowK#pi#pi^{0};D0_pi0_InvM;", 50, 0.09, 0.17);
39
40 oldDir->cd();
41}
42
43
45{
46 REG_HISTOGRAM
47
49 result.isOptional();
50}
51
56
58{
59
61 if (!result.isValid()) {
62 B2WARNING("SoftwareTriggerResult object not available but needed to select events for the histograms.");
63 return;
64 }
65
66 const std::map<std::string, int>& results = result->getResults();
67 if (results.find(m_triggerIdentifier) == results.end()) {
68 B2WARNING("PhysicsObjectsMiraBelleDst2: Can't find trigger identifier: " << m_triggerIdentifier);
69 return;
70 }
71
72 // apply software trigger
73 const bool accepted = (result->getResult(m_triggerIdentifier) == SoftwareTriggerCutResult::c_accept);
74 if (accepted == false) return;
75
76 // get D* candidates
78
79 for (unsigned int i = 0; i < dstParticles->getListSize(); i++) {
80 const Particle* dst = dstParticles->getParticle(i);
81 const Particle* d0 = dst->getDaughter(0);
82 float dst_mass = dst->getMass();
83 float d0_mass = d0->getMass();
84 float delta_m = dst_mass - d0_mass;
85 // Mass of Pi0
86 if (1.83 < d0_mass && d0_mass < 1.89 && 0.142 < delta_m && delta_m < 0.148) {
87 m_h_D0_pi0_InvM->Fill(Belle2::Variable::particleInvariantMassFromDaughters(d0->getDaughter(2)));
88 }
89 }
90}
91
92// void PhysicsObjectsMiraBelleDst2Module::getPIDInformationMiraBelle(Particle* part, float pid[3][7])
93// {
94// PIDLikelihood* I_like_coffee = part->getPIDLikelihood();
95// pid[0][0] = I_like_coffee->getProbability();
96// }
97
HistoModule()
Constructor.
Definition HistoModule.h:32
void setDescription(const std::string &description)
Sets the description of the module.
Definition Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition Module.h:80
Class to store reconstructed particles.
Definition Particle.h:76
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
Definition Particle.cc:662
double getMass() const
Returns invariant mass (= nominal for FS particles)
Definition Particle.h:527
std::string m_dstListName
Name of the mu+ particle list.
void event() override
This method is called for each event.
std::string m_triggerIdentifier
Trigger identifier string used to select events for the histograms.
void beginRun() override
Called when entering a new run.
TH1F * m_h_D0_pi0_InvM
Pi0 invariant mass for D0->Kpipi0.
void defineHisto() override
Definition of the histograms.
Type-safe access to single objects in the data store.
Definition StoreObjPtr.h:96
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition Module.h:559
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition Module.h:649
Abstract base class for different kinds of events.