]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New PHOS raw stream class based on a new AliAltroRawStream class. As soon as the...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 30 Mar 2006 13:03:58 +0000 (13:03 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 30 Mar 2006 13:03:58 +0000 (13:03 +0000)
PHOS/AliPHOSRawStream.cxx
PHOS/AliPHOSRawStream.h

index 4e2b1414e4bda5084ebc078e0ceb6b3e15548cbd..f4ab53a5048f549d14f8bd1b205ffb569df63e3b 100644 (file)
@@ -37,9 +37,81 @@ ClassImp(AliPHOSRawStream)
 
 //_____________________________________________________________________________
 AliPHOSRawStream::AliPHOSRawStream(AliRawReader* rawReader) :
-  AliAltroRawStream(rawReader)
+  AliAltroRawStream(rawReader),
+  fModule(-1),
+  fPrevModule(-1),
+  fRow(-1),
+  fPrevRow(-1),
+  fColumn(-1),
+  fPrevColumn(-1)
 {
 // create an object to read PHOS raw digits
 
-  fRawReader->Select(6);
+  SelectRawData(6);
+
+  fNoAltroMapping = kTRUE;
+}
+
+//_____________________________________________________________________________
+AliPHOSRawStream::AliPHOSRawStream(const AliPHOSRawStream& stream) :
+  AliAltroRawStream(stream),
+  fModule(-1),
+  fPrevModule(-1),
+  fRow(-1),
+  fPrevRow(-1),
+  fColumn(-1),
+  fPrevColumn(-1)
+{  
+  Fatal("AliPHOSRawStream", "copy constructor not implemented");
+}
+
+//_____________________________________________________________________________
+AliPHOSRawStream& AliPHOSRawStream::operator = (const AliPHOSRawStream& 
+                                             /* stream */)
+{
+  Fatal("operator =", "assignment operator not implemented");
+  return *this;
+}
+
+//_____________________________________________________________________________
+AliPHOSRawStream::~AliPHOSRawStream()
+{
+// destructor
+}
+
+//_____________________________________________________________________________
+void AliPHOSRawStream::Reset()
+{
+  // reset phos raw stream params
+  AliAltroRawStream::Reset();
+  fModule = fPrevModule = fRow = fPrevRow = fColumn = fPrevColumn = -1;
+}
+
+//_____________________________________________________________________________
+Bool_t AliPHOSRawStream::Next()
+{
+  // Read next PHOS signal
+  // Apply the PHOS altro mapping to get
+  // the module,row and column indeces
+  fPrevModule = fModule;
+  fPrevRow = fRow;
+  fPrevColumn = fColumn;
+  if (AliAltroRawStream::Next()) {
+    //    if (IsNewHWAddress())
+    ApplyAltroMapping();
+    return kTRUE;
+  }
+  else
+    return kFALSE;
+}
+
+//_____________________________________________________________________________
+void AliPHOSRawStream::ApplyAltroMapping()
+{
+  // Take the DDL index, load
+  // the corresponding altro mapping
+  // object and fill the sector,row and pad indeces
+  fModule = fSegmentation[0];
+  fRow = fSegmentation[1];
+  fColumn = fSegmentation[2];
 }
index f4849074678e7a9aa62c33bd81dd6511d7e4c675..bdfcfac60f9e7af73eb20e39611b77f8f7178e29 100644 (file)
@@ -21,20 +21,34 @@ class AliRawReader;
 class AliPHOSRawStream: public AliAltroRawStream {
 
 public :
-  
   AliPHOSRawStream(AliRawReader* rawReader);
+  virtual ~AliPHOSRawStream();
+  virtual void             Reset();
+  virtual Bool_t           Next();
   
-  Int_t            GetColumn() const {return fPad;}
-  Int_t            GetModule() const {return fSector;}
-  Int_t            GetPrevColumn() const {return fPrevPad;}
-  Int_t            GetPrevModule() const {return fPrevSector;}
+  Int_t            GetColumn() const {return fColumn;}
+  Int_t            GetModule() const {return fModule;}
+  Int_t            GetPrevColumn() const {return fPrevColumn;}
+  Int_t            GetPrevModule() const {return fPrevModule;}
   Int_t            GetPrevRow() const {return fPrevRow;}
   Int_t            GetRow() const {return fRow;}
-  Int_t            GetSignal() const {return fSignal;}
-  Int_t            GetTime() const {return fTime;}
   Bool_t           IsNewColumn() const {return (GetColumn() != GetPrevColumn()) || IsNewRow();}
   Bool_t           IsNewModule() const {return GetModule() != GetPrevModule();}
   Bool_t           IsNewRow() const {return (GetRow() != GetPrevRow()) || IsNewModule();}
+
+protected:
+    AliPHOSRawStream(const AliPHOSRawStream& stream);
+    AliPHOSRawStream& operator = (const AliPHOSRawStream& stream);
+
+    virtual void ApplyAltroMapping();
+
+    Int_t            fModule;       // index of current module
+    Int_t            fPrevModule;   // index of previous module
+    Int_t            fRow;          // index of current row
+    Int_t            fPrevRow;      // index of previous row
+    Int_t            fColumn;       // index of current column
+    Int_t            fPrevColumn;   // index of previous column
   
   ClassDef(AliPHOSRawStream, 0)   // class for reading PHOS raw digits
     };