CMS 3D CMS Logo

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