Belle II Software  release-05-01-25
ExporterEventInfo.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jakob Lettenbichler *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include "tracking/vxdCaTracking/ExporterEventInfo.h"
12 
13 
14 using namespace std;
15 using namespace Belle2;
16 // using namespace Belle2::Tracking;
17 
18 
19 
20 void ExporterEventInfo::addHit(ExporterHitInfo aHit) { m_hits.push_back(aHit); }
21 
22 
23 
24 void ExporterEventInfo::addTc(ExporterTcInfo aTc) { m_tcs.push_back(aTc); }
25 
26 
27 
28 std::vector<ExporterHitInfo>* ExporterEventInfo::getHits() { return &m_hits; }
29 
30 
31 
32 std::vector<ExporterTcInfo>* ExporterEventInfo::getTcs() { return &m_tcs; }
33 
34 
35 
36 int ExporterEventInfo::getNPXDTrueHits() { return countHitsOfType(0); }
37 
38 
39 
40 int ExporterEventInfo::getNSVDTrueHits() { return countHitsOfType(1); }
41 
42 
43 int ExporterEventInfo::getNMCHits()
44 {
45  int nMCHits = 0;
46  for (ExporterTcInfo tc : m_tcs) {
47  nMCHits += tc.getNHits();
48  }
49  return nMCHits;
50 }
51 
52 int ExporterEventInfo::countHitsOfType(int type)
53 {
54  int counter = 0;
55  for (ExporterHitInfo hit : m_hits) {
56  if (hit.getType() == type) { ++counter; }
57  }
58  return counter;
59 }
Belle2::ExporterTcInfo
Bundles information for a single track candidate to be stored by EventInfo (needed for HitExporter,...
Definition: ExporterTcInfo.h:32
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ExporterHitInfo
Bundles information for a single hit to be stored by EventInfo (needed for HitExporter,...
Definition: ExporterHitInfo.h:33