|
|
Go to the documentation of this file.
16 #include "TPolyLine.h"
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
52 #define YPSUOFFSET 100
54 #define NUMFEDCH_INCOLUMN 12
55 #define NUMFEDCH_INROW 8
56 #define NUMFED_INCOLUMN 21
57 #define NUMFED_INROW 1
60 #define NUMFEDCRATE_INCOLUMN 1
61 #define NUMFEDCRATE_INROW 31
64 #define XFEDCSIZE 2940 // 14*21 boxes
65 #define YFEDCSIZE 90 // 9 boxes
66 #define XFEDOFFSET 150
67 #define YFEDOFFSET 100
87 void print(
bool print_total =
true,
float minval = 0.,
float maxval = 0.,
std::string s =
"svgmap");
88 void printall(
bool print_total =
true,
96 void save(
bool print_total =
true,
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);
133 void fill(
int layer,
int ring,
int nmod,
float x);
135 void fillc(
int idmod,
int RGBcode) {
fillc(
idmod, (RGBcode >> 16) & 0xFF, (RGBcode >> 8) & 0xFF, RGBcode & 0xFF); }
170 std::vector<TColor*>
vc;
182 typedef std::map<const int, TmCcu*>
MapCcu;
186 typedef std::map<const int, TmPsu*>
MapPsu;
207 double phi1 = atan(
y /
x);
213 if (fabs(
y) < 0.000001 &&
x > 0)
215 if (fabs(
y) < 0.000001 &&
x < 0)
217 if (fabs(
x) < 0.000001 &&
y > 0)
219 if (fabs(
x) < 0.000001 &&
y < 0)
231 layer = layer +
add + 1;
240 layer = layer * 2 + 1;
256 if (partdet == 1 || partdet == 3) {
263 if (partdet == 1 || partdet == 3) {
270 if (partdet == 1 || partdet == 3) {
378 if (num_crate == 1 || num_crate == 3)
380 if (num_crate == 2 || num_crate == 4)
404 if (num_lay > 12 && num_lay < 19) {
419 if (num_lay > 33 && num_lay < 38) {
431 if (num_lay > 12 && num_lay < 19) {
446 if (num_lay > 33 && num_lay < 38) {
454 if (num_lay == 15 || num_lay == 14)
455 iy = (15 - num_lay) * 2 *
ysize;
457 if (num_lay > 9 && num_lay < 13)
463 if (num_lay > 15 && num_lay < 31) {
465 if (num_lay == 16 || num_lay == 17)
466 iy = (num_lay - 16) * 2 *
ysize;
468 if (num_lay > 18 && num_lay < 22)
480 int il = (num_lay - 30) / 2;
485 int il = (num_lay - 30) / 2;
490 int il = (num_lay - 30) / 2;
494 if (num_lay > 34 && num_lay % 2 == 0) {
495 int il = (num_lay - 30) / 2;
499 if (num_lay > 34 && num_lay % 2 != 0) {
500 int il = (num_lay - 30) / 2;
510 if (partdet == 1 || partdet == 3) {
517 if (partdet == 1 || partdet == 3) {
527 if (layer == 2 || layer == 3)
529 if (layer == 4 || layer == 5 || layer == 6)
531 if (layer == 7 || layer == 8 || layer == 9)
537 if (layer == 8 || layer == 7)
539 if (layer == 6 || layer == 5 || layer == 4)
541 if (layer == 3 || layer == 2 || layer == 1)
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;
557 numero_layer = layer - 1;
559 numero_layer = numero_layer + 3;
562 numero_layer = numero_layer + 7;
564 ncomponent = spicchib[numero_layer];
570 ncomponent = spicchif[
ring - 1];
574 static int layerno(
int subdet,
int leftright,
int layer) {
575 if (subdet == 6 && leftright == 1)
577 if (subdet == 6 && leftright == 2)
579 if (subdet == 4 && leftright == 1)
580 return (4 - layer + 9);
581 if (subdet == 4 && leftright == 2)
583 if (subdet == 2 && leftright == 1)
584 return (4 - layer + 12);
585 if (subdet == 2 && leftright == 2)
597 int layer =
key / 100000;
598 int ring =
key - layer * 100000;
600 if (layer == 34 || layer == 35 || layer == 38 || layer == 39)
602 if (layer < 13 || (layer > 18 && layer < 31))
608 if (det == 3 &&
part == 1)
610 if (det == 2 &&
part == 1)
612 if (det == 1 &&
part == 1)
614 if (det == 1 &&
part == 3)
616 if (det == 2 &&
part == 3)
618 if (det == 3 &&
part == 3)
620 if (det == 1 &&
part == 2)
622 if (det == 2 &&
part == 2)
624 if (det == 3 &&
part == 2)
631 std::ostringstream ons;
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;
650 ons <<
"TOB Layer " << layer - 37;
std::multimap< TmPsu *, TmModule * > PsuModule
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
#define NUMFEDCRATE_INROW
std::map< const int, TmModule * > SmoduleMap
int getringCount(int subdet, int partdet, int layer)
void setPalette(int numpalette)
double phival(double x, double y)
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
std::vector< std::string > legKeys_
static bool isRingStereo(int key)
T mod(const T &a, const T &b)
std::map< const int, TmCcu * > MapCcu
double xdpixelpsu(double x)
int find_layer(int ix, int iy)
#define NUMPSURACK_INCOLUMN
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void fill_fec_channel(int crate, int slot, int ring, int addr, float qty)
void fill_lv_channel(int rack, int crate, int board, float qty)
std::vector< TColor * > vc
std::map< const int, TmPsu * > MapPsu
void fill_current_val(int idmod, float current_val)
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)
void setText(int idmod, std::string s)
double ydpixelpsu(double y)
void fill(int layer, int ring, int nmod, float x)
std::pair< float, float > getAutomaticRange()
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
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)
int getcolor(float value, int palette)
void fillc_hv_channel3(int rack, int crate, int board, int red, int green, int blue)
const CaloTopology * topology(nullptr)
void addPixel(bool addPixelfl)
double ydpixelc(double y)
double ydpixelfec(double y)
void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue)
int nlayer(int det, int part, int lay)
#define NUMFEDCH_INCOLUMN
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)
std::map< const int, TmApvPair * > SvgApvPair
void fill_current_val_fed_channel(int fedId, int fedCh, float current_val)
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
void setRange(float min, float max)
int module(int fedId, int fedCh)
void defwindow(int num_lay)
int getlayerCount(int subdet, int partdet)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void printall(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap", int width=6000, int height=3200)
void fill_fed_channel(int fedId, int fedCh, float qty)
void defcwindow(int num_crate)
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
void fill_hv_channel2(int rack, int crate, int board, float qty)
void showPalette(bool printflag1)
std::multimap< TmCcu *, TmModule * > FecModule
void setTitle(std::string s)
std::ifstream * findfile(std::string filename)
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)
#define NUMPSUCRATE_INCOLUMN
TrackerMap(std::string s=" ", int xsize1=340, int ysize1=200)
void onlyPixel(bool onlyPixelfl)
int getmoduleCount(int subdet, int partdet, int layer, int ring)
std::multimap< const int, TmApvPair * > ModApvPair
std::vector< TPolyLine * > legInfos_
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
std::ifstream * inputfile
void deffecwindow(int num_crate)
std::map< const int, TmModule * > ImoduleMap
std::string layername(int layer)
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue)
void defpsuwindow(int num_rack)
static int layerno(int subdet, int leftright, int layer)
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
~TrackerMap()
default destructor
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
void load(std::string s="tmap.svg")
#define NUMFEDCRATE_INCOLUMN
std::map< const int, int > SvgFed
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
double xdpixelc(double x)
void fill_hv_channel3(int rack, int crate, int board, float qty)
void fillc(int idmod, int RGBcode)
double xdpixelfec(double x)