8 #include "TEveWindow.h" 32 m_resXCol(kGreen - 9),
36 m_stereoCol(kCyan - 9),
40 memset(
res, 0,
sizeof(
res));
51 auto const& residuals =
track->residuals();
67 if ((*(
track->recHitsBegin() +
i))->isValid()) {
72 res[1][
i] = residuals.pullY(
i);
97 if (!
track->extra().isAvailable()) {
100 TLatex* latex =
new TLatex();
101 latex->SetTextSize(0.1);
102 latex->DrawLatex(0.1, 0.5,
"No track extra information");
110 TH2F* h_res =
new TH2F(
"h_resx",
"h_resx", 10, -5.5, 5.5,
m_ndet, 0,
m_ndet);
111 TPad* padX =
new TPad(
"pad1",
"pad1", 0.2, 0., 0.8, 0.99);
112 padX->SetBorderMode(0);
113 padX->SetLeftMargin(0.2);
116 padX->SetFrameLineWidth(0);
118 h_res->SetDirectory(
nullptr);
119 h_res->SetStats(kFALSE);
121 h_res->SetXTitle(
"residual");
122 h_res->GetXaxis()->SetTickLength(0);
123 h_res->GetYaxis()->SetTickLength(0);
124 h_res->GetXaxis()->SetNdivisions(20);
125 h_res->GetYaxis()->SetLabelSize(0.06);
129 float larray[9] = {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5};
131 for (
int l = 0;
l < 8;
l++) {
132 float diff2 = (larray[
l + 1] - larray[
l]) / 2;
133 larray2[
l] = larray[
l] + diff2;
139 for (
int k = 0;
k < 8;
k++) {
140 if (fabs(
res[0][
l]) == larray2[
k])
142 if (fabs(
res[1][
l]) == larray2[
k])
148 for (
int l = 0;
l < 17;
l++) {
151 sign = (
l > 8) ? -1 : 1;
154 lines[
l]->SetLineStyle(3);
165 for (
int h = 0;
h < 2;
h++) {
174 h_res->GetYaxis()->SetBinLabel(
j + 1, det_str2);
186 box[1] = height1 +
width *
k;
187 box[3] = height1 +
width * (
k + 1);
208 const char* res_str =
"residuals in Si detector local x-y coord.";
209 TPaveText*
pt =
new TPaveText(0.0, 0.91, 1, 0.99,
"blNDC");
210 pt->SetBorderSize(0);
211 pt->SetFillColor(kWhite);
212 pt->AddText(res_str);
222 double local1[3] = {0, 0, 0};
223 double local2[3] = {resX, 0, 0};
224 double global1[3], global2[3];
225 const TGeoMatrix*
m =
geom->getMatrix(
id);
227 m->LocalToMaster(local1, global1);
228 m->LocalToMaster(local2, global2);
229 TVector3
g1 = global1;
230 TVector3
g2 = global2;
231 if (
g2.DeltaPhi(
g1) > 0)
239 std::cout <<
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
243 printf(
"m_det[idx] %i m_det_tracker_str %s substruct %i\n",
254 Double_t fontsize = 0.07;
255 TLatex* latex =
new TLatex();
256 latex->SetTextSize(fontsize);
274 latex->SetTextSize(fontsize);
275 Double_t boxH = 0.25 * fontsize;
279 latex->DrawLatex(x0,
y,
"Residual:");
284 "sgn(#hat{X}#bullet#hat{#phi}) #times #frac{X_{hit} - X_{traj}}{#sqrt{#sigma^{2}_{hit} + #sigma^{2}_{traj}}}");
286 snprintf(mytext, 255,
"layers hit: %i",
m_ndet);
287 latex->DrawLatex(x0,
y, mytext);
289 snprintf(mytext, 255,
"valid Si hits: %i", nvalid);
290 latex->DrawLatex(x0,
y, mytext);
292 snprintf(mytext, 255,
"total Si hits: %i",
m_nhits);
293 latex->DrawLatex(x0,
y, mytext);
295 snprintf(mytext, 255,
"valid Si pixel hits: %i", npix);
296 latex->DrawLatex(x0,
y, mytext);
298 snprintf(mytext, 255,
"valid Si strip hits: %i", nstrip);
299 latex->DrawLatex(x0,
y, mytext);
306 latex->DrawLatex(x0,
y,
"X hit");
312 latex->DrawLatex(x0,
y,
"Y hit");
318 latex->DrawLatex(x0,
y,
"stereo hit");
324 latex->DrawLatex(x0,
y,
"invalid hit");
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
void prepareData(const FWModelId &id, const reco::Track *)
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)