]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRecPoint.cxx
Added class iostreamer funcionality and Print and Read functions. cleaned
[u/mrichter/AliRoot.git] / ITS / AliITSRecPoint.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /*
17 $Log$
18 */
19 ////////////////////////////////////////////////
20 //  Reconstructed point class for set:ITS     //
21 ////////////////////////////////////////////////
22
23
24 #include "AliITSRecPoint.h"
25 ClassImp(AliITSRecPoint)
26
27 AliITSRecPoint::AliITSRecPoint() {
28     // default creator
29     fTracks[0]=fTracks[1]=fTracks[2]=-3; 
30     fX=fZ=fQ=fdEdX=0.;
31     fSigmaX2=fSigmaZ2=0.;
32 }
33 //----------------------------------------------------------------------
34 void AliITSRecPoint::Print(ostream *os){
35     ////////////////////////////////////////////////////////////////////////
36     // Standard output format for this class.
37     ////////////////////////////////////////////////////////////////////////
38 #if defined __GNUC__
39 #if __GNUC__ > 2
40     ios::fmtflags fmt;
41 #else
42     Int_t fmt;
43 #endif
44 #else
45 #if defined __ICC
46     ios::fmtflags fmt;
47 #else
48     Int_t fmt;
49 #endif
50 #endif
51  
52     fmt = os->setf(ios::fixed);  // set fixed floating point output
53     *os << fTracks[0]<< " " << fTracks[1] << " " << fTracks[2] << " ";
54     *os << fX << " " << fZ << " " << fQ << " ";
55     fmt = os->setf(ios::scientific); // set scientific for dEdX.
56     *os << fdEdX << " ";
57     fmt = os->setf(ios::fixed); // every fixed
58     *os << fSigmaX2 << " " << fSigmaZ2;
59     os->flags(fmt); // reset back to old formating.
60     return;
61 }
62 //----------------------------------------------------------------------
63 void AliITSRecPoint::Read(istream *is){
64 ////////////////////////////////////////////////////////////////////////
65 // Standard input format for this class.
66 ////////////////////////////////////////////////////////////////////////
67  
68
69     *is >> fTracks[0] >> fTracks[1] >> fTracks[2] >> fX >> fZ >> fQ;
70     *is >> fdEdX >> fSigmaX2 >> fSigmaZ2;
71     return;
72 }
73 //----------------------------------------------------------------------
74 ostream &operator<<(ostream &os,AliITSRecPoint &p){
75 ////////////////////////////////////////////////////////////////////////
76 // Standard output streaming function.
77 ////////////////////////////////////////////////////////////////////////
78  
79     p.Print(&os);
80     return os;
81 }
82 //----------------------------------------------------------------------
83 istream &operator>>(istream &is,AliITSRecPoint &r){
84 ////////////////////////////////////////////////////////////////////////
85 // Standard input streaming function.
86 ////////////////////////////////////////////////////////////////////////
87  
88     r.Read(&is);
89     return is;
90 }
91 //----------------------------------------------------------------------