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 
19 class TH1F;
20 class TLegend;
21 /*
22 #define NUMFEDCH_INCOLUMN 12
23 #define NUMFEDCH_INROW 8
24 #define NUMFED_INCOLUMN 6
25 #define NUMFED_INROW 4
26 #define NUMFEDCRATE_INCOLUMN 3
27 #define XFEDCSIZE 340
28 #define YFEDCSIZE 400
29 */
30 
31 /*
32 #define NUMFEDCH_INCOLUMN 12
33 #define NUMFEDCH_INROW 8
34 #define NUMFED_INCOLUMN 1
35 #define NUMFED_INROW 21
36 //#define NUMFEDCRATE_INCOLUMN 11
37 //#define NUMFEDCRATE_INROW 3
38 #define NUMFEDCRATE_INCOLUMN 16
39 #define NUMFEDCRATE_INROW 2
40 //#define XFEDCSIZE 160 // 14 boxes
41 //#define YFEDCSIZE 2100 // 9*21 boxes
42 #define XFEDCSIZE 140 // 14 boxes
43 #define YFEDCSIZE 1890 // 9*21 boxes
44 */
45 
46 #define NUMPSUCH_INROW 18
47 #define NUMPSUCRATE_INCOLUMN 5
48 #define NUMPSURACK_INCOLUMN 6
49 #define NUMPSURACK_INROW 5
50 #define XPSURSIZE 150 // (5)*1.5 boxes
51 #define YPSURSIZE 360 // 18 boxes
52 #define XPSUOFFSET 50
53 #define YPSUOFFSET 100
54 
55 #define NUMFEDCH_INCOLUMN 12
56 #define NUMFEDCH_INROW 8
57 #define NUMFED_INCOLUMN 21
58 #define NUMFED_INROW 1
59 //#define NUMFEDCRATE_INCOLUMN 11
60 //#define NUMFEDCRATE_INROW 3
61 #define NUMFEDCRATE_INCOLUMN 1
62 #define NUMFEDCRATE_INROW 31
63 //#define XFEDCSIZE 160 // 14 boxes
64 //#define YFEDCSIZE 2100 // 9*21 boxes
65 #define XFEDCSIZE 2940 // 14*21 boxes
66 #define YFEDCSIZE 90 // 9 boxes
67 #define XFEDOFFSET 150
68 #define YFEDOFFSET 100
69 
70 class TmModule;
71 class TmApvPair;
72 class EventSetup;
73 class TmCcu;
74 class TmPsu;
75 class TrackerTopology;
76 
77 class TrackerMap {
78  public:
79  //TrackerMap(){TrackerMap(" ");}; //!< default constructor
80  TrackerMap(std::string s=" ",int xsize1=340,int ysize1=200);
81  TrackerMap(const edm::ParameterSet & iConfig);
82  TrackerMap(const edm::ParameterSet & iConfig,const SiStripFedCabling* tkFed,const TrackerTopology* const topology);
83  ~TrackerMap();
84 
85  void build();
86  void init();
87  void drawModule(TmModule * mod, int key, int layer, bool total, std::ofstream * file);
88  void print(bool print_total=true,float minval=0., float maxval=0.,std::string s="svgmap");
89  void printall(bool print_total=true,float minval=0., float maxval=0.,std::string s="svgmap",int width=6000, int height=3200);
90  void printonline();
91  void printlayers(bool print_total=true,float minval=0., float maxval=0.,std::string s="layer");
92  void save(bool print_total=true,float minval=0., float maxval=0.,std::string s="svgmap.svg",int width=1500, int height=800);
93  void save_as_fedtrackermap(bool print_total=true,float minval=0., float maxval=0.,std::string s="fed_svgmap.svg",
96  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);
97  void save_as_psutrackermap(bool print_total=true,float minval=0., float maxval=0.,std::string s="psu_svgmap.svg",
100  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);
101  void drawApvPair( int crate, int numfed_incrate, bool total, TmApvPair* apvPair,std::ofstream * file,bool useApvPairValue);
102  void drawCcu( int crate, int numfed_incrate, bool total, TmCcu* ccu,std::ofstream * file,bool useCcuValue);
103  void drawPsu(int rack,int numcrate_inrack, bool print_total, TmPsu* psu,std::ofstream * svgfile,bool usePsuValue);
104  void drawHV2(int rack,int numcrate_inrack, bool print_total, TmPsu* psu,std::ofstream * svgfile,bool usePsuValue);
105  void drawHV3(int rack,int numcrate_inrack, bool print_total, TmPsu* psu,std::ofstream * svgfile,bool usePsuValue);
106  void fill_current_val(int idmod, float current_val );
107  void fill(int layer , int ring, int nmod, float x );
108  void fill(int idmod, float qty );
109  void fillc(int idmod, int RGBcode) {fillc(idmod,(RGBcode>>16) & 0xFF , (RGBcode>>8) & 0xFF, RGBcode & 0xFF);}
110  void fillc(int idmod, int red, int green, int blue);
111  void fillc(int layer,int ring, int nmod, int red, int green, int blue);
112  void fillc_all_blank();
113  void fill_all_blank();
114  void fill_current_val_fed_channel(int fedId,int fedCh, float current_val );
115  void fill_fed_channel(int fedId,int fedCh, float qty );
116  void fill_fed_channel(int modId, float qty );
117  void fillc_fed_channel(int fedId,int fedCh, int red, int green, int blue);
118  void fillc_fec_channel(int crate,int slot, int ring, int addr, int red, int green, int blue );
119  void fill_fec_channel(int crate,int slot, int ring, int addr, float qty );
120  void fill_lv_channel(int rack,int crate, int board, float qty );
121  void fillc_lv_channel(int rack,int crate, int board, int red, int green, int blue);
122  void fill_hv_channel2(int rack,int crate, int board, float qty );
123  void fillc_hv_channel2(int rack,int crate, int board, int red, int green, int blue);
124  void fill_hv_channel3(int rack,int crate, int board, float qty );
125  void fillc_hv_channel3(int rack,int crate, int board, int red, int green, int blue);
126  int module(int fedId,int fedCh);
127  void setText(int idmod , std::string s );
128  void setText(int layer, int ring, int nmod , std::string s );
129  void setPalette(int numpalette){palette=numpalette;}
130  void drawPalette(std::ofstream * file, int xoffset=3660, int yoffset=1540);
131  void showPalette(bool printflag1){printflag=printflag1;};
133  void setRange(float min,float max);
134  std::pair<float,float>getAutomaticRange();
135  void addPixel(bool addPixelfl){addPixelFlag=addPixelfl;};
136  void onlyPixel(bool onlyPixelfl){onlyPixelFlag=onlyPixelfl;};
137  void reset();
138  void load(std::string s="tmap.svg");
139  int getxsize(){return xsize;};
140  int getysize(){return ysize;};
141  int getcolor(float value, int palette);
142  std::ifstream * findfile(std::string filename);
143  int getNumMod(){return number_modules;};
144  std::vector<TColor*> vc;
145  typedef std::map<const int , TmModule *> SmoduleMap;
146  SmoduleMap smoduleMap;
147  typedef std::map<const int , TmModule *> ImoduleMap;
148  ImoduleMap imoduleMap;
149  typedef std::map<const int , TmApvPair*> SvgApvPair;
150  SvgApvPair apvMap;
151  typedef std::multimap<const int , TmApvPair*> ModApvPair;
152  ModApvPair apvModuleMap;
153  typedef std::map<const int , int> SvgFed;
154  SvgFed fedMap;
155  SvgFed slotMap;
156  typedef std::map<const int , TmCcu*> MapCcu;
157  MapCcu ccuMap;
158  typedef std::multimap<TmCcu* , TmModule*> FecModule;
159  FecModule fecModuleMap;
160  typedef std::map<const int , TmPsu*> MapPsu;
161  MapPsu psuMap;
162  typedef std::multimap<TmPsu* , TmModule*> PsuModule;
163  PsuModule psuModuleMap;
164  int palette;
165  bool printflag;
172  bool tkMapLog;
173  int ndet; //number of detectors
174  int npart; //number of detectors parts
179  double phival(double x, double y){
180  double phi;
181  double phi1=atan(y/x);
182  phi = phi1;
183  if(y<0. && x>0) phi = phi1+2.*M_PI;
184  if(x<0.)phi=phi1+M_PI;
185  if(fabs(y)<0.000001 && x>0)phi=0;
186  if(fabs(y)<0.000001&&x<0)phi=M_PI;
187  if(fabs(x)<0.000001&&y>0)phi=M_PI/2.;
188  if(fabs(x)<0.000001&&y<0)phi=3.*M_PI/2.;
189 
190  return phi;
191  }
192 
193  int find_layer(int ix, int iy)
194  {
195  int add;
196  int layer=0;
197  if(iy <= xsize){//endcap+z
198  add = 15;
199  layer = ix/ysize;
200  layer = layer+add+1;
201  }
202  if(iy > xsize && iy< 3*xsize){//barrel
203  add=30;
204  if(ix < 2*ysize){
205  layer=1;
206  }else {
207  layer = ix/(2*ysize);
208  if(iy < 2*xsize)layer=layer*2+1; else layer=layer*2;
209  }
210  layer = layer+add;
211  }
212  if(iy >= 3*xsize){ //endcap-z
213  layer = ix/ysize;
214  layer = 15-layer;
215  }
216  return layer;
217  }
218 
219  int getlayerCount(int subdet, int partdet){
220  int ncomponent=0;
221  if(subdet == 1){ //1=pixel
222  if(partdet == 1 || partdet == 3){ //1-3=encap
223  ncomponent = 3;
224  }
225  else { ncomponent = 3; } //barrel
226  }
227  if(subdet== 2){ //2=inner silicon
228  if(partdet == 1 || partdet == 3){ //1-3=encap
229  ncomponent = 3;
230  }
231  else { ncomponent = 4; } //barrel
232  }
233  if(subdet== 3){ //3=outer silicon
234  if(partdet == 1 || partdet == 3){ //1-3=encap
235  ncomponent = 9;
236  }
237  else { ncomponent = 6; } //barrel
238  }
239  return(ncomponent);
240  }
241  double xdpixel(double x){
242  double res;
243  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
244  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
245  return res;
246  }
247  double ydpixel(double y){
248  double res=0;
249  double y1;
250  y1 = (y-ymin)/(ymax-ymin);
251  if(nlay>30)
252  {
253  if(nlay <34) res= 2*ysize - (y1*2*ysize);
254  if(nlay==34) res= 2.4*ysize - (y1*2.4*ysize);
255  if(nlay>34) res= 2.5*ysize - (y1*2.5*ysize);
256  }
257  else res= xsize - (y1*xsize);
258  if(!saveAsSingleLayer) res=res+iy;
259  return res;
260  }
261  double xdpixelc(double x){
262  double res;
263  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE);
264  else res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE)+ix;
265  return res;
266  }
267  double ydpixelc(double y){
268  double res;
269  double y1;
270  y1 = (y-ymin)/(ymax-ymin);
271  if(saveAsSingleLayer)res= YFEDCSIZE - (y1*YFEDCSIZE);
272  else res= YFEDCSIZE - (y1*YFEDCSIZE)+iy;
273  return res;
274  }
275  double xdpixelfec(double x){
276  double res;
277  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
278  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
279  return res;
280  }
281  double ydpixelfec(double y){
282  double res;
283  double y1;
284  y1 = (y-ymin)/(ymax-ymin);
285  if(saveAsSingleLayer)res= 2*ysize - (y1*2*ysize);
286  else res= 2*ysize - (y1*2*ysize)+iy;
287  return res;
288  }
289  double xdpixelpsu(double x){
290  double res;
291  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XPSURSIZE);
292  else res= ((x-xmin)/(xmax-xmin)*XPSURSIZE)+ix;
293  return res;
294  }
295  double ydpixelpsu(double y){
296  double res;
297  double y1;
298  y1 = (y-ymin)/(ymax-ymin);
299  if(saveAsSingleLayer)res=YPSURSIZE - (y1*YPSURSIZE);
300  else res= YPSURSIZE - (y1*YPSURSIZE)+iy;
301  return res;
302  }
303 
304  void defcwindow(int num_crate){
305  // ncrate = num_crate;
306  int xoffset=XFEDOFFSET;
307  int yoffset=YFEDOFFSET;
309 
310  ix = xoffset+((NUMFEDCRATE_INCOLUMN-1)-((num_crate-1)%NUMFEDCRATE_INCOLUMN))*(XFEDCSIZE+XFEDOFFSET);
311  iy = yoffset+((num_crate-1)/NUMFEDCRATE_INCOLUMN)*(YFEDCSIZE+YFEDOFFSET);
312  }
313  void deffecwindow(int num_crate){
314  // ncrate = num_crate;
315  int xoffset=xsize/3;
316  int yoffset=2*ysize;
317  xmin=-1.;xmax=37.; ymin = -10.; ymax=40.;
318  if(num_crate==1||num_crate==3)ix = xoffset+xsize*2;
319  if(num_crate==2||num_crate==4)ix = xoffset;
320  iy = yoffset+((num_crate-1)/2)*ysize*4;
321  }
322  void defpsuwindow(int num_rack){
323  // nrack = num_rack;
324  int xoffset=XPSUOFFSET;
325  int yoffset=YPSUOFFSET;
326  xmin=0; xmax=(NUMPSUCRATE_INCOLUMN)*1.5;
328 
329  ix = xoffset+((NUMPSURACK_INCOLUMN-1)-((num_rack-1)%NUMPSURACK_INCOLUMN))*(XPSURSIZE+XPSUOFFSET);
330  iy = yoffset+((num_rack-1)/NUMPSURACK_INCOLUMN)*(YPSURSIZE+YPSUOFFSET);
331  }
332 
333 
334 void defwindow(int num_lay){
335  // nlay = num_lay;
336  if(posrel){ // separated modules
337  xmin=-2.;ymin=-2.;xmax=2.;ymax=2.;
338  if(num_lay >12 && num_lay < 19){
339  xmin=-.40;xmax=.40;ymin=-.40;ymax=.40;
340  }
341  if(num_lay>30){
342  xmin=-0.1;xmax=3.;ymin=-0.1;ymax=8.5;
343  if(num_lay<34){xmin=-0.3;xmax=1.0;}
344  if(num_lay>33&&num_lay<38){xmax=2.0;}
345  if(num_lay>37){ymax=8.;}//inner
346  }
347  }else{ //overlayed modules
348  xmin=-1.3;ymin=-1.3;xmax=1.3;ymax=1.3;
349  if(num_lay >12 && num_lay < 19){
350  xmin=-.20;xmax=.20;ymin=-.20;ymax=.20;
351  }
352  if(num_lay>30){
353  xmin=-1.5;xmax=1.5;ymin=-1.;ymax=28.;
354  if(num_lay<34){xmin=-0.5;xmax=0.5;}
355  if(num_lay>33&&num_lay<38){xmin=-1.;xmax=1.;}
356  }
357 
358  }
359  if(num_lay<16){
360  ix=0;
361  if(num_lay==15||num_lay==14)iy=(15-num_lay)*2*ysize; else
362  {if(num_lay>9&&num_lay<13)iy=4*ysize-(int)(ysize/2.)+(12-num_lay)*(int)(ysize/1.50);else iy=6*ysize+(9-num_lay)*(int)(ysize*1.3);}}
363  if(num_lay>15&&num_lay<31){
364  ix=3*xsize;
365  if(num_lay==16||num_lay==17)iy=(num_lay-16)*2*ysize; else
366  {if(num_lay>18&&num_lay<22)iy=4*ysize-(int)(ysize/2.)+(num_lay-19)*(int)(ysize/1.50);else iy=6*ysize+(num_lay-22)*(int)(ysize*1.3);}}
367  if(num_lay>30){
368  if(num_lay==31){ix=(int)(1.5*xsize);iy=0;}
369  if(num_lay==32){int il=(num_lay-30)/2;ix=xsize;iy=il*2*ysize;}
370  if(num_lay==33){int il=(num_lay-30)/2;ix=2*xsize;iy=il*2*ysize;}
371  if(num_lay==34){int il=(num_lay-30)/2;ix=xsize;iy=il*(int)(2.57*ysize);}
372  if(num_lay>34 && num_lay%2==0){int il=(num_lay-30)/2;ix=xsize;iy=il*(int)(2.5*ysize);}
373  if(num_lay>34 && num_lay%2!=0){int il=(num_lay-30)/2;ix=2*xsize;iy=il*(int)(2.5*ysize);}
374  }
375 }
376 
377  int getringCount(int subdet, int partdet, int layer){
378  int ncomponent=0;
379  if(subdet== 1){ //1=pixel
380  if(partdet== 1 || partdet== 3){ //end-cap
381  ncomponent = 7;
382  }
383  else{ncomponent = 8;} //barrel
384  }
385  if(subdet== 2){ //inner-silicon
386  if(partdet== 1 || partdet== 3){ //end-cap
387  ncomponent = 3;
388  }
389  else{ncomponent = 12;} //barrel
390  }
391  if(subdet== 3){ //outer-silicon
392  if(partdet== 1){ //end-cap-z
393  if (layer== 1) ncomponent = 4;
394  if (layer== 2 || layer== 3) ncomponent = 5;
395  if (layer== 4 || layer== 5 || layer== 6) ncomponent = 6;
396  if (layer== 7 || layer== 8 || layer== 9) ncomponent = 7;
397  }
398  if(partdet== 3){ //endcap+z
399  if (layer== 9) ncomponent = 4;
400  if (layer== 8 || layer== 7) ncomponent = 5;
401  if (layer== 6 || layer== 5 || layer== 4) ncomponent = 6;
402  if (layer== 3 || layer== 2 || layer== 1) ncomponent = 7;
403  }
404  if(partdet== 2){ //barrel
405  ncomponent = 12;
406  }
407  }
408  return(ncomponent);
409  }
410  int getmoduleCount(int subdet, int partdet, int layer, int ring){
411  int ncomponent=0;
412  int spicchif[] ={24,24,40,56,40,56,80};
413  int spicchib[] ={20,32,44,30,38,46,56,42,48,54,60,66,74};
414  int numero_layer = 0;
415 
416  if(partdet == 2){ //barrel
417  numero_layer = layer-1;
418  if(subdet== 2){ //inner
419  numero_layer = numero_layer+3;
420  }
421  if(subdet == 3){ //outer
422  numero_layer = numero_layer+7;
423  }
424  ncomponent = spicchib[numero_layer];
425  }
426  if(partdet!= 2){ //endcap
427  if(subdet== 1)ncomponent=24;//pixel
428  else
429  ncomponent = spicchif[ring-1];
430  }
431  return(ncomponent);
432  }
433  static int layerno(int subdet,int leftright,int layer){
434  if(subdet==6&&leftright==1)return(10-layer);
435  if(subdet==6&&leftright==2)return(layer+21);
436  if(subdet==4&&leftright==1)return(4-layer+9);
437  if(subdet==4&&leftright==2)return(layer+18);
438  if(subdet==2&&leftright==1)return(4-layer+12);
439  if(subdet==2&&leftright==2)return(layer+15);
440  if(subdet==1)return(layer+30);
441  if(subdet==3)return(layer+33);
442  if(subdet==5)return(layer+37);
443  assert(false);
444  }
445 
446  static bool isRingStereo(int key){
447  int layer=key/100000;
448  int ring = key - layer*100000;
449  ring = ring/1000;
450  if(layer==34 || layer==35 || layer==38 || layer==39) return true;
451  if(layer<13 || (layer>18&&layer<31))
452  if(ring==1 || ring==2 || ring==5)return true;
453  return false;
454  }
455  int nlayer(int det,int part,int lay){
456  if(det==3 && part==1) return lay;
457  if(det==2 && part==1) return lay+9;
458  if(det==1 && part==1) return lay+12;
459  if(det==1 && part==3) return lay+15;
460  if(det==2 && part==3) return lay+18;
461  if(det==3 && part==3) return lay+21;
462  if(det==1 && part==2) return lay+30;
463  if(det==2 && part==2) return lay+33;
464  if(det==3 && part==2) return lay+37;
465  return -1;
466  }
467 
468  std::string layername(int layer){
469  std::string s= " ";
470  std::ostringstream ons;
471 
472  if(layer < 10) ons << "TEC -z Layer " << layer;
473  if(layer < 13 && layer > 9) ons << "TID -z Layer " << layer-9;
474  if(layer < 16 && layer > 12) ons << "FPIX -z Layer " << layer-12;
475  if(layer < 19 && layer > 15) ons << "FPIX +z Layer " << layer-15;
476  if(layer < 22 && layer > 18) ons << "TID +z Layer " << layer-18;
477  if(layer < 31 && layer > 21) ons << "TEC +z Layer " << layer-21;
478  if(layer < 34 && layer > 30) ons << "TPB Layer " << layer-30;
479  if(layer < 38 && layer > 33) ons << "TIB Layer " << layer-33;
480  if(layer > 37) ons << "TOB Layer " << layer-37;
481  s = ons.str();
482  return s;
483  }
484  int ntotRing[43];
485  int firstRing[43];
486 
487  protected:
488  int nlay;
489  // int ncrate;
490  // int nrack;
491  int ncrates;
495  double xmin,xmax,ymin,ymax;
497  bool posrel;
498  bool firstcall;
499  std::ofstream * svgfile;
500  std::ofstream * savefile;
501  std::ifstream * jsfile;
502  std::ifstream * inputfile;
503  std::ifstream * ccufile;
508 
509  private:
510 
511  float oldz;
515  TLegend *buildLegend();
516  std::vector<TPolyLine*> legInfos_;
517  std::vector<std::string> legKeys_;
518 };
519 #endif
520 
std::vector< TPolyLine * > legInfos_
Definition: TrackerMap.h:516
void reset()
Definition: TrackerMap.cc:432
bool tkMapLog
Definition: TrackerMap.h:172
void fill_hv_channel2(int rack, int crate, int board, float qty)
Definition: TrackerMap.cc:2668
#define NUMFEDCRATE_INCOLUMN
Definition: TrackerMap.h:61
void build()
Definition: TrackerMap.cc:2817
float minvalue
Definition: TrackerMap.h:505
TrackerMap(std::string s=" ", int xsize1=340, int ysize1=200)
Definition: TrackerMap.cc:413
ModApvPair apvModuleMap
Definition: TrackerMap.h:152
double ydpixelc(double y)
Definition: TrackerMap.h:267
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:3519
int nfeccrates
Definition: TrackerMap.h:493
void fillc_all_blank()
Definition: TrackerMap.cc:2741
#define NUMPSURACK_INCOLUMN
Definition: TrackerMap.h:48
double ydpixelfec(double y)
Definition: TrackerMap.h:281
std::string layername(int layer)
Definition: TrackerMap.h:468
int getmoduleCount(int subdet, int partdet, int layer, int ring)
Definition: TrackerMap.h:410
MapCcu ccuMap
Definition: TrackerMap.h:157
void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue)
Definition: TrackerMap.cc:2640
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
std::ifstream * inputfile
Definition: TrackerMap.h:502
std::ofstream * savefile
Definition: TrackerMap.h:500
int getxsize()
Definition: TrackerMap.h:139
bool psetAvailable
Definition: TrackerMap.h:178
void addPixel(bool addPixelfl)
Definition: TrackerMap.h:135
#define YFEDOFFSET
Definition: TrackerMap.h:68
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:1853
CaloTopology const * topology(0)
~TrackerMap()
default destructor
Definition: TrackerMap.cc:491
bool saveGeoTrackerMap
Definition: TrackerMap.h:167
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
bool enableFecProcessing
Definition: TrackerMap.h:169
double xmin
Definition: TrackerMap.h:495
#define XPSURSIZE
Definition: TrackerMap.h:50
std::multimap< const int, TmApvPair * > ModApvPair
Definition: TrackerMap.h:151
void defwindow(int num_lay)
Definition: TrackerMap.h:334
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:55
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:1570
std::map< const int, int > SvgFed
Definition: TrackerMap.h:153
double xdpixelc(double x)
Definition: TrackerMap.h:261
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:322
bool addPixelFlag
Definition: TrackerMap.h:513
int number_modules
Definition: TrackerMap.h:506
bool saveWebInterface
Definition: TrackerMap.h:166
std::string infilename
Definition: TrackerMap.h:176
int getlayerCount(int subdet, int partdet)
Definition: TrackerMap.h:219
int npsuracks
Definition: TrackerMap.h:494
void fill_current_val_fed_channel(int fedId, int fedCh, float current_val)
Definition: TrackerMap.cc:2574
#define YFEDCSIZE
Definition: TrackerMap.h:66
bool enableFedProcessing
Definition: TrackerMap.h:168
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
int firstRing[43]
Definition: TrackerMap.h:485
int getNumMod()
Definition: TrackerMap.h:143
float gminvalue
Definition: TrackerMap.h:504
#define NUMFEDCRATE_INROW
Definition: TrackerMap.h:62
std::multimap< TmPsu *, TmModule * > PsuModule
Definition: TrackerMap.h:162
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
Definition: TrackerMap.cc:2585
void setTitle(std::string s)
Definition: TrackerMap.h:132
Definition: Electron.h:6
std::string jsPath
Definition: TrackerMap.h:177
bool enableHVProcessing
Definition: TrackerMap.h:171
double xdpixelfec(double x)
Definition: TrackerMap.h:275
bool posrel
Definition: TrackerMap.h:497
int getysize()
Definition: TrackerMap.h:140
double phival(double x, double y)
Definition: TrackerMap.h:179
void fill_all_blank()
Definition: TrackerMap.cc:2749
std::map< const int, TmPsu * > MapPsu
Definition: TrackerMap.h:160
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
Definition: TrackerMap.cc:2613
std::map< const int, TmApvPair * > SvgApvPair
Definition: TrackerMap.h:149
std::vector< std::string > legKeys_
Definition: TrackerMap.h:517
void showPalette(bool printflag1)
Definition: TrackerMap.h:131
int getringCount(int subdet, int partdet, int layer)
Definition: TrackerMap.h:377
double xdpixelpsu(double x)
Definition: TrackerMap.h:289
double ymax
Definition: TrackerMap.h:495
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1245
std::ifstream * ccufile
Definition: TrackerMap.h:503
std::map< const int, TmModule * > SmoduleMap
Definition: TrackerMap.h:145
void setPalette(int numpalette)
Definition: TrackerMap.h:129
#define NUMFED_INCOLUMN
Definition: TrackerMap.h:57
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:699
bool saveAsSingleLayer
Definition: TrackerMap.h:512
void deffecwindow(int num_crate)
Definition: TrackerMap.h:313
bool temporary_file
Definition: TrackerMap.h:507
bool onlyPixelFlag
Definition: TrackerMap.h:514
std::ofstream * svgfile
Definition: TrackerMap.h:499
void load(std::string s="tmap.svg")
Definition: TrackerMap.cc:2407
#define XFEDCSIZE
Definition: TrackerMap.h:65
double xmax
Definition: TrackerMap.h:495
Definition: value.py:1
T min(T a, T b)
Definition: MathUtil.h:58
std::map< const int, TmCcu * > MapCcu
Definition: TrackerMap.h:156
double ydpixel(double y)
Definition: TrackerMap.h:247
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:538
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
Definition: TrackerMap.cc:950
void init()
Definition: TrackerMap.cc:440
void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue)
Definition: TrackerMap.cc:2547
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
double ymin
Definition: TrackerMap.h:495
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:109
#define M_PI
static int layerno(int subdet, int leftright, int layer)
Definition: TrackerMap.h:433
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
Definition: TrackerMap.cc:3536
SvgFed slotMap
Definition: TrackerMap.h:155
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1178
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
Definition: TrackerMap.cc:1036
def green(string)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
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:2135
SvgFed fedMap
Definition: TrackerMap.h:154
PsuModule psuModuleMap
Definition: TrackerMap.h:163
#define YPSUOFFSET
Definition: TrackerMap.h:53
part
Definition: HCALResponse.h:20
void fill_hv_channel3(int rack, int crate, int board, float qty)
Definition: TrackerMap.cc:2680
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:47
bool printflag
Definition: TrackerMap.h:165
int firstcrate
Definition: TrackerMap.h:492
TLegend * buildLegend()
Definition: TrackerMap.cc:3623
FecModule fecModuleMap
Definition: TrackerMap.h:159
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void setRange(float min, float max)
Definition: TrackerMap.cc:671
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2509
#define YPSURSIZE
Definition: TrackerMap.h:51
std::string title
Definition: TrackerMap.h:175
double xdpixel(double x)
Definition: TrackerMap.h:241
void printonline()
Definition: TrackerMap.cc:2887
int nlayer(int det, int part, int lay)
Definition: TrackerMap.h:455
#define NUMFED_INROW
Definition: TrackerMap.h:58
int find_layer(int ix, int iy)
Definition: TrackerMap.h:193
SvgApvPair apvMap
Definition: TrackerMap.h:150
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
Definition: TrackerMap.cc:2442
void fill_fec_channel(int crate, int slot, int ring, int addr, float qty)
Definition: TrackerMap.cc:2598
float gmaxvalue
Definition: TrackerMap.h:504
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:2759
float maxvalue
Definition: TrackerMap.h:505
void setText(int idmod, std::string s)
Definition: TrackerMap.cc:2797
#define XFEDOFFSET
Definition: TrackerMap.h:67
bool enableLVProcessing
Definition: TrackerMap.h:170
#define NUMPSURACK_INROW
Definition: TrackerMap.h:49
bool firstcall
Definition: TrackerMap.h:498
MapPsu psuMap
Definition: TrackerMap.h:161
static bool isRingStereo(int key)
Definition: TrackerMap.h:446
Definition: TmCcu.h:5
float oldz
Definition: TrackerMap.h:511
void defcwindow(int num_crate)
Definition: TrackerMap.h:304
std::ifstream * jsfile
Definition: TrackerMap.h:501
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: TmPsu.h:6
#define XPSUOFFSET
Definition: TrackerMap.h:52
void fill_lv_channel(int rack, int crate, int board, float qty)
Definition: TrackerMap.cc:2627
std::map< const int, TmModule * > ImoduleMap
Definition: TrackerMap.h:147
std::vector< TColor * > vc
Definition: TrackerMap.h:143
#define NUMPSUCH_INROW
Definition: TrackerMap.h:46
void onlyPixel(bool onlyPixelfl)
Definition: TrackerMap.h:136
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:3188
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1101
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2786
double ydpixelpsu(double y)
Definition: TrackerMap.h:295
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:1310
void fill_fed_channel(int fedId, int fedCh, float qty)
Definition: TrackerMap.cc:2707
#define NUMFEDCH_INROW
Definition: TrackerMap.h:56
std::multimap< TmCcu *, TmModule * > FecModule
Definition: TrackerMap.h:158
void fillc_hv_channel3(int rack, int crate, int board, int red, int green, int blue)
Definition: TrackerMap.cc:2653
int ntotRing[43]
Definition: TrackerMap.h:484
std::pair< float, float > getAutomaticRange()
Definition: TrackerMap.cc:675
std::string jsfilename
Definition: TrackerMap.h:176