9#include <dqm/modules/PhysicsObjectsMiraBelle/PhysicsObjectsMiraBelleHadronModule.h>
10#include <hlt/softwaretrigger/calculations/utilities.h>
11#include <analysis/dataobjects/ParticleList.h>
12#include <analysis/ContinuumSuppression/FoxWolfram.h>
13#include <analysis/utility/PCmsLabTransform.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <framework/datastore/StoreArray.h>
16#include <mdst/dataobjects/Track.h>
17#include <mdst/dataobjects/SoftwareTriggerResult.h>
18#include <analysis/ClusterUtility/ClusterUtils.h>
19#include <TDirectory.h>
32 "Trigger identifier string used to select events for the histograms", std::string(
"software_trigger_cut&skim&accept_hadronb2"));
33 addParam(
"hadronb2piPListName",
m_hadpiPListName,
"Name of the pi+ particle list", std::string(
"pi+:hadb2physMiraBelle"));
38 TDirectory* oldDir = gDirectory;
39 oldDir->mkdir(
"PhysicsObjectsMiraBelleHadron");
40 oldDir->cd(
"PhysicsObjectsMiraBelleHadron");
43 m_h_nECLClusters =
new TH1F(
"hist_nECLClusters",
"hist_nECLClusters", 100, 0, 60);
47 m_h_EsumCMSnorm =
new TH1F(
"hist_EsumCMSnorm",
"hist_EsumCMSnorm", 100, 0, 2);
49 m_h_R2 =
new TH1F(
"hist_R2",
"hist_R2", 100, 0, 1);
50 m_h_R2->SetXTitle(
"hist_R2");
82 if (!result.isValid()) {
83 B2WARNING(
"SoftwareTriggerResult object not available but needed to select events for the histograms.");
87 const std::map<std::string, int>& results = result->getResults();
89 B2WARNING(
"PhysicsObjectsMiraBelleHadron: Can't find trigger identifier: " <<
m_triggerIdentifier);
95 if (accepted ==
false)
return;
99 std::vector<ROOT::Math::PxPyPzEVector> m_pionHad;
101 double EsumPiHad = 0.;
103 for (
unsigned int i = 0; i < hadpiParticles->getListSize(); i++) {
104 const Particle* parPiHad = hadpiParticles->getParticle(i);
106 m_pionHad.push_back(V4PiHad);
107 EsumPiHad += V4PiHad.E();
111 double neclClusters = -1.;
112 double eneclClusters = 0.;
115 double EsumGamma = 0.;
118 const unsigned int numberOfECLClusters = std::count_if(eclClusters.
begin(), eclClusters.
end(),
120 return (eclcluster.hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)
121 and eclcluster.getEnergy(ECLCluster::EHypothesisBit::c_nPhotons) > 0.1);
123 neclClusters = numberOfECLClusters;
124 for (
int ncl = 0; ncl < eclClusters.
getEntries(); ncl++) {
128 if (!eclClusters[ncl]->getRelatedFrom<Track>()) {
131 EsumGamma += V4Gamma_CMS.E();
137 double visibleEnergyCMSnorm = (EsumPiHad + EsumGamma) / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
138 double EsumCMSnorm = eneclClusters / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
141 double R2 = fw.
getR(2);
147 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.
@ 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.
void initialize() override
Initializer.
void event() override
This method is called for each event.
TH1F * m_h_physicsresultsH
histogram for event results for hadronb2 and hadronb2 tight
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_R2
histogram for R2 of hadron events after the hadronb2 selection
std::string m_hadpiPListName
Name of the pi+ particle list.
void beginRun() override
Called when entering a new run.
PhysicsObjectsMiraBelleHadronModule()
Constructor.
TH1F * m_h_visibleEnergyCMSnorm
histogram for visible energy of tracks and gammas
TH1F * m_h_EsumCMSnorm
histogram for sum of energy of clusters with E > 0.1
TH1F * m_h_nECLClusters
To check hadron events.
void defineHisto() override
Definition of the 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.
iterator end()
Return iterator to last entry +1.
iterator begin()
Return iterator to first entry.
Type-safe access to single objects in the data store.
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.