Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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)

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 PlexMuxBoxId::AsString(), GetPixel(), GetSpot(), GetTube(), and option.

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(), PhotonStatSummarizer::LoadDataFromDB(), LIPlexMaps::MakeCalAdcToPe(), operator<<(), PlotPmt(), pmt_plot(), TridModelPixel::Print(), TridModelPmt::Print(), SimPmtUTM16::Print(), SimPmtM64::Print(), SimPmtM16::Print(), PlexSEIdAltLItem::Print(), Print(), PmtDrift::Print(), SimVaTimedElectronics::ReadoutPmt(), SimVaElectronics::ReadoutPmt(), SimQieElectronics::ReadoutPmt(), Coroner::RecordDeadStrips(), 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]
 

Reimplemented from PlexMuxBoxId.

Definition at line 156 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2().

Referenced by UberDST::Ana(), PhotonStatSummarizer::ComputePmtDrifts(), HardwareComponent::HardwareComponent(), UberModuleLite::Reco(), and UberModule::Reco().

00157 { ConvertToVersion2(); return fEncoded; }

UShort_t PlexPixelSpotId::GetPixel  )  const [inline]
 

Definition at line 165 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2().

Referenced by AsString(), TridPmtPage::CreateSketches(), XTalkFilter::DoTrueFilter(), CDCrossTalker::GetCleanStripMap(), SimPmt::GetPixelNumber(), CDCrossTalker::GetXTalkStripInfo(), PEGainCalScheme::GuessGainAndWidth(), PEGainAggCalScheme::GuessGainAndWidth(), AlgAltDeMuxBase::IsXTalk(), LIPlexMaps::MakeCalAdcToPe(), AlgAltDeMuxBase::MakePixelMap(), AlgStripSRList::MakeXtalkMap(), TridPmtPage::OffsetPixelIntoPmt(), Anp::PmtHit::Plot(), LIPlexMaps::PlotPlexStripMap(), AlgAltDeMuxBase::PredictedSpotQ(), TridModelPixel::Print(), LIPlexMaps::ReadDbGains(), LISummarySorter::ReconstructStripEnd(), PulserGainFit::RunNearFarFits(), PmtPixelsMxx::SetPixelSpot(), PlexPixelToRawChannel::Store(), PlexPixelSpotToStripEnd::Store(), AlgAltDeMuxBase::UpdateXTalkMap(), AlgAltDeMuxBase::XTalkCharge(), and AlgAltDeMuxBase::XTalkPixelMap().

00166 {
00167   ConvertToVersion2();
00168   return (fEncoded & maskPlexSpotPixel ) >> shftPlexSpotPixel ;
00169 }

UShort_t PlexPixelSpotId::GetSpot  )  const [inline]
 

Definition at line 171 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2().

Referenced by AsString(), XTalkFilter::DoTrueFilter(), CDCrossTalker::GetCleanStripMap(), Plexus::GetSEIdAltL(), SimPmt::GetSpotNumber(), CDCrossTalker::GetXTalkStripInfo(), LIPlexMaps::MakeCalAdcToPe(), LIPlexMaps::PlotPlexStripMap(), TridModelPixel::Print(), LIPlexMaps::ReadDbGains(), PulserGainFit::RunNearFarFits(), PmtPixelsMxx::SetPixelSpot(), PlexPixelSpotToStripEnd::Store(), and AlgAltDeMuxBase::UpdateXTalkMap().

00172 {
00173   ConvertToVersion2();
00174   return (fEncoded & maskPlexSpotSpot ) >> shftPlexSpotSpot ;
00175 }

UShort_t PlexPixelSpotId::GetTube  )  const [inline]
 

Definition at line 159 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2().

Referenced by AsString(), XTalkFilter::CalculatePMTmuxID(), PhotonStatSummarizer::ComputePmtDrifts(), CDCrossTalker::GetCleanStripMap(), AlgAltDeMuxBase::IsXTalk(), AlgAltDeMuxBase::MakePixelMap(), TridPmtPage::OffsetPmtIntoRack_FD(), AlgAltDeMuxBase::PredictedSpotQ(), TridModelPixel::Print(), TridModelPmt::Print(), LIPlexMaps::ReadDbGains(), PulserGainFit::RunNearFarFits(), PlexPixelToRawChannel::Store(), PlexPixelSpotToStripEnd::Store(), AlgAltDeMuxBase::UpdateXTalkMap(), AlgAltDeMuxBase::XTalkCharge(), and AlgAltDeMuxBase::XTalkPixelMap().

00160 {
00161   ConvertToVersion2();
00162   return (fEncoded & maskPlexSpotTube ) >> shftPlexSpotTube ;
00163 }

UInt_t PlexPixelSpotId::GetUniquePixelEncodedValue  )  const [inline]
 

Definition at line 211 of file PlexPixelSpotId.h.

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]
 

Definition at line 205 of file PlexPixelSpotId.h.

References maskPlexSpotSpot.

Referenced by PhotonStatSummarizer::ComputePmtDrifts(), draw(), PmtDriftCalScheme::GetDrift(), SimDetector::GetTubeIndex(), LIPlexMaps::MakeCalAdcToPe(), AlgStripSRList::MakeXtalkMap(), PlotPmt(), StripSRKeyFromTube(), TridModelPixel::TridModelPixel(), and TridModelPmt::TridModelPmt().

00206 {
00207   // uncompatified, but unique for a PMT independent of pixel/spot
00208   return fEncoded | maskPlexSpotSpot | maskPlexSpotPixel;
00209 }

Bool_t PlexPixelSpotId::IsSamePixel const PlexPixelSpotId other  )  const [inline]
 

Definition at line 145 of file PlexPixelSpotId.h.

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

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(), and PlexMuxBoxId::fEncoded.

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]
 

Reimplemented from PlexMuxBoxId.

Definition at line 199 of file PlexPixelSpotId.h.

References zeroPlexMuxVersion.

Referenced by RerootFlsDigitToDigiPE::AddPE(), LightInjector::Get(), PEGainCalScheme::GetRow(), PEGainAggCalScheme::GetRow(), PEGainCalScheme::GuessGainAndWidth(), PEGainAggCalScheme::GuessGainAndWidth(), PhotonStatSummarizer::LoadDataFromDB(), PhotonDefaultModel::MakeNoise(), PhotonCaldetNoise::MakeNoise(), PhotonDefaultModel::MakeNoiseOld(), LIPlexMaps::PlotPlexStripMap(), PhotonInjector::SimulateEvent(), PhotonTransport::SimulateScintHit(), SimDetector::SortDigiPE(), and LIAnalysis::WriteGainsTextFile().

00200 {
00201   // test whether this is the nonsensical default value
00202   return ( fEncoded & (zeroPlexMuxVersion&zeroPlexSpotTubePixelSpot) ) != defaultMuxBoxId;
00203 }

void PlexPixelSpotId::Print Option_t *  option = ""  )  const
 

Reimplemented from PlexMuxBoxId.

Definition at line 117 of file PlexPixelSpotId.cxx.

References AsString(), and option.

Referenced by LIPlexMaps::MakeCalAdcToPe(), and pmt_plot().

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

void PlexPixelSpotId::SetPixel UInt_t  pixel  )  [inline]
 

Definition at line 184 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2().

Referenced by LightInjector::Ana(), PhotonStatSummarizer::ComputePmtDrifts(), TridPmtPage::CreateSketches(), Plexus::GetAllPixelSpotIds(), SimPmt::GetPixelSpotId(), HardwareComponent::GetStripEndsForPmt(), PEGainCalScheme::GuessGainAndWidth(), PEGainAggCalScheme::GuessGainAndWidth(), HardwareComponent::HardwareComponent(), PhotonNdAfterpulseModel::MakeAfterpulses(), PhotonCaldetNoise::MakeNoise(), PhotonDefaultModel::MakeNoiseOld(), PlexPixelSpotId(), PlotPmt(), and Coroner::RecordDeadStrips().

00185 {
00186   ConvertToVersion2();
00187   fEncoded = (fEncoded & ~maskPlexSpotPixel) |
00188       ( ( pixel << shftPlexSpotPixel ) & maskPlexSpotPixel );
00189 }

void PlexPixelSpotId::SetSpot UInt_t  spot  )  [inline]
 

Definition at line 191 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2().

Referenced by SimDaqPlaneTrigger::ApplyTriggerAt(), SimDaqMultTrigger::ApplyTriggerAt(), SimDaqEnergyTrigger::ApplyTriggerAt(), Plexus::BuildPixelMaps(), PhotonStatSummarizer::ComputePmtDrifts(), Plexus::GetAllPixelSpotIds(), SimPmt::GetPixelSpotId(), Plexus::GetRawChannelId(), Plexus::GetStripEndId(), HardwareComponent::GetStripEndsForPixel(), PEGainCalScheme::GuessGainAndWidth(), PEGainAggCalScheme::GuessGainAndWidth(), HardwareComponent::HardwareComponent(), PhotonNdAfterpulseModel::MakeAfterpulses(), PhotonCaldetNoise::MakeNoise(), PhotonDefaultModel::MakeNoiseOld(), PlexPixelSpotId(), PlotPmt(), and Coroner::RecordDeadStrips().

00192 {
00193   ConvertToVersion2();
00194   fEncoded = (fEncoded & ~maskPlexSpotSpot) |
00195       ( ( spot << shftPlexSpotSpot ) & maskPlexSpotSpot );
00196 }

void PlexPixelSpotId::SetTube UInt_t  tube  )  [inline]
 

Definition at line 177 of file PlexPixelSpotId.h.

References PlexMuxBoxId::ConvertToVersion2().

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]
 

Definition at line 132 of file PlexPixelSpotId.h.

00133 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00134   return lhs.fEncoded != rhs.fEncoded; }

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

Definition at line 120 of file PlexPixelSpotId.h.

00121 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00122   return lhs.fEncoded <  rhs.fEncoded; }

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

Definition at line 124 of file PlexPixelSpotId.h.

00125 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00126   return lhs.fEncoded <= rhs.fEncoded; }

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

Definition at line 128 of file PlexPixelSpotId.h.

00129 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00130   return lhs.fEncoded == rhs.fEncoded; }

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

Definition at line 136 of file PlexPixelSpotId.h.

00137 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00138   return lhs.fEncoded >  rhs.fEncoded; }

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

Definition at line 140 of file PlexPixelSpotId.h.

00141 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00142   return lhs.fEncoded >= rhs.fEncoded; }


The documentation for this class was generated from the following files:
Generated on Sat Nov 21 22:51:43 2009 for loon by  doxygen 1.3.9.1