CMS 3D CMS Logo

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

#include <TrackerMap.h>

Inheritance diagram for TrackerMap:
SiPixelTrackerMap

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Protected Attributes

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

Private Attributes

bool addPixelFlag
 
float oldz
 
bool saveAsSingleLayer
 

Detailed Description

Definition at line 20 of file TrackerMap.h.

Member Typedef Documentation

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

Definition at line 94 of file TrackerMap.h.

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

Definition at line 84 of file TrackerMap.h.

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

Definition at line 92 of file TrackerMap.h.

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

Definition at line 96 of file TrackerMap.h.

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

Definition at line 88 of file TrackerMap.h.

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

Definition at line 98 of file TrackerMap.h.

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

Definition at line 82 of file TrackerMap.h.

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

Definition at line 86 of file TrackerMap.h.

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

Definition at line 90 of file TrackerMap.h.

Constructor & Destructor Documentation

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

Definition at line 379 of file TrackerMap.cc.

References enableFedProcessing, infilename, init(), jsfilename, psetAvailable, asciidump::s, saveAsSingleLayer, title, xsize, and ysize.

379  {
380  psetAvailable=false;
381  xsize=xsize1;ysize=ysize1;
382  title=s;
383  jsfilename="CommonTools/TrackerMap/data/trackermap.txt";
384  infilename="CommonTools/TrackerMap/data/tracker.dat";
385  enableFedProcessing=false;
386  saveAsSingleLayer=false;
387  init();
388 }
bool psetAvailable
Definition: TrackerMap.h:111
std::string infilename
Definition: TrackerMap.h:109
bool enableFedProcessing
Definition: TrackerMap.h:102
bool saveAsSingleLayer
Definition: TrackerMap.h:449
void init()
Definition: TrackerMap.cc:398
std::string title
Definition: TrackerMap.h:108
string s
Definition: asciidump.py:422
std::string jsfilename
Definition: TrackerMap.h:109
TrackerMap::TrackerMap ( const edm::ParameterSet iConfig)

Definition at line 362 of file TrackerMap.cc.

References gather_cfg::cout, enableFedProcessing, edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameter(), infilename, init(), jsfilename, ncrates, psetAvailable, saveAsSingleLayer, title, xsize, and ysize.

362  {
363  psetAvailable=true;
364  xsize=340;ysize=200;
365  title=" ";
366  jsfilename="CommonTools/TrackerMap/data/trackermap.txt";
367  infilename="CommonTools/TrackerMap/data/tracker.dat";
369  saveAsSingleLayer=false;
370  if(tkmapPset.exists("trackermaptxtPath")){
371  jsfilename=tkmapPset.getUntrackedParameter<std::string>("trackermaptxtPath","")+"trackermap.txt";
372  std::cout << jsfilename << std::endl;
373  infilename=tkmapPset.getUntrackedParameter<std::string>("trackerdatPath","")+"tracker.dat";
374  std::cout << infilename << std::endl;
375  } else std::cout << "no parameters found" << std::endl;
376  init();
377 }
bool psetAvailable
Definition: TrackerMap.h:111
std::string infilename
Definition: TrackerMap.h:109
bool enableFedProcessing
Definition: TrackerMap.h:102
bool saveAsSingleLayer
Definition: TrackerMap.h:449
void init()
Definition: TrackerMap.cc:398
std::string title
Definition: TrackerMap.h:108
tuple cout
Definition: gather_cfg.py:41
std::string jsfilename
Definition: TrackerMap.h:109
TrackerMap::TrackerMap ( const edm::ParameterSet iConfig,
const edm::ESHandle< SiStripFedCabling tkFed 
)

Definition at line 30 of file TrackerMap.cc.

References apvMap, apvModuleMap, dataDML::branchinfo, TmModule::capvids, TmModule::CcuId, ccuMap, TmCcu::cmodid, TmPsu::cmodid_HV2, TmPsu::cmodid_HV3, TmPsu::cmodid_LV, gather_cfg::cout, TmApvPair::crate, SiStripFecCabling::crates(), enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, edm::ParameterSet::exists(), fecModuleMap, fedMap, TmCcu::getCcuCrate(), TmCcu::getCcuRing(), TmCcu::getCcuSlot(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuBranch(), TmPsu::getPsuCrate(), TmPsu::getPsuDcs(), TmPsu::getPsuRack(), edm::ParameterSet::getUntrackedParameter(), TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, imoduleMap, recoMuon::in, infilename, init(), sistrip::invalid32_, sistrip::invalid_, jsfilename, jsPath, combine::key, TmCcu::layer, TmModule::layer, mod(), TmApvPair::mod, TmApvPair::mpos, TmCcu::mpos, TmModule::name, nchan, ncrates, nfeccrates, TmCcu::nmod, TmPsu::nmod, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, pos, psetAvailable, TmPsu::psId, TmModule::PsuId, TmModule::psuIdex, psuMap, psuModuleMap, runTheMatrix::ret, relativeConstraints::ring, asciidump::s, saveAsSingleLayer, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, xsize, and ysize.

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

default destructor

Definition at line 448 of file TrackerMap.cc.

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

448  {
449 
450 for (int layer=1; layer < 44; layer++){
451  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
452  for (int module=1;module<200;module++) {
453  int key=layer*100000+ring*1000+module;
454  TmModule * mod = smoduleMap[key];
455  if(mod !=0 ) delete mod;
456  }
457  }
458  }
459 
460 //std::map<int , TmModule *>::iterator i_mod;
461 // for( i_mod=imoduleMap.begin();i_mod !=imoduleMap.end(); i_mod++){
462 // TmModule * mod= i_mod->second;
463 // delete mod;
464 // }
465 std::map<int , TmApvPair *>::iterator i_apv;
466  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
467  TmApvPair * apvPair= i_apv->second;
468  delete apvPair;
469  }
470 
471 
472 std::map<int , TmCcu *>::iterator i_ccu;
473  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
474  TmCcu * ccu= i_ccu->second;
475  delete ccu;
476  }
477 
478 std::map<int , TmPsu *>::iterator ipsu;
479  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
480  TmPsu * psu= ipsu->second;
481  delete psu;
482  }
483 
484 gROOT->Reset();
485 
486 
487 //for(std::vector<TColor*>::iterator col1=vc.begin();col1!=vc.end();col1++){
488 // std::cout<<(*col1)<<std::endl;}
489 }
MapCcu ccuMap
Definition: TrackerMap.h:93
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2459
int firstRing[43]
Definition: TrackerMap.h:423
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:87
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmCcu.h:5
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: TmPsu.h:6
Definition: vlib.h:209
int ntotRing[43]
Definition: TrackerMap.h:422

Member Function Documentation

void TrackerMap::addPixel ( bool  addPixelfl)
inline

Definition at line 73 of file TrackerMap.h.

References addPixelFlag.

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

Definition at line 2579 of file TrackerMap.cc.

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

Referenced by init().

2579  {
2580  // ifstream* infile;
2581 
2582  int nmods, pix_sil, fow_bar, ring, nmod, layer;
2583  unsigned int idex;
2584  float posx, posy, posz, length, width, thickness, widthAtHalfLength;
2585  int iModule=0,old_layer=0, ntotMod =0;
2586  std::string name,dummys;
2587  ifstream infile(edm::FileInPath(infilename).fullPath().c_str(),std::ios::in);
2588  while(!infile.eof()) {
2589  infile >> nmods >> pix_sil >> fow_bar >> layer >> ring >> nmod >> posx >> posy
2590  >> posz>> length >> width >> thickness
2591  >> widthAtHalfLength >> idex ;
2592  getline(infile,dummys); //necessary to reach end of record
2593  getline(infile,name);
2594  if(old_layer!=layer){old_layer=layer;iModule=0;}
2595  iModule++;
2596  ntotMod++;
2597  int key=layer*100000+ring*1000+nmod;
2598  TmModule * mod = smoduleMap[key];
2599 
2600  imoduleMap[idex]=mod;
2601 
2602  if(mod==0) std::cout << "error in module "<<key <<std::endl;
2603  else
2604  {
2605  mod->posx = posx;
2606  mod->posy = posy;
2607  mod->setUsed();
2608  mod->value=0;
2609  mod->count=0;
2610  mod->posz = posz;
2611  mod->length = length;
2612  mod->width = width;
2613  mod->thickness = thickness;
2614  mod->widthAtHalfLength = widthAtHalfLength;
2615  mod->idex = idex;
2616  mod->name = name;
2617  }
2618  }
2619  infile.close();
2620  number_modules = ntotMod-1;
2621 }
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
void setUsed()
Definition: TmModule.h:25
float posz
Definition: TmModule.h:9
int number_modules
Definition: TrackerMap.h:443
std::string infilename
Definition: TrackerMap.h:109
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
float posx
Definition: TmModule.h:9
unsigned int idex
Definition: TmModule.h:29
float posy
Definition: TmModule.h:9
int count
Definition: TmModule.h:13
float width
Definition: TmModule.h:10
float widthAtHalfLength
Definition: TmModule.h:10
float thickness
Definition: TmModule.h:10
list key
Definition: combine.py:13
list infile
Definition: EdgesToViz.py:90
tuple cout
Definition: gather_cfg.py:41
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
float length
Definition: TmModule.h:10
std::string name
Definition: TmModule.h:15
void TrackerMap::defcwindow ( int  num_crate)
inline

Definition at line 237 of file TrackerMap.h.

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

Referenced by save_as_fedtrackermap().

237  {
238  ncrate = num_crate;
239  int xoffset=xsize/3;
240  int yoffset=ysize;
241  xmin=-1.;xmax=63.; ymin = -1.; ymax=37.;
242  if((ncrate%3)==2)ix = xoffset+xsize*4/3;
243  if((ncrate%3)==1)ix = xoffset+2*xsize*4/3;
244  if((ncrate%3)==0)ix = xoffset;
245  iy = yoffset+((ncrate-1)/3)*ysize*2;
246  }
double xmin
Definition: TrackerMap.h:432
double ymax
Definition: TrackerMap.h:432
double xmax
Definition: TrackerMap.h:432
double ymin
Definition: TrackerMap.h:432
void TrackerMap::deffecwindow ( int  num_crate)
inline

Definition at line 247 of file TrackerMap.h.

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

Referenced by save_as_fectrackermap().

247  {
248  ncrate = num_crate;
249  int xoffset=xsize/3;
250  int yoffset=2*ysize;
251  xmin=-1.;xmax=37.; ymin = -10.; ymax=40.;
252  if(ncrate==1||ncrate==3)ix = xoffset+xsize*2;
253  if(ncrate==2||ncrate==4)ix = xoffset;
254  iy = yoffset+((ncrate-1)/2)*ysize*4;
255  }
double xmin
Definition: TrackerMap.h:432
double ymax
Definition: TrackerMap.h:432
double xmax
Definition: TrackerMap.h:432
double ymin
Definition: TrackerMap.h:432
void TrackerMap::defpsuwindow ( int  num_rack)
inline

Definition at line 256 of file TrackerMap.h.

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

Referenced by save_as_HVtrackermap(), and save_as_psutrackermap().

256  {
257  nrack = num_rack;
258  int xoffset=xsize/5;
259  int yoffset=ysize;
260  xmin=-1.;xmax=63.; ymin = -1.; ymax=37.;
261 
262  if((nrack%5)==1)ix = xoffset+4*int(xsize/1.5);
263  if((nrack%5)==2)ix = xoffset+3*int(xsize/1.5);
264  if((nrack%5)==3)ix = xoffset+2*int(xsize/1.5);
265  if((nrack%5)==4)ix = xoffset+int(xsize/1.5);
266  if((nrack%5)==0)ix = xoffset;
267 
268  iy = yoffset+((nrack-1)/5)*ysize*2;
269 
270  }
double xmin
Definition: TrackerMap.h:432
double ymax
Definition: TrackerMap.h:432
double xmax
Definition: TrackerMap.h:432
double ymin
Definition: TrackerMap.h:432
void TrackerMap::defwindow ( int  num_lay)
inline

Definition at line 273 of file TrackerMap.h.

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

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

273  {
274  nlay = num_lay;
275  if(posrel){ // separated modules
276  xmin=-2.;ymin=-2.;xmax=2.;ymax=2.;
277  if(nlay >12 && nlay < 19){
278  xmin=-.40;xmax=.40;ymin=-.40;ymax=.40;
279  }
280  if(nlay>30){
281  xmin=-0.1;xmax=3.;ymin=-0.1;ymax=8.5;
282  if(nlay<34){xmin=-0.3;xmax=1.0;}
283  if(nlay>33&&nlay<38){xmax=2.0;}
284  if(nlay>37){ymax=8.;}//inner
285  }
286  }else{ //overlayed modules
287  xmin=-1.3;ymin=-1.3;xmax=1.3;ymax=1.3;
288  if(nlay >12 && nlay < 19){
289  xmin=-.20;xmax=.20;ymin=-.20;ymax=.20;
290  }
291  if(nlay>30){
292  xmin=-1.5;xmax=1.5;ymin=-1.;ymax=28.;
293  if(nlay<34){xmin=-0.5;xmax=0.5;}
294  if(nlay>33&&nlay<38){xmin=-1.;xmax=1.;}
295  }
296 
297  }
298  if(nlay<16){
299  ix=0;
300  if(nlay==15||nlay==14)iy=(15-nlay)*2*ysize; else
301  {if(nlay>9&&nlay<13)iy=4*ysize-(int)(ysize/2.)+(12-nlay)*(int)(ysize/1.50);else iy=6*ysize+(9-nlay)*(int)(ysize*1.3);}}
302  if(nlay>15&&nlay<31){
303  ix=3*xsize;
304  if(nlay==16||nlay==17)iy=(nlay-16)*2*ysize; else
305  {if(nlay>18&&nlay<22)iy=4*ysize-(int)(ysize/2.)+(nlay-19)*(int)(ysize/1.50);else iy=6*ysize+(nlay-22)*(int)(ysize*1.3);}}
306  if(nlay>30){
307  if(nlay==31){ix=(int)(1.5*xsize);iy=0;}
308  if(nlay==32){int il=(nlay-30)/2;ix=xsize;iy=il*2*ysize;}
309  if(nlay==33){int il=(nlay-30)/2;ix=2*xsize;iy=il*2*ysize;}
310  if(nlay==34){int il=(nlay-30)/2;ix=xsize;iy=il*(int)(2.57*ysize);}
311  if(nlay>34 && nlay%2==0){int il=(nlay-30)/2;ix=xsize;iy=il*(int)(2.5*ysize);}
312  if(nlay>34 && nlay%2!=0){int il=(nlay-30)/2;ix=2*xsize;iy=il*(int)(2.5*ysize);}
313  }
314  }
double xmin
Definition: TrackerMap.h:432
bool posrel
Definition: TrackerMap.h:434
double ymax
Definition: TrackerMap.h:432
double xmax
Definition: TrackerMap.h:432
double ymin
Definition: TrackerMap.h:432
void TrackerMap::drawApvPair ( int  crate,
int  numfed_incrate,
bool  total,
TmApvPair apvPair,
std::ofstream *  file,
bool  useApvPairValue 
)

Definition at line 847 of file TrackerMap.cc.

References TmApvPair::blue, TmModule::blue, TmApvPair::count, TmModule::count, getcolor(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmModule::getKey(), TmApvPair::green, TmModule::green, cmsRelvalreport::green(), TmApvPair::idex, TmModule::idex, j, gen::k, TmApvPair::mod, TmModule::name, runTheMatrix::np, palette, TmApvPair::red, TmModule::red, cmsRelvalreport::red(), asciidump::s, temporary_file, TmApvPair::value, TmModule::value, xdpixelc(), and ydpixelc().

Referenced by save_as_fedtrackermap().

848 {
849  double xp[4],yp[4];
850  int color;
851  int green = 0;
852  int red = 0;
853  int blue = 0;
854  double xd[4],yd[4];
855  int np = 4;
856  double boxinitx=0., boxinity=0.;
857  double dx=.9,dy=.9;
858  int numfedch_incolumn = 12;
859  int numfedch_inrow = 8;
860  int numfed_incolumn = 5;
861  int numfed_inrow = 4;
862  boxinitx=boxinitx+(numfed_incolumn-(numfed_incrate-1)/numfed_inrow)*14.;
863  boxinity=boxinity+(numfed_inrow-(numfed_incrate-1)%numfed_inrow)*9.;
864  boxinity=boxinity+numfedch_inrow-(apvPair->getFedCh()/numfedch_incolumn);
865  boxinitx = boxinitx+numfedch_incolumn-(int)(apvPair->getFedCh()%numfedch_incolumn);
866  //std::cout << crate << " " << numfed_incrate << " " << apvPair->getFedCh()<<" "<<boxinitx<< " " << boxinity << std::endl; ;
867  xp[0]=boxinitx;yp[0]=boxinity;
868  xp[1]=boxinitx+dx;yp[1]=boxinity;
869  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
870  xp[3]=boxinitx;yp[3]=boxinity + dy;
871  for(int j=0;j<4;j++){
872  xd[j]=xdpixelc(xp[j]);yd[j]=ydpixelc(yp[j]);
873  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
874  }
875 
876  char buffer [20];
877  sprintf(buffer,"%X",apvPair->mod->idex);
878  std::string s = apvPair->mod->name;
879  s.erase(s.begin()+s.find("connected"),s.end());
880 
881  if(useApvPairValue){
882  if(apvPair->red < 0){ //use count to compute color
883  if(apvPair->count > 0) {
884  color = getcolor(apvPair->value,palette);
885  red=(color>>16)&0xFF;
886  green=(color>>8)&0xFF;
887  blue=(color)&0xFF;
888  if(!print_total)apvPair->value=apvPair->value*apvPair->count;//restore mod->value
889  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
890  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=\"";
891  } else {
892  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
893  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=\"";
894  }
895  } else {//color defined with fillc
896  if(apvPair->red>255)apvPair->red=255;
897  if(apvPair->green>255)apvPair->green=255;
898  if(apvPair->blue>255)apvPair->blue=255;
899  if(temporary_file)*svgfile << apvPair->red << " " << apvPair->green << " " << apvPair->blue << " ";
900  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=\"";
901  }
902  }else{
903  if(apvPair->mod->red < 0){ //use count to compute color
904  if(apvPair->mod->count > 0) {
905  color = getcolor(apvPair->mod->value,palette);
906  red=(color>>16)&0xFF;
907  green=(color>>8)&0xFF;
908  blue=(color)&0xFF;
909  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
910  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=\"";
911  } else {
912  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
913  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=\"";
914  }
915  } else {//color defined with fillc
916  if(apvPair->mod->red>255)apvPair->mod->red=255;
917  if(apvPair->mod->green>255)apvPair->mod->green=255;
918  if(apvPair->mod->blue>255)apvPair->mod->blue=255;
919  if(temporary_file)*svgfile << apvPair->mod->red << " " << apvPair->mod->green << " " << apvPair->mod->blue << " ";
920  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=\"";
921  }
922  }
923  if(temporary_file)*svgfile << np << " ";
924  for(int k=0;k<np;k++){
925  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
926  else *svgfile << xd[k] << "," << yd[k] << " " ;
927  }
928  if(temporary_file)*svgfile << std::endl;
929  else *svgfile <<"\" />" <<std::endl;
930 }
TmModule * mod
Definition: TmApvPair.h:16
double ydpixelc(double y)
Definition: TrackerMap.h:200
float value
Definition: TmModule.h:12
int green
Definition: TmApvPair.h:10
double xdpixelc(double x)
Definition: TrackerMap.h:194
int getFedId()
Definition: TmApvPair.h:19
int red
Definition: TmApvPair.h:10
unsigned int idex
Definition: TmModule.h:29
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:444
std::ofstream * svgfile
Definition: TrackerMap.h:436
int blue
Definition: TmApvPair.h:10
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2622
int count
Definition: TmModule.h:13
int k[5][pyjets_maxn]
int getKey()
Definition: TmModule.h:23
int green
Definition: TmModule.h:11
int count
Definition: TmApvPair.h:13
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
int idex
Definition: TmApvPair.h:14
string s
Definition: asciidump.py:422
float value
Definition: TmApvPair.h:11
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
void TrackerMap::drawCcu ( int  crate,
int  numfed_incrate,
bool  total,
TmCcu ccu,
std::ofstream *  file,
bool  useCcuValue 
)

Definition at line 931 of file TrackerMap.cc.

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

Referenced by save_as_fectrackermap().

932 {
933  double xp[4],yp[4];
934  int color;
935  int green = 0;
936  int red = 0;
937  int blue = 0;
938  double xd[4],yd[4];
939  int np = 4;
940  double boxinitx=0., boxinity=0.;
941  double dx=.9,dy=.9;
942  int numccu_incolumn = 8;
943  int numccu_inrow = 15;
944  int numfed_incolumn = 5;
945  int numfed_inrow = 4;
946  boxinitx=boxinitx+(numfed_incolumn-(numfec_incrate-1)/numfed_inrow)*14.;
947  boxinity=boxinity+(numfed_inrow-(numfec_incrate-1)%numfed_inrow)*16.;
948  boxinity=boxinity+numccu_inrow-ccu->mpos;
949  boxinitx = boxinitx+numccu_incolumn-(int)(ccu->getCcuRing()%numccu_incolumn);
950  //std::cout << crate << " " << numfec_incrate << " " << ccu->getCcuRing()<<" "<<ccu->mpos<<" "<<boxinitx<< " " << boxinity << std::endl; ;
951  xp[0]=boxinitx;yp[0]=boxinity;
952  xp[1]=boxinitx+dx;yp[1]=boxinity;
953  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
954  xp[3]=boxinitx;yp[3]=boxinity + dy;
955  for(int j=0;j<4;j++){
956  xd[j]=xdpixelfec(xp[j]);yd[j]=ydpixelfec(yp[j]);
957  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
958  }
959 
960  char buffer [20];
961  sprintf(buffer,"%X",ccu->idex);
962  //sprintf(buffer,"%X",ccu->mod->idex);
963  //std::string s = ccu->mod->name;
964  std::string s = ccu->text;
965  s.erase(s.begin()+s.find("connected"),s.end());
966 
967  if(ccu->red < 0){ //use count to compute color
968  if(ccu->count > 0) {
969  color = getcolor(ccu->value,palette);
970  red=(color>>16)&0xFF;
971  green=(color>>8)&0xFF;
972  blue=(color)&0xFF;
973  if(!print_total)ccu->value=ccu->value*ccu->count;//restore mod->value
974  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
975  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=\"";
976  } else {
977  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
978  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=\"";
979  }
980  } else {//color defined with fillc
981  if(ccu->red>255)ccu->red=255;
982  if(ccu->green>255)ccu->green=255;
983  if(ccu->blue>255)ccu->blue=255;
984  if(temporary_file)*svgfile << ccu->red << " " << ccu->green << " " << ccu->blue << " ";
985  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=\"";
986  }
987 if(temporary_file)*svgfile << np << " ";
988 for(int k=0;k<np;k++){
989  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
990  else *svgfile << xd[k] << "," << yd[k] << " " ;
991 }
992 if(temporary_file)*svgfile << std::endl;
993 else *svgfile <<"\" />" <<std::endl;
994 
995 }
double ydpixelfec(double y)
Definition: TrackerMap.h:214
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:208
int getCcuSlot()
Definition: TmCcu.h:20
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:444
std::ofstream * svgfile
Definition: TrackerMap.h:436
int green
Definition: TmCcu.h:9
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2622
int k[5][pyjets_maxn]
int mpos
Definition: TmCcu.h:18
float value
Definition: TmCcu.h:10
int idex
Definition: TmCcu.h:13
int red
Definition: TmCcu.h:9
string s
Definition: asciidump.py:422
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 1062 of file TrackerMap.cc.

References TmPsu::blueHV2, TmPsu::cmodid_HV2, TmPsu::countHV2, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::greenHV2, TmPsu::idex, j, gen::k, runTheMatrix::np, palette, TmPsu::redHV2, asciidump::s, temporary_file, TmPsu::textHV2, TmPsu::valueHV2, xdpixelpsu(), and ydpixelpsu().

Referenced by save_as_HVtrackermap().

1063 {
1064  double xp[4],yp[4];
1065  int color;
1066  int greenHV2 = 0;
1067  int redHV2 = 0;
1068  int blueHV2 = 0;
1069  double xd[4],yd[4];
1070  int np = 4;
1071  double boxinitx=35, boxinity=12;
1072  double dx=1.1,dy=1.3;
1073 
1074  boxinitx= boxinitx+(5 - numcrate_inrack)*5;
1075  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1076 
1077  xp[0]=boxinitx;yp[0]=boxinity;
1078  xp[1]=boxinitx+dx;yp[1]=boxinity;
1079  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1080  xp[3]=boxinitx;yp[3]=boxinity + dy;
1081 
1082 
1083  for(int j=0;j<4;j++){
1084  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1085  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1086  }
1087 
1088  char buffer [20];
1089  sprintf(buffer,"%X",psu->idex);
1090  std::string s = psu->textHV2;
1091  s.erase(s.begin()+s.find("connected"),s.end());
1092 
1093  if(psu->redHV2 < 0){ //use count to compute color
1094 
1095  if(psu->valueHV2 > 0){
1096  color = getcolor(psu->valueHV2,palette);
1097  redHV2=(color>>16)&0xFF;
1098  greenHV2=(color>>8)&0xFF;
1099  blueHV2=(color)&0xFF;
1100  if(!print_total)psu->valueHV2=psu->valueHV2*psu->countHV2;//restore mod->value
1101  if(temporary_file)*svgfile << redHV2 << " " << greenHV2 << " " << blueHV2 << " ";
1102  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=\"";
1103  }
1104  else{
1105  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1106  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=\"";
1107  }
1108  }
1109 
1110  else {//color defined with fillc
1111  if(psu->redHV2>255)psu->redHV2=255;
1112  if(psu->greenHV2>255)psu->greenHV2=255;
1113  if(psu->blueHV2>255)psu->blueHV2=255;
1114  if(temporary_file)*svgfile << psu->redHV2 << " " << psu->greenHV2 << " " << psu->blueHV2 << " ";
1115  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=\"";
1116  }
1117 
1118 if(temporary_file)*svgfile << np << " ";
1119 for(int k=0;k<np;k++){
1120  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1121  else *svgfile << xd[k] << "," << yd[k] << " " ;
1122 }
1123 if(temporary_file)*svgfile << std::endl;
1124 else *svgfile <<"\" />" <<std::endl;
1125 
1126 }
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
double xdpixelpsu(double x)
Definition: TrackerMap.h:222
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:444
std::ofstream * svgfile
Definition: TrackerMap.h:436
int greenHV2
Definition: TmPsu.h:21
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2622
int k[5][pyjets_maxn]
float valueHV2
Definition: TmPsu.h:25
string s
Definition: asciidump.py:422
std::string textHV2
Definition: TmPsu.h:36
int blueHV2
Definition: TmPsu.h:21
double ydpixelpsu(double y)
Definition: TrackerMap.h:228
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 1129 of file TrackerMap.cc.

References TmPsu::blueHV3, TmPsu::cmodid_HV3, TmPsu::countHV3, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::greenHV3, TmPsu::idex, j, gen::k, runTheMatrix::np, palette, TmPsu::redHV3, asciidump::s, temporary_file, TmPsu::textHV3, TmPsu::valueHV3, xdpixelpsu(), and ydpixelpsu().

Referenced by save_as_HVtrackermap().

1130 {
1131  double xp[4],yp[4];
1132  int color;
1133  int greenHV3 = 0;
1134  int redHV3 = 0;
1135  int blueHV3 = 0;
1136  double xd[4],yd[4];
1137  int np = 4;
1138  double boxinitx=36.5, boxinity=12;
1139  double dx=1.1,dy=1.3;
1140 
1141  boxinitx= boxinitx+(5 - numcrate_inrack)*5;
1142  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1143 
1144  xp[0]=boxinitx;yp[0]=boxinity;
1145  xp[1]=boxinitx+dx;yp[1]=boxinity;
1146  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1147  xp[3]=boxinitx;yp[3]=boxinity + dy;
1148 
1149 
1150  for(int j=0;j<4;j++){
1151  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1152  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1153  }
1154 
1155  char buffer [20];
1156  sprintf(buffer,"%X",psu->idex);
1157  std::string s = psu->textHV3;
1158  s.erase(s.begin()+s.find("connected"),s.end());
1159 
1160  if(psu->redHV3 < 0){ //use count to compute color
1161  if(psu->valueHV3 > 0){
1162  color = getcolor(psu->valueHV3,palette);
1163  redHV3=(color>>16)&0xFF;
1164  greenHV3=(color>>8)&0xFF;
1165  blueHV3=(color)&0xFF;
1166  if(!print_total)psu->valueHV3=psu->valueHV3*psu->countHV3;//restore mod->value
1167  if(temporary_file)*svgfile << redHV3 << " " << greenHV3 << " " << blueHV3 << " ";
1168  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=\"";
1169  }
1170  else{
1171  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1172  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=\"";
1173  }
1174  }
1175 
1176  else {//color defined with fillc
1177  if(psu->redHV3>255)psu->redHV3=255;
1178  if(psu->greenHV3>255)psu->greenHV3=255;
1179  if(psu->blueHV3>255)psu->blueHV3=255;
1180  if(temporary_file)*svgfile << psu->redHV3 << " " << psu->greenHV3 << " " << psu->blueHV3 << " ";
1181  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=\"";
1182  }
1183 
1184 if(temporary_file)*svgfile << np << " ";
1185 for(int k=0;k<np;k++){
1186  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1187  else *svgfile << xd[k] << "," << yd[k] << " " ;
1188 }
1189 if(temporary_file)*svgfile << std::endl;
1190 else *svgfile <<"\" />" <<std::endl;
1191 
1192 }
int idex
Definition: TmPsu.h:11
int getPsuBoard()
Definition: TmPsu.h:17
int greenHV3
Definition: TmPsu.h:22
double xdpixelpsu(double x)
Definition: TrackerMap.h:222
int blueHV3
Definition: TmPsu.h:22
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:444
std::ofstream * svgfile
Definition: TrackerMap.h:436
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2622
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
string s
Definition: asciidump.py:422
double ydpixelpsu(double y)
Definition: TrackerMap.h:228
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::drawModule ( TmModule mod,
int  key,
int  layer,
bool  total,
std::ofstream *  file 
)

Definition at line 495 of file TrackerMap.cc.

References TmModule::blue, TmModule::capvids, TmModule::CcuId, funct::cos(), TmModule::count, getcolor(), TmModule::green, cmsRelvalreport::green(), TmModule::HVchannel, TmModule::idex, TmModule::idModule, isRingStereo(), j, gen::k, TmModule::length, M_PI, TmModule::name, runTheMatrix::np, palette, phi, phival(), posrel, TmModule::posx, TmModule::posy, TmModule::posz, TmModule::psuIdex, csvReporter::r, TmModule::red, cmsRelvalreport::red(), TmModule::ring, funct::sin(), mathSSE::sqrt(), temporary_file, TmModule::text, TmModule::value, TmModule::width, TmModule::widthAtHalfLength, xdpixel(), and ydpixel().

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

495  {
496  //int x,y;
497  double phi,r,dx,dy, dy1;
498  double xp[4],yp[4],xp1,yp1;
499  double vhbot,vhtop,vhapo;
500  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};
501  double xt1,yt1,xs1=0.,ys1=0.,xt2,yt2,xs2,ys2,pv1,pv2;
502  int green = 0;
503  int red = 0;
504  int blue = 0;
505  double xd[4],yd[4];
506  int np = 4;
507  //int numrec=0;
508  int numod=0;
509  phi = phival(mod->posx,mod->posy);
510  r = sqrt(mod->posx*mod->posx+mod->posy*mod->posy);
511  vhbot = mod->width;
512  vhtop=mod->width;
513  vhapo=mod->length;
514  if(nlay < 31){ //endcap
515  vhbot = mod->widthAtHalfLength/2.-(mod->width/2.-mod->widthAtHalfLength/2.);
516  vhtop=mod->width/2.;
517  vhapo=mod->length/2.;
518  if(nlay >12 && nlay <19){
519  if(posrel)r = r+r;
520  xp[0]=r-vhtop;yp[0]=-vhapo;
521  xp[1]=r+vhtop;yp[1]=-vhapo;
522  xp[2]=r+vhtop;yp[2]=vhapo;
523  xp[3]=r-vhtop;yp[3]=vhapo;
524  }else{
525  if(posrel)r = r + r/3.;
526  xp[0]=r-vhapo;yp[0]=-vhbot;
527  xp[1]=r+vhapo;yp[1]=-vhtop;
528  xp[2]=r+vhapo;yp[2]=vhtop;
529  xp[3]=r-vhapo;yp[3]=vhbot;
530  }
531  for(int j=0;j<4;j++){
532  xp1 = xp[j]*cos(phi)-yp[j]*sin(phi);
533  yp1 = xp[j]*sin(phi)+yp[j]*cos(phi);
534  xp[j] = xp1;yp[j]=yp1;
535  }
536  } else { //barrel
537  numod=mod->idModule;if(numod>100)numod=numod-100;
538  int vane = mod->ring;
539  if(posrel){
540  dx = vhapo;
541  phi=M_PI;
542  xt1=rmedio[nlay-31]; yt1=-vhtop/2.;
543  xs1 = xt1*cos(phi)-yt1*sin(phi);
544  ys1 = xt1*sin(phi)+yt1*cos(phi);
545  xt2=rmedio[nlay-31]; yt2=vhtop/2.;
546  xs2 = xt2*cos(phi)-yt2*sin(phi);
547  ys2 = xt2*sin(phi)+yt2*cos(phi);
548  dy=phival(xs2,ys2)-phival(xs1,ys1);
549  dy1 = dy;
550  if(nlay==31)dy1=0.39;
551  if(nlay==32)dy1=0.23;
552  if(nlay==33)dy1=0.16;
553  xp[0]=vane*(dx+dx/8.);yp[0]=numod*(dy1);
554  xp[1]=vane*(dx+dx/8.)+dx;yp[1]=numod*(dy1);
555  xp[2]=vane*(dx+dx/8.)+dx;yp[2]=numod*(dy1)+dy;
556  xp[3]=vane*(dx+dx/8.);yp[3]=numod*(dy1)+dy;
557  }else{
558  xt1=r; yt1=-vhtop/2.;
559  xs1 = xt1*cos(phi)-yt1*sin(phi);
560  ys1 = xt1*sin(phi)+yt1*cos(phi);
561  xt2=r; yt2=vhtop/2.;
562  xs2 = xt2*cos(phi)-yt2*sin(phi);
563  ys2 = xt2*sin(phi)+yt2*cos(phi);
564  pv1=phival(xs1,ys1);
565  pv2=phival(xs2,ys2);
566  if(fabs(pv1-pv2)>M_PI && numod==1)pv1=pv1-2.*M_PI;
567  if(fabs(pv1-pv2)>M_PI && numod!=1)pv2=pv2+2.*M_PI;
568  xp[0]=mod->posz-vhapo/2.;yp[0]=4.2*pv1;
569  xp[1]=mod->posz+vhapo/2.;yp[1]=4.2*pv1;
570  xp[2]=mod->posz+vhapo/2. ;yp[2]=4.2*pv2;
571  xp[3]=mod->posz-vhapo/2.;yp[3]=4.2*pv2;
572  }
573  }
574  if(isRingStereo(key))
575  {
576  np = 3;
577  if(mod->idModule>100 ){for(int j=0;j<3;j++){
578  xd[j]=xdpixel(xp[j]);yd[j]=ydpixel(yp[j]);
579  }
580  }else {
581  xd[0]=xdpixel(xp[2]);yd[0]=ydpixel(yp[2]);
582  xd[1]=xdpixel(xp[3]);yd[1]=ydpixel(yp[3]);
583  xd[2]=xdpixel(xp[0]);yd[2]=ydpixel(yp[0]);
584  }
585  } else {
586  for(int j=0;j<4;j++){
587  xd[j]=xdpixel(xp[j]);yd[j]=ydpixel(yp[j]);
588  }
589  }
590  char buffer [20];
591  sprintf(buffer,"%X",mod->idex);
592 
593  if(mod->red < 0){ //use count to compute color
594  int color = getcolor(mod->value,palette);
595  red=(color>>16)&0xFF;
596  green=(color>>8)&0xFF;
597  blue=(color)&0xFF;
598 
599 if(!print_total)mod->value=mod->value*mod->count;//restore mod->value
600 
601  if(mod->count > 0)
602  if(temporary_file) *svgfile << red << " " << green << " " << blue << " "; else
603  *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=\"";
604  else
605  if(temporary_file) *svgfile << 255 << " " << 255 << " " << 255 << " "; else
606  *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=\"";
607  if(temporary_file) *svgfile << np << " ";
608  for(int k=0;k<np;k++){
609  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ; else
610  *svgfile << xd[k] << "," << yd[k] << " " ;
611  }
612  if(temporary_file)*svgfile << std::endl; else *svgfile <<"\" />" <<std::endl;
613  } else {//color defined with fillc
614  if(mod->red>255)mod->red=255;
615  if(mod->green>255)mod->green=255;
616  if(mod->blue>255)mod->blue=255;
617  if(temporary_file) *svgfile << mod->red << " " << mod->green << " " << mod->blue << " "; else
618  *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=\"";
619  if(temporary_file) *svgfile << np << " ";
620  for(int k=0;k<np;k++){
621  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ; else
622  *svgfile << xd[k] << "," << yd[k] << " " ;
623  }
624  if(temporary_file)*svgfile << std::endl; else *svgfile <<"\" />" <<std::endl;
625  }
626 
627 }
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:434
double phival(double x, double y)
Definition: TrackerMap.h:112
unsigned int idex
Definition: TmModule.h:29
std::string text
Definition: TmModule.h:14
float posy
Definition: TmModule.h:9
T sqrt(T t)
Definition: SSEVec.h:28
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:444
std::ofstream * svgfile
Definition: TrackerMap.h:436
double ydpixel(double y)
Definition: TrackerMap.h:180
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2622
int count
Definition: TmModule.h:13
float width
Definition: TmModule.h:10
int psuIdex
Definition: TmModule.h:19
int k[5][pyjets_maxn]
std::string capvids
Definition: TmModule.h:16
short int HVchannel
Definition: TmModule.h:20
float widthAtHalfLength
Definition: TmModule.h:10
#define M_PI
Definition: BFit3D.cc:3
int green
Definition: TmModule.h:11
int CcuId
Definition: TmModule.h:17
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
double xdpixel(double x)
Definition: TrackerMap.h:174
list key
Definition: combine.py:13
static bool isRingStereo(int key)
Definition: TrackerMap.h:384
int ring
Definition: TmModule.h:27
float length
Definition: TmModule.h:10
std::string name
Definition: TmModule.h:15
Definition: DDAxes.h:10
void TrackerMap::drawPalette ( std::ofstream *  file)

Definition at line 2276 of file TrackerMap.cc.

References getcolor(), cmsRelvalreport::green(), i, maxvalue, minvalue, palette, cmsRelvalreport::red(), and temporary_file.

Referenced by print(), and save().

2276  {
2277  int color,red, green, blue;
2278  float val=minvalue;
2279  int paletteLength = 250;
2280  float dval = (maxvalue-minvalue)/(float)paletteLength;
2281  for(int i=0;i<paletteLength;i++){
2282  color = getcolor(val,palette);
2283  red=(color>>16)&0xFF;
2284  green=(color>>8)&0xFF;
2285  blue=(color)&0xFF;
2286  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" />\n";
2287  // else *svgfile << red << " " << green << " " << blue << " 4 " << (6*i)+40 << " 3010. " <<//
2288  // (6*i)+40 << " 3060. " <<//
2289  // (6*(i-1))+40 << " 3060. " <<//
2290  // (6*(i-1))+40 <<" 3010. " << std::endl; //
2291 
2292  // if(i%50 == 0){
2293  // if(!temporary_file)*svgfile <<"<svg:rect x=\"3010\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
2294  // if(i%50==0&&!temporary_file)*svgfile << " <svg:text class=\"normalText\" x=\"3060\" y=\""<<(1560-6*i)<<"\">" <<val<<"</svg:text>"<<std::endl;
2295 
2296  if(!temporary_file)*svgfile <<"<svg:rect x=\"3610\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"6\" fill=\"rgb("<<red<<","<<green<<","<<blue<<")\" />\n";
2297  else *svgfile << red << " " << green << " " << blue << " 4 " << (6*i)+40 << " 3610. " <<//
2298  (6*i)+40 << " 3660. " <<//
2299  (6*(i-1))+40 << " 3660. " <<//
2300  (6*(i-1))+40 <<" 3610. " << std::endl; //
2301 
2302  if(i%50 == 0){
2303  if(!temporary_file)*svgfile <<"<svg:rect x=\"3610\" y=\""<<(1550-6*i)<<"\" width=\"50\" height=\"1\" fill=\"black\" />\n";
2304  if(i%50==0&&!temporary_file)*svgfile << " <svg:text class=\"normalText\" x=\"3660\" y=\""<<(1560-6*i)<<"\">" <<val<<"</svg:text>"<<std::endl;
2305  }
2306  val = val + dval;
2307  }
2308 }
int i
Definition: DBlmapReader.cc:9
float minvalue
Definition: TrackerMap.h:442
bool temporary_file
Definition: TrackerMap.h:444
std::ofstream * svgfile
Definition: TrackerMap.h:436
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2622
float maxvalue
Definition: TrackerMap.h:442
void TrackerMap::drawPsu ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 996 of file TrackerMap.cc.

References TmPsu::blue, TmPsu::cmodid_LV, TmPsu::count, getcolor(), TmPsu::getPsuBoard(), TmPsu::getPsuCrate(), TmPsu::green, cmsRelvalreport::green(), TmPsu::idex, j, gen::k, runTheMatrix::np, palette, TmPsu::red, cmsRelvalreport::red(), asciidump::s, temporary_file, TmPsu::text, TmPsu::value, xdpixelpsu(), and ydpixelpsu().

Referenced by save_as_psutrackermap().

997 {
998  double xp[4],yp[4];
999  int color;
1000  int green = 0;
1001  int red = 0;
1002  int blue = 0;
1003  double xd[4],yd[4];
1004  int np = 4;
1005  double boxinitx=35, boxinity=12;
1006  double dx=3,dy=1.3;
1007 
1008  boxinitx= boxinitx+(5 - numcrate_inrack)*5;
1009  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1010 
1011  xp[0]=boxinitx;yp[0]=boxinity;
1012  xp[1]=boxinitx+dx;yp[1]=boxinity;
1013  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1014  xp[3]=boxinitx;yp[3]=boxinity + dy;
1015 
1016 
1017  for(int j=0;j<4;j++){
1018  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1019  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1020  }
1021 
1022  char buffer [20];
1023  sprintf(buffer,"%X",psu->idex);
1024  std::string s = psu->text;
1025  s.erase(s.begin()+s.find("connected"),s.end());
1026 
1027  if(psu->red < 0){ //use count to compute color
1028  if(psu->value > 0){
1029  color = getcolor(psu->value,palette);
1030  red=(color>>16)&0xFF;
1031  green=(color>>8)&0xFF;
1032  blue=(color)&0xFF;
1033  if(!print_total)psu->value=psu->value*psu->count;//restore mod->value
1034  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
1035  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=\"";
1036  }
1037  else{
1038 
1039  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1040  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=\"";
1041  }
1042  }
1043 
1044  else {//color defined with fillc
1045  if(psu->red>255)psu->red=255;
1046  if(psu->green>255)psu->green=255;
1047  if(psu->blue>255)psu->blue=255;
1048  if(temporary_file)*svgfile << psu->red << " " << psu->green << " " << psu->blue << " ";
1049  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=\"";
1050  }
1051 
1052 if(temporary_file)*svgfile << np << " ";
1053 for(int k=0;k<np;k++){
1054  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1055  else *svgfile << xd[k] << "," << yd[k] << " " ;
1056 }
1057 if(temporary_file)*svgfile << std::endl;
1058 else *svgfile <<"\" />" <<std::endl;
1059 
1060 }
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
double xdpixelpsu(double x)
Definition: TrackerMap.h:222
int j
Definition: DBlmapReader.cc:9
bool temporary_file
Definition: TrackerMap.h:444
std::ofstream * svgfile
Definition: TrackerMap.h:436
int green
Definition: TmPsu.h:20
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2622
int k[5][pyjets_maxn]
std::string text
Definition: TmPsu.h:35
std::string cmodid_LV
Definition: TmPsu.h:32
string s
Definition: asciidump.py:422
int blue
Definition: TmPsu.h:20
double ydpixelpsu(double y)
Definition: TrackerMap.h:228
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::fill ( int  layer,
int  ring,
int  nmod,
float  x 
)

Definition at line 2548 of file TrackerMap.cc.

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

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

2548  {
2549 
2550  int key = layer*100000+ring*1000+nmod;
2551  TmModule * mod = smoduleMap[key];
2552  if(mod!=0){
2553  mod->value=mod->value+qty;
2554  mod->count++;
2555  }
2556  else std::cout << "**************************error in SvgModuleMap **************";
2557 }
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int count
Definition: TmModule.h:13
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill ( int  idmod,
float  qty 
)

Definition at line 2528 of file TrackerMap.cc.

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

2528  {
2529 
2530  TmModule * mod = imoduleMap[idmod];
2531  if(mod!=0){
2532  mod->value=mod->value+qty;
2533  mod->count++;
2534  return;
2535  }else{
2536  TmModule * mod1 = imoduleMap[idmod+1];
2537  TmModule * mod2 = imoduleMap[idmod+2];
2538  if(mod1!=0 && mod2!=0){
2539  mod1->value=mod1->value+qty;
2540  mod1->count++;
2541  mod2->value=mod2->value+qty;
2542  mod2->count++;
2543  return;
2544  }}
2545  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2546 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
int count
Definition: TmModule.h:13
tuple cout
Definition: gather_cfg.py:41
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill_all_blank ( )

Definition at line 2511 of file TrackerMap.cc.

References fill_current_val(), and imoduleMap.

Referenced by SiStripTrackerMapCreator::create().

2511  {
2512 
2513  std::map<const int , TmModule *>::iterator imod;
2514  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2515  fill_current_val(imod->first,0);
2516  }
2517 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:2521
void TrackerMap::fill_current_val ( int  idmod,
float  current_val 
)

Definition at line 2521 of file TrackerMap.cc.

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

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

2521  {
2522 
2523  TmModule * mod = imoduleMap[idmod];
2524  if(mod!=0) {mod->value=current_val; mod->count=1; mod->red=-1;}
2525  else std::cout << "**error in fill_current_val method ***module "<<idmod<<std::endl;
2526 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
int count
Definition: TmModule.h:13
int red
Definition: TmModule.h:11
tuple cout
Definition: gather_cfg.py:41
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 2336 of file TrackerMap.cc.

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

2337 {
2338  int key = fedId*1000+fedCh;
2339  TmApvPair* apvpair = apvMap[key];
2340 
2341  if(apvpair!=0) {apvpair->value=current_val; apvpair->count=1; apvpair->red=-1;}
2342  else
2343  std::cout << "*** error in FedTrackerMap fill_current_val method ***";
2344 }
int red
Definition: TmApvPair.h:10
int count
Definition: TmApvPair.h:13
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:87
tuple cout
Definition: gather_cfg.py:41
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
float  qty 
)

Definition at line 2360 of file TrackerMap.cc.

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

2361 {
2362  int key =crate*10000000+slot*100000+ring*1000+addr;
2363  TmCcu *ccu = ccuMap[key];
2364  if(ccu!=0){
2365  ccu->count++; ccu->value=ccu->value+qty;
2366  return;
2367 
2368  }
2369 
2370  std::cout << "*** error in FecTrackerMap fill by module method ***";
2371  }
MapCcu ccuMap
Definition: TrackerMap.h:93
int count
Definition: TmCcu.h:12
float value
Definition: TmCcu.h:10
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
Definition: TmCcu.h:5
void TrackerMap::fill_fed_channel ( int  fedId,
int  fedCh,
float  qty 
)

Definition at line 2469 of file TrackerMap.cc.

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

2470 {
2471  int key = fedId*1000+fedCh;
2472  TmApvPair* apvpair = apvMap[key];
2473  if(apvpair!=0){
2474  apvpair->value=apvpair->value+qty;
2475  apvpair->count++;
2476  return;
2477  }
2478  std::cout << "*** error inFedTrackerMap fill method ***";
2479 }
int count
Definition: TmApvPair.h:13
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:87
tuple cout
Definition: gather_cfg.py:41
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fed_channel ( int  modId,
float  qty 
)

Definition at line 2321 of file TrackerMap.cc.

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

2322 {
2323  std::multimap<const int, TmApvPair*>::iterator pos;
2324  for (pos = apvModuleMap.lower_bound(idmod);
2325  pos != apvModuleMap.upper_bound(idmod); ++pos) {
2326  TmApvPair* apvpair = pos->second;
2327  if(apvpair!=0){
2328  apvpair->value=apvpair->value+qty;
2329  apvpair->count++;
2330  }
2331  }
2332  return;
2333  std::cout << "*** error in FedTrackerMap fill by module method ***";
2334  }
ModApvPair apvModuleMap
Definition: TrackerMap.h:89
int count
Definition: TmApvPair.h:13
tuple cout
Definition: gather_cfg.py:41
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_hv_channel2 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2430 of file TrackerMap.cc.

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

2431 {
2432  int key = rack*1000+crate*100+board;
2433  TmPsu *psu = psuMap[key];
2434  if(psu!=0){
2435  psu->countHV2++; psu->valueHV2=psu->valueHV2+qty;
2436  return;
2437 
2438  }
2439 
2440  std::cout << "*** error in HVTrackerMap fill by module method ***";
2441  }
int countHV2
Definition: TmPsu.h:27
float valueHV2
Definition: TmPsu.h:25
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmPsu.h:6
void TrackerMap::fill_hv_channel3 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2442 of file TrackerMap.cc.

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

2443 {
2444  int key = rack*1000+crate*100+board;
2445  TmPsu *psu = psuMap[key];
2446  if(psu!=0){
2447  psu->countHV3++; psu->valueHV3=psu->valueHV3+qty;
2448  return;
2449 
2450  }
2451 
2452  std::cout << "*** error in HVTrackerMap fill by module method ***";
2453  }
list key
Definition: combine.py:13
int countHV3
Definition: TmPsu.h:28
tuple cout
Definition: gather_cfg.py:41
float valueHV3
Definition: TmPsu.h:24
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmPsu.h:6
void TrackerMap::fill_lv_channel ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2389 of file TrackerMap.cc.

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

2390 {
2391  int key = rack*1000+crate*100+board;
2392  TmPsu *psu = psuMap[key];
2393  if(psu!=0){
2394  psu->count++; psu->value=psu->value+qty;
2395  return;
2396 
2397  }
2398 
2399  std::cout << "*** error in LVTrackerMap fill by module method ***";
2400  }
int count
Definition: TmPsu.h:26
float value
Definition: TmPsu.h:23
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
MapPsu psuMap
Definition: TrackerMap.h:97
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 2482 of file TrackerMap.cc.

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

2482  {
2483 
2484  TmModule * mod = imoduleMap[idmod];
2485  if(mod!=0){
2486  mod->red=red; mod->green=green; mod->blue=blue;
2487  return;
2488  }
2489  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2490 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
tuple cout
Definition: gather_cfg.py:41
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 2491 of file TrackerMap.cc.

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

2491  {
2492 
2493  int key = layer*10000+ring*1000+nmod;
2494  TmModule * mod = smoduleMap[key];
2495 
2496  if(mod!=0){
2497  mod->red=red; mod->green=green; mod->blue=blue;
2498  return;
2499  }
2500  std::cout << "**************************error in fill method **************"<< std::endl;
2501 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fillc_all_blank ( )

Definition at line 2503 of file TrackerMap.cc.

References fillc(), and imoduleMap.

Referenced by SiStripTrackerMapCreator::create().

2503  {
2504 
2505  std::map<const int , TmModule *>::iterator imod;
2506  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2507  fillc(imod->first,255,255,255);
2508  }
2509 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:48
void TrackerMap::fillc_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
int  red,
int  green,
int  blue 
)

Definition at line 2347 of file TrackerMap.cc.

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

2348  {
2349  int key =crate*10000000+slot*100000+ring*1000+addr;
2350 
2351  TmCcu *ccu = ccuMap[key];
2352 
2353  if(ccu!=0){
2354  ccu->red=red; ccu->green=green; ccu->blue=blue;
2355  return;
2356  }
2357  std::cout << "*** error in FecTrackerMap fillc method ***";
2358 }
MapCcu ccuMap
Definition: TrackerMap.h:93
int green
Definition: TmCcu.h:9
list key
Definition: combine.py:13
int red
Definition: TmCcu.h:9
tuple cout
Definition: gather_cfg.py:41
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 2309 of file TrackerMap.cc.

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

2310 {
2311  int key = fedId*1000+fedCh;
2312  TmApvPair* apvpair = apvMap[key];
2313 
2314  if(apvpair!=0){
2315  apvpair->red=red; apvpair->green=green; apvpair->blue=blue;
2316  return;
2317  }
2318  std::cout << "*** error in FedTrackerMap fillc method ***";
2319 }
int green
Definition: TmApvPair.h:10
int red
Definition: TmApvPair.h:10
int blue
Definition: TmApvPair.h:10
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:87
tuple cout
Definition: gather_cfg.py:41
void TrackerMap::fillc_hv_channel2 ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2402 of file TrackerMap.cc.

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

2403 {
2404 
2405  int key = rack*1000+crate*100+board;
2406 
2407  TmPsu *psu = psuMap[key];
2408 
2409  if(psu!=0){
2410  psu->redHV2=red; psu->greenHV2=green; psu->blueHV2=blue;
2411  return;
2412  }
2413  std::cout << "*** error in HVTrackerMap (channel 2) fillc method ***";
2414 }
int redHV2
Definition: TmPsu.h:21
int greenHV2
Definition: TmPsu.h:21
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
MapPsu psuMap
Definition: TrackerMap.h:97
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 2415 of file TrackerMap.cc.

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

2416 {
2417 
2418  int key = rack*1000+crate*100+board;
2419 
2420  TmPsu *psu = psuMap[key];
2421 
2422  if(psu!=0){
2423  psu->redHV3=red; psu->greenHV3=green; psu->blueHV3=blue;
2424  return;
2425  }
2426  std::cout << "*** error in HVTrackerMap (channel 3) fillc method ***";
2427 }
int greenHV3
Definition: TmPsu.h:22
int blueHV3
Definition: TmPsu.h:22
int redHV3
Definition: TmPsu.h:22
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmPsu.h:6
void TrackerMap::fillc_lv_channel ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2375 of file TrackerMap.cc.

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

2376 {
2377 
2378  int key = rack*1000+crate*100+board;
2379 
2380  TmPsu *psu = psuMap[key];
2381 
2382  if(psu!=0){
2383  psu->red=red; psu->green=green; psu->blue=blue;
2384  return;
2385  }
2386  std::cout << "*** error in LVTrackerMap fillc method ***";
2387 }
int red
Definition: TmPsu.h:20
int green
Definition: TmPsu.h:20
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
int blue
Definition: TmPsu.h:20
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmPsu.h:6
int TrackerMap::find_layer ( int  ix,
int  iy 
)
inline

Definition at line 126 of file TrackerMap.h.

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

127  {
128  int add;
129  int layer=0;
130  if(iy <= xsize){//endcap+z
131  add = 15;
132  layer = ix/ysize;
133  layer = layer+add+1;
134  }
135  if(iy > xsize && iy< 3*xsize){//barrel
136  add=30;
137  if(ix < 2*ysize){
138  layer=1;
139  }else {
140  layer = ix/(2*ysize);
141  if(iy < 2*xsize)layer=layer*2+1; else layer=layer*2;
142  }
143  layer = layer+add;
144  }
145  if(iy >= 3*xsize){ //endcap-z
146  layer = ix/ysize;
147  layer = 15-layer;
148  }
149  return layer;
150  }
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
std::ifstream * TrackerMap::findfile ( std::string  filename)

Definition at line 3250 of file TrackerMap.cc.

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

Referenced by printall(), and printonline().

3250  {
3251  std::ifstream * ifilename;
3252  std::string ifname;
3253  if(jsPath!=""){
3254  ifname=jsPath+filename;
3255  ifilename = new ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3256  if(!ifilename){
3257  ifname="CommonTools/TrackerMap/data/"+filename;
3258  ifilename = new ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3259  }
3260  }else {
3261  ifname="CommonTools/TrackerMap/data/"+filename;
3262  ifilename = new ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3263  }
3264  if(!ifilename)std::cout << "File " << filename << " missing" << std::endl;
3265  return ifilename;
3266  }
std::string jsPath
Definition: TrackerMap.h:110
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:41
int TrackerMap::getcolor ( float  value,
int  palette 
)

Definition at line 2622 of file TrackerMap.cc.

References delta, cmsRelvalreport::green(), maxvalue, minvalue, cmsRelvalreport::red(), and ExpressReco_HICollisions_FallBack::x.

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

2622  {
2623  int red,green,blue;
2624  red=0;green=0;blue=0;
2625  if(palette==1){//palette1 1 - raibow
2626  float delta=(maxvalue-minvalue);
2627  float x =(value-minvalue);
2628  if(value<minvalue){red=0;green=0;blue=255;}
2629  if(value>maxvalue){red=255;green=0;blue=0;}
2630  if(value>=minvalue&&value<=maxvalue){
2631  red = (int) ( x<(delta/2) ? 0 : ( x > ((3./4.)*delta) ? 255 : 255/(delta/4) * (x-(2./4.)*delta) ) );
2632  green= (int) ( x<delta/4 ? (x*255/(delta/4)) : ( x > ((3./4.)*delta) ? 255-255/(delta/4) *(x-(3./4.)*delta) : 255 ) );
2633  blue = (int) ( x<delta/4 ? 255 : ( x > ((1./2.)*delta) ? 0 : 255-255/(delta/4) * (x-(1./4.)*delta) ) );
2634  }
2635  }
2636  if (palette==2){//palette 2 yellow-green
2637  green = (int)((value-minvalue)/(maxvalue-minvalue)*256.);
2638  if (green > 255) green=255;
2639  red = 255; blue=0;green=255-green;
2640  }
2641  return(blue|(green<<8)|(red<<16));
2642 }
dbl * delta
Definition: mlp_gen.cc:36
float minvalue
Definition: TrackerMap.h:442
float maxvalue
Definition: TrackerMap.h:442
int TrackerMap::getlayerCount ( int  subdet,
int  partdet 
)
inline

Definition at line 152 of file TrackerMap.h.

Referenced by init().

152  {
153  int ncomponent=0;
154  if(subdet == 1){ //1=pixel
155  if(partdet == 1 || partdet == 3){ //1-3=encap
156  ncomponent = 3;
157  }
158  else { ncomponent = 3; } //barrel
159  }
160  if(subdet== 2){ //2=inner silicon
161  if(partdet == 1 || partdet == 3){ //1-3=encap
162  ncomponent = 3;
163  }
164  else { ncomponent = 4; } //barrel
165  }
166  if(subdet== 3){ //3=outer silicon
167  if(partdet == 1 || partdet == 3){ //1-3=encap
168  ncomponent = 9;
169  }
170  else { ncomponent = 6; } //barrel
171  }
172  return(ncomponent);
173  }
int TrackerMap::getmoduleCount ( int  subdet,
int  partdet,
int  layer,
int  ring 
)
inline

Definition at line 349 of file TrackerMap.h.

Referenced by init().

349  {
350  int ncomponent=0;
351  int spicchif[] ={24,24,40,56,40,56,80};
352  int spicchib[] ={20,32,44,30,38,46,56,42,48,54,60,66,74};
353  int numero_layer = 0;
354 
355  if(partdet == 2){ //barrel
356  numero_layer = layer-1;
357  if(subdet== 2){ //inner
358  numero_layer = numero_layer+3;
359  }
360  if(subdet == 3){ //outer
361  numero_layer = numero_layer+7;
362  }
363  ncomponent = spicchib[numero_layer];
364  }
365  if(partdet!= 2){ //endcap
366  if(subdet== 1)ncomponent=24;//pixel
367  else
368  ncomponent = spicchif[ring-1];
369  }
370  return(ncomponent);
371  }
int TrackerMap::getNumMod ( )
inline

Definition at line 80 of file TrackerMap.h.

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

Definition at line 316 of file TrackerMap.h.

Referenced by init().

316  {
317  int ncomponent=0;
318  if(subdet== 1){ //1=pixel
319  if(partdet== 1 || partdet== 3){ //end-cap
320  ncomponent = 7;
321  }
322  else{ncomponent = 8;} //barrel
323  }
324  if(subdet== 2){ //inner-silicon
325  if(partdet== 1 || partdet== 3){ //end-cap
326  ncomponent = 3;
327  }
328  else{ncomponent = 12;} //barrel
329  }
330  if(subdet== 3){ //outer-silicon
331  if(partdet== 1){ //end-cap-z
332  if (layer== 1) ncomponent = 4;
333  if (layer== 2 || layer== 3) ncomponent = 5;
334  if (layer== 4 || layer== 5 || layer== 6) ncomponent = 6;
335  if (layer== 7 || layer== 8 || layer== 9) ncomponent = 7;
336  }
337  if(partdet== 3){ //endcap+z
338  if (layer== 9) ncomponent = 4;
339  if (layer== 8 || layer== 7) ncomponent = 5;
340  if (layer== 6 || layer== 5 || layer== 4) ncomponent = 6;
341  if (layer== 3 || layer== 2 || layer== 1) ncomponent = 7;
342  }
343  if(partdet== 2){ //barrel
344  ncomponent = 12;
345  }
346  }
347  return(ncomponent);
348  }
int TrackerMap::getxsize ( )
inline

Definition at line 76 of file TrackerMap.h.

References xsize.

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

Definition at line 77 of file TrackerMap.h.

References ysize.

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

Definition at line 398 of file TrackerMap.cc.

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

Referenced by TrackerMap().

398  {
399 
400  int ntotmod=0;
401  ix=0;iy=0; //used to compute the place of each layer in the tracker map
402  firstcall = true;
404  posrel=true;
405  palette = 1;
406  printflag=true;
407  addPixelFlag=false;
408  temporary_file=false;
409  gminvalue=0.; gmaxvalue=0.;//default global range for online rendering
410 
411  ndet = 3; // number of detectors: pixel, inner silicon, outer silicon
412  npart = 3; // number of detector parts: endcap -z, barrel, endcap +z
413 
414  //allocate module map
415  for (int subdet=1; subdet < ndet+1; subdet++){//loop on subdetectors
416  for (int detpart=1; detpart < npart+1; detpart++){//loop on subdetectors parts
417  int nlayers = getlayerCount(subdet,detpart); // compute number of layers
418  for(int layer=1; layer < nlayers+1; layer++){//loop on layers
419  int nrings = getringCount(subdet,detpart,layer);// compute number of rings
420  //fill arrays used to do the loop on the rings
421  int layer_g = nlayer(subdet,detpart,layer);
422  ntotRing[layer_g-1]=nrings;
423  firstRing[layer_g-1]=1;
424  if(subdet==3 && detpart!=2) firstRing[layer_g-1]= 8-nrings; //special numbering for TEC
425  for (int ring=firstRing[layer_g-1]; ring < ntotRing[layer_g-1]+firstRing[layer_g-1];ring++){//loop on rings
426  int nmodules = getmoduleCount(subdet,detpart,layer,ring);// compute number of modules
427  int key=0;
428  TmModule *smodule;
429  for(int module=1; module < nmodules+1; module++){//loop on modules
430  smodule = new TmModule(module,ring,layer_g);
431  key=layer_g*100000+ring*1000+module;//key identifying module
432  smoduleMap[key]=smodule;
433  ntotmod++;
434  }
435  if(isRingStereo(key))for(int module=1; module < nmodules+1; module++){//loop on stereo modules
436  smodule = new TmModule(module+100,ring,layer_g);
437  int key=layer_g*100000+ring*1000+module+100;
438  smoduleMap[key]=smodule;
439  ntotmod++;
440  }
441  }
442  }
443  }
444  }
445  build();
446 }
void build()
Definition: TrackerMap.cc:2579
float minvalue
Definition: TrackerMap.h:442
int getmoduleCount(int subdet, int partdet, int layer, int ring)
Definition: TrackerMap.h:349
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2459
bool addPixelFlag
Definition: TrackerMap.h:450
int getlayerCount(int subdet, int partdet)
Definition: TrackerMap.h:152
int firstRing[43]
Definition: TrackerMap.h:423
float gminvalue
Definition: TrackerMap.h:441
bool posrel
Definition: TrackerMap.h:434
int getringCount(int subdet, int partdet, int layer)
Definition: TrackerMap.h:316
bool temporary_file
Definition: TrackerMap.h:444
bool printflag
Definition: TrackerMap.h:101
int nlayer(int det, int part, int lay)
Definition: TrackerMap.h:393
list key
Definition: combine.py:13
float gmaxvalue
Definition: TrackerMap.h:441
float maxvalue
Definition: TrackerMap.h:442
bool firstcall
Definition: TrackerMap.h:435
static bool isRingStereo(int key)
Definition: TrackerMap.h:384
Definition: vlib.h:209
int ntotRing[43]
Definition: TrackerMap.h:422
static bool TrackerMap::isRingStereo ( int  key)
inlinestatic

Definition at line 384 of file TrackerMap.h.

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

384  {
385  int layer=key/100000;
386  int ring = key - layer*100000;
387  ring = ring/1000;
388  if(layer==34 || layer==35 || layer==38 || layer==39) return true;
389  if(layer<13 || (layer>18&&layer<31))
390  if(ring==1 || ring==2 || ring==5)return true;
391  return false;
392  }
list key
Definition: combine.py:13
std::string TrackerMap::layername ( int  layer)
inline

Definition at line 406 of file TrackerMap.h.

References asciidump::s.

406  {
407  std::string s= " ";
408  std::ostringstream ons;
409 
410  if(layer < 10) ons << "TEC -z Layer " << layer;
411  if(layer < 13 && layer > 9) ons << "TID -z Layer " << layer-9;
412  if(layer < 16 && layer > 12) ons << "FPIX -z Layer " << layer-12;
413  if(layer < 19 && layer > 15) ons << "FPIX +z Layer " << layer-15;
414  if(layer < 22 && layer > 18) ons << "TID +z Layer " << layer-18;
415  if(layer < 31 && layer > 21) ons << "TEC +z Layer " << layer-21;
416  if(layer < 34 && layer > 30) ons << "TPB Layer " << layer-30;
417  if(layer < 38 && layer > 33) ons << "TIB Layer " << layer-33;
418  if(layer > 37) ons << "TOB Layer " << layer-37;
419  s = ons.str();
420  return s;
421  }
string s
Definition: asciidump.py:422
static int TrackerMap::layerno ( int  subdet,
int  leftright,
int  layer 
)
inlinestatic

Definition at line 372 of file TrackerMap.h.

372  {
373  if(subdet==6&&leftright==1)return(10-layer);
374  if(subdet==6&&leftright==2)return(layer+21);
375  if(subdet==4&&leftright==1)return(4-layer+9);
376  if(subdet==4&&leftright==2)return(layer+18);
377  if(subdet==2&&leftright==1)return(4-layer+12);
378  if(subdet==2&&leftright==2)return(layer+15);
379  if(subdet==1)return(layer+30);
380  if(subdet==3)return(layer+33);
381  if(subdet==5)return(layer+37);
382  }
void TrackerMap::load ( std::string  s = "tmap.svg")

Definition at line 2174 of file TrackerMap.cc.

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

2174  {
2175  inputfile = new ifstream(inputfilename.c_str(),std::ios::in);
2176  std::string line,value;
2177  int ipos,ipos1,ipos2,id=0,val=0;
2178  int nline=0;
2179  while (getline( *inputfile, line ))
2180  {
2181  ipos1 = line.find("value=\"");
2182  if(ipos1 > 0) {
2183  value = line.substr(ipos1+7,10);
2184  ipos = value.find("\"");
2185  value = value.substr(0,ipos);
2186  val=atoi(value.c_str());
2187  }
2188  ipos2 = line.find("detid=\"");
2189  if(ipos2 > 0) {
2190  value = line.substr(ipos2+7,10);
2191  ipos = value.find("\"");
2192  value = value.substr(0,ipos);
2193  id = atoi(value.c_str());
2194  }
2195  if(ipos1>0 && ipos2>0 && val>0)this->fill(id,val);
2196  if(ipos1>0 && ipos2>0)nline++;
2197  //if(ipos1>0 && ipos2>0)std::cout << nline << " " << id << " " << val << std::endl;
2198 
2199  }
2200  std::cout << nline << " modules found in this svg file " << std::endl;
2201  inputfile->close();delete inputfile;
2202  }
std::ifstream * inputfile
Definition: TrackerMap.h:439
tuple cout
Definition: gather_cfg.py:41
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:2548
int TrackerMap::module ( int  fedId,
int  fedCh 
)

Definition at line 2459 of file TrackerMap.cc.

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

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

2460 {
2461  int key = fedId*1000+fedCh;
2462  TmApvPair* apvpair = apvMap[key];
2463  if(apvpair!=0){
2464  return(apvpair->mod->idex);
2465  }
2466  return(0);
2467  std::cout << "*** error in FedTrackerMap module method ***";
2468 }
TmModule * mod
Definition: TmApvPair.h:16
unsigned int idex
Definition: TmModule.h:29
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:87
tuple cout
Definition: gather_cfg.py:41
int TrackerMap::nlayer ( int  det,
int  part,
int  lay 
)
inline

Definition at line 393 of file TrackerMap.h.

Referenced by init().

393  {
394  if(det==3 && part==1) return lay;
395  if(det==2 && part==1) return lay+9;
396  if(det==1 && part==1) return lay+12;
397  if(det==1 && part==3) return lay+15;
398  if(det==2 && part==3) return lay+18;
399  if(det==3 && part==3) return lay+21;
400  if(det==1 && part==2) return lay+30;
401  if(det==2 && part==2) return lay+33;
402  if(det==3 && part==2) return lay+37;
403  return -1;
404  }
part
Definition: HCALResponse.h:21
double TrackerMap::phival ( double  x,
double  y 
)
inline

Definition at line 112 of file TrackerMap.h.

References M_PI, and phi.

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

112  {
113  double phi;
114  double phi1=atan(y/x);
115  phi = phi1;
116  if(y<0. && x>0) phi = phi1+2.*M_PI;
117  if(x<0.)phi=phi1+M_PI;
118  if(fabs(y)<0.000001 && x>0)phi=0;
119  if(fabs(y)<0.000001&&x<0)phi=M_PI;
120  if(fabs(x)<0.000001&&y>0)phi=M_PI/2.;
121  if(fabs(x)<0.000001&&y<0)phi=3.*M_PI/2.;
122 
123  return phi;
124  }
#define M_PI
Definition: BFit3D.cc:3
Definition: DDAxes.h:10
void TrackerMap::print ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap" 
)

Definition at line 2209 of file TrackerMap.cc.

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

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

2209  {
2210  temporary_file=false;
2211  std::ostringstream outs;
2212  minvalue=minval; maxvalue=maxval;
2213  outs << outputfilename << ".xml";
2214  svgfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2215  jsfile = new ifstream(edm::FileInPath(jsfilename).fullPath().c_str(),std::ios::in);
2216 
2217  //copy javascript interface from trackermap.txt file
2218  std::string line;
2219  while (getline( *jsfile, line ))
2220  {
2221  *svgfile << line << std::endl;
2222  }
2223  jsfile->close();delete jsfile;
2224  //
2225  if(!print_total){
2226  for (int layer=1; layer < 44; layer++){
2227  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2228  for (int module=1;module<200;module++) {
2229  int key=layer*100000+ring*1000+module;
2230  TmModule * mod = smoduleMap[key];
2231  if(mod !=0 && !mod->notInUse()){
2232  mod->value = mod->value / mod->count;
2233  }
2234  }
2235  }
2236  }
2237  }
2238  if(minvalue>=maxvalue){
2239  minvalue=9999999.;
2240  maxvalue=-9999999.;
2241  for (int layer=1; layer < 44; layer++){
2242  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2243  for (int module=1;module<200;module++) {
2244  int key=layer*100000+ring*1000+module;
2245  TmModule * mod = smoduleMap[key];
2246  if(mod !=0 && !mod->notInUse()){
2247  if (minvalue > mod->value)minvalue=mod->value;
2248  if (maxvalue < mod->value)maxvalue=mod->value;
2249  }
2250  }
2251  }
2252  }
2253 }
2254  for (int layer=1; layer < 44; layer++){
2255  nlay=layer;
2256  defwindow(nlay);
2257  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2258  for (int module=1;module<200;module++) {
2259  int key=layer*100000+ring*1000+module;
2260  TmModule * mod = smoduleMap[key];
2261  if(mod !=0 && !mod->notInUse()){
2262  drawModule(mod,key,layer,print_total,svgfile);
2263  }
2264  }
2265  }
2266  }
2267  *svgfile << "</svg:g></svg:svg>"<<std::endl;
2268  *svgfile << " <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">"<<title<<"</svg:text>"<<std::endl;
2270  *svgfile << "</svg:svg>"<<std::endl;
2271  *svgfile << "</body></html>"<<std::endl;
2272  svgfile->close();delete svgfile;
2273 
2274 }
float minvalue
Definition: TrackerMap.h:442
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2459
void defwindow(int num_lay)
Definition: TrackerMap.h:273
int firstRing[43]
Definition: TrackerMap.h:423
bool temporary_file
Definition: TrackerMap.h:444
void drawPalette(std::ofstream *file)
Definition: TrackerMap.cc:2276
std::ofstream * svgfile
Definition: TrackerMap.h:436
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:495
int count
Definition: TmModule.h:13
tuple out
Definition: dbtoconf.py:99
bool printflag
Definition: TrackerMap.h:101
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:108
list key
Definition: combine.py:13
float maxvalue
Definition: TrackerMap.h:442
std::ifstream * jsfile
Definition: TrackerMap.h:438
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:209
int ntotRing[43]
Definition: TrackerMap.h:422
std::string jsfilename
Definition: TrackerMap.h:109
void TrackerMap::printall ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap" 
)

Definition at line 2944 of file TrackerMap.cc.

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

2944  {
2945 //Copy interface
2946  std::ofstream * ofilename;
2947  std::ifstream * ifilename;
2948  std::ostringstream ofname;
2949  std::string ifname;
2950  std::string line;
2951  std::string command;
2952 
2953  ifilename=findfile("viewerHeader.xhtml");
2954  ofname << outputfilename << "viewer.html";
2955  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2956  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2957 *ofilename <<" var tmapname=\"" <<outputfilename << "\""<<std::endl;
2958 *ofilename <<" var tmaptitle=\"" <<title << "\""<<std::endl;
2959 *ofilename <<" var ncrates=" <<ncrates << ";"<<std::endl;
2960 *ofilename <<" var nfeccrates=" <<nfeccrates << ";"<<std::endl;
2961 *ofilename <<" var npsuracks=" <<npsuracks << ";"<<std::endl;
2962  ifilename->close();delete ifilename;
2963  ifilename=findfile("viewerTrailer.xhtml");
2964  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2965  ofilename->close();delete ofilename;
2966  ifilename->close();delete ifilename;
2967  command = "sed -i \"s/XtmapnameX/"+outputfilename+"/g\" "+ ofname.str();
2968  std::cout << "Executing " << command << std::endl;
2969  system(command.c_str());
2970  command = "sed -i \"s/XtmaptitleX/"+title+"/g\" "+ ofname.str();
2971  std::cout << "Executing " << command << std::endl;
2972  system(command.c_str());
2973  ofname.str("");
2974 
2975 ifilename=findfile("jqviewer.js");
2976  ofname << "jqviewer.js";
2977  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2978  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2979  ofilename->close();delete ofilename;
2980  ifilename->close();delete ifilename;
2981 
2982  ofname.str("");
2983  ifilename=findfile("crate.js");
2984  ofname << "crate.js";
2985  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2986  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2987  ofilename->close();delete ofilename;
2988  ifilename->close();delete ifilename;
2989 
2990  ofname.str("");
2991  ifilename=findfile("feccrate.js");
2992  ofname << "feccrate.js";
2993  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2994  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2995  ofilename->close();delete ofilename;
2996  ifilename->close();delete ifilename;
2997 
2998  ofname.str("");
2999  ifilename=findfile("rack.js");
3000  ofname << "rack.js";
3001  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3002  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3003  ofilename->close();delete ofilename;
3004  ifilename->close();delete ifilename;
3005 
3006  ofname.str("");
3007  ifilename=findfile("rackhv.js");
3008  ofname << "rackhv.js";
3009  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3010  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3011  ofilename->close();delete ofilename;
3012  ifilename->close();delete ifilename;
3013 
3014  ofname.str("");
3015  ifilename=findfile("layer.js");
3016  ofname << "layer.js";
3017  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
3018  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
3019  ofilename->close();delete ofilename;
3020  ifilename->close();delete ifilename;
3021 
3022  command = "scp -r ../../DQM/TrackerCommon/test/jquery/ .";
3023  std::cout << "Executing " << command << std::endl;
3024  system(command.c_str());
3025  command = "scp -r ../../CommonTools/TrackerMap/data/images/ .";
3026  std::cout << "Executing " << command << std::endl;
3027  system(command.c_str());
3028 
3029 
3030  std::ostringstream outs;
3031  outs << outputfilename<<".png";
3032 save(true,minval,maxval,outs.str(),3000,1600);
3033 temporary_file=false;
3034 printlayers(true,minval,maxval,outputfilename);
3035 
3036 //Now print a text file for each layer
3037  std::ofstream * txtfile;
3038 for (int layer=1; layer < 44; layer++){
3039  std::ostringstream outs;
3040  outs << outputfilename <<"layer"<<layer<< ".html";
3041  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3042  *txtfile << "<html><head></head> <body>" << std::endl;
3043  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3044  for (int module=1;module<200;module++) {
3045  int key=layer*100000+ring*1000+module;
3046  TmModule * mod = smoduleMap[key];
3047  if(mod !=0 && !mod->notInUse()){
3048  int idmod=mod->idex;
3049  int nchan=0;
3050  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3051  std::multimap<const int, TmApvPair*>::iterator pos;
3052  for (pos = apvModuleMap.lower_bound(idmod);
3053  pos != apvModuleMap.upper_bound(idmod); ++pos) {
3054  TmApvPair* apvpair = pos->second;
3055  if(apvpair!=0){
3056  nchan++;
3057  *txtfile << apvpair->text << std::endl;
3058  }
3059 
3060  }
3061  *txtfile << "</pre><h3>"<< mod->name<<"</h3>"<<std::endl;
3062  }
3063  }
3064  }
3065  *txtfile << "</body></html>" << std::endl;
3066  txtfile->close();delete txtfile;
3067  }
3069  std::ostringstream outs1,outs2;
3070  outs1 << outputfilename<<"fed.png";
3071 save_as_fedtrackermap(true,0.,0.,outs1.str(),6000,3200);
3072  outs2 << outputfilename<<".xml";
3073 save_as_fedtrackermap(true,0.,0.,outs2.str(),3000,1600);
3074 //And a text file for each crate
3075  std::map<int , int>::iterator i_fed;
3076  std::ofstream * txtfile;
3077  for (int crate=1; crate < (ncrates+1); crate++){
3078  std::ostringstream outs;
3079  outs << outputfilename <<"crate"<<crate<< ".html";
3080  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3081  *txtfile << "<html><head></head> <body>" << std::endl;
3082  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
3083  if(i_fed->second == crate){
3084  int fedId = i_fed->first;
3085  for (int nconn=0;nconn<96;nconn++){
3086  int key = fedId*1000+nconn;
3087  TmApvPair * apvPair= apvMap[key];
3088  if(apvPair !=0){
3089  int idmod=apvPair->idex;
3090  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3091  *txtfile << apvPair->text << std::endl;
3092  std::ostringstream outs;
3093  outs << "fedchannel " <<apvPair->getFedId() << "/"<<apvPair->getFedCh()<<" connects to module " << apvPair->mod->idex ;
3094  *txtfile << "</pre><h3>"<< outs.str()<<"</h3>"<<std::endl;
3095  }
3096  }
3097  }
3098  }
3099  *txtfile << "</body></html>" << std::endl;
3100  txtfile->close();delete txtfile;
3101  }
3102  }
3104  std::ostringstream outs1,outs2;
3105  outs1 << outputfilename<<"fec.png";
3106 save_as_fectrackermap(true,0.,0.,outs1.str(),6000,3200);
3107  outs2 << outputfilename<<".xml";
3108 save_as_fectrackermap(true,0.,0.,outs2.str(),3000,1600);
3109 //And a text file for each crate
3110  std::ofstream * txtfile;
3111  std::map<int , TmCcu *>::iterator i_ccu;
3112  std::multimap<TmCcu*, TmModule*>::iterator it;
3113  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
3114  for (int crate=1; crate < (nfeccrates+1); crate++){
3115  std::ostringstream outs;
3116  outs << outputfilename <<"feccrate"<<crate<< ".html";
3117  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3118  *txtfile << "<html><head></head> <body>" << std::endl;
3119  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
3120  TmCcu * ccu= i_ccu->second;
3121  if(ccu!=0&&ccu->getCcuCrate() == crate){
3122  int idmod=ccu->idex;
3123  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
3124  *txtfile << ccu->text << std::endl;
3125  std::ostringstream outs;
3126  if(ccu->nmod==0)outs << "ccu is in position" << ccu->mpos<<"in ring but doesn't seem to have any module connected"; else
3127  {
3128  outs << "ccu is in position " << ccu->mpos<<" in ring and connects " <<ccu->nmod<< " modules" << std::endl;
3129  ret = fecModuleMap.equal_range(ccu);
3130  for (it = ret.first; it != ret.second; ++it)
3131  {
3132  outs << (*it).second->idex<<" " << (*it).second->name <<" value= "<< (*it).second->value<<"\n\n";
3133  }
3134 
3135  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3136  }//ifccu->nmod==0
3137  }//if ccu!=0
3138  }//for i_ccu
3139  *txtfile << "</body></html>" << std::endl;
3140  txtfile->close();
3141  }//for int crate
3142  }
3143 if(enableLVProcessing){
3144  std::ostringstream outs3,outs4;
3145  outs3 << outputfilename<<"psu.png";
3146 save_as_psutrackermap(true,0.,0.,outs3.str(),6000,3200);
3147 
3148  outs4 << outputfilename<<".xml";
3149 save_as_psutrackermap(true,0.,0.,outs4.str(),3000,1600);
3150 //And a text file for each rack
3151 
3152  std::ofstream * txtfile;
3153  std::map<int , TmPsu *>::iterator ipsu;
3154  std::multimap<TmPsu*, TmModule*>::iterator it;
3155  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3156  for (int rack=1; rack < (npsuracks+1); rack++){
3157  std::ostringstream outs;
3158 
3159  outs << outputfilename <<"psurack"<<rack<< ".html";
3160  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3161  *txtfile << "<html><head></head> <body>" << std::endl;
3162  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3163  TmPsu * psu= ipsu->second;
3164  if(psu!=0 && psu->getPsuRack() == rack){
3165  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3166  *txtfile << psu->text << std::endl;
3167  std::ostringstream outs;
3168  if(psu->nmod==0)outs << "Ps is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3169  {
3170  outs<< "PS is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmod<<" modules. "<<std::endl;
3171 
3172  ret = psuModuleMap.equal_range(psu);
3173  for (it = ret.first; it != ret.second; ++it)
3174  {
3175  outs <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;
3176 
3177  }
3178  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
3179  }
3180  }
3181  }
3182  *txtfile << "</body></html>" << std::endl;
3183  txtfile->close();
3184  }
3185  }
3186 
3187 
3188 if(enableHVProcessing){
3189  std::ostringstream outs5,outs6;
3190  outs5 << outputfilename<<"hv.png";
3191 save_as_HVtrackermap(true,0.,0.,outs5.str(),6000,3200);
3192 
3193  outs6 << outputfilename<<".xml";
3194 save_as_HVtrackermap(true,0.,0.,outs6.str(),3000,1600);
3195 //And a text file for each rack
3196 
3197  std::ofstream * txtfile;
3198  std::map<int , TmPsu *>::iterator ipsu;
3199  std::multimap<TmPsu*, TmModule*>::iterator it;
3200  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
3201  for (int rack=1; rack < (npsuracks+1); rack++){
3202  std::ostringstream outs;
3203 
3204  outs << outputfilename <<"HVrack"<<rack<< ".html";
3205  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3206  *txtfile << "<html><head></head> <body>" << std::endl;
3207  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
3208  TmPsu * psu= ipsu->second;
3209  if(psu!=0 && psu->getPsuRack() == rack){
3210  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
3211  *txtfile << psu->textHV2 << std::endl;
3212  std::ostringstream outsHV2;
3213  if(psu->nmodHV2==0)outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3214  {
3215  outsHV2<< "HV Channel002 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV2<<" modules. "<<" <br>"<<std::endl;
3216 
3217  ret = psuModuleMap.equal_range(psu);
3218  for (it = ret.first; it != ret.second; ++it)
3219  {
3220  if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3221  }
3222  *txtfile << "</pre><h4>"<< outsHV2.str()<<"</h4>"<<std::endl;
3223  }
3224 
3225  *txtfile << psu->textHV3 << std::endl;
3226  std::ostringstream outsHV3;
3227  if(psu->nmodHV3==0)outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
3228  {
3229  outsHV3<< "HV Channel003 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV3<<" modules. "<<" <br>"<<std::endl;
3230 
3231  ret = psuModuleMap.equal_range(psu);
3232  for (it = ret.first; it != ret.second; ++it)
3233  {
3234  if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
3235  }
3236  *txtfile << "</pre><h4>"<< outsHV3.str()<<"</h4>"<<std::endl;
3237  }
3238 
3239  }
3240  }
3241  *txtfile << "</body></html>" << std::endl;
3242  txtfile->close();
3243  }
3244  }
3245 
3246 
3247 }
TmModule * mod
Definition: TmApvPair.h:16
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:89
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:3250
int nfeccrates
Definition: TrackerMap.h:430
MapCcu ccuMap
Definition: TrackerMap.h:93
void save_as_psutrackermap(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:1700
int nmodHV3
Definition: TmPsu.h:31
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int idex
Definition: TmPsu.h:11
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2459
bool enableFecProcessing
Definition: TrackerMap.h:103
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:1435
int npsuracks
Definition: TrackerMap.h:431
int getPsuBoard()
Definition: TmPsu.h:17
bool enableFedProcessing
Definition: TrackerMap.h:102
int firstRing[43]
Definition: TrackerMap.h:423
int nmod
Definition: TmCcu.h:15
bool enableHVProcessing
Definition: TrackerMap.h:105
int getFedId()
Definition: TmApvPair.h:19
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:632
bool temporary_file
Definition: TrackerMap.h:444
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:3267
tuple out
Definition: dbtoconf.py:99
int mpos
Definition: TmCcu.h:18
SvgFed fedMap
Definition: TrackerMap.h:91
PsuModule psuModuleMap
Definition: TrackerMap.h:99
FecModule fecModuleMap
Definition: TrackerMap.h:95
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:108
int idex
Definition: TmCcu.h:13
list key
Definition: combine.py:13
std::string textHV3
Definition: TmPsu.h:37
SvgApvPair apvMap
Definition: TrackerMap.h:87
std::string text
Definition: TmPsu.h:35
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1949
int idex
Definition: TmApvPair.h:14
tuple cout
Definition: gather_cfg.py:41
bool enableLVProcessing
Definition: TrackerMap.h:104
std::string textHV2
Definition: TmPsu.h:36
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmCcu.h:5
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::string text
Definition: TmCcu.h:11
Definition: TmPsu.h:6
Definition: vlib.h:209
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1194
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:422
void TrackerMap::printlayers ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "layer" 
)

Definition at line 3267 of file TrackerMap.cc.

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

Referenced by printall(), and printonline().

3267  {
3268  std::ofstream * xmlfile;
3269 saveAsSingleLayer=true;
3270 if(!print_total){
3271  for (int layer=1; layer < 44; layer++){
3272  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3273  for (int module=1;module<200;module++) {
3274  int key=layer*100000+ring*1000+module;
3275  TmModule * mod = smoduleMap[key];
3276  if(mod !=0 && !mod->notInUse()){
3277  mod->value = mod->value / mod->count;
3278  }
3279  }
3280  }
3281  }
3282  }
3283  if(minvalue>=maxvalue){
3284  minvalue=9999999.;
3285  maxvalue=-9999999.;
3286  for (int layer=1; layer < 44; layer++){
3287  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3288  for (int module=1;module<200;module++) {
3289  int key=layer*100000+ring*1000+module;
3290  TmModule * mod = smoduleMap[key];
3291  if(mod !=0 && !mod->notInUse()){
3292  if (minvalue > mod->value)minvalue=mod->value;
3293  if (maxvalue < mod->value)maxvalue=mod->value;
3294  }
3295  }
3296  }
3297  }
3298  }
3299 for (int layer=1; layer < 44; layer++){
3300  std::ostringstream outs;
3301  outs << outputfilename <<"layer"<<layer<< ".xml";
3302  xmlfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3303  *xmlfile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
3304  *xmlfile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
3305  *xmlfile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
3306  *xmlfile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
3307  *xmlfile << "<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />"<<std::endl;
3308  *xmlfile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerLayer.init()\">"<<std::endl;
3309  if(layer<31)*xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > "<<std::endl;
3310  else *xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > "<<std::endl;
3311  *xmlfile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
3312  *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;
3313  *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;
3314  *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;
3315  *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;
3316  *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;
3317 
3318  nlay=layer;
3319  defwindow(nlay);
3320  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3321  for (int module=1;module<200;module++) {
3322  int key=layer*100000+ring*1000+module;
3323  TmModule * mod = smoduleMap[key];
3324  if(mod !=0 && !mod->notInUse()){
3325  drawModule(mod,key,layer,print_total,xmlfile);
3326  }
3327  }
3328  }
3329  *xmlfile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
3330  *xmlfile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
3331  *xmlfile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
3332  *xmlfile << "<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
3333  *xmlfile << "<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
3334  if(layer > 33){
3335  *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;
3336  *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;
3337  *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;
3338  *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;
3339  *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;
3340  }
3341  else{
3342  *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;
3343  *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;
3344  *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;
3345  *xmlfile << "<tspan mapAttribute=\"hv\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"24\" y=\"319\" font-size=\"12\" font-family=\"arial\" fill=\"white\">HV</tspan> " <<std::endl;
3346  *xmlfile << "<tspan mapAttribute=\"plot\" onclick=\"chooseMap(evt);\" onmouseover=\"chooseMap(evt);\" onmouseout=\"chooseMap(evt);\" x=\"17\" y=\"360\" font-size=\"12\" font-family=\"arial\" fill=\"white\">PLOT</tspan> " <<std::endl;
3347  }
3348  *xmlfile << " </text> </svg>" << std::endl;
3349  xmlfile->close();delete xmlfile;
3350  }
3351 saveAsSingleLayer=false;
3352 }
float minvalue
Definition: TrackerMap.h:442
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2459
void defwindow(int num_lay)
Definition: TrackerMap.h:273
int firstRing[43]
Definition: TrackerMap.h:423
bool saveAsSingleLayer
Definition: TrackerMap.h:449
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:495
int count
Definition: TmModule.h:13
tuple out
Definition: dbtoconf.py:99
bool notInUse()
Definition: TmModule.h:24
list key
Definition: combine.py:13
float maxvalue
Definition: TrackerMap.h:442
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:209
int ntotRing[43]
Definition: TrackerMap.h:422
void TrackerMap::printonline ( )

Definition at line 2643 of file TrackerMap.cc.

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

Referenced by SiStripTrackerMapCreator::create().

2643  {
2644 //Copy interface
2645  std::ofstream * ofilename;
2646  std::ifstream * ifilename;
2647  std::ostringstream ofname;
2648  std::string ifname;
2649  std::string command;
2650  std::string line;
2651  std::string outputfilename="dqmtmap";
2652  ifilename=findfile("viewerHeader.xhtml");
2653  ofname << outputfilename << "viewer.html";
2654  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2655  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2656 *ofilename <<" var tmapname=\"" <<outputfilename << "\""<<std::endl;
2657 *ofilename <<" var tmaptitle=\"" <<title << "\""<<std::endl;
2658 *ofilename <<" var ncrates=" <<ncrates << ";"<<std::endl;
2659 *ofilename <<" var nfeccrates=" <<nfeccrates << ";"<<std::endl;
2660  *ofilename <<" var npsuracks=" <<npsuracks << ";"<<std::endl;
2661 
2662  ifilename->close();delete ifilename;
2663 
2664  ifilename=findfile("viewerTrailer.xhtml");
2665  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2666  ofilename->close();delete ofilename;
2667  command = "sed -i \"s/XtmapnameX/"+outputfilename+"/g\" "+ ofname.str();
2668  std::cout << "Executing " << command << std::endl;
2669  system(command.c_str());
2670  command = "sed -i \"s/XtmaptitleX/"+title+"/g\" "+ ofname.str();
2671  std::cout << "Executing " << command << std::endl;
2672  system(command.c_str());
2673  ofname.str("");
2674  ifilename->close();delete ifilename;
2675 
2676  ifilename=findfile("jqviewer.js");
2677  ofname << "jqviewer.js";
2678  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2679  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2680  ofname.str("");
2681  ofilename->close();delete ofilename;
2682  ifilename->close();delete ifilename;
2683 
2684  ifilename=findfile("crate.js");
2685  ofname << "crate.js";
2686  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2687  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2688  ofname.str("");
2689  ofilename->close();delete ofilename;
2690  ifilename->close();delete ifilename;
2691 
2692  ifilename=findfile("feccrate.js");
2693  ofname << "feccrate.js";
2694  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2695  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2696  ofname.str("");
2697  ofilename->close();delete ofilename;
2698  ifilename->close();delete ifilename;
2699 
2700  ifilename=findfile("layer.js");
2701  ofname << "layer.js";
2702  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2703  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2704  ofname.str("");
2705  ofilename->close();delete ofilename;
2706  ifilename->close();delete ifilename;
2707 
2708  ifilename=findfile("rack.js");
2709  ofname << "rack.js";
2710  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2711  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2712  ofname.str("");
2713  ofilename->close();delete ofilename;
2714  ifilename->close();delete ifilename;
2715  ofname.str("");
2716 
2717  ifilename=findfile("rackhv.js");
2718  ofname << "rackhv.js";
2719  ofilename = new std::ofstream(ofname.str().c_str(),std::ios::out);
2720  while (getline( *ifilename, line )) { *ofilename << line << std::endl; }
2721  ofname.str("");
2722  ofilename->close();delete ofilename;
2723  ifilename->close();delete ifilename;
2724 
2725 
2726 
2727 
2728  std::ostringstream outs,outs1,outs2;
2729  outs << outputfilename<<".png";
2730 save(true,gminvalue,gmaxvalue,outs.str(),3000,1600);
2731 temporary_file=false;
2732 printlayers(true,gminvalue,gmaxvalue,outputfilename);
2733 
2734 //Now print a text file for each layer
2735  std::ofstream * txtfile;
2736 for (int layer=1; layer < 44; layer++){
2737  std::ostringstream outs;
2738  outs << outputfilename <<"layer"<<layer<< ".html";
2739  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2740  *txtfile << "<html><head></head> <body>" << std::endl;
2741  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
2742  for (int module=1;module<200;module++) {
2743  int key=layer*100000+ring*1000+module;
2744  TmModule * mod = smoduleMap[key];
2745  if(mod !=0 && !mod->notInUse()){
2746  int idmod=mod->idex;
2747  int nchan=0;
2748  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
2749  std::multimap<const int, TmApvPair*>::iterator pos;
2750  for (pos = apvModuleMap.lower_bound(idmod);
2751  pos != apvModuleMap.upper_bound(idmod); ++pos) {
2752  TmApvPair* apvpair = pos->second;
2753  if(apvpair!=0){
2754  nchan++;
2755  *txtfile << apvpair->text << std::endl;
2756  }
2757 
2758  }
2759  *txtfile << "</pre><h3>"<< mod->name<<"</h3>"<<std::endl;
2760  }
2761  }
2762  }
2763  *txtfile << "</body></html>" << std::endl;
2764  txtfile->close();delete txtfile;
2765  }
2767  outs1 << outputfilename<<"fed.png";
2768 save_as_fedtrackermap(true,gminvalue,gmaxvalue,outs1.str(),6000,3200);
2769  outs2 << outputfilename<<".xml";
2770 save_as_fedtrackermap(true,gminvalue,gmaxvalue,outs2.str(),3000,1600);
2771 //And a text file for each crate
2772  std::map<int , int>::iterator i_fed;
2773  std::ofstream * txtfile;
2774  for (int crate=1; crate < (ncrates+1); crate++){
2775  std::ostringstream outs;
2776  outs << outputfilename <<"crate"<<crate<< ".html";
2777  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2778  *txtfile << "<html><head></head> <body>" << std::endl;
2779  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
2780  if(i_fed->second == crate){
2781  int fedId = i_fed->first;
2782  for (int nconn=0;nconn<96;nconn++){
2783  int key = fedId*1000+nconn;
2784  TmApvPair * apvPair= apvMap[key];
2785  if(apvPair !=0){
2786  int idmod=apvPair->idex;
2787  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
2788  *txtfile << apvPair->text << std::endl;
2789  std::ostringstream outs;
2790  outs << "fedchannel " <<apvPair->getFedId() << "/"<<apvPair->getFedCh()<<" connects to module " << apvPair->mod->idex ;
2791  *txtfile << "</pre><h3>"<< outs.str()<<"</h3>"<<std::endl;
2792  }
2793  }
2794  }
2795  }
2796  *txtfile << "</body></html>" << std::endl;
2797  txtfile->close();delete txtfile;
2798  }
2799  }
2801  std::ostringstream outs1,outs2;
2802  outs1 << outputfilename<<"fec.png";
2803 save_as_fectrackermap(true,gminvalue,gmaxvalue,outs1.str(),6000,3200);
2804  outs2 << outputfilename<<".xml";
2805 save_as_fectrackermap(true,gminvalue,gmaxvalue,outs2.str(),3000,1600);
2806 //And a text file for each crate
2807  std::ofstream * txtfile;
2808  std::map<int , TmCcu *>::iterator i_ccu;
2809  std::multimap<TmCcu*, TmModule*>::iterator it;
2810  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
2811  for (int crate=1; crate < (nfeccrates+1); crate++){
2812  std::ostringstream outs;
2813  outs << outputfilename <<"feccrate"<<crate<< ".html";
2814  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2815  *txtfile << "<html><head></head> <body>" << std::endl;
2816  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
2817  TmCcu * ccu= i_ccu->second;
2818  if(ccu!=0&&ccu->getCcuCrate() == crate){
2819  int idmod=ccu->idex;
2820  *txtfile << "<a name="<<idmod<<"><pre>"<<std::endl;
2821  *txtfile << ccu->text << std::endl;
2822  std::ostringstream outs;
2823  if(ccu->nmod==0)outs << "ccu is in position" << ccu->mpos<<"in ring but doesn't seem to have any module connected"; else
2824  {
2825  outs << "ccu is in position " << ccu->mpos<<" in ring and connects " <<ccu->nmod<< " modules" << std::endl;
2826  ret = fecModuleMap.equal_range(ccu);
2827  for (it = ret.first; it != ret.second; ++it)
2828  {
2829  outs << (*it).second->idex<<" " << (*it).second->name <<" value= "<< (*it).second->value<<"\n\n";
2830  }
2831 
2832  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
2833  }//ifccu->nmod==0
2834  }//if ccu!=0
2835  }//for i_ccu
2836  *txtfile << "</body></html>" << std::endl;
2837  txtfile->close();delete txtfile;
2838  }//for int crate
2839  }
2840 if(enableLVProcessing){
2841  std::ostringstream outs3,outs4;
2842  outs3 << outputfilename<<"psu.png";
2843 save_as_psutrackermap(true,gminvalue,gmaxvalue,outs3.str(),6000,3200);
2844 
2845  outs4 << outputfilename<<".xml";
2846 save_as_psutrackermap(true,gminvalue,gmaxvalue,outs4.str(),3000,1600);
2847 //And a text file for each rack
2848 
2849  std::ofstream * txtfile;
2850  std::map<int , TmPsu *>::iterator ipsu;
2851  std::multimap<TmPsu*, TmModule*>::iterator it;
2852  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
2853  for (int rack=1; rack < (npsuracks+1); rack++){
2854  std::ostringstream outs;
2855 
2856  outs << outputfilename <<"psurack"<<rack<< ".html";
2857  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2858  *txtfile << "<html><head></head> <body>" << std::endl;
2859  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
2860  TmPsu * psu= ipsu->second;
2861  if(psu!=0 && psu->getPsuRack() == rack){
2862  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
2863  *txtfile << psu->text << std::endl;
2864  std::ostringstream outs;
2865  if(psu->nmod==0)outs << "Ps is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
2866  {
2867  outs<< "PS is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmod<<" modules. "<<std::endl;
2868 
2869  ret = psuModuleMap.equal_range(psu);
2870  for (it = ret.first; it != ret.second; ++it)
2871  {
2872  outs <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;
2873 
2874  }
2875  *txtfile << "</pre><h4>"<< outs.str()<<"</h4>"<<std::endl;
2876  }
2877  }
2878  }
2879  *txtfile << "</body></html>" << std::endl;
2880  txtfile->close();delete txtfile;
2881  }
2882  }
2883 
2884 
2885 if(enableHVProcessing){
2886  std::ostringstream outs5,outs6;
2887  outs5 << outputfilename<<"hv.png";
2888 save_as_HVtrackermap(true,gminvalue,gmaxvalue,outs5.str(),6000,3200);
2889 
2890  outs6 << outputfilename<<".xml";
2891 save_as_HVtrackermap(true,gminvalue,gmaxvalue,outs6.str(),3000,1600);
2892 //And a text file for each rack
2893 
2894  std::ofstream * txtfile;
2895  std::map<int , TmPsu *>::iterator ipsu;
2896  std::multimap<TmPsu*, TmModule*>::iterator it;
2897  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
2898  for (int rack=1; rack < (npsuracks+1); rack++){
2899  std::ostringstream outs;
2900 
2901  outs << outputfilename <<"HVrack"<<rack<< ".html";
2902  txtfile = new std::ofstream(outs.str().c_str(),std::ios::out);
2903  *txtfile << "<html><head></head> <body>" << std::endl;
2904  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
2905  TmPsu * psu= ipsu->second;
2906  if(psu!=0 && psu->getPsuRack() == rack){
2907  *txtfile << "<a name="<<psu->idex<<"><pre>"<<std::endl;
2908  *txtfile << psu->textHV2 << std::endl;
2909  std::ostringstream outsHV2;
2910  if(psu->nmodHV2==0)outsHV2 << "HV Channel002 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
2911  {
2912  outsHV2<< "HV Channel002 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV2<<" modules. "<<" <br>"<<std::endl;
2913 
2914  ret = psuModuleMap.equal_range(psu);
2915  for (it = ret.first; it != ret.second; ++it)
2916  {
2917  if((*it).second->HVchannel==2){outsHV2 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
2918  }
2919  *txtfile << "</pre><h4>"<< outsHV2.str()<<"</h4>"<<std::endl;
2920  }
2921 
2922  *txtfile << psu->textHV3 << std::endl;
2923  std::ostringstream outsHV3;
2924  if(psu->nmodHV3==0)outsHV3 << "HV Channel003 is in position" << psu->getPsuBoard()<<"in crate but doesn't seem to have any module connected"; else
2925  {
2926  outsHV3<< "HV Channel003 is in position " <<psu->getPsuBoard()<< " in crate and connects to "<<psu->nmodHV3<<" modules. "<<" <br>"<<std::endl;
2927 
2928  ret = psuModuleMap.equal_range(psu);
2929  for (it = ret.first; it != ret.second; ++it)
2930  {
2931  if((*it).second->HVchannel==3){outsHV3 <<(*it).second->idex << " "<< (*it).second->name<<" value= "<<(*it).second->value<<" <br>"<<std::endl;}
2932  }
2933  *txtfile << "</pre><h4>"<< outsHV3.str()<<"</h4>"<<std::endl;
2934  }
2935 
2936  }
2937  }
2938  *txtfile << "</body></html>" << std::endl;
2939  txtfile->close();delete txtfile;
2940  }
2941  }
2942 
2943 }
TmModule * mod
Definition: TmApvPair.h:16
std::string text
Definition: TmApvPair.h:12
ModApvPair apvModuleMap
Definition: TrackerMap.h:89
std::ifstream * findfile(std::string filename)
Definition: TrackerMap.cc:3250
int nfeccrates
Definition: TrackerMap.h:430
MapCcu ccuMap
Definition: TrackerMap.h:93
void save_as_psutrackermap(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:1700
int nmodHV3
Definition: TmPsu.h:31
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
int idex
Definition: TmPsu.h:11
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2459
bool enableFecProcessing
Definition: TrackerMap.h:103
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:1435
int npsuracks
Definition: TrackerMap.h:431
int getPsuBoard()
Definition: TmPsu.h:17
bool enableFedProcessing
Definition: TrackerMap.h:102
int firstRing[43]
Definition: TrackerMap.h:423
float gminvalue
Definition: TrackerMap.h:441
int nmod
Definition: TmCcu.h:15
bool enableHVProcessing
Definition: TrackerMap.h:105
int getFedId()
Definition: TmApvPair.h:19
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:632
bool temporary_file
Definition: TrackerMap.h:444
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:3267
tuple out
Definition: dbtoconf.py:99
int mpos
Definition: TmCcu.h:18
SvgFed fedMap
Definition: TrackerMap.h:91
PsuModule psuModuleMap
Definition: TrackerMap.h:99
FecModule fecModuleMap
Definition: TrackerMap.h:95
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:108
int idex
Definition: TmCcu.h:13
list key
Definition: combine.py:13
std::string textHV3
Definition: TmPsu.h:37
SvgApvPair apvMap
Definition: TrackerMap.h:87
std::string text
Definition: TmPsu.h:35
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1949
float gmaxvalue
Definition: TrackerMap.h:441
int idex
Definition: TmApvPair.h:14
tuple cout
Definition: gather_cfg.py:41
bool enableLVProcessing
Definition: TrackerMap.h:104
std::string textHV2
Definition: TmPsu.h:36
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmCcu.h:5
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::string text
Definition: TmCcu.h:11
Definition: TmPsu.h:6
Definition: vlib.h:209
void save_as_fectrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fec_svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:1194
std::string name
Definition: TmModule.h:15
int getFedCh()
Definition: TmApvPair.h:18
int ntotRing[43]
Definition: TrackerMap.h:422
void TrackerMap::reset ( void  )

Definition at line 390 of file TrackerMap.cc.

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

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

390  {
391 std::map<int , TmModule *>::iterator i_mod;
392  for( i_mod=imoduleMap.begin();i_mod !=imoduleMap.end(); i_mod++){
393  TmModule * mod= i_mod->second;
394  mod->count=0;mod->value=0;mod->red=-1;
395  }
396 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
int count
Definition: TmModule.h:13
int red
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::save ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "svgmap.svg",
int  width = 1500,
int  height = 800 
)

Definition at line 632 of file TrackerMap.cc.

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

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

632  {
633 
634  std::string filetype=s,outputfilename=s;
635  std::vector<TPolyLine*> vp;
636  TGaxis *axis = 0 ;
637  size_t found=filetype.find_last_of(".");
638  filetype=filetype.substr(found+1);
639  found=outputfilename.find_last_of(".");
640  outputfilename=outputfilename.substr(0,found);
641  //outputfilename.erase(outputfilename.begin()+outputfilename.find("."),outputfilename.end());
642  temporary_file=true;
643  if(filetype=="svg")temporary_file=false;
644  std::ostringstream outs;
645  minvalue=minval; maxvalue=maxval;
646  outs << outputfilename << ".coor";
647  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
648  if(!print_total){
649  for (int layer=1; layer < 44; layer++){
650  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
651  for (int module=1;module<200;module++) {
652  int key=layer*100000+ring*1000+module;
653  TmModule * mod = smoduleMap[key];
654  if(mod !=0 && !mod->notInUse()){
655  mod->value = mod->value / mod->count;
656  }
657  }
658  }
659  }
660  }
661 
662  if(minvalue>=maxvalue){
663  minvalue=9999999.;
664  maxvalue=-9999999.;
665  for (int layer=1; layer < 44; layer++){
666  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
667  for (int module=1;module<200;module++) {
668  int key=layer*100000+ring*1000+module;
669  TmModule * mod = smoduleMap[key];
670  if(mod !=0 && !mod->notInUse()){
671  if (minvalue > mod->value)minvalue=mod->value;
672  if (maxvalue < mod->value)maxvalue=mod->value;
673  }
674  }
675  }
676  }
677 }
678  if (maxvalue == minvalue) printflag = false;
679  if(!temporary_file){
680  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
681  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
682  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
683  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
684  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3100 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
685  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3100\" height=\"1600\" /> "<<std::endl;
686  *savefile << "<svg:g id=\"tracker\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
687  }
688  for (int layer=1; layer < 44; layer++){
689  nlay=layer;
690  defwindow(nlay);
691  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
692  for (int module=1;module<200;module++) {
693  int key=layer*100000+ring*1000+module;
694  TmModule * mod = smoduleMap[key];
695  if(mod !=0 && !mod->notInUse()){
696  drawModule(mod,key,layer,print_total,savefile);
697  }
698  }
699  }
700  }
701 
702  if(!temporary_file){
703  *savefile << "</svg:g>"<<std::endl;
704  *savefile << " <svg:text id=\"Title\" class=\"normalText\" x=\"300\" y=\"0\">"<<title<<"</svg:text>"<<std::endl;
705  }
706 
708  if(!temporary_file){
709  *savefile << "</svg:svg>"<<std::endl;
710  *savefile << "</svg>"<<std::endl;
711  }
712  savefile->close(); delete savefile;
713 
714  const char * command1;
715  std::string tempfilename = outputfilename + ".coor";
716  if(filetype=="svg"){
717  std::string command = "mv "+tempfilename +" " +outputfilename + ".svg";
718  command1=command.c_str();
719  std::cout << "Executing " << command1 << std::endl;
720  system(command1);
721  }
722 
723  if (temporary_file){ // create root trackermap image
724  int red,green,blue,npoints,colindex,ncolor;
725  double x[4],y[4];
726  ifstream tempfile(tempfilename.c_str(),std::ios::in);
727  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
728  gPad->SetFillColor(38);
729 
730  if(addPixelFlag)gPad->Range(0,0,3800,1600);else gPad->Range(800,0,3800,1600);
731 
732  //First build palette
733  ncolor=0;
734  typedef std::map<int,int> ColorList;
735  ColorList colorList;
736  ColorList::iterator pos;
737  TColor *col, *c;
738  std::cout<<"tempfilename "<<tempfilename<<std::endl;
739  while(!tempfile.eof()) {
740  tempfile >> red >> green >> blue >> npoints;
741  colindex=red+green*1000+blue*1000000;
742  pos=colorList.find(colindex);
743  if(pos == colorList.end()){ colorList[colindex]=ncolor+100; col =gROOT->GetColor(ncolor+100);
744  if(col) col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.)); else c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));vc.push_back(c); ncolor++;}
745  for (int i=0;i<npoints;i++){
746  tempfile >> x[i] >> y[i];
747  }
748  }
749 
750  if(ncolor>0 && ncolor<10000){
751  Int_t colors[10000];
752  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
753  gStyle->SetPalette(ncolor,colors);
754  }
755 
756  tempfile.clear();
757  tempfile.seekg(0,std::ios::beg);
758  std::cout << "created palette with " << ncolor << " colors" << std::endl;
759 
760  while(!tempfile.eof()) {//create polylines
761  tempfile >> red >> green >> blue >> npoints;
762  for (int i=0;i<npoints;i++){
763  tempfile >> x[i] >> y[i];
764  }
765  colindex=red+green*1000+blue*1000000;
766  pos=colorList.find(colindex);
767  if(pos != colorList.end()){
768  TPolyLine* pline = new TPolyLine(npoints,y,x);
769  vp.push_back(pline);
770  pline->SetFillColor(colorList[colindex]);
771  pline->SetLineWidth(0);
772  pline->Draw("f");
773  }
774  }
775  if (printflag) {
776  axis = new TGaxis(3660,36,3660,1530,minvalue,maxvalue,510,"+L");
777  axis->SetLabelSize(0.02);
778  axis->Draw();
779  }
780  TLatex l;
781  l.SetTextSize(0.03);
782  l.DrawLatex(950,1330,"TID");
783  l.DrawLatex(2300,1330,"TEC");
784  l.DrawLatex(300,1330,"FPIX");
785  l.DrawLatex(20,560,"BPIX L1");
786  l.DrawLatex(500,385,"BPIX L2");
787  l.DrawLatex(500,945,"BPIX L3");
788  l.SetTextSize(0.04);
789  l.DrawLatex(850,1500,title.c_str());
790  l.DrawLatex(1730,40,"-z");
791  l.DrawLatex(1730,1360,"+z");
792  l.DrawLatex(1085,330,"TIB L1");
793  l.DrawLatex(1085,1000,"TIB L2");
794  l.DrawLatex(1585,330,"TIB L3");
795  l.DrawLatex(1585,1000,"TIB L4");
796  l.DrawLatex(2085,330,"TOB L1");
797  l.DrawLatex(2085,1000,"TOB L2");
798  l.DrawLatex(2585,330,"TOB L3");
799  l.DrawLatex(2585,1000,"TOB L4");
800  l.DrawLatex(3085,330,"TOB L5");
801  l.DrawLatex(3085,1000,"TOB L6");
802  TArrow arx(3448,1190,3448,1350,0.01,"|>");
803  l.DrawLatex(3460,1350,"x");
804  TArrow ary(3448,1190,3312,1190,0.01,"|>");
805  l.DrawLatex(3312,1210,"y");
806  TArrow arz(3485,373,3485,676,0.01,"|>");
807  l.DrawLatex(3510,667,"z");
808  TArrow arphi(3485,511,3037,511,0.01,"|>");
809  l.DrawLatex(3023,520,"#Phi");
810  arx.SetLineWidth(3);
811  ary.SetLineWidth(3);
812  arz.SetLineWidth(3);
813  arphi.SetLineWidth(3);
814  arx.Draw();
815  ary.Draw();
816  arz.Draw();
817  arphi.Draw();
818  MyC->Update();
819  if(filetype=="png"){
820 
821  std::string filename = outputfilename + ".png";
822  std::cout << "printing " <<filename<< std::endl;
823  MyC->Print(filename.c_str());
824  }
825  if(filetype=="jpg"){
826  std::string filename = outputfilename + ".jpg";
827  MyC->Print(filename.c_str());
828  }
829  if(filetype=="pdf"){
830  std::string filename = outputfilename + ".pdf";
831  MyC->Print(filename.c_str());
832  }
833  std::string command = "rm "+tempfilename ;
834  command1=command.c_str();
835  std::cout << "Executing " << command1 << std::endl;
836  system(command1);
837  MyC->Clear();
838  delete MyC;
839  if (printflag)delete axis;
840  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
841  delete (*pos1);}
842 
843  }
844 
845 
846 }
int i
Definition: DBlmapReader.cc:9
float minvalue
Definition: TrackerMap.h:442
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
std::ofstream * savefile
Definition: TrackerMap.h:437
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2459
void defwindow(int num_lay)
Definition: TrackerMap.h:273
bool addPixelFlag
Definition: TrackerMap.h:450
std::vector< Color_t > colors
Definition: eve_filter.cc:26
int firstRing[43]
Definition: TrackerMap.h:423
bool temporary_file
Definition: TrackerMap.h:444
void drawPalette(std::ofstream *file)
Definition: TrackerMap.cc:2276
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:495
int count
Definition: TmModule.h:13
tuple out
Definition: dbtoconf.py:99
bool printflag
Definition: TrackerMap.h:101
bool notInUse()
Definition: TmModule.h:24
std::string title
Definition: TrackerMap.h:108
list key
Definition: combine.py:13
tuple filename
Definition: lut2db_cfg.py:20
float maxvalue
Definition: TrackerMap.h:442
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:209
std::vector< TColor * > vc
Definition: TrackerMap.h:80
int ntotRing[43]
Definition: TrackerMap.h:422
void TrackerMap::save_as_fectrackermap ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "fec_svgmap.svg",
int  width = 1500,
int  height = 800 
)

Definition at line 1194 of file TrackerMap.cc.

References TmCcu::blue, trackerHits::c, ccuMap, colors, edmPickEvents::command, TmCcu::count, gather_cfg::cout, deffecwindow(), drawCcu(), enableFecProcessing, fecModuleMap, lut2db_cfg::filename, alcaDQMUpload::filetype(), newFWLiteAna::found, TmCcu::getCcuCrate(), TmCcu::getCcuSlot(), TmCcu::green, cmsRelvalreport::green(), i, recoMuon::in, maxvalue, minvalue, ncrate, nfeccrates, TmCcu::nmod, dbtoconf::out, pos, TmCcu::red, cmsRelvalreport::red(), runTheMatrix::ret, asciidump::s, saveAsSingleLayer, savefile, temporary_file, title, TmCcu::value, relativeConstraints::value, vc, ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.

Referenced by printall(), and printonline().

1194  {
1195  if(enableFecProcessing){
1196  std::string filetype=s,outputfilename=s;
1197  std::vector<TPolyLine*> vp;
1198  size_t found=filetype.find_last_of(".");
1199  filetype=filetype.substr(found+1);
1200  found=outputfilename.find_last_of(".");
1201  outputfilename=outputfilename.substr(0,found);
1202  temporary_file=true;
1203  if(filetype=="xml"||filetype=="svg")temporary_file=false;
1204  std::ostringstream outs;
1205  minvalue=minval; maxvalue=maxval;
1206  outs << outputfilename << ".coor";
1207  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1208  std::map<int , TmCcu *>::iterator i_ccu;
1209  std::multimap<TmCcu*, TmModule*>::iterator it;
1210  std::pair<std::multimap<TmCcu*, TmModule*>::iterator,std::multimap<TmCcu*, TmModule*>::iterator> ret;
1211  //Decide if we must use Module or Ccu value
1212  bool useCcuValue=false;
1213 
1214 
1215  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1216  TmCcu * ccu= i_ccu->second;
1217  if(ccu!=0) {
1218  if(ccu->count > 0 || ccu->red!=-1) { useCcuValue=true; break;}
1219  }
1220  }
1221 
1222 
1223  if(!useCcuValue)//store mean of connected modules value{
1224  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1225  TmCcu * ccu= i_ccu->second;
1226  if(ccu!=0) {
1227  ret = fecModuleMap.equal_range(ccu);
1228  for (it = ret.first; it != ret.second; ++it)
1229  {
1230  if( (*it).second->count>0){ccu->value=ccu->value+(*it).second->value;ccu->count++;}
1231  }
1232  if(ccu->count>0)ccu->value=ccu->value/ccu->count;
1233  if(ccu->nmod==0) { ccu->red=0;ccu->green=0;ccu->blue=0;}
1234  }
1235  }
1236 
1237 
1238  if(title==" Tracker Map from QTestAlarm"){
1239  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1240  TmCcu * ccu= i_ccu->second;
1241  if(ccu!=0) {
1242  ret = fecModuleMap.equal_range(ccu);
1243  ccu->red=0;ccu->green=255;ccu->blue=0;
1244  for (it = ret.first; it != ret.second; ++it) {
1245  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1246  ccu->red=255;ccu->green=0;ccu->blue=0;
1247  }
1248  }
1249  }
1250  }
1251  }
1252 
1253 
1254 
1255  if(!print_total){
1256  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1257  TmCcu * ccu= i_ccu->second;
1258  if(ccu!=0) {
1259  if(useCcuValue) ccu->value = ccu->value / ccu->count;
1260 
1261  }
1262  }
1263  }
1264 
1265  if(minvalue>=maxvalue){
1266 
1267  minvalue=9999999.;
1268  maxvalue=-9999999.;
1269  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1270  TmCcu * ccu= i_ccu->second;
1271  if(ccu!=0) {
1272  if (minvalue > ccu->value)minvalue=ccu->value;
1273  if (maxvalue < ccu->value)maxvalue=ccu->value;
1274  }
1275  }
1276  }
1277 
1278 
1279 
1280  if(filetype=="svg"){
1281  saveAsSingleLayer=false;
1282  std::ostringstream outs;
1283  outs << outputfilename<<".svg";
1284  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1285  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1286  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1287  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1288  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1289  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
1290  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1291  *savefile << "<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1292  }
1293  for (int crate=1; crate < (nfeccrates+1); crate++){
1294  if(filetype=="xml"){
1295  saveAsSingleLayer=true;
1296  std::ostringstream outs;
1297  outs << outputfilename<<"feccrate" <<crate<< ".xml";
1298  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1299  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1300  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1301  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1302  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1303  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"feccrate.js\" />"<<std::endl;
1304  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
1305  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1306  *savefile << "<g id=\"crate\" transform=\" translate(280,580) rotate(270) scale(.7,.8)\" > "<<std::endl;
1307  }
1308  ncrate=crate;
1310 
1311  for ( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1312  TmCcu * ccu= i_ccu->second;
1313  if(ccu!=0){
1314  if(ccu->getCcuCrate() == crate){
1315 
1316  drawCcu(crate,ccu->getCcuSlot()-2,print_total,ccu,savefile,useCcuValue);
1317  }
1318  }
1319  }
1320 
1321  if(!temporary_file){
1322  if(filetype=="xml"){
1323  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1324  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1325  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1326  *savefile << " </text> </svg>" << std::endl;
1327  savefile->close();
1328  saveAsSingleLayer=false;
1329  }
1330  }
1331  }
1332  if(filetype=="svg"){
1333  *savefile << "</g> </svg> </svg> " << std::endl;
1334  savefile->close();
1335  }
1336  if(!print_total && !useCcuValue){
1337 //Restore ccu value
1338  for( i_ccu=ccuMap.begin();i_ccu !=ccuMap.end(); i_ccu++){
1339  TmCcu * ccu= i_ccu->second;
1340  if(ccu!=0) {
1341  ccu->value = ccu->value * ccu->count;
1342  }
1343 }
1344 }
1345  if(temporary_file){
1346  // if(printflag)drawPalette(savefile);
1347  savefile->close();
1348 
1349  const char * command1;
1350  std::string tempfilename = outputfilename + ".coor";
1351  int red,green,blue,npoints,colindex,ncolor;
1352  double x[4],y[4];
1353  ifstream tempfile(tempfilename.c_str(),std::ios::in);
1354  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
1355  gPad->SetFillColor(38);
1356 
1357  gPad->Range(0,0,3700,1600);
1358 
1359  //First build palette
1360  ncolor=0;
1361  typedef std::map<int,int> ColorList;
1362  ColorList colorList;
1363  ColorList::iterator pos;
1364  TColor *col,*c;
1365  while(!tempfile.eof()) {
1366  tempfile >> red >> green >> blue >> npoints;
1367  colindex=red+green*1000+blue*1000000;
1368  pos=colorList.find(colindex);
1369  if(pos == colorList.end()){
1370  colorList[colindex]=ncolor+100;
1371  col =gROOT->GetColor(ncolor+100);
1372  if(col)
1373  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1374  else
1375  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1376  vc.push_back(c);
1377  ncolor++;
1378  }
1379  for (int i=0;i<npoints;i++){
1380  tempfile >> x[i] >> y[i];
1381  }
1382  }
1383  if(ncolor>0 && ncolor<10000){
1384  Int_t colors[10000];
1385  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
1386  gStyle->SetPalette(ncolor,colors);
1387  }
1388  tempfile.clear();
1389  tempfile.seekg(0,std::ios::beg);
1390  std::cout << "created palette with " << ncolor << " colors" << std::endl;
1391  while(!tempfile.eof()) {//create polylines
1392  tempfile >> red >> green >> blue >> npoints;
1393  for (int i=0;i<npoints;i++){
1394  tempfile >> x[i] >> y[i];
1395  }
1396  colindex=red+green*1000+blue*1000000;
1397  pos=colorList.find(colindex);
1398  if(pos != colorList.end()){
1399  TPolyLine* pline = new TPolyLine(npoints,y,x);
1400  vp.push_back(pline);
1401  pline->SetFillColor(colorList[colindex]);
1402  pline->SetLineWidth(0);
1403  pline->Draw("f");
1404  }
1405  }
1406  MyC->Update();
1407  std::cout << "Filetype " << filetype << std::endl;
1408  if(filetype=="png"){
1409  std::string filename = outputfilename + ".png";
1410  MyC->Print(filename.c_str());
1411  }
1412  if(filetype=="jpg"){
1413  std::string filename = outputfilename + ".jpg";
1414  MyC->Print(filename.c_str());
1415  }
1416  if(filetype=="pdf"){
1417  std::string filename = outputfilename + ".pdf";
1418  MyC->Print(filename.c_str());
1419  }
1420  std::string command = "rm "+tempfilename ;
1421  command1=command.c_str();
1422  std::cout << "Executing " << command1 << std::endl;
1423  system(command1);
1424  MyC->Clear();
1425  delete MyC;
1426  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1427  delete (*pos1);}
1428 
1429 
1430 
1431 
1432 }//if(temporary_file)
1433 }//if(enabledFecProcessing)
1434 }
int i
Definition: DBlmapReader.cc:9
float minvalue
Definition: TrackerMap.h:442
int nfeccrates
Definition: TrackerMap.h:430
MapCcu ccuMap
Definition: TrackerMap.h:93
std::ofstream * savefile
Definition: TrackerMap.h:437
bool enableFecProcessing
Definition: TrackerMap.h:103
std::vector< Color_t > colors
Definition: eve_filter.cc:26
int count
Definition: TmCcu.h:12
int nmod
Definition: TmCcu.h:15
int getCcuSlot()
Definition: TmCcu.h:20
bool saveAsSingleLayer
Definition: TrackerMap.h:449
void deffecwindow(int num_crate)
Definition: TrackerMap.h:247
bool temporary_file
Definition: TrackerMap.h:444
int getCcuCrate()
Definition: TmCcu.h:19
int green
Definition: TmCcu.h:9
tuple out
Definition: dbtoconf.py:99
void drawCcu(int crate, int numfed_incrate, bool total, TmCcu *ccu, std::ofstream *file, bool useCcuValue)
Definition: TrackerMap.cc:931
float value
Definition: TmCcu.h:10
FecModule fecModuleMap
Definition: TrackerMap.h:95
std::string title
Definition: TrackerMap.h:108
int red
Definition: TmCcu.h:9
tuple filename
Definition: lut2db_cfg.py:20
float maxvalue
Definition: TrackerMap.h:442
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
int blue
Definition: TmCcu.h:9
Definition: TmCcu.h:5
std::vector< TColor * > vc
Definition: TrackerMap.h:80
void TrackerMap::save_as_fedtrackermap ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "fed_svgmap.svg",
int  width = 1500,
int  height = 800 
)

Definition at line 1949 of file TrackerMap.cc.

References apvMap, trackerHits::c, colors, edmPickEvents::command, TmModule::count, TmApvPair::count, gather_cfg::cout, defcwindow(), drawApvPair(), enableFedProcessing, fedMap, lut2db_cfg::filename, alcaDQMUpload::filetype(), newFWLiteAna::found, cmsRelvalreport::green(), i, recoMuon::in, combine::key, maxvalue, minvalue, TmApvPair::mod, TmApvPair::mpos, ncrate, ncrates, TmModule::notInUse(), dbtoconf::out, pos, TmApvPair::red, cmsRelvalreport::red(), asciidump::s, saveAsSingleLayer, savefile, temporary_file, TmApvPair::value, TmModule::value, relativeConstraints::value, vc, ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.

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

1949  {
1950  if(enableFedProcessing){
1951  std::string filetype=s,outputfilename=s;
1952  std::vector<TPolyLine*> vp;
1953 
1954  size_t found=filetype.find_last_of(".");
1955  filetype=filetype.substr(found+1);
1956  found=outputfilename.find_last_of(".");
1957  outputfilename=outputfilename.substr(0,found);
1958 
1959  temporary_file=true;
1960  if(filetype=="xml"||filetype=="svg")temporary_file=false;
1961  std::ostringstream outs;
1962  minvalue=minval; maxvalue=maxval;
1963  outs << outputfilename << ".coor";
1964  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1965  std::map<int , TmApvPair *>::iterator i_apv;
1966  std::map<int , int>::iterator i_fed;
1967  //Decide if we must use Module or ApvPair value
1968  bool useApvPairValue=false;
1969  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
1970  TmApvPair * apvPair= i_apv->second;
1971  if(apvPair!=0) {
1972  TmModule * apv_mod = apvPair->mod;
1973  if(apv_mod !=0 && !apv_mod->notInUse()){
1974  if(apvPair->count > 0 || apvPair->red!=-1) { useApvPairValue=true; break;}
1975  }
1976  }
1977  }
1978  if(!print_total){
1979  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
1980  TmApvPair * apvPair= i_apv->second;
1981  if(apvPair!=0) {
1982  TmModule * apv_mod = apvPair->mod;
1983  if(apv_mod !=0 && !apv_mod->notInUse()){
1984  if(useApvPairValue) apvPair->value = apvPair->value / apvPair->count;
1985  else if(apvPair->mpos==0)apv_mod->value = apv_mod->value / apv_mod->count;
1986  }
1987  }
1988  }
1989  }
1990  if(minvalue>=maxvalue){
1991 
1992  minvalue=9999999.;
1993  maxvalue=-9999999.;
1994  for(i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
1995  TmApvPair * apvPair= i_apv->second;
1996  if(apvPair!=0) {
1997  TmModule * apv_mod = apvPair->mod;
1998  if( apv_mod !=0 && !apv_mod->notInUse()){
1999  if(useApvPairValue){
2000  if (minvalue > apvPair->value)minvalue=apvPair->value;
2001  if (maxvalue < apvPair->value)maxvalue=apvPair->value;
2002  } else {
2003  if (minvalue > apv_mod->value)minvalue=apv_mod->value;
2004  if (maxvalue < apv_mod->value)maxvalue=apv_mod->value;
2005  }
2006  }
2007  }
2008  }
2009  }
2010  if(filetype=="svg"){
2011  saveAsSingleLayer=false;
2012  std::ostringstream outs;
2013  outs << outputfilename<<".svg";
2014  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
2015  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
2016  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
2017  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
2018  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
2019  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
2020  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
2021  *savefile << "<svg:g id=\"fedtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
2022  }
2023  for (int crate=1; crate < (ncrates+1); crate++){
2024  if(filetype=="xml"){
2025  saveAsSingleLayer=true;
2026  std::ostringstream outs;
2027  outs << outputfilename<<"crate" <<crate<< ".xml";
2028  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
2029  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
2030  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
2031  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
2032  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
2033  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"crate.js\" />"<<std::endl;
2034  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
2035  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
2036  *savefile << "<g id=\"crate\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
2037  }
2038  ncrate=crate;
2039  defcwindow(ncrate);
2040  int numfed_incrate=0;
2041  for (i_fed=fedMap.begin();i_fed != fedMap.end(); i_fed++){
2042  if(i_fed->second == crate){
2043  int fedId = i_fed->first;
2044  numfed_incrate++;
2045  for (int nconn=0;nconn<96;nconn++){
2046  int key = fedId*1000+nconn;
2047  TmApvPair * apvPair= apvMap[key];
2048  if(apvPair !=0){
2049  TmModule * apv_mod = apvPair->mod;
2050  if(apv_mod !=0 && !apv_mod->notInUse()){
2051  drawApvPair(crate,numfed_incrate,print_total,apvPair,savefile,useApvPairValue);
2052  }
2053  }
2054  }
2055  }
2056  }
2057  if(!temporary_file){
2058  if(filetype=="xml"){
2059  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
2060  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
2061  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
2062  *savefile << " </text> </svg>" << std::endl;
2063  savefile->close();delete savefile;
2064  saveAsSingleLayer=false;
2065  }
2066  }
2067  }
2068  if(filetype=="svg"){
2069  *savefile << "</g> </svg> </svg> " << std::endl;
2070  savefile->close();delete savefile;
2071  }
2072  if(!print_total && !useApvPairValue){
2073 //Restore module value
2074  for( i_apv=apvMap.begin();i_apv !=apvMap.end(); i_apv++){
2075  TmApvPair * apvPair= i_apv->second;
2076  if(apvPair!=0) {
2077  TmModule * apv_mod = apvPair->mod;
2078  if(apv_mod !=0 && apvPair->mpos==0 && !apv_mod->notInUse()){
2079  apv_mod->value = apv_mod->value * apv_mod->count;
2080  }
2081  }
2082  }
2083 }
2084 
2085  if(temporary_file){
2086  //if(printflag)drawPalette(savefile);
2087  savefile->close(); delete savefile;
2088 
2089  const char * command1;
2090  std::string tempfilename = outputfilename + ".coor";
2091  int red,green,blue,npoints,colindex,ncolor;
2092  double x[4],y[4];
2093  ifstream tempfile(tempfilename.c_str(),std::ios::in);
2094  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
2095  gPad->SetFillColor(38);
2096 
2097  gPad->Range(0,0,3750,1600);
2098 
2099  //First build palette
2100  ncolor=0;
2101  typedef std::map<int,int> ColorList;
2102  ColorList colorList;
2103  ColorList::iterator pos;
2104  TColor *col,*c;
2105  while(!tempfile.eof()) {
2106  tempfile >> red >> green >> blue >> npoints;
2107  colindex=red+green*1000+blue*1000000;
2108  pos=colorList.find(colindex);
2109  if(pos == colorList.end()){
2110  colorList[colindex]=ncolor+100;
2111  col =gROOT->GetColor(ncolor+100);
2112  if(col)
2113  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2114  else
2115  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
2116  vc.push_back(c);
2117  ncolor++;
2118  }
2119  for (int i=0;i<npoints;i++){
2120  tempfile >> x[i] >> y[i];
2121  }
2122  }
2123  if(ncolor>0 && ncolor<10000){
2124  Int_t colors[10000];
2125  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
2126  gStyle->SetPalette(ncolor,colors);
2127  }
2128  tempfile.clear();
2129  tempfile.seekg(0,std::ios::beg);
2130  std::cout << "created palette with " << ncolor << " colors" << std::endl;
2131  while(!tempfile.eof()) {//create polylines
2132  tempfile >> red >> green >> blue >> npoints;
2133  for (int i=0;i<npoints;i++){
2134  tempfile >> x[i] >> y[i];
2135  }
2136  colindex=red+green*1000+blue*1000000;
2137  pos=colorList.find(colindex);
2138  if(pos != colorList.end()){
2139  TPolyLine* pline = new TPolyLine(npoints,y,x);
2140  vp.push_back(pline);
2141  pline->SetFillColor(colorList[colindex]);
2142  pline->SetLineWidth(0);
2143  pline->Draw("f");
2144  }
2145  }
2146  MyC->Update();
2147  std::cout << "Filetype " << filetype << std::endl;
2148  if(filetype=="png"){
2149  std::string filename = outputfilename + ".png";
2150  MyC->Print(filename.c_str());
2151  }
2152  if(filetype=="jpg"){
2153  std::string filename = outputfilename + ".jpg";
2154  MyC->Print(filename.c_str());
2155  }
2156  if(filetype=="pdf"){
2157  std::string filename = outputfilename + ".pdf";
2158  MyC->Print(filename.c_str());
2159  }
2160  std::string command = "rm "+tempfilename ;
2161  command1=command.c_str();
2162  std::cout << "Executing " << command1 << std::endl;
2163  system(command1);
2164  MyC->Clear();
2165  delete MyC;
2166  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
2167  delete (*pos1);}
2168 
2169 
2170 }//if(temporary_file)
2171 }//if(enabledFedProcessing)
2172 }
TmModule * mod
Definition: TmApvPair.h:16
int i
Definition: DBlmapReader.cc:9
float minvalue
Definition: TrackerMap.h:442
float value
Definition: TmModule.h:12
int mpos
Definition: TmApvPair.h:17
std::ofstream * savefile
Definition: TrackerMap.h:437
std::vector< Color_t > colors
Definition: eve_filter.cc:26
bool enableFedProcessing
Definition: TrackerMap.h:102
int red
Definition: TmApvPair.h:10
bool saveAsSingleLayer
Definition: TrackerMap.h:449
bool temporary_file
Definition: TrackerMap.h:444
void drawApvPair(int crate, int numfed_incrate, bool total, TmApvPair *apvPair, std::ofstream *file, bool useApvPairValue)
Definition: TrackerMap.cc:847
int count
Definition: TmModule.h:13
tuple out
Definition: dbtoconf.py:99
int count
Definition: TmApvPair.h:13
SvgFed fedMap
Definition: TrackerMap.h:91
bool notInUse()
Definition: TmModule.h:24
list key
Definition: combine.py:13
SvgApvPair apvMap
Definition: TrackerMap.h:87
tuple filename
Definition: lut2db_cfg.py:20
float maxvalue
Definition: TrackerMap.h:442
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
void defcwindow(int num_crate)
Definition: TrackerMap.h:237
std::vector< TColor * > vc
Definition: TrackerMap.h:80
float value
Definition: TmApvPair.h:11
void TrackerMap::save_as_HVtrackermap ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "psu_svgmap.svg",
int  width = 1500,
int  height = 800 
)

Definition at line 1435 of file TrackerMap.cc.

References TmPsu::blueHV2, TmPsu::blueHV3, trackerHits::c, colors, edmPickEvents::command, TmPsu::countHV2, TmPsu::countHV3, gather_cfg::cout, defpsuwindow(), drawHV2(), drawHV3(), enableHVProcessing, lut2db_cfg::filename, alcaDQMUpload::filetype(), newFWLiteAna::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), cmsRelvalreport::green(), TmPsu::greenHV2, TmPsu::greenHV3, i, recoMuon::in, max(), maxvalue, min, minvalue, TmPsu::nmodHV2, TmPsu::nmodHV3, npsuracks, nrack, dbtoconf::out, pos, psuMap, psuModuleMap, cmsRelvalreport::red(), TmPsu::redHV2, TmPsu::redHV3, runTheMatrix::ret, asciidump::s, saveAsSingleLayer, savefile, temporary_file, title, TmPsu::valueHV2, TmPsu::valueHV3, vc, ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.

Referenced by printall(), and printonline().

1435  {
1436 
1437  if(enableHVProcessing){
1438  std::string filetype=s,outputfilename=s;
1439  std::vector<TPolyLine*> vp;
1440 
1441  size_t found=filetype.find_last_of(".");
1442  filetype=filetype.substr(found+1);
1443  found=outputfilename.find_last_of(".");
1444  outputfilename=outputfilename.substr(0,found);
1445 
1446  temporary_file=true;
1447 
1448 
1449  if(filetype=="xml"||filetype=="svg")temporary_file=false;
1450 
1451  std::ostringstream outs;
1452  minvalue=minval; maxvalue=maxval;
1453  outs << outputfilename << ".coor";
1454  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1455 
1456  std::map<int , TmPsu *>::iterator ipsu;
1457  std::multimap<TmPsu*, TmModule*>::iterator it;
1458  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
1459 
1460 
1461  bool usePsuValue=false;
1462 
1463  for( ipsu=psuMap.begin();ipsu!=psuMap.end(); ipsu++){
1464  TmPsu* psu= ipsu->second;
1465  if(psu!=0) {
1466  if(psu->countHV2 > 0 || psu->redHV2!=-1 || psu->countHV3 > 0 || psu->redHV3!=-1) { usePsuValue=true; break;}
1467  }
1468  }
1469 
1470  if(!usePsuValue){//store mean of connected modules value{
1471 
1472  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1473  TmPsu * psu= ipsu->second;
1474  if(psu!=0) {
1475  ret = psuModuleMap.equal_range(psu);
1476  for(it = ret.first; it != ret.second; ++it){
1477  if((*it).second->HVchannel==2){ psu->valueHV2=psu->valueHV2+(*it).second->value;}
1478  if((*it).second->HVchannel==3){ psu->valueHV3=psu->valueHV3+(*it).second->value;}
1479  }
1480  if(psu->nmodHV2!=0){psu->valueHV2=psu->valueHV2/psu->nmodHV2;}
1481  if(psu->nmodHV3!=0){psu->valueHV3=psu->valueHV3/psu->nmodHV3;}
1482  psu->countHV2=1;
1483  psu->countHV3=1;
1484 
1485  }
1486 
1487  }
1488  }
1489 
1490  if(title==" Tracker Map from QTestAlarm"){
1491  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1492  TmPsu * psu= ipsu->second;
1493  if(psu!=0) {
1494  ret = psuModuleMap.equal_range(psu);
1495  psu->redHV2=0;psu->greenHV2=255;psu->blueHV2=0;
1496  psu->redHV3=0;psu->greenHV3=255;psu->blueHV3=0;
1497  for (it = ret.first; it != ret.second; ++it) {
1498  if((*it).second->HVchannel==2){
1499  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1500  psu->redHV2=255;psu->greenHV2=0;psu->blueHV2=0;
1501  }
1502  }
1503  if((*it).second->HVchannel==3){
1504  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1505  psu->redHV3=255;psu->greenHV3=0;psu->blueHV3=0;
1506  }
1507  }
1508  }
1509  }
1510  }
1511  }
1512 
1513  if(!print_total){
1514  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1515  TmPsu * psu= ipsu->second;
1516  if(psu!=0) {
1517  if(usePsuValue){
1518  psu->valueHV2 = psu->valueHV2 / psu->countHV2;
1519  psu->valueHV3 = psu->valueHV3 / psu->countHV3;
1520  }
1521  }
1522  }
1523  }
1524 
1525  if(minvalue>=maxvalue){
1526 
1527  minvalue=9999999.;
1528  maxvalue=-9999999.;
1529 
1530  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1531  TmPsu * psu= ipsu->second;
1532  if(psu!=0) {
1533  if (minvalue > psu->valueHV2 || minvalue > psu->valueHV3)minvalue=std::min(psu->valueHV2,psu->valueHV3);
1534  if (maxvalue < psu->valueHV2 || maxvalue < psu->valueHV3)maxvalue=std::max(psu->valueHV2,psu->valueHV3);
1535 
1536 
1537  }
1538  }
1539  }
1540 
1541  if(filetype=="svg"){
1542  saveAsSingleLayer=false;
1543  std::ostringstream outs;
1544  outs << outputfilename<<".svg";
1545  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1546  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1547  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1548  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1549  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1550  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
1551  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1552  *savefile << "<svg:g id=\"HVtrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1553  }
1554 
1555  for (int irack=1; irack < (npsuracks+1); irack++){
1556  if(filetype=="xml"){
1557  saveAsSingleLayer=true;
1558  std::ostringstream outs;
1559  outs << outputfilename<<"HVrack" <<irack<< ".xml";
1560  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1561  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1562  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1563  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1564  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1565  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"rackhv.js\" />"<<std::endl;
1566  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerRackhv.init()\">"<<std::endl;
1567  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1568  *savefile << "<g id=\"rackhv\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
1569  }
1570 
1571  nrack=irack;
1573  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1574  TmPsu * psu= ipsu->second;
1575  if(psu->getPsuRack() == irack){
1576  drawHV2(irack,psu->getPsuCrate(),print_total,psu,savefile,usePsuValue);
1577  drawHV3(irack,psu->getPsuCrate(),print_total,psu,savefile,usePsuValue);
1578  }
1579  }
1580 
1581 
1582  if(!temporary_file){
1583  if(filetype=="xml"){
1584  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1585  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1586  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1587  *savefile << " </text> </svg>" << std::endl;
1588  savefile->close();
1589  saveAsSingleLayer=false;
1590  }
1591  }
1592  }
1593  if(filetype=="svg"){
1594  *savefile << "</g> </svg> </svg> " << std::endl;
1595  savefile->close();
1596  }
1597 
1598  //Restore psu value
1599  if(!print_total && !usePsuValue){
1600  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1601  TmPsu *psu = ipsu->second;
1602  if(psu!=0) {
1603  psu->valueHV2 = psu->valueHV2 * psu->countHV2;
1604  psu->valueHV3 = psu->valueHV3 * psu->countHV3;
1605  }
1606  }
1607  }
1608 
1609 
1610  if(temporary_file){
1611  // if(printflag)drawPalette(savefile);
1612  savefile->close();
1613 
1614  const char * command1;
1615  std::string tempfilename = outputfilename + ".coor";
1616  int red,green,blue,npoints,colindex,ncolor;
1617  double x[4],y[4];
1618  ifstream tempfile(tempfilename.c_str(),std::ios::in);
1619  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
1620  gPad->SetFillColor(38);
1621 
1622  gPad->Range(0,0,3700,1600);
1623 
1624  //First build palette
1625  ncolor=0;
1626  typedef std::map<int,int> ColorList;
1627  ColorList colorList;
1628  ColorList::iterator pos;
1629  TColor *col,*c;
1630  while(!tempfile.eof()) {
1631  tempfile >> red >> green >> blue >> npoints;
1632  colindex=red+green*1000+blue*1000000;
1633  pos=colorList.find(colindex);
1634  if(pos == colorList.end()){
1635  colorList[colindex]=ncolor+100;
1636  col =gROOT->GetColor(ncolor+100);
1637  if(col)
1638  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1639  else
1640  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1641  vc.push_back(c);
1642  ncolor++;
1643  }
1644  for (int i=0;i<npoints;i++){
1645  tempfile >> x[i] >> y[i];
1646  }
1647  }
1648  if(ncolor>0 && ncolor<10000){
1649  Int_t colors[10000];
1650  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
1651  gStyle->SetPalette(ncolor,colors);
1652  }
1653  tempfile.clear();
1654  tempfile.seekg(0,std::ios::beg);
1655  std::cout << "created palette with " << ncolor << " colors" << std::endl;
1656  while(!tempfile.eof()) {//create polylines
1657  tempfile >> red >> green >> blue >> npoints;
1658  for (int i=0;i<npoints;i++){
1659  tempfile >> x[i] >> y[i];
1660  }
1661  colindex=red+green*1000+blue*1000000;
1662  pos=colorList.find(colindex);
1663  if(pos != colorList.end()){
1664  TPolyLine* pline = new TPolyLine(npoints,y,x);
1665  vp.push_back(pline);
1666  pline->SetFillColor(colorList[colindex]);
1667  pline->SetLineWidth(0);
1668  pline->Draw("f");
1669  }
1670  }
1671  MyC->Update();
1672  std::cout << "Filetype " << filetype << std::endl;
1673  if(filetype=="png"){
1674  std::string filename = outputfilename + ".png";
1675  MyC->Print(filename.c_str());
1676  }
1677  if(filetype=="jpg"){
1678  std::string filename = outputfilename + ".jpg";
1679  MyC->Print(filename.c_str());
1680  }
1681  if(filetype=="pdf"){
1682  std::string filename = outputfilename + ".pdf";
1683  MyC->Print(filename.c_str());
1684  }
1685  std::string command = "rm "+tempfilename ;
1686  command1=command.c_str();
1687  std::cout << "Executing " << command1 << std::endl;
1688  system(command1);
1689  MyC->Clear();
1690  delete MyC;
1691  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1692  delete (*pos1);}
1693 
1694 
1695  }//if(temporary_file)
1696 }//if(enabledHVProcessing)
1697 }
void drawHV3(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1129
int i
Definition: DBlmapReader.cc:9
float minvalue
Definition: TrackerMap.h:442
int redHV2
Definition: TmPsu.h:21
int nmodHV3
Definition: TmPsu.h:31
std::ofstream * savefile
Definition: TrackerMap.h:437
int countHV2
Definition: TmPsu.h:27
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:256
int npsuracks
Definition: TrackerMap.h:431
std::vector< Color_t > colors
Definition: eve_filter.cc:26
int greenHV3
Definition: TmPsu.h:22
#define min(a, b)
Definition: mlp_lapack.h:161
bool enableHVProcessing
Definition: TrackerMap.h:105
const T & max(const T &a, const T &b)
void drawHV2(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:1062
bool saveAsSingleLayer
Definition: TrackerMap.h:449
int blueHV3
Definition: TmPsu.h:22
bool temporary_file
Definition: TrackerMap.h:444
int greenHV2
Definition: TmPsu.h:21
int getPsuRack()
Definition: TmPsu.h:15
int nmodHV2
Definition: TmPsu.h:30
tuple out
Definition: dbtoconf.py:99
int redHV3
Definition: TmPsu.h:22
PsuModule psuModuleMap
Definition: TrackerMap.h:99
float valueHV2
Definition: TmPsu.h:25
std::string title
Definition: TrackerMap.h:108
tuple filename
Definition: lut2db_cfg.py:20
int countHV3
Definition: TmPsu.h:28
float maxvalue
Definition: TrackerMap.h:442
tuple cout
Definition: gather_cfg.py:41
float valueHV3
Definition: TmPsu.h:24
string s
Definition: asciidump.py:422
MapPsu psuMap
Definition: TrackerMap.h:97
int blueHV2
Definition: TmPsu.h:21
Definition: TmPsu.h:6
std::vector< TColor * > vc
Definition: TrackerMap.h:80
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::save_as_psutrackermap ( bool  print_total = true,
float  minval = 0.,
float  maxval = 0.,
std::string  s = "psu_svgmap.svg",
int  width = 1500,
int  height = 800 
)

Definition at line 1700 of file TrackerMap.cc.

References TmPsu::blue, trackerHits::c, colors, edmPickEvents::command, TmPsu::count, gather_cfg::cout, defpsuwindow(), drawPsu(), enableLVProcessing, lut2db_cfg::filename, alcaDQMUpload::filetype(), newFWLiteAna::found, TmPsu::getPsuCrate(), TmPsu::getPsuRack(), TmPsu::green, cmsRelvalreport::green(), i, recoMuon::in, maxvalue, minvalue, TmPsu::nmod, npsuracks, nrack, dbtoconf::out, pos, psuMap, psuModuleMap, TmPsu::red, cmsRelvalreport::red(), runTheMatrix::ret, asciidump::s, saveAsSingleLayer, savefile, temporary_file, title, TmPsu::value, relativeConstraints::value, vc, ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.

Referenced by printall(), and printonline().

1700  {
1701 
1702  if(enableLVProcessing){
1703 
1704  std::string filetype=s,outputfilename=s;
1705  std::vector<TPolyLine*> vp;
1706 
1707  size_t found=filetype.find_last_of(".");
1708  filetype=filetype.substr(found+1);
1709  found=outputfilename.find_last_of(".");
1710  outputfilename=outputfilename.substr(0,found);
1711 
1712  temporary_file=true;
1713 
1714 
1715 
1716  if(filetype=="xml"||filetype=="svg")temporary_file=false;
1717 
1718  std::ostringstream outs;
1719  minvalue=minval; maxvalue=maxval;
1720  outs << outputfilename << ".coor";
1721  if(temporary_file)savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1722 
1723  std::map<int , TmPsu *>::iterator ipsu;
1724  std::multimap<TmPsu*, TmModule*>::iterator it;
1725  std::pair<std::multimap<TmPsu*, TmModule*>::iterator,std::multimap<TmPsu*, TmModule*>::iterator> ret;
1726 
1727  //Decide if we must use Module or Power Psupply value
1728  bool usePsuValue=false;
1729 
1730  for( ipsu=psuMap.begin();ipsu!=psuMap.end(); ipsu++){
1731  TmPsu* psu= ipsu->second;
1732  if(psu!=0) {
1733  if(psu->count > 0 || psu->red!=-1) { usePsuValue=true; break;}
1734  }
1735  }
1736 
1737  if(!usePsuValue){//store mean of connected modules value{
1738  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1739  TmPsu * psu= ipsu->second;
1740  if(psu!=0) {
1741  ret = psuModuleMap.equal_range(psu);
1742  for(it = ret.first; it != ret.second; ++it){
1743  psu->value=psu->value+(*it).second->value;
1744 
1745  }
1746  psu->value=psu->value/psu->nmod;
1747  psu->count=1;
1748 
1749  }
1750  }
1751  }
1752 
1753  if(title==" Tracker Map from QTestAlarm"){
1754  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1755  TmPsu * psu= ipsu->second;
1756  if(psu!=0) {
1757  ret = psuModuleMap.equal_range(psu);
1758  psu->red=0;psu->green=255;psu->blue=0;
1759  for (it = ret.first; it != ret.second; ++it) {
1760  if( !( (*it).second->red==0 && (*it).second->green==255 && (*it).second->blue==0 ) && !( (*it).second->red==255 && (*it).second->green==255 && (*it).second->blue==255 ) ){
1761  psu->red=255;psu->green=0;psu->blue=0;
1762  }
1763  }
1764  }
1765  }
1766  }
1767 
1768 
1769 
1770  if(!print_total){
1771  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1772  TmPsu * psu= ipsu->second;
1773  if(psu!=0) {
1774  if(usePsuValue) psu->value = psu->value / psu->count;
1775 
1776  }
1777  }
1778  }
1779 
1780  if(minvalue>=maxvalue){
1781 
1782  minvalue=9999999.;
1783  maxvalue=-9999999.;
1784  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1785  TmPsu * psu= ipsu->second;
1786  if(psu!=0) {
1787  if (minvalue > psu->value)minvalue=psu->value;
1788  if (maxvalue < psu->value)maxvalue=psu->value;
1789  }
1790  }
1791  }
1792 
1793  if(filetype=="svg"){
1794  saveAsSingleLayer=false;
1795  std::ostringstream outs;
1796  outs << outputfilename<<".svg";
1797  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1798  *savefile << "<?xml version=\"1.0\" standalone=\"no\" ?>"<<std::endl;
1799  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1800  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\" "<<std::endl;
1801  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\">"<<std::endl;
1802  *savefile << "<svg:svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 3000 1600"<<"\" width=\""<<width<<"\" height=\""<<height<<"\">"<<std::endl;
1803  *savefile << "<svg:rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"3000\" height=\"1600\" /> "<<std::endl;
1804  *savefile << "<svg:g id=\"psutrackermap\" transform=\"translate(10,1500) rotate(270)\" style=\"fill:none;stroke:black;stroke-width:0;\"> "<<std::endl;
1805  }
1806 
1807  for (int irack=1; irack < (npsuracks+1); irack++){
1808  if(filetype=="xml"){
1809  saveAsSingleLayer=true;
1810  outs << outputfilename<<"psurack" <<irack<< ".xml";
1811  savefile = new std::ofstream(outs.str().c_str(),std::ios::out);
1812  *savefile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
1813  *savefile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
1814  *savefile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
1815  *savefile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
1816  *savefile << "<script type=\"text/ecmascript\" xlink:href=\"rack.js\" />"<<std::endl;
1817  *savefile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerCrate.init()\">"<<std::endl;
1818  *savefile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
1819  *savefile << "<g id=\"rack\" transform=\" translate(150,500) rotate(270) scale(1.,1.)\" > "<<std::endl;
1820  }
1821 
1822 
1823  nrack=irack;
1825  for ( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1826  TmPsu * psu= ipsu->second;
1827  if(psu->getPsuRack() == irack){
1828 
1829  drawPsu(irack,psu->getPsuCrate(),print_total,psu,savefile,usePsuValue);
1830  }
1831  }
1832 
1833 
1834  if(!temporary_file){
1835  if(filetype=="xml"){
1836  *savefile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\"> " << std::endl;
1837  *savefile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
1838  *savefile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
1839  *savefile << " </text> </svg>" << std::endl;
1840  savefile->close();
1841  saveAsSingleLayer=false;
1842  }
1843  }
1844  }
1845  if(filetype=="svg"){
1846  *savefile << "</g> </svg> </svg> " << std::endl;
1847  savefile->close();
1848  }
1849 
1850  //Restore psu value
1851  if(!print_total && !usePsuValue){
1852  for( ipsu=psuMap.begin();ipsu !=psuMap.end(); ipsu++){
1853  TmPsu *psu = ipsu->second;
1854  if(psu!=0) {
1855  psu->value = psu->value * psu->count;
1856  }
1857  }
1858  }
1859 
1860 
1861  if(temporary_file){
1862  // if(printflag)drawPalette(savefile);
1863  savefile->close();
1864 
1865  const char * command1;
1866  std::string tempfilename = outputfilename + ".coor";
1867  int red,green,blue,npoints,colindex,ncolor;
1868  double x[4],y[4];
1869  ifstream tempfile(tempfilename.c_str(),std::ios::in);
1870  TCanvas *MyC = new TCanvas("MyC", "TrackerMap",width,height);
1871  gPad->SetFillColor(38);
1872 
1873  gPad->Range(0,0,3700,1600);
1874 
1875  //First build palette
1876  ncolor=0;
1877  typedef std::map<int,int> ColorList;
1878  ColorList colorList;
1879  ColorList::iterator pos;
1880  TColor *col,*c;
1881  while(!tempfile.eof()) {
1882  tempfile >> red >> green >> blue >> npoints;
1883  colindex=red+green*1000+blue*1000000;
1884  pos=colorList.find(colindex);
1885  if(pos == colorList.end()){
1886  colorList[colindex]=ncolor+100;
1887  col =gROOT->GetColor(ncolor+100);
1888  if(col)
1889  col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1890  else
1891  c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
1892  vc.push_back(c);
1893  ncolor++;
1894  }
1895  for (int i=0;i<npoints;i++){
1896  tempfile >> x[i] >> y[i];
1897  }
1898  }
1899  if(ncolor>0 && ncolor<10000){
1900  Int_t colors[10000];
1901  for(int i=0;i<ncolor;i++){colors[i]=i+100;}
1902  gStyle->SetPalette(ncolor,colors);
1903  }
1904  tempfile.clear();
1905  tempfile.seekg(0,std::ios::beg);
1906  std::cout << "created palette with " << ncolor << " colors" << std::endl;
1907  while(!tempfile.eof()) {//create polylines
1908  tempfile >> red >> green >> blue >> npoints;
1909  for (int i=0;i<npoints;i++){
1910  tempfile >> x[i] >> y[i];
1911  }
1912  colindex=red+green*1000+blue*1000000;
1913  pos=colorList.find(colindex);
1914  if(pos != colorList.end()){
1915  TPolyLine* pline = new TPolyLine(npoints,y,x);
1916  vp.push_back(pline);
1917  pline->SetFillColor(colorList[colindex]);
1918  pline->SetLineWidth(0);
1919  pline->Draw("f");
1920  }
1921  }
1922  MyC->Update();
1923  std::cout << "Filetype " << filetype << std::endl;
1924  if(filetype=="png"){
1925  std::string filename = outputfilename + ".png";
1926  MyC->Print(filename.c_str());
1927  }
1928  if(filetype=="jpg"){
1929  std::string filename = outputfilename + ".jpg";
1930  MyC->Print(filename.c_str());
1931  }
1932  if(filetype=="pdf"){
1933  std::string filename = outputfilename + ".pdf";
1934  MyC->Print(filename.c_str());
1935  }
1936  std::string command = "rm "+tempfilename ;
1937  command1=command.c_str();
1938  std::cout << "Executing " << command1 << std::endl;
1939  system(command1);
1940  MyC->Clear();
1941  delete MyC;
1942  for(std::vector<TPolyLine*>::iterator pos1=vp.begin();pos1!=vp.end();pos1++){
1943  delete (*pos1);}
1944 
1945 }//if(temporary_file)
1946 }//if(enabledFedProcessing)
1947 }
int i
Definition: DBlmapReader.cc:9
float minvalue
Definition: TrackerMap.h:442
std::ofstream * savefile
Definition: TrackerMap.h:437
int count
Definition: TmPsu.h:26
void drawPsu(int rack, int numcrate_inrack, bool print_total, TmPsu *psu, ofstream *svgfile, bool usePsuValue)
Definition: TrackerMap.cc:996
void defpsuwindow(int num_rack)
Definition: TrackerMap.h:256
int npsuracks
Definition: TrackerMap.h:431
std::vector< Color_t > colors
Definition: eve_filter.cc:26
float value
Definition: TmPsu.h:23
int red
Definition: TmPsu.h:20
int nmod
Definition: TmPsu.h:29
bool saveAsSingleLayer
Definition: TrackerMap.h:449
bool temporary_file
Definition: TrackerMap.h:444
int getPsuRack()
Definition: TmPsu.h:15
int green
Definition: TmPsu.h:20
tuple out
Definition: dbtoconf.py:99
PsuModule psuModuleMap
Definition: TrackerMap.h:99
std::string title
Definition: TrackerMap.h:108
tuple filename
Definition: lut2db_cfg.py:20
float maxvalue
Definition: TrackerMap.h:442
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
bool enableLVProcessing
Definition: TrackerMap.h:104
int blue
Definition: TmPsu.h:20
MapPsu psuMap
Definition: TrackerMap.h:97
Definition: TmPsu.h:6
std::vector< TColor * > vc
Definition: TrackerMap.h:80
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::setPalette ( int  numpalette)
inline
void TrackerMap::setRange ( float  min,
float  max 
)
inline

Definition at line 72 of file TrackerMap.h.

References gmaxvalue, gminvalue, max(), and min.

Referenced by SiStripTrackerMapCreator::setTkMapRange().

#define min(a, b)
Definition: mlp_lapack.h:161
float gminvalue
Definition: TrackerMap.h:441
const T & max(const T &a, const T &b)
float gmaxvalue
Definition: TrackerMap.h:441
void TrackerMap::setText ( int  idmod,
std::string  s 
)

Definition at line 2559 of file TrackerMap.cc.

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

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

2559  {
2560 
2561  TmModule * mod = imoduleMap[idmod];
2562  if(mod!=0){
2563  mod->text=s;
2564  }
2565  else std::cout << "**************************error in IdModuleMap **************";
2566 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:85
std::string text
Definition: TmModule.h:14
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::setText ( int  layer,
int  ring,
int  nmod,
std::string  s 
)

Definition at line 2569 of file TrackerMap.cc.

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

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

2569  {
2570 
2571  int key = layer*100000+ring*1000+nmod;
2572  TmModule * mod = smoduleMap[key];
2573  if(mod!=0){
2574  mod->text=s;
2575  }
2576  else std::cout << "**************************error in SvgModuleMap **************";
2577 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:83
std::string text
Definition: TmModule.h:14
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::setTitle ( std::string  s)
inline
void TrackerMap::showPalette ( bool  printflag1)
inline

Definition at line 70 of file TrackerMap.h.

References printflag.

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

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

Definition at line 174 of file TrackerMap.h.

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

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

174  {
175  double res;
176  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
177  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
178  return res;
179  }
double xmin
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double xmax
Definition: TrackerMap.h:432
double TrackerMap::xdpixelc ( double  x)
inline

Definition at line 194 of file TrackerMap.h.

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

Referenced by drawApvPair().

194  {
195  double res;
196  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
197  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
198  return res;
199  }
double xmin
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double xmax
Definition: TrackerMap.h:432
double TrackerMap::xdpixelfec ( double  x)
inline

Definition at line 208 of file TrackerMap.h.

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

Referenced by drawCcu().

208  {
209  double res;
210  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
211  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
212  return res;
213  }
double xmin
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double xmax
Definition: TrackerMap.h:432
double TrackerMap::xdpixelpsu ( double  x)
inline

Definition at line 222 of file TrackerMap.h.

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

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

222  {
223  double res;
224  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
225  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
226  return res;
227  }
double xmin
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double xmax
Definition: TrackerMap.h:432
double TrackerMap::ydpixel ( double  y)
inline

Definition at line 180 of file TrackerMap.h.

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

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

180  {
181  double res=0;
182  double y1;
183  y1 = (y-ymin)/(ymax-ymin);
184  if(nlay>30)
185  {
186  if(nlay <34) res= 2*ysize - (y1*2*ysize);
187  if(nlay==34) res= 2.4*ysize - (y1*2.4*ysize);
188  if(nlay>34) res= 2.5*ysize - (y1*2.5*ysize);
189  }
190  else res= xsize - (y1*xsize);
191  if(!saveAsSingleLayer) res=res+iy;
192  return res;
193  }
double ymax
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double ymin
Definition: TrackerMap.h:432
double TrackerMap::ydpixelc ( double  y)
inline

Definition at line 200 of file TrackerMap.h.

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

Referenced by drawApvPair().

200  {
201  double res;
202  double y1;
203  y1 = (y-ymin)/(ymax-ymin);
204  if(saveAsSingleLayer)res= 2*ysize - (y1*2*ysize);
205  else res= 2*ysize - (y1*2*ysize)+iy;
206  return res;
207  }
double ymax
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double ymin
Definition: TrackerMap.h:432
double TrackerMap::ydpixelfec ( double  y)
inline

Definition at line 214 of file TrackerMap.h.

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

Referenced by drawCcu().

214  {
215  double res;
216  double y1;
217  y1 = (y-ymin)/(ymax-ymin);
218  if(saveAsSingleLayer)res= 2*ysize - (y1*2*ysize);
219  else res= 2*ysize - (y1*2*ysize)+iy;
220  return res;
221  }
double ymax
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double ymin
Definition: TrackerMap.h:432
double TrackerMap::ydpixelpsu ( double  y)
inline

Definition at line 228 of file TrackerMap.h.

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

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

228  {
229  double res;
230  double y1;
231  y1 = (y-ymin)/(ymax-ymin);
232  if(saveAsSingleLayer)res= 2*ysize - (y1*2*ysize);
233  else res= 2*ysize - (y1*2*ysize)+iy;
234  return res;
235  }
double ymax
Definition: TrackerMap.h:432
bool saveAsSingleLayer
Definition: TrackerMap.h:449
double ymin
Definition: TrackerMap.h:432

Member Data Documentation

bool TrackerMap::addPixelFlag
private

Definition at line 450 of file TrackerMap.h.

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

SvgApvPair TrackerMap::apvMap
ModApvPair TrackerMap::apvModuleMap

Definition at line 89 of file TrackerMap.h.

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

std::ifstream* TrackerMap::ccufile
protected

Definition at line 440 of file TrackerMap.h.

MapCcu TrackerMap::ccuMap
bool TrackerMap::enableFecProcessing

Definition at line 103 of file TrackerMap.h.

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

bool TrackerMap::enableFedProcessing

Definition at line 102 of file TrackerMap.h.

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

bool TrackerMap::enableHVProcessing

Definition at line 105 of file TrackerMap.h.

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

bool TrackerMap::enableLVProcessing

Definition at line 104 of file TrackerMap.h.

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

FecModule TrackerMap::fecModuleMap

Definition at line 95 of file TrackerMap.h.

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

SvgFed TrackerMap::fedMap

Definition at line 91 of file TrackerMap.h.

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

bool TrackerMap::firstcall
protected

Definition at line 435 of file TrackerMap.h.

Referenced by init().

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

Definition at line 441 of file TrackerMap.h.

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

float TrackerMap::gminvalue
protected

Definition at line 441 of file TrackerMap.h.

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

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

Definition at line 109 of file TrackerMap.h.

Referenced by build(), and TrackerMap().

std::ifstream* TrackerMap::inputfile
protected

Definition at line 439 of file TrackerMap.h.

Referenced by load().

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

Definition at line 438 of file TrackerMap.h.

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

std::string TrackerMap::jsfilename

Definition at line 109 of file TrackerMap.h.

Referenced by print(), and TrackerMap().

std::string TrackerMap::jsPath

Definition at line 110 of file TrackerMap.h.

Referenced by findfile(), and TrackerMap().

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

Definition at line 429 of file TrackerMap.h.

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

int TrackerMap::ndet

Definition at line 106 of file TrackerMap.h.

Referenced by init().

int TrackerMap::nfeccrates
protected

Definition at line 430 of file TrackerMap.h.

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

int TrackerMap::nlay
protected

Definition at line 426 of file TrackerMap.h.

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

int TrackerMap::npart

Definition at line 107 of file TrackerMap.h.

Referenced by init().

int TrackerMap::npsuracks
protected
int TrackerMap::nrack
protected

Definition at line 428 of file TrackerMap.h.

Referenced by defpsuwindow(), save_as_HVtrackermap(), and save_as_psutrackermap().

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

Definition at line 443 of file TrackerMap.h.

Referenced by build().

float TrackerMap::oldz
private

Definition at line 448 of file TrackerMap.h.

int TrackerMap::palette
bool TrackerMap::posrel
protected

Definition at line 434 of file TrackerMap.h.

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

bool TrackerMap::printflag

Definition at line 101 of file TrackerMap.h.

Referenced by init(), print(), save(), and showPalette().

bool TrackerMap::psetAvailable

Definition at line 111 of file TrackerMap.h.

Referenced by TrackerMap().

MapPsu TrackerMap::psuMap
PsuModule TrackerMap::psuModuleMap
bool TrackerMap::saveAsSingleLayer
private
std::ofstream* TrackerMap::savefile
protected
SmoduleMap TrackerMap::smoduleMap
std::ofstream* TrackerMap::svgfile
protected

Definition at line 436 of file TrackerMap.h.

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

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