 |
Belle II Software
release-05-02-19
|
13 #include <tracking/modules/vxdtfRedesign/SegmentNetworkAnalyzerModule.h>
14 #include <tracking/spacePointCreation/SpacePoint.h>
15 #include <tracking/spacePointCreation/PurityCalculatorTools.h>
32 std::string(
"SegmentNetworkAnalyzer_output.root"));
38 B2INFO(
"SegmentNetworkAnalyzer::initialize() ------------------------------");
44 m_treePtr =
new TTree(
"SegmentNetworkAnalyzer",
"segment network analysis output");
53 auto& hitNetwork =
m_network->accessHitNetwork();
54 auto& segmentNetwork =
m_network->accessSegmentNetwork();
58 for (
const auto& outerHit : hitNetwork.getNodes()) {
59 for (
const auto& centerHit : outerHit->getInnerNodes()) {
60 for (
const auto& innerHit : centerHit->getInnerNodes()) {
63 innerHit->getEntry().m_sector->getFullSecID(),
64 ¢erHit->getEntry(),
65 &innerHit->getEntry());
67 centerHit->getEntry().m_sector->getFullSecID(),
68 &outerHit->getEntry(),
69 ¢erHit->getEntry());
73 if (
auto outerNode = segmentNetwork.getNode(outerSegment->
getID())) {
74 for (
const auto& connectedNode : outerNode->getInnerNodes()) {
75 if (connectedNode->getEntry() == *innerSegment) {
119 std::vector<const Belle2::SpacePoint*> combinationSPs;
125 auto mcId = purityInfo[0].getPurity();
126 bool signal = mcId.first >= 0 && mcId.second == 1;
135 pdg = part->getPDG();
136 pT = part->getMomentum().Pt();
150 auto position = spacePoint->getPosition();
154 B2DEBUG(100,
"Collected combination with: phi " << position.Phi() <<
", theta " << position.Theta() <<
155 ", pdg " << pdg <<
", pT " << pT <<
", signal " << signal <<
", passed " << passed <<
", mcId " << mcId.first);
158 template<
typename EntryType,
typename MetaInfoType >
162 for (
const auto& outerNodes : network) {
163 nLinks += outerNodes->getInnerNodes().size();
void initialize() override
set up root file and check required Store Arrays
std::vector< double > phi
phi of the innermost hit (that is not the virtual IP)
std::vector< int > passed
did segment combination pass the three hit filters
std::vector< double > theta
theta of the innermost hit (that is not the virtual IP)
void setDescription(const std::string &description)
Sets the description of the module.
unsigned networkConnections
number of connections in network
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
const HitType * getOuterHit() const
returns outer hit of current Segment
void event() override
collect necessary data and put into TTree
std::vector< double > pT
pT of the related MCParticle
SpacePoint * m_spacePoint
Pointer to spacePoint.
unsigned networkSize
segmentNetwork size
@ VXD
Any type of VXD Sensor.
The Segment class This class represents segments of track candidates needed for TrackFinderVXD-Module...
Network of directed nodes of the type EntryType.
TFile * m_rFilePtr
ptr to root file
Belle2::StoreObjPtr< Belle2::DirectedNodeNetworkContainer > m_network
StoreObjPtr to the SegmentNetwork and TrackNode Network container.
SegmentNetworkAnalyzerModule()
constructor
void terminate() override
write and close root file
std::int64_t getID() const
************************* PUBLIC MEMBER FUNCTIONS *************************
std::string m_PARAMrootFileName
file name of the produced root file
std::vector< int > virtualIP
did the segment contain the virtual IP
Abstract base class for different kinds of events.
TTree * m_treePtr
ptr to TTree
size_t getNConnections(Belle2::DirectedNodeNetwork< EntryType, MetaInfoType > &network) const
get the number of connections between the nodes of a network
keep all the variables for rootoutput in one struct
void makeBranches()
setup the Branches in the output TTree
static std::vector< Belle2::MCVXDPurityInfo > createPurityInfosVec(const std::vector< const Belle2::SpacePoint * > &spacePoints)
create a vector of MCVXDPurityInfos objects for a std::vector<Belle2::SpacePoints>.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
std::vector< int > signal
was segment combination signal
const HitType * getInnerHit() const
returns inner hit of current Segment
std::vector< int > pdg
pdg of the related MCParticle
Belle2::StoreArray< Belle2::MCParticle > m_mcParticles
MCParticles StoreArray for obtaining MC Information.
std::string m_PARAMnetworkName
StoreArray name of the DirectedNodeNetworkContainer.
A Class to store the Monte Carlo particle information.
RootVariables m_rootVariables
handle to collect all data for one event
void analyzeCombination(const Belle2::Segment< Belle2::TrackNode > &outer, const Belle2::Segment< Belle2::TrackNode > &inner, bool passed)
get necessary data from three hit combination and put them into the root variables