Belle II Software development
ExporterTcInfo.h
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#pragma once
10
11#include <vector>
12#include <string>
13
14namespace Belle2 {
19
23 public:
25 ExporterTcInfo(int pdg, int motherID):
26 m_pdgCode(pdg),
27 m_motherID(motherID) {}
28
29
32
33
36 void addHit(std::pair<double, std::string> hit) { m_hits.push_back(hit); }
37
38
40 void addHitIDs(const std::vector<int>& ids) { m_hitIDs = ids; }
41
42
44 int getNHits() { return m_hits.size(); }
45
46
48 std::vector<std::pair<double, std::string>>* getHits() { return &m_hits; }
49
50
52 std::vector<int>* getHitIDs() { return &m_hitIDs; }
53
54
58 void addInfo(const std::string& info) { m_tcInfo = info; }
59
60
62 const std::string& getInfo() const { return m_tcInfo; }
63
64
66 int getPdgCode() { return m_pdgCode; }
67
68
70 int getMotherID() { return m_motherID; }
71
72
73 protected:
76
79
82 std::vector<std::pair<double, std::string>> m_hits;
83
86 std::vector<int> m_hitIDs;
87
90 std::string m_tcInfo;
91 };
92
93}
94
void addInfo(const std::string &info)
Adds Info about the tc itself.
std::string m_tcInfo
contains Info about the tc itself.
~ExporterTcInfo()
Destructor.
std::vector< int > * getHitIDs()
returns hitIDs of the hits attached to this TC (in no particular order!)
int getMotherID()
returns index of the mother particle in the simulation
void addHitIDs(const std::vector< int > &ids)
adds IDs of hits for unique identification
void addHit(std::pair< double, std::string > hit)
adds already formatted hit information.
int m_motherID
Index of the mother particle in the simulation.
std::vector< std::pair< double, std::string > > m_hits
Contains already formatted hit information.
std::vector< std::pair< double, std::string > > * getHits()
returns the hits added one by one using addHit
int m_pdgCode
pdgCode of tc in the tc-file. TODO: implement a check which proves that suggested and real fileIndex ...
int getNHits()
returns number of Hits attached to this tc
int getPdgCode()
returns pdgCode of tc in the tc-file
std::vector< int > m_hitIDs
Stores the hitIDs of the hits attached to this TC, can be treated independently of hits themselves.
const std::string & getInfo() const
returns info about tc in formatted without having the last piece of the Information
ExporterTcInfo(int pdg, int motherID)
Standard constructor.
Abstract base class for different kinds of events.