CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Attributes
TrackerMap Class Reference

#include <TrackerMap.h>

Inheritance diagram for TrackerMap:
SiPixelTrackerMap

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, ofstream *svgfile, bool usePsuValue)
 
void drawHV3 (int rack, int numcrate_inrack, bool print_total, TmPsu *psu, 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, 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)
 
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=YFEDOFFSET+(YFEDCSIZE+YFEDOFFSET)*NUMFEDCRATE_INROW+300, int height=XFEDOFFSET+(XFEDCSIZE+XFEDOFFSET)*NUMFEDCRATE_INCOLUMN+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=YPSUOFFSET+(YPSURSIZE+YPSUOFFSET)*NUMPSURACK_INROW+300, int height=XPSUOFFSET+(XPSURSIZE+XPSUOFFSET)*NUMPSURACK_INCOLUMN+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)
 
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 Attributes

bool addPixelFlag
 
float oldz
 
bool saveAsSingleLayer
 

Detailed Description

Definition at line 71 of file TrackerMap.h.

Member Typedef Documentation

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

Definition at line 151 of file TrackerMap.h.

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

Definition at line 140 of file TrackerMap.h.

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

Definition at line 149 of file TrackerMap.h.

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

Definition at line 153 of file TrackerMap.h.

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

Definition at line 144 of file TrackerMap.h.

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

Definition at line 155 of file TrackerMap.h.

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

Definition at line 138 of file TrackerMap.h.

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

Definition at line 142 of file TrackerMap.h.

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

Definition at line 146 of file TrackerMap.h.

Constructor & Destructor Documentation

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

Definition at line 411 of file TrackerMap.cc.

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

411  {
412  psetAvailable=false;
413  xsize=xsize1;ysize=ysize1;
414  title=s;
415  jsfilename="CommonTools/TrackerMap/data/trackermap.txt";
416  infilename="CommonTools/TrackerMap/data/tracker.dat";
417  saveWebInterface=false;
418  saveGeoTrackerMap=true;
419  tkMapLog=false;
420  jsPath="CommonTools/TrackerMap/data/";
421  enableFedProcessing=false;
422  enableFecProcessing=false;
423  enableLVProcessing=false;
424  enableHVProcessing=false;
425  saveAsSingleLayer=false;
426  init();
427 
428 }
bool tkMapLog
Definition: TrackerMap.h:165
bool psetAvailable
Definition: TrackerMap.h:171
bool saveGeoTrackerMap
Definition: TrackerMap.h:160
bool enableFecProcessing
Definition: TrackerMap.h:162
bool saveWebInterface
Definition: TrackerMap.h:159
std::string infilename
Definition: TrackerMap.h:169
bool enableFedProcessing
Definition: TrackerMap.h:161
std::string jsPath
Definition: TrackerMap.h:170
bool enableHVProcessing
Definition: TrackerMap.h:164
bool saveAsSingleLayer
Definition: TrackerMap.h:505
void init()
Definition: TrackerMap.cc:438
std::string title
Definition: TrackerMap.h:168
bool enableLVProcessing
Definition: TrackerMap.h:163
std::string jsfilename
Definition: TrackerMap.h:169
TrackerMap::TrackerMap ( const edm::ParameterSet iConfig)

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

391  {
392  psetAvailable=true;
393  xsize=340;ysize=200;
394  title=" ";
395  jsfilename="CommonTools/TrackerMap/data/trackermap.txt";
396  infilename="CommonTools/TrackerMap/data/tracker.dat";
398  saveAsSingleLayer=false;
399  tkMapLog = tkmapPset.getUntrackedParameter<bool>("logScale",false);
400  saveWebInterface=tkmapPset.getUntrackedParameter<bool>("saveWebInterface",false);
401  saveGeoTrackerMap=tkmapPset.getUntrackedParameter<bool>("saveGeoTrackerMap",true);
402  // if(tkmapPset.exists("trackermaptxtPath")){
403  jsfilename=tkmapPset.getUntrackedParameter<std::string>("trackermaptxtPath","CommonTools/TrackerMap/data/")+"trackermap.txt";
404  std::cout << jsfilename << std::endl;
405  infilename=tkmapPset.getUntrackedParameter<std::string>("trackerdatPath","CommonTools/TrackerMap/data/")+"tracker.dat";
406  std::cout << infilename << std::endl;
407  // } else std::cout << "no parameters found" << std::endl;
408  init();
409 }
bool tkMapLog
Definition: TrackerMap.h:165
bool psetAvailable
Definition: TrackerMap.h:171
bool saveGeoTrackerMap
Definition: TrackerMap.h:160
bool saveWebInterface
Definition: TrackerMap.h:159
std::string infilename
Definition: TrackerMap.h:169
bool enableFedProcessing
Definition: TrackerMap.h:161
bool saveAsSingleLayer
Definition: TrackerMap.h:505
void init()
Definition: TrackerMap.cc:438
int firstcrate
Definition: TrackerMap.h:485
std::string title
Definition: TrackerMap.h:168
tuple cout
Definition: gather_cfg.py:121
std::string jsfilename
Definition: TrackerMap.h:169
TrackerMap::TrackerMap ( const edm::ParameterSet iConfig,
const SiStripFedCabling tkFed 
)

Definition at line 31 of file TrackerMap.cc.

References apvMap, apvModuleMap, dataDML::branchinfo, TmModule::capvids, TmModule::CcuId, ccuMap, TmCcu::cmodid, TmPsu::cmodid_HV2, TmPsu::cmodid_HV3, TmPsu::cmodid_LV, SiStripFedCabling::connections(), gather_cfg::cout, TmApvPair::crate, SiStripFecCabling::crates(), enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, fedMap, SiStripFedCabling::feds(), 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, combine::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, pos, psetAvailable, TmPsu::psId, TmModule::PsuId, TmModule::psuIdex, psuMap, psuModuleMap, run_regression::ret, 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.

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

default destructor

Definition at line 488 of file TrackerMap.cc.

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

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

Member Function Documentation

void TrackerMap::addPixel ( bool  addPixelfl)
inline

Definition at line 129 of file TrackerMap.h.

References addPixelFlag.

Referenced by DetIdSelectorTest::DetIdSelectorTest().

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

Definition at line 2787 of file TrackerMap.cc.

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

Referenced by init().

2787  {
2788  // ifstream* infile;
2789 
2790  int nmods, pix_sil, fow_bar, ring, nmod, layer;
2791  unsigned int idex;
2792  float posx, posy, posz, length, width, thickness, widthAtHalfLength;
2793  int iModule=0,old_layer=0, ntotMod =0;
2794  std::string name,dummys;
2795  ifstream infile(edm::FileInPath(infilename).fullPath().c_str(),std::ios::in);
2796  while(!infile.eof()) {
2797  infile >> nmods >> pix_sil >> fow_bar >> layer >> ring >> nmod >> posx >> posy
2798  >> posz>> length >> width >> thickness
2799  >> widthAtHalfLength >> idex ;
2800  getline(infile,dummys); //necessary to reach end of record
2801  getline(infile,name);
2802  if(old_layer!=layer){old_layer=layer;iModule=0;}
2803  iModule++;
2804  ntotMod++;
2805  int key=layer*100000+ring*1000+nmod;
2806  TmModule * mod = smoduleMap[key];
2807 
2808  imoduleMap[idex]=mod;
2809 
2810  if(mod==0) std::cout << "error in module "<<key <<std::endl;
2811  else
2812  {
2813  mod->posx = posx;
2814  mod->posy = posy;
2815  mod->setUsed();
2816  mod->value=0;
2817  mod->count=0;
2818  mod->posz = posz;
2819  mod->length = length;
2820  mod->width = width;
2821  mod->thickness = thickness;
2822  mod->widthAtHalfLength = widthAtHalfLength;
2823  mod->idex = idex;
2824  mod->name = name;
2825  }
2826  }
2827  infile.close();
2828  number_modules = ntotMod-1;
2829 }
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
void setUsed()
Definition: TmModule.h:25
float posz
Definition: TmModule.h:9
int number_modules
Definition: TrackerMap.h:499
std::string infilename
Definition: TrackerMap.h:169
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
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
list key
Definition: combine.py:13
list infile
Definition: EdgesToViz.py:90
tuple cout
Definition: gather_cfg.py:121
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
void TrackerMap::defcwindow ( int  num_crate)
inline

Definition at line 297 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().

297  {
298  // ncrate = num_crate;
299  int xoffset=XFEDOFFSET;
300  int yoffset=YFEDOFFSET;
302 
303  ix = xoffset+((NUMFEDCRATE_INCOLUMN-1)-((num_crate-1)%NUMFEDCRATE_INCOLUMN))*(XFEDCSIZE+XFEDOFFSET);
304  iy = yoffset+((num_crate-1)/NUMFEDCRATE_INCOLUMN)*(YFEDCSIZE+YFEDOFFSET);
305  }
#define NUMFEDCRATE_INCOLUMN
Definition: TrackerMap.h:56
#define YFEDOFFSET
Definition: TrackerMap.h:63
double xmin
Definition: TrackerMap.h:488
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:50
#define YFEDCSIZE
Definition: TrackerMap.h:61
double ymax
Definition: TrackerMap.h:488
#define NUMFED_INCOLUMN
Definition: TrackerMap.h:52
#define XFEDCSIZE
Definition: TrackerMap.h:60
double xmax
Definition: TrackerMap.h:488
double ymin
Definition: TrackerMap.h:488
#define NUMFED_INROW
Definition: TrackerMap.h:53
#define XFEDOFFSET
Definition: TrackerMap.h:62
#define NUMFEDCH_INROW
Definition: TrackerMap.h:51
void TrackerMap::deffecwindow ( int  num_crate)
inline

Definition at line 306 of file TrackerMap.h.

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

Referenced by save_as_fectrackermap().

306  {
307  // ncrate = num_crate;
308  int xoffset=xsize/3;
309  int yoffset=2*ysize;
310  xmin=-1.;xmax=37.; ymin = -10.; ymax=40.;
311  if(num_crate==1||num_crate==3)ix = xoffset+xsize*2;
312  if(num_crate==2||num_crate==4)ix = xoffset;
313  iy = yoffset+((num_crate-1)/2)*ysize*4;
314  }
double xmin
Definition: TrackerMap.h:488
double ymax
Definition: TrackerMap.h:488
double xmax
Definition: TrackerMap.h:488
double ymin
Definition: TrackerMap.h:488
void TrackerMap::defpsuwindow ( int  num_rack)
inline

Definition at line 315 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().

315  {
316  // nrack = num_rack;
317  int xoffset=XPSUOFFSET;
318  int yoffset=YPSUOFFSET;
319  xmin=0; xmax=(NUMPSUCRATE_INCOLUMN)*1.5;
321 
322  ix = xoffset+((NUMPSURACK_INCOLUMN-1)-((num_rack-1)%NUMPSURACK_INCOLUMN))*(XPSURSIZE+XPSUOFFSET);
323  iy = yoffset+((num_rack-1)/NUMPSURACK_INCOLUMN)*(YPSURSIZE+YPSUOFFSET);
324  }
#define NUMPSURACK_INCOLUMN
Definition: TrackerMap.h:43
double xmin
Definition: TrackerMap.h:488
#define XPSURSIZE
Definition: TrackerMap.h:45
double ymax
Definition: TrackerMap.h:488
double xmax
Definition: TrackerMap.h:488
double ymin
Definition: TrackerMap.h:488
#define YPSUOFFSET
Definition: TrackerMap.h:48
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:42
#define YPSURSIZE
Definition: TrackerMap.h:46
#define XPSUOFFSET
Definition: TrackerMap.h:47
#define NUMPSUCH_INROW
Definition: TrackerMap.h:41
void TrackerMap::defwindow ( int  num_lay)
inline

Definition at line 327 of file TrackerMap.h.

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

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

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

Definition at line 922 of file TrackerMap.cc.

References TmApvPair::blue, TmModule::blue, create_public_lumi_plots::color, TmApvPair::count, TmModule::count, getcolor(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmModule::getKey(), TmApvPair::green, TmModule::green, cmsRelvalreport::green(), TmApvPair::idex, TmModule::idex, j, gen::k, TmApvPair::mod, TmModule::name, np, NUMFED_INCOLUMN, NUMFED_INROW, NUMFEDCH_INCOLUMN, NUMFEDCH_INROW, palette, TmApvPair::red, TmModule::red, cmsRelvalreport::red(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmApvPair::value, TmModule::value, xdpixelc(), and ydpixelc().

Referenced by save_as_fedtrackermap().

923 {
924  double xp[4],yp[4];
925  int color;
926  int green = 0;
927  int red = 0;
928  int blue = 0;
929  double xd[4],yd[4];
930  int np = 4;
931  double boxinitx=0., boxinity=0.;
932  double dx=.9,dy=.9;
933  /*
934  int numfedch_incolumn = 12;
935  int numfedch_inrow = 8;
936  int numfed_incolumn = 6;
937  int numfed_inrow = 4;
938  */
939  boxinitx=boxinitx+(NUMFED_INCOLUMN-1-(numfed_incrate-1)/NUMFED_INROW)*(NUMFEDCH_INCOLUMN+2);
940  boxinity=boxinity+(NUMFED_INROW-1-(numfed_incrate-1)%NUMFED_INROW)*(NUMFEDCH_INROW+1);
941  boxinity=boxinity+NUMFEDCH_INROW-(apvPair->getFedCh()/NUMFEDCH_INCOLUMN);
942  boxinitx = boxinitx+NUMFEDCH_INCOLUMN-(int)(apvPair->getFedCh()%NUMFEDCH_INCOLUMN);
943  // std::cout << crate << " " << numfed_incrate << " " << apvPair->getFedCh()<<" "<<boxinitx<< " " << boxinity << std::endl; ;
944  xp[0]=boxinitx;yp[0]=boxinity;
945  xp[1]=boxinitx+dx;yp[1]=boxinity;
946  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
947  xp[3]=boxinitx;yp[3]=boxinity + dy;
948  for(int j=0;j<4;j++){
949  xd[j]=xdpixelc(xp[j]);yd[j]=ydpixelc(yp[j]);
950  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
951  }
952 
953  char buffer [20];
954  sprintf(buffer,"%X",apvPair->mod->idex);
955  std::string s = apvPair->mod->name;
956  s.erase(s.begin()+s.find("connected"),s.end());
957 
958  if(useApvPairValue){
959  if(apvPair->red < 0){ //use count to compute color
960  if(apvPair->count > 0) {
961  color = getcolor(apvPair->value,palette);
962  red=(color>>16)&0xFF;
963  green=(color>>8)&0xFF;
964  blue=(color)&0xFF;
965  if(!print_total)apvPair->value=apvPair->value*apvPair->count;//restore mod->value
966  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
967  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=\"";
968  } else {
969  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
970  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=\"";
971  }
972  } else {//color defined with fillc
973  if(apvPair->red>255)apvPair->red=255;
974  if(apvPair->green>255)apvPair->green=255;
975  if(apvPair->blue>255)apvPair->blue=255;
976  if(temporary_file)*svgfile << apvPair->red << " " << apvPair->green << " " << apvPair->blue << " ";
977  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=\"";
978  }
979  }else{
980  if(apvPair->mod->red < 0){ //use count to compute color
981  if(apvPair->mod->count > 0) {
982  color = getcolor(apvPair->mod->value,palette);
983  red=(color>>16)&0xFF;
984  green=(color>>8)&0xFF;
985  blue=(color)&0xFF;
986  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
987  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=\"";
988  } else {
989  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
990  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=\"";
991  }
992  } else {//color defined with fillc
993  if(apvPair->mod->red>255)apvPair->mod->red=255;
994  if(apvPair->mod->green>255)apvPair->mod->green=255;
995  if(apvPair->mod->blue>255)apvPair->mod->blue=255;
996  if(temporary_file)*svgfile << apvPair->mod->red << " " << apvPair->mod->green << " " << apvPair->mod->blue << " ";
997  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=\"";
998  }
999  }
1000  if(temporary_file)*svgfile << np << " ";
1001  for(int k=0;k<np;k++){
1002  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1003  else *svgfile << xd[k] << "," << yd[k] << " " ;
1004  }
1005  if(temporary_file)*svgfile << std::endl;
1006  else *svgfile <<"\" />" <<std::endl;
1007 }
TmModule * mod
Definition: TmApvPair.h:16
double ydpixelc(double y)
Definition: TrackerMap.h:260
float value
Definition: TmModule.h:12
int green
Definition: TmApvPair.h:10
#define NUMFEDCH_INCOLUMN
Definition: TrackerMap.h:50
double xdpixelc(double x)
Definition: TrackerMap.h:254
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:52
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:500
std::ofstream * svgfile
Definition: TrackerMap.h:492
int blue
Definition: TmApvPair.h:10
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2830
int count
Definition: TmModule.h:13
int k[5][pyjets_maxn]
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:53
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:51
void TrackerMap::drawCcu ( int  crate,
int  numfed_incrate,
bool  total,
TmCcu ccu,
std::ofstream *  file,
bool  useCcuValue 
)

Definition at line 1008 of file TrackerMap.cc.

References TmCcu::blue, TmCcu::cmodid, create_public_lumi_plots::color, TmCcu::count, TmCcu::getCcuRing(), TmCcu::getCcuSlot(), getcolor(), TmCcu::green, cmsRelvalreport::green(), TmCcu::idex, j, gen::k, TmCcu::layer, TmCcu::mpos, np, palette, TmCcu::red, cmsRelvalreport::red(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmCcu::value, xdpixelfec(), and ydpixelfec().

Referenced by save_as_fectrackermap().

1009 {
1010  double xp[4],yp[4];
1011  int color;
1012  int green = 0;
1013  int red = 0;
1014  int blue = 0;
1015  double xd[4],yd[4];
1016  int np = 4;
1017  double boxinitx=0., boxinity=0.;
1018  double dx=.9,dy=.9;
1019  int numccu_incolumn = 8;
1020  int numccu_inrow = 15;
1021  int numfec_incolumn = 5;
1022  int numfec_inrow = 4;
1023  boxinitx=boxinitx+(numfec_incolumn-(numfec_incrate-1)/numfec_inrow)*14.;
1024  boxinity=boxinity+(numfec_inrow-(numfec_incrate-1)%numfec_inrow)*16.;
1025  boxinity=boxinity+numccu_inrow-ccu->mpos;
1026  boxinitx = boxinitx+numccu_incolumn-(int)(ccu->getCcuRing()%numccu_incolumn);
1027  //std::cout << crate << " " << numfec_incrate << " " << ccu->getCcuRing()<<" "<<ccu->mpos<<" "<<boxinitx<< " " << boxinity << std::endl; ;
1028  xp[0]=boxinitx;yp[0]=boxinity;
1029  xp[1]=boxinitx+dx;yp[1]=boxinity;
1030  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1031  xp[3]=boxinitx;yp[3]=boxinity + dy;
1032  for(int j=0;j<4;j++){
1033  xd[j]=xdpixelfec(xp[j]);yd[j]=ydpixelfec(yp[j]);
1034  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1035  }
1036 
1037  char buffer [20];
1038  sprintf(buffer,"%X",ccu->idex);
1039  //sprintf(buffer,"%X",ccu->mod->idex);
1040  //std::string s = ccu->mod->name;
1041  std::string s = ccu->text;
1042  s.erase(s.begin()+s.find("connected"),s.end());
1043 
1044  if(ccu->red < 0){ //use count to compute color
1045  if(ccu->count > 0) {
1046  color = getcolor(ccu->value,palette);
1047  red=(color>>16)&0xFF;
1048  green=(color>>8)&0xFF;
1049  blue=(color)&0xFF;
1050  if(!print_total)ccu->value=ccu->value*ccu->count;//restore mod->value
1051  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
1052  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=\"";
1053  } else {
1054  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1055  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=\"";
1056  }
1057  } else {//color defined with fillc
1058  if(ccu->red>255)ccu->red=255;
1059  if(ccu->green>255)ccu->green=255;
1060  if(ccu->blue>255)ccu->blue=255;
1061  if(temporary_file)*svgfile << ccu->red << " " << ccu->green << " " << ccu->blue << " ";
1062  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=\"";
1063  }
1064 if(temporary_file)*svgfile << np << " ";
1065 for(int k=0;k<np;k++){
1066  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1067  else *svgfile << xd[k] << "," << yd[k] << " " ;
1068 }
1069 if(temporary_file)*svgfile << std::endl;
1070 else *svgfile <<"\" />" <<std::endl;
1071 
1072 }
double ydpixelfec(double y)
Definition: TrackerMap.h:274
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:268
int getCcuSlot()
Definition: TmCcu.h:20
int np
Definition: AMPTWrapper.h:33
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:500
std::ofstream * svgfile
Definition: TrackerMap.h:492
int green
Definition: TmCcu.h:9
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2830
int k[5][pyjets_maxn]
int mpos
Definition: TmCcu.h:18
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 1150 of file TrackerMap.cc.

References TmPsu::blueHV2, TmPsu::cmodid_HV2, create_public_lumi_plots::color, TmPsu::countHV2, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::greenHV2, TmPsu::idex, j, 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().

1151 {
1152  double xp[4],yp[4];
1153  int color;
1154  int greenHV2 = 0;
1155  int redHV2 = 0;
1156  int blueHV2 = 0;
1157  double xd[4],yd[4];
1158  int np = 4;
1159  double boxinitx=35, boxinity=12;
1160  double dx=1.1,dy=1.3;
1161 
1162  boxinitx= boxinitx+(5 - psu->getPsuCrate())*5;
1163  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1164 
1165  xp[0]=boxinitx;yp[0]=boxinity;
1166  xp[1]=boxinitx+dx;yp[1]=boxinity;
1167  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1168  xp[3]=boxinitx;yp[3]=boxinity + dy;
1169 
1170 
1171  for(int j=0;j<4;j++){
1172  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1173  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1174  }
1175 
1176  char buffer [20];
1177  sprintf(buffer,"%X",psu->idex);
1178  std::string s = psu->textHV2;
1179  s.erase(s.begin()+s.find("connected"),s.end());
1180 
1181  if(psu->redHV2 < 0){ //use count to compute color
1182 
1183  if(psu->valueHV2 > 0){
1184  color = getcolor(psu->valueHV2,palette);
1185  redHV2=(color>>16)&0xFF;
1186  greenHV2=(color>>8)&0xFF;
1187  blueHV2=(color)&0xFF;
1188  if(!print_total)psu->valueHV2=psu->valueHV2*psu->countHV2;//restore mod->value
1189  if(temporary_file)*svgfile << redHV2 << " " << greenHV2 << " " << blueHV2 << " ";
1190  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=\"";
1191  }
1192  else{
1193  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1194  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=\"";
1195  }
1196  }
1197 
1198  else {//color defined with fillc
1199  if(psu->redHV2>255)psu->redHV2=255;
1200  if(psu->greenHV2>255)psu->greenHV2=255;
1201  if(psu->blueHV2>255)psu->blueHV2=255;
1202  if(temporary_file)*svgfile << psu->redHV2 << " " << psu->greenHV2 << " " << psu->blueHV2 << " ";
1203  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=\"";
1204  }
1205 
1206 if(temporary_file)*svgfile << np << " ";
1207 for(int k=0;k<np;k++){
1208  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1209  else *svgfile << xd[k] << "," << yd[k] << " " ;
1210 }
1211 if(temporary_file)*svgfile << std::endl;
1212 else *svgfile <<"\" />" <<std::endl;
1213 
1214 }
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:282
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:500
std::ofstream * svgfile
Definition: TrackerMap.h:492
int greenHV2
Definition: TmPsu.h:21
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2830
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:288
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 1217 of file TrackerMap.cc.

References TmPsu::blueHV3, TmPsu::cmodid_HV3, create_public_lumi_plots::color, TmPsu::countHV3, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::greenHV3, TmPsu::idex, j, 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().

1218 {
1219  double xp[4],yp[4];
1220  int color;
1221  int greenHV3 = 0;
1222  int redHV3 = 0;
1223  int blueHV3 = 0;
1224  double xd[4],yd[4];
1225  int np = 4;
1226  double boxinitx=36.5, boxinity=12;
1227  double dx=1.1,dy=1.3;
1228 
1229  boxinitx= boxinitx+(5 - psu->getPsuCrate())*5;
1230  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1231 
1232  xp[0]=boxinitx;yp[0]=boxinity;
1233  xp[1]=boxinitx+dx;yp[1]=boxinity;
1234  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1235  xp[3]=boxinitx;yp[3]=boxinity + dy;
1236 
1237 
1238  for(int j=0;j<4;j++){
1239  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1240  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1241  }
1242 
1243  char buffer [20];
1244  sprintf(buffer,"%X",psu->idex);
1245  std::string s = psu->textHV3;
1246  s.erase(s.begin()+s.find("connected"),s.end());
1247 
1248  if(psu->redHV3 < 0){ //use count to compute color
1249  if(psu->valueHV3 > 0){
1250  color = getcolor(psu->valueHV3,palette);
1251  redHV3=(color>>16)&0xFF;
1252  greenHV3=(color>>8)&0xFF;
1253  blueHV3=(color)&0xFF;
1254  if(!print_total)psu->valueHV3=psu->valueHV3*psu->countHV3;//restore mod->value
1255  if(temporary_file)*svgfile << redHV3 << " " << greenHV3 << " " << blueHV3 << " ";
1256  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=\"";
1257  }
1258  else{
1259  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1260  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=\"";
1261  }
1262  }
1263 
1264  else {//color defined with fillc
1265  if(psu->redHV3>255)psu->redHV3=255;
1266  if(psu->greenHV3>255)psu->greenHV3=255;
1267  if(psu->blueHV3>255)psu->blueHV3=255;
1268  if(temporary_file)*svgfile << psu->redHV3 << " " << psu->greenHV3 << " " << psu->blueHV3 << " ";
1269  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=\"";
1270  }
1271 
1272 if(temporary_file)*svgfile << np << " ";
1273 for(int k=0;k<np;k++){
1274  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1275  else *svgfile << xd[k] << "," << yd[k] << " " ;
1276 }
1277 if(temporary_file)*svgfile << std::endl;
1278 else *svgfile <<"\" />" <<std::endl;
1279 
1280 }
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:282
int blueHV3
Definition: TmPsu.h:22
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:500
std::ofstream * svgfile
Definition: TrackerMap.h:492
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2830
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:288
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::drawModule ( TmModule mod,
int  key,
int  layer,
bool  total,
std::ofstream *  file 
)

Definition at line 535 of file TrackerMap.cc.

References TmModule::blue, TmModule::capvids, TmModule::CcuId, create_public_lumi_plots::color, funct::cos(), TmModule::count, getcolor(), TmModule::green, cmsRelvalreport::green(), TmModule::HVchannel, TmModule::idex, TmModule::idModule, isRingStereo(), j, 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, cmsRelvalreport::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().

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

Definition at line 2479 of file TrackerMap.cc.

References create_public_lumi_plots::color, gather_cfg::cout, getcolor(), cmsRelvalreport::green(), i, maxvalue, minvalue, palette, cmsRelvalreport::red(), relval_parameters_module::step, temporary_file, tkMapLog, and create_public_lumi_plots::width.

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

2479  {
2480  std::cout << "preparing the palette" << std::endl;
2481  int color,red, green, blue;
2482  float val=minvalue;
2483  int paletteLength = 250;
2484  int width=50*(yoffset-40)/1500;
2485  float dval = (maxvalue-minvalue)/(float)paletteLength;
2486  bool rtkMapLog = tkMapLog; if (tkMapLog)tkMapLog=false;
2487  float step = float(yoffset-40)/float(paletteLength);
2488  for(int i=1;i<paletteLength+1;i++){
2489  color = getcolor(val,palette);
2490  red=(color>>16)&0xFF;
2491  green=(color>>8)&0xFF;
2492  blue=(color)&0xFF;
2493  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" />\n";
2494  // else *svgfile << red << " " << green << " " << blue << " 4 " << (6*i)+40 << " 3010. " <<//
2495  // (6*i)+40 << " 3060. " <<//
2496  // (6*(i-1))+40 << " 3060. " <<//
2497  // (6*(i-1))+40 <<" 3010. " << std::endl; //
2498 
2499  // if(i%50 == 0){
2500  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
2501  // if(i%50==0&&!temporary_file)*svgfile << " <svg:text class=\"normalText\" x=\"3060\" y=\""<<(1560-6*i)<<"\">" <<val<<"</svg:text>"<<std::endl;
2502 
2503  if(!temporary_file)*svgfile <<"<svg:rect x=\"3610\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" />\n";
2504  else *svgfile << red << " " << green << " " << blue << " 4 " << int(step*i)+34 << " " << xoffset-width << ". " <<//
2505  int(step*i)+34 << " " << xoffset << ". " <<//
2506  int(step*(i-1))+34 << " " << xoffset << ". " <<//
2507  int(step*(i-1))+34 << " " << xoffset-width << ". " << std::endl; //
2508 
2509  if(i%50 == 0){
2510  if(!temporary_file)*svgfile <<"<svg:rect x=\"3610\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
2511  if(i%50==0&&!temporary_file)*svgfile << " <svg:text class=\"normalText\" x=\"3660\" y=\""<<(1560-6*i)<<"\">" <<val<<"</svg:text>"<<std::endl;
2512  }
2513  val = val + dval;
2514  }
2515  tkMapLog=rtkMapLog;
2516 }
bool tkMapLog
Definition: TrackerMap.h:165
int i
Definition: DBlmapReader.cc:9
float minvalue
Definition: TrackerMap.h:498
bool temporary_file
Definition: TrackerMap.h:500
std::ofstream * svgfile
Definition: TrackerMap.h:492
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2830
float maxvalue
Definition: TrackerMap.h:498
tuple cout
Definition: gather_cfg.py:121
void TrackerMap::drawPsu ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1073 of file TrackerMap.cc.

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

Referenced by save_as_psutrackermap().

1074 {
1075  double xp[4],yp[4];
1076  int color;
1077  int green = 0;
1078  int red = 0;
1079  int blue = 0;
1080  double xd[4],yd[4];
1081  int np = 4;
1082  double boxinitx=0., boxinity=0.;
1083  double dx=.9,dy=.9;
1084 
1085  boxinitx=boxinitx+(NUMPSUCRATE_INCOLUMN-psu->getPsuCrate())*1.5;
1086  boxinity=boxinity+(NUMPSUCH_INROW-psu->getPsuBoard());
1087 
1088  xp[0]=boxinitx;yp[0]=boxinity;
1089  xp[1]=boxinitx+dx;yp[1]=boxinity;
1090  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1091  xp[3]=boxinitx;yp[3]=boxinity + dy;
1092 
1093 
1094  for(int j=0;j<4;j++){
1095  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1096  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1097  }
1098 
1099  // lines needed to prepare the clickable maps: understand why I get twice the full list of channels (HV1 and HV0?)
1100  /*
1101  double scalex=2695./2700.;
1102  double scaley=1520./1550.;
1103  std::cout << "<area shape=\"rect\" coords=\" "
1104  << int(scalex*yd[2]) << "," << int(1520-scaley*xd[2])
1105  << "," << int(scalex*yd[0]) << "," << int(1520-scaley*xd[0])
1106  << "\" title=\" " << psu->psId << "\" /> " << std::endl;
1107  */
1108  //
1109 
1110  char buffer [20];
1111  sprintf(buffer,"%X",psu->idex);
1112  std::string s = psu->text;
1113  s.erase(s.begin()+s.find("connected"),s.end());
1114 
1115  if(psu->red < 0){ //use count to compute color
1116  if(psu->count > 0){
1117  color = getcolor(psu->value,palette);
1118  red=(color>>16)&0xFF;
1119  green=(color>>8)&0xFF;
1120  blue=(color)&0xFF;
1121  if(!print_total)psu->value=psu->value*psu->count;//restore mod->value
1122  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
1123  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=\"";
1124  }
1125  else{
1126 
1127  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1128  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=\"";
1129  }
1130  }
1131 
1132  else {//color defined with fillc
1133  if(psu->red>255)psu->red=255;
1134  if(psu->green>255)psu->green=255;
1135  if(psu->blue>255)psu->blue=255;
1136  if(temporary_file)*svgfile << psu->red << " " << psu->green << " " << psu->blue << " ";
1137  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=\"";
1138  }
1139 
1140 if(temporary_file)*svgfile << np << " ";
1141 for(int k=0;k<np;k++){
1142  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1143  else *svgfile << xd[k] << "," << yd[k] << " " ;
1144 }
1145 if(temporary_file)*svgfile << std::endl;
1146 else *svgfile <<"\" />" <<std::endl;
1147 
1148 }
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:282
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:500
std::ofstream * svgfile
Definition: TrackerMap.h:492
int green
Definition: TmPsu.h:20
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2830
int k[5][pyjets_maxn]
#define NUMPSUCRATE_INCOLUMN
Definition: TrackerMap.h:42
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:41
double ydpixelpsu(double y)
Definition: TrackerMap.h:288
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::fill ( int  layer,
int  ring,
int  nmod,
float  x 
)

Definition at line 2756 of file TrackerMap.cc.

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

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

2756  {
2757 
2758  int key = layer*100000+ring*1000+nmod;
2759  TmModule * mod = smoduleMap[key];
2760  if(mod!=0){
2761  mod->value=mod->value+qty;
2762  mod->count++;
2763  }
2764  else std::cout << "**************************error in SvgModuleMap **************";
2765 }
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
int count
Definition: TmModule.h:13
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill ( int  idmod,
float  qty 
)

Definition at line 2736 of file TrackerMap.cc.

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

2736  {
2737 
2738  TmModule * mod = imoduleMap[idmod];
2739  if(mod!=0){
2740  mod->value=mod->value+qty;
2741  mod->count++;
2742  return;
2743  }else{
2744  TmModule * mod1 = imoduleMap[idmod+1];
2745  TmModule * mod2 = imoduleMap[idmod+2];
2746  if(mod1!=0 && mod2!=0){
2747  mod1->value=mod1->value+qty;
2748  mod1->count++;
2749  mod2->value=mod2->value+qty;
2750  mod2->count++;
2751  return;
2752  }}
2753  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2754 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
int count
Definition: TmModule.h:13
tuple cout
Definition: gather_cfg.py:121
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill_all_blank ( )

Definition at line 2719 of file TrackerMap.cc.

References fill_current_val(), and imoduleMap.

Referenced by SiStripTrackerMapCreator::create().

2719  {
2720 
2721  std::map<const int , TmModule *>::iterator imod;
2722  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2723  fill_current_val(imod->first,0);
2724  }
2725 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:2729
void TrackerMap::fill_current_val ( int  idmod,
float  current_val 
)

Definition at line 2729 of file TrackerMap.cc.

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

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

2729  {
2730 
2731  TmModule * mod = imoduleMap[idmod];
2732  if(mod!=0) {mod->value=current_val; mod->count=1; mod->red=-1;}
2733  else std::cout << "**error in fill_current_val method ***module "<<idmod<<std::endl;
2734 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
int count
Definition: TmModule.h:13
int red
Definition: TmModule.h:11
tuple cout
Definition: gather_cfg.py:121
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 2544 of file TrackerMap.cc.

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

2545 {
2546  int key = fedId*1000+fedCh;
2547  TmApvPair* apvpair = apvMap[key];
2548 
2549  if(apvpair!=0) {apvpair->value=current_val; apvpair->count=1; apvpair->red=-1;}
2550  else
2551  std::cout << "*** error in FedTrackerMap fill_current_val method ***";
2552 }
int red
Definition: TmApvPair.h:10
int count
Definition: TmApvPair.h:13
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:143
tuple cout
Definition: gather_cfg.py:121
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
float  qty 
)

Definition at line 2568 of file TrackerMap.cc.

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

2569 {
2570  int key =crate*10000000+slot*100000+ring*1000+addr;
2571  TmCcu *ccu = ccuMap[key];
2572  if(ccu!=0){
2573  ccu->count++; ccu->value=ccu->value+qty;
2574  return;
2575 
2576  }
2577 
2578  std::cout << "*** error in FecTrackerMap fill by module method ***";
2579  }
MapCcu ccuMap
Definition: TrackerMap.h:150
int count
Definition: TmCcu.h:12
float value
Definition: TmCcu.h:10
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
Definition: TmCcu.h:5
void TrackerMap::fill_fed_channel ( int  fedId,
int  fedCh,
float  qty 
)

Definition at line 2677 of file TrackerMap.cc.

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

2678 {
2679  int key = fedId*1000+fedCh;
2680  TmApvPair* apvpair = apvMap[key];
2681  if(apvpair!=0){
2682  apvpair->value=apvpair->value+qty;
2683  apvpair->count++;
2684  return;
2685  }
2686  std::cout << "*** error inFedTrackerMap fill method ***";
2687 }
int count
Definition: TmApvPair.h:13
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:143
tuple cout
Definition: gather_cfg.py:121
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fed_channel ( int  modId,
float  qty 
)

Definition at line 2529 of file TrackerMap.cc.

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

2530 {
2531  std::multimap<const int, TmApvPair*>::iterator pos;
2532  for (pos = apvModuleMap.lower_bound(idmod);
2533  pos != apvModuleMap.upper_bound(idmod); ++pos) {
2534  TmApvPair* apvpair = pos->second;
2535  if(apvpair!=0){
2536  apvpair->value=apvpair->value+qty;
2537  apvpair->count++;
2538  }
2539  }
2540  return;
2541  std::cout << "*** error in FedTrackerMap fill by module method ***";
2542  }
ModApvPair apvModuleMap
Definition: TrackerMap.h:145
int count
Definition: TmApvPair.h:13
tuple cout
Definition: gather_cfg.py:121
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_hv_channel2 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2638 of file TrackerMap.cc.

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

2639 {
2640  int key = rack*1000+crate*100+board;
2641  TmPsu *psu = psuMap[key];
2642  if(psu!=0){
2643  psu->countHV2++; psu->valueHV2=psu->valueHV2+qty;
2644  return;
2645 
2646  }
2647 
2648  std::cout << "*** error in HVTrackerMap fill by module method ***";
2649  }
int countHV2
Definition: TmPsu.h:27
float valueHV2
Definition: TmPsu.h:25
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
MapPsu psuMap
Definition: TrackerMap.h:154
Definition: TmPsu.h:6
void TrackerMap::fill_hv_channel3 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2650 of file TrackerMap.cc.

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

2651 {
2652  int key = rack*1000+crate*100+board;
2653  TmPsu *psu = psuMap[key];
2654  if(psu!=0){
2655  psu->countHV3++; psu->valueHV3=psu->valueHV3+qty;
2656  return;
2657 
2658  }
2659 
2660  std::cout << "*** error in HVTrackerMap fill by module method ***";
2661  }
list key
Definition: combine.py:13
int countHV3
Definition: TmPsu.h:28
tuple cout
Definition: gather_cfg.py:121
float valueHV3
Definition: TmPsu.h:24
MapPsu psuMap
Definition: TrackerMap.h:154
Definition: TmPsu.h:6
void TrackerMap::fill_lv_channel ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2597 of file TrackerMap.cc.

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

2598 {
2599  int key = rack*1000+crate*100+board;
2600  TmPsu *psu = psuMap[key];
2601  if(psu!=0){
2602  psu->count++; psu->value=psu->value+qty;
2603  return;
2604 
2605  }
2606 
2607  std::cout << "*** error in LVTrackerMap fill by module method ***";
2608  }
int count
Definition: TmPsu.h:26
float value
Definition: TmPsu.h:23
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
MapPsu psuMap
Definition: TrackerMap.h:154
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 2690 of file TrackerMap.cc.

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

2690  {
2691 
2692  TmModule * mod = imoduleMap[idmod];
2693  if(mod!=0){
2694  mod->red=red; mod->green=green; mod->blue=blue;
2695  return;
2696  }
2697  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2698 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
tuple cout
Definition: gather_cfg.py:121
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 2699 of file TrackerMap.cc.

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

2699  {
2700 
2701  int key = layer*10000+ring*1000+nmod;
2702  TmModule * mod = smoduleMap[key];
2703 
2704  if(mod!=0){
2705  mod->red=red; mod->green=green; mod->blue=blue;
2706  return;
2707  }
2708  std::cout << "**************************error in fill method **************"<< std::endl;
2709 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fillc_all_blank ( )

Definition at line 2711 of file TrackerMap.cc.

References fillc(), and imoduleMap.

Referenced by SiStripTrackerMapCreator::setTkMapFromAlarm().

2711  {
2712 
2713  std::map<const int , TmModule *>::iterator imod;
2714  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2715  fillc(imod->first,255,255,255);
2716  }
2717 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:103
void TrackerMap::fillc_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
int  red,
int  green,
int  blue 
)

Definition at line 2555 of file TrackerMap.cc.

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

2556  {
2557  int key =crate*10000000+slot*100000+ring*1000+addr;
2558 
2559  TmCcu *ccu = ccuMap[key];
2560 
2561  if(ccu!=0){
2562  ccu->red=red; ccu->green=green; ccu->blue=blue;
2563  return;
2564  }
2565  std::cout << "*** error in FecTrackerMap fillc method ***";
2566 }
MapCcu ccuMap
Definition: TrackerMap.h:150
int green
Definition: TmCcu.h:9
list key
Definition: combine.py:13
int red
Definition: TmCcu.h:9
tuple cout
Definition: gather_cfg.py:121
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 2517 of file TrackerMap.cc.

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

2518 {
2519  int key = fedId*1000+fedCh;
2520  TmApvPair* apvpair = apvMap[key];
2521 
2522  if(apvpair!=0){
2523  apvpair->red=red; apvpair->green=green; apvpair->blue=blue;
2524  return;
2525  }
2526  std::cout << "*** error in FedTrackerMap fillc method ***";
2527 }
int green
Definition: TmApvPair.h:10
int red
Definition: TmApvPair.h:10
int blue
Definition: TmApvPair.h:10
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:143
tuple cout
Definition: gather_cfg.py:121
void TrackerMap::fillc_hv_channel2 ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2610 of file TrackerMap.cc.

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

2611 {
2612 
2613  int key = rack*1000+crate*100+board;
2614 
2615  TmPsu *psu = psuMap[key];
2616 
2617  if(psu!=0){
2618  psu->redHV2=red; psu->greenHV2=green; psu->blueHV2=blue;
2619  return;
2620  }
2621  std::cout << "*** error in HVTrackerMap (channel 2) fillc method ***";
2622 }
int redHV2
Definition: TmPsu.h:21
int greenHV2
Definition: TmPsu.h:21
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
MapPsu psuMap
Definition: TrackerMap.h:154
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 2623 of file TrackerMap.cc.

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

2624 {
2625 
2626  int key = rack*1000+crate*100+board;
2627 
2628  TmPsu *psu = psuMap[key];
2629 
2630  if(psu!=0){
2631  psu->redHV3=red; psu->greenHV3=green; psu->blueHV3=blue;
2632  return;
2633  }
2634  std::cout << "*** error in HVTrackerMap (channel 3) fillc method ***";
2635 }
int greenHV3
Definition: TmPsu.h:22
int blueHV3
Definition: TmPsu.h:22
int redHV3
Definition: TmPsu.h:22
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
MapPsu psuMap
Definition: TrackerMap.h:154
Definition: TmPsu.h:6
void TrackerMap::fillc_lv_channel ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2583 of file TrackerMap.cc.

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

2584 {
2585 
2586  int key = rack*1000+crate*100+board;
2587 
2588  TmPsu *psu = psuMap[key];
2589 
2590  if(psu!=0){
2591  psu->red=red; psu->green=green; psu->blue=blue;
2592  return;
2593  }
2594  std::cout << "*** error in LVTrackerMap fillc method ***";
2595 }
int red
Definition: TmPsu.h:20
int green
Definition: TmPsu.h:20
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
int blue
Definition: TmPsu.h:20
MapPsu psuMap
Definition: TrackerMap.h:154
Definition: TmPsu.h:6
int TrackerMap::find_layer ( int  ix,
int  iy 
)
inline

Definition at line 186 of file TrackerMap.h.

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

187  {
188  int add;
189  int layer=0;
190  if(iy <= xsize){//endcap+z
191  add = 15;
192  layer = ix/ysize;
193  layer = layer+add+1;
194  }
195  if(iy > xsize && iy< 3*xsize){//barrel
196  add=30;
197  if(ix < 2*ysize){
198  layer=1;
199  }else {
200  layer = ix/(2*ysize);
201  if(iy < 2*xsize)layer=layer*2+1; else layer=layer*2;
202  }
203  layer = layer+add;
204  }
205  if(iy >= 3*xsize){ //endcap-z
206  layer = ix/ysize;
207  layer = 15-layer;
208  }
209  return layer;
210  }
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
std::ifstream * TrackerMap::findfile ( std::string  filename)

Definition at line 3489 of file TrackerMap.cc.

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

Referenced by printall(), and printonline().

3489  {
3490  std::ifstream * ifilename;
3491  std::string ifname;
3492  if(jsPath!=""){
3493  ifname=jsPath+filename;
3494  ifilename = new ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3495  if(!ifilename){
3496  ifname="CommonTools/TrackerMap/data/"+filename;
3497  ifilename = new ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3498  }
3499  }else {
3500  ifname="CommonTools/TrackerMap/data/"+filename;
3501  ifilename = new ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3502  }
3503  if(!ifilename)std::cout << "File " << filename << " missing" << std::endl;
3504  return ifilename;
3505  }
std::string jsPath
Definition: TrackerMap.h:170
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:121
std::pair< float, float > TrackerMap::getAutomaticRange ( )

Definition at line 673 of file TrackerMap.cc.

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

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

Definition at line 2830 of file TrackerMap.cc.

References delta, cmsRelvalreport::green(), create_public_lumi_plots::log, maxvalue, minvalue, cmsRelvalreport::red(), tkMapLog, and x.

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

2830  {
2831  int red,green,blue;
2832  float lminvalue, lmaxvalue;
2833  lminvalue=minvalue; lmaxvalue=maxvalue;
2834  if(tkMapLog) {lminvalue=log(minvalue)/log(10);lmaxvalue=log(maxvalue)/log(10); value=log(value)/log(10);}
2835 
2836 
2837  red=0;green=0;blue=0;
2838  if(palette==1){//palette1 1 - raibow
2839  float delta=(lmaxvalue-lminvalue);
2840  float x =(value-lminvalue);
2841  if(value<lminvalue){red=0;green=0;blue=255;}
2842  if(value>lmaxvalue){red=255;green=0;blue=0;}
2843  if(value>=lminvalue&&value<=lmaxvalue){
2844  red = (int) ( x<(delta/2) ? 0 : ( x > ((3./4.)*delta) ? 255 : 255/(delta/4) * (x-(2./4.)*delta) ) );
2845  green= (int) ( x<delta/4 ? (x*255/(delta/4)) : ( x > ((3./4.)*delta) ? 255-255/(delta/4) *(x-(3./4.)*delta) : 255 ) );
2846  blue = (int) ( x<delta/4 ? 255 : ( x > ((1./2.)*delta) ? 0 : 255-255/(delta/4) * (x-(1./4.)*delta) ) );
2847  }
2848  }
2849  if (palette==2){//palette 2 yellow-green
2850  green = (int)((value-lminvalue)/(lmaxvalue-lminvalue)*256.);
2851  if (green > 255) green=255;
2852  red = 255; blue=0;green=255-green;
2853  }
2854  // std::cout<<red<<" "<<green<<" "<<blue<<" "<<value <<" "<<lminvalue<<" "<< lmaxvalue<<std::endl;
2855  return(blue|(green<<8)|(red<<16));
2856 }
dbl * delta
Definition: mlp_gen.cc:36
bool tkMapLog
Definition: TrackerMap.h:165
float minvalue
Definition: TrackerMap.h:498
float maxvalue
Definition: TrackerMap.h:498
Definition: DDAxes.h:10
int TrackerMap::getlayerCount ( int  subdet,
int  partdet 
)
inline

Definition at line 212 of file TrackerMap.h.

Referenced by init().

212  {
213  int ncomponent=0;
214  if(subdet == 1){ //1=pixel
215  if(partdet == 1 || partdet == 3){ //1-3=encap
216  ncomponent = 3;
217  }
218  else { ncomponent = 3; } //barrel
219  }
220  if(subdet== 2){ //2=inner silicon
221  if(partdet == 1 || partdet == 3){ //1-3=encap
222  ncomponent = 3;
223  }
224  else { ncomponent = 4; } //barrel
225  }
226  if(subdet== 3){ //3=outer silicon
227  if(partdet == 1 || partdet == 3){ //1-3=encap
228  ncomponent = 9;
229  }
230  else { ncomponent = 6; } //barrel
231  }
232  return(ncomponent);
233  }
int TrackerMap::getmoduleCount ( int  subdet,
int  partdet,
int  layer,
int  ring 
)
inline

Definition at line 403 of file TrackerMap.h.

Referenced by init().

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

Definition at line 136 of file TrackerMap.h.

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

Definition at line 370 of file TrackerMap.h.

Referenced by init().

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

Definition at line 132 of file TrackerMap.h.

References xsize.

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

Definition at line 133 of file TrackerMap.h.

References ysize.

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

Definition at line 438 of file TrackerMap.cc.

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

Referenced by TrackerMap().

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

Definition at line 439 of file TrackerMap.h.

Referenced by SiPixelTrackerMap::drawModule(), drawModule(), and init().

439  {
440  int layer=key/100000;
441  int ring = key - layer*100000;
442  ring = ring/1000;
443  if(layer==34 || layer==35 || layer==38 || layer==39) return true;
444  if(layer<13 || (layer>18&&layer<31))
445  if(ring==1 || ring==2 || ring==5)return true;
446  return false;
447  }
list key
Definition: combine.py:13
std::string TrackerMap::layername ( int  layer)
inline

Definition at line 461 of file TrackerMap.h.

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

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

Definition at line 426 of file TrackerMap.h.

426  {
427  if(subdet==6&&leftright==1)return(10-layer);
428  if(subdet==6&&leftright==2)return(layer+21);
429  if(subdet==4&&leftright==1)return(4-layer+9);
430  if(subdet==4&&leftright==2)return(layer+18);
431  if(subdet==2&&leftright==1)return(4-layer+12);
432  if(subdet==2&&leftright==2)return(layer+15);
433  if(subdet==1)return(layer+30);
434  if(subdet==3)return(layer+33);
435  if(subdet==5)return(layer+37);
436  assert(false);
437  }
void TrackerMap::load ( std::string  s = "tmap.svg")

Definition at line 2377 of file TrackerMap.cc.

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

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

2377  {
2378  inputfile = new ifstream(inputfilename.c_str(),std::ios::in);
2380  int ipos,ipos1,ipos2,id=0,val=0;
2381  int nline=0;
2382  while (getline( *inputfile, line ))
2383  {
2384  ipos1 = line.find("value=\"");
2385  if(ipos1 > 0) {
2386  value = line.substr(ipos1+7,10);
2387  ipos = value.find("\"");
2388  value = value.substr(0,ipos);
2389  val=atoi(value.c_str());
2390  }
2391  ipos2 = line.find("detid=\"");
2392  if(ipos2 > 0) {
2393  value = line.substr(ipos2+7,10);
2394  ipos = value.find("\"");
2395  value = value.substr(0,ipos);
2396  id = atoi(value.c_str());
2397  }
2398  if(ipos1>0 && ipos2>0 && val>0)this->fill(id,val);
2399  if(ipos1>0 && ipos2>0)nline++;
2400  //if(ipos1>0 && ipos2>0)std::cout << nline << " " << id << " " << val << std::endl;
2401 
2402  }
2403  std::cout << nline << " modules found in this svg file " << std::endl;
2404  inputfile->close();delete inputfile;
2405  }
std::ifstream * inputfile
Definition: TrackerMap.h:495
tuple cout
Definition: gather_cfg.py:121
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2756
int TrackerMap::module ( int  fedId,
int  fedCh 
)

Definition at line 2667 of file TrackerMap.cc.

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

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

2668 {
2669  int key = fedId*1000+fedCh;
2670  TmApvPair* apvpair = apvMap[key];
2671  if(apvpair!=0){
2672  return(apvpair->mod->idex);
2673  }
2674  return(0);
2675  std::cout << "*** error in FedTrackerMap module method ***";
2676 }
TmModule * mod
Definition: TmApvPair.h:16
unsigned int idex
Definition: TmModule.h:29
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:143
tuple cout
Definition: gather_cfg.py:121
int TrackerMap::nlayer ( int  det,
int  part,
int  lay 
)
inline

Definition at line 448 of file TrackerMap.h.

Referenced by init().

448  {
449  if(det==3 && part==1) return lay;
450  if(det==2 && part==1) return lay+9;
451  if(det==1 && part==1) return lay+12;
452  if(det==1 && part==3) return lay+15;
453  if(det==2 && part==3) return lay+18;
454  if(det==3 && part==3) return lay+21;
455  if(det==1 && part==2) return lay+30;
456  if(det==2 && part==2) return lay+33;
457  if(det==3 && part==2) return lay+37;
458  return -1;
459  }
part
Definition: HCALResponse.h:20
double TrackerMap::phival ( double  x,
double  y 
)
inline

Definition at line 172 of file TrackerMap.h.

References M_PI, and phi.

Referenced by SiPixelTrackerMap::drawModule(), and drawModule().

172  {
173  double phi;
174  double phi1=atan(y/x);
175  phi = phi1;
176  if(y<0. && x>0) phi = phi1+2.*M_PI;
177  if(x<0.)phi=phi1+M_PI;
178  if(fabs(y)<0.000001 && x>0)phi=0;
179  if(fabs(y)<0.000001&&x<0)phi=M_PI;
180  if(fabs(x)<0.000001&&y>0)phi=M_PI/2.;
181  if(fabs(x)<0.000001&&y<0)phi=3.*M_PI/2.;
182 
183  return phi;
184  }
#define M_PI
Definition: BFit3D.cc:3
Definition: DDAxes.h:10
Definition: DDAxes.h:10
void TrackerMap::print ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap" 
)

Definition at line 2412 of file TrackerMap.cc.

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

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

2412  {
2413  temporary_file=false;
2414  std::ostringstream outs;
2415  minvalue=minval; maxvalue=maxval;
2416  outs << outputfilename << ".xml";
2417  svgfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2418  jsfile = new ifstream(edm::FileInPath(jsfilename).fullPath().c_str(),std::ios::in);
2419 
2420  //copy javascript interface from trackermap.txt file
2421  std::string line;
2422  while (getline( *jsfile, line ))
2423  {
2424  *svgfile << line << std::endl;
2425  }
2426  jsfile->close();delete jsfile;
2427  //
2428  if(!print_total){
2429  for (int layer=1; layer < 44; layer++){
2430  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2431  for (int module=1;module<200;module++) {
2432  int key=layer*100000+ring*1000+module;
2433  TmModule * mod = smoduleMap[key];
2434  if(mod !=0 && !mod->notInUse()){
2435  mod->value = mod->value / mod->count;
2436  }
2437  }
2438  }
2439  }
2440  }
2441  if(minvalue>=maxvalue){
2442  minvalue=9999999.;
2443  maxvalue=-9999999.;
2444  for (int layer=1; layer < 44; layer++){
2445  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2446  for (int module=1;module<200;module++) {
2447  int key=layer*100000+ring*1000+module;
2448  TmModule * mod = smoduleMap[key];
2449  if(mod !=0 && !mod->notInUse()){
2450  if (minvalue > mod->value)minvalue=mod->value;
2451  if (maxvalue < mod->value)maxvalue=mod->value;
2452  }
2453  }
2454  }
2455  }
2456 }
2457  for (int layer=1; layer < 44; layer++){
2458  // nlay=layer;
2459  defwindow(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 !=0 && !mod->notInUse()){
2465  drawModule(mod,key,layer,print_total,svgfile);
2466  }
2467  }
2468  }
2469  }
2470  *svgfile << "</svg:g></svg:svg>"<<std::endl;
2471  *svgfile << " <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">"<<title<<"</svg:text>"<<std::endl;
2473  *svgfile << "</svg:svg>"<<std::endl;
2474  *svgfile << "</body></html>"<<std::endl;
2475  svgfile->close();delete svgfile;
2476 
2477 }
float minvalue
Definition: TrackerMap.h:498
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2667
void defwindow(int num_lay)
Definition: TrackerMap.h:327
int firstRing[43]
Definition: TrackerMap.h:478
bool temporary_file
Definition: TrackerMap.h:500
std::ofstream * svgfile
Definition: TrackerMap.h:492
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:535
int count
Definition: TmModule.h:13
tuple out
Definition: dbtoconf.py:99
bool printflag
Definition: TrackerMap.h:158
void drawPalette(std::ofstream *file, int xoffset=3660, int yoffset=1540)
Definition: TrackerMap.cc:2479
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:168
list key
Definition: combine.py:13
float maxvalue
Definition: TrackerMap.h:498
std::ifstream * jsfile
Definition: TrackerMap.h:494
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:209
int ntotRing[43]
Definition: TrackerMap.h:477
std::string jsfilename
Definition: TrackerMap.h:169
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 3158 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, edmPickEvents::command, gather_cfg::cout, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, fedMap, alcaDQMUpload::filetype(), findfile(), firstcrate, firstRing, newFWLiteAna::found, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, combine::key, geometryCSVtoXML::line, mod(), TmApvPair::mod, module(), TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, TmModule::notInUse(), npsuracks, ntotRing, dbtoconf::out, pos, funct::pow(), printlayers(), psuMap, psuModuleMap, run_regression::ret, relativeConstraints::ring, alignCSCRings::s, save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), save_as_psutrackermap(), saveGeoTrackerMap, saveWebInterface, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, tkMapLog, makeMuonMisalignmentScenario::txtfile, and create_public_lumi_plots::width.

3158  {
3159 //Copy interface
3160  float minval,maxval; minval=minval1; maxval=maxval1;
3161  if(tkMapLog && (minval<maxval)) {minval=pow(10.,minval1);maxval=pow(10.,maxval1);}
3162  std::string filetype=s,outputfilename=s;
3163  if(saveWebInterface){width=6000;height=3200;}
3164  else{
3165  size_t found=filetype.find_last_of(".");
3166  filetype=filetype.substr(found+1);
3167  found=outputfilename.find_last_of(".");
3168  outputfilename=outputfilename.substr(0,found);
3169  }
3170  std::ofstream * ofilename;
3171  std::ifstream * ifilename;
3172  std::ostringstream ofname;
3173  std::string ifname;
3174  std::string line;
3176  if(saveWebInterface){
3177  ifilename=findfile("viewerHeader.xhtml");
3178  ofname << outputfilename << "viewer.html";
3179  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3180  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3181 *ofilename <<" var tmapname=\"" <<outputfilename << "\""<<std::endl;
3182 *ofilename <<" var tmaptitle=\"" <<title << "\""<<std::endl;
3183 *ofilename <<" var ncrates=" <<ncrates << ";"<<std::endl;
3184 *ofilename <<" var nfeccrates=" <<nfeccrates << ";"<<std::endl;
3185 *ofilename <<" var npsuracks=" <<npsuracks << ";"<<std::endl;
3186  ifilename->close();delete ifilename;
3187  ifilename=findfile("viewerTrailer.xhtml");
3188  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3189  ofilename->close();delete ofilename;
3190  ifilename->close();delete ifilename;
3191  command = "sed -i \"s/XtmapnameX/"+outputfilename+"/g\" "+ ofname.str();
3192  std::cout << "Executing " << command << std::endl;
3193  system(command.c_str());
3194  command = "sed -i \"s/XtmaptitleX/"+title+"/g\" "+ ofname.str();
3195  std::cout << "Executing " << command << std::endl;
3196  system(command.c_str());
3197  ofname.str("");
3198 
3199 ifilename=findfile("jqviewer.js");
3200  ofname << "jqviewer.js";
3201  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3202  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3203  ofilename->close();delete ofilename;
3204  ifilename->close();delete ifilename;
3205 
3206  ofname.str("");
3207  ifilename=findfile("crate.js");
3208  ofname << "crate.js";
3209  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3210  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3211  ofilename->close();delete ofilename;
3212  ifilename->close();delete ifilename;
3213 
3214  ofname.str("");
3215  ifilename=findfile("feccrate.js");
3216  ofname << "feccrate.js";
3217  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3218  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3219  ofilename->close();delete ofilename;
3220  ifilename->close();delete ifilename;
3221 
3222  ofname.str("");
3223  ifilename=findfile("rack.js");
3224  ofname << "rack.js";
3225  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3226  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3227  ofilename->close();delete ofilename;
3228  ifilename->close();delete ifilename;
3229 
3230  ofname.str("");
3231  ifilename=findfile("rackhv.js");
3232  ofname << "rackhv.js";
3233  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3234  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3235  ofilename->close();delete ofilename;
3236  ifilename->close();delete ifilename;
3237 
3238  ofname.str("");
3239  ifilename=findfile("layer.js");
3240  ofname << "layer.js";
3241  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3242  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3243  ofilename->close();delete ofilename;
3244  ifilename->close();delete ifilename;
3245 
3246  command = "scp -r ../../DQM/TrackerCommon/test/jquery/ .";
3247  std::cout << "Executing " << command << std::endl;
3248  system(command.c_str());
3249  command = "scp -r ../../CommonTools/TrackerMap/data/images/ .";
3250  std::cout << "Executing " << command << std::endl;
3251  system(command.c_str());
3252 }
3253 
3254  std::ostringstream outs;
3255  outs << outputfilename<<".png";
3256  if(saveWebInterface)save(true,minval,maxval,outs.str(),3000,1600);
3257  else {if(saveGeoTrackerMap)save(true,minval,maxval,s,width,height);}
3258  if(saveWebInterface){
3259  std::ostringstream outs;
3260  outs << outputfilename<<".png";
3261 temporary_file=false;
3262 printlayers(true,minval,maxval,outputfilename);
3263 
3264 //Now print a text file for each layer
3265  std::ofstream * txtfile;
3266 for (int layer=1; layer < 44; layer++){
3267  std::ostringstream outs;
3268  outs << outputfilename <<"layer"<<layer<< ".html";
3269  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3270  *txtfile << "<html><head></head> <body>" << std::endl;
3271  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3272  for (int module=1;module<200;module++) {
3273  int key=layer*100000+ring*1000+module;
3274  TmModule * mod = smoduleMap[key];
3275  if(mod !=0 && !mod->notInUse()){
3276  int idmod=mod->idex;
3277  int nchan=0;
3278  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3279  std::multimap<const int, TmApvPair*>::iterator pos;
3280  for (pos = apvModuleMap.lower_bound(idmod);
3281  pos != apvModuleMap.upper_bound(idmod); ++pos) {
3282  TmApvPair* apvpair = pos->second;
3283  if(apvpair!=0){
3284  nchan++;
3285  *txtfile << apvpair->text << std::endl;
3286  }
3287 
3288  }
3289  *txtfile << "</pre><h3>"<< mod->name<<"</h3>"<<std::endl;
3290  }
3291  }
3292  }
3293  *txtfile << "</body></html>" << std::endl;
3294  txtfile->close();delete txtfile;
3295 }
3296  }
3298  std::ostringstream outs1,outs2;
3299  if(saveWebInterface)outs1 << outputfilename<<"fed.png";
3300  else outs1 << outputfilename<<"fed."<<filetype;
3301 save_as_fedtrackermap(true,0.,0.,outs1.str(),width,height);
3302  if(saveWebInterface){
3303  outs2 << outputfilename<<".xml";
3304 save_as_fedtrackermap(true,0.,0.,outs2.str(),3000,1600);
3305 //And a text file for each crate
3306  std::map<int , int>::iterator i_fed;
3307  std::ofstream * txtfile;
3308  for (int crate=firstcrate; crate < (ncrates+1); crate++){
3309  std::ostringstream outs;
3310  outs << outputfilename <<"crate"<<crate<< ".html";
3311  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3312  *txtfile << "<html><head></head> <body>" << std::endl;
3313  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
3314  if(i_fed->second == crate){
3315  int fedId = i_fed->first;
3316  for (int nconn=0;nconn<96;nconn++){
3317  int key = fedId*1000+nconn;
3318  TmApvPair * apvPair= apvMap[key];
3319  if(apvPair !=0){
3320  int idmod=apvPair->idex;
3321  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3322  *txtfile << apvPair->text << std::endl;
3323  std::ostringstream outs;
3324  outs << "fedchannel " <<apvPair->getFedId() << "/"<<apvPair->getFedCh()<<" connects to module " << apvPair->mod->idex ;
3325  *txtfile << "</pre><h3>"<< outs.str()<<"</h3>"<<std::endl;
3326  }
3327  }
3328  }
3329  }
3330  *txtfile << "</body></html>" << std::endl;
3331  txtfile->close();delete txtfile;
3332  }
3333  }
3334  }
3336  std::ostringstream outs1,outs2;
3337  if(saveWebInterface)outs1 << outputfilename<<"fec.png";
3338  else outs1 << outputfilename<<"fec."<<filetype;
3339 save_as_fectrackermap(true,0.,0.,outs1.str(),width,height);
3340  if(saveWebInterface){
3341  outs2 << outputfilename<<".xml";
3342 save_as_fectrackermap(true,0.,0.,outs2.str(),3000,1600);
3343 //And a text file for each crate
3344  std::ofstream * txtfile;
3345  std::map<int , TmCcu *>::iterator i_ccu;
3346  std::multimap<TmCcu*, TmModule*>::iterator it;
3347  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
3348  for (int crate=1; crate < (nfeccrates+1); crate++){
3349  std::ostringstream outs;
3350  outs << outputfilename <<"feccrate"<<crate<< ".html";
3351  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3352  *txtfile << "<html><head></head> <body>" << std::endl;
3353  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
3354  TmCcu * ccu= i_ccu->second;
3355  if(ccu!=0&&ccu->getCcuCrate() == crate){
3356  int idmod=ccu->idex;
3357  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3358  *txtfile << ccu->text << std::endl;
3359  std::ostringstream outs;
3360  if(ccu->nmod==0)outs << "ccu is in position" << ccu->mpos<<"in ring but doesn't seem to have any module connected"; else
3361  {
3362  outs << "ccu is in position " << ccu->mpos<<" in ring and connects " <<ccu->nmod<< " modules" << std::endl;
3363  ret = fecModuleMap.equal_range(ccu);
3364  for (it = ret.first; it != ret.second; ++it)
3365  {
3366  outs << (*it).second->idex<<" " << (*it).second->name <<" value= "<< (*it).second->value<<"\n\n";
3367  }
3368 
3369  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3370  }//ifccu->nmod==0
3371  }//if ccu!=0
3372  }//for i_ccu
3373  *txtfile << "</body></html>" << std::endl;
3374  txtfile->close();
3375  }//for int crate
3376  }
3377  }
3378 if(enableLVProcessing){
3379  std::ostringstream outs3,outs4;
3380  if(saveWebInterface)outs3 << outputfilename<<"psu.png";
3381  else outs3 << outputfilename<<"psu."<<filetype;
3382 save_as_psutrackermap(true,0.,0.,outs3.str(),width,height);
3383  if(saveWebInterface){
3384  outs4 << outputfilename<<".xml";
3385 save_as_psutrackermap(true,0.,0.,outs4.str(),3000,1600);
3386 //And a text file for each rack
3387 
3388  std::ofstream * txtfile;
3389  std::map<int , TmPsu *>::iterator ipsu;
3390  std::multimap<TmPsu*, TmModule*>::iterator it;
3391  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3392  for (int rack=1; rack < (npsuracks+1); rack++){
3393  std::ostringstream outs;
3394 
3395  outs << outputfilename <<"psurack"<<rack<< ".html";
3396  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3397  *txtfile << "<html><head></head> <body>" << std::endl;
3398  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3399  TmPsu * psu= ipsu->second;
3400  if(psu!=0 && psu->getPsuRack() == rack){
3401  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3402  *txtfile << psu->text << std::endl;
3403  std::ostringstream outs;
3404  if(psu->nmod==0)outs << "Ps is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3405  {
3406  outs<< "PS is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmod<<" modules. "<<std::endl;
3407 
3408  ret = psuModuleMap.equal_range(psu);
3409  for (it = ret.first; it != ret.second; ++it)
3410  {
3411  outs <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;
3412 
3413  }
3414  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3415  }
3416  }
3417  }
3418  *txtfile << "</body></html>" << std::endl;
3419  txtfile->close();
3420  }
3421  }
3422  }
3423 
3424 
3425 if(enableHVProcessing){
3426  std::ostringstream outs5,outs6;
3427  if(saveWebInterface)outs5 << outputfilename<<"hv.png";
3428  else outs5 << outputfilename<<"hv."<<filetype;
3429 save_as_HVtrackermap(true,0.,0.,outs5.str(),width,height);
3430  if(saveWebInterface){
3431  outs6 << outputfilename<<".xml";
3432 save_as_HVtrackermap(true,0.,0.,outs6.str(),3000,1600);
3433 //And a text file for each rack
3434 
3435  std::ofstream * txtfile;
3436  std::map<int , TmPsu *>::iterator ipsu;
3437  std::multimap<TmPsu*, TmModule*>::iterator it;
3438  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3439  for (int rack=1; rack < (npsuracks+1); rack++){
3440  std::ostringstream outs;
3441 
3442  outs << outputfilename <<"HVrack"<<rack<< ".html";
3443  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3444  *txtfile << "<html><head></head> <body>" << std::endl;
3445  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3446  TmPsu * psu= ipsu->second;
3447  if(psu!=0 && psu->getPsuRack() == rack){
3448  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3449  *txtfile << psu->textHV2 << std::endl;
3450  std::ostringstream outsHV2;
3451  if(psu->nmodHV2==0)outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3452  {
3453  outsHV2<< "HV Channel002 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV2<<" modules. "<<" <br>"<<std::endl;
3454 
3455  ret = psuModuleMap.equal_range(psu);
3456  for (it = ret.first; it != ret.second; ++it)
3457  {
3458  if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3459  }
3460  *txtfile << "</pre><h4>"<< outsHV2.str()<<"</h4>"<<std::endl;
3461  }
3462 
3463  *txtfile << psu->textHV3 << std::endl;
3464  std::ostringstream outsHV3;
3465  if(psu->nmodHV3==0)outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3466  {
3467  outsHV3<< "HV Channel003 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV3<<" modules. "<<" <br>"<<std::endl;
3468 
3469  ret = psuModuleMap.equal_range(psu);
3470  for (it = ret.first; it != ret.second; ++it)
3471  {
3472  if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3473  }
3474  *txtfile << "</pre><h4>"<< outsHV3.str()<<"</h4>"<<std::endl;
3475  }
3476 
3477  }
3478  }
3479  *txtfile << "</body></html>" << std::endl;
3480  txtfile->close();
3481  }
3482  }
3483  }
3484 
3485 
3486 }
TmModule * mod
Definition: TmApvPair.h:16
bool tkMapLog
Definition: TrackerMap.h:165
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:145
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:3489
int nfeccrates
Definition: TrackerMap.h:486
MapCcu ccuMap
Definition: TrackerMap.h:150
int nmodHV3
Definition: TmPsu.h:31
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
int idex
Definition: TmPsu.h:11
bool saveGeoTrackerMap
Definition: TrackerMap.h:160
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2667
bool enableFecProcessing
Definition: TrackerMap.h:162
void save_as_HVtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1541
bool saveWebInterface
Definition: TrackerMap.h:159
int npsuracks
Definition: TrackerMap.h:487
tuple txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
int getPsuBoard()
Definition: TmPsu.h:17
bool enableFedProcessing
Definition: TrackerMap.h:161
int firstRing[43]
Definition: TrackerMap.h:478
int nmod
Definition: TmCcu.h:15
bool enableHVProcessing
Definition: TrackerMap.h:164
int getFedId()
Definition: TmApvPair.h:19
unsigned int idex
Definition: TmModule.h:29
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=YPSUOFFSET+(YPSURSIZE+YPSUOFFSET)*NUMPSURACK_INROW+300, int height=XPSUOFFSET+(XPSURSIZE+XPSUOFFSET)*NUMPSURACK_INCOLUMN+300)
Definition: TrackerMap.cc:1823
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:697
bool temporary_file
Definition: TrackerMap.h:500
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:3506
tuple out
Definition: dbtoconf.py:99
int mpos
Definition: TmCcu.h:18
SvgFed fedMap
Definition: TrackerMap.h:147
PsuModule psuModuleMap
Definition: TrackerMap.h:156
int firstcrate
Definition: TrackerMap.h:485
FecModule fecModuleMap
Definition: TrackerMap.h:152
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:168
int idex
Definition: TmCcu.h:13
list key
Definition: combine.py:13
std::string textHV3
Definition: TmPsu.h:37
SvgApvPair apvMap
Definition: TrackerMap.h:143
std::string text
Definition: TmPsu.h:35
int idex
Definition: TmApvPair.h:14
tuple cout
Definition: gather_cfg.py:121
bool enableLVProcessing
Definition: TrackerMap.h:163
std::string textHV2
Definition: TmPsu.h:36
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=YFEDOFFSET+(YFEDCSIZE+YFEDOFFSET)*NUMFEDCRATE_INROW+300, int height=XFEDOFFSET+(XFEDCSIZE+XFEDOFFSET)*NUMFEDCRATE_INCOLUMN+300)
Definition: TrackerMap.cc:2105
MapPsu psuMap
Definition: TrackerMap.h:154
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:209
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:1282
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:477
void TrackerMap::printlayers ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "layer" 
)

Definition at line 3506 of file TrackerMap.cc.

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

Referenced by printall(), and printonline().

3506  {
3507  std::ofstream * xmlfile;
3508 saveAsSingleLayer=true;
3509 if(!print_total){
3510  for (int layer=1; layer < 44; layer++){
3511  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3512  for (int module=1;module<200;module++) {
3513  int key=layer*100000+ring*1000+module;
3514  TmModule * mod = smoduleMap[key];
3515  if(mod !=0 && !mod->notInUse()){
3516  mod->value = mod->value / mod->count;
3517  }
3518  }
3519  }
3520  }
3521  }
3522  if(minvalue>=maxvalue){
3523  minvalue=9999999.;
3524  maxvalue=-9999999.;
3525  for (int layer=1; layer < 44; layer++){
3526  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3527  for (int module=1;module<200;module++) {
3528  int key=layer*100000+ring*1000+module;
3529  TmModule * mod = smoduleMap[key];
3530  if(mod !=0 && !mod->notInUse()){
3531  if (minvalue > mod->value)minvalue=mod->value;
3532  if (maxvalue < mod->value)maxvalue=mod->value;
3533  }
3534  }
3535  }
3536  }
3537  }
3538 for (int layer=1; layer < 44; layer++){
3539  std::ostringstream outs;
3540  outs << outputfilename <<"layer"<<layer<< ".xml";
3541  xmlfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3542  *xmlfile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
3543  *xmlfile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
3544  *xmlfile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
3545  *xmlfile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
3546  *xmlfile << "<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />"<<std::endl;
3547  *xmlfile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerLayer.init()\">"<<std::endl;
3548  if(layer<31)*xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > "<<std::endl;
3549  else *xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > "<<std::endl;
3550  *xmlfile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
3551  *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;
3552  *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;
3553  *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;
3554  *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;
3555  *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;
3556 
3557  // nlay=layer;
3558  defwindow(layer);
3559  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3560  for (int module=1;module<200;module++) {
3561  int key=layer*100000+ring*1000+module;
3562  TmModule * mod = smoduleMap[key];
3563  if(mod !=0 && !mod->notInUse()){
3564  drawModule(mod,key,layer,print_total,xmlfile);
3565  }
3566  }
3567  }
3568  *xmlfile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
3569  *xmlfile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
3570  *xmlfile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
3571  *xmlfile << "<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
3572  *xmlfile << "<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
3573  if(layer > 33){
3574  *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;
3575  *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;
3576  *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;
3577  *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;
3578  *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;
3579  }
3580  else{
3581  *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;
3582  *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;
3583  *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;
3584  *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;
3585  *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;
3586  }
3587  *xmlfile << " </text> </svg>" << std::endl;
3588  xmlfile->close();delete xmlfile;
3589  }
3590 saveAsSingleLayer=false;
3591 }
float minvalue
Definition: TrackerMap.h:498
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2667
void defwindow(int num_lay)
Definition: TrackerMap.h:327
int firstRing[43]
Definition: TrackerMap.h:478
tuple xmlfile
Make an XML representation of the misalignment.
bool saveAsSingleLayer
Definition: TrackerMap.h:505
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:535
int count
Definition: TmModule.h:13
tuple out
Definition: dbtoconf.py:99
bool notInUse()
Definition: TmModule.h:24
list key
Definition: combine.py:13
float maxvalue
Definition: TrackerMap.h:498
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:209
int ntotRing[43]
Definition: TrackerMap.h:477
void TrackerMap::printonline ( )

Definition at line 2857 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, edmPickEvents::command, gather_cfg::cout, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, fedMap, findfile(), firstcrate, firstRing, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), gmaxvalue, gminvalue, TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, combine::key, geometryCSVtoXML::line, mod(), TmApvPair::mod, module(), TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, TmModule::notInUse(), npsuracks, ntotRing, dbtoconf::out, pos, printlayers(), psuMap, psuModuleMap, run_regression::ret, relativeConstraints::ring, save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), save_as_psutrackermap(), smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, and makeMuonMisalignmentScenario::txtfile.

Referenced by SiStripTrackerMapCreator::create().

2857  {
2858 //Copy interface
2859  std::ofstream * ofilename;
2860  std::ifstream * ifilename;
2861  std::ostringstream ofname;
2862  std::string ifname;
2864  std::string line;
2865  std::string outputfilename="dqmtmap";
2866  ifilename=findfile("viewerHeader.xhtml");
2867  ofname << outputfilename << "viewer.html";
2868  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2869  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2870 *ofilename <<" var tmapname=\"" <<outputfilename << "\""<<std::endl;
2871 *ofilename <<" var tmaptitle=\"" <<title << "\""<<std::endl;
2872 *ofilename <<" var ncrates=" <<ncrates << ";"<<std::endl;
2873 *ofilename <<" var nfeccrates=" <<nfeccrates << ";"<<std::endl;
2874  *ofilename <<" var npsuracks=" <<npsuracks << ";"<<std::endl;
2875 
2876  ifilename->close();delete ifilename;
2877 
2878  ifilename=findfile("viewerTrailer.xhtml");
2879  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2880  ofilename->close();delete ofilename;
2881  command = "sed -i \"s/XtmapnameX/"+outputfilename+"/g\" "+ ofname.str();
2882  std::cout << "Executing " << command << std::endl;
2883  system(command.c_str());
2884  command = "sed -i \"s/XtmaptitleX/"+title+"/g\" "+ ofname.str();
2885  std::cout << "Executing " << command << std::endl;
2886  system(command.c_str());
2887  ofname.str("");
2888  ifilename->close();delete ifilename;
2889 
2890  ifilename=findfile("jqviewer.js");
2891  ofname << "jqviewer.js";
2892  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2893  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2894  ofname.str("");
2895  ofilename->close();delete ofilename;
2896  ifilename->close();delete ifilename;
2897 
2898  ifilename=findfile("crate.js");
2899  ofname << "crate.js";
2900  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2901  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2902  ofname.str("");
2903  ofilename->close();delete ofilename;
2904  ifilename->close();delete ifilename;
2905 
2906  ifilename=findfile("feccrate.js");
2907  ofname << "feccrate.js";
2908  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2909  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2910  ofname.str("");
2911  ofilename->close();delete ofilename;
2912  ifilename->close();delete ifilename;
2913 
2914  ifilename=findfile("layer.js");
2915  ofname << "layer.js";
2916  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2917  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2918  ofname.str("");
2919  ofilename->close();delete ofilename;
2920  ifilename->close();delete ifilename;
2921 
2922  ifilename=findfile("rack.js");
2923  ofname << "rack.js";
2924  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2925  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2926  ofname.str("");
2927  ofilename->close();delete ofilename;
2928  ifilename->close();delete ifilename;
2929  ofname.str("");
2930 
2931  ifilename=findfile("rackhv.js");
2932  ofname << "rackhv.js";
2933  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2934  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2935  ofname.str("");
2936  ofilename->close();delete ofilename;
2937  ifilename->close();delete ifilename;
2938 
2939 
2940 
2941 
2942  std::ostringstream outs,outs1,outs2;
2943  outs << outputfilename<<".png";
2944 save(true,gminvalue,gmaxvalue,outs.str(),3000,1600);
2945 temporary_file=false;
2946 printlayers(true,gminvalue,gmaxvalue,outputfilename);
2947 
2948 //Now print a text file for each layer
2949  std::ofstream * txtfile;
2950 for (int layer=1; layer < 44; layer++){
2951  std::ostringstream outs;
2952  outs << outputfilename <<"layer"<<layer<< ".html";
2953  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2954  *txtfile << "<html><head></head> <body>" << std::endl;
2955  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2956  for (int module=1;module<200;module++) {
2957  int key=layer*100000+ring*1000+module;
2958  TmModule * mod = smoduleMap[key];
2959  if(mod !=0 && !mod->notInUse()){
2960  int idmod=mod->idex;
2961  int nchan=0;
2962  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
2963  std::multimap<const int, TmApvPair*>::iterator pos;
2964  for (pos = apvModuleMap.lower_bound(idmod);
2965  pos != apvModuleMap.upper_bound(idmod); ++pos) {
2966  TmApvPair* apvpair = pos->second;
2967  if(apvpair!=0){
2968  nchan++;
2969  *txtfile << apvpair->text << std::endl;
2970  }
2971 
2972  }
2973  *txtfile << "</pre><h3>"<< mod->name<<"</h3>"<<std::endl;
2974  }
2975  }
2976  }
2977  *txtfile << "</body></html>" << std::endl;
2978  txtfile->close();delete txtfile;
2979  }
2981  outs1 << outputfilename<<"fed.png";
2982 save_as_fedtrackermap(true,gminvalue,gmaxvalue,outs1.str(),6000,3200);
2983  outs2 << outputfilename<<".xml";
2984 save_as_fedtrackermap(true,gminvalue,gmaxvalue,outs2.str(),3000,1600);
2985 //And a text file for each crate
2986  std::map<int , int>::iterator i_fed;
2987  std::ofstream * txtfile;
2988  for (int crate=firstcrate; crate < (ncrates+1); crate++){
2989  std::ostringstream outs;
2990  outs << outputfilename <<"crate"<<crate<< ".html";
2991  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2992  *txtfile << "<html><head></head> <body>" << std::endl;
2993  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
2994  if(i_fed->second == crate){
2995  int fedId = i_fed->first;
2996  for (int nconn=0;nconn<96;nconn++){
2997  int key = fedId*1000+nconn;
2998  TmApvPair * apvPair= apvMap[key];
2999  if(apvPair !=0){
3000  int idmod=apvPair->idex;
3001  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3002  *txtfile << apvPair->text << std::endl;
3003  std::ostringstream outs;
3004  outs << "fedchannel " <<apvPair->getFedId() << "/"<<apvPair->getFedCh()<<" connects to module " << apvPair->mod->idex ;
3005  *txtfile << "</pre><h3>"<< outs.str()<<"</h3>"<<std::endl;
3006  }
3007  }
3008  }
3009  }
3010  *txtfile << "</body></html>" << std::endl;
3011  txtfile->close();delete txtfile;
3012  }
3013  }
3015  std::ostringstream outs1,outs2;
3016  outs1 << outputfilename<<"fec.png";
3017 save_as_fectrackermap(true,gminvalue,gmaxvalue,outs1.str(),6000,3200);
3018  outs2 << outputfilename<<".xml";
3019 save_as_fectrackermap(true,gminvalue,gmaxvalue,outs2.str(),3000,1600);
3020 //And a text file for each crate
3021  std::ofstream * txtfile;
3022  std::map<int , TmCcu *>::iterator i_ccu;
3023  std::multimap<TmCcu*, TmModule*>::iterator it;
3024  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
3025  for (int crate=1; crate < (nfeccrates+1); crate++){
3026  std::ostringstream outs;
3027  outs << outputfilename <<"feccrate"<<crate<< ".html";
3028  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3029  *txtfile << "<html><head></head> <body>" << std::endl;
3030  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
3031  TmCcu * ccu= i_ccu->second;
3032  if(ccu!=0&&ccu->getCcuCrate() == crate){
3033  int idmod=ccu->idex;
3034  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3035  *txtfile << ccu->text << std::endl;
3036  std::ostringstream outs;
3037  if(ccu->nmod==0)outs << "ccu is in position" << ccu->mpos<<"in ring but doesn't seem to have any module connected"; else
3038  {
3039  outs << "ccu is in position " << ccu->mpos<<" in ring and connects " <<ccu->nmod<< " modules" << std::endl;
3040  ret = fecModuleMap.equal_range(ccu);
3041  for (it = ret.first; it != ret.second; ++it)
3042  {
3043  outs << (*it).second->idex<<" " << (*it).second->name <<" value= "<< (*it).second->value<<"\n\n";
3044  }
3045 
3046  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3047  }//ifccu->nmod==0
3048  }//if ccu!=0
3049  }//for i_ccu
3050  *txtfile << "</body></html>" << std::endl;
3051  txtfile->close();delete txtfile;
3052  }//for int crate
3053  }
3054 if(enableLVProcessing){
3055  std::ostringstream outs3,outs4;
3056  outs3 << outputfilename<<"psu.png";
3057 save_as_psutrackermap(true,gminvalue,gmaxvalue,outs3.str(),6000,3200);
3058 
3059  outs4 << outputfilename<<".xml";
3060 save_as_psutrackermap(true,gminvalue,gmaxvalue,outs4.str(),3000,1600);
3061 //And a text file for each rack
3062 
3063  std::ofstream * txtfile;
3064  std::map<int , TmPsu *>::iterator ipsu;
3065  std::multimap<TmPsu*, TmModule*>::iterator it;
3066  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3067  for (int rack=1; rack < (npsuracks+1); rack++){
3068  std::ostringstream outs;
3069 
3070  outs << outputfilename <<"psurack"<<rack<< ".html";
3071  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3072  *txtfile << "<html><head></head> <body>" << std::endl;
3073  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3074  TmPsu * psu= ipsu->second;
3075  if(psu!=0 && psu->getPsuRack() == rack){
3076  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3077  *txtfile << psu->text << std::endl;
3078  std::ostringstream outs;
3079  if(psu->nmod==0)outs << "Ps is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3080  {
3081  outs<< "PS is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmod<<" modules. "<<std::endl;
3082 
3083  ret = psuModuleMap.equal_range(psu);
3084  for (it = ret.first; it != ret.second; ++it)
3085  {
3086  outs <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;
3087 
3088  }
3089  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3090  }
3091  }
3092  }
3093  *txtfile << "</body></html>" << std::endl;
3094  txtfile->close();delete txtfile;
3095  }
3096  }
3097 
3098 
3099 if(enableHVProcessing){
3100  std::ostringstream outs5,outs6;
3101  outs5 << outputfilename<<"hv.png";
3102 save_as_HVtrackermap(true,gminvalue,gmaxvalue,outs5.str(),6000,3200);
3103 
3104  outs6 << outputfilename<<".xml";
3105 save_as_HVtrackermap(true,gminvalue,gmaxvalue,outs6.str(),3000,1600);
3106 //And a text file for each rack
3107 
3108  std::ofstream * txtfile;
3109  std::map<int , TmPsu *>::iterator ipsu;
3110  std::multimap<TmPsu*, TmModule*>::iterator it;
3111  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3112  for (int rack=1; rack < (npsuracks+1); rack++){
3113  std::ostringstream outs;
3114 
3115  outs << outputfilename <<"HVrack"<<rack<< ".html";
3116  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3117  *txtfile << "<html><head></head> <body>" << std::endl;
3118  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3119  TmPsu * psu= ipsu->second;
3120  if(psu!=0 && psu->getPsuRack() == rack){
3121  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3122  *txtfile << psu->textHV2 << std::endl;
3123  std::ostringstream outsHV2;
3124  if(psu->nmodHV2==0)outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3125  {
3126  outsHV2<< "HV Channel002 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV2<<" modules. "<<" <br>"<<std::endl;
3127 
3128  ret = psuModuleMap.equal_range(psu);
3129  for (it = ret.first; it != ret.second; ++it)
3130  {
3131  if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3132  }
3133  *txtfile << "</pre><h4>"<< outsHV2.str()<<"</h4>"<<std::endl;
3134  }
3135 
3136  *txtfile << psu->textHV3 << std::endl;
3137  std::ostringstream outsHV3;
3138  if(psu->nmodHV3==0)outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3139  {
3140  outsHV3<< "HV Channel003 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV3<<" modules. "<<" <br>"<<std::endl;
3141 
3142  ret = psuModuleMap.equal_range(psu);
3143  for (it = ret.first; it != ret.second; ++it)
3144  {
3145  if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3146  }
3147  *txtfile << "</pre><h4>"<< outsHV3.str()<<"</h4>"<<std::endl;
3148  }
3149 
3150  }
3151  }
3152  *txtfile << "</body></html>" << std::endl;
3153  txtfile->close();delete txtfile;
3154  }
3155  }
3156 
3157 }
TmModule * mod
Definition: TmApvPair.h:16
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:145
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:3489
int nfeccrates
Definition: TrackerMap.h:486
MapCcu ccuMap
Definition: TrackerMap.h:150
int nmodHV3
Definition: TmPsu.h:31
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
int idex
Definition: TmPsu.h:11
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2667
bool enableFecProcessing
Definition: TrackerMap.h:162
void save_as_HVtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1541
int npsuracks
Definition: TrackerMap.h:487
tuple txtfile
Delete all three files at once to make sure the user never sees stale data (e.g.
int getPsuBoard()
Definition: TmPsu.h:17
bool enableFedProcessing
Definition: TrackerMap.h:161
int firstRing[43]
Definition: TrackerMap.h:478
float gminvalue
Definition: TrackerMap.h:497
int nmod
Definition: TmCcu.h:15
bool enableHVProcessing
Definition: TrackerMap.h:164
int getFedId()
Definition: TmApvPair.h:19
unsigned int idex
Definition: TmModule.h:29
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=YPSUOFFSET+(YPSURSIZE+YPSUOFFSET)*NUMPSURACK_INROW+300, int height=XPSUOFFSET+(XPSURSIZE+XPSUOFFSET)*NUMPSURACK_INCOLUMN+300)
Definition: TrackerMap.cc:1823
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:697
bool temporary_file
Definition: TrackerMap.h:500
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:3506
tuple out
Definition: dbtoconf.py:99
int mpos
Definition: TmCcu.h:18
SvgFed fedMap
Definition: TrackerMap.h:147
PsuModule psuModuleMap
Definition: TrackerMap.h:156
int firstcrate
Definition: TrackerMap.h:485
FecModule fecModuleMap
Definition: TrackerMap.h:152
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:168
int idex
Definition: TmCcu.h:13
list key
Definition: combine.py:13
std::string textHV3
Definition: TmPsu.h:37
SvgApvPair apvMap
Definition: TrackerMap.h:143
std::string text
Definition: TmPsu.h:35
float gmaxvalue
Definition: TrackerMap.h:497
int idex
Definition: TmApvPair.h:14
tuple cout
Definition: gather_cfg.py:121
bool enableLVProcessing
Definition: TrackerMap.h:163
std::string textHV2
Definition: TmPsu.h:36
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=YFEDOFFSET+(YFEDCSIZE+YFEDOFFSET)*NUMFEDCRATE_INROW+300, int height=XFEDOFFSET+(XFEDCSIZE+XFEDOFFSET)*NUMFEDCRATE_INCOLUMN+300)
Definition: TrackerMap.cc:2105
MapPsu psuMap
Definition: TrackerMap.h:154
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:209
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1282
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:477
void TrackerMap::reset ( void  )

Definition at line 430 of file TrackerMap.cc.

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

Referenced by MatrixReader.MatrixReader::__init__(), BeautifulSoup.BeautifulStoneSoup::__init__(), and MatrixReader.MatrixReader::showRaw().

430  {
431 std::map<int , TmModule *>::iterator i_mod;
432  for( i_mod=imoduleMap.begin();i_mod !=imoduleMap.end(); i_mod++){
433  TmModule * mod= i_mod->second;
434  mod->count=0;mod->value=0;mod->red=-1;
435  }
436 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
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 697 of file TrackerMap.cc.

References addPixelFlag, trackerHits::c, cuy::col, colors, edmPickEvents::command, TmModule::count, gather_cfg::cout, defwindow(), drawModule(), drawPalette(), lut2db_cfg::filename, alcaDQMUpload::filetype(), firstRing, newFWLiteAna::found, cmsRelvalreport::green(), i, recoMuon::in, combine::key, prof2calltree::l, create_public_lumi_plots::log, maxvalue, minvalue, mod(), module(), TmModule::notInUse(), ntotRing, dbtoconf::out, pos, printflag, cmsRelvalreport::red(), relativeConstraints::ring, alignCSCRings::s, savefile, saveGeoTrackerMap, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmModule::value, relativeConstraints::value, vc, x, and detailsBasic3DVector::y.

Referenced by Vispa.Main.TabController.TabController::allowClose(), SiStripQualityStatistics::analyze(), TkVoltageMapCreator::beginRun(), TrackerDpgAnalysis::beginRun(), Vispa.Main.TabController.TabController::checkModificationTimestamp(), SiStripTrackerMapCreator::createForOffline(), SiStripCorrelateNoise::DoPlots(), SiStripCablingTrackerMap::endJob(), SiStripQualityStatistics::endJob(), SiStripDQMProfileToTkMapConverter::endJob(), SiStripPlotGain::endJob(), SiStripCorrelateBadStripAndNoise::endJob(), BuildTrackerMapPlugin::endJob(), DetIdSelectorTest::endJob(), APVShotsAnalyzer::endJob(), SiStripHitEffFromCalibTree::makeTKMap(), printall(), printonline(), and SiStripBaseCondObjDQM::saveTkMap().

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

References TmCcu::blue, trackerHits::c, ccuMap, cuy::col, colors, edmPickEvents::command, TmCcu::count, gather_cfg::cout, deffecwindow(), drawCcu(), drawPalette(), enableFecProcessing, fecModuleMap, lut2db_cfg::filename, alcaDQMUpload::filetype(), newFWLiteAna::found, TmCcu::getCcuCrate(), TmCcu::getCcuSlot(), TmCcu::green, cmsRelvalreport::green(), i, recoMuon::in, prof2calltree::l, create_public_lumi_plots::log, maxvalue, minvalue, nfeccrates, TmCcu::nmod, dbtoconf::out, pos, printflag, TmCcu::red, cmsRelvalreport::red(), run_regression::ret, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmCcu::value, relativeConstraints::value, vc, x, and detailsBasic3DVector::y.

Referenced by printall(), and printonline().

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

Definition at line 2105 of file TrackerMap.cc.

References apvMap, trackerHits::c, cuy::col, colors, edmPickEvents::command, TmModule::count, TmApvPair::count, gather_cfg::cout, defcwindow(), drawApvPair(), drawPalette(), enableFedProcessing, fedMap, lut2db_cfg::filename, alcaDQMUpload::filetype(), firstcrate, newFWLiteAna::found, cmsRelvalreport::green(), i, recoMuon::in, combine::key, prof2calltree::l, create_public_lumi_plots::log, maxvalue, minvalue, TmApvPair::mod, TmApvPair::mpos, ncrates, TmModule::notInUse(), NUMFEDCRATE_INCOLUMN, NUMFEDCRATE_INROW, dbtoconf::out, pos, printflag, TmApvPair::red, cmsRelvalreport::red(), alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, slotMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmApvPair::value, TmModule::value, relativeConstraints::value, vc, x, XFEDCSIZE, XFEDOFFSET, detailsBasic3DVector::y, YFEDCSIZE, and YFEDOFFSET.

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

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

References TmPsu::blueHV2, TmPsu::blueHV3, trackerHits::c, cuy::col, colors, edmPickEvents::command, TmPsu::countHV2, TmPsu::countHV3, gather_cfg::cout, defpsuwindow(), drawHV2(), drawHV3(), drawPalette(), enableHVProcessing, lut2db_cfg::filename, alcaDQMUpload::filetype(), newFWLiteAna::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), cmsRelvalreport::green(), TmPsu::greenHV2, TmPsu::greenHV3, i, recoMuon::in, prof2calltree::l, create_public_lumi_plots::log, max(), maxvalue, min, minvalue, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, dbtoconf::out, pos, printflag, psuMap, psuModuleMap, cmsRelvalreport::red(), TmPsu::redHV2, TmPsu::redHV3, run_regression::ret, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmPsu::valueHV2, TmPsu::valueHV3, vc, x, and detailsBasic3DVector::y.

Referenced by printall(), and printonline().

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

Definition at line 1823 of file TrackerMap.cc.

References trackerHits::c, cuy::col, colors, edmPickEvents::command, TmPsu::count, gather_cfg::cout, defpsuwindow(), drawPalette(), drawPsu(), enableLVProcessing, lut2db_cfg::filename, alcaDQMUpload::filetype(), newFWLiteAna::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), cmsRelvalreport::green(), i, recoMuon::in, prof2calltree::l, create_public_lumi_plots::log, maxvalue, minvalue, TmPsu::nmod, npsuracks, NUMPSURACK_INCOLUMN, NUMPSURACK_INROW, dbtoconf::out, pos, printflag, psuMap, psuModuleMap, TmPsu::red, cmsRelvalreport::red(), run_regression::ret, alignCSCRings::s, saveAsSingleLayer, savefile, saveWebInterface, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, title, tkMapLog, TmPsu::value, relativeConstraints::value, vc, x, XPSUOFFSET, XPSURSIZE, detailsBasic3DVector::y, YPSUOFFSET, and YPSURSIZE.

Referenced by SiStripTrackerMapCreator::createForOffline(), printall(), and printonline().

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

Definition at line 669 of file TrackerMap.cc.

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

Referenced by SiStripTrackerMapCreator::setTkMapRange().

670 if(tkMapLog) {gminvalue=pow(10.,min);gmaxvalue=pow(10.,max);}
671 }
bool tkMapLog
Definition: TrackerMap.h:165
#define min(a, b)
Definition: mlp_lapack.h:161
float gminvalue
Definition: TrackerMap.h:497
const T & max(const T &a, const T &b)
float gmaxvalue
Definition: TrackerMap.h:497
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 2767 of file TrackerMap.cc.

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

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

2767  {
2768 
2769  TmModule * mod = imoduleMap[idmod];
2770  if(mod!=0){
2771  mod->text=s;
2772  }
2773  else std::cout << "**************************error in IdModuleMap **************";
2774 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:141
std::string text
Definition: TmModule.h:14
tuple cout
Definition: gather_cfg.py:121
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 2777 of file TrackerMap.cc.

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

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

2777  {
2778 
2779  int key = layer*100000+ring*1000+nmod;
2780  TmModule * mod = smoduleMap[key];
2781  if(mod!=0){
2782  mod->text=s;
2783  }
2784  else std::cout << "**************************error in SvgModuleMap **************";
2785 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:139
std::string text
Definition: TmModule.h:14
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
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 125 of file TrackerMap.h.

References printflag.

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

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

Definition at line 234 of file TrackerMap.h.

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

Referenced by SiPixelTrackerMap::drawModule(), and drawModule().

234  {
235  double res;
236  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
237  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
238  return res;
239  }
double xmin
Definition: TrackerMap.h:488
bool saveAsSingleLayer
Definition: TrackerMap.h:505
double xmax
Definition: TrackerMap.h:488
Definition: DDAxes.h:10
double TrackerMap::xdpixelc ( double  x)
inline

Definition at line 254 of file TrackerMap.h.

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

Referenced by drawApvPair().

254  {
255  double res;
256  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE);
257  else res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE)+ix;
258  return res;
259  }
double xmin
Definition: TrackerMap.h:488
bool saveAsSingleLayer
Definition: TrackerMap.h:505
#define XFEDCSIZE
Definition: TrackerMap.h:60
double xmax
Definition: TrackerMap.h:488
Definition: DDAxes.h:10
double TrackerMap::xdpixelfec ( double  x)
inline

Definition at line 268 of file TrackerMap.h.

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

Referenced by drawCcu().

268  {
269  double res;
270  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
271  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
272  return res;
273  }
double xmin
Definition: TrackerMap.h:488
bool saveAsSingleLayer
Definition: TrackerMap.h:505
double xmax
Definition: TrackerMap.h:488
Definition: DDAxes.h:10
double TrackerMap::xdpixelpsu ( double  x)
inline

Definition at line 282 of file TrackerMap.h.

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

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

282  {
283  double res;
284  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XPSURSIZE);
285  else res= ((x-xmin)/(xmax-xmin)*XPSURSIZE)+ix;
286  return res;
287  }
double xmin
Definition: TrackerMap.h:488
#define XPSURSIZE
Definition: TrackerMap.h:45
bool saveAsSingleLayer
Definition: TrackerMap.h:505
double xmax
Definition: TrackerMap.h:488
Definition: DDAxes.h:10
double TrackerMap::ydpixel ( double  y)
inline

Definition at line 240 of file TrackerMap.h.

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

Referenced by SiPixelTrackerMap::drawModule(), and drawModule().

240  {
241  double res=0;
242  double y1;
243  y1 = (y-ymin)/(ymax-ymin);
244  if(nlay>30)
245  {
246  if(nlay <34) res= 2*ysize - (y1*2*ysize);
247  if(nlay==34) res= 2.4*ysize - (y1*2.4*ysize);
248  if(nlay>34) res= 2.5*ysize - (y1*2.5*ysize);
249  }
250  else res= xsize - (y1*xsize);
251  if(!saveAsSingleLayer) res=res+iy;
252  return res;
253  }
double ymax
Definition: TrackerMap.h:488
bool saveAsSingleLayer
Definition: TrackerMap.h:505
double ymin
Definition: TrackerMap.h:488
double TrackerMap::ydpixelc ( double  y)
inline

Definition at line 260 of file TrackerMap.h.

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

Referenced by drawApvPair().

260  {
261  double res;
262  double y1;
263  y1 = (y-ymin)/(ymax-ymin);
264  if(saveAsSingleLayer)res= YFEDCSIZE - (y1*YFEDCSIZE);
265  else res= YFEDCSIZE - (y1*YFEDCSIZE)+iy;
266  return res;
267  }
#define YFEDCSIZE
Definition: TrackerMap.h:61
double ymax
Definition: TrackerMap.h:488
bool saveAsSingleLayer
Definition: TrackerMap.h:505
double ymin
Definition: TrackerMap.h:488
double TrackerMap::ydpixelfec ( double  y)
inline

Definition at line 274 of file TrackerMap.h.

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

Referenced by drawCcu().

274  {
275  double res;
276  double y1;
277  y1 = (y-ymin)/(ymax-ymin);
278  if(saveAsSingleLayer)res= 2*ysize - (y1*2*ysize);
279  else res= 2*ysize - (y1*2*ysize)+iy;
280  return res;
281  }
double ymax
Definition: TrackerMap.h:488
bool saveAsSingleLayer
Definition: TrackerMap.h:505
double ymin
Definition: TrackerMap.h:488
double TrackerMap::ydpixelpsu ( double  y)
inline

Definition at line 288 of file TrackerMap.h.

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

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

288  {
289  double res;
290  double y1;
291  y1 = (y-ymin)/(ymax-ymin);
292  if(saveAsSingleLayer)res=YPSURSIZE - (y1*YPSURSIZE);
293  else res= YPSURSIZE - (y1*YPSURSIZE)+iy;
294  return res;
295  }
double ymax
Definition: TrackerMap.h:488
bool saveAsSingleLayer
Definition: TrackerMap.h:505
double ymin
Definition: TrackerMap.h:488
#define YPSURSIZE
Definition: TrackerMap.h:46

Member Data Documentation

bool TrackerMap::addPixelFlag
private

Definition at line 506 of file TrackerMap.h.

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

SvgApvPair TrackerMap::apvMap
ModApvPair TrackerMap::apvModuleMap

Definition at line 145 of file TrackerMap.h.

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

std::ifstream* TrackerMap::ccufile
protected

Definition at line 496 of file TrackerMap.h.

MapCcu TrackerMap::ccuMap
bool TrackerMap::enableFecProcessing

Definition at line 162 of file TrackerMap.h.

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

bool TrackerMap::enableFedProcessing

Definition at line 161 of file TrackerMap.h.

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

bool TrackerMap::enableHVProcessing

Definition at line 164 of file TrackerMap.h.

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

bool TrackerMap::enableLVProcessing

Definition at line 163 of file TrackerMap.h.

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

FecModule TrackerMap::fecModuleMap

Definition at line 152 of file TrackerMap.h.

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

SvgFed TrackerMap::fedMap

Definition at line 147 of file TrackerMap.h.

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

bool TrackerMap::firstcall
protected

Definition at line 491 of file TrackerMap.h.

Referenced by init().

int TrackerMap::firstcrate
protected

Definition at line 485 of file TrackerMap.h.

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

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

Definition at line 497 of file TrackerMap.h.

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

float TrackerMap::gminvalue
protected

Definition at line 497 of file TrackerMap.h.

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

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

Definition at line 169 of file TrackerMap.h.

Referenced by build(), and TrackerMap().

std::ifstream* TrackerMap::inputfile
protected

Definition at line 495 of file TrackerMap.h.

Referenced by load().

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

Definition at line 494 of file TrackerMap.h.

Referenced by SiPixelTrackerMap::print(), and print().

std::string TrackerMap::jsfilename

Definition at line 169 of file TrackerMap.h.

Referenced by print(), and TrackerMap().

std::string TrackerMap::jsPath

Definition at line 170 of file TrackerMap.h.

Referenced by findfile(), and TrackerMap().

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

Definition at line 484 of file TrackerMap.h.

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

int TrackerMap::ndet

Definition at line 166 of file TrackerMap.h.

Referenced by init().

int TrackerMap::nfeccrates
protected

Definition at line 486 of file TrackerMap.h.

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

int TrackerMap::nlay
protected

Definition at line 481 of file TrackerMap.h.

Referenced by drawModule(), SiPixelTrackerMap::print(), and ydpixel().

int TrackerMap::npart

Definition at line 167 of file TrackerMap.h.

Referenced by init().

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

Definition at line 499 of file TrackerMap.h.

Referenced by build().

float TrackerMap::oldz
private

Definition at line 504 of file TrackerMap.h.

int TrackerMap::palette
bool TrackerMap::posrel
protected

Definition at line 490 of file TrackerMap.h.

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

bool TrackerMap::printflag
bool TrackerMap::psetAvailable

Definition at line 171 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 160 of file TrackerMap.h.

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

bool TrackerMap::saveWebInterface
SvgFed TrackerMap::slotMap

Definition at line 148 of file TrackerMap.h.

Referenced by save_as_fedtrackermap(), and TrackerMap().

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

Definition at line 492 of file TrackerMap.h.

Referenced by SiPixelTrackerMap::drawModule(), SiPixelTrackerMap::print(), and 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