]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITShit.cxx
Macro taken from oldmacros and fixed up a bit.
[u/mrichter/AliRoot.git] / ITS / AliITShit.cxx
index b3bb4e8f4a1767aa0af97c06811647eec4545be1..f65fa48942f4dfe35891a9ded5b39eae861172a8 100644 (file)
 
 /*
 $Log$
+Revision 1.12  2002/03/08 16:05:05  nilsen
+Standeard io streamers added to make debugging et al. easier.
+
+Revision 1.11  2001/01/30 09:23:13  hristov
+Streamers removed (R.Brun)
+
+Revision 1.10  2001/01/26 20:01:19  hristov
+Major upgrade of AliRoot code
+
 Revision 1.9  2000/10/02 16:32:51  barbera
 Automatic streamer used and forward declarations added
 
@@ -39,6 +48,7 @@ Introduction of the Copyright and cvs Log
 
 */
 
+#include <iostream.h>
 
 #include <TMath.h>
 #include <TRandom.h>
@@ -463,41 +473,62 @@ TParticle * AliITShit::GetParticle(){
 // particle can be found. See the TParticle class.
 ////////////////////////////////////////////////////////////////////////
     return gAlice->Particle(GetTrack());
+}  
+//----------------------------------------------------------------------
+void AliITShit::Print(ostream *os){
+////////////////////////////////////////////////////////////////////////
+// Standard output format for this class.
+////////////////////////////////////////////////////////////////////////
+#if defined __GNUC__
+#if __GNUC__ > 2
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#else
+    Int_t fmt;
+#endif
+    fmt = os->setf(ios::scientific);  // set scientific floating point output
+    *os << fTrack << " " << fX << " " << fY << " " << fZ << " ";
+    fmt = os->setf(ios::hex); // set hex for fStatus only.
+    *os << fStatus << " ";
+    fmt = os->setf(ios::dec); // every thing else decimel.
+    *os << fLayer << " " << fLadder << " " << fDet << " ";;
+    *os << fPx << " " << fPy << " " << fPz << " ";
+    *os << fDestep << " " << fTof;
+    *os << endl;
+    os->flags(fmt); // reset back to old formating.
+    return;
 }
-/*
-//___________________________________________________________________________
-void AliITShit::Streamer(TBuffer &R__b){
-////////////////////////////////////////////////////////////////////////
-//     The streamer function for this AliITShit class. This has been set
-// up so that future changes to this class can be easly incorporated.
-////////////////////////////////////////////////////////////////////////
-   if (R__b.IsReading()) {
-      Version_t R__v = R__b.ReadVersion(); 
-      if (R__v==1) {
-         AliHit::Streamer(R__b);
-         R__b >> fStatus;
-         R__b >> fLayer;
-         R__b >> fLadder;
-         R__b >> fDet;
-         R__b >> fPx;
-         R__b >> fPy;
-         R__b >> fPz;
-         R__b >> fDestep;
-         R__b >> fTof;
-      }else{ // for futrue changes to this class.
-      } // end if R__v==1
-   } else {
-      R__b.WriteVersion(AliITShit::IsA());
-      AliHit::Streamer(R__b);
-      R__b << fStatus;
-      R__b << fLayer;
-      R__b << fLadder;
-      R__b << fDet;
-      R__b << fPx;
-      R__b << fPy;
-      R__b << fPz;
-      R__b << fDestep;
-      R__b << fTof;
-   } // end if R__b.IsReading()
+//----------------------------------------------------------------------
+void AliITShit::Read(istream *is){
+////////////////////////////////////////////////////////////////////////
+// Standard input format for this class.
+////////////////////////////////////////////////////////////////////////
+
+    *is >> fTrack >> fX >> fY >> fZ;
+    *is >> fStatus >> fLayer >> fLadder >> fDet >> fPx >> fPy >> fPz >>
+          fDestep >> fTof;
+    return;
 }
-*/
+//----------------------------------------------------------------------
+ostream &operator<<(ostream &os,AliITShit &p){
+////////////////////////////////////////////////////////////////////////
+// Standard output streaming function.
+////////////////////////////////////////////////////////////////////////
+    p.Print(&os);
+    return os;
+}
+//----------------------------------------------------------------------
+istream &operator>>(istream &is,AliITShit &r){
+////////////////////////////////////////////////////////////////////////
+// Standard input streaming function.
+////////////////////////////////////////////////////////////////////////
+    r.Read(&is);
+    return is;
+}
+//----------------------------------------------------------------------