]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSdigitSSD.cxx
Using detector quality flag (taken from ALICE logbook) to decide whether to rpodcue...
[u/mrichter/AliRoot.git] / ITS / AliITSdigitSSD.cxx
index b9a944bbda13c629788ce46152ac16ec675e9d6c..f6afe19122c2a5b61da7d1c9c9bbbf62dec9c2b3 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * 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.              *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-*/
+#include <AliITSdigitSSD.h>
+#include <TArrayI.h>
 
-#include "AliITSdigitSSD.h"
+///////////////////////////////////////////////////////////////////
+//                                                               //
+// Class defining the digit object
+// for SSD
+// Inherits from AliITSdigit
+//                                                               //
+///////////////////////////////////////////////////////////////////
 
-ClassImp(AliITSdigitSSD);
+ClassImp(AliITSdigitSSD)
 
-AliITSdigitSSD::AliITSdigitSSD 
-    (Int_t *tracks, Int_t *digits, Int_t strNo, Int_t s, Bool_t p)
-    :AliITSdigit(tracks,digits) {
-    fSignal = s;
-    fStripNumber = strNo;
-    fSide = p;
+//______________________________________________________________________
+AliITSdigitSSD::AliITSdigitSSD():AliITSdigit(){
+    // default constructor
+    Int_t i;
+
+    for(i=0; i<fgkSize; i++) fTracks[i] = -3;
+    for(i=0; i<fgkSize; i++) fHits[i] = -1;
+}
+//__________________________________________________________________________
+AliITSdigitSSD::AliITSdigitSSD(const Int_t *digits):AliITSdigit(digits){
+    // Creates a real SSD digit object
+}
+//_____________________________________________________________________________
+AliITSdigitSSD::AliITSdigitSSD(const Int_t *digits,const Int_t *tracks,
+                              const Int_t *hits):AliITSdigit(digits){
+    // Creates a simulated SSD digit object
+
+    for(Int_t i=0; i<fgkSize; i++) {
+       fTracks[i] = tracks[i];
+       fHits[i]   = hits[i];
+    } // end for i
 }
+//______________________________________________________________________
+Int_t AliITSdigitSSD::GetListOfTracks(TArrayI &t){
+    // Fills the TArrayI t with the tracks found in fTracks removing
+    // duplicated tracks, but otherwise in the same order. It will return
+    // the number of tracks and fill the remaining elements to the array
+    // t with -1.
+    // Inputs:
+    //   TArrayI  &t Reference to a TArrayI to contain the list of
+    //               nonduplicated track numbers.
+    // Output:
+    //   TArrayI  &t The input array filled with the nonduplicated track
+    //               numbers.
+    // Return:
+    //   Int_t The number of none -1 entries in the TArrayI t.
+    Int_t nt = t.GetSize();
+    Int_t nth = this->GetNTracks();
+    Int_t n = 0,i,j;
+    Bool_t inlist = kFALSE;
 
+    t.Reset(-1); // -1 array.
+    for(i=0;i<nth;i++) {
+       if(this->GetTrack(i) == -1) continue;
+       inlist = kFALSE;
+       for(j=0;j<n;j++)if(this->GetTrack(i) == t.At(j)) inlist = kTRUE;
+       if(!inlist){ // add to end of list
+           t.AddAt(this->GetTrack(i),n);
+           if(n<nt) n++;
+       } // end if
+    } // end for i
+    return n;
+}
+//______________________________________________________________________
+void AliITSdigitSSD::Print(ostream *os){
+    //Standard output format for this class
+    Int_t i;
+
+    AliITSdigit::Print(os);
+    for(i=0; i<fgkSize; i++) *os <<","<< fTracks[i];
+    for(i=0; i<fgkSize; i++) *os <<","<< fHits[i];
+}
+//______________________________________________________________________
+void AliITSdigitSSD::Read(istream *os){
+    //Standard input for this class
+    Int_t i;
+
+    AliITSdigit::Read(os);
+    for(i=0; i<fgkSize; i++) *os >> fTracks[i];
+    for(i=0; i<fgkSize; i++) *os >> fHits[i];
+}
+//______________________________________________________________________
+ostream &operator<<(ostream &os,AliITSdigitSSD &source){
+    // Standard output streaming function.
+
+    source.Print(&os);
+    return os;
+}
+//______________________________________________________________________
+istream &operator>>(istream &os,AliITSdigitSSD &source){
+    // Standard output streaming function.
+
+    source.Read(&os);
+    return os;
+}