PhotonCaldetNoise Class Reference

#include <PhotonCaldetNoise.h>

Inheritance diagram for PhotonCaldetNoise:

PhotonTransportModule List of all members.

Public Member Functions

 PhotonCaldetNoise ()
virtual void Configure (const Registry &r)
virtual void MakeNoise (std::vector< DigiPE * > &peList, Double_t t_start, Double_t t_end)
virtual void Print (Option_t *option="") const

Protected Member Functions

virtual void Reset (const VldContext &cx)

Private Member Functions

 ClassDef (PhotonCaldetNoise, 0)

Private Attributes

Double_t fDarkNoiseRate
Double_t fGreenNoiseRate
Double_t fNoiseWindow

Detailed Description

Definition at line 22 of file PhotonCaldetNoise.h.


Constructor & Destructor Documentation

PhotonCaldetNoise::PhotonCaldetNoise (  ) 

Definition at line 17 of file PhotonCaldetNoise.cxx.

References PhotonConfiguration().

00018 {
00019   Configure(PhotonConfiguration()); // Set up default values.
00020 }


Member Function Documentation

PhotonCaldetNoise::ClassDef ( PhotonCaldetNoise  ,
 
) [private]

void PhotonCaldetNoise::Configure ( const Registry r  )  [virtual]

Reimplemented from PhotonTransportModule.

Definition at line 25 of file PhotonCaldetNoise.cxx.

References ScintPhoton::Configure(), fDarkNoiseRate, fGreenNoiseRate, fNoiseWindow, Registry::Get(), Msg::kDebug, and MSG.

00026 {
00027   // The other classses in the model need configuring:
00028   ScintPhoton::Configure(r);
00029 
00030   MSG("Photon",Msg::kDebug) << "Configuring CaldetNoise." << std::endl;
00031 
00032   double tmpd;
00033   if (r.Get("DarkNoiseRate",tmpd))        fDarkNoiseRate = tmpd; 
00034   if (r.Get("GreenNoiseRate",tmpd))       fGreenNoiseRate = tmpd;
00035   if (r.Get("NoiseWindow",tmpd))          fNoiseWindow = tmpd;
00036 }

void PhotonCaldetNoise::MakeNoise ( std::vector< DigiPE * > &  peList,
Double_t  t_start,
Double_t  t_end 
) [virtual]

Reimplemented from PhotonTransportModule.

Definition at line 46 of file PhotonCaldetNoise.cxx.

References PhotonTransportModule::fContext, fDarkNoiseRate, fGreenNoiseRate, fNoiseWindow, PhotonTransportModule::fRandom, PlexMuxBoxId::GetElecType(), PlexPixelSpotId::IsValid(), DigiSignal::kDarkNoise, Msg::kDebug, DigiSignal::kFibreLight, ElecType::kQIE, ElecType::kVA, MSG, Munits::ns, PlexPixelSpotId::SetPixel(), and PlexPixelSpotId::SetSpot().

00049 {
00054 
00055   // Work out our window.
00056   double t1 = t_start - fNoiseWindow*0.5;
00057   double t2 = t_end   + fNoiseWindow*0.5;
00058   double dt = t2-t1;
00059 
00060   MSG("Photon",Msg::kDebug) << "Computing noise for window at" << t1 
00061                             << " s for " << (t2-t1)/Munits::ns << " ns." << std::endl;
00062 
00063   PlexHandle plex(fContext);
00064   // Get a list of PMTs from the Plex.
00065   const std::vector<PlexPixelSpotId>& tubes = plex.GetAllTubes();
00066   
00067   // How many PMT hits would we expect?
00068   Double_t pmtHits = (double)tubes.size() * dt * fDarkNoiseRate;
00069   // Now find the number that DID happen...
00070   Int_t nPmtHits = fRandom->Poisson(pmtHits);
00071   MSG("Photon",Msg::kDebug) << "Creating " << nPmtHits << " dark noise hits.\n";
00072   
00073   // Create the hits.
00074   for(int i=0; i<nPmtHits; i++) {
00075     // Pick a tube at random.
00076     Int_t whichPmt = fRandom->Integer((int)tubes.size());
00077     // Pick a pixelspot.
00078     PlexPixelSpotId psid = tubes[whichPmt];
00079     if(psid.GetElecType()==ElecType::kQIE) {
00080       psid.SetPixel(fRandom->Integer(64));
00081       psid.SetSpot(1);      
00082     }
00083     if(psid.GetElecType()==ElecType::kVA) {
00084       psid.SetPixel(fRandom->Integer(16));
00085       psid.SetSpot(fRandom->Integer(8)+1);      
00086     }
00087     if(psid.IsValid()) {
00088       DigiPE* pe = new DigiPE( fRandom->Uniform(t1,t2),
00089                                psid,
00090                                DigiSignal::kDarkNoise ); // No Scint Hit associated with the PE.
00091       peList.push_back(pe);
00092     }
00093   }
00094 
00095   // Get list of strip ends from the Plex.  
00096   const std::vector<PlexStripEndId>& stripEnds = plex.GetAllStripEnds();
00097 
00098   // How many fibre hits would we expect?
00099   Double_t fibreHits = (double)stripEnds.size() * dt * fGreenNoiseRate;
00100   // Now find the number that DID happen...
00101   Int_t nGreenHits = fRandom->Poisson(fibreHits);
00102   MSG("Photon",Msg::kDebug) << "Creating " << nGreenHits << " green WLS noise hits.\n";
00103   
00104   // Create the hits.
00105   for(int i=0; i<nGreenHits; i++) {
00106     // Pick a strip end at random.
00107     Int_t whichSeid = fRandom->Integer((int)stripEnds.size());
00108     
00109     PlexPixelSpotId psid = plex.GetPixelSpotId(stripEnds[whichSeid]);
00110 
00111     if(psid.IsValid()) {  
00112       DigiPE* pe =  new DigiPE( fRandom->Uniform(t1,t2),
00113                                 psid,
00114                                 DigiSignal::kFibreLight ); // No Scint Hit associated with the PE.
00115       peList.push_back(pe);
00116     }
00117   }
00118 
00119   
00120 }

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

Reimplemented from PhotonTransportModule.

Definition at line 123 of file PhotonCaldetNoise.cxx.

References Msg::kInfo, and MSG.

00124 {
00125   if(option[0]=='n') {
00126     MSG("Photon",Msg::kInfo) << "-<NoiseMaker>          PhotonCaldetNoise:-----" << endl;  
00127     //FIXME
00128   }
00129 }

void PhotonCaldetNoise::Reset ( const VldContext cx  )  [protected, virtual]

Reimplemented from PhotonTransportModule.

Definition at line 39 of file PhotonCaldetNoise.cxx.

00040 {
00041   // Ensure tables are up-to-date.
00042 }


Member Data Documentation

Double_t PhotonCaldetNoise::fDarkNoiseRate [private]

Definition at line 38 of file PhotonCaldetNoise.h.

Referenced by Configure(), and MakeNoise().

Double_t PhotonCaldetNoise::fGreenNoiseRate [private]

Definition at line 39 of file PhotonCaldetNoise.h.

Referenced by Configure(), and MakeNoise().

Double_t PhotonCaldetNoise::fNoiseWindow [private]

Definition at line 40 of file PhotonCaldetNoise.h.

Referenced by Configure(), and MakeNoise().


The documentation for this class was generated from the following files:
Generated on Thu Jul 10 22:53:29 2014 for loon by  doxygen 1.4.7