Belle II Software  release-05-02-19
ECLTrackClusterMatchingPerformanceModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributor: Frank Meier *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <ecl/modules/eclTrackClusterMatching/ECLTrackClusterMatchingPerformanceModule.h>
12 
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/dataobjects/EventMetaData.h>
16 #include <framework/datastore/RelationVector.h>
17 #include <mdst/dataobjects/HitPatternCDC.h>
18 #include <mdst/dataobjects/HitPatternVXD.h>
19 
20 #include <root/TFile.h>
21 #include <root/TTree.h>
22 
23 using namespace Belle2;
24 
25 //-----------------------------------------------------------------
26 // Register the Module
27 //-----------------------------------------------------------------
28 REG_MODULE(ECLTrackClusterMatchingPerformance)
29 
30 ECLTrackClusterMatchingPerformanceModule::ECLTrackClusterMatchingPerformanceModule() :
31  Module(), m_trackProperties()
32 {
33  setDescription("Module to test the track cluster matching efficiency. Writes information about the tracks and MCParticles in a ROOT file.");
35 
36  addParam("outputFileName", m_outputFileName, "Name of output root file.",
37  std::string("ECLTrackClusterMatchingPerformance.root"));
38  addParam("minClusterEnergy", m_minClusterEnergy, "Minimal cluster energy in units of particle's true energy for MC match",
39  0.5);
40  addParam("minWeight", m_minWeight, "Fraction of cluster energy required to originate from particle to be matched to cluster.",
41  0.5);
42  addParam("trackClusterRelationName", m_trackClusterRelationName, "Name of relation array between tracks and ECL clusters",
43  std::string(""));
44 }
45 
47 {
48  // MCParticles and Tracks needed for this module
49  m_mcParticles.isRequired();
50  m_tracks.isRequired();
51  m_trackFitResults.isRequired();
52  m_eclClusters.isRequired();
53 
54  m_outputFile = new TFile(m_outputFileName.c_str(), "RECREATE");
55  TDirectory* oldDir = gDirectory;
56  m_outputFile->cd();
57  m_tracksTree = new TTree("tracks", "tracks");
58  m_clusterTree = new TTree("cluster", "cluster");
59  oldDir->cd();
60 
61  setupTree();
62 }
63 
65 {
66  StoreObjPtr<EventMetaData> eventMetaData("EventMetaData", DataStore::c_Event);
67  m_iEvent = eventMetaData->getEvent();
68  m_iRun = eventMetaData->getRun();
69  m_iExperiment = eventMetaData->getExperiment();
70 
71  for (const ECLCluster& eclCluster : m_eclClusters) {
73  bool found_photon = false, found_mcmatch = false, found_charged_stable = false;
74  // find all MCParticles matched to the ECLCluster
75  const auto& relatedMCParticles = eclCluster.getRelationsWith<MCParticle>();
76  for (unsigned int index = 0; index < relatedMCParticles.size() && (!found_photon || !found_charged_stable); ++index) {
77  const MCParticle* relatedMCParticle = relatedMCParticles.object(index);
78  // check if matched MCParticle is primary photon
79  if (!(isPrimaryMcParticle(*relatedMCParticle))) continue;
80  found_mcmatch = true;
81  // get total energy of MCParticle deposited in this ECLCluster
82  const double weight = relatedMCParticles.weight(index);
83  // check that at least 50% of the generated energy of the particle is contained in this ECLCluster
84  // and check that the total cluster energy is greater than 50% of the energy coming from the particle
85 
87  if (eclCluster.hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron)
88  and not eclCluster.hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) {
90  }
91 
92  if (eclCluster.getEnergy(hypo) >= 0.5 * relatedMCParticle->getEnergy()) {
93  if (isChargedStable(*relatedMCParticle) && weight >= 0.5 * relatedMCParticle->getEnergy()) {
94  found_charged_stable = true;
95  } else if (relatedMCParticle->getPDG() == 22 && weight >= 0.5 * eclCluster.getEnergy(hypo) && !found_photon) {
96  found_photon = true;
97  m_photonEnergy = relatedMCParticle->getEnergy();
98  }
99  }
100  }
101  if (found_mcmatch) {
102  if (eclCluster.isTrack()) {
103  m_clusterIsTrack = 1;
104  }
105  m_clusterIsPhoton = int(found_photon);
106  m_clusterIsChargedStable = int(found_charged_stable);
107  m_clusterPhi = eclCluster.getPhi();
108  m_clusterTheta = eclCluster.getTheta();
109  if (eclCluster.hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) {
110  if (eclCluster.hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron)) {
111  m_clusterHypothesis = 56;
112  } else {
114  }
116  } else if (eclCluster.hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron)) {
119  }
120 
121  m_clusterErrorTiming = eclCluster.getDeltaTime99();
122  m_clusterE1E9 = eclCluster.getE1oE9();
123  m_clusterDetectorRegion = eclCluster.getDetectorRegion();
124  m_clusterMinTrkDistance = eclCluster.getMinTrkDistance();
125  m_clusterDeltaL = eclCluster.getDeltaL();
126  m_clusterTree->Fill();
127  }
128  }
129 
130  for (const MCParticle& mcParticle : m_mcParticles) {
131  // check status of mcParticle
132  if (isPrimaryMcParticle(mcParticle) && isChargedStable(mcParticle) && mcParticle.hasStatus(MCParticle::c_StableInGenerator)) {
134 
135  int pdgCode = mcParticle.getPDG();
136  B2DEBUG(29, "Primary MCParticle has PDG code " << pdgCode);
137  m_trackProperties.pdg_gen = pdgCode;
138 
139  m_trackProperties.cosTheta_gen = mcParticle.getMomentum().CosTheta();
140  m_trackProperties.phi_gen = mcParticle.getMomentum().Phi();
141  m_trackProperties.ptot_gen = mcParticle.getMomentum().Mag();
142  m_trackProperties.pt_gen = mcParticle.getMomentum().Pt();
143  m_trackProperties.px_gen = mcParticle.getMomentum().Px();
144  m_trackProperties.py_gen = mcParticle.getMomentum().Py();
145  m_trackProperties.pz_gen = mcParticle.getMomentum().Pz();
146  m_trackProperties.x_gen = mcParticle.getVertex().X();
147  m_trackProperties.y_gen = mcParticle.getVertex().Y();
148  m_trackProperties.z_gen = mcParticle.getVertex().Z();
149 
150  const Track* b2Track = nullptr;
151  double maximumWeight = -2;
152  // find highest rated Track
153  const auto& relatedTracks = mcParticle.getRelationsWith<Track>();
154  for (unsigned int index = 0; index < relatedTracks.size(); ++index) {
155  const Track* relatedTrack = relatedTracks.object(index);
156  const double weight = relatedTracks.weight(index);
157 
158  if (weight > maximumWeight) {
159  maximumWeight = weight;
160  b2Track = relatedTrack;
161  }
162  }
163 
164  if (b2Track) {
165  const TrackFitResult* fitResult = b2Track->getTrackFitResultWithClosestMass(Const::ChargedStable(std::abs(pdgCode)));
166  B2ASSERT("Related Belle2 Track has no related track fit result!", fitResult);
167 
168  // write some data to the root tree
169  TVector3 mom = fitResult->getMomentum();
170  m_trackProperties.cosTheta = mom.CosTheta();
171  m_trackProperties.phi = mom.Phi();
172  m_trackProperties.ptot = mom.Mag();
173  m_trackProperties.pt = mom.Pt();
174  m_trackProperties.px = mom.Px();
175  m_trackProperties.py = mom.Py();
176  m_trackProperties.pz = mom.Pz();
177  m_trackProperties.x = fitResult->getPosition().X();
178  m_trackProperties.y = fitResult->getPosition().Y();
179  m_trackProperties.z = fitResult->getPosition().Z();
180 
181  m_pValue = fitResult->getPValue();
182  m_charge = (int)fitResult->getChargeSign();
183  m_d0 = fitResult->getD0();
184  m_z0 = fitResult->getZ0();
185 
186  // Count hits
190 
192 
193  const ECLCluster* eclCluster_PhotonHypothesis_track_related = nullptr;
194  const ECLCluster* eclCluster_HadronHypothesis_track_related = nullptr;
195  for (const auto& eclCluster : b2Track->getRelationsTo<ECLCluster>("", m_trackClusterRelationName)) {
196  if (!(eclCluster.isTrack())) continue;
197  if (eclCluster.hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) {
199  m_matchedPhotonHypothesisClusterDetectorRegion = eclCluster.getDetectorRegion();
200  m_matchedPhotonHypothesisClusterTheta = eclCluster.getTheta();
201  m_matchedPhotonHypothesisClusterPhi = eclCluster.getPhi();
202  m_matchedPhotonHypothesisClusterMinTrkDistance = eclCluster.getMinTrkDistance();
203  m_matchedPhotonHypothesisClusterDeltaL = eclCluster.getDeltaL();
204  eclCluster_PhotonHypothesis_track_related = &eclCluster;
205  }
206  if (eclCluster.hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron)) {
208  m_matchedHadronHypothesisClusterDetectorRegion = eclCluster.getDetectorRegion();
209  m_matchedHadronHypothesisClusterTheta = eclCluster.getTheta();
210  m_matchedHadronHypothesisClusterPhi = eclCluster.getPhi();
211  m_matchedHadronHypothesisClusterMinTrkDistance = eclCluster.getMinTrkDistance();
212  m_matchedHadronHypothesisClusterDeltaL = eclCluster.getDeltaL();
213  eclCluster_HadronHypothesis_track_related = &eclCluster;
214  }
215  }
216  // find ECLCluster in which the particle has deposited the majority of its energy
217  maximumWeight = -2.;
218  const ECLCluster* eclCluster_matchedBestToMCParticle = nullptr;
219  const auto& relatedECLClusters = mcParticle.getRelationsFrom<ECLCluster>();
220  for (unsigned int index = 0; index < relatedECLClusters.size(); ++index) {
221  const ECLCluster* relatedECLCluster = relatedECLClusters.object(index);
222  if (!relatedECLCluster->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) continue;
223  const double weight = relatedECLClusters.weight(index);
224  if (weight > maximumWeight) {
225  eclCluster_matchedBestToMCParticle = relatedECLCluster;
226  maximumWeight = weight;
227  }
228  }
229  if (eclCluster_matchedBestToMCParticle != nullptr) {
231  m_mcparticle_cluster_energy = maximumWeight;
232  m_mcparticle_cluster_theta = eclCluster_matchedBestToMCParticle->getTheta();
233  m_mcparticle_cluster_phi = eclCluster_matchedBestToMCParticle->getPhi();
234  m_mcparticle_cluster_detectorregion = eclCluster_matchedBestToMCParticle->getDetectorRegion();
235  if ((eclCluster_PhotonHypothesis_track_related == eclCluster_matchedBestToMCParticle
236  && eclCluster_matchedBestToMCParticle->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons))
237  || (eclCluster_HadronHypothesis_track_related == eclCluster_matchedBestToMCParticle
238  && eclCluster_matchedBestToMCParticle->hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron))) {
239  m_sameclusters = 1;
240  }
241  }
242  }
243  m_tracksTree->Fill(); // write data to tree
244  }
245  }
246 }
247 
248 
250 {
251  writeData();
252 }
253 
255 {
256  return mcParticle.hasStatus(MCParticle::c_PrimaryParticle);
257 }
258 
260 {
261  return Const::chargedStableSet.find(abs(mcParticle.getPDG()))
263 }
264 
266 {
267  if (m_tracksTree == NULL || m_clusterTree == NULL) {
268  B2FATAL("Data tree or event tree was not created.");
269  }
273 
275 
278 
281 
284 
287 
290 
293 
296 
299 
302 
305 
307 
309 
312 
316 
318 
321  addVariableToTree("MCParticleClusterMatch", m_mcparticle_cluster_match, m_tracksTree);
322 
324 
326  addVariableToTree("PhotonHypothesisClusterTheta", m_matchedPhotonHypothesisClusterTheta, m_tracksTree);
330 
332  addVariableToTree("HadronHypothesisClusterTheta", m_matchedHadronHypothesisClusterTheta, m_tracksTree);
336 
341 
342 
346 
349  addVariableToTree("ClusterHypothesis", m_clusterHypothesis, m_clusterTree);
353  addVariableToTree("ClusterErrorTiming", m_clusterErrorTiming, m_clusterTree);
354  addVariableToTree("ClusterDetectorRegion", m_clusterDetectorRegion, m_clusterTree);
355  addVariableToTree("ClusterMinTrkDistance", m_clusterMinTrkDistance, m_clusterTree);
357 
360  addVariableToTree("ChargedStableCluster", m_clusterIsChargedStable, m_clusterTree);
361 }
362 
364 {
365  if (m_tracksTree != NULL && m_clusterTree != NULL) {
366  TDirectory* oldDir = gDirectory;
367  if (m_outputFile)
368  m_outputFile->cd();
369  m_tracksTree->Write();
370  delete m_tracksTree;
371  m_clusterTree->Write();
372  delete m_clusterTree;
373  oldDir->cd();
374  }
375  if (m_outputFile != NULL) {
376  m_outputFile->Close();
377  delete m_outputFile;
378  }
379 }
380 
382 {
383  m_trackProperties = -999;
384 
385  m_pValue = -999;
386 
387  m_charge = 0;
388 
389  m_d0 = -999;
390 
391  m_z0 = -999;
392 
394 
396 
398 
399  m_sameclusters = 0;
400 
402 
404 
406 
408 
410 
412 
414 
416 
418 
420 
422 
424 
426 
428 }
429 
431 {
432  m_clusterPhi = -999;
433 
434  m_clusterTheta = -999;
435 
436  m_clusterIsTrack = 0;
437 
438  m_clusterIsPhoton = -999;
439 
441 
443 
444  m_clusterEnergy = -999;
445 
446  m_photonEnergy = -999;
447 
448  m_clusterE1E9 = -999;
449 
450  m_clusterErrorTiming = -999;
451 
453 
455 
456  m_clusterDeltaL = -999;
457 }
458 
459 void ECLTrackClusterMatchingPerformanceModule::addVariableToTree(const std::string& varName, double& varReference, TTree* tree)
460 {
461  std::stringstream leaf;
462  leaf << varName << "/D";
463  tree->Branch(varName.c_str(), &varReference, leaf.str().c_str());
464 }
465 
466 void ECLTrackClusterMatchingPerformanceModule::addVariableToTree(const std::string& varName, int& varReference, TTree* tree)
467 {
468  std::stringstream leaf;
469  leaf << varName << "/I";
470  tree->Branch(varName.c_str(), &varReference, leaf.str().c_str());
471 }
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedToHadronHypothesisECLCluster
int m_matchedToHadronHypothesisECLCluster
boolean for match between track and ECL cluster with hadron hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:140
Belle2::ECLTrackClusterMatchingPerformanceModule::m_iRun
int m_iRun
Run number.
Definition: ECLTrackClusterMatchingPerformanceModule.h:71
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterEnergy
double m_clusterEnergy
cluster energy
Definition: ECLTrackClusterMatchingPerformanceModule.h:164
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcParticles
StoreArray< MCParticle > m_mcParticles
Required input array of MCParticles.
Definition: ECLTrackClusterMatchingPerformanceModule.h:56
Belle2::MCParticle::getEnergy
float getEnergy() const
Return particle energy in GeV.
Definition: MCParticle.h:158
Belle2::ECLTrackClusterMatchingPerformanceModule::m_eclClusters
StoreArray< ECLCluster > m_eclClusters
Required input array of ECLClusters.
Definition: ECLTrackClusterMatchingPerformanceModule.h:55
Belle2::ECLTrackClusterMatchingPerformanceModule::terminate
void terminate() override
Write the tree into the opened root file.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:249
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterPhi
double m_matchedPhotonHypothesisClusterPhi
phi of cluster with photon hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:98
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterDeltaL
double m_matchedPhotonHypothesisClusterDeltaL
delta l of cluster with photon hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:104
Belle2::ECLTrackClusterMatchingPerformanceModule::addVariableToTree
void addVariableToTree(const std::string &varName, double &varReference, TTree *tree)
add a variable with double format
Definition: ECLTrackClusterMatchingPerformanceModule.cc:459
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_match
int m_mcparticle_cluster_match
boolean for match between MCParticle and ECL cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:134
Belle2::HitPatternVXD::getNPXDHits
unsigned short getNPXDHits() const
Get total number of hits in the PXD.
Definition: HitPatternVXD.cc:147
Belle2::ECLTrackClusterMatchingPerformanceModule::m_sameclusters
int m_sameclusters
boolean whether matched to ECL cluster with highest weight
Definition: ECLTrackClusterMatchingPerformanceModule.h:143
Belle2::ECLTrackClusterMatchingPerformanceModule::m_photonEnergy
double m_photonEnergy
photon energy
Definition: ECLTrackClusterMatchingPerformanceModule.h:167
Belle2::RelationsInterface::getRelationsWith
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.
Definition: RelationsObject.h:232
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterHypothesis
int m_clusterHypothesis
hypothesis ID of cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:152
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterMinTrkDistance
double m_matchedHadronHypothesisClusterMinTrkDistance
minimal distance between cluster with hadron hypothesis and track (not necessarily the matched one)
Definition: ECLTrackClusterMatchingPerformanceModule.h:116
Belle2::Const::invalidParticle
static const ParticleType invalidParticle
Invalid particle, used internally.
Definition: Const.h:554
Belle2::TrackFitResult::getMomentum
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Definition: TrackFitResult.h:116
Belle2::ParticleProperties::py
double py
measured momentum in y direction
Definition: ParticleProperties.h:44
Belle2::ECLCluster
ECL cluster data.
Definition: ECLCluster.h:39
Belle2::ParticleProperties::ptot_gen
double ptot_gen
generated total momentum
Definition: ParticleProperties.h:67
Belle2::ParticleProperties::px
double px
measured momentum in x direction
Definition: ParticleProperties.h:43
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::ParticleProperties::phi_gen
double phi_gen
azimuthal angle of generated momentum vector
Definition: ParticleProperties.h:69
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::ECLCluster::EHypothesisBit
EHypothesisBit
The hypothesis bits for this ECLCluster (Connected region (CR) is split using this hypothesis.
Definition: ECLCluster.h:43
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterTheta
double m_matchedPhotonHypothesisClusterTheta
theta of cluster with photon hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:95
Belle2::ECLTrackClusterMatchingPerformanceModule::m_outputFileName
std::string m_outputFileName
name of output root file
Definition: ECLTrackClusterMatchingPerformanceModule.h:49
Belle2::ECLTrackClusterMatchingPerformanceModule::writeData
void writeData()
write root tree to output file and close the file
Definition: ECLTrackClusterMatchingPerformanceModule.cc:363
Belle2::ParticleProperties::py_gen
double py_gen
generated momentum in y direction
Definition: ParticleProperties.h:64
Belle2::TrackFitResult::getPValue
double getPValue() const
Getter for Chi2 Probability of the track fit.
Definition: TrackFitResult.h:163
Belle2::ECLTrackClusterMatchingPerformanceModule::m_pValue
double m_pValue
pValue of track fit
Definition: ECLTrackClusterMatchingPerformanceModule.h:77
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterTheta
double m_clusterTheta
polar angle of cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:149
Belle2::ECLTrackClusterMatchingPerformanceModule::m_lastCDCLayer
int m_lastCDCLayer
number of last CDC layer used for track fit
Definition: ECLTrackClusterMatchingPerformanceModule.h:89
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_theta
double m_mcparticle_cluster_theta
theta of cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:125
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterErrorTiming
double m_clusterErrorTiming
cluster's timing uncertainty containing 99% of true photons
Definition: ECLTrackClusterMatchingPerformanceModule.h:176
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterPhi
double m_clusterPhi
azimuthal angle of cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:146
Belle2::ECLCluster::getTheta
double getTheta() const
Return Corrected Theta of Shower (radian).
Definition: ECLCluster.h:326
Belle2::Const::chargedStableSet
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:494
Belle2::ECLCluster::getPhi
double getPhi() const
Return Corrected Phi of Shower (radian).
Definition: ECLCluster.h:323
Belle2::ECLCluster::EHypothesisBit::c_nPhotons
@ c_nPhotons
CR is split into n photons (N1)
Belle2::ECLTrackClusterMatchingPerformanceModule::event
void event() override
Fill the tree with the event data.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:64
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterMinTrkDistance
double m_matchedPhotonHypothesisClusterMinTrkDistance
minimal distance between cluster with photon hypothesis and track (not necessarily the matched one)
Definition: ECLTrackClusterMatchingPerformanceModule.h:101
Belle2::ECLTrackClusterMatchingPerformanceModule::m_charge
int m_charge
charge
Definition: ECLTrackClusterMatchingPerformanceModule.h:80
Belle2::ECLCluster::hasHypothesis
bool hasHypothesis(EHypothesisBit bitmask) const
Return if specific hypothesis bit is set.
Definition: ECLCluster.h:374
Belle2::ECLTrackClusterMatchingPerformanceModule::initialize
void initialize() override
Register the needed StoreArrays and open th output TFile.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:46
Belle2::TrackFitResult
Values of the result of a track fit with a given particle hypothesis.
Definition: TrackFitResult.h:59
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedToPhotonHypothesisECLCluster
int m_matchedToPhotonHypothesisECLCluster
boolean for match between track and ECL cluster with photon hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:137
Belle2::RelationsInterface::getRelationsTo
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
Definition: RelationsObject.h:199
Belle2::TrackFitResult::getPosition
TVector3 getPosition() const
Getter for vector of position at closest approach of track in r/phi projection.
Definition: TrackFitResult.h:109
Belle2::ParticleProperties::pz_gen
double pz_gen
generated momentum in z direction
Definition: ParticleProperties.h:65
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterDeltaL
double m_clusterDeltaL
delta l
Definition: ECLTrackClusterMatchingPerformanceModule.h:182
Belle2::TrackFitResult::getHitPatternCDC
HitPatternCDC getHitPatternCDC() const
Getter for the hit pattern in the CDC;.
Definition: TrackFitResult.cc:120
Belle2::TrackFitResult::getZ0
double getZ0() const
Getter for z0.
Definition: TrackFitResult.h:200
Belle2::ECLTrackClusterMatchingPerformanceModule::m_d0
double m_d0
signed distance of the track to the IP in the r-phi plane
Definition: ECLTrackClusterMatchingPerformanceModule.h:83
Belle2::ECLTrackClusterMatchingPerformanceModule::m_trackFitResults
StoreArray< TrackFitResult > m_trackFitResults
Required input array of TrackFitResults.
Definition: ECLTrackClusterMatchingPerformanceModule.h:58
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::ParticleProperties::px_gen
double px_gen
generated momentum in x direction
Definition: ParticleProperties.h:63
Belle2::ECLTrackClusterMatchingPerformanceModule::m_z0
double m_z0
distance of the track to the IP along the beam axis
Definition: ECLTrackClusterMatchingPerformanceModule.h:86
Belle2::ParticleProperties::pt
double pt
measured transverse momentum
Definition: ParticleProperties.h:46
Belle2::ParticleProperties::nSVDhits
int nSVDhits
Number of SVD hits in reconstructed track
Definition: ParticleProperties.h:55
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:210
Belle2::MCParticle::hasStatus
bool hasStatus(unsigned short int bitmask) const
Return if specific status bit is set.
Definition: MCParticle.h:140
Belle2::ECLTrackClusterMatchingPerformanceModule::isChargedStable
bool isChargedStable(const MCParticle &mcParticle)
Tests if MCParticle is a charged stable particle.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:259
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_detectorregion
int m_mcparticle_cluster_detectorregion
detector region of cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:122
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterDetectorRegion
int m_clusterDetectorRegion
cluster detection region
Definition: ECLTrackClusterMatchingPerformanceModule.h:173
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterTree
TTree * m_clusterTree
root tree containing information on all truth-matched photon clusters.
Definition: ECLTrackClusterMatchingPerformanceModule.h:62
Belle2::ParticleProperties::cosTheta
double cosTheta
polar angle of measured momentum vector
Definition: ParticleProperties.h:48
Belle2::Const::ParticleSet::find
const ParticleType & find(int pdg) const
Returns particle in set with given PDG code, or invalidParticle if not found.
Definition: Const.h:447
Belle2::ECLTrackClusterMatchingPerformanceModule::m_iEvent
int m_iEvent
Event number.
Definition: ECLTrackClusterMatchingPerformanceModule.h:74
Belle2::Track::getTrackFitResultWithClosestMass
const TrackFitResult * getTrackFitResultWithClosestMass(const Const::ChargedStable &requestedType) const
Return the track fit for a fit hypothesis with the closest mass.
Definition: Track.cc:70
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::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterTheta
double m_matchedHadronHypothesisClusterTheta
theta of cluster with hadron hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:110
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterDetectorRegion
int m_matchedPhotonHypothesisClusterDetectorRegion
detector region of cluster with photon hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:92
Belle2::ECLTrackClusterMatchingPerformanceModule::m_tracksTree
TTree * m_tracksTree
MCParticle based root tree with all output data.
Definition: ECLTrackClusterMatchingPerformanceModule.h:61
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterDeltaL
double m_matchedHadronHypothesisClusterDeltaL
delta l of cluster with hadron hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:119
Belle2::MCParticle::getPDG
int getPDG() const
Return PDG code of particle.
Definition: MCParticle.h:123
Belle2::ECLTrackClusterMatchingPerformanceModule::setClusterVariablesToDefaultValue
void setClusterVariablesToDefaultValue()
sets cluster related variables to default values
Definition: ECLTrackClusterMatchingPerformanceModule.cc:430
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_energy
double m_mcparticle_cluster_energy
amount of particle energy contained in cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:131
Belle2::RelationsInterface::getRelationsFrom
RelationVector< FROM > getRelationsFrom(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from another store array to this object.
Definition: RelationsObject.h:214
Belle2::ECLTrackClusterMatchingPerformanceModule::m_outputFile
TFile * m_outputFile
output root file
Definition: ECLTrackClusterMatchingPerformanceModule.h:60
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterIsPhoton
int m_clusterIsPhoton
cluster fulfills requirements for being product of a photon
Definition: ECLTrackClusterMatchingPerformanceModule.h:158
Belle2::ParticleProperties::y
double y
measured y value of position
Definition: ParticleProperties.h:51
Belle2::ParticleProperties::nCDChits
int nCDChits
Number of CDC hits in reconstructed track
Definition: ParticleProperties.h:56
Belle2::ECLCluster::EHypothesisBit::c_neutralHadron
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterE1E9
double m_clusterE1E9
energy sum of central crystal over 3x3 array around central crystal
Definition: ECLTrackClusterMatchingPerformanceModule.h:170
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterIsTrack
int m_clusterIsTrack
cluster is matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:155
Belle2::ParticleProperties::pdg_gen
int pdg_gen
PDG code of generated particle.
Definition: ParticleProperties.h:61
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_phi
double m_mcparticle_cluster_phi
phi of cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:128
Belle2::TrackFitResult::getHitPatternVXD
HitPatternVXD getHitPatternVXD() const
Getter for the hit pattern in the VXD;.
Definition: TrackFitResult.cc:125
Belle2::ECLTrackClusterMatchingPerformanceModule::m_trackClusterRelationName
std::string m_trackClusterRelationName
name of relation array between tracks and ECL clusters
Definition: ECLTrackClusterMatchingPerformanceModule.h:52
Belle2::ParticleProperties::y_gen
double y_gen
y value of generated position
Definition: ParticleProperties.h:71
Belle2::MCParticle::c_StableInGenerator
@ c_StableInGenerator
bit 1: Particle is stable, i.e., not decaying in the generator.
Definition: MCParticle.h:60
Belle2::ParticleProperties::pt_gen
double pt_gen
generated transverse momentum
Definition: ParticleProperties.h:66
Belle2::ECLTrackClusterMatchingPerformanceModule::isPrimaryMcParticle
bool isPrimaryMcParticle(const MCParticle &mcParticle)
Tests if MCParticle is a primary one.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:254
Belle2::ParticleProperties::nPXDhits
int nPXDhits
Number of PXD hits in reconstructed track
Definition: ParticleProperties.h:54
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterIsChargedStable
int m_clusterIsChargedStable
cluster has related MCParticle which is charged and stable
Definition: ECLTrackClusterMatchingPerformanceModule.h:161
Belle2::ParticleProperties::cosTheta_gen
double cosTheta_gen
polar angle of generated momentum vector
Definition: ParticleProperties.h:68
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::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465
Belle2::HitPatternCDC::getLastLayer
short getLastLayer() const
Returns the index of the last layer with a hit.
Definition: HitPatternCDC.cc:106
Belle2::ParticleProperties::phi
double phi
azimuthal angle of measured momentum vector
Definition: ParticleProperties.h:49
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterPhi
double m_matchedHadronHypothesisClusterPhi
phi of cluster with hadron hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:113
Belle2::ECLTrackClusterMatchingPerformanceModule::setVariablesToDefaultValue
void setVariablesToDefaultValue()
Sets all variables to the default value, here -999.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:381
Belle2::HitPatternCDC::getNHits
unsigned short getNHits() const
Get the total Number of CDC hits in the fit.
Definition: HitPatternCDC.cc:49
Belle2::ECLTrackClusterMatchingPerformanceModule::setupTree
void setupTree()
add branches to data tree
Definition: ECLTrackClusterMatchingPerformanceModule.cc:265
Belle2::HitPatternVXD::getNSVDHits
unsigned short getNSVDHits() const
Get total number of hits in the SVD.
Definition: HitPatternVXD.cc:83
Belle2::ECLTrackClusterMatchingPerformanceModule::m_tracks
StoreArray< Track > m_tracks
Required input array of Tracks.
Definition: ECLTrackClusterMatchingPerformanceModule.h:57
Belle2::Track
Class that bundles various TrackFitResults.
Definition: Track.h:35
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::ECLCluster::getDetectorRegion
int getDetectorRegion() const
Return detector region: 0: below acceptance, 1: FWD, 2: BRL, 3: BWD, 11: FWDGAP, 13: BWDGAP.
Definition: ECLCluster.cc:68
Belle2::DataStore::c_Event
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Definition: DataStore.h:61
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterMinTrkDistance
double m_clusterMinTrkDistance
distance to closest track
Definition: ECLTrackClusterMatchingPerformanceModule.h:179
Belle2::ParticleProperties::x
double x
measured x value of position
Definition: ParticleProperties.h:50
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterDetectorRegion
int m_matchedHadronHypothesisClusterDetectorRegion
detector region of cluster with hadron hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:107
Belle2::ECLTrackClusterMatchingPerformanceModule::m_trackProperties
ParticleProperties m_trackProperties
properties of a reconstructed track
Definition: ECLTrackClusterMatchingPerformanceModule.h:65
Belle2::ParticleProperties::z_gen
double z_gen
z value of generated position
Definition: ParticleProperties.h:72
Belle2::ECLTrackClusterMatchingPerformanceModule::m_iExperiment
int m_iExperiment
Experiment number.
Definition: ECLTrackClusterMatchingPerformanceModule.h:68
Belle2::ParticleProperties::ptot
double ptot
measured total momentum
Definition: ParticleProperties.h:47
Belle2::ParticleProperties::x_gen
double x_gen
x value of generated position
Definition: ParticleProperties.h:70
Belle2::ParticleProperties::pz
double pz
measured momentum in z direction
Definition: ParticleProperties.h:45
Belle2::TrackFitResult::getChargeSign
short getChargeSign() const
Return track charge (1 or -1).
Definition: TrackFitResult.h:160
Belle2::ParticleProperties::z
double z
measured z value of position
Definition: ParticleProperties.h:52
Belle2::MCParticle::c_PrimaryParticle
@ c_PrimaryParticle
bit 0: Particle is primary particle.
Definition: MCParticle.h:58
Belle2::TrackFitResult::getD0
double getD0() const
Getter for d0.
Definition: TrackFitResult.h:178