8#include <dqm/modules/PhysicsObjectsMiraBelle/PhysicsObjectsMiraBelleEcmsBBModule.h>
10#include <analysis/variables/ContinuumSuppressionVariables.h>
11#include <analysis/utility/PCmsLabTransform.h>
12#include <framework/particledb/EvtGenDatabasePDG.h>
13#include <mdst/dataobjects/SoftwareTriggerResult.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <analysis/dataobjects/ParticleList.h>
17#include <TDirectory.h>
36 setDescription(
"Monitor of the CMS collision energy based on hadronic B decays");
40 "Trigger identifier string used to select events for the histograms", std::string(
"software_trigger_cut&skim&accept_btocharm"));
41 addParam(
"BmListName",
m_BmListName,
"Name of the B- particle list", std::string(
"B-:combined"));
42 addParam(
"B0ListName",
m_B0ListName,
"Name of the B0 particle list", std::string(
"B0:combined"));
53 TDirectory* oldDir = gDirectory;
54 oldDir->mkdir(
"PhysicsObjectsMiraBelleEcmsBB");
55 oldDir->cd(
"PhysicsObjectsMiraBelleEcmsBB");
62 m_hB0 =
new TH1D(
"hB0",
"", 80, cMBp, 5.37);
63 m_hBp =
new TH1D(
"hBp",
"", 80, cMBp, 5.37);
80 if (!result.isValid()) {
81 B2WARNING(
"SoftwareTriggerResult object not available but needed to select events for the histograms.");
86 if (accepted ==
false)
return;
92 std::vector<const Particle*> Bparts;
95 for (
unsigned i = 0; i < B0->getListSize(); ++i)
96 if (B0->getParticle(i))
97 Bparts.push_back(B0->getParticle(i));
100 for (
unsigned i = 0; i < Bm->getListSize(); ++i)
101 if (Bm->getParticle(i))
102 Bparts.push_back(Bm->getParticle(i));
106 if (Bparts.size() == 0)
return;
108 for (
unsigned i = 0; i < Bparts.size(); ++i) {
112 double dmDstar = std::numeric_limits<double>::quiet_NaN();
126 dmDstar = Dstar->
getMass() - D->getMass();
128 B2INFO(
"No D meson found");
130 double mD = D ? D->getMass() : std::numeric_limits<double>::quiet_NaN();
134 double mInv = Bpart->
getMass();
136 double R2 = Variable::R2(Bpart);
147 double eBC =
sqrt(pBcms * pBcms + mB * mB);
148 if (abs(pdg) == 511) {
static EvtGenDatabasePDG * Instance()
Instance method that loads the EvtGen table.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to store reconstructed particles.
int getPDGCode(void) const
Returns PDG code.
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
double getMass() const
Returns invariant mass (= nominal for FS particles)
PhysicsObjectsMiraBelleEcmsBBModule()
Constructor.
void initialize() override final
Register the histograms.
std::string m_B0ListName
List name for neutral B candidates.
static constexpr double c_mDmax
Maximal value of the D meson inv mass.
void defineHisto() override final
Initialize the histograms.
std::string m_triggerIdentifier
Trigger identifier string used to select events for the histograms.
void event() override final
Event processor Filling of the histograms.
static constexpr double c_mDmin
Minimal value of the D meson inv mass.
TH1D * m_hBp
EB* histogram for charged B.
static constexpr double c_dmDstarMin
Minimal value of the m(D*)-(mD)
std::string m_BmListName
List name for charged B candidates.
TH1D * m_hB0
EB* histogram for neutral B.
static constexpr double c_dmDstarMax
Maximal value of the m(D*)-(mD)
void beginRun() override final
Reset the histograms.
static constexpr double c_mBwindow
Maximal deviation of B meson inv mass from PDG value.
static constexpr double c_R2max
Maximal allowed R2 value (to suppress continuum)
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
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
@ c_accept
Accept this event.
Abstract base class for different kinds of events.