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

In This Package:

Public Member Functions | Static Public Member Functions | Protected Attributes
DayaBay::RpcSensor Class Reference

Uniquely identify an RPC strip in the RPC detector. More...

#include <Detectors.h>

Inheritance diagram for DayaBay::RpcSensor:
Inheritance graph
[legend]
Collaboration diagram for DayaBay::RpcSensor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RpcSensor ()
 RpcSensor (int panelRow, int panelColumn, int layer, int strip, Site::Site_t site, DetectorId::DetectorId_t detid)
 RpcSensor (const RpcSensor &sensor)
 RpcSensor (int data)
virtual ~RpcSensor ()
RpcSensoroperator= (const RpcSensor &sensor)
RpcSensor panel () const
 Returns representation of panel to which this sensor belongs to.
int panelRow () const
int panelColumn () const
int layer () const
int strip () const
virtual bool bogus () const
 Check for bogosity.
int sensorId () const
 Return the sensor ID number.
void set (Site::Site_t site, DetectorId::DetectorId_t det)
 Set values after construction.
std::string asString () const
 Return string representation of the data.
std::string detName () const
 Return the detector name = SiteDetectorId (eg. NearAD1, FarIWS).
DetectorId::DetectorId_t detectorId () const
 Return the detector ID.
Site::Site_t site () const
 Return the site.
int fullPackedData () const
 Return the full, raw packed integer.
short int siteDetPackedData () const
 Return the part of the packing just for the site+detector part.
bool isAD () const
 Is this an AD?
bool isWaterShield () const
 Is this a Water Shield (Inner or Outer)?
bool isRPC () const
 Is this an RPC?
bool operator== (const Detector &rhs) const
bool operator!= (const Detector &rhs) const

Static Public Member Functions

static Detector from_short (short int sitedet)
 Return a detector built from a short int.
static short int siteDetPackedFromString (const std::string str)

Protected Attributes

unsigned int m_data

Detailed Description

Uniquely identify an RPC strip in the RPC detector.

Besides Site and Detector ID, RPC strips are characterized as follows:

Panels are arranged in a grid of 6 x 9 (Near site) and 9 x 9 (Far site).

Panel column: counts 1 to 9 starting from the edge of the RPC further from the hall entrance (DayaBay site).

Panel row: counts 1 to 6 (Near site) or 1 to 9 (Far site). Numbering starts on the left when looking at the RPC from above. See the diagram below.

Hall Entrance (this side)

Row: 6 5 4 3 2 1 --------------------------------------- | | | | | | | Col: | | | | | | | 9 | | | | | | | --------------------------------------- | | | | | | | Looking at | | | | | | | 8 Near site RPC | | | | | | | from above. --------------------------------------- | | | | | | |

Layer: counts 1 to 4 from the bottom layer of the RPC.

Strip: counts 1 to 8 in the same direction as either the row or column number, depending on the orientation of the strips.

Definition at line 255 of file Detectors.h.


Constructor & Destructor Documentation

DayaBay::RpcSensor::RpcSensor ( ) [inline]

Definition at line 257 of file Detectors.h.

DayaBay::RpcSensor::RpcSensor ( int  panelRow,
int  panelColumn,
int  layer,
int  strip,
Site::Site_t  site,
DetectorId::DetectorId_t  detid 
)

Definition at line 375 of file Detectors.cc.

  : DetectorSensor((panelRow<<12)|(panelColumn<<8)|(layer<<4)|strip,site,detid)
{
}
DayaBay::RpcSensor::RpcSensor ( const RpcSensor sensor) [inline]

Definition at line 260 of file Detectors.h.

: DetectorSensor(sensor) {}
DayaBay::RpcSensor::RpcSensor ( int  data) [inline]

Definition at line 261 of file Detectors.h.

: DetectorSensor(data) {}
DayaBay::RpcSensor::~RpcSensor ( ) [virtual]

Definition at line 383 of file Detectors.cc.

{
}

Member Function Documentation

RpcSensor& DayaBay::RpcSensor::operator= ( const RpcSensor sensor) [inline]

Definition at line 264 of file Detectors.h.

          { m_data = sensor.m_data; return *this; }
DayaBay::RpcSensor DayaBay::RpcSensor::panel ( ) const

Returns representation of panel to which this sensor belongs to.

Definition at line 387 of file Detectors.cc.

{
    return RpcSensor(m_data & 0xffffff00);
}
int DayaBay::RpcSensor::panelRow ( ) const

Definition at line 392 of file Detectors.cc.

{
    return (this->sensorId()&0x0000f000)>>12;
}
int DayaBay::RpcSensor::panelColumn ( ) const

Definition at line 397 of file Detectors.cc.

{
    return (this->sensorId()&0x00000f00)>>8;
}
int DayaBay::RpcSensor::layer ( ) const

Definition at line 402 of file Detectors.cc.

{
    return (this->sensorId()&0x000000f0)>>4;
}
int DayaBay::RpcSensor::strip ( ) const

Definition at line 407 of file Detectors.cc.

{
    return this->sensorId()&0x0000000f;
}
bool DayaBay::RpcSensor::bogus ( ) const [virtual]

Check for bogosity.

Reimplemented from DayaBay::DetectorSensor.

Definition at line 428 of file Detectors.cc.

{
    if (this->Detector::bogus()) return true;
    if (detectorId() != DetectorId::kRPC) {
        return true;
    }

    Site::Site_t siteid = site();
    int row = panelRow();
    int col = panelColumn();
    // deal with telescopes first
    if (row==0 && col==5) // telescope
      return false;
    if (siteid == Site::kFar) {
      if (row==10 && col==5) // far site telescope
        return false;
    }
    else if (row==7 && col==5) // near site telescope
      return false;

    if (!(row && col)) // numbering convention forbids row or column to be zero
        return true;

    if (siteid == Site::kFar && row > 9) // too many rows
        return true;

    if (siteid == Site::kDayaBay && row > 6) // too many rows
        return true;

    if (siteid == Site::kLingAo && row > 6) // too many rows
        return true;

    if (col > 9) // too many columns
        return true;

    // FIXME: add checks for layer and strip

    return false;
}
int DayaBay::DetectorSensor::sensorId ( ) const [inherited]

Return the sensor ID number.

Definition at line 169 of file Detectors.cc.

{
    return m_data&0x0000ffff;
}
DayaBay::Detector DayaBay::Detector::from_short ( short int  sitedet) [static, inherited]

Return a detector built from a short int.

Definition at line 39 of file Detectors.cc.

{
    return Detector(sitedet); 
}
void DayaBay::Detector::set ( Site::Site_t  site,
DetectorId::DetectorId_t  det 
) [inherited]

Set values after construction.

Definition at line 65 of file Detectors.cc.

{
    m_data = (site << 24) | (det << 16);
}
std::string DayaBay::Detector::asString ( ) const [inherited]

Return string representation of the data.

Definition at line 71 of file Detectors.cc.

{
    std::stringstream ss;
    ss << *this;
    return ss.str();
}
std::string DayaBay::Detector::detName ( ) const [inherited]

Return the detector name = SiteDetectorId (eg. NearAD1, FarIWS).

Definition at line 78 of file Detectors.cc.

{
    std::string ret = Site::AsString(site());
    ret += DetectorId::AsString(detectorId());

    return ret;
}
DetectorId::DetectorId_t DayaBay::Detector::detectorId ( ) const [inherited]

Return the detector ID.

Definition at line 86 of file Detectors.cc.

{
    return (DetectorId::DetectorId_t)((m_data&0x00ff0000)>>16);
}
Site::Site_t DayaBay::Detector::site ( ) const [inherited]

Return the site.

Definition at line 91 of file Detectors.cc.

{
    return (Site::Site_t)((m_data&0xff000000)>>24);
}
int DayaBay::Detector::fullPackedData ( ) const [inherited]

Return the full, raw packed integer.

If created by subclass, this may include values in the lower two detector sensor bytes.

Definition at line 96 of file Detectors.cc.

{
    return m_data;
}
short int DayaBay::Detector::siteDetPackedData ( ) const [inherited]

Return the part of the packing just for the site+detector part.

Definition at line 101 of file Detectors.cc.

{
    return (short int)(m_data>>16);
}
short int DayaBay::Detector::siteDetPackedFromString ( const std::string  str) [static, inherited]

Definition at line 115 of file Detectors.cc.

                                                                     {
  DetectorId::DetectorId_t detId = DetectorId::FromString("Unknown");
  Site::Site_t site = Site::FromString("Unknown");

  //find site

  if (str.find("DayaBay")!=std::string::npos) site=Site::FromString("DayaBay");
  if (str.find("LingAo")!=std::string::npos) site=Site::FromString("LingAo");
  if (str.find("Mid")!=std::string::npos) site=Site::FromString("Mid");
  if (str.find("Far")!=std::string::npos) site=Site::FromString("Far");
  if (str.find("Aberdeen")!=std::string::npos) site=Site::FromString("Aberdeen");
  if (str.find("SAB")!=std::string::npos) site=Site::FromString("SAB");

  //find detector

  if (str.find("AD1")!=std::string::npos) detId=DetectorId::FromString("AD1");
  if (str.find("AD2")!=std::string::npos) detId=DetectorId::FromString("AD2");
  if (str.find("AD3")!=std::string::npos) detId=DetectorId::FromString("AD3");
  if (str.find("AD4")!=std::string::npos) detId=DetectorId::FromString("AD4");
  if (str.find("IWS")!=std::string::npos) detId=DetectorId::FromString("IWS");
  if (str.find("OWS")!=std::string::npos) detId=DetectorId::FromString("OWS");
  if (str.find("RPC")!=std::string::npos) detId=DetectorId::FromString("RPC");

  return DayaBay::Detector(site,detId).siteDetPackedData();
}
bool DayaBay::Detector::isAD ( ) const [inline, inherited]

Is this an AD?

Definition at line 74 of file Detectors.h.

{ return DetectorId::isAD(this->detectorId()); }
bool DayaBay::Detector::isWaterShield ( ) const [inline, inherited]

Is this a Water Shield (Inner or Outer)?

Definition at line 77 of file Detectors.h.

bool DayaBay::Detector::isRPC ( ) const [inline, inherited]

Is this an RPC?

Definition at line 80 of file Detectors.h.

{ return DetectorId::isRPC(this->detectorId()); }
bool DayaBay::Detector::operator== ( const Detector rhs) const [inline, inherited]

Definition at line 87 of file Detectors.h.

{ return this->m_data == rhs.m_data; }
bool DayaBay::Detector::operator!= ( const Detector rhs) const [inline, inherited]

Definition at line 88 of file Detectors.h.

{ return !(*this == rhs); }

Member Data Documentation

unsigned int DayaBay::Detector::m_data [protected, inherited]

Definition at line 91 of file Detectors.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

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