8 #include "TEveWindow.h" 32 m_resXCol(kGreen - 9),
36 m_stereoCol(kCyan - 9),
43 auto const& residuals =
track->residuals();
67 if ((*(
track->recHitsBegin() +
i))->isValid()) {
73 res[1].push_back(residuals.pullY(
i));
98 if (!
track->extra().isAvailable()) {
101 TLatex* latex =
new TLatex();
102 latex->SetTextSize(0.1);
103 latex->DrawLatex(0.1, 0.5,
"No track extra information");
111 TH2F* h_res =
new TH2F(
"h_resx",
"h_resx", 10, -5.5, 5.5,
m_ndet, 0,
m_ndet);
112 TPad* padX =
new TPad(
"pad1",
"pad1", 0.2, 0., 0.8, 0.99);
113 padX->SetBorderMode(0);
114 padX->SetLeftMargin(0.2);
117 padX->SetFrameLineWidth(0);
119 h_res->SetDirectory(
nullptr);
120 h_res->SetStats(kFALSE);
122 h_res->SetXTitle(
"residual");
123 h_res->GetXaxis()->SetTickLength(0);
124 h_res->GetYaxis()->SetTickLength(0);
125 h_res->GetXaxis()->SetNdivisions(20);
126 h_res->GetYaxis()->SetLabelSize(0.06);
130 float larray[9] = {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5};
132 for (
int l = 0;
l < 8;
l++) {
133 float diff2 = (larray[
l + 1] - larray[
l]) / 2;
134 larray2[
l] = larray[
l] + diff2;
140 for (
int k = 0;
k < 8;
k++) {
141 if (fabs(
res[0][
l]) == larray2[
k])
143 if (fabs(
res[1][
l]) == larray2[
k])
149 for (
int l = 0;
l < 17;
l++) {
152 sign = (
l > 8) ? -1 : 1;
155 lines[
l]->SetLineStyle(3);
166 for (
int h = 0;
h < 2;
h++) {
175 h_res->GetYaxis()->SetBinLabel(
j + 1, det_str2);
187 box[1] = height1 +
width *
k;
188 box[3] = height1 +
width * (
k + 1);
209 const char* res_str =
"residuals in Si detector local x-y coord.";
210 TPaveText*
pt =
new TPaveText(0.0, 0.91, 1, 0.99,
"blNDC");
211 pt->SetBorderSize(0);
212 pt->SetFillColor(kWhite);
213 pt->AddText(res_str);
223 double local1[3] = {0, 0, 0};
224 double local2[3] = {resX, 0, 0};
225 double global1[3], global2[3];
226 const TGeoMatrix*
m =
geom->getMatrix(
id);
228 m->LocalToMaster(local1, global1);
229 m->LocalToMaster(local2, global2);
230 TVector3
g1 = global1;
231 TVector3
g2 = global2;
232 if (
g2.DeltaPhi(
g1) > 0)
240 std::cout <<
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
244 printf(
"m_det[idx] %i m_det_tracker_str %s substruct %i\n",
255 Double_t fontsize = 0.07;
256 TLatex* latex =
new TLatex();
257 latex->SetTextSize(fontsize);
275 latex->SetTextSize(fontsize);
276 Double_t boxH = 0.25 * fontsize;
280 latex->DrawLatex(x0,
y,
"Residual:");
285 "sgn(#hat{X}#bullet#hat{#phi}) #times #frac{X_{hit} - X_{traj}}{#sqrt{#sigma^{2}_{hit} + #sigma^{2}_{traj}}}");
287 snprintf(mytext, 255,
"layers hit: %i",
m_ndet);
288 latex->DrawLatex(x0,
y, mytext);
290 snprintf(mytext, 255,
"valid Si hits: %i", nvalid);
291 latex->DrawLatex(x0,
y, mytext);
293 snprintf(mytext, 255,
"total Si hits: %i",
m_nhits);
294 latex->DrawLatex(x0,
y, mytext);
296 snprintf(mytext, 255,
"valid Si pixel hits: %i", npix);
297 latex->DrawLatex(x0,
y, mytext);
299 snprintf(mytext, 255,
"valid Si strip hits: %i", nstrip);
300 latex->DrawLatex(x0,
y, mytext);
307 latex->DrawLatex(x0,
y,
"X hit");
313 latex->DrawLatex(x0,
y,
"Y hit");
319 latex->DrawLatex(x0,
y,
"stereo hit");
325 latex->DrawLatex(x0,
y,
"invalid hit");
std::vector< int > subsubstruct
std::vector< int > substruct
int numberOfAllHits(HitCategory category) const
double getSignedResidual(const FWGeometry *geom, unsigned int id, double resX)
void setTextInfo(const FWModelId &id, const reco::Track *) override
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
void build(const FWModelId &id, const reco::Track *) override
FWTrackResidualDetailView()
~FWTrackResidualDetailView() override
uint16_t getHitPattern(HitCategory category, int position) const
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
std::vector< int > m_detector
std::vector< int > hittype
void prepareData(const FWModelId &id, const reco::Track *)
std::vector< int > stereo
static const char * m_det_tracker_str[]
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static void drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)