SimPixelTimeBucket Class Reference

#include <SimPixelTimeBucket.h>

List of all members.

Public Types

typedef std::multimap< Double_t,
const DigiPE * > 
PeList_t

Public Member Functions

 SimPixelTimeBucket ()
 SimPixelTimeBucket (Int_t nSpots)
 ~SimPixelTimeBucket ()
Int_t GetNumSpots () const
PeList_tGetDigiPE (Int_t ispot=1)
PeList_tGetDigiPEXtalk (Int_t ispot=1)
Float_t GetPE (Int_t ispot=1) const
Float_t GetPEXtalk (Int_t ispot=1) const
Float_t GetCharge () const
Float_t GetTime () const
DigiSignalCreateSignal ()
void SetPE (Int_t spot, Float_t pe)
void SetPEXtalk (Int_t spot, Float_t pe)
void SetCharge (Float_t charge)
void SetTruthBit (Int_t bit)
void SetTruth (DigiSignal::DigiPmtTruth_t in)
void AddPE (Int_t spot, Float_t pe)
void AddPEXtalk (Int_t spot, Float_t pe)
void AddCharge (Float_t charge)
void SetTime (Float_t time)
Float_t GetTotalPE ()
Float_t GetTotalPEXtalk ()
void AddDigiPE (const DigiPE *digipe, Int_t spot)

Static Public Member Functions

static int GetGlobalPixelBuckets ()

Private Attributes

Int_t fNSpots
std::vector< PeList_tfDigiPE
std::vector< PeList_tfDigiPEXtalk
std::vector< Float_t > fPE
std::vector< Float_t > fPEXtalk
DigiSignal::DigiPmtTruth_t fTruth
Float_t fCharge
Float_t fTime

Static Private Attributes

static Int_t fsTotalNumber = 0


Detailed Description

Definition at line 8 of file SimPixelTimeBucket.h.


Member Typedef Documentation

typedef std::multimap<Double_t, const DigiPE*> SimPixelTimeBucket::PeList_t

Definition at line 18 of file SimPixelTimeBucket.h.


Constructor & Destructor Documentation

SimPixelTimeBucket::SimPixelTimeBucket (  ) 

Definition at line 28 of file SimPixelTimeBucket.cxx.

00029 {
00030   // Do not use!  Only for I/O.
00031   fsTotalNumber++;
00032 }

SimPixelTimeBucket::SimPixelTimeBucket ( Int_t  nSpots  ) 

Definition at line 35 of file SimPixelTimeBucket.cxx.

References fNSpots, fPE, fPEXtalk, and fsTotalNumber.

00035                                                      :
00036   fNSpots(nSpots),
00037   fDigiPE(fNSpots+1),
00038   fDigiPEXtalk(fNSpots+1),
00039   fPE(fNSpots+1),
00040   fPEXtalk(fNSpots+1),
00041   fTruth(DigiSignal::kUnknown),
00042   fCharge(0),
00043   fTime(1e9)
00044 {
00045   fsTotalNumber++;
00046 
00047   // Fill with zeros.
00048   for(int i=0;i<=fNSpots;i++) {
00049     fPE[i]=0;
00050     fPEXtalk[i]=0;
00051   }
00052 }

SimPixelTimeBucket::~SimPixelTimeBucket (  ) 

Definition at line 54 of file SimPixelTimeBucket.cxx.

References fsTotalNumber.

00055 {
00056   fsTotalNumber--;
00057 }


Member Function Documentation

void SimPixelTimeBucket::AddCharge ( Float_t  charge  ) 

Definition at line 67 of file SimPixelTimeBucket.cxx.

References fCharge.

Referenced by SimPmtM64Oxford::SimulateAnodeEffects(), and SimPmtM64Full::SimulateCharges().

00068 {
00069   fCharge += charge;
00070   //if(fCharge<-100*Munits::fC) {
00071   //  cout << "Charge got added to " << fCharge/Munits::fC << " with increment " << charge/Munits::fC << endl;
00072   //}
00073 }

void SimPixelTimeBucket::AddDigiPE ( const DigiPE digipe,
Int_t  spot 
)

Definition at line 97 of file SimPixelTimeBucket.cxx.

References fDigiPE, fNSpots, fPE, fTime, fTruth, DigiPE::GetSource(), DigiPE::GetTime(), Msg::kWarning, and MSG.

00098 {
00099   //
00100   // Add DigiPE to the bucket.  Use the provided spot number instead of the 
00101   // PlexPixelSpotId in the digipe, because the PlexPixelSpotID is simply wrong,
00102   // if accurately wrong.
00103   //
00104   
00105   //Int_t spot = digipe->GetPixelSpotId().GetSpot();
00106   if( (spot > fNSpots) || (spot < 1) ) {
00107     // Problem!
00108     MSG("DetSim",Msg::kWarning) << "AddDigiPE() Invalid Pixel Spot number!" << endl;
00109     return;
00110   }
00111   if(digipe->GetTime() < fTime) fTime = digipe->GetTime();
00112   
00113   // This adds the hit info and the pe pointer.
00114   fPE[spot] += 1;                    // True number of PE.. don't touch this again.
00115   
00116   fDigiPE[spot].insert(std::pair<Double_t,const DigiPE*>(digipe->GetTime(), digipe));
00117   
00118   // This is a real hit.
00119   
00120   fTruth |= digipe->GetSource();
00121 }

void SimPixelTimeBucket::AddPE ( Int_t  spot,
Float_t  pe 
) [inline]

Definition at line 38 of file SimPixelTimeBucket.h.

References fPE.

00038 { fPE[spot] += pe; };

void SimPixelTimeBucket::AddPEXtalk ( Int_t  spot,
Float_t  pe 
) [inline]

Definition at line 39 of file SimPixelTimeBucket.h.

References fPEXtalk.

Referenced by SimPmt::MoveOpticalPE().

00039 { fPEXtalk[spot] += pe; }; 

DigiSignal * SimPixelTimeBucket::CreateSignal (  ) 

Definition at line 124 of file SimPixelTimeBucket.cxx.

References fCharge, fDigiPEXtalk, fTruth, and Munits::s.

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

00125 {
00126   // Creates a new digiSignal with all the attendant data.
00127   // Caller becomes responsible for ownership.
00128   //
00129   DigiSignal* s = new DigiSignal();
00130   // Set up the charge
00131   s->SetCharge(fCharge);
00132   s->SetTruth(fTruth);
00133 
00134   // Add the PEs.
00135   for(UInt_t i = 0; i<fDigiPEXtalk.size(); i++) {
00136     PeList_t::iterator it = fDigiPEXtalk[i].begin();
00137     for( ; it!= fDigiPEXtalk[i].end() ; it++) {
00138       s->AddDigiPE(it->second);
00139     }
00140   }
00141 
00142   return s;
00143 }

Float_t SimPixelTimeBucket::GetCharge (  )  const [inline]

Definition at line 27 of file SimPixelTimeBucket.h.

References fCharge.

Referenced by SimPmt::GetCharge(), SimVaTimedElectronics::ReadoutPmt(), SimQieElectronics::ReadoutPmt(), and SimPmtM64Oxford::SimulateAnodeEffects().

00027 { return fCharge; };

PeList_t& SimPixelTimeBucket::GetDigiPE ( Int_t  ispot = 1  )  [inline]

Definition at line 23 of file SimPixelTimeBucket.h.

References fDigiPE.

Referenced by SimPmt::MoveOpticalPE().

00023 { return fDigiPE[ispot];};

PeList_t& SimPixelTimeBucket::GetDigiPEXtalk ( Int_t  ispot = 1  )  [inline]

Definition at line 24 of file SimPixelTimeBucket.h.

References fDigiPEXtalk.

Referenced by SimPmt::MoveOpticalPE().

00024 { return fDigiPEXtalk[ispot];};

static int SimPixelTimeBucket::GetGlobalPixelBuckets (  )  [inline, static]

Definition at line 12 of file SimPixelTimeBucket.h.

References fsTotalNumber.

Referenced by SimDetector::Reset().

00012 { return fsTotalNumber; };

Int_t SimPixelTimeBucket::GetNumSpots (  )  const [inline]

Definition at line 22 of file SimPixelTimeBucket.h.

References fNSpots.

00022 { return fNSpots; };

Float_t SimPixelTimeBucket::GetPE ( Int_t  ispot = 1  )  const [inline]

Definition at line 25 of file SimPixelTimeBucket.h.

References fPE.

Referenced by SimPmt::GetPe(), and SimPmt::MoveOpticalPE().

00025 { return fPE[ispot]; };

Float_t SimPixelTimeBucket::GetPEXtalk ( Int_t  ispot = 1  )  const [inline]

Definition at line 26 of file SimPixelTimeBucket.h.

References fPEXtalk.

Referenced by SimPmt::GetPeXtalk(), and SimVaTimedElectronics::ReadoutPmt().

00026 { return fPEXtalk[ispot]; };

Float_t SimPixelTimeBucket::GetTime ( void   )  const [inline]

Definition at line 28 of file SimPixelTimeBucket.h.

References fTime.

Referenced by SimPmt::GetTime().

00028 { return fTime; };

Float_t SimPixelTimeBucket::GetTotalPE (  ) 

Definition at line 77 of file SimPixelTimeBucket.cxx.

References fNSpots, and fPE.

Referenced by SimPmt::GetPe().

00078 {
00079   float tot = 0;
00080   for(int i=1;i<=fNSpots;i++) {
00081     tot += fPE[i];
00082   }
00083   return tot;
00084 }

Float_t SimPixelTimeBucket::GetTotalPEXtalk (  ) 

Definition at line 86 of file SimPixelTimeBucket.cxx.

References fNSpots, and fPEXtalk.

Referenced by SimPmt::GetPeXtalk().

00087 {
00088   float tot = 0;
00089   for(int i=1;i<=fNSpots;i++) {
00090     tot += fPEXtalk[i];
00091   }
00092   return tot;
00093 }

void SimPixelTimeBucket::SetCharge ( Float_t  charge  ) 

Definition at line 59 of file SimPixelTimeBucket.cxx.

References fCharge.

00060 {
00061   fCharge = charge;
00062   //if(charge<-100*Munits::fC) {
00063   //  cout << "Charge got set to " << fCharge/Munits::fC << endl;
00064   // }
00065 }

void SimPixelTimeBucket::SetPE ( Int_t  spot,
Float_t  pe 
) [inline]

Definition at line 32 of file SimPixelTimeBucket.h.

References fPE.

00032 { fPE[spot] = pe; };

void SimPixelTimeBucket::SetPEXtalk ( Int_t  spot,
Float_t  pe 
) [inline]

Definition at line 33 of file SimPixelTimeBucket.h.

References fPEXtalk.

00033 { fPEXtalk[spot] = pe; }; 

void SimPixelTimeBucket::SetTime ( Float_t  time  )  [inline]

Definition at line 42 of file SimPixelTimeBucket.h.

References fTime.

00042 { fTime = time; };

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

Definition at line 36 of file SimPixelTimeBucket.h.

References fTruth.

00036 { fTruth = in; }; 

void SimPixelTimeBucket::SetTruthBit ( Int_t  bit  )  [inline]

Definition at line 35 of file SimPixelTimeBucket.h.

References fTruth.

Referenced by SimPmtM64Oxford::SimulateAnodeEffects(), SimPmtM64Full::SimulateCharges(), and SimPmtM64::SimulateOpticalXtalk().

00035 { fTruth |= bit; }; 


Member Data Documentation

Float_t SimPixelTimeBucket::fCharge [private]

Definition at line 63 of file SimPixelTimeBucket.h.

Referenced by AddCharge(), CreateSignal(), GetCharge(), SetCharge(), and SimPmtM64Oxford::SimulateAnodeEffects().

std::vector<PeList_t> SimPixelTimeBucket::fDigiPE [private]

Definition at line 55 of file SimPixelTimeBucket.h.

Referenced by AddDigiPE(), and GetDigiPE().

std::vector<PeList_t> SimPixelTimeBucket::fDigiPEXtalk [private]

Definition at line 56 of file SimPixelTimeBucket.h.

Referenced by CreateSignal(), and GetDigiPEXtalk().

Int_t SimPixelTimeBucket::fNSpots [private]

Definition at line 52 of file SimPixelTimeBucket.h.

Referenced by AddDigiPE(), GetNumSpots(), GetTotalPE(), GetTotalPEXtalk(), and SimPixelTimeBucket().

std::vector<Float_t> SimPixelTimeBucket::fPE [private]

Definition at line 59 of file SimPixelTimeBucket.h.

Referenced by AddDigiPE(), AddPE(), GetPE(), GetTotalPE(), SetPE(), and SimPixelTimeBucket().

std::vector<Float_t> SimPixelTimeBucket::fPEXtalk [private]

Definition at line 60 of file SimPixelTimeBucket.h.

Referenced by AddPEXtalk(), GetPEXtalk(), GetTotalPEXtalk(), SetPEXtalk(), and SimPixelTimeBucket().

int SimPixelTimeBucket::fsTotalNumber = 0 [static, private]

Definition at line 66 of file SimPixelTimeBucket.h.

Referenced by GetGlobalPixelBuckets(), SimPixelTimeBucket(), and ~SimPixelTimeBucket().

Float_t SimPixelTimeBucket::fTime [private]

Definition at line 64 of file SimPixelTimeBucket.h.

Referenced by AddDigiPE(), GetTime(), SetTime(), and SimPmtM64Oxford::SimulateAnodeEffects().

DigiSignal::DigiPmtTruth_t SimPixelTimeBucket::fTruth [private]

Definition at line 62 of file SimPixelTimeBucket.h.

Referenced by AddDigiPE(), CreateSignal(), SetTruth(), and SetTruthBit().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:03:42 2014 for loon by  doxygen 1.4.7