8 #include "TEveWindow.h"
41 memset(
res, 0,
sizeof(
res));
82 for(
int j=0;
j < m_nhits-1;) {
86 if(k==(m_nhits-1))
j=
k;
107 TLatex* latex =
new TLatex();
108 latex->SetTextSize(0.1);
109 latex->DrawLatex(0.1, 0.5,
"No track extra information");
117 TH2F* h_res =
new TH2F(
"h_resx",
"h_resx",10,-5.5,5.5,
m_ndet,0,
m_ndet);
118 TPad* padX =
new TPad(
"pad1",
"pad1", 0.2, 0., 0.8, 0.99);
119 padX->SetBorderMode(0);
120 padX->SetLeftMargin(0.2);
123 padX->SetFrameLineWidth(0);
125 h_res->SetDirectory(0);
126 h_res->SetStats(kFALSE);
128 h_res->SetXTitle(
"residual");
129 h_res->GetXaxis()->SetTickLength(0);
130 h_res->GetYaxis()->SetTickLength(0);
131 h_res->GetXaxis()->SetNdivisions(20);
132 h_res->GetYaxis()->SetLabelSize(0.06);
136 float larray[9]={0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5};
138 for(
int l=0;
l<8;
l++) {
139 float diff2=(larray[
l+1]-larray[
l])/2;
140 larray2[
l]=larray[
l]+diff2;
146 for(
int k=0;
k<8;
k++) {
147 if(fabs(
res[0][
l])==larray2[
k])
149 if(fabs(
res[1][l])==larray2[
k])
155 for(
int l=0;
l<17;
l++) {
158 sign = (
l>8) ? -1 : 1;
159 lines[
l] =
new TLine(sign*larray[ix],0,sign*larray[ix],
m_ndet);
161 lines[
l]->SetLineStyle(3);
172 for(
int h=0;
h<2;
h++) {
181 h_res->GetYaxis()->SetBinLabel(j+1, det_str2);
187 for(
int l=m_det[j];
l<(m_det[
j]+
diff);
l++) {
190 int sign = (
res[
h][
l]<0) ? -1 : 1;
191 box[0] = (
hittype[
l]==0) ? sign*larray[resi[
h][
l]] : -5.5;
192 box[2] = (
hittype[
l]==0) ? sign*larray[resi[
h][
l]+1] : 5.5;
193 box[1] = height1+width*
k;
194 box[3] = height1+width*(k+1);
217 const char* res_str=
"residuals in Si detector local x-y coord.";
218 TPaveText *
pt =
new TPaveText(0.0,0.91, 1,0.99,
"blNDC");
219 pt->SetBorderSize(0);
220 pt->SetFillColor(kWhite);
221 pt->AddText(res_str);
233 double local1[3] = { 0, 0, 0 };
234 double local2[3] = { resX, 0, 0 };
235 double global1[3], global2[3];
238 m->LocalToMaster(local1, global1);
239 m->LocalToMaster(local2, global2);
240 TVector3
g1 = global1;
241 TVector3
g2 = global2;
242 if (g2.DeltaPhi(g1) > 0)
252 std::cout <<
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
266 Double_t fontsize = 0.07;
267 TLatex* latex =
new TLatex();
268 latex->SetTextSize(fontsize);
284 latex->SetTextSize(fontsize);
285 Double_t boxH = 0.25*fontsize;
289 latex->DrawLatex(x0, y,
"Residual:");
291 latex->DrawLatex(x0, y,
"sgn(#hat{X}#bullet#hat{#phi}) #times #frac{X_{hit} - X_{traj}}{#sqrt{#sigma^{2}_{hit} + #sigma^{2}_{traj}}}" );
293 snprintf(mytext, 255,
"layers hit: %i",
m_ndet);
294 latex->DrawLatex(x0, y, mytext);
296 snprintf(mytext, 255,
"valid Si hits: %i", nvalid);
297 latex->DrawLatex(x0, y, mytext);
299 snprintf(mytext, 255,
"total Si hits: %i", m_nhits);
300 latex->DrawLatex(x0, y, mytext);
302 snprintf(mytext, 255,
"valid Si pixel hits: %i", npix);
303 latex->DrawLatex(x0, y, mytext);
305 snprintf(mytext, 255,
"valid Si strip hits: %i", nstrip);
306 latex->DrawLatex(x0, y, mytext);
314 latex->DrawLatex(x0, y,
"X hit");
315 pos[1] =
y; pos[3] = pos[1] + boxH;
319 latex->DrawLatex(x0, y,
"Y hit");
320 pos[1] =
y; pos[3] = pos[1] + boxH;
324 latex->DrawLatex(x0, y,
"stereo hit");
325 pos[1] =
y; pos[3] = pos[1] + boxH;
329 latex->DrawLatex(x0, y,
"invalid hit");
330 pos[1] =
y; pos[3] = pos[1] + boxH;
const TrackExtraRef & extra() const
reference to "extra" object
double getSignedResidual(const FWGeometry *geom, unsigned int id, double resX)
double residualY(int i, const HitPattern &) const
const TGeoMatrix * getMatrix(unsigned int id) const
FWTrackResidualDetailView()
virtual ~FWTrackResidualDetailView()
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
double residualX(int i, const HitPattern &) const
void prepareData(const FWModelId &id, const reco::Track *)
virtual void build(const FWModelId &id, const reco::Track *)
#define REGISTER_FWDETAILVIEW(_classname_, _name_)
const TrackResiduals & residuals() const
static const char * m_det_tracker_str[]
uint32_t getHitPattern(int position) const
static void drawCanvasBox(Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)
virtual void setTextInfo(const FWModelId &id, const reco::Track *)