9#include <dqm/modules/PhysicsObjectsMiraBelle/PhysicsObjectsMiraBelleHadronModule.h>
10#include <hlt/softwaretrigger/calculations/utilities.h>
11#include <analysis/dataobjects/ParticleList.h>
12#include <analysis/variables/ContinuumSuppressionVariables.h>
13#include <analysis/ContinuumSuppression/FoxWolfram.h>
14#include <analysis/variables/TrackVariables.h>
15#include <analysis/utility/PCmsLabTransform.h>
16#include <analysis/variables/Variables.h>
17#include <framework/datastore/StoreObjPtr.h>
18#include <framework/datastore/StoreArray.h>
19#include <mdst/dataobjects/Track.h>
20#include <mdst/dataobjects/TrackFitResult.h>
21#include <mdst/dataobjects/KLMCluster.h>
22#include <mdst/dataobjects/HitPatternCDC.h>
23#include <mdst/dataobjects/HitPatternVXD.h>
24#include <mdst/dataobjects/EventLevelTrackingInfo.h>
25#include <mdst/dataobjects/PIDLikelihood.h>
26#include <top/variables/TOPDigitVariables.h>
27#include <arich/modules/arichDQM/ARICHDQMModule.h>
28#include <arich/dataobjects/ARICHLikelihood.h>
29#include <mdst/dataobjects/SoftwareTriggerResult.h>
30#include <analysis/ClusterUtility/ClusterUtils.h>
31#include <TDirectory.h>
44 "Trigger identifier string used to select events for the histograms", std::string(
"software_trigger_cut&skim&accept_hadronb2"));
45 addParam(
"hadronb2piPListName",
m_hadpiPListName,
"Name of the pi+ particle list", std::string(
"pi+:hadb2physMiraBelle"));
50 TDirectory* oldDir = gDirectory;
51 oldDir->mkdir(
"PhysicsObjectsMiraBelleHadron");
52 oldDir->cd(
"PhysicsObjectsMiraBelleHadron");
55 m_h_nECLClusters =
new TH1F(
"hist_nECLClusters",
"hist_nECLClusters", 100, 0, 60);
59 m_h_EsumCMSnorm =
new TH1F(
"hist_EsumCMSnorm",
"hist_EsumCMSnorm", 100, 0, 2);
61 m_h_R2 =
new TH1F(
"hist_R2",
"hist_R2", 100, 0, 1);
62 m_h_R2->SetXTitle(
"hist_R2");
94 if (!result.isValid()) {
95 B2WARNING(
"SoftwareTriggerResult object not available but needed to select events for the histograms.");
99 const std::map<std::string, int>& results = result->getResults();
101 B2WARNING(
"PhysicsObjectsMiraBelleHadron: Can't find trigger identifier: " <<
m_triggerIdentifier);
107 if (accepted ==
false)
return;
111 std::vector<ROOT::Math::XYZVector> m_pionHadv3;
113 double EsumPiHad = 0.;
115 for (
unsigned int i = 0; i < hadpiParticles->getListSize(); i++) {
116 const Particle* parPiHad = hadpiParticles->getParticle(i);
119 EsumPiHad += V4PiHad.E();
123 double neclClusters = -1.;
124 double eneclClusters = 0.;
127 double EsumGamma = 0.;
130 const unsigned int numberOfECLClusters = std::count_if(eclClusters.
begin(), eclClusters.
end(),
132 return (eclcluster.hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)
133 and eclcluster.getEnergy(ECLCluster::EHypothesisBit::c_nPhotons) > 0.1);
135 neclClusters = numberOfECLClusters;
136 for (
int ncl = 0; ncl < eclClusters.
getEntries(); ncl++) {
140 if (!eclClusters[ncl]->getRelatedFrom<Track>()) {
143 EsumGamma += V4Gamma_CMS.E();
149 double visibleEnergyCMSnorm = (EsumPiHad + EsumGamma) / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
150 double EsumCMSnorm = eneclClusters / (Belle2::SoftwareTrigger::BeamEnergyCMS() * 2.0);
153 double R2 = fw.
getR(2);
159 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.
ROOT::Math::XYZVector getMomentum() const
Returns momentum 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 wether 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.