13#include <dqm/modules/PhysicsObjectsDQM/PhysicsObjectsDQMModule.h>
14#include <analysis/dataobjects/ParticleList.h>
15#include <analysis/variables/EventShapeVariables.h>
16#include <analysis/ContinuumSuppression/FoxWolfram.h>
17#include <analysis/utility/PCmsLabTransform.h>
18#include <mdst/dataobjects/Track.h>
19#include <framework/datastore/StoreArray.h>
20#include <analysis/ClusterUtility/ClusterUtils.h>
21#include <framework/datastore/StoreObjPtr.h>
22#include <framework/gearbox/Const.h>
23#include <mdst/dataobjects/SoftwareTriggerResult.h>
24#include <hlt/softwaretrigger/calculations/utilities.h>
25#include <TDirectory.h>
47 "Trigger identifier string used to select events for the histograms", std::string(
"software_trigger_cut&skim&accept_hadron"));
49 "Trigger identifier string used to select events for the mumu histograms",
50 std::string(
"software_trigger_cut&skim&accept_mumutight"));
52 "Trigger identifier string used to select events for the bhabha histograms",
53 std::string(
"software_trigger_cut&skim&accept_bhabha_all"));
55 "Trigger identifier string used to select events for the hadronb2 histograms",
56 std::string(
"software_trigger_cut&skim&accept_hadronb2"));
62 addParam(
"UpsHadPListName",
m_hadbphysDQM,
"Name of the pi hadron particle list", std::string(
"pi+:hadbphysDQM"));
67 TDirectory* oldDir = gDirectory;
68 oldDir->mkdir(
"PhysicsObjects");
69 oldDir->cd(
"PhysicsObjects");
71 m_h_mKS0 =
new TH1F(
"mKS0",
"KS0 Invariant Mass", 20, 0.48, 0.52);
72 m_h_mKS0->SetXTitle(
"M(K_{S}^{0}) [GeV]");
74 m_h_mPI0 =
new TH1F(
"mPI0",
"pi0 Invariant Mass", 25, 0.10, 0.15);
75 m_h_mPI0->SetXTitle(
"M(#pi^{0}) [GeV]");
77 m_h_mUPS =
new TH1F(
"mUPS",
"Ups Invariant Mass", 500, 9, 12);
78 m_h_mUPS->SetXTitle(
"M(#mu#mu) [GeV]");
80 m_h_R2 =
new TH1F(
"R2",
"Event Level R2", 36, 0, 1.2);
83 m_h_mUPSe =
new TH1F(
"mUPSe",
"Ups ee Invariant Mass", 500, 9, 12);
129 if (!result.isValid()) {
130 B2WARNING(
"SoftwareTriggerResult object not available but needed to select events for the histograms.");
134 const std::map<std::string, int>& results = result->getResults();
141 if (accepted !=
false) {
148 double R2 = Belle2::Variable::foxWolframR2(
nullptr);
152 for (
unsigned int i = 0; i < pi0Particles->getListSize(); i++) {
153 Particle* pi0 = pi0Particles->getParticle(i);
158 for (
unsigned int i = 0; i < ks0Particles->getListSize(); i++) {
159 Particle* ks0 = ks0Particles->getParticle(i);
171 if (accepted !=
false) {
175 for (
unsigned int i = 0; i < UpsParticles->getListSize(); i++) {
176 Particle* Ups = UpsParticles->getParticle(i);
189 if (accepted !=
false) {
192 if (UpsbhabhaParticles.
isValid()) {
193 for (
unsigned int i = 0; i < UpsbhabhaParticles->getListSize(); i++) {
194 Particle* Upse = UpsbhabhaParticles->getParticle(i);
207 if (accepted !=
false) {
213 std::vector<ROOT::Math::XYZVector> m_pionHadv3;
214 double EsumPiHad = 0.;
215 for (
unsigned int i = 0; i < hadpiParticles->getListSize(); i++) {
216 const Particle* parPiHad = hadpiParticles->getParticle(i);
219 EsumPiHad += V4PiHad.E();
222 double eneclClusters = 0.;
225 double EsumGamma = 0.;
227 for (
int ncl = 0; ncl < eclClusters.
getEntries(); ncl++) {
231 if (!eclClusters[ncl]->getRelatedFrom<Track>()) {
234 EsumGamma += V4Gamma_CMS.E();
239 double visibleEnergyCMSnorm = (EsumPiHad + EsumGamma) / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
240 double EsumCMSnorm = eneclClusters / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
243 double R2 = fw.
getR(2);
244 bool hadronb_tag = visibleEnergyCMSnorm > 0.4 && EsumCMSnorm > 0.2 && R2 < 0.2;
Class to provide momentum-related information from ECLClusters.
const ROOT::Math::PxPyPzEVector Get4MomentumFromCluster(const ECLCluster *cluster, ECLCluster::EHypothesisBit hypo)
Returns four momentum vector.
int getPDGCode() const
PDG code.
static const ParticleType pi0
neutral pion particle
static const ParticleType Kshort
K^0_S particle.
@ c_nPhotons
CR is split into n photons (N1)
Class to calculate the Fox-Wolfram moments up to order 8.
double getR(int i) const
Returns the i-th moment normalized to the 0th-order moment.
void calculateBasicMoments()
Method to perform the calculation of the moments up to order 4, which are the most relevant ones.
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.
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
ROOT::Math::XYZVector getMomentum() const
Returns momentum vector.
double getMass() const
Returns invariant mass (= nominal for FS particles)
TH1F * m_h_mUPS
Ups invariant mass.
std::string m_ks0PListName
Name of the KS0 particle list.
void initialize() override
Initializer.
void event() override
This method is called for each event.
void endRun() override
This method is called if the current run ends.
void terminate() override
This method is called at the end of the event processing.
std::string m_triggerIdentifier
Trigger identifier string used to select events for the histograms.
TH1F * m_h_mPI0
PI0 invariant mass.
TH1F * m_h_mUPSe
Ups ee invariant mass.
void beginRun() override
Called when entering a new run.
TH1F * m_h_physicsresults
event physics results
TH1F * m_h_mKS0
KS0 invariant mass.
PhysicsObjectsDQMModule()
Constructor.
std::string m_upsPListName
Name of the Ups particle list.
std::string m_hadbphysDQM
Name of the pi hadron particle list.
std::string m_upsBhabhaPListName
Name of the Ups bhabha particle list.
std::string m_triggerIdentifierHadronb2
Trigger identifier string used to select events for the hadronb2 histograms.
std::string m_triggerIdentifierMuMu
Trigger identifier string used to select events for the mumu histograms.
std::string m_pi0PListName
Name of the pi0 particle list.
void defineHisto() override
Definition of the histograms.
std::string m_triggerIdentifierBhabha
Trigger identifier string used to select events for the ee histograms.
Accessor to arrays stored in the data store.
bool isValid() const
Check wether the array was registered.
int getEntries() const
Get the number of objects in the array.
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.
@ c_accept
Accept this event.
Abstract base class for different kinds of events.