#include "Plex/PlexSEIdAltL.h"#include "Plex/PlexCalib.h"#include "MessageService/MsgService.h"#include "MessageService/MsgStream.h"#include "MessageService/MsgFormat.h"#include "TMath.h"#include <string>#include <algorithm>#include <cassert>Go to the source code of this file.
Functions | |
| CVSID ("$Id: PlexSEIdAltL.cxx,v 1.36 2008/11/09 04:11:34 rhatcher Exp $") | |
| ostream & | operator<< (ostream &os, const PlexSEIdAltL &alt) |
Variables | |
| PlexSEIdAltLItem | dummyPlexSEIdAltLItem |
| const UInt_t | defaultFmtFlag = 0xFFFFFFFF & ~PlexSEIdAltL::fmt_PixelSpot |
| UInt_t | lastFmtFlag = 0 |
| string | fmtHeaderTitle = "" |
| string | fmtHeaderULine = "" |
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 42 of file PlexSEIdAltL.cxx. References PlexPixelSpotId::AsString(), PlexStripEndId::AsString(), fmtHeaderTitle, fmtHeaderULine, PlexSEIdAltL::GetFmtFlag(), PlexSEIdAltLItem::GetPE(), PlexSEIdAltLItem::GetPixelSpotId(), PlexSEIdAltLItem::GetSEId(), PlexSEIdAltLItem::GetSigCorr(), PlexSEIdAltLItem::GetSigLin(), PlexSEIdAltLItem::GetTime(), PlexSEIdAltLItem::GetWeight(), and lastFmtFlag. 00043 {
00044 // Print out the list
00045 if (alt.size() <= 0) {
00046 os << "Empty-PlexSEIdAltL " << endl;
00047 return os;
00048 }
00049
00050 UInt_t fmt = PlexSEIdAltL::GetFmtFlag();
00051 // disallow no formatting bits
00052 if (!fmt) fmt = defaultFmtFlag;
00053 bool doFmtIndex = fmt & PlexSEIdAltL::fmt_Index;
00054 bool doFmtCursor = fmt & PlexSEIdAltL::fmt_Cursor;
00055 bool doFmtBest = fmt & PlexSEIdAltL::fmt_Best;
00056 bool doFmtStripEnd = fmt & PlexSEIdAltL::fmt_StripEnd;
00057 bool doFmtPixelSpot = fmt & PlexSEIdAltL::fmt_PixelSpot;
00058 bool doFmtWeight = fmt & PlexSEIdAltL::fmt_Weight;
00059 bool doFmtPE = fmt & PlexSEIdAltL::fmt_PE;
00060 bool doFmtSigLin = fmt & PlexSEIdAltL::fmt_SigLin;
00061 bool doFmtSigCorr = fmt & PlexSEIdAltL::fmt_SigCorr;
00062 bool doFmtTime = fmt & PlexSEIdAltL::fmt_Time;
00063
00064 static const MsgFormat i1("%1d");
00065 static const MsgFormat f3p1("%3.1f");
00066 static const MsgFormat f5p1("%5.1f");
00067 static const MsgFormat f7p2("%7.2f");
00068
00069 if (lastFmtFlag != fmt) {
00070 // construct the header line and the line of "---"'s and "+"'s
00071 lastFmtFlag = fmt;
00072 fmtHeaderTitle = "";
00073 fmtHeaderULine = "";
00074 if (doFmtBest) {
00075 fmtHeaderTitle += " ";
00076 fmtHeaderULine += "-";
00077 }
00078 if (doFmtCursor) {
00079 fmtHeaderTitle += " ";
00080 fmtHeaderULine += "-";
00081 }
00082 if (doFmtIndex) {
00083 fmtHeaderTitle += " i |";
00084 fmtHeaderULine += "---+";
00085 }
00086 if (doFmtStripEnd) {
00087 // F0001Uc003-
00088 fmtHeaderTitle += " StripEndId |";
00089 fmtHeaderULine += "-------------+";
00090 }
00091 if (doFmtPixelSpot) {
00092 // MUXB-UV-?L00:00-SPOT-0-00-00
00093 fmtHeaderTitle += " PixelSpot |";
00094 fmtHeaderULine += "------------------------------+";
00095 }
00096 if (doFmtWeight) {
00097 fmtHeaderTitle += " wgt |";
00098 fmtHeaderULine += "-----+";
00099 }
00100 if (doFmtPE) {
00101 fmtHeaderTitle += " PE |";
00102 fmtHeaderULine += "-------+";
00103 }
00104 if (doFmtSigLin) {
00105 fmtHeaderTitle += " Linear |";
00106 fmtHeaderULine += "---------+";
00107 }
00108 if (doFmtSigCorr) {
00109 fmtHeaderTitle += " S2SCorr |";
00110 fmtHeaderULine += "---------+";
00111 }
00112 if (doFmtTime) {
00113 fmtHeaderTitle += " Time |";
00114 fmtHeaderULine += "---------+";
00115 }
00116 }
00117
00118 os << fmtHeaderTitle << endl;
00119 os << fmtHeaderULine << endl;
00120
00121 PlexSEIdAltLItem& best = dummyPlexSEIdAltLItem;
00122
00123 for (unsigned int i=0; i<alt.size(); ++i) {
00124 const PlexSEIdAltLItem& item = alt[i];
00125 if (doFmtBest) { best = alt.GetBestItem();
00126 os << ((item == best) ? '!' : ' ');
00127 }
00128 if (doFmtCursor) {
00129 os << ((i == alt.fCurrent) ? '@' : ' ');
00130 }
00131 if (doFmtIndex) os << " " << i1(i) << " |";
00132 if (doFmtStripEnd) os << " " << item.GetSEId().AsString("C") << " |";
00133 if (doFmtPixelSpot) os << " " << item.GetPixelSpotId().AsString("c") << " |";
00134 if (doFmtWeight) os << " " << f3p1(item.GetWeight()) << " |";
00135 if (doFmtPE) os << " " << f5p1(item.GetPE()) << " |";
00136 if (doFmtSigLin) os << " " << f7p2(item.GetSigLin()) << " |";
00137 if (doFmtSigCorr) os << " " << f7p2(item.GetSigCorr()) << " |";
00138 if (doFmtTime) os << " " << f7p2(item.GetTime()) << " |";
00139 os << endl;
00140 }
00141
00142 #ifdef OLDFORMATTING
00143 char marker;
00144 PlexStripEndId seid;
00145 MsgFormat i2("%2d");
00146 MsgFormat i3("%3d");
00147 // MsgFormat f10("%10.5f");
00148
00149 // format the header line
00150 os << " i | StripEndId (size=" << i2(alt.size())
00151 << ",cur=" << i2(alt.fCurrent) << ") "
00152 << "| weight "
00153 << "| muon unit "
00154 << "| t offset "
00155 << endl;
00156 os << "-------+-----------------------------"
00157 << "+-----------"
00158 << "+-----------"
00159 << "+-----------"
00160 << endl;
00161
00162 for (unsigned int i=0; i<alt.size(); ++i) {
00163 (i==alt.fCurrent) ? marker = '*' : marker = ' ';
00164 PlexSEIdAltLItem item = alt[i];
00165 seid = item.GetSEId();
00166 os << " " << marker << " " << i3(i)
00167 << " " << item
00168 << endl;
00169 }
00170 #endif
00171
00172 return os;
00173 }
|
|
|
Definition at line 35 of file PlexSEIdAltL.cxx. |
|
|
Definition at line 28 of file PlexSEIdAltL.cxx. |
|
|
Definition at line 38 of file PlexSEIdAltL.cxx. Referenced by operator<<(). |
|
|
Definition at line 39 of file PlexSEIdAltL.cxx. Referenced by operator<<(). |
|
|
Definition at line 37 of file PlexSEIdAltL.cxx. Referenced by operator<<(). |
1.3.9.1