11 #include <tracking/modules/vxdtfRedesign/SegmentNetworkAnalyzerModule.h>
12 #include <tracking/spacePointCreation/SpacePoint.h>
13 #include <tracking/spacePointCreation/PurityCalculatorTools.h>
29 std::string(
"SegmentNetworkAnalyzer_output.root"));
35 B2INFO(
"SegmentNetworkAnalyzer::initialize() ------------------------------");
41 m_treePtr =
new TTree(
"SegmentNetworkAnalyzer",
"segment network analysis output");
55 for (
const auto& outerHit : hitNetwork.getNodes()) {
56 for (
const auto& centerHit : outerHit->getInnerNodes()) {
57 for (
const auto& innerHit : centerHit->getInnerNodes()) {
60 innerHit->getEntry().m_sector->getFullSecID(),
61 ¢erHit->getEntry(),
62 &innerHit->getEntry());
64 centerHit->getEntry().m_sector->getFullSecID(),
65 &outerHit->getEntry(),
66 ¢erHit->getEntry());
70 if (
auto outerNode = segmentNetwork.getNode(outerSegment->
getID())) {
71 for (
const auto& connectedNode : outerNode->getInnerNodes()) {
72 if (connectedNode->getEntry() == *innerSegment) {
116 std::vector<const Belle2::SpacePoint*> combinationSPs;
122 auto mcId = purityInfo[0].getPurity();
123 bool signal = mcId.first >= 0 && mcId.second == 1;
132 pdg = part->getPDG();
133 pT = part->getMomentum().Rho();
147 auto position = spacePoint->getPosition();
151 B2DEBUG(22,
"Collected combination with: phi " << position.Phi() <<
", theta " << position.Theta() <<
152 ", pdg " << pdg <<
", pT " << pT <<
", signal " << signal <<
", passed " << passed <<
", mcId " << mcId.first);
155 template<
typename EntryType,
typename MetaInfoType >
159 for (
const auto& outerNodes : network) {
160 nLinks += outerNodes->getInnerNodes().size();
DirectedNodeNetwork< Belle2::TrackNode, Belle2::VoidMetaInfo > & accessHitNetwork()
Returns reference to the HitNetwork stored in this container, intended for read and write access.
DirectedNodeNetwork< Belle2::Segment< Belle2::TrackNode >, Belle2::CACell > & accessSegmentNetwork()
Returns reference to the SegmentNetwork stored in this container, intended for read and write access.
Network of directed nodes of the type EntryType.
A Class to store the Monte Carlo particle information.
void setDescription(const std::string &description)
Sets the description of the module.
TTree * m_treePtr
ptr to TTree
std::string m_PARAMrootFileName
file name of the produced root file
TFile * m_rFilePtr
ptr to root file
void initialize() override
set up root file and check required Store Arrays
SegmentNetworkAnalyzerModule()
constructor
Belle2::StoreObjPtr< Belle2::DirectedNodeNetworkContainer > m_network
StoreObjPtr to the SegmentNetwork and TrackNode Network container.
RootVariables m_rootVariables
handle to collect all data for one event
void event() override
collect necessary data and put into TTree
std::string m_PARAMnetworkName
StoreArray name of the DirectedNodeNetworkContainer.
size_t getNConnections(Belle2::DirectedNodeNetwork< EntryType, MetaInfoType > &network) const
get the number of connections between the nodes of a network
void terminate() override
write and close root file
Belle2::StoreArray< Belle2::MCParticle > m_mcParticles
MCParticles StoreArray for obtaining MC Information.
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
void makeBranches()
setup the Branches in the output TTree
The Segment class This class represents segments of track candidates needed for TrackFinderVXD-Module...
std::int64_t getID() const
************************* PUBLIC MEMBER FUNCTIONS *************************
const HitType * getInnerHit() const
returns inner hit of current Segment
const HitType * getOuterHit() const
returns outer hit of current Segment
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
@ VXD
Any type of VXD Sensor.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
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>.
Abstract base class for different kinds of events.
keep all the variables for rootoutput in one struct
std::vector< double > phi
phi of the innermost hit (that is not the virtual IP)
std::vector< int > pdg
pdg of the related MCParticle
unsigned networkSize
segmentNetwork size
std::vector< int > virtualIP
did the segment contain the virtual IP
std::vector< double > theta
theta of the innermost hit (that is not the virtual IP)
unsigned networkConnections
number of connections in network
std::vector< int > passed
did segment combination pass the three hit filters
std::vector< int > signal
was segment combination signal
std::vector< double > pT
pT of the related MCParticle
SpacePoint * m_spacePoint
Pointer to spacePoint.