9#include <tracking/modules/roiFinding/svd/SVDROIFinderAnalysisDataModule.h>
10#include <framework/datastore/StoreArray.h>
11#include <framework/logging/Logger.h>
13#include <mdst/dataobjects/Track.h>
14#include <tracking/dataobjects/RecoTrack.h>
15#include <tracking/dataobjects/ROIid.h>
16#include <tracking/dataobjects/SVDIntercept.h>
17#include <svd/dataobjects/SVDShaperDigit.h>
33 , m_recoTrackListName()
34 , m_SVDInterceptListName()
36 , m_rootFilePtr(nullptr)
38 , m_writeToRoot(false)
42 , m_h1Track_pt(nullptr)
43 , m_h1Track_phi(nullptr)
44 , m_h1Track_lambda(nullptr)
45 , m_h1Track_cosTheta(nullptr)
46 , m_h1Track_pVal(nullptr)
48 , m_h1ROItrack(nullptr)
49 , m_h1ROItrack_pt(nullptr)
50 , m_h1ROItrack_phi(nullptr)
51 , m_h1ROItrack_lambda(nullptr)
52 , m_h1ROItrack_cosTheta(nullptr)
53 , m_h1ROItrack_pVal(nullptr)
55 , m_h1GoodROItrack(nullptr)
56 , m_h1GoodROItrack_pt(nullptr)
57 , m_h1GoodROItrack_phi(nullptr)
58 , m_h1GoodROItrack_lambda(nullptr)
59 , m_h1GoodROItrack_cosTheta(nullptr)
60 , m_h1GoodROItrack_pVal(nullptr)
62 , m_h1FullROItrack(nullptr)
63 , m_h1FullROItrack_pt(nullptr)
64 , m_h1FullROItrack_phi(nullptr)
65 , m_h1FullROItrack_lambda(nullptr)
66 , m_h1FullROItrack_cosTheta(nullptr)
67 , m_h1FullROItrack_pVal(nullptr)
71 , m_h2sigmaUphi(nullptr)
72 , m_h2sigmaVphi(nullptr)
77 , m_h1GlobalTime(nullptr)
79 , m_h2ROIuMinMax(nullptr)
80 , m_h2ROIvMinMax(nullptr)
81 , m_h2ROIcenters(nullptr)
82 , m_h2GoodROIcenters(nullptr)
83 , m_h2FullROIcenters(nullptr)
84 , m_h1totROIs(nullptr)
85 , m_h1goodROIs(nullptr)
87 , m_h1effROIs(nullptr)
98 setDescription(
"This module performs the analysis of the SVDROIFinder module output ON DATA");
101 "set true if you want to save the information in a root file named by parameter 'rootFileName'",
bool(
true));
104 "fileName used for . Will be ignored if parameter 'writeToRoot' is false (standard)",
105 std::string(
"svdDataRedAnalysisData"));
108 "name of the input collection of RecoTracks", std::string(
""));
111 "name of the input collection of SVDShaperDigits", std::string(
""));
114 "name of the list of interceptions", std::string(
""));
117 "name of the list of ROIs", std::string(
""));
121 addParam(
"minPVal",
m_minPVal,
"fiducial region: minimum track P-Value",
float(0.001));
152 m_h1GlobalTime =
new TH1F(
"hGlobalTime",
"global time for SVDShaperDigits contained in ROI", 200, -100, 100);
153 m_h1PullU =
new TH1F(
"hPullU",
"U pulls for SVDShaperDigits contained in ROI", 100, -6, 6);
154 m_h1PullV =
new TH1F(
"hPullV",
"V pulls for SVDShaperDigits contained in ROI", 100, -6, 6);
155 m_h2sigmaUphi =
new TH2F(
"hsigmaUvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.35);
156 m_h2sigmaVphi =
new TH2F(
"hsigmaVvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.4);
157 m_h1ResidU =
new TH1F(
"hResidU",
"U resid for SVDShaperDigits contained in ROI", 100, -0.5, 0.5);
158 m_h1ResidV =
new TH1F(
"hResidV",
"V resid for SVDShaperDigits contained in ROI", 100, -0.5, 0.5);
159 m_h1SigmaU =
new TH1F(
"hSigmaU",
"sigmaU for SVDShaperDigits contained in ROI", 100, 0, 0.35);
160 m_h1SigmaV =
new TH1F(
"hSigmaV",
"sigmaV for SVDShaperDigits contained in ROI", 100, 0, 0.35);
172 m_h1totROIs =
new TH1F(
"h1TotNROIs",
"number of all ROIs", 110, 0, 110);
173 m_h1goodROIs =
new TH1F(
"h1GoodNROIs",
"number of ROIs from Good Track", 110, 0, 110);
174 m_h1okROIs =
new TH1F(
"h1OkNROIs",
"number of Good ROIs containing a SVDShaperDigit", 110, 0, 110);
175 m_h1effROIs =
new TH1F(
"h1EffSVD",
"fraction of Good ROIs containing a SVDShaperDigit", 100, 0, 1.1);
181 m_h2ROIuMinMax =
new TH2F(
"h2ROIuMinMax",
"u Min vs Max (all ROIs)", 960, -100, 860, 960, -100, 860);
182 m_h2ROIvMinMax =
new TH2F(
"h2ROIvMinMax",
"v Min vs Max (all ROIs)", 960, -100, 860, 960, -100, 860);
183 m_h2ROIcenters =
new TH2F(
"h2ROIcenters",
"ROI Centers", 768, 0, 768, 512, 0, 512);
184 m_h2GoodROIcenters =
new TH2F(
"h2GoodROIcenters",
"Good ROI Centers", 768, 0, 768, 512, 0, 512);
185 m_h2FullROIcenters =
new TH2F(
"h2FullROIcenters",
"Full ROI Centers", 768, 0, 768, 512, 0, 512);
194 m_h1ROItrack =
new TH1F(
"hROITrack",
"track with an attached Good ROI", 2, 0, 2);
195 m_h1ROItrack_pt =
new TH1F(
"hROITrack_pT",
"Track with an attached Good ROI, Transverse Momentum", 100, 0, 8);
196 m_h1ROItrack_phi =
new TH1F(
"h1ROITrack_phi",
"Track with an attached Good ROI, Momentum Phi", 200, -TMath::Pi() - 0.01,
198 m_h1ROItrack_lambda =
new TH1F(
"h1ROITrack_lambda",
"Track with an attached Good ROI, Lambda", 100, -TMath::Pi() - 0.01,
200 m_h1ROItrack_cosTheta =
new TH1F(
"h1ROITrack_cosTheta",
"Track with an attached Good ROI, Momentum CosTheta", 100, -1 - 0.01, 1.01);
201 m_h1ROItrack_pVal =
new TH1F(
"h1ROITrack_pVal",
"Track with an attached Good ROI, P-Value", 1000, 0, 1 + 0.01);
203 m_h1FullROItrack =
new TH1F(
"hFullROITrack",
"track with an attached Full ROI", 20, 0, 20);
204 m_h1FullROItrack_pt =
new TH1F(
"hFullROITrack_pT",
"Track with an attached Full ROI, Transverse Momentum", 100, 0, 8);
205 m_h1FullROItrack_phi =
new TH1F(
"h1FullROITrack_phi",
"Track with an attached Full ROI, Momentum Phi", 200, -TMath::Pi() - 0.01,
207 m_h1FullROItrack_lambda =
new TH1F(
"h1FullROITrack_lambda",
"Track with an attached Full ROI, Lambda", 100, -TMath::Pi() - 0.01,
209 m_h1FullROItrack_cosTheta =
new TH1F(
"h1FullROITrack_cosTheta",
"Track with an attached Full ROI, Momentum CosTheta", 100,
211 m_h1FullROItrack_pVal =
new TH1F(
"h1FullROITrack_pVal",
"Track with an attached Full ROI, P-Value", 1000, 0, 1 + 0.01);
213 m_h1GoodROItrack =
new TH1F(
"hGoodROITrack",
"track with an attached Good ROI", 20, 0, 20);
214 m_h1GoodROItrack_pt =
new TH1F(
"hGoodROITrack_pT",
"Track with an attached Good ROI, Transverse Momentum", 100, 0, 8);
215 m_h1GoodROItrack_phi =
new TH1F(
"h1GoodROITrack_phi",
"Track with an attached Good ROI, Momentum Phi", 200, -TMath::Pi() - 0.01,
217 m_h1GoodROItrack_lambda =
new TH1F(
"h1GoodROITrack_lambda",
"Track with an attached Good ROI, Lambda", 100, -TMath::Pi() - 0.01,
219 m_h1GoodROItrack_cosTheta =
new TH1F(
"h1GoodROITrack_cosTheta",
"Track with an attached Good ROI, Momentum CosTheta", 100,
221 m_h1GoodROItrack_pVal =
new TH1F(
"h1GoodROITrack_pVal",
"Track with an attached Good ROI, P-Value", 1000, 0, 1 + 0.01);
223 m_h1Track =
new TH1F(
"hTrack",
"Number of Tracks per Event", 20, 0, 20);
224 m_h1Track_pt =
new TH1F(
"hTrack_pT",
"Track Transverse Momentum", 100, 0, 8);
225 m_h1Track_lambda =
new TH1F(
"h1Track_lambda",
"Track Momentum Lambda", 100, -TMath::Pi() + 0.01, TMath::Pi() + 0.01);
226 m_h1Track_phi =
new TH1F(
"h1Track_phi",
"Track momentum Phi", 200, -TMath::Pi() - 0.01, TMath::Pi() + 0.01);
227 m_h1Track_cosTheta =
new TH1F(
"h1Track_cosTheta",
"Track Momentum CosTheta", 100, -1 - 0.01, 1 + 0.01);
228 m_h1Track_pVal =
new TH1F(
"h1Track_pVal",
"Track P-Value", 1000, 0, 1 + 0.01);
236 B2DEBUG(21,
" ++++++++++++++ SVDROIFinderAnalysisDataModule");
243 for (
int i = 0; i < (int)
m_tracks.getEntries(); i++) {
258 for (
int i = 0; i < (int)
m_ROIs.getEntries(); i++) {
260 float centerROIU = (
m_ROIs[i]->getMaxUid() +
m_ROIs[i]->getMinUid()) / 2;
261 float centerROIV = (
m_ROIs[i]->getMaxVid() +
m_ROIs[i]->getMinVid()) / 2;
270 if (!theRC[0]->wasFitSuccessful()) {
295 float nStripsU = 768;
296 float nStripsV = 512;
297 float centerSensorU = nStripsU / 2;
298 float centerSensorV = nStripsV / 2;
299 float pitchU = 0.075;
300 float pitchV = 0.240;
308 float edgeStripsU =
m_edgeU / pitchU;
309 float edgeStripsV =
m_edgeV / pitchV;
310 B2DEBUG(21,
"good U in range " << edgeStripsU <<
", " << nStripsU - edgeStripsU);
311 B2DEBUG(21,
"good V in range " << edgeStripsV <<
", " << nStripsV - edgeStripsV);
313 B2DEBUG(21,
"U check: " << abs(centerROIU - centerSensorU) <<
" < (good) " << centerSensorU - edgeStripsU);
314 B2DEBUG(21,
"V check: " << abs(centerROIV - centerSensorV) <<
" < (good) " << centerSensorV - edgeStripsV);
316 if ((abs(centerROIU - centerSensorU) > centerSensorU - edgeStripsU)
317 || (abs(centerROIV - centerSensorV) > centerSensorV - edgeStripsV))
325 ": U side " <<
m_ROIs[i]->getMinUid() <<
"->" <<
m_ROIs[i]->getMaxUid() <<
", V side " <<
m_ROIs[i]->getMinVid() <<
"->" <<
334 for (
int s = 0; s <
m_shapers.getEntries(); s++) {
346 B2RESULT(
" --> is Full");
372 B2RESULT(
" o Good ROIs = " << nGoodROIs <<
", of which Full = " << nOkROIs
373 <<
" --> efficiency = " << (
float)nOkROIs / nGoodROIs);
375 if (nGoodROIs >
m_ROIs.getEntries()) B2RESULT(
" HOUSTON WE HAVE A PROBLEM!");
383 B2RESULT(
" ROI AnalysisData Summary ");
384 B2RESULT(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
387 B2RESULT(
" number of tracks = " <<
n_tracks);
389 B2RESULT(
" number of ROIs = " <<
n_rois);
390 B2RESULT(
" number of Good ROIs = " <<
m_nGoodROIs);
392 B2RESULT(
" number of Good ROIs with SVDShaperDigit= " <<
m_nOkROIs);
394 B2RESULT(
" average SVD INefficiency = " << 1 -
m_h1effROIs->GetMean());
403 TDirectory* oldDir = gDirectory;
405 TDirectory* m_alltracks = oldDir->mkdir(
"ALLtracks");
406 TDirectory* m_roitracks = oldDir->mkdir(
"ROItracks");
407 TDirectory* m_goodroitracks = oldDir->mkdir(
"GoodROItracks");
408 TDirectory* m_fullroitracks = oldDir->mkdir(
"FullROItracks");
411 TDirectory* m_ROIDir = oldDir->mkdir(
"roi");
433 m_goodroitracks->cd();
440 m_fullroitracks->cd();
static const ChargedStable pion
charged pion particle
void setDescription(const std::string &description)
Sets the description of the module.
Class for type safe access to objects that are referred to in relations.
std::string m_rootFileName
root file name
TH2F * m_h2FullROIcenters
ROI centers with all SVDShaperDigits inside ROI.
TH1F * m_h1FullROItrack_cosTheta
track with attached ROI - costheta
TH1F * m_h1FullROItrack_phi
track with attached ROI- phi
TH1F * m_h1ResidV
distribution of V resid for SVDShaperDigits contained in a ROI
std::string m_ROIListName
ROI list name.
unsigned int n_intercepts
number of SVDIntercepts
std::string m_recoTrackListName
Track list name.
TH1F * m_h1FullROItrack_pt
track with attached ROI - pT
bool m_writeToRoot
if true, a rootFile named by m_rootFileName will be filled with info
unsigned int n_tracks
number of tracks
TH1F * m_h1FullROItrack_lambda
track with attached ROI - lambda
TH1F * m_h1PullV
distribution of V pulls for PDXDigits contained in a ROI
StoreArray< SVDIntercept > m_SVDIntercepts
svd intercept store array
TH1F * m_h1Track_pt
denominator track pT
TH1F * m_h1GoodROItrack_pVal
track with attached ROI - pVal
void initialize() override
Initializes the Module.
TH1F * m_h1ROItrack
track with attached ROI
int m_rootEvent
event number
TH1F * m_h1Track_pVal
denominator track pVal
TH2F * m_h2GoodROIcenters
ROI centers containing a SVDShaperDigit.
TH1F * m_h1PullU
distribution of U pulls for PDXDigits contained in a ROI
TH1F * m_h1okROIs
distribution of number of ROIs containing a SVDShaperDigit
TH1F * m_h1Track_cosTheta
denominator track cosTheta
StoreArray< SVDShaperDigit > m_shapers
shaper digits store array
TH1F * m_h1GoodROItrack_cosTheta
track with attached ROI - costheta
void event() override
Event loop.
TH1F * m_h1Track_lambda
denominator track lambda
std::string m_SVDInterceptListName
Intercept list name.
TH1F * m_h1Track
denominator track
TH1F * m_h1effROIs
distribution of number of ROIs containing a SVDShaperDigit, DATA
TH1F * m_h1totROIs
distribution of number of all ROIs
TH1F * m_h1goodROIs
distribution of number of ROIs containing a SVDShaperDigit, DATA
void terminate() override
Termination action.
unsigned int m_nGoodROIs
number of ROIs containing a SVDShaperDigit, DATA
TH1F * m_h1GlobalTime
distribution of global time for PDXDigits contained in a ROI
TH1F * m_h1GoodROItrack
track with attached ROI
TH1F * m_h1ROItrack_lambda
track with attached ROI - lambda
TH1F * m_h1SigmaV
distribution of sigmaV for SVDShaperDigits contained in a ROI
float m_edgeV
fiducial region, edge along U
TH1F * m_h1SigmaU
distribution of sigmaU for SVDShaperDigits contained in a ROI
TH1F * m_h1ROItrack_pVal
track with attached ROI - pVal
unsigned int m_nOkROIs
number of ROIs containing a SVDShaperDigit
float m_edgeU
fiducial region, edge along U
TH1F * m_h1GoodROItrack_pt
track with attached ROI - pT
TH1F * m_h1ResidU
distribution of U resid for SVDShaperDigits contained in a ROI
StoreArray< Track > m_tracks
reco track store array
TH1F * m_h1ROItrack_phi
track with attached ROI- phi
TH2F * m_h2ROIcenters
ROI centers.
unsigned int n_rois
number of ROIs
TH1F * m_h1ROItrack_cosTheta
track with attached ROI - costheta
TH2F * m_h2sigmaUphi
distribution of sigmaU VS phi for PDXDigits contained in a ROI
TH2F * m_h2ROIvMinMax
v-coordinate Min vs Max
std::string m_shapersName
SVDShaperDigits name.
StoreArray< RecoTrack > m_recoTracks
reco track store array
float m_minPVal
fiducial region, minimum P value of the tracks
TH1F * m_h1GoodROItrack_phi
track with attached ROI- phi
TH2F * m_h2sigmaVphi
distribution of sigmaV VS phi for PDXDigits contained in a ROI
TH1F * m_h1Track_phi
denominator track phi
TH1F * m_h1FullROItrack
track with attached ROI
TFile * m_rootFilePtr
pointer at root file used for storing infos for debugging and validating purposes
TH2F * m_h2ROIuMinMax
u-coordinate Min vs Max
TH1F * m_h1FullROItrack_pVal
track with attached ROI - pVal
TH1F * m_h1GoodROItrack_lambda
track with attached ROI - lambda
~SVDROIFinderAnalysisDataModule()
Destructor of the module.
SVDROIFinderAnalysisDataModule()
Constructor of the module.
TH1F * m_h1ROItrack_pt
track with attached ROI - pT
StoreArray< ROIid > m_ROIs
rois store array
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Values of the result of a track fit with a given particle hypothesis.
double getPValue() const
Getter for Chi2 Probability of the track fit.
ROOT::Math::XYZVector getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
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.