13#include <dqm/modules/PhysicsObjectsDQM/PhysicsObjectsDQMModule.h>
14#include <analysis/dataobjects/ParticleList.h>
15#include <analysis/variables/EventShapeVariables.h>
16#include <analysis/variables/BelleVariables.h>
17#include <analysis/ContinuumSuppression/FoxWolfram.h>
18#include <analysis/utility/PCmsLabTransform.h>
19#include <mdst/dataobjects/Track.h>
20#include <framework/datastore/StoreArray.h>
21#include <analysis/ClusterUtility/ClusterUtils.h>
22#include <framework/datastore/StoreObjPtr.h>
23#include <framework/gearbox/Const.h>
24#include <mdst/dataobjects/SoftwareTriggerResult.h>
25#include <mdst/dataobjects/TRGSummary.h>
26#include <hlt/softwaretrigger/calculations/utilities.h>
27#include <TDirectory.h>
49 "Trigger identifier string used to select events for the histograms", std::string(
"software_trigger_cut&skim&accept_hadron"));
51 "Trigger identifier string used to select events for the mumu histograms",
52 std::string(
"software_trigger_cut&skim&accept_mumutight"));
54 "Trigger identifier string used to select events for the bhabha histograms",
55 std::string(
"software_trigger_cut&skim&accept_bhabha_trk_ecl"));
57 "Trigger identifier string used to select events for the hadronb2 histograms",
58 std::string(
"software_trigger_cut&skim&accept_hadronb2"));
60 "Trigger identifier string used to select events for the HLTprefilter histograms",
61 std::string(
"software_trigger_cut&filter&total_result"));
67 addParam(
"UpsHadPListName",
m_hadbphysDQM,
"Name of the pi hadron particle list", std::string(
"pi+:hadbphysDQM"));
72 TDirectory* oldDir = gDirectory;
73 oldDir->mkdir(
"PhysicsObjects");
74 oldDir->cd(
"PhysicsObjects");
76 m_h_mKS0 =
new TH1F(
"mKS0",
"KS0 Invariant Mass", 20, 0.48, 0.52);
77 m_h_mKS0->SetXTitle(
"M(K_{S}^{0}) [GeV]");
79 m_h_mPI0 =
new TH1F(
"mPI0",
"pi0 Invariant Mass", 25, 0.10, 0.15);
80 m_h_mPI0->SetXTitle(
"M(#pi^{0}) [GeV]");
82 m_h_mUPS =
new TH1F(
"mUPS",
"Ups Invariant Mass", 500, 9, 12);
83 m_h_mUPS->SetXTitle(
"M(#mu#mu) [GeV]");
85 m_h_R2 =
new TH1F(
"R2",
"Event Level R2", 36, 0, 1.2);
88 m_h_mUPSe =
new TH1F(
"mUPSe",
"Ups ee Invariant Mass", 500, 9, 12);
100 m_h_nKshortAllH =
new TH1F(
"hist_nKshortAllH",
"hist_nKshortAllH", 50, 0.45, 0.55);
101 m_h_nKshortActiveH =
new TH1F(
"hist_nKshortActiveH",
"hist_nKshortActiveH", 50, 0.45, 0.55);
136 if (!result.isValid()) {
137 B2WARNING(
"SoftwareTriggerResult object not available but needed to select events for the histograms.");
141 const std::map<std::string, int>& results = result->getResults();
145 bool HLTAccepted =
false;
151 if (HLTAccepted !=
false) {
154 bool inActiveInjectionVeto =
false;
157 inActiveInjectionVeto =
true;
158 }
catch (
const std::exception&) {}
171 for (
unsigned int i = 0; i < ks0Particles->getListSize(); i++) {
172 const Particle* mergeKsCand = ks0Particles->getParticle(i);
173 const bool isKsCandGood = Variable::goodBelleKshort(mergeKsCand);
177 if (inActiveInjectionVeto) {
195 if (accepted !=
false) {
204 double R2 = Belle2::Variable::foxWolframR2(
nullptr);
207 if (pi0Particles.
isValid() && abs(pi0Particles->getPDGCode()) ==
Const::pi0.getPDGCode()) {
208 for (
unsigned int i = 0; i < pi0Particles->getListSize(); i++) {
209 const Particle* pi0 = pi0Particles->getParticle(i);
214 for (
unsigned int i = 0; i < ks0Particles->getListSize(); i++) {
215 const Particle* ks0 = ks0Particles->getParticle(i);
227 if (accepted !=
false) {
231 for (
unsigned int i = 0; i < UpsParticles->getListSize(); i++) {
232 const Particle* Ups = UpsParticles->getParticle(i);
245 if (accepted !=
false) {
252 if (UpsbhabhaParticles.
isValid()) {
253 for (
unsigned int i = 0; i < UpsbhabhaParticles->getListSize(); i++) {
254 const Particle* Upse = UpsbhabhaParticles->getParticle(i);
268 if (accepted !=
false && HLTAccepted !=
false) {
274 std::vector<ROOT::Math::PxPyPzEVector> m_pionHad;
275 double EsumPiHad = 0.;
276 for (
unsigned int i = 0; i < hadpiParticles->getListSize(); i++) {
277 const Particle* parPiHad = hadpiParticles->getParticle(i);
279 m_pionHad.push_back(V4PiHad);
280 EsumPiHad += V4PiHad.E();
283 double eneclClusters = 0.;
286 double EsumGamma = 0.;
288 for (
int ncl = 0; ncl < eclClusters.
getEntries(); ncl++) {
292 if (!eclClusters[ncl]->getRelatedFrom<Track>()) {
295 EsumGamma += V4Gamma_CMS.E();
300 double visibleEnergyCMSnorm = (EsumPiHad + EsumGamma) / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
301 double EsumCMSnorm = eneclClusters / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
304 double R2 = fw.
getR(2);
305 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.
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()
Constructor.
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.
double getMass() const
Returns invariant mass (= nominal for FS particles)
TH1F * m_h_nKshortAllH
Histograms for Ks.
TH1F * m_h_mUPS
Ups invariant mass.
std::string m_ks0PListName
Name of the KS0 particle list.
void initialize() override
Initializer.
StoreObjPtr< TRGSummary > m_l1Trigger
Objects relevant to HLTprefilter monitoring.
void event() override
This method is called for each event.
std::string m_prefilter_Injection_Strip
HLTPrefilter lines.
std::string m_triggerIdentifier
Trigger identifier string used to select events for the histograms.
bool m_CDCECLCut
Flag for timing cut on injection strip.
TH1F * m_h_mPI0
PI0 invariant mass.
TH1F * m_h_nKshortActiveNotCDCECLH
Histogram for Ks events : && active veto && !timing cut.
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.
bool m_TimingCut
CDC-ECL occupancy cut for prefilter.
std::string m_prefilter_CDCECL_Cut
Timing cut for prefilter.
std::string m_triggerIdentifierHLT
Trigger identifier string used to select events for HLTprefilter histograms.
std::string m_triggerIdentifierMuMu
Trigger identifier string used to select events for the mumu histograms.
TH1F * m_h_nKshortActiveH
Histogram for Ks events.
std::string m_pi0PListName
Name of the pi0 particle list.
TH1F * m_h_nKshortActiveNotTimeH
Histogram for Ks events : active veto.
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 whether 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.