9#include <pxd/modules/pxdDQM/PXDDQMTrackRawNtupleModule.h>
10#include <tracking/dataobjects/ROIid.h>
12#include <pxd/reconstruction/PXDPixelMasker.h>
13#include <mdst/dataobjects/Track.h>
14#include <framework/gearbox/Const.h>
16#include "TMatrixDSym.h"
42 addParam(
"pCut",
m_pcut,
"Set a cut on the track fit p-value (0=no cut)",
double(1e-20));
43 addParam(
"minSVDHits",
m_minSVDHits,
"Number of SVD hits required in a track to be considered", 5u);
44 addParam(
"momCut",
m_momCut,
"Set a cut on the track momentum in GeV/c, 0 disables",
double(0.3));
45 addParam(
"pTCut",
m_pTCut,
"Set a cut on the track transverse momentum (<=0 disable)",
double(0.3));
46 addParam(
"uDist",
m_uDist,
"distance in ucell to intercept to accept hit",
int(10));
47 addParam(
"vDist",
m_vDist,
"distance in vcell to intercept to accept hit",
int(10));
53 auto dir = gDirectory;
76 m_tuple =
new TNtuple(
"trackraw",
"trackraw",
"vxdid:u:v:p:pt:framenr:triggergate");
91 B2INFO(
"PXDHits array is missing, will not do anything");
95 B2INFO(
"RecoTrack array is missing, will not do anything");
99 B2INFO(
"Track array is missing, will not do anything");
103 B2INFO(
"Intercept array is missing, will not do anything");
107 std::map<unsigned int, int> triggergate;
109 for (
auto& pkt : evt) {
110 for (
auto& dhc : pkt) {
111 for (
auto& dhe : dhc) {
112 triggergate[(
unsigned int)dhe.getSensorID()] = dhe.getTriggerGate();
120 if (!recoTrack.
size())
continue;
122 auto a_track = recoTrack[0];
124 if (!a_track->wasFitSuccessful())
continue;
126 if (a_track->getNumberOfSVDHits() <
m_minSVDHits)
continue;
129 if (!interceptList.
size())
continue;
131 const genfit::FitStatus* fitstatus = a_track->getTrackFitStatus();
132 if (fitstatus->getPVal() <
m_pcut)
continue;
134 genfit::MeasuredStateOnPlane trackstate;
135 trackstate = a_track->getMeasuredStateOnPlaneFromFirstHit();
136 if (trackstate.getMom().Mag() <
m_momCut)
continue;
137 if (trackstate.getMom().Pt() <
m_pTCut)
continue;
141 B2ERROR(
"expect a track fit result for mass");
147 for (
auto intercept : interceptList) {
148 VxdID aVxdID = intercept.getSensorID();
154 double u_fit = intercept.getCoorU();
155 double v_fit = intercept.getCoorV();
157 int ucell_fit = info.getUCellID(u_fit);
158 int vcell_fit = info.getVCellID(v_fit);
164 VxdID hitID = hit.getSensorID();
172 auto u = hit.getUCellID();
173 auto v = hit.getVCellID();
174 if (abs(ucell_fit - u) <
m_uDist && abs(vcell_fit - v) <
m_vDist) {
176 float fill[7] = {float((
int)aVxdID), float(u), float(v), float(trackstate.getMom().Mag()), float(trackstate.getMom().Pt()), float(hit.getFrameNr()), float(triggergate[hitID])};
static const ChargedStable pion
charged pion particle
void setDescription(const std::string &description)
Sets the description of the module.
StoreArray< PXDRawHit > m_pxdhits
store array of pxd clusters
void initialize() override final
initializes the need store arrays, trees and histograms
StoreObjPtr< PXDDAQStatus > m_storeDAQEvtStats
Input array for DAQ Status.
unsigned int m_minSVDHits
Required hits in SVD strips for tracks.
std::string m_PXDInterceptListName
intercept list name
double m_momCut
Cut on fitted track momentum.
double m_pcut
pValue-Cut for tracks
void terminate() override final
terminate , save tuple to file if needed
void event() override final
main function which fills trees and histograms
StoreArray< Track > m_tracks
store array of tracks
std::string m_recoTracksName
name of the store array of recotracks
TFile * m_file
pointer to opened file
std::string m_pxdHitsName
name of the store array of pxd clusters
PXDDQMTrackRawNtupleModule()
Constructor: Sets the description, the properties and the parameters of the module.
double m_pTCut
Cut on fitted track pT.
StoreArray< PXDIntercept > m_intercepts
store array of PXD Intercepts
StoreArray< RecoTrack > m_recoTracks
store array of reco tracks
bool m_useAlignment
if true alignment will be used!
int m_uDist
distance in ucell to intercept to accept hit
VXD::GeoCache & m_vxdGeometry
the geometry
TNtuple * m_tuple
pointer to opened tuple
std::string m_ntupleName
name output file
int m_vDist
distance in vcell to intercept to accept hit
std::string m_tracksName
name of the store array of tracks
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
This is the Reconstruction Event-Data Model Track.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool isValid() const
Check wether the array was registered.
Values of the result of a track fit with a given particle hypothesis.
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getSensorNumber() const
Get the sensor id.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.