From 55a4253e40e7df755ebebd58a94216af1ddd6a00 Mon Sep 17 00:00:00 2001
From: Stefania Spagnolo <stefspa@cern.ch>
Date: Wed, 18 Jan 2012 22:50:06 +0100
Subject: [PATCH] update error enum (MuonByteStreamErrors-00-00-03)

---
 .../CscByteStreamErrorContainer.h             | 46 ++++++++++++
 .../MdtByteStreamErrorContainer.h             | 45 ++++++++++++
 .../MuonByteStreamErrorsDict.h                | 27 +++++++
 .../RpcByteStreamErrorContainer.h             | 73 +++++++++++++++++++
 .../TgcByteStreamErrorContainer.h             | 46 ++++++++++++
 .../MuonByteStreamErrors/selection.xml        | 13 ++++
 .../MuonByteStreamErrors/cmt/requirements     | 19 +++++
 .../src/CscByteStreamErrorContainer.cxx       | 36 +++++++++
 .../src/MdtByteStreamErrorContainer.cxx       | 36 +++++++++
 .../src/RpcByteStreamErrorContainer.cxx       | 68 +++++++++++++++++
 .../src/TgcByteStreamErrorContainer.cxx       | 36 +++++++++
 11 files changed, 445 insertions(+)
 create mode 100644 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/CscByteStreamErrorContainer.h
 create mode 100644 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MdtByteStreamErrorContainer.h
 create mode 100644 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MuonByteStreamErrorsDict.h
 create mode 100644 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/RpcByteStreamErrorContainer.h
 create mode 100644 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/TgcByteStreamErrorContainer.h
 create mode 100644 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/selection.xml
 create mode 100644 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/cmt/requirements
 create mode 100755 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/CscByteStreamErrorContainer.cxx
 create mode 100755 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/MdtByteStreamErrorContainer.cxx
 create mode 100755 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/RpcByteStreamErrorContainer.cxx
 create mode 100755 MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/TgcByteStreamErrorContainer.cxx

diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/CscByteStreamErrorContainer.h b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/CscByteStreamErrorContainer.h
new file mode 100644
index 00000000000..86272e02941
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/CscByteStreamErrorContainer.h
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/***************************************************************************
+ MuonByteStreamErrors package
+ CscByteStreamErrorContainer class
+ -----------------------------------------
+***************************************************************************/
+
+
+#ifndef MUONBYTESTREAMERRORS_CSCBYTESTREAMERRORCONTAINER_H
+#define MUONBYTESTREAMERRORS_CSCBYTESTREAMERRORCONTAINER_H
+
+
+#include "Identifier/IdentifierHash.h"
+#include "DataModel/DataVector.h"
+#include "CLIDSvc/CLASS_DEF.h"
+
+
+namespace Muon {
+  enum CscBSerrorTypes {    
+    //temporary implementation of errors enumeration
+    CSC_CSMHeaderErrors,
+    CSC_CSMSubHeaderErrors,
+    Csc_NUM_ERROR_TYPES  // always have this one last, so we can use it as a loop index
+  };
+
+  class CscByteStreamErrorContainer 
+  {
+  public: 
+    CscByteStreamErrorContainer();
+    CscByteStreamErrorContainer( DataVector<std::pair<IdentifierHash, int> > errorVector );
+    ~CscByteStreamErrorContainer();
+
+    void addError(IdentifierHash, int); 
+    const DataVector<std::pair<IdentifierHash, int> >& getAllErrors() const;
+  private:
+    DataVector<std::pair<IdentifierHash, int> > m_errorVector; 
+  };
+
+}
+
+CLASS_DEF( Muon::CscByteStreamErrorContainer , 1307307367  , 1 )
+#endif // MUONBYTESTREAMERRORS_CSCBYTESTREAMERRORCONTAINER_H
+
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MdtByteStreamErrorContainer.h b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MdtByteStreamErrorContainer.h
new file mode 100644
index 00000000000..7ab2d784284
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MdtByteStreamErrorContainer.h
@@ -0,0 +1,45 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/***************************************************************************
+ MuonByteStreamErrors package
+ MdtByteStreamErrorContainer class
+ -----------------------------------------
+ ***************************************************************************/
+
+
+#ifndef MUONBYTESTREAMERRORS_MDTBYTESTREAMERRORCONTAINER_H
+#define MUONBYTESTREAMERRORS_MDTBYTESTREAMERRORCONTAINER_H
+
+
+#include "Identifier/IdentifierHash.h"
+#include "DataModel/DataVector.h"
+#include "CLIDSvc/CLASS_DEF.h"
+
+
+namespace Muon {
+    enum MdtBSerrorTypes {    
+    CSMHeaderErrors,
+    CSMSubHeaderErrors,
+    Mdt_NUM_ERROR_TYPES  // always have this one last, so we can use it as a loop index
+  };
+
+  class MdtByteStreamErrorContainer 
+  {
+  public: 
+    MdtByteStreamErrorContainer();
+    MdtByteStreamErrorContainer( DataVector<std::pair<IdentifierHash, int> > errorVector );
+    ~MdtByteStreamErrorContainer();
+
+    void addError(IdentifierHash, int); 
+    const DataVector<std::pair<IdentifierHash, int> >& getAllErrors() const;
+  private:
+    DataVector<std::pair<IdentifierHash, int> > m_errorVector; 
+  };
+
+}
+
+CLASS_DEF( Muon::MdtByteStreamErrorContainer , 1143400055 , 1 )
+#endif // MUONBYTESTREAMERRORS_MDTBYTESTREAMERRORCONTAINER_H
+
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MuonByteStreamErrorsDict.h b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MuonByteStreamErrorsDict.h
new file mode 100644
index 00000000000..79f651afd35
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/MuonByteStreamErrorsDict.h
@@ -0,0 +1,27 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef MUONBYTESTREAMERRORS_MUONBYTESTREAMERRORCONTAINERDICT_H
+#define MUONBYTESTREAMERRORS_MUONBYTESTREAMERRORCONTAINERDICT_H 
+// containers
+#include "MuonByteStreamErrors/RpcByteStreamErrorContainer.h"
+#include "MuonByteStreamErrors/MdtByteStreamErrorContainer.h"
+#include "MuonByteStreamErrors/CscByteStreamErrorContainer.h"
+#include "MuonByteStreamErrors/TgcByteStreamErrorContainer.h"
+
+namespace MuonByteStreamErrorsDict 
+{
+  struct tmp 
+  {
+    std::pair <IdentifierHash, int> m_mypair;
+    std::vector <std::pair<IdentifierHash, int>* > m_myvector_ppair;
+    DataVector <std::pair <IdentifierHash, int> > m_mydatavector;
+  };
+  
+    
+  
+}
+
+
+#endif // MUONBYTESTREAMERRORS_MUONBYTESTREAMERRORCONTAINERDICT_H
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/RpcByteStreamErrorContainer.h b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/RpcByteStreamErrorContainer.h
new file mode 100644
index 00000000000..0ff27acf497
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/RpcByteStreamErrorContainer.h
@@ -0,0 +1,73 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/***************************************************************************
+ MuonByteStreamErrors package
+ RpcByteStreamErrorContainer class
+ -----------------------------------------
+ ***************************************************************************/
+
+
+#ifndef MUONBYTESTREAMERRORS_RPCBYTESTREAMERRORCONTAINER_H
+#define MUONBYTESTREAMERRORS_RPCBYTESTREAMERRORCONTAINER_H
+
+
+#include "Identifier/IdentifierHash.h"
+#include "DataModel/DataVector.h"
+#include "CLIDSvc/CLASS_DEF.h"
+
+
+namespace Muon {
+    enum RpcBSerrorTypes { 
+      NoError,
+      CMHeaderErrors,       // CM related error (from 0 to 8 in a pad)
+      CMSubHeaderErrors,    // CM related error 
+      CMFooterErrors,       // CM related error 
+      CRC8checkFailures,    // CM related error 
+      CMmissing,            // CM related error 
+      RXHeaderErrors,       // PAD related error (0 or 1 on a pad)
+      RXSubHeaderErrors,
+      PADHeaderErrors,
+      PADSubHeaderErrors,
+      PADPreFooterErrors,
+      PADFooterErrors,
+      PADmissing,
+      SLHeaderErrors,
+      SLSubHeaderErrors,
+      SLFooterErrors,
+      RXFooterErrors,
+      Rpc_NUM_ERROR_TYPES  // always have this one last, so we can use it as a loop index
+  };
+    // For a given pad (uniquely identified by an IdentifierHash: first item or key in the pair) the error code (second item in the pair) keep the whole 
+    // information on the errors met in the pad fragment decoding;
+    // 
+    // If there are CM errors in the pad, the error code is built as ValueCM=100+sum(value*10^cmid) over all cmids with errors; 
+    //         value in the range 1-5, i.e. CMHeaderErrors - CRC8checkFailures; 
+    // If there's a Pad error, the error code is set to ValuePad+ValueCM, with ValuePad in the range 5-Rpc_NUM_ERROR_TYPES-1
+ 
+  class RpcByteStreamErrorContainer 
+  {
+  public: 
+    typedef DataVector<std::pair<IdentifierHash, int> >::const_iterator rpcErrorIterator;
+
+    RpcByteStreamErrorContainer();
+    RpcByteStreamErrorContainer( DataVector<std::pair<IdentifierHash, int> > errorVector );
+    ~RpcByteStreamErrorContainer();
+
+    void clear(); 
+    void addError(IdentifierHash, int); 
+    int  getError(IdentifierHash)  const; 
+    std::vector<IdentifierHash> getPadsWithError() const; 
+
+    const DataVector<std::pair<IdentifierHash, int> >& getAllErrors() const;
+
+  private:
+    DataVector<std::pair<IdentifierHash, int> > m_errorVector; 
+  };
+
+}
+
+CLASS_DEF( Muon::RpcByteStreamErrorContainer , 1200798491 , 1 )
+#endif // MUONBYTESTREAMERRORS_RPCBYTESTREAMERRORCONTAINER_H
+
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/TgcByteStreamErrorContainer.h b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/TgcByteStreamErrorContainer.h
new file mode 100644
index 00000000000..30c7b093f2b
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/TgcByteStreamErrorContainer.h
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/***************************************************************************
+ MuonByteStreamErrors package
+ TgcByteStreamErrorContainer class
+ -----------------------------------------
+***************************************************************************/
+
+
+#ifndef MUONBYTESTREAMERRORS_TGCBYTESTREAMERRORCONTAINER_H
+#define MUONBYTESTREAMERRORS_TGCBYTESTREAMERRORCONTAINER_H
+
+
+#include "Identifier/IdentifierHash.h"
+#include "DataModel/DataVector.h"
+#include "CLIDSvc/CLASS_DEF.h"
+
+
+namespace Muon {
+  //temporary implementation of errors enumeration
+  enum TgcBSerrorTypes {    
+    TGC_CSMHeaderErrors,
+    TCG_CSMSubHeaderErrors,
+    Tgc_NUM_ERROR_TYPES  // always have this one last, so we can use it as a loop index
+  };
+
+  class TgcByteStreamErrorContainer 
+  {
+  public: 
+    TgcByteStreamErrorContainer();
+    TgcByteStreamErrorContainer( DataVector<std::pair<IdentifierHash, int> > errorVector );
+    ~TgcByteStreamErrorContainer();
+
+    void addError(IdentifierHash, int); 
+    const DataVector<std::pair<IdentifierHash, int> >& getAllErrors() const;
+  private:
+    DataVector<std::pair<IdentifierHash, int> > m_errorVector; 
+  };
+
+}
+
+CLASS_DEF( Muon::TgcByteStreamErrorContainer ,1299911504 , 1 )
+#endif // MUONBYTESTREAMERRORS_TGCBYTESTREAMERRORCONTAINER_H
+
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/selection.xml b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/selection.xml
new file mode 100644
index 00000000000..ae002c29e40
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/MuonByteStreamErrors/selection.xml
@@ -0,0 +1,13 @@
+<lcgdict>       
+
+  <!--# theses lines create duplicates in the overall Atlas dictionary  
+  <class name="std::pair < IdentifierHash, int >" /> 
+  <class name="DataVector<std::pair<IdentifierHash, int> >" />
+  <class name="std::vector<std::pair<IdentifierHash, int>* >"/>
+  -->
+  <class name="Muon::MdtByteStreamErrorContainer" />
+  <class name="Muon::RpcByteStreamErrorContainer" />
+  <class name="Muon::CscByteStreamErrorContainer" />
+  <class name="Muon::TgcByteStreamErrorContainer" />
+
+</lcgdict>
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/cmt/requirements b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/cmt/requirements
new file mode 100644
index 00000000000..f10286b63cc
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/cmt/requirements
@@ -0,0 +1,19 @@
+package MuonByteStreamErrors
+
+author stefania spagnolo <stefania.spagnolo@cern.ch>
+author nicola orlando    <nicola.orlando@cern.ch>
+
+public
+use AtlasPolicy          AtlasPolicy-*  
+use CLIDSvc              CLIDSvc-*                  Control
+use DataModel            DataModel-*                Control
+use Identifier           Identifier-*               DetectorDescription
+
+
+apply_pattern installed_library
+library MuonByteStreamErrors *.cxx
+
+private
+use AtlasReflex          AtlasReflex-*             External   	-no_auto_imports
+apply_pattern lcgdict dict=MuonByteStreamErrors selectionfile=selection.xml headerfiles="../MuonByteStreamErrors/MuonByteStreamErrorsDict.h"
+end_private 
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/CscByteStreamErrorContainer.cxx b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/CscByteStreamErrorContainer.cxx
new file mode 100755
index 00000000000..d4447cc9cc0
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/CscByteStreamErrorContainer.cxx
@@ -0,0 +1,36 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MuonByteStreamErrors/CscByteStreamErrorContainer.h"
+
+namespace Muon {
+    
+
+CscByteStreamErrorContainer::CscByteStreamErrorContainer( ) 
+{}
+
+CscByteStreamErrorContainer::CscByteStreamErrorContainer( DataVector< std::pair < IdentifierHash, int > > inputVector ) 
+    :
+    m_errorVector (inputVector) 
+{}
+
+CscByteStreamErrorContainer::~CscByteStreamErrorContainer( )
+{} 
+
+const DataVector<std::pair<IdentifierHash, int> >& 
+CscByteStreamErrorContainer::getAllErrors() const
+{
+  return m_errorVector;
+}
+
+void CscByteStreamErrorContainer::addError(IdentifierHash idh, int type)
+{
+
+   std::pair<IdentifierHash, int>* err = new std::pair<IdentifierHash, int>(std::make_pair(idh,type));
+   m_errorVector.push_back(err);
+
+}
+
+
+}
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/MdtByteStreamErrorContainer.cxx b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/MdtByteStreamErrorContainer.cxx
new file mode 100755
index 00000000000..b1b399c172d
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/MdtByteStreamErrorContainer.cxx
@@ -0,0 +1,36 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MuonByteStreamErrors/MdtByteStreamErrorContainer.h"
+
+namespace Muon {
+    
+
+MdtByteStreamErrorContainer::MdtByteStreamErrorContainer( ) 
+{}
+
+MdtByteStreamErrorContainer::MdtByteStreamErrorContainer( DataVector< std::pair < IdentifierHash, int > > inputVector ) 
+    :
+    m_errorVector (inputVector) 
+{}
+
+MdtByteStreamErrorContainer::~MdtByteStreamErrorContainer( )
+{} 
+
+const DataVector<std::pair<IdentifierHash, int> >& 
+MdtByteStreamErrorContainer::getAllErrors() const
+{
+  return m_errorVector;
+}
+
+void MdtByteStreamErrorContainer::addError(IdentifierHash idh, int type)
+{
+
+   std::pair<IdentifierHash, int>* err = new std::pair<IdentifierHash, int>(std::make_pair(idh,type));
+   m_errorVector.push_back(err);
+
+}
+
+
+}
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/RpcByteStreamErrorContainer.cxx b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/RpcByteStreamErrorContainer.cxx
new file mode 100755
index 00000000000..b7a5d10d1da
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/RpcByteStreamErrorContainer.cxx
@@ -0,0 +1,68 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MuonByteStreamErrors/RpcByteStreamErrorContainer.h"
+
+namespace Muon {
+    
+
+RpcByteStreamErrorContainer::RpcByteStreamErrorContainer( ) 
+{}
+
+RpcByteStreamErrorContainer::RpcByteStreamErrorContainer( DataVector< std::pair < IdentifierHash, int > > inputVector ) 
+    :
+    m_errorVector (inputVector) 
+{}
+
+RpcByteStreamErrorContainer::~RpcByteStreamErrorContainer( )
+{} 
+
+const DataVector<std::pair<IdentifierHash, int> >& 
+RpcByteStreamErrorContainer::getAllErrors() const
+{
+  return m_errorVector;
+}
+
+void RpcByteStreamErrorContainer::addError(IdentifierHash idh, int type)
+{
+
+   std::pair<IdentifierHash, int>* err = new std::pair<IdentifierHash, int>(std::make_pair(idh,type));
+   m_errorVector.push_back(err);
+
+}
+void RpcByteStreamErrorContainer::clear()
+{
+    if (m_errorVector.size()!=0) m_errorVector.clear();
+}
+int RpcByteStreamErrorContainer::getError(IdentifierHash idh) const
+{
+  int errorCode=-1;
+  if ( m_errorVector.size()==0) return errorCode;
+  rpcErrorIterator myIt  = m_errorVector.begin();
+  rpcErrorIterator myItE = m_errorVector.end();
+  for (;myIt!=myItE;++myIt)
+    {
+      IdentifierHash myPadId = (*myIt)->first;
+      if (myPadId==idh) errorCode= (*myIt)->second;
+      break;
+    }  
+  
+  return errorCode; 
+}
+
+std::vector<IdentifierHash> RpcByteStreamErrorContainer::getPadsWithError() const
+{
+  rpcErrorIterator myIt = m_errorVector.begin();
+  rpcErrorIterator myItE = m_errorVector.end();
+  std::vector<IdentifierHash> myList;
+  for (;myIt!=myItE;++myIt)
+    {
+      IdentifierHash myPadId = (*myIt)->first;
+      myList.push_back(myPadId);
+    }
+  return myList;
+}
+
+
+}
diff --git a/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/TgcByteStreamErrorContainer.cxx b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/TgcByteStreamErrorContainer.cxx
new file mode 100755
index 00000000000..2919b793a4d
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonByteStreamErrors/src/TgcByteStreamErrorContainer.cxx
@@ -0,0 +1,36 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MuonByteStreamErrors/TgcByteStreamErrorContainer.h"
+
+namespace Muon {
+    
+
+TgcByteStreamErrorContainer::TgcByteStreamErrorContainer( ) 
+{}
+
+TgcByteStreamErrorContainer::TgcByteStreamErrorContainer( DataVector< std::pair < IdentifierHash, int > > inputVector ) 
+    :
+    m_errorVector (inputVector) 
+{}
+
+TgcByteStreamErrorContainer::~TgcByteStreamErrorContainer( )
+{} 
+
+const DataVector<std::pair<IdentifierHash, int> >& 
+TgcByteStreamErrorContainer::getAllErrors() const
+{
+  return m_errorVector;
+}
+
+void TgcByteStreamErrorContainer::addError(IdentifierHash idh, int type)
+{
+
+   std::pair<IdentifierHash, int>* err = new std::pair<IdentifierHash, int>(std::make_pair(idh,type));
+   m_errorVector.push_back(err);
+
+}
+
+
+}
-- 
GitLab