ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/DTDPGAnalysis/scripts/doDTOfflineAnalWeb.pl
Revision: 1.3
Committed: Thu Jul 4 16:41:54 2013 UTC (11 years, 9 months ago) by marycruz
Content type: application/x-perl
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +346 -448 lines
Log Message:
Update last version of PromptOffline

File Contents

# Content
1 #!/usr/bin/perl
2
3 $run = $ARGV[0];
4 $dir = $ARGV[1];
5
6 $pathweb = "/afs/cern.ch/cms/MUON/dt/sx5/Results/GlobalRuns/$dir/Run$run";
7
8 if (($run eq "") || ($dir eq "" )) {
9
10 print " Execute as:: \n";
11 print " > doDTOfflineAnalWeb #RUN_NB #GLOBAL_RUN_DIR \n";
12 print " #RUN_NB = Run number \n";
13 print " #GLOBAL_RUN_DIR = Directory where gifs are saved \n";
14 print " (CRUZET09/CRAFT09) \n";
15
16 }
17
18 elsif (!(-e "$pathweb")){
19
20 print " \n";
21 print " Please select a valid directory (CRUZET09/CRAFT09/...) \n";
22 print " $pathweb does not exist \n";
23 print " \n";
24 print " Execute as:: \n";
25 print " > doDTOfflineAnalWeb #RUN_NB #GLOBAL_RUN_DIR \n";
26 print " #RUN_NB = Run number \n";
27 print " #GLOBAL_RUN_DIR = Directory where gifs are saved \n";
28 print " (CRUZET09/CRAFT09) \n";
29
30
31 }
32
33 else{
34
35 ################################################################################################
36 #
37 # Root website (general)
38 #
39 ################################################################################################
40
41
42 open(FILELIST,"/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DT/OfflineCode/Scripts/WebScripts/plotlistForWeb_Main.txt");
43 @gifs = <FILELIST>;
44 close(FILELIST);
45
46 ## print $pathweb;
47
48 ### Reference run
49
50 open(REFRUN,"/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DT/OfflineCode/Scripts/referenceRun.txt");
51 @rrunv = <REFRUN>;
52 close(REFRUN);
53
54
55 $runref=@rrunv[0];
56 print "$runref\n";
57 $pathrefW =@rrunv[1];
58 print "$pathrefW\n";
59
60 #### $pathref = "/afs/cern.ch/cms/MUON/dt/sx5/Results/GlobalRuns/Beam2011/Collisions/Run177718/";
61 #--------------------
62
63
64 if (!(-e "$pathweb/webPlots/")){
65 system("mkdir $pathweb/webPlots/");
66 }
67
68 print " Producing main website ..................................... \n";
69
70 $pathcurrent = $pathweb;
71
72 $pathcurrentW = "";
73
74
75 open(OUTF,">$pathweb/Welcome.html");
76
77 &head;
78
79 print OUTF <<EndofHtml1;
80
81 <BODY BGCOLOR="lightyellow">
82 <CENTER>
83 <IMG SRC="http://cern.ch/isr-muon/CMS-logo.gif" ALIGN=UP WIDTH=45 HEIGHT=45>
84 <font size=+5>
85 <B>DT run $run prompt offline plots</B></font>
86 <IMG SRC="http://cern.ch/isr-muon/CMS-logo.gif" ALIGN=UP WIDTH=45 HEIGHT=45>
87 <hr>
88 <CENTER>
89
90 <div class="highslide-gallery">
91
92 EndofHtml1
93
94
95 ## Defined previously: $gif + $gifref + $runref + $giftitle
96
97 $count=0;
98
99
100
101 foreach $file (@gifs){
102
103 if ($count==0){
104 print OUTF "<h2>Data Integrity plots and L1 GMT Trigger Ref</h2><TABLE><TR><TD>\n"
105 }
106 elsif ($count==3){
107 print OUTF "</TABLE><HR><h2>Chamber performance plots</h2>\n";
108 print OUTF "<TABLE><TR><TD>\n";
109 }
110 elsif (($count==7) || ($count==11)|| ($count==20) || ($count==24) || ($count==28) ){
111 print OUTF "<TR><TD>\n";
112 }
113 elsif ($count==16){
114 print OUTF "</TABLE><HR><h2>Trigger performance plots</h2>\n";
115 print OUTF "<TABLE><TR><TD>\n";
116 }
117 else {
118 print OUTF "<TD>\n";
119
120 }
121
122
123 ($gif,$giftitle) = split(/\@\@/,$file);
124 &doItem;
125 $count++;
126 ## print OUTF "<BR>\n";
127
128 }
129
130
131
132 print OUTF <<EndofHtml1;
133
134 </div>
135
136 </TABLE>
137 <h3>
138 Individual wheel results<BR>
139 <button onClick="window.location='Wheel+2/'">YB+2</button>
140 <button onClick="window.location='Wheel+1/'">YB+1</button>
141 <button onClick="window.location='Wheel+0/'">YB0</button>
142 <button onClick="window.location='Wheel-1/'">YB-1</button>
143 <button onClick="window.location='Wheel-2/'">YB-2</button>
144 <HR>
145 <button onClick="window.location='ExtraPlots/'">Extra Plots</button>
146 EndofHtml1
147
148 close(OUTF);
149
150 ######## End of main page
151
152 ################################################################################################
153 # Pages for individual wheels
154 ################################################################################################
155
156 open(FILELIST,"/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DT/OfflineCode/Scripts/WebScripts/plotlistForWeb_Wheel.txt");
157 @gifs = <FILELIST>;
158 close(FILELIST);
159
160
161 @wheel_names = ("-","+2","+1","+0","-1","-2");
162 @wheel_nb = ("-","2","1","0","-1","-2");
163
164 @sector_names = ("-","01","02","03","04","05","06","07","08","09","10","11","12","13","14");
165
166 for ($i=1;$i<=5;$i++){
167
168
169 $wheel = $wheel_names[$i];
170 $wn = $wheel_nb[$i];
171
172 print " Producing website wheel $wheel ..................................... \n";
173
174
175 open(OUTF,">$pathweb/Wheel$wheel/Welcome.html");
176
177 $pathcurrent = "$pathweb\/Wheel$wheel";
178 $pathcurrentW = "Wheel$wheel/";
179
180 if (!(-e "$pathcurrent/webPlots/")){
181 system("mkdir $pathcurrent/webPlots/");
182 }
183
184 &head;
185
186 print OUTF <<EndofHtml1;
187
188 <BODY BGCOLOR="lightgreen">
189
190 <CENTER>
191 <IMG SRC="http://cern.ch/isr-muon/CMS-logo.gif" ALIGN=UP WIDTH=45 HEIGHT=45>
192 <font size=+5>
193 <B>DT run $run prompt offline plots for wheel $wheel</B>
194 <IMG SRC="http://cern.ch/isr-muon/CMS-logo.gif" ALIGN=UP WIDTH=45 HEIGHT=45>
195
196 <hr>
197 <CENTER>
198
199 EndofHtml1
200
201 ## Defined previously: $gif + $gifref + $runref + $giftitle
202
203 $count=0;
204
205 foreach $file (@gifs){
206
207 if ($count==0){
208 print OUTF "<h2>Data Integrity plots</h2><TABLE><TR><TD>\n"
209 }
210 elsif ($count==2){
211 print OUTF "</TABLE><HR><h2>Chamber performance plots</h2>\n";
212 print OUTF "<TABLE><TR><TD>\n";
213 }
214 elsif (($count==6) || ($count==10)|| ($count==18) || ($count==22) || ($count==28) || ($count==14) ){
215 print OUTF "<TR><TD>\n";
216 }
217
218 elsif ($count==24){
219 print OUTF "</TABLE><HR><h2>Trigger performance plots</h2>\n";
220 print OUTF "<TABLE><TR><TD>\n";
221 }
222 else {
223 print OUTF "<TD>\n";
224
225 }
226
227
228 ($gif,$giftitle) = split(/\@\@/,$file);
229 &doItem;
230 $count++;
231
232 }
233
234
235
236 print OUTF <<EndofHtml1;
237
238 </TABLE>
239
240 <h2> Sectors data<BR>
241
242 EndofHtml1
243
244
245
246 for ($s=1;$s<=14;$s++){
247
248 $sector = $sector_names[$s];
249
250 print OUTF <<EndofHtml1;
251
252 <button onClick="window.location='Sect$sector/'">Sect $sector</button>
253
254 EndofHtml1
255
256 &createsectorweb($run,$wn,$sector,$s);
257
258 }
259
260 print OUTF <<EndofHtml1;
261 <BR>
262 <button onClick="window.location='ExtraPlots/'">Extra Plots</button>
263
264 <h3>
265
266 EndofHtml1
267
268 close(OUTF);
269
270 } ## Loop on sectors
271
272 } ## Loop on wheels
273
274 ######## End of wheel pages
275
276
277
278 ################################################################################################
279 ################################################################################################
280
281 sub doItem{
282
283 if ($issector==1){
284 $filout = "OUTF2"
285 }
286 else{
287 $filout = "OUTF"
288 }
289 ;
290
291
292 $gifcurrent = $gif;
293 $gifref = $gif;
294
295 $gifcurrent =~ s/\$run/$run/;
296 $gifref =~ s/\$run/$runref/;
297
298 $gifcurrent =~ s/\$wn/$wn/;
299 $gifref =~ s/\$wn/$wn/;
300
301 $gifcurrent =~ s/\$sn/$s/;
302 $gifref =~ s/\$sn/$s/;
303
304 $gifcurrent =~ s/\\//g;
305 $gifref =~ s/\\//g;
306
307 $gifcurrent =~ s/ //g;
308 $gifref =~ s/ //g;
309
310
311 ##system("convert $pathref/$pathcurrentW/$gifref -bordercolor green1 -border 20 -resize 80% /tmp/DTPromptplot.gif");
312 ##system("montage $pathcurrent/$gifcurrent /tmp/DTPromptplot.gif -mode concatenate $pathcurrent/webPlots/Comp_$gifcurrent");
313
314 ## <a href="webPlots/Comp_$gifcurrent" class="highslide" onclick="return hs.expand(this,config1)">
315 ## <!h4><!font color="orange">Pop-up plot (Run $run)<!/font><!/h4><!BR>
316 # <h3><font color="orange">Left: Current run $run </font><br> <font color="green">Right: Reference run $runref</font></h3>
317 # <hr>
318 # <!div class='single-image'>
319 # <!a href="$gifcurrent" class="highslide" onclick="return hs.expand(this)">
320 # <!img src="$pathcurrentW\./$gifcurrent" alt="Highslide JS" height="120" width="107" /><!/a>
321 # <!/div>
322
323 print " ******* $gifcurrent\n";
324
325 ##<div class="highslide-gallery">
326 print $filout <<endHtmHtm;
327
328 <a href="$gifcurrent" class="highslide" onclick="return hs.expand(this,config1)">
329 <img src="$gifcurrent" alt="Highslide JS" title="Click to enlarge" width="220"/></a>
330 <div class='highslide-heading'><center>
331 <h2><font color="white">$giftitle</font></h2>
332 </div>
333 <div class='highslide-caption' style="padding: 1px 10px 1px 10px"><center>
334 <div class='single-image'>
335 <h4><font color="green">Pop-up reference plot (Run $runref)</font></h4>
336 <a href="$pathrefW/$pathcurrentW/$gifref" class="highslide" onclick="return hs.expand(this)">
337 <img src="$pathrefW/$pathcurrentW/$gifref" alt="Highslide JS" width="450" /></a>
338 </div>
339 </div>
340
341 endHtmHtm
342
343 ##</div>
344
345 }
346
347 #############################################################################################
348
349 sub head{
350
351 if ($issector==1){
352 $filout = "OUTF2"
353 }
354 else{
355 $filout = "OUTF"
356 }
357
358
359 print $filout <<EndofHtml1;
360 <html><head><title>DT run $run data summary</title>
361
362 <script type="text/javascript" src="https://dt-sx5.web.cern.ch/dt-sx5/styles/highslide/highslide-with-gallery.js"></script>
363 <!script type="text/javascript" src="https://dt-sx5.web.cern.ch/dt-sx5/styles/highslide/highslide.js">
364 <!/script>
365 <link rel="stylesheet" type="text/css" href="https://dt-sx5.web.cern.ch/dt-sx5/styles/highslide/highslide.css" />
366
367 <script type="text/javascript">
368 hs.graphicsDir = 'https://dt-sx5.web.cern.ch/dt-sx5/styles/highslide/graphics/';
369 hs.align = 'center';
370 hs.transitions = ['expand', 'crossfade'];
371 hs.wrapperClassName = 'dark borderless floating-caption';
372 hs.fadeInOut = true;
373 hs.dimmingOpacity = 0.8;
374 //hs.captionEval = 'this.thumb.alt';
375
376 //hs.outlineType = 'rounded-white';
377
378 hs.marginBottom = 105; // make room for the thumbstrip and the controls
379 hs.marginTop = 50; // make room for the heading
380
381 hs.numberPosition = 'caption bottom';
382 hs.captionEval = 'this.a.title';
383 hs.captionOverlay.position = 'rightpanel';
384
385 // Heading with button - this example uses the same heading for all images
386 hs.headingId = 'my-heading';
387 hs.dragByHeading = false;
388 hs.headingOverlay = {
389 position: 'top center',
390 fade: false,
391 relativeTo: 'viewport',
392 };
393
394
395 // Add the slideshow providing the controlbar and the thumbstrip
396 if (hs.addSlideshow) hs.addSlideshow({
397 //slideshowGroup: 'group1',
398 interval: 5000,
399 repeat: false,
400 useControls: true,
401 // captionOverlay: { position: 'rightpanel', width: '600px'},
402 fixedControls: 'fit',
403 overlayOptions: {
404 className: 'text-controls',
405 position: 'bottom center',
406 relativeTo: 'viewport',
407 offsetY: -60
408 },
409 thumbstrip: {
410 position: 'bottom center',
411 mode: 'horizontal',
412 relativeTo: 'viewport'
413 }
414 });
415
416
417 var config1 = {
418
419 slideshowGroup: 'group1',
420 // thumbnailId: 'thumb1',
421 transitions: ['expand', 'crossfade'],
422 headingEval: 'this.a.title',
423 align: 'left',
424 captionOverlay: { position: 'rightpanel', width: '500px'},
425
426 };
427
428
429
430
431 // Make all images animate to the one visible thumbnail
432 var miniGalleryOptions1 = {
433 thumbnailId: 'thumb1'
434 }
435 </script>
436
437
438 </HEAD>
439
440
441 EndofHtml1
442
443 }
444
445 #############################################################################################
446
447 sub createsectorweb($run,$wn,$sector,$s)
448 {
449
450 $run = $_[0];
451 $wn = $_[1];
452 $sector = $_[2];
453 $sn= $_[3];
454
455
456 open(OUTF2,">$pathweb/Wheel$wheel/Sect$sector/Welcome.html");
457
458 $pathcurrent = "$pathweb\/Wheel$wheel/Sect$sector/";
459 $pathcurrentW = "Wheel$wheel/Sect$sector/";
460
461 if (!(-e "$pathcurrent/webPlots/")){
462 system("mkdir $pathcurrent/webPlots/");
463 }
464
465 print " ----- Producing website wheel $wheel sector $sector ..................................... \n";
466
467 $issector =1;
468 &head;
469 $issector =0;
470
471 print OUTF2 <<EndofHtml1;
472
473 <BODY BGCOLOR="lightblue">
474
475 <CENTER>
476 <IMG SRC="http://cern.ch/isr-muon/CMS-logo.gif" ALIGN=UP WIDTH=45 HEIGHT=45>
477 <font size=+5>
478 <B>DT run $run prompt offline plots for wheel $wheel sector $sector</B>
479 <IMG SRC="http://cern.ch/isr-muon/CMS-logo.gif" ALIGN=UP WIDTH=45 HEIGHT=45>
480
481 <hr>
482
483 EndofHtml1
484
485 open(FILELIST2,"/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DT/OfflineCode/Scripts/WebScripts/plotlistForWeb_Sector.txt");
486 @gifs2 = <FILELIST2>;
487 close(FILELIST2);
488
489 $count=0;
490
491 foreach $file2 (@gifs2){
492
493 if ($count==0){
494 print OUTF2 "<h2>Data Integrity plots</h2><TABLE><TR><TD>\n"
495 }
496 elsif ($count==2){
497 print OUTF2 "</TABLE><HR><h2>Chamber performance plots</h2>\n";
498 print OUTF2 "<TABLE><TR><TD>\n";
499 }
500 elsif (($count==4) || ($count==7) || ($count==10)|| ($count==13) || ($count==15) || ($count==18) || ($count==21) || ($count==24) || ($count==27) || ($count==29) || ($count==32) || ($count==35) || ($count==38) || ($count==40) || ($count==44) || ($count==51) ){
501 print OUTF2 "<TR><TD>\n";
502 }
503
504 elsif ($count==47){
505 print OUTF2 "</TABLE><HR><h2>Trigger performance plots</h2>\n";
506 print OUTF2 "<TABLE><TR><TD>\n";
507 }
508 else {
509 print OUTF2 "<TD>\n";
510
511 }
512
513
514 ($gif,$giftitle) = split(/\@\@/,$file2);
515 $issector =1;
516 &doItem;
517 $issector =0;
518 $count++;
519
520 }
521
522 print OUTF2 "</TABLE><h3>";
523
524 close(OUTF2);
525
526
527 }