DigiSignal Class Reference

#include <DigiSignal.h>

List of all members.

Public Types

enum  EDigiPmtTruth {
  kUnknown = 0x00, kGenuine = 0x01, kDarkNoise = 0x02, kFibreLight = 0x04,
  kCrosstalk = 0x08, kCrosstalkOptical = 0x10, kLeakFromNextBucket = 0x20, kLeakFromPrevBucket = 0x40,
  kAfterpulse = 0x80
}
typedef Int_t DigiPmtTruth_t
typedef std::vector< const
DigiPE * > 
PEList_t
typedef std::vector< TRef > HitList_t
typedef std::vector< Float_t > HitWeightList_t

Public Member Functions

 DigiSignal ()
 DigiSignal (Float_t charge, PEList_t &pes, HitList_t &hits, HitWeightList_t &weights, DigiPmtTruth_t truth)
 DigiSignal (const DigiSignal &rhs)
 ~DigiSignal ()
UInt_t GetId () const
Double_t GetCharge () const
const PEList_tGetPes () const
DigiPmtTruth_t GetTruth () const
Int_t GetNumPe () const
UInt_t GetNumberOfHits () const
const DigiScintHitGetHit (UInt_t hit) const
Float_t GetHitWeight (UInt_t hit) const
Float_t GetTotalHitWeight () const
const DigiScintHitGetBiggestHit () const
void SetCharge (Double_t charge)
void AddDigiPE (const DigiPE *digipe)
void AddHit (const DigiScintHit *hitptr, Double_t weight=0)
void SetTruth (DigiPmtTruth_t in)
void SetTruthBit (DigiPmtTruth_t in)
void ClearTruthBit (DigiPmtTruth_t in)
void Merge (DigiSignal &other)
virtual void Print (Option_t *option="") const
virtual const char * AsString (Option_t *option="") const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const

Private Member Functions

 ClassDef (DigiSignal, 4)

Private Attributes

UInt_t fSignalId
Float_t fCharge
PEList_t fPes
Int_t fNumPe
HitList_t fHits
HitWeightList_t fHitWeights
DigiPmtTruth_t fTruth

Friends

std::ostream & operator<< (std::ostream &os, const DigiSignal &s)

Detailed Description

Definition at line 15 of file DigiSignal.h.


Member Typedef Documentation

Definition at line 31 of file DigiSignal.h.

typedef std::vector<TRef> DigiSignal::HitList_t

Definition at line 33 of file DigiSignal.h.

typedef std::vector<Float_t> DigiSignal::HitWeightList_t

Definition at line 34 of file DigiSignal.h.

typedef std::vector<const DigiPE*> DigiSignal::PEList_t

Definition at line 32 of file DigiSignal.h.


Member Enumeration Documentation

Enumerator:
kUnknown 
kGenuine 
kDarkNoise 
kFibreLight 
kCrosstalk 
kCrosstalkOptical 
kLeakFromNextBucket 
kLeakFromPrevBucket 
kAfterpulse 

Definition at line 18 of file DigiSignal.h.

00018                      {
00019     kUnknown          = 0x00,   // Can happen: known cause is 0 charge
00020                                 // but random noise passes sparsification thresh.
00021     kGenuine          = 0x01,   // A real hit from real gosh-darn physics.
00022     kDarkNoise        = 0x02,   // Dark noise from the tube.
00023     kFibreLight       = 0x04,   // Random [singles] from a fibre. 
00024     kCrosstalk        = 0x08,   // A generic crosstalk hit.
00025     kCrosstalkOptical = 0x10,   // A crosstalk hit, specifically from
00026     kLeakFromNextBucket = 0x20,  // The next bucket leaked charge back to this one
00027     kLeakFromPrevBucket = 0x40,  // The prev bucket leaked charge forward to this one
00028     kAfterpulse         = 0x80   // This PE is an afterpulse
00029   };


Constructor & Destructor Documentation

DigiSignal::DigiSignal (  ) 

Definition at line 12 of file DigiSignal.cxx.

References fSignalId, and sSignalIdCounter.

00012                        :
00013   fCharge(0),
00014   fPes(0),
00015   fNumPe(0),
00016   fHits(0),
00017   fHitWeights(0),
00018   fTruth(kUnknown)
00019 {
00020   fSignalId = sSignalIdCounter++;
00021 }

DigiSignal::DigiSignal ( Float_t  charge,
PEList_t pes,
HitList_t hits,
HitWeightList_t weights,
DigiPmtTruth_t  truth 
)

Definition at line 23 of file DigiSignal.cxx.

References fSignalId, and sSignalIdCounter.

00027                                              :
00028   fCharge(charge),
00029   fPes(pes),
00030   fNumPe((int)pes.size()),
00031   fHits(hits),
00032   fHitWeights(weights),
00033   fTruth(truth)
00034 {
00035   fSignalId = sSignalIdCounter++;
00036 }

DigiSignal::DigiSignal ( const DigiSignal rhs  ) 

Definition at line 40 of file DigiSignal.cxx.

00040                                               :
00041   TObject(rhs),
00042   fSignalId(rhs.fSignalId),
00043   fCharge(rhs.fCharge),
00044   fPes(rhs.fPes),
00045   fNumPe(rhs.GetNumPe()),
00046   fHits(rhs.fHits),
00047   fHitWeights(rhs.fHitWeights),
00048   fTruth(rhs.fTruth)
00049 {
00050 }

DigiSignal::~DigiSignal (  ) 

Definition at line 52 of file DigiSignal.cxx.

00053 {
00054   // Note: we don't own the Hits.
00055 }


Member Function Documentation

void DigiSignal::AddDigiPE ( const DigiPE digipe  ) 

Definition at line 57 of file DigiSignal.cxx.

References AddHit(), fNumPe, fPes, and DigiPE::GetHitPointer().

Referenced by SimPixelTimeBucket::CreateSignal().

00058 {
00059   if(digipe) {
00060     fPes.push_back(digipe);
00061     const DigiScintHit* hit = digipe->GetHitPointer();
00062     fNumPe+=1;
00063     if(hit) AddHit(hit, 1.0);
00064   }
00065 }

void DigiSignal::AddHit ( const DigiScintHit hitptr,
Double_t  weight = 0 
)

Definition at line 67 of file DigiSignal.cxx.

References fHits, fHitWeights, GetHit(), and n.

Referenced by AddDigiPE(), and Merge().

00068 {
00069   //Make sure we don't already have this hit.
00070   UInt_t n = fHits.size();
00071   for(UInt_t i=0; i<n; i++) {
00072     const DigiScintHit* oldhit = GetHit(i);
00073     if (oldhit->GetUniqueID() == hitptr->GetUniqueID()) {
00074       // Add this weight.
00075       fHitWeights[i] += weight;
00076       return;
00077     }
00078   }
00079 
00080   // Add it onto the list
00081   TRef ref((TObject*)hitptr);
00082   fHits.push_back(ref);
00083   fHitWeights.push_back(weight);
00084 }

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

Definition at line 139 of file DigiSignal.cxx.

References Munits::fC, Form(), GetCharge(), GetId(), GetNumberOfHits(), GetNumPe(), and GetTruth().

Referenced by FormatToOStream(), and Print().

00140 {
00141   const char* fmt_default = 
00142     "DigiSignal [%d] %s Q=%.1ffC Npe=%d Nhits=%d";
00143   const char* fmt_extended =
00144     "DigiSignal ID=%d Truth=%s Charge=%.1ffC Npe=%d Nhits=%d";
00145 
00146   const char* fmt = fmt_default;
00147 
00148   switch(option[0]) {
00149   case 'e': // (E)xtended printout.
00150   case 'E':
00151     fmt = fmt_extended;
00152     break;
00153   default:
00154     fmt = fmt_default;
00155   }
00156    
00157   DigiSignal::DigiPmtTruth_t truth = GetTruth();
00158   const char* truthstr = ::AsString(truth);
00159   return Form(fmt,
00160               GetId(),
00161               truthstr,
00162               GetCharge()/Munits::fC,
00163               GetNumPe(),
00164               GetNumberOfHits()
00165               );
00166 
00167 }

DigiSignal::ClassDef ( DigiSignal  ,
 
) [private]
void DigiSignal::ClearTruthBit ( DigiPmtTruth_t  in  )  [inline]

Definition at line 66 of file DigiSignal.h.

References fTruth.

00066 { fTruth &= ( 0xFFFF - in ); };

std::ostream & DigiSignal::FormatToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Definition at line 131 of file DigiSignal.cxx.

References AsString().

Referenced by operator<<().

00133 {
00134    os << AsString(option);
00135    return os;
00136 }

const DigiScintHit * DigiSignal::GetBiggestHit (  )  const [inline]

Definition at line 121 of file DigiSignal.h.

References fHits, fHitWeights, GetHit(), and n.

Referenced by Truthifier::GetBiggestHit().

00122 { 
00123   UInt_t n = fHits.size();
00124   if(n==0) return 0;
00125   float biggest_weight = fHitWeights[0];
00126   UInt_t index =0;
00127   for(UInt_t i=0; i<n; i++) {
00128     if(fHitWeights[i] > biggest_weight) index = i;
00129   }
00130 
00131   return GetHit(index);
00132 }

Double_t DigiSignal::GetCharge (  )  const [inline]

Definition at line 47 of file DigiSignal.h.

References fCharge.

Referenced by CustomLightInjector::Ana(), AsString(), and Truthifier::Print().

00047 { return fCharge; }; // in Munits

const DigiScintHit * DigiSignal::GetHit ( UInt_t  hit  )  const [inline]
Float_t DigiSignal::GetHitWeight ( UInt_t  hit  )  const [inline]
UInt_t DigiSignal::GetId (  )  const [inline]

Definition at line 46 of file DigiSignal.h.

References fSignalId.

Referenced by AsString(), MnvRawDigitSuppression::FindMCTDCMinMax(), DetSim::Get(), and Truthifier::Reset().

00046 { return fSignalId; };

UInt_t DigiSignal::GetNumberOfHits (  )  const [inline]
Int_t DigiSignal::GetNumPe (  )  const [inline]

Definition at line 52 of file DigiSignal.h.

References fNumPe.

Referenced by AsString(), GetTotalHitWeight(), and Merge().

00052 { return fNumPe; };

const PEList_t& DigiSignal::GetPes (  )  const [inline]

Definition at line 48 of file DigiSignal.h.

References fPes.

00048 { return fPes; };

Float_t DigiSignal::GetTotalHitWeight (  )  const [inline]

Definition at line 113 of file DigiSignal.h.

References GetNumPe().

00114 {
00115   return (Float_t) GetNumPe();
00116 }

DigiPmtTruth_t DigiSignal::GetTruth (  )  const [inline]
void DigiSignal::Merge ( DigiSignal other  ) 

Definition at line 86 of file DigiSignal.cxx.

References AddHit(), fCharge, fNumPe, fPes, fTruth, GetHit(), GetHitWeight(), GetNumberOfHits(), GetNumPe(), and n.

Referenced by SimQieElectronics::ReadoutPmt(), and SimVaTimedElectronics::ReadoutPmt().

00087 {
00088   fCharge += other.fCharge;
00089   fPes.insert(fPes.end(),other.fPes.begin(),other.fPes.end());
00090   fNumPe+=other.GetNumPe();
00091 
00092   UInt_t n = other.GetNumberOfHits();
00093   for(UInt_t i=0; i<n; i++) {
00094     AddHit(other.GetHit(i), other.GetHitWeight(i));
00095   }
00096 
00097   fTruth |= other.fTruth;
00098 }

void DigiSignal::Print ( Option_t *  option = ""  )  const [virtual]

Definition at line 125 of file DigiSignal.cxx.

References AsString().

00126 {
00127    std::cout << this->AsString(option) << std::endl;
00128 }

void DigiSignal::SetCharge ( Double_t  charge  )  [inline]

Definition at line 61 of file DigiSignal.h.

References fCharge.

Referenced by SimPixelTimeBucket::CreateSignal().

00061 { fCharge = charge; };

void DigiSignal::SetTruth ( DigiPmtTruth_t  in  )  [inline]

Definition at line 64 of file DigiSignal.h.

References fTruth.

Referenced by SimPixelTimeBucket::CreateSignal().

00064 { fTruth = in; };

void DigiSignal::SetTruthBit ( DigiPmtTruth_t  in  )  [inline]

Definition at line 65 of file DigiSignal.h.

References fTruth.

00065 { fTruth |= in; };


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DigiSignal s 
) [friend]

Member Data Documentation

Float_t DigiSignal::fCharge [private]

Definition at line 78 of file DigiSignal.h.

Referenced by GetCharge(), Merge(), and SetCharge().

Definition at line 81 of file DigiSignal.h.

Referenced by AddHit(), GetBiggestHit(), GetHit(), and GetNumberOfHits().

Definition at line 82 of file DigiSignal.h.

Referenced by AddHit(), GetBiggestHit(), and GetHitWeight().

Int_t DigiSignal::fNumPe [private]

Definition at line 80 of file DigiSignal.h.

Referenced by AddDigiPE(), GetNumPe(), and Merge().

Definition at line 79 of file DigiSignal.h.

Referenced by AddDigiPE(), GetPes(), and Merge().

UInt_t DigiSignal::fSignalId [private]

Definition at line 77 of file DigiSignal.h.

Referenced by DigiSignal(), and GetId().

Definition at line 83 of file DigiSignal.h.

Referenced by ClearTruthBit(), GetTruth(), Merge(), SetTruth(), and SetTruthBit().


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

Generated on 13 Sep 2017 for loon by  doxygen 1.6.1