PlexPinDiodeId Class Reference

#include <PlexPinDiodeId.h>

Inheritance diagram for PlexPinDiodeId:
PlexMuxBoxId

List of all members.

Public Member Functions

 PlexPinDiodeId ()
 PlexPinDiodeId (Detector::Detector_t detector, ElecType::Elec_t electronics, Char_t eastwest, Char_t racklevel, UInt_t rackbay, UInt_t inrack, UInt_t inbox, UInt_t gain)
 PlexPinDiodeId (PlexMuxBoxId muxbox, UInt_t inbox, UInt_t gain)
virtual ~PlexPinDiodeId ()
 PlexPinDiodeId (const UInt_t encoded)
UInt_t GetEncoded () const
const char * AsString (Option_t *option="") const
UShort_t GetInBox () const
UShort_t GetGain () const
Bool_t IsHighGain () const
Bool_t IsLowGain () const
Bool_t IsValid () const
void Print (Option_t *option="") const
void SetInBox (UInt_t inbox)
void SetGain (UInt_t gain)

Friends

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

Detailed Description

Definition at line 24 of file PlexPinDiodeId.h.


Constructor & Destructor Documentation

PlexPinDiodeId::PlexPinDiodeId (  ) 

Definition at line 36 of file PlexPinDiodeId.cxx.

00037    : PlexMuxBoxId()
00038 {
00039    // Default ctor constructs meaningless value
00040 }

PlexPinDiodeId::PlexPinDiodeId ( Detector::Detector_t  detector,
ElecType::Elec_t  electronics,
Char_t  eastwest,
Char_t  racklevel,
UInt_t  rackbay,
UInt_t  inrack,
UInt_t  inbox,
UInt_t  gain 
)

Definition at line 43 of file PlexPinDiodeId.cxx.

References SetGain(), and SetInBox().

00048   : PlexMuxBoxId(detector,elec,eastwest,racklevel,rackbay,inrack)
00049 {
00050    // Normal ctor
00051 
00052    SetInBox(inbox);
00053    SetGain(gain);
00054 }

PlexPinDiodeId::PlexPinDiodeId ( PlexMuxBoxId  muxbox,
UInt_t  inbox,
UInt_t  gain 
)

Definition at line 57 of file PlexPinDiodeId.cxx.

References SetGain(), and SetInBox().

00059   : PlexMuxBoxId(muxbox)
00060 {
00061    // Normal ctor
00062 
00063    SetInBox(inbox);
00064    SetGain(gain);
00065 }

PlexPinDiodeId::~PlexPinDiodeId (  )  [virtual]

Definition at line 75 of file PlexPinDiodeId.cxx.

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

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

Definition at line 68 of file PlexPinDiodeId.cxx.

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


Member Function Documentation

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

Reimplemented from PlexMuxBoxId.

Definition at line 81 of file PlexPinDiodeId.cxx.

References GetInBox(), and IsLowGain().

Referenced by Plexus::BuildLedMaps(), Plexus::BuildPinDiodeMap(), FitNdNonlinQuad(), LISummarySorter::GetMuxBoxInfo(), Plexus::GetPinDiodeIds(), Print(), and LISummarySorter::ReconstructPin().

00082 {
00083    // Return unpacked PlexPinDiodeId 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 
00097    const char*   efmt = "%s-PIN-%3.3d%c";
00098    if (extended) efmt = "%s-PIN-diode %3.3d gain %c";
00099 
00100    const char* muxAsString = PlexMuxBoxId::AsString(option);
00101    sprintf(newstring[ibuffer],efmt,muxAsString,GetInBox(),(IsLowGain()?'L':'H'));
00102    
00103    return newstring[ibuffer];
00104 }

UInt_t PlexPinDiodeId::GetEncoded (  )  const [inline]
UShort_t PlexPinDiodeId::GetGain (  )  const [inline]
UShort_t PlexPinDiodeId::GetInBox (  )  const [inline]
Bool_t PlexPinDiodeId::IsHighGain (  )  const [inline]

Definition at line 49 of file PlexPinDiodeId.h.

References GetGain().

Referenced by Plexus::GetPinDiodeIds().

00049 { return GetGain()==0; }

Bool_t PlexPinDiodeId::IsLowGain (  )  const [inline]

Definition at line 50 of file PlexPinDiodeId.h.

References GetGain().

Referenced by AsString(), and FitNdNonlinQuad().

00050 { return GetGain()==1; }

Bool_t PlexPinDiodeId::IsValid (  )  const [inline]

Reimplemented from PlexMuxBoxId.

Definition at line 161 of file PlexPinDiodeId.h.

References defaultMuxBoxId, PlexMuxBoxId::fEncoded, and zeroPlexMuxVersion.

Referenced by Plexus::GetPinDiodeIds(), and LISummarySorter::ReconstructPin().

00162 { 
00163    // test whether this is the nonsensical default value
00164    return  ( fEncoded & zeroPlexMuxVersion ) != defaultMuxBoxId;
00165    // (fEncoded&~(maskPlexMuxVersion|maskPlexPinInBox|maskPlexPinGain)) != defaultMuxBoxId;
00166 }

void PlexPinDiodeId::Print ( Option_t *  option = ""  )  const

Reimplemented from PlexMuxBoxId.

Definition at line 107 of file PlexPinDiodeId.cxx.

References AsString().

Referenced by LIPlexMaps::GetRawPinLedMap(), LIPlexMaps::GetRawPinMap(), and LIPlexMaps::GetRefAdcPinRatio().

00108 {
00109    // Print the (decoded) value
00110 
00111    printf("%s\n",AsString(option));
00112 }

void PlexPinDiodeId::SetGain ( UInt_t  gain  )  [inline]

Definition at line 154 of file PlexPinDiodeId.h.

References PlexMuxBoxId::ConvertToVersion2(), PlexMuxBoxId::fEncoded, maskPlexPinGain, and shftPlexPinGain.

Referenced by PlexPinDiodeId().

00155 {
00156   ConvertToVersion2();
00157   fEncoded = (fEncoded & ~maskPlexPinGain) |
00158       ( ( gain << shftPlexPinGain ) & maskPlexPinGain );
00159 }

void PlexPinDiodeId::SetInBox ( UInt_t  inbox  )  [inline]

Definition at line 147 of file PlexPinDiodeId.h.

References PlexMuxBoxId::ConvertToVersion2(), PlexMuxBoxId::fEncoded, maskPlexPinInBox, and shftPlexPinInBox.

Referenced by PlexPinDiodeId().

00148 {
00149   ConvertToVersion2();
00150   fEncoded = (fEncoded & ~maskPlexPinInBox) |
00151       ( ( inbox << shftPlexPinInBox ) & maskPlexPinInBox );
00152 }


Friends And Related Function Documentation

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

Reimplemented from PlexMuxBoxId.

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

Reimplemented from PlexMuxBoxId.

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

Reimplemented from PlexMuxBoxId.

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

Reimplemented from PlexMuxBoxId.

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

Reimplemented from PlexMuxBoxId.

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

Reimplemented from PlexMuxBoxId.


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1