23 #include "Gaudi/Property.h"
34 static const std::array<std::string, I4MomDumper::Display::Size> s_display
55 ISvcLocator* pSvcLocator ) :
67 descr =
"List of INavigable4Momentum containers one wants to dump";
71 std::vector<std::string> i4momContainersName( 0 );
76 "Tells how one wants the I4Momentum objects to be displayed"
77 " ie: eetaphim|iptcotthphim|ptetaphim|pxpypze" );
80 descr =
"Name of the output stream where we'll dump informations from the";
81 descr +=
" INavigable4MomentumCollection object(s).";
82 descr +=
" Valid stream names are: \n";
83 descr +=
" - \"MsgStream\"\n";
84 descr +=
" - \"stderr\"\n";
85 descr +=
" - \"stdout\"\n";
86 descr +=
" - \"/path/to/some/file\".";
116 <<
"] containers:" );
117 for ( std::vector<std::string>::const_iterator
128 return StatusCode::SUCCESS;
134 return StatusCode::SUCCESS;
141 typedef std::vector<std::string>::const_iterator ContNameIterator;
143 for ( ContNameIterator
151 if ( !
dump( *itr ).isSuccess() ) {
158 return StatusCode::SUCCESS;
169 if ( !
evtStore()->contains<I4Moms_t>( collName ) ) {
171 <<
"] I4MomentumContainer in StoreGate !" );
172 return StatusCode::RECOVERABLE;
175 const I4Moms_t * coll = 0;
180 << collName <<
"] !!" );
181 return StatusCode::RECOVERABLE;
184 std::ostringstream
out;
186 const std::size_t iMax = coll->size();
187 out <<
"Retrieved [" << collName <<
"] ==> size = " << iMax <<
"\n";
188 if ( coll->empty() ) {
189 return StatusCode::SUCCESS;
193 typedef std::set<const I4Momentum*, P4Sorters::Descending::Pt> Coll_t;
194 Coll_t i4moms( coll->begin(), coll->end() );
197 out <<
"[e,eta,phi,m] ="
198 << std::right << std::scientific << std::setprecision(8);
199 for ( Coll_t::const_iterator itr = i4moms.begin(),
203 out << std::setw(16) << (*itr)->e()
204 << std::setw(16) << (*itr)->eta()
205 << std::setw(16) << (*itr)->phi()
206 << std::setw(16) << (*itr)->m()
211 out <<
"[ipt,cotTh,phi,m] ="
212 << std::right << std::scientific << std::setprecision(8);
213 for ( Coll_t::const_iterator itr = i4moms.begin(),
217 out << std::setw(16) << (*itr)->iPt()
218 << std::setw(16) << (*itr)->cotTh()
219 << std::setw(16) << (*itr)->phi()
220 << std::setw(16) << (*itr)->m()
225 out <<
"[pt,eta,phi,m] ="
226 << std::right << std::scientific << std::setprecision(8);
227 for ( Coll_t::const_iterator itr = i4moms.begin(),
231 out << std::setw(16) << (*itr)->pt()
232 << std::setw(16) << (*itr)->eta()
233 << std::setw(16) << (*itr)->phi()
234 << std::setw(16) << (*itr)->m()
238 out <<
"[px,py,pz,e] ="
239 << std::right << std::scientific << std::setprecision(8);
240 for ( Coll_t::const_iterator itr = i4moms.begin(),
244 out << std::setw(16) << (*itr)->px()
245 << std::setw(16) << (*itr)->py()
246 << std::setw(16) << (*itr)->pz()
247 << std::setw(16) << (*itr)->e()
257 return StatusCode::SUCCESS;
286 <<
" => will use [pxpypxe] instead..." );
310 const std::string
stdout =
"stdout";
311 const std::string
stderr =
"stderr";
312 const std::string msgstream =
"msgstream";