CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelTrackerMapCreator.cc
Go to the documentation of this file.
1 
13 #include <iostream>
14 #include <sstream>
15 #include "TText.h"
16 using namespace std;
17 
18 //==============================================================================
19 // -- Constructor
20 //
22  string theTKType,
23  bool offlineXMLfile_)
24 {
25 // cout << ACYellow << ACBold
26 // << "[SiPixelTrackerMapCreator::SiPixelTrackerMapCreator()]"
27 // << ACPlain << " ctor" << endl ;
28 
29  mEName = themEName ;
30  TKType = theTKType ;
31 //cout<<"ME and type for new TrackerMap are: "<<themEName<<" , "<<theTKType<<endl;
32  stringstream title ;
33  title.str("") ;
34  title << themEName ;
35 
36  trackerMap = new SiPixelTrackerMap(title.str());
37  if (infoExtractor_ == 0) infoExtractor_ = new SiPixelInformationExtractor(offlineXMLfile_);
38 }
39 
40 //==============================================================================
41 // -- Destructor
42 //
44 {
45 // if (trackerMap) delete trackerMap;
46 // if (infoExtractor_) delete infoExtractor_;
47 // cout << ACYellow << ACBold
48 // << "[SiPixelTrackerMapCreator::~SiPixelTrackerMapCreator()]"
49 // << ACPlain << " dtor" << endl ;
50 }
51 
52 //------------------------------------------------------------------------------
57 {
58 // cout << ACYellow << ACBold
59 // << "[SiPixelTrackerMapCreator::create()] "
60 // << ACPlain
61 // << " Creating tracker map for ME: "
62 // << mEName
63 // << endl;
64 
65  vector<MonitorElement*> mEList ;
66  map<string, int> mEHash ;
67 
68  infoExtractor_->selectMEList(bei, mEName, mEList) ;
69  infoExtractor_->getMEList( bei, mEHash) ;
70 
71  int nImages = mEHash.size() ;
72 
73  for(vector<MonitorElement*>::iterator it=mEList.begin(); it!=mEList.end(); it++)
74  {
75  paintTkMap(*it);
76  }
77 
78  trackerMap->print(true, TKType);
79 //cout<<"Going to create inner frame now! Still in TMC::create"<<endl;
80  std::ofstream innerFrame ;
81 
82  innerFrame.open( "rightEmbedded.html", ios::out );
83 
84  if( !innerFrame )
85  {
86  cout << ACRed << ACBold
87  << "[SiPixelTrackerMapCreator::create()] "
88  << ACCyan << ACBold
89  << "Could not open rightEmbedded.html"
90  << ACPlain
91  << endl ;
92  return ;
93  }
94 
95  innerFrame << "<html> " << "\n"
96  << "<!-- " << "\n"
97  << " Author: D. Menasce " << "\n"
98  << " Pixel Tracker Map " << "\n"
99  << "--> " << "\n"
100  << " " << "\n"
101  << "<meta http-equiv='pragma' " << "\n"
102  << " content ='no-cache'> " << "\n"
103  << " " << "\n"
104  << "<head> " << "\n"
105  << " <link rel = 'stylesheet' " << "\n"
106  << " type = 'text/css' " << "\n"
107  << " href = 'css_files/wz_dragdrop.css>' " << "\n"
108  << " <link rel = 'stylesheet' " << "\n"
109  << " type = 'text/css' " << "\n"
110  << " href = 'css_files/magnifier.css'> " << "\n"
111  << " <script type = 'text/javascript' " << "\n"
112  << " src = 'js_files/magnifier.js'> " << "\n"
113  << " </script> " << "\n"
114  << " <script type = 'text/javascript' " << "\n"
115  << " src = 'js_files/wz_dragdrop.js'> " << "\n"
116  << " </script> " << "\n"
117  << " <script type = 'text/javascript' " << "\n"
118  << " src = 'js_files/DMLibrary.js'> " << "\n"
119  << " </script> " << "\n"
120  << " " << "\n"
121  << "</head> " << "\n"
122  << " " << "\n"
123  << "<body bgcolor='#414141'> " << "\n"
124  << " " << "\n"
125  << " <center> " << "\n"
126  << " " << endl ;
127  for( int img=1; img<=nImages; img++)
128  {
129  stringstream sId, sNm ;
130  sId.str(""); sId << "binding" << img ;
131  sNm.str(""); sNm << "baseImage" << img ;
132  string sid = sId.str() ;
133  string snm = sNm.str() ;
134  innerFrame << " <div id = 'binding' " << "\n"
135  << " name = '" << sid << "'> " << "\n"
136  << " <img id = '" << snm << "' " << "\n"
137  << " name = '" << snm << "' " << "\n"
138  << " src = 'images/EmptyPlot.png' " << "\n"
139  << " alt = 'picture geometry:800x600' " << "\n"
140  << " onload = 'RightEmbedded.innerLoading(\"" << sid << "\",\"" << snm << "\")'" << "\n"
141  << " onclick = 'RightEmbedded.innerTransport(event)' " << "\n"
142  << " onmouseover = 'this.T_SHADOWWIDTH=4; " << "\n"
143  << " this.T_OPACITY =70; " << "\n"
144  << " this.T_FONTCOLOR =\"#000000\"; " << "\n"
145  << " this.T_WIDTH =200; " << "\n"
146  << " return escape(\"Click to send to pan/zoom area\")' " << "\n"
147  << " width = '267' " << "\n"
148  << " height = '200' /> " << "\n"
149  << " </div> " << endl ;
150  }
151  innerFrame << " " << "\n"
152  << "</center> " << "\n"
153  << " " << "\n"
154  << "<script type = 'text/javascript' " << "\n"
155  << " src = 'js_files/rightEmbedded.js'> " << "\n"
156  << "</script> " << "\n"
157  << " " << "\n"
158  << "<script type='text/javascript' " << "\n"
159  << " src ='js_files/wz_tooltip.js'> " << "\n"
160  << "</script> " << "\n"
161  << "</html> " << endl ;
162  innerFrame.close() ;
163 // cout<<"leaving TMC::create."<<endl;
164 }
165 
166 //==============================================================================
167 // -- Draw Monitor Elements
168 //
170 {
171 // double sts;
172 // int rval, gval, bval, detId;
173 // cout<<"Inside SiPixelTrackerMapCreator::paintTkMap: me= "<<mE->getName()<<endl;
174 }
175 
176 //==============================================================================
177 // -- Browse through monitorable and get values needed by TrackerMap
178 //
180 {
181  cout << ACCyan << ACBold
182  << "[SiPixelTrackerMapCreator::create()] "
183  << ACRed << ACReverse
184  << "List of histograms in"
185  << ACPlain
186  << " "
187  << ACBlue << ACBold
188  << bei->pwd()
189  << ACPlain << endl ;
190 
191 
192  vector<string> histoList = bei->getMEs();
193 
194  for (vector<string>::const_iterator it = histoList.begin(); it != histoList.end(); it++)
195  {
196  cout << ACCyan << ACBold
197  << "[SiPixelTrackerMapCreator::create()] "
198  << ACRed << ACReverse
199  << "Histogram:"
200  << ACPlain
201  << " "
202  << *it
203  << ACPlain << endl ;
204  }
205 
206  vector<string> subDirs = bei->getSubdirs();
207 
208  for (vector<string>::const_iterator it = subDirs.begin(); it != subDirs.end(); it++)
209  {
210  bei->cd(*it);
211  cout << ACCyan << ACBold
212  << "[SiPixelTrackerMapCreator::create()] "
213  << ACRed << ACBold
214  << "Moved down to"
215  << ACPlain
216  << " "
217  << ACBlue << ACBold
218  << bei->pwd()
219  << ACPlain << endl ;
220  exploreBeiStructure(bei);
221  bei->goUp();
222  cout << ACCyan << ACBold
223  << "[SiPixelTrackerMapCreator::create()] "
224  << ACRed << ACBold
225  << "Now back to"
226  << ACPlain
227  << " "
228  << ACBlue << ACBold
229  << bei->pwd()
230  << ACPlain << endl ;
231  }
232  return true ;
233 }
#define ACRed
Definition: ANSIColors.h:15
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1659
SiPixelTrackerMapCreator(std::string themEName, std::string theTKType, bool offlineXMLfile)
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
#define ACBlue
Definition: ANSIColors.h:12
return((rh^lh)&mask)
bool exploreBeiStructure(DQMStore *bei)
void create(DQMStore *bei)
(Documentation under construction).
void paintTkMap(MonitorElement *mE)
#define ACReverse
Definition: ANSIColors.h:32
tuple out
Definition: dbtoconf.py:99
#define ACCyan
Definition: ANSIColors.h:14
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1682
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:678
tuple cout
Definition: gather_cfg.py:121
#define ACPlain
Definition: ANSIColors.h:28
#define ACBold
Definition: ANSIColors.h:29
const std::string & pwd(void) const
Definition: DQMStore.cc:639