Commit in lcio/src/cpp on MAIN
include/UTIL/Operators.h+210-2001.6 -> 1.7
src/UTIL/Operators.cc+2262-20361.8 -> 1.9
+2472-2236
2 modified files
restore format on ostream for all operator<<( LCIO-Class ) 

lcio/src/cpp/include/UTIL
Operators.h 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- Operators.h	30 Jun 2010 16:53:43 -0000	1.6
+++ Operators.h	24 Sep 2010 10:34:28 -0000	1.7
@@ -65,229 +65,239 @@
 //
 //
 // @author J Engels, H. Hoelbe
-// @version $Id: Operators.h,v 1.6 2010/06/30 16:53:43 gaede Exp $
+// @version $Id: Operators.h,v 1.7 2010/09/24 10:34:28 gaede Exp $
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 namespace UTIL{
 
-  //template to enable the use of the operator << for a "one-line" output of an object.
-  //since there are two ostream& << operators for sending an object to the output stream this
-  //template works like a "wrapper class" so that the correct operator can be triggered for the
-  //respective detailed/short output
-  template <class T> struct lcio_short{
-  const T* obj;
-  lcio_short(const T* t) : obj(t) {}
-  };
-
-  //template to enable a "one-line" output of a vertex object
-  template <class T> lcio_short<T> lcshort( const T* t){ return lcio_short<T>(t); }
- 
+ //template to enable the use of the operator << for a "one-line" output of an object.
+ //since there are two ostream& << operators for sending an object to the output stream this
+ //template works like a "wrapper class" so that the correct operator can be triggered for the
+ //respective detailed/short output
+ template <class T> struct lcio_short{
+ const T* obj;
+ lcio_short(const T* t) : obj(t) {}
+ };
+
+ //template to enable a "one-line" output of a vertex object
+ template <class T> lcio_short<T> lcshort( const T* t){ return lcio_short<T>(t); }
+
 /*
-  // EXP: INDEX MAP - UNDER DEVELOPMENT
-  
-  template <class T, class T2> struct lcio_short{
-  const T* obj;
-  const T2* cobj;
-  lcio_short(const T* t, const T2* t2) : obj(t),cobj(t2) {}
-  };
+ // EXP: INDEX MAP - UNDER DEVELOPMENT
+
+ template <class T, class T2> struct lcio_short{
+ const T* obj;
+ const T2* cobj;
+ lcio_short(const T* t, const T2* t2) : obj(t),cobj(t2) {}
+ };
 
-  //template to enable a "one-line" output of a vertex object
-  template <class T, class T2> lcio_short<T, T2> lcshort( const T* t, const T2* t2){ return lcio_short<T, T2>(t, t2); }
+ //template to enable a "one-line" output of a vertex object
+ template <class T, class T2> lcio_short<T, T2> lcshort( const T* t, const T2* t2){ return lcio_short<T, T2>(t, t2); }
 */
 
 
-  /** operator for detailed output of a vertex object (e.g. cout << vertexObj << endl; ) */
-  /** for printing the header of a vertex object (e.g. cout << header(vertexObj) << endl; ) */
-  /** for printing the tail of a vertex object (e.g. cout << tail(vertexObj) << endl; ) */
-
-  const std::string& header(const EVENT::Vertex &);
-  const std::string& tail(const EVENT::Vertex &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex>& sV);
-  std::ostream& operator<<( std::ostream& out, const EVENT::Vertex &v);
+ /** operator for detailed output of a vertex object (e.g. cout << vertexObj << endl; ) */
+ /** for printing the header of a vertex object (e.g. cout << header(vertexObj) << endl; ) */
+ /** for printing the tail of a vertex object (e.g. cout << tail(vertexObj) << endl; ) */
+
+ struct ostream_flags{
+   std::_Ios_Fmtflags oldf;
+   long precision;
+   char fill;
+ };
+
+ const ostream_flags saveflags(std::ostream& stream);
+ void setflags(std::ostream& stream, ostream_flags);
+
+ const std::string& header(const EVENT::Vertex &);
+ const std::string& tail(const EVENT::Vertex &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex>& sV);
+ std::ostream& operator<<( std::ostream& out, const EVENT::Vertex &v);
 
 
 //hauke 2010 (start)
-  const std::string& header( const EVENT::MCParticle &);
-  const std::string& tail( const EVENT::MCParticle &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::MCParticle>& sV);
-  std::ostream& operator<<( std::ostream& out, const EVENT::MCParticle &);
-
-
-  const std::string& header( const EVENT::TrackerHit &);
-  const std::string& tail( const EVENT::TrackerHit &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerHit>& sV);
-  std::ostream& operator<<( std::ostream& out, const EVENT::TrackerHit &);
-
-  const std::string& header( const EVENT::SimTrackerHit &);
-  const std::string& tail( const EVENT::SimTrackerHit &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimTrackerHit>& sV);
-  std::ostream& operator<<( std::ostream& out, const EVENT::SimTrackerHit &);
-
-  const std::string& header( const EVENT::CalorimeterHit &);
-  const std::string& tail( const EVENT::CalorimeterHit &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::CalorimeterHit>& sV);
-  std::ostream& operator<<( std::ostream& out, const EVENT::CalorimeterHit &);
-
-  const std::string& header( const EVENT::SimCalorimeterHit &);
-  const std::string& tail( const EVENT::SimCalorimeterHit &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimCalorimeterHit>& sV);
-  std::ostream& operator<<( std::ostream& out, const EVENT::SimCalorimeterHit &);
-
-  const std::string& header( const EVENT::ReconstructedParticle &);
-  const std::string& tail( const EVENT::ReconstructedParticle &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ReconstructedParticle> & );
-  std::ostream& operator<<( std::ostream& out, const EVENT::ReconstructedParticle &);
-
-  const std::string& header( const EVENT::Track &);
-  const std::string& tail( const EVENT::Track &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Track> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::Track &);
-
-  const std::string& header( const EVENT::Cluster &);
-  const std::string& tail( const EVENT::Cluster &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Cluster> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::Cluster &);
-
-  const std::string& header( const EVENT::LCRelation &);
-  const std::string& tail( const EVENT::LCRelation &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRelation> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCRelation &);
-
-  const std::string& header( const EVENT::LCFloatVec &);
-  const std::string& tail( const EVENT::LCFloatVec &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFloatVec> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCFloatVec &);
-
-  template <class T> 
-        const std::string & header(){return header((T)(0)); }
-  template <class T> 
-        const std::string & tail(){return tail((T)(0)); }
-
-
-  template <class T>
-  class LCIO_LONG{
-        public:
-            //lcio_long(const T& o, EVENT::LCCollection* c);
-            LCIO_LONG(const T& o, const EVENT::LCCollection* c){ obj=&o; col=c;};
-            const T *object(void) const {return(obj);};
-            const EVENT::LCCollection *collection(void) const {return(col);};
-        private: 
-            const T *obj;
-            const EVENT::LCCollection *col;
-  };
-
-  //test:
-  template <class T>
-  LCIO_LONG<T> lcio_long(const T& o, const EVENT::LCCollection* c){return(LCIO_LONG<T>(o,c));}
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::CalorimeterHit> l);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Cluster> l);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Track> l);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::ReconstructedParticle> ll);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimCalorimeterHit> ll);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerHit> ll);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimTrackerHit> ll);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::MCParticle> ll);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Vertex> ll);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCRelation> ll);
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFloatVec> ll);
-
-
-  const std::string& header( const EVENT::LCCollection &);
-  const std::string& tail( const EVENT::LCCollection &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCCollection> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCCollection &);
-
-  const std::string& header( const EVENT::LCEvent &);
-  const std::string& tail( const EVENT::LCEvent &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCEvent> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCEvent &);
-
-  const std::string& header( const EVENT::LCFlag &);
-  const std::string& tail( const EVENT::LCFlag &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFlag> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCFlag &);
-
-  const std::string& header( const EVENT::LCGenericObject &);
-  const std::string& tail( const EVENT::LCGenericObject &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCGenericObject> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCGenericObject &);
-
-  const std::string& header( const EVENT::LCIntVec &);
-  const std::string& tail( const EVENT::LCIntVec &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIntVec> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCIntVec &);
-
-  const std::string& header( const EVENT::LCObject &);
-  const std::string& tail( const EVENT::LCObject &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCObject> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCObject &);
-
-  const std::string& header( const EVENT::LCParameters &);
-  const std::string& tail( const EVENT::LCParameters &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCParameters> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCParameters &);
-
-  const std::string& header( const EVENT::LCRunHeader &);
-  const std::string& tail( const EVENT::LCRunHeader &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRunHeader> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCRunHeader &);
+ const std::string& header( const EVENT::MCParticle &);
+ const std::string& tail( const EVENT::MCParticle &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::MCParticle>& sV);
+ std::ostream& operator<<( std::ostream& out, const EVENT::MCParticle &);
+
+
+ const std::string& header( const EVENT::TrackerHit &);
+ const std::string& tail( const EVENT::TrackerHit &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerHit>& sV);
+ std::ostream& operator<<( std::ostream& out, const EVENT::TrackerHit &);
+
+ const std::string& header( const EVENT::SimTrackerHit &);
+ const std::string& tail( const EVENT::SimTrackerHit &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimTrackerHit>& sV);
+ std::ostream& operator<<( std::ostream& out, const EVENT::SimTrackerHit &);
+
+ const std::string& header( const EVENT::CalorimeterHit &);
+ const std::string& tail( const EVENT::CalorimeterHit &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::CalorimeterHit>& sV);
+ std::ostream& operator<<( std::ostream& out, const EVENT::CalorimeterHit &);
+
+ const std::string& header( const EVENT::SimCalorimeterHit &);
+ const std::string& tail( const EVENT::SimCalorimeterHit &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimCalorimeterHit>& sV);
+ std::ostream& operator<<( std::ostream& out, const EVENT::SimCalorimeterHit &);
+
+ const std::string& header( const EVENT::ReconstructedParticle &);
+ const std::string& tail( const EVENT::ReconstructedParticle &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ReconstructedParticle> & );
+ std::ostream& operator<<( std::ostream& out, const EVENT::ReconstructedParticle &);
+
+ const std::string& header( const EVENT::Track &);
+ const std::string& tail( const EVENT::Track &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Track> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::Track &);
+
+ const std::string& header( const EVENT::Cluster &);
+ const std::string& tail( const EVENT::Cluster &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Cluster> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::Cluster &);
+
+ const std::string& header( const EVENT::LCRelation &);
+ const std::string& tail( const EVENT::LCRelation &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRelation> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCRelation &);
+
+ const std::string& header( const EVENT::LCFloatVec &);
+ const std::string& tail( const EVENT::LCFloatVec &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFloatVec> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCFloatVec &);
+
+ template <class T> 
+       const std::string & header(){return header((T)(0)); }
+ template <class T> 
+       const std::string & tail(){return tail((T)(0)); }
+
+
+ template <class T>
+ class LCIO_LONG{
+       public:
+           //lcio_long(const T& o, EVENT::LCCollection* c);
+           LCIO_LONG(const T& o, const EVENT::LCCollection* c){ obj=&o; col=c;};
+           const T *object(void) const {return(obj);};
+           const EVENT::LCCollection *collection(void) const {return(col);};
+       private: 
+           const T *obj;
+           const EVENT::LCCollection *col;
+ };
+
+ //test:
+ template <class T>
+ LCIO_LONG<T> lcio_long(const T& o, const EVENT::LCCollection* c){return(LCIO_LONG<T>(o,c));}
+
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::CalorimeterHit> l);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Cluster> l);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Track> l);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::ReconstructedParticle> ll);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimCalorimeterHit> ll);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerHit> ll);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimTrackerHit> ll);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::MCParticle> ll);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Vertex> ll);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCRelation> ll);
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFloatVec> ll);
+
+
+ const std::string& header( const EVENT::LCCollection &);
+ const std::string& tail( const EVENT::LCCollection &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCCollection> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCCollection &);
+
+ const std::string& header( const EVENT::LCEvent &);
+ const std::string& tail( const EVENT::LCEvent &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCEvent> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCEvent &);
+
+ const std::string& header( const EVENT::LCFlag &);
+ const std::string& tail( const EVENT::LCFlag &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFlag> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCFlag &);
+
+ const std::string& header( const EVENT::LCGenericObject &);
+ const std::string& tail( const EVENT::LCGenericObject &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCGenericObject> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCGenericObject &);
+
+ const std::string& header( const EVENT::LCIntVec &);
+ const std::string& tail( const EVENT::LCIntVec &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIntVec> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCIntVec &);
+
+ const std::string& header( const EVENT::LCObject &);
+ const std::string& tail( const EVENT::LCObject &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCObject> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCObject &);
+
+ const std::string& header( const EVENT::LCParameters &);
+ const std::string& tail( const EVENT::LCParameters &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCParameters> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCParameters &);
+
+ const std::string& header( const EVENT::LCRunHeader &);
+ const std::string& tail( const EVENT::LCRunHeader &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRunHeader> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCRunHeader &);
 
 /*
-  const std::string& header( const EVENT::LCStrVec &);
-  const std::string& tail( const EVENT::LCStrVec &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCStrVec> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCStrVec &);
+ const std::string& header( const EVENT::LCStrVec &);
+ const std::string& tail( const EVENT::LCStrVec &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCStrVec> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCStrVec &);
 */
 
-  const std::string& header( const EVENT::ParticleID &);
-  const std::string& tail( const EVENT::ParticleID &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ParticleID> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::ParticleID &);
-
-  const std::string& header( const EVENT::RawCalorimeterHit &);
-  const std::string& tail( const EVENT::RawCalorimeterHit &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::RawCalorimeterHit> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::RawCalorimeterHit &);
-
-//  const std::string& header( const EVENT::TPCHit &);
-//  const std::string& tail( const EVENT::TPCHit &);
-//  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TPCHit> &);
-//  std::ostream& operator<<( std::ostream& out, const EVENT::TPCHit &);
-
-  const std::string& header( const EVENT::TrackerData &);
-  const std::string& tail( const EVENT::TrackerData &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerData> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::TrackerData &);
-
-  const std::string& header( const EVENT::TrackerPulse &);
-  const std::string& tail( const EVENT::TrackerPulse &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerPulse> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::TrackerPulse &);
-
-  const std::string& header( const EVENT::TrackerRawData &);
-  const std::string& tail( const EVENT::TrackerRawData &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerRawData> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::TrackerRawData &);
-
-  const std::string& header( const EVENT::LCIO &);
-  const std::string& tail( const EVENT::LCIO &);
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIO> &);
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCIO &);
+ const std::string& header( const EVENT::ParticleID &);
+ const std::string& tail( const EVENT::ParticleID &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ParticleID> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::ParticleID &);
+
+ const std::string& header( const EVENT::RawCalorimeterHit &);
+ const std::string& tail( const EVENT::RawCalorimeterHit &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::RawCalorimeterHit> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::RawCalorimeterHit &);
+
+//  const std::string& header( const EVENT::TPCHit &);
+//  const std::string& tail( const EVENT::TPCHit &);
+//  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TPCHit> &);
+//  std::ostream& operator<<( std::ostream& out, const EVENT::TPCHit &);
+
+ const std::string& header( const EVENT::TrackerData &);
+ const std::string& tail( const EVENT::TrackerData &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerData> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::TrackerData &);
+
+ const std::string& header( const EVENT::TrackerPulse &);
+ const std::string& tail( const EVENT::TrackerPulse &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerPulse> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::TrackerPulse &);
+
+ const std::string& header( const EVENT::TrackerRawData &);
+ const std::string& tail( const EVENT::TrackerRawData &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerRawData> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::TrackerRawData &);
+
+ const std::string& header( const EVENT::LCIO &);
+ const std::string& tail( const EVENT::LCIO &);
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIO> &);
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCIO &);
 
 
 
 /*
-  template <class T>
-  std::ostream& operator<<( std::ostream& out, const T obj) {
-    out << lcio_long<T>( obj , NULL ) ;
-    return out;
-  }
+ template <class T>
+ std::ostream& operator<<( std::ostream& out, const T obj) {
+   out << lcio_long<T>( obj , NULL ) ;
+   return out;
+ }
 */
 
- 
+
 
 }//namespace
 
 #endif /* ifndef LCIO_OPERATORS_H */
+

lcio/src/cpp/src/UTIL
Operators.cc 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- Operators.cc	24 Aug 2010 12:16:53 -0000	1.8
+++ Operators.cc	24 Sep 2010 10:34:28 -0000	1.9
@@ -1,3 +1,6 @@
+#include <iostream>
+#include <ios> 
+
 #include "UTIL/Operators.h"
 
 #include "EVENT/ReconstructedParticle.h"
@@ -60,32 +63,32 @@
 namespace UTIL{
 
 /* 
-  // EXP: INDEX MAP - UNDER DEVELOPMENT
-  
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex, EVENT::LCCollection>& sV){
-    const EVENT::Vertex* v = sV.obj;
-    const EVENT::LCCollection* col = sV.cobj;
-    
-    //TODO: PROBLEM HERE!!!
-    UTIL::IndexMap im(col,"AlgorithmNames","AlgorithmTypes");
-    
-    out << setfill('0');
-    out << " [" << setw(8) << hex << v->id() << "] | " << v->isPrimary()<< " | ";
-    out << setfill(' ') << setw(17) << left << im.decode( v->getAlgorithmType() ) << " | ";
-    
-    out << setfill('0') << right << scientific << setprecision(3) << v->getChi2() << " | " << v->getProbability() << " | " <<
+ // EXP: INDEX MAP - UNDER DEVELOPMENT
+
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex, EVENT::LCCollection>& sV){
+   const EVENT::Vertex* v = sV.obj;
+   const EVENT::LCCollection* col = sV.cobj;
+
+   //TODO: PROBLEM HERE!!!
+   UTIL::IndexMap im(col,"AlgorithmNames","AlgorithmTypes");
+
+   out << setfill('0');
+   out << " [" << setw(8) << hex << v->id() << "] | " << v->isPrimary()<< " | ";
+   out << setfill(' ') << setw(17) << left << im.decode( v->getAlgorithmType() ) << " | ";
+
+   out << setfill('0') << right << scientific << setprecision(3) << v->getChi2() << " | " << v->getProbability() << " | " <<
 	v->getPosition()[0] << "," <<
-        v->getPosition()[1] << "," <<
-        v->getPosition()[2] << " | [" ;
+       v->getPosition()[1] << "," <<
+       v->getPosition()[2] << " | [" ;
+
+//    for(int i=0;i<VTXCOVMATRIX;i++)
+//      out << v->getCovMatrix()[i] << (i<(VTXCOVMATRIX-1)?",":" | [");
+   out << setw(3) << v->getParameters().size() << "] | [";
+   out << setw(8) << hex << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << "]\n";
 
-//    for(int i=0;i<VTXCOVMATRIX;i++)
-//      out << v->getCovMatrix()[i] << (i<(VTXCOVMATRIX-1)?",":" | [");
-    out << setw(3) << v->getParameters().size() << "] | [";
-    out << setw(8) << hex << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << "]\n";
-    
-    return out;
+   return out;
 
-  }
+ }
 */
 
 
@@ -93,2147 +96,2370 @@
 //--
 //-- begin new ----
 //-------------------------
-  const std::string& header(const EVENT::LCCollection &){ //hauke
-    static std::string _vtxh("| Number of elements | Type name |    Flag     | Is transient | Is default | Is subset |\n");
-    return _vtxh;
-  }
-
-  const std::string& tail(const EVENT::LCCollection &){ //hauke
-    static std::string _vtxt("|--------------------|-----------|-------------|--------------|------------|-----------|\n");
-    return _vtxt;
-  }
-
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCCollection>& sV){ //hauke
-    const EVENT::LCCollection* hit = sV.obj;
-    using namespace std;
-    out << noshowpos;
-    out << "|" << dec << setw(20) << setfill(' ') << hit->getNumberOfElements();
-    out << "|" << dec << setw(11) << setfill(' ') << hit->getTypeName();
-    out << "|" << hex << setw(13) << setfill(' ') << hit->getFlag();
-    out << "|" << dec << setw(14) << setfill(' ') << hit->isTransient();
-    out << "|" << dec << setw(12) << setfill(' ') << hit->isDefault();
-    out << "|" << dec << setw(11) << setfill(' ') << hit->isSubset() << "|" << endl;
-    return out;
-  }
-
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCCollection> l) { //hauke
-    const EVENT::LCCollection *hit = l.object();
-    const EVENT::LCCollection *col = l.collection();
-
-    using namespace std;
-    stringstream sstream;
-
-    out << noshowpos;
-    out << setw(41) << setfill('-') << right << " LCCollection " << setfill('-') << setw(29) << "-" << endl;
-
-    if(col != NULL){
-        if(col->getTypeName() != LCIO::LCCOLLECTION){
-            out << "Warning: collection not of type " << LCIO::LCCOLLECTION << endl ;
-            return(out);
-
-        }
-        //print collection flags
-    }
-
-    //print object attributs
-    out << setw(30) << setfill(' ') << left << "Number of elements" << right <<  setw(40)<< dec << hit->getNumberOfElements() << endl;
-    out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
-    out << setw(30) << setfill(' ') << left << "Flag"<< setfill(' ') << right << setw(40) << hex << hit->getFlag() << endl;
-    out << setw(30) << setfill(' ') << left << "Is transient"<< setfill(' ') << right << setw(40) << dec << hit->isTransient()  << endl;
-    out << setw(30) << setfill(' ') << left << "Is default"<< setfill(' ') << right << setw(40) << hit->isDefault() << endl;
-    out << setw(30) << setfill(' ') << left << "Is subset"<< setfill(' ') << right << setw(40) << hit->isSubset() << endl;
-    return out;
-}
-
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCCollection &hit){
-    out<<lcio_long(hit,NULL);
-    return out;
-  }
-
-//-------------------------
- const std::string& header(const EVENT::LCEvent &){ //hauke
-    static std::string _vtxh("| Run number  |Event number |Detector name| Time stamp  |  Weight     |\n");
-    return _vtxh;
-  }
-
-  const std::string& tail(const EVENT::LCEvent &){ //hauke
-    static std::string _vtxt("|-------------|-------------|-------------|-------------|-------------|\n");
-    return _vtxt;
-  }
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCEvent>& sV){ //hauke
-    const EVENT::LCEvent* hit = sV.obj;
-    using namespace std;
-    out << noshowpos;
-    out << "|" << hex << setw(13) << setfill(' ') << hit->getRunNumber();
-    out << "|" << hex << setw(13) << setfill(' ') << hit->getEventNumber();
-    out << "|" << dec << setw(13) << setfill(' ') << hit->getDetectorName();
-    out << "|" << dec << setw(13) << setfill(' ') << hit->getTimeStamp();
-    out << "|" << dec << setw(13) << setfill(' ') << hit->getWeight() << "|" << endl;
-    return out;
-  }
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCEvent> l) { //hauke
-    const EVENT::LCEvent *hit = l.object();
-    const EVENT::LCCollection *col = l.collection();
-
-    using namespace std;
-    stringstream sstream;
-
-    out << noshowpos;
-    out << setw(41) << setfill('-') << right << " LCEvent " << setfill('-') << setw(29) << "-" << endl;
-
-    if(col != NULL){
-        if(col->getTypeName() != LCIO::LCEVENT){
-            out << "Warning: collection not of type " << LCIO::LCEVENT << endl ;
-            return(out);
-
-        }
-        //print collection flags
-    }
-
-    //print object attributs
-    //sstream << "0x" << hex << hit->id();
-    out << setw(30) << setfill(' ') << left << "Run number" << right << setw(40) <<hex << hit->getRunNumber() << endl;
-    out << setw(30) << setfill(' ') << left << "Event number"<< setfill(' ') << right << setw(40) << dec << hit->getEventNumber() << endl;
-    out << setw(30) << setfill(' ') << left << "Detector name"<< setfill(' ') << right << setw(40) << hit->getDetectorName() << endl;
-    out << setw(30) << setfill(' ') << left << "Time stamp"<< setfill(' ') << right << setw(40) << hit->getTimeStamp() << endl;
-    out << setw(30) << setfill(' ') << left << "Weight"<< setfill(' ') << right << setw(40) << hit->getWeight() << endl;
-
-    out << setw(30) << setfill(' ') << left << "Collection Names" << endl;
-    const std::vector< std::string >* strVec = hit->getCollectionNames() ;
-    for(std::vector< std::string >::const_iterator name = strVec->begin() ; name != strVec->end() ; name++){
-        out << "      " << "Name: " << setw(20) << left << *name;
-        out << " Type: " << left << setw(10) <<  hit->getCollection( *name )->getTypeName();
-        out << " Number of Elements: "<< left << setw(20) << hit->getCollection( *name )->getNumberOfElements() << endl;
-    }
-    return out;
-}
-
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCEvent  &hit){
-    out<<lcio_long(hit,NULL);
-    return out;
-  }
-
-
-//-------------------------
-  const std::string& header(const EVENT::LCFlag &){ //hauke
-    static std::string _vtxh("|    Flag    |");
-    return _vtxh;
-  }
-  const std::string& tail(const EVENT::LCFlag &){ //hauke
-    static std::string _vtxt("|------------|\n");
-    return _vtxt;
-  }
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFlag>& sV){ //hauke
-    const EVENT::LCFlag* hit = sV.obj;
-    using namespace std;
-    out << noshowpos;
-    out << "|" << hex << setw(8) << setfill(' ') << hit->getFlag() << "|" << endl;
-    return out;
-  }
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFlag> l) { //hauke
-    const EVENT::LCFlag *hit = l.object();
-    const EVENT::LCCollection *col = l.collection();
-
-    using namespace std;
-    stringstream sstream;
-
-    out << noshowpos;
-    out << setw(41) << setfill('-') << right << " LCFlag " << setfill('-') << setw(29) << "-" << endl;
-
-    if(col != NULL){
-      // if(col->getTypeName() != LCIO::LCFLAG){
-      //      out << "Warning: collection not of type " << LCIO::LCFLAG << endl ;
-      //      return(out);
-      //  }
-      //not part of lcio?
-        //print collection flags
-    }
-
-    //print object attributs
-    out << setw(30) << setfill(' ') << left << "Flag" << right << hex << setw(40) << hit->getFlag() << dec << endl;
-    return out;
-}
-
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCFlag  &hit){
-    out<<lcio_long(hit,NULL);
-    return out;
-  }
-
-//-------------------------
-//-------------------------
-  const std::string& header(const EVENT::LCGenericObject &){ //hauke
-    static std::string _vtxh(" [   id   ] | Number of ints|Number of floats|     Type   |\n");
-    return _vtxh;
-  }
-  const std::string& tail(const EVENT::LCGenericObject &){ //hauke
-    static std::string _vtxt(" -------------|---------------|----------------|------------|\n");
-    return _vtxt;
-  }
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCGenericObject>& sV){ //hauke
-    const EVENT::LCGenericObject* hit = sV.obj;
-    using namespace std;
-    out << noshowpos;
-    out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
-    out << " |" << dec << setw(15) << setfill(' ') << hit->getNInt();
-    out << "|" << setw(16) << setfill(' ') << hit->getNDouble();
-    out << "|" << setw(12) << setfill(' ') << hit->getDataDescription() << "|" << endl;
-    return out;
-  }
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCGenericObject> l) { //hauke
-    const EVENT::LCGenericObject *hit = l.object();
-    const EVENT::LCCollection *col = l.collection();
-
-    using namespace std;
-    stringstream sstream;
-
-    out << noshowpos;
-    out << setw(41) << setfill('-') << right << " LCGenericObject " << setfill('-') << setw(29) << "-" << endl;
-
-    if(col != NULL){
-        if(col->getTypeName() != LCIO::LCGENERICOBJECT){
-            out << "Warning: collection not of type " << LCIO::LCGENERICOBJECT << endl ;
-            return(out);
-
-        }
-        //print collection flags
-    }
-
-    //print object attributs
-    sstream << "0x" << hex << hit->id();
-    out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
-    out << setw(30) << setfill(' ') << left << "Number of integer values"<< setfill(' ') << right << setw(40) << hit->getNInt() << endl;
-    out << setw(30) << setfill(' ') << left << "Number of float values"<< setfill(' ') << right << setw(40) << hit->getNDouble() << endl;
-    out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
-    out << setw(30) << setfill(' ') << left << "Description"<< setfill(' ') << right << setw(40) << hit->getDataDescription() << endl;
-    return out;
-}
-
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCGenericObject  &hit){
-    out<<lcio_long(hit,NULL);
-    return out;
-  }
-
-
-//-------------------------
-//-------------------------
-  const std::string& header(const EVENT::LCIntVec &){ //hauke
-    static std::string _vtxh(" [  Id   ] \n");
-    return _vtxh;
-  }
-  const std::string& tail(const EVENT::LCIntVec &){ //hauke
-    static std::string _vtxt("-----------\n");
-    return _vtxt;
-  }
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIntVec>& sV){ //hauke
-    const EVENT::LCIntVec* hit = sV.obj;
-    using namespace std;
-    out << noshowpos;
-    out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
-    return out;
-  }
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCIntVec> l) { //hauke
-    const EVENT::LCIntVec *hit = l.object();
-    const EVENT::LCCollection *col = l.collection();
-
-    using namespace std;
-    stringstream sstream;
-
-    out << noshowpos;
-    out << setw(41) << setfill('-') << right << " LCIntVec " << setfill('-') << setw(29) << "-" << endl;
-
-    if(col != NULL){
-        if(col->getTypeName() != LCIO::LCINTVEC){
-            out << "Warning: collection not of type " << LCIO::LCINTVEC << endl ;
-            return(out);
-
-        }
-        //print collection flags
-    }
-
-    //print object attributs
-    sstream << "0x" << hex << hit->id();
-    out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
-    return out;
-}
-
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCIntVec  &hit){
-    out<<lcio_long(hit,NULL);
-    return out;
-  }
-
-
-//-------------------------
-//-------------------------
-  const std::string& header(const EVENT::LCObject &){ //hauke
-    static std::string _vtxh(" [  Id   ] \n");
-    return _vtxh;
-  }
-
-  const std::string& tail(const EVENT::LCObject &){ //hauke
-    static std::string _vtxt("-----------\n");
-    return _vtxt;
-  }
-
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCObject>& sV){ //hauke
-    const EVENT::LCObject* hit = sV.obj;
-    using namespace std;
-    out << noshowpos;
-    out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
-    return out;
-  }
-
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCObject> l) { //hauke
-    const EVENT::LCObject *hit = l.object();
-    const EVENT::LCCollection *col = l.collection();
-
-    using namespace std;
-    stringstream sstream;
-
-    out << noshowpos;
-    out << setw(41) << setfill('-') << right << " LCObject " << setfill('-') << setw(29) << "-" << endl;
-
-    if(col != NULL){
-        //if(col->getTypeName() != LCIO::LCOBJECT){
-        //    out << "Warning: collection not of type " << LCIO::LCOBJECT << endl ;
-        //    return(out);
-        //}
-        //not part of lcio?
-
-        //print collection flags
-    }
-
-    //print object attributs
-    sstream << "0x" << hex << hit->id();
-    out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
-    return out;
-}
-
-  std::ostream& operator<<( std::ostream& out, const EVENT::LCObject  &hit){
-    out<<lcio_long(hit,NULL);
-    return out;
-  }
-
-//-------------------------
-  const std::string& header(const EVENT::LCParameters &){ //hauke
-    static std::string _vtxh("-----\n");
-    return _vtxh;
-  }
-  const std::string& tail(const EVENT::LCParameters &){ //hauke
-    static std::string _vtxt("-----\n");
-    return _vtxt;
-  }
-  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCParameters>& sV){ //hauke
-    //const EVENT::LCParameters* hit = sV.obj;
-    using namespace std;
-    out << noshowpos;
-    out << "| " << hex << setw(8) << setfill(' ')<< " |";
-    return out;
-  }
-
-
-
-  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCParameters> l) { //hauke
-    //const EVENT::LCParameters *params = l.object();
-    const EVENT::LCCollection *col = l.collection();
-
-    using namespace std;
-    stringstream sstream;
-
-    out << noshowpos;
-    out << setw(41) << setfill('-') << right << " LCParameters " << setfill('-') << setw(29) << "-" << endl;
-
-    if(col != NULL){
-        //if(col->getTypeName() != LCIO::LCPARAMETERS){
-        //    out << "Warning: collection not of type " << LCIO::LCPARAMETERS << endl ;
-        //    return(out);
-        //}
-        //not part of LCIO?
+ const ostream_flags saveflags(std::ostream& stream){
+       ostream_flags flags;
+       flags.oldf = stream.flags();
+       flags.precision =  stream.precision();
+       flags.fill = stream.fill();
+       return(flags);
+ }
+ void setflags(std::ostream& stream, ostream_flags flags){
+       stream.flags(flags.oldf);
+       stream.precision(flags.precision);
+       stream.fill(flags.fill);
+
+ }
+
+ const std::string& header(const EVENT::LCCollection &){ //hauke
+   static std::string _vtxh("| Number of elements | Type name |    Flag     | Is transient | Is default | Is subset |\n");
+   return _vtxh;
+ }
+
+ const std::string& tail(const EVENT::LCCollection &){ //hauke
+   static std::string _vtxt("|--------------------|-----------|-------------|--------------|------------|-----------|\n");
+   return _vtxt;
+ }
+
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCCollection>& sV){ //hauke
+   const EVENT::LCCollection* hit = sV.obj;
+   using namespace std;
+
+   ostream_flags flags=saveflags(out);
+   out << noshowpos;
+   out << "|" << dec << setw(20) << setfill(' ') << hit->getNumberOfElements();
+   out << "|" << dec << setw(11) << setfill(' ') << hit->getTypeName();
+   out << "|" << hex << setw(13) << setfill(' ') << hit->getFlag();
+   out << "|" << dec << setw(14) << setfill(' ') << hit->isTransient();
+   out << "|" << dec << setw(12) << setfill(' ') << hit->isDefault();
+   out << "|" << dec << setw(11) << setfill(' ') << hit->isSubset() << "|" << endl;
 
-        //print collection flags
+   setflags(out, flags);
+   return out;
+ }
+
+
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCCollection> l) { //hauke
+   const EVENT::LCCollection *hit = l.object();
+   const EVENT::LCCollection *col = l.collection();
+
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   stringstream sstream;
+
+   out << noshowpos;
+   out << setw(41) << setfill('-') << right << " LCCollection " << setfill('-') << setw(29) << "-" << endl;
+
+   if(col != NULL){
+       if(col->getTypeName() != LCIO::LCCOLLECTION){
+           out << "Warning: collection not of type " << LCIO::LCCOLLECTION << endl ;
+           setflags(out, flags);
+           return(out);
+       }
+       //print collection flags
+   }
+
+   //print object attributs
+   out << setw(30) << setfill(' ') << left << "Number of elements" << right <<  setw(40)<< dec << hit->getNumberOfElements() << endl;
+   out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
+   out << setw(30) << setfill(' ') << left << "Flag"<< setfill(' ') << right << setw(40) << hex << hit->getFlag() << endl;
+   out << setw(30) << setfill(' ') << left << "Is transient"<< setfill(' ') << right << setw(40) << dec << hit->isTransient()  << endl;
+   out << setw(30) << setfill(' ') << left << "Is default"<< setfill(' ') << right << setw(40) << hit->isDefault() << endl;
+   out << setw(30) << setfill(' ') << left << "Is subset"<< setfill(' ') << right << setw(40) << hit->isSubset() << endl;
+
+   setflags(out, flags);
+   return out;
+
+}
 
-    }
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCCollection &hit){
+   out<<lcio_long(hit,NULL);
+   return out;
+ }
+
+//-------------------------
+const std::string& header(const EVENT::LCEvent &){ //hauke
+   static std::string _vtxh("| Run number  |Event number |Detector name| Time stamp  |  Weight     |\n");
+   return _vtxh;
+ }
+
+ const std::string& tail(const EVENT::LCEvent &){ //hauke
+   static std::string _vtxt("|-------------|-------------|-------------|-------------|-------------|\n");
+   return _vtxt;
+ }
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCEvent>& sV){ //hauke
+   const EVENT::LCEvent* hit = sV.obj;
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   out << noshowpos;
+   out << "|" << hex << setw(13) << setfill(' ') << hit->getRunNumber();
+   out << "|" << hex << setw(13) << setfill(' ') << hit->getEventNumber();
+   out << "|" << dec << setw(13) << setfill(' ') << hit->getDetectorName();
+   out << "|" << dec << setw(13) << setfill(' ') << hit->getTimeStamp();
+   out << "|" << dec << setw(13) << setfill(' ') << hit->getWeight() << "|" << endl;
+   setflags(out, flags);
+
+   return out;
+ }
+
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCEvent> l) { //hauke
+   const EVENT::LCEvent *hit = l.object();
+   const EVENT::LCCollection *col = l.collection();
+
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   stringstream sstream;
+
+   out << noshowpos;
+   out << setw(41) << setfill('-') << right << " LCEvent " << setfill('-') << setw(29) << "-" << endl;
+
+   if(col != NULL){
+       if(col->getTypeName() != LCIO::LCEVENT){
+           out << "Warning: collection not of type " << LCIO::LCEVENT << endl ;
+           setflags(out, flags);
+
+           return(out);
+
+       }
+       //print collection flags
+   }
+
+   //print object attributs
+   //sstream << "0x" << hex << hit->id();
+   out << setw(30) << setfill(' ') << left << "Run number" << right << setw(40) <<hex << hit->getRunNumber() << endl;
+   out << setw(30) << setfill(' ') << left << "Event number"<< setfill(' ') << right << setw(40) << dec << hit->getEventNumber() << endl;
+   out << setw(30) << setfill(' ') << left << "Detector name"<< setfill(' ') << right << setw(40) << hit->getDetectorName() << endl;
+   out << setw(30) << setfill(' ') << left << "Time stamp"<< setfill(' ') << right << setw(40) << hit->getTimeStamp() << endl;
+   out << setw(30) << setfill(' ') << left << "Weight"<< setfill(' ') << right << setw(40) << hit->getWeight() << endl;
+
+   out << setw(30) << setfill(' ') << left << "Collection Names" << endl;
+   const std::vector< std::string >* strVec = hit->getCollectionNames() ;
+   for(std::vector< std::string >::const_iterator name = strVec->begin() ; name != strVec->end() ; name++){
+       out << "      " << "Name: " << setw(20) << left << *name;
+       out << " Type: " << left << setw(10) <<  hit->getCollection( *name )->getTypeName();
+       out << " Number of Elements: "<< left << setw(20) << hit->getCollection( *name )->getNumberOfElements() << endl;
+   }
+   out << setfill(' ') << setprecision(6)  <<  dec;
+   setflags(out, flags);
+
+   return out;
+}
+
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCEvent  &hit){
+   out<<lcio_long(hit,NULL);
+   return out;
+ }
+
+
+//-------------------------
+ const std::string& header(const EVENT::LCFlag &){ //hauke
+   static std::string _vtxh("|    Flag    |");
+   return _vtxh;
+ }
+ const std::string& tail(const EVENT::LCFlag &){ //hauke
+   static std::string _vtxt("|------------|\n");
+   return _vtxt;
+ }
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFlag>& sV){ //hauke
+   const EVENT::LCFlag* hit = sV.obj;
+   using namespace std;
+   ostream_flags flags=saveflags(out);
 
+   out << noshowpos;
+   out << "|" << hex << setw(8) << setfill(' ') << hit->getFlag() << "|" << endl;
+   setflags(out, flags);
+   return out;
+ }
 
-    // from lctools
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFlag> l) { //hauke
+   const EVENT::LCFlag *hit = l.object();
+   const EVENT::LCCollection *col = l.collection();
+
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   stringstream sstream;
+
+   out << noshowpos;
+   out << setw(41) << setfill('-') << right << " LCFlag " << setfill('-') << setw(29) << "-" << endl;
+
+   if(col != NULL){
+     // if(col->getTypeName() != LCIO::LCFLAG){
+     //      out << "Warning: collection not of type " << LCIO::LCFLAG << endl ;
+     //      return(out);
+     //  }
+     //not part of lcio?
+       //print collection flags
+   }
+
+   //print object attributs
+   out << setw(30) << setfill(' ') << left << "Flag" << right << hex << setw(40) << hit->getFlag() << dec << endl;
+
+   setflags(out, flags);
+   return out;
+}
+
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCFlag  &hit){
+   out<<lcio_long(hit,NULL);
+   return out;
+ }
+
+//-------------------------
+//-------------------------
+ const std::string& header(const EVENT::LCGenericObject &){ //hauke
+   static std::string _vtxh(" [   id   ] | Number of ints|Number of floats|     Type   |\n");
+   return _vtxh;
+ }
+ const std::string& tail(const EVENT::LCGenericObject &){ //hauke
+   static std::string _vtxt(" -------------|---------------|----------------|------------|\n");
+   return _vtxt;
+ }
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCGenericObject>& sV){ //hauke
+   const EVENT::LCGenericObject* hit = sV.obj;
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   out << noshowpos;
+   out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
+   out << " |" << dec << setw(15) << setfill(' ') << hit->getNInt();
+   out << "|" << setw(16) << setfill(' ') << hit->getNDouble();
+   out << "|" << setw(12) << setfill(' ') << hit->getDataDescription() << "|" << endl;
+
+
+   setflags(out, flags);
+   return out;
+ }
+
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCGenericObject> l) { //hauke
+   const EVENT::LCGenericObject *hit = l.object();
+   const EVENT::LCCollection *col = l.collection();
+
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   stringstream sstream;
+
+   out << noshowpos;
+   out << setw(41) << setfill('-') << right << " LCGenericObject " << setfill('-') << setw(29) << "-" << endl;
+
+   if(col != NULL){
+       if(col->getTypeName() != LCIO::LCGENERICOBJECT){
+           out << "Warning: collection not of type " << LCIO::LCGENERICOBJECT << endl ;
+           setflags(out, flags);
+           return(out);
+
+       }
+       //print collection flags
+   }
+
+   //print object attributs
+   sstream << "0x" << hex << hit->id();
+   out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
+   out << setw(30) << setfill(' ') << left << "Number of integer values"<< setfill(' ') << right << setw(40) << hit->getNInt() << endl;
+   out << setw(30) << setfill(' ') << left << "Number of float values"<< setfill(' ') << right << setw(40) << hit->getNDouble() << endl;
+   out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
+   out << setw(30) << setfill(' ') << left << "Description"<< setfill(' ') << right << setw(40) << hit->getDataDescription() << endl;
+
+   setflags(out, flags);
+   return out;
+}
+
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCGenericObject  &hit){
+   out<<lcio_long(hit,NULL);
+   return out;
+ }
+
+
+//-------------------------
+//-------------------------
+ const std::string& header(const EVENT::LCIntVec &){ //hauke
+   static std::string _vtxh(" [  Id   ] \n");
+   return _vtxh;
+ }
+ const std::string& tail(const EVENT::LCIntVec &){ //hauke
+   static std::string _vtxt("-----------\n");
+   return _vtxt;
+ }
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIntVec>& sV){ //hauke
+   const EVENT::LCIntVec* hit = sV.obj;
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   out << noshowpos;
+   out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
+
+   setflags(out, flags);
+   return out;
+ }
+
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCIntVec> l) { //hauke
+   const EVENT::LCIntVec *hit = l.object();
+   const EVENT::LCCollection *col = l.collection();
+
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   stringstream sstream;
+
+   out << noshowpos;
+   out << setw(41) << setfill('-') << right << " LCIntVec " << setfill('-') << setw(29) << "-" << endl;
+
+   if(col != NULL){
+       if(col->getTypeName() != LCIO::LCINTVEC){
+           out << "Warning: collection not of type " << LCIO::LCINTVEC << endl ;
+           setflags(out, flags);
+           return(out);
+
+       }
+       //print collection flags
+   }
+
+   //print object attributs
+   sstream << "0x" << hex << hit->id();
+   out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
+
+   setflags(out, flags);
+   return out;
+}
+
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCIntVec  &hit){
+   out<<lcio_long(hit,NULL);
+   return out;
+ }
+
+
+//-------------------------
+//-------------------------
+ const std::string& header(const EVENT::LCObject &){ //hauke
+   static std::string _vtxh(" [  Id   ] \n");
+   return _vtxh;
+ }
+
+ const std::string& tail(const EVENT::LCObject &){ //hauke
+   static std::string _vtxt("-----------\n");
+   return _vtxt;
+ }
+
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCObject>& sV){ //hauke
+   const EVENT::LCObject* hit = sV.obj;
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   out << noshowpos;
+   out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
+
+   setflags(out, flags);
+   return out;
+ }
+
+
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCObject> l) { //hauke
+   const EVENT::LCObject *hit = l.object();
+   const EVENT::LCCollection *col = l.collection();
+
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   stringstream sstream;
+
+   out << noshowpos;
+   out << setw(41) << setfill('-') << right << " LCObject " << setfill('-') << setw(29) << "-" << endl;
+
+   if(col != NULL){
+       //if(col->getTypeName() != LCIO::LCOBJECT){
+       //    out << "Warning: collection not of type " << LCIO::LCOBJECT << endl ;
+       //    return(out);
+       //}
+       //not part of lcio?
+
+       //print collection flags
+   }
+
+   //print object attributs
+   sstream << "0x" << hex << hit->id();
+   out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
+
+   setflags(out, flags);
+   return out;
+}
+
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCObject  &hit){
+   out<<lcio_long(hit,NULL);
+   return out;
+ }
+
+//-------------------------
+ const std::string& header(const EVENT::LCParameters &){ //hauke
+   static std::string _vtxh("-----\n");
+   return _vtxh;
+ }
+ const std::string& tail(const EVENT::LCParameters &){ //hauke
+   static std::string _vtxt("-----\n");
+   return _vtxt;
+ }
+ std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCParameters>& sV){ //hauke
+   //const EVENT::LCParameters* hit = sV.obj;
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   out << noshowpos;
+   out << "| " << hex << setw(8) << setfill(' ')<< " |";
+
+   setflags(out, flags);
+   return out;
+ }
+
+
+
+ std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCParameters> l) { //hauke
+   //const EVENT::LCParameters *params = l.object();
+   const EVENT::LCCollection *col = l.collection();
+
+   using namespace std;
+   ostream_flags flags=saveflags(out);
+
+   stringstream sstream;
+
+   out << noshowpos;
+   out << setw(41) << setfill('-') << right << " LCParameters " << setfill('-') << setw(29) << "-" << endl;
+
+   if(col != NULL){
+       //if(col->getTypeName() != LCIO::LCPARAMETERS){
+       //    out << "Warning: collection not of type " << LCIO::LCPARAMETERS << endl ;
+       //    return(out);
+       //}
+       //not part of LCIO?
+
+       //print collection flags
+
+   }
+
+
+   // from lctools
 /*
-    StringVec intKeys ;
-    int nIntParameters = params.getIntKeys( intKeys ).size() ;
-    for(int i=0; i< nIntParameters ; i++ ){
-      IntVec intVec ;
-      params.getIntVals(  intKeys[i], intVec ) ;
-      int nInt  = intVec.size()  ;
-      out << " parameter " << intKeys[i] << " [int]: " ;
-
-      if( nInt == 0 ){
-    out << " [empty] " << std::endl ;
-      }
-      for(int j=0; j< nInt ; j++ ){
-    out << intVec[j] << ", " ;
-      }
-      out << endl ;
-    }
-    StringVec floatKeys ;
-    int nFloatParameters = params.getFloatKeys( floatKeys ).size() ;
-    for(int i=0; i< nFloatParameters ; i++ ){
-      FloatVec floatVec ;
-      params.getFloatVals(  floatKeys[i], floatVec ) ;
-      int nFloat  = floatVec.size()  ;
-      out << " parameter " << floatKeys[i] << " [float]: " ;
-      if( nFloat == 0 ){
-    out << " [empty] " << std::endl ;
-      }
-      for(int j=0; j< nFloat ; j++ ){
-    out << floatVec[j] << ", " ;
-      }
-      out << endl ;
-    }
-    StringVec stringKeys ;
-    int nStringParameters = params.getStringKeys( stringKeys ).size() ;
-    for(int i=0; i< nStringParameters ; i++ ){
-      StringVec stringVec ;
-      params.getStringVals(  stringKeys[i], stringVec ) ;
-      int nString  = stringVec.size()  ;
-      out << " parameter " << stringKeys[i] << " [string]: " ;
-      if( nString == 0 ){
-    out << " [empty] " << std::endl ;
-      }
-      for(int j=0; j< nString ; j++ ){
-    out << stringVec[j] << ", " ;
-      }
-      out << endl ;
-   }
+   StringVec intKeys ;
+   int nIntParameters = params.getIntKeys( intKeys ).size() ;
+   for(int i=0; i< nIntParameters ; i++ ){
+     IntVec intVec ;
+     params.getIntVals(  intKeys[i], intVec ) ;
+     int nInt  = intVec.size()  ;
+     out << " parameter " << intKeys[i] << " [int]: " ;
+
+     if( nInt == 0 ){
+   out << " [empty] " << std::endl ;
+     }
+     for(int j=0; j< nInt ; j++ ){
+   out << intVec[j] << ", " ;
+     }
+     out << endl ;
+   }
+   StringVec floatKeys ;
+   int nFloatParameters = params.getFloatKeys( floatKeys ).size() ;
+   for(int i=0; i< nFloatParameters ; i++ ){
+     FloatVec floatVec ;
+     params.getFloatVals(  floatKeys[i], floatVec ) ;
+     int nFloat  = floatVec.size()  ;
+     out << " parameter " << floatKeys[i] << " [float]: " ;
+     if( nFloat == 0 ){
+   out << " [empty] " << std::endl ;
+     }
+     for(int j=0; j< nFloat ; j++ ){
+   out << floatVec[j] << ", " ;
+     }
+     out << endl ;
+   }
+   StringVec stringKeys ;
+   int nStringParameters = params.getStringKeys( stringKeys ).size() ;
+   for(int i=0; i< nStringParameters ; i++ ){
+     StringVec stringVec ;
+     params.getStringVals(  stringKeys[i], stringVec ) ;
+     int nString  = stringVec.size()  ;
+     out << " parameter " << stringKeys[i] << " [string]: " ;
+     if( nString == 0 ){
+   out << " [empty] " << std::endl ;
+     }
+     for(int j=0; j< nString ; j++ ){
+   out << stringVec[j] << ", " ;
+     }
+     out << endl ;
+  }
 */
-    // end
+   // end
+
+   //sstream << "0x" << hex << hit->id();
+   //out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
+   //out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << hit->getType() << endl;
+   //out << setw(30) << left << "Energy [GeV]" << right << setw(40) << hit->getEnergy() << endl;
+
+   setflags(out, flags);
+   return out;
+
+}
+
+ std::ostream& operator<<( std::ostream& out, const EVENT::LCParameters  &hit){
+   out<<lcio_long(hit,NULL);
+   return out;
+ }
+
[truncated at 1000 lines; 3450 more skipped]
CVSspam 0.2.8