]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSdigit.cxx
In Open() and GotoEvent() try the ESD operations first, fallback to run-loader.
[u/mrichter/AliRoot.git] / ITS / AliITSdigit.cxx
index af7c69b2e3552538a77e3a0bc8fc8150f40bf452..1689dc8367ab87947f6ee7bdcef32f09531a6bc9 100644 (file)
+/**************************************************************************
+ * Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
 ////////////////////////////////////////////////
-//  Digits classes for set:ITS                //
+//  Digits classes for all ITS detectors      //
+//                                            //
+//                                            //
 ////////////////////////////////////////////////
 
-
 #include "AliITSdigit.h"
 
-ClassImp(AliITSdigit)
-//_____________________________________________________________________________
-
-AliITSdigit::AliITSdigit(Int_t *digits) {
-  //
-  // Creates a real data digit object
-  //
-  fCoord1       = digits[0];
-  fCoord2       = digits[1];
-  fSignal       = digits[2];
-}
 
+//______________________________________________________________________
+ClassImp(AliITSdigit)
 
-ClassImp(AliITSdigitSPD)
-  
-  //_________________________________________________________________________
-  AliITSdigitSPD::AliITSdigitSPD(Int_t *digits) {
-  //
-  // Creates a SPD digit object 
-  //
-  
-  fCoord1        = digits[0];
-  fCoord2        = digits[1];
-  fSignal        = digits[2];
+AliITSdigit::AliITSdigit():
+fCoord1(0),
+fCoord2(0),
+fSignal(0){
+  //default constructor. zero all values.
+  for(Int_t i=0;i<fgkSize;i++) fTracks[i] = 0;
+  for(Int_t i=0;i<fgkSize;i++) fHits[i]   = 0;
   
 }
 
-//_____________________________________________________________________________
-AliITSdigitSPD::AliITSdigitSPD(Int_t *digits,Int_t *tracks) {  
-  //
-  // Creates a simulated SPD digit object 
-  //
-  
-  fCoord1        = digits[0];
-  fCoord2        = digits[1];
-  fSignal        = digits[2];
-  
-  Int_t i;
-  for(i=0; i<3; i++) {
-    fTracks[i]    = tracks[i];
-  }
-}
 
+AliITSdigit::AliITSdigit(const Int_t *digits):
+fCoord1(digits[0]),
+fCoord2(digits[1]),
+fSignal(digits[2]){
+  // Creates a real data digit object
+  for(Int_t i=0;i<fgkSize;i++) fTracks[i] = 0;
+  for(Int_t i=0;i<fgkSize;i++) fHits[i]   = 0;
 
-ClassImp(AliITSdigitSDD)
-  //________________________________________________________________________
-  AliITSdigitSDD::AliITSdigitSDD(Float_t phys,Int_t *digits) {
-  //
-  // Creates a simulated SDD digit object to be updated
-  //
-  fCoord1       = digits[0];
-  fCoord2       = digits[1];
-  fSignal       = digits[2];
-  fPhysics      = phys;
-}
 
-//_____________________________________________________________________________
-AliITSdigitSDD::AliITSdigitSDD(Float_t phys,Int_t *digits,Int_t *tracks, Float_t *charges) {
-  //
-  // Creates a simulated SDD digit object 
-  //
-  fCoord1        = digits[0];
-  fCoord2        = digits[1];
-  fSignal        = digits[2];
-  fPhysics       = phys;
-  
-  Int_t i;
-  for(i=0; i<3; i++) {
-    fTcharges[i]  = charges[i];
-    fTracks[i]    = tracks[i];
-  }
 }
+//______________________________________________________________________
+void AliITSdigit::Print(ostream *os) {
+    //Standard output format for this class
 
-
-ClassImp(AliITSTransientDigit)
-  //_______________________________________________________________________
-  AliITSTransientDigit::AliITSTransientDigit(Float_t phys,Int_t *digits): 
-    AliITSdigitSDD(phys,digits) {
-  //
-  // Creates a digit object in a list of digits to be updated
-  //  
-  fTrackList   = new TObjArray;  
+    *os << fCoord1 <<","<< fCoord2 <<","<< fSignal;
 }
+//______________________________________________________________________
+void AliITSdigit::Read(istream *os) {
+    //Standard input for this class
 
-//__________________________________________________________________________
-AliITSTransientDigit::AliITSTransientDigit(const AliITSTransientDigit &source){
-  //     Copy Constructor 
-  if(&source == this) return;
-  this->fTrackList = source.fTrackList;
-  return;
+    *os >> fCoord1 >> fCoord2 >> fSignal;
 }
+//______________________________________________________________________
+ostream &operator<<(ostream &os,AliITSdigit &source){
+    // Standard output streaming function.
 
-//_________________________________________________________________________
-AliITSTransientDigit& 
-  AliITSTransientDigit::operator=(const AliITSTransientDigit &source) {
-  //    Assignment operator
-  if(&source == this) return *this;
-  this->fTrackList = source.fTrackList;
-  return *this;
+    source.Print(&os);
+    return os;
 }
+//______________________________________________________________________
+istream &operator>>(istream &os,AliITSdigit &source){
+    // Standard output streaming function.
 
-ClassImp(AliITSdigitSSD)
-  //__________________________________________________________________________
-  AliITSdigitSSD::AliITSdigitSSD(Int_t *digits) {
-  //
-  // Creates a real SSD digit object 
-  //
-  
-  fCoord1        = digits[0];
-  fCoord2        = digits[1];
-  fSignal        = digits[2];
-  
+    source.Read(&os);
+    return os;
 }
 
-//_____________________________________________________________________________
-AliITSdigitSSD::AliITSdigitSSD(Int_t *digits,Int_t *tracks) {
-  //
-  // Creates a simulated SSD digit object 
-  // 
-  
-  fCoord1        = digits[0];
-  fCoord2        = digits[1];
-  fSignal        = digits[2];
-
-  Int_t i;
-  for(i=0; i<3; i++) {
-    fTracks[i]    = tracks[i];
-  }
-}