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

# User Rev Content
1 battilan 1.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 marycruz 1.3 ################################################################################################
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 battilan 1.1
46     ## print $pathweb;
47    
48 marycruz 1.3 ### 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 battilan 1.1 open(OUTF,">$pathweb/Welcome.html");
76    
77 marycruz 1.3 &head;
78    
79 battilan 1.1 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 marycruz 1.3 <B>DT run $run prompt offline plots</B></font>
86 battilan 1.1 <IMG SRC="http://cern.ch/isr-muon/CMS-logo.gif" ALIGN=UP WIDTH=45 HEIGHT=45>
87 marycruz 1.3 <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 battilan 1.1
131    
132 marycruz 1.3 print OUTF <<EndofHtml1;
133 battilan 1.1
134 marycruz 1.3 </div>
135 battilan 1.1
136 marycruz 1.3 </TABLE>
137     <h3>
138 battilan 1.1 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 marycruz 1.3 ######## 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 battilan 1.1 @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 marycruz 1.3
169 battilan 1.1 $wheel = $wheel_names[$i];
170     $wn = $wheel_nb[$i];
171    
172 marycruz 1.3 print " Producing website wheel $wheel ..................................... \n";
173    
174 battilan 1.1
175     open(OUTF,">$pathweb/Wheel$wheel/Welcome.html");
176    
177 marycruz 1.3 $pathcurrent = "$pathweb\/Wheel$wheel";
178     $pathcurrentW = "Wheel$wheel/";
179    
180     if (!(-e "$pathcurrent/webPlots/")){
181     system("mkdir $pathcurrent/webPlots/");
182     }
183    
184     &head;
185 battilan 1.1
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 marycruz 1.3 <CENTER>
198 battilan 1.1
199 marycruz 1.3 EndofHtml1
200 battilan 1.1
201 marycruz 1.3 ## Defined previously: $gif + $gifref + $runref + $giftitle
202 battilan 1.1
203 marycruz 1.3 $count=0;
204 battilan 1.1
205 marycruz 1.3 foreach $file (@gifs){
206 battilan 1.1
207 marycruz 1.3 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 battilan 1.1
232 marycruz 1.3 }
233 battilan 1.1
234    
235    
236 marycruz 1.3 print OUTF <<EndofHtml1;
237 battilan 1.1
238 marycruz 1.3 </TABLE>
239 battilan 1.1
240 marycruz 1.3 <h2> Sectors data<BR>
241 battilan 1.1
242     EndofHtml1
243    
244    
245    
246 marycruz 1.3 for ($s=1;$s<=14;$s++){
247 battilan 1.1
248 marycruz 1.3 $sector = $sector_names[$s];
249 battilan 1.1
250     print OUTF <<EndofHtml1;
251    
252 marycruz 1.3 <button onClick="window.location='Sect$sector/'">Sect $sector</button>
253 battilan 1.1
254 marycruz 1.3 EndofHtml1
255 battilan 1.1
256 marycruz 1.3 &createsectorweb($run,$wn,$sector,$s);
257 battilan 1.1
258 marycruz 1.3 }
259 battilan 1.1
260 marycruz 1.3 print OUTF <<EndofHtml1;
261     <BR>
262     <button onClick="window.location='ExtraPlots/'">Extra Plots</button>
263 battilan 1.1
264 marycruz 1.3 <h3>
265 battilan 1.1
266 marycruz 1.3 EndofHtml1
267 battilan 1.1
268 marycruz 1.3 close(OUTF);
269 battilan 1.1
270 marycruz 1.3 } ## Loop on sectors
271 battilan 1.1
272 marycruz 1.3 } ## Loop on wheels
273 battilan 1.1
274 marycruz 1.3 ######## End of wheel pages
275 battilan 1.1
276    
277    
278 marycruz 1.3 ################################################################################################
279     ################################################################################################
280 battilan 1.1
281 marycruz 1.3 sub doItem{
282 battilan 1.1
283 marycruz 1.3 if ($issector==1){
284     $filout = "OUTF2"
285     }
286     else{
287     $filout = "OUTF"
288     }
289     ;
290 battilan 1.1
291    
292 marycruz 1.3 $gifcurrent = $gif;
293     $gifref = $gif;
294 battilan 1.1
295 marycruz 1.3 $gifcurrent =~ s/\$run/$run/;
296     $gifref =~ s/\$run/$runref/;
297 battilan 1.1
298 marycruz 1.3 $gifcurrent =~ s/\$wn/$wn/;
299     $gifref =~ s/\$wn/$wn/;
300 battilan 1.1
301 marycruz 1.3 $gifcurrent =~ s/\$sn/$s/;
302     $gifref =~ s/\$sn/$s/;
303 battilan 1.1
304 marycruz 1.3 $gifcurrent =~ s/\\//g;
305     $gifref =~ s/\\//g;
306 battilan 1.1
307 marycruz 1.3 $gifcurrent =~ s/ //g;
308     $gifref =~ s/ //g;
309 battilan 1.1
310    
311 marycruz 1.3 ##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 battilan 1.1
314 marycruz 1.3 ## <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 battilan 1.1
323 marycruz 1.3 print " ******* $gifcurrent\n";
324 battilan 1.1
325 marycruz 1.3 ##<div class="highslide-gallery">
326     print $filout <<endHtmHtm;
327 battilan 1.1
328 marycruz 1.3 <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 battilan 1.1
341 marycruz 1.3 endHtmHtm
342 battilan 1.1
343 marycruz 1.3 ##</div>
344 battilan 1.1
345 marycruz 1.3 }
346 battilan 1.1
347 marycruz 1.3 #############################################################################################
348 battilan 1.1
349 marycruz 1.3 sub head{
350 battilan 1.1
351 marycruz 1.3 if ($issector==1){
352     $filout = "OUTF2"
353     }
354     else{
355     $filout = "OUTF"
356     }
357 battilan 1.1
358    
359 marycruz 1.3 print $filout <<EndofHtml1;
360     <html><head><title>DT run $run data summary</title>
361 battilan 1.1
362 marycruz 1.3 <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 battilan 1.1
437    
438 marycruz 1.3 </HEAD>
439 battilan 1.1
440    
441     EndofHtml1
442    
443     }
444    
445 marycruz 1.3 #############################################################################################
446 battilan 1.1
447     sub createsectorweb($run,$wn,$sector,$s)
448     {
449    
450     $run = $_[0];
451     $wn = $_[1];
452     $sector = $_[2];
453     $sn= $_[3];
454    
455 marycruz 1.3
456 battilan 1.1 open(OUTF2,">$pathweb/Wheel$wheel/Sect$sector/Welcome.html");
457 marycruz 1.3
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 battilan 1.1 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 marycruz 1.3 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 battilan 1.1
522 marycruz 1.3 print OUTF2 "</TABLE><h3>";
523 battilan 1.1
524 marycruz 1.3 close(OUTF2);
525 battilan 1.1
526    
527     }