9 #include <masterclass/modules/MasterClassModule.h>
10 #include <mdst/dataobjects/PIDLikelihood.h>
12 #include "TDirectory.h"
28 setDescription(R
"DOC("Module to write out data in a format for Belle II masterclasses)DOC");
29 addParam("outputFileName", m_filename,
"File name of root ntuple output.", std::string(
"masterclass.root"));
39 m_tree =
new TTree(
"T",
"Event Tree");
50 const double priors[] = {0.05, 0.05, 0.65, 0.24, 0.01, 0};
51 auto type = pid->getMostLikely(priors);
52 auto trackFit = track.getTrackFitResultWithClosestMass(type);
53 auto p = trackFit->getMomentum();
54 double m = type.getMass();
56 switch (type.getPDGCode()) {
57 case 11:
id = ELECTRON;
break;
58 case 13:
id = MUON;
break;
59 case 211:
id = PION;
break;
60 case 321:
id = KAON;
break;
61 case 2212:
id = PROTON;
break;
64 m_event->
AddTrack(p.x(), p.y(), p.z(), sqrt(m * m + p.Mag2()), trackFit->getChargeSign(), id);
70 if (E < 0.1)
continue;
71 TVector3 p = cluster.getClusterPosition();
The Class for Masterclass event parameters.
virtual void Clear(Option_t *="")
Clear the array of particles.
void AddTrack(float px, float py, float pz, float e, float charge, SIMPLEPID pid)
Add the track to the event.
void EventNo(int evtno)
Set the current event number.
@ c_nPhotons
CR is split into n photons (N1)
Module to write out data in a format for Belle II masterclasses.
TTree * m_tree
output tree
virtual void terminate() override
Close ntuple.
BEvent * m_event
output event object
StoreArray< ECLCluster > m_clusters
Cluster objects.
virtual void event() override
Write out particles.
StoreArray< Track > m_tracks
Track objects.
virtual void initialize() override
Register input and output data.
TFile * m_file
root ntuple file
std::string m_filename
output file name
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.