]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
parity bit is introduced
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 Feb 2007 07:26:12 +0000 (07:26 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 Feb 2007 07:26:12 +0000 (07:26 +0000)
PMD/AliPMDDDLRawData.cxx
PMD/AliPMDDDLRawData.h
PMD/AliPMDRawStream.cxx
PMD/AliPMDRawStream.h
PMD/PMDrecLinkDef.h
PMD/libPMDrec.pkg

index 2a59aefe4bc43eb31177dddbfada6f1730e5b762..83fe31458928e045b0b8c426db3cd304e6c65e63 100644 (file)
@@ -359,6 +359,7 @@ void AliPMDDDLRawData::GetUMDigitsData(TTree *treeD, Int_t imodule,
   UInt_t mcmno, chno;
   UInt_t adc;
   Int_t  det, smn, irow, icol;
+  Int_t  parity;
 
   const Int_t kMaxBus = 50;
   Int_t totPatchBus, bPatchBus, ePatchBus;
@@ -483,7 +484,8 @@ void AliPMDDDLRawData::GetUMDigitsData(TTree *treeD, Int_t imodule,
       AliBitPacking::PackWord(chno,baseword,12,17);
       AliBitPacking::PackWord(mcmno,baseword,18,28);
       AliBitPacking::PackWord(0,baseword,29,30);
-      AliBitPacking::PackWord(1,baseword,31,31);
+      parity = ComputeParity(baseword);      // generate the parity bit
+      AliBitPacking::PackWord(parity,baseword,31,31);
 
       Int_t jj = contentsBus[busno];
       busPatch[busno][jj] = baseword;
@@ -676,3 +678,19 @@ void AliPMDDDLRawData::GetMCMCh(Int_t ddlno, Int_t row, Int_t col,
 }
 //____________________________________________________________________________
 
+Int_t AliPMDDDLRawData::ComputeParity(UInt_t baseword)
+{
+  // Generate the parity bit
+
+  Int_t count = 0;
+  for(Int_t j=0; j<29; j++)
+    {
+      if (baseword & 0x01 ) count++;
+      baseword >>= 1;
+    }
+  Int_t parity = count%2;
+  return parity;
+}
+
+//____________________________________________________________________________
+
index 1cf705ded1551f1c9ce2b895791d2ea0e4819e0f..f6c651bf4ada514fde8b8d35b43540d52356152b 100644 (file)
@@ -38,12 +38,14 @@ class AliPMDDDLRawData:public TObject
                Int_t *endRowBus, Int_t *endColBus,
                Int_t & busno, UInt_t &mcmno, UInt_t &chno);
 
+
  protected:
 
+  Int_t ComputeParity(UInt_t baseword);
+
   TClonesArray *fDigits;    //! List of digits
-  //  AliPMDdigit  *fPMDdigit;  //! Pointer to digits
 
-  ClassDef(AliPMDDDLRawData,6)    // To make RAW Data
+  ClassDef(AliPMDDDLRawData,7)    // To make RAW Data
 };
 #endif
 
index d8db2b1e1446e993c08e86333f3690ab98c87880..e53298b1bc1ea032c5d5b5af6eb8dd262a4445d0 100644 (file)
@@ -92,7 +92,6 @@ Bool_t AliPMDRawStream::DdlData(Int_t indexDDL, TObjArray *pmdddlcont)
   Int_t  iddl  = fRawReader->GetDDLID();
   Int_t dataSize = fRawReader->GetDataSize();
   Int_t totaldataword = dataSize/4;
-  Int_t equipId = fRawReader->GetEquipmentId();
 
   if (dataSize <= 0) return kFALSE;
   if (indexDDL != iddl)
@@ -203,7 +202,7 @@ Bool_t AliPMDRawStream::DdlData(Int_t indexDDL, TObjArray *pmdddlcont)
   const Int_t kdspHLen  = dspHeader.GetHeaderLength();
   const Int_t kpbusHLen = pbusHeader.GetHeaderLength();
   
-
+  Int_t parity;
   Int_t idet, ismn;
   Int_t irow = -1;
   Int_t icol = -1;
@@ -277,6 +276,11 @@ Bool_t AliPMDRawStream::DdlData(Int_t indexDDL, TObjArray *pmdddlcont)
                  Int_t imcm = (data >> 18) & 0x07FF;
                  Int_t ibit = (data >> 31) & 0x0001;
 
+                 parity = ComputeParity(data);
+                 if (ibit != parity)
+                   {
+                     AliWarning("ComputeParity:: Parity Error");
+                   }
                  GetRowCol(iddl, pbusid, imcm, ich, 
                            startRowBus, endRowBus,
                            startColBus, endColBus,
@@ -498,4 +502,23 @@ void AliPMDRawStream::TransformH2S(Int_t smn, Int_t &row, Int_t &col) const
   row = irownew;
   col = icolnew;
 }
+
+//_____________________________________________________________________________
+
+int AliPMDRawStream::ComputeParity(Int_t data)
+{
+// Calculate the parity bit
+
+  Int_t count = 0;
+  for(Int_t j = 0; j<29; j++)
+    {
+      if (data & 0x01 ) count++;
+      data >>= 1;
+    }
+  
+  Int_t parity = count%2;
+
+  return parity;
+}
+
 //_____________________________________________________________________________
index 38aea85b166e5d310f0b3169a31699cf3d352206..0bb5b0b6a7506a6255cc34d7d8b54a2b6c3f346b 100644 (file)
@@ -37,6 +37,7 @@ class AliPMDRawStream: public TObject {
     void             ConvertDDL2SMN(Int_t iddl, Int_t imodule,
                                    Int_t &smn, Int_t &detector) const;
     void             TransformH2S(Int_t smn, Int_t &row, Int_t &col) const;
+    int              ComputeParity(Int_t data);
 
     AliRawReader*    fRawReader;    // object for reading the raw data
 
index b49aa7d5878d847355152994c9aa5c862e122d39..4c2189913c15bb1cdea0f3ee739328d60e505d47 100644 (file)
@@ -17,6 +17,7 @@
 #pragma link C++ class  AliPMDClusteringV1+;
 #pragma link C++ class  AliPMDClusteringV2+;
 #pragma link C++ class  AliPMDclupid+;
+#pragma link C++ class  AliPMDcludata+;
 #pragma link C++ class  AliPMDDiscriminator+;
 #pragma link C++ class  AliPMDEmpDiscriminator+;
 #pragma link C++ class  AliPMDClusterFinder+;
index ac6d80612d61f4633a21bdbb56443d153b97d3ff..5ee6713335783d5d6543876f4887ab1445da9a66 100644 (file)
@@ -1,9 +1,9 @@
 #-*- Mode: Makefile -*-
 # $Id$
 
-SRCS:= AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx
+SRCS:= AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx AliPMDcludata.cxx
 
-HDRS:= $(SRCS:.cxx=.h) AliPMDClustering.h AliPMDDiscriminator.h
+HDRS:= $(SRCS:.cxx=.h) AliPMDClustering.h AliPMDDiscriminator.h AliPMDcludata.h
 
 DHDR:=PMDrecLinkDef.h