]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITShit.cxx
Removing obsolete macros
[u/mrichter/AliRoot.git] / ITS / AliITShit.cxx
index b3bb4e8f4a1767aa0af97c06811647eec4545be1..7554f001d99a5f58764b4554614cfbbabae91c73 100644 (file)
 
 /*
 $Log$
+Revision 1.20  2002/10/22 14:45:42  alibrary
+Introducing Riostream.h
+
+Revision 1.19  2002/10/14 14:57:00  hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
+Revision 1.13.6.3  2002/08/28 15:06:50  alibrary
+Updating to v3-09-01
+
+Revision 1.18  2002/08/07 18:37:53  nilsen
+Removed endl from print function. should be supplied by user as wanted.
+
+Revision 1.17  2002/06/20 09:10:14  hristov
+Data member ft0 initialized
+
+Revision 1.16  2002/06/19 21:12:37  nilsen
+Fixed bug with non-zero-ed new data members in constructors. Thanks Jiri
+for finding it and pointing it out.
+
+Revision 1.15  2002/06/12 18:59:47  nilsen
+Added Starting track location to hit class and related changes to modules.
+This is at present still fully backwards compatible since starting hits
+are still written to the file. When aliroot v4.0 will be released, this
+backwards compatiblity will be broken by removing the enterence hit, and making
+the nessesary changes to module at that time.
+
+Revision 1.14  2002/05/19 18:17:03  hristov
+Changes needed by ICC/IFC compiler (Intel)
+
+Revision 1.13  2002/03/09 18:35:35  nilsen
+Added functions to print out Hit data members.
+
+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 +80,7 @@ Introduction of the Copyright and cvs Log
 
 */
 
+#include <Riostream.h>
 
 #include <TMath.h>
 #include <TRandom.h>
@@ -217,6 +259,73 @@ ClassImp(AliITShit)
 //
 ////////////////////////////////////////////////////////////////////////
 //_____________________________________________________________________________
+AliITShit::AliITShit():AliHit(){
+    // Default Constructor
+    // Zero data member just to be safe.
+    // Intputs:
+    //    none.
+    // Outputs:
+    //    none.
+    // Return:
+    //    A default created AliITShit class.
+
+    fStatus = 0; // Track Status
+    fLayer  = 0;  // Layer number
+    fLadder = 0; // Ladder number
+    fDet    = 0;    // Detector number  
+    fPx     = 0.0;     // PX of particle at the point of the hit
+    fPy     = 0.0;     // PY of particle at the point of the hit
+    fPz     = 0.0;     // PZ of particle at the point of the hit
+    fDestep = 0.0; // Energy deposited in the current step
+    fTof    = 0.0;    // Time of flight at the point of the hit
+    fStatus0 = 0; // zero status bit by default.
+    fx0     = 0.0;     // Starting point of this step
+    fy0     = 0.0;     // Starting point of this step
+    fz0     = 0.0;     // Starting point of this step
+    ft0     = 0.0;     // Starting point of this step
+}
+AliITShit::AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,
+                    Float_t tof,TLorentzVector &x,TLorentzVector &x0,
+                    TLorentzVector &p) : AliHit(shunt, track){
+////////////////////////////////////////////////////////////////////////
+// Create ITS hit
+//     The creator of the AliITShit class. The variables shunt and
+// track are passed to the creator of the AliHit class. See the AliHit
+// class for a full description. In the units of the Monte Carlo
+////////////////////////////////////////////////////////////////////////
+    // Intputs:
+    //    Int_t shunt   See AliHit
+    //    Int_t track   Track number, see AliHit
+    //    Int_t *vol     Array of integer hit data,
+    //                     vol[0] Layer where the hit is, 1-6 typicaly
+    //                     vol[1] Ladder where the hit is.
+    //                     vol[2] Detector number where the hit is
+    //                     vol[3] Set of status bits
+    //                     vol[4] Set of status bits at start
+    // Outputs:
+    //    none.
+    // Return:
+    //    A default created AliITShit class.
+
+    fLayer      = vol[0];  // Layer number
+    fLadder     = vol[2];  // Ladder number
+    fDet        = vol[1];  // Detector number
+    fStatus     = vol[3];  // Track status flags
+    fStatus0    = vol[4];  // Track status flag for start position.
+    fX          = x.X();   // Track X global position
+    fY          = x.Y();   // Track Y global position
+    fZ          = x.Z();   // Track Z global position
+    fPx         = p.Px();  // Track X Momentum
+    fPy         = p.Py();  // Track Y Momentum
+    fPz         = p.Pz();  // Track Z Momentum
+    fDestep     = edep;    // Track dE/dx for this step
+    fTof        = tof   ;  // Track Time of Flight for this step
+    fx0         = x0.X();  // Track X global position
+    fy0         = x0.Y();  // Track Y global position
+    fz0         = x0.Z();  // Track Z global position
+    ft0         = x0.T();     // Starting point of this step
+}
+//______________________________________________________________________
 AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
     AliHit(shunt, track){
 ////////////////////////////////////////////////////////////////////////
@@ -229,18 +338,44 @@ AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
 // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
 // fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo
 ////////////////////////////////////////////////////////////////////////
+    // Intputs:
+    //    Int_t shunt   See AliHit
+    //    Int_t track   Track number, see AliHit
+    //    Int_t *vol     Array of integer hit data,
+    //                     vol[0] Layer where the hit is, 1-6 typicaly
+    //                     vol[1] Ladder where the hit is.
+    //                     vol[2] Detector number where the hit is
+    //                     vol[3] Set of status bits
+    //    Float_t *hits   Array of hit information
+    //                     hits[0] X global position of this hit
+    //                     hits[1] Y global position of this hit
+    //                     hits[2] Z global position of this hit
+    //                     hits[3] Px global position of this hit
+    //                     hits[4] Py global position of this hit
+    //                     hits[5] Pz global position of this hit
+    //                     hits[6] Energy deposited by this step
+    //                     hits[7] Time of flight of this particle at this step
+    // Outputs:
+    //    none.
+    // Return:
+    //    A standard created AliITShit class.
   fLayer      = vol[0];   // Layer number
   fLadder     = vol[2];   // Ladder number
   fDet        = vol[1];   // Detector number
   fStatus     = vol[3];   // Track status flags
-  fX          = hits[0];  // Track X position
-  fY          = hits[1];  // Track Y position
-  fZ          = hits[2];  // Track Z position
+  fX          = hits[0];  // Track X global position
+  fY          = hits[1];  // Track Y global position
+  fZ          = hits[2];  // Track Z global position
   fPx         = hits[3];  // Track X Momentum
   fPy         = hits[4];  // Track Y Momentum
   fPz         = hits[5];  // Track Z Momentum
   fDestep     = hits[6];  // Track dE/dx for this step
   fTof        = hits[7];  // Track Time of Flight for this step
+  fStatus0 = 0;// Track Status of Starting point
+  fx0 = 0.0;     // Starting point of this step
+  fy0 = 0.0;     // Starting point of this step
+  fz0 = 0.0;     // Starting point of this step
+  ft0 = 0.0;     // Starting point of this step
 }
 //______________________________________________________________________
 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){
@@ -463,41 +598,68 @@ 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
+#if defined __ICC || defined __ECC
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#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 << " " << fx0 << " " << fy0 << " " << fz0;
+//    *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;
+    *is >> fx0 >> fy0 >> fz0;
+    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;
+}
+//----------------------------------------------------------------------