CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes
TrackerMap Class Reference

#include <TrackerMap.h>

Public Types

typedef std::multimap< TmCcu *, TmModule * > FecModule
 
typedef std::map< const int, TmModule * > ImoduleMap
 
typedef std::map< const int, TmCcu * > MapCcu
 
typedef std::map< const int, TmPsu * > MapPsu
 
typedef std::multimap< const int, TmApvPair * > ModApvPair
 
typedef std::multimap< TmPsu *, TmModule * > PsuModule
 
typedef std::map< const int, TmModule * > SmoduleMap
 
typedef std::map< const int, TmApvPair * > SvgApvPair
 
typedef std::map< const int, int > SvgFed
 

Public Member Functions

void addPixel (bool addPixelfl)
 
void build ()
 
void defcwindow (int num_crate)
 
void deffecwindow (int num_crate)
 
void defpsuwindow (int num_rack)
 
void defwindow (int num_lay)
 
void drawApvPair (int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
 
void drawCcu (int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
 
void drawHV2 (int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
 
void drawHV3 (int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
 
void drawModule (TmModule *mod, int key, int layer, bool total, std::ofstream *file)
 
void drawPalette (std::ofstream *file, int xoffset=3660, int yoffset=1540)
 
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)
 
void fill (int idmod, float qty)
 
void fill_all_blank ()
 
void fill_current_val (int idmod, float current_val)
 
void fill_current_val_fed_channel (int fedId, int fedCh, float current_val)
 
void fill_fec_channel (int crate, int slot, int ring, int addr, float qty)
 
void fill_fed_channel (int fedId, int fedCh, float qty)
 
void fill_fed_channel (int modId, float qty)
 
void fill_hv_channel2 (int rack, int crate, int board, float qty)
 
void fill_hv_channel3 (int rack, int crate, int board, float qty)
 
void fill_lv_channel (int rack, int crate, int board, float qty)
 
void fillc (int idmod, int RGBcode)
 
void fillc (int idmod, int red, int green, int blue)
 
void fillc (int layer, int ring, int nmod, int red, int green, int blue)
 
void fillc_all_blank ()
 
void fillc_fec_channel (int crate, int slot, int ring, int addr, int red, int green, int blue)
 
void fillc_fed_channel (int fedId, int fedCh, int red, int green, int blue)
 
void fillc_hv_channel2 (int rack, int crate, int board, int red, int green, int blue)
 
void fillc_hv_channel3 (int rack, int crate, int board, int red, int green, int blue)
 
void fillc_lv_channel (int rack, int crate, int board, int red, int green, int blue)
 
int find_layer (int ix, int iy)
 
std::ifstream * findfile (std::string filename)
 
std::pair< float, float > getAutomaticRange ()
 
int getcolor (float value, int palette)
 
int getlayerCount (int subdet, int partdet)
 
int getmoduleCount (int subdet, int partdet, int layer, int ring)
 
int getNumMod ()
 
int getringCount (int subdet, int partdet, int layer)
 
int getxsize ()
 
int getysize ()
 
void init ()
 
std::string layername (int layer)
 
void load (std::string s="tmap.svg")
 
int module (int fedId, int fedCh)
 
int nlayer (int det, int part, int lay)
 
void onlyPixel (bool onlyPixelfl)
 
double phival (double x, double y)
 
void print (bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap")
 
void printall (bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap", int width=6000, int height=3200)
 
void printlayers (bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
 
void printonline ()
 
void reset ()
 
void save (bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
 
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 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 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)
 
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 setPalette (int numpalette)
 
void setRange (float min, float max)
 
void setText (int idmod, std::string s)
 
void setText (int layer, int ring, int nmod, std::string s)
 
void setTitle (std::string s)
 
void showPalette (bool printflag1)
 
 TrackerMap (std::string s=" ", int xsize1=340, int ysize1=200)
 
 TrackerMap (const edm::ParameterSet &iConfig)
 
 TrackerMap (const edm::ParameterSet &iConfig, const SiStripFedCabling *tkFed, const TrackerTopology *const topology)
 
double xdpixel (double x)
 
double xdpixelc (double x)
 
double xdpixelfec (double x)
 
double xdpixelpsu (double x)
 
double ydpixel (double y)
 
double ydpixelc (double y)
 
double ydpixelfec (double y)
 
double ydpixelpsu (double y)
 
 ~TrackerMap ()
 default destructor More...
 

Static Public Member Functions

static bool isRingStereo (int key)
 
static int layerno (int subdet, int leftright, int layer)
 

Public Attributes

SvgApvPair apvMap
 
ModApvPair apvModuleMap
 
MapCcu ccuMap
 
bool enableFecProcessing
 
bool enableFedProcessing
 
bool enableHVProcessing
 
bool enableLVProcessing
 
FecModule fecModuleMap
 
SvgFed fedMap
 
int firstRing [43]
 
ImoduleMap imoduleMap
 
std::string infilename
 
std::string jsfilename
 
std::string jsPath
 
int ntotRing [43]
 
int palette
 
bool printflag
 
bool psetAvailable
 
MapPsu psuMap
 
PsuModule psuModuleMap
 
bool saveGeoTrackerMap
 
bool saveWebInterface
 
SvgFed slotMap
 
SmoduleMap smoduleMap
 
std::string title
 
bool tkMapLog
 
std::vector< TColor * > vc
 

Protected Attributes

std::ifstream * ccufile
 
bool firstcall
 
int firstcrate
 
float gmaxvalue
 
float gminvalue
 
std::ifstream * inputfile
 
int ix
 
int iy
 
std::ifstream * jsfile
 
float maxvalue
 
float minvalue
 
int ncrates
 
int nfeccrates
 
int nlay
 
int npsuracks
 
int number_modules
 
bool posrel
 
std::ofstream * savefile
 
std::ofstream * svgfile
 
bool temporary_file
 
double xmax
 
double xmin
 
int xsize
 
double ymax
 
double ymin
 
int ysize
 

Private Member Functions

TLegend * buildLegend ()
 

Private Attributes

bool addPixelFlag
 
std::vector< TPolyLine * > legInfos_
 
std::vector< std::string > legKeys_
 
float oldz
 
bool onlyPixelFlag
 
bool saveAsSingleLayer
 

Detailed Description

Definition at line 75 of file TrackerMap.h.

Member Typedef Documentation

◆ FecModule

typedef std::multimap<TmCcu*, TmModule*> TrackerMap::FecModule

Definition at line 183 of file TrackerMap.h.

◆ ImoduleMap

typedef std::map<const int, TmModule*> TrackerMap::ImoduleMap

Definition at line 172 of file TrackerMap.h.

◆ MapCcu

typedef std::map<const int, TmCcu*> TrackerMap::MapCcu

Definition at line 181 of file TrackerMap.h.

◆ MapPsu

typedef std::map<const int, TmPsu*> TrackerMap::MapPsu

Definition at line 185 of file TrackerMap.h.

◆ ModApvPair

typedef std::multimap<const int, TmApvPair*> TrackerMap::ModApvPair

Definition at line 176 of file TrackerMap.h.

◆ PsuModule

typedef std::multimap<TmPsu*, TmModule*> TrackerMap::PsuModule

Definition at line 187 of file TrackerMap.h.

◆ SmoduleMap

typedef std::map<const int, TmModule*> TrackerMap::SmoduleMap

Definition at line 170 of file TrackerMap.h.

◆ SvgApvPair

typedef std::map<const int, TmApvPair*> TrackerMap::SvgApvPair

Definition at line 174 of file TrackerMap.h.

◆ SvgFed

typedef std::map<const int, int> TrackerMap::SvgFed

Definition at line 178 of file TrackerMap.h.

Constructor & Destructor Documentation

◆ TrackerMap() [1/3]

TrackerMap::TrackerMap ( std::string  s = " ",
int  xsize1 = 340,
int  ysize1 = 200 
)

Definition at line 443 of file TrackerMap.cc.

References enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, infilename, init(), jsfilename, jsPath, psetAvailable, alignCSCRings::s, saveAsSingleLayer, saveGeoTrackerMap, saveWebInterface, title, tkMapLog, xsize, and ysize.

443  {
444  psetAvailable = false;
445  xsize = xsize1;
446  ysize = ysize1;
447  title = s;
448  jsfilename = "CommonTools/TrackerMap/data/trackermap.txt";
449  infilename = "CommonTools/TrackerMap/data/tracker.dat";
450  saveWebInterface = false;
451  saveGeoTrackerMap = true;
452  tkMapLog = false;
453  jsPath = "CommonTools/TrackerMap/data/";
454  enableFedProcessing = false;
455  enableFecProcessing = false;
456  enableLVProcessing = false;
457  enableHVProcessing = false;
458  saveAsSingleLayer = false;
459  init();
460 }
bool tkMapLog
Definition: TrackerMap.h:197
bool psetAvailable
Definition: TrackerMap.h:201
bool saveGeoTrackerMap
Definition: TrackerMap.h:192
bool enableFecProcessing
Definition: TrackerMap.h:194
bool saveWebInterface
Definition: TrackerMap.h:191
std::string infilename
Definition: TrackerMap.h:199
bool enableFedProcessing
Definition: TrackerMap.h:193
std::string jsPath
Definition: TrackerMap.h:200
bool enableHVProcessing
Definition: TrackerMap.h:196
bool saveAsSingleLayer
Definition: TrackerMap.h:673
void init()
Definition: TrackerMap.cc:472
std::string title
Definition: TrackerMap.h:198
bool enableLVProcessing
Definition: TrackerMap.h:195
std::string jsfilename
Definition: TrackerMap.h:199

◆ TrackerMap() [2/3]

TrackerMap::TrackerMap ( const edm::ParameterSet iConfig)

Definition at line 418 of file TrackerMap.cc.

References gather_cfg::cout, enableFedProcessing, firstcrate, edm::ParameterSet::getUntrackedParameter(), infilename, init(), jsfilename, ncrates, psetAvailable, saveAsSingleLayer, saveGeoTrackerMap, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, title, tkMapLog, xsize, and ysize.

418  {
419  psetAvailable = true;
420  xsize = 340;
421  ysize = 200;
422  title = " ";
423  jsfilename = "CommonTools/TrackerMap/data/trackermap.txt";
424  infilename = "CommonTools/TrackerMap/data/tracker.dat";
425  enableFedProcessing = true;
426  ncrates = 0;
427  firstcrate = 0;
428  saveAsSingleLayer = false;
429  tkMapLog = tkmapPset.getUntrackedParameter<bool>("logScale", false);
430  saveWebInterface = tkmapPset.getUntrackedParameter<bool>("saveWebInterface", false);
431  saveGeoTrackerMap = tkmapPset.getUntrackedParameter<bool>("saveGeoTrackerMap", true);
432  // if(tkmapPset.exists("trackermaptxtPath")){
433  jsfilename = tkmapPset.getUntrackedParameter<std::string>("trackermaptxtPath", "CommonTools/TrackerMap/data/") +
434  "trackermap.txt";
435  std::cout << jsfilename << std::endl;
436  infilename =
437  tkmapPset.getUntrackedParameter<std::string>("trackerdatPath", "CommonTools/TrackerMap/data/") + "tracker.dat";
438  std::cout << infilename << std::endl;
439  // } else std::cout << "no parameters found" << std::endl;
440  init();
441 }
bool tkMapLog
Definition: TrackerMap.h:197
bool psetAvailable
Definition: TrackerMap.h:201
bool saveGeoTrackerMap
Definition: TrackerMap.h:192
bool saveWebInterface
Definition: TrackerMap.h:191
std::string infilename
Definition: TrackerMap.h:199
bool enableFedProcessing
Definition: TrackerMap.h:193
bool saveAsSingleLayer
Definition: TrackerMap.h:673
void init()
Definition: TrackerMap.cc:472
int firstcrate
Definition: TrackerMap.h:654
std::string title
Definition: TrackerMap.h:198
std::string jsfilename
Definition: TrackerMap.h:199

◆ TrackerMap() [3/3]

TrackerMap::TrackerMap ( const edm::ParameterSet iConfig,
const SiStripFedCabling tkFed,
const TrackerTopology *const  topology 
)

Definition at line 36 of file TrackerMap.cc.

References generateTowerEtThresholdLUT::addr, apvMap, apvModuleMap, MicroEventContent_cff::branch, TmModule::CcuId, ccuMap, TmCcu::cmodid, TmPsu::cmodid_HV2, TmPsu::cmodid_HV3, TmPsu::cmodid_LV, gather_cfg::cout, TmApvPair::crate, FCDTask_cfi::crate, SiStripFecCabling::crates(), enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), fedMap, l1tstage2emulator_dqm_sourceclient-live_cfg::feds, firstcrate, contentValuesFiles::fullPath, TmCcu::getCcuCrate(), TmCcu::getCcuRing(), TmCcu::getCcuSlot(), SiStripDetCabling::getConnections(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuBranch(), TmPsu::getPsuCrate(), TmPsu::getPsuDcs(), TmPsu::getPsuRack(), edm::ParameterSet::getUntrackedParameter(), TmModule::HVchannel, TmPsu::idex, TmCcu::idex, TmApvPair::idex, B2GTnPMonitor_cfi::idmod, imoduleMap, recoMuon::in, infilename, init(), sistrip::invalid32_, sistrip::invalid_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, jsfilename, jsPath, submitPVResolutionJobs::key, TmCcu::layer, TmModule::layer, nano_mu_digi_cff::layer, mod(), TmApvPair::mod, TmApvPair::mpos, TmCcu::mpos, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, psetAvailable, TmPsu::psId, TmModule::PsuId, TmModule::psuIdex, psuMap, psuModuleMap, runTheMatrix::ret, relativeConstraints::ring, alignCSCRings::s, saveAsSingleLayer, saveGeoTrackerMap, saveWebInterface, FCDTask_cfi::slot, slotMap, AlCaHLTBitMon_QueryRunRegistry::string, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, tkMapLog, HLT_2024v14_cff::topology, xsize, and ysize.

38  {
39  psetAvailable = true;
40  xsize = 340;
41  ysize = 200;
42 
43  title = " ";
44  jsPath = "";
45  jsfilename = "CommonTools/TrackerMap/data/trackermap.txt";
46  infilename = "CommonTools/TrackerMap/data/tracker.dat";
47  saveAsSingleLayer = false;
48  tkMapLog = false;
49  // if(tkmapPset.exists("trackermaptxtPath")){
50  jsPath = tkmapPset.getUntrackedParameter<std::string>("trackermaptxtPath", "CommonTools/TrackerMap/data/");
51  jsfilename = jsPath + "trackermap.txt";
52  std::cout << jsfilename << std::endl;
53  infilename =
54  tkmapPset.getUntrackedParameter<std::string>("trackerdatPath", "CommonTools/TrackerMap/data/") + "tracker.dat";
55  std::cout << infilename << std::endl;
56  saveWebInterface = tkmapPset.getUntrackedParameter<bool>("saveWebInterface", false);
57  saveGeoTrackerMap = tkmapPset.getUntrackedParameter<bool>("saveGeoTrackerMap", true);
58  ncrates = 0;
59  firstcrate = 0;
60  enableFedProcessing = tkmapPset.getUntrackedParameter<bool>("loadFedCabling", false);
61  if (tkFed == nullptr && enableFedProcessing) {
62  enableFedProcessing = false;
63  std::cout << "ERROR:fed trackermap requested but no valid fedCabling is available!!!" << std::endl;
64  }
65  nfeccrates = 0;
66  enableFecProcessing = tkmapPset.getUntrackedParameter<bool>("loadFecCabling", false);
67  if (tkFed == nullptr && enableFecProcessing) {
68  enableFecProcessing = false;
69  std::cout << "ERROR:fec trackermap requested but no valid fedCabling is available!!!" << std::endl;
70  }
71  // std::cout << "loadFecCabling " << enableFecProcessing << std::endl;
72  npsuracks = 0;
73  enableLVProcessing = tkmapPset.getUntrackedParameter<bool>("loadLVCabling", false);
74  // std::cout << "loadLVCabling " << enableLVProcessing << std::endl;
75  enableHVProcessing = tkmapPset.getUntrackedParameter<bool>("loadHVCabling", false);
76  // std::cout << "loadHVCabling " << enableHVProcessing << std::endl;
77  tkMapLog = tkmapPset.getUntrackedParameter<bool>("logScale", false);
78  // } else std::cout << "no parameters found" << std::endl;
79 
80  init();
81  // Now load fed cabling information
82  if (enableFedProcessing) {
83  auto feds = tkFed->fedIds();
84  std::cout << "SiStripFedCabling has " << feds.size() << " active FEDS" << std::endl;
85  // int num_board=0;
86  // int num_crate=0;
87  for (std::vector<unsigned short>::const_iterator ifed = feds.begin(); ifed < feds.end(); ifed++) {
88  auto theconn = tkFed->fedConnections(*ifed);
89  int num_conn = 0;
90  for (auto iconn = theconn.begin(); iconn < theconn.end(); iconn++) {
91  if (iconn->fedId() == sistrip::invalid_ || iconn->detId() == sistrip::invalid_ ||
92  iconn->detId() == sistrip::invalid32_ || iconn->apvPairNumber() == sistrip::invalid_ ||
93  iconn->nApvPairs() == sistrip::invalid_) {
94  continue;
95  }
96 
97  TmModule *imod = imoduleMap[iconn->detId()];
98  int key = iconn->fedId() * 1000 + iconn->fedCh();
99  TmApvPair *apvpair = apvMap[key];
100  if (apvpair != nullptr)
101  std::cout << "Fed " << iconn->fedId() << " channel " << iconn->fedCh() << " seem to be already loaded!"
102  << std::endl;
103  else {
104  num_conn++;
105  if (num_conn == 1) {
106  // if(fedMap[iconn->fedId()]==0){num_crate=num_board/18+1;fedMap[iconn->fedId()]=num_crate;num_board++;}
107  if (fedMap[iconn->fedId()] == 0) {
108  fedMap[iconn->fedId()] = iconn->fedCrate();
109  }
110  if (slotMap[iconn->fedId()] == 0) {
111  slotMap[iconn->fedId()] = iconn->fedSlot();
112  }
113  if (ncrates == 0 || ncrates < iconn->fedCrate())
114  ncrates = iconn->fedCrate();
115  if (firstcrate == 0 || firstcrate > iconn->fedCrate())
116  firstcrate = iconn->fedCrate();
117  }
118 
119  // apvpair = new TmApvPair(key,num_crate);
120  apvpair = new TmApvPair(key, iconn->fedCrate());
121  apvpair->mod = imod;
122  apvpair->mpos = iconn->apvPairNumber();
123  apvMap[key] = apvpair;
124  apvModuleMap.insert(std::make_pair(iconn->detId(), apvpair));
125  std::stringstream s;
126  iconn->print(s);
127  apvpair->text = s.str();
128  }
129  }
130  }
131  // ncrates=num_crate;
132  std::cout << "from " << firstcrate << " to " << ncrates << " crates used " << std::endl;
133  //Now add APv information to module name
134  std::map<int, TmModule *>::iterator i_mod;
135  for (i_mod = imoduleMap.begin(); i_mod != imoduleMap.end(); i_mod++) {
136  TmModule *mod = i_mod->second;
137  if (mod != nullptr) {
138  std::ostringstream outs, outs1;
139  outs << " connected to ";
140  outs1 << "(";
141 
142  int idmod = mod->idex;
143  int nchan = 0;
144  std::multimap<const int, TmApvPair *>::iterator pos;
145  for (pos = apvModuleMap.lower_bound(idmod); pos != apvModuleMap.upper_bound(idmod); ++pos) {
146  TmApvPair *apvpair = pos->second;
147  if (apvpair != nullptr) {
148  outs << apvpair->mpos << " " << apvpair->getFedId() << "/" << apvpair->getFedCh() << " ";
149  outs1 << apvpair->idex + apvpair->crate * 1000000 << ",";
150  nchan++;
151  }
152  }
153  outs << "(" << nchan << ")";
154  mod->name = mod->name + outs.str();
155  std::string s = outs1.str();
156  s.erase(s.end() - 1, s.end());
157  mod->capvids = s + ")";
158  }
159  }
160  }
161  // Now load fec cabling information
162  if (enableFecProcessing) {
163  int nccu;
164  int nmod;
165  int crate, slot, ring, addr, pos;
166  SiStripFecCabling *fecCabling_;
167  fecCabling_ = new SiStripFecCabling(*tkFed);
168  std::string Ccufilename = tkmapPset.getUntrackedParameter<std::string>("trackerdatPath", "") + "cculist.txt";
169  std::ifstream Ccufile(edm::FileInPath(Ccufilename).fullPath().c_str(), std::ios::in);
170  std::string dummys;
171  while (!Ccufile.eof()) {
172  Ccufile >> crate >> slot >> ring >> addr >> pos;
173  getline(Ccufile, dummys);
174  int key = crate * 10000000 + slot * 100000 + ring * 1000 + addr;
175  TmCcu *ccu = ccuMap[key];
176  if (ccu == nullptr) {
177  ccu = new TmCcu(crate, slot, ring, addr);
178  ccu->mpos = pos, ccuMap[key] = ccu;
179  }
180  }
181 
182  for (std::vector<SiStripFecCrate>::const_iterator icrate = fecCabling_->crates().begin();
183  icrate != fecCabling_->crates().end();
184  icrate++) {
185  for (std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end();
186  ifec++) {
187  for (std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end();
188  iring++) {
189  nccu = 0;
190  for (std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end();
191  iccu++) {
192  nccu++;
193  nmod = 0;
194  int key =
195  icrate->fecCrate() * 10000000 + ifec->fecSlot() * 100000 + iring->fecRing() * 1000 + iccu->ccuAddr();
196  int layer = 0;
197  TmCcu *ccu = ccuMap[key];
198  for (std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin();
199  imod != iccu->modules().end();
200  imod++) {
201  nmod++;
202  TmModule *imod1 = imoduleMap[imod->detId()];
203  layer = imod1->layer;
204  fecModuleMap.insert(std::make_pair(ccu, imod1));
205  if (imod1 != nullptr)
206  imod1->CcuId = key; //imod1->ccuId=key+Crate*1000000
207  }
208  if (ccu == nullptr)
209  std::cout << key << " This ccu seems to have not been stored! " << std::endl;
210  else {
211  ccu->nmod = nmod;
212  ccu->layer = layer;
213  }
214  }
215  }
216  }
217  }
218 
219  std::map<int, TmCcu *>::iterator i_ccu;
220  std::multimap<TmCcu *, TmModule *>::iterator it;
221  std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator> ret;
222  nccu = 0;
223  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
224  TmCcu *ccu = i_ccu->second;
225  nccu++;
226  if (ccu != nullptr) {
227  std::ostringstream outs;
228  std::ostringstream outs1;
229  outs << "CCU " << ccu->idex << " connected to fec,ring " << ccu->getCcuSlot() << "," << ccu->getCcuRing()
230  << " in crate " << ccu->getCcuCrate() << " at position " << ccu->mpos << " with " << ccu->nmod
231  << " modules: ";
232  outs1 << "(";
233  ret = fecModuleMap.equal_range(ccu);
234  for (it = ret.first; it != ret.second; ++it) {
235  outs << (*it).second->idex << " ";
236  outs1 << (*it).second->getKey() << ",";
237  }
238  outs1 << ")";
239  ccu->text = outs.str();
240  ccu->cmodid = outs1.str();
241  //std::cout << ccu->text << std::endl;
242  }
243  }
244  nfeccrates = 4;
245  std::cout << nccu << " ccu stored in " << nfeccrates << " crates" << std::endl;
246 
247  delete fecCabling_;
248  }
249  //load Psu cabling info
250  //load Psu cabling info
252  SiStripDetCabling *detCabling = nullptr;
254  detCabling = new SiStripDetCabling(*tkFed, topology);
255 
256  int npsu = 0;
257  int nmod, nmodHV2, nmodHV3;
258  int modId1, dcuId; // ,modId2;
259  int dcs, branch, crate, board;
260  int rack = 0;
261  std::string channelstr1;
262  short int channel;
263  std::string psinfo;
264  std::string psIdinfo;
265  int rack_order[54] = {0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 6, 0, 7, 8, 0, 9, 10, 0,
266  11, 12, 0, 13, 14, 0, 15, 0, 0, 0, 0, 0, 0, 16, 0, 17, 18, 0,
267  19, 20, 0, 21, 0, 22, 0, 23, 0, 24, 25, 0, 26, 27, 0, 28, 0, 29};
268  // std::ifstream *LVfile;
269  // std::ifstream *HVfile;
270 
271  std::string LVfilename =
272  tkmapPset.getUntrackedParameter<std::string>("trackerdatPath", "CommonTools/TrackerMap/data/") + "psdcumap.dat";
273  //std::string HVfilename=tkmapPset.getUntrackedParameter<std::string>("trackerdatPath","")+"hvmap.dat";
274 
275  std::ifstream LVfile(edm::FileInPath(LVfilename).fullPath().c_str(), std::ios::in);
276 
277  std::cout << LVfilename << std::endl;
278 
279  /*
280  if(enableHVProcessing){
281  std::ifstream HVfile(edm::FileInPath(HVfilename).fullPath().c_str(),std::ios::in);
282  while(!HVfile.eof()) {
283  HVfile >> modId2 >> channelstr1;
284  std::string channelstr2 = channelstr1.substr(9,1);
285  channel= atoi(channelstr2.c_str());
286  TmModule *imod = imoduleMap[modId2];
287  // if(modId1==modId2){
288  imod->HVchannel=channel;
289 
290  }
291 
292  }
293 */
294 
295  while (!LVfile.eof()) {
296  LVfile >> modId1 >> dcuId >> psIdinfo >> psinfo;
297 
298  if (detCabling && detCabling->getConnections(modId1).empty())
299  continue;
300 
301  // int length=psinfo.length();
302  std::string dcsinfo = psinfo.substr(39, 1);
303  std::string branchinfo = psinfo.substr(57, 2);
304  std::string crateinfo = psinfo.substr(69, 1);
305  std::string boardinfo = psinfo.substr(80, 2);
306  std::string channelinfo = psinfo.substr(90, 3);
307 
308  dcs = atoi(dcsinfo.c_str());
309  branch = atoi(branchinfo.c_str());
310  crate = atoi(crateinfo.c_str()) + 1;
311  board = atoi(boardinfo.c_str()) + 1;
312  rack = (branch + 1) + (dcs - 1) * 6;
313  rack = rack_order[rack];
314  channel = atoi(channelinfo.c_str());
315  // std::cout << dcs << " " << branch<< " " <<crate<< " " << board<<" " << rack << std::endl;
316  int key = rack * 1000 + crate * 100 + board;
317 
318  TmPsu *psu = psuMap[key];
319  TmModule *imod = imoduleMap[modId1];
320  if (psu == nullptr) {
321  psu = new TmPsu(dcs, branch, rack, crate, board);
322  psuMap[key] = psu;
323  psu->psId = psIdinfo;
324  }
325 
326  psuModuleMap.insert(std::make_pair(psu, imod));
327  if (imod != nullptr) {
328  imod->PsuId = psIdinfo;
329  imod->psuIdex = psu->idex;
330  imod->HVchannel = channel;
331  }
332  }
333 
334  // int nmax=0;
335  std::map<int, TmPsu *>::iterator ipsu;
336  std::multimap<TmPsu *, TmModule *>::iterator it;
337  std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator> ret;
338  npsu = 0;
339 
340  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
341  TmPsu *psu = ipsu->second;
342  npsu++;
343 
344  if (psu != nullptr) {
345  std::ostringstream outs;
346  std::ostringstream outs1;
347 
348  std::ostringstream outs3;
349  std::ostringstream outs4;
350 
351  std::ostringstream outs5;
352  std::ostringstream outs6;
353 
354  outs << "PSU " << psu->psId << " connected to Mainframe " << psu->getPsuDcs() << " BranchController "
355  << psu->getPsuBranch() << " (Rack " << psu->getPsuRack() << "), crate " << psu->getPsuCrate()
356  << " in position " << psu->getPsuBoard() << " with modules: ";
357  outs1 << "(";
358 
359  if (enableHVProcessing) {
360  outs3 << "PSU " << psu->psId << " connected to Mainframe " << psu->getPsuDcs() << " BranchController "
361  << psu->getPsuBranch() << " (Rack " << psu->getPsuRack() << "),crate " << psu->getPsuCrate()
362  << " in position " << psu->getPsuBoard() << " and HV channel 002 with modules: ";
363  outs4 << "(";
364 
365  outs5 << "PSU " << psu->psId << " connected to Mainframe " << psu->getPsuDcs() << " BranchController "
366  << psu->getPsuBranch() << " (Rack " << psu->getPsuRack() << "), crate " << psu->getPsuCrate()
367  << " in position " << psu->getPsuBoard() << " and HV channel 002 with modules: ";
368  outs6 << "(";
369  }
370 
371  ret = psuModuleMap.equal_range(psu);
372  nmod = 0;
373  nmodHV2 = 0;
374  nmodHV3 = 0;
375  for (it = ret.first; it != ret.second; ++it) {
376  nmod++;
377  outs << (*it).second->idex << ", ";
378  outs1 << (*it).second->getKey() << ",";
379 
380  if (enableHVProcessing) {
381  if ((*it).second->HVchannel == 2) {
382  nmodHV2++;
383  outs3 << (*it).second->idex << ", ";
384  outs4 << (*it).second->getKey() << ",";
385  } else if ((*it).second->HVchannel == 3) {
386  nmodHV3++;
387  outs5 << (*it).second->idex << ", ";
388  outs6 << (*it).second->getKey() << ",";
389  }
390  }
391  }
392 
393  outs1 << ")";
394  psu->nmod = nmod;
395  outs << "(" << psu->nmod << ")";
396  psu->text = outs.str();
397  psu->cmodid_LV = outs1.str();
398  if (enableHVProcessing) {
399  outs4 << ")";
400  outs6 << ")";
401  psu->nmodHV2 = nmodHV2;
402  psu->nmodHV3 = nmodHV3;
403  outs3 << "(" << psu->nmodHV2 << ")";
404  outs5 << "(" << psu->nmodHV3 << ")";
405  psu->textHV2 = outs3.str();
406  psu->textHV3 = outs5.str();
407  psu->cmodid_HV2 = outs4.str();
408  psu->cmodid_HV3 = outs6.str();
409  }
410  }
411  }
412 
413  npsuracks = 29;
414  std::cout << npsu << " psu stored in " << npsuracks << " racks" << std::endl;
415  }
416 }
TmModule * mod
Definition: TmApvPair.h:16
bool tkMapLog
Definition: TrackerMap.h:197
std::string text
Definition: TmApvPair.h:12
int getPsuBranch()
Definition: TmPsu.h:17
ModApvPair apvModuleMap
Definition: TrackerMap.h:177
int nfeccrates
Definition: TrackerMap.h:655
MapCcu ccuMap
Definition: TrackerMap.h:182
int mpos
Definition: TmApvPair.h:17
std::string cmodid_HV2
Definition: TmPsu.h:50
int nmodHV3
Definition: TmPsu.h:48
bool psetAvailable
Definition: TrackerMap.h:201
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
int idex
Definition: TmPsu.h:11
std::string cmodid
Definition: TmCcu.h:15
static const uint32_t invalid32_
Definition: Constants.h:15
bool saveGeoTrackerMap
Definition: TrackerMap.h:192
ret
prodAgent to be discontinued
bool enableFecProcessing
Definition: TrackerMap.h:194
int layer
Definition: TmCcu.h:16
int getCcuRing()
Definition: TmCcu.h:27
bool saveWebInterface
Definition: TrackerMap.h:191
std::string infilename
Definition: TrackerMap.h:199
int npsuracks
Definition: TrackerMap.h:656
int getPsuBoard()
Definition: TmPsu.h:31
bool enableFedProcessing
Definition: TrackerMap.h:193
int layer
Definition: TmModule.h:27
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
int nmod
Definition: TmCcu.h:14
std::string jsPath
Definition: TrackerMap.h:200
bool enableHVProcessing
Definition: TrackerMap.h:196
int getFedId()
Definition: TmApvPair.h:22
int getPsuDcs()
Definition: TmPsu.h:13
int getCcuSlot()
Definition: TmCcu.h:22
int nmod
Definition: TmPsu.h:46
std::string PsuId
Definition: TmModule.h:17
bool saveAsSingleLayer
Definition: TrackerMap.h:673
key
prepare the HTCondor submission files and eventually submit them
int getCcuCrate()
Definition: TmCcu.h:18
const std::vector< SiStripFecCrate > & crates() const
int getPsuRack()
Definition: TmPsu.h:22
int nmodHV2
Definition: TmPsu.h:47
void init()
Definition: TrackerMap.cc:472
std::string psId
Definition: TmPsu.h:12
int psuIdex
Definition: TmModule.h:18
SvgFed slotMap
Definition: TrackerMap.h:180
int mpos
Definition: TmCcu.h:17
short int HVchannel
Definition: TmModule.h:19
int CcuId
Definition: TmModule.h:16
SvgFed fedMap
Definition: TrackerMap.h:179
PsuModule psuModuleMap
Definition: TrackerMap.h:188
std::string cmodid_HV3
Definition: TmPsu.h:51
static const uint16_t invalid_
Definition: Constants.h:16
int crate
Definition: TmApvPair.h:15
int firstcrate
Definition: TrackerMap.h:654
FecModule fecModuleMap
Definition: TrackerMap.h:184
std::string title
Definition: TrackerMap.h:198
int idex
Definition: TmCcu.h:12
std::string textHV3
Definition: TmPsu.h:54
SvgApvPair apvMap
Definition: TrackerMap.h:175
std::string text
Definition: TmPsu.h:52
int idex
Definition: TmApvPair.h:14
std::string cmodid_LV
Definition: TmPsu.h:49
bool enableLVProcessing
Definition: TrackerMap.h:195
std::string textHV2
Definition: TmPsu.h:53
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmCcu.h:4
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::string text
Definition: TmCcu.h:10
Definition: TmPsu.h:6
FedsConstIterRange fedIds() const
ConnsConstIterRange fedConnections(uint16_t fed_id) const
int getFedCh()
Definition: TmApvPair.h:18
int getPsuCrate()
Definition: TmPsu.h:26
std::string jsfilename
Definition: TrackerMap.h:199

◆ ~TrackerMap()

TrackerMap::~TrackerMap ( )

default destructor

Definition at line 525 of file TrackerMap.cc.

References apvMap, ccuMap, firstRing, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mod(), module(), ntotRing, psuMap, relativeConstraints::ring, and smoduleMap.

525  {
526  for (int layer = 1; layer < 44; layer++) {
527  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
528  for (int module = 1; module < 200; module++) {
529  int key = layer * 100000 + ring * 1000 + module;
531  if (mod != nullptr)
532  delete mod;
533  }
534  }
535  }
536 
537  //std::map<int , TmModule *>::iterator i_mod;
538  // for( i_mod=imoduleMap.begin();i_mod !=imoduleMap.end(); i_mod++){
539  // TmModule * mod= i_mod->second;
540  // delete mod;
541  // }
542  std::map<int, TmApvPair *>::iterator i_apv;
543  for (i_apv = apvMap.begin(); i_apv != apvMap.end(); i_apv++) {
544  TmApvPair *apvPair = i_apv->second;
545  delete apvPair;
546  }
547 
548  std::map<int, TmCcu *>::iterator i_ccu;
549  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
550  TmCcu *ccu = i_ccu->second;
551  delete ccu;
552  }
553 
554  std::map<int, TmPsu *>::iterator ipsu;
555  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
556  TmPsu *psu = ipsu->second;
557  delete psu;
558  }
559 }
MapCcu ccuMap
Definition: TrackerMap.h:182
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
int firstRing[43]
Definition: TrackerMap.h:647
key
prepare the HTCondor submission files and eventually submit them
SvgApvPair apvMap
Definition: TrackerMap.h:175
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmCcu.h:4
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: TmPsu.h:6
int ntotRing[43]
Definition: TrackerMap.h:646

Member Function Documentation

◆ addPixel()

void TrackerMap::addPixel ( bool  addPixelfl)
inline

Definition at line 160 of file TrackerMap.h.

References addPixelFlag.

Referenced by DetIdSelectorTest::DetIdSelectorTest().

160 { addPixelFlag = addPixelfl; };
bool addPixelFlag
Definition: TrackerMap.h:674

◆ build()

void TrackerMap::build ( )

Definition at line 3471 of file TrackerMap.cc.

References gather_cfg::cout, contentValuesFiles::fullPath, imoduleMap, recoMuon::in, timingPdfMaker::infile, infilename, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mod(), mergeVDriftHistosByStation::name, number_modules, relativeConstraints::ring, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, ppsPixelTopologyESSourceRun2_cfi::thickness, and ApeEstimator_cff::width.

Referenced by init(), and psClasses.BuildThread::run().

3471  {
3472  // std::ifstream* infile;
3473 
3474  int nmods, pix_sil, fow_bar, ring, nmod, layer;
3475  unsigned int idex;
3476  float posx, posy, posz, length, width, thickness, widthAtHalfLength;
3477  int old_layer = 0, ntotMod = 0;
3478  std::string name, dummys;
3479  std::ifstream infile(edm::FileInPath(infilename).fullPath().c_str(), std::ios::in);
3480  while (!infile.eof()) {
3481  infile >> nmods >> pix_sil >> fow_bar >> layer >> ring >> nmod >> posx >> posy >> posz >> length >> width >>
3482  thickness >> widthAtHalfLength >> idex;
3483  getline(infile, dummys); //necessary to reach end of record
3484  getline(infile, name);
3485  if (old_layer != layer) {
3486  old_layer = layer;
3487  }
3488  ntotMod++;
3489  int key = layer * 100000 + ring * 1000 + nmod;
3490  TmModule *mod = smoduleMap[key];
3491 
3492  imoduleMap[idex] = mod;
3493 
3494  if (mod == nullptr)
3495  std::cout << "error in module " << key << std::endl;
3496  else {
3497  mod->posx = posx;
3498  mod->posy = posy;
3499  mod->setUsed();
3500  mod->value = 0;
3501  mod->count = 0;
3502  mod->posz = posz;
3503  mod->length = length;
3504  mod->width = width;
3505  mod->thickness = thickness;
3506  mod->widthAtHalfLength = widthAtHalfLength;
3507  mod->idex = idex;
3508  mod->name = name;
3509  }
3510  }
3511  infile.close();
3512  number_modules = ntotMod - 1;
3513 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int number_modules
Definition: TrackerMap.h:668
std::string infilename
Definition: TrackerMap.h:199
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
key
prepare the HTCondor submission files and eventually submit them
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ buildLegend()

TLegend * TrackerMap::buildLegend ( )
private

Definition at line 4450 of file TrackerMap.cc.

References mps_fire::i, legInfos_, and legKeys_.

Referenced by save().

4450  {
4451  if (legInfos_.empty()) {
4452  legInfos_.reserve(8);
4453 
4454  legInfos_.push_back(new TPolyLine(0));
4455  legInfos_.back()->SetFillColor(kGreen);
4456  legInfos_.push_back(new TPolyLine(0));
4457  legInfos_.back()->SetFillColor(kBlue - 9);
4458  legInfos_.push_back(new TPolyLine(0));
4459  legInfos_.back()->SetFillColor(kRed + 2);
4460  legInfos_.push_back(new TPolyLine(0));
4461  legInfos_.back()->SetFillColor(kPink - 9);
4462  legInfos_.push_back(new TPolyLine(0));
4463  legInfos_.back()->SetFillColor(kOrange + 2);
4464  legInfos_.push_back(new TPolyLine(0));
4465  legInfos_.back()->SetFillColor(kYellow);
4466  legInfos_.push_back(new TPolyLine(0));
4467  legInfos_.back()->SetFillColor(kRed + 1);
4468  legInfos_.push_back(new TPolyLine(0));
4469  legInfos_.back()->SetFillColor(kViolet - 5);
4470  legKeys_ = {"Good Modules",
4471  "Excluded FED",
4472  "FED errors",
4473  "# Clusters",
4474  "# Digis",
4475  "PCL bad",
4476  "# Clusters & Digis",
4477  "DCS Error"};
4478  }
4479 
4480  TLegend *myL = new TLegend(0.56, 0.87, 0.95, 0.99);
4481  myL->SetNColumns(2);
4482  myL->SetBorderSize(0);
4483  myL->SetFillColor(38);
4484  for (unsigned int i = 0; i < legInfos_.size(); i++) {
4485  myL->AddEntry((TObject *)legInfos_[i], legKeys_[i].c_str(), "f");
4486  }
4487  // myL->Draw();
4488  return myL;
4489 }
std::vector< TPolyLine * > legInfos_
Definition: TrackerMap.h:677
std::vector< std::string > legKeys_
Definition: TrackerMap.h:678

◆ defcwindow()

void TrackerMap::defcwindow ( int  num_crate)
inline

Definition at line 349 of file TrackerMap.h.

References ix, iy, NUMFED_INCOLUMN, NUMFED_INROW, NUMFEDCH_INCOLUMN, NUMFEDCH_INROW, NUMFEDCRATE_INCOLUMN, XFEDCSIZE, XFEDOFFSET, xmax, xmin, EcalSCDynamicDPhiParametersESProducer_cfi::xoffset, YFEDCSIZE, YFEDOFFSET, ymax, ymin, and EcalSCDynamicDPhiParametersESProducer_cfi::yoffset.

Referenced by save_as_fedtrackermap().

349  {
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  }
#define NUMFEDCRATE_INCOLUMN
Definition: TrackerMap.h:59
#define YFEDOFFSET
Definition: TrackerMap.h:66
double xmin
Definition: TrackerMap.h:657
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:53
#define YFEDCSIZE
Definition: TrackerMap.h:64
double ymax
Definition: TrackerMap.h:657
#define NUMFED_INCOLUMN
Definition: TrackerMap.h:55
#define XFEDCSIZE
Definition: TrackerMap.h:63
double xmax
Definition: TrackerMap.h:657
double ymin
Definition: TrackerMap.h:657
#define NUMFED_INROW
Definition: TrackerMap.h:56
#define XFEDOFFSET
Definition: TrackerMap.h:65
#define NUMFEDCH_INROW
Definition: TrackerMap.h:54

◆ deffecwindow()

void TrackerMap::deffecwindow ( int  num_crate)
inline

Definition at line 361 of file TrackerMap.h.

References ix, iy, xmax, xmin, EcalSCDynamicDPhiParametersESProducer_cfi::xoffset, xsize, ymax, ymin, EcalSCDynamicDPhiParametersESProducer_cfi::yoffset, and ysize.

Referenced by save_as_fectrackermap().

361  {
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  }
double xmin
Definition: TrackerMap.h:657
double ymax
Definition: TrackerMap.h:657
double xmax
Definition: TrackerMap.h:657
double ymin
Definition: TrackerMap.h:657

◆ defpsuwindow()

void TrackerMap::defpsuwindow ( int  num_rack)
inline

Definition at line 375 of file TrackerMap.h.

References ix, iy, NUMPSUCH_INROW, NUMPSUCRATE_INCOLUMN, NUMPSURACK_INCOLUMN, xmax, xmin, EcalSCDynamicDPhiParametersESProducer_cfi::xoffset, XPSUOFFSET, XPSURSIZE, ymax, ymin, EcalSCDynamicDPhiParametersESProducer_cfi::yoffset, YPSUOFFSET, and YPSURSIZE.

Referenced by save_as_HVtrackermap(), and save_as_psutrackermap().

375  {
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  }
#define NUMPSURACK_INCOLUMN
Definition: TrackerMap.h:46
double xmin
Definition: TrackerMap.h:657
#define XPSURSIZE
Definition: TrackerMap.h:48
double ymax
Definition: TrackerMap.h:657
double xmax
Definition: TrackerMap.h:657
double ymin
Definition: TrackerMap.h:657
#define YPSUOFFSET
Definition: TrackerMap.h:51
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:45
#define YPSURSIZE
Definition: TrackerMap.h:49
#define XPSUOFFSET
Definition: TrackerMap.h:50
#define NUMPSUCH_INROW
Definition: TrackerMap.h:44

◆ defwindow()

void TrackerMap::defwindow ( int  num_lay)
inline

Definition at line 388 of file TrackerMap.h.

References createfilelist::int, ix, iy, posrel, xmax, xmin, xsize, ymax, ymin, and ysize.

Referenced by print(), printlayers(), and save().

388  {
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  }
double xmin
Definition: TrackerMap.h:657
bool posrel
Definition: TrackerMap.h:659
double ymax
Definition: TrackerMap.h:657
double xmax
Definition: TrackerMap.h:657
double ymin
Definition: TrackerMap.h:657

◆ drawApvPair()

void TrackerMap::drawApvPair ( int  crate,
int  numfed_incrate,
bool  total,
TmApvPair apvPair,
std::ofstream *  file,
bool  useApvPairValue 
)

Definition at line 1241 of file TrackerMap.cc.

References TmApvPair::blue, TmModule::blue, DivergingColor::blue, edmScanValgrind::buffer, TmModule::count, TmApvPair::count, FCDTask_cfi::crate, PVValHelper::dx, PVValHelper::dy, getcolor(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmModule::getKey(), TmApvPair::green, TmModule::green, TmApvPair::idex, TmModule::idex, createfilelist::int, dqmiolumiharvest::j, isotrackApplyRegressor::k, TmApvPair::mod, TmModule::name, np, NUMFED_INCOLUMN, NUMFED_INROW, NUMFEDCH_INCOLUMN, NUMFEDCH_INROW, palette, TmApvPair::red, TmModule::red, DivergingColor::red, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, TmModule::value, TmApvPair::value, xdpixelc(), and ydpixelc().

Referenced by save_as_fedtrackermap().

1242  {
1243  double xp[4], yp[4];
1244  int color;
1245  int green = 0;
1246  int red = 0;
1247  int blue = 0;
1248  double xd[4], yd[4];
1249  int np = 4;
1250  double boxinitx = 0., boxinity = 0.;
1251  double dx = .9, dy = .9;
1252  /*
1253  int numfedch_incolumn = 12;
1254  int numfedch_inrow = 8;
1255  int numfed_incolumn = 6;
1256  int numfed_inrow = 4;
1257  */
1258  boxinitx = boxinitx + (NUMFED_INCOLUMN - 1 - (numfed_incrate - 1) / NUMFED_INROW) * (NUMFEDCH_INCOLUMN + 2);
1259  boxinity = boxinity + (NUMFED_INROW - 1 - (numfed_incrate - 1) % NUMFED_INROW) * (NUMFEDCH_INROW + 1);
1260  boxinity = boxinity + NUMFEDCH_INROW - (apvPair->getFedCh() / NUMFEDCH_INCOLUMN);
1261  boxinitx = boxinitx + NUMFEDCH_INCOLUMN - (int)(apvPair->getFedCh() % NUMFEDCH_INCOLUMN);
1262  // std::cout << crate << " " << numfed_incrate << " " << apvPair->getFedCh()<<" "<<boxinitx<< " " << boxinity << std::endl; ;
1263  xp[0] = boxinitx;
1264  yp[0] = boxinity;
1265  xp[1] = boxinitx + dx;
1266  yp[1] = boxinity;
1267  xp[2] = boxinitx + dx;
1268  yp[2] = boxinity + dy;
1269  xp[3] = boxinitx;
1270  yp[3] = boxinity + dy;
1271  for (int j = 0; j < 4; j++) {
1272  xd[j] = xdpixelc(xp[j]);
1273  yd[j] = ydpixelc(yp[j]);
1274  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1275  }
1276 
1277  char buffer[20];
1278  sprintf(buffer, "%X", apvPair->mod->idex);
1279  std::string s = apvPair->mod->name;
1280  s.erase(s.begin() + s.find("connected"), s.end());
1281 
1282  if (useApvPairValue) {
1283  if (apvPair->red < 0) { //use count to compute color
1284  if (apvPair->count > 0) {
1285  float vals = apvPair->value;
1286  std::string nams = "nams_apv";
1287 
1288  color = getcolor(apvPair->value, palette);
1289  red = (color >> 16) & 0xFF;
1290  green = (color >> 8) & 0xFF;
1291  blue = (color) & 0xFF;
1292  if (!print_total)
1293  apvPair->value = apvPair->value * apvPair->count; //restore mod->value
1294  if (temporary_file)
1295  *svgfile << nams << " " << vals << " " << red << " " << green << " " << blue << " ";
1296  else
1297  *svgfile
1298  << "<svg:polygon detid=\"" << apvPair->idex << "\" count=\"" << apvPair->count << "\" value=\""
1299  << apvPair->value << "\" id=\"" << apvPair->idex + crate * 1000000 << "\" cmodid=\""
1300  << apvPair->mod->getKey()
1301  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1302  "\" POS=\"Fed/Ch "
1303  << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connected to " << s << " Id " << buffer
1304  << " \" fill=\"rgb(" << red << "," << green << "," << blue << ")\" points=\"";
1305  } else {
1306  if (temporary_file)
1307  *svgfile << 0 << " " << 0 << " " << 255 << " " << 255 << " " << 255 << " ";
1308  else
1309  *svgfile
1310  << "<svg:polygon detid=\"" << apvPair->idex << "\" count=\"" << apvPair->count << "\" value=\""
1311  << apvPair->value << "\" id=\"" << apvPair->idex + crate * 1000000 << "\" cmodid=\""
1312  << apvPair->mod->getKey()
1313  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1314  "\" POS=\"Fed/Ch "
1315  << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connected to " << s << " Id " << buffer
1316  << " \" fill=\"white\" points=\"";
1317  }
1318  } else { //color defined with fillc
1319  if (apvPair->red > 255)
1320  apvPair->red = 255;
1321  if (apvPair->green > 255)
1322  apvPair->green = 255;
1323  if (apvPair->blue > 255)
1324  apvPair->blue = 255;
1325  if (temporary_file)
1326  *svgfile << 0 << " " << 0 << " " << apvPair->red << " " << apvPair->green << " " << apvPair->blue << " ";
1327  else
1328  *svgfile
1329  << "<svg:polygon detid=\"" << apvPair->idex << "\" count=\"" << apvPair->count << "\" value=\""
1330  << apvPair->value << "\" id=\"" << apvPair->idex + crate * 1000000 << "\" cmodid=\""
1331  << apvPair->mod->getKey()
1332  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1333  "\" POS=\"Fed/Ch "
1334  << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connected to " << s << " Id " << buffer
1335  << " \" fill=\"rgb(" << apvPair->red << "," << apvPair->green << "," << apvPair->blue << ")\" points=\"";
1336  }
1337  } else {
1338  if (apvPair->mod->red < 0) { //use count to compute color
1339  if (apvPair->mod->count > 0) {
1340  float vals = apvPair->mod->value;
1341  std::string nams = "nams_apv2";
1342 
1343  color = getcolor(apvPair->mod->value, palette);
1344  red = (color >> 16) & 0xFF;
1345  green = (color >> 8) & 0xFF;
1346  blue = (color) & 0xFF;
1347  if (temporary_file)
1348  *svgfile << nams << " " << vals << " " << red << " " << green << " " << blue << " ";
1349  else
1350  *svgfile
1351  << "<svg:polygon detid=\"" << apvPair->idex << "\" count=\"" << apvPair->count << "\" value=\""
1352  << apvPair->value << "\" id=\"" << apvPair->idex + crate * 1000000 << "\" cmodid=\""
1353  << apvPair->mod->getKey()
1354  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1355  "\" POS=\"Fed/Ch "
1356  << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connected to " << s << " Id " << buffer
1357  << " \" fill=\"rgb(" << red << "," << green << "," << blue << ")\" points=\"";
1358  } else {
1359  if (temporary_file)
1360  *svgfile << 0 << " " << 0 << " " << 255 << " " << 255 << " " << 255 << " ";
1361  else
1362  *svgfile
1363  << "<svg:polygon detid=\"" << apvPair->idex << "\" count=\"" << apvPair->count << "\" value=\""
1364  << apvPair->value << "\" id=\"" << apvPair->idex + crate * 1000000 << "\" cmodid=\""
1365  << apvPair->mod->getKey()
1366  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1367  "\" POS=\"Fed/Ch "
1368  << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connected to " << s << " Id " << buffer
1369  << " \" fill=\"white\" points=\"";
1370  }
1371  } else { //color defined with fillc
1372  if (apvPair->mod->red > 255)
1373  apvPair->mod->red = 255;
1374  if (apvPair->mod->green > 255)
1375  apvPair->mod->green = 255;
1376  if (apvPair->mod->blue > 255)
1377  apvPair->mod->blue = 255;
1378  if (temporary_file)
1379  *svgfile << 0 << " " << 0 << " " << apvPair->mod->red << " " << apvPair->mod->green << " " << apvPair->mod->blue
1380  << " ";
1381  else
1382  *svgfile
1383  << "<svg:polygon detid=\"" << apvPair->idex << "\" count=\"" << apvPair->count << "\" value=\""
1384  << apvPair->value << "\" id=\"" << apvPair->idex + crate * 1000000 << "\" cmodid=\""
1385  << apvPair->mod->getKey()
1386  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1387  "\" POS=\"Fed/Ch "
1388  << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connected to " << s << " Id " << buffer
1389  << " \" fill=\"rgb(" << apvPair->mod->red << "," << apvPair->mod->green << "," << apvPair->mod->blue
1390  << ")\" points=\"";
1391  }
1392  }
1393  if (temporary_file)
1394  *svgfile << np << " ";
1395  for (int k = 0; k < np; k++) {
1396  if (temporary_file)
1397  *svgfile << xd[k] << " " << yd[k] << " ";
1398  else
1399  *svgfile << xd[k] << "," << yd[k] << " ";
1400  }
1401  if (temporary_file)
1402  *svgfile << std::endl;
1403  else
1404  *svgfile << "\" />" << std::endl;
1405 }
TmModule * mod
Definition: TmApvPair.h:16
double ydpixelc(double y)
Definition: TrackerMap.h:302
float value
Definition: TmModule.h:11
int green
Definition: TmApvPair.h:10
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:53
double xdpixelc(double x)
Definition: TrackerMap.h:294
int getFedId()
Definition: TmApvPair.h:22
int red
Definition: TmApvPair.h:10
unsigned int idex
Definition: TmModule.h:28
int np
Definition: AMPTWrapper.h:43
#define NUMFED_INCOLUMN
Definition: TrackerMap.h:55
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
int blue
Definition: TmApvPair.h:10
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3514
int count
Definition: TmModule.h:12
int getKey()
Definition: TmModule.h:22
int green
Definition: TmModule.h:10
int count
Definition: TmApvPair.h:13
int red
Definition: TmModule.h:10
int blue
Definition: TmModule.h:10
#define NUMFED_INROW
Definition: TrackerMap.h:56
int idex
Definition: TmApvPair.h:14
float value
Definition: TmApvPair.h:11
std::string name
Definition: TmModule.h:14
int getFedCh()
Definition: TmApvPair.h:18
#define NUMFEDCH_INROW
Definition: TrackerMap.h:54

◆ drawCcu()

void TrackerMap::drawCcu ( int  crate,
int  numfed_incrate,
bool  total,
TmCcu ccu,
std::ofstream *  file,
bool  useCcuValue 
)

Definition at line 1406 of file TrackerMap.cc.

References TmCcu::blue, DivergingColor::blue, edmScanValgrind::buffer, TmCcu::cmodid, TmCcu::count, FCDTask_cfi::crate, PVValHelper::dx, PVValHelper::dy, TmCcu::getCcuRing(), TmCcu::getCcuSlot(), getcolor(), TmCcu::green, TmCcu::idex, createfilelist::int, dqmiolumiharvest::j, isotrackApplyRegressor::k, TmCcu::layer, TmCcu::mpos, np, palette, TmCcu::red, DivergingColor::red, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, TmCcu::text, TmCcu::value, xdpixelfec(), and ydpixelfec().

Referenced by save_as_fectrackermap().

1407  {
1408  double xp[4], yp[4];
1409  int color;
1410  int green = 0;
1411  int red = 0;
1412  int blue = 0;
1413  double xd[4], yd[4];
1414  int np = 4;
1415  double boxinitx = 0., boxinity = 0.;
1416  double dx = .9, dy = .9;
1417  int numccu_incolumn = 8;
1418  int numccu_inrow = 15;
1419  int numfec_incolumn = 5;
1420  int numfec_inrow = 4;
1421  boxinitx = boxinitx + (numfec_incolumn - (numfec_incrate - 1) / numfec_inrow) * 14.;
1422  boxinity = boxinity + (numfec_inrow - (numfec_incrate - 1) % numfec_inrow) * 16.;
1423  boxinity = boxinity + numccu_inrow - ccu->mpos;
1424  boxinitx = boxinitx + numccu_incolumn - (int)(ccu->getCcuRing() % numccu_incolumn);
1425  //std::cout << crate << " " << numfec_incrate << " " << ccu->getCcuRing()<<" "<<ccu->mpos<<" "<<boxinitx<< " " << boxinity << std::endl; ;
1426  xp[0] = boxinitx;
1427  yp[0] = boxinity;
1428  xp[1] = boxinitx + dx;
1429  yp[1] = boxinity;
1430  xp[2] = boxinitx + dx;
1431  yp[2] = boxinity + dy;
1432  xp[3] = boxinitx;
1433  yp[3] = boxinity + dy;
1434  for (int j = 0; j < 4; j++) {
1435  xd[j] = xdpixelfec(xp[j]);
1436  yd[j] = ydpixelfec(yp[j]);
1437  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1438  }
1439 
1440  char buffer[20];
1441  sprintf(buffer, "%X", ccu->idex);
1442  //sprintf(buffer,"%X",ccu->mod->idex);
1443  //std::string s = ccu->mod->name;
1444  std::string s = ccu->text;
1445  s.erase(s.begin() + s.find("connected"), s.end());
1446 
1447  if (ccu->red < 0) { //use count to compute color
1448  if (ccu->count > 0) {
1449  float vals = ccu->value;
1450  std::string nams = "nams_ccu";
1451 
1452  color = getcolor(ccu->value, palette);
1453  red = (color >> 16) & 0xFF;
1454  green = (color >> 8) & 0xFF;
1455  blue = (color) & 0xFF;
1456  if (!print_total)
1457  ccu->value = ccu->value * ccu->count; //restore mod->value
1458  if (temporary_file)
1459  *svgfile << nams << " " << vals << " " << red << " " << green << " " << blue << " ";
1460  else
1461  *svgfile
1462  << "<svg:polygon detid=\"" << ccu->idex << "\" count=\"" << ccu->count << "\" value=\"" << ccu->value
1463  << "\" id=\"" << ccu->idex + crate * 1000000 << "\" cmodid=\"" << ccu->cmodid << "\" layer=\"" << ccu->layer
1464  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1465  "\" POS=\"Slot/Ring"
1466  << ccu->getCcuSlot() << "/" << ccu->getCcuRing() << " connected to " << s << " Id " << buffer
1467  << " \" fill=\"rgb(" << red << "," << green << "," << blue << ")\" points=\"";
1468  } else {
1469  if (temporary_file)
1470  *svgfile << 0 << " " << 0 << " " << 255 << " " << 255 << " " << 255 << " ";
1471  else
1472  *svgfile
1473  << "<svg:polygon detid=\"" << ccu->idex << "\" count=\"" << ccu->count << "\" value=\"" << ccu->value
1474  << "\" id=\"" << ccu->idex + crate * 1000000 << "\" cmodid=\"" << ccu->cmodid << "\" layer=\""
1475  << ccu->layer
1476  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1477  "\" POS=\"Slot/Ring "
1478  << ccu->getCcuSlot() << "/" << ccu->getCcuRing() << " connected to " << s << " Id " << buffer
1479  << " \" fill=\"white\" points=\"";
1480  }
1481  } else { //color defined with fillc
1482  if (ccu->red > 255)
1483  ccu->red = 255;
1484  if (ccu->green > 255)
1485  ccu->green = 255;
1486  if (ccu->blue > 255)
1487  ccu->blue = 255;
1488  if (temporary_file)
1489  *svgfile << 0 << " " << 0 << " " << ccu->red << " " << ccu->green << " " << ccu->blue << " ";
1490  else
1491  *svgfile
1492  << "<svg:polygon detid=\"" << ccu->idex << "\" count=\"" << ccu->count << "\" value=\"" << ccu->value
1493  << "\" id=\"" << ccu->idex + crate * 1000000 << "\" cmodid=\"" << ccu->cmodid << "\" layer=\"" << ccu->layer
1494  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1495  "\" POS=\"Slot/Ring "
1496  << ccu->getCcuSlot() << "/" << ccu->getCcuRing() << " connected to " << s << " Id " << buffer
1497  << " \" fill=\"rgb(" << ccu->red << "," << ccu->green << "," << ccu->blue << ")\" points=\"";
1498  }
1499  if (temporary_file)
1500  *svgfile << np << " ";
1501  for (int k = 0; k < np; k++) {
1502  if (temporary_file)
1503  *svgfile << xd[k] << " " << yd[k] << " ";
1504  else
1505  *svgfile << xd[k] << "," << yd[k] << " ";
1506  }
1507  if (temporary_file)
1508  *svgfile << std::endl;
1509  else
1510  *svgfile << "\" />" << std::endl;
1511 }
double ydpixelfec(double y)
Definition: TrackerMap.h:320
std::string cmodid
Definition: TmCcu.h:15
int layer
Definition: TmCcu.h:16
int getCcuRing()
Definition: TmCcu.h:27
int count
Definition: TmCcu.h:11
double xdpixelfec(double x)
Definition: TrackerMap.h:312
int getCcuSlot()
Definition: TmCcu.h:22
int np
Definition: AMPTWrapper.h:43
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
int green
Definition: TmCcu.h:8
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3514
int mpos
Definition: TmCcu.h:17
float value
Definition: TmCcu.h:9
int idex
Definition: TmCcu.h:12
int red
Definition: TmCcu.h:8
int blue
Definition: TmCcu.h:8
std::string text
Definition: TmCcu.h:10

◆ drawHV2()

void TrackerMap::drawHV2 ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1626 of file TrackerMap.cc.

References TmPsu::blueHV2, edmScanValgrind::buffer, TmPsu::cmodid_HV2, TmPsu::countHV2, PVValHelper::dx, PVValHelper::dy, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::greenHV2, TmPsu::idex, dqmiolumiharvest::j, isotrackApplyRegressor::k, np, palette, TmPsu::redHV2, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, TmPsu::textHV2, TmPsu::valueHV2, xdpixelpsu(), and ydpixelpsu().

Referenced by save_as_HVtrackermap().

1627  {
1628  double xp[4], yp[4];
1629  int color;
1630  int greenHV2 = 0;
1631  int redHV2 = 0;
1632  int blueHV2 = 0;
1633  double xd[4], yd[4];
1634  int np = 4;
1635  double boxinitx = 35, boxinity = 12;
1636  double dx = 1.1, dy = 1.3;
1637 
1638  boxinitx = boxinitx + (5 - psu->getPsuCrate()) * 5;
1639  boxinity = boxinity + (18 - psu->getPsuBoard()) * 1.75;
1640 
1641  xp[0] = boxinitx;
1642  yp[0] = boxinity;
1643  xp[1] = boxinitx + dx;
1644  yp[1] = boxinity;
1645  xp[2] = boxinitx + dx;
1646  yp[2] = boxinity + dy;
1647  xp[3] = boxinitx;
1648  yp[3] = boxinity + dy;
1649 
1650  for (int j = 0; j < 4; j++) {
1651  xd[j] = xdpixelpsu(xp[j]);
1652  yd[j] = ydpixelpsu(yp[j]);
1653  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1654  }
1655 
1656  char buffer[20];
1657  sprintf(buffer, "%X", psu->idex);
1658  std::string s = psu->textHV2;
1659  s.erase(s.begin() + s.find("connected"), s.end());
1660 
1661  if (psu->redHV2 < 0) { //use count to compute color
1662 
1663  if (psu->valueHV2 > 0) {
1664  float vals = psu->valueHV2;
1665  std::string nams = "nams_hv2";
1666 
1667  color = getcolor(psu->valueHV2, palette);
1668  redHV2 = (color >> 16) & 0xFF;
1669  greenHV2 = (color >> 8) & 0xFF;
1670  blueHV2 = (color) & 0xFF;
1671  if (!print_total)
1672  psu->valueHV2 = psu->valueHV2 * psu->countHV2; //restore mod->value
1673  if (temporary_file)
1674  *svgfile << nams << " " << vals << " " << redHV2 << " " << greenHV2 << " " << blueHV2 << " ";
1675  else
1676  *svgfile
1677  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->countHV2 << "\" value=\"" << psu->valueHV2
1678  << "\" id=\"" << psu->idex * 10 + 2 << "\" cmodid=\"" << psu->cmodid_HV2
1679  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1680  "\" POS=\"easyCrate/easyBoard "
1681  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s << " \" fill=\"rgb(" << redHV2
1682  << "," << greenHV2 << "," << blueHV2 << ")\" points=\"";
1683  } else {
1684  if (temporary_file)
1685  *svgfile << 0 << " " << 0 << " " << 255 << " " << 255 << " " << 255 << " ";
1686  else
1687  *svgfile
1688  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->countHV2 << "\" value=\"" << psu->valueHV2
1689  << "\" id=\"" << psu->idex * 10 + 2 << "\" cmodid=\"" << psu->cmodid_HV2
1690  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1691  "\" POS=\"easyCrate/easyBoard "
1692  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s
1693  << " \" fill=\"white\" points=\"";
1694  }
1695  }
1696 
1697  else { //color defined with fillc
1698  if (psu->redHV2 > 255)
1699  psu->redHV2 = 255;
1700  if (psu->greenHV2 > 255)
1701  psu->greenHV2 = 255;
1702  if (psu->blueHV2 > 255)
1703  psu->blueHV2 = 255;
1704  if (temporary_file)
1705  *svgfile << 0 << " " << 0 << " " << psu->redHV2 << " " << psu->greenHV2 << " " << psu->blueHV2 << " ";
1706  else
1707  *svgfile
1708  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->countHV2 << "\" value=\"" << psu->valueHV2
1709  << "\" id=\"" << psu->idex * 10 + 2 << "\" cmodid=\"" << psu->cmodid_HV2
1710  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1711  "\" POS=\"easyCrate/easyBoard "
1712  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s << " \" fill=\"rgb("
1713  << psu->redHV2 << "," << psu->greenHV2 << "," << psu->blueHV2 << ")\" points=\"";
1714  }
1715 
1716  if (temporary_file)
1717  *svgfile << np << " ";
1718  for (int k = 0; k < np; k++) {
1719  if (temporary_file)
1720  *svgfile << xd[k] << " " << yd[k] << " ";
1721  else
1722  *svgfile << xd[k] << "," << yd[k] << " ";
1723  }
1724  if (temporary_file)
1725  *svgfile << std::endl;
1726  else
1727  *svgfile << "\" />" << std::endl;
1728 }
int redHV2
Definition: TmPsu.h:38
std::string cmodid_HV2
Definition: TmPsu.h:50
int idex
Definition: TmPsu.h:11
int countHV2
Definition: TmPsu.h:44
int getPsuBoard()
Definition: TmPsu.h:31
int np
Definition: AMPTWrapper.h:43
double xdpixelpsu(double x)
Definition: TrackerMap.h:330
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
int greenHV2
Definition: TmPsu.h:38
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3514
float valueHV2
Definition: TmPsu.h:42
std::string textHV2
Definition: TmPsu.h:53
int blueHV2
Definition: TmPsu.h:38
double ydpixelpsu(double y)
Definition: TrackerMap.h:338
int getPsuCrate()
Definition: TmPsu.h:26

◆ drawHV3()

void TrackerMap::drawHV3 ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1730 of file TrackerMap.cc.

References TmPsu::blueHV3, edmScanValgrind::buffer, TmPsu::cmodid_HV3, TmPsu::countHV3, PVValHelper::dx, PVValHelper::dy, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::greenHV3, TmPsu::idex, dqmiolumiharvest::j, isotrackApplyRegressor::k, np, palette, TmPsu::redHV3, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, TmPsu::textHV3, TmPsu::valueHV3, xdpixelpsu(), and ydpixelpsu().

Referenced by save_as_HVtrackermap().

1731  {
1732  double xp[4], yp[4];
1733  int color;
1734  int greenHV3 = 0;
1735  int redHV3 = 0;
1736  int blueHV3 = 0;
1737  double xd[4], yd[4];
1738  int np = 4;
1739  double boxinitx = 36.5, boxinity = 12;
1740  double dx = 1.1, dy = 1.3;
1741 
1742  boxinitx = boxinitx + (5 - psu->getPsuCrate()) * 5;
1743  boxinity = boxinity + (18 - psu->getPsuBoard()) * 1.75;
1744 
1745  xp[0] = boxinitx;
1746  yp[0] = boxinity;
1747  xp[1] = boxinitx + dx;
1748  yp[1] = boxinity;
1749  xp[2] = boxinitx + dx;
1750  yp[2] = boxinity + dy;
1751  xp[3] = boxinitx;
1752  yp[3] = boxinity + dy;
1753 
1754  for (int j = 0; j < 4; j++) {
1755  xd[j] = xdpixelpsu(xp[j]);
1756  yd[j] = ydpixelpsu(yp[j]);
1757  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1758  }
1759 
1760  char buffer[20];
1761  sprintf(buffer, "%X", psu->idex);
1762  std::string s = psu->textHV3;
1763  s.erase(s.begin() + s.find("connected"), s.end());
1764 
1765  if (psu->redHV3 < 0) { //use count to compute color
1766  if (psu->valueHV3 > 0) {
1767  float vals = psu->valueHV3;
1768  std::string nams = "nams_hv3";
1769 
1770  color = getcolor(psu->valueHV3, palette);
1771  redHV3 = (color >> 16) & 0xFF;
1772  greenHV3 = (color >> 8) & 0xFF;
1773  blueHV3 = (color) & 0xFF;
1774  if (!print_total)
1775  psu->valueHV3 = psu->valueHV3 * psu->countHV3; //restore mod->value
1776  if (temporary_file)
1777  *svgfile << nams << " " << vals << " " << redHV3 << " " << greenHV3 << " " << blueHV3 << " ";
1778  else
1779  *svgfile
1780  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->countHV3 << "\" value=\"" << psu->valueHV3
1781  << "\" id=\"" << psu->idex * 10 + 3 << "\" cmodid=\"" << psu->cmodid_HV3
1782  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1783  "\" POS=\"easyCrate/easyBoard"
1784  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s << " \" fill=\"rgb(" << redHV3
1785  << "," << greenHV3 << "," << blueHV3 << ")\" points=\"";
1786  } else {
1787  if (temporary_file)
1788  *svgfile << 0 << " " << 255 << " " << 255 << " " << 255 << " ";
1789  else
1790  *svgfile
1791  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->countHV3 << "\" value=\"" << psu->valueHV3
1792  << "\" id=\"" << psu->idex * 10 + 3 << "\" cmodid=\"" << psu->cmodid_HV3
1793  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1794  "\" POS=\"easyCrate/easyBoard "
1795  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s
1796  << " \" fill=\"white\" points=\"";
1797  }
1798  }
1799 
1800  else { //color defined with fillc
1801  if (psu->redHV3 > 255)
1802  psu->redHV3 = 255;
1803  if (psu->greenHV3 > 255)
1804  psu->greenHV3 = 255;
1805  if (psu->blueHV3 > 255)
1806  psu->blueHV3 = 255;
1807  if (temporary_file)
1808  *svgfile << 0 << " " << 0 << " " << psu->redHV3 << " " << psu->greenHV3 << " " << psu->blueHV3 << " ";
1809  else
1810  *svgfile
1811  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->countHV3 << "\" value=\"" << psu->valueHV3
1812  << "\" id=\"" << psu->idex * 10 + 3 << "\" cmodid=\"" << psu->cmodid_HV3
1813  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1814  "\" POS=\"easyCrate/easyBoard "
1815  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s << " \" fill=\"rgb("
1816  << psu->redHV3 << "," << psu->greenHV3 << "," << psu->blueHV3 << ")\" points=\"";
1817  }
1818 
1819  if (temporary_file)
1820  *svgfile << np << " ";
1821  for (int k = 0; k < np; k++) {
1822  if (temporary_file)
1823  *svgfile << xd[k] << " " << yd[k] << " ";
1824  else
1825  *svgfile << xd[k] << "," << yd[k] << " ";
1826  }
1827  if (temporary_file)
1828  *svgfile << std::endl;
1829  else
1830  *svgfile << "\" />" << std::endl;
1831 }
int idex
Definition: TmPsu.h:11
int getPsuBoard()
Definition: TmPsu.h:31
int greenHV3
Definition: TmPsu.h:39
int np
Definition: AMPTWrapper.h:43
double xdpixelpsu(double x)
Definition: TrackerMap.h:330
int blueHV3
Definition: TmPsu.h:39
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3514
int redHV3
Definition: TmPsu.h:39
std::string cmodid_HV3
Definition: TmPsu.h:51
std::string textHV3
Definition: TmPsu.h:54
int countHV3
Definition: TmPsu.h:45
float valueHV3
Definition: TmPsu.h:41
double ydpixelpsu(double y)
Definition: TrackerMap.h:338
int getPsuCrate()
Definition: TmPsu.h:26

◆ drawModule()

void TrackerMap::drawModule ( TmModule mod,
int  key,
int  layer,
bool  total,
std::ofstream *  file 
)

Definition at line 561 of file TrackerMap.cc.

References DivergingColor::blue, edmScanValgrind::buffer, DummyCfis::c, funct::cos(), PVValHelper::dx, PVValHelper::dy, newFWLiteAna::found, getcolor(), CommonMethods::isnan(), isRingStereo(), dqmiolumiharvest::j, isotrackApplyRegressor::k, submitPVResolutionJobs::key, M_PI, mod(), nlay, np, palette, phi, phival(), posrel, alignCSCRings::r, DivergingColor::red, funct::sin(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, xdpixel(), and ydpixel().

Referenced by print(), printlayers(), and save().

561  {
562  //int x,y;
563  nlay = mlay;
564  double phi, r, dx, dy, dy1;
565  double xp[4], yp[4], xp1, yp1;
566  double vhbot, vhtop, vhapo;
567  double rmedio[] = {0.041, 0.0701, 0.0988, 0.255, 0.340, 0.430, 0.520, 0.610, 0.696, 0.782, 0.868, 0.965, 1.080};
568  double xt1, yt1, xs1 = 0., ys1 = 0., xt2, yt2, xs2, ys2, pv1, pv2;
569  int green = 0;
570  int red = 0;
571  int blue = 0;
572  double xd[4], yd[4];
573  int np = 4;
574  //int numrec=0;
575  int numod = 0;
576  phi = phival(mod->posx, mod->posy);
577  r = sqrt(mod->posx * mod->posx + mod->posy * mod->posy);
578  vhtop = mod->width;
579  vhapo = mod->length;
580  if (mlay < 31) { //endcap
581  vhbot = mod->widthAtHalfLength / 2. - (mod->width / 2. - mod->widthAtHalfLength / 2.);
582  vhtop = mod->width / 2.;
583  vhapo = mod->length / 2.;
584  if (mlay > 12 && mlay < 19) {
585  if (posrel)
586  r = r + r;
587  xp[0] = r - vhtop;
588  yp[0] = -vhapo;
589  xp[1] = r + vhtop;
590  yp[1] = -vhapo;
591  xp[2] = r + vhtop;
592  yp[2] = vhapo;
593  xp[3] = r - vhtop;
594  yp[3] = vhapo;
595  } else {
596  if (posrel)
597  r = r + r / 3.;
598  xp[0] = r - vhapo;
599  yp[0] = -vhbot;
600  xp[1] = r + vhapo;
601  yp[1] = -vhtop;
602  xp[2] = r + vhapo;
603  yp[2] = vhtop;
604  xp[3] = r - vhapo;
605  yp[3] = vhbot;
606  }
607  for (int j = 0; j < 4; j++) {
608  xp1 = xp[j] * cos(phi) - yp[j] * sin(phi);
609  yp1 = xp[j] * sin(phi) + yp[j] * cos(phi);
610  xp[j] = xp1;
611  yp[j] = yp1;
612  }
613  } else { //barrel
614  numod = mod->idModule;
615  if (numod > 100)
616  numod = numod - 100;
617  int vane = mod->ring;
618  if (posrel) {
619  dx = vhapo;
620  phi = M_PI;
621  xt1 = rmedio[mlay - 31];
622  yt1 = -vhtop / 2.;
623  xs1 = xt1 * cos(phi) - yt1 * sin(phi);
624  ys1 = xt1 * sin(phi) + yt1 * cos(phi);
625  xt2 = rmedio[mlay - 31];
626  yt2 = vhtop / 2.;
627  xs2 = xt2 * cos(phi) - yt2 * sin(phi);
628  ys2 = xt2 * sin(phi) + yt2 * cos(phi);
629  dy = phival(xs2, ys2) - phival(xs1, ys1);
630  dy1 = dy;
631  if (mlay == 31)
632  dy1 = 0.39;
633  if (mlay == 32)
634  dy1 = 0.23;
635  if (mlay == 33)
636  dy1 = 0.16;
637  xp[0] = vane * (dx + dx / 8.);
638  yp[0] = numod * (dy1);
639  xp[1] = vane * (dx + dx / 8.) + dx;
640  yp[1] = numod * (dy1);
641  xp[2] = vane * (dx + dx / 8.) + dx;
642  yp[2] = numod * (dy1) + dy;
643  xp[3] = vane * (dx + dx / 8.);
644  yp[3] = numod * (dy1) + dy;
645  } else {
646  xt1 = r;
647  yt1 = -vhtop / 2.;
648  xs1 = xt1 * cos(phi) - yt1 * sin(phi);
649  ys1 = xt1 * sin(phi) + yt1 * cos(phi);
650  xt2 = r;
651  yt2 = vhtop / 2.;
652  xs2 = xt2 * cos(phi) - yt2 * sin(phi);
653  ys2 = xt2 * sin(phi) + yt2 * cos(phi);
654  pv1 = phival(xs1, ys1);
655  pv2 = phival(xs2, ys2);
656  if (fabs(pv1 - pv2) > M_PI && numod == 1)
657  pv1 = pv1 - 2. * M_PI;
658  if (fabs(pv1 - pv2) > M_PI && numod != 1)
659  pv2 = pv2 + 2. * M_PI;
660  xp[0] = mod->posz - vhapo / 2.;
661  yp[0] = 4.2 * pv1;
662  xp[1] = mod->posz + vhapo / 2.;
663  yp[1] = 4.2 * pv1;
664  xp[2] = mod->posz + vhapo / 2.;
665  yp[2] = 4.2 * pv2;
666  xp[3] = mod->posz - vhapo / 2.;
667  yp[3] = 4.2 * pv2;
668  }
669  }
670  if (isRingStereo(key)) {
671  np = 3;
672  if (mod->idModule > 100) {
673  for (int j = 0; j < 3; j++) {
674  xd[j] = xdpixel(xp[j]);
675  yd[j] = ydpixel(yp[j]);
676  }
677  } else {
678  xd[0] = xdpixel(xp[2]);
679  yd[0] = ydpixel(yp[2]);
680  xd[1] = xdpixel(xp[3]);
681  yd[1] = ydpixel(yp[3]);
682  xd[2] = xdpixel(xp[0]);
683  yd[2] = ydpixel(yp[0]);
684  }
685  } else {
686  for (int j = 0; j < 4; j++) {
687  xd[j] = xdpixel(xp[j]);
688  yd[j] = ydpixel(yp[j]);
689  }
690  }
691  char buffer[20];
692  sprintf(buffer, "%X", mod->idex);
693 
694  //Get value and name for TH2Poly bin
695  float vals = mod->value;
696  if (std::isnan(vals))
697  vals = 0; //Avoid nan values
698  std::string nams = mod->name;
699 
700  //Format TH2Poly bin name = short_name_(detId)_FED
701  //Original name = TOB- Layer 5 Rod 61 Module 6 r-phi (436295608) connected to 0 413/48 1 413/49 2 413/50 (3)^C
702  //Bin name = TOB-_L_5_R_61_M_6_(436295608)_413
703  nams.erase(std::remove_if(nams.begin(), nams.end(), [](char c) { return std::islower(c); }), nams.end());
704  size_t found = nams.find('/');
705  if (found != std::string::npos) {
706  nams.erase(found, nams.length() - found);
707  } else {
708  found = nams.find(')');
709  nams.erase(found + 1, nams.length() - found);
710  }
711  found = nams.find(") ");
712  while (found != std::string::npos) {
713  nams.erase(found + 1, 4);
714  found = nams.find(") ", found);
715  }
716  found = nams.find(" -");
717  while (found != std::string::npos) {
718  nams.erase(found, 2);
719  found = nams.find(" -", found);
720  }
721  found = nams.find(" ");
722  while (found != std::string::npos) {
723  nams.erase(found, 2);
724  found = nams.find(" ", found);
725  }
726  found = nams.find(" ");
727  while (found != std::string::npos) {
728  nams.erase(found, 1);
729  found = nams.find(" ", found);
730  }
731  std::replace_if(nams.begin(), nams.end(), [](char c) { return c == ' '; }, '_');
732 
733  if (mod->red < 0) { //use count to compute color
734  int color = getcolor(mod->value, palette);
735  red = (color >> 16) & 0xFF;
736  green = (color >> 8) & 0xFF;
737  blue = (color) & 0xFF;
738 
739  if (!print_total)
740  mod->value = mod->value * mod->count; //restore mod->value
741 
742  if (mod->count > 0)
743  if (temporary_file)
744  //Add TH2Poly bin name and value to temporary .coor file
745  *svgfile << nams << " " << vals << " " << red << " " << green << " " << blue << " ";
746  else
747  *svgfile
748  << "<svg:polygon detid=\"" << mod->idex << "\" count=\"" << mod->count << "\" value=\"" << mod->value
749  << "\" id=\"" << key << "\" capvids=\"" << mod->capvids << "\" lv=\"" << mod->psuIdex << "\" hv=\""
750  << mod->psuIdex * 10 + mod->HVchannel << "\" fec=\"" << mod->CcuId
751  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
752  << mod->text << "\" POS=\"" << mod->name << " \" fill=\"rgb(" << red << "," << green << "," << blue
753  << ")\" points=\"";
754  else if (temporary_file)
755  *svgfile << nams << " " << vals << " " << 255 << " " << 255 << " " << 255 << " ";
756  else
757  *svgfile
758  << "<svg:polygon detid=\"" << mod->idex << "\" count=\"" << mod->count << "\" value=\"" << mod->value
759  << "\" id=\"" << key << "\" capvids=\"" << mod->capvids << "\" lv=\"" << mod->psuIdex << "\" hv=\""
760  << mod->psuIdex * 10 + mod->HVchannel << "\" fec=\"" << mod->CcuId
761  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
762  << mod->text << "\" POS=\"" << mod->name << " \" fill=\"white\" points=\"";
763  if (temporary_file)
764  *svgfile << np << " ";
765  for (int k = 0; k < np; k++) {
766  if (temporary_file)
767  *svgfile << xd[k] << " " << yd[k] << " ";
768  else
769  *svgfile << xd[k] << "," << yd[k] << " ";
770  }
771  if (temporary_file)
772  *svgfile << std::endl;
773  else
774  *svgfile << "\" />" << std::endl;
775  } else { //color defined with fillc
776  if (mod->red > 255)
777  mod->red = 255;
778  if (mod->green > 255)
779  mod->green = 255;
780  if (mod->blue > 255)
781  mod->blue = 255;
782  if (temporary_file)
783  *svgfile << nams << " " << vals << " " << mod->red << " " << mod->green << " " << mod->blue << " ";
784  else
785  *svgfile
786  << "<svg:polygon detid=\"" << mod->idex << "\" count=\"" << mod->count << "\" value=\"" << mod->value
787  << "\" id=\"" << key << "\" capvids=\"" << mod->capvids << "\" lv=\"" << mod->psuIdex << "\" hv=\""
788  << mod->psuIdex * 10 + mod->HVchannel << "\" fec=\"" << mod->CcuId
789  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
790  << mod->text << "\" POS=\"" << mod->name << " \" fill=\"rgb(" << mod->red << "," << mod->green << ","
791  << mod->blue << ")\" points=\"";
792  if (temporary_file)
793  *svgfile << np << " ";
794  for (int k = 0; k < np; k++) {
795  if (temporary_file)
796  *svgfile << xd[k] << " " << yd[k] << " ";
797  else
798  *svgfile << xd[k] << "," << yd[k] << " ";
799  }
800  if (temporary_file)
801  *svgfile << std::endl;
802  else
803  *svgfile << "\" />" << std::endl;
804  }
805 }
def isnan(num)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool posrel
Definition: TrackerMap.h:659
double phival(double x, double y)
Definition: TrackerMap.h:203
int np
Definition: AMPTWrapper.h:43
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
key
prepare the HTCondor submission files and eventually submit them
double ydpixel(double y)
Definition: TrackerMap.h:277
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3514
#define M_PI
double xdpixel(double x)
Definition: TrackerMap.h:269
static bool isRingStereo(int key)
Definition: TrackerMap.h:583
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ drawPalette()

void TrackerMap::drawPalette ( std::ofstream *  file,
int  xoffset = 3660,
int  yoffset = 1540 
)

Definition at line 3169 of file TrackerMap.cc.

References DivergingColor::blue, gather_cfg::cout, ALCARECOEcalPhiSym_cff::float, getcolor(), mps_fire::i, createfilelist::int, maxvalue, minvalue, palette, DivergingColor::red, svgfile, temporary_file, tkMapLog, heppy_batch::val, ApeEstimator_cff::width, EcalSCDynamicDPhiParametersESProducer_cfi::xoffset, and EcalSCDynamicDPhiParametersESProducer_cfi::yoffset.

Referenced by print(), save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), and save_as_psutrackermap().

3169  {
3170  std::cout << "preparing the palette" << std::endl;
3171 
3172  int color, red, green, blue;
3173  float val = minvalue;
3174  int paletteLength = 250;
3175  int width = 50 * (yoffset - 40) / 1500;
3176  float dval = (maxvalue - minvalue) / (float)paletteLength;
3177  bool rtkMapLog = tkMapLog;
3178  if (tkMapLog)
3179  tkMapLog = false;
3180  float step = float(yoffset - 40) / float(paletteLength);
3181  for (int i = 1; i < paletteLength + 1; i++) {
3182  color = getcolor(val, palette);
3183  red = (color >> 16) & 0xFF;
3184  green = (color >> 8) & 0xFF;
3185  blue = (color) & 0xFF;
3186  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" />\n";
3187  // else *svgfile << red << " " << green << " " << blue << " 4 " << (6*i)+40 << " 3010. " <<//
3188  // (6*i)+40 << " 3060. " <<//
3189  // (6*(i-1))+40 << " 3060. " <<//
3190  // (6*(i-1))+40 <<" 3010. " << std::endl; //
3191 
3192  // if(i%50 == 0){
3193  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
3194  // if(i%50==0&&!temporary_file)*svgfile << " <svg:text class=\"normalText\" x=\"3060\" y=\""<<(1560-6*i)<<"\">" <<val<<"</svg:text>"<<std::endl;
3195 
3196  if (!temporary_file)
3197  *svgfile << "<svg:rect x=\"3610\" y=\"" << (1550 - 6 * i) << "\" width=\"50\" height=\"6\" fill=\"rgb(" << red
3198  << "," << green << "," << blue << ")\" />\n";
3199  else
3200  *svgfile << 0 << " " << 0 << " " << red << " " << green << " " << blue << " 4 " << int(step * i) + 34 << " "
3201  << xoffset - width << ". " << //
3202  int(step * i) + 34 << " " << xoffset << ". " << //
3203  int(step * (i - 1)) + 34 << " " << xoffset << ". " << //
3204  int(step * (i - 1)) + 34 << " " << xoffset - width << ". " << std::endl; //
3205 
3206  if (i % 50 == 0) {
3207  if (!temporary_file)
3208  *svgfile << "<svg:rect x=\"3610\" y=\"" << (1550 - 6 * i)
3209  << "\" width=\"50\" height=\"1\" fill=\"black\" />\n";
3210  if (i % 50 == 0 && !temporary_file)
3211  *svgfile << " <svg:text class=\"normalText\" x=\"3660\" y=\"" << (1560 - 6 * i) << "\">" << val
3212  << "</svg:text>" << std::endl;
3213  }
3214  val = val + dval;
3215  }
3216  tkMapLog = rtkMapLog;
3217 }
bool tkMapLog
Definition: TrackerMap.h:197
float minvalue
Definition: TrackerMap.h:667
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3514
float maxvalue
Definition: TrackerMap.h:667
step
Definition: StallMonitor.cc:83

◆ drawPsu()

void TrackerMap::drawPsu ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1512 of file TrackerMap.cc.

References TmPsu::blue, DivergingColor::blue, edmScanValgrind::buffer, TmPsu::cmodid_LV, TmPsu::count, PVValHelper::dx, PVValHelper::dy, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::green, TmPsu::idex, dqmiolumiharvest::j, isotrackApplyRegressor::k, np, NUMPSUCH_INROW, NUMPSUCRATE_INCOLUMN, palette, TmPsu::red, DivergingColor::red, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, TmPsu::text, TmPsu::value, xdpixelpsu(), and ydpixelpsu().

Referenced by save_as_psutrackermap().

1513  {
1514  double xp[4], yp[4];
1515  int color;
1516  int green = 0;
1517  int red = 0;
1518  int blue = 0;
1519  double xd[4], yd[4];
1520  int np = 4;
1521  double boxinitx = 0., boxinity = 0.;
1522  double dx = .9, dy = .9;
1523 
1524  boxinitx = boxinitx + (NUMPSUCRATE_INCOLUMN - psu->getPsuCrate()) * 1.5;
1525  boxinity = boxinity + (NUMPSUCH_INROW - psu->getPsuBoard());
1526 
1527  xp[0] = boxinitx;
1528  yp[0] = boxinity;
1529  xp[1] = boxinitx + dx;
1530  yp[1] = boxinity;
1531  xp[2] = boxinitx + dx;
1532  yp[2] = boxinity + dy;
1533  xp[3] = boxinitx;
1534  yp[3] = boxinity + dy;
1535 
1536  for (int j = 0; j < 4; j++) {
1537  xd[j] = xdpixelpsu(xp[j]);
1538  yd[j] = ydpixelpsu(yp[j]);
1539  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1540  }
1541 
1542  // lines needed to prepare the clickable maps: understand why I get twice the full list of channels (HV1 and HV0?)
1543  /*
1544  double scalex=2695./2700.;
1545  double scaley=1520./1550.;
1546  std::cout << "<area shape=\"rect\" coords=\" "
1547  << int(scalex*yd[2]) << "," << int(1520-scaley*xd[2])
1548  << "," << int(scalex*yd[0]) << "," << int(1520-scaley*xd[0])
1549  << "\" title=\" " << psu->psId << "\" /> " << std::endl;
1550  */
1551  //
1552 
1553  char buffer[20];
1554  sprintf(buffer, "%X", psu->idex);
1555  std::string s = psu->text;
1556  s.erase(s.begin() + s.find("connected"), s.end());
1557 
1558  if (psu->red < 0) { //use count to compute color
1559  if (psu->count > 0) {
1560  float vals = psu->value;
1561  std::string nams = "nams_psu";
1562 
1563  color = getcolor(psu->value, palette);
1564  red = (color >> 16) & 0xFF;
1565  green = (color >> 8) & 0xFF;
1566  blue = (color) & 0xFF;
1567  if (!print_total)
1568  psu->value = psu->value * psu->count; //restore mod->value
1569  if (temporary_file)
1570  *svgfile << nams << " " << vals << " " << red << " " << green << " " << blue << " ";
1571  else
1572  *svgfile
1573  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->count << "\" value=\"" << psu->value
1574  << "\" id=\"" << psu->idex << "\" cmodid=\"" << psu->cmodid_LV
1575  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1576  "\" POS=\"easyCrate/easyBoard "
1577  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s << " \" fill=\"rgb(" << red
1578  << "," << green << "," << blue << ")\" points=\"";
1579  } else {
1580  if (temporary_file)
1581  *svgfile << 0 << " " << 0 << " " << 255 << " " << 255 << " " << 255 << " ";
1582  else
1583  *svgfile
1584  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->count << "\" value=\"" << psu->value
1585  << "\" id=\"" << psu->idex << "\" cmodid=\"" << psu->cmodid_LV
1586  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1587  "\" POS=\"easyCrate/easyBoard "
1588  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s
1589  << " \" fill=\"white\" points=\"";
1590  }
1591  }
1592 
1593  else { //color defined with fillc
1594  if (psu->red > 255)
1595  psu->red = 255;
1596  if (psu->green > 255)
1597  psu->green = 255;
1598  if (psu->blue > 255)
1599  psu->blue = 255;
1600  if (temporary_file)
1601  *svgfile << 0 << " " << 0 << " " << psu->red << " " << psu->green << " " << psu->blue << " ";
1602  else
1603  *svgfile
1604  << "<svg:polygon detid=\"" << psu->idex << "\" count=\"" << psu->count << "\" value=\"" << psu->value
1605  << "\" id=\"" << psu->idex << "\" cmodid=\"" << psu->cmodid_LV
1606  << "\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""
1607  "\" POS=\"easyCrate/easyBoard "
1608  << psu->getPsuCrate() << "/" << psu->getPsuBoard() << " connected to " << s << " \" fill=\"rgb(" << psu->red
1609  << "," << psu->green << "," << psu->blue << ")\" points=\"";
1610  }
1611 
1612  if (temporary_file)
1613  *svgfile << np << " ";
1614  for (int k = 0; k < np; k++) {
1615  if (temporary_file)
1616  *svgfile << xd[k] << " " << yd[k] << " ";
1617  else
1618  *svgfile << xd[k] << "," << yd[k] << " ";
1619  }
1620  if (temporary_file)
1621  *svgfile << std::endl;
1622  else
1623  *svgfile << "\" />" << std::endl;
1624 }
int count
Definition: TmPsu.h:43
int idex
Definition: TmPsu.h:11
float value
Definition: TmPsu.h:40
int getPsuBoard()
Definition: TmPsu.h:31
int red
Definition: TmPsu.h:37
int np
Definition: AMPTWrapper.h:43
double xdpixelpsu(double x)
Definition: TrackerMap.h:330
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
int green
Definition: TmPsu.h:37
int getcolor(float value, int palette)
Definition: TrackerMap.cc:3514
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:45
std::string text
Definition: TmPsu.h:52
std::string cmodid_LV
Definition: TmPsu.h:49
int blue
Definition: TmPsu.h:37
#define NUMPSUCH_INROW
Definition: TrackerMap.h:44
double ydpixelpsu(double y)
Definition: TrackerMap.h:338
int getPsuCrate()
Definition: TmPsu.h:26

◆ fill() [1/2]

void TrackerMap::fill ( int  layer,
int  ring,
int  nmod,
float  x 
)

Definition at line 3444 of file TrackerMap.cc.

References gather_cfg::cout, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mod(), relativeConstraints::ring, and smoduleMap.

Referenced by SiStripCorrelateNoise::DoAnalysis(), SiStripPlotGain::DoAnalysis(), TkHistoMap::dumpInTkMap(), SiStripBaseCondObjDQM::fillTkMap(), SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillTrackerMap(), load(), SiStripHitResolFromCalibTree::makeTKMap(), SiStripHitEffFromCalibTree::makeTKMap(), and SiStripQualityStatistics::updateAndSave().

3444  {
3445  int key = layer * 100000 + ring * 1000 + nmod;
3446  TmModule *mod = smoduleMap[key];
3447  if (mod != nullptr) {
3448  mod->value = mod->value + qty;
3449  mod->count++;
3450  } else
3451  std::cout << "**************************error in SvgModuleMap **************";
3452 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
key
prepare the HTCondor submission files and eventually submit them
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ fill() [2/2]

void TrackerMap::fill ( int  idmod,
float  qty 
)

Definition at line 3424 of file TrackerMap.cc.

References TmModule::count, gather_cfg::cout, B2GTnPMonitor_cfi::idmod, imoduleMap, mod(), and TmModule::value.

3424  {
3426  if (mod != nullptr) {
3427  mod->value = mod->value + qty;
3428  mod->count++;
3429  return;
3430  } else {
3431  TmModule *mod1 = imoduleMap[idmod + 1];
3432  TmModule *mod2 = imoduleMap[idmod + 2];
3433  if (mod1 != nullptr && mod2 != nullptr) {
3434  mod1->value = mod1->value + qty;
3435  mod1->count++;
3436  mod2->value = mod2->value + qty;
3437  mod2->count++;
3438  return;
3439  }
3440  }
3441  std::cout << "**************************error in fill method **************module " << idmod << std::endl;
3442 }
float value
Definition: TmModule.h:11
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
int count
Definition: TmModule.h:12
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ fill_all_blank()

void TrackerMap::fill_all_blank ( )

Definition at line 3407 of file TrackerMap.cc.

References fill_current_val(), and imoduleMap.

3407  {
3408  std::map<const int, TmModule *>::iterator imod;
3409  for (imod = imoduleMap.begin(); imod != imoduleMap.end(); imod++) {
3410  fill_current_val(imod->first, 0);
3411  }
3412 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:3414

◆ fill_current_val()

void TrackerMap::fill_current_val ( int  idmod,
float  current_val 
)

Definition at line 3414 of file TrackerMap.cc.

References gather_cfg::cout, B2GTnPMonitor_cfi::idmod, imoduleMap, and mod().

Referenced by DetIdSelectorTest::analyze(), TrackerDpgAnalysis::beginRun(), and fill_all_blank().

3414  {
3416  if (mod != nullptr) {
3417  mod->value = current_val;
3418  mod->count = 1;
3419  mod->red = -1;
3420  } else
3421  std::cout << "**error in fill_current_val method ***module " << idmod << std::endl;
3422 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ fill_current_val_fed_channel()

void TrackerMap::fill_current_val_fed_channel ( int  fedId,
int  fedCh,
float  current_val 
)

Definition at line 3244 of file TrackerMap.cc.

References apvMap, TmApvPair::count, gather_cfg::cout, l1tstage2_dqm_sourceclient-live_cfg::fedId, submitPVResolutionJobs::key, TmApvPair::red, and TmApvPair::value.

3244  {
3245  int key = fedId * 1000 + fedCh;
3246  TmApvPair *apvpair = apvMap[key];
3247 
3248  if (apvpair != nullptr) {
3249  apvpair->value = current_val;
3250  apvpair->count = 1;
3251  apvpair->red = -1;
3252  } else
3253  std::cout << "*** error in FedTrackerMap fill_current_val method ***";
3254 }
int red
Definition: TmApvPair.h:10
key
prepare the HTCondor submission files and eventually submit them
int count
Definition: TmApvPair.h:13
SvgApvPair apvMap
Definition: TrackerMap.h:175
float value
Definition: TmApvPair.h:11

◆ fill_fec_channel()

void TrackerMap::fill_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
float  qty 
)

Definition at line 3270 of file TrackerMap.cc.

References generateTowerEtThresholdLUT::addr, ccuMap, TmCcu::count, gather_cfg::cout, FCDTask_cfi::crate, submitPVResolutionJobs::key, relativeConstraints::ring, FCDTask_cfi::slot, and TmCcu::value.

3270  {
3271  int key = crate * 10000000 + slot * 100000 + ring * 1000 + addr;
3272  TmCcu *ccu = ccuMap[key];
3273  if (ccu != nullptr) {
3274  ccu->count++;
3275  ccu->value = ccu->value + qty;
3276  return;
3277  }
3278 
3279  std::cout << "*** error in FecTrackerMap fill by module method ***";
3280 }
MapCcu ccuMap
Definition: TrackerMap.h:182
int count
Definition: TmCcu.h:11
key
prepare the HTCondor submission files and eventually submit them
float value
Definition: TmCcu.h:9
Definition: TmCcu.h:4

◆ fill_fed_channel() [1/2]

void TrackerMap::fill_fed_channel ( int  fedId,
int  fedCh,
float  qty 
)

Definition at line 3366 of file TrackerMap.cc.

References apvMap, TmApvPair::count, gather_cfg::cout, l1tstage2_dqm_sourceclient-live_cfg::fedId, submitPVResolutionJobs::key, and TmApvPair::value.

3366  {
3367  int key = fedId * 1000 + fedCh;
3368  TmApvPair *apvpair = apvMap[key];
3369  if (apvpair != nullptr) {
3370  apvpair->value = apvpair->value + qty;
3371  apvpair->count++;
3372  return;
3373  }
3374  std::cout << "*** error inFedTrackerMap fill method ***";
3375 }
key
prepare the HTCondor submission files and eventually submit them
int count
Definition: TmApvPair.h:13
SvgApvPair apvMap
Definition: TrackerMap.h:175
float value
Definition: TmApvPair.h:11

◆ fill_fed_channel() [2/2]

void TrackerMap::fill_fed_channel ( int  modId,
float  qty 
)

Definition at line 3231 of file TrackerMap.cc.

References apvModuleMap, TmApvPair::count, gather_cfg::cout, B2GTnPMonitor_cfi::idmod, and TmApvPair::value.

3231  {
3232  std::multimap<const int, TmApvPair *>::iterator pos;
3233  for (pos = apvModuleMap.lower_bound(idmod); pos != apvModuleMap.upper_bound(idmod); ++pos) {
3234  TmApvPair *apvpair = pos->second;
3235  if (apvpair != nullptr) {
3236  apvpair->value = apvpair->value + qty;
3237  apvpair->count++;
3238  }
3239  }
3240  return;
3241  std::cout << "*** error in FedTrackerMap fill by module method ***";
3242 }
ModApvPair apvModuleMap
Definition: TrackerMap.h:177
int count
Definition: TmApvPair.h:13
float value
Definition: TmApvPair.h:11

◆ fill_hv_channel2()

void TrackerMap::fill_hv_channel2 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 3335 of file TrackerMap.cc.

References TmPsu::countHV2, gather_cfg::cout, FCDTask_cfi::crate, submitPVResolutionJobs::key, psuMap, and TmPsu::valueHV2.

3335  {
3336  int key = rack * 1000 + crate * 100 + board;
3337  TmPsu *psu = psuMap[key];
3338  if (psu != nullptr) {
3339  psu->countHV2++;
3340  psu->valueHV2 = psu->valueHV2 + qty;
3341  return;
3342  }
3343 
3344  std::cout << "*** error in HVTrackerMap fill by module method ***";
3345 }
int countHV2
Definition: TmPsu.h:44
key
prepare the HTCondor submission files and eventually submit them
float valueHV2
Definition: TmPsu.h:42
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmPsu.h:6

◆ fill_hv_channel3()

void TrackerMap::fill_hv_channel3 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 3346 of file TrackerMap.cc.

References TmPsu::countHV3, gather_cfg::cout, FCDTask_cfi::crate, submitPVResolutionJobs::key, psuMap, and TmPsu::valueHV3.

3346  {
3347  int key = rack * 1000 + crate * 100 + board;
3348  TmPsu *psu = psuMap[key];
3349  if (psu != nullptr) {
3350  psu->countHV3++;
3351  psu->valueHV3 = psu->valueHV3 + qty;
3352  return;
3353  }
3354 
3355  std::cout << "*** error in HVTrackerMap fill by module method ***";
3356 }
key
prepare the HTCondor submission files and eventually submit them
int countHV3
Definition: TmPsu.h:45
float valueHV3
Definition: TmPsu.h:41
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmPsu.h:6

◆ fill_lv_channel()

void TrackerMap::fill_lv_channel ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 3296 of file TrackerMap.cc.

References TmPsu::count, gather_cfg::cout, FCDTask_cfi::crate, submitPVResolutionJobs::key, psuMap, and TmPsu::value.

3296  {
3297  int key = rack * 1000 + crate * 100 + board;
3298  TmPsu *psu = psuMap[key];
3299  if (psu != nullptr) {
3300  psu->count++;
3301  psu->value = psu->value + qty;
3302  return;
3303  }
3304 
3305  std::cout << "*** error in LVTrackerMap fill by module method ***";
3306 }
int count
Definition: TmPsu.h:43
float value
Definition: TmPsu.h:40
key
prepare the HTCondor submission files and eventually submit them
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmPsu.h:6

◆ fillc() [1/3]

void TrackerMap::fillc ( int  idmod,
int  RGBcode 
)
inline

◆ fillc() [2/3]

void TrackerMap::fillc ( int  idmod,
int  red,
int  green,
int  blue 
)

Definition at line 3377 of file TrackerMap.cc.

References DivergingColor::blue, gather_cfg::cout, B2GTnPMonitor_cfi::idmod, imoduleMap, mod(), and DivergingColor::red.

3377  {
3379  if (mod != nullptr) {
3380  mod->red = red;
3381  mod->green = green;
3382  mod->blue = blue;
3383  return;
3384  }
3385  std::cout << "**************************error in fill method **************module " << idmod << std::endl;
3386 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ fillc() [3/3]

void TrackerMap::fillc ( int  layer,
int  ring,
int  nmod,
int  red,
int  green,
int  blue 
)

Definition at line 3387 of file TrackerMap.cc.

References DivergingColor::blue, gather_cfg::cout, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mod(), DivergingColor::red, relativeConstraints::ring, and smoduleMap.

3387  {
3388  int key = layer * 10000 + ring * 1000 + nmod;
3389  TmModule *mod = smoduleMap[key];
3390 
3391  if (mod != nullptr) {
3392  mod->red = red;
3393  mod->green = green;
3394  mod->blue = blue;
3395  return;
3396  }
3397  std::cout << "**************************error in fill method **************" << std::endl;
3398 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
key
prepare the HTCondor submission files and eventually submit them
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ fillc_all_blank()

void TrackerMap::fillc_all_blank ( )

Definition at line 3400 of file TrackerMap.cc.

References fillc(), and imoduleMap.

3400  {
3401  std::map<const int, TmModule *>::iterator imod;
3402  for (imod = imoduleMap.begin(); imod != imoduleMap.end(); imod++) {
3403  fillc(imod->first, 255, 255, 255);
3404  }
3405 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:134

◆ fillc_fec_channel()

void TrackerMap::fillc_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
int  red,
int  green,
int  blue 
)

Definition at line 3256 of file TrackerMap.cc.

References generateTowerEtThresholdLUT::addr, TmCcu::blue, DivergingColor::blue, ccuMap, gather_cfg::cout, FCDTask_cfi::crate, TmCcu::green, submitPVResolutionJobs::key, TmCcu::red, DivergingColor::red, relativeConstraints::ring, and FCDTask_cfi::slot.

3256  {
3257  int key = crate * 10000000 + slot * 100000 + ring * 1000 + addr;
3258 
3259  TmCcu *ccu = ccuMap[key];
3260 
3261  if (ccu != nullptr) {
3262  ccu->red = red;
3263  ccu->green = green;
3264  ccu->blue = blue;
3265  return;
3266  }
3267  std::cout << "*** error in FecTrackerMap fillc method ***";
3268 }
MapCcu ccuMap
Definition: TrackerMap.h:182
key
prepare the HTCondor submission files and eventually submit them
int green
Definition: TmCcu.h:8
int red
Definition: TmCcu.h:8
int blue
Definition: TmCcu.h:8
Definition: TmCcu.h:4

◆ fillc_fed_channel()

void TrackerMap::fillc_fed_channel ( int  fedId,
int  fedCh,
int  red,
int  green,
int  blue 
)

Definition at line 3218 of file TrackerMap.cc.

References apvMap, TmApvPair::blue, DivergingColor::blue, gather_cfg::cout, l1tstage2_dqm_sourceclient-live_cfg::fedId, TmApvPair::green, submitPVResolutionJobs::key, TmApvPair::red, and DivergingColor::red.

3218  {
3219  int key = fedId * 1000 + fedCh;
3220  TmApvPair *apvpair = apvMap[key];
3221 
3222  if (apvpair != nullptr) {
3223  apvpair->red = red;
3224  apvpair->green = green;
3225  apvpair->blue = blue;
3226  return;
3227  }
3228  std::cout << "*** error in FedTrackerMap fillc method ***";
3229 }
int green
Definition: TmApvPair.h:10
int red
Definition: TmApvPair.h:10
key
prepare the HTCondor submission files and eventually submit them
int blue
Definition: TmApvPair.h:10
SvgApvPair apvMap
Definition: TrackerMap.h:175

◆ fillc_hv_channel2()

void TrackerMap::fillc_hv_channel2 ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 3308 of file TrackerMap.cc.

References DivergingColor::blue, TmPsu::blueHV2, gather_cfg::cout, FCDTask_cfi::crate, TmPsu::greenHV2, submitPVResolutionJobs::key, psuMap, DivergingColor::red, and TmPsu::redHV2.

3308  {
3309  int key = rack * 1000 + crate * 100 + board;
3310 
3311  TmPsu *psu = psuMap[key];
3312 
3313  if (psu != nullptr) {
3314  psu->redHV2 = red;
3315  psu->greenHV2 = green;
3316  psu->blueHV2 = blue;
3317  return;
3318  }
3319  std::cout << "*** error in HVTrackerMap (channel 2) fillc method ***";
3320 }
int redHV2
Definition: TmPsu.h:38
int greenHV2
Definition: TmPsu.h:38
key
prepare the HTCondor submission files and eventually submit them
MapPsu psuMap
Definition: TrackerMap.h:186
int blueHV2
Definition: TmPsu.h:38
Definition: TmPsu.h:6

◆ fillc_hv_channel3()

void TrackerMap::fillc_hv_channel3 ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 3321 of file TrackerMap.cc.

References DivergingColor::blue, TmPsu::blueHV3, gather_cfg::cout, FCDTask_cfi::crate, TmPsu::greenHV3, submitPVResolutionJobs::key, psuMap, DivergingColor::red, and TmPsu::redHV3.

3321  {
3322  int key = rack * 1000 + crate * 100 + board;
3323 
3324  TmPsu *psu = psuMap[key];
3325 
3326  if (psu != nullptr) {
3327  psu->redHV3 = red;
3328  psu->greenHV3 = green;
3329  psu->blueHV3 = blue;
3330  return;
3331  }
3332  std::cout << "*** error in HVTrackerMap (channel 3) fillc method ***";
3333 }
int greenHV3
Definition: TmPsu.h:39
int blueHV3
Definition: TmPsu.h:39
key
prepare the HTCondor submission files and eventually submit them
int redHV3
Definition: TmPsu.h:39
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmPsu.h:6

◆ fillc_lv_channel()

void TrackerMap::fillc_lv_channel ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 3282 of file TrackerMap.cc.

References TmPsu::blue, DivergingColor::blue, gather_cfg::cout, FCDTask_cfi::crate, TmPsu::green, submitPVResolutionJobs::key, psuMap, TmPsu::red, and DivergingColor::red.

3282  {
3283  int key = rack * 1000 + crate * 100 + board;
3284 
3285  TmPsu *psu = psuMap[key];
3286 
3287  if (psu != nullptr) {
3288  psu->red = red;
3289  psu->green = green;
3290  psu->blue = blue;
3291  return;
3292  }
3293  std::cout << "*** error in LVTrackerMap fillc method ***";
3294 }
int red
Definition: TmPsu.h:37
key
prepare the HTCondor submission files and eventually submit them
int green
Definition: TmPsu.h:37
int blue
Definition: TmPsu.h:37
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmPsu.h:6

◆ find_layer()

int TrackerMap::find_layer ( int  ix,
int  iy 
)
inline

Definition at line 218 of file TrackerMap.h.

References PVValHelper::add(), ix, iy, nano_mu_digi_cff::layer, xsize, and ysize.

218  {
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  }
void add(std::map< std::string, TH1 *> &h, TH1 *hist)

◆ findfile()

std::ifstream * TrackerMap::findfile ( std::string  filename)

Definition at line 4294 of file TrackerMap.cc.

References gather_cfg::cout, corrVsCorr::filename, contentValuesFiles::fullPath, recoMuon::in, jsPath, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by printall(), and printonline().

4294  {
4295  std::ifstream *ifilename;
4296  std::string ifname;
4297  if (!jsPath.empty()) {
4298  ifname = jsPath + filename;
4299  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(), std::ios::in);
4300  if (!ifilename) {
4301  ifname = "CommonTools/TrackerMap/data/" + filename;
4302  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(), std::ios::in);
4303  }
4304  } else {
4305  ifname = "CommonTools/TrackerMap/data/" + filename;
4306  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(), std::ios::in);
4307  }
4308  if (!ifilename)
4309  std::cout << "File " << filename << " missing" << std::endl;
4310  return ifilename;
4311 }
std::string jsPath
Definition: TrackerMap.h:200

◆ getAutomaticRange()

std::pair< float, float > TrackerMap::getAutomaticRange ( )

Definition at line 815 of file TrackerMap.cc.

References firstRing, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, CrabHelper::log, mod(), module(), ntotRing, relativeConstraints::ring, smoduleMap, and tkMapLog.

815  {
816  float minval, maxval;
817  minval = 9999999.;
818  maxval = -9999999.;
819  for (int layer = 1; layer < 44; layer++) {
820  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
821  for (int module = 1; module < 200; module++) {
822  int key = layer * 100000 + ring * 1000 + module;
824  if (mod != nullptr && !mod->notInUse() && mod->count > 0) {
825  if (minval > mod->value)
826  minval = mod->value;
827  if (maxval < mod->value)
828  maxval = mod->value;
829  }
830  }
831  }
832  }
833  if (tkMapLog) {
834  minval = log(minval) / log(10);
835  maxval = log(maxval) / log(10);
836  }
837  return std::make_pair(minval, maxval);
838 }
bool tkMapLog
Definition: TrackerMap.h:197
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
int firstRing[43]
Definition: TrackerMap.h:647
key
prepare the HTCondor submission files and eventually submit them
Definition: value.py:1
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
int ntotRing[43]
Definition: TrackerMap.h:646

◆ getcolor()

int TrackerMap::getcolor ( float  value,
int  palette 
)

Definition at line 3514 of file TrackerMap.cc.

References DivergingColor::blue, dumpMFGeometry_cfg::delta, createfilelist::int, CrabHelper::log, maxvalue, minvalue, palette, DivergingColor::red, tkMapLog, and x.

Referenced by drawApvPair(), drawCcu(), drawHV2(), drawHV3(), drawModule(), drawPalette(), and drawPsu().

3514  {
3515  int red, green, blue;
3516  float lminvalue, lmaxvalue;
3517  lminvalue = minvalue;
3518  lmaxvalue = maxvalue;
3519  if (tkMapLog) {
3520  lminvalue = log(minvalue) / log(10);
3521  lmaxvalue = log(maxvalue) / log(10);
3522  value = log(value) / log(10);
3523  }
3524 
3525  red = 0;
3526  green = 0;
3527  blue = 0;
3528  if (palette == 1) { //palette1 1 - raibow
3529  float delta = (lmaxvalue - lminvalue);
3530  float x = (value - lminvalue);
3531  if (value < lminvalue) {
3532  red = 0;
3533  green = 0;
3534  blue = 255;
3535  }
3536  if (value > lmaxvalue) {
3537  red = 255;
3538  green = 0;
3539  blue = 0;
3540  }
3541  if (value >= lminvalue && value <= lmaxvalue) {
3542  red = (int)(x < (delta / 2) ? 0 : (x > ((3. / 4.) * delta) ? 255 : 255 / (delta / 4) * (x - (2. / 4.) * delta)));
3543  green =
3544  (int)(x < delta / 4 ? (x * 255 / (delta / 4))
3545  : (x > ((3. / 4.) * delta) ? 255 - 255 / (delta / 4) * (x - (3. / 4.) * delta) : 255));
3546  blue = (int)(x < delta / 4 ? 255
3547  : (x > ((1. / 2.) * delta) ? 0 : 255 - 255 / (delta / 4) * (x - (1. / 4.) * delta)));
3548  }
3549  }
3550  if (palette == 2) { //palette 2 yellow-green
3551  green = (int)((value - lminvalue) / (lmaxvalue - lminvalue) * 256.);
3552  if (green > 255)
3553  green = 255;
3554  red = 255;
3555  blue = 0;
3556  green = 255 - green;
3557  }
3558  // std::cout<<red<<" "<<green<<" "<<blue<<" "<<value <<" "<<lminvalue<<" "<< lmaxvalue<<std::endl;
3559  return (blue | (green << 8) | (red << 16));
3560 }
bool tkMapLog
Definition: TrackerMap.h:197
float minvalue
Definition: TrackerMap.h:667
Definition: value.py:1
float maxvalue
Definition: TrackerMap.h:667

◆ getlayerCount()

int TrackerMap::getlayerCount ( int  subdet,
int  partdet 
)
inline

Definition at line 243 of file TrackerMap.h.

Referenced by init().

243  {
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  }

◆ getmoduleCount()

int TrackerMap::getmoduleCount ( int  subdet,
int  partdet,
int  layer,
int  ring 
)
inline

Definition at line 536 of file TrackerMap.h.

References nano_mu_digi_cff::layer, and relativeConstraints::ring.

Referenced by init().

536  {
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  }

◆ getNumMod()

int TrackerMap::getNumMod ( )
inline

Definition at line 168 of file TrackerMap.h.

168 { return number_modules; };
int number_modules
Definition: TrackerMap.h:668

◆ getringCount()

int TrackerMap::getringCount ( int  subdet,
int  partdet,
int  layer 
)
inline

Definition at line 498 of file TrackerMap.h.

References nano_mu_digi_cff::layer.

Referenced by init().

498  {
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  }

◆ getxsize()

int TrackerMap::getxsize ( )
inline

Definition at line 164 of file TrackerMap.h.

References xsize.

164 { return xsize; };

◆ getysize()

int TrackerMap::getysize ( )
inline

Definition at line 165 of file TrackerMap.h.

References ysize.

165 { return ysize; };

◆ init()

void TrackerMap::init ( void  )

Definition at line 472 of file TrackerMap.cc.

References addPixelFlag, build(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), firstcall, firstRing, getlayerCount(), getmoduleCount(), getringCount(), gmaxvalue, gminvalue, isRingStereo(), ix, iy, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, maxvalue, minvalue, module(), nlayer(), npart, ntotRing, onlyPixelFlag, palette, posrel, printflag, relativeConstraints::ring, smoduleMap, and temporary_file.

Referenced by TrackerMap().

472  {
473  ix = 0;
474  iy = 0; //used to compute the place of each layer in the tracker map
475  firstcall = true;
476  minvalue = 0.;
477  maxvalue = minvalue;
478  posrel = true;
479  palette = 1;
480  printflag = true;
481  addPixelFlag = false;
482  onlyPixelFlag = false;
483  temporary_file = false;
484  gminvalue = 0.;
485  gmaxvalue = 0.; //default global range for online rendering
486 
487  int constexpr ndet = 3; // number of detectors: pixel, inner silicon, outer silicon
488  int constexpr npart = 3; // number of detector parts: endcap -z, barrel, endcap +z
489 
490  //allocate module map
491  for (int subdet = 1; subdet < ndet + 1; subdet++) { //loop on subdetectors
492  for (int detpart = 1; detpart < npart + 1; detpart++) { //loop on subdetectors parts
493  int nlayers = getlayerCount(subdet, detpart); // compute number of layers
494  for (int layer = 1; layer < nlayers + 1; layer++) { //loop on layers
495  int nrings = getringCount(subdet, detpart, layer); // compute number of rings
496  //fill arrays used to do the loop on the rings
497  int layer_g = nlayer(subdet, detpart, layer);
498  ntotRing[layer_g - 1] = nrings;
499  firstRing[layer_g - 1] = 1;
500  if (subdet == 3 && detpart != 2)
501  firstRing[layer_g - 1] = 8 - nrings; //special numbering for TEC
502  for (int ring = firstRing[layer_g - 1]; ring < ntotRing[layer_g - 1] + firstRing[layer_g - 1];
503  ring++) { //loop on rings
504  int nmodules = getmoduleCount(subdet, detpart, layer, ring); // compute number of modules
505  int key = 0;
506  TmModule *smodule;
507  for (int module = 1; module < nmodules + 1; module++) { //loop on modules
508  smodule = new TmModule(module, ring, layer_g);
509  key = layer_g * 100000 + ring * 1000 + module; //key identifying module
510  smoduleMap[key] = smodule;
511  }
512  if (isRingStereo(key))
513  for (int module = 1; module < nmodules + 1; module++) { //loop on stereo modules
514  smodule = new TmModule(module + 100, ring, layer_g);
515  int key = layer_g * 100000 + ring * 1000 + module + 100;
516  smoduleMap[key] = smodule;
517  }
518  }
519  }
520  }
521  }
522  build();
523 }
void build()
Definition: TrackerMap.cc:3471
float minvalue
Definition: TrackerMap.h:667
int getmoduleCount(int subdet, int partdet, int layer, int ring)
Definition: TrackerMap.h:536
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
bool addPixelFlag
Definition: TrackerMap.h:674
int getlayerCount(int subdet, int partdet)
Definition: TrackerMap.h:243
double npart
Definition: HydjetWrapper.h:48
int firstRing[43]
Definition: TrackerMap.h:647
float gminvalue
Definition: TrackerMap.h:666
bool posrel
Definition: TrackerMap.h:659
int getringCount(int subdet, int partdet, int layer)
Definition: TrackerMap.h:498
bool temporary_file
Definition: TrackerMap.h:669
bool onlyPixelFlag
Definition: TrackerMap.h:675
key
prepare the HTCondor submission files and eventually submit them
bool printflag
Definition: TrackerMap.h:190
int nlayer(int det, int part, int lay)
Definition: TrackerMap.h:595
float gmaxvalue
Definition: TrackerMap.h:666
float maxvalue
Definition: TrackerMap.h:667
bool firstcall
Definition: TrackerMap.h:660
static bool isRingStereo(int key)
Definition: TrackerMap.h:583
int ntotRing[43]
Definition: TrackerMap.h:646

◆ isRingStereo()

static bool TrackerMap::isRingStereo ( int  key)
inlinestatic

Definition at line 583 of file TrackerMap.h.

References submitPVResolutionJobs::key, nano_mu_digi_cff::layer, and relativeConstraints::ring.

Referenced by drawModule(), and init().

583  {
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  }
key
prepare the HTCondor submission files and eventually submit them

◆ layername()

std::string TrackerMap::layername ( int  layer)
inline

Definition at line 620 of file TrackerMap.h.

References nano_mu_digi_cff::layer, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

620  {
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  }

◆ layerno()

static int TrackerMap::layerno ( int  subdet,
int  leftright,
int  layer 
)
inlinestatic

Definition at line 561 of file TrackerMap.h.

References cms::cuda::assert(), and nano_mu_digi_cff::layer.

561  {
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  }
assert(be >=bs)

◆ load()

void TrackerMap::load ( std::string  s = "tmap.svg")

Definition at line 3064 of file TrackerMap.cc.

References gather_cfg::cout, fill(), recoMuon::in, inputfile, mps_splice::line, AlCaHLTBitMon_QueryRunRegistry::string, heppy_batch::val, and relativeConstraints::value.

Referenced by MatrixToProcess.MatrixToProcess::getProcess(), MatrixToProcess.MatrixToProcess::listAll(), and ConfigBuilder.ConfigBuilder::prepare_FILTER().

3064  {
3065  inputfile = new std::ifstream(inputfilename.c_str(), std::ios::in);
3067  int ipos, ipos1, ipos2, id = 0, val = 0;
3068  int nline = 0;
3069  while (getline(*inputfile, line)) {
3070  ipos1 = line.find("value=\"");
3071  if (ipos1 > 0) {
3072  value = line.substr(ipos1 + 7, 10);
3073  ipos = value.find('\"');
3074  value = value.substr(0, ipos);
3075  val = atoi(value.c_str());
3076  }
3077  ipos2 = line.find("detid=\"");
3078  if (ipos2 > 0) {
3079  value = line.substr(ipos2 + 7, 10);
3080  ipos = value.find('\"');
3081  value = value.substr(0, ipos);
3082  id = atoi(value.c_str());
3083  }
3084  if (ipos1 > 0 && ipos2 > 0 && val > 0)
3085  this->fill(id, val);
3086  if (ipos1 > 0 && ipos2 > 0)
3087  nline++;
3088  //if(ipos1>0 && ipos2>0)std::cout << nline << " " << id << " " << val << std::endl;
3089  }
3090  std::cout << nline << " modules found in this svg file " << std::endl;
3091  inputfile->close();
3092  delete inputfile;
3093 }
std::ifstream * inputfile
Definition: TrackerMap.h:664
Definition: value.py:1
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:3444

◆ module()

int TrackerMap::module ( int  fedId,
int  fedCh 
)

Definition at line 3358 of file TrackerMap.cc.

References apvMap, l1tstage2_dqm_sourceclient-live_cfg::fedId, TmModule::idex, submitPVResolutionJobs::key, and TmApvPair::mod.

Referenced by getAutomaticRange(), init(), print(), printall(), printlayers(), printonline(), save(), and ~TrackerMap().

3358  {
3359  int key = fedId * 1000 + fedCh;
3360  TmApvPair *apvpair = apvMap[key];
3361  if (apvpair != nullptr) {
3362  return (apvpair->mod->idex);
3363  }
3364  return (0);
3365 }
TmModule * mod
Definition: TmApvPair.h:16
unsigned int idex
Definition: TmModule.h:28
key
prepare the HTCondor submission files and eventually submit them
SvgApvPair apvMap
Definition: TrackerMap.h:175

◆ nlayer()

int TrackerMap::nlayer ( int  det,
int  part,
int  lay 
)
inline

Definition at line 595 of file TrackerMap.h.

References gather_cfg::cout.

Referenced by init().

595  {
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  }
part
Definition: HCALResponse.h:20

◆ onlyPixel()

void TrackerMap::onlyPixel ( bool  onlyPixelfl)
inline

Definition at line 161 of file TrackerMap.h.

References onlyPixelFlag.

161 { onlyPixelFlag = onlyPixelfl; };
bool onlyPixelFlag
Definition: TrackerMap.h:675

◆ phival()

double TrackerMap::phival ( double  x,
double  y 
)
inline

Definition at line 203 of file TrackerMap.h.

References M_PI, phi, x, and y.

Referenced by drawModule().

203  {
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  }
#define M_PI

◆ print()

void TrackerMap::print ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap" 
)

Definition at line 3098 of file TrackerMap.cc.

References defwindow(), drawModule(), drawPalette(), firstRing, contentValuesFiles::fullPath, recoMuon::in, jsfile, jsfilename, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mps_splice::line, maxvalue, minvalue, mod(), module(), ntotRing, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, relativeConstraints::ring, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, and title.

Referenced by SiStripQualityStatistics::dqmEndJob(), and SiStripQualityStatistics::updateAndSave().

3098  {
3099  temporary_file = false;
3100  std::ostringstream outs;
3101  minvalue = minval;
3102  maxvalue = maxval;
3103  outs << outputfilename << ".xml";
3104  svgfile = new std::ofstream(outs.str().c_str(), std::ios::out);
3105  jsfile = new std::ifstream(edm::FileInPath(jsfilename).fullPath().c_str(), std::ios::in);
3106 
3107  //copy javascript interface from trackermap.txt file
3108  std::string line;
3109  while (getline(*jsfile, line)) {
3110  *svgfile << line << std::endl;
3111  }
3112  jsfile->close();
3113  delete jsfile;
3114  //
3115  if (!print_total) {
3116  for (int layer = 1; layer < 44; layer++) {
3117  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
3118  for (int module = 1; module < 200; module++) {
3119  int key = layer * 100000 + ring * 1000 + module;
3120  TmModule *mod = smoduleMap[key];
3121  if (mod != nullptr && !mod->notInUse()) {
3122  mod->value = mod->value / mod->count;
3123  }
3124  }
3125  }
3126  }
3127  }
3128  if (minvalue >= maxvalue) {
3129  minvalue = 9999999.;
3130  maxvalue = -9999999.;
3131  for (int layer = 1; layer < 44; layer++) {
3132  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
3133  for (int module = 1; module < 200; module++) {
3134  int key = layer * 100000 + ring * 1000 + module;
3135  TmModule *mod = smoduleMap[key];
3136  if (mod != nullptr && !mod->notInUse()) {
3137  if (minvalue > mod->value)
3138  minvalue = mod->value;
3139  if (maxvalue < mod->value)
3140  maxvalue = mod->value;
3141  }
3142  }
3143  }
3144  }
3145  }
3146  for (int layer = 1; layer < 44; layer++) {
3147  // nlay=layer;
3148  defwindow(layer);
3149  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
3150  for (int module = 1; module < 200; module++) {
3151  int key = layer * 100000 + ring * 1000 + module;
3152  TmModule *mod = smoduleMap[key];
3153  if (mod != nullptr && !mod->notInUse()) {
3154  drawModule(mod, key, layer, print_total, svgfile);
3155  }
3156  }
3157  }
3158  }
3159  *svgfile << "</svg:g></svg:svg>" << std::endl;
3160  *svgfile << " <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" << title << "</svg:text>" << std::endl;
3161  if (printflag)
3163  *svgfile << "</svg:svg>" << std::endl;
3164  *svgfile << "</body></html>" << std::endl;
3165  svgfile->close();
3166  delete svgfile;
3167 }
float minvalue
Definition: TrackerMap.h:667
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
void defwindow(int num_lay)
Definition: TrackerMap.h:388
int firstRing[43]
Definition: TrackerMap.h:647
bool temporary_file
Definition: TrackerMap.h:669
std::ofstream * svgfile
Definition: TrackerMap.h:661
key
prepare the HTCondor submission files and eventually submit them
Definition: value.py:1
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:561
bool printflag
Definition: TrackerMap.h:190
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:3169
std::string title
Definition: TrackerMap.h:198
float maxvalue
Definition: TrackerMap.h:667
std::ifstream * jsfile
Definition: TrackerMap.h:663
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
int ntotRing[43]
Definition: TrackerMap.h:646
std::string jsfilename
Definition: TrackerMap.h:199

◆ printall()

void TrackerMap::printall ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap",
int  width = 6000,
int  height = 3200 
)

Definition at line 3904 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, mps_check::command, gather_cfg::cout, FCDTask_cfi::crate, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedMap, ConfigBuilder::filetype, findfile(), firstcrate, firstRing, newFWLiteAna::found, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, B2GTnPMonitor_cfi::idmod, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mps_splice::line, mod(), TmApvPair::mod, module(), TmCcu::mpos, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, ntotRing, haddnano::ofname, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, funct::pow(), printlayers(), psuMap, psuModuleMap, runTheMatrix::ret, relativeConstraints::ring, alignCSCRings::s, save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), save_as_psutrackermap(), saveGeoTrackerMap, saveWebInterface, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, tkMapLog, makeMuonMisalignmentScenario::txtfile, and ApeEstimator_cff::width.

3904  {
3905  //Copy interface
3906  float minval, maxval;
3907  minval = minval1;
3908  maxval = maxval1;
3909  if (tkMapLog && (minval < maxval)) {
3910  minval = pow(10., minval1);
3911  maxval = pow(10., maxval1);
3912  }
3914  if (saveWebInterface) {
3915  width = 6000;
3916  height = 3200;
3917  } else {
3918  size_t found = filetype.find_last_of('.');
3919  filetype = filetype.substr(found + 1);
3920  found = outputfilename.find_last_of('.');
3921  outputfilename = outputfilename.substr(0, found);
3922  }
3923  std::ofstream *ofilename;
3924  std::ifstream *ifilename;
3925  std::ostringstream ofname;
3926  std::string ifname;
3927  std::string line;
3929  if (saveWebInterface) {
3930  ifilename = findfile("viewerHeader.xhtml");
3931  ofname << outputfilename << "viewer.html";
3932  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3933  while (getline(*ifilename, line)) {
3934  *ofilename << line << std::endl;
3935  }
3936  *ofilename << " var tmapname=\"" << outputfilename << "\"" << std::endl;
3937  *ofilename << " var tmaptitle=\"" << title << "\"" << std::endl;
3938  *ofilename << " var ncrates=" << ncrates << ";" << std::endl;
3939  *ofilename << " var nfeccrates=" << nfeccrates << ";" << std::endl;
3940  *ofilename << " var npsuracks=" << npsuracks << ";" << std::endl;
3941  ifilename->close();
3942  delete ifilename;
3943  ifilename = findfile("viewerTrailer.xhtml");
3944  while (getline(*ifilename, line)) {
3945  *ofilename << line << std::endl;
3946  }
3947  ofilename->close();
3948  delete ofilename;
3949  ifilename->close();
3950  delete ifilename;
3951  command = "sed -i \"s/XtmapnameX/" + outputfilename + "/g\" " + ofname.str();
3952  std::cout << "Executing " << command << std::endl;
3953  system(command.c_str());
3954  command = "sed -i \"s/XtmaptitleX/" + title + "/g\" " + ofname.str();
3955  std::cout << "Executing " << command << std::endl;
3956  system(command.c_str());
3957  ofname.str("");
3958 
3959  ifilename = findfile("jqviewer.js");
3960  ofname << "jqviewer.js";
3961  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3962  while (getline(*ifilename, line)) {
3963  *ofilename << line << std::endl;
3964  }
3965  ofilename->close();
3966  delete ofilename;
3967  ifilename->close();
3968  delete ifilename;
3969 
3970  ofname.str("");
3971  ifilename = findfile("crate.js");
3972  ofname << "crate.js";
3973  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3974  while (getline(*ifilename, line)) {
3975  *ofilename << line << std::endl;
3976  }
3977  ofilename->close();
3978  delete ofilename;
3979  ifilename->close();
3980  delete ifilename;
3981 
3982  ofname.str("");
3983  ifilename = findfile("feccrate.js");
3984  ofname << "feccrate.js";
3985  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3986  while (getline(*ifilename, line)) {
3987  *ofilename << line << std::endl;
3988  }
3989  ofilename->close();
3990  delete ofilename;
3991  ifilename->close();
3992  delete ifilename;
3993 
3994  ofname.str("");
3995  ifilename = findfile("rack.js");
3996  ofname << "rack.js";
3997  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3998  while (getline(*ifilename, line)) {
3999  *ofilename << line << std::endl;
4000  }
4001  ofilename->close();
4002  delete ofilename;
4003  ifilename->close();
4004  delete ifilename;
4005 
4006  ofname.str("");
4007  ifilename = findfile("rackhv.js");
4008  ofname << "rackhv.js";
4009  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
4010  while (getline(*ifilename, line)) {
4011  *ofilename << line << std::endl;
4012  }
4013  ofilename->close();
4014  delete ofilename;
4015  ifilename->close();
4016  delete ifilename;
4017 
4018  ofname.str("");
4019  ifilename = findfile("layer.js");
4020  ofname << "layer.js";
4021  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
4022  while (getline(*ifilename, line)) {
4023  *ofilename << line << std::endl;
4024  }
4025  ofilename->close();
4026  delete ofilename;
4027  ifilename->close();
4028  delete ifilename;
4029 
4030  command = "scp -r ../../DQM/TrackerCommon/test/jquery/ .";
4031  std::cout << "Executing " << command << std::endl;
4032  system(command.c_str());
4033  command = "scp -r ../../CommonTools/TrackerMap/data/images/ .";
4034  std::cout << "Executing " << command << std::endl;
4035  system(command.c_str());
4036  }
4037 
4038  std::ostringstream outs;
4039  outs << outputfilename << ".png";
4040  if (saveWebInterface)
4041  save(true, minval, maxval, outs.str(), 3000, 1600);
4042  else {
4043  if (saveGeoTrackerMap)
4044  save(true, minval, maxval, s, width, height);
4045  }
4046  if (saveWebInterface) {
4047  std::ostringstream outs;
4048  outs << outputfilename << ".png";
4049  temporary_file = false;
4050  printlayers(true, minval, maxval, outputfilename);
4051 
4052  //Now print a text file for each layer
4053  std::ofstream *txtfile;
4054  for (int layer = 1; layer < 44; layer++) {
4055  std::ostringstream outs;
4056  outs << outputfilename << "layer" << layer << ".html";
4057  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
4058  *txtfile << "<html><head></head> <body>" << std::endl;
4059  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
4060  for (int module = 1; module < 200; module++) {
4061  int key = layer * 100000 + ring * 1000 + module;
4062  TmModule *mod = smoduleMap[key];
4063  if (mod != nullptr && !mod->notInUse()) {
4064  int idmod = mod->idex;
4065  *txtfile << "<a name=" << idmod << "><pre>" << std::endl;
4066  std::multimap<const int, TmApvPair *>::iterator pos;
4067  for (pos = apvModuleMap.lower_bound(idmod); pos != apvModuleMap.upper_bound(idmod); ++pos) {
4068  TmApvPair *apvpair = pos->second;
4069  if (apvpair != nullptr) {
4070  *txtfile << apvpair->text << std::endl;
4071  }
4072  }
4073  *txtfile << "</pre><h3>" << mod->name << "</h3>" << std::endl;
4074  }
4075  }
4076  }
4077  *txtfile << "</body></html>" << std::endl;
4078  txtfile->close();
4079  delete txtfile;
4080  }
4081  }
4082  if (enableFedProcessing) {
4083  std::ostringstream outs1, outs2;
4084  if (saveWebInterface)
4085  outs1 << outputfilename << "fed.png";
4086  else
4087  outs1 << outputfilename << "fed." << filetype;
4088  save_as_fedtrackermap(true, 0., 0., outs1.str(), width, height);
4089  if (saveWebInterface) {
4090  outs2 << outputfilename << ".xml";
4091  save_as_fedtrackermap(true, 0., 0., outs2.str(), 3000, 1600);
4092  //And a text file for each crate
4093  std::map<int, int>::iterator i_fed;
4094  std::ofstream *txtfile;
4095  for (int crate = firstcrate; crate < (ncrates + 1); crate++) {
4096  std::ostringstream outs;
4097  outs << outputfilename << "crate" << crate << ".html";
4098  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
4099  *txtfile << "<html><head></head> <body>" << std::endl;
4100  for (i_fed = fedMap.begin(); i_fed != fedMap.end(); i_fed++) {
4101  if (i_fed->second == crate) {
4102  int fedId = i_fed->first;
4103  for (int nconn = 0; nconn < 96; nconn++) {
4104  int key = fedId * 1000 + nconn;
4105  TmApvPair *apvPair = apvMap[key];
4106  if (apvPair != nullptr) {
4107  int idmod = apvPair->idex;
4108  *txtfile << "<a name=" << idmod << "><pre>" << std::endl;
4109  *txtfile << apvPair->text << std::endl;
4110  std::ostringstream outs;
4111  outs << "fedchannel " << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connects to module "
4112  << apvPair->mod->idex;
4113  *txtfile << "</pre><h3>" << outs.str() << "</h3>" << std::endl;
4114  }
4115  }
4116  }
4117  }
4118  *txtfile << "</body></html>" << std::endl;
4119  txtfile->close();
4120  delete txtfile;
4121  }
4122  }
4123  }
4124  if (enableFecProcessing) {
4125  std::ostringstream outs1, outs2;
4126  if (saveWebInterface)
4127  outs1 << outputfilename << "fec.png";
4128  else
4129  outs1 << outputfilename << "fec." << filetype;
4130  save_as_fectrackermap(true, 0., 0., outs1.str(), width, height);
4131  if (saveWebInterface) {
4132  outs2 << outputfilename << ".xml";
4133  save_as_fectrackermap(true, 0., 0., outs2.str(), 3000, 1600);
4134  //And a text file for each crate
4135  std::ofstream *txtfile;
4136  std::map<int, TmCcu *>::iterator i_ccu;
4137  std::multimap<TmCcu *, TmModule *>::iterator it;
4138  std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator> ret;
4139  for (int crate = 1; crate < (nfeccrates + 1); crate++) {
4140  std::ostringstream outs;
4141  outs << outputfilename << "feccrate" << crate << ".html";
4142  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
4143  *txtfile << "<html><head></head> <body>" << std::endl;
4144  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
4145  TmCcu *ccu = i_ccu->second;
4146  if (ccu != nullptr && ccu->getCcuCrate() == crate) {
4147  int idmod = ccu->idex;
4148  *txtfile << "<a name=" << idmod << "><pre>" << std::endl;
4149  *txtfile << ccu->text << std::endl;
4150  std::ostringstream outs;
4151  if (ccu->nmod == 0)
4152  outs << "ccu is in position" << ccu->mpos << "in ring but doesn't seem to have any module connected";
4153  else {
4154  outs << "ccu is in position " << ccu->mpos << " in ring and connects " << ccu->nmod << " modules"
4155  << std::endl;
4156  ret = fecModuleMap.equal_range(ccu);
4157  for (it = ret.first; it != ret.second; ++it) {
4158  outs << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value << "\n\n";
4159  }
4160 
4161  *txtfile << "</pre><h4>" << outs.str() << "</h4>" << std::endl;
4162  } //ifccu->nmod==0
4163  } //if ccu!=0
4164  } //for i_ccu
4165  *txtfile << "</body></html>" << std::endl;
4166  txtfile->close();
4167  } //for int crate
4168  }
4169  }
4170  if (enableLVProcessing) {
4171  std::ostringstream outs3, outs4;
4172  if (saveWebInterface)
4173  outs3 << outputfilename << "psu.png";
4174  else
4175  outs3 << outputfilename << "psu." << filetype;
4176  save_as_psutrackermap(true, 0., 0., outs3.str(), width, height);
4177  if (saveWebInterface) {
4178  outs4 << outputfilename << ".xml";
4179  save_as_psutrackermap(true, 0., 0., outs4.str(), 3000, 1600);
4180  //And a text file for each rack
4181 
4182  std::ofstream *txtfile;
4183  std::map<int, TmPsu *>::iterator ipsu;
4184  std::multimap<TmPsu *, TmModule *>::iterator it;
4185  std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator> ret;
4186  for (int rack = 1; rack < (npsuracks + 1); rack++) {
4187  std::ostringstream outs;
4188 
4189  outs << outputfilename << "psurack" << rack << ".html";
4190  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
4191  *txtfile << "<html><head></head> <body>" << std::endl;
4192  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
4193  TmPsu *psu = ipsu->second;
4194  if (psu != nullptr && psu->getPsuRack() == rack) {
4195  *txtfile << "<a name=" << psu->idex << "><pre>" << std::endl;
4196  *txtfile << psu->text << std::endl;
4197  std::ostringstream outs;
4198  if (psu->nmod == 0)
4199  outs << "Ps is in position" << psu->getPsuBoard()
4200  << "in crate but doesn't seem to have any module connected";
4201  else {
4202  outs << "PS is in position " << psu->getPsuBoard() << " in crate and connects to " << psu->nmod
4203  << " modules. " << std::endl;
4204 
4205  ret = psuModuleMap.equal_range(psu);
4206  for (it = ret.first; it != ret.second; ++it) {
4207  outs << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value << " <br>"
4208  << std::endl;
4209  }
4210  *txtfile << "</pre><h4>" << outs.str() << "</h4>" << std::endl;
4211  }
4212  }
4213  }
4214  *txtfile << "</body></html>" << std::endl;
4215  txtfile->close();
4216  }
4217  }
4218  }
4219 
4220  if (enableHVProcessing) {
4221  std::ostringstream outs5, outs6;
4222  if (saveWebInterface)
4223  outs5 << outputfilename << "hv.png";
4224  else
4225  outs5 << outputfilename << "hv." << filetype;
4226  save_as_HVtrackermap(true, 0., 0., outs5.str(), width, height);
4227  if (saveWebInterface) {
4228  outs6 << outputfilename << ".xml";
4229  save_as_HVtrackermap(true, 0., 0., outs6.str(), 3000, 1600);
4230  //And a text file for each rack
4231 
4232  std::ofstream *txtfile;
4233  std::map<int, TmPsu *>::iterator ipsu;
4234  std::multimap<TmPsu *, TmModule *>::iterator it;
4235  std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator> ret;
4236  for (int rack = 1; rack < (npsuracks + 1); rack++) {
4237  std::ostringstream outs;
4238 
4239  outs << outputfilename << "HVrack" << rack << ".html";
4240  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
4241  *txtfile << "<html><head></head> <body>" << std::endl;
4242  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
4243  TmPsu *psu = ipsu->second;
4244  if (psu != nullptr && psu->getPsuRack() == rack) {
4245  *txtfile << "<a name=" << psu->idex << "><pre>" << std::endl;
4246  *txtfile << psu->textHV2 << std::endl;
4247  std::ostringstream outsHV2;
4248  if (psu->nmodHV2 == 0)
4249  outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()
4250  << "in crate but doesn't seem to have any module connected";
4251  else {
4252  outsHV2 << "HV Channel002 is in position " << psu->getPsuBoard() << " in crate and connects to "
4253  << psu->nmodHV2 << " modules. "
4254  << " <br>" << std::endl;
4255 
4256  ret = psuModuleMap.equal_range(psu);
4257  for (it = ret.first; it != ret.second; ++it) {
4258  if ((*it).second->HVchannel == 2) {
4259  outsHV2 << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value
4260  << " <br>" << std::endl;
4261  }
4262  }
4263  *txtfile << "</pre><h4>" << outsHV2.str() << "</h4>" << std::endl;
4264  }
4265 
4266  *txtfile << psu->textHV3 << std::endl;
4267  std::ostringstream outsHV3;
4268  if (psu->nmodHV3 == 0)
4269  outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()
4270  << "in crate but doesn't seem to have any module connected";
4271  else {
4272  outsHV3 << "HV Channel003 is in position " << psu->getPsuBoard() << " in crate and connects to "
4273  << psu->nmodHV3 << " modules. "
4274  << " <br>" << std::endl;
4275 
4276  ret = psuModuleMap.equal_range(psu);
4277  for (it = ret.first; it != ret.second; ++it) {
4278  if ((*it).second->HVchannel == 3) {
4279  outsHV3 << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value
4280  << " <br>" << std::endl;
4281  }
4282  }
4283  *txtfile << "</pre><h4>" << outsHV3.str() << "</h4>" << std::endl;
4284  }
4285  }
4286  }
4287  *txtfile << "</body></html>" << std::endl;
4288  txtfile->close();
4289  }
4290  }
4291  }
4292 }
TmModule * mod
Definition: TmApvPair.h:16
bool tkMapLog
Definition: TrackerMap.h:197
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:177
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:4294
int nfeccrates
Definition: TrackerMap.h:655
MapCcu ccuMap
Definition: TrackerMap.h:182
int nmodHV3
Definition: TmPsu.h:48
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int idex
Definition: TmPsu.h:11
bool saveGeoTrackerMap
Definition: TrackerMap.h:192
ret
prodAgent to be discontinued
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
bool enableFecProcessing
Definition: TrackerMap.h:194
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
bool saveWebInterface
Definition: TrackerMap.h:191
int npsuracks
Definition: TrackerMap.h:656
int getPsuBoard()
Definition: TmPsu.h:31
bool enableFedProcessing
Definition: TrackerMap.h:193
int firstRing[43]
Definition: TrackerMap.h:647
int nmod
Definition: TmCcu.h:14
bool enableHVProcessing
Definition: TrackerMap.h:196
int getFedId()
Definition: TmApvPair.h:22
txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
unsigned int idex
Definition: TmModule.h:28
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
int nmod
Definition: TmPsu.h:46
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 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 temporary_file
Definition: TrackerMap.h:669
key
prepare the HTCondor submission files and eventually submit them
int getCcuCrate()
Definition: TmCcu.h:18
int getPsuRack()
Definition: TmPsu.h:22
int nmodHV2
Definition: TmPsu.h:47
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
Definition: TrackerMap.cc:4312
int mpos
Definition: TmCcu.h:17
SvgFed fedMap
Definition: TrackerMap.h:179
PsuModule psuModuleMap
Definition: TrackerMap.h:188
int firstcrate
Definition: TrackerMap.h:654
FecModule fecModuleMap
Definition: TrackerMap.h:184
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:198
int idex
Definition: TmCcu.h:12
std::string textHV3
Definition: TmPsu.h:54
SvgApvPair apvMap
Definition: TrackerMap.h:175
std::string text
Definition: TmPsu.h:52
int idex
Definition: TmApvPair.h:14
bool enableLVProcessing
Definition: TrackerMap.h:195
std::string textHV2
Definition: TmPsu.h:53
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmCcu.h:4
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::string text
Definition: TmCcu.h:10
Definition: TmPsu.h:6
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
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
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:646

◆ printlayers()

void TrackerMap::printlayers ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "layer" 
)

Definition at line 4312 of file TrackerMap.cc.

References defwindow(), drawModule(), firstRing, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, maxvalue, minvalue, mod(), module(), ntotRing, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, relativeConstraints::ring, saveAsSingleLayer, smoduleMap, and makeMuonMisalignmentScenario::xmlfile.

Referenced by printall(), and printonline().

4312  {
4313  std::ofstream *xmlfile;
4314  saveAsSingleLayer = true;
4315  if (!print_total) {
4316  for (int layer = 1; layer < 44; layer++) {
4317  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
4318  for (int module = 1; module < 200; module++) {
4319  int key = layer * 100000 + ring * 1000 + module;
4320  TmModule *mod = smoduleMap[key];
4321  if (mod != nullptr && !mod->notInUse()) {
4322  mod->value = mod->value / mod->count;
4323  }
4324  }
4325  }
4326  }
4327  }
4328  if (minvalue >= maxvalue) {
4329  minvalue = 9999999.;
4330  maxvalue = -9999999.;
4331  for (int layer = 1; layer < 44; layer++) {
4332  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
4333  for (int module = 1; module < 200; module++) {
4334  int key = layer * 100000 + ring * 1000 + module;
4335  TmModule *mod = smoduleMap[key];
4336  if (mod != nullptr && !mod->notInUse()) {
4337  if (minvalue > mod->value)
4338  minvalue = mod->value;
4339  if (maxvalue < mod->value)
4340  maxvalue = mod->value;
4341  }
4342  }
4343  }
4344  }
4345  }
4346  for (int layer = 1; layer < 44; layer++) {
4347  std::ostringstream outs;
4348  outs << outputfilename << "layer" << layer << ".xml";
4349  xmlfile = new std::ofstream(outs.str().c_str(), std::ios::out);
4350  *xmlfile << "<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
4351  *xmlfile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
4352  *xmlfile << "xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
4353  *xmlfile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
4354  *xmlfile << "<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />" << std::endl;
4355  *xmlfile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
4356  "onload=\"TrackerLayer.init()\">"
4357  << std::endl;
4358  if (layer < 31)
4359  *xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > " << std::endl;
4360  else
4361  *xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > " << std::endl;
4362  *xmlfile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />" << std::endl;
4363  *xmlfile << "<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" "
4364  "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4365  "fill=\"rgb(0,127,255)\"/>"
4366  << std::endl;
4367  *xmlfile << "<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" "
4368  "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4369  "fill=\"rgb(0,127,255)\"/>"
4370  << std::endl;
4371  *xmlfile << "<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" "
4372  "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4373  "fill=\"rgb(0,127,255)\"/>"
4374  << std::endl;
4375  *xmlfile << "<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" "
4376  "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4377  "fill=\"rgb(0,127,255)\"/>"
4378  << std::endl;
4379  *xmlfile << "<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" "
4380  "onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" "
4381  "fill=\"rgb(200,0,0)\"/>"
4382  << std::endl;
4383 
4384  // nlay=layer;
4385  defwindow(layer);
4386  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
4387  for (int module = 1; module < 200; module++) {
4388  int key = layer * 100000 + ring * 1000 + module;
4389  TmModule *mod = smoduleMap[key];
4390  if (mod != nullptr && !mod->notInUse()) {
4391  drawModule(mod, key, layer, print_total, xmlfile);
4392  }
4393  }
4394  }
4395  *xmlfile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
4396  *xmlfile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
4397  *xmlfile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
4398  *xmlfile << "<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
4399  *xmlfile << "<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
4400  if (layer > 33) {
4401  *xmlfile << "<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4402  "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" "
4403  "fill=\"white\">FED</tspan> "
4404  << std::endl;
4405  *xmlfile << "<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4406  "onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" "
4407  "fill=\"white\">FEC</tspan> "
4408  << std::endl;
4409  *xmlfile << "<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4410  "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" "
4411  "fill=\"white\">LV</tspan> "
4412  << std::endl;
4413  *xmlfile << "<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4414  "onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" "
4415  "fill=\"white\">HV</tspan> "
4416  << std::endl;
4417  *xmlfile << "<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4418  "onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" "
4419  "fill=\"white\">PLOT</tspan> "
4420  << std::endl;
4421  } else {
4422  *xmlfile << "<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4423  "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" "
4424  "fill=\"white\">FED</tspan> "
4425  << std::endl;
4426  *xmlfile << "<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4427  "onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" "
4428  "fill=\"white\">FEC</tspan> "
4429  << std::endl;
4430  *xmlfile << "<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4431  "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" "
4432  "fill=\"white\">LV</tspan> "
4433  << std::endl;
4434  *xmlfile << "<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4435  "onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" "
4436  "fill=\"white\">HV</tspan> "
4437  << std::endl;
4438  *xmlfile << "<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" "
4439  "onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" "
4440  "fill=\"white\">PLOT</tspan> "
4441  << std::endl;
4442  }
4443  *xmlfile << " </text> </svg>" << std::endl;
4444  xmlfile->close();
4445  delete xmlfile;
4446  }
4447  saveAsSingleLayer = false;
4448 }
float minvalue
Definition: TrackerMap.h:667
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
void defwindow(int num_lay)
Definition: TrackerMap.h:388
int firstRing[43]
Definition: TrackerMap.h:647
bool saveAsSingleLayer
Definition: TrackerMap.h:673
key
prepare the HTCondor submission files and eventually submit them
Definition: value.py:1
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:561
xmlfile
Make an XML representation of the misalignment.
float maxvalue
Definition: TrackerMap.h:667
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
int ntotRing[43]
Definition: TrackerMap.h:646

◆ printonline()

void TrackerMap::printonline ( )

Definition at line 3561 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, mps_check::command, gather_cfg::cout, FCDTask_cfi::crate, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedMap, findfile(), firstcrate, firstRing, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), gmaxvalue, gminvalue, TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, B2GTnPMonitor_cfi::idmod, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mps_splice::line, mod(), TmApvPair::mod, module(), TmCcu::mpos, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, ntotRing, haddnano::ofname, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printlayers(), psuMap, psuModuleMap, runTheMatrix::ret, relativeConstraints::ring, save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), save_as_psutrackermap(), smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, and makeMuonMisalignmentScenario::txtfile.

3561  {
3562  //Copy interface
3563  std::ofstream *ofilename;
3564  std::ifstream *ifilename;
3565  std::ostringstream ofname;
3566  std::string ifname;
3568  std::string line;
3569  std::string outputfilename = "dqmtmap";
3570  ifilename = findfile("viewerHeader.xhtml");
3571  ofname << outputfilename << "viewer.html";
3572  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3573  while (getline(*ifilename, line)) {
3574  *ofilename << line << std::endl;
3575  }
3576  *ofilename << " var tmapname=\"" << outputfilename << "\"" << std::endl;
3577  *ofilename << " var tmaptitle=\"" << title << "\"" << std::endl;
3578  *ofilename << " var ncrates=" << ncrates << ";" << std::endl;
3579  *ofilename << " var nfeccrates=" << nfeccrates << ";" << std::endl;
3580  *ofilename << " var npsuracks=" << npsuracks << ";" << std::endl;
3581 
3582  ifilename->close();
3583  delete ifilename;
3584 
3585  ifilename = findfile("viewerTrailer.xhtml");
3586  while (getline(*ifilename, line)) {
3587  *ofilename << line << std::endl;
3588  }
3589  ofilename->close();
3590  delete ofilename;
3591  command = "sed -i \"s/XtmapnameX/" + outputfilename + "/g\" " + ofname.str();
3592  std::cout << "Executing " << command << std::endl;
3593  system(command.c_str());
3594  command = "sed -i \"s/XtmaptitleX/" + title + "/g\" " + ofname.str();
3595  std::cout << "Executing " << command << std::endl;
3596  system(command.c_str());
3597  ofname.str("");
3598  ifilename->close();
3599  delete ifilename;
3600 
3601  ifilename = findfile("jqviewer.js");
3602  ofname << "jqviewer.js";
3603  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3604  while (getline(*ifilename, line)) {
3605  *ofilename << line << std::endl;
3606  }
3607  ofname.str("");
3608  ofilename->close();
3609  delete ofilename;
3610  ifilename->close();
3611  delete ifilename;
3612 
3613  ifilename = findfile("crate.js");
3614  ofname << "crate.js";
3615  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3616  while (getline(*ifilename, line)) {
3617  *ofilename << line << std::endl;
3618  }
3619  ofname.str("");
3620  ofilename->close();
3621  delete ofilename;
3622  ifilename->close();
3623  delete ifilename;
3624 
3625  ifilename = findfile("feccrate.js");
3626  ofname << "feccrate.js";
3627  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3628  while (getline(*ifilename, line)) {
3629  *ofilename << line << std::endl;
3630  }
3631  ofname.str("");
3632  ofilename->close();
3633  delete ofilename;
3634  ifilename->close();
3635  delete ifilename;
3636 
3637  ifilename = findfile("layer.js");
3638  ofname << "layer.js";
3639  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3640  while (getline(*ifilename, line)) {
3641  *ofilename << line << std::endl;
3642  }
3643  ofname.str("");
3644  ofilename->close();
3645  delete ofilename;
3646  ifilename->close();
3647  delete ifilename;
3648 
3649  ifilename = findfile("rack.js");
3650  ofname << "rack.js";
3651  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3652  while (getline(*ifilename, line)) {
3653  *ofilename << line << std::endl;
3654  }
3655  ofname.str("");
3656  ofilename->close();
3657  delete ofilename;
3658  ifilename->close();
3659  delete ifilename;
3660  ofname.str("");
3661 
3662  ifilename = findfile("rackhv.js");
3663  ofname << "rackhv.js";
3664  ofilename = new std::ofstream(ofname.str().c_str(), std::ios::out);
3665  while (getline(*ifilename, line)) {
3666  *ofilename << line << std::endl;
3667  }
3668  ofname.str("");
3669  ofilename->close();
3670  delete ofilename;
3671  ifilename->close();
3672  delete ifilename;
3673 
3674  std::ostringstream outs, outs1, outs2;
3675  outs << outputfilename << ".png";
3676  save(true, gminvalue, gmaxvalue, outs.str(), 3000, 1600);
3677  temporary_file = false;
3679 
3680  //Now print a text file for each layer
3681  std::ofstream *txtfile;
3682  for (int layer = 1; layer < 44; layer++) {
3683  std::ostringstream outs;
3684  outs << outputfilename << "layer" << layer << ".html";
3685  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
3686  *txtfile << "<html><head></head> <body>" << std::endl;
3687  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
3688  for (int module = 1; module < 200; module++) {
3689  int key = layer * 100000 + ring * 1000 + module;
3690  TmModule *mod = smoduleMap[key];
3691  if (mod != nullptr && !mod->notInUse()) {
3692  int idmod = mod->idex;
3693  *txtfile << "<a name=" << idmod << "><pre>" << std::endl;
3694  std::multimap<const int, TmApvPair *>::iterator pos;
3695  for (pos = apvModuleMap.lower_bound(idmod); pos != apvModuleMap.upper_bound(idmod); ++pos) {
3696  TmApvPair *apvpair = pos->second;
3697  if (apvpair != nullptr) {
3698  *txtfile << apvpair->text << std::endl;
3699  }
3700  }
3701  *txtfile << "</pre><h3>" << mod->name << "</h3>" << std::endl;
3702  }
3703  }
3704  }
3705  *txtfile << "</body></html>" << std::endl;
3706  txtfile->close();
3707  delete txtfile;
3708  }
3709  if (enableFedProcessing) {
3710  outs1 << outputfilename << "fed.png";
3711  save_as_fedtrackermap(true, gminvalue, gmaxvalue, outs1.str(), 6000, 3200);
3712  outs2 << outputfilename << ".xml";
3713  save_as_fedtrackermap(true, gminvalue, gmaxvalue, outs2.str(), 3000, 1600);
3714  //And a text file for each crate
3715  std::map<int, int>::iterator i_fed;
3716  std::ofstream *txtfile;
3717  for (int crate = firstcrate; crate < (ncrates + 1); crate++) {
3718  std::ostringstream outs;
3719  outs << outputfilename << "crate" << crate << ".html";
3720  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
3721  *txtfile << "<html><head></head> <body>" << std::endl;
3722  for (i_fed = fedMap.begin(); i_fed != fedMap.end(); i_fed++) {
3723  if (i_fed->second == crate) {
3724  int fedId = i_fed->first;
3725  for (int nconn = 0; nconn < 96; nconn++) {
3726  int key = fedId * 1000 + nconn;
3727  TmApvPair *apvPair = apvMap[key];
3728  if (apvPair != nullptr) {
3729  int idmod = apvPair->idex;
3730  *txtfile << "<a name=" << idmod << "><pre>" << std::endl;
3731  *txtfile << apvPair->text << std::endl;
3732  std::ostringstream outs;
3733  outs << "fedchannel " << apvPair->getFedId() << "/" << apvPair->getFedCh() << " connects to module "
3734  << apvPair->mod->idex;
3735  *txtfile << "</pre><h3>" << outs.str() << "</h3>" << std::endl;
3736  }
3737  }
3738  }
3739  }
3740  *txtfile << "</body></html>" << std::endl;
3741  txtfile->close();
3742  delete txtfile;
3743  }
3744  }
3745  if (enableFecProcessing) {
3746  std::ostringstream outs1, outs2;
3747  outs1 << outputfilename << "fec.png";
3748  save_as_fectrackermap(true, gminvalue, gmaxvalue, outs1.str(), 6000, 3200);
3749  outs2 << outputfilename << ".xml";
3750  save_as_fectrackermap(true, gminvalue, gmaxvalue, outs2.str(), 3000, 1600);
3751  //And a text file for each crate
3752  std::ofstream *txtfile;
3753  std::map<int, TmCcu *>::iterator i_ccu;
3754  std::multimap<TmCcu *, TmModule *>::iterator it;
3755  std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator> ret;
3756  for (int crate = 1; crate < (nfeccrates + 1); crate++) {
3757  std::ostringstream outs;
3758  outs << outputfilename << "feccrate" << crate << ".html";
3759  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
3760  *txtfile << "<html><head></head> <body>" << std::endl;
3761  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
3762  TmCcu *ccu = i_ccu->second;
3763  if (ccu != nullptr && ccu->getCcuCrate() == crate) {
3764  int idmod = ccu->idex;
3765  *txtfile << "<a name=" << idmod << "><pre>" << std::endl;
3766  *txtfile << ccu->text << std::endl;
3767  std::ostringstream outs;
3768  if (ccu->nmod == 0)
3769  outs << "ccu is in position" << ccu->mpos << "in ring but doesn't seem to have any module connected";
3770  else {
3771  outs << "ccu is in position " << ccu->mpos << " in ring and connects " << ccu->nmod << " modules"
3772  << std::endl;
3773  ret = fecModuleMap.equal_range(ccu);
3774  for (it = ret.first; it != ret.second; ++it) {
3775  outs << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value << "\n\n";
3776  }
3777 
3778  *txtfile << "</pre><h4>" << outs.str() << "</h4>" << std::endl;
3779  } //ifccu->nmod==0
3780  } //if ccu!=0
3781  } //for i_ccu
3782  *txtfile << "</body></html>" << std::endl;
3783  txtfile->close();
3784  delete txtfile;
3785  } //for int crate
3786  }
3787  if (enableLVProcessing) {
3788  std::ostringstream outs3, outs4;
3789  outs3 << outputfilename << "psu.png";
3790  save_as_psutrackermap(true, gminvalue, gmaxvalue, outs3.str(), 6000, 3200);
3791 
3792  outs4 << outputfilename << ".xml";
3793  save_as_psutrackermap(true, gminvalue, gmaxvalue, outs4.str(), 3000, 1600);
3794  //And a text file for each rack
3795 
3796  std::ofstream *txtfile;
3797  std::map<int, TmPsu *>::iterator ipsu;
3798  std::multimap<TmPsu *, TmModule *>::iterator it;
3799  std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator> ret;
3800  for (int rack = 1; rack < (npsuracks + 1); rack++) {
3801  std::ostringstream outs;
3802 
3803  outs << outputfilename << "psurack" << rack << ".html";
3804  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
3805  *txtfile << "<html><head></head> <body>" << std::endl;
3806  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
3807  TmPsu *psu = ipsu->second;
3808  if (psu != nullptr && psu->getPsuRack() == rack) {
3809  *txtfile << "<a name=" << psu->idex << "><pre>" << std::endl;
3810  *txtfile << psu->text << std::endl;
3811  std::ostringstream outs;
3812  if (psu->nmod == 0)
3813  outs << "Ps is in position" << psu->getPsuBoard()
3814  << "in crate but doesn't seem to have any module connected";
3815  else {
3816  outs << "PS is in position " << psu->getPsuBoard() << " in crate and connects to " << psu->nmod
3817  << " modules. " << std::endl;
3818 
3819  ret = psuModuleMap.equal_range(psu);
3820  for (it = ret.first; it != ret.second; ++it) {
3821  outs << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value << " <br>"
3822  << std::endl;
3823  }
3824  *txtfile << "</pre><h4>" << outs.str() << "</h4>" << std::endl;
3825  }
3826  }
3827  }
3828  *txtfile << "</body></html>" << std::endl;
3829  txtfile->close();
3830  delete txtfile;
3831  }
3832  }
3833 
3834  if (enableHVProcessing) {
3835  std::ostringstream outs5, outs6;
3836  outs5 << outputfilename << "hv.png";
3837  save_as_HVtrackermap(true, gminvalue, gmaxvalue, outs5.str(), 6000, 3200);
3838 
3839  outs6 << outputfilename << ".xml";
3840  save_as_HVtrackermap(true, gminvalue, gmaxvalue, outs6.str(), 3000, 1600);
3841  //And a text file for each rack
3842 
3843  std::ofstream *txtfile;
3844  std::map<int, TmPsu *>::iterator ipsu;
3845  std::multimap<TmPsu *, TmModule *>::iterator it;
3846  std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator> ret;
3847  for (int rack = 1; rack < (npsuracks + 1); rack++) {
3848  std::ostringstream outs;
3849 
3850  outs << outputfilename << "HVrack" << rack << ".html";
3851  txtfile = new std::ofstream(outs.str().c_str(), std::ios::out);
3852  *txtfile << "<html><head></head> <body>" << std::endl;
3853  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
3854  TmPsu *psu = ipsu->second;
3855  if (psu != nullptr && psu->getPsuRack() == rack) {
3856  *txtfile << "<a name=" << psu->idex << "><pre>" << std::endl;
3857  *txtfile << psu->textHV2 << std::endl;
3858  std::ostringstream outsHV2;
3859  if (psu->nmodHV2 == 0)
3860  outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()
3861  << "in crate but doesn't seem to have any module connected";
3862  else {
3863  outsHV2 << "HV Channel002 is in position " << psu->getPsuBoard() << " in crate and connects to "
3864  << psu->nmodHV2 << " modules. "
3865  << " <br>" << std::endl;
3866 
3867  ret = psuModuleMap.equal_range(psu);
3868  for (it = ret.first; it != ret.second; ++it) {
3869  if ((*it).second->HVchannel == 2) {
3870  outsHV2 << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value
3871  << " <br>" << std::endl;
3872  }
3873  }
3874  *txtfile << "</pre><h4>" << outsHV2.str() << "</h4>" << std::endl;
3875  }
3876 
3877  *txtfile << psu->textHV3 << std::endl;
3878  std::ostringstream outsHV3;
3879  if (psu->nmodHV3 == 0)
3880  outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()
3881  << "in crate but doesn't seem to have any module connected";
3882  else {
3883  outsHV3 << "HV Channel003 is in position " << psu->getPsuBoard() << " in crate and connects to "
3884  << psu->nmodHV3 << " modules. "
3885  << " <br>" << std::endl;
3886 
3887  ret = psuModuleMap.equal_range(psu);
3888  for (it = ret.first; it != ret.second; ++it) {
3889  if ((*it).second->HVchannel == 3) {
3890  outsHV3 << (*it).second->idex << " " << (*it).second->name << " value= " << (*it).second->value
3891  << " <br>" << std::endl;
3892  }
3893  }
3894  *txtfile << "</pre><h4>" << outsHV3.str() << "</h4>" << std::endl;
3895  }
3896  }
3897  }
3898  *txtfile << "</body></html>" << std::endl;
3899  txtfile->close();
3900  delete txtfile;
3901  }
3902  }
3903 }
TmModule * mod
Definition: TmApvPair.h:16
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:177
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:4294
int nfeccrates
Definition: TrackerMap.h:655
MapCcu ccuMap
Definition: TrackerMap.h:182
int nmodHV3
Definition: TmPsu.h:48
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int idex
Definition: TmPsu.h:11
ret
prodAgent to be discontinued
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
bool enableFecProcessing
Definition: TrackerMap.h:194
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
int npsuracks
Definition: TrackerMap.h:656
int getPsuBoard()
Definition: TmPsu.h:31
bool enableFedProcessing
Definition: TrackerMap.h:193
int firstRing[43]
Definition: TrackerMap.h:647
float gminvalue
Definition: TrackerMap.h:666
int nmod
Definition: TmCcu.h:14
bool enableHVProcessing
Definition: TrackerMap.h:196
int getFedId()
Definition: TmApvPair.h:22
txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
unsigned int idex
Definition: TmModule.h:28
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
int nmod
Definition: TmPsu.h:46
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 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 temporary_file
Definition: TrackerMap.h:669
key
prepare the HTCondor submission files and eventually submit them
int getCcuCrate()
Definition: TmCcu.h:18
int getPsuRack()
Definition: TmPsu.h:22
int nmodHV2
Definition: TmPsu.h:47
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
Definition: TrackerMap.cc:4312
int mpos
Definition: TmCcu.h:17
SvgFed fedMap
Definition: TrackerMap.h:179
PsuModule psuModuleMap
Definition: TrackerMap.h:188
int firstcrate
Definition: TrackerMap.h:654
FecModule fecModuleMap
Definition: TrackerMap.h:184
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:198
int idex
Definition: TmCcu.h:12
std::string textHV3
Definition: TmPsu.h:54
SvgApvPair apvMap
Definition: TrackerMap.h:175
std::string text
Definition: TmPsu.h:52
float gmaxvalue
Definition: TrackerMap.h:666
int idex
Definition: TmApvPair.h:14
bool enableLVProcessing
Definition: TrackerMap.h:195
std::string textHV2
Definition: TmPsu.h:53
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmCcu.h:4
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::string text
Definition: TmCcu.h:10
Definition: TmPsu.h:6
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
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:646

◆ reset()

void TrackerMap::reset ( void  )

Definition at line 462 of file TrackerMap.cc.

References imoduleMap, and mod().

Referenced by MatrixReader.MatrixReader::__init__(), data_sources.json_list::__next__(), and MatrixReader.MatrixReader::showRaw().

462  {
463  std::map<int, TmModule *>::iterator i_mod;
464  for (i_mod = imoduleMap.begin(); i_mod != imoduleMap.end(); i_mod++) {
465  TmModule *mod = i_mod->second;
466  mod->count = 0;
467  mod->value = 0;
468  mod->red = -1;
469  }
470 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ save()

void TrackerMap::save ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap.svg",
int  width = 1500,
int  height = 800 
)

Definition at line 843 of file TrackerMap.cc.

References addPixelFlag, newFWLiteAna::bin, DivergingColor::blue, buildLegend(), DummyCfis::c, cuy::col, mps_check::command, submitPVResolutionJobs::content, gather_cfg::cout, defwindow(), drawModule(), drawPalette(), corrVsCorr::filename, ConfigBuilder::filetype, firstRing, newFWLiteAna::found, mps_fire::i, recoMuon::in, submitPVResolutionJobs::key, MainPageGenerator::l, nano_mu_digi_cff::layer, CrabHelper::log, maxvalue, minvalue, mod(), module(), npoints, ntotRing, onlyPixelFlag, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, DivergingColor::red, relativeConstraints::ring, cond::runnumber, alignCSCRings::s, savefile, saveGeoTrackerMap, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, vc, ApeEstimator_cff::width, x, and y.

Referenced by SiStripDetVOffTkMapPlotter::analyze(), TkVoltageMapCreator::beginRun(), TrackerDpgAnalysis::beginRun(), SiStripCorrelateNoise::DoPlots(), SiStripQualityStatistics::dqmEndJob(), SiStripCorrelateBadStripAndNoise::endJob(), SiStripPlotGain::endJob(), DetIdSelectorTest::endJob(), BuildTrackerMapPlugin::endJob(), SiStripHitResolFromCalibTree::makeTKMap(), SiStripHitEffFromCalibTree::makeTKMap(), printall(), printonline(), SpecificationBuilder_cfi.Specification::saveAll(), SiStripBaseCondObjDQM::saveTkMap(), and SiStripQualityStatistics::updateAndSave().

843  {
844  printflag = true;
845  bool rangefound = true;
846  if (saveGeoTrackerMap) {
848  std::vector<TPolyLine *> vp;
849  TGaxis *axis = nullptr;
850  size_t found = filetype.find_last_of('.');
851  filetype = filetype.substr(found + 1);
852  found = outputfilename.find_last_of('.');
853  outputfilename = outputfilename.substr(0, found);
854  //outputfilename.erase(outputfilename.begin()+outputfilename.find("."),outputfilename.end());
855  temporary_file = true;
856 
857  //Dev option to produce only one plot
858  //if(outputfilename != "StoNCorrOnTrack")
859  // return;
860 
861  if (filetype == "svg")
862  temporary_file = false;
863  std::ostringstream outs;
864  minvalue = minval;
865  maxvalue = maxval;
866  outs << outputfilename << ".coor";
867  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
868  if (!print_total) {
869  for (int layer = 1; layer < 44; layer++) {
870  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
871  for (int module = 1; module < 200; module++) {
872  int key = layer * 100000 + ring * 1000 + module;
874  if (mod != nullptr && !mod->notInUse()) {
875  mod->value = mod->value / mod->count;
876  }
877  }
878  }
879  }
880  }
881 
882  if (minvalue >= maxvalue) {
883  minvalue = 9999999.;
884  maxvalue = -9999999.;
885  rangefound = false;
886  for (int layer = 1; layer < 44; layer++) {
887  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
888  for (int module = 1; module < 200; module++) {
889  int key = layer * 100000 + ring * 1000 + module;
891  if (mod != nullptr && !mod->notInUse() && mod->count > 0) {
892  rangefound = true;
893  if (minvalue > mod->value)
894  minvalue = mod->value;
895  if (maxvalue < mod->value)
896  maxvalue = mod->value;
897  }
898  }
899  }
900  }
901  }
902  if ((title.find("QTestAlarm") != std::string::npos) || (maxvalue == minvalue) || !rangefound)
903  printflag = false;
904  if (!temporary_file) {
905  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
906  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
907  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
908  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
909  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600"
910  << "\" width=\"" << width << "\" height=\"" << height << "\">" << std::endl;
911  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> "
912  << std::endl;
913  *savefile << "<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" "
914  "style=\"fill:none;stroke:black;stroke-width:0;\"> "
915  << std::endl;
916  }
917  for (int layer = 1; layer < 44; layer++) {
918  // nlay=layer;
919  defwindow(layer);
920  for (int ring = firstRing[layer - 1]; ring < ntotRing[layer - 1] + firstRing[layer - 1]; ring++) {
921  for (int module = 1; module < 200; module++) {
922  int key = layer * 100000 + ring * 1000 + module;
924  if (mod != nullptr && !mod->notInUse()) {
925  drawModule(mod, key, layer, print_total, savefile);
926  }
927  }
928  }
929  }
930 
931  if (!temporary_file) {
932  *savefile << "</svg:g>" << std::endl;
933  *savefile << " <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">" << title << "</svg:text>"
934  << std::endl;
935  }
936 
937  if (printflag) {
938  if (onlyPixelFlag) {
939  drawPalette(savefile, -30);
940  } else {
942  }
943  }
944  if (!temporary_file) {
945  *savefile << "</svg:svg>" << std::endl;
946  *savefile << "</svg>" << std::endl;
947  }
948  savefile->close();
949  delete savefile;
950 
951  const char *command1;
952  std::string tempfilename = outputfilename + ".coor";
953  if (filetype == "svg") {
954  std::string command = "mv " + tempfilename + " " + outputfilename + ".svg";
955  command1 = command.c_str();
956  std::cout << "Executing " << command1 << std::endl;
957  system(command1);
958  }
959 
960  if (temporary_file) { // create root trackermap image
961  //Variables for TH2Poly bin content and name from temporary .coor file
962  float content;
963  std::string named;
964 
965  int red, green, blue, npoints, colindex, ncolor;
966  double x[4], y[4];
967  std::ifstream tempfile(tempfilename.c_str(), std::ios::in);
968  TCanvas *MyC = new TCanvas("MyC", "TrackerMap", width, height);
969  gPad->SetFillColor(38);
970 
971  if (addPixelFlag) {
972  gPad->Range(0, 0, 3800, 1600);
973  } else if (onlyPixelFlag) {
974  gPad->Range(-100, 0, 800, 1600);
975  } else {
976  gPad->Range(800, 0, 3800, 1600);
977  }
978 
979  //First build palette
980  ncolor = 0;
981  typedef std::map<int, int> ColorList;
982  ColorList colorList;
983  ColorList::iterator pos;
984  TColor *col, *c;
985  std::cout << "tempfilename " << tempfilename << std::endl;
986  while (!tempfile.eof()) {
987  tempfile >> named >> content >> red >> green >> blue >> npoints;
988  colindex = red + green * 1000 + blue * 1000000;
989  pos = colorList.find(colindex);
990  if (pos == colorList.end()) {
991  colorList[colindex] = ncolor + 100;
992  col = gROOT->GetColor(ncolor + 100);
993  if (col)
994  col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
995  else
996  c = new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
997  vc.push_back(c);
998  ncolor++;
999  }
1000  for (int i = 0; i < npoints; i++) {
1001  tempfile >> x[i] >> y[i];
1002  }
1003  }
1004 
1005  if (ncolor > 0 && ncolor < 10000) {
1006  Int_t colors[10000];
1007  for (int i = 0; i < ncolor; i++) {
1008  colors[i] = i + 100;
1009  }
1010  gStyle->SetPalette(ncolor, colors);
1011  }
1012 
1013  tempfile.clear();
1014  tempfile.seekg(0, std::ios::beg);
1015  std::cout << "created palette with " << ncolor << " colors" << std::endl;
1016 
1017  //TH2Poly Tracker Map for Strip
1018  TH2Poly *StripMap = new TH2Poly("StripSummary", "", 775, 3600, 0, 1350);
1019  StripMap->SetFloat(true);
1020  StripMap->GetXaxis()->SetTitle("");
1021  StripMap->GetYaxis()->SetTitle("");
1022  StripMap->SetStats(false);
1023  int siterator = 0;
1024 
1025  while (!tempfile.eof()) { //create polylines
1026  siterator++;
1027  //Get TH2Poly bin name and content from temporary .coor file
1028  tempfile >> named >> content >> red >> green >> blue >> npoints;
1029 
1030  for (int i = 0; i < npoints; i++) {
1031  tempfile >> x[i] >> y[i];
1032  }
1033  colindex = red + green * 1000 + blue * 1000000;
1034  pos = colorList.find(colindex);
1035  if (pos != colorList.end()) {
1036  TPolyLine *pline = new TPolyLine(npoints, y, x);
1037  vp.push_back(pline);
1038  pline->SetFillColor(colorList[colindex]);
1039 
1040  TGraph *bin = new TGraph(npoints, y, x);
1041  //Fill only 15145 TH2Poly bins (Strip only), instead of 16588 bins (Pixel+Strip, old)
1042  if ((siterator >= 1 && siterator <= 3608) || (siterator >= 4281 && siterator <= 7888) ||
1043  (siterator >= 8657 && siterator <= 16588)) {
1044  bin->SetName(named.c_str());
1045  StripMap->AddBin(bin);
1046  StripMap->Fill(named.c_str(), content);
1047  }
1048 
1049  pline->SetLineWidth(0);
1050  pline->Draw("f");
1051  }
1052  }
1053  if (printflag) {
1054  float lminvalue = minvalue;
1055  float lmaxvalue = maxvalue;
1056  if (tkMapLog) {
1057  lminvalue = log(minvalue) / log(10);
1058  lmaxvalue = log(maxvalue) / log(10);
1059  }
1060  if (onlyPixelFlag) {
1061  axis = new TGaxis(-30, 36, -30, 1530, lminvalue, lmaxvalue, 510, "+L");
1062  } else {
1063  axis = new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510, "+L");
1064  }
1065  axis->SetLabelSize(0.02);
1066  axis->Draw();
1067  }
1068  TLatex l;
1069  l.SetTextSize(0.03);
1070  l.DrawLatex(950, 1330, "TID");
1071  l.DrawLatex(2300, 1330, "TEC");
1072  l.DrawLatex(300, 1330, "FPIX");
1073  l.DrawLatex(20, 560, "BPIX L1");
1074  l.DrawLatex(500, 385, "BPIX L2");
1075  l.DrawLatex(500, 945, "BPIX L3");
1076  l.SetTextSize(0.04);
1077  std::string fulltitle = title;
1078  if (tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos))
1079  fulltitle += ": Log10 scale";
1080  if (onlyPixelFlag) {
1081  l.DrawLatex(30, 1500, fulltitle.c_str());
1082  } else {
1083  l.DrawLatex(850, 1500, fulltitle.c_str());
1084  }
1085  if (onlyPixelFlag) {
1086  l.DrawLatex(380, 40, "-z");
1087  } else {
1088  l.DrawLatex(1730, 40, "-z");
1089  }
1090  if (onlyPixelFlag) {
1091  l.DrawLatex(380, 1330, "+z");
1092  } else {
1093  l.DrawLatex(1730, 1360, "+z");
1094  }
1095  l.DrawLatex(1085, 330, "TIB L1");
1096  l.DrawLatex(1085, 1000, "TIB L2");
1097  l.DrawLatex(1585, 330, "TIB L3");
1098  l.DrawLatex(1585, 1000, "TIB L4");
1099  l.DrawLatex(2085, 330, "TOB L1");
1100  l.DrawLatex(2085, 1000, "TOB L2");
1101  l.DrawLatex(2585, 330, "TOB L3");
1102  l.DrawLatex(2585, 1000, "TOB L4");
1103  l.DrawLatex(3085, 330, "TOB L5");
1104  l.DrawLatex(3085, 1000, "TOB L6");
1105  TArrow arx(3448, 1190, 3448, 1350, 0.01, "|>");
1106  l.DrawLatex(3460, 1350, "x");
1107  TArrow ary(3448, 1190, 3312, 1190, 0.01, "|>");
1108  l.DrawLatex(3312, 1210, "y");
1109  TArrow arz(3485, 373, 3485, 676, 0.01, "|>");
1110  l.DrawLatex(3510, 667, "z");
1111  TArrow arphi(3485, 511, 3037, 511, 0.01, "|>");
1112  l.DrawLatex(3023, 520, "#Phi");
1113  arx.SetLineWidth(3);
1114  ary.SetLineWidth(3);
1115  arz.SetLineWidth(3);
1116  arphi.SetLineWidth(3);
1117  if (onlyPixelFlag) {
1118  arx.SetX1(570);
1119  arx.SetX2(570);
1120  arx.SetY1(1190);
1121  arx.SetY2(1350);
1122  l.DrawLatex(570 + 12, 1190 + 160, "x");
1123  ary.SetX1(570);
1124  ary.SetX2(570 - 160);
1125  ary.SetY1(1190);
1126  ary.SetY2(1190);
1127  l.DrawLatex(570 - 160, 1190 + 30, "y");
1128  arz.SetX1(380);
1129  arz.SetX2(380);
1130  arz.SetY1(683 - 100);
1131  arz.SetY2(683 + 100);
1132  l.DrawLatex(380 + 15, 683 + 100 - 9, "z");
1133  arphi.SetX1(380);
1134  arphi.SetX2(380 - 390);
1135  arphi.SetY1(683);
1136  arphi.SetY2(683);
1137  l.DrawLatex(380 - 390 - 14, 683 + 9, "#Phi");
1138  }
1139  arx.Draw();
1140  ary.Draw();
1141  arz.Draw();
1142  arphi.Draw();
1143  TLegend *MyL = buildLegend();
1144 
1145  if (title.find("QTestAlarm") != std::string::npos) {
1146  MyL->Draw();
1147  }
1148  MyC->Update();
1149  if (filetype == "png") {
1150  std::string filename = outputfilename + ".png";
1151  std::cout << "printing " << filename << std::endl;
1152  MyC->Print(filename.c_str());
1153  }
1154  if (filetype == "jpg") {
1155  std::string filename = outputfilename + ".jpg";
1156  MyC->Print(filename.c_str());
1157  }
1158  if (filetype == "pdf") {
1159  std::string filename = outputfilename + ".pdf";
1160  MyC->Print(filename.c_str());
1161  }
1162  std::string command = "rm " + tempfilename;
1163  command1 = command.c_str();
1164  std::cout << "Executing " << command1 << std::endl;
1165  system(command1);
1166  MyC->Clear();
1167  delete MyC;
1168  delete MyL;
1169 
1170  //Canvas name = MyT for both Pixel and Strip Tracker Maps
1171  TCanvas *MyT = new TCanvas("MyT", "MyT", 3500, 1500);
1172  //gPad->SetFillColor(38);//Fill pad
1173  StripMap->SetLineColor(kBlack);
1174  StripMap->SetLineWidth(0);
1175  StripMap->Draw("AL COLZ");
1176  MyT->Update();
1177 
1178  //Rainbow palette, fix pad margin and palette position
1179  gStyle->SetPalette(kRainBow);
1180  TPaletteAxis *realPalette = (TPaletteAxis *)StripMap->GetListOfFunctions()->FindObject("palette");
1181  realPalette->SetX1NDC(0.92);
1182  realPalette->SetX2NDC(0.94);
1183  realPalette->SetY1NDC(0.02);
1184  realPalette->SetY2NDC(0.91);
1185  gPad->SetRightMargin(0.08);
1186  gPad->SetLeftMargin(0.01);
1187  gPad->SetTopMargin(0.09);
1188  gPad->SetBottomMargin(0.02);
1189  gPad->Update();
1190 
1191  //Fill pad with text and arrows
1192  TLatex l2;
1193  l2.SetTextSize(0.06);
1195  for (char c : title)
1196  if (std::isdigit(c))
1197  runnumber.push_back(c);
1198  std::string striptitle = "Run " + runnumber + ": Strip " + outputfilename;
1199  l2.DrawLatex(800, 1380, striptitle.c_str());
1200  l2.SetTextSize(0.05);
1201  l2.DrawLatex(1200, 40, "-z");
1202  l2.DrawLatex(1200, 1300, "+z");
1203  l2.DrawLatex(1085, 310, "TIB L1");
1204  l2.DrawLatex(1085, 1000, "TIB L2");
1205  l2.DrawLatex(1585, 310, "TIB L3");
1206  l2.DrawLatex(1585, 1000, "TIB L4");
1207  l2.DrawLatex(2085, 310, "TOB L1");
1208  l2.DrawLatex(2085, 1000, "TOB L2");
1209  l2.DrawLatex(2585, 310, "TOB L3");
1210  l2.DrawLatex(2585, 1000, "TOB L4");
1211  l2.DrawLatex(3085, 310, "TOB L5");
1212  l2.DrawLatex(3085, 1000, "TOB L6");
1213  l2.DrawLatex(3460, 1320, "x");
1214  l2.DrawLatex(3315, 1210, "y");
1215  l2.DrawLatex(3510, 667, "z");
1216  l2.DrawLatex(3023, 530, "#Phi");
1217  arx.SetY2(1320);
1218  ary.SetX2(3320);
1219  arz.SetX1(3490);
1220  arz.SetX2(3490);
1221  arphi.SetX1(3490);
1222  arx.Draw();
1223  ary.Draw();
1224  arz.Draw();
1225  arphi.Draw();
1226  MyT->Update();
1227 
1228  std::string filename = outputfilename + ".root";
1229  MyT->Print(filename.c_str());
1230  delete MyT;
1231 
1232  if (printflag)
1233  delete axis;
1234  for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
1235  delete (*pos1);
1236  }
1237  }
1238  }
1239  return;
1240 }
bool tkMapLog
Definition: TrackerMap.h:197
float minvalue
Definition: TrackerMap.h:667
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
std::ofstream * savefile
Definition: TrackerMap.h:662
bool saveGeoTrackerMap
Definition: TrackerMap.h:192
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:3358
void defwindow(int num_lay)
Definition: TrackerMap.h:388
bool addPixelFlag
Definition: TrackerMap.h:674
int firstRing[43]
Definition: TrackerMap.h:647
bool temporary_file
Definition: TrackerMap.h:669
bool onlyPixelFlag
Definition: TrackerMap.h:675
key
prepare the HTCondor submission files and eventually submit them
static const int npoints
Definition: value.py:1
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:561
bool printflag
Definition: TrackerMap.h:190
TLegend * buildLegend()
Definition: TrackerMap.cc:4450
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:3169
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:198
Definition: colors.py:1
col
Definition: cuy.py:1009
float maxvalue
Definition: TrackerMap.h:667
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< TColor * > vc
Definition: TrackerMap.h:168
int ntotRing[43]
Definition: TrackerMap.h:646

◆ save_as_fectrackermap()

void TrackerMap::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 at line 1833 of file TrackerMap.cc.

References TmCcu::blue, DivergingColor::blue, DummyCfis::c, ccuMap, cuy::col, mps_check::command, submitPVResolutionJobs::content, TmCcu::count, gather_cfg::cout, FCDTask_cfi::crate, deffecwindow(), drawCcu(), drawPalette(), enableFecProcessing, fecModuleMap, corrVsCorr::filename, ConfigBuilder::filetype, newFWLiteAna::found, TmCcu::getCcuCrate(), TmCcu::getCcuSlot(), TmCcu::green, mps_fire::i, recoMuon::in, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, MainPageGenerator::l, CrabHelper::log, maxvalue, minvalue, nfeccrates, TmCcu::nmod, npoints, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, TmCcu::red, DivergingColor::red, runTheMatrix::ret, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmCcu::value, vc, ApeEstimator_cff::width, x, and y.

Referenced by printall(), and printonline().

1834  {
1835  if (enableFecProcessing) {
1837  std::vector<TPolyLine *> vp;
1838  TGaxis *axis = nullptr;
1839  size_t found = filetype.find_last_of('.');
1840  filetype = filetype.substr(found + 1);
1841  found = outputfilename.find_last_of('.');
1842  outputfilename = outputfilename.substr(0, found);
1843  temporary_file = true;
1844  if (filetype == "xml" || filetype == "svg")
1845  temporary_file = false;
1846  std::ostringstream outs;
1847  minvalue = minval;
1848  maxvalue = maxval;
1849  outs << outputfilename << ".coor";
1850  if (temporary_file)
1851  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
1852  std::map<int, TmCcu *>::iterator i_ccu;
1853  std::multimap<TmCcu *, TmModule *>::iterator it;
1854  std::pair<std::multimap<TmCcu *, TmModule *>::iterator, std::multimap<TmCcu *, TmModule *>::iterator> ret;
1855  //Decide if we must use Module or Ccu value
1856  bool useCcuValue = false;
1857 
1858  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
1859  TmCcu *ccu = i_ccu->second;
1860  if (ccu != nullptr) {
1861  if (ccu->count > 0 || ccu->red != -1) {
1862  useCcuValue = true;
1863  break;
1864  }
1865  }
1866  }
1867 
1868  if (!useCcuValue) //store mean of connected modules value{
1869  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
1870  TmCcu *ccu = i_ccu->second;
1871  if (ccu != nullptr) {
1872  ret = fecModuleMap.equal_range(ccu);
1873  for (it = ret.first; it != ret.second; ++it) {
1874  if ((*it).second->count > 0) {
1875  ccu->value = ccu->value + (*it).second->value;
1876  ccu->count++;
1877  }
1878  }
1879  if (ccu->count > 0)
1880  ccu->value = ccu->value / ccu->count;
1881  if (ccu->nmod == 0) {
1882  ccu->red = 0;
1883  ccu->green = 0;
1884  ccu->blue = 0;
1885  }
1886  }
1887  }
1888 
1889  if (title.find("QTestAlarm") != std::string::npos) {
1890  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
1891  TmCcu *ccu = i_ccu->second;
1892  if (ccu != nullptr) {
1893  ret = fecModuleMap.equal_range(ccu);
1894  ccu->red = 0;
1895  ccu->green = 255;
1896  ccu->blue = 0;
1897  for (it = ret.first; it != ret.second; ++it) {
1898  if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
1899  !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
1900  ccu->red = 255;
1901  ccu->green = 0;
1902  ccu->blue = 0;
1903  }
1904  }
1905  }
1906  }
1907  }
1908 
1909  if (!print_total) {
1910  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
1911  TmCcu *ccu = i_ccu->second;
1912  if (ccu != nullptr) {
1913  if (useCcuValue)
1914  ccu->value = ccu->value / ccu->count;
1915  }
1916  }
1917  }
1918 
1919  if (minvalue >= maxvalue) {
1920  minvalue = 9999999.;
1921  maxvalue = -9999999.;
1922  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
1923  TmCcu *ccu = i_ccu->second;
1924  if (ccu != nullptr && ccu->count > 0) {
1925  if (minvalue > ccu->value)
1926  minvalue = ccu->value;
1927  if (maxvalue < ccu->value)
1928  maxvalue = ccu->value;
1929  }
1930  }
1931  }
1932 
1933  if (filetype == "svg") {
1934  saveAsSingleLayer = false;
1935  std::ostringstream outs;
1936  outs << outputfilename << ".svg";
1937  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
1938  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
1939  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1940  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
1941  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
1942  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
1943  << "\" width=\"" << width << "\" height=\"" << height << "\">" << std::endl;
1944  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
1945  << std::endl;
1946  *savefile << "<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" "
1947  "style=\"fill:none;stroke:black;stroke-width:0;\"> "
1948  << std::endl;
1949  }
1950  for (int crate = 1; crate < (nfeccrates + 1); crate++) {
1951  if (filetype == "xml") {
1952  saveAsSingleLayer = true;
1953  std::ostringstream outs;
1954  outs << outputfilename << "feccrate" << crate << ".xml";
1955  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
1956  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
1957  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
1958  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
1959  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
1960  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />" << std::endl;
1961  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
1962  "onload=\"TrackerCrate.init()\">"
1963  << std::endl;
1964  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
1965  << std::endl;
1966  *savefile << "<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > " << std::endl;
1967  }
1968  // ncrate=crate;
1970 
1971  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
1972  TmCcu *ccu = i_ccu->second;
1973  if (ccu != nullptr) {
1974  if (ccu->getCcuCrate() == crate) {
1975  drawCcu(crate, ccu->getCcuSlot() - 2, print_total, ccu, savefile, useCcuValue);
1976  }
1977  }
1978  }
1979 
1980  if (!temporary_file) {
1981  if (filetype == "xml") {
1982  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1983  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1984  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1985  *savefile << " </text> </svg>" << std::endl;
1986  savefile->close();
1987  saveAsSingleLayer = false;
1988  }
1989  }
1990  }
1991  if (filetype == "svg") {
1992  *savefile << "</g> </svg> </svg> " << std::endl;
1993  savefile->close();
1994  }
1995  if (!print_total && !useCcuValue) {
1996  //Restore ccu value
1997  for (i_ccu = ccuMap.begin(); i_ccu != ccuMap.end(); i_ccu++) {
1998  TmCcu *ccu = i_ccu->second;
1999  if (ccu != nullptr) {
2000  ccu->value = ccu->value * ccu->count;
2001  }
2002  }
2003  }
2004  if (temporary_file) {
2005  if (printflag && !saveWebInterface)
2007  savefile->close();
2008 
2009  float content;
2010  std::string named;
2011  const char *command1;
2012  std::string tempfilename = outputfilename + ".coor";
2013  int red, green, blue, npoints, colindex, ncolor;
2014  double x[4], y[4];
2015  std::ifstream tempfile(tempfilename.c_str(), std::ios::in);
2016  TCanvas *MyC = new TCanvas("MyC", "TrackerMap", width, height);
2017  gPad->SetFillColor(38);
2018 
2019  if (saveWebInterface)
2020  gPad->Range(0, 0, 3700, 1600);
2021  else
2022  gPad->Range(0, 0, 3800, 1600);
2023 
2024  //First build palette
2025  ncolor = 0;
2026  typedef std::map<int, int> ColorList;
2027  ColorList colorList;
2028  ColorList::iterator pos;
2029  TColor *col, *c;
2030  while (!tempfile.eof()) {
2031  tempfile >> named >> content >> red >> green >> blue >> npoints;
2032  colindex = red + green * 1000 + blue * 1000000;
2033  pos = colorList.find(colindex);
2034  if (pos == colorList.end()) {
2035  colorList[colindex] = ncolor + 100;
2036  col = gROOT->GetColor(ncolor + 100);
2037  if (col)
2038  col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2039  else {
2040  c = new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2041  vc.push_back(c);
2042  }
2043  ncolor++;
2044  }
2045  for (int i = 0; i < npoints; i++) {
2046  tempfile >> x[i] >> y[i];
2047  }
2048  }
2049  if (ncolor > 0 && ncolor < 10000) {
2050  Int_t colors[10000];
2051  for (int i = 0; i < ncolor; i++) {
2052  colors[i] = i + 100;
2053  }
2054  gStyle->SetPalette(ncolor, colors);
2055  }
2056  tempfile.clear();
2057  tempfile.seekg(0, std::ios::beg);
2058  std::cout << "created palette with " << ncolor << " colors" << std::endl;
2059  while (!tempfile.eof()) { //create polylines
2060  tempfile >> named >> content >> red >> green >> blue >> npoints;
2061  for (int i = 0; i < npoints; i++) {
2062  tempfile >> x[i] >> y[i];
2063  }
2064  colindex = red + green * 1000 + blue * 1000000;
2065  pos = colorList.find(colindex);
2066  if (pos != colorList.end()) {
2067  TPolyLine *pline = new TPolyLine(npoints, y, x);
2068  vp.push_back(pline);
2069  pline->SetFillColor(colorList[colindex]);
2070  pline->SetLineWidth(0);
2071  pline->Draw("f");
2072  }
2073  }
2074  if (printflag && !saveWebInterface) {
2075  float lminvalue = minvalue;
2076  float lmaxvalue = maxvalue;
2077  if (tkMapLog) {
2078  lminvalue = log(minvalue) / log(10);
2079  lmaxvalue = log(maxvalue) / log(10);
2080  }
2081  axis = new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510, "+L");
2082  axis->SetLabelSize(0.02);
2083  axis->Draw();
2084  }
2085 
2086  if (!saveWebInterface) {
2087  TLatex l;
2088  l.SetTextSize(0.05);
2089  std::string fulltitle = title;
2090  if (tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos))
2091  fulltitle += ": Log10 scale";
2092  l.DrawLatex(50, 1530, fulltitle.c_str());
2093  }
2094  MyC->Update();
2095  std::cout << "Filetype " << filetype << std::endl;
2096  if (filetype == "png") {
2097  std::string filename = outputfilename + ".png";
2098  MyC->Print(filename.c_str());
2099  }
2100  if (filetype == "jpg") {
2101  std::string filename = outputfilename + ".jpg";
2102  MyC->Print(filename.c_str());
2103  }
2104  if (filetype == "pdf") {
2105  std::string filename = outputfilename + ".pdf";
2106  MyC->Print(filename.c_str());
2107  }
2108  std::string command = "rm " + tempfilename;
2109  command1 = command.c_str();
2110  std::cout << "Executing " << command1 << std::endl;
2111  system(command1);
2112  MyC->Clear();
2113  delete MyC;
2114  if (printflag && !saveWebInterface)
2115  delete axis;
2116  for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2117  delete (*pos1);
2118  }
2119 
2120  } //if(temporary_file)
2121  } //if(enabledFecProcessing)
2122 }
bool tkMapLog
Definition: TrackerMap.h:197
float minvalue
Definition: TrackerMap.h:667
int nfeccrates
Definition: TrackerMap.h:655
MapCcu ccuMap
Definition: TrackerMap.h:182
std::ofstream * savefile
Definition: TrackerMap.h:662
ret
prodAgent to be discontinued
bool enableFecProcessing
Definition: TrackerMap.h:194
bool saveWebInterface
Definition: TrackerMap.h:191
int count
Definition: TmCcu.h:11
int nmod
Definition: TmCcu.h:14
int getCcuSlot()
Definition: TmCcu.h:22
bool saveAsSingleLayer
Definition: TrackerMap.h:673
void deffecwindow(int num_crate)
Definition: TrackerMap.h:361
bool temporary_file
Definition: TrackerMap.h:669
static const int npoints
Definition: value.py:1
int getCcuCrate()
Definition: TmCcu.h:18
int green
Definition: TmCcu.h:8
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
Definition: TrackerMap.cc:1406
float value
Definition: TmCcu.h:9
bool printflag
Definition: TrackerMap.h:190
FecModule fecModuleMap
Definition: TrackerMap.h:184
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:3169
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:198
Definition: colors.py:1
int red
Definition: TmCcu.h:8
col
Definition: cuy.py:1009
float maxvalue
Definition: TrackerMap.h:667
int blue
Definition: TmCcu.h:8
Definition: TmCcu.h:4
std::vector< TColor * > vc
Definition: TrackerMap.h:168

◆ save_as_fedtrackermap()

void TrackerMap::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 at line 2754 of file TrackerMap.cc.

References apvMap, DivergingColor::blue, DummyCfis::c, cuy::col, mps_check::command, submitPVResolutionJobs::content, TmModule::count, TmApvPair::count, gather_cfg::cout, FCDTask_cfi::crate, defcwindow(), drawApvPair(), drawPalette(), enableFedProcessing, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedMap, corrVsCorr::filename, ConfigBuilder::filetype, firstcrate, newFWLiteAna::found, mps_fire::i, recoMuon::in, submitPVResolutionJobs::key, MainPageGenerator::l, CrabHelper::log, maxvalue, minvalue, TmApvPair::mod, TmApvPair::mpos, ncrates, TmModule::notInUse(), npoints, NUMFEDCRATE_INCOLUMN, NUMFEDCRATE_INROW, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, TmApvPair::red, DivergingColor::red, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, slotMap, AlCaHLTBitMon_QueryRunRegistry::string, suppress, temporary_file, title, tkMapLog, TmApvPair::value, TmModule::value, vc, ApeEstimator_cff::width, x, XFEDCSIZE, XFEDOFFSET, y, YFEDCSIZE, and YFEDOFFSET.

Referenced by BuildTrackerMapPlugin::endJob(), printall(), and printonline().

2755  {
2756  if (enableFedProcessing) {
2757  printflag = true;
2758  bool rangefound = true;
2760  std::vector<TPolyLine *> vp;
2761  TGaxis *axis = nullptr;
2762 
2763  size_t found = filetype.find_last_of('.');
2764  filetype = filetype.substr(found + 1);
2765  found = outputfilename.find_last_of('.');
2766  outputfilename = outputfilename.substr(0, found);
2767 
2768  temporary_file = true;
2769  if (filetype == "xml" || filetype == "svg")
2770  temporary_file = false;
2771  std::ostringstream outs;
2772  minvalue = minval;
2773  maxvalue = maxval;
2774  outs << outputfilename << ".coor";
2775  if (temporary_file)
2776  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2777  std::map<int, TmApvPair *>::iterator i_apv;
2778  std::map<int, int>::iterator i_fed;
2779  //Decide if we must use Module or ApvPair value
2780  bool useApvPairValue = false;
2781  for (i_apv = apvMap.begin(); i_apv != apvMap.end(); i_apv++) {
2782  TmApvPair *apvPair = i_apv->second;
2783  if (apvPair != nullptr) {
2784  TmModule *apv_mod = apvPair->mod;
2785  if (apv_mod != nullptr && !apv_mod->notInUse()) {
2786  if (apvPair->count > 0 || apvPair->red != -1) {
2787  useApvPairValue = true;
2788  break;
2789  }
2790  }
2791  }
2792  }
2793  if (!print_total) {
2794  for (i_apv = apvMap.begin(); i_apv != apvMap.end(); i_apv++) {
2795  TmApvPair *apvPair = i_apv->second;
2796  if (apvPair != nullptr) {
2797  TmModule *apv_mod = apvPair->mod;
2798  if (apv_mod != nullptr && !apv_mod->notInUse()) {
2799  if (useApvPairValue)
2800  apvPair->value = apvPair->value / apvPair->count;
2801  else if (apvPair->mpos == 0 && apv_mod->count > 0)
2802  apv_mod->value = apv_mod->value / apv_mod->count;
2803  }
2804  }
2805  }
2806  }
2807  if (minvalue >= maxvalue) {
2808  minvalue = 9999999.;
2809  maxvalue = -9999999.;
2810  rangefound = false;
2811  for (i_apv = apvMap.begin(); i_apv != apvMap.end(); i_apv++) {
2812  TmApvPair *apvPair = i_apv->second;
2813  if (apvPair != nullptr) {
2814  TmModule *apv_mod = apvPair->mod;
2815  if (apv_mod != nullptr && !apv_mod->notInUse()) {
2816  if (useApvPairValue) {
2817  rangefound = true;
2818  if (minvalue > apvPair->value)
2819  minvalue = apvPair->value;
2820  if (maxvalue < apvPair->value)
2821  maxvalue = apvPair->value;
2822  } else {
2823  if (apv_mod->count > 0) {
2824  rangefound = true;
2825  if (minvalue > apv_mod->value)
2826  minvalue = apv_mod->value;
2827  if (maxvalue < apv_mod->value)
2828  maxvalue = apv_mod->value;
2829  }
2830  }
2831  }
2832  }
2833  }
2834  }
2835  if ((title.find("QTestAlarm") != std::string::npos) || (maxvalue == minvalue) || !rangefound)
2836  printflag = false;
2837 
2838  if (filetype == "svg") {
2839  saveAsSingleLayer = false;
2840  std::ostringstream outs;
2841  outs << outputfilename << ".svg";
2842  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2843  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2844  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2845  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2846  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2847  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
2848  << "\" width=\"" << width << "\" height=\"" << height << "\">" << std::endl;
2849  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
2850  << std::endl;
2851  *savefile << "<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" "
2852  "style=\"fill:none;stroke:black;stroke-width:0;\"> "
2853  << std::endl;
2854  }
2855  for (int crate = firstcrate; crate < (ncrates + 1); crate++) {
2856  if (filetype == "xml") {
2857  saveAsSingleLayer = true;
2858  std::ostringstream outs;
2859  outs << outputfilename << "crate" << crate << ".xml";
2860  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2861  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2862  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2863  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2864  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2865  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />" << std::endl;
2866  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
2867  "onload=\"TrackerCrate.init()\">"
2868  << std::endl;
2869  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
2870  << std::endl;
2871  *savefile << "<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2872  }
2873  // ncrate=crate;
2874  defcwindow(crate);
2875  int numfed_incrate = 0;
2876  for (i_fed = fedMap.begin(); i_fed != fedMap.end(); i_fed++) {
2877  if (i_fed->second == crate) {
2878  int fedId = i_fed->first;
2879  // numfed_incrate++;
2880  numfed_incrate = slotMap[fedId];
2881  // the following piece of code is used to prepare the HTML clickable map
2882  /*
2883  double scalex=6285./6290.;
2884  double scaley=3510./3540.;
2885  double boxinitix=(NUMFED_INCOLUMN-1-(numfed_incrate-1)/NUMFED_INROW)*(NUMFEDCH_INCOLUMN+2)+NUMFEDCH_INCOLUMN+0.9;
2886  double boxinitiy=(NUMFED_INROW-1-(numfed_incrate-1)%NUMFED_INROW)*(NUMFEDCH_INROW+1)+NUMFEDCH_INROW+0.9;
2887  double boxendix=boxinitix-(NUMFEDCH_INCOLUMN-1)-0.9;
2888  double boxendiy=boxinitiy-(NUMFEDCH_INROW-1)-0.9;
2889 
2890  std::cout << "<area shape=\"rect\" coords=\" "
2891  << int(scalex*ydpixelc(boxinitiy)) << "," << int(3510-scaley*xdpixelc(boxinitix))
2892  << "," << int(scalex*ydpixelc(boxendiy)) << "," << int(3510-scaley*xdpixelc(boxendix))
2893  << "\" href=\"\" title=\"crate " << crate << " slot " << numfed_incrate << " FED " << fedId << "\" /> " << std::endl;
2894  */
2895  //
2896  for (int nconn = 0; nconn < 96; nconn++) {
2897  int key = fedId * 1000 + nconn;
2898  TmApvPair *apvPair = apvMap[key];
2899  if (apvPair != nullptr) {
2900  TmModule *apv_mod = apvPair->mod;
2901  if (apv_mod != nullptr && !apv_mod->notInUse()) {
2902  drawApvPair(crate, numfed_incrate, print_total, apvPair, savefile, useApvPairValue);
2903  }
2904  }
2905  }
2906  }
2907  }
2908  if (!temporary_file) {
2909  if (filetype == "xml") {
2910  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2911  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2912  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2913  *savefile << " </text> </svg>" << std::endl;
2914  savefile->close();
2915  delete savefile;
2916  saveAsSingleLayer = false;
2917  }
2918  }
2919  }
2920  if (filetype == "svg") {
2921  // savefile is only deleted for filetype "xml"
2922  [[clang::suppress]] * savefile << "</g> </svg> </svg> " << std::endl;
2923  savefile->close();
2924  delete savefile;
2925  }
2926  if (!print_total && !useApvPairValue) {
2927  //Restore module value
2928  for (i_apv = apvMap.begin(); i_apv != apvMap.end(); i_apv++) {
2929  TmApvPair *apvPair = i_apv->second;
2930  if (apvPair != nullptr) {
2931  TmModule *apv_mod = apvPair->mod;
2932  if (apv_mod != nullptr && apvPair->mpos == 0 && !apv_mod->notInUse()) {
2933  apv_mod->value = apv_mod->value * apv_mod->count;
2934  }
2935  }
2936  }
2937  }
2938 
2939  int rangex = YFEDOFFSET + (YFEDCSIZE + YFEDOFFSET) * NUMFEDCRATE_INROW + 300;
2940  int rangey = XFEDOFFSET + (XFEDCSIZE + XFEDOFFSET) * NUMFEDCRATE_INCOLUMN + 300;
2941 
2942  if (temporary_file) {
2943  if (printflag && !saveWebInterface)
2944  // savefile is only deleted for filetype "xml", for this filetype temporary_file is false
2945  [[clang::suppress]]
2946  drawPalette(savefile, rangex - 140, rangey - 100);
2947  [[clang::suppress]] savefile->close();
2948  [[clang::suppress]] delete savefile;
2949 
2950  float content;
2951  std::string named;
2952  const char *command1;
2953  std::string tempfilename = outputfilename + ".coor";
2954  int red, green, blue, npoints, colindex, ncolor;
2955  double x[4], y[4];
2956  std::ifstream tempfile(tempfilename.c_str(), std::ios::in);
2957  TCanvas *MyC = new TCanvas("MyC", "TrackerMap", width, height);
2958  gPad->SetFillColor(38);
2959 
2960  // if(saveWebInterface)gPad->Range(0,0,3750,1600); else gPad->Range(0,0,3800,1600);
2961  std::cout << " range x " << rangex << std::endl;
2962  std::cout << " range y " << rangey << std::endl;
2963  gPad->Range(0, 0, rangex, rangey);
2964 
2965  //First build palette
2966  ncolor = 0;
2967  typedef std::map<int, int> ColorList;
2968  ColorList colorList;
2969  ColorList::iterator pos;
2970  TColor *col, *c;
2971  while (!tempfile.eof()) {
2972  tempfile >> named >> content >> red >> green >> blue >> npoints;
2973  colindex = red + green * 1000 + blue * 1000000;
2974  pos = colorList.find(colindex);
2975  if (pos == colorList.end()) {
2976  colorList[colindex] = ncolor + 100;
2977  col = gROOT->GetColor(ncolor + 100);
2978  if (col)
2979  col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2980  else
2981  c = new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2982  vc.push_back(c);
2983  ncolor++;
2984  }
2985  for (int i = 0; i < npoints; i++) {
2986  tempfile >> x[i] >> y[i];
2987  }
2988  }
2989  if (ncolor > 0 && ncolor < 10000) {
2990  Int_t colors[10000];
2991  for (int i = 0; i < ncolor; i++) {
2992  colors[i] = i + 100;
2993  }
2994  gStyle->SetPalette(ncolor, colors);
2995  }
2996  tempfile.clear();
2997  tempfile.seekg(0, std::ios::beg);
2998  std::cout << "created palette with " << ncolor << " colors" << std::endl;
2999  while (!tempfile.eof()) { //create polylines
3000  tempfile >> named >> content >> red >> green >> blue >> npoints;
3001  for (int i = 0; i < npoints; i++) {
3002  tempfile >> x[i] >> y[i];
3003  }
3004  colindex = red + green * 1000 + blue * 1000000;
3005  pos = colorList.find(colindex);
3006  if (pos != colorList.end()) {
3007  TPolyLine *pline = new TPolyLine(npoints, y, x);
3008  vp.push_back(pline);
3009  pline->SetFillColor(colorList[colindex]);
3010  pline->SetLineWidth(0);
3011  pline->Draw("f");
3012  }
3013  }
3014  if (printflag && !saveWebInterface) {
3015  float lminvalue = minvalue;
3016  float lmaxvalue = maxvalue;
3017  if (tkMapLog) {
3018  lminvalue = log(minvalue) / log(10);
3019  lmaxvalue = log(maxvalue) / log(10);
3020  }
3021  axis = new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510, "+L");
3022  axis->SetLabelSize(0.02);
3023  axis->Draw();
3024  }
3025 
3026  if (!saveWebInterface) {
3027  TLatex l;
3028  l.SetTextSize(0.05);
3029  std::string fulltitle = title;
3030  if (tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos))
3031  fulltitle += ": Log10 scale";
3032  l.DrawLatex(50, rangey - 200, fulltitle.c_str());
3033  }
3034  MyC->Update();
3035  std::cout << "Filetype " << filetype << std::endl;
3036  if (filetype == "png") {
3037  std::string filename = outputfilename + ".png";
3038  MyC->Print(filename.c_str());
3039  }
3040  if (filetype == "jpg") {
3041  std::string filename = outputfilename + ".jpg";
3042  MyC->Print(filename.c_str());
3043  }
3044  if (filetype == "pdf") {
3045  std::string filename = outputfilename + ".pdf";
3046  MyC->Print(filename.c_str());
3047  }
3048  std::string command = "rm " + tempfilename;
3049  command1 = command.c_str();
3050  std::cout << "Executing " << command1 << std::endl;
3051  system(command1);
3052  MyC->Clear();
3053  delete MyC;
3054  if (printflag && !saveWebInterface)
3055  delete axis;
3056  for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
3057  delete (*pos1);
3058  }
3059 
3060  } //if(temporary_file)
3061  } //if(enabledFedProcessing)
3062 }
TmModule * mod
Definition: TmApvPair.h:16
bool tkMapLog
Definition: TrackerMap.h:197
#define NUMFEDCRATE_INCOLUMN
Definition: TrackerMap.h:59
float minvalue
Definition: TrackerMap.h:667
float value
Definition: TmModule.h:11
int mpos
Definition: TmApvPair.h:17
std::ofstream * savefile
Definition: TrackerMap.h:662
#define YFEDOFFSET
Definition: TrackerMap.h:66
bool saveWebInterface
Definition: TrackerMap.h:191
#define YFEDCSIZE
Definition: TrackerMap.h:64
bool enableFedProcessing
Definition: TrackerMap.h:193
#define NUMFEDCRATE_INROW
Definition: TrackerMap.h:60
int red
Definition: TmApvPair.h:10
bool saveAsSingleLayer
Definition: TrackerMap.h:673
bool temporary_file
Definition: TrackerMap.h:669
key
prepare the HTCondor submission files and eventually submit them
#define XFEDCSIZE
Definition: TrackerMap.h:63
static const int npoints
Definition: value.py:1
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
Definition: TrackerMap.cc:1241
int count
Definition: TmModule.h:12
SvgFed slotMap
Definition: TrackerMap.h:180
int count
Definition: TmApvPair.h:13
SvgFed fedMap
Definition: TrackerMap.h:179
bool printflag
Definition: TrackerMap.h:190
int firstcrate
Definition: TrackerMap.h:654
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:3169
bool notInUse()
Definition: TmModule.h:23
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:198
Definition: colors.py:1
SvgApvPair apvMap
Definition: TrackerMap.h:175
col
Definition: cuy.py:1009
float maxvalue
Definition: TrackerMap.h:667
#define XFEDOFFSET
Definition: TrackerMap.h:65
void defcwindow(int num_crate)
Definition: TrackerMap.h:349
std::vector< TColor * > vc
Definition: TrackerMap.h:168
float value
Definition: TmApvPair.h:11

◆ save_as_HVtrackermap()

void TrackerMap::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 at line 2123 of file TrackerMap.cc.

References DivergingColor::blue, TmPsu::blueHV2, TmPsu::blueHV3, DummyCfis::c, cuy::col, mps_check::command, submitPVResolutionJobs::content, TmPsu::countHV2, TmPsu::countHV3, gather_cfg::cout, defpsuwindow(), drawHV2(), drawHV3(), drawPalette(), enableHVProcessing, corrVsCorr::filename, ConfigBuilder::filetype, newFWLiteAna::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), TmPsu::greenHV2, TmPsu::greenHV3, mps_fire::i, recoMuon::in, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, MainPageGenerator::l, CrabHelper::log, WZElectronSkims53X_cff::max, maxvalue, SiStripPI::min, minvalue, TmPsu::nmodHV2, TmPsu::nmodHV3, npoints, npsuracks, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, psuMap, psuModuleMap, DivergingColor::red, TmPsu::redHV2, TmPsu::redHV3, runTheMatrix::ret, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmPsu::valueHV2, TmPsu::valueHV3, vc, ApeEstimator_cff::width, x, and y.

Referenced by printall(), and printonline().

2124  {
2125  if (enableHVProcessing) {
2127  std::vector<TPolyLine *> vp;
2128  TGaxis *axis = nullptr;
2129  size_t found = filetype.find_last_of('.');
2130  filetype = filetype.substr(found + 1);
2131  found = outputfilename.find_last_of('.');
2132  outputfilename = outputfilename.substr(0, found);
2133 
2134  temporary_file = true;
2135 
2136  if (filetype == "xml" || filetype == "svg")
2137  temporary_file = false;
2138 
2139  std::ostringstream outs;
2140  minvalue = minval;
2141  maxvalue = maxval;
2142  outs << outputfilename << ".coor";
2143  if (temporary_file)
2144  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2145 
2146  std::map<int, TmPsu *>::iterator ipsu;
2147  std::multimap<TmPsu *, TmModule *>::iterator it;
2148  std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator> ret;
2149 
2150  bool usePsuValue = false;
2151 
2152  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2153  TmPsu *psu = ipsu->second;
2154  if (psu != nullptr) {
2155  if (psu->countHV2 > 0 || psu->redHV2 != -1 || psu->countHV3 > 0 || psu->redHV3 != -1) {
2156  usePsuValue = true;
2157  break;
2158  }
2159  }
2160  }
2161 
2162  if (!usePsuValue) { //store mean of connected modules value{
2163 
2164  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2165  TmPsu *psu = ipsu->second;
2166  if (psu != nullptr) {
2167  ret = psuModuleMap.equal_range(psu);
2168  int nconn1 = 0;
2169  int nconn2 = 0;
2170  for (it = ret.first; it != ret.second; ++it) {
2171  if ((*it).second->HVchannel == 2 && (*it).second->count > 0) {
2172  nconn1++;
2173  psu->valueHV2 = psu->valueHV2 + (*it).second->value;
2174  }
2175  if ((*it).second->HVchannel == 3 && (*it).second->count > 0) {
2176  nconn2++;
2177  psu->valueHV3 = psu->valueHV3 + (*it).second->value;
2178  }
2179  }
2180  if (psu->nmodHV2 != 0 && nconn1 > 0) {
2181  psu->valueHV2 = psu->valueHV2 / psu->nmodHV2;
2182  psu->countHV2 = 1;
2183  }
2184  if (psu->nmodHV3 != 0 && nconn2 > 0) {
2185  psu->valueHV3 = psu->valueHV3 / psu->nmodHV3;
2186  psu->countHV3 = 1;
2187  }
2188  }
2189  }
2190  }
2191 
2192  if (title.find("QTestAlarm") != std::string::npos) {
2193  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2194  TmPsu *psu = ipsu->second;
2195  if (psu != nullptr) {
2196  ret = psuModuleMap.equal_range(psu);
2197  psu->redHV2 = 0;
2198  psu->greenHV2 = 255;
2199  psu->blueHV2 = 0;
2200  psu->redHV3 = 0;
2201  psu->greenHV3 = 255;
2202  psu->blueHV3 = 0;
2203  for (it = ret.first; it != ret.second; ++it) {
2204  if ((*it).second->HVchannel == 2) {
2205  if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2206  !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2207  psu->redHV2 = 255;
2208  psu->greenHV2 = 0;
2209  psu->blueHV2 = 0;
2210  }
2211  }
2212  if ((*it).second->HVchannel == 3) {
2213  if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2214  !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2215  psu->redHV3 = 255;
2216  psu->greenHV3 = 0;
2217  psu->blueHV3 = 0;
2218  }
2219  }
2220  }
2221  }
2222  }
2223  }
2224 
2225  if (!print_total) {
2226  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2227  TmPsu *psu = ipsu->second;
2228  if (psu != nullptr) {
2229  if (usePsuValue) {
2230  psu->valueHV2 = psu->valueHV2 / psu->countHV2;
2231  psu->valueHV3 = psu->valueHV3 / psu->countHV3;
2232  }
2233  }
2234  }
2235  }
2236 
2237  if (minvalue >= maxvalue) {
2238  minvalue = 9999999.;
2239  maxvalue = -9999999.;
2240 
2241  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2242  TmPsu *psu = ipsu->second;
2243  if (psu != nullptr && psu->countHV2 > 0 && psu->countHV3 > 0) {
2244  if (minvalue > psu->valueHV2 || minvalue > psu->valueHV3)
2245  minvalue = std::min(psu->valueHV2, psu->valueHV3);
2246  if (maxvalue < psu->valueHV2 || maxvalue < psu->valueHV3)
2247  maxvalue = std::max(psu->valueHV2, psu->valueHV3);
2248  }
2249  }
2250  }
2251 
2252  if (filetype == "svg") {
2253  saveAsSingleLayer = false;
2254  std::ostringstream outs;
2255  outs << outputfilename << ".svg";
2256  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2257  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2258  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2259  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2260  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2261  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
2262  << "\" width=\"" << width << "\" height=\"" << height << "\">" << std::endl;
2263  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
2264  << std::endl;
2265  *savefile << "<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" "
2266  "style=\"fill:none;stroke:black;stroke-width:0;\"> "
2267  << std::endl;
2268  }
2269 
2270  for (int irack = 1; irack < (npsuracks + 1); irack++) {
2271  if (filetype == "xml") {
2272  saveAsSingleLayer = true;
2273  std::ostringstream outs;
2274  outs << outputfilename << "HVrack" << irack << ".xml";
2275  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2276  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2277  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2278  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2279  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2280  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />" << std::endl;
2281  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
2282  "onload=\"TrackerRackhv.init()\">"
2283  << std::endl;
2284  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
2285  << std::endl;
2286  *savefile << "<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2287  }
2288 
2289  // nrack=irack;
2290  defpsuwindow(irack);
2291  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2292  TmPsu *psu = ipsu->second;
2293  if (psu->getPsuRack() == irack) {
2294  drawHV2(irack, psu->getPsuCrate(), print_total, psu, savefile, usePsuValue);
2295  drawHV3(irack, psu->getPsuCrate(), print_total, psu, savefile, usePsuValue);
2296  }
2297  }
2298 
2299  if (!temporary_file) {
2300  if (filetype == "xml") {
2301  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2302  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2303  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2304  *savefile << " </text> </svg>" << std::endl;
2305  savefile->close();
2306  saveAsSingleLayer = false;
2307  }
2308  }
2309  }
2310  if (filetype == "svg") {
2311  *savefile << "</g> </svg> </svg> " << std::endl;
2312  savefile->close();
2313  }
2314 
2315  //Restore psu value
2316  if (!print_total && !usePsuValue) {
2317  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2318  TmPsu *psu = ipsu->second;
2319  if (psu != nullptr) {
2320  psu->valueHV2 = psu->valueHV2 * psu->countHV2;
2321  psu->valueHV3 = psu->valueHV3 * psu->countHV3;
2322  }
2323  }
2324  }
2325 
2326  if (temporary_file) {
2327  if (printflag && !saveWebInterface)
2329  savefile->close();
2330 
2331  float content;
2332  std::string named;
2333  const char *command1;
2334  std::string tempfilename = outputfilename + ".coor";
2335  int red, green, blue, npoints, colindex, ncolor;
2336  double x[4], y[4];
2337  std::ifstream tempfile(tempfilename.c_str(), std::ios::in);
2338  TCanvas *MyC = new TCanvas("MyC", "TrackerMap", width, height);
2339  gPad->SetFillColor(38);
2340 
2341  if (saveWebInterface)
2342  gPad->Range(0, 0, 3700, 1600);
2343  else
2344  gPad->Range(0, 0, 3800, 1600);
2345 
2346  //First build palette
2347  ncolor = 0;
2348  typedef std::map<int, int> ColorList;
2349  ColorList colorList;
2350  ColorList::iterator pos;
2351  TColor *col, *c;
2352  while (!tempfile.eof()) {
2353  tempfile >> named >> content >> red >> green >> blue >> npoints;
2354  colindex = red + green * 1000 + blue * 1000000;
2355  pos = colorList.find(colindex);
2356  if (pos == colorList.end()) {
2357  colorList[colindex] = ncolor + 100;
2358  col = gROOT->GetColor(ncolor + 100);
2359  if (col)
2360  col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2361  else {
2362  c = new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2363  vc.push_back(c);
2364  }
2365  ncolor++;
2366  }
2367  for (int i = 0; i < npoints; i++) {
2368  tempfile >> x[i] >> y[i];
2369  }
2370  }
2371  if (ncolor > 0 && ncolor < 10000) {
2372  Int_t colors[10000];
2373  for (int i = 0; i < ncolor; i++) {
2374  colors[i] = i + 100;
2375  }
2376  gStyle->SetPalette(ncolor, colors);
2377  }
2378  tempfile.clear();
2379  tempfile.seekg(0, std::ios::beg);
2380  std::cout << "created palette with " << ncolor << " colors" << std::endl;
2381  while (!tempfile.eof()) { //create polylines
2382  tempfile >> named >> content >> red >> green >> blue >> npoints;
2383  for (int i = 0; i < npoints; i++) {
2384  tempfile >> x[i] >> y[i];
2385  }
2386  colindex = red + green * 1000 + blue * 1000000;
2387  pos = colorList.find(colindex);
2388  if (pos != colorList.end()) {
2389  TPolyLine *pline = new TPolyLine(npoints, y, x);
2390  vp.push_back(pline);
2391  pline->SetFillColor(colorList[colindex]);
2392  pline->SetLineWidth(0);
2393  pline->Draw("f");
2394  }
2395  }
2396  if (printflag && !saveWebInterface) {
2397  float lminvalue = minvalue;
2398  float lmaxvalue = maxvalue;
2399  if (tkMapLog) {
2400  lminvalue = log(minvalue) / log(10);
2401  lmaxvalue = log(maxvalue) / log(10);
2402  }
2403  axis = new TGaxis(3660, 36, 3660, 1530, lminvalue, lmaxvalue, 510, "+L");
2404  axis->SetLabelSize(0.02);
2405  axis->Draw();
2406  }
2407 
2408  if (!saveWebInterface) {
2409  TLatex l;
2410  l.SetTextSize(0.05);
2411  std::string fulltitle = title;
2412  if (tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos))
2413  fulltitle += ": Log10 scale";
2414  l.DrawLatex(50, 1530, fulltitle.c_str());
2415  }
2416  MyC->Update();
2417  std::cout << "Filetype " << filetype << std::endl;
2418  if (filetype == "png") {
2419  std::string filename = outputfilename + ".png";
2420  MyC->Print(filename.c_str());
2421  }
2422  if (filetype == "jpg") {
2423  std::string filename = outputfilename + ".jpg";
2424  MyC->Print(filename.c_str());
2425  }
2426  if (filetype == "pdf") {
2427  std::string filename = outputfilename + ".pdf";
2428  MyC->Print(filename.c_str());
2429  }
2430  std::string command = "rm " + tempfilename;
2431  command1 = command.c_str();
2432  std::cout << "Executing " << command1 << std::endl;
2433  system(command1);
2434  MyC->Clear();
2435  delete MyC;
2436  if (printflag && !saveWebInterface)
2437  delete axis;
2438  for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2439  delete (*pos1);
2440  }
2441 
2442  } //if(temporary_file)
2443  } //if(enabledHVProcessing)
2444 }
bool tkMapLog
Definition: TrackerMap.h:197
float minvalue
Definition: TrackerMap.h:667
int redHV2
Definition: TmPsu.h:38
int nmodHV3
Definition: TmPsu.h:48
std::ofstream * savefile
Definition: TrackerMap.h:662
int countHV2
Definition: TmPsu.h:44
ret
prodAgent to be discontinued
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:375
bool saveWebInterface
Definition: TrackerMap.h:191
int npsuracks
Definition: TrackerMap.h:656
int greenHV3
Definition: TmPsu.h:39
bool enableHVProcessing
Definition: TrackerMap.h:196
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1730
bool saveAsSingleLayer
Definition: TrackerMap.h:673
int blueHV3
Definition: TmPsu.h:39
bool temporary_file
Definition: TrackerMap.h:669
int greenHV2
Definition: TmPsu.h:38
static const int npoints
int getPsuRack()
Definition: TmPsu.h:22
int nmodHV2
Definition: TmPsu.h:47
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1626
int redHV3
Definition: TmPsu.h:39
PsuModule psuModuleMap
Definition: TrackerMap.h:188
float valueHV2
Definition: TmPsu.h:42
bool printflag
Definition: TrackerMap.h:190
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:3169
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:198
Definition: colors.py:1
col
Definition: cuy.py:1009
int countHV3
Definition: TmPsu.h:45
float maxvalue
Definition: TrackerMap.h:667
float valueHV3
Definition: TmPsu.h:41
MapPsu psuMap
Definition: TrackerMap.h:186
int blueHV2
Definition: TmPsu.h:38
Definition: TmPsu.h:6
std::vector< TColor * > vc
Definition: TrackerMap.h:168
int getPsuCrate()
Definition: TmPsu.h:26

◆ save_as_psutrackermap()

void TrackerMap::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 at line 2446 of file TrackerMap.cc.

References DivergingColor::blue, DummyCfis::c, cuy::col, mps_check::command, submitPVResolutionJobs::content, TmPsu::count, gather_cfg::cout, defpsuwindow(), drawPalette(), drawPsu(), enableLVProcessing, corrVsCorr::filename, ConfigBuilder::filetype, newFWLiteAna::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), mps_fire::i, recoMuon::in, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, MainPageGenerator::l, CrabHelper::log, maxvalue, minvalue, TmPsu::nmod, npoints, npsuracks, NUMPSURACK_INCOLUMN, NUMPSURACK_INROW, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, psuMap, psuModuleMap, TmPsu::red, DivergingColor::red, runTheMatrix::ret, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmPsu::value, vc, ApeEstimator_cff::width, x, XPSUOFFSET, XPSURSIZE, y, YPSUOFFSET, and YPSURSIZE.

Referenced by printall(), and printonline().

2447  {
2448  if (enableLVProcessing) {
2449  printflag = true;
2450  bool rangefound = true;
2452  std::vector<TPolyLine *> vp;
2453  TGaxis *axis = nullptr;
2454 
2455  size_t found = filetype.find_last_of('.');
2456  filetype = filetype.substr(found + 1);
2457  found = outputfilename.find_last_of('.');
2458  outputfilename = outputfilename.substr(0, found);
2459 
2460  temporary_file = true;
2461 
2462  if (filetype == "xml" || filetype == "svg")
2463  temporary_file = false;
2464 
2465  std::ostringstream outs;
2466  minvalue = minval;
2467  maxvalue = maxval;
2468  outs << outputfilename << ".coor";
2469  if (temporary_file)
2470  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2471 
2472  std::map<int, TmPsu *>::iterator ipsu;
2473  std::multimap<TmPsu *, TmModule *>::iterator it;
2474  std::pair<std::multimap<TmPsu *, TmModule *>::iterator, std::multimap<TmPsu *, TmModule *>::iterator> ret;
2475 
2476  //Decide if we must use Module or Power Psupply value
2477  bool usePsuValue = false;
2478 
2479  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2480  TmPsu *psu = ipsu->second;
2481  if (psu != nullptr) {
2482  if (psu->count > 0 || psu->red != -1) {
2483  usePsuValue = true;
2484  break;
2485  }
2486  }
2487  }
2488 
2489  if (!usePsuValue) { //store mean of connected modules value{
2490  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2491  TmPsu *psu = ipsu->second;
2492  if (psu != nullptr) {
2493  ret = psuModuleMap.equal_range(psu);
2494  int nconn = 0;
2495  for (it = ret.first; it != ret.second; ++it) {
2496  if ((*it).second->count > 0) {
2497  nconn++;
2498  psu->value = psu->value + (*it).second->value;
2499  }
2500  }
2501  if (nconn > 0) {
2502  psu->value = psu->value / psu->nmod;
2503  psu->count = 1;
2504  }
2505  }
2506  }
2507  }
2508 
2509  if (title.find("QTestAlarm") != std::string::npos) {
2510  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2511  TmPsu *psu = ipsu->second;
2512  if (psu != nullptr) {
2513  ret = psuModuleMap.equal_range(psu);
2514  // psu->red=255;psu->green=255;psu->blue=255;
2515  psu->red = -1;
2516  int nconn = 0;
2517  for (it = ret.first; it != ret.second; ++it) {
2518  if (!((*it).second->red == 0 && (*it).second->green == 255 && (*it).second->blue == 0) &&
2519  !((*it).second->red == 255 && (*it).second->green == 255 && (*it).second->blue == 255)) {
2520  nconn++;
2521  psu->value++;
2522  }
2523  }
2524  if (nconn > 0) {
2525  psu->value = psu->value / psu->nmod;
2526  psu->count = 1;
2527  }
2528  }
2529  }
2530  }
2531 
2532  if (!print_total) {
2533  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2534  TmPsu *psu = ipsu->second;
2535  if (psu != nullptr) {
2536  if (usePsuValue)
2537  psu->value = psu->value / psu->count;
2538  }
2539  }
2540  }
2541 
2542  if (minvalue >= maxvalue) {
2543  minvalue = 9999999.;
2544  maxvalue = -9999999.;
2545  rangefound = false;
2546  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2547  TmPsu *psu = ipsu->second;
2548  if (psu != nullptr && psu->count > 0) {
2549  rangefound = true;
2550  if (minvalue > psu->value)
2551  minvalue = psu->value;
2552  if (maxvalue < psu->value)
2553  maxvalue = psu->value;
2554  }
2555  }
2556  }
2557  if ((maxvalue == minvalue) || !rangefound)
2558  printflag = false;
2559 
2560  if (filetype == "svg") {
2561  saveAsSingleLayer = false;
2562  std::ostringstream outs;
2563  outs << outputfilename << ".svg";
2564  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2565  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>" << std::endl;
2566  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2567  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" " << std::endl;
2568  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << std::endl;
2569  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"
2570  << "\" width=\"" << width << "\" height=\"" << height << "\">" << std::endl;
2571  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "
2572  << std::endl;
2573  *savefile << "<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" "
2574  "style=\"fill:none;stroke:black;stroke-width:0;\"> "
2575  << std::endl;
2576  }
2577 
2578  for (int irack = 1; irack < (npsuracks + 1); irack++) {
2579  if (filetype == "xml") {
2580  saveAsSingleLayer = true;
2581  std::ostringstream outs;
2582  outs << outputfilename << "psurack" << irack << ".xml";
2583  savefile = new std::ofstream(outs.str().c_str(), std::ios::out);
2584  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl;
2585  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\"" << std::endl;
2586  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl;
2587  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >" << std::endl;
2588  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />" << std::endl;
2589  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" "
2590  "onload=\"TrackerCrate.init()\">"
2591  << std::endl;
2592  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"
2593  << std::endl;
2594  *savefile << "<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > " << std::endl;
2595  }
2596 
2597  // nrack=irack;
2598  defpsuwindow(irack);
2599  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2600  TmPsu *psu = ipsu->second;
2601  if (psu->getPsuRack() == irack) {
2602  drawPsu(irack, psu->getPsuCrate(), print_total, psu, savefile, usePsuValue);
2603  }
2604  }
2605 
2606  if (!temporary_file) {
2607  if (filetype == "xml") {
2608  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2609  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2610  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2611  *savefile << " </text> </svg>" << std::endl;
2612  savefile->close();
2613  saveAsSingleLayer = false;
2614  }
2615  }
2616  }
2617  if (filetype == "svg") {
2618  *savefile << "</g> </svg> </svg> " << std::endl;
2619  savefile->close();
2620  }
2621 
2622  //Restore psu value
2623  if (!print_total && !usePsuValue) {
2624  for (ipsu = psuMap.begin(); ipsu != psuMap.end(); ipsu++) {
2625  TmPsu *psu = ipsu->second;
2626  if (psu != nullptr) {
2627  psu->value = psu->value * psu->count;
2628  }
2629  }
2630  }
2631 
2632  int rangex = YPSUOFFSET + (YPSURSIZE + YPSUOFFSET) * NUMPSURACK_INROW + 300;
2633  int rangey = XPSUOFFSET + (XPSURSIZE + XPSUOFFSET) * NUMPSURACK_INCOLUMN + 300;
2634 
2635  if (temporary_file) {
2636  if (printflag && !saveWebInterface)
2637  drawPalette(savefile, rangex - 140, rangey - 100);
2638  savefile->close();
2639 
2640  float content;
2641  std::string named;
2642  const char *command1;
2643  std::string tempfilename = outputfilename + ".coor";
2644  int red, green, blue, npoints, colindex, ncolor;
2645  double x[4], y[4];
2646  std::ifstream tempfile(tempfilename.c_str(), std::ios::in);
2647  TCanvas *MyC = new TCanvas("MyC", "TrackerMap", width, height);
2648  gPad->SetFillColor(38);
2649 
2650  // if(saveWebInterface)gPad->Range(0,0,3700,1600); else gPad->Range(0,0,3800,1600);
2651  std::cout << " range x " << rangex << std::endl;
2652  std::cout << " range y " << rangey << std::endl;
2653  gPad->Range(0, 0, rangex, rangey);
2654 
2655  //First build palette
2656  ncolor = 0;
2657  typedef std::map<int, int> ColorList;
2658  ColorList colorList;
2659  ColorList::iterator pos;
2660  TColor *col, *c;
2661  while (!tempfile.eof()) {
2662  tempfile >> named >> content >> red >> green >> blue >> npoints;
2663  colindex = red + green * 1000 + blue * 1000000;
2664  pos = colorList.find(colindex);
2665  if (pos == colorList.end()) {
2666  colorList[colindex] = ncolor + 100;
2667  col = gROOT->GetColor(ncolor + 100);
2668  if (col)
2669  col->SetRGB((Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2670  else
2671  c = new TColor(ncolor + 100, (Double_t)(red / 255.), (Double_t)(green / 255.), (Double_t)(blue / 255.));
2672  vc.push_back(c);
2673  ncolor++;
2674  }
2675  for (int i = 0; i < npoints; i++) {
2676  tempfile >> x[i] >> y[i];
2677  }
2678  }
2679  if (ncolor > 0 && ncolor < 10000) {
2680  Int_t colors[10000];
2681  for (int i = 0; i < ncolor; i++) {
2682  colors[i] = i + 100;
2683  }
2684  gStyle->SetPalette(ncolor, colors);
2685  }
2686  tempfile.clear();
2687  tempfile.seekg(0, std::ios::beg);
2688  std::cout << "created palette with " << ncolor << " colors" << std::endl;
2689  while (!tempfile.eof()) { //create polylines
2690  tempfile >> named >> content >> red >> green >> blue >> npoints;
2691  for (int i = 0; i < npoints; i++) {
2692  tempfile >> x[i] >> y[i];
2693  }
2694  colindex = red + green * 1000 + blue * 1000000;
2695  pos = colorList.find(colindex);
2696  if (pos != colorList.end()) {
2697  TPolyLine *pline = new TPolyLine(npoints, y, x);
2698  vp.push_back(pline);
2699  pline->SetFillColor(colorList[colindex]);
2700  pline->SetLineWidth(0);
2701  pline->Draw("f");
2702  }
2703  }
2704  if (printflag && !saveWebInterface) {
2705  float lminvalue = minvalue;
2706  float lmaxvalue = maxvalue;
2707  if (tkMapLog) {
2708  lminvalue = log(minvalue) / log(10);
2709  lmaxvalue = log(maxvalue) / log(10);
2710  }
2711  axis = new TGaxis(rangex - 140, 34, rangex - 140, rangey - 106, lminvalue, lmaxvalue, 510, "+L");
2712  axis->SetLabelSize(0.02);
2713  axis->Draw();
2714  }
2715 
2716  if (!saveWebInterface) {
2717  TLatex l;
2718  l.SetTextSize(0.05);
2719  std::string fulltitle = title;
2720  if (tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos))
2721  fulltitle += ": Log10 scale";
2722  l.DrawLatex(50, rangey - 200, fulltitle.c_str());
2723  }
2724  MyC->Update();
2725  std::cout << "Filetype " << filetype << std::endl;
2726  if (filetype == "png") {
2727  std::string filename = outputfilename + ".png";
2728  MyC->Print(filename.c_str());
2729  }
2730  if (filetype == "jpg") {
2731  std::string filename = outputfilename + ".jpg";
2732  MyC->Print(filename.c_str());
2733  }
2734  if (filetype == "pdf") {
2735  std::string filename = outputfilename + ".pdf";
2736  MyC->Print(filename.c_str());
2737  }
2738  std::string command = "rm " + tempfilename;
2739  command1 = command.c_str();
2740  std::cout << "Executing " << command1 << std::endl;
2741  system(command1);
2742  MyC->Clear();
2743  delete MyC;
2744  if (printflag && !saveWebInterface)
2745  delete axis;
2746  for (std::vector<TPolyLine *>::iterator pos1 = vp.begin(); pos1 != vp.end(); pos1++) {
2747  delete (*pos1);
2748  }
2749 
2750  } //if(temporary_file)
2751  } //if(enabledFedProcessing)
2752 }
bool tkMapLog
Definition: TrackerMap.h:197
float minvalue
Definition: TrackerMap.h:667
#define NUMPSURACK_INCOLUMN
Definition: TrackerMap.h:46
std::ofstream * savefile
Definition: TrackerMap.h:662
int count
Definition: TmPsu.h:43
ret
prodAgent to be discontinued
#define XPSURSIZE
Definition: TrackerMap.h:48
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:375
bool saveWebInterface
Definition: TrackerMap.h:191
int npsuracks
Definition: TrackerMap.h:656
float value
Definition: TmPsu.h:40
int red
Definition: TmPsu.h:37
int nmod
Definition: TmPsu.h:46
bool saveAsSingleLayer
Definition: TrackerMap.h:673
bool temporary_file
Definition: TrackerMap.h:669
static const int npoints
Definition: value.py:1
int getPsuRack()
Definition: TmPsu.h:22
PsuModule psuModuleMap
Definition: TrackerMap.h:188
#define YPSUOFFSET
Definition: TrackerMap.h:51
bool printflag
Definition: TrackerMap.h:190
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:3169
#define YPSURSIZE
Definition: TrackerMap.h:49
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:198
Definition: colors.py:1
col
Definition: cuy.py:1009
float maxvalue
Definition: TrackerMap.h:667
bool enableLVProcessing
Definition: TrackerMap.h:195
#define NUMPSURACK_INROW
Definition: TrackerMap.h:47
MapPsu psuMap
Definition: TrackerMap.h:186
Definition: TmPsu.h:6
#define XPSUOFFSET
Definition: TrackerMap.h:50
std::vector< TColor * > vc
Definition: TrackerMap.h:168
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1512
int getPsuCrate()
Definition: TmPsu.h:26

◆ setPalette()

void TrackerMap::setPalette ( int  numpalette)
inline

◆ setRange()

void TrackerMap::setRange ( float  min,
float  max 
)

Definition at line 806 of file TrackerMap.cc.

References gmaxvalue, gminvalue, WZElectronSkims53X_cff::max, SiStripPI::min, funct::pow(), and tkMapLog.

806  {
807  gminvalue = min;
808  gmaxvalue = max;
809  if (tkMapLog) {
810  gminvalue = pow(10., min);
811  gmaxvalue = pow(10., max);
812  }
813 }
bool tkMapLog
Definition: TrackerMap.h:197
float gminvalue
Definition: TrackerMap.h:666
float gmaxvalue
Definition: TrackerMap.h:666
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ setText() [1/2]

void TrackerMap::setText ( int  idmod,
std::string  s 
)

Definition at line 3454 of file TrackerMap.cc.

References gather_cfg::cout, B2GTnPMonitor_cfi::idmod, imoduleMap, mod(), and alignCSCRings::s.

3454  {
3456  if (mod != nullptr) {
3457  mod->text = s;
3458  } else
3459  std::cout << "**************************error in IdModuleMap **************";
3460 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:173
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ setText() [2/2]

void TrackerMap::setText ( int  layer,
int  ring,
int  nmod,
std::string  s 
)

Definition at line 3462 of file TrackerMap.cc.

References gather_cfg::cout, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, mod(), relativeConstraints::ring, alignCSCRings::s, and smoduleMap.

3462  {
3463  int key = layer * 100000 + ring * 1000 + nmod;
3464  TmModule *mod = smoduleMap[key];
3465  if (mod != nullptr) {
3466  mod->text = s;
3467  } else
3468  std::cout << "**************************error in SvgModuleMap **************";
3469 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
key
prepare the HTCondor submission files and eventually submit them
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ setTitle()

void TrackerMap::setTitle ( std::string  s)
inline

◆ showPalette()

void TrackerMap::showPalette ( bool  printflag1)
inline

Definition at line 156 of file TrackerMap.h.

References printflag.

Referenced by BuildTrackerMapPlugin::endJob(), and SiStripBaseCondObjDQM::saveTkMap().

156 { printflag = printflag1; };
bool printflag
Definition: TrackerMap.h:190

◆ xdpixel()

double TrackerMap::xdpixel ( double  x)
inline

Definition at line 269 of file TrackerMap.h.

References ix, saveAsSingleLayer, x, xmax, xmin, and xsize.

Referenced by drawModule().

269  {
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  }
double xmin
Definition: TrackerMap.h:657
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:673
double xmax
Definition: TrackerMap.h:657

◆ xdpixelc()

double TrackerMap::xdpixelc ( double  x)
inline

Definition at line 294 of file TrackerMap.h.

References ix, saveAsSingleLayer, x, XFEDCSIZE, xmax, and xmin.

Referenced by drawApvPair().

294  {
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  }
double xmin
Definition: TrackerMap.h:657
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:673
#define XFEDCSIZE
Definition: TrackerMap.h:63
double xmax
Definition: TrackerMap.h:657

◆ xdpixelfec()

double TrackerMap::xdpixelfec ( double  x)
inline

Definition at line 312 of file TrackerMap.h.

References ix, saveAsSingleLayer, x, xmax, xmin, and xsize.

Referenced by drawCcu().

312  {
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  }
double xmin
Definition: TrackerMap.h:657
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:673
double xmax
Definition: TrackerMap.h:657

◆ xdpixelpsu()

double TrackerMap::xdpixelpsu ( double  x)
inline

Definition at line 330 of file TrackerMap.h.

References ix, saveAsSingleLayer, x, xmax, xmin, and XPSURSIZE.

Referenced by drawHV2(), drawHV3(), and drawPsu().

330  {
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  }
double xmin
Definition: TrackerMap.h:657
#define XPSURSIZE
Definition: TrackerMap.h:48
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:673
double xmax
Definition: TrackerMap.h:657

◆ ydpixel()

double TrackerMap::ydpixel ( double  y)
inline

Definition at line 277 of file TrackerMap.h.

References iy, nlay, saveAsSingleLayer, xsize, y, testProducerWithPsetDescEmpty_cfi::y1, ymax, ymin, and ysize.

Referenced by drawModule().

277  {
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  }
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:657
bool saveAsSingleLayer
Definition: TrackerMap.h:673
double ymin
Definition: TrackerMap.h:657

◆ ydpixelc()

double TrackerMap::ydpixelc ( double  y)
inline

Definition at line 302 of file TrackerMap.h.

References iy, saveAsSingleLayer, y, testProducerWithPsetDescEmpty_cfi::y1, YFEDCSIZE, ymax, and ymin.

Referenced by drawApvPair().

302  {
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  }
#define YFEDCSIZE
Definition: TrackerMap.h:64
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:657
bool saveAsSingleLayer
Definition: TrackerMap.h:673
double ymin
Definition: TrackerMap.h:657

◆ ydpixelfec()

double TrackerMap::ydpixelfec ( double  y)
inline

Definition at line 320 of file TrackerMap.h.

References iy, saveAsSingleLayer, y, testProducerWithPsetDescEmpty_cfi::y1, ymax, ymin, and ysize.

Referenced by drawCcu().

320  {
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  }
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:657
bool saveAsSingleLayer
Definition: TrackerMap.h:673
double ymin
Definition: TrackerMap.h:657

◆ ydpixelpsu()

double TrackerMap::ydpixelpsu ( double  y)
inline

Definition at line 338 of file TrackerMap.h.

References iy, saveAsSingleLayer, y, testProducerWithPsetDescEmpty_cfi::y1, ymax, ymin, and YPSURSIZE.

Referenced by drawHV2(), drawHV3(), and drawPsu().

338  {
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  }
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:657
bool saveAsSingleLayer
Definition: TrackerMap.h:673
double ymin
Definition: TrackerMap.h:657
#define YPSURSIZE
Definition: TrackerMap.h:49

Member Data Documentation

◆ addPixelFlag

bool TrackerMap::addPixelFlag
private

Definition at line 674 of file TrackerMap.h.

Referenced by addPixel(), init(), and save().

◆ apvMap

SvgApvPair TrackerMap::apvMap

◆ apvModuleMap

ModApvPair TrackerMap::apvModuleMap

Definition at line 177 of file TrackerMap.h.

Referenced by fill_fed_channel(), printall(), printonline(), and TrackerMap().

◆ ccufile

std::ifstream* TrackerMap::ccufile
protected

Definition at line 665 of file TrackerMap.h.

◆ ccuMap

MapCcu TrackerMap::ccuMap

◆ enableFecProcessing

bool TrackerMap::enableFecProcessing

Definition at line 194 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_fectrackermap(), and TrackerMap().

◆ enableFedProcessing

bool TrackerMap::enableFedProcessing

Definition at line 193 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_fedtrackermap(), and TrackerMap().

◆ enableHVProcessing

bool TrackerMap::enableHVProcessing

Definition at line 196 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_HVtrackermap(), and TrackerMap().

◆ enableLVProcessing

bool TrackerMap::enableLVProcessing

Definition at line 195 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_psutrackermap(), and TrackerMap().

◆ fecModuleMap

FecModule TrackerMap::fecModuleMap

Definition at line 184 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_fectrackermap(), and TrackerMap().

◆ fedMap

SvgFed TrackerMap::fedMap

Definition at line 179 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_fedtrackermap(), and TrackerMap().

◆ firstcall

bool TrackerMap::firstcall
protected

Definition at line 660 of file TrackerMap.h.

Referenced by init().

◆ firstcrate

int TrackerMap::firstcrate
protected

Definition at line 654 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_fedtrackermap(), and TrackerMap().

◆ firstRing

int TrackerMap::firstRing[43]

◆ gmaxvalue

float TrackerMap::gmaxvalue
protected

Definition at line 666 of file TrackerMap.h.

Referenced by init(), printonline(), and setRange().

◆ gminvalue

float TrackerMap::gminvalue
protected

Definition at line 666 of file TrackerMap.h.

Referenced by init(), printonline(), and setRange().

◆ imoduleMap

ImoduleMap TrackerMap::imoduleMap

◆ infilename

std::string TrackerMap::infilename

Definition at line 199 of file TrackerMap.h.

Referenced by build(), and TrackerMap().

◆ inputfile

std::ifstream* TrackerMap::inputfile
protected

Definition at line 664 of file TrackerMap.h.

Referenced by load().

◆ ix

int TrackerMap::ix
protected

◆ iy

int TrackerMap::iy
protected

◆ jsfile

std::ifstream* TrackerMap::jsfile
protected

Definition at line 663 of file TrackerMap.h.

Referenced by print().

◆ jsfilename

std::string TrackerMap::jsfilename

Definition at line 199 of file TrackerMap.h.

Referenced by print(), and TrackerMap().

◆ jsPath

std::string TrackerMap::jsPath

Definition at line 200 of file TrackerMap.h.

Referenced by findfile(), and TrackerMap().

◆ legInfos_

std::vector<TPolyLine*> TrackerMap::legInfos_
private

Definition at line 677 of file TrackerMap.h.

Referenced by buildLegend().

◆ legKeys_

std::vector<std::string> TrackerMap::legKeys_
private

Definition at line 678 of file TrackerMap.h.

Referenced by buildLegend().

◆ maxvalue

float TrackerMap::maxvalue
protected

◆ minvalue

float TrackerMap::minvalue
protected

◆ ncrates

int TrackerMap::ncrates
protected

Definition at line 653 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_fedtrackermap(), and TrackerMap().

◆ nfeccrates

int TrackerMap::nfeccrates
protected

Definition at line 655 of file TrackerMap.h.

Referenced by printall(), printonline(), save_as_fectrackermap(), and TrackerMap().

◆ nlay

int TrackerMap::nlay
protected

Definition at line 650 of file TrackerMap.h.

Referenced by drawModule(), and ydpixel().

◆ npsuracks

int TrackerMap::npsuracks
protected

◆ ntotRing

int TrackerMap::ntotRing[43]

◆ number_modules

int TrackerMap::number_modules
protected

Definition at line 668 of file TrackerMap.h.

Referenced by build().

◆ oldz

float TrackerMap::oldz
private

Definition at line 672 of file TrackerMap.h.

◆ onlyPixelFlag

bool TrackerMap::onlyPixelFlag
private

Definition at line 675 of file TrackerMap.h.

Referenced by init(), onlyPixel(), and save().

◆ palette

int TrackerMap::palette

◆ posrel

bool TrackerMap::posrel
protected

Definition at line 659 of file TrackerMap.h.

Referenced by defwindow(), drawModule(), and init().

◆ printflag

bool TrackerMap::printflag

◆ psetAvailable

bool TrackerMap::psetAvailable

Definition at line 201 of file TrackerMap.h.

Referenced by TrackerMap().

◆ psuMap

MapPsu TrackerMap::psuMap

◆ psuModuleMap

PsuModule TrackerMap::psuModuleMap

◆ saveAsSingleLayer

bool TrackerMap::saveAsSingleLayer
private

◆ savefile

std::ofstream* TrackerMap::savefile
protected

◆ saveGeoTrackerMap

bool TrackerMap::saveGeoTrackerMap

Definition at line 192 of file TrackerMap.h.

Referenced by printall(), save(), and TrackerMap().

◆ saveWebInterface

bool TrackerMap::saveWebInterface

◆ slotMap

SvgFed TrackerMap::slotMap

Definition at line 180 of file TrackerMap.h.

Referenced by save_as_fedtrackermap(), and TrackerMap().

◆ smoduleMap

SmoduleMap TrackerMap::smoduleMap

◆ svgfile

std::ofstream* TrackerMap::svgfile
protected

Definition at line 661 of file TrackerMap.h.

Referenced by drawApvPair(), drawCcu(), drawHV2(), drawHV3(), drawModule(), drawPalette(), drawPsu(), and print().

◆ temporary_file

bool TrackerMap::temporary_file
protected

◆ title

std::string TrackerMap::title

◆ tkMapLog

bool TrackerMap::tkMapLog

◆ vc

std::vector<TColor*> TrackerMap::vc

◆ xmax

double TrackerMap::xmax
protected

◆ xmin

double TrackerMap::xmin
protected

◆ xsize

int TrackerMap::xsize
protected

◆ ymax

double TrackerMap::ymax
protected

◆ ymin

double TrackerMap::ymin
protected

◆ ysize

int TrackerMap::ysize
protected