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

PhotonFullGreenTracker Class Reference

#include <PhotonFullGreenTracker.h>

Inheritance diagram for PhotonFullGreenTracker:

PhotonTransportModule List of all members.

Public Member Functions

 PhotonFullGreenTracker ()
virtual void Configure (const Registry &r)
virtual Bool_t GreenPhotonToPe (const UgliStripHandle &inStrip, DigiPhoton *inGreenPhoton, DigiPE *&outPe, StripEnd::StripEnd_t &outEnd)

Protected Member Functions

virtual void Reset (const VldContext &cx)

Private Member Functions

 ClassDef (PhotonFullGreenTracker, 1)

Private Attributes

PhotonLookupTable fFibreAbsorbTable
PhotonLookupTable fPmtEffTable
Double_t fReflectorFibreReflec
Double_t fFibreIndex
Double_t fClearFibreIndex

Constructor & Destructor Documentation

PhotonFullGreenTracker::PhotonFullGreenTracker  ) 
 

Definition at line 16 of file PhotonFullGreenTracker.cxx.

References MSG, and PhotonConfiguration().

00016                                                :
00017   fFibreAbsorbTable("PHOTONFIBREABSORB"),
00018   fPmtEffTable("PHOTONPMTQUANTUMEFFICIENCY")
00019 {
00020   Configure(PhotonConfiguration());
00021 
00022   if (fFibreAbsorbTable.GetNumRows()<1) {
00023     MSG("Photon",Msg::kError) << "Can't find data for table PHOTONFIBREABSORB. Aborting!\n";
00024     assert(0);
00025   }
00026   if (fPmtEffTable.GetNumRows()<1) {
00027     MSG("Photon",Msg::kError) << "Can't find data for table PHOTONPMTQUANTUMEFFICIENCY. Aborting!\n";
00028     assert(0);
00029   }
00030   // Set the prescale factors.
00031   SetGreenPrescaleFactor(
00032                          fPmtEffTable.GetMaximum()/100.
00033                          ); // Phototube photocathode acceptance.
00034   
00035 }


Member Function Documentation

PhotonFullGreenTracker::ClassDef PhotonFullGreenTracker  ,
[private]
 

void PhotonFullGreenTracker::Configure const Registry r  )  [virtual]
 

Reimplemented from PhotonTransportModule.

Definition at line 40 of file PhotonFullGreenTracker.cxx.

References fClearFibreIndex, fFibreIndex, fReflectorFibreReflec, Registry::Get(), and MSG.

00041 {
00042   MSG("Photon",Msg::kDebug) << "Configuring FullGreenTracker." << std::endl;
00043 
00044   double tmpd;
00045   if (r.Get("ReflectorFibreReflec",tmpd))         fReflectorFibreReflec  = tmpd;
00046   if (r.Get("FibreIndex",tmpd))                   fFibreIndex = tmpd;
00047   if (r.Get("ClearFibreIndex",tmpd))              fClearFibreIndex = tmpd;
00048 }

Bool_t PhotonFullGreenTracker::GreenPhotonToPe const UgliStripHandle inStrip,
DigiPhoton inGreenPhoton,
DigiPE *&  outPe,
StripEnd::StripEnd_t outEnd
[virtual]
 

Reimplemented from PhotonTransportModule.

Definition at line 71 of file PhotonFullGreenTracker.cxx.

References UgliStripHandle::ClearFiber(), fClearFibreIndex, fFibreAbsorbTable, fFibreIndex, fPmtEffTable, DigiPhoton::GetCosX(), PhotonTransportModule::GetGreenPrescaleFactor(), UgliStripHandle::GetHalfLength(), PlexHandle::GetPixelSpotId(), UgliStripHandle::GetSEId(), PhotonLookupTable::Interpolate(), UgliStripHandle::IsMirrored(), MSG, DigiPhoton::ParentHit(), UgliStripHandle::PartialLength(), PlexStripEndId::SetEnd(), DigiPhoton::T(), DigiPhoton::WaveLength(), UgliStripHandle::WlsBypass(), UgliStripHandle::WlsPigtail(), and DigiPhoton::X().

00075 {
00076   outPe = NULL;
00077   if(!inGreenPhoton) return false;
00078 
00079   // First, figure out which way we're going.
00080   StripEnd::StripEnd_t dir = 
00081     (inGreenPhoton->GetCosX()>0) ? StripEnd::kPositive : StripEnd::kNegative;
00082 
00083   StripEnd::StripEnd_t readout = dir; // Assume we're reading out the end it's going.
00084 
00085   // Is the end we've gotten to mirrored? 
00086   if(inStrip.IsMirrored(dir)) {
00087     // Ok, then we're going to need to flip it.
00088     // Does this photon survive the flip?
00089     if(fRandom->Rndm() > fReflectorFibreReflec) {
00090       return false;
00091     }
00092 
00093     // We survived the reflection.
00094     readout = (dir==StripEnd::kPositive) ? StripEnd::kNegative : StripEnd::kPositive;
00095   }
00096 
00097   // The photon is reflecting it's way down the strip.
00098   // Figure out how far it has to go in each medium.
00099 
00100   double distToCenter = (inGreenPhoton->GetCosX()>0) ? (-inGreenPhoton->X())
00101     : (inGreenPhoton->X());
00102 
00103   Double_t greenDist =
00104     distToCenter // Distance to center of strip.
00105     +inStrip.GetHalfLength()         // Distance to end of strip;
00106     +inStrip.WlsPigtail(readout); // Pigtail on readout end.
00107 
00108   MSG("Photon",Msg::kVerbose) << "Distance to center of strip: " << distToCenter 
00109                               << "  end= " << readout 
00110                               << "  halflen=" << inStrip.GetHalfLength()
00111                               << "  x="<<inGreenPhoton->X() 
00112                               << "  dx=" << inGreenPhoton->GetCosX() << endl;
00113 
00114 
00115   // Deal with WLS bypass, if any
00116   double bypassExtra = 0;
00117   if(inStrip.WlsBypass() >0) {    
00118     bypassExtra = ( inStrip.PartialLength(StripEnd::kNegative) + 
00119                     inStrip.PartialLength(StripEnd::kPositive) +
00120                     inStrip.WlsBypass() - 
00121                     inStrip.GetHalfLength()*2.0 );
00122 
00123     // place in the middle of the break;
00124     float x_break =0.5* (inStrip.PartialLength(StripEnd::kNegative) 
00125                          - inStrip.PartialLength(StripEnd::kPositive) );
00126 
00127     if(inGreenPhoton->X() < x_break) {
00128       // If the photon is at -ve end and going +ve, it goes through the bypass
00129       if(dir==StripEnd::kPositive)  greenDist+= bypassExtra;
00130     } else {
00131       // If the photon is at +ve end and going -ve, it goes through the bypass
00132       if(dir==StripEnd::kNegative)  greenDist+= bypassExtra;
00133     }
00134   }
00135 
00136   if(readout!=dir) {
00137     // i.e. we're going towards the mirror end but being read out on the non-mirror end
00138     greenDist+= inStrip.GetHalfLength()*2.0; // Gotta double back...
00139     greenDist+= bypassExtra;                 // ... through the ENTIRE green fibre
00140     greenDist+= inStrip.WlsPigtail(dir)*2.0; // And we have to go through the pigtail, if any
00141                                              // (N.B. This is for caldet, which has pigtails before the reflector)
00142   }
00143  
00144   // Find the distance down the clear strip.
00145   Double_t clearDist = inStrip.ClearFiber(readout);
00146 
00147   // But... we don't travel in a straight line!
00148   // We bounce around the fibre a lot. This makes the path length longer.
00149   greenDist /= fabs(inGreenPhoton->GetCosX());
00150   clearDist /= fabs(inGreenPhoton->GetCosX());
00151   
00152   MSG("Photon",Msg::kVerbose) << "After pathlength correction: greenDist = " << greenDist
00153                               << "  clearDist = " << clearDist << endl;
00154 
00155 
00156   double wavelength_nm = inGreenPhoton->WaveLength()/Munits::nm;
00157   if(wavelength_nm==0) wavelength_nm = 520; // Default.
00158   
00159   double greenLambda = fFibreAbsorbTable.Interpolate(wavelength_nm);
00160 
00161   // Compute the probablility we just lose it.
00162   // 1 is no attenuation, 0 is complete loss
00163   // So, a small number is a small attenuation prob.
00164   double greenAtten = exp(-greenDist/greenLambda);
00165 
00166   MSG("Photon",Msg::kVerbose) << "Green atten prob = " << greenAtten << endl;
00167   if(fRandom->Rndm() > greenAtten) return false;
00168 
00169   // Clear fibres:
00170   // These numbers are from the GMINOS defaults.
00171   const double lambda_c = 11.4; // meters
00172 
00173   // 1 is no attenuation, 0 is complete loss
00174   double clearAtten =   exp(-clearDist/lambda_c);
00175   
00176   MSG("Photon",Msg::kVerbose) << "Clear atten prob = " << clearAtten << endl;
00177   if(fRandom->Rndm() > clearAtten) return false;
00178   
00179   double eff = fPmtEffTable.Interpolate(wavelength_nm)/100.; // Convert from percent.
00180 
00181   // Apply prescaling.
00182   double prob = eff / GetGreenPrescaleFactor();
00183   
00184   MSG("Photon",Msg::kVerbose) << "Photocathode convert prob (" 
00185                               << wavelength_nm << " nm) = " << prob << endl;
00186   if(fRandom->Uniform() > prob) return false; // Didn't convert in cathode.
00187 
00188   // Build the resultant digipe.
00189   // Find the time of arrival.
00190   double time = inGreenPhoton->T()
00191     + greenDist * fFibreIndex / Munits::c_light
00192     + clearDist * fClearFibreIndex / Munits::c_light;
00193 
00194   PlexStripEndId seid =  inStrip.GetSEId();
00195   seid.SetEnd(readout);
00196 
00197   PlexHandle plex(fContext);
00198   PlexPixelSpotId psid = plex.GetPixelSpotId(seid);
00199 
00200   outPe = new DigiPE( time, psid, inGreenPhoton->ParentHit() );
00201   outEnd = readout;
00202 
00203   return true;  
00204 }

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

Reimplemented from PhotonTransportModule.

Definition at line 52 of file PhotonFullGreenTracker.cxx.

References fFibreAbsorbTable, fPmtEffTable, PhotonLookupTable::GetMaximum(), PhotonLookupTable::Reset(), and PhotonTransportModule::SetGreenPrescaleFactor().

00053 {
00054   fFibreAbsorbTable.Reset(cx);
00055   fPmtEffTable.Reset(cx);
00056   // Set the prescale factors.
00057   SetGreenPrescaleFactor(
00058                          fPmtEffTable.GetMaximum()/100.
00059                          ); // Phototube photocathode acceptance.
00060   
00061 }


Member Data Documentation

Double_t PhotonFullGreenTracker::fClearFibreIndex [private]
 

Definition at line 40 of file PhotonFullGreenTracker.h.

Referenced by Configure(), and GreenPhotonToPe().

PhotonLookupTable PhotonFullGreenTracker::fFibreAbsorbTable [private]
 

Definition at line 36 of file PhotonFullGreenTracker.h.

Referenced by GreenPhotonToPe(), and Reset().

Double_t PhotonFullGreenTracker::fFibreIndex [private]
 

Definition at line 39 of file PhotonFullGreenTracker.h.

Referenced by Configure(), and GreenPhotonToPe().

PhotonLookupTable PhotonFullGreenTracker::fPmtEffTable [private]
 

Definition at line 37 of file PhotonFullGreenTracker.h.

Referenced by GreenPhotonToPe(), and Reset().

Double_t PhotonFullGreenTracker::fReflectorFibreReflec [private]
 

Definition at line 38 of file PhotonFullGreenTracker.h.

Referenced by Configure().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:02 2010 for loon by  doxygen 1.3.9.1