CMS 3D CMS Logo

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>

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Protected Attributes

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

Private Attributes

bool addPixelFlag
 
float oldz
 
bool onlyPixelFlag
 
bool saveAsSingleLayer
 

Detailed Description

Definition at line 72 of file TrackerMap.h.

Member Typedef Documentation

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

Definition at line 153 of file TrackerMap.h.

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

Definition at line 142 of file TrackerMap.h.

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

Definition at line 151 of file TrackerMap.h.

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

Definition at line 155 of file TrackerMap.h.

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

Definition at line 146 of file TrackerMap.h.

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

Definition at line 157 of file TrackerMap.h.

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

Definition at line 140 of file TrackerMap.h.

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

Definition at line 144 of file TrackerMap.h.

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

Definition at line 148 of file TrackerMap.h.

Constructor & Destructor Documentation

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

Definition at line 412 of file TrackerMap.cc.

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

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

Definition at line 392 of file TrackerMap.cc.

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

392  {
393  psetAvailable=true;
394  xsize=340;ysize=200;
395  title=" ";
396  jsfilename="CommonTools/TrackerMap/data/trackermap.txt";
397  infilename="CommonTools/TrackerMap/data/tracker.dat";
399  saveAsSingleLayer=false;
400  tkMapLog = tkmapPset.getUntrackedParameter<bool>("logScale",false);
401  saveWebInterface=tkmapPset.getUntrackedParameter<bool>("saveWebInterface",false);
402  saveGeoTrackerMap=tkmapPset.getUntrackedParameter<bool>("saveGeoTrackerMap",true);
403  // if(tkmapPset.exists("trackermaptxtPath")){
404  jsfilename=tkmapPset.getUntrackedParameter<std::string>("trackermaptxtPath","CommonTools/TrackerMap/data/")+"trackermap.txt";
405  std::cout << jsfilename << std::endl;
406  infilename=tkmapPset.getUntrackedParameter<std::string>("trackerdatPath","CommonTools/TrackerMap/data/")+"tracker.dat";
407  std::cout << infilename << std::endl;
408  // } else std::cout << "no parameters found" << std::endl;
409  init();
410 }
bool tkMapLog
Definition: TrackerMap.h:167
bool psetAvailable
Definition: TrackerMap.h:173
bool saveGeoTrackerMap
Definition: TrackerMap.h:162
bool saveWebInterface
Definition: TrackerMap.h:161
std::string infilename
Definition: TrackerMap.h:171
bool enableFedProcessing
Definition: TrackerMap.h:163
bool saveAsSingleLayer
Definition: TrackerMap.h:507
void init()
Definition: TrackerMap.cc:439
int firstcrate
Definition: TrackerMap.h:487
std::string title
Definition: TrackerMap.h:170
std::string jsfilename
Definition: TrackerMap.h:171
TrackerMap::TrackerMap ( const edm::ParameterSet iConfig,
const SiStripFedCabling tkFed,
const TrackerTopology *const  topology 
)

Definition at line 32 of file TrackerMap.cc.

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

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

default destructor

Definition at line 490 of file TrackerMap.cc.

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

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

Member Function Documentation

void TrackerMap::addPixel ( bool  addPixelfl)
inline

Definition at line 130 of file TrackerMap.h.

References addPixelFlag.

Referenced by DetIdSelectorTest::DetIdSelectorTest().

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

Definition at line 2809 of file TrackerMap.cc.

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

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

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

Definition at line 299 of file TrackerMap.h.

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

Referenced by save_as_fedtrackermap().

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

Definition at line 308 of file TrackerMap.h.

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

Referenced by save_as_fectrackermap().

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

Definition at line 317 of file TrackerMap.h.

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

Referenced by save_as_HVtrackermap(), and save_as_psutrackermap().

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

Definition at line 329 of file TrackerMap.h.

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

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

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

Definition at line 942 of file TrackerMap.cc.

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

Referenced by save_as_fedtrackermap().

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

Definition at line 1028 of file TrackerMap.cc.

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

Referenced by save_as_fectrackermap().

1029 {
1030  double xp[4],yp[4];
1031  int color;
1032  int green = 0;
1033  int red = 0;
1034  int blue = 0;
1035  double xd[4],yd[4];
1036  int np = 4;
1037  double boxinitx=0., boxinity=0.;
1038  double dx=.9,dy=.9;
1039  int numccu_incolumn = 8;
1040  int numccu_inrow = 15;
1041  int numfec_incolumn = 5;
1042  int numfec_inrow = 4;
1043  boxinitx=boxinitx+(numfec_incolumn-(numfec_incrate-1)/numfec_inrow)*14.;
1044  boxinity=boxinity+(numfec_inrow-(numfec_incrate-1)%numfec_inrow)*16.;
1045  boxinity=boxinity+numccu_inrow-ccu->mpos;
1046  boxinitx = boxinitx+numccu_incolumn-(int)(ccu->getCcuRing()%numccu_incolumn);
1047  //std::cout << crate << " " << numfec_incrate << " " << ccu->getCcuRing()<<" "<<ccu->mpos<<" "<<boxinitx<< " " << boxinity << std::endl; ;
1048  xp[0]=boxinitx;yp[0]=boxinity;
1049  xp[1]=boxinitx+dx;yp[1]=boxinity;
1050  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1051  xp[3]=boxinitx;yp[3]=boxinity + dy;
1052  for(int j=0;j<4;j++){
1053  xd[j]=xdpixelfec(xp[j]);yd[j]=ydpixelfec(yp[j]);
1054  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1055  }
1056 
1057  char buffer [20];
1058  sprintf(buffer,"%X",ccu->idex);
1059  //sprintf(buffer,"%X",ccu->mod->idex);
1060  //std::string s = ccu->mod->name;
1061  std::string s = ccu->text;
1062  s.erase(s.begin()+s.find("connected"),s.end());
1063 
1064  if(ccu->red < 0){ //use count to compute color
1065  if(ccu->count > 0) {
1066  color = getcolor(ccu->value,palette);
1067  red=(color>>16)&0xFF;
1068  green=(color>>8)&0xFF;
1069  blue=(color)&0xFF;
1070  if(!print_total)ccu->value=ccu->value*ccu->count;//restore mod->value
1071  if(temporary_file)*svgfile << red << " " << green << " " << blue << " ";
1072  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=\"";
1073  } else {
1074  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1075  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=\"";
1076  }
1077  } else {//color defined with fillc
1078  if(ccu->red>255)ccu->red=255;
1079  if(ccu->green>255)ccu->green=255;
1080  if(ccu->blue>255)ccu->blue=255;
1081  if(temporary_file)*svgfile << ccu->red << " " << ccu->green << " " << ccu->blue << " ";
1082  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=\"";
1083  }
1084 if(temporary_file)*svgfile << np << " ";
1085 for(int k=0;k<np;k++){
1086  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1087  else *svgfile << xd[k] << "," << yd[k] << " " ;
1088 }
1089 if(temporary_file)*svgfile << std::endl;
1090 else *svgfile <<"\" />" <<std::endl;
1091 
1092 }
double ydpixelfec(double y)
Definition: TrackerMap.h:276
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:270
int getCcuSlot()
Definition: TmCcu.h:20
int np
Definition: AMPTWrapper.h:33
bool temporary_file
Definition: TrackerMap.h:502
std::ofstream * svgfile
Definition: TrackerMap.h:494
int green
Definition: TmCcu.h:9
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2852
int k[5][pyjets_maxn]
int mpos
Definition: TmCcu.h:18
def green(string)
float value
Definition: TmCcu.h:10
int idex
Definition: TmCcu.h:13
int red
Definition: TmCcu.h:9
int blue
Definition: TmCcu.h:9
std::string text
Definition: TmCcu.h:11
void TrackerMap::drawHV2 ( int  rack,
int  numcrate_inrack,
bool  print_total,
TmPsu psu,
std::ofstream *  svgfile,
bool  usePsuValue 
)

Definition at line 1170 of file TrackerMap.cc.

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

Referenced by save_as_HVtrackermap().

1171 {
1172  double xp[4],yp[4];
1173  int color;
1174  int greenHV2 = 0;
1175  int redHV2 = 0;
1176  int blueHV2 = 0;
1177  double xd[4],yd[4];
1178  int np = 4;
1179  double boxinitx=35, boxinity=12;
1180  double dx=1.1,dy=1.3;
1181 
1182  boxinitx= boxinitx+(5 - psu->getPsuCrate())*5;
1183  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1184 
1185  xp[0]=boxinitx;yp[0]=boxinity;
1186  xp[1]=boxinitx+dx;yp[1]=boxinity;
1187  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1188  xp[3]=boxinitx;yp[3]=boxinity + dy;
1189 
1190 
1191  for(int j=0;j<4;j++){
1192  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1193  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1194  }
1195 
1196  char buffer [20];
1197  sprintf(buffer,"%X",psu->idex);
1198  std::string s = psu->textHV2;
1199  s.erase(s.begin()+s.find("connected"),s.end());
1200 
1201  if(psu->redHV2 < 0){ //use count to compute color
1202 
1203  if(psu->valueHV2 > 0){
1204  color = getcolor(psu->valueHV2,palette);
1205  redHV2=(color>>16)&0xFF;
1206  greenHV2=(color>>8)&0xFF;
1207  blueHV2=(color)&0xFF;
1208  if(!print_total)psu->valueHV2=psu->valueHV2*psu->countHV2;//restore mod->value
1209  if(temporary_file)*svgfile << redHV2 << " " << greenHV2 << " " << blueHV2 << " ";
1210  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=\"";
1211  }
1212  else{
1213  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1214  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=\"";
1215  }
1216  }
1217 
1218  else {//color defined with fillc
1219  if(psu->redHV2>255)psu->redHV2=255;
1220  if(psu->greenHV2>255)psu->greenHV2=255;
1221  if(psu->blueHV2>255)psu->blueHV2=255;
1222  if(temporary_file)*svgfile << psu->redHV2 << " " << psu->greenHV2 << " " << psu->blueHV2 << " ";
1223  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=\"";
1224  }
1225 
1226 if(temporary_file)*svgfile << np << " ";
1227 for(int k=0;k<np;k++){
1228  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1229  else *svgfile << xd[k] << "," << yd[k] << " " ;
1230 }
1231 if(temporary_file)*svgfile << std::endl;
1232 else *svgfile <<"\" />" <<std::endl;
1233 
1234 }
int redHV2
Definition: TmPsu.h:21
std::string cmodid_HV2
Definition: TmPsu.h:33
int idex
Definition: TmPsu.h:11
int countHV2
Definition: TmPsu.h:27
int getPsuBoard()
Definition: TmPsu.h:17
int np
Definition: AMPTWrapper.h:33
double xdpixelpsu(double x)
Definition: TrackerMap.h:284
bool temporary_file
Definition: TrackerMap.h:502
std::ofstream * svgfile
Definition: TrackerMap.h:494
int greenHV2
Definition: TmPsu.h:21
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2852
int k[5][pyjets_maxn]
float valueHV2
Definition: TmPsu.h:25
std::string textHV2
Definition: TmPsu.h:36
int blueHV2
Definition: TmPsu.h:21
double ydpixelpsu(double y)
Definition: TrackerMap.h:290
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 1237 of file TrackerMap.cc.

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

Referenced by save_as_HVtrackermap().

1238 {
1239  double xp[4],yp[4];
1240  int color;
1241  int greenHV3 = 0;
1242  int redHV3 = 0;
1243  int blueHV3 = 0;
1244  double xd[4],yd[4];
1245  int np = 4;
1246  double boxinitx=36.5, boxinity=12;
1247  double dx=1.1,dy=1.3;
1248 
1249  boxinitx= boxinitx+(5 - psu->getPsuCrate())*5;
1250  boxinity= boxinity+(18 - psu->getPsuBoard())*1.75;
1251 
1252  xp[0]=boxinitx;yp[0]=boxinity;
1253  xp[1]=boxinitx+dx;yp[1]=boxinity;
1254  xp[2]=boxinitx+dx;yp[2]=boxinity + dy;
1255  xp[3]=boxinitx;yp[3]=boxinity + dy;
1256 
1257 
1258  for(int j=0;j<4;j++){
1259  xd[j]=xdpixelpsu(xp[j]);yd[j]=ydpixelpsu(yp[j]);
1260  //std::cout << boxinity << " "<< ymax << " "<< yp[j] << std::endl;
1261  }
1262 
1263  char buffer [20];
1264  sprintf(buffer,"%X",psu->idex);
1265  std::string s = psu->textHV3;
1266  s.erase(s.begin()+s.find("connected"),s.end());
1267 
1268  if(psu->redHV3 < 0){ //use count to compute color
1269  if(psu->valueHV3 > 0){
1270  color = getcolor(psu->valueHV3,palette);
1271  redHV3=(color>>16)&0xFF;
1272  greenHV3=(color>>8)&0xFF;
1273  blueHV3=(color)&0xFF;
1274  if(!print_total)psu->valueHV3=psu->valueHV3*psu->countHV3;//restore mod->value
1275  if(temporary_file)*svgfile << redHV3 << " " << greenHV3 << " " << blueHV3 << " ";
1276  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=\"";
1277  }
1278  else{
1279  if(temporary_file)*svgfile << 255 << " " << 255 << " " << 255 << " ";
1280  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=\"";
1281  }
1282  }
1283 
1284  else {//color defined with fillc
1285  if(psu->redHV3>255)psu->redHV3=255;
1286  if(psu->greenHV3>255)psu->greenHV3=255;
1287  if(psu->blueHV3>255)psu->blueHV3=255;
1288  if(temporary_file)*svgfile << psu->redHV3 << " " << psu->greenHV3 << " " << psu->blueHV3 << " ";
1289  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=\"";
1290  }
1291 
1292 if(temporary_file)*svgfile << np << " ";
1293 for(int k=0;k<np;k++){
1294  if(temporary_file)*svgfile << xd[k] << " " << yd[k] << " " ;
1295  else *svgfile << xd[k] << "," << yd[k] << " " ;
1296 }
1297 if(temporary_file)*svgfile << std::endl;
1298 else *svgfile <<"\" />" <<std::endl;
1299 
1300 }
int idex
Definition: TmPsu.h:11
int getPsuBoard()
Definition: TmPsu.h:17
int greenHV3
Definition: TmPsu.h:22
int np
Definition: AMPTWrapper.h:33
double xdpixelpsu(double x)
Definition: TrackerMap.h:284
int blueHV3
Definition: TmPsu.h:22
bool temporary_file
Definition: TrackerMap.h:502
std::ofstream * svgfile
Definition: TrackerMap.h:494
int getcolor(float value, int palette)
Definition: TrackerMap.cc:2852
int k[5][pyjets_maxn]
int redHV3
Definition: TmPsu.h:22
std::string cmodid_HV3
Definition: TmPsu.h:34
std::string textHV3
Definition: TmPsu.h:37
int countHV3
Definition: TmPsu.h:28
float valueHV3
Definition: TmPsu.h:24
double ydpixelpsu(double y)
Definition: TrackerMap.h:290
int getPsuCrate()
Definition: TmPsu.h:16
void TrackerMap::drawModule ( TmModule mod,
int  key,
int  layer,
bool  total,
std::ofstream *  file 
)

Definition at line 537 of file TrackerMap.cc.

References TmModule::blue, edmScanValgrind::buffer, TmModule::capvids, TmModule::CcuId, create_public_lumi_plots::color, funct::cos(), TmModule::count, PVValHelper::dx, PVValHelper::dy, getcolor(), TmModule::green, cmsRelvalreport::green(), TmModule::HVchannel, TmModule::idex, TmModule::idModule, isRingStereo(), gen::k, TmModule::length, M_PI, TmModule::name, nlay, np, palette, phi, phival(), posrel, TmModule::posx, TmModule::posy, TmModule::posz, TmModule::psuIdex, alignCSCRings::r, TmModule::red, 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().

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

Definition at line 2501 of file TrackerMap.cc.

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

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

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

Definition at line 1093 of file TrackerMap.cc.

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

Referenced by save_as_psutrackermap().

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

Definition at line 2778 of file TrackerMap.cc.

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

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

2778  {
2779 
2780  int key = layer*100000+ring*1000+nmod;
2781  TmModule * mod = smoduleMap[key];
2782  if(mod!=0){
2783  mod->value=mod->value+qty;
2784  mod->count++;
2785  }
2786  else std::cout << "**************************error in SvgModuleMap **************";
2787 }
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:141
int count
Definition: TmModule.h:13
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill ( int  idmod,
float  qty 
)

Definition at line 2758 of file TrackerMap.cc.

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

2758  {
2759 
2760  TmModule * mod = imoduleMap[idmod];
2761  if(mod!=0){
2762  mod->value=mod->value+qty;
2763  mod->count++;
2764  return;
2765  }else{
2766  TmModule * mod1 = imoduleMap[idmod+1];
2767  TmModule * mod2 = imoduleMap[idmod+2];
2768  if(mod1!=0 && mod2!=0){
2769  mod1->value=mod1->value+qty;
2770  mod1->count++;
2771  mod2->value=mod2->value+qty;
2772  mod2->count++;
2773  return;
2774  }}
2775  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2776 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:143
int count
Definition: TmModule.h:13
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill_all_blank ( )

Definition at line 2741 of file TrackerMap.cc.

References fill_current_val(), and imoduleMap.

Referenced by SiStripTrackerMapCreator::create(), and fillc().

2741  {
2742 
2743  std::map<const int , TmModule *>::iterator imod;
2744  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2745  fill_current_val(imod->first,0);
2746  }
2747 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:143
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:2751
void TrackerMap::fill_current_val ( int  idmod,
float  current_val 
)

Definition at line 2751 of file TrackerMap.cc.

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

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

2751  {
2752 
2753  TmModule * mod = imoduleMap[idmod];
2754  if(mod!=0) {mod->value=current_val; mod->count=1; mod->red=-1;}
2755  else std::cout << "**error in fill_current_val method ***module "<<idmod<<std::endl;
2756 }
float value
Definition: TmModule.h:12
ImoduleMap imoduleMap
Definition: TrackerMap.h:143
int count
Definition: TmModule.h:13
int red
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fill_current_val_fed_channel ( int  fedId,
int  fedCh,
float  current_val 
)

Definition at line 2566 of file TrackerMap.cc.

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

Referenced by fillc().

2567 {
2568  int key = fedId*1000+fedCh;
2569  TmApvPair* apvpair = apvMap[key];
2570 
2571  if(apvpair!=0) {apvpair->value=current_val; apvpair->count=1; apvpair->red=-1;}
2572  else
2573  std::cout << "*** error in FedTrackerMap fill_current_val method ***";
2574 }
int red
Definition: TmApvPair.h:10
int count
Definition: TmApvPair.h:13
SvgApvPair apvMap
Definition: TrackerMap.h:145
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
float  qty 
)

Definition at line 2590 of file TrackerMap.cc.

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

Referenced by fillc().

2591 {
2592  int key =crate*10000000+slot*100000+ring*1000+addr;
2593  TmCcu *ccu = ccuMap[key];
2594  if(ccu!=0){
2595  ccu->count++; ccu->value=ccu->value+qty;
2596  return;
2597 
2598  }
2599 
2600  std::cout << "*** error in FecTrackerMap fill by module method ***";
2601  }
MapCcu ccuMap
Definition: TrackerMap.h:152
int count
Definition: TmCcu.h:12
float value
Definition: TmCcu.h:10
Definition: TmCcu.h:5
void TrackerMap::fill_fed_channel ( int  fedId,
int  fedCh,
float  qty 
)

Definition at line 2699 of file TrackerMap.cc.

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

Referenced by fillc().

2700 {
2701  int key = fedId*1000+fedCh;
2702  TmApvPair* apvpair = apvMap[key];
2703  if(apvpair!=0){
2704  apvpair->value=apvpair->value+qty;
2705  apvpair->count++;
2706  return;
2707  }
2708  std::cout << "*** error inFedTrackerMap fill method ***";
2709 }
int count
Definition: TmApvPair.h:13
SvgApvPair apvMap
Definition: TrackerMap.h:145
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_fed_channel ( int  modId,
float  qty 
)

Definition at line 2551 of file TrackerMap.cc.

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

2552 {
2553  std::multimap<const int, TmApvPair*>::iterator pos;
2554  for (pos = apvModuleMap.lower_bound(idmod);
2555  pos != apvModuleMap.upper_bound(idmod); ++pos) {
2556  TmApvPair* apvpair = pos->second;
2557  if(apvpair!=0){
2558  apvpair->value=apvpair->value+qty;
2559  apvpair->count++;
2560  }
2561  }
2562  return;
2563  std::cout << "*** error in FedTrackerMap fill by module method ***";
2564  }
ModApvPair apvModuleMap
Definition: TrackerMap.h:147
int count
Definition: TmApvPair.h:13
float value
Definition: TmApvPair.h:11
void TrackerMap::fill_hv_channel2 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2660 of file TrackerMap.cc.

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

Referenced by fillc().

2661 {
2662  int key = rack*1000+crate*100+board;
2663  TmPsu *psu = psuMap[key];
2664  if(psu!=0){
2665  psu->countHV2++; psu->valueHV2=psu->valueHV2+qty;
2666  return;
2667 
2668  }
2669 
2670  std::cout << "*** error in HVTrackerMap fill by module method ***";
2671  }
int countHV2
Definition: TmPsu.h:27
float valueHV2
Definition: TmPsu.h:25
MapPsu psuMap
Definition: TrackerMap.h:156
Definition: TmPsu.h:6
void TrackerMap::fill_hv_channel3 ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2672 of file TrackerMap.cc.

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

Referenced by fillc().

2673 {
2674  int key = rack*1000+crate*100+board;
2675  TmPsu *psu = psuMap[key];
2676  if(psu!=0){
2677  psu->countHV3++; psu->valueHV3=psu->valueHV3+qty;
2678  return;
2679 
2680  }
2681 
2682  std::cout << "*** error in HVTrackerMap fill by module method ***";
2683  }
int countHV3
Definition: TmPsu.h:28
float valueHV3
Definition: TmPsu.h:24
MapPsu psuMap
Definition: TrackerMap.h:156
Definition: TmPsu.h:6
void TrackerMap::fill_lv_channel ( int  rack,
int  crate,
int  board,
float  qty 
)

Definition at line 2619 of file TrackerMap.cc.

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

Referenced by fillc().

2620 {
2621  int key = rack*1000+crate*100+board;
2622  TmPsu *psu = psuMap[key];
2623  if(psu!=0){
2624  psu->count++; psu->value=psu->value+qty;
2625  return;
2626 
2627  }
2628 
2629  std::cout << "*** error in LVTrackerMap fill by module method ***";
2630  }
int count
Definition: TmPsu.h:26
float value
Definition: TmPsu.h:23
MapPsu psuMap
Definition: TrackerMap.h:156
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 2712 of file TrackerMap.cc.

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

2712  {
2713 
2714  TmModule * mod = imoduleMap[idmod];
2715  if(mod!=0){
2716  mod->red=red; mod->green=green; mod->blue=blue;
2717  return;
2718  }
2719  std::cout << "**************************error in fill method **************module "<<idmod<<std::endl;
2720 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:143
def green(string)
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fillc ( int  layer,
int  ring,
int  nmod,
int  red,
int  green,
int  blue 
)

Definition at line 2721 of file TrackerMap.cc.

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

2721  {
2722 
2723  int key = layer*10000+ring*1000+nmod;
2724  TmModule * mod = smoduleMap[key];
2725 
2726  if(mod!=0){
2727  mod->red=red; mod->green=green; mod->blue=blue;
2728  return;
2729  }
2730  std::cout << "**************************error in fill method **************"<< std::endl;
2731 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:141
def green(string)
int green
Definition: TmModule.h:11
int red
Definition: TmModule.h:11
int blue
Definition: TmModule.h:11
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::fillc_all_blank ( )

Definition at line 2733 of file TrackerMap.cc.

References fillc(), and imoduleMap.

Referenced by fillc(), and SiStripTrackerMapCreator::setTkMapFromAlarm().

2733  {
2734 
2735  std::map<const int , TmModule *>::iterator imod;
2736  for( imod=imoduleMap.begin();imod !=imoduleMap.end(); imod++){
2737  fillc(imod->first,255,255,255);
2738  }
2739 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:143
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:104
void TrackerMap::fillc_fec_channel ( int  crate,
int  slot,
int  ring,
int  addr,
int  red,
int  green,
int  blue 
)

Definition at line 2577 of file TrackerMap.cc.

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

Referenced by fillc().

2578  {
2579  int key =crate*10000000+slot*100000+ring*1000+addr;
2580 
2581  TmCcu *ccu = ccuMap[key];
2582 
2583  if(ccu!=0){
2584  ccu->red=red; ccu->green=green; ccu->blue=blue;
2585  return;
2586  }
2587  std::cout << "*** error in FecTrackerMap fillc method ***";
2588 }
MapCcu ccuMap
Definition: TrackerMap.h:152
int green
Definition: TmCcu.h:9
def green(string)
int red
Definition: TmCcu.h:9
int blue
Definition: TmCcu.h:9
Definition: TmCcu.h:5
void TrackerMap::fillc_fed_channel ( int  fedId,
int  fedCh,
int  red,
int  green,
int  blue 
)

Definition at line 2539 of file TrackerMap.cc.

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

Referenced by fillc().

2540 {
2541  int key = fedId*1000+fedCh;
2542  TmApvPair* apvpair = apvMap[key];
2543 
2544  if(apvpair!=0){
2545  apvpair->red=red; apvpair->green=green; apvpair->blue=blue;
2546  return;
2547  }
2548  std::cout << "*** error in FedTrackerMap fillc method ***";
2549 }
int green
Definition: TmApvPair.h:10
int red
Definition: TmApvPair.h:10
int blue
Definition: TmApvPair.h:10
def green(string)
SvgApvPair apvMap
Definition: TrackerMap.h:145
void TrackerMap::fillc_hv_channel2 ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2632 of file TrackerMap.cc.

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

Referenced by fillc().

2633 {
2634 
2635  int key = rack*1000+crate*100+board;
2636 
2637  TmPsu *psu = psuMap[key];
2638 
2639  if(psu!=0){
2640  psu->redHV2=red; psu->greenHV2=green; psu->blueHV2=blue;
2641  return;
2642  }
2643  std::cout << "*** error in HVTrackerMap (channel 2) fillc method ***";
2644 }
int redHV2
Definition: TmPsu.h:21
int greenHV2
Definition: TmPsu.h:21
def green(string)
MapPsu psuMap
Definition: TrackerMap.h:156
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 2645 of file TrackerMap.cc.

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

Referenced by fillc().

2646 {
2647 
2648  int key = rack*1000+crate*100+board;
2649 
2650  TmPsu *psu = psuMap[key];
2651 
2652  if(psu!=0){
2653  psu->redHV3=red; psu->greenHV3=green; psu->blueHV3=blue;
2654  return;
2655  }
2656  std::cout << "*** error in HVTrackerMap (channel 3) fillc method ***";
2657 }
int greenHV3
Definition: TmPsu.h:22
int blueHV3
Definition: TmPsu.h:22
int redHV3
Definition: TmPsu.h:22
def green(string)
MapPsu psuMap
Definition: TrackerMap.h:156
Definition: TmPsu.h:6
void TrackerMap::fillc_lv_channel ( int  rack,
int  crate,
int  board,
int  red,
int  green,
int  blue 
)

Definition at line 2605 of file TrackerMap.cc.

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

Referenced by fillc().

2606 {
2607 
2608  int key = rack*1000+crate*100+board;
2609 
2610  TmPsu *psu = psuMap[key];
2611 
2612  if(psu!=0){
2613  psu->red=red; psu->green=green; psu->blue=blue;
2614  return;
2615  }
2616  std::cout << "*** error in LVTrackerMap fillc method ***";
2617 }
int red
Definition: TmPsu.h:20
int green
Definition: TmPsu.h:20
def green(string)
int blue
Definition: TmPsu.h:20
MapPsu psuMap
Definition: TrackerMap.h:156
Definition: TmPsu.h:6
int TrackerMap::find_layer ( int  ix,
int  iy 
)
inline

Definition at line 188 of file TrackerMap.h.

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

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

Definition at line 3511 of file TrackerMap.cc.

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

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

3511  {
3512  std::ifstream * ifilename;
3513  std::string ifname;
3514  if(jsPath!=""){
3515  ifname=jsPath+filename;
3516  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3517  if(!ifilename){
3518  ifname="CommonTools/TrackerMap/data/"+filename;
3519  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3520  }
3521  }else {
3522  ifname="CommonTools/TrackerMap/data/"+filename;
3523  ifilename = new std::ifstream(edm::FileInPath(ifname).fullPath().c_str(),std::ios::in);
3524  }
3525  if(!ifilename)std::cout << "File " << filename << " missing" << std::endl;
3526  return ifilename;
3527  }
std::string jsPath
Definition: TrackerMap.h:172
std::pair< float, float > TrackerMap::getAutomaticRange ( )

Definition at line 674 of file TrackerMap.cc.

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

Referenced by setTitle().

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

Definition at line 2852 of file TrackerMap.cc.

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

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

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

Definition at line 214 of file TrackerMap.h.

Referenced by init().

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

Definition at line 405 of file TrackerMap.h.

Referenced by init().

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

Definition at line 138 of file TrackerMap.h.

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

Definition at line 372 of file TrackerMap.h.

Referenced by init().

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

Definition at line 134 of file TrackerMap.h.

References xsize.

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

Definition at line 135 of file TrackerMap.h.

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

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

Definition at line 439 of file TrackerMap.cc.

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

Referenced by TrackerMap().

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

Definition at line 441 of file TrackerMap.h.

Referenced by drawModule(), and init().

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

Definition at line 463 of file TrackerMap.h.

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

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

Definition at line 428 of file TrackerMap.h.

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

Definition at line 2399 of file TrackerMap.cc.

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

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

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

Definition at line 2689 of file TrackerMap.cc.

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

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

2690 {
2691  int key = fedId*1000+fedCh;
2692  TmApvPair* apvpair = apvMap[key];
2693  if(apvpair!=0){
2694  return(apvpair->mod->idex);
2695  }
2696  return(0);
2697  std::cout << "*** error in FedTrackerMap module method ***";
2698 }
TmModule * mod
Definition: TmApvPair.h:16
unsigned int idex
Definition: TmModule.h:29
SvgApvPair apvMap
Definition: TrackerMap.h:145
int TrackerMap::nlayer ( int  det,
int  part,
int  lay 
)
inline

Definition at line 450 of file TrackerMap.h.

Referenced by init().

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

Definition at line 131 of file TrackerMap.h.

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

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

Definition at line 174 of file TrackerMap.h.

References M_PI, and phi.

Referenced by drawModule().

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

Definition at line 2434 of file TrackerMap.cc.

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

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

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

Definition at line 3180 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, mps_alisetup::command, gather_cfg::cout, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, l1t::stage2::layer2::fedId, fedMap, symbols::filetype, findfile(), firstcrate, firstRing, runEdmFileComparison::found, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, crabWrapper::key, 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, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, funct::pow(), printlayers(), psuMap, psuModuleMap, relativeConstraints::ring, alignCSCRings::s, save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), save_as_psutrackermap(), saveGeoTrackerMap, saveWebInterface, smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, tkMapLog, makeMuonMisalignmentScenario::txtfile, and ApeEstimator_cff::width.

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

Definition at line 3528 of file TrackerMap.cc.

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

Referenced by printall(), and printonline().

3528  {
3529  std::ofstream * xmlfile;
3530 saveAsSingleLayer=true;
3531 if(!print_total){
3532  for (int layer=1; layer < 44; layer++){
3533  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3534  for (int module=1;module<200;module++) {
3535  int key=layer*100000+ring*1000+module;
3536  TmModule * mod = smoduleMap[key];
3537  if(mod !=0 && !mod->notInUse()){
3538  mod->value = mod->value / mod->count;
3539  }
3540  }
3541  }
3542  }
3543  }
3544  if(minvalue>=maxvalue){
3545  minvalue=9999999.;
3546  maxvalue=-9999999.;
3547  for (int layer=1; layer < 44; layer++){
3548  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3549  for (int module=1;module<200;module++) {
3550  int key=layer*100000+ring*1000+module;
3551  TmModule * mod = smoduleMap[key];
3552  if(mod !=0 && !mod->notInUse()){
3553  if (minvalue > mod->value)minvalue=mod->value;
3554  if (maxvalue < mod->value)maxvalue=mod->value;
3555  }
3556  }
3557  }
3558  }
3559  }
3560 for (int layer=1; layer < 44; layer++){
3561  std::ostringstream outs;
3562  outs << outputfilename <<"layer"<<layer<< ".xml";
3563  xmlfile = new std::ofstream(outs.str().c_str(),std::ios::out);
3564  *xmlfile << "<?xml version=\"1.0\" standalone=\"no\"?>"<<std::endl;
3565  *xmlfile << "<svg xmlns=\"http://www.w3.org/2000/svg\""<<std::endl;
3566  *xmlfile << "xmlns:svg=\"http://www.w3.org/2000/svg\""<<std::endl;
3567  *xmlfile << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" >"<<std::endl;
3568  *xmlfile << "<script type=\"text/ecmascript\" xlink:href=\"layer.js\" />"<<std::endl;
3569  *xmlfile << "<svg id=\"mainMap\" x=\"0\" y=\"0\" viewBox=\"0 0 500 500\" width=\"700\" height=\"700\" onload=\"TrackerLayer.init()\">"<<std::endl;
3570  if(layer<31)*xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,1.)\" > "<<std::endl;
3571  else *xmlfile << "<g id=\"layer\" transform=\" translate(0,400) rotate(270) scale(1.,0.8)\" > "<<std::endl;
3572  *xmlfile << "<rect fill=\"lightblue\" stroke=\"none\" x=\"0\" y=\"0\" width=\"700\" height=\"700\" />"<<std::endl;
3573  *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;
3574  *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;
3575  *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;
3576  *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;
3577  *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;
3578 
3579  // nlay=layer;
3580  defwindow(layer);
3581  for (int ring=firstRing[layer-1]; ring < ntotRing[layer-1]+firstRing[layer-1];ring++){
3582  for (int module=1;module<200;module++) {
3583  int key=layer*100000+ring*1000+module;
3584  TmModule * mod = smoduleMap[key];
3585  if(mod !=0 && !mod->notInUse()){
3586  drawModule(mod,key,layer,print_total,xmlfile);
3587  }
3588  }
3589  }
3590  *xmlfile << "</g> </svg> <text id=\"currentElementText\" x=\"40\" y=\"30\">" << std::endl;
3591  *xmlfile << "<tspan id=\"line1\" x=\"40\" y=\"30\"> </tspan> " << std::endl;
3592  *xmlfile << "<tspan id=\"line2\" x=\"40\" y=\"60\"> </tspan> " << std::endl;
3593  *xmlfile << "<tspan id=\"line3\" x=\"40\" y=\"90\"> </tspan> " << std::endl;
3594  *xmlfile << "<tspan id=\"line4\" x=\"40\" y=\"120\"> </tspan> " << std::endl;
3595  if(layer > 33){
3596  *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;
3597  *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;
3598  *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;
3599  *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;
3600  *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;
3601  }
3602  else{
3603  *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;
3604  *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;
3605  *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;
3606  *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;
3607  *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;
3608  }
3609  *xmlfile << " </text> </svg>" << std::endl;
3610  xmlfile->close();delete xmlfile;
3611  }
3612 saveAsSingleLayer=false;
3613 }
float minvalue
Definition: TrackerMap.h:500
float value
Definition: TmModule.h:12
SmoduleMap smoduleMap
Definition: TrackerMap.h:141
int module(int fedId, int fedCh)
Definition: TrackerMap.cc:2689
void defwindow(int num_lay)
Definition: TrackerMap.h:329
int firstRing[43]
Definition: TrackerMap.h:480
bool saveAsSingleLayer
Definition: TrackerMap.h:507
Definition: value.py:1
void drawModule(TmModule *mod, int key, int layer, bool total, std::ofstream *file)
Definition: TrackerMap.cc:537
xmlfile
Make an XML representation of the misalignment.
int count
Definition: TmModule.h:13
bool notInUse()
Definition: TmModule.h:24
float maxvalue
Definition: TrackerMap.h:500
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
int ntotRing[43]
Definition: TrackerMap.h:479
void TrackerMap::printonline ( )

Definition at line 2879 of file TrackerMap.cc.

References apvMap, apvModuleMap, ccuMap, mps_alisetup::command, gather_cfg::cout, enableFecProcessing, enableFedProcessing, enableHVProcessing, enableLVProcessing, fecModuleMap, l1t::stage2::layer2::fedId, fedMap, findfile(), firstcrate, firstRing, TmCcu::getCcuCrate(), TmApvPair::getFedCh(), TmApvPair::getFedId(), TmPsu::getPsuBoard(), TmPsu::getPsuRack(), gmaxvalue, gminvalue, TmPsu::idex, TmCcu::idex, TmApvPair::idex, TmModule::idex, crabWrapper::key, 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, MillePedeFileConverter_cfg::out, createfilelist::outputfilename, printlayers(), psuMap, psuModuleMap, relativeConstraints::ring, save(), save_as_fectrackermap(), save_as_fedtrackermap(), save_as_HVtrackermap(), save_as_psutrackermap(), smoduleMap, AlCaHLTBitMon_QueryRunRegistry::string, temporary_file, TmCcu::text, TmApvPair::text, TmPsu::text, TmPsu::textHV2, TmPsu::textHV3, title, and makeMuonMisalignmentScenario::txtfile.

Referenced by SiStripTrackerMapCreator::create().

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

Definition at line 431 of file TrackerMap.cc.

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

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

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

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

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

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

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

Referenced by printall(), and printonline().

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

Definition at line 2127 of file TrackerMap.cc.

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

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

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

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

Referenced by printall(), and printonline().

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

Definition at line 1845 of file TrackerMap.cc.

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

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

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

Definition at line 670 of file TrackerMap.cc.

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

Referenced by setTitle(), and SiStripTrackerMapCreator::setTkMapRange().

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

Definition at line 2789 of file TrackerMap.cc.

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

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

2789  {
2790 
2791  TmModule * mod = imoduleMap[idmod];
2792  if(mod!=0){
2793  mod->text=s;
2794  }
2795  else std::cout << "**************************error in IdModuleMap **************";
2796 }
ImoduleMap imoduleMap
Definition: TrackerMap.h:143
std::string text
Definition: TmModule.h:14
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::setText ( int  layer,
int  ring,
int  nmod,
std::string  s 
)

Definition at line 2799 of file TrackerMap.cc.

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

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

2799  {
2800 
2801  int key = layer*100000+ring*1000+nmod;
2802  TmModule * mod = smoduleMap[key];
2803  if(mod!=0){
2804  mod->text=s;
2805  }
2806  else std::cout << "**************************error in SvgModuleMap **************";
2807 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:141
std::string text
Definition: TmModule.h:14
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void TrackerMap::setTitle ( std::string  s)
inline
void TrackerMap::showPalette ( bool  printflag1)
inline

Definition at line 126 of file TrackerMap.h.

References printflag.

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

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

Definition at line 236 of file TrackerMap.h.

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

Referenced by drawModule().

236  {
237  double res;
238  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
239  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
240  return res;
241  }
double xmin
Definition: TrackerMap.h:490
Definition: Electron.h:4
bool saveAsSingleLayer
Definition: TrackerMap.h:507
double xmax
Definition: TrackerMap.h:490
double TrackerMap::xdpixelc ( double  x)
inline

Definition at line 256 of file TrackerMap.h.

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

Referenced by drawApvPair().

256  {
257  double res;
258  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE);
259  else res= ((x-xmin)/(xmax-xmin)*XFEDCSIZE)+ix;
260  return res;
261  }
double xmin
Definition: TrackerMap.h:490
Definition: Electron.h:4
bool saveAsSingleLayer
Definition: TrackerMap.h:507
#define XFEDCSIZE
Definition: TrackerMap.h:60
double xmax
Definition: TrackerMap.h:490
double TrackerMap::xdpixelfec ( double  x)
inline

Definition at line 270 of file TrackerMap.h.

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

Referenced by drawCcu().

270  {
271  double res;
272  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*xsize);
273  else res= ((x-xmin)/(xmax-xmin)*xsize)+ix;
274  return res;
275  }
double xmin
Definition: TrackerMap.h:490
Definition: Electron.h:4
bool saveAsSingleLayer
Definition: TrackerMap.h:507
double xmax
Definition: TrackerMap.h:490
double TrackerMap::xdpixelpsu ( double  x)
inline

Definition at line 284 of file TrackerMap.h.

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

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

284  {
285  double res;
286  if(saveAsSingleLayer)res= ((x-xmin)/(xmax-xmin)*XPSURSIZE);
287  else res= ((x-xmin)/(xmax-xmin)*XPSURSIZE)+ix;
288  return res;
289  }
double xmin
Definition: TrackerMap.h:490
#define XPSURSIZE
Definition: TrackerMap.h:45
Definition: Electron.h:4
bool saveAsSingleLayer
Definition: TrackerMap.h:507
double xmax
Definition: TrackerMap.h:490
double TrackerMap::ydpixel ( double  y)
inline

Definition at line 242 of file TrackerMap.h.

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

Referenced by drawModule().

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

Definition at line 262 of file TrackerMap.h.

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

Referenced by drawApvPair().

262  {
263  double res;
264  double y1;
265  y1 = (y-ymin)/(ymax-ymin);
266  if(saveAsSingleLayer)res= YFEDCSIZE - (y1*YFEDCSIZE);
267  else res= YFEDCSIZE - (y1*YFEDCSIZE)+iy;
268  return res;
269  }
#define YFEDCSIZE
Definition: TrackerMap.h:61
Definition: Electron.h:4
double ymax
Definition: TrackerMap.h:490
bool saveAsSingleLayer
Definition: TrackerMap.h:507
double ymin
Definition: TrackerMap.h:490
double TrackerMap::ydpixelfec ( double  y)
inline

Definition at line 276 of file TrackerMap.h.

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

Referenced by drawCcu().

276  {
277  double res;
278  double y1;
279  y1 = (y-ymin)/(ymax-ymin);
280  if(saveAsSingleLayer)res= 2*ysize - (y1*2*ysize);
281  else res= 2*ysize - (y1*2*ysize)+iy;
282  return res;
283  }
Definition: Electron.h:4
double ymax
Definition: TrackerMap.h:490
bool saveAsSingleLayer
Definition: TrackerMap.h:507
double ymin
Definition: TrackerMap.h:490
double TrackerMap::ydpixelpsu ( double  y)
inline

Definition at line 290 of file TrackerMap.h.

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

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

290  {
291  double res;
292  double y1;
293  y1 = (y-ymin)/(ymax-ymin);
294  if(saveAsSingleLayer)res=YPSURSIZE - (y1*YPSURSIZE);
295  else res= YPSURSIZE - (y1*YPSURSIZE)+iy;
296  return res;
297  }
Definition: Electron.h:4
double ymax
Definition: TrackerMap.h:490
bool saveAsSingleLayer
Definition: TrackerMap.h:507
double ymin
Definition: TrackerMap.h:490
#define YPSURSIZE
Definition: TrackerMap.h:46

Member Data Documentation

bool TrackerMap::addPixelFlag
private

Definition at line 508 of file TrackerMap.h.

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

SvgApvPair TrackerMap::apvMap
ModApvPair TrackerMap::apvModuleMap

Definition at line 147 of file TrackerMap.h.

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

std::ifstream* TrackerMap::ccufile
protected

Definition at line 498 of file TrackerMap.h.

MapCcu TrackerMap::ccuMap
bool TrackerMap::enableFecProcessing

Definition at line 164 of file TrackerMap.h.

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

bool TrackerMap::enableFedProcessing

Definition at line 163 of file TrackerMap.h.

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

bool TrackerMap::enableHVProcessing

Definition at line 166 of file TrackerMap.h.

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

bool TrackerMap::enableLVProcessing

Definition at line 165 of file TrackerMap.h.

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

FecModule TrackerMap::fecModuleMap

Definition at line 154 of file TrackerMap.h.

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

SvgFed TrackerMap::fedMap

Definition at line 149 of file TrackerMap.h.

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

bool TrackerMap::firstcall
protected

Definition at line 493 of file TrackerMap.h.

Referenced by init().

int TrackerMap::firstcrate
protected

Definition at line 487 of file TrackerMap.h.

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

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

Definition at line 499 of file TrackerMap.h.

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

float TrackerMap::gminvalue
protected

Definition at line 499 of file TrackerMap.h.

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

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

Definition at line 171 of file TrackerMap.h.

Referenced by build(), and TrackerMap().

std::ifstream* TrackerMap::inputfile
protected

Definition at line 497 of file TrackerMap.h.

Referenced by load().

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

Definition at line 496 of file TrackerMap.h.

Referenced by print().

std::string TrackerMap::jsfilename

Definition at line 171 of file TrackerMap.h.

Referenced by print(), and TrackerMap().

std::string TrackerMap::jsPath

Definition at line 172 of file TrackerMap.h.

Referenced by findfile(), and TrackerMap().

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

Definition at line 486 of file TrackerMap.h.

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

int TrackerMap::ndet

Definition at line 168 of file TrackerMap.h.

Referenced by init().

int TrackerMap::nfeccrates
protected

Definition at line 488 of file TrackerMap.h.

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

int TrackerMap::nlay
protected

Definition at line 483 of file TrackerMap.h.

Referenced by drawModule(), and ydpixel().

int TrackerMap::npart

Definition at line 169 of file TrackerMap.h.

Referenced by init().

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

Definition at line 501 of file TrackerMap.h.

Referenced by build().

float TrackerMap::oldz
private

Definition at line 506 of file TrackerMap.h.

bool TrackerMap::onlyPixelFlag
private

Definition at line 509 of file TrackerMap.h.

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

int TrackerMap::palette
bool TrackerMap::posrel
protected

Definition at line 492 of file TrackerMap.h.

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

bool TrackerMap::printflag
bool TrackerMap::psetAvailable

Definition at line 173 of file TrackerMap.h.

Referenced by TrackerMap().

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

Definition at line 162 of file TrackerMap.h.

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

bool TrackerMap::saveWebInterface
SvgFed TrackerMap::slotMap

Definition at line 150 of file TrackerMap.h.

Referenced by save_as_fedtrackermap(), and TrackerMap().

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

Definition at line 494 of file TrackerMap.h.

Referenced by print().

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