CMS 3D CMS Logo

TrackerMap.h
Go to the documentation of this file.
1 #ifndef _TrackerMap_h_
2 #define _TrackerMap_h_
3 #include <utility>
4 #include <string>
5 #include <iostream>
6 #include <fstream>
7 #include <sstream>
8 #include <cmath>
9 #include <map>
13 #include "TColor.h"
14 #include <cassert>
15 #include <vector>
16 #include "TPolyLine.h"
17 
18 class TH1F;
19 class TLegend;
20 /*
21 #define NUMFEDCH_INCOLUMN 12
22 #define NUMFEDCH_INROW 8
23 #define NUMFED_INCOLUMN 6
24 #define NUMFED_INROW 4
25 #define NUMFEDCRATE_INCOLUMN 3
26 #define XFEDCSIZE 340
27 #define YFEDCSIZE 400
28 */
29 
30 /*
31 #define NUMFEDCH_INCOLUMN 12
32 #define NUMFEDCH_INROW 8
33 #define NUMFED_INCOLUMN 1
34 #define NUMFED_INROW 21
35 //#define NUMFEDCRATE_INCOLUMN 11
36 //#define NUMFEDCRATE_INROW 3
37 #define NUMFEDCRATE_INCOLUMN 16
38 #define NUMFEDCRATE_INROW 2
39 //#define XFEDCSIZE 160 // 14 boxes
40 //#define YFEDCSIZE 2100 // 9*21 boxes
41 #define XFEDCSIZE 140 // 14 boxes
42 #define YFEDCSIZE 1890 // 9*21 boxes
43 */
44 
45 #define NUMPSUCH_INROW 18
46 #define NUMPSUCRATE_INCOLUMN 5
47 #define NUMPSURACK_INCOLUMN 6
48 #define NUMPSURACK_INROW 5
49 #define XPSURSIZE 150 // (5)*1.5 boxes
50 #define YPSURSIZE 360 // 18 boxes
51 #define XPSUOFFSET 50
52 #define YPSUOFFSET 100
53 
54 #define NUMFEDCH_INCOLUMN 12
55 #define NUMFEDCH_INROW 8
56 #define NUMFED_INCOLUMN 21
57 #define NUMFED_INROW 1
58 //#define NUMFEDCRATE_INCOLUMN 11
59 //#define NUMFEDCRATE_INROW 3
60 #define NUMFEDCRATE_INCOLUMN 1
61 #define NUMFEDCRATE_INROW 31
62 //#define XFEDCSIZE 160 // 14 boxes
63 //#define YFEDCSIZE 2100 // 9*21 boxes
64 #define XFEDCSIZE 2940 // 14*21 boxes
65 #define YFEDCSIZE 90 // 9 boxes
66 #define XFEDOFFSET 150
67 #define YFEDOFFSET 100
68 
69 class TmModule;
70 class TmApvPair;
71 class EventSetup;
72 class TmCcu;
73 class TmPsu;
74 class TrackerTopology;
75 
76 class TrackerMap {
77 public:
78  //TrackerMap(){TrackerMap(" ");}; //!< default constructor
79  TrackerMap(std::string s = " ", int xsize1 = 340, int ysize1 = 200);
80  TrackerMap(const edm::ParameterSet& iConfig);
81  TrackerMap(const edm::ParameterSet& iConfig, const SiStripFedCabling* tkFed, const TrackerTopology* const topology);
82  ~TrackerMap();
83 
84  void build();
85  void init();
86  void drawModule(TmModule* mod, int key, int layer, bool total, std::ofstream* file);
87  void print(bool print_total = true, float minval = 0., float maxval = 0., std::string s = "svgmap");
88  void printall(bool print_total = true,
89  float minval = 0.,
90  float maxval = 0.,
91  std::string s = "svgmap",
92  int width = 6000,
93  int height = 3200);
94  void printonline();
95  void printlayers(bool print_total = true, float minval = 0., float maxval = 0., std::string s = "layer");
96  void save(bool print_total = true,
97  float minval = 0.,
98  float maxval = 0.,
99  std::string s = "svgmap.svg",
100  int width = 1500,
101  int height = 800);
102  void save_as_fedtrackermap(bool print_total = true,
103  float minval = 0.,
104  float maxval = 0.,
105  std::string s = "fed_svgmap.svg",
107  int height = XFEDOFFSET + (XFEDCSIZE + XFEDOFFSET) * NUMFEDCRATE_INCOLUMN + 300);
108  void save_as_fectrackermap(bool print_total = true,
109  float minval = 0.,
110  float maxval = 0.,
111  std::string s = "fec_svgmap.svg",
112  int width = 1500,
113  int height = 800);
114  void save_as_psutrackermap(bool print_total = true,
115  float minval = 0.,
116  float maxval = 0.,
117  std::string s = "psu_svgmap.svg",
119  int height = XPSUOFFSET + (XPSURSIZE + XPSUOFFSET) * NUMPSURACK_INCOLUMN + 300);
120  void save_as_HVtrackermap(bool print_total = true,
121  float minval = 0.,
122  float maxval = 0.,
123  std::string s = "psu_svgmap.svg",
124  int width = 1500,
125  int height = 800);
126  void drawApvPair(
127  int crate, int numfed_incrate, bool total, TmApvPair* apvPair, std::ofstream* file, bool useApvPairValue);
128  void drawCcu(int crate, int numfed_incrate, bool total, TmCcu* ccu, std::ofstream* file, bool useCcuValue);
129  void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu* psu, std::ofstream* svgfile, bool usePsuValue);
130  void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu* psu, std::ofstream* svgfile, bool usePsuValue);
131  void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu* psu, std::ofstream* svgfile, bool usePsuValue);
132  void fill_current_val(int idmod, float current_val);
133  void fill(int layer, int ring, int nmod, float x);
134  void fill(int idmod, float qty);
135  void fillc(int idmod, int RGBcode) { fillc(idmod, (RGBcode >> 16) & 0xFF, (RGBcode >> 8) & 0xFF, RGBcode & 0xFF); }
136  void fillc(int idmod, int red, int green, int blue);
137  void fillc(int layer, int ring, int nmod, int red, int green, int blue);
138  void fillc_all_blank();
139  void fill_all_blank();
140  void fill_current_val_fed_channel(int fedId, int fedCh, float current_val);
141  void fill_fed_channel(int fedId, int fedCh, float qty);
142  void fill_fed_channel(int modId, float qty);
143  void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue);
144  void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue);
145  void fill_fec_channel(int crate, int slot, int ring, int addr, float qty);
146  void fill_lv_channel(int rack, int crate, int board, float qty);
147  void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue);
148  void fill_hv_channel2(int rack, int crate, int board, float qty);
149  void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue);
150  void fill_hv_channel3(int rack, int crate, int board, float qty);
151  void fillc_hv_channel3(int rack, int crate, int board, int red, int green, int blue);
152  int module(int fedId, int fedCh);
153  void setText(int idmod, std::string s);
154  void setText(int layer, int ring, int nmod, std::string s);
155  void setPalette(int numpalette) { palette = numpalette; }
156  void drawPalette(std::ofstream* file, int xoffset = 3660, int yoffset = 1540);
157  void showPalette(bool printflag1) { printflag = printflag1; };
158  void setTitle(std::string s) { title = s; };
159  void setRange(float min, float max);
160  std::pair<float, float> getAutomaticRange();
161  void addPixel(bool addPixelfl) { addPixelFlag = addPixelfl; };
162  void onlyPixel(bool onlyPixelfl) { onlyPixelFlag = onlyPixelfl; };
163  void reset();
164  void load(std::string s = "tmap.svg");
165  int getxsize() { return xsize; };
166  int getysize() { return ysize; };
167  int getcolor(float value, int palette);
168  std::ifstream* findfile(std::string filename);
169  int getNumMod() { return number_modules; };
170  std::vector<TColor*> vc;
171  typedef std::map<const int, TmModule*> SmoduleMap;
173  typedef std::map<const int, TmModule*> ImoduleMap;
175  typedef std::map<const int, TmApvPair*> SvgApvPair;
177  typedef std::multimap<const int, TmApvPair*> ModApvPair;
179  typedef std::map<const int, int> SvgFed;
182  typedef std::map<const int, TmCcu*> MapCcu;
184  typedef std::multimap<TmCcu*, TmModule*> FecModule;
186  typedef std::map<const int, TmPsu*> MapPsu;
188  typedef std::multimap<TmPsu*, TmModule*> PsuModule;
190  int palette;
191  bool printflag;
198  bool tkMapLog;
199  int ndet; //number of detectors
200  int npart; //number of detectors parts
205  double phival(double x, double y) {
206  double phi;
207  double phi1 = atan(y / x);
208  phi = phi1;
209  if (y < 0. && x > 0)
210  phi = phi1 + 2. * M_PI;
211  if (x < 0.)
212  phi = phi1 + M_PI;
213  if (fabs(y) < 0.000001 && x > 0)
214  phi = 0;
215  if (fabs(y) < 0.000001 && x < 0)
216  phi = M_PI;
217  if (fabs(x) < 0.000001 && y > 0)
218  phi = M_PI / 2.;
219  if (fabs(x) < 0.000001 && y < 0)
220  phi = 3. * M_PI / 2.;
221 
222  return phi;
223  }
224 
225  int find_layer(int ix, int iy) {
226  int add;
227  int layer = 0;
228  if (iy <= xsize) { //endcap+z
229  add = 15;
230  layer = ix / ysize;
231  layer = layer + add + 1;
232  }
233  if (iy > xsize && iy < 3 * xsize) { //barrel
234  add = 30;
235  if (ix < 2 * ysize) {
236  layer = 1;
237  } else {
238  layer = ix / (2 * ysize);
239  if (iy < 2 * xsize)
240  layer = layer * 2 + 1;
241  else
242  layer = layer * 2;
243  }
244  layer = layer + add;
245  }
246  if (iy >= 3 * xsize) { //endcap-z
247  layer = ix / ysize;
248  layer = 15 - layer;
249  }
250  return layer;
251  }
252 
253  int getlayerCount(int subdet, int partdet) {
254  int ncomponent = 0;
255  if (subdet == 1) { //1=pixel
256  if (partdet == 1 || partdet == 3) { //1-3=encap
257  ncomponent = 3;
258  } else {
259  ncomponent = 3;
260  } //barrel
261  }
262  if (subdet == 2) { //2=inner silicon
263  if (partdet == 1 || partdet == 3) { //1-3=encap
264  ncomponent = 3;
265  } else {
266  ncomponent = 4;
267  } //barrel
268  }
269  if (subdet == 3) { //3=outer silicon
270  if (partdet == 1 || partdet == 3) { //1-3=encap
271  ncomponent = 9;
272  } else {
273  ncomponent = 6;
274  } //barrel
275  }
276  return (ncomponent);
277  }
278  double xdpixel(double x) {
279  double res;
280  if (saveAsSingleLayer)
281  res = ((x - xmin) / (xmax - xmin) * xsize);
282  else
283  res = ((x - xmin) / (xmax - xmin) * xsize) + ix;
284  return res;
285  }
286  double ydpixel(double y) {
287  double res = 0;
288  double y1;
289  y1 = (y - ymin) / (ymax - ymin);
290  if (nlay > 30) {
291  if (nlay < 34)
292  res = 2 * ysize - (y1 * 2 * ysize);
293  if (nlay == 34)
294  res = 2.4 * ysize - (y1 * 2.4 * ysize);
295  if (nlay > 34)
296  res = 2.5 * ysize - (y1 * 2.5 * ysize);
297  } else
298  res = xsize - (y1 * xsize);
299  if (!saveAsSingleLayer)
300  res = res + iy;
301  return res;
302  }
303  double xdpixelc(double x) {
304  double res;
305  if (saveAsSingleLayer)
306  res = ((x - xmin) / (xmax - xmin) * XFEDCSIZE);
307  else
308  res = ((x - xmin) / (xmax - xmin) * XFEDCSIZE) + ix;
309  return res;
310  }
311  double ydpixelc(double y) {
312  double res;
313  double y1;
314  y1 = (y - ymin) / (ymax - ymin);
315  if (saveAsSingleLayer)
316  res = YFEDCSIZE - (y1 * YFEDCSIZE);
317  else
318  res = YFEDCSIZE - (y1 * YFEDCSIZE) + iy;
319  return res;
320  }
321  double xdpixelfec(double x) {
322  double res;
323  if (saveAsSingleLayer)
324  res = ((x - xmin) / (xmax - xmin) * xsize);
325  else
326  res = ((x - xmin) / (xmax - xmin) * xsize) + ix;
327  return res;
328  }
329  double ydpixelfec(double y) {
330  double res;
331  double y1;
332  y1 = (y - ymin) / (ymax - ymin);
333  if (saveAsSingleLayer)
334  res = 2 * ysize - (y1 * 2 * ysize);
335  else
336  res = 2 * ysize - (y1 * 2 * ysize) + iy;
337  return res;
338  }
339  double xdpixelpsu(double x) {
340  double res;
341  if (saveAsSingleLayer)
342  res = ((x - xmin) / (xmax - xmin) * XPSURSIZE);
343  else
344  res = ((x - xmin) / (xmax - xmin) * XPSURSIZE) + ix;
345  return res;
346  }
347  double ydpixelpsu(double y) {
348  double res;
349  double y1;
350  y1 = (y - ymin) / (ymax - ymin);
351  if (saveAsSingleLayer)
352  res = YPSURSIZE - (y1 * YPSURSIZE);
353  else
354  res = YPSURSIZE - (y1 * YPSURSIZE) + iy;
355  return res;
356  }
357 
358  void defcwindow(int num_crate) {
359  // ncrate = num_crate;
360  int xoffset = XFEDOFFSET;
361  int yoffset = YFEDOFFSET;
362  xmin = 0.;
364  ymin = 0.;
365  ymax = (NUMFEDCH_INROW + 1) * NUMFED_INROW;
366 
367  ix = xoffset + ((NUMFEDCRATE_INCOLUMN - 1) - ((num_crate - 1) % NUMFEDCRATE_INCOLUMN)) * (XFEDCSIZE + XFEDOFFSET);
368  iy = yoffset + ((num_crate - 1) / NUMFEDCRATE_INCOLUMN) * (YFEDCSIZE + YFEDOFFSET);
369  }
370  void deffecwindow(int num_crate) {
371  // ncrate = num_crate;
372  int xoffset = xsize / 3;
373  int yoffset = 2 * ysize;
374  xmin = -1.;
375  xmax = 37.;
376  ymin = -10.;
377  ymax = 40.;
378  if (num_crate == 1 || num_crate == 3)
379  ix = xoffset + xsize * 2;
380  if (num_crate == 2 || num_crate == 4)
381  ix = xoffset;
382  iy = yoffset + ((num_crate - 1) / 2) * ysize * 4;
383  }
384  void defpsuwindow(int num_rack) {
385  // nrack = num_rack;
386  int xoffset = XPSUOFFSET;
387  int yoffset = YPSUOFFSET;
388  xmin = 0;
389  xmax = (NUMPSUCRATE_INCOLUMN)*1.5;
390  ymin = 0;
392 
393  ix = xoffset + ((NUMPSURACK_INCOLUMN - 1) - ((num_rack - 1) % NUMPSURACK_INCOLUMN)) * (XPSURSIZE + XPSUOFFSET);
394  iy = yoffset + ((num_rack - 1) / NUMPSURACK_INCOLUMN) * (YPSURSIZE + YPSUOFFSET);
395  }
396 
397  void defwindow(int num_lay) {
398  // nlay = num_lay;
399  if (posrel) { // separated modules
400  xmin = -2.;
401  ymin = -2.;
402  xmax = 2.;
403  ymax = 2.;
404  if (num_lay > 12 && num_lay < 19) {
405  xmin = -.40;
406  xmax = .40;
407  ymin = -.40;
408  ymax = .40;
409  }
410  if (num_lay > 30) {
411  xmin = -0.1;
412  xmax = 3.;
413  ymin = -0.1;
414  ymax = 8.5;
415  if (num_lay < 34) {
416  xmin = -0.3;
417  xmax = 1.0;
418  }
419  if (num_lay > 33 && num_lay < 38) {
420  xmax = 2.0;
421  }
422  if (num_lay > 37) {
423  ymax = 8.;
424  } //inner
425  }
426  } else { //overlayed modules
427  xmin = -1.3;
428  ymin = -1.3;
429  xmax = 1.3;
430  ymax = 1.3;
431  if (num_lay > 12 && num_lay < 19) {
432  xmin = -.20;
433  xmax = .20;
434  ymin = -.20;
435  ymax = .20;
436  }
437  if (num_lay > 30) {
438  xmin = -1.5;
439  xmax = 1.5;
440  ymin = -1.;
441  ymax = 28.;
442  if (num_lay < 34) {
443  xmin = -0.5;
444  xmax = 0.5;
445  }
446  if (num_lay > 33 && num_lay < 38) {
447  xmin = -1.;
448  xmax = 1.;
449  }
450  }
451  }
452  if (num_lay < 16) {
453  ix = 0;
454  if (num_lay == 15 || num_lay == 14)
455  iy = (15 - num_lay) * 2 * ysize;
456  else {
457  if (num_lay > 9 && num_lay < 13)
458  iy = 4 * ysize - (int)(ysize / 2.) + (12 - num_lay) * (int)(ysize / 1.50);
459  else
460  iy = 6 * ysize + (9 - num_lay) * (int)(ysize * 1.3);
461  }
462  }
463  if (num_lay > 15 && num_lay < 31) {
464  ix = 3 * xsize;
465  if (num_lay == 16 || num_lay == 17)
466  iy = (num_lay - 16) * 2 * ysize;
467  else {
468  if (num_lay > 18 && num_lay < 22)
469  iy = 4 * ysize - (int)(ysize / 2.) + (num_lay - 19) * (int)(ysize / 1.50);
470  else
471  iy = 6 * ysize + (num_lay - 22) * (int)(ysize * 1.3);
472  }
473  }
474  if (num_lay > 30) {
475  if (num_lay == 31) {
476  ix = (int)(1.5 * xsize);
477  iy = 0;
478  }
479  if (num_lay == 32) {
480  int il = (num_lay - 30) / 2;
481  ix = xsize;
482  iy = il * 2 * ysize;
483  }
484  if (num_lay == 33) {
485  int il = (num_lay - 30) / 2;
486  ix = 2 * xsize;
487  iy = il * 2 * ysize;
488  }
489  if (num_lay == 34) {
490  int il = (num_lay - 30) / 2;
491  ix = xsize;
492  iy = il * (int)(2.57 * ysize);
493  }
494  if (num_lay > 34 && num_lay % 2 == 0) {
495  int il = (num_lay - 30) / 2;
496  ix = xsize;
497  iy = il * (int)(2.5 * ysize);
498  }
499  if (num_lay > 34 && num_lay % 2 != 0) {
500  int il = (num_lay - 30) / 2;
501  ix = 2 * xsize;
502  iy = il * (int)(2.5 * ysize);
503  }
504  }
505  }
506 
507  int getringCount(int subdet, int partdet, int layer) {
508  int ncomponent = 0;
509  if (subdet == 1) { //1=pixel
510  if (partdet == 1 || partdet == 3) { //end-cap
511  ncomponent = 7;
512  } else {
513  ncomponent = 8;
514  } //barrel
515  }
516  if (subdet == 2) { //inner-silicon
517  if (partdet == 1 || partdet == 3) { //end-cap
518  ncomponent = 3;
519  } else {
520  ncomponent = 12;
521  } //barrel
522  }
523  if (subdet == 3) { //outer-silicon
524  if (partdet == 1) { //end-cap-z
525  if (layer == 1)
526  ncomponent = 4;
527  if (layer == 2 || layer == 3)
528  ncomponent = 5;
529  if (layer == 4 || layer == 5 || layer == 6)
530  ncomponent = 6;
531  if (layer == 7 || layer == 8 || layer == 9)
532  ncomponent = 7;
533  }
534  if (partdet == 3) { //endcap+z
535  if (layer == 9)
536  ncomponent = 4;
537  if (layer == 8 || layer == 7)
538  ncomponent = 5;
539  if (layer == 6 || layer == 5 || layer == 4)
540  ncomponent = 6;
541  if (layer == 3 || layer == 2 || layer == 1)
542  ncomponent = 7;
543  }
544  if (partdet == 2) { //barrel
545  ncomponent = 12;
546  }
547  }
548  return (ncomponent);
549  }
550  int getmoduleCount(int subdet, int partdet, int layer, int ring) {
551  int ncomponent = 0;
552  int spicchif[] = {24, 24, 40, 56, 40, 56, 80};
553  int spicchib[] = {20, 32, 44, 30, 38, 46, 56, 42, 48, 54, 60, 66, 74};
554  int numero_layer = 0;
555 
556  if (partdet == 2) { //barrel
557  numero_layer = layer - 1;
558  if (subdet == 2) { //inner
559  numero_layer = numero_layer + 3;
560  }
561  if (subdet == 3) { //outer
562  numero_layer = numero_layer + 7;
563  }
564  ncomponent = spicchib[numero_layer];
565  }
566  if (partdet != 2) { //endcap
567  if (subdet == 1)
568  ncomponent = 24; //pixel
569  else
570  ncomponent = spicchif[ring - 1];
571  }
572  return (ncomponent);
573  }
574  static int layerno(int subdet, int leftright, int layer) {
575  if (subdet == 6 && leftright == 1)
576  return (10 - layer);
577  if (subdet == 6 && leftright == 2)
578  return (layer + 21);
579  if (subdet == 4 && leftright == 1)
580  return (4 - layer + 9);
581  if (subdet == 4 && leftright == 2)
582  return (layer + 18);
583  if (subdet == 2 && leftright == 1)
584  return (4 - layer + 12);
585  if (subdet == 2 && leftright == 2)
586  return (layer + 15);
587  if (subdet == 1)
588  return (layer + 30);
589  if (subdet == 3)
590  return (layer + 33);
591  if (subdet == 5)
592  return (layer + 37);
593  assert(false);
594  }
595 
596  static bool isRingStereo(int key) {
597  int layer = key / 100000;
598  int ring = key - layer * 100000;
599  ring = ring / 1000;
600  if (layer == 34 || layer == 35 || layer == 38 || layer == 39)
601  return true;
602  if (layer < 13 || (layer > 18 && layer < 31))
603  if (ring == 1 || ring == 2 || ring == 5)
604  return true;
605  return false;
606  }
607  int nlayer(int det, int part, int lay) {
608  if (det == 3 && part == 1)
609  return lay;
610  if (det == 2 && part == 1)
611  return lay + 9;
612  if (det == 1 && part == 1)
613  return lay + 12;
614  if (det == 1 && part == 3)
615  return lay + 15;
616  if (det == 2 && part == 3)
617  return lay + 18;
618  if (det == 3 && part == 3)
619  return lay + 21;
620  if (det == 1 && part == 2)
621  return lay + 30;
622  if (det == 2 && part == 2)
623  return lay + 33;
624  if (det == 3 && part == 2)
625  return lay + 37;
626  return -1;
627  }
628 
630  std::string s = " ";
631  std::ostringstream ons;
632 
633  if (layer < 10)
634  ons << "TEC -z Layer " << layer;
635  if (layer < 13 && layer > 9)
636  ons << "TID -z Layer " << layer - 9;
637  if (layer < 16 && layer > 12)
638  ons << "FPIX -z Layer " << layer - 12;
639  if (layer < 19 && layer > 15)
640  ons << "FPIX +z Layer " << layer - 15;
641  if (layer < 22 && layer > 18)
642  ons << "TID +z Layer " << layer - 18;
643  if (layer < 31 && layer > 21)
644  ons << "TEC +z Layer " << layer - 21;
645  if (layer < 34 && layer > 30)
646  ons << "TPB Layer " << layer - 30;
647  if (layer < 38 && layer > 33)
648  ons << "TIB Layer " << layer - 33;
649  if (layer > 37)
650  ons << "TOB Layer " << layer - 37;
651  s = ons.str();
652  return s;
653  }
654  int ntotRing[43];
655  int firstRing[43];
656 
657 protected:
658  int nlay;
659  // int ncrate;
660  // int nrack;
661  int ncrates;
665  double xmin, xmax, ymin, ymax;
666  int xsize, ysize, ix, iy;
667  bool posrel;
668  bool firstcall;
669  std::ofstream* svgfile;
670  std::ofstream* savefile;
671  std::ifstream* jsfile;
672  std::ifstream* inputfile;
673  std::ifstream* ccufile;
678 
679 private:
680  float oldz;
684  TLegend* buildLegend();
685  std::vector<TPolyLine*> legInfos_;
686  std::vector<std::string> legKeys_;
687 };
688 #endif
std::vector< TPolyLine * > legInfos_
Definition: TrackerMap.h:685
void reset()
Definition: TrackerMap.cc:462
bool tkMapLog
Definition: TrackerMap.h:198
void fill_hv_channel2(int rack, int crate, int board, float qty)
Definition: TrackerMap.cc:3179
#define NUMFEDCRATE_INCOLUMN
Definition: TrackerMap.h:60
void build()
Definition: TrackerMap.cc:3316
float minvalue
Definition: TrackerMap.h:675
TrackerMap(std::string s=" ", int xsize1=340, int ysize1=200)
Definition: TrackerMap.cc:443
ModApvPair apvModuleMap
Definition: TrackerMap.h:178
double ydpixelc(double y)
Definition: TrackerMap.h:311
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:4145
int nfeccrates
Definition: TrackerMap.h:663
void fillc_all_blank()
Definition: TrackerMap.cc:3245
#define NUMPSURACK_INCOLUMN
Definition: TrackerMap.h:47
double ydpixelfec(double y)
Definition: TrackerMap.h:329
std::string layername(int layer)
Definition: TrackerMap.h:629
int getmoduleCount(int subdet, int partdet, int layer, int ring)
Definition: TrackerMap.h:550
MapCcu ccuMap
Definition: TrackerMap.h:183
void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue)
Definition: TrackerMap.cc:3152
SmoduleMap smoduleMap
Definition: TrackerMap.h:172
std::ifstream * inputfile
Definition: TrackerMap.h:672
std::ofstream * savefile
Definition: TrackerMap.h:670
int getxsize()
Definition: TrackerMap.h:165
bool psetAvailable
Definition: TrackerMap.h:204
void addPixel(bool addPixelfl)
Definition: TrackerMap.h:161
#define YFEDOFFSET
Definition: TrackerMap.h:67
~TrackerMap()
default destructor
Definition: TrackerMap.cc:528
std::map< const int, TmModule * > ImoduleMap
Definition: TrackerMap.h:173
bool saveGeoTrackerMap
Definition: TrackerMap.h:193
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3202
bool enableFecProcessing
Definition: TrackerMap.h:195
double xmin
Definition: TrackerMap.h:665
std::map< const int, int > SvgFed
Definition: TrackerMap.h:179
#define XPSURSIZE
Definition: TrackerMap.h:49
void defwindow(int num_lay)
Definition: TrackerMap.h:397
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:54
void save_as_HVtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1977
std::map< const int, TmApvPair * > SvgApvPair
Definition: TrackerMap.h:175
double xdpixelc(double x)
Definition: TrackerMap.h:303
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:384
bool addPixelFlag
Definition: TrackerMap.h:682
int number_modules
Definition: TrackerMap.h:676
bool saveWebInterface
Definition: TrackerMap.h:192
std::string infilename
Definition: TrackerMap.h:202
int getlayerCount(int subdet, int partdet)
Definition: TrackerMap.h:253
int npsuracks
Definition: TrackerMap.h:664
void fill_current_val_fed_channel(int fedId, int fedCh, float current_val)
Definition: TrackerMap.cc:3088
#define YFEDCSIZE
Definition: TrackerMap.h:65
bool enableFedProcessing
Definition: TrackerMap.h:194
ImoduleMap imoduleMap
Definition: TrackerMap.h:174
int firstRing[43]
Definition: TrackerMap.h:655
int getNumMod()
Definition: TrackerMap.h:169
float gminvalue
Definition: TrackerMap.h:674
#define NUMFEDCRATE_INROW
Definition: TrackerMap.h:61
std::map< const int, TmModule * > SmoduleMap
Definition: TrackerMap.h:171
assert(be >=bs)
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
Definition: TrackerMap.cc:3100
void setTitle(std::string s)
Definition: TrackerMap.h:158
Definition: Electron.h:6
std::string jsPath
Definition: TrackerMap.h:203
bool enableHVProcessing
Definition: TrackerMap.h:197
double xdpixelfec(double x)
Definition: TrackerMap.h:321
bool posrel
Definition: TrackerMap.h:667
std::multimap< TmPsu *, TmModule * > PsuModule
Definition: TrackerMap.h:188
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
int getysize()
Definition: TrackerMap.h:166
double phival(double x, double y)
Definition: TrackerMap.h:205
void fill_all_blank()
Definition: TrackerMap.cc:3252
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
Definition: TrackerMap.cc:3126
std::multimap< TmCcu *, TmModule * > FecModule
Definition: TrackerMap.h:184
std::vector< std::string > legKeys_
Definition: TrackerMap.h:686
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=100+(360+100) *5+300, int height=50+(150+50) *6+300)
Definition: TrackerMap.cc:2298
void showPalette(bool printflag1)
Definition: TrackerMap.h:157
int getringCount(int subdet, int partdet, int layer)
Definition: TrackerMap.h:507
std::map< const int, TmCcu * > MapCcu
Definition: TrackerMap.h:182
double xdpixelpsu(double x)
Definition: TrackerMap.h:339
double ymax
Definition: TrackerMap.h:665
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1589
std::ifstream * ccufile
Definition: TrackerMap.h:673
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=100+(90+100) *31+300, int height=150+(2940+150) *1+300)
Definition: TrackerMap.cc:2604
void setPalette(int numpalette)
Definition: TrackerMap.h:155
#define NUMFED_INCOLUMN
Definition: TrackerMap.h:56
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:811
bool saveAsSingleLayer
Definition: TrackerMap.h:681
void deffecwindow(int num_crate)
Definition: TrackerMap.h:370
bool temporary_file
Definition: TrackerMap.h:677
bool onlyPixelFlag
Definition: TrackerMap.h:683
std::ofstream * svgfile
Definition: TrackerMap.h:669
void load(std::string s="tmap.svg")
Definition: TrackerMap.cc:2909
#define XFEDCSIZE
Definition: TrackerMap.h:64
double xmax
Definition: TrackerMap.h:665
Definition: value.py:1
std::map< const int, TmPsu * > MapPsu
Definition: TrackerMap.h:186
double ydpixel(double y)
Definition: TrackerMap.h:286
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:569
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
Definition: TrackerMap.cc:1116
void init()
Definition: TrackerMap.cc:472
void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue)
Definition: TrackerMap.cc:3062
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3361
double ymin
Definition: TrackerMap.h:665
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:135
#define M_PI
static int layerno(int subdet, int leftright, int layer)
Definition: TrackerMap.h:574
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
Definition: TrackerMap.cc:4163
SvgFed slotMap
Definition: TrackerMap.h:181
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1488
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
Definition: TrackerMap.cc:1274
SvgFed fedMap
Definition: TrackerMap.h:180
PsuModule psuModuleMap
Definition: TrackerMap.h:189
#define YPSUOFFSET
Definition: TrackerMap.h:52
part
Definition: HCALResponse.h:20
void fill_hv_channel3(int rack, int crate, int board, float qty)
Definition: TrackerMap.cc:3190
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:46
bool printflag
Definition: TrackerMap.h:191
int firstcrate
Definition: TrackerMap.h:662
TLegend * buildLegend()
Definition: TrackerMap.cc:4301
FecModule fecModuleMap
Definition: TrackerMap.h:185
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void setRange(float min, float max)
Definition: TrackerMap.cc:774
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:3014
#define YPSURSIZE
Definition: TrackerMap.h:50
std::string title
Definition: TrackerMap.h:201
double xdpixel(double x)
Definition: TrackerMap.h:278
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
void printonline()
Definition: TrackerMap.cc:3408
int nlayer(int det, int part, int lay)
Definition: TrackerMap.h:607
#define NUMFED_INROW
Definition: TrackerMap.h:57
int find_layer(int ix, int iy)
Definition: TrackerMap.h:225
SvgApvPair apvMap
Definition: TrackerMap.h:176
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
Definition: TrackerMap.cc:2943
void fill_fec_channel(int crate, int slot, int ring, int addr, float qty)
Definition: TrackerMap.cc:3114
float gmaxvalue
Definition: TrackerMap.h:674
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:3259
float maxvalue
Definition: TrackerMap.h:675
void setText(int idmod, std::string s)
Definition: TrackerMap.cc:3299
#define XFEDOFFSET
Definition: TrackerMap.h:66
bool enableLVProcessing
Definition: TrackerMap.h:196
#define NUMPSURACK_INROW
Definition: TrackerMap.h:48
bool firstcall
Definition: TrackerMap.h:668
MapPsu psuMap
Definition: TrackerMap.h:187
static bool isRingStereo(int key)
Definition: TrackerMap.h:596
Definition: TmCcu.h:4
float oldz
Definition: TrackerMap.h:680
void defcwindow(int num_crate)
Definition: TrackerMap.h:358
std::ifstream * jsfile
Definition: TrackerMap.h:671
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: TmPsu.h:6
#define XPSUOFFSET
Definition: TrackerMap.h:51
void fill_lv_channel(int rack, int crate, int board, float qty)
Definition: TrackerMap.cc:3140
std::vector< TColor * > vc
Definition: TrackerMap.h:169
#define NUMPSUCH_INROW
Definition: TrackerMap.h:45
void onlyPixel(bool onlyPixelfl)
Definition: TrackerMap.h:162
std::multimap< const int, TmApvPair * > ModApvPair
Definition: TrackerMap.h:177
void printall(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap", int width=6000, int height=3200)
Definition: TrackerMap.cc:3753
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1377
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:3289
double ydpixelpsu(double y)
Definition: TrackerMap.h:347
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1689
void fill_fed_channel(int fedId, int fedCh, float qty)
Definition: TrackerMap.cc:3211
#define NUMFEDCH_INROW
Definition: TrackerMap.h:55
void fillc_hv_channel3(int rack, int crate, int board, int red, int green, int blue)
Definition: TrackerMap.cc:3165
int ntotRing[43]
Definition: TrackerMap.h:654
std::pair< float, float > getAutomaticRange()
Definition: TrackerMap.cc:783
std::string jsfilename
Definition: TrackerMap.h:202