1 #ifndef _CommonTools_TrackerMap_TrackerMap_h_ 2 #define _CommonTools_TrackerMap_TrackerMap_h_ 15 #include "TPolyLine.h" 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 51 #define YPSUOFFSET 100 53 #define NUMFEDCH_INCOLUMN 12 54 #define NUMFEDCH_INROW 8 55 #define NUMFED_INCOLUMN 21 56 #define NUMFED_INROW 1 59 #define NUMFEDCRATE_INCOLUMN 1 60 #define NUMFEDCRATE_INROW 31 63 #define XFEDCSIZE 2940 // 14*21 boxes 64 #define YFEDCSIZE 90 // 9 boxes 65 #define XFEDOFFSET 150 66 #define YFEDOFFSET 100 86 void print(
bool print_total =
true,
float minval = 0.,
float maxval = 0.,
std::string s =
"svgmap");
87 void printall(
bool print_total =
true,
95 void save(
bool print_total =
true,
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);
134 void fillc(
int idmod,
int RGBcode) {
fillc(
idmod, (RGBcode >> 16) & 0xFF, (RGBcode >> 8) & 0xFF, RGBcode & 0xFF); }
169 std::vector<TColor*>
vc;
181 typedef std::map<const int, TmCcu*>
MapCcu;
185 typedef std::map<const int, TmPsu*>
MapPsu;
205 if (fabs(
x) >= 0.000001 && fabs(
y) >= 0.000001) {
211 }
else if (fabs(
y) < 0.000001)
246 if (partdet == 1 || partdet == 3) {
253 if (partdet == 1 || partdet == 3) {
260 if (partdet == 1 || partdet == 3) {
369 if (num_crate == 1 || num_crate == 3)
371 if (num_crate == 2 || num_crate == 4)
395 if (num_lay > 12 && num_lay < 19) {
410 if (num_lay > 33 && num_lay < 38) {
422 if (num_lay > 12 && num_lay < 19) {
437 if (num_lay > 33 && num_lay < 38) {
445 if (num_lay == 15 || num_lay == 14)
446 iy = (15 - num_lay) * 2 *
ysize;
448 if (num_lay > 9 && num_lay < 13)
454 if (num_lay > 15 && num_lay < 31) {
456 if (num_lay == 16 || num_lay == 17)
457 iy = (num_lay - 16) * 2 *
ysize;
459 if (num_lay > 18 && num_lay < 22)
471 int il = (num_lay - 30) / 2;
476 int il = (num_lay - 30) / 2;
481 int il = (num_lay - 30) / 2;
485 if (num_lay > 34 && num_lay % 2 == 0) {
486 int il = (num_lay - 30) / 2;
490 if (num_lay > 34 && num_lay % 2 != 0) {
491 int il = (num_lay - 30) / 2;
501 if (partdet == 1 || partdet == 3)
505 }
else if (subdet == 2) {
506 if (partdet == 1 || partdet == 3)
510 }
else if (subdet == 3) {
520 }
else if (partdet == 3) {
529 }
else if (partdet == 2) {
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;
543 numero_layer =
layer - 1;
545 numero_layer = numero_layer + 3;
548 numero_layer = numero_layer + 7;
550 ncomponent = spicchib[numero_layer];
556 ncomponent = spicchif[
ring - 1];
562 if (subdet == 6 && leftright == 1)
564 if (subdet == 6 && leftright == 2)
566 if (subdet == 4 && leftright == 1)
567 return (4 -
layer + 9);
568 if (subdet == 4 && leftright == 2)
570 if (subdet == 2 && leftright == 1)
571 return (4 -
layer + 12);
572 if (subdet == 2 && leftright == 2)
596 if (det == 3 &&
part == 1)
598 if (det == 2 &&
part == 1)
600 if (det == 1 &&
part == 1)
602 if (det == 1 &&
part == 3)
604 if (det == 2 &&
part == 3)
606 if (det == 3 &&
part == 3)
608 if (det == 1 &&
part == 2)
610 if (det == 2 &&
part == 2)
612 if (det == 3 &&
part == 2)
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;
622 std::ostringstream ons;
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;
641 ons <<
"TOB Layer " <<
layer - 37;
std::vector< TPolyLine * > legInfos_
void fill_hv_channel2(int rack, int crate, int board, float qty)
#define NUMFEDCRATE_INCOLUMN
TrackerMap(std::string s=" ", int xsize1=340, int ysize1=200)
double ydpixelc(double y)
std::ifstream * findfile(std::string filename)
#define NUMPSURACK_INCOLUMN
double ydpixelfec(double y)
std::string layername(int layer)
int getmoduleCount(int subdet, int partdet, int layer, int ring)
void fillc_hv_channel2(int rack, int crate, int board, int red, int green, int blue)
std::ifstream * inputfile
void addPixel(bool addPixelfl)
~TrackerMap()
default destructor
std::map< const int, TmModule * > ImoduleMap
int module(int fedId, int fedCh)
std::map< const int, int > SvgFed
void defwindow(int num_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
double xdpixelc(double x)
void defpsuwindow(int num_rack)
int getlayerCount(int subdet, int partdet)
void fill_current_val_fed_channel(int fedId, int fedCh, float current_val)
#define NUMFEDCRATE_INROW
std::map< const int, TmModule * > SmoduleMap
void fillc_fec_channel(int crate, int slot, int ring, int addr, int red, int green, int blue)
void setTitle(std::string s)
double xdpixelfec(double x)
std::multimap< TmPsu *, TmModule * > PsuModule
double phival(double x, double y)
void fillc_lv_channel(int rack, int crate, int board, int red, int green, int blue)
std::multimap< TmCcu *, TmModule * > FecModule
std::vector< std::string > legKeys_
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)
void showPalette(bool printflag1)
int getringCount(int subdet, int partdet, int layer)
std::map< const int, TmCcu * > MapCcu
double xdpixelpsu(double x)
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
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 setPalette(int numpalette)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
void deffecwindow(int num_crate)
void load(std::string s="tmap.svg")
key
prepare the HTCondor submission files and eventually submit them
std::map< const int, TmPsu * > MapPsu
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
void fillc_fed_channel(int fedId, int fedCh, int red, int green, int blue)
int getcolor(float value, int palette)
void fillc(int idmod, int RGBcode)
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")
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
void fill_hv_channel3(int rack, int crate, int board, float qty)
#define NUMPSUCRATE_INCOLUMN
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void setRange(float min, float max)
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
int nlayer(int det, int part, int lay)
int find_layer(int ix, int iy)
void print(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
void fill_fec_channel(int crate, int slot, int ring, int addr, float qty)
void fill_current_val(int idmod, float current_val)
void setText(int idmod, std::string s)
static bool isRingStereo(int key)
void defcwindow(int num_crate)
T mod(const T &a, const T &b)
void fill_lv_channel(int rack, int crate, int board, float qty)
std::vector< TColor * > vc
void onlyPixel(bool onlyPixelfl)
std::multimap< const int, TmApvPair * > ModApvPair
void printall(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap", int width=6000, int height=3200)
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
void fill(int layer, int ring, int nmod, float x)
double ydpixelpsu(double y)
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)
void fill_fed_channel(int fedId, int fedCh, float qty)
void fillc_hv_channel3(int rack, int crate, int board, int red, int green, int blue)
std::pair< float, float > getAutomaticRange()