00001
00002 #ifndef __TKRBADSTRIPSSVC_H
00003 #define __TKRBADSTRIPSSVC_H 1
00004
00005 #include "GaudiKernel/Service.h"
00006
00007 #include "TkrRecon/ITkrBadStripsSvc.h"
00008 #include "TkrRecon/TkrAxis.h"
00009 #include "TkrRecon/ITkrGeometrySvc.h"
00010
00011 #include <string>
00012 #include <vector>
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 class TkrBadStripsSvc : public Service,
00023 virtual public ITkrBadStripsSvc
00024 {
00025 public:
00026
00028 TkrBadStripsSvc(const std::string& name, ISvcLocator* pSvcLocator);
00029 virtual ~TkrBadStripsSvc() {}
00030
00031 StatusCode initialize();
00032 StatusCode finalize();
00033 int getIndex(const int tower, const int layer, const TkrAxis::axis);
00034 v_strips* getBadStrips(const int tower, const int layer, const TkrAxis::axis);
00035 v_strips* getBadStrips(const int index);
00036 bool isBadStrip(const int tower, const int layer, const TkrAxis::axis, const int strip);
00037 bool isBadStrip(const v_strips* v, const int strip);
00038 bool isTaggedBad(const int taggedStrip);
00039 int tagBad(const int strip);
00040 int tagGood(const int strip);
00041 int untag(const int strip);
00042
00044 StatusCode queryInterface(const IID& riid, void** ppvUnknown);
00045
00046 static const InterfaceID& interfaceID() { return ITkrBadStripsSvc::interfaceID(); }
00047
00049 const IID& type() const;
00050
00051 private:
00052
00053
00054 void readFromFile(std::ifstream* file);
00055 void addStrip(v_strips* v, const int strip);
00056
00057 ITkrGeometrySvc* pTkrGeom;
00058
00059 std::string m_badStripsFile;
00060
00061 int m_ntowers;
00062 int m_nlayers;
00063 int m_nviews;
00064
00065
00066
00067 v_strips m_stripsCol[576];
00068 };
00069
00070
00071 #endif