9#include <tracking/dqmUtils/DQMEventProcessorBase.h>
10#include <tracking/dqmUtils/DQMHistoModuleBase.h>
12#include <framework/datastore/StoreArray.h>
13#include <vxd/geometry/GeoTools.h>
14#include <vxd/geometry/SensorInfoBase.h>
26 if (!tracks.isOptional()) {
37 for (
const Track& track : tracks) {
42 }
catch (
const std::exception& e) {
43 B2WARNING(
"Exception " + std::string(e.what()) +
" in " +
m_histoModule->
getName() +
" module!");
52 if (!recoTracksVector.size())
60 nPXDClusters = (int)pxdClusters.
size();
63 int nSVDClusters = (int)svdClusters.
size();
65 int nCDCHits = (int)cdcHits.
size();
68 auto trackFitResult = track.getTrackFitResultWithClosestMass(
Const::pion);
70 TString message =
ConstructMessage(trackFitResult, nPXDClusters, nSVDClusters, nCDCHits);
71 B2DEBUG(20, message.Data());
80 if (((nPXDClusters > 0) || (nSVDClusters > 0)) && (nCDCHits == 0))
82 if (((nPXDClusters == 0) && (nSVDClusters == 0)) && (nCDCHits > 0))
84 if (((nPXDClusters > 0) || (nSVDClusters > 0)) && (nCDCHits > 0))
91 return Form(
"%s: track %3i, Mom: %f, %f, %f, Pt: %f, Mag: %f, Hits: PXD %i SVD %i CDC %i Suma %i\n",
99 nPXDClusters, nSVDClusters, nCDCHits, nPXDClusters + nSVDClusters + nCDCHits
127 B2DEBUG(20,
"Missing genfit::pxd recoHitInfo in event() for " +
m_histoModule->
getName() +
" module.");
136 if (!isPXD && !isSVD)
142 auto fitterInfo = trackpoint->getFitterInfo();
216 ROOT::Math::XYZVector globalPosition = sensorInfo->pointToGlobal(
m_position,
true);
251 switch (layerNumber) {
253 return ladderNumber < 5 || ladderNumber > 8;
255 return ladderNumber < 7 || ladderNumber > 12;
263 switch (layerNumber) {
265 return ladderNumber < 3 || ladderNumber > 5;
267 return ladderNumber < 4 || ladderNumber > 8;
269 return ladderNumber < 5 || ladderNumber > 10;
271 return ladderNumber < 6 || ladderNumber > 13;
static const ChargedStable pion
charged pion particle
virtual void ProcessSVDRecoHit(RecoHitInformation *recoHitInfo)
Compute position in a SVD way which means we need two consecutive hits to be from the same sensor to ...
ROOT::Math::XYZVector m_position
local coordinates of the hit position (u, v, w)
bool m_produce1Dres
if true, produce 1D Track residuals plots for each VXD sensor
bool m_produceTRClusters
if true, produce 2D Track-Related Cluster plots
static bool IsNotMat(int ladderNumber, int layerNumber)
Returns true if sensor with given ladderNumber and layerNumber isn't in the Mat half-shell,...
virtual void ProcessTrack(const Track &track)
Find RecoTrack for given track.
float m_phiPrev_deg
global phi in degrees of the previous hit
int m_layerIndex
index of the layer of the hit
std::string m_tracksStoreArrayName
StoreArray name where Tracks are written.
virtual void FillCommonHistograms()
Fill histograms which are common for PXD and SVD hit.
int m_layerNumberPrev
number of the layer of the previous hit
virtual void ProcessPXDRecoHit(RecoHitInformation *recoHitInfo)
Compute position in a PXD way.
int m_layerNumber
number of the layer of the hit
virtual void FillTrackFitResult(const TrackFitResult *trackFitResult)
Fill histograms with values derived from TrackFitResult.
int m_iTrackVXD
index of track where are VXD hits and aren't CDC hits (with valid TrackFitResult and related RecoTrac...
int m_iTrackCDC
index of track where are CDC hits and aren't VXD hits (with valid TrackFitResult and related RecoTrac...
bool m_produce2Dres
if true, produce 2D Track residuals plots for each VXD sensor
ROOT::Math::XYZVector m_residual_um
unbiased residual for the hit in micrometers in local coordinates (u, v, w)
bool m_isNotFirstHit
Determines if the hit is not the first hit in the current track.
int m_correlationIndex
index of the layer of the previous hit
int m_sensorIndex
index of the sensor of the hit
virtual void Run()
Call this to start processing the event data and filling histograms.
virtual void ComputeCommonVariables()
Compute variables which are common for PXD and SVD hit.
virtual void ProcessSuccessfulFit()
Continue track processing by calling ProcessRecoHit function on each RecoHitInformation in given Reco...
virtual void ProcessRecoHit(RecoHitInformation *recoHitInfo)
Compute unbiased residual and the calls ProcesPXDRecoHit or ProcessSVDRecoHit.
float m_theta_deg
global theta in degrees of the hit
TVectorT< double > * m_rawSensorResidual
unbiased residual for the hit obtained from the sensor so its length is different for PXD and SVD sen...
float m_phi_deg
global phi in degrees of the hit
virtual void SetCommonPrevVariables()
Set the value of -Prev values which are common for PXD and SVD hit.
bool m_runningOnHLT
true if the DQM is run on HLT
static bool IsNotYang(int ladderNumber, int layerNumber)
Returns true if sensor with given ladderNumber and layerNumber isn't in the Yang half-shell,...
std::string m_recoTracksStoreArrayName
StoreArray name where RecoTracks are written.
float m_thetaPrev_deg
global theta in degrees of the previous hit
VxdID m_sensorID
ID of the current sensor.
virtual TString ConstructMessage(const TrackFitResult *trackFitResult, int nPXDClusters, int nSVDClusters, int nCDCHits)
Make debug message with information about RecoTrack.
int m_iTrackVXDCDC
index of track where are both VXD hits and CDC hits (with valid TrackFitResult and related RecoTrack)
RecoTrack * m_recoTrack
RecoTrack related to currently processed Track.
DQMHistoModuleBase * m_histoModule
DQM histogram module on which the Fill- functions are called to fill histograms.
int m_iTrack
index of track (with valid TrackFitResult and related RecoTrack)
VxdID m_sensorIDPrev
ID of the prewious sensor.
ROOT::Math::XYZVector m_globalResidual_um
unbiased residual for the hit in micrometers in global coordinates (x, y, z)
virtual void FillHitNumbers(int nPXD, int nSVD, int nCDC)
Fill histograms with numbers of hits.
virtual void FillHalfShellsSVD(const B2Vector3D &globalResidual_um, bool isNotMat)
Fill histograms with unbiased residuals for half-shells for SVD sensors.
virtual void FillUB2DResidualsSensor(const B2Vector3D &residual_um, int sensorIndex)
Fill 2D histograms with unbiased residuals for individual sensors.
virtual void FillUBResidualsPXD(const B2Vector3D &residual_um)
Fill histograms with unbiased residuals in PXD sensors.
virtual void FillTrackFitStatus(const genfit::FitStatus *tfs)
Fill histograms which require FitStatus.
virtual void FillTRClusterHitmap(float phi_deg, float theta_deg, int layerIndex)
Fill cluster hitmap in IP angle range.
virtual void FillHelixParametersAndCorrelations(const TrackFitResult *tfr)
Fill histograms with helix parameters and their correlations.
virtual void FillMomentumCoordinates(const TrackFitResult *tfr)
Fill histograms with track momentum Pt.
virtual void FillHalfShellsPXD(const B2Vector3D &globalResidual_um, bool isNotYang)
Fill histograms with unbiased residuals for half-shells for PXD sensors.
virtual void FillTrackIndexes(int iTrack, int iTrackVXD, int iTrackCDC, int iTrackVXDCDC)
Fill histograms with track indexes.
virtual void FillTRClusterCorrelations(float phi_deg, float phiPrev_deg, float theta_deg, float thetaPrev_deg, int correlationIndex)
Fill histograms with correlations between neighbor layers.
virtual void FillMomentumAngles(const TrackFitResult *tfr)
Fill histograms with track momentum Pt.
virtual void FillUBResidualsSVD(const B2Vector3D &residual_um)
Fill histograms with unbiased residuals in SVD sensors.
virtual void FillUB1DResidualsSensor(const B2Vector3D &residual_um, int sensorIndex)
Fill 1D histograms with unbiased residuals for individual sensors.
const std::string & getName() const
Returns the name of the module.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
float getV() const
Get v coordinate of hit position.
float getU() const
Get u coordinate of hit position.
This is the Reconstruction Event-Data Model Track.
bool wasFitSuccessful(const genfit::AbsTrackRep *representation=nullptr) const
Returns true if the last fit with the given representation was successful.
const genfit::TrackPoint * getCreatedTrackPoint(const RecoHitInformation *recoHitInformation) const
Get a pointer to the TrackPoint that was created from this hit.
std::vector< RecoHitInformation * > getRecoHitInformations(bool getSorted=false) const
Return a list of all RecoHitInformations associated with the RecoTrack.
const genfit::FitStatus * getTrackFitStatus(const genfit::AbsTrackRep *representation=nullptr) const
Return the track fit status for the given representation or for the cardinal one. You are not allowed...
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
bool isUCluster() const
Get the direction of strips.
float getPosition(double v=0) const
Get the coordinate of reconstructed hit.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
Accessor to arrays stored in the data store.
Values of the result of a track fit with a given particle hypothesis.
ROOT::Math::XYZVector getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Class that bundles various TrackFitResults.
static const double deg
degree to radians
static const double um
[micrometers]
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
Abstract base class for different kinds of events.