Belle II Software development
VXDDedxPIDModule.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 <framework/core/Module.h>
12#include <framework/gearbox/Const.h>
13#include <framework/datastore/StoreArray.h>
14
15#include <reconstruction/dataobjects/VXDDedxTrack.h>
16#include <reconstruction/dataobjects/VXDDedxLikelihood.h>
17#include <reconstruction/dataobjects/DedxConstants.h>
18
19#include <mdst/dataobjects/Track.h>
20#include <mdst/dataobjects/MCParticle.h>
21#include <tracking/dataobjects/RecoTrack.h>
22#include <svd/dataobjects/SVDCluster.h>
23#include <pxd/dataobjects/PXDCluster.h>
24
25#include <framework/database/DBObjPtr.h>
26#include <svd/dbobjects/SVDdEdxPDFs.h>
27#include <pxd/dbobjects/PXDdEdxPDFs.h>
28
29#include <vector>
30
31
32namespace Belle2 {
37 class HelixHelper;
38
52 class VXDDedxPIDModule : public Module {
53
54 public:
55
58
60 virtual ~VXDDedxPIDModule();
61
63 virtual void initialize() override;
64
66 virtual void event() override;
67
69 virtual void terminate() override;
70
71 private:
72
74 void checkPDFs();
75
83 void calculateMeans(double& mean, double& truncatedMean, double& truncatedMeanErr, const std::vector<double>& dedx) const;
84
86 static double getTraversedLength(const PXDCluster* hit, const HelixHelper* helix);
87
89 static double getTraversedLength(const SVDCluster* hit, const HelixHelper* helix);
90
92 template <class HitClass> void saveSiHits(VXDDedxTrack* track, const HelixHelper& helix, const std::vector<HitClass*>& hits) const;
93
94 // module steering parameters
96 bool m_usePXD;
97 bool m_useSVD;
101 // required input
105 // optional input
110 // output
114 // PDF's for PID
118 // other
122 };
124} // Belle2 namespace
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Helper class representing a helical track.
Definition: HelixHelper.h:28
Base class for Modules.
Definition: Module.h:72
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:30
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:29
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Extract dE/dx from fitted tracks.
DBObjPtr< SVDdEdxPDFs > m_SVDDedxPDFs
SVD DB object for dedx vs.
void calculateMeans(double &mean, double &truncatedMean, double &truncatedMeanErr, const std::vector< double > &dedx) const
Save arithmetic and truncated mean for the 'dedx' values.
int m_trackID
counter for tracks in this event
virtual void initialize() override
Initialize the module.
StoreArray< SVDCluster > m_svdClusters
Optional array of SVDClusters.
bool m_usePXD
use PXD data for likelihood
virtual void event() override
This method is called for each event.
StoreArray< MCParticle > m_mcparticles
Optional array of MCParticles.
StoreArray< VXDDedxLikelihood > m_dedxLikelihoods
Output array of VXDDedxLikelihoods.
void checkPDFs()
Check the pdfs for consistency every time they change in the database.
virtual void terminate() override
End of the event processing.
void saveSiHits(VXDDedxTrack *track, const HelixHelper &helix, const std::vector< HitClass * > &hits) const
save energy loss and hit information from SVD/PXDHits to track
DBObjPtr< PXDdEdxPDFs > m_PXDDedxPDFs
PXD DB object for dedx vs.
StoreArray< VXDDedxTrack > m_dedxTracks
Output array of VXDDedxTracks.
virtual ~VXDDedxPIDModule()
Destructor.
int m_eventID
counter for events
bool m_useSVD
use SVD data for likelihood
StoreArray< Track > m_tracks
Required array of Tracks.
bool m_onlyPrimaryParticles
For MC only: if true, only save data for primary particles (as determined by MC truth)
StoreArray< PXDCluster > m_pxdClusters
Optional array of PXDClusters.
static double getTraversedLength(const PXDCluster *hit, const HelixHelper *helix)
returns traversed length through active medium of given PXDCluster.
StoreArray< RecoTrack > m_recoTracks
Required array of RecoTracks.
bool m_useIndividualHits
use individual hits (true) or truncated mean (false) to determine likelihoods
VXDDedxPIDModule()
Default constructor.
double m_trackDistanceThreshhold
track distance threshold
Debug output for VXDDedxPID module.
Definition: VXDDedxTrack.h:29
Abstract base class for different kinds of events.