1 |
pam-fi |
1.1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
2 |
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
3 |
|
|
<title>PamCut: Collections/VerboseBlindCollection/VerboseBlindCollection.cpp Source File</title> |
4 |
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"> |
5 |
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"> |
6 |
|
|
</head><body> |
7 |
|
|
<!-- Generated by Doxygen 1.5.9 --> |
8 |
|
|
<div class="navigation" id="top"> |
9 |
|
|
<div class="tabs"> |
10 |
|
|
<ul> |
11 |
|
|
<li><a href="index.html"><span>Main Page</span></a></li> |
12 |
|
|
<li><a href="annotated.html"><span>Classes</span></a></li> |
13 |
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li> |
14 |
|
|
</ul> |
15 |
|
|
</div> |
16 |
|
|
<div class="tabs"> |
17 |
|
|
<ul> |
18 |
|
|
<li><a href="files.html"><span>File List</span></a></li> |
19 |
|
|
<li><a href="globals.html"><span>File Members</span></a></li> |
20 |
|
|
</ul> |
21 |
|
|
</div> |
22 |
|
|
<h1>Collections/VerboseBlindCollection/VerboseBlindCollection.cpp</h1><a href="VerboseBlindCollection_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> |
23 |
|
|
<a name="l00002"></a>00002 <span class="comment"> * VerboseBlindCollection.cpp</span> |
24 |
|
|
<a name="l00003"></a>00003 <span class="comment"> *</span> |
25 |
|
|
<a name="l00004"></a>00004 <span class="comment"> * Created on: 16-mag-2009</span> |
26 |
|
|
<a name="l00005"></a>00005 <span class="comment"> * Author: Nicola Mori</span> |
27 |
|
|
<a name="l00006"></a>00006 <span class="comment"> */</span> |
28 |
|
|
<a name="l00007"></a>00007 |
29 |
|
|
<a name="l00010"></a>00010 <span class="preprocessor">#include "<a class="code" href="VerboseBlindCollection_8h.html">VerboseBlindCollection.h</a>"</span> |
30 |
|
|
<a name="l00011"></a>00011 <span class="preprocessor">#include <cmath></span> |
31 |
|
|
<a name="l00012"></a>00012 |
32 |
|
|
<a name="l00013"></a><a class="code" href="classVerboseBlindCollection.html#43d6ea7b5ea35c5dbb342e23584b79ee">00013</a> <span class="keywordtype">void</span> <a class="code" href="classVerboseBlindCollection.html#43d6ea7b5ea35c5dbb342e23584b79ee" title="The post analysis task.">VerboseBlindCollection::Finalize</a>() { |
33 |
|
|
<a name="l00014"></a>00014 |
34 |
|
|
<a name="l00015"></a>00015 <span class="comment">// Prepare the output format</span> |
35 |
|
|
<a name="l00016"></a>00016 streamsize oldPrec = cout.precision(); |
36 |
|
|
<a name="l00017"></a>00017 streamsize newPrec = 4; |
37 |
|
|
<a name="l00018"></a>00018 cout.precision(newPrec); |
38 |
|
|
<a name="l00019"></a>00019 cout.setf(ios::fixed, ios::floatfield); |
39 |
|
|
<a name="l00020"></a>00020 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nDigitsEvents = 0; |
40 |
|
|
<a name="l00021"></a>00021 <span class="keywordtype">double</span> nEvents = (double) <a class="code" href="classPamCut.html#3ae6ebc9dd777e11e0d8ce18948538be" title="Returns the number of checked events.">GetNEv</a>(); |
41 |
|
|
<a name="l00022"></a>00022 <span class="keywordflow">while</span> (nEvents >= 1.) { |
42 |
|
|
<a name="l00023"></a>00023 nEvents /= 10.; |
43 |
|
|
<a name="l00024"></a>00024 nDigitsEvents++; |
44 |
|
|
<a name="l00025"></a>00025 } |
45 |
|
|
<a name="l00026"></a>00026 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nameWidth = 0; |
46 |
|
|
<a name="l00027"></a>00027 |
47 |
|
|
<a name="l00028"></a>00028 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < <a class="code" href="classPamCutCollection.html#95f91f4b81f916cb6e120ee4b5bb5403" title="A vector containing pointers to PamCut objects.">_cuts</a>.size(); i++) { |
48 |
|
|
<a name="l00029"></a>00029 <span class="keywordflow">if</span> (strlen(<a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#9f14d875c176c2af470838a1b6dc069b" title="Returns the cut name.">GetName</a>()) > nameWidth) |
49 |
|
|
<a name="l00030"></a>00030 nameWidth = strlen(<a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#9f14d875c176c2af470838a1b6dc069b" title="Returns the cut name.">GetName</a>()); |
50 |
|
|
<a name="l00031"></a>00031 } |
51 |
|
|
<a name="l00032"></a>00032 |
52 |
|
|
<a name="l00033"></a>00033 cout << <span class="stringliteral">"\n- Collection: "</span> << <a class="code" href="classPamCut.html#9f14d875c176c2af470838a1b6dc069b" title="Returns the cut name.">GetName</a>() << <span class="stringliteral">"\n"</span>; |
53 |
|
|
<a name="l00034"></a>00034 cout << <span class="stringliteral">" Selected/Analized events (eff.): "</span> << <a class="code" href="classPamCut.html#b8a69206312cfcf6df6897aef973ef4a" title="Returns the number of good events.">GetNGood</a>() << <span class="stringliteral">"/"</span> << <a class="code" href="classPamCut.html#3ae6ebc9dd777e11e0d8ce18948538be" title="Returns the number of checked events.">GetNEv</a>() << <span class="stringliteral">" ("</span> << (float) <a class="code" href="classPamCut.html#b8a69206312cfcf6df6897aef973ef4a" title="Returns the number of good events.">GetNGood</a>() |
54 |
|
|
<a name="l00035"></a>00035 / (float) <a class="code" href="classPamCut.html#3ae6ebc9dd777e11e0d8ce18948538be" title="Returns the number of checked events.">GetNEv</a>() << <span class="stringliteral">")\n"</span>; |
55 |
|
|
<a name="l00036"></a>00036 cout << <span class="stringliteral">" "</span> << setw(nameWidth + 1) << <span class="stringliteral">"--Single cuts--"</span>; |
56 |
|
|
<a name="l00037"></a>00037 cout << <span class="stringliteral">" "</span> << setw(nDigitsEvents) << <span class="stringliteral">"sel."</span>; |
57 |
|
|
<a name="l00038"></a>00038 cout << <span class="stringliteral">" "</span> << setw(nDigitsEvents) << <span class="stringliteral">"tot."</span>; |
58 |
|
|
<a name="l00039"></a>00039 cout << <span class="stringliteral">" "</span> << setw(newPrec + 2) << <span class="stringliteral">"eff."</span>; |
59 |
|
|
<a name="l00040"></a>00040 cout << <span class="stringliteral">" "</span> << setw(newPrec + 2) << <span class="stringliteral">"prog. eff.\n"</span>; |
60 |
|
|
<a name="l00041"></a>00041 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < <a class="code" href="classPamCutCollection.html#231f91b82b18cf326a2912b0b515baca" title="The number of cuts contained in the collection.">GetSize</a>(); i++) { |
61 |
|
|
<a name="l00042"></a>00042 cout << <span class="stringliteral">" "</span> << setw(nameWidth) << <a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#9f14d875c176c2af470838a1b6dc069b" title="Returns the cut name.">GetName</a>() << <span class="stringliteral">":"</span>; |
62 |
|
|
<a name="l00043"></a>00043 cout << <span class="stringliteral">" "</span> << setw(nDigitsEvents) << <a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#b8a69206312cfcf6df6897aef973ef4a" title="Returns the number of good events.">GetNGood</a>(); |
63 |
|
|
<a name="l00044"></a>00044 cout << <span class="stringliteral">" "</span> << setw(nDigitsEvents) << <a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#3ae6ebc9dd777e11e0d8ce18948538be" title="Returns the number of checked events.">GetNEv</a>(); |
64 |
|
|
<a name="l00045"></a>00045 cout << <span class="stringliteral">" "</span> << (float) <a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#b8a69206312cfcf6df6897aef973ef4a" title="Returns the number of good events.">GetNGood</a>() / (float) <a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#3ae6ebc9dd777e11e0d8ce18948538be" title="Returns the number of checked events.">GetNEv</a>(); |
65 |
|
|
<a name="l00046"></a>00046 cout << <span class="stringliteral">" "</span> << (float) <a class="code" href="classPamCutCollection.html#55e41082749260f5cee2fd53d9fd331b" title="Returns a pointer to the iCut-th cut.">GetCut</a>(i)-><a class="code" href="classPamCut.html#b8a69206312cfcf6df6897aef973ef4a" title="Returns the number of good events.">GetNGood</a>() / (float) <a class="code" href="classPamCut.html#3ae6ebc9dd777e11e0d8ce18948538be" title="Returns the number of checked events.">GetNEv</a>(); |
66 |
|
|
<a name="l00047"></a>00047 cout << <span class="stringliteral">"\n"</span>; |
67 |
|
|
<a name="l00048"></a>00048 |
68 |
|
|
<a name="l00049"></a>00049 } |
69 |
|
|
<a name="l00050"></a>00050 cout << endl; |
70 |
|
|
<a name="l00051"></a>00051 |
71 |
|
|
<a name="l00052"></a>00052 <span class="comment">// Reset the output format</span> |
72 |
|
|
<a name="l00053"></a>00053 cout.precision(oldPrec); |
73 |
|
|
<a name="l00054"></a>00054 cout << resetiosflags(ios::floatfield); |
74 |
|
|
<a name="l00055"></a>00055 |
75 |
|
|
<a name="l00056"></a>00056 <a class="code" href="classVerboseBlindCollection.html#43d6ea7b5ea35c5dbb342e23584b79ee" title="The post analysis task.">SmartBlindCollection::Finalize</a>(); |
76 |
|
|
<a name="l00057"></a>00057 |
77 |
|
|
<a name="l00058"></a>00058 } |
78 |
|
|
</pre></div></div> |
79 |
|
|
<hr size="1"><address style="text-align: right;"><small>Generated on Wed May 27 15:21:27 2009 for PamCut by |
80 |
|
|
<a href="http://www.doxygen.org/index.html"> |
81 |
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> |
82 |
|
|
</body> |
83 |
|
|
</html> |