8 #include "TEveWindow.h"
41 memset(
res, 0,
sizeof(
res));
67 hittype[
i] = HitPattern::getHitType(pattern);
68 stereo[
i] = HitPattern::getSide(pattern);
70 substruct[
i] = HitPattern::getSubStructure(pattern);
71 m_detector[
i] = HitPattern::getSubDetector(pattern);
84 for(
int j=0;
j < m_nhits-1;) {
88 if(k==(m_nhits-1))
j=
k;
109 TLatex* latex =
new TLatex();
110 latex->SetTextSize(0.1);
111 latex->DrawLatex(0.1, 0.5,
"No track extra information");
119 TH2F* h_res =
new TH2F(
"h_resx",
"h_resx",10,-5.5,5.5,
m_ndet,0,
m_ndet);
120 TPad* padX =
new TPad(
"pad1",
"pad1", 0.2, 0., 0.8, 0.99);
121 padX->SetBorderMode(0);
122 padX->SetLeftMargin(0.2);
125 padX->SetFrameLineWidth(0);
127 h_res->SetDirectory(0);
128 h_res->SetStats(kFALSE);
130 h_res->SetXTitle(
"residual");
131 h_res->GetXaxis()->SetTickLength(0);
132 h_res->GetYaxis()->SetTickLength(0);
133 h_res->GetXaxis()->SetNdivisions(20);
134 h_res->GetYaxis()->SetLabelSize(0.06);
138 float larray[9]={0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5};
140 for(
int l=0;
l<8;
l++) {
141 float diff2=(larray[
l+1]-larray[
l])/2;
142 larray2[
l]=larray[
l]+diff2;
148 for(
int k=0;
k<8;
k++) {
149 if(fabs(
res[0][
l])==larray2[
k])
151 if(fabs(
res[1][l])==larray2[
k])
157 for(
int l=0;
l<17;
l++) {
160 sign = (
l>8) ? -1 : 1;
161 lines[
l] =
new TLine(sign*larray[ix],0,sign*larray[ix],
m_ndet);
163 lines[
l]->SetLineStyle(3);
174 for(
int h=0;
h<2;
h++) {
183 h_res->GetYaxis()->SetBinLabel(j+1, det_str2);
189 for(
int l=m_det[j];
l<(m_det[
j]+
diff);
l++) {
193 box[0] = (
hittype[
l]==0) ? sign*larray[resi[
h][
l]] : -5.5;
194 box[2] = (
hittype[
l]==0) ? sign*larray[resi[
h][
l]+1] : 5.5;
195 box[1] = height1+width*
k;
196 box[3] = height1+width*(k+1);
219 const char* res_str=
"residuals in Si detector local x-y coord.";
220 TPaveText *
pt =
new TPaveText(0.0,0.91, 1,0.99,
"blNDC");
221 pt->SetBorderSize(0);
222 pt->SetFillColor(kWhite);
223 pt->AddText(res_str);
235 double local1[3] = { 0, 0, 0 };
236 double local2[3] = { resX, 0, 0 };
237 double global1[3], global2[3];
240 m->LocalToMaster(local1, global1);
241 m->LocalToMaster(local2, global2);
242 TVector3
g1 = global1;
243 TVector3
g2 = global2;
244 if (g2.DeltaPhi(g1) > 0)
254 std::cout <<
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
268 Double_t fontsize = 0.07;
269 TLatex* latex =
new TLatex();
270 latex->SetTextSize(fontsize);
286 latex->SetTextSize(fontsize);
287 Double_t boxH = 0.25*fontsize;
291 latex->DrawLatex(x0, y,
"Residual:");
293 latex->DrawLatex(x0, y,
"sgn(#hat{X}#bullet#hat{#phi}) #times #frac{X_{hit} - X_{traj}}{#sqrt{#sigma^{2}_{hit} + #sigma^{2}_{traj}}}" );
295 snprintf(mytext, 255,
"layers hit: %i",
m_ndet);
296 latex->DrawLatex(x0, y, mytext);
298 snprintf(mytext, 255,
"valid Si hits: %i", nvalid);
299 latex->DrawLatex(x0, y, mytext);
301 snprintf(mytext, 255,
"total Si hits: %i", m_nhits);
302 latex->DrawLatex(x0, y, mytext);
304 snprintf(mytext, 255,
"valid Si pixel hits: %i", npix);
305 latex->DrawLatex(x0, y, mytext);
307 snprintf(mytext, 255,
"valid Si strip hits: %i", nstrip);
308 latex->DrawLatex(x0, y, mytext);
316 latex->DrawLatex(x0, y,
"X hit");
317 pos[1] =
y; pos[3] = pos[1] + boxH;
321 latex->DrawLatex(x0, y,
"Y hit");
322 pos[1] =
y; pos[3] = pos[1] + boxH;
326 latex->DrawLatex(x0, y,
"stereo hit");
327 pos[1] =
y; pos[3] = pos[1] + boxH;
331 latex->DrawLatex(x0, y,
"invalid hit");
332 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
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
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.
double residualX(int i, const HitPattern &) const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
void prepareData(const FWModelId &id, const reco::Track *)
virtual void build(const FWModelId &id, const reco::Track *)
const TrackResiduals & residuals() const
static const char * m_det_tracker_str[]
uint16_t getHitPattern(HitCategory category, int position) const
int numberOfHits(HitCategory category) 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 *)