CMS 3D CMS Logo

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