Belle II Software  release-05-01-25
PhysicsObjectsMiraBelleDst2Module.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2020 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Shun Watanuki *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <dqm/modules/PhysicsObjectsMiraBelle/PhysicsObjectsMiraBelleDst2Module.h>
12 #include <analysis/dataobjects/ParticleList.h>
13 #include <analysis/variables/ContinuumSuppressionVariables.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 <TDirectory.h>
31 #include <map>
32 
33 using namespace Belle2;
34 
35 REG_MODULE(PhysicsObjectsMiraBelleDst2)
36 
37 PhysicsObjectsMiraBelleDst2Module::PhysicsObjectsMiraBelleDst2Module() : HistoModule()
38 {
39  setDescription("Monitor Physics Objects Quality");
41 
42  addParam("TriggerIdentifier", m_triggerIdentifier,
43  "Trigger identifier string used to select events for the histograms", std::string("software_trigger_cut&skim&accept_hadron"));
44  addParam("DstListName", m_dstListName, "Name of the D*+ particle list", std::string("D*+:physMiraBelle"));
45 }
46 
48 {
49  TDirectory* oldDir = gDirectory;
50  oldDir->mkdir("PhysicsObjectsMiraBelleDst2")->cd();
51  // Mass distributions
52  m_h_D0_pi0_InvM = new TH1F("hist_D0_pi0_InvM", "#pi^{0} mass of D^{0}#rightarrowK#pi#pi^{0};D0_pi0_InvM;", 50, 0.09, 0.17);
53 
54  oldDir->cd();
55 }
56 
57 
59 {
60  REG_HISTOGRAM
61 
63  result.isOptional();
64 }
65 
67 {
68  m_h_D0_pi0_InvM->Reset();
69 }
70 
72 {
73 
75  if (!result.isValid()) {
76  B2WARNING("SoftwareTriggerResult object not available but needed to select events for the histograms.");
77  return;
78  }
79 
80  const std::map<std::string, int>& results = result->getResults();
81  if (results.find(m_triggerIdentifier) == results.end()) {
82  B2WARNING("PhysicsObjectsMiraBelleDst2: Can't find trigger identifier: " << m_triggerIdentifier);
83  return;
84  }
85 
86  // apply software trigger
87  const bool accepted = (result->getResult(m_triggerIdentifier) == SoftwareTriggerCutResult::c_accept);
88  if (accepted == false) return;
89 
90  // get D* candidates
92 
93  for (unsigned int i = 0; i < dstParticles->getListSize(); i++) {
94  const Particle* dst = dstParticles->getParticle(i);
95  const Particle* d0 = dst->getDaughter(0);
96  float dst_mass = dst->getMass();
97  float d0_mass = d0->getMass();
98  float delta_m = dst_mass - d0_mass;
99  // Mass of Pi0
100  if (1.83 < d0_mass && d0_mass < 1.89 && 0.142 < delta_m && delta_m < 0.148) {
101  m_h_D0_pi0_InvM->Fill(Belle2::Variable::particleInvariantMassFromDaughters(d0->getDaughter(2)));
102  }
103  }
104 }
105 
106 // void PhysicsObjectsMiraBelleDst2Module::getPIDInformationMiraBelle(Particle* part, float pid[3][7])
107 // {
108 // PIDLikelihood* I_like_coffee = part->getPIDLikelihood();
109 // pid[0][0] = I_like_coffee->getProbability();
110 // }
111 
113 {
114 }
115 
117 {
118 }
119 
Belle2::PhysicsObjectsMiraBelleDst2Module::m_triggerIdentifier
std::string m_triggerIdentifier
Trigger identifier string used to select events for the histograms.
Definition: PhysicsObjectsMiraBelleDst2Module.h:57
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
Belle2::PhysicsObjectsMiraBelleDst2Module::defineHisto
void defineHisto() override
Function to define histograms.
Definition: PhysicsObjectsMiraBelleDst2Module.cc:47
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::Module::c_ParallelProcessingCertified
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:82
Belle2::PhysicsObjectsMiraBelleDst2Module::terminate
void terminate() override
Function to terminate module.
Definition: PhysicsObjectsMiraBelleDst2Module.cc:116
Belle2::PhysicsObjectsMiraBelleDst2Module::m_h_D0_pi0_InvM
TH1F * m_h_D0_pi0_InvM
Pi0 invariant mass for D0->Kpipi0.
Definition: PhysicsObjectsMiraBelleDst2Module.h:54
Belle2::PhysicsObjectsMiraBelleModule::m_triggerIdentifier
std::string m_triggerIdentifier
Trigger identifier string used to select events for the histograms.
Definition: PhysicsObjectsMiraBelleModule.h:89
Belle2::Particle::getDaughter
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
Definition: Particle.cc:595
Belle2::PhysicsObjectsMiraBelleDst2Module::event
void event() override
Function to process event record.
Definition: PhysicsObjectsMiraBelleDst2Module.cc:71
Belle2::PhysicsObjectsMiraBelleDst2Module::endRun
void endRun() override
Function to process end_run record.
Definition: PhysicsObjectsMiraBelleDst2Module.cc:112
Belle2::SoftwareTriggerCutResult::c_accept
@ c_accept
Accept this event.
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:210
Belle2::Particle::getMass
float getMass() const
Returns invariant mass (= nominal for FS particles)
Definition: Particle.h:433
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::PhysicsObjectsMiraBelleDst2Module::initialize
void initialize() override
Function for dynamic initialization of module.
Definition: PhysicsObjectsMiraBelleDst2Module.cc:58
Belle2::PhysicsObjectsMiraBelleDst2Module::m_dstListName
std::string m_dstListName
Name of the mu+ particle list.
Definition: PhysicsObjectsMiraBelleDst2Module.h:60
Belle2::Particle
Class to store reconstructed particles.
Definition: Particle.h:77
Belle2::Module::addParam
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:562
Belle2::PhysicsObjectsMiraBelleDst2Module::beginRun
void beginRun() override
Function to process begin_run record.
Definition: PhysicsObjectsMiraBelleDst2Module.cc:66
Belle2::HistoModule
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29