/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Detectors.h
Go to the documentation of this file.
00001 /* Detectors - succinct representation of the detectors
00002  *
00003  * 2008/3/11 bv@bnl.gov
00004  */
00005 
00006 #ifndef DETECTORS_H
00007 #define DETECTORS_H
00008 
00009 #include "Conventions/DetectorId.h"
00010 #include "Conventions/Site.h"
00011 
00012 #include <string>
00013 #include <ostream>
00014 
00015 namespace DayaBay {
00016 
00018     class Detector {
00019     public:
00021         Detector(Site::Site_t site,
00022                  DetectorId::DetectorId_t det);
00023 
00025         Detector(const Detector& det) { m_data = det.m_data; }
00026 
00028         Detector(int fullPackedData);
00029 
00031         Detector(short int sitedet);
00032 
00034         Detector(std::string name) { m_data = (Detector::siteDetPackedFromString(name) << 16); }
00035 
00037         Detector();
00038 
00040         static Detector from_short(short int sitedet);
00041 
00042         virtual ~Detector();
00043 
00044         // Assignment Operator
00045         Detector& operator=(const Detector& det)
00046           { m_data = det.m_data; return *this; }
00047 
00049         void set(Site::Site_t site, DetectorId::DetectorId_t det);
00050 
00052         std::string asString() const;
00053 
00055         std::string detName() const;
00056 
00058         DetectorId::DetectorId_t detectorId() const;
00059 
00061         Site::Site_t site() const;
00062 
00066         int fullPackedData() const;
00067 
00069         short int siteDetPackedData() const;
00070 
00071         static short int siteDetPackedFromString(const std::string str);
00072 
00074         bool isAD() const { return DetectorId::isAD(this->detectorId()); }
00075 
00077         bool isWaterShield() const { return DetectorId::isWaterShield(this->detectorId()); }
00078 
00080         bool isRPC() const { return DetectorId::isRPC(this->detectorId()); }
00081 
00085         virtual bool bogus() const;
00086 
00087         bool operator==(const Detector& rhs) const { return this->m_data == rhs.m_data; }
00088         bool operator!=(const Detector& rhs) const { return !(*this == rhs); }
00089 
00090     protected:
00091         unsigned int m_data;
00092     };
00093 
00095     class DetectorSensor : public Detector {
00096     public:
00097         DetectorSensor() : Detector(0) {}
00098         DetectorSensor(unsigned int sensor_id,
00099                        Site::Site_t site,
00100                        DetectorId::DetectorId_t det);
00101         DetectorSensor(const DetectorSensor& sensor) : Detector(sensor) {}
00102         DetectorSensor(int data) : Detector(data) {}
00103         virtual ~DetectorSensor();
00104         // Assignment Operator
00105         DetectorSensor& operator=(const DetectorSensor& sensor)
00106           { m_data = sensor.m_data; return *this; }
00107 
00109         int sensorId() const;
00110 
00112         virtual bool bogus() const;
00113 
00114     };
00115 
00121     class AdPmtSensor : public DetectorSensor {
00122     public:
00123         AdPmtSensor() : DetectorSensor(0) {}
00124         AdPmtSensor(int ring, int column,
00125                     Site::Site_t site, DetectorId::DetectorId_t detid);
00126         AdPmtSensor(int ring, int column,
00127                     Site::Site_t site, int ad_number);
00128         AdPmtSensor(const AdPmtSensor& sensor) : DetectorSensor(sensor) {}
00129         AdPmtSensor(int data) : DetectorSensor(data) {}
00130         virtual ~AdPmtSensor();
00131         // Assignment Operator
00132         AdPmtSensor& operator=(const AdPmtSensor& sensor)
00133           { m_data = sensor.m_data; return *this; }
00134 
00136         int ring() const;
00137 
00139         int column() const;
00140 
00142         bool baseBogus() const;
00143 
00147         virtual bool bogus() const;
00148 
00150         bool is2inch() const;
00151 
00153         bool is8inch() const;
00154 
00158         bool isRefSig() const;
00159     };
00160 
00165     class AdFadcSensor : public DetectorSensor {
00166     public:
00167         AdFadcSensor() : DetectorSensor(0) {}
00168         AdFadcSensor(int ring, int column, 
00169                            Site::Site_t site, DetectorId::DetectorId_t detid);
00170         AdFadcSensor(int ring, int column,
00171                            Site::Site_t site, int ad_number);
00172         AdFadcSensor(int /* ring */, const AdFadcSensor& sensor) : DetectorSensor(sensor) {}
00173         AdFadcSensor(int data) : DetectorSensor(data) {}
00174         virtual ~AdFadcSensor();
00175 
00176         int channel() const;
00177 
00178         // Assignment Operator
00179         AdFadcSensor& operator=(const AdFadcSensor& sensor)
00180           { m_data = sensor.m_data; return *this; }
00181 
00185         virtual bool bogus() const;
00186     };
00187 
00200     class PoolPmtSensor : public DetectorSensor {
00201     public:
00202         PoolPmtSensor() : DetectorSensor(0) {}
00203         PoolPmtSensor(int wall_number, int wall_spot, bool inward_facing,
00204                       Site::Site_t site, DetectorId::DetectorId_t detid);
00205         PoolPmtSensor(const PoolPmtSensor& sensor) : DetectorSensor(sensor) {}
00206         PoolPmtSensor(int data) : DetectorSensor(data) {}
00207         virtual ~PoolPmtSensor();
00208         // Assignment Operator
00209         PoolPmtSensor& operator=(const PoolPmtSensor& sensor)
00210           { m_data = sensor.m_data; return *this; }
00211 
00212         int wallNumber() const;
00213         int wallSpot() const;
00214         bool inwardFacing() const;
00215 
00217         virtual bool bogus() const;
00218     };
00219 
00255     class RpcSensor : public DetectorSensor {
00256     public:
00257         RpcSensor() : DetectorSensor(0) {}
00258         RpcSensor(int panelRow, int panelColumn, int layer, int strip,
00259                   Site::Site_t site, DetectorId::DetectorId_t detid);
00260         RpcSensor(const RpcSensor& sensor) : DetectorSensor(sensor) {}
00261         RpcSensor(int data) : DetectorSensor(data) {}
00262         virtual ~RpcSensor();
00263         // Assignment Operator
00264         RpcSensor& operator=(const RpcSensor& sensor)
00265           { m_data = sensor.m_data; return *this; }
00266 
00268         RpcSensor panel() const;
00269 
00270         int panelRow() const;
00271         int panelColumn() const;
00272         int layer() const;
00273         int strip() const;
00274 
00276         virtual bool bogus() const;
00277     };
00278 
00279 
00280 
00281     std::ostream& operator<<(std::ostream& str, const DayaBay::Detector& det);
00282     std::ostream& operator<<(std::ostream& str, const DayaBay::DetectorSensor& detsens);
00283     std::ostream& operator<<(std::ostream& str, const DayaBay::AdPmtSensor& adsens);
00284     std::ostream& operator<<(std::ostream& str, const DayaBay::AdFadcSensor& adsens);
00285     std::ostream& operator<<(std::ostream& str, const DayaBay::PoolPmtSensor& adsens);
00286     std::ostream& operator<<(std::ostream& str, const DayaBay::RpcSensor& rpcsens);
00287 
00288     bool operator<(const DayaBay::Detector& a, const DayaBay::Detector& b);
00289 
00290 
00291 }      // namespace DayaBay
00292 #endif  // DETECTORS_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:19 for Conventions by doxygen 1.7.4