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 ndet
 
int npart
 
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 77 of file TrackerMap.h.

Member Typedef Documentation

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

Definition at line 158 of file TrackerMap.h.

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

Definition at line 147 of file TrackerMap.h.

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

Definition at line 156 of file TrackerMap.h.

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

Definition at line 160 of file TrackerMap.h.

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

Definition at line 151 of file TrackerMap.h.

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

Definition at line 162 of file TrackerMap.h.

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

Definition at line 145 of file TrackerMap.h.

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

Definition at line 149 of file TrackerMap.h.

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

Definition at line 153 of file TrackerMap.h.

Constructor & Destructor Documentation

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

Definition at line 413 of file TrackerMap.cc.

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

413  {
414  psetAvailable=false;
415  xsize=xsize1;ysize=ysize1;
416  title=s;
417  jsfilename="CommonTools/TrackerMap/data/trackermap.txt";
418  infilename="CommonTools/TrackerMap/data/tracker.dat";
419  saveWebInterface=false;
420  saveGeoTrackerMap=true;
421  tkMapLog=false;
422  jsPath="CommonTools/TrackerMap/data/";
423  enableFedProcessing=false;
424  enableFecProcessing=false;
425  enableLVProcessing=false;
426  enableHVProcessing=false;
427  saveAsSingleLayer=false;
428  init();
429 
430 }
bool tkMapLog
Definition: TrackerMap.h:172
bool psetAvailable
Definition: TrackerMap.h:178
bool saveGeoTrackerMap
Definition: TrackerMap.h:167
bool enableFecProcessing
Definition: TrackerMap.h:169
bool saveWebInterface
Definition: TrackerMap.h:166
std::string infilename
Definition: TrackerMap.h:176
bool enableFedProcessing
Definition: TrackerMap.h:168
std::string jsPath
Definition: TrackerMap.h:177
bool enableHVProcessing
Definition: TrackerMap.h:171
bool saveAsSingleLayer
Definition: TrackerMap.h:512
void init()
Definition: TrackerMap.cc:440
std::string title
Definition: TrackerMap.h:175
bool enableLVProcessing
Definition: TrackerMap.h:170
std::string jsfilename
Definition: TrackerMap.h:176
TrackerMap::TrackerMap ( const edm::ParameterSet iConfig)

Definition at line 393 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.

393  {
394  psetAvailable=true;
395  xsize=340;ysize=200;
396  title=" ";
397  jsfilename="CommonTools/TrackerMap/data/trackermap.txt";
398  infilename="CommonTools/TrackerMap/data/tracker.dat";
400  saveAsSingleLayer=false;
401  tkMapLog = tkmapPset.getUntrackedParameter<bool>("logScale",false);
402  saveWebInterface=tkmapPset.getUntrackedParameter<bool>("saveWebInterface",false);
403  saveGeoTrackerMap=tkmapPset.getUntrackedParameter<bool>("saveGeoTrackerMap",true);
404  // if(tkmapPset.exists("trackermaptxtPath")){
405  jsfilename=tkmapPset.getUntrackedParameter<std::string>("trackermaptxtPath","CommonTools/TrackerMap/data/")+"trackermap.txt";
406  std::cout << jsfilename << std::endl;
407  infilename=tkmapPset.getUntrackedParameter<std::string>("trackerdatPath","CommonTools/TrackerMap/data/")+"tracker.dat";
408  std::cout << infilename << std::endl;
409  // } else std::cout << "no parameters found" << std::endl;
410  init();
411 }
bool tkMapLog
Definition: TrackerMap.h:172
bool psetAvailable
Definition: TrackerMap.h:178
bool saveGeoTrackerMap
Definition: TrackerMap.h:167
bool saveWebInterface
Definition: TrackerMap.h:166
std::string infilename
Definition: TrackerMap.h:176
bool enableFedProcessing
Definition: TrackerMap.h:168
bool saveAsSingleLayer
Definition: TrackerMap.h:512
void init()
Definition: TrackerMap.cc:440
int firstcrate
Definition: TrackerMap.h:492
std::string title
Definition: TrackerMap.h:175
std::string jsfilename
Definition: TrackerMap.h:176
TrackerMap::TrackerMap ( const edm::ParameterSet iConfig,
const SiStripFedCabling tkFed,
const TrackerTopology *const  topology 
)

Definition at line 33 of file TrackerMap.cc.

References apvMap, apvModuleMap, MicroEventContent_cff::branch, dataDML::branchinfo, TmModule::capvids, TmModule::CcuId, ccuMap, TmCcu::cmodid, TmPsu::cmodid_HV2, TmPsu::cmodid_HV3, TmPsu::cmodid_LV, gather_cfg::cout, TmApvPair::crate, SiStripFecCabling::crates(), enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), fedMap, firstcrate, 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, TmModule::idex, imoduleMap, recoMuon::in, infilename, init(), sistrip::invalid32_, sistrip::invalid_, jsfilename, jsPath, crabWrapper::key, TmCcu::layer, TmModule::layer, mod(), TmApvPair::mod, TmApvPair::mpos, TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, psetAvailable, TmPsu::psId, TmModule::PsuId, TmModule::psuIdex, psuMap, psuModuleMap, relativeConstraints::ring, alignCSCRings::s, saveAsSingleLayer, saveGeoTrackerMap, saveWebInterface, slotMap, AlCaHLTBitMon_QueryRunRegistry::string, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, tkMapLog, xsize, and ysize.

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

default destructor

Definition at line 491 of file TrackerMap.cc.

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

491  {
492 
493 for (int layer=1; layer < 44; layer++){
494  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
495  for (int module=1;module<200;module++) {
496  int key=layer*100000+ring*1000+module;
497  TmModule * mod = smoduleMap[key];
498  if(mod !=nullptr ) delete mod;
499  }
500  }
501  }
502 
503 //std::map<int , TmModule *>::iterator i_mod;
504 // for( i_mod=imoduleMap.begin();i_mod !=imoduleMap.end(); i_mod++){
505 // TmModule * mod= i_mod->second;
506 // delete mod;
507 // }
508 std::map<int , TmApvPair *>::iterator i_apv;
509  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
510  TmApvPair * apvPair= i_apv->second;
511  delete apvPair;
512  }
513 
514 
515 std::map<int , TmCcu *>::iterator i_ccu;
516  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
517  TmCcu * ccu= i_ccu->second;
518  delete ccu;
519  }
520 
521 std::map<int , TmPsu *>::iterator ipsu;
522  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
523  TmPsu * psu= ipsu->second;
524  delete psu;
525  }
526 
527 gROOT->Reset();
528 
529 
530 //for(std::vector<TColor*>::iterator col1=vc.begin();col1!=vc.end();col1++){
531 // std::cout<<(*col1)<<std::endl;}
532 }
MapCcu ccuMap
Definition: TrackerMap.h:157
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
int firstRing[43]
Definition: TrackerMap.h:485
SvgApvPair apvMap
Definition: TrackerMap.h:150
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmCcu.h:5
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: TmPsu.h:6
Definition: vlib.h:208
int ntotRing[43]
Definition: TrackerMap.h:484

Member Function Documentation

void TrackerMap::addPixel ( bool  addPixelfl)
inline

Definition at line 135 of file TrackerMap.h.

References addPixelFlag.

Referenced by DetIdSelectorTest::DetIdSelectorTest().

135 {addPixelFlag=addPixelfl;};
bool addPixelFlag
Definition: TrackerMap.h:513
void TrackerMap::build ( )

Definition at line 2817 of file TrackerMap.cc.

References TmModule::count, gather_cfg::cout, TmModule::idex, imoduleMap, recoMuon::in, infilename, crabWrapper::key, TmModule::length, mod(), TmModule::name, dataset::name, number_modules, TmModule::posx, TmModule::posy, TmModule::posz, relativeConstraints::ring, TmModule::setUsed(), smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, TmModule::thickness, TmModule::value, TmModule::width, ApeEstimator_cff::width, and TmModule::widthAtHalfLength.

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

2817  {
2818  // std::ifstream* infile;
2819 
2820  int nmods, pix_sil, fow_bar, ring, nmod, layer;
2821  unsigned int idex;
2822  float posx, posy, posz, length, width, thickness, widthAtHalfLength;
2823  int iModule=0,old_layer=0, ntotMod =0;
2824  std::string name,dummys;
2825  std::ifstream infile(edm::FileInPath(infilename).fullPath().c_str(),std::ios::in);
2826  while(!infile.eof()) {
2827  infile >> nmods >> pix_sil >> fow_bar >> layer >> ring >> nmod >> posx >> posy
2828  >> posz>> length >> width >> thickness
2829  >> widthAtHalfLength >> idex ;
2830  getline(infile,dummys); //necessary to reach end of record
2831  getline(infile,name);
2832  if(old_layer!=layer){old_layer=layer;iModule=0;}
2833  iModule++;
2834  ntotMod++;
2835  int key=layer*100000+ring*1000+nmod;
2836  TmModule * mod = smoduleMap[key];
2837 
2838  imoduleMap[idex]=mod;
2839 
2840  if(mod==nullptr) std::cout << "error in module "<<key <<std::endl;
2841  else
2842  {
2843  mod->posx = posx;
2844  mod->posy = posy;
2845  mod->setUsed();
2846  mod->value=0;
2847  mod->count=0;
2848  mod->posz = posz;
2849  mod->length = length;
2850  mod->width = width;
2851  mod->thickness = thickness;
2852  mod->widthAtHalfLength = widthAtHalfLength;
2853  mod->idex = idex;
2854  mod->name = name;
2855  }
2856  }
2857  infile.close();
2858  number_modules = ntotMod-1;
2859 }
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
void setUsed()
Definition: TmModule.h:25
float posz
Definition: TmModule.h:9
int number_modules
Definition: TrackerMap.h:506
std::string infilename
Definition: TrackerMap.h:176
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
float posx
Definition: TmModule.h:9
unsigned int idex
Definition: TmModule.h:29
float posy
Definition: TmModule.h:9
int count
Definition: TmModule.h:13
float width
Definition: TmModule.h:10
float widthAtHalfLength
Definition: TmModule.h:10
float thickness
Definition: TmModule.h:10
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
float length
Definition: TmModule.h:10
std::string name
Definition: TmModule.h:15
TLegend * TrackerMap::buildLegend ( )
private

Definition at line 3623 of file TrackerMap.cc.

References mps_fire::i, legInfos_, and legKeys_.

Referenced by save().

3623  {
3624  if ( legInfos_.empty() ) {
3625  legInfos_.reserve(8);
3626 
3627  legInfos_.push_back(new TPolyLine(0));
3628  legInfos_.back()->SetFillColor(kGreen);
3629  legInfos_.push_back(new TPolyLine(0));
3630  legInfos_.back()->SetFillColor(kBlue-9);
3631  legInfos_.push_back(new TPolyLine(0));
3632  legInfos_.back()->SetFillColor(kRed+2);
3633  legInfos_.push_back(new TPolyLine(0));
3634  legInfos_.back()->SetFillColor(kPink-9);
3635  legInfos_.push_back(new TPolyLine(0));
3636  legInfos_.back()->SetFillColor(kOrange+2);
3637  legInfos_.push_back(new TPolyLine(0));
3638  legInfos_.back()->SetFillColor(kYellow);
3639  legInfos_.push_back(new TPolyLine(0));
3640  legInfos_.back()->SetFillColor(kRed+1);
3641  legInfos_.push_back(new TPolyLine(0));
3642  legInfos_.back()->SetFillColor(kViolet-5);
3643  legKeys_ = { "Good Modules","Excluded FED","FED errors", "# Clusters",
3644  "# Digis", "PCL bad", "# Clusters & Digis", "DCS Error"};
3645  }
3646 
3647  TLegend* myL=new TLegend(0.56,0.87,0.95,0.99);
3648  myL->SetNColumns(2);
3649  myL->SetBorderSize(0);
3650  myL->SetFillColor(38);
3651  for ( unsigned int i=0; i< legInfos_.size(); i++ ) {
3652  myL->AddEntry((TObject*)legInfos_[i],legKeys_[i].c_str(),"f");
3653  }
3654  // myL->Draw();
3655  return myL;
3656 }
std::vector< TPolyLine * > legInfos_
Definition: TrackerMap.h:516
std::vector< std::string > legKeys_
Definition: TrackerMap.h:517
void TrackerMap::defcwindow ( int  num_crate)
inline

Definition at line 304 of file TrackerMap.h.

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

Referenced by save_as_fedtrackermap().

304  {
305  // ncrate = num_crate;
306  int xoffset=XFEDOFFSET;
307  int yoffset=YFEDOFFSET;
309 
310  ix = xoffset+((NUMFEDCRATE_INCOLUMN-1)-((num_crate-1)%NUMFEDCRATE_INCOLUMN))*(XFEDCSIZE+XFEDOFFSET);
311  iy = yoffset+((num_crate-1)/NUMFEDCRATE_INCOLUMN)*(YFEDCSIZE+YFEDOFFSET);
312  }
#define NUMFEDCRATE_INCOLUMN
Definition: TrackerMap.h:61
#define YFEDOFFSET
Definition: TrackerMap.h:68
double xmin
Definition: TrackerMap.h:495
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:55
#define YFEDCSIZE
Definition: TrackerMap.h:66
double ymax
Definition: TrackerMap.h:495
#define NUMFED_INCOLUMN
Definition: TrackerMap.h:57
#define XFEDCSIZE
Definition: TrackerMap.h:65
double xmax
Definition: TrackerMap.h:495
double ymin
Definition: TrackerMap.h:495
#define NUMFED_INROW
Definition: TrackerMap.h:58
#define XFEDOFFSET
Definition: TrackerMap.h:67
#define NUMFEDCH_INROW
Definition: TrackerMap.h:56
void TrackerMap::deffecwindow ( int  num_crate)
inline

Definition at line 313 of file TrackerMap.h.

References ix, iy, xmax, xmin, xsize, ymax, ymin, and ysize.

Referenced by save_as_fectrackermap().

313  {
314  // ncrate = num_crate;
315  int xoffset=xsize/3;
316  int yoffset=2*ysize;
317  xmin=-1.;xmax=37.; ymin = -10.; ymax=40.;
318  if(num_crate==1||num_crate==3)ix = xoffset+xsize*2;
319  if(num_crate==2||num_crate==4)ix = xoffset;
320  iy = yoffset+((num_crate-1)/2)*ysize*4;
321  }
double xmin
Definition: TrackerMap.h:495
double ymax
Definition: TrackerMap.h:495
double xmax
Definition: TrackerMap.h:495
double ymin
Definition: TrackerMap.h:495
void TrackerMap::defpsuwindow ( int  num_rack)
inline

Definition at line 322 of file TrackerMap.h.

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

Referenced by save_as_HVtrackermap(), and save_as_psutrackermap().

322  {
323  // nrack = num_rack;
324  int xoffset=XPSUOFFSET;
325  int yoffset=YPSUOFFSET;
326  xmin=0; xmax=(NUMPSUCRATE_INCOLUMN)*1.5;
328 
329  ix = xoffset+((NUMPSURACK_INCOLUMN-1)-((num_rack-1)%NUMPSURACK_INCOLUMN))*(XPSURSIZE+XPSUOFFSET);
330  iy = yoffset+((num_rack-1)/NUMPSURACK_INCOLUMN)*(YPSURSIZE+YPSUOFFSET);
331  }
#define NUMPSURACK_INCOLUMN
Definition: TrackerMap.h:48
double xmin
Definition: TrackerMap.h:495
#define XPSURSIZE
Definition: TrackerMap.h:50
double ymax
Definition: TrackerMap.h:495
double xmax
Definition: TrackerMap.h:495
double ymin
Definition: TrackerMap.h:495
#define YPSUOFFSET
Definition: TrackerMap.h:53
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:47
#define YPSURSIZE
Definition: TrackerMap.h:51
#define XPSUOFFSET
Definition: TrackerMap.h:52
#define NUMPSUCH_INROW
Definition: TrackerMap.h:46
void TrackerMap::defwindow ( int  num_lay)
inline

Definition at line 334 of file TrackerMap.h.

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

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

334  {
335  // nlay = num_lay;
336  if(posrel){ // separated modules
337  xmin=-2.;ymin=-2.;xmax=2.;ymax=2.;
338  if(num_lay >12 && num_lay < 19){
339  xmin=-.40;xmax=.40;ymin=-.40;ymax=.40;
340  }
341  if(num_lay>30){
342  xmin=-0.1;xmax=3.;ymin=-0.1;ymax=8.5;
343  if(num_lay<34){xmin=-0.3;xmax=1.0;}
344  if(num_lay>33&&num_lay<38){xmax=2.0;}
345  if(num_lay>37){ymax=8.;}//inner
346  }
347  }else{ //overlayed modules
348  xmin=-1.3;ymin=-1.3;xmax=1.3;ymax=1.3;
349  if(num_lay >12 && num_lay < 19){
350  xmin=-.20;xmax=.20;ymin=-.20;ymax=.20;
351  }
352  if(num_lay>30){
353  xmin=-1.5;xmax=1.5;ymin=-1.;ymax=28.;
354  if(num_lay<34){xmin=-0.5;xmax=0.5;}
355  if(num_lay>33&&num_lay<38){xmin=-1.;xmax=1.;}
356  }
357 
358  }
359  if(num_lay<16){
360  ix=0;
361  if(num_lay==15||num_lay==14)iy=(15-num_lay)*2*ysize; else
362  {if(num_lay>9&&num_lay<13)iy=4*ysize-(int)(ysize/2.)+(12-num_lay)*(int)(ysize/1.50);else iy=6*ysize+(9-num_lay)*(int)(ysize*1.3);}}
363  if(num_lay>15&&num_lay<31){
364  ix=3*xsize;
365  if(num_lay==16||num_lay==17)iy=(num_lay-16)*2*ysize; else
366  {if(num_lay>18&&num_lay<22)iy=4*ysize-(int)(ysize/2.)+(num_lay-19)*(int)(ysize/1.50);else iy=6*ysize+(num_lay-22)*(int)(ysize*1.3);}}
367  if(num_lay>30){
368  if(num_lay==31){ix=(int)(1.5*xsize);iy=0;}
369  if(num_lay==32){int il=(num_lay-30)/2;ix=xsize;iy=il*2*ysize;}
370  if(num_lay==33){int il=(num_lay-30)/2;ix=2*xsize;iy=il*2*ysize;}
371  if(num_lay==34){int il=(num_lay-30)/2;ix=xsize;iy=il*(int)(2.57*ysize);}
372  if(num_lay>34 && num_lay%2==0){int il=(num_lay-30)/2;ix=xsize;iy=il*(int)(2.5*ysize);}
373  if(num_lay>34 && num_lay%2!=0){int il=(num_lay-30)/2;ix=2*xsize;iy=il*(int)(2.5*ysize);}
374  }
375 }
double xmin
Definition: TrackerMap.h:495
bool posrel
Definition: TrackerMap.h:497
double ymax
Definition: TrackerMap.h:495
double xmax
Definition: TrackerMap.h:495
double ymin
Definition: TrackerMap.h:495
void TrackerMap::drawApvPair ( int  crate,
int  numfed_incrate,
bool  total,
TmApvPair apvPair,
std::ofstream *  file,
bool  useApvPairValue 
)

Definition at line 950 of file TrackerMap.cc.

References TmApvPair::blue, TmModule::blue, DivergingColor::blue, edmScanValgrind::buffer, create_public_lumi_plots::color, TmModule::count, TmApvPair::count, PVValHelper::dx, PVValHelper::dy, getcolor(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmModule::getKey(), TmApvPair::green, TmModule::green, cmsRelvalreport::green(), TmApvPair::idex, TmModule::idex, createfilelist::int, gen::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, temporary_file, TmApvPair::value, TmModule::value, xdpixelc(), and ydpixelc().

Referenced by save_as_fedtrackermap().

951 {
952  double xp[4],yp[4];
953  int color;
954  int green = 0;
955  int red = 0;
956  int blue = 0;
957  double xd[4],yd[4];
958  int np = 4;
959  double boxinitx=0., boxinity=0.;
960  double dx=.9,dy=.9;
961  /*
962  int numfedch_incolumn = 12;
963  int numfedch_inrow = 8;
964  int numfed_incolumn = 6;
965  int numfed_inrow = 4;
966  */
967  boxinitx=boxinitx+(NUMFED_INCOLUMN-1-(numfed_incrate-1)/NUMFED_INROW)*(NUMFEDCH_INCOLUMN+2);
968  boxinity=boxinity+(NUMFED_INROW-1-(numfed_incrate-1)%NUMFED_INROW)*(NUMFEDCH_INROW+1);
969  boxinity=boxinity+NUMFEDCH_INROW-(apvPair->getFedCh()/NUMFEDCH_INCOLUMN);
970  boxinitx = boxinitx+NUMFEDCH_INCOLUMN-(int)(apvPair->getFedCh()%NUMFEDCH_INCOLUMN);
971  // std::cout << crate << " " << numfed_incrate << " " << apvPair->getFedCh()<<" "<<boxinitx<< " " << boxinity << std::endl; ;
972  xp[0]=boxinitx;yp[0]=boxinity;
973  xp[1]=boxinitx+dx;yp[1]=boxinity;
974  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
975  xp[3]=boxinitx;yp[3]=boxinity + dy;
976  for(int j=0;j<4;j++){
977  xd[j]=xdpixelc(xp[j]);yd[j]=ydpixelc(yp[j]);
978  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
979  }
980 
981  char buffer [20];
982  sprintf(buffer,"%X",apvPair->mod->idex);
983  std::string s = apvPair->mod->name;
984  s.erase(s.begin()+s.find("connected"),s.end());
985 
986  if(useApvPairValue){
987  if(apvPair->red < 0){ //use count to compute color
988  if(apvPair->count > 0) {
989  color = getcolor(apvPair->value,palette);
990  red=(color>>16)&0xFF;
991  green=(color>>8)&0xFF;
992  blue=(color)&0xFF;
993  if(!print_total)apvPair->value=apvPair->value*apvPair->count;//restore mod->value
994  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
995  else *svgfile <<"<svg:polygon detid=\""<<apvPair->idex<<"\" count=\""<<apvPair->count <<"\" value=\""<<apvPair->value<<"\" id=\""<<apvPair->idex+crate*1000000<<"\" cmodid=\""<<apvPair->mod->getKey()<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->getFedId()<<"/"<<apvPair->getFedCh()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" points=\"";
996  } else {
997  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
998  else *svgfile <<"<svg:polygon detid=\""<<apvPair->idex<<"\" count=\""<<apvPair->count <<"\" value=\""<<apvPair->value<<"\" id=\""<<apvPair->idex+crate*1000000<<"\" cmodid=\""<<apvPair->mod->getKey()<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->getFedId()<<"/"<<apvPair->getFedCh()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"white\" points=\"";
999  }
1000  } else {//color defined with fillc
1001  if(apvPair->red>255)apvPair->red=255;
1002  if(apvPair->green>255)apvPair->green=255;
1003  if(apvPair->blue>255)apvPair->blue=255;
1004  if(temporary_file)*svgfile << apvPair->red << " " << apvPair->green << " " << apvPair->blue << " ";
1005  else *svgfile <<"<svg:polygon detid=\""<<apvPair->idex<<"\" count=\""<<apvPair->count <<"\" value=\""<<apvPair->value<<"\" id=\""<<apvPair->idex+crate*1000000<<"\" cmodid=\""<<apvPair->mod->getKey()<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->getFedId()<<"/"<<apvPair->getFedCh()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"rgb("<<apvPair->red<<","<<apvPair->green<<","<<apvPair->blue<<")\" points=\"";
1006  }
1007  }else{
1008  if(apvPair->mod->red < 0){ //use count to compute color
1009  if(apvPair->mod->count > 0) {
1010  color = getcolor(apvPair->mod->value,palette);
1011  red=(color>>16)&0xFF;
1012  green=(color>>8)&0xFF;
1013  blue=(color)&0xFF;
1014  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
1015  else *svgfile <<"<svg:polygon detid=\""<<apvPair->idex<<"\" count=\""<<apvPair->count <<"\" value=\""<<apvPair->value<<"\" id=\""<<apvPair->idex+crate*1000000<<"\" cmodid=\""<<apvPair->mod->getKey()<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->getFedId()<<"/"<<apvPair->getFedCh()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" points=\"";
1016  } else {
1017  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1018  else *svgfile <<"<svg:polygon detid=\""<<apvPair->idex<<"\" count=\""<<apvPair->count <<"\" value=\""<<apvPair->value<<"\" id=\""<<apvPair->idex+crate*1000000<<"\" cmodid=\""<<apvPair->mod->getKey()<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->getFedId()<<"/"<<apvPair->getFedCh()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"white\" points=\"";
1019  }
1020  } else {//color defined with fillc
1021  if(apvPair->mod->red>255)apvPair->mod->red=255;
1022  if(apvPair->mod->green>255)apvPair->mod->green=255;
1023  if(apvPair->mod->blue>255)apvPair->mod->blue=255;
1024  if(temporary_file)*svgfile << apvPair->mod->red << " " << apvPair->mod->green << " " << apvPair->mod->blue << " ";
1025  else *svgfile <<"<svg:polygon detid=\""<<apvPair->idex<<"\" count=\""<<apvPair->count <<"\" value=\""<<apvPair->value<<"\" id=\""<<apvPair->idex+crate*1000000<<"\" cmodid=\""<<apvPair->mod->getKey()<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Fed/Ch "<<apvPair->getFedId()<<"/"<<apvPair->getFedCh()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"rgb("<<apvPair->mod->red<<","<<apvPair->mod->green<<","<<apvPair->mod->blue<<")\" points=\"";
1026  }
1027  }
1028  if(temporary_file)*svgfile << np << " ";
1029  for(int k=0;k<np;k++){
1030  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1031  else *svgfile << xd[k] << "," << yd[k] << " " ;
1032  }
1033  if(temporary_file)*svgfile << std::endl;
1034  else *svgfile <<"\" />" <<std::endl;
1035 }
TmModule * mod
Definition: TmApvPair.h:16
double ydpixelc(double y)
Definition: TrackerMap.h:267
float value
Definition: TmModule.h:12
int green
Definition: TmApvPair.h:10
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:55
double xdpixelc(double x)
Definition: TrackerMap.h:261
int getFedId()
Definition: TmApvPair.h:19
int red
Definition: TmApvPair.h:10
unsigned int idex
Definition: TmModule.h:29
int np
Definition: AMPTWrapper.h:33
#define NUMFED_INCOLUMN
Definition: TrackerMap.h:57
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
int blue
Definition: TmApvPair.h:10
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
int count
Definition: TmModule.h:13
int k[5][pyjets_maxn]
def green(string)
int getKey()
Definition: TmModule.h:23
int green
Definition: TmModule.h:11
int count
Definition: TmApvPair.h:13
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
#define NUMFED_INROW
Definition: TrackerMap.h:58
int idex
Definition: TmApvPair.h:14
float value
Definition: TmApvPair.h:11
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
#define NUMFEDCH_INROW
Definition: TrackerMap.h:56
void TrackerMap::drawCcu ( int  crate,
int  numfed_incrate,
bool  total,
TmCcu ccu,
std::ofstream *  file,
bool  useCcuValue 
)

Definition at line 1036 of file TrackerMap.cc.

References TmCcu::blue, DivergingColor::blue, edmScanValgrind::buffer, TmCcu::cmodid, create_public_lumi_plots::color, TmCcu::count, PVValHelper::dx, PVValHelper::dy, TmCcu::getCcuRing(), TmCcu::getCcuSlot(), getcolor(), TmCcu::green, cmsRelvalreport::green(), TmCcu::idex, createfilelist::int, gen::k, TmCcu::layer, TmCcu::mpos, np, palette, TmCcu::red, DivergingColor::red, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmCcu::value, xdpixelfec(), and ydpixelfec().

Referenced by save_as_fectrackermap().

1037 {
1038  double xp[4],yp[4];
1039  int color;
1040  int green = 0;
1041  int red = 0;
1042  int blue = 0;
1043  double xd[4],yd[4];
1044  int np = 4;
1045  double boxinitx=0., boxinity=0.;
1046  double dx=.9,dy=.9;
1047  int numccu_incolumn = 8;
1048  int numccu_inrow = 15;
1049  int numfec_incolumn = 5;
1050  int numfec_inrow = 4;
1051  boxinitx=boxinitx+(numfec_incolumn-(numfec_incrate-1)/numfec_inrow)*14.;
1052  boxinity=boxinity+(numfec_inrow-(numfec_incrate-1)%numfec_inrow)*16.;
1053  boxinity=boxinity+numccu_inrow-ccu->mpos;
1054  boxinitx = boxinitx+numccu_incolumn-(int)(ccu->getCcuRing()%numccu_incolumn);
1055  //std::cout << crate << " " << numfec_incrate << " " << ccu->getCcuRing()<<" "<<ccu->mpos<<" "<<boxinitx<< " " << boxinity << std::endl; ;
1056  xp[0]=boxinitx;yp[0]=boxinity;
1057  xp[1]=boxinitx+dx;yp[1]=boxinity;
1058  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1059  xp[3]=boxinitx;yp[3]=boxinity + dy;
1060  for(int j=0;j<4;j++){
1061  xd[j]=xdpixelfec(xp[j]);yd[j]=ydpixelfec(yp[j]);
1062  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1063  }
1064 
1065  char buffer [20];
1066  sprintf(buffer,"%X",ccu->idex);
1067  //sprintf(buffer,"%X",ccu->mod->idex);
1068  //std::string s = ccu->mod->name;
1069  std::string s = ccu->text;
1070  s.erase(s.begin()+s.find("connected"),s.end());
1071 
1072  if(ccu->red < 0){ //use count to compute color
1073  if(ccu->count > 0) {
1074  color = getcolor(ccu->value,palette);
1075  red=(color>>16)&0xFF;
1076  green=(color>>8)&0xFF;
1077  blue=(color)&0xFF;
1078  if(!print_total)ccu->value=ccu->value*ccu->count;//restore mod->value
1079  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
1080  else *svgfile <<"<svg:polygon detid=\""<<ccu->idex<<"\" count=\""<<ccu->count <<"\" value=\""<<ccu->value<<"\" id=\""<<ccu->idex+crate*1000000<<"\" cmodid=\""<<ccu->cmodid<<"\" layer=\""<<ccu->layer<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Slot/Ring"<<ccu->getCcuSlot()<<"/"<<ccu->getCcuRing()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" points=\"";
1081  } else {
1082  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1083  else *svgfile <<"<svg:polygon detid=\""<<ccu->idex<<"\" count=\""<<ccu->count <<"\" value=\""<<ccu->value<<"\" id=\""<<ccu->idex+crate*1000000<<"\" cmodid=\""<<ccu->cmodid<<"\" layer=\""<<ccu->layer<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Slot/Ring "<<ccu->getCcuSlot()<<"/"<<ccu->getCcuRing()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"white\" points=\"";
1084  }
1085  } else {//color defined with fillc
1086  if(ccu->red>255)ccu->red=255;
1087  if(ccu->green>255)ccu->green=255;
1088  if(ccu->blue>255)ccu->blue=255;
1089  if(temporary_file)*svgfile << ccu->red << " " << ccu->green << " " << ccu->blue << " ";
1090  else *svgfile <<"<svg:polygon detid=\""<<ccu->idex<<"\" count=\""<<ccu->count <<"\" value=\""<<ccu->value<<"\" id=\""<<ccu->idex+crate*1000000<<"\" cmodid=\""<<ccu->cmodid<<"\" layer=\""<<ccu->layer<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"Slot/Ring "<<ccu->getCcuSlot()<<"/"<<ccu->getCcuRing()<<" connected to "<<s<<" Id "<<buffer<<" \" fill=\"rgb("<<ccu->red<<","<<ccu->green<<","<<ccu->blue<<")\" points=\"";
1091  }
1092 if(temporary_file)*svgfile << np << " ";
1093 for(int k=0;k<np;k++){
1094  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1095  else *svgfile << xd[k] << "," << yd[k] << " " ;
1096 }
1097 if(temporary_file)*svgfile << std::endl;
1098 else *svgfile <<"\" />" <<std::endl;
1099 
1100 }
double ydpixelfec(double y)
Definition: TrackerMap.h:281
std::string cmodid
Definition: TmCcu.h:16
int layer
Definition: TmCcu.h:17
int getCcuRing()
Definition: TmCcu.h:21
int count
Definition: TmCcu.h:12
double xdpixelfec(double x)
Definition: TrackerMap.h:275
int getCcuSlot()
Definition: TmCcu.h:20
int np
Definition: AMPTWrapper.h:33
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
int green
Definition: TmCcu.h:9
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
int k[5][pyjets_maxn]
int mpos
Definition: TmCcu.h:18
def green(string)
float value
Definition: TmCcu.h:10
int idex
Definition: TmCcu.h:13
int red
Definition: TmCcu.h:9
int blue
Definition: TmCcu.h:9
std::string text
Definition: TmCcu.h:11
void TrackerMap::drawHV2 ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1178 of file TrackerMap.cc.

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

Referenced by save_as_HVtrackermap().

1179 {
1180  double xp[4],yp[4];
1181  int color;
1182  int greenHV2 = 0;
1183  int redHV2 = 0;
1184  int blueHV2 = 0;
1185  double xd[4],yd[4];
1186  int np = 4;
1187  double boxinitx=35, boxinity=12;
1188  double dx=1.1,dy=1.3;
1189 
1190  boxinitx= boxinitx+(5 - psu->getPsuCrate())*5;
1191  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1192 
1193  xp[0]=boxinitx;yp[0]=boxinity;
1194  xp[1]=boxinitx+dx;yp[1]=boxinity;
1195  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1196  xp[3]=boxinitx;yp[3]=boxinity + dy;
1197 
1198 
1199  for(int j=0;j<4;j++){
1200  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1201  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1202  }
1203 
1204  char buffer [20];
1205  sprintf(buffer,"%X",psu->idex);
1206  std::string s = psu->textHV2;
1207  s.erase(s.begin()+s.find("connected"),s.end());
1208 
1209  if(psu->redHV2 < 0){ //use count to compute color
1210 
1211  if(psu->valueHV2 > 0){
1212  color = getcolor(psu->valueHV2,palette);
1213  redHV2=(color>>16)&0xFF;
1214  greenHV2=(color>>8)&0xFF;
1215  blueHV2=(color)&0xFF;
1216  if(!print_total)psu->valueHV2=psu->valueHV2*psu->countHV2;//restore mod->value
1217  if(temporary_file)*svgfile << redHV2 << " " << greenHV2 << " " << blueHV2 << " ";
1218  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->countHV2 <<"\" value=\""<<psu->valueHV2<<"\" id=\""<< psu->idex*10+2 <<"\" cmodid=\""<<psu->cmodid_HV2<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"rgb("<<redHV2<<","<<greenHV2<<","<<blueHV2<<")\" points=\"";
1219  }
1220  else{
1221  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1222  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->countHV2 <<"\" value=\""<<psu->valueHV2<<"\" id=\""<< psu->idex*10+2 <<"\" cmodid=\""<<psu->cmodid_HV2<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"white\" points=\"";
1223  }
1224  }
1225 
1226  else {//color defined with fillc
1227  if(psu->redHV2>255)psu->redHV2=255;
1228  if(psu->greenHV2>255)psu->greenHV2=255;
1229  if(psu->blueHV2>255)psu->blueHV2=255;
1230  if(temporary_file)*svgfile << psu->redHV2 << " " << psu->greenHV2 << " " << psu->blueHV2 << " ";
1231  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->countHV2 <<"\" value=\""<<psu->valueHV2<<"\" id=\""<< psu->idex*10+2 <<"\" cmodid=\""<<psu->cmodid_HV2<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"rgb("<<psu->redHV2<<","<<psu->greenHV2<<","<<psu->blueHV2<<")\" points=\"";
1232  }
1233 
1234 if(temporary_file)*svgfile << np << " ";
1235 for(int k=0;k<np;k++){
1236  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1237  else *svgfile << xd[k] << "," << yd[k] << " " ;
1238 }
1239 if(temporary_file)*svgfile << std::endl;
1240 else *svgfile <<"\" />" <<std::endl;
1241 
1242 }
int redHV2
Definition: TmPsu.h:21
std::string cmodid_HV2
Definition: TmPsu.h:33
int idex
Definition: TmPsu.h:11
int countHV2
Definition: TmPsu.h:27
int getPsuBoard()
Definition: TmPsu.h:17
int np
Definition: AMPTWrapper.h:33
double xdpixelpsu(double x)
Definition: TrackerMap.h:289
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
int greenHV2
Definition: TmPsu.h:21
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
int k[5][pyjets_maxn]
float valueHV2
Definition: TmPsu.h:25
std::string textHV2
Definition: TmPsu.h:36
int blueHV2
Definition: TmPsu.h:21
double ydpixelpsu(double y)
Definition: TrackerMap.h:295
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::drawHV3 ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1245 of file TrackerMap.cc.

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

Referenced by save_as_HVtrackermap().

1246 {
1247  double xp[4],yp[4];
1248  int color;
1249  int greenHV3 = 0;
1250  int redHV3 = 0;
1251  int blueHV3 = 0;
1252  double xd[4],yd[4];
1253  int np = 4;
1254  double boxinitx=36.5, boxinity=12;
1255  double dx=1.1,dy=1.3;
1256 
1257  boxinitx= boxinitx+(5 - psu->getPsuCrate())*5;
1258  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1259 
1260  xp[0]=boxinitx;yp[0]=boxinity;
1261  xp[1]=boxinitx+dx;yp[1]=boxinity;
1262  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1263  xp[3]=boxinitx;yp[3]=boxinity + dy;
1264 
1265 
1266  for(int j=0;j<4;j++){
1267  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1268  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1269  }
1270 
1271  char buffer [20];
1272  sprintf(buffer,"%X",psu->idex);
1273  std::string s = psu->textHV3;
1274  s.erase(s.begin()+s.find("connected"),s.end());
1275 
1276  if(psu->redHV3 < 0){ //use count to compute color
1277  if(psu->valueHV3 > 0){
1278  color = getcolor(psu->valueHV3,palette);
1279  redHV3=(color>>16)&0xFF;
1280  greenHV3=(color>>8)&0xFF;
1281  blueHV3=(color)&0xFF;
1282  if(!print_total)psu->valueHV3=psu->valueHV3*psu->countHV3;//restore mod->value
1283  if(temporary_file)*svgfile << redHV3 << " " << greenHV3 << " " << blueHV3 << " ";
1284  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->countHV3 <<"\" value=\""<<psu->valueHV3<<"\" id=\""<< psu->idex*10+3 <<"\" cmodid=\""<<psu->cmodid_HV3<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard"<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"rgb("<<redHV3<<","<<greenHV3<<","<<blueHV3<<")\" points=\"";
1285  }
1286  else{
1287  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1288  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->countHV3 <<"\" value=\""<<psu->valueHV3<<"\" id=\""<< psu->idex*10+3 <<"\" cmodid=\""<<psu->cmodid_HV3<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"white\" points=\"";
1289  }
1290  }
1291 
1292  else {//color defined with fillc
1293  if(psu->redHV3>255)psu->redHV3=255;
1294  if(psu->greenHV3>255)psu->greenHV3=255;
1295  if(psu->blueHV3>255)psu->blueHV3=255;
1296  if(temporary_file)*svgfile << psu->redHV3 << " " << psu->greenHV3 << " " << psu->blueHV3 << " ";
1297  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->countHV3 <<"\" value=\""<<psu->valueHV3<<"\" id=\""<< psu->idex*10+3 <<"\" cmodid=\""<<psu->cmodid_HV3<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"rgb("<<psu->redHV3<<","<<psu->greenHV3<<","<<psu->blueHV3<<")\" points=\"";
1298  }
1299 
1300 if(temporary_file)*svgfile << np << " ";
1301 for(int k=0;k<np;k++){
1302  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1303  else *svgfile << xd[k] << "," << yd[k] << " " ;
1304 }
1305 if(temporary_file)*svgfile << std::endl;
1306 else *svgfile <<"\" />" <<std::endl;
1307 
1308 }
int idex
Definition: TmPsu.h:11
int getPsuBoard()
Definition: TmPsu.h:17
int greenHV3
Definition: TmPsu.h:22
int np
Definition: AMPTWrapper.h:33
double xdpixelpsu(double x)
Definition: TrackerMap.h:289
int blueHV3
Definition: TmPsu.h:22
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
int k[5][pyjets_maxn]
int redHV3
Definition: TmPsu.h:22
std::string cmodid_HV3
Definition: TmPsu.h:34
std::string textHV3
Definition: TmPsu.h:37
int countHV3
Definition: TmPsu.h:28
float valueHV3
Definition: TmPsu.h:24
double ydpixelpsu(double y)
Definition: TrackerMap.h:295
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::drawModule ( TmModule mod,
int  key,
int  layer,
bool  total,
std::ofstream *  file 
)

Definition at line 538 of file TrackerMap.cc.

References TmModule::blue, DivergingColor::blue, edmScanValgrind::buffer, TmModule::capvids, TmModule::CcuId, create_public_lumi_plots::color, funct::cos(), TmModule::count, PVValHelper::dx, PVValHelper::dy, getcolor(), TmModule::green, cmsRelvalreport::green(), TmModule::HVchannel, TmModule::idex, TmModule::idModule, isRingStereo(), gen::k, TmModule::length, M_PI, TmModule::name, nlay, np, palette, phi, phival(), posrel, TmModule::posx, TmModule::posy, TmModule::posz, TmModule::psuIdex, alignCSCRings::r, TmModule::red, DivergingColor::red, TmModule::ring, funct::sin(), mathSSE::sqrt(), temporary_file, TmModule::text, TmModule::value, TmModule::width, TmModule::widthAtHalfLength, xdpixel(), and ydpixel().

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

538  {
539  //int x,y;
540  nlay = mlay;
541  double phi,r,dx,dy, dy1;
542  double xp[4],yp[4],xp1,yp1;
543  double vhbot,vhtop,vhapo;
544  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};
545  double xt1,yt1,xs1=0.,ys1=0.,xt2,yt2,xs2,ys2,pv1,pv2;
546  int green = 0;
547  int red = 0;
548  int blue = 0;
549  double xd[4],yd[4];
550  int np = 4;
551  //int numrec=0;
552  int numod=0;
553  phi = phival(mod->posx,mod->posy);
554  r = sqrt(mod->posx*mod->posx+mod->posy*mod->posy);
555  vhtop=mod->width;
556  vhapo=mod->length;
557  if(mlay < 31){ //endcap
558  vhbot = mod->widthAtHalfLength/2.-(mod->width/2.-mod->widthAtHalfLength/2.);
559  vhtop=mod->width/2.;
560  vhapo=mod->length/2.;
561  if(mlay >12 && mlay <19){
562  if(posrel)r = r+r;
563  xp[0]=r-vhtop;yp[0]=-vhapo;
564  xp[1]=r+vhtop;yp[1]=-vhapo;
565  xp[2]=r+vhtop;yp[2]=vhapo;
566  xp[3]=r-vhtop;yp[3]=vhapo;
567  }else{
568  if(posrel)r = r + r/3.;
569  xp[0]=r-vhapo;yp[0]=-vhbot;
570  xp[1]=r+vhapo;yp[1]=-vhtop;
571  xp[2]=r+vhapo;yp[2]=vhtop;
572  xp[3]=r-vhapo;yp[3]=vhbot;
573  }
574  for(int j=0;j<4;j++){
575  xp1 = xp[j]*cos(phi)-yp[j]*sin(phi);
576  yp1 = xp[j]*sin(phi)+yp[j]*cos(phi);
577  xp[j] = xp1;yp[j]=yp1;
578  }
579  } else { //barrel
580  numod=mod->idModule;if(numod>100)numod=numod-100;
581  int vane = mod->ring;
582  if(posrel){
583  dx = vhapo;
584  phi=M_PI;
585  xt1=rmedio[mlay-31]; yt1=-vhtop/2.;
586  xs1 = xt1*cos(phi)-yt1*sin(phi);
587  ys1 = xt1*sin(phi)+yt1*cos(phi);
588  xt2=rmedio[mlay-31]; yt2=vhtop/2.;
589  xs2 = xt2*cos(phi)-yt2*sin(phi);
590  ys2 = xt2*sin(phi)+yt2*cos(phi);
591  dy=phival(xs2,ys2)-phival(xs1,ys1);
592  dy1 = dy;
593  if(mlay==31)dy1=0.39;
594  if(mlay==32)dy1=0.23;
595  if(mlay==33)dy1=0.16;
596  xp[0]=vane*(dx+dx/8.);yp[0]=numod*(dy1);
597  xp[1]=vane*(dx+dx/8.)+dx;yp[1]=numod*(dy1);
598  xp[2]=vane*(dx+dx/8.)+dx;yp[2]=numod*(dy1)+dy;
599  xp[3]=vane*(dx+dx/8.);yp[3]=numod*(dy1)+dy;
600  }else{
601  xt1=r; yt1=-vhtop/2.;
602  xs1 = xt1*cos(phi)-yt1*sin(phi);
603  ys1 = xt1*sin(phi)+yt1*cos(phi);
604  xt2=r; yt2=vhtop/2.;
605  xs2 = xt2*cos(phi)-yt2*sin(phi);
606  ys2 = xt2*sin(phi)+yt2*cos(phi);
607  pv1=phival(xs1,ys1);
608  pv2=phival(xs2,ys2);
609  if(fabs(pv1-pv2)>M_PI && numod==1)pv1=pv1-2.*M_PI;
610  if(fabs(pv1-pv2)>M_PI && numod!=1)pv2=pv2+2.*M_PI;
611  xp[0]=mod->posz-vhapo/2.;yp[0]=4.2*pv1;
612  xp[1]=mod->posz+vhapo/2.;yp[1]=4.2*pv1;
613  xp[2]=mod->posz+vhapo/2. ;yp[2]=4.2*pv2;
614  xp[3]=mod->posz-vhapo/2.;yp[3]=4.2*pv2;
615  }
616  }
617  if(isRingStereo(key))
618  {
619  np = 3;
620  if(mod->idModule>100 ){for(int j=0;j<3;j++){
621  xd[j]=xdpixel(xp[j]);yd[j]=ydpixel(yp[j]);
622  }
623  }else {
624  xd[0]=xdpixel(xp[2]);yd[0]=ydpixel(yp[2]);
625  xd[1]=xdpixel(xp[3]);yd[1]=ydpixel(yp[3]);
626  xd[2]=xdpixel(xp[0]);yd[2]=ydpixel(yp[0]);
627  }
628  } else {
629  for(int j=0;j<4;j++){
630  xd[j]=xdpixel(xp[j]);yd[j]=ydpixel(yp[j]);
631  }
632  }
633  char buffer [20];
634  sprintf(buffer,"%X",mod->idex);
635 
636  if(mod->red < 0){ //use count to compute color
637  int color = getcolor(mod->value,palette);
638  red=(color>>16)&0xFF;
639  green=(color>>8)&0xFF;
640  blue=(color)&0xFF;
641 
642 if(!print_total)mod->value=mod->value*mod->count;//restore mod->value
643 
644  if(mod->count > 0)
645  if(temporary_file) *svgfile << red << " " << green << " " << blue << " "; else
646  *svgfile <<"<svg:polygon detid=\""<<mod->idex<<"\" count=\""<<mod->count <<"\" value=\""<<mod->value<<"\" id=\""<<key<<"\" capvids=\""<<mod->capvids<<"\" lv=\""<<mod->psuIdex<<"\" hv=\""<<mod->psuIdex*10 + mod->HVchannel<<"\" fec=\""<<mod->CcuId<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""<<mod->text<<"\" POS=\""<<mod->name<<" \" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" points=\"";
647  else
648  if(temporary_file) *svgfile << 255 << " " << 255 << " " << 255 << " "; else
649  *svgfile <<"<svg:polygon detid=\""<<mod->idex<<"\" count=\""<<mod->count <<"\" value=\""<<mod->value<<"\" id=\""<<key<<"\" capvids=\""<<mod->capvids<<"\" lv=\""<<mod->psuIdex<<"\" hv=\""<<mod->psuIdex*10 + mod->HVchannel<<"\" fec=\""<<mod->CcuId<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""<<mod->text<<"\" POS=\""<<mod->name<<" \" fill=\"white\" points=\"";
650  if(temporary_file) *svgfile << np << " ";
651  for(int k=0;k<np;k++){
652  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ; else
653  *svgfile << xd[k] << "," << yd[k] << " " ;
654  }
655  if(temporary_file)*svgfile << std::endl; else *svgfile <<"\" />" <<std::endl;
656  } else {//color defined with fillc
657  if(mod->red>255)mod->red=255;
658  if(mod->green>255)mod->green=255;
659  if(mod->blue>255)mod->blue=255;
660  if(temporary_file) *svgfile << mod->red << " " << mod->green << " " << mod->blue << " "; else
661  *svgfile <<"<svg:polygon detid=\""<<mod->idex<<"\" count=\""<<mod->count <<"\" value=\""<<mod->value<<"\" id=\""<<key<<"\" capvids=\""<<mod->capvids<<"\" lv=\""<<mod->psuIdex<<"\" hv=\""<<mod->psuIdex*10 + mod->HVchannel<<"\" fec=\""<<mod->CcuId<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\""<<mod->text<<"\" POS=\""<<mod->name<<" \" fill=\"rgb("<<mod->red<<","<<mod->green<<","<<mod->blue<<")\" points=\"";
662  if(temporary_file) *svgfile << np << " ";
663  for(int k=0;k<np;k++){
664  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ; else
665  *svgfile << xd[k] << "," << yd[k] << " " ;
666  }
667  if(temporary_file)*svgfile << std::endl; else *svgfile <<"\" />" <<std::endl;
668  }
669 
670 }
float value
Definition: TmModule.h:12
int idModule
Definition: TmModule.h:26
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float posz
Definition: TmModule.h:9
float posx
Definition: TmModule.h:9
bool posrel
Definition: TrackerMap.h:497
double phival(double x, double y)
Definition: TrackerMap.h:179
unsigned int idex
Definition: TmModule.h:29
int np
Definition: AMPTWrapper.h:33
std::string text
Definition: TmModule.h:14
float posy
Definition: TmModule.h:9
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
double ydpixel(double y)
Definition: TrackerMap.h:247
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
int count
Definition: TmModule.h:13
float width
Definition: TmModule.h:10
#define M_PI
int psuIdex
Definition: TmModule.h:19
int k[5][pyjets_maxn]
std::string capvids
Definition: TmModule.h:16
short int HVchannel
Definition: TmModule.h:20
def green(string)
float widthAtHalfLength
Definition: TmModule.h:10
int green
Definition: TmModule.h:11
int CcuId
Definition: TmModule.h:17
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
double xdpixel(double x)
Definition: TrackerMap.h:241
static bool isRingStereo(int key)
Definition: TrackerMap.h:446
int ring
Definition: TmModule.h:27
float length
Definition: TmModule.h:10
std::string name
Definition: TmModule.h:15
void TrackerMap::drawPalette ( std::ofstream *  file,
int  xoffset = 3660,
int  yoffset = 1540 
)

Definition at line 2509 of file TrackerMap.cc.

References DivergingColor::blue, create_public_lumi_plots::color, gather_cfg::cout, objects.autophobj::float, getcolor(), cmsRelvalreport::green(), mps_fire::i, createfilelist::int, maxvalue, minvalue, palette, DivergingColor::red, temporary_file, tkMapLog, heppy_batch::val, and ApeEstimator_cff::width.

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

2509  {
2510  std::cout << "preparing the palette" << std::endl;
2511  int color,red, green, blue;
2512  float val=minvalue;
2513  int paletteLength = 250;
2514  int width=50*(yoffset-40)/1500;
2515  float dval = (maxvalue-minvalue)/(float)paletteLength;
2516  bool rtkMapLog = tkMapLog; if (tkMapLog)tkMapLog=false;
2517  float step = float(yoffset-40)/float(paletteLength);
2518  for(int i=1;i<paletteLength+1;i++){
2519  color = getcolor(val,palette);
2520  red=(color>>16)&0xFF;
2521  green=(color>>8)&0xFF;
2522  blue=(color)&0xFF;
2523  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" />\n";
2524  // else *svgfile << red << " " << green << " " << blue << " 4 " << (6*i)+40 << " 3010. " <<//
2525  // (6*i)+40 << " 3060. " <<//
2526  // (6*(i-1))+40 << " 3060. " <<//
2527  // (6*(i-1))+40 <<" 3010. " << std::endl; //
2528 
2529  // if(i%50 == 0){
2530  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
2531  // if(i%50==0&&!temporary_file)*svgfile << " <svg:text class=\"normalText\" x=\"3060\" y=\""<<(1560-6*i)<<"\">" <<val<<"</svg:text>"<<std::endl;
2532 
2533  if(!temporary_file)*svgfile <<"<svg:rect x=\"3610\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" />\n";
2534  else *svgfile << red << " " << green << " " << blue << " 4 " << int(step*i)+34 << " " << xoffset-width << ". " <<//
2535  int(step*i)+34 << " " << xoffset << ". " <<//
2536  int(step*(i-1))+34 << " " << xoffset << ". " <<//
2537  int(step*(i-1))+34 << " " << xoffset-width << ". " << std::endl; //
2538 
2539  if(i%50 == 0){
2540  if(!temporary_file)*svgfile <<"<svg:rect x=\"3610\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
2541  if(i%50==0&&!temporary_file)*svgfile << " <svg:text class=\"normalText\" x=\"3660\" y=\""<<(1560-6*i)<<"\">" <<val<<"</svg:text>"<<std::endl;
2542  }
2543  val = val + dval;
2544  }
2545  tkMapLog=rtkMapLog;
2546 }
bool tkMapLog
Definition: TrackerMap.h:172
float minvalue
Definition: TrackerMap.h:505
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
def green(string)
float maxvalue
Definition: TrackerMap.h:505
step
Definition: StallMonitor.cc:94
void TrackerMap::drawPsu ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1101 of file TrackerMap.cc.

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

Referenced by save_as_psutrackermap().

1102 {
1103  double xp[4],yp[4];
1104  int color;
1105  int green = 0;
1106  int red = 0;
1107  int blue = 0;
1108  double xd[4],yd[4];
1109  int np = 4;
1110  double boxinitx=0., boxinity=0.;
1111  double dx=.9,dy=.9;
1112 
1113  boxinitx=boxinitx+(NUMPSUCRATE_INCOLUMN-psu->getPsuCrate())*1.5;
1114  boxinity=boxinity+(NUMPSUCH_INROW-psu->getPsuBoard());
1115 
1116  xp[0]=boxinitx;yp[0]=boxinity;
1117  xp[1]=boxinitx+dx;yp[1]=boxinity;
1118  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1119  xp[3]=boxinitx;yp[3]=boxinity + dy;
1120 
1121 
1122  for(int j=0;j<4;j++){
1123  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1124  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1125  }
1126 
1127  // lines needed to prepare the clickable maps: understand why I get twice the full list of channels (HV1 and HV0?)
1128  /*
1129  double scalex=2695./2700.;
1130  double scaley=1520./1550.;
1131  std::cout << "<area shape=\"rect\" coords=\" "
1132  << int(scalex*yd[2]) << "," << int(1520-scaley*xd[2])
1133  << "," << int(scalex*yd[0]) << "," << int(1520-scaley*xd[0])
1134  << "\" title=\" " << psu->psId << "\" /> " << std::endl;
1135  */
1136  //
1137 
1138  char buffer [20];
1139  sprintf(buffer,"%X",psu->idex);
1140  std::string s = psu->text;
1141  s.erase(s.begin()+s.find("connected"),s.end());
1142 
1143  if(psu->red < 0){ //use count to compute color
1144  if(psu->count > 0){
1145  color = getcolor(psu->value,palette);
1146  red=(color>>16)&0xFF;
1147  green=(color>>8)&0xFF;
1148  blue=(color)&0xFF;
1149  if(!print_total)psu->value=psu->value*psu->count;//restore mod->value
1150  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
1151  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->count <<"\" value=\""<<psu->value<<"\" id=\""<< psu->idex <<"\" cmodid=\""<<psu->cmodid_LV<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" points=\"";
1152  }
1153  else{
1154 
1155  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1156  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->count <<"\" value=\""<<psu->value<<"\" id=\""<< psu->idex <<"\" cmodid=\""<<psu->cmodid_LV<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"white\" points=\"";
1157  }
1158  }
1159 
1160  else {//color defined with fillc
1161  if(psu->red>255)psu->red=255;
1162  if(psu->green>255)psu->green=255;
1163  if(psu->blue>255)psu->blue=255;
1164  if(temporary_file)*svgfile << psu->red << " " << psu->green << " " << psu->blue << " ";
1165  else *svgfile <<"<svg:polygon detid=\""<<psu->idex<<"\" count=\""<<psu->count <<"\" value=\""<<psu->value<<"\" id=\""<< psu->idex <<"\" cmodid=\""<<psu->cmodid_LV<<"\" onclick=\"showData(evt);\" onmouseover=\"showData(evt);\" onmouseout=\"showData(evt);\" MESSAGE=\"""\" POS=\"easyCrate/easyBoard "<<psu->getPsuCrate()<<"/"<<psu->getPsuBoard()<<" connected to "<<s<<" \" fill=\"rgb("<<psu->red<<","<<psu->green<<","<<psu->blue<<")\" points=\"";
1166  }
1167 
1168 if(temporary_file)*svgfile << np << " ";
1169 for(int k=0;k<np;k++){
1170  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1171  else *svgfile << xd[k] << "," << yd[k] << " " ;
1172 }
1173 if(temporary_file)*svgfile << std::endl;
1174 else *svgfile <<"\" />" <<std::endl;
1175 
1176 }
int count
Definition: TmPsu.h:26
int idex
Definition: TmPsu.h:11
float value
Definition: TmPsu.h:23
int getPsuBoard()
Definition: TmPsu.h:17
int red
Definition: TmPsu.h:20
int np
Definition: AMPTWrapper.h:33
double xdpixelpsu(double x)
Definition: TrackerMap.h:289
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
int green
Definition: TmPsu.h:20
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2860
int k[5][pyjets_maxn]
def green(string)
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:47
std::string text
Definition: TmPsu.h:35
std::string cmodid_LV
Definition: TmPsu.h:32
int blue
Definition: TmPsu.h:20
#define NUMPSUCH_INROW
Definition: TrackerMap.h:46
double ydpixelpsu(double y)
Definition: TrackerMap.h:295
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::fill ( int  layer,
int  ring,
int  nmod,
float  x 
)

Definition at line 2786 of file TrackerMap.cc.

References TmModule::count, gather_cfg::cout, crabWrapper::key, mod(), smoduleMap, and TmModule::value.

Referenced by SiStripCablingTrackerMap::analyze(), SiStripQualityStatistics::analyze(), SiStripPlotGain::DoAnalysis(), SiStripCorrelateNoise::DoAnalysis(), TkHistoMap::dumpInTkMap(), SiStripBaseCondObjDQM::fillTkMap(), load(), and SiStripHitEffFromCalibTree::makeTKMap().

2786  {
2787 
2788  int key = layer*100000+ring*1000+nmod;
2789  TmModule * mod = smoduleMap[key];
2790  if(mod!=nullptr){
2791  mod->value=mod->value+qty;
2792  mod->count++;
2793  }
2794  else std::cout << "**************************error in SvgModuleMap **************";
2795 }
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
int count
Definition: TmModule.h:13
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill ( int  idmod,
float  qty 
)

Definition at line 2766 of file TrackerMap.cc.

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

2766  {
2767 
2768  TmModule * mod = imoduleMap[idmod];
2769  if(mod!=nullptr){
2770  mod->value=mod->value+qty;
2771  mod->count++;
2772  return;
2773  }else{
2774  TmModule * mod1 = imoduleMap[idmod+1];
2775  TmModule * mod2 = imoduleMap[idmod+2];
2776  if(mod1!=nullptr && mod2!=nullptr){
2777  mod1->value=mod1->value+qty;
2778  mod1->count++;
2779  mod2->value=mod2->value+qty;
2780  mod2->count++;
2781  return;
2782  }}
2783  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2784 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
int count
Definition: TmModule.h:13
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill_all_blank ( )

Definition at line 2749 of file TrackerMap.cc.

References fill_current_val(), and imoduleMap.

Referenced by fillc().

2749  {
2750 
2751  std::map<const int , TmModule *>::iterator imod;
2752  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2753  fill_current_val(imod->first,0);
2754  }
2755 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:2759
void TrackerMap::fill_current_val ( int  idmod,
float  current_val 
)

Definition at line 2759 of file TrackerMap.cc.

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

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

2759  {
2760 
2761  TmModule * mod = imoduleMap[idmod];
2762  if(mod!=nullptr) {mod->value=current_val; mod->count=1; mod->red=-1;}
2763  else std::cout << "**error in fill_current_val method ***module "<<idmod<<std::endl;
2764 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
int count
Definition: TmModule.h:13
int red
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill_current_val_fed_channel ( int  fedId,
int  fedCh,
float  current_val 
)

Definition at line 2574 of file TrackerMap.cc.

References apvMap, TmApvPair::count, gather_cfg::cout, crabWrapper::key, TmApvPair::red, and TmApvPair::value.

Referenced by fillc().

2575 {
2576  int key = fedId*1000+fedCh;
2577  TmApvPair* apvpair = apvMap[key];
2578 
2579  if(apvpair!=nullptr) {apvpair->value=current_val; apvpair->count=1; apvpair->red=-1;}
2580  else
2581  std::cout << "*** error in FedTrackerMap fill_current_val method ***";
2582 }
int red
Definition: TmApvPair.h:10
int count
Definition: TmApvPair.h:13
SvgApvPair apvMap
Definition: TrackerMap.h:150
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
float  qty 
)

Definition at line 2598 of file TrackerMap.cc.

References ccuMap, TmCcu::count, gather_cfg::cout, crabWrapper::key, and TmCcu::value.

Referenced by fillc().

2599 {
2600  int key =crate*10000000+slot*100000+ring*1000+addr;
2601  TmCcu *ccu = ccuMap[key];
2602  if(ccu!=nullptr){
2603  ccu->count++; ccu->value=ccu->value+qty;
2604  return;
2605 
2606  }
2607 
2608  std::cout << "*** error in FecTrackerMap fill by module method ***";
2609  }
MapCcu ccuMap
Definition: TrackerMap.h:157
int count
Definition: TmCcu.h:12
float value
Definition: TmCcu.h:10
Definition: TmCcu.h:5
void TrackerMap::fill_fed_channel ( int  fedId,
int  fedCh,
float  qty 
)

Definition at line 2707 of file TrackerMap.cc.

References apvMap, TmApvPair::count, gather_cfg::cout, crabWrapper::key, and TmApvPair::value.

Referenced by fillc().

2708 {
2709  int key = fedId*1000+fedCh;
2710  TmApvPair* apvpair = apvMap[key];
2711  if(apvpair!=nullptr){
2712  apvpair->value=apvpair->value+qty;
2713  apvpair->count++;
2714  return;
2715  }
2716  std::cout << "*** error inFedTrackerMap fill method ***";
2717 }
int count
Definition: TmApvPair.h:13
SvgApvPair apvMap
Definition: TrackerMap.h:150
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fed_channel ( int  modId,
float  qty 
)

Definition at line 2559 of file TrackerMap.cc.

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

2560 {
2561  std::multimap<const int, TmApvPair*>::iterator pos;
2562  for (pos = apvModuleMap.lower_bound(idmod);
2563  pos != apvModuleMap.upper_bound(idmod); ++pos) {
2564  TmApvPair* apvpair = pos->second;
2565  if(apvpair!=nullptr){
2566  apvpair->value=apvpair->value+qty;
2567  apvpair->count++;
2568  }
2569  }
2570  return;
2571  std::cout << "*** error in FedTrackerMap fill by module method ***";
2572  }
ModApvPair apvModuleMap
Definition: TrackerMap.h:152
int count
Definition: TmApvPair.h:13
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_hv_channel2 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2668 of file TrackerMap.cc.

References TmPsu::countHV2, gather_cfg::cout, crabWrapper::key, psuMap, and TmPsu::valueHV2.

Referenced by fillc().

2669 {
2670  int key = rack*1000+crate*100+board;
2671  TmPsu *psu = psuMap[key];
2672  if(psu!=nullptr){
2673  psu->countHV2++; psu->valueHV2=psu->valueHV2+qty;
2674  return;
2675 
2676  }
2677 
2678  std::cout << "*** error in HVTrackerMap fill by module method ***";
2679  }
int countHV2
Definition: TmPsu.h:27
float valueHV2
Definition: TmPsu.h:25
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmPsu.h:6
void TrackerMap::fill_hv_channel3 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2680 of file TrackerMap.cc.

References TmPsu::countHV3, gather_cfg::cout, crabWrapper::key, psuMap, and TmPsu::valueHV3.

Referenced by fillc().

2681 {
2682  int key = rack*1000+crate*100+board;
2683  TmPsu *psu = psuMap[key];
2684  if(psu!=nullptr){
2685  psu->countHV3++; psu->valueHV3=psu->valueHV3+qty;
2686  return;
2687 
2688  }
2689 
2690  std::cout << "*** error in HVTrackerMap fill by module method ***";
2691  }
int countHV3
Definition: TmPsu.h:28
float valueHV3
Definition: TmPsu.h:24
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmPsu.h:6
void TrackerMap::fill_lv_channel ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2627 of file TrackerMap.cc.

References TmPsu::count, gather_cfg::cout, crabWrapper::key, psuMap, and TmPsu::value.

Referenced by fillc().

2628 {
2629  int key = rack*1000+crate*100+board;
2630  TmPsu *psu = psuMap[key];
2631  if(psu!=nullptr){
2632  psu->count++; psu->value=psu->value+qty;
2633  return;
2634 
2635  }
2636 
2637  std::cout << "*** error in LVTrackerMap fill by module method ***";
2638  }
int count
Definition: TmPsu.h:26
float value
Definition: TmPsu.h:23
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmPsu.h:6
void TrackerMap::fillc ( int  idmod,
int  RGBcode 
)
inline
void TrackerMap::fillc ( int  idmod,
int  red,
int  green,
int  blue 
)

Definition at line 2720 of file TrackerMap.cc.

References TmModule::blue, DivergingColor::blue, gather_cfg::cout, TmModule::green, cmsRelvalreport::green(), imoduleMap, mod(), TmModule::red, and DivergingColor::red.

2720  {
2721 
2722  TmModule * mod = imoduleMap[idmod];
2723  if(mod!=nullptr){
2724  mod->red=red; mod->green=green; mod->blue=blue;
2725  return;
2726  }
2727  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2728 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
def green(string)
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fillc ( int  layer,
int  ring,
int  nmod,
int  red,
int  green,
int  blue 
)

Definition at line 2729 of file TrackerMap.cc.

References TmModule::blue, DivergingColor::blue, gather_cfg::cout, TmModule::green, cmsRelvalreport::green(), crabWrapper::key, mod(), TmModule::red, DivergingColor::red, and smoduleMap.

2729  {
2730 
2731  int key = layer*10000+ring*1000+nmod;
2732  TmModule * mod = smoduleMap[key];
2733 
2734  if(mod!=nullptr){
2735  mod->red=red; mod->green=green; mod->blue=blue;
2736  return;
2737  }
2738  std::cout << "**************************error in fill method **************"<< std::endl;
2739 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
def green(string)
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fillc_all_blank ( )

Definition at line 2741 of file TrackerMap.cc.

References fillc(), and imoduleMap.

Referenced by fillc().

2741  {
2742 
2743  std::map<const int , TmModule *>::iterator imod;
2744  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2745  fillc(imod->first,255,255,255);
2746  }
2747 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:109
void TrackerMap::fillc_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
int  red,
int  green,
int  blue 
)

Definition at line 2585 of file TrackerMap.cc.

References TmCcu::blue, DivergingColor::blue, ccuMap, gather_cfg::cout, TmCcu::green, cmsRelvalreport::green(), crabWrapper::key, TmCcu::red, and DivergingColor::red.

Referenced by fillc().

2586  {
2587  int key =crate*10000000+slot*100000+ring*1000+addr;
2588 
2589  TmCcu *ccu = ccuMap[key];
2590 
2591  if(ccu!=nullptr){
2592  ccu->red=red; ccu->green=green; ccu->blue=blue;
2593  return;
2594  }
2595  std::cout << "*** error in FecTrackerMap fillc method ***";
2596 }
MapCcu ccuMap
Definition: TrackerMap.h:157
int green
Definition: TmCcu.h:9
def green(string)
int red
Definition: TmCcu.h:9
int blue
Definition: TmCcu.h:9
Definition: TmCcu.h:5
void TrackerMap::fillc_fed_channel ( int  fedId,
int  fedCh,
int  red,
int  green,
int  blue 
)

Definition at line 2547 of file TrackerMap.cc.

References apvMap, TmApvPair::blue, DivergingColor::blue, gather_cfg::cout, TmApvPair::green, cmsRelvalreport::green(), crabWrapper::key, TmApvPair::red, and DivergingColor::red.

Referenced by fillc().

2548 {
2549  int key = fedId*1000+fedCh;
2550  TmApvPair* apvpair = apvMap[key];
2551 
2552  if(apvpair!=nullptr){
2553  apvpair->red=red; apvpair->green=green; apvpair->blue=blue;
2554  return;
2555  }
2556  std::cout << "*** error in FedTrackerMap fillc method ***";
2557 }
int green
Definition: TmApvPair.h:10
int red
Definition: TmApvPair.h:10
int blue
Definition: TmApvPair.h:10
def green(string)
SvgApvPair apvMap
Definition: TrackerMap.h:150
void TrackerMap::fillc_hv_channel2 ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2640 of file TrackerMap.cc.

References DivergingColor::blue, TmPsu::blueHV2, gather_cfg::cout, cmsRelvalreport::green(), TmPsu::greenHV2, crabWrapper::key, psuMap, DivergingColor::red, and TmPsu::redHV2.

Referenced by fillc().

2641 {
2642 
2643  int key = rack*1000+crate*100+board;
2644 
2645  TmPsu *psu = psuMap[key];
2646 
2647  if(psu!=nullptr){
2648  psu->redHV2=red; psu->greenHV2=green; psu->blueHV2=blue;
2649  return;
2650  }
2651  std::cout << "*** error in HVTrackerMap (channel 2) fillc method ***";
2652 }
int redHV2
Definition: TmPsu.h:21
int greenHV2
Definition: TmPsu.h:21
def green(string)
MapPsu psuMap
Definition: TrackerMap.h:161
int blueHV2
Definition: TmPsu.h:21
Definition: TmPsu.h:6
void TrackerMap::fillc_hv_channel3 ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2653 of file TrackerMap.cc.

References DivergingColor::blue, TmPsu::blueHV3, gather_cfg::cout, cmsRelvalreport::green(), TmPsu::greenHV3, crabWrapper::key, psuMap, DivergingColor::red, and TmPsu::redHV3.

Referenced by fillc().

2654 {
2655 
2656  int key = rack*1000+crate*100+board;
2657 
2658  TmPsu *psu = psuMap[key];
2659 
2660  if(psu!=nullptr){
2661  psu->redHV3=red; psu->greenHV3=green; psu->blueHV3=blue;
2662  return;
2663  }
2664  std::cout << "*** error in HVTrackerMap (channel 3) fillc method ***";
2665 }
int greenHV3
Definition: TmPsu.h:22
int blueHV3
Definition: TmPsu.h:22
int redHV3
Definition: TmPsu.h:22
def green(string)
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmPsu.h:6
void TrackerMap::fillc_lv_channel ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2613 of file TrackerMap.cc.

References TmPsu::blue, DivergingColor::blue, gather_cfg::cout, TmPsu::green, cmsRelvalreport::green(), crabWrapper::key, psuMap, TmPsu::red, and DivergingColor::red.

Referenced by fillc().

2614 {
2615 
2616  int key = rack*1000+crate*100+board;
2617 
2618  TmPsu *psu = psuMap[key];
2619 
2620  if(psu!=nullptr){
2621  psu->red=red; psu->green=green; psu->blue=blue;
2622  return;
2623  }
2624  std::cout << "*** error in LVTrackerMap fillc method ***";
2625 }
int red
Definition: TmPsu.h:20
int green
Definition: TmPsu.h:20
def green(string)
int blue
Definition: TmPsu.h:20
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmPsu.h:6
int TrackerMap::find_layer ( int  ix,
int  iy 
)
inline

Definition at line 193 of file TrackerMap.h.

References PVValHelper::add(), xsize, and ysize.

194  {
195  int add;
196  int layer=0;
197  if(iy <= xsize){//endcap+z
198  add = 15;
199  layer = ix/ysize;
200  layer = layer+add+1;
201  }
202  if(iy > xsize && iy< 3*xsize){//barrel
203  add=30;
204  if(ix < 2*ysize){
205  layer=1;
206  }else {
207  layer = ix/(2*ysize);
208  if(iy < 2*xsize)layer=layer*2+1; else layer=layer*2;
209  }
210  layer = layer+add;
211  }
212  if(iy >= 3*xsize){ //endcap-z
213  layer = ix/ysize;
214  layer = 15-layer;
215  }
216  return layer;
217  }
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::ifstream * TrackerMap::findfile ( std::string  filename)

Definition at line 3519 of file TrackerMap.cc.

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

Referenced by getysize(), printall(), and printonline().

3519  {
3520  std::ifstream * ifilename;
3521  std::string ifname;
3522  if(!jsPath.empty()){
3523  ifname=jsPath+filename;
3524  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3525  if(!ifilename){
3526  ifname="CommonTools/TrackerMap/data/"+filename;
3527  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3528  }
3529  }else {
3530  ifname="CommonTools/TrackerMap/data/"+filename;
3531  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3532  }
3533  if(!ifilename)std::cout << "File " << filename << " missing" << std::endl;
3534  return ifilename;
3535  }
std::string jsPath
Definition: TrackerMap.h:177
std::pair< float, float > TrackerMap::getAutomaticRange ( )

Definition at line 675 of file TrackerMap.cc.

References TmModule::count, firstRing, crabWrapper::key, cmsBatch::log, mod(), module(), TmModule::notInUse(), ntotRing, relativeConstraints::ring, smoduleMap, tkMapLog, and TmModule::value.

Referenced by setTitle().

675  {
676  float minval,maxval;
677  minval=9999999.;
678  maxval=-9999999.;
679  for (int layer=1; layer < 44; layer++){
680  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
681  for (int module=1;module<200;module++) {
682  int key=layer*100000+ring*1000+module;
683  TmModule * mod = smoduleMap[key];
684  if(mod !=nullptr && !mod->notInUse() && mod->count>0){
685  if (minval > mod->value)minval=mod->value;
686  if (maxval < mod->value)maxval=mod->value;
687  }
688  }
689  }
690  }
691 if(tkMapLog) {minval=log(minval)/log(10);maxval=log(maxval)/log(10);}
692  return std::make_pair(minval,maxval);
693 
694 }
bool tkMapLog
Definition: TrackerMap.h:172
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
int firstRing[43]
Definition: TrackerMap.h:485
Definition: value.py:1
int count
Definition: TmModule.h:13
bool notInUse()
Definition: TmModule.h:24
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
int ntotRing[43]
Definition: TrackerMap.h:484
int TrackerMap::getcolor ( float  value,
int  palette 
)

Definition at line 2860 of file TrackerMap.cc.

References DivergingColor::blue, delta, cmsRelvalreport::green(), createfilelist::int, cmsBatch::log, maxvalue, minvalue, DivergingColor::red, tkMapLog, and x.

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

2860  {
2861  int red,green,blue;
2862  float lminvalue, lmaxvalue;
2863  lminvalue=minvalue; lmaxvalue=maxvalue;
2864  if(tkMapLog) {lminvalue=log(minvalue)/log(10);lmaxvalue=log(maxvalue)/log(10); value=log(value)/log(10);}
2865 
2866 
2867  red=0;green=0;blue=0;
2868  if(palette==1){//palette1 1 - raibow
2869  float delta=(lmaxvalue-lminvalue);
2870  float x =(value-lminvalue);
2871  if(value<lminvalue){red=0;green=0;blue=255;}
2872  if(value>lmaxvalue){red=255;green=0;blue=0;}
2873  if(value>=lminvalue&&value<=lmaxvalue){
2874  red = (int) ( x<(delta/2) ? 0 : ( x > ((3./4.)*delta) ? 255 : 255/(delta/4) * (x-(2./4.)*delta) ) );
2875  green= (int) ( x<delta/4 ? (x*255/(delta/4)) : ( x > ((3./4.)*delta) ? 255-255/(delta/4) *(x-(3./4.)*delta) : 255 ) );
2876  blue = (int) ( x<delta/4 ? 255 : ( x > ((1./2.)*delta) ? 0 : 255-255/(delta/4) * (x-(1./4.)*delta) ) );
2877  }
2878  }
2879  if (palette==2){//palette 2 yellow-green
2880  green = (int)((value-lminvalue)/(lmaxvalue-lminvalue)*256.);
2881  if (green > 255) green=255;
2882  red = 255; blue=0;green=255-green;
2883  }
2884  // std::cout<<red<<" "<<green<<" "<<blue<<" "<<value <<" "<<lminvalue<<" "<< lmaxvalue<<std::endl;
2885  return(blue|(green<<8)|(red<<16));
2886 }
dbl * delta
Definition: mlp_gen.cc:36
bool tkMapLog
Definition: TrackerMap.h:172
float minvalue
Definition: TrackerMap.h:505
Definition: value.py:1
def green(string)
float maxvalue
Definition: TrackerMap.h:505
int TrackerMap::getlayerCount ( int  subdet,
int  partdet 
)
inline

Definition at line 219 of file TrackerMap.h.

Referenced by init().

219  {
220  int ncomponent=0;
221  if(subdet == 1){ //1=pixel
222  if(partdet == 1 || partdet == 3){ //1-3=encap
223  ncomponent = 3;
224  }
225  else { ncomponent = 3; } //barrel
226  }
227  if(subdet== 2){ //2=inner silicon
228  if(partdet == 1 || partdet == 3){ //1-3=encap
229  ncomponent = 3;
230  }
231  else { ncomponent = 4; } //barrel
232  }
233  if(subdet== 3){ //3=outer silicon
234  if(partdet == 1 || partdet == 3){ //1-3=encap
235  ncomponent = 9;
236  }
237  else { ncomponent = 6; } //barrel
238  }
239  return(ncomponent);
240  }
int TrackerMap::getmoduleCount ( int  subdet,
int  partdet,
int  layer,
int  ring 
)
inline

Definition at line 410 of file TrackerMap.h.

Referenced by init().

410  {
411  int ncomponent=0;
412  int spicchif[] ={24,24,40,56,40,56,80};
413  int spicchib[] ={20,32,44,30,38,46,56,42,48,54,60,66,74};
414  int numero_layer = 0;
415 
416  if(partdet == 2){ //barrel
417  numero_layer = layer-1;
418  if(subdet== 2){ //inner
419  numero_layer = numero_layer+3;
420  }
421  if(subdet == 3){ //outer
422  numero_layer = numero_layer+7;
423  }
424  ncomponent = spicchib[numero_layer];
425  }
426  if(partdet!= 2){ //endcap
427  if(subdet== 1)ncomponent=24;//pixel
428  else
429  ncomponent = spicchif[ring-1];
430  }
431  return(ncomponent);
432  }
int TrackerMap::getNumMod ( )
inline

Definition at line 143 of file TrackerMap.h.

143 {return number_modules;};
int number_modules
Definition: TrackerMap.h:506
int TrackerMap::getringCount ( int  subdet,
int  partdet,
int  layer 
)
inline

Definition at line 377 of file TrackerMap.h.

Referenced by init().

377  {
378  int ncomponent=0;
379  if(subdet== 1){ //1=pixel
380  if(partdet== 1 || partdet== 3){ //end-cap
381  ncomponent = 7;
382  }
383  else{ncomponent = 8;} //barrel
384  }
385  if(subdet== 2){ //inner-silicon
386  if(partdet== 1 || partdet== 3){ //end-cap
387  ncomponent = 3;
388  }
389  else{ncomponent = 12;} //barrel
390  }
391  if(subdet== 3){ //outer-silicon
392  if(partdet== 1){ //end-cap-z
393  if (layer== 1) ncomponent = 4;
394  if (layer== 2 || layer== 3) ncomponent = 5;
395  if (layer== 4 || layer== 5 || layer== 6) ncomponent = 6;
396  if (layer== 7 || layer== 8 || layer== 9) ncomponent = 7;
397  }
398  if(partdet== 3){ //endcap+z
399  if (layer== 9) ncomponent = 4;
400  if (layer== 8 || layer== 7) ncomponent = 5;
401  if (layer== 6 || layer== 5 || layer== 4) ncomponent = 6;
402  if (layer== 3 || layer== 2 || layer== 1) ncomponent = 7;
403  }
404  if(partdet== 2){ //barrel
405  ncomponent = 12;
406  }
407  }
408  return(ncomponent);
409  }
int TrackerMap::getxsize ( )
inline

Definition at line 139 of file TrackerMap.h.

References xsize.

139 {return xsize;};
int TrackerMap::getysize ( )
inline

Definition at line 140 of file TrackerMap.h.

References corrVsCorr::filename, findfile(), getcolor(), palette, AlCaHLTBitMon_QueryRunRegistry::string, and ysize.

140 {return ysize;};
void TrackerMap::init ( void  )

Definition at line 440 of file TrackerMap.cc.

References addPixelFlag, build(), firstcall, firstRing, getlayerCount(), getmoduleCount(), getringCount(), gmaxvalue, gminvalue, isRingStereo(), ix, iy, crabWrapper::key, maxvalue, minvalue, module(), ndet, nlayer(), nlayers, npart, ntotRing, onlyPixelFlag, palette, posrel, printflag, relativeConstraints::ring, smoduleMap, and temporary_file.

Referenced by TrackerMap().

440  {
441 
442  int ntotmod=0;
443  ix=0;iy=0; //used to compute the place of each layer in the tracker map
444  firstcall = true;
446  posrel=true;
447  palette = 1;
448  printflag=true;
449  addPixelFlag=false;
450  onlyPixelFlag=false;
451  temporary_file=false;
452  gminvalue=0.; gmaxvalue=0.;//default global range for online rendering
453 
454  ndet = 3; // number of detectors: pixel, inner silicon, outer silicon
455  npart = 3; // number of detector parts: endcap -z, barrel, endcap +z
456 
457  //allocate module map
458  for (int subdet=1; subdet < ndet+1; subdet++){//loop on subdetectors
459  for (int detpart=1; detpart < npart+1; detpart++){//loop on subdetectors parts
460  int nlayers = getlayerCount(subdet,detpart); // compute number of layers
461  for(int layer=1; layer < nlayers+1; layer++){//loop on layers
462  int nrings = getringCount(subdet,detpart,layer);// compute number of rings
463  //fill arrays used to do the loop on the rings
464  int layer_g = nlayer(subdet,detpart,layer);
465  ntotRing[layer_g-1]=nrings;
466  firstRing[layer_g-1]=1;
467  if(subdet==3 && detpart!=2) firstRing[layer_g-1]= 8-nrings; //special numbering for TEC
468  for (int ring=firstRing[layer_g-1]; ring < ntotRing[layer_g-1]+firstRing[layer_g-1];ring++){//loop on rings
469  int nmodules = getmoduleCount(subdet,detpart,layer,ring);// compute number of modules
470  int key=0;
471  TmModule *smodule;
472  for(int module=1; module < nmodules+1; module++){//loop on modules
473  smodule = new TmModule(module,ring,layer_g);
474  key=layer_g*100000+ring*1000+module;//key identifying module
475  smoduleMap[key]=smodule;
476  ntotmod++;
477  }
478  if(isRingStereo(key))for(int module=1; module < nmodules+1; module++){//loop on stereo modules
479  smodule = new TmModule(module+100,ring,layer_g);
480  int key=layer_g*100000+ring*1000+module+100;
481  smoduleMap[key]=smodule;
482  ntotmod++;
483  }
484  }
485  }
486  }
487  }
488  build();
489 }
void build()
Definition: TrackerMap.cc:2817
float minvalue
Definition: TrackerMap.h:505
int getmoduleCount(int subdet, int partdet, int layer, int ring)
Definition: TrackerMap.h:410
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
bool addPixelFlag
Definition: TrackerMap.h:513
int getlayerCount(int subdet, int partdet)
Definition: TrackerMap.h:219
int firstRing[43]
Definition: TrackerMap.h:485
float gminvalue
Definition: TrackerMap.h:504
bool posrel
Definition: TrackerMap.h:497
int getringCount(int subdet, int partdet, int layer)
Definition: TrackerMap.h:377
bool temporary_file
Definition: TrackerMap.h:507
bool onlyPixelFlag
Definition: TrackerMap.h:514
bool printflag
Definition: TrackerMap.h:165
int nlayer(int det, int part, int lay)
Definition: TrackerMap.h:455
float gmaxvalue
Definition: TrackerMap.h:504
float maxvalue
Definition: TrackerMap.h:505
bool firstcall
Definition: TrackerMap.h:498
static bool isRingStereo(int key)
Definition: TrackerMap.h:446
Definition: vlib.h:208
int ntotRing[43]
Definition: TrackerMap.h:484
static bool TrackerMap::isRingStereo ( int  key)
inlinestatic

Definition at line 446 of file TrackerMap.h.

Referenced by drawModule(), and init().

446  {
447  int layer=key/100000;
448  int ring = key - layer*100000;
449  ring = ring/1000;
450  if(layer==34 || layer==35 || layer==38 || layer==39) return true;
451  if(layer<13 || (layer>18&&layer<31))
452  if(ring==1 || ring==2 || ring==5)return true;
453  return false;
454  }
std::string TrackerMap::layername ( int  layer)
inline

Definition at line 468 of file TrackerMap.h.

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

468  {
469  std::string s= " ";
470  std::ostringstream ons;
471 
472  if(layer < 10) ons << "TEC -z Layer " << layer;
473  if(layer < 13 && layer > 9) ons << "TID -z Layer " << layer-9;
474  if(layer < 16 && layer > 12) ons << "FPIX -z Layer " << layer-12;
475  if(layer < 19 && layer > 15) ons << "FPIX +z Layer " << layer-15;
476  if(layer < 22 && layer > 18) ons << "TID +z Layer " << layer-18;
477  if(layer < 31 && layer > 21) ons << "TEC +z Layer " << layer-21;
478  if(layer < 34 && layer > 30) ons << "TPB Layer " << layer-30;
479  if(layer < 38 && layer > 33) ons << "TIB Layer " << layer-33;
480  if(layer > 37) ons << "TOB Layer " << layer-37;
481  s = ons.str();
482  return s;
483  }
static int TrackerMap::layerno ( int  subdet,
int  leftright,
int  layer 
)
inlinestatic

Definition at line 433 of file TrackerMap.h.

433  {
434  if(subdet==6&&leftright==1)return(10-layer);
435  if(subdet==6&&leftright==2)return(layer+21);
436  if(subdet==4&&leftright==1)return(4-layer+9);
437  if(subdet==4&&leftright==2)return(layer+18);
438  if(subdet==2&&leftright==1)return(4-layer+12);
439  if(subdet==2&&leftright==2)return(layer+15);
440  if(subdet==1)return(layer+30);
441  if(subdet==3)return(layer+33);
442  if(subdet==5)return(layer+37);
443  assert(false);
444  }
void TrackerMap::load ( std::string  s = "tmap.svg")

Definition at line 2407 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(), onlyPixel(), and ConfigBuilder.ConfigBuilder::prepare_FILTER().

2407  {
2408  inputfile = new std::ifstream(inputfilename.c_str(),std::ios::in);
2410  int ipos,ipos1,ipos2,id=0,val=0;
2411  int nline=0;
2412  while (getline( *inputfile, line ))
2413  {
2414  ipos1 = line.find("value=\"");
2415  if(ipos1 > 0) {
2416  value = line.substr(ipos1+7,10);
2417  ipos = value.find("\"");
2418  value = value.substr(0,ipos);
2419  val=atoi(value.c_str());
2420  }
2421  ipos2 = line.find("detid=\"");
2422  if(ipos2 > 0) {
2423  value = line.substr(ipos2+7,10);
2424  ipos = value.find("\"");
2425  value = value.substr(0,ipos);
2426  id = atoi(value.c_str());
2427  }
2428  if(ipos1>0 && ipos2>0 && val>0)this->fill(id,val);
2429  if(ipos1>0 && ipos2>0)nline++;
2430  //if(ipos1>0 && ipos2>0)std::cout << nline << " " << id << " " << val << std::endl;
2431 
2432  }
2433  std::cout << nline << " modules found in this svg file " << std::endl;
2434  inputfile->close();delete inputfile;
2435  }
std::ifstream * inputfile
Definition: TrackerMap.h:502
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2786
int TrackerMap::module ( int  fedId,
int  fedCh 
)

Definition at line 2697 of file TrackerMap.cc.

References apvMap, gather_cfg::cout, TmModule::idex, crabWrapper::key, and TmApvPair::mod.

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

2698 {
2699  int key = fedId*1000+fedCh;
2700  TmApvPair* apvpair = apvMap[key];
2701  if(apvpair!=nullptr){
2702  return(apvpair->mod->idex);
2703  }
2704  return(0);
2705  std::cout << "*** error in FedTrackerMap module method ***";
2706 }
TmModule * mod
Definition: TmApvPair.h:16
unsigned int idex
Definition: TmModule.h:29
SvgApvPair apvMap
Definition: TrackerMap.h:150
int TrackerMap::nlayer ( int  det,
int  part,
int  lay 
)
inline

Definition at line 455 of file TrackerMap.h.

Referenced by init().

455  {
456  if(det==3 && part==1) return lay;
457  if(det==2 && part==1) return lay+9;
458  if(det==1 && part==1) return lay+12;
459  if(det==1 && part==3) return lay+15;
460  if(det==2 && part==3) return lay+18;
461  if(det==3 && part==3) return lay+21;
462  if(det==1 && part==2) return lay+30;
463  if(det==2 && part==2) return lay+33;
464  if(det==3 && part==2) return lay+37;
465  return -1;
466  }
part
Definition: HCALResponse.h:20
void TrackerMap::onlyPixel ( bool  onlyPixelfl)
inline

Definition at line 136 of file TrackerMap.h.

References load(), onlyPixelFlag, reset(), and AlCaHLTBitMon_QueryRunRegistry::string.

136 {onlyPixelFlag=onlyPixelfl;};
bool onlyPixelFlag
Definition: TrackerMap.h:514
double TrackerMap::phival ( double  x,
double  y 
)
inline

Definition at line 179 of file TrackerMap.h.

References M_PI, and phi.

Referenced by drawModule().

179  {
180  double phi;
181  double phi1=atan(y/x);
182  phi = phi1;
183  if(y<0. && x>0) phi = phi1+2.*M_PI;
184  if(x<0.)phi=phi1+M_PI;
185  if(fabs(y)<0.000001 && x>0)phi=0;
186  if(fabs(y)<0.000001&&x<0)phi=M_PI;
187  if(fabs(x)<0.000001&&y>0)phi=M_PI/2.;
188  if(fabs(x)<0.000001&&y<0)phi=3.*M_PI/2.;
189 
190  return phi;
191  }
#define M_PI
void TrackerMap::print ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap" 
)

Definition at line 2442 of file TrackerMap.cc.

References TmModule::count, defwindow(), drawModule(), drawPalette(), firstRing, recoMuon::in, jsfile, jsfilename, crabWrapper::key, mps_splice::line, maxvalue, minvalue, mod(), module(), TmModule::notInUse(), ntotRing, MillePedeFileConverter_cfg::out, printflag, relativeConstraints::ring, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, svgfile, temporary_file, title, and TmModule::value.

Referenced by SiStripQualityStatistics::analyze(), SiStripCablingTrackerMap::endJob(), and SiStripQualityStatistics::EndJob().

2442  {
2443  temporary_file=false;
2444  std::ostringstream outs;
2445  minvalue=minval; maxvalue=maxval;
2446  outs << outputfilename << ".xml";
2447  svgfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2448  jsfile = new std::ifstream(edm::FileInPath(jsfilename).fullPath().c_str(),std::ios::in);
2449 
2450  //copy javascript interface from trackermap.txt file
2451  std::string line;
2452  while (getline( *jsfile, line ))
2453  {
2454  *svgfile << line << std::endl;
2455  }
2456  jsfile->close();delete jsfile;
2457  //
2458  if(!print_total){
2459  for (int layer=1; layer < 44; layer++){
2460  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2461  for (int module=1;module<200;module++) {
2462  int key=layer*100000+ring*1000+module;
2463  TmModule * mod = smoduleMap[key];
2464  if(mod !=nullptr && !mod->notInUse()){
2465  mod->value = mod->value / mod->count;
2466  }
2467  }
2468  }
2469  }
2470  }
2471  if(minvalue>=maxvalue){
2472  minvalue=9999999.;
2473  maxvalue=-9999999.;
2474  for (int layer=1; layer < 44; layer++){
2475  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2476  for (int module=1;module<200;module++) {
2477  int key=layer*100000+ring*1000+module;
2478  TmModule * mod = smoduleMap[key];
2479  if(mod !=nullptr && !mod->notInUse()){
2480  if (minvalue > mod->value)minvalue=mod->value;
2481  if (maxvalue < mod->value)maxvalue=mod->value;
2482  }
2483  }
2484  }
2485  }
2486 }
2487  for (int layer=1; layer < 44; layer++){
2488  // nlay=layer;
2489  defwindow(layer);
2490  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2491  for (int module=1;module<200;module++) {
2492  int key=layer*100000+ring*1000+module;
2493  TmModule * mod = smoduleMap[key];
2494  if(mod !=nullptr && !mod->notInUse()){
2495  drawModule(mod,key,layer,print_total,svgfile);
2496  }
2497  }
2498  }
2499  }
2500  *svgfile << "</svg:g></svg:svg>"<<std::endl;
2501  *svgfile << " <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">"<<title<<"</svg:text>"<<std::endl;
2503  *svgfile << "</svg:svg>"<<std::endl;
2504  *svgfile << "</body></html>"<<std::endl;
2505  svgfile->close();delete svgfile;
2506 
2507 }
float minvalue
Definition: TrackerMap.h:505
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
void defwindow(int num_lay)
Definition: TrackerMap.h:334
int firstRing[43]
Definition: TrackerMap.h:485
bool temporary_file
Definition: TrackerMap.h:507
std::ofstream * svgfile
Definition: TrackerMap.h:499
Definition: value.py:1
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:538
int count
Definition: TmModule.h:13
bool printflag
Definition: TrackerMap.h:165
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2509
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:175
float maxvalue
Definition: TrackerMap.h:505
std::ifstream * jsfile
Definition: TrackerMap.h:501
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
int ntotRing[43]
Definition: TrackerMap.h:484
std::string jsfilename
Definition: TrackerMap.h:176
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 3188 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, mps_check::command, gather_cfg::cout, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, l1t::stage2::layer2::fedId, fedMap, symbols::filetype, findfile(), firstcrate, firstRing, runEdmFileComparison::found, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, crabWrapper::key, mps_splice::line, mod(), TmApvPair::mod, module(), TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, TmModule::notInUse(), npsuracks, ntotRing, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, funct::pow(), printlayers(), psuMap, psuModuleMap, 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.

3188  {
3189 //Copy interface
3190  float minval,maxval; minval=minval1; maxval=maxval1;
3191  if(tkMapLog && (minval<maxval)) {minval=pow(10.,minval1);maxval=pow(10.,maxval1);}
3193  if(saveWebInterface){width=6000;height=3200;}
3194  else{
3195  size_t found=filetype.find_last_of(".");
3196  filetype=filetype.substr(found+1);
3197  found=outputfilename.find_last_of(".");
3198  outputfilename=outputfilename.substr(0,found);
3199  }
3200  std::ofstream * ofilename;
3201  std::ifstream * ifilename;
3202  std::ostringstream ofname;
3203  std::string ifname;
3204  std::string line;
3206  if(saveWebInterface){
3207  ifilename=findfile("viewerHeader.xhtml");
3208  ofname << outputfilename << "viewer.html";
3209  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3210  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3211 *ofilename <<" var tmapname=\"" <<outputfilename << "\""<<std::endl;
3212 *ofilename <<" var tmaptitle=\"" <<title << "\""<<std::endl;
3213 *ofilename <<" var ncrates=" <<ncrates << ";"<<std::endl;
3214 *ofilename <<" var nfeccrates=" <<nfeccrates << ";"<<std::endl;
3215 *ofilename <<" var npsuracks=" <<npsuracks << ";"<<std::endl;
3216  ifilename->close();delete ifilename;
3217  ifilename=findfile("viewerTrailer.xhtml");
3218  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3219  ofilename->close();delete ofilename;
3220  ifilename->close();delete ifilename;
3221  command = "sed -i \"s/XtmapnameX/"+outputfilename+"/g\" "+ ofname.str();
3222  std::cout << "Executing " << command << std::endl;
3223  system(command.c_str());
3224  command = "sed -i \"s/XtmaptitleX/"+title+"/g\" "+ ofname.str();
3225  std::cout << "Executing " << command << std::endl;
3226  system(command.c_str());
3227  ofname.str("");
3228 
3229 ifilename=findfile("jqviewer.js");
3230  ofname << "jqviewer.js";
3231  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3232  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3233  ofilename->close();delete ofilename;
3234  ifilename->close();delete ifilename;
3235 
3236  ofname.str("");
3237  ifilename=findfile("crate.js");
3238  ofname << "crate.js";
3239  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3240  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3241  ofilename->close();delete ofilename;
3242  ifilename->close();delete ifilename;
3243 
3244  ofname.str("");
3245  ifilename=findfile("feccrate.js");
3246  ofname << "feccrate.js";
3247  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3248  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3249  ofilename->close();delete ofilename;
3250  ifilename->close();delete ifilename;
3251 
3252  ofname.str("");
3253  ifilename=findfile("rack.js");
3254  ofname << "rack.js";
3255  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3256  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3257  ofilename->close();delete ofilename;
3258  ifilename->close();delete ifilename;
3259 
3260  ofname.str("");
3261  ifilename=findfile("rackhv.js");
3262  ofname << "rackhv.js";
3263  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3264  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3265  ofilename->close();delete ofilename;
3266  ifilename->close();delete ifilename;
3267 
3268  ofname.str("");
3269  ifilename=findfile("layer.js");
3270  ofname << "layer.js";
3271  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3272  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3273  ofilename->close();delete ofilename;
3274  ifilename->close();delete ifilename;
3275 
3276  command = "scp -r ../../DQM/TrackerCommon/test/jquery/ .";
3277  std::cout << "Executing " << command << std::endl;
3278  system(command.c_str());
3279  command = "scp -r ../../CommonTools/TrackerMap/data/images/ .";
3280  std::cout << "Executing " << command << std::endl;
3281  system(command.c_str());
3282 }
3283 
3284  std::ostringstream outs;
3285  outs << outputfilename<<".png";
3286  if(saveWebInterface)save(true,minval,maxval,outs.str(),3000,1600);
3287  else {if(saveGeoTrackerMap)save(true,minval,maxval,s,width,height);}
3288  if(saveWebInterface){
3289  std::ostringstream outs;
3290  outs << outputfilename<<".png";
3291 temporary_file=false;
3292 printlayers(true,minval,maxval,outputfilename);
3293 
3294 //Now print a text file for each layer
3295  std::ofstream * txtfile;
3296 for (int layer=1; layer < 44; layer++){
3297  std::ostringstream outs;
3298  outs << outputfilename <<"layer"<<layer<< ".html";
3299  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3300  *txtfile << "<html><head></head> <body>" << std::endl;
3301  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3302  for (int module=1;module<200;module++) {
3303  int key=layer*100000+ring*1000+module;
3304  TmModule * mod = smoduleMap[key];
3305  if(mod !=nullptr && !mod->notInUse()){
3306  int idmod=mod->idex;
3307  int nchan=0;
3308  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3309  std::multimap<const int, TmApvPair*>::iterator pos;
3310  for (pos = apvModuleMap.lower_bound(idmod);
3311  pos != apvModuleMap.upper_bound(idmod); ++pos) {
3312  TmApvPair* apvpair = pos->second;
3313  if(apvpair!=nullptr){
3314  nchan++;
3315  *txtfile << apvpair->text << std::endl;
3316  }
3317 
3318  }
3319  *txtfile << "</pre><h3>"<< mod->name<<"</h3>"<<std::endl;
3320  }
3321  }
3322  }
3323  *txtfile << "</body></html>" << std::endl;
3324  txtfile->close();delete txtfile;
3325 }
3326  }
3328  std::ostringstream outs1,outs2;
3329  if(saveWebInterface)outs1 << outputfilename<<"fed.png";
3330  else outs1 << outputfilename<<"fed."<<filetype;
3331 save_as_fedtrackermap(true,0.,0.,outs1.str(),width,height);
3332  if(saveWebInterface){
3333  outs2 << outputfilename<<".xml";
3334 save_as_fedtrackermap(true,0.,0.,outs2.str(),3000,1600);
3335 //And a text file for each crate
3336  std::map<int , int>::iterator i_fed;
3337  std::ofstream * txtfile;
3338  for (int crate=firstcrate; crate < (ncrates+1); crate++){
3339  std::ostringstream outs;
3340  outs << outputfilename <<"crate"<<crate<< ".html";
3341  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3342  *txtfile << "<html><head></head> <body>" << std::endl;
3343  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
3344  if(i_fed->second == crate){
3345  int fedId = i_fed->first;
3346  for (int nconn=0;nconn<96;nconn++){
3347  int key = fedId*1000+nconn;
3348  TmApvPair * apvPair= apvMap[key];
3349  if(apvPair !=nullptr){
3350  int idmod=apvPair->idex;
3351  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3352  *txtfile << apvPair->text << std::endl;
3353  std::ostringstream outs;
3354  outs << "fedchannel " <<apvPair->getFedId() << "/"<<apvPair->getFedCh()<<" connects to module " << apvPair->mod->idex ;
3355  *txtfile << "</pre><h3>"<< outs.str()<<"</h3>"<<std::endl;
3356  }
3357  }
3358  }
3359  }
3360  *txtfile << "</body></html>" << std::endl;
3361  txtfile->close();delete txtfile;
3362  }
3363  }
3364  }
3366  std::ostringstream outs1,outs2;
3367  if(saveWebInterface)outs1 << outputfilename<<"fec.png";
3368  else outs1 << outputfilename<<"fec."<<filetype;
3369 save_as_fectrackermap(true,0.,0.,outs1.str(),width,height);
3370  if(saveWebInterface){
3371  outs2 << outputfilename<<".xml";
3372 save_as_fectrackermap(true,0.,0.,outs2.str(),3000,1600);
3373 //And a text file for each crate
3374  std::ofstream * txtfile;
3375  std::map<int , TmCcu *>::iterator i_ccu;
3376  std::multimap<TmCcu*, TmModule*>::iterator it;
3377  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
3378  for (int crate=1; crate < (nfeccrates+1); crate++){
3379  std::ostringstream outs;
3380  outs << outputfilename <<"feccrate"<<crate<< ".html";
3381  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3382  *txtfile << "<html><head></head> <body>" << std::endl;
3383  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
3384  TmCcu * ccu= i_ccu->second;
3385  if(ccu!=nullptr&&ccu->getCcuCrate() == crate){
3386  int idmod=ccu->idex;
3387  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3388  *txtfile << ccu->text << std::endl;
3389  std::ostringstream outs;
3390  if(ccu->nmod==0)outs << "ccu is in position" << ccu->mpos<<"in ring but doesn't seem to have any module connected"; else
3391  {
3392  outs << "ccu is in position " << ccu->mpos<<" in ring and connects " <<ccu->nmod<< " modules" << std::endl;
3393  ret = fecModuleMap.equal_range(ccu);
3394  for (it = ret.first; it != ret.second; ++it)
3395  {
3396  outs << (*it).second->idex<<" " << (*it).second->name <<" value= "<< (*it).second->value<<"\n\n";
3397  }
3398 
3399  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3400  }//ifccu->nmod==0
3401  }//if ccu!=0
3402  }//for i_ccu
3403  *txtfile << "</body></html>" << std::endl;
3404  txtfile->close();
3405  }//for int crate
3406  }
3407  }
3408 if(enableLVProcessing){
3409  std::ostringstream outs3,outs4;
3410  if(saveWebInterface)outs3 << outputfilename<<"psu.png";
3411  else outs3 << outputfilename<<"psu."<<filetype;
3412 save_as_psutrackermap(true,0.,0.,outs3.str(),width,height);
3413  if(saveWebInterface){
3414  outs4 << outputfilename<<".xml";
3415 save_as_psutrackermap(true,0.,0.,outs4.str(),3000,1600);
3416 //And a text file for each rack
3417 
3418  std::ofstream * txtfile;
3419  std::map<int , TmPsu *>::iterator ipsu;
3420  std::multimap<TmPsu*, TmModule*>::iterator it;
3421  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3422  for (int rack=1; rack < (npsuracks+1); rack++){
3423  std::ostringstream outs;
3424 
3425  outs << outputfilename <<"psurack"<<rack<< ".html";
3426  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3427  *txtfile << "<html><head></head> <body>" << std::endl;
3428  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3429  TmPsu * psu= ipsu->second;
3430  if(psu!=nullptr && psu->getPsuRack() == rack){
3431  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3432  *txtfile << psu->text << std::endl;
3433  std::ostringstream outs;
3434  if(psu->nmod==0)outs << "Ps is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3435  {
3436  outs<< "PS is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmod<<" modules. "<<std::endl;
3437 
3438  ret = psuModuleMap.equal_range(psu);
3439  for (it = ret.first; it != ret.second; ++it)
3440  {
3441  outs <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;
3442 
3443  }
3444  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3445  }
3446  }
3447  }
3448  *txtfile << "</body></html>" << std::endl;
3449  txtfile->close();
3450  }
3451  }
3452  }
3453 
3454 
3455 if(enableHVProcessing){
3456  std::ostringstream outs5,outs6;
3457  if(saveWebInterface)outs5 << outputfilename<<"hv.png";
3458  else outs5 << outputfilename<<"hv."<<filetype;
3459 save_as_HVtrackermap(true,0.,0.,outs5.str(),width,height);
3460  if(saveWebInterface){
3461  outs6 << outputfilename<<".xml";
3462 save_as_HVtrackermap(true,0.,0.,outs6.str(),3000,1600);
3463 //And a text file for each rack
3464 
3465  std::ofstream * txtfile;
3466  std::map<int , TmPsu *>::iterator ipsu;
3467  std::multimap<TmPsu*, TmModule*>::iterator it;
3468  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3469  for (int rack=1; rack < (npsuracks+1); rack++){
3470  std::ostringstream outs;
3471 
3472  outs << outputfilename <<"HVrack"<<rack<< ".html";
3473  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3474  *txtfile << "<html><head></head> <body>" << std::endl;
3475  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3476  TmPsu * psu= ipsu->second;
3477  if(psu!=nullptr && psu->getPsuRack() == rack){
3478  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3479  *txtfile << psu->textHV2 << std::endl;
3480  std::ostringstream outsHV2;
3481  if(psu->nmodHV2==0)outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3482  {
3483  outsHV2<< "HV Channel002 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV2<<" modules. "<<" <br>"<<std::endl;
3484 
3485  ret = psuModuleMap.equal_range(psu);
3486  for (it = ret.first; it != ret.second; ++it)
3487  {
3488  if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3489  }
3490  *txtfile << "</pre><h4>"<< outsHV2.str()<<"</h4>"<<std::endl;
3491  }
3492 
3493  *txtfile << psu->textHV3 << std::endl;
3494  std::ostringstream outsHV3;
3495  if(psu->nmodHV3==0)outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3496  {
3497  outsHV3<< "HV Channel003 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV3<<" modules. "<<" <br>"<<std::endl;
3498 
3499  ret = psuModuleMap.equal_range(psu);
3500  for (it = ret.first; it != ret.second; ++it)
3501  {
3502  if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3503  }
3504  *txtfile << "</pre><h4>"<< outsHV3.str()<<"</h4>"<<std::endl;
3505  }
3506 
3507  }
3508  }
3509  *txtfile << "</body></html>" << std::endl;
3510  txtfile->close();
3511  }
3512  }
3513  }
3514 
3515 
3516 }
TmModule * mod
Definition: TmApvPair.h:16
bool tkMapLog
Definition: TrackerMap.h:172
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:152
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:3519
int nfeccrates
Definition: TrackerMap.h:493
MapCcu ccuMap
Definition: TrackerMap.h:157
int nmodHV3
Definition: TmPsu.h:31
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=100+(360+100)*5+300, int height=50+(150+50)*6+300)
Definition: TrackerMap.cc:1853
int idex
Definition: TmPsu.h:11
bool saveGeoTrackerMap
Definition: TrackerMap.h:167
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
bool enableFecProcessing
Definition: TrackerMap.h:169
void save_as_HVtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1570
bool saveWebInterface
Definition: TrackerMap.h:166
int npsuracks
Definition: TrackerMap.h:494
int getPsuBoard()
Definition: TmPsu.h:17
bool enableFedProcessing
Definition: TrackerMap.h:168
int firstRing[43]
Definition: TrackerMap.h:485
int nmod
Definition: TmCcu.h:15
bool enableHVProcessing
Definition: TrackerMap.h:171
int getFedId()
Definition: TmApvPair.h:19
txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
unsigned int idex
Definition: TmModule.h:29
int nmod
Definition: TmPsu.h:29
int nchan
Definition: TauolaWrapper.h:80
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:699
filetype
Definition: symbols.py:49
bool temporary_file
Definition: TrackerMap.h:507
int getCcuCrate()
Definition: TmCcu.h:19
int getPsuRack()
Definition: TmPsu.h:15
int nmodHV2
Definition: TmPsu.h:30
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
Definition: TrackerMap.cc:3536
int mpos
Definition: TmCcu.h:18
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=100+(90+100)*31+300, int height=150+(2940+150)*1+300)
Definition: TrackerMap.cc:2135
SvgFed fedMap
Definition: TrackerMap.h:154
PsuModule psuModuleMap
Definition: TrackerMap.h:163
int firstcrate
Definition: TrackerMap.h:492
FecModule fecModuleMap
Definition: TrackerMap.h:159
bool notInUse()
Definition: TmModule.h:24
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:175
int idex
Definition: TmCcu.h:13
std::string textHV3
Definition: TmPsu.h:37
SvgApvPair apvMap
Definition: TrackerMap.h:150
std::string text
Definition: TmPsu.h:35
int idex
Definition: TmApvPair.h:14
bool enableLVProcessing
Definition: TrackerMap.h:170
std::string textHV2
Definition: TmPsu.h:36
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmCcu.h:5
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::string text
Definition: TmCcu.h:11
Definition: TmPsu.h:6
Definition: vlib.h:208
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1310
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:484
void TrackerMap::printlayers ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "layer" 
)

Definition at line 3536 of file TrackerMap.cc.

References TmModule::count, defwindow(), drawModule(), firstRing, crabWrapper::key, maxvalue, minvalue, mod(), module(), TmModule::notInUse(), ntotRing, MillePedeFileConverter_cfg::out, relativeConstraints::ring, saveAsSingleLayer, smoduleMap, TmModule::value, and makeMuonMisalignmentScenario::xmlfile.

Referenced by printall(), and printonline().

3536  {
3537  std::ofstream * xmlfile;
3538 saveAsSingleLayer=true;
3539 if(!print_total){
3540  for (int layer=1; layer < 44; layer++){
3541  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3542  for (int module=1;module<200;module++) {
3543  int key=layer*100000+ring*1000+module;
3544  TmModule * mod = smoduleMap[key];
3545  if(mod !=nullptr && !mod->notInUse()){
3546  mod->value = mod->value / mod->count;
3547  }
3548  }
3549  }
3550  }
3551  }
3552  if(minvalue>=maxvalue){
3553  minvalue=9999999.;
3554  maxvalue=-9999999.;
3555  for (int layer=1; layer < 44; layer++){
3556  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3557  for (int module=1;module<200;module++) {
3558  int key=layer*100000+ring*1000+module;
3559  TmModule * mod = smoduleMap[key];
3560  if(mod !=nullptr && !mod->notInUse()){
3561  if (minvalue > mod->value)minvalue=mod->value;
3562  if (maxvalue < mod->value)maxvalue=mod->value;
3563  }
3564  }
3565  }
3566  }
3567  }
3568 for (int layer=1; layer < 44; layer++){
3569  std::ostringstream outs;
3570  outs << outputfilename <<"layer"<<layer<< ".xml";
3571  xmlfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3572  *xmlfile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
3573  *xmlfile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
3574  *xmlfile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
3575  *xmlfile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
3576  *xmlfile << "<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />"<<std::endl;
3577  *xmlfile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerLayer.init()\">"<<std::endl;
3578  if(layer<31)*xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > "<<std::endl;
3579  else *xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > "<<std::endl;
3580  *xmlfile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
3581  *xmlfile << "<svg:polygon id=\"fed\" mapAttribute=\"fed\" points=\"250,40 250,10 230,10 230,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3582  *xmlfile << "<svg:polygon id=\"fec\" mapAttribute=\"fec\" points=\"228,40 228,10 208,10 208,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3583  *xmlfile << "<svg:polygon id=\"lv\" mapAttribute=\"lv\" points=\"206,40 206,10 186,10 186,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3584  *xmlfile << "<svg:polygon id=\"hv\" mapAttribute=\"hv\" points=\"184,40 184,10 164,10 164,40\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(0,127,255)\"/>"<<std::endl;
3585  *xmlfile << "<svg:polygon id=\"plot\" mapAttribute=\"plot\" points=\"155,45 155,5 135,5 135,45\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" fill=\"rgb(200,0,0)\"/>"<<std::endl;
3586 
3587  // nlay=layer;
3588  defwindow(layer);
3589  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3590  for (int module=1;module<200;module++) {
3591  int key=layer*100000+ring*1000+module;
3592  TmModule * mod = smoduleMap[key];
3593  if(mod !=nullptr && !mod->notInUse()){
3594  drawModule(mod,key,layer,print_total,xmlfile);
3595  }
3596  }
3597  }
3598  *xmlfile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
3599  *xmlfile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
3600  *xmlfile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
3601  *xmlfile << "<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
3602  *xmlfile << "<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
3603  if(layer > 33){
3604  *xmlfile << "<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"228\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FED</tspan> " <<std::endl;
3605  *xmlfile << "<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"15\" y=\"258\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FEC</tspan> " <<std::endl;
3606  *xmlfile << "<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"289\" font-size=\"12\" font-family=\"arial\" fill=\"white\">LV</tspan> " <<std::endl;
3607  *xmlfile << "<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"18\" y=\"319\" font-size=\"12\" font-family=\"arial\" fill=\"white\">HV</tspan> " <<std::endl;
3608  *xmlfile << "<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"12\" y=\"360\" font-size=\"12\" font-family=\"arial\" fill=\"white\">PLOT</tspan> " <<std::endl;
3609  }
3610  else{
3611  *xmlfile << "<tspan mapAttribute=\"fed\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"228\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FED</tspan> " <<std::endl;
3612  *xmlfile << "<tspan mapAttribute=\"fec\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"21\" y=\"258\" font-size=\"12\" font-family=\"arial\" fill=\"white\">FEC</tspan> " <<std::endl;
3613  *xmlfile << "<tspan mapAttribute=\"lv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"289\" font-size=\"12\" font-family=\"arial\" fill=\"white\">LV</tspan> " <<std::endl;
3614  *xmlfile << "<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" fill=\"white\">HV</tspan> " <<std::endl;
3615  *xmlfile << "<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" fill=\"white\">PLOT</tspan> " <<std::endl;
3616  }
3617  *xmlfile << " </text> </svg>" << std::endl;
3618  xmlfile->close();delete xmlfile;
3619  }
3620 saveAsSingleLayer=false;
3621 }
float minvalue
Definition: TrackerMap.h:505
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
void defwindow(int num_lay)
Definition: TrackerMap.h:334
int firstRing[43]
Definition: TrackerMap.h:485
bool saveAsSingleLayer
Definition: TrackerMap.h:512
Definition: value.py:1
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:538
xmlfile
Make an XML representation of the misalignment.
int count
Definition: TmModule.h:13
bool notInUse()
Definition: TmModule.h:24
float maxvalue
Definition: TrackerMap.h:505
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
int ntotRing[43]
Definition: TrackerMap.h:484
void TrackerMap::printonline ( )

Definition at line 2887 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, mps_check::command, gather_cfg::cout, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, l1t::stage2::layer2::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, crabWrapper::key, mps_splice::line, mod(), TmApvPair::mod, module(), TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, TmModule::notInUse(), npsuracks, ntotRing, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printlayers(), psuMap, psuModuleMap, 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.

2887  {
2888 //Copy interface
2889  std::ofstream * ofilename;
2890  std::ifstream * ifilename;
2891  std::ostringstream ofname;
2892  std::string ifname;
2894  std::string line;
2895  std::string outputfilename="dqmtmap";
2896  ifilename=findfile("viewerHeader.xhtml");
2897  ofname << outputfilename << "viewer.html";
2898  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2899  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2900 *ofilename <<" var tmapname=\"" <<outputfilename << "\""<<std::endl;
2901 *ofilename <<" var tmaptitle=\"" <<title << "\""<<std::endl;
2902 *ofilename <<" var ncrates=" <<ncrates << ";"<<std::endl;
2903 *ofilename <<" var nfeccrates=" <<nfeccrates << ";"<<std::endl;
2904  *ofilename <<" var npsuracks=" <<npsuracks << ";"<<std::endl;
2905 
2906  ifilename->close();delete ifilename;
2907 
2908  ifilename=findfile("viewerTrailer.xhtml");
2909  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2910  ofilename->close();delete ofilename;
2911  command = "sed -i \"s/XtmapnameX/"+outputfilename+"/g\" "+ ofname.str();
2912  std::cout << "Executing " << command << std::endl;
2913  system(command.c_str());
2914  command = "sed -i \"s/XtmaptitleX/"+title+"/g\" "+ ofname.str();
2915  std::cout << "Executing " << command << std::endl;
2916  system(command.c_str());
2917  ofname.str("");
2918  ifilename->close();delete ifilename;
2919 
2920  ifilename=findfile("jqviewer.js");
2921  ofname << "jqviewer.js";
2922  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2923  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2924  ofname.str("");
2925  ofilename->close();delete ofilename;
2926  ifilename->close();delete ifilename;
2927 
2928  ifilename=findfile("crate.js");
2929  ofname << "crate.js";
2930  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2931  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2932  ofname.str("");
2933  ofilename->close();delete ofilename;
2934  ifilename->close();delete ifilename;
2935 
2936  ifilename=findfile("feccrate.js");
2937  ofname << "feccrate.js";
2938  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2939  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2940  ofname.str("");
2941  ofilename->close();delete ofilename;
2942  ifilename->close();delete ifilename;
2943 
2944  ifilename=findfile("layer.js");
2945  ofname << "layer.js";
2946  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2947  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2948  ofname.str("");
2949  ofilename->close();delete ofilename;
2950  ifilename->close();delete ifilename;
2951 
2952  ifilename=findfile("rack.js");
2953  ofname << "rack.js";
2954  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2955  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2956  ofname.str("");
2957  ofilename->close();delete ofilename;
2958  ifilename->close();delete ifilename;
2959  ofname.str("");
2960 
2961  ifilename=findfile("rackhv.js");
2962  ofname << "rackhv.js";
2963  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2964  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2965  ofname.str("");
2966  ofilename->close();delete ofilename;
2967  ifilename->close();delete ifilename;
2968 
2969 
2970 
2971 
2972  std::ostringstream outs,outs1,outs2;
2973  outs << outputfilename<<".png";
2974 save(true,gminvalue,gmaxvalue,outs.str(),3000,1600);
2975 temporary_file=false;
2976 printlayers(true,gminvalue,gmaxvalue,outputfilename);
2977 
2978 //Now print a text file for each layer
2979  std::ofstream * txtfile;
2980 for (int layer=1; layer < 44; layer++){
2981  std::ostringstream outs;
2982  outs << outputfilename <<"layer"<<layer<< ".html";
2983  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2984  *txtfile << "<html><head></head> <body>" << std::endl;
2985  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2986  for (int module=1;module<200;module++) {
2987  int key=layer*100000+ring*1000+module;
2988  TmModule * mod = smoduleMap[key];
2989  if(mod !=nullptr && !mod->notInUse()){
2990  int idmod=mod->idex;
2991  int nchan=0;
2992  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
2993  std::multimap<const int, TmApvPair*>::iterator pos;
2994  for (pos = apvModuleMap.lower_bound(idmod);
2995  pos != apvModuleMap.upper_bound(idmod); ++pos) {
2996  TmApvPair* apvpair = pos->second;
2997  if(apvpair!=nullptr){
2998  nchan++;
2999  *txtfile << apvpair->text << std::endl;
3000  }
3001 
3002  }
3003  *txtfile << "</pre><h3>"<< mod->name<<"</h3>"<<std::endl;
3004  }
3005  }
3006  }
3007  *txtfile << "</body></html>" << std::endl;
3008  txtfile->close();delete txtfile;
3009  }
3011  outs1 << outputfilename<<"fed.png";
3012 save_as_fedtrackermap(true,gminvalue,gmaxvalue,outs1.str(),6000,3200);
3013  outs2 << outputfilename<<".xml";
3014 save_as_fedtrackermap(true,gminvalue,gmaxvalue,outs2.str(),3000,1600);
3015 //And a text file for each crate
3016  std::map<int , int>::iterator i_fed;
3017  std::ofstream * txtfile;
3018  for (int crate=firstcrate; crate < (ncrates+1); crate++){
3019  std::ostringstream outs;
3020  outs << outputfilename <<"crate"<<crate<< ".html";
3021  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3022  *txtfile << "<html><head></head> <body>" << std::endl;
3023  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
3024  if(i_fed->second == crate){
3025  int fedId = i_fed->first;
3026  for (int nconn=0;nconn<96;nconn++){
3027  int key = fedId*1000+nconn;
3028  TmApvPair * apvPair= apvMap[key];
3029  if(apvPair !=nullptr){
3030  int idmod=apvPair->idex;
3031  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3032  *txtfile << apvPair->text << std::endl;
3033  std::ostringstream outs;
3034  outs << "fedchannel " <<apvPair->getFedId() << "/"<<apvPair->getFedCh()<<" connects to module " << apvPair->mod->idex ;
3035  *txtfile << "</pre><h3>"<< outs.str()<<"</h3>"<<std::endl;
3036  }
3037  }
3038  }
3039  }
3040  *txtfile << "</body></html>" << std::endl;
3041  txtfile->close();delete txtfile;
3042  }
3043  }
3045  std::ostringstream outs1,outs2;
3046  outs1 << outputfilename<<"fec.png";
3047 save_as_fectrackermap(true,gminvalue,gmaxvalue,outs1.str(),6000,3200);
3048  outs2 << outputfilename<<".xml";
3049 save_as_fectrackermap(true,gminvalue,gmaxvalue,outs2.str(),3000,1600);
3050 //And a text file for each crate
3051  std::ofstream * txtfile;
3052  std::map<int , TmCcu *>::iterator i_ccu;
3053  std::multimap<TmCcu*, TmModule*>::iterator it;
3054  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
3055  for (int crate=1; crate < (nfeccrates+1); crate++){
3056  std::ostringstream outs;
3057  outs << outputfilename <<"feccrate"<<crate<< ".html";
3058  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3059  *txtfile << "<html><head></head> <body>" << std::endl;
3060  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
3061  TmCcu * ccu= i_ccu->second;
3062  if(ccu!=nullptr&&ccu->getCcuCrate() == crate){
3063  int idmod=ccu->idex;
3064  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3065  *txtfile << ccu->text << std::endl;
3066  std::ostringstream outs;
3067  if(ccu->nmod==0)outs << "ccu is in position" << ccu->mpos<<"in ring but doesn't seem to have any module connected"; else
3068  {
3069  outs << "ccu is in position " << ccu->mpos<<" in ring and connects " <<ccu->nmod<< " modules" << std::endl;
3070  ret = fecModuleMap.equal_range(ccu);
3071  for (it = ret.first; it != ret.second; ++it)
3072  {
3073  outs << (*it).second->idex<<" " << (*it).second->name <<" value= "<< (*it).second->value<<"\n\n";
3074  }
3075 
3076  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3077  }//ifccu->nmod==0
3078  }//if ccu!=0
3079  }//for i_ccu
3080  *txtfile << "</body></html>" << std::endl;
3081  txtfile->close();delete txtfile;
3082  }//for int crate
3083  }
3084 if(enableLVProcessing){
3085  std::ostringstream outs3,outs4;
3086  outs3 << outputfilename<<"psu.png";
3087 save_as_psutrackermap(true,gminvalue,gmaxvalue,outs3.str(),6000,3200);
3088 
3089  outs4 << outputfilename<<".xml";
3090 save_as_psutrackermap(true,gminvalue,gmaxvalue,outs4.str(),3000,1600);
3091 //And a text file for each rack
3092 
3093  std::ofstream * txtfile;
3094  std::map<int , TmPsu *>::iterator ipsu;
3095  std::multimap<TmPsu*, TmModule*>::iterator it;
3096  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3097  for (int rack=1; rack < (npsuracks+1); rack++){
3098  std::ostringstream outs;
3099 
3100  outs << outputfilename <<"psurack"<<rack<< ".html";
3101  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3102  *txtfile << "<html><head></head> <body>" << std::endl;
3103  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3104  TmPsu * psu= ipsu->second;
3105  if(psu!=nullptr && psu->getPsuRack() == rack){
3106  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3107  *txtfile << psu->text << std::endl;
3108  std::ostringstream outs;
3109  if(psu->nmod==0)outs << "Ps is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3110  {
3111  outs<< "PS is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmod<<" modules. "<<std::endl;
3112 
3113  ret = psuModuleMap.equal_range(psu);
3114  for (it = ret.first; it != ret.second; ++it)
3115  {
3116  outs <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;
3117 
3118  }
3119  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3120  }
3121  }
3122  }
3123  *txtfile << "</body></html>" << std::endl;
3124  txtfile->close();delete txtfile;
3125  }
3126  }
3127 
3128 
3129 if(enableHVProcessing){
3130  std::ostringstream outs5,outs6;
3131  outs5 << outputfilename<<"hv.png";
3132 save_as_HVtrackermap(true,gminvalue,gmaxvalue,outs5.str(),6000,3200);
3133 
3134  outs6 << outputfilename<<".xml";
3135 save_as_HVtrackermap(true,gminvalue,gmaxvalue,outs6.str(),3000,1600);
3136 //And a text file for each rack
3137 
3138  std::ofstream * txtfile;
3139  std::map<int , TmPsu *>::iterator ipsu;
3140  std::multimap<TmPsu*, TmModule*>::iterator it;
3141  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3142  for (int rack=1; rack < (npsuracks+1); rack++){
3143  std::ostringstream outs;
3144 
3145  outs << outputfilename <<"HVrack"<<rack<< ".html";
3146  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3147  *txtfile << "<html><head></head> <body>" << std::endl;
3148  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3149  TmPsu * psu= ipsu->second;
3150  if(psu!=nullptr && psu->getPsuRack() == rack){
3151  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3152  *txtfile << psu->textHV2 << std::endl;
3153  std::ostringstream outsHV2;
3154  if(psu->nmodHV2==0)outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3155  {
3156  outsHV2<< "HV Channel002 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV2<<" modules. "<<" <br>"<<std::endl;
3157 
3158  ret = psuModuleMap.equal_range(psu);
3159  for (it = ret.first; it != ret.second; ++it)
3160  {
3161  if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3162  }
3163  *txtfile << "</pre><h4>"<< outsHV2.str()<<"</h4>"<<std::endl;
3164  }
3165 
3166  *txtfile << psu->textHV3 << std::endl;
3167  std::ostringstream outsHV3;
3168  if(psu->nmodHV3==0)outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3169  {
3170  outsHV3<< "HV Channel003 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV3<<" modules. "<<" <br>"<<std::endl;
3171 
3172  ret = psuModuleMap.equal_range(psu);
3173  for (it = ret.first; it != ret.second; ++it)
3174  {
3175  if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3176  }
3177  *txtfile << "</pre><h4>"<< outsHV3.str()<<"</h4>"<<std::endl;
3178  }
3179 
3180  }
3181  }
3182  *txtfile << "</body></html>" << std::endl;
3183  txtfile->close();delete txtfile;
3184  }
3185  }
3186 
3187 }
TmModule * mod
Definition: TmApvPair.h:16
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:152
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:3519
int nfeccrates
Definition: TrackerMap.h:493
MapCcu ccuMap
Definition: TrackerMap.h:157
int nmodHV3
Definition: TmPsu.h:31
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=100+(360+100)*5+300, int height=50+(150+50)*6+300)
Definition: TrackerMap.cc:1853
int idex
Definition: TmPsu.h:11
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
bool enableFecProcessing
Definition: TrackerMap.h:169
void save_as_HVtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1570
int npsuracks
Definition: TrackerMap.h:494
int getPsuBoard()
Definition: TmPsu.h:17
bool enableFedProcessing
Definition: TrackerMap.h:168
int firstRing[43]
Definition: TrackerMap.h:485
float gminvalue
Definition: TrackerMap.h:504
int nmod
Definition: TmCcu.h:15
bool enableHVProcessing
Definition: TrackerMap.h:171
int getFedId()
Definition: TmApvPair.h:19
txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
unsigned int idex
Definition: TmModule.h:29
int nmod
Definition: TmPsu.h:29
int nchan
Definition: TauolaWrapper.h:80
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:699
bool temporary_file
Definition: TrackerMap.h:507
int getCcuCrate()
Definition: TmCcu.h:19
int getPsuRack()
Definition: TmPsu.h:15
int nmodHV2
Definition: TmPsu.h:30
void printlayers(bool print_total=true, float minval=0., float maxval=0., std::string s="layer")
Definition: TrackerMap.cc:3536
int mpos
Definition: TmCcu.h:18
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=100+(90+100)*31+300, int height=150+(2940+150)*1+300)
Definition: TrackerMap.cc:2135
SvgFed fedMap
Definition: TrackerMap.h:154
PsuModule psuModuleMap
Definition: TrackerMap.h:163
int firstcrate
Definition: TrackerMap.h:492
FecModule fecModuleMap
Definition: TrackerMap.h:159
bool notInUse()
Definition: TmModule.h:24
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:175
int idex
Definition: TmCcu.h:13
std::string textHV3
Definition: TmPsu.h:37
SvgApvPair apvMap
Definition: TrackerMap.h:150
std::string text
Definition: TmPsu.h:35
float gmaxvalue
Definition: TrackerMap.h:504
int idex
Definition: TmApvPair.h:14
bool enableLVProcessing
Definition: TrackerMap.h:170
std::string textHV2
Definition: TmPsu.h:36
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmCcu.h:5
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::string text
Definition: TmCcu.h:11
Definition: TmPsu.h:6
Definition: vlib.h:208
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1310
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:484
void TrackerMap::reset ( void  )

Definition at line 432 of file TrackerMap.cc.

References TmModule::count, imoduleMap, mod(), TmModule::red, and TmModule::value.

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

432  {
433 std::map<int , TmModule *>::iterator i_mod;
434  for( i_mod=imoduleMap.begin();i_mod !=imoduleMap.end(); i_mod++){
435  TmModule * mod= i_mod->second;
436  mod->count=0;mod->value=0;mod->red=-1;
437  }
438 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
int count
Definition: TmModule.h:13
int red
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
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 699 of file TrackerMap.cc.

References addPixelFlag, DivergingColor::blue, buildLegend(), EnergyCorrector::c, cuy::col, mps_check::command, TmModule::count, gather_cfg::cout, defwindow(), drawModule(), drawPalette(), corrVsCorr::filename, symbols::filetype, firstRing, runEdmFileComparison::found, cmsRelvalreport::green(), mps_fire::i, recoMuon::in, crabWrapper::key, checklumidiff::l, cmsBatch::log, maxvalue, minvalue, mod(), module(), TmModule::notInUse(), npoints, ntotRing, nullptr, onlyPixelFlag, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, DivergingColor::red, relativeConstraints::ring, alignCSCRings::s, savefile, saveGeoTrackerMap, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmModule::value, vc, x, and y.

Referenced by Vispa.Main.TabController.TabController::allowClose(), SiStripDetVOffTkMapPlotter::analyze(), SiStripQualityStatistics::analyze(), TkVoltageMapCreator::beginRun(), TrackerDpgAnalysis::beginRun(), Vispa.Main.TabController.TabController::checkModificationTimestamp(), SiStripCorrelateNoise::DoPlots(), SiStripCablingTrackerMap::endJob(), SiStripQualityStatistics::EndJob(), SiStripPlotGain::endJob(), SiStripCorrelateBadStripAndNoise::endJob(), BuildTrackerMapPlugin::endJob(), DetIdSelectorTest::endJob(), SiStripHitEffFromCalibTree::makeTKMap(), printall(), printonline(), SpecificationBuilder_cfi.Specification::saveAll(), and SiStripBaseCondObjDQM::saveTkMap().

699  {
700 
701  printflag=true;
702  bool rangefound = true;
703  if(saveGeoTrackerMap){
705  std::vector<TPolyLine*> vp;
706  TGaxis *axis = nullptr ;
707  size_t found=filetype.find_last_of(".");
708  filetype=filetype.substr(found+1);
709  found=outputfilename.find_last_of(".");
710  outputfilename=outputfilename.substr(0,found);
711  //outputfilename.erase(outputfilename.begin()+outputfilename.find("."),outputfilename.end());
712  temporary_file=true;
713  if(filetype=="svg")temporary_file=false;
714  std::ostringstream outs;
715  minvalue=minval; maxvalue=maxval;
716  outs << outputfilename << ".coor";
717  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
718  if(!print_total){
719  for (int layer=1; layer < 44; layer++){
720  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
721  for (int module=1;module<200;module++) {
722  int key=layer*100000+ring*1000+module;
723  TmModule * mod = smoduleMap[key];
724  if(mod !=nullptr && !mod->notInUse()){
725  mod->value = mod->value / mod->count;
726  }
727  }
728  }
729  }
730  }
731 
732  if(minvalue>=maxvalue){
733  minvalue=9999999.;
734  maxvalue=-9999999.;
735  rangefound=false;
736  for (int layer=1; layer < 44; layer++){
737  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
738  for (int module=1;module<200;module++) {
739  int key=layer*100000+ring*1000+module;
740  TmModule * mod = smoduleMap[key];
741  if(mod !=nullptr && !mod->notInUse() && mod->count>0){
742  rangefound=true;
743  if (minvalue > mod->value)minvalue=mod->value;
744  if (maxvalue < mod->value)maxvalue=mod->value;
745  }
746  }
747  }
748  }
749  }
750  if ((title.find("QTestAlarm")!=std::string::npos) || (maxvalue == minvalue)||!rangefound) printflag = false;
751  if(!temporary_file){
752  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
753  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
754  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
755  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
756  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
757  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> "<<std::endl;
758  *savefile << "<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
759  }
760  for (int layer=1; layer < 44; layer++){
761  // nlay=layer;
762  defwindow(layer);
763  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
764  for (int module=1;module<200;module++) {
765  int key=layer*100000+ring*1000+module;
766  TmModule * mod = smoduleMap[key];
767  if(mod !=nullptr && !mod->notInUse()){
768  drawModule(mod,key,layer,print_total,savefile);
769  }
770  }
771  }
772  }
773 
774  if(!temporary_file){
775  *savefile << "</svg:g>"<<std::endl;
776  *savefile << " <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">"<<title<<"</svg:text>"<<std::endl;
777  }
778 
779  if(printflag) {
781  else {drawPalette(savefile);}
782  }
783  if(!temporary_file){
784  *savefile << "</svg:svg>"<<std::endl;
785  *savefile << "</svg>"<<std::endl;
786  }
787  savefile->close(); delete savefile;
788 
789  const char * command1;
790  std::string tempfilename = outputfilename + ".coor";
791  if(filetype=="svg"){
792  std::string command = "mv "+tempfilename +" " +outputfilename + ".svg";
793  command1=command.c_str();
794  std::cout << "Executing " << command1 << std::endl;
795  system(command1);
796  }
797 
798 
799  if (temporary_file){ // create root trackermap image
800  int red,green,blue,npoints,colindex,ncolor;
801  double x[4],y[4];
802  std::ifstream tempfile(tempfilename.c_str(),std::ios::in);
803  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
804  gPad->SetFillColor(38);
805 
806  if(addPixelFlag) {gPad->Range(0,0,3800,1600);}
807  else if(onlyPixelFlag) {gPad->Range(-100,0,800,1600);}
808  else {gPad->Range(800,0,3800,1600);}
809 
810  //First build palette
811  ncolor=0;
812  typedef std::map<int,int> ColorList;
813  ColorList colorList;
814  ColorList::iterator pos;
815  TColor *col, *c;
816  std::cout<<"tempfilename "<<tempfilename<<std::endl;
817  while(!tempfile.eof()) {
818  tempfile >> red >> green >> blue >> npoints;
819  colindex=red+green*1000+blue*1000000;
820  pos=colorList.find(colindex);
821  if(pos == colorList.end()){ colorList[colindex]=ncolor+100; col =gROOT->GetColor(ncolor+100);
822  if(col) col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.)); else c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));vc.push_back(c); ncolor++;}
823  for (int i=0;i<npoints;i++){
824  tempfile >> x[i] >> y[i];
825  }
826  }
827 
828  if(ncolor>0 && ncolor<10000){
829  Int_t colors[10000];
830  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
831  gStyle->SetPalette(ncolor,colors);
832  }
833 
834  tempfile.clear();
835  tempfile.seekg(0,std::ios::beg);
836  std::cout << "created palette with " << ncolor << " colors" << std::endl;
837 
838  while(!tempfile.eof()) {//create polylines
839  tempfile >> red >> green >> blue >> npoints;
840  for (int i=0;i<npoints;i++){
841  tempfile >> x[i] >> y[i];
842  }
843  colindex=red+green*1000+blue*1000000;
844  pos=colorList.find(colindex);
845  if(pos != colorList.end()){
846  TPolyLine* pline = new TPolyLine(npoints,y,x);
847  vp.push_back(pline);
848  pline->SetFillColor(colorList[colindex]);
849  pline->SetLineWidth(0);
850  pline->Draw("f");
851  }
852  }
853  if (printflag) {
854  float lminvalue=minvalue; float lmaxvalue=maxvalue;
855  if(tkMapLog) {lminvalue=log(minvalue)/log(10);lmaxvalue=log(maxvalue)/log(10);}
856  if(onlyPixelFlag) {axis = new TGaxis(-30,36,-30,1530,lminvalue,lmaxvalue,510,"+L");}
857  else {axis = new TGaxis(3660,36,3660,1530,lminvalue,lmaxvalue,510,"+L");}
858  axis->SetLabelSize(0.02);
859  axis->Draw();
860  }
861  TLatex l;
862  l.SetTextSize(0.03);
863  l.DrawLatex(950,1330,"TID");
864  l.DrawLatex(2300,1330,"TEC");
865  l.DrawLatex(300,1330,"FPIX");
866  l.DrawLatex(20,560,"BPIX L1");
867  l.DrawLatex(500,385,"BPIX L2");
868  l.DrawLatex(500,945,"BPIX L3");
869  l.SetTextSize(0.04);
870  std::string fulltitle = title;
871  if(tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos)) fulltitle += ": Log10 scale";
872  if(onlyPixelFlag) {l.DrawLatex(30,1500,fulltitle.c_str());}
873  else {l.DrawLatex(850,1500,fulltitle.c_str());}
874  if(onlyPixelFlag) {l.DrawLatex(380,40,"-z");}
875  else {l.DrawLatex(1730,40,"-z");}
876  if(onlyPixelFlag) {l.DrawLatex(380,1330,"+z");}
877  else {l.DrawLatex(1730,1360,"+z");}
878  l.DrawLatex(1085,330,"TIB L1");
879  l.DrawLatex(1085,1000,"TIB L2");
880  l.DrawLatex(1585,330,"TIB L3");
881  l.DrawLatex(1585,1000,"TIB L4");
882  l.DrawLatex(2085,330,"TOB L1");
883  l.DrawLatex(2085,1000,"TOB L2");
884  l.DrawLatex(2585,330,"TOB L3");
885  l.DrawLatex(2585,1000,"TOB L4");
886  l.DrawLatex(3085,330,"TOB L5");
887  l.DrawLatex(3085,1000,"TOB L6");
888  TArrow arx(3448,1190,3448,1350,0.01,"|>");
889  l.DrawLatex(3460,1350,"x");
890  TArrow ary(3448,1190,3312,1190,0.01,"|>");
891  l.DrawLatex(3312,1210,"y");
892  TArrow arz(3485,373,3485,676,0.01,"|>");
893  l.DrawLatex(3510,667,"z");
894  TArrow arphi(3485,511,3037,511,0.01,"|>");
895  l.DrawLatex(3023,520,"#Phi");
896  arx.SetLineWidth(3);
897  ary.SetLineWidth(3);
898  arz.SetLineWidth(3);
899  arphi.SetLineWidth(3);
900  if(onlyPixelFlag) {
901  arx.SetX1(570);arx.SetX2(570);arx.SetY1(1190);arx.SetY2(1350);
902  l.DrawLatex(570+12,1190+160,"x");
903  ary.SetX1(570);ary.SetX2(570-160);ary.SetY1(1190);ary.SetY2(1190);
904  l.DrawLatex(570-160,1190+30,"y");
905  arz.SetX1(380);arz.SetX2(380);arz.SetY1(683-100);arz.SetY2(683+100);
906  l.DrawLatex(380+15,683+100-9,"z");
907  arphi.SetX1(380);arphi.SetX2(380-390);arphi.SetY1(683);arphi.SetY2(683);
908  l.DrawLatex(380-390-14,683+9,"#Phi");
909  }
910  arx.Draw();
911  ary.Draw();
912  arz.Draw();
913  arphi.Draw();
914  TLegend *MyL = buildLegend();
915 
916  if (title.find("QTestAlarm")!=std::string::npos){
917 
918  MyL->Draw();
919  }
920  MyC->Update();
921  if(filetype=="png"){
922 
923  std::string filename = outputfilename + ".png";
924  std::cout << "printing " <<filename<< std::endl;
925  MyC->Print(filename.c_str());
926  }
927  if(filetype=="jpg"){
928  std::string filename = outputfilename + ".jpg";
929  MyC->Print(filename.c_str());
930  }
931  if(filetype=="pdf"){
932  std::string filename = outputfilename + ".pdf";
933  MyC->Print(filename.c_str());
934  }
935  std::string command = "rm "+tempfilename ;
936  command1=command.c_str();
937  std::cout << "Executing " << command1 << std::endl;
938  system(command1);
939  MyC->Clear();
940  delete MyC;
941  delete MyL;
942  if (printflag)delete axis;
943  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
944  delete (*pos1);}
945 
946  }
947  }
948  return;
949 }
bool tkMapLog
Definition: TrackerMap.h:172
float minvalue
Definition: TrackerMap.h:505
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
std::ofstream * savefile
Definition: TrackerMap.h:500
bool saveGeoTrackerMap
Definition: TrackerMap.h:167
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2697
void defwindow(int num_lay)
Definition: TrackerMap.h:334
#define nullptr
bool addPixelFlag
Definition: TrackerMap.h:513
int firstRing[43]
Definition: TrackerMap.h:485
filetype
Definition: symbols.py:49
bool temporary_file
Definition: TrackerMap.h:507
bool onlyPixelFlag
Definition: TrackerMap.h:514
static const int npoints
Definition: value.py:1
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:538
int count
Definition: TmModule.h:13
def green(string)
bool printflag
Definition: TrackerMap.h:165
TLegend * buildLegend()
Definition: TrackerMap.cc:3623
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2509
bool notInUse()
Definition: TmModule.h:24
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:175
Definition: colors.py:1
col
Definition: cuy.py:1010
float maxvalue
Definition: TrackerMap.h:505
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
std::vector< TColor * > vc
Definition: TrackerMap.h:143
int ntotRing[43]
Definition: TrackerMap.h:484
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 1310 of file TrackerMap.cc.

References TmCcu::blue, DivergingColor::blue, EnergyCorrector::c, ccuMap, cuy::col, mps_check::command, TmCcu::count, gather_cfg::cout, deffecwindow(), drawCcu(), drawPalette(), enableFecProcessing, fecModuleMap, corrVsCorr::filename, symbols::filetype, runEdmFileComparison::found, TmCcu::getCcuCrate(), TmCcu::getCcuSlot(), TmCcu::green, cmsRelvalreport::green(), mps_fire::i, recoMuon::in, checklumidiff::l, cmsBatch::log, maxvalue, minvalue, nfeccrates, TmCcu::nmod, npoints, nullptr, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, TmCcu::red, DivergingColor::red, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmCcu::value, vc, x, and y.

Referenced by printall(), and printonline().

1310  {
1311 
1312  if(enableFecProcessing){
1314  std::vector<TPolyLine*> vp;
1315  TGaxis *axis = nullptr ;
1316  size_t found=filetype.find_last_of(".");
1317  filetype=filetype.substr(found+1);
1318  found=outputfilename.find_last_of(".");
1319  outputfilename=outputfilename.substr(0,found);
1320  temporary_file=true;
1321  if(filetype=="xml"||filetype=="svg")temporary_file=false;
1322  std::ostringstream outs;
1323  minvalue=minval; maxvalue=maxval;
1324  outs << outputfilename << ".coor";
1325  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1326  std::map<int , TmCcu *>::iterator i_ccu;
1327  std::multimap<TmCcu*, TmModule*>::iterator it;
1328  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
1329  //Decide if we must use Module or Ccu value
1330  bool useCcuValue=false;
1331 
1332 
1333  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1334  TmCcu * ccu= i_ccu->second;
1335  if(ccu!=nullptr) {
1336  if(ccu->count > 0 || ccu->red!=-1) { useCcuValue=true; break;}
1337  }
1338  }
1339 
1340 
1341  if(!useCcuValue)//store mean of connected modules value{
1342  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1343  TmCcu * ccu= i_ccu->second;
1344  if(ccu!=nullptr) {
1345  ret = fecModuleMap.equal_range(ccu);
1346  for (it = ret.first; it != ret.second; ++it)
1347  {
1348  if( (*it).second->count>0){ccu->value=ccu->value+(*it).second->value;ccu->count++;}
1349  }
1350  if(ccu->count>0)ccu->value=ccu->value/ccu->count;
1351  if(ccu->nmod==0) { ccu->red=0;ccu->green=0;ccu->blue=0;}
1352  }
1353  }
1354 
1355 
1356  if(title.find("QTestAlarm")!=std::string::npos){
1357  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1358  TmCcu * ccu= i_ccu->second;
1359  if(ccu!=nullptr) {
1360  ret = fecModuleMap.equal_range(ccu);
1361  ccu->red=0;ccu->green=255;ccu->blue=0;
1362  for (it = ret.first; it != ret.second; ++it) {
1363  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1364  ccu->red=255;ccu->green=0;ccu->blue=0;
1365  }
1366  }
1367  }
1368  }
1369  }
1370 
1371 
1372 
1373  if(!print_total){
1374  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1375  TmCcu * ccu= i_ccu->second;
1376  if(ccu!=nullptr) {
1377  if(useCcuValue) ccu->value = ccu->value / ccu->count;
1378 
1379  }
1380  }
1381  }
1382 
1383  if(minvalue>=maxvalue){
1384 
1385  minvalue=9999999.;
1386  maxvalue=-9999999.;
1387  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1388  TmCcu * ccu= i_ccu->second;
1389  if(ccu!=nullptr && ccu->count>0) {
1390  if (minvalue > ccu->value)minvalue=ccu->value;
1391  if (maxvalue < ccu->value)maxvalue=ccu->value;
1392  }
1393  }
1394  }
1395 
1396 
1397 
1398  if(filetype=="svg"){
1399  saveAsSingleLayer=false;
1400  std::ostringstream outs;
1401  outs << outputfilename<<".svg";
1402  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1403  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1404  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1405  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1406  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1407  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
1408  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1409  *savefile << "<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1410  }
1411  for (int crate=1; crate < (nfeccrates+1); crate++){
1412  if(filetype=="xml"){
1413  saveAsSingleLayer=true;
1414  std::ostringstream outs;
1415  outs << outputfilename<<"feccrate" <<crate<< ".xml";
1416  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1417  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1418  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1419  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1420  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1421  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />"<<std::endl;
1422  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
1423  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1424  *savefile << "<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > "<<std::endl;
1425  }
1426  // ncrate=crate;
1427  deffecwindow(crate);
1428 
1429  for ( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1430  TmCcu * ccu= i_ccu->second;
1431  if(ccu!=nullptr){
1432  if(ccu->getCcuCrate() == crate){
1433 
1434  drawCcu(crate,ccu->getCcuSlot()-2,print_total,ccu,savefile,useCcuValue);
1435  }
1436  }
1437  }
1438 
1439  if(!temporary_file){
1440  if(filetype=="xml"){
1441  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1442  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1443  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1444  *savefile << " </text> </svg>" << std::endl;
1445  savefile->close();
1446  saveAsSingleLayer=false;
1447  }
1448  }
1449  }
1450  if(filetype=="svg"){
1451  *savefile << "</g> </svg> </svg> " << std::endl;
1452  savefile->close();
1453  }
1454  if(!print_total && !useCcuValue){
1455 //Restore ccu value
1456  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1457  TmCcu * ccu= i_ccu->second;
1458  if(ccu!=nullptr) {
1459  ccu->value = ccu->value * ccu->count;
1460  }
1461 }
1462 }
1463  if(temporary_file){
1465  savefile->close();
1466 
1467  const char * command1;
1468  std::string tempfilename = outputfilename + ".coor";
1469  int red,green,blue,npoints,colindex,ncolor;
1470  double x[4],y[4];
1471  std::ifstream tempfile(tempfilename.c_str(),std::ios::in);
1472  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
1473  gPad->SetFillColor(38);
1474 
1475  if(saveWebInterface)gPad->Range(0,0,3700,1600); else gPad->Range(0,0,3800,1600);
1476 
1477  //First build palette
1478  ncolor=0;
1479  typedef std::map<int,int> ColorList;
1480  ColorList colorList;
1481  ColorList::iterator pos;
1482  TColor *col,*c;
1483  while(!tempfile.eof()) {
1484  tempfile >> red >> green >> blue >> npoints;
1485  colindex=red+green*1000+blue*1000000;
1486  pos=colorList.find(colindex);
1487  if(pos == colorList.end()){
1488  colorList[colindex]=ncolor+100;
1489  col =gROOT->GetColor(ncolor+100);
1490  if(col)
1491  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1492  else {
1493  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1494  vc.push_back(c);
1495  }
1496  ncolor++;
1497  }
1498  for (int i=0;i<npoints;i++){
1499  tempfile >> x[i] >> y[i];
1500  }
1501  }
1502  if(ncolor>0 && ncolor<10000){
1503  Int_t colors[10000];
1504  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
1505  gStyle->SetPalette(ncolor,colors);
1506  }
1507  tempfile.clear();
1508  tempfile.seekg(0,std::ios::beg);
1509  std::cout << "created palette with " << ncolor << " colors" << std::endl;
1510  while(!tempfile.eof()) {//create polylines
1511  tempfile >> red >> green >> blue >> npoints;
1512  for (int i=0;i<npoints;i++){
1513  tempfile >> x[i] >> y[i];
1514  }
1515  colindex=red+green*1000+blue*1000000;
1516  pos=colorList.find(colindex);
1517  if(pos != colorList.end()){
1518  TPolyLine* pline = new TPolyLine(npoints,y,x);
1519  vp.push_back(pline);
1520  pline->SetFillColor(colorList[colindex]);
1521  pline->SetLineWidth(0);
1522  pline->Draw("f");
1523  }
1524  }
1525  if (printflag&&!saveWebInterface) {
1526  float lminvalue=minvalue; float lmaxvalue=maxvalue;
1527  if(tkMapLog) {lminvalue=log(minvalue)/log(10);lmaxvalue=log(maxvalue)/log(10);}
1528  axis = new TGaxis(3660,36,3660,1530,lminvalue,lmaxvalue,510,"+L");
1529  axis->SetLabelSize(0.02);
1530  axis->Draw();
1531  }
1532 
1533  if(!saveWebInterface){
1534  TLatex l;
1535  l.SetTextSize(0.05);
1536  std::string fulltitle = title;
1537  if(tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos)) fulltitle += ": Log10 scale";
1538  l.DrawLatex(50,1530,fulltitle.c_str());
1539  }
1540  MyC->Update();
1541  std::cout << "Filetype " << filetype << std::endl;
1542  if(filetype=="png"){
1543  std::string filename = outputfilename + ".png";
1544  MyC->Print(filename.c_str());
1545  }
1546  if(filetype=="jpg"){
1547  std::string filename = outputfilename + ".jpg";
1548  MyC->Print(filename.c_str());
1549  }
1550  if(filetype=="pdf"){
1551  std::string filename = outputfilename + ".pdf";
1552  MyC->Print(filename.c_str());
1553  }
1554  std::string command = "rm "+tempfilename ;
1555  command1=command.c_str();
1556  std::cout << "Executing " << command1 << std::endl;
1557  system(command1);
1558  MyC->Clear();
1559  delete MyC;
1560  if (printflag&&!saveWebInterface)delete axis;
1561  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1562  delete (*pos1);}
1563 
1564 
1565 
1566 
1567 }//if(temporary_file)
1568 }//if(enabledFecProcessing)
1569 }
bool tkMapLog
Definition: TrackerMap.h:172
float minvalue
Definition: TrackerMap.h:505
int nfeccrates
Definition: TrackerMap.h:493
MapCcu ccuMap
Definition: TrackerMap.h:157
std::ofstream * savefile
Definition: TrackerMap.h:500
bool enableFecProcessing
Definition: TrackerMap.h:169
#define nullptr
bool saveWebInterface
Definition: TrackerMap.h:166
int count
Definition: TmCcu.h:12
int nmod
Definition: TmCcu.h:15
int getCcuSlot()
Definition: TmCcu.h:20
bool saveAsSingleLayer
Definition: TrackerMap.h:512
void deffecwindow(int num_crate)
Definition: TrackerMap.h:313
filetype
Definition: symbols.py:49
bool temporary_file
Definition: TrackerMap.h:507
static const int npoints
Definition: value.py:1
int getCcuCrate()
Definition: TmCcu.h:19
int green
Definition: TmCcu.h:9
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
Definition: TrackerMap.cc:1036
def green(string)
float value
Definition: TmCcu.h:10
bool printflag
Definition: TrackerMap.h:165
FecModule fecModuleMap
Definition: TrackerMap.h:159
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2509
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:175
Definition: colors.py:1
int red
Definition: TmCcu.h:9
col
Definition: cuy.py:1010
float maxvalue
Definition: TrackerMap.h:505
int blue
Definition: TmCcu.h:9
Definition: TmCcu.h:5
std::vector< TColor * > vc
Definition: TrackerMap.h:143
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 2135 of file TrackerMap.cc.

References apvMap, DivergingColor::blue, EnergyCorrector::c, cuy::col, mps_check::command, TmApvPair::count, TmModule::count, gather_cfg::cout, defcwindow(), drawApvPair(), drawPalette(), enableFedProcessing, l1t::stage2::layer2::fedId, fedMap, corrVsCorr::filename, symbols::filetype, firstcrate, runEdmFileComparison::found, cmsRelvalreport::green(), mps_fire::i, recoMuon::in, crabWrapper::key, checklumidiff::l, cmsBatch::log, maxvalue, minvalue, TmApvPair::mod, TmApvPair::mpos, ncrates, TmModule::notInUse(), npoints, nullptr, NUMFEDCRATE_INCOLUMN, NUMFEDCRATE_INROW, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, TmApvPair::red, DivergingColor::red, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, slotMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmApvPair::value, TmModule::value, vc, x, XFEDCSIZE, XFEDOFFSET, y, YFEDCSIZE, and YFEDOFFSET.

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

2135  {
2136  if(enableFedProcessing){
2137  printflag=true;
2138  bool rangefound = true;
2140  std::vector<TPolyLine*> vp;
2141  TGaxis *axis = nullptr ;
2142 
2143  size_t found=filetype.find_last_of(".");
2144  filetype=filetype.substr(found+1);
2145  found=outputfilename.find_last_of(".");
2146  outputfilename=outputfilename.substr(0,found);
2147 
2148  temporary_file=true;
2149  if(filetype=="xml"||filetype=="svg")temporary_file=false;
2150  std::ostringstream outs;
2151  minvalue=minval; maxvalue=maxval;
2152  outs << outputfilename << ".coor";
2153  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
2154  std::map<int , TmApvPair *>::iterator i_apv;
2155  std::map<int , int>::iterator i_fed;
2156  //Decide if we must use Module or ApvPair value
2157  bool useApvPairValue=false;
2158  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
2159  TmApvPair * apvPair= i_apv->second;
2160  if(apvPair!=nullptr) {
2161  TmModule * apv_mod = apvPair->mod;
2162  if(apv_mod !=nullptr && !apv_mod->notInUse()){
2163  if(apvPair->count > 0 || apvPair->red!=-1) { useApvPairValue=true; break;}
2164  }
2165  }
2166  }
2167  if(!print_total){
2168  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
2169  TmApvPair * apvPair= i_apv->second;
2170  if(apvPair!=nullptr) {
2171  TmModule * apv_mod = apvPair->mod;
2172  if(apv_mod !=nullptr && !apv_mod->notInUse() ){
2173  if(useApvPairValue) apvPair->value = apvPair->value / apvPair->count;
2174  else if(apvPair->mpos==0 && apv_mod->count>0)apv_mod->value = apv_mod->value / apv_mod->count;
2175  }
2176  }
2177  }
2178  }
2179  if(minvalue>=maxvalue){
2180 
2181  minvalue=9999999.;
2182  maxvalue=-9999999.;
2183  rangefound=false;
2184  for(i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
2185  TmApvPair * apvPair= i_apv->second;
2186  if(apvPair!=nullptr ) {
2187  TmModule * apv_mod = apvPair->mod;
2188  if( apv_mod !=nullptr && !apv_mod->notInUse() ){
2189  if(useApvPairValue){
2190  rangefound=true;
2191  if (minvalue > apvPair->value)minvalue=apvPair->value;
2192  if (maxvalue < apvPair->value)maxvalue=apvPair->value;
2193  } else {
2194  if(apv_mod->count>0){
2195  rangefound=true;
2196  if (minvalue > apv_mod->value)minvalue=apv_mod->value;
2197  if (maxvalue < apv_mod->value)maxvalue=apv_mod->value;}
2198  }
2199  }
2200  }
2201  }
2202  }
2203  if ((title.find("QTestAlarm")!=std::string::npos) || (maxvalue == minvalue)||!rangefound) printflag = false;
2204 
2205  if(filetype=="svg"){
2206  saveAsSingleLayer=false;
2207  std::ostringstream outs;
2208  outs << outputfilename<<".svg";
2209  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
2210  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
2211  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
2212  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
2213  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
2214  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
2215  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
2216  *savefile << "<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
2217  }
2218  for (int crate=firstcrate; crate < (ncrates+1); crate++){
2219  if(filetype=="xml"){
2220  saveAsSingleLayer=true;
2221  std::ostringstream outs;
2222  outs << outputfilename<<"crate" <<crate<< ".xml";
2223  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
2224  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
2225  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
2226  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
2227  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
2228  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />"<<std::endl;
2229  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
2230  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
2231  *savefile << "<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
2232  }
2233  // ncrate=crate;
2234  defcwindow(crate);
2235  int numfed_incrate=0;
2236  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
2237  if(i_fed->second == crate){
2238  int fedId = i_fed->first;
2239  // numfed_incrate++;
2240  numfed_incrate = slotMap[fedId];
2241  // the following piece of code is used to prepare the HTML clickable map
2242  /*
2243  double scalex=6285./6290.;
2244  double scaley=3510./3540.;
2245  double boxinitix=(NUMFED_INCOLUMN-1-(numfed_incrate-1)/NUMFED_INROW)*(NUMFEDCH_INCOLUMN+2)+NUMFEDCH_INCOLUMN+0.9;
2246  double boxinitiy=(NUMFED_INROW-1-(numfed_incrate-1)%NUMFED_INROW)*(NUMFEDCH_INROW+1)+NUMFEDCH_INROW+0.9;
2247  double boxendix=boxinitix-(NUMFEDCH_INCOLUMN-1)-0.9;
2248  double boxendiy=boxinitiy-(NUMFEDCH_INROW-1)-0.9;
2249 
2250  std::cout << "<area shape=\"rect\" coords=\" "
2251  << int(scalex*ydpixelc(boxinitiy)) << "," << int(3510-scaley*xdpixelc(boxinitix))
2252  << "," << int(scalex*ydpixelc(boxendiy)) << "," << int(3510-scaley*xdpixelc(boxendix))
2253  << "\" href=\"\" title=\"crate " << crate << " slot " << numfed_incrate << " FED " << fedId << "\" /> " << std::endl;
2254  */
2255  //
2256  for (int nconn=0;nconn<96;nconn++){
2257  int key = fedId*1000+nconn;
2258  TmApvPair * apvPair= apvMap[key];
2259  if(apvPair !=nullptr){
2260  TmModule * apv_mod = apvPair->mod;
2261  if(apv_mod !=nullptr && !apv_mod->notInUse()){
2262  drawApvPair(crate,numfed_incrate,print_total,apvPair,savefile,useApvPairValue);
2263  }
2264  }
2265  }
2266  }
2267  }
2268  if(!temporary_file){
2269  if(filetype=="xml"){
2270  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2271  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2272  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2273  *savefile << " </text> </svg>" << std::endl;
2274  savefile->close();delete savefile;
2275  saveAsSingleLayer=false;
2276  }
2277  }
2278  }
2279  if(filetype=="svg"){
2280  *savefile << "</g> </svg> </svg> " << std::endl;
2281  savefile->close();delete savefile;
2282  }
2283  if(!print_total && !useApvPairValue){
2284 //Restore module value
2285  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
2286  TmApvPair * apvPair= i_apv->second;
2287  if(apvPair!=nullptr) {
2288  TmModule * apv_mod = apvPair->mod;
2289  if(apv_mod !=nullptr && apvPair->mpos==0 && !apv_mod->notInUse()){
2290  apv_mod->value = apv_mod->value * apv_mod->count;
2291  }
2292  }
2293  }
2294 }
2295 
2296  int rangex = YFEDOFFSET+(YFEDCSIZE+YFEDOFFSET)*NUMFEDCRATE_INROW+300;
2298 
2299  if(temporary_file){
2300  if(printflag&&!saveWebInterface)drawPalette(savefile,rangex-140,rangey-100);
2301  savefile->close(); delete savefile;
2302 
2303  const char * command1;
2304  std::string tempfilename = outputfilename + ".coor";
2305  int red,green,blue,npoints,colindex,ncolor;
2306  double x[4],y[4];
2307  std::ifstream tempfile(tempfilename.c_str(),std::ios::in);
2308  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
2309  gPad->SetFillColor(38);
2310 
2311  // if(saveWebInterface)gPad->Range(0,0,3750,1600); else gPad->Range(0,0,3800,1600);
2312  std::cout << " range x " << rangex << std::endl;
2313  std::cout << " range y " << rangey << std::endl;
2314  gPad->Range(0,0,rangex,rangey);
2315 
2316  //First build palette
2317  ncolor=0;
2318  typedef std::map<int,int> ColorList;
2319  ColorList colorList;
2320  ColorList::iterator pos;
2321  TColor *col,*c;
2322  while(!tempfile.eof()) {
2323  tempfile >> red >> green >> blue >> npoints;
2324  colindex=red+green*1000+blue*1000000;
2325  pos=colorList.find(colindex);
2326  if(pos == colorList.end()){
2327  colorList[colindex]=ncolor+100;
2328  col =gROOT->GetColor(ncolor+100);
2329  if(col)
2330  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2331  else
2332  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2333  vc.push_back(c);
2334  ncolor++;
2335  }
2336  for (int i=0;i<npoints;i++){
2337  tempfile >> x[i] >> y[i];
2338  }
2339  }
2340  if(ncolor>0 && ncolor<10000){
2341  Int_t colors[10000];
2342  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
2343  gStyle->SetPalette(ncolor,colors);
2344  }
2345  tempfile.clear();
2346  tempfile.seekg(0,std::ios::beg);
2347  std::cout << "created palette with " << ncolor << " colors" << std::endl;
2348  while(!tempfile.eof()) {//create polylines
2349  tempfile >> red >> green >> blue >> npoints;
2350  for (int i=0;i<npoints;i++){
2351  tempfile >> x[i] >> y[i];
2352  }
2353  colindex=red+green*1000+blue*1000000;
2354  pos=colorList.find(colindex);
2355  if(pos != colorList.end()){
2356  TPolyLine* pline = new TPolyLine(npoints,y,x);
2357  vp.push_back(pline);
2358  pline->SetFillColor(colorList[colindex]);
2359  pline->SetLineWidth(0);
2360  pline->Draw("f");
2361  }
2362  }
2363  if (printflag&&!saveWebInterface) {
2364  float lminvalue=minvalue; float lmaxvalue=maxvalue;
2365  if(tkMapLog) {lminvalue=log(minvalue)/log(10);lmaxvalue=log(maxvalue)/log(10);}
2366  axis = new TGaxis(rangex-140,34,rangex-140,rangey-106,lminvalue,lmaxvalue,510,"+L");
2367  axis->SetLabelSize(0.02);
2368  axis->Draw();
2369  }
2370 
2371  if(!saveWebInterface){
2372  TLatex l;
2373  l.SetTextSize(0.05);
2374  std::string fulltitle = title;
2375  if(tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos)) fulltitle += ": Log10 scale";
2376  l.DrawLatex(50,rangey-200,fulltitle.c_str());
2377  }
2378  MyC->Update();
2379  std::cout << "Filetype " << filetype << std::endl;
2380  if(filetype=="png"){
2381  std::string filename = outputfilename + ".png";
2382  MyC->Print(filename.c_str());
2383  }
2384  if(filetype=="jpg"){
2385  std::string filename = outputfilename + ".jpg";
2386  MyC->Print(filename.c_str());
2387  }
2388  if(filetype=="pdf"){
2389  std::string filename = outputfilename + ".pdf";
2390  MyC->Print(filename.c_str());
2391  }
2392  std::string command = "rm "+tempfilename ;
2393  command1=command.c_str();
2394  std::cout << "Executing " << command1 << std::endl;
2395  system(command1);
2396  MyC->Clear();
2397  delete MyC;
2398  if (printflag&&!saveWebInterface)delete axis;
2399  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
2400  delete (*pos1);}
2401 
2402 
2403 }//if(temporary_file)
2404 }//if(enabledFedProcessing)
2405 }
TmModule * mod
Definition: TmApvPair.h:16
bool tkMapLog
Definition: TrackerMap.h:172
#define NUMFEDCRATE_INCOLUMN
Definition: TrackerMap.h:61
float minvalue
Definition: TrackerMap.h:505
float value
Definition: TmModule.h:12
int mpos
Definition: TmApvPair.h:17
std::ofstream * savefile
Definition: TrackerMap.h:500
#define YFEDOFFSET
Definition: TrackerMap.h:68
#define nullptr
bool saveWebInterface
Definition: TrackerMap.h:166
#define YFEDCSIZE
Definition: TrackerMap.h:66
bool enableFedProcessing
Definition: TrackerMap.h:168
#define NUMFEDCRATE_INROW
Definition: TrackerMap.h:62
int red
Definition: TmApvPair.h:10
bool saveAsSingleLayer
Definition: TrackerMap.h:512
filetype
Definition: symbols.py:49
bool temporary_file
Definition: TrackerMap.h:507
#define XFEDCSIZE
Definition: TrackerMap.h:65
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:950
int count
Definition: TmModule.h:13
SvgFed slotMap
Definition: TrackerMap.h:155
def green(string)
int count
Definition: TmApvPair.h:13
SvgFed fedMap
Definition: TrackerMap.h:154
bool printflag
Definition: TrackerMap.h:165
int firstcrate
Definition: TrackerMap.h:492
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2509
bool notInUse()
Definition: TmModule.h:24
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:175
Definition: colors.py:1
SvgApvPair apvMap
Definition: TrackerMap.h:150
col
Definition: cuy.py:1010
float maxvalue
Definition: TrackerMap.h:505
#define XFEDOFFSET
Definition: TrackerMap.h:67
void defcwindow(int num_crate)
Definition: TrackerMap.h:304
std::vector< TColor * > vc
Definition: TrackerMap.h:143
float value
Definition: TmApvPair.h:11
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 1570 of file TrackerMap.cc.

References DivergingColor::blue, TmPsu::blueHV2, TmPsu::blueHV3, EnergyCorrector::c, cuy::col, mps_check::command, TmPsu::countHV2, TmPsu::countHV3, gather_cfg::cout, defpsuwindow(), drawHV2(), drawHV3(), drawPalette(), enableHVProcessing, corrVsCorr::filename, symbols::filetype, runEdmFileComparison::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), cmsRelvalreport::green(), TmPsu::greenHV2, TmPsu::greenHV3, mps_fire::i, recoMuon::in, checklumidiff::l, cmsBatch::log, SiStripPI::max, maxvalue, min(), minvalue, TmPsu::nmodHV2, TmPsu::nmodHV3, npoints, npsuracks, nullptr, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, psuMap, psuModuleMap, DivergingColor::red, TmPsu::redHV2, TmPsu::redHV3, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmPsu::valueHV2, TmPsu::valueHV3, vc, x, and y.

Referenced by printall(), and printonline().

1570  {
1571 
1572  if(enableHVProcessing){
1574  std::vector<TPolyLine*> vp;
1575  TGaxis *axis = nullptr ;
1576  size_t found=filetype.find_last_of(".");
1577  filetype=filetype.substr(found+1);
1578  found=outputfilename.find_last_of(".");
1579  outputfilename=outputfilename.substr(0,found);
1580 
1581  temporary_file=true;
1582 
1583 
1584  if(filetype=="xml"||filetype=="svg")temporary_file=false;
1585 
1586  std::ostringstream outs;
1587  minvalue=minval; maxvalue=maxval;
1588  outs << outputfilename << ".coor";
1589  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1590 
1591  std::map<int , TmPsu *>::iterator ipsu;
1592  std::multimap<TmPsu*, TmModule*>::iterator it;
1593  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
1594 
1595 
1596  bool usePsuValue=false;
1597 
1598  for( ipsu=psuMap.begin();ipsu!=psuMap.end(); ipsu++){
1599  TmPsu* psu= ipsu->second;
1600  if(psu!=nullptr) {
1601  if(psu->countHV2 > 0 || psu->redHV2!=-1 || psu->countHV3 > 0 || psu->redHV3!=-1) { usePsuValue=true; break;}
1602  }
1603  }
1604 
1605  if(!usePsuValue){//store mean of connected modules value{
1606 
1607  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1608  TmPsu * psu= ipsu->second;
1609  if(psu!=nullptr) {
1610  ret = psuModuleMap.equal_range(psu);
1611  int nconn1=0;int nconn2=0;
1612  for(it = ret.first; it != ret.second; ++it){
1613  if((*it).second->HVchannel==2&&(*it).second->count>0){ nconn1++;psu->valueHV2=psu->valueHV2+(*it).second->value;}
1614  if((*it).second->HVchannel==3&&(*it).second->count>0){ nconn2++;psu->valueHV3=psu->valueHV3+(*it).second->value;}
1615  }
1616  if(psu->nmodHV2!=0 &&nconn1>0){psu->valueHV2=psu->valueHV2/psu->nmodHV2; psu->countHV2=1; }
1617  if(psu->nmodHV3!=0 &&nconn2>0){psu->valueHV3=psu->valueHV3/psu->nmodHV3; psu->countHV3=1; }
1618 
1619  }
1620 
1621  }
1622  }
1623 
1624  if(title.find("QTestAlarm")!=std::string::npos){
1625  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1626  TmPsu * psu= ipsu->second;
1627  if(psu!=nullptr) {
1628  ret = psuModuleMap.equal_range(psu);
1629  psu->redHV2=0;psu->greenHV2=255;psu->blueHV2=0;
1630  psu->redHV3=0;psu->greenHV3=255;psu->blueHV3=0;
1631  for (it = ret.first; it != ret.second; ++it) {
1632  if((*it).second->HVchannel==2){
1633  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1634  psu->redHV2=255;psu->greenHV2=0;psu->blueHV2=0;
1635  }
1636  }
1637  if((*it).second->HVchannel==3){
1638  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1639  psu->redHV3=255;psu->greenHV3=0;psu->blueHV3=0;
1640  }
1641  }
1642  }
1643  }
1644  }
1645  }
1646 
1647  if(!print_total){
1648  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1649  TmPsu * psu= ipsu->second;
1650  if(psu!=nullptr) {
1651  if(usePsuValue){
1652  psu->valueHV2 = psu->valueHV2 / psu->countHV2;
1653  psu->valueHV3 = psu->valueHV3 / psu->countHV3;
1654  }
1655  }
1656  }
1657  }
1658 
1659  if(minvalue>=maxvalue){
1660 
1661  minvalue=9999999.;
1662  maxvalue=-9999999.;
1663 
1664  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1665  TmPsu * psu= ipsu->second;
1666  if(psu!=nullptr && psu->countHV2>0 && psu->countHV3 >0) {
1667 
1668  if (minvalue > psu->valueHV2 || minvalue > psu->valueHV3)minvalue=std::min(psu->valueHV2,psu->valueHV3);
1669  if (maxvalue < psu->valueHV2 || maxvalue < psu->valueHV3)maxvalue=std::max(psu->valueHV2,psu->valueHV3);
1670 
1671 
1672  }
1673  }
1674  }
1675 
1676  if(filetype=="svg"){
1677  saveAsSingleLayer=false;
1678  std::ostringstream outs;
1679  outs << outputfilename<<".svg";
1680  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1681  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1682  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1683  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1684  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1685  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
1686  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1687  *savefile << "<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1688  }
1689 
1690  for (int irack=1; irack < (npsuracks+1); irack++){
1691  if(filetype=="xml"){
1692  saveAsSingleLayer=true;
1693  std::ostringstream outs;
1694  outs << outputfilename<<"HVrack" <<irack<< ".xml";
1695  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1696  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1697  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1698  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1699  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1700  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />"<<std::endl;
1701  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerRackhv.init()\">"<<std::endl;
1702  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1703  *savefile << "<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
1704  }
1705 
1706  // nrack=irack;
1707  defpsuwindow(irack);
1708  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1709  TmPsu * psu= ipsu->second;
1710  if(psu->getPsuRack() == irack){
1711  drawHV2(irack,psu->getPsuCrate(),print_total,psu,savefile,usePsuValue);
1712  drawHV3(irack,psu->getPsuCrate(),print_total,psu,savefile,usePsuValue);
1713  }
1714  }
1715 
1716 
1717  if(!temporary_file){
1718  if(filetype=="xml"){
1719  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1720  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1721  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1722  *savefile << " </text> </svg>" << std::endl;
1723  savefile->close();
1724  saveAsSingleLayer=false;
1725  }
1726  }
1727  }
1728  if(filetype=="svg"){
1729  *savefile << "</g> </svg> </svg> " << std::endl;
1730  savefile->close();
1731  }
1732 
1733  //Restore psu value
1734  if(!print_total && !usePsuValue){
1735  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1736  TmPsu *psu = ipsu->second;
1737  if(psu!=nullptr) {
1738  psu->valueHV2 = psu->valueHV2 * psu->countHV2;
1739  psu->valueHV3 = psu->valueHV3 * psu->countHV3;
1740  }
1741  }
1742  }
1743 
1744 
1745  if(temporary_file){
1747  savefile->close();
1748 
1749  const char * command1;
1750  std::string tempfilename = outputfilename + ".coor";
1751  int red,green,blue,npoints,colindex,ncolor;
1752  double x[4],y[4];
1753  std::ifstream tempfile(tempfilename.c_str(),std::ios::in);
1754  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
1755  gPad->SetFillColor(38);
1756 
1757  if(saveWebInterface)gPad->Range(0,0,3700,1600); else gPad->Range(0,0,3800,1600);
1758 
1759  //First build palette
1760  ncolor=0;
1761  typedef std::map<int,int> ColorList;
1762  ColorList colorList;
1763  ColorList::iterator pos;
1764  TColor *col,*c;
1765  while(!tempfile.eof()) {
1766  tempfile >> red >> green >> blue >> npoints;
1767  colindex=red+green*1000+blue*1000000;
1768  pos=colorList.find(colindex);
1769  if(pos == colorList.end()){
1770  colorList[colindex]=ncolor+100;
1771  col =gROOT->GetColor(ncolor+100);
1772  if(col)
1773  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1774  else {
1775  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1776  vc.push_back(c);
1777  }
1778  ncolor++;
1779  }
1780  for (int i=0;i<npoints;i++){
1781  tempfile >> x[i] >> y[i];
1782  }
1783  }
1784  if(ncolor>0 && ncolor<10000){
1785  Int_t colors[10000];
1786  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
1787  gStyle->SetPalette(ncolor,colors);
1788  }
1789  tempfile.clear();
1790  tempfile.seekg(0,std::ios::beg);
1791  std::cout << "created palette with " << ncolor << " colors" << std::endl;
1792  while(!tempfile.eof()) {//create polylines
1793  tempfile >> red >> green >> blue >> npoints;
1794  for (int i=0;i<npoints;i++){
1795  tempfile >> x[i] >> y[i];
1796  }
1797  colindex=red+green*1000+blue*1000000;
1798  pos=colorList.find(colindex);
1799  if(pos != colorList.end()){
1800  TPolyLine* pline = new TPolyLine(npoints,y,x);
1801  vp.push_back(pline);
1802  pline->SetFillColor(colorList[colindex]);
1803  pline->SetLineWidth(0);
1804  pline->Draw("f");
1805  }
1806  }
1807  if (printflag&&!saveWebInterface) {
1808  float lminvalue=minvalue; float lmaxvalue=maxvalue;
1809  if(tkMapLog) {lminvalue=log(minvalue)/log(10);lmaxvalue=log(maxvalue)/log(10);}
1810  axis = new TGaxis(3660,36,3660,1530,lminvalue,lmaxvalue,510,"+L");
1811  axis->SetLabelSize(0.02);
1812  axis->Draw();
1813  }
1814 
1815 
1816  if(!saveWebInterface){
1817  TLatex l;
1818  l.SetTextSize(0.05);
1819  std::string fulltitle = title;
1820  if(tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos)) fulltitle += ": Log10 scale";
1821  l.DrawLatex(50,1530,fulltitle.c_str());
1822  }
1823  MyC->Update();
1824  std::cout << "Filetype " << filetype << std::endl;
1825  if(filetype=="png"){
1826  std::string filename = outputfilename + ".png";
1827  MyC->Print(filename.c_str());
1828  }
1829  if(filetype=="jpg"){
1830  std::string filename = outputfilename + ".jpg";
1831  MyC->Print(filename.c_str());
1832  }
1833  if(filetype=="pdf"){
1834  std::string filename = outputfilename + ".pdf";
1835  MyC->Print(filename.c_str());
1836  }
1837  std::string command = "rm "+tempfilename ;
1838  command1=command.c_str();
1839  std::cout << "Executing " << command1 << std::endl;
1840  system(command1);
1841  MyC->Clear();
1842  delete MyC;
1843  if (printflag&&!saveWebInterface)delete axis;
1844  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1845  delete (*pos1);}
1846 
1847 
1848  }//if(temporary_file)
1849 }//if(enabledHVProcessing)
1850 }
bool tkMapLog
Definition: TrackerMap.h:172
float minvalue
Definition: TrackerMap.h:505
int redHV2
Definition: TmPsu.h:21
int nmodHV3
Definition: TmPsu.h:31
std::ofstream * savefile
Definition: TrackerMap.h:500
int countHV2
Definition: TmPsu.h:27
#define nullptr
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:322
bool saveWebInterface
Definition: TrackerMap.h:166
int npsuracks
Definition: TrackerMap.h:494
int greenHV3
Definition: TmPsu.h:22
bool enableHVProcessing
Definition: TrackerMap.h:171
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1245
bool saveAsSingleLayer
Definition: TrackerMap.h:512
int blueHV3
Definition: TmPsu.h:22
filetype
Definition: symbols.py:49
bool temporary_file
Definition: TrackerMap.h:507
int greenHV2
Definition: TmPsu.h:21
static const int npoints
T min(T a, T b)
Definition: MathUtil.h:58
int getPsuRack()
Definition: TmPsu.h:15
int nmodHV2
Definition: TmPsu.h:30
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1178
int redHV3
Definition: TmPsu.h:22
def green(string)
PsuModule psuModuleMap
Definition: TrackerMap.h:163
float valueHV2
Definition: TmPsu.h:25
bool printflag
Definition: TrackerMap.h:165
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2509
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:175
Definition: colors.py:1
col
Definition: cuy.py:1010
int countHV3
Definition: TmPsu.h:28
float maxvalue
Definition: TrackerMap.h:505
float valueHV3
Definition: TmPsu.h:24
MapPsu psuMap
Definition: TrackerMap.h:161
int blueHV2
Definition: TmPsu.h:21
Definition: TmPsu.h:6
std::vector< TColor * > vc
Definition: TrackerMap.h:143
int getPsuCrate()
Definition: TmPsu.h:16
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 1853 of file TrackerMap.cc.

References DivergingColor::blue, EnergyCorrector::c, cuy::col, mps_check::command, TmPsu::count, gather_cfg::cout, defpsuwindow(), drawPalette(), drawPsu(), enableLVProcessing, corrVsCorr::filename, symbols::filetype, runEdmFileComparison::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), cmsRelvalreport::green(), mps_fire::i, recoMuon::in, checklumidiff::l, cmsBatch::log, maxvalue, minvalue, TmPsu::nmod, npoints, npsuracks, nullptr, NUMPSURACK_INCOLUMN, NUMPSURACK_INROW, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printflag, psuMap, psuModuleMap, TmPsu::red, DivergingColor::red, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmPsu::value, vc, x, XPSUOFFSET, XPSURSIZE, y, YPSUOFFSET, and YPSURSIZE.

Referenced by printall(), and printonline().

1853  {
1854 
1855  if(enableLVProcessing){
1856 
1857  printflag=true;
1858  bool rangefound=true;
1860  std::vector<TPolyLine*> vp;
1861  TGaxis *axis = nullptr ;
1862 
1863  size_t found=filetype.find_last_of(".");
1864  filetype=filetype.substr(found+1);
1865  found=outputfilename.find_last_of(".");
1866  outputfilename=outputfilename.substr(0,found);
1867 
1868  temporary_file=true;
1869 
1870 
1871 
1872  if(filetype=="xml"||filetype=="svg")temporary_file=false;
1873 
1874  std::ostringstream outs;
1875  minvalue=minval; maxvalue=maxval;
1876  outs << outputfilename << ".coor";
1877  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1878 
1879  std::map<int , TmPsu *>::iterator ipsu;
1880  std::multimap<TmPsu*, TmModule*>::iterator it;
1881  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
1882 
1883  //Decide if we must use Module or Power Psupply value
1884  bool usePsuValue=false;
1885 
1886  for( ipsu=psuMap.begin();ipsu!=psuMap.end(); ipsu++){
1887  TmPsu* psu= ipsu->second;
1888  if(psu!=nullptr) {
1889  if(psu->count > 0 || psu->red!=-1) { usePsuValue=true; break;}
1890  }
1891  }
1892 
1893  if(!usePsuValue){//store mean of connected modules value{
1894  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1895  TmPsu * psu= ipsu->second;
1896  if(psu!=nullptr) {
1897  ret = psuModuleMap.equal_range(psu);
1898  int nconn=0;
1899  for(it = ret.first; it != ret.second; ++it){
1900  if((*it).second->count>0){nconn++;psu->value=psu->value+(*it).second->value;}
1901 
1902  }
1903  if(nconn>0){ psu->value=psu->value/psu->nmod; psu->count=1;}
1904 
1905  }
1906  }
1907  }
1908 
1909  if(title.find("QTestAlarm")!=std::string::npos){
1910  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1911  TmPsu * psu= ipsu->second;
1912  if(psu!=nullptr) {
1913  ret = psuModuleMap.equal_range(psu);
1914  // psu->red=255;psu->green=255;psu->blue=255;
1915  psu->red=-1;
1916  int nconn=0;
1917  for (it = ret.first; it != ret.second; ++it) {
1918  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1919  nconn++;psu->value++;
1920  }
1921  }
1922  if(nconn>0){ psu->value=psu->value/psu->nmod; psu->count=1;}
1923  }
1924  }
1925  }
1926 
1927 
1928 
1929  if(!print_total){
1930  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1931  TmPsu * psu= ipsu->second;
1932  if(psu!=nullptr) {
1933  if(usePsuValue) psu->value = psu->value / psu->count;
1934 
1935  }
1936  }
1937  }
1938 
1939  if(minvalue>=maxvalue){
1940 
1941  minvalue=9999999.;
1942  maxvalue=-9999999.;
1943  rangefound=false;
1944  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1945  TmPsu * psu= ipsu->second;
1946  if(psu!=nullptr && psu->count>0) {
1947  rangefound = true;
1948  if (minvalue > psu->value)minvalue=psu->value;
1949  if (maxvalue < psu->value)maxvalue=psu->value;
1950  }
1951  }
1952  }
1953  if ((maxvalue == minvalue)||!rangefound) printflag = false;
1954 
1955 
1956  if(filetype=="svg"){
1957  saveAsSingleLayer=false;
1958  std::ostringstream outs;
1959  outs << outputfilename<<".svg";
1960  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1961  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1962  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1963  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1964  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1965  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
1966  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1967  *savefile << "<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1968  }
1969 
1970  for (int irack=1; irack < (npsuracks+1); irack++){
1971  if(filetype=="xml"){
1972  saveAsSingleLayer=true;
1973  std::ostringstream outs;
1974  outs << outputfilename<<"psurack" <<irack<< ".xml";
1975  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1976  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1977  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1978  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1979  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1980  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />"<<std::endl;
1981  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
1982  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1983  *savefile << "<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
1984  }
1985 
1986 
1987  // nrack=irack;
1988  defpsuwindow(irack);
1989  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1990  TmPsu * psu= ipsu->second;
1991  if(psu->getPsuRack() == irack){
1992 
1993  drawPsu(irack,psu->getPsuCrate(),print_total,psu,savefile,usePsuValue);
1994  }
1995  }
1996 
1997 
1998  if(!temporary_file){
1999  if(filetype=="xml"){
2000  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2001  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2002  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2003  *savefile << " </text> </svg>" << std::endl;
2004  savefile->close();
2005  saveAsSingleLayer=false;
2006  }
2007  }
2008  }
2009  if(filetype=="svg"){
2010  *savefile << "</g> </svg> </svg> " << std::endl;
2011  savefile->close();
2012  }
2013 
2014  //Restore psu value
2015  if(!print_total && !usePsuValue){
2016  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
2017  TmPsu *psu = ipsu->second;
2018  if(psu!=nullptr) {
2019  psu->value = psu->value * psu->count;
2020  }
2021  }
2022  }
2023 
2024  int rangex=YPSUOFFSET+(YPSURSIZE+YPSUOFFSET)*NUMPSURACK_INROW+300;
2026 
2027 
2028  if(temporary_file){
2029  if(printflag&&!saveWebInterface)drawPalette(savefile,rangex-140,rangey-100);
2030  savefile->close();
2031 
2032  const char * command1;
2033  std::string tempfilename = outputfilename + ".coor";
2034  int red,green,blue,npoints,colindex,ncolor;
2035  double x[4],y[4];
2036  std::ifstream tempfile(tempfilename.c_str(),std::ios::in);
2037  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
2038  gPad->SetFillColor(38);
2039 
2040  // if(saveWebInterface)gPad->Range(0,0,3700,1600); else gPad->Range(0,0,3800,1600);
2041  std::cout << " range x " << rangex << std::endl;
2042  std::cout << " range y " << rangey << std::endl;
2043  gPad->Range(0,0,rangex,rangey);
2044 
2045  //First build palette
2046  ncolor=0;
2047  typedef std::map<int,int> ColorList;
2048  ColorList colorList;
2049  ColorList::iterator pos;
2050  TColor *col,*c;
2051  while(!tempfile.eof()) {
2052  tempfile >> red >> green >> blue >> npoints;
2053  colindex=red+green*1000+blue*1000000;
2054  pos=colorList.find(colindex);
2055  if(pos == colorList.end()){
2056  colorList[colindex]=ncolor+100;
2057  col =gROOT->GetColor(ncolor+100);
2058  if(col)
2059  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2060  else
2061  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2062  vc.push_back(c);
2063  ncolor++;
2064  }
2065  for (int i=0;i<npoints;i++){
2066  tempfile >> x[i] >> y[i];
2067  }
2068  }
2069  if(ncolor>0 && ncolor<10000){
2070  Int_t colors[10000];
2071  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
2072  gStyle->SetPalette(ncolor,colors);
2073  }
2074  tempfile.clear();
2075  tempfile.seekg(0,std::ios::beg);
2076  std::cout << "created palette with " << ncolor << " colors" << std::endl;
2077  while(!tempfile.eof()) {//create polylines
2078  tempfile >> red >> green >> blue >> npoints;
2079  for (int i=0;i<npoints;i++){
2080  tempfile >> x[i] >> y[i];
2081  }
2082  colindex=red+green*1000+blue*1000000;
2083  pos=colorList.find(colindex);
2084  if(pos != colorList.end()){
2085  TPolyLine* pline = new TPolyLine(npoints,y,x);
2086  vp.push_back(pline);
2087  pline->SetFillColor(colorList[colindex]);
2088  pline->SetLineWidth(0);
2089  pline->Draw("f");
2090  }
2091  }
2092  if (printflag&&!saveWebInterface) {
2093  float lminvalue=minvalue; float lmaxvalue=maxvalue;
2094  if(tkMapLog) {lminvalue=log(minvalue)/log(10);lmaxvalue=log(maxvalue)/log(10);}
2095  axis = new TGaxis(rangex-140,34,rangex-140,rangey-106,lminvalue,lmaxvalue,510,"+L");
2096  axis->SetLabelSize(0.02);
2097  axis->Draw();
2098  }
2099 
2100  if(!saveWebInterface){
2101  TLatex l;
2102  l.SetTextSize(0.05);
2103  std::string fulltitle = title;
2104  if(tkMapLog && (fulltitle.find("Log10 scale") == std::string::npos)) fulltitle += ": Log10 scale";
2105  l.DrawLatex(50,rangey-200,fulltitle.c_str());
2106  }
2107  MyC->Update();
2108  std::cout << "Filetype " << filetype << std::endl;
2109  if(filetype=="png"){
2110  std::string filename = outputfilename + ".png";
2111  MyC->Print(filename.c_str());
2112  }
2113  if(filetype=="jpg"){
2114  std::string filename = outputfilename + ".jpg";
2115  MyC->Print(filename.c_str());
2116  }
2117  if(filetype=="pdf"){
2118  std::string filename = outputfilename + ".pdf";
2119  MyC->Print(filename.c_str());
2120  }
2121  std::string command = "rm "+tempfilename ;
2122  command1=command.c_str();
2123  std::cout << "Executing " << command1 << std::endl;
2124  system(command1);
2125  MyC->Clear();
2126  delete MyC;
2127  if (printflag&&!saveWebInterface)delete axis;
2128  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
2129  delete (*pos1);}
2130 
2131 }//if(temporary_file)
2132 }//if(enabledFedProcessing)
2133 }
bool tkMapLog
Definition: TrackerMap.h:172
float minvalue
Definition: TrackerMap.h:505
#define NUMPSURACK_INCOLUMN
Definition: TrackerMap.h:48
std::ofstream * savefile
Definition: TrackerMap.h:500
int count
Definition: TmPsu.h:26
#define XPSURSIZE
Definition: TrackerMap.h:50
#define nullptr
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:322
bool saveWebInterface
Definition: TrackerMap.h:166
int npsuracks
Definition: TrackerMap.h:494
float value
Definition: TmPsu.h:23
int red
Definition: TmPsu.h:20
int nmod
Definition: TmPsu.h:29
bool saveAsSingleLayer
Definition: TrackerMap.h:512
filetype
Definition: symbols.py:49
bool temporary_file
Definition: TrackerMap.h:507
static const int npoints
Definition: value.py:1
int getPsuRack()
Definition: TmPsu.h:15
def green(string)
PsuModule psuModuleMap
Definition: TrackerMap.h:163
#define YPSUOFFSET
Definition: TrackerMap.h:53
bool printflag
Definition: TrackerMap.h:165
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2509
#define YPSURSIZE
Definition: TrackerMap.h:51
list command
Definition: mps_check.py:25
std::string title
Definition: TrackerMap.h:175
Definition: colors.py:1
col
Definition: cuy.py:1010
float maxvalue
Definition: TrackerMap.h:505
bool enableLVProcessing
Definition: TrackerMap.h:170
#define NUMPSURACK_INROW
Definition: TrackerMap.h:49
MapPsu psuMap
Definition: TrackerMap.h:161
Definition: TmPsu.h:6
#define XPSUOFFSET
Definition: TrackerMap.h:52
std::vector< TColor * > vc
Definition: TrackerMap.h:143
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, std::ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1101
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::setPalette ( int  numpalette)
inline
void TrackerMap::setRange ( float  min,
float  max 
)

Definition at line 671 of file TrackerMap.cc.

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

Referenced by setTitle().

672 if(tkMapLog) {gminvalue=pow(10.,min);gmaxvalue=pow(10.,max);}
673 }
bool tkMapLog
Definition: TrackerMap.h:172
float gminvalue
Definition: TrackerMap.h:504
T min(T a, T b)
Definition: MathUtil.h:58
float gmaxvalue
Definition: TrackerMap.h:504
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void TrackerMap::setText ( int  idmod,
std::string  s 
)

Definition at line 2797 of file TrackerMap.cc.

References gather_cfg::cout, imoduleMap, mod(), alignCSCRings::s, and TmModule::text.

Referenced by fillc(), and Vispa.Gui.PortWidget.PortWidget::setDescription().

2797  {
2798 
2799  TmModule * mod = imoduleMap[idmod];
2800  if(mod!=nullptr){
2801  mod->text=s;
2802  }
2803  else std::cout << "**************************error in IdModuleMap **************";
2804 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:148
std::string text
Definition: TmModule.h:14
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::setText ( int  layer,
int  ring,
int  nmod,
std::string  s 
)

Definition at line 2807 of file TrackerMap.cc.

References gather_cfg::cout, crabWrapper::key, mod(), alignCSCRings::s, smoduleMap, and TmModule::text.

Referenced by Vispa.Gui.PortWidget.PortWidget::setDescription().

2807  {
2808 
2809  int key = layer*100000+ring*1000+nmod;
2810  TmModule * mod = smoduleMap[key];
2811  if(mod!=nullptr){
2812  mod->text=s;
2813  }
2814  else std::cout << "**************************error in SvgModuleMap **************";
2815 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:146
std::string text
Definition: TmModule.h:14
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::setTitle ( std::string  s)
inline
void TrackerMap::showPalette ( bool  printflag1)
inline

Definition at line 131 of file TrackerMap.h.

References printflag.

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

131 {printflag=printflag1;};
bool printflag
Definition: TrackerMap.h:165
double TrackerMap::xdpixel ( double  x)
inline

Definition at line 241 of file TrackerMap.h.

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

Referenced by drawModule().

241  {
242  double res;
243  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
244  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
245  return res;
246  }
double xmin
Definition: TrackerMap.h:495
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:512
double xmax
Definition: TrackerMap.h:495
double TrackerMap::xdpixelc ( double  x)
inline

Definition at line 261 of file TrackerMap.h.

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

Referenced by drawApvPair().

261  {
262  double res;
263  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE);
264  else res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE)+ix;
265  return res;
266  }
double xmin
Definition: TrackerMap.h:495
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:512
#define XFEDCSIZE
Definition: TrackerMap.h:65
double xmax
Definition: TrackerMap.h:495
double TrackerMap::xdpixelfec ( double  x)
inline

Definition at line 275 of file TrackerMap.h.

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

Referenced by drawCcu().

275  {
276  double res;
277  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
278  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
279  return res;
280  }
double xmin
Definition: TrackerMap.h:495
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:512
double xmax
Definition: TrackerMap.h:495
double TrackerMap::xdpixelpsu ( double  x)
inline

Definition at line 289 of file TrackerMap.h.

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

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

289  {
290  double res;
291  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XPSURSIZE);
292  else res= ((x-xmin)/(xmax-xmin)*XPSURSIZE)+ix;
293  return res;
294  }
double xmin
Definition: TrackerMap.h:495
#define XPSURSIZE
Definition: TrackerMap.h:50
Definition: Electron.h:6
bool saveAsSingleLayer
Definition: TrackerMap.h:512
double xmax
Definition: TrackerMap.h:495
double TrackerMap::ydpixel ( double  y)
inline

Definition at line 247 of file TrackerMap.h.

References iy, nlay, saveAsSingleLayer, xsize, ymax, ymin, and ysize.

Referenced by drawModule().

247  {
248  double res=0;
249  double y1;
250  y1 = (y-ymin)/(ymax-ymin);
251  if(nlay>30)
252  {
253  if(nlay <34) res= 2*ysize - (y1*2*ysize);
254  if(nlay==34) res= 2.4*ysize - (y1*2.4*ysize);
255  if(nlay>34) res= 2.5*ysize - (y1*2.5*ysize);
256  }
257  else res= xsize - (y1*xsize);
258  if(!saveAsSingleLayer) res=res+iy;
259  return res;
260  }
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:495
bool saveAsSingleLayer
Definition: TrackerMap.h:512
double ymin
Definition: TrackerMap.h:495
double TrackerMap::ydpixelc ( double  y)
inline

Definition at line 267 of file TrackerMap.h.

References iy, saveAsSingleLayer, YFEDCSIZE, ymax, and ymin.

Referenced by drawApvPair().

267  {
268  double res;
269  double y1;
270  y1 = (y-ymin)/(ymax-ymin);
271  if(saveAsSingleLayer)res= YFEDCSIZE - (y1*YFEDCSIZE);
272  else res= YFEDCSIZE - (y1*YFEDCSIZE)+iy;
273  return res;
274  }
#define YFEDCSIZE
Definition: TrackerMap.h:66
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:495
bool saveAsSingleLayer
Definition: TrackerMap.h:512
double ymin
Definition: TrackerMap.h:495
double TrackerMap::ydpixelfec ( double  y)
inline

Definition at line 281 of file TrackerMap.h.

References iy, saveAsSingleLayer, ymax, ymin, and ysize.

Referenced by drawCcu().

281  {
282  double res;
283  double y1;
284  y1 = (y-ymin)/(ymax-ymin);
285  if(saveAsSingleLayer)res= 2*ysize - (y1*2*ysize);
286  else res= 2*ysize - (y1*2*ysize)+iy;
287  return res;
288  }
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:495
bool saveAsSingleLayer
Definition: TrackerMap.h:512
double ymin
Definition: TrackerMap.h:495
double TrackerMap::ydpixelpsu ( double  y)
inline

Definition at line 295 of file TrackerMap.h.

References iy, saveAsSingleLayer, ymax, ymin, and YPSURSIZE.

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

295  {
296  double res;
297  double y1;
298  y1 = (y-ymin)/(ymax-ymin);
299  if(saveAsSingleLayer)res=YPSURSIZE - (y1*YPSURSIZE);
300  else res= YPSURSIZE - (y1*YPSURSIZE)+iy;
301  return res;
302  }
Definition: Electron.h:6
double ymax
Definition: TrackerMap.h:495
bool saveAsSingleLayer
Definition: TrackerMap.h:512
double ymin
Definition: TrackerMap.h:495
#define YPSURSIZE
Definition: TrackerMap.h:51

Member Data Documentation

bool TrackerMap::addPixelFlag
private

Definition at line 513 of file TrackerMap.h.

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

SvgApvPair TrackerMap::apvMap
ModApvPair TrackerMap::apvModuleMap

Definition at line 152 of file TrackerMap.h.

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

std::ifstream* TrackerMap::ccufile
protected

Definition at line 503 of file TrackerMap.h.

MapCcu TrackerMap::ccuMap
bool TrackerMap::enableFecProcessing

Definition at line 169 of file TrackerMap.h.

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

bool TrackerMap::enableFedProcessing

Definition at line 168 of file TrackerMap.h.

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

bool TrackerMap::enableHVProcessing

Definition at line 171 of file TrackerMap.h.

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

bool TrackerMap::enableLVProcessing

Definition at line 170 of file TrackerMap.h.

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

FecModule TrackerMap::fecModuleMap

Definition at line 159 of file TrackerMap.h.

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

SvgFed TrackerMap::fedMap

Definition at line 154 of file TrackerMap.h.

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

bool TrackerMap::firstcall
protected

Definition at line 498 of file TrackerMap.h.

Referenced by init().

int TrackerMap::firstcrate
protected

Definition at line 492 of file TrackerMap.h.

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

int TrackerMap::firstRing[43]
float TrackerMap::gmaxvalue
protected

Definition at line 504 of file TrackerMap.h.

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

float TrackerMap::gminvalue
protected

Definition at line 504 of file TrackerMap.h.

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

ImoduleMap TrackerMap::imoduleMap
std::string TrackerMap::infilename

Definition at line 176 of file TrackerMap.h.

Referenced by build(), and TrackerMap().

std::ifstream* TrackerMap::inputfile
protected

Definition at line 502 of file TrackerMap.h.

Referenced by load().

int TrackerMap::ix
protected
int TrackerMap::iy
protected
std::ifstream* TrackerMap::jsfile
protected

Definition at line 501 of file TrackerMap.h.

Referenced by print().

std::string TrackerMap::jsfilename

Definition at line 176 of file TrackerMap.h.

Referenced by print(), and TrackerMap().

std::string TrackerMap::jsPath

Definition at line 177 of file TrackerMap.h.

Referenced by findfile(), and TrackerMap().

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

Definition at line 516 of file TrackerMap.h.

Referenced by buildLegend().

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

Definition at line 517 of file TrackerMap.h.

Referenced by buildLegend().

float TrackerMap::maxvalue
protected
float TrackerMap::minvalue
protected
int TrackerMap::ncrates
protected

Definition at line 491 of file TrackerMap.h.

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

int TrackerMap::ndet

Definition at line 173 of file TrackerMap.h.

Referenced by init().

int TrackerMap::nfeccrates
protected

Definition at line 493 of file TrackerMap.h.

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

int TrackerMap::nlay
protected

Definition at line 488 of file TrackerMap.h.

Referenced by drawModule(), and ydpixel().

int TrackerMap::npart

Definition at line 174 of file TrackerMap.h.

Referenced by init().

int TrackerMap::npsuracks
protected
int TrackerMap::ntotRing[43]
int TrackerMap::number_modules
protected

Definition at line 506 of file TrackerMap.h.

Referenced by build().

float TrackerMap::oldz
private

Definition at line 511 of file TrackerMap.h.

bool TrackerMap::onlyPixelFlag
private

Definition at line 514 of file TrackerMap.h.

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

int TrackerMap::palette
bool TrackerMap::posrel
protected

Definition at line 497 of file TrackerMap.h.

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

bool TrackerMap::printflag
bool TrackerMap::psetAvailable

Definition at line 178 of file TrackerMap.h.

Referenced by TrackerMap().

MapPsu TrackerMap::psuMap
PsuModule TrackerMap::psuModuleMap
bool TrackerMap::saveAsSingleLayer
private
std::ofstream* TrackerMap::savefile
protected
bool TrackerMap::saveGeoTrackerMap

Definition at line 167 of file TrackerMap.h.

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

bool TrackerMap::saveWebInterface
SvgFed TrackerMap::slotMap

Definition at line 155 of file TrackerMap.h.

Referenced by save_as_fedtrackermap(), and TrackerMap().

SmoduleMap TrackerMap::smoduleMap
std::ofstream* TrackerMap::svgfile
protected

Definition at line 499 of file TrackerMap.h.

Referenced by print().

bool TrackerMap::temporary_file
protected
std::string TrackerMap::title
bool TrackerMap::tkMapLog
std::vector<TColor*> TrackerMap::vc
double TrackerMap::xmax
protected
double TrackerMap::xmin
protected
int TrackerMap::xsize
protected
double TrackerMap::ymax
protected
double TrackerMap::ymin
protected
int TrackerMap::ysize
protected