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