PlexPixelSpotId Class Reference

#include <PlexPixelSpotId.h>

Inheritance diagram for PlexPixelSpotId:
PlexMuxBoxId

List of all members.

Public Member Functions

 PlexPixelSpotId ()
 PlexPixelSpotId (Detector::Detector_t detector, ElecType::Elec_t electronics, Char_t eastwest, Char_t racklevel, UInt_t rackbay, UInt_t inrack, UInt_t tube, UInt_t pixel, UInt_t spot)
 PlexPixelSpotId (PlexMuxBoxId muxbox, UInt_t tube, UInt_t pixel, UInt_t spot)
virtual ~PlexPixelSpotId ()
 PlexPixelSpotId (const UInt_t encoded)
UInt_t GetEncoded () const
const char * AsString (Option_t *option="") const
UShort_t GetTube () const
UShort_t GetPixel () const
UShort_t GetSpot () const
Bool_t IsValid () const
UInt_t GetUniquePmtEncodedValue () const
UInt_t GetUniquePixelEncodedValue () const
void Print (Option_t *option="") const
void SetTube (UInt_t tube)
void SetPixel (UInt_t pixel)
void SetSpot (UInt_t spot)
Bool_t IsSamePixel (const PlexPixelSpotId &other) const
Bool_t IsSameTube (const PlexPixelSpotId &other) const

Friends

Bool_t operator< (const PlexPixelSpotId &lhs, const PlexPixelSpotId &rhs)
Bool_t operator<= (const PlexPixelSpotId &lhs, const PlexPixelSpotId &rhs)
Bool_t operator== (const PlexPixelSpotId &lhs, const PlexPixelSpotId &rhs)
Bool_t operator!= (const PlexPixelSpotId &lhs, const PlexPixelSpotId &rhs)
Bool_t operator> (const PlexPixelSpotId &lhs, const PlexPixelSpotId &rhs)
Bool_t operator>= (const PlexPixelSpotId &lhs, const PlexPixelSpotId &rhs)

Detailed Description

Definition at line 24 of file PlexPixelSpotId.h.


Constructor & Destructor Documentation

PlexPixelSpotId::PlexPixelSpotId (  ) 

Definition at line 34 of file PlexPixelSpotId.cxx.

00035    : PlexMuxBoxId()
00036 {
00037    // Default ctor constructs meaningless value
00038 }

PlexPixelSpotId::PlexPixelSpotId ( Detector::Detector_t  detector,
ElecType::Elec_t  electronics,
Char_t  eastwest,
Char_t  racklevel,
UInt_t  rackbay,
UInt_t  inrack,
UInt_t  tube,
UInt_t  pixel,
UInt_t  spot 
)

Definition at line 41 of file PlexPixelSpotId.cxx.

References SetPixel(), SetSpot(), and SetTube().

00046   : PlexMuxBoxId(detector,elec,eastwest,racklevel,rackbay,inrack)
00047 {
00048    // Normal ctor
00049 
00050    SetTube(tube);
00051    SetPixel(pixel);
00052    SetSpot(spot);
00053 }

PlexPixelSpotId::PlexPixelSpotId ( PlexMuxBoxId  muxbox,
UInt_t  tube,
UInt_t  pixel,
UInt_t  spot 
)

Definition at line 56 of file PlexPixelSpotId.cxx.

References SetPixel(), SetSpot(), and SetTube().

00058   : PlexMuxBoxId(muxbox)
00059 {
00060    // Normal ctor
00061 
00062    SetTube(tube);
00063    SetPixel(pixel);
00064    SetSpot(spot);
00065 }

PlexPixelSpotId::~PlexPixelSpotId (  )  [virtual]

Definition at line 75 of file PlexPixelSpotId.cxx.

00076 {
00077    // delete all the owned sub-objects
00078 }

PlexPixelSpotId::PlexPixelSpotId ( const UInt_t  encoded  )  [explicit]

Definition at line 68 of file PlexPixelSpotId.cxx.

00069    : PlexMuxBoxId(encoded)
00070 {
00071    // constructor from pre-encoded value
00072 }


Member Function Documentation

const char * PlexPixelSpotId::AsString ( Option_t *  option = ""  )  const [virtual]

Reimplemented from PlexMuxBoxId.

Definition at line 81 of file PlexPixelSpotId.cxx.

References GetPixel(), GetSpot(), and GetTube().

Referenced by SimPmtTimeBucket::AddDigiPE(), RerootFlsDigitToDigiPE::AddPE(), DigitText::AddPixelSpotIdText(), SimDigit::AsString(), Plexus::BuildPixelMaps(), PhotonStatSummarizer::ComputePmtDrifts(), draw(), FitNdNonlinQuad(), LightInjector::Get(), PmtDriftCalScheme::GetDrift(), SimPmt::GetGainAndWidth(), LISummarySorter::GetMuxBoxInfo(), SimPmtUTM16::InitSECValues(), operator<<(), PlotPmt(), pmt_plot(), SimPmtUTM16::Print(), TridModelPixel::Print(), Print(), SimPmtM16::Print(), PlexSEIdAltLItem::Print(), TridModelPmt::Print(), PmtDrift::Print(), SimPmtM64::Print(), SimVaElectronics::ReadoutPmt(), SimQieElectronics::ReadoutPmt(), SimVaTimedElectronics::ReadoutPmt(), SimPmt::Reset(), SimDetector::SimulatePmts(), and SimDetector::SortDigiPE().

00082 {
00083    // Return unpacked PlexPixelSpotId as a string
00084    // User should copy result because it points to a 
00085    // statically allocated string.
00086    // Internally uses a circular list of buffers to avoid problems
00087    // using AsString multiple times in a cout-like situation.
00088 
00089    const int nbuffers = 8;  // use a circular list of strings
00090    static char newstring[nbuffers][64];
00091    static int ibuffer = nbuffers;
00092    ibuffer = (ibuffer+1)%nbuffers;  // each time move to next buffer
00093 
00094    string opt = option;
00095    bool extended   = (opt.find("e") != string::npos);
00096    bool pixel_only = (opt.find("p") != string::npos);
00097    bool tube_only =  (opt.find("t") != string::npos);
00098 
00099    const char*   pfmt = "%s-PIXEL-%1.1d-%2.2d";
00100    const char*   tfmt = "%s-TUBE-%1.1d";
00101    const char*   efmt = "%s-SPOT-%1.1d-%2.2d-%2.2d";
00102    if (extended) efmt = "%s-SPOT-tube %1.1d pixel %2.2d spot %2.2d";
00103 
00104    const char* muxAsString = PlexMuxBoxId::AsString(option);
00105 
00106    if (pixel_only)    sprintf(newstring[ibuffer],pfmt,
00107                               muxAsString,GetTube(),GetPixel());
00108    else if(tube_only) sprintf(newstring[ibuffer],tfmt,
00109                               muxAsString,GetTube());
00110    else               sprintf(newstring[ibuffer],efmt,
00111                               muxAsString,GetTube(),GetPixel(),GetSpot());
00112    
00113    return newstring[ibuffer];
00114 }

UInt_t PlexPixelSpotId::GetEncoded (  )  const [inline]
UShort_t PlexPixelSpotId::GetPixel (  )  const [inline]
UShort_t PlexPixelSpotId::GetSpot (  )  const [inline]
UShort_t PlexPixelSpotId::GetTube (  )  const [inline]
UInt_t PlexPixelSpotId::GetUniquePixelEncodedValue (  )  const [inline]

Definition at line 211 of file PlexPixelSpotId.h.

References PlexMuxBoxId::fEncoded, and maskPlexSpotSpot.

Referenced by PhotonTransport::SimulateScintHit().

00212 {
00213   // uncompatified, but unique for a PMT independent of spot
00214   return fEncoded | maskPlexSpotSpot;
00215 }

UInt_t PlexPixelSpotId::GetUniquePmtEncodedValue (  )  const [inline]
Bool_t PlexPixelSpotId::IsSamePixel ( const PlexPixelSpotId other  )  const [inline]

Definition at line 145 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2(), PlexMuxBoxId::fEncoded, and zeroPlexSpotSpot.

Referenced by TridModelPixel::ShouldContain().

00146 { ConvertToVersion2(); other.ConvertToVersion2();
00147   return (fEncoded&zeroPlexSpotSpot) == (other.fEncoded&zeroPlexSpotSpot); }

Bool_t PlexPixelSpotId::IsSameTube ( const PlexPixelSpotId other  )  const [inline]

Definition at line 151 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2(), PlexMuxBoxId::fEncoded, and zeroPlexSpotPixelSpot.

Referenced by Anp::Pmt::IsSamePmt(), and TridModelPmt::ShouldContain().

00152 { ConvertToVersion2(); other.ConvertToVersion2();
00153   return (fEncoded&zeroPlexSpotPixelSpot) == 
00154          (other.fEncoded&zeroPlexSpotPixelSpot); }

Bool_t PlexPixelSpotId::IsValid (  )  const [inline]
void PlexPixelSpotId::Print ( Option_t *  option = ""  )  const

Reimplemented from PlexMuxBoxId.

Definition at line 117 of file PlexPixelSpotId.cxx.

References AsString().

00118 {
00119    // Print the (decoded) value
00120 
00121    printf("%s\n",AsString(option));
00122 }

void PlexPixelSpotId::SetPixel ( UInt_t  pixel  )  [inline]
void PlexPixelSpotId::SetSpot ( UInt_t  spot  )  [inline]
void PlexPixelSpotId::SetTube ( UInt_t  tube  )  [inline]

Definition at line 177 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2(), PlexMuxBoxId::fEncoded, maskPlexSpotTube, and shftPlexSpotTube.

Referenced by PlexPixelSpotId().

00178 {
00179   ConvertToVersion2();
00180   fEncoded = (fEncoded & ~maskPlexSpotTube) |
00181       ( ( tube << shftPlexSpotTube ) & maskPlexSpotTube );
00182 }


Friends And Related Function Documentation

Bool_t operator!= ( const PlexPixelSpotId lhs,
const PlexPixelSpotId rhs 
) [friend]

Reimplemented from PlexMuxBoxId.

Bool_t operator< ( const PlexPixelSpotId lhs,
const PlexPixelSpotId rhs 
) [friend]

Reimplemented from PlexMuxBoxId.

Bool_t operator<= ( const PlexPixelSpotId lhs,
const PlexPixelSpotId rhs 
) [friend]

Reimplemented from PlexMuxBoxId.

Bool_t operator== ( const PlexPixelSpotId lhs,
const PlexPixelSpotId rhs 
) [friend]

Reimplemented from PlexMuxBoxId.

Bool_t operator> ( const PlexPixelSpotId lhs,
const PlexPixelSpotId rhs 
) [friend]

Reimplemented from PlexMuxBoxId.

Bool_t operator>= ( const PlexPixelSpotId lhs,
const PlexPixelSpotId rhs 
) [friend]

Reimplemented from PlexMuxBoxId.


The documentation for this class was generated from the following files:

Generated on 21 Oct 2017 for loon by  doxygen 1.6.1