CMS 3D CMS Logo

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

#include <TrackerMap.h>

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Protected Attributes

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

Private Member Functions

TLegend * buildLegend ()
 

Private Attributes

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

Detailed Description

Definition at line 77 of file TrackerMap.h.

Member Typedef Documentation

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

Definition at line 158 of file TrackerMap.h.

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

Definition at line 147 of file TrackerMap.h.

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

Definition at line 156 of file TrackerMap.h.

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

Definition at line 160 of file TrackerMap.h.

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

Definition at line 151 of file TrackerMap.h.

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

Definition at line 162 of file TrackerMap.h.

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

Definition at line 145 of file TrackerMap.h.

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

Definition at line 149 of file TrackerMap.h.

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

Definition at line 153 of file TrackerMap.h.

Constructor & Destructor Documentation

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

Definition at line 413 of file TrackerMap.cc.

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

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

Definition at line 393 of file TrackerMap.cc.

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

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

Definition at line 33 of file TrackerMap.cc.

References apvMap, apvModuleMap, MicroEventContent_cff::branch, dataDML::branchinfo, TmModule::capvids, TmModule::CcuId, ccuMap, TmCcu::cmodid, TmPsu::cmodid_HV2, TmPsu::cmodid_HV3, TmPsu::cmodid_LV, gather_cfg::cout, TmApvPair::crate, SiStripFecCabling::crates(), enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), fedMap, firstcrate, TmCcu::getCcuCrate(), TmCcu::getCcuRing(), TmCcu::getCcuSlot(), SiStripDetCabling::getConnections(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuBranch(), TmPsu::getPsuCrate(), TmPsu::getPsuDcs(), TmPsu::getPsuRack(), edm::ParameterSet::getUntrackedParameter(), TmModule::HVchannel, TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, imoduleMap, recoMuon::in, infilename, init(), sistrip::invalid32_, sistrip::invalid_, jsfilename, jsPath, crabWrapper::key, TmCcu::layer, TmModule::layer, mod(), TmApvPair::mod, TmApvPair::mpos, TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, psetAvailable, TmPsu::psId, TmModule::PsuId, TmModule::psuIdex, psuMap, psuModuleMap, relativeConstraints::ring, alignCSCRings::s, saveAsSingleLayer, saveGeoTrackerMap, saveWebInterface, slotMap, AlCaHLTBitMon_QueryRunRegistry::string, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, tkMapLog, xsize, and ysize.

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

default destructor

Definition at line 491 of file TrackerMap.cc.

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

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

Member Function Documentation

void TrackerMap::addPixel ( bool  addPixelfl)
inline

Definition at line 135 of file TrackerMap.h.

References addPixelFlag.

Referenced by DetIdSelectorTest::DetIdSelectorTest().

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

Definition at line 2817 of file TrackerMap.cc.

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

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

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

Definition at line 3623 of file TrackerMap.cc.

References mps_fire::i, legInfos_, and legKeys_.

Referenced by save().

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

Definition at line 304 of file TrackerMap.h.

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

Referenced by save_as_fedtrackermap().

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

Definition at line 313 of file TrackerMap.h.

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

Referenced by save_as_fectrackermap().

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

Definition at line 322 of file TrackerMap.h.

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

Referenced by save_as_HVtrackermap(), and save_as_psutrackermap().

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

Definition at line 334 of file TrackerMap.h.

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

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

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

Definition at line 950 of file TrackerMap.cc.

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

Referenced by save_as_fedtrackermap().

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

Definition at line 1036 of file TrackerMap.cc.

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

Referenced by save_as_fectrackermap().

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

Definition at line 1178 of file TrackerMap.cc.

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

Referenced by save_as_HVtrackermap().

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

Definition at line 1245 of file TrackerMap.cc.

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

Referenced by save_as_HVtrackermap().

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

Definition at line 538 of file TrackerMap.cc.

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

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

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

Definition at line 2509 of file TrackerMap.cc.

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

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

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

Definition at line 1101 of file TrackerMap.cc.

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

Referenced by save_as_psutrackermap().

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

Definition at line 2786 of file TrackerMap.cc.

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

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

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

Definition at line 2766 of file TrackerMap.cc.

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

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

Definition at line 2749 of file TrackerMap.cc.

References fill_current_val(), and imoduleMap.

Referenced by fillc().

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

Definition at line 2759 of file TrackerMap.cc.

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

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

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

Definition at line 2574 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2598 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2707 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2559 of file TrackerMap.cc.

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

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

Definition at line 2668 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2680 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2627 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2720 of file TrackerMap.cc.

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

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

Definition at line 2729 of file TrackerMap.cc.

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

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

Definition at line 2741 of file TrackerMap.cc.

References fillc(), and imoduleMap.

Referenced by fillc().

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

Definition at line 2585 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2547 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2640 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2653 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 2613 of file TrackerMap.cc.

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

Referenced by fillc().

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

Definition at line 193 of file TrackerMap.h.

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

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

Definition at line 3519 of file TrackerMap.cc.

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

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

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

Definition at line 675 of file TrackerMap.cc.

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

Referenced by setTitle().

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

Definition at line 2860 of file TrackerMap.cc.

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

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

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

Definition at line 219 of file TrackerMap.h.

Referenced by init().

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

Definition at line 410 of file TrackerMap.h.

Referenced by init().

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

Definition at line 143 of file TrackerMap.h.

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

Definition at line 377 of file TrackerMap.h.

Referenced by init().

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

Definition at line 139 of file TrackerMap.h.

References xsize.

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

Definition at line 140 of file TrackerMap.h.

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

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

Definition at line 440 of file TrackerMap.cc.

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

Referenced by TrackerMap().

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

Definition at line 446 of file TrackerMap.h.

Referenced by drawModule(), and init().

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

Definition at line 468 of file TrackerMap.h.

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

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

Definition at line 433 of file TrackerMap.h.

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

Definition at line 2407 of file TrackerMap.cc.

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

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

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

Definition at line 2697 of file TrackerMap.cc.

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

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

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

Definition at line 455 of file TrackerMap.h.

Referenced by init().

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

Definition at line 136 of file TrackerMap.h.

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

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

Definition at line 179 of file TrackerMap.h.

References M_PI, and phi.

Referenced by drawModule().

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

Definition at line 2442 of file TrackerMap.cc.

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

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

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

Definition at line 3188 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, mps_check::command, gather_cfg::cout, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, l1t::stage2::layer2::fedId, fedMap, symbols::filetype, findfile(), firstcrate, firstRing, runEdmFileComparison::found, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, crabWrapper::key, mps_splice::line, mod(), TmApvPair::mod, module(), TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, TmModule::notInUse(), npsuracks, ntotRing, haddnano::ofname, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, funct::pow(), printlayers(), psuMap, psuModuleMap, relativeConstraints::ring, alignCSCRings::s, save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), save_as_psutrackermap(), saveGeoTrackerMap, saveWebInterface, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, tkMapLog, makeMuonMisalignmentScenario::txtfile, and ApeEstimator_cff::width.

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

Definition at line 3536 of file TrackerMap.cc.

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

Referenced by printall(), and printonline().

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