CMS 3D CMS Logo

HFCherenkov Class Reference

#include <SimG4CMS/Calo/interface/HFCherenkov.h>

List of all members.

Public Member Functions

void clearVectors ()
int computeNPE (G4ParticleDefinition *pDef, double pBeta, double u, double v, double w, double step_length, double zFiber, double Dose, int Npe_Dose)
int computeNPhTrapped (double pBeta, double u, double v, double w, double step_length, double zFiber, double Dose, int Npe_Dose)
std::vector< double > getMom ()
std::vector< double > getWL ()
std::vector< double > getWLAtten ()
std::vector< double > getWLHEM ()
std::vector< double > getWLIni ()
std::vector< double > getWLQEff ()
std::vector< double > getWLTrap ()
 HFCherenkov (edm::ParameterSet const &p)
double smearNPE (G4int Npe)
virtual ~HFCherenkov ()

Private Member Functions

double computeHEMEff (double wavelength)
int computeNbOfPhotons (double pBeta, double step_length)
double computeQEff (double wavelength)
bool isApplicable (const G4ParticleDefinition *aParticleType)

Private Attributes

double aperture
double apertureTrap
bool checkSurvive
double gain
double lambda1
double lambda2
std::vector< double > momZ
G4ThreeVector phMom
double ref_index
std::vector< double > wl
std::vector< double > wlatten
std::vector< double > wlhem
std::vector< double > wlini
std::vector< double > wlqeff
std::vector< double > wltrap


Detailed Description

Definition at line 18 of file HFCherenkov.h.


Constructor & Destructor Documentation

HFCherenkov::HFCherenkov ( edm::ParameterSet const &  p  ) 

Definition at line 11 of file HFCherenkov.cc.

References aperture, apertureTrap, checkSurvive, clearVectors(), funct::cos(), gain, edm::ParameterSet::getParameter(), lambda1, lambda2, funct::pow(), and ref_index.

00011                                                   {
00012 
00013   edm::ParameterSet m_HF = p.getParameter<edm::ParameterSet>("HFCherenkov");
00014   //Simple configurables
00015   //static SimpleConfigurable<double> p1(1.459, "HFCherenkov:RefIndex");
00016   //static SimpleConfigurable<double> p2(280.0, "HFCherenkov:Lambda1");
00017   //static SimpleConfigurable<double> p3(700.0, "HFCherenkov:Lambda2");
00018   //static SimpleConfigurable<double> p4(0.33,  "HFCherenkov:Aperture");
00019   //static SimpleConfigurable<double> p5(0.22,  "HFCherenkov:ApertureTrapped");
00020   //static SimpleConfigurable<double> p6(0.33,  "HFCherenkov:Gain");
00021   //static SimpleConfigurable<bool>   p7(false, "HFCherenkov:CheckSurvive");
00022 
00023   ref_index    = m_HF.getParameter<double>("RefIndex");
00024   lambda1      = ((m_HF.getParameter<double>("Lambda1"))/pow(double(10),7))*cm;
00025   lambda2      = ((m_HF.getParameter<double>("Lambda2"))/pow(double(10),7))*cm;
00026   aperture     = cos(asin(m_HF.getParameter<double>("Aperture")));
00027   apertureTrap = cos(asin(m_HF.getParameter<double>("ApertureTrapped")));
00028   gain         = m_HF.getParameter<double>("Gain");
00029   checkSurvive = m_HF.getParameter<bool>("CheckSurvive");
00030 
00031   edm::LogInfo("HFShower") << "HFCherenkov:: initialised with ref_index " 
00032                            << ref_index << " lambda1/lambda2 (cm) " 
00033                            << lambda1/cm << "/" << lambda2/cm
00034                            << " aperture(total/trapped) " << aperture << "/"
00035                            << apertureTrap << " Check photon survival in HF " 
00036                            << checkSurvive << " Gain " << gain;
00037 
00038   clearVectors();
00039 }

HFCherenkov::~HFCherenkov (  )  [virtual]

Definition at line 41 of file HFCherenkov.cc.

00041 {}


Member Function Documentation

void HFCherenkov::clearVectors (  ) 

Definition at line 285 of file HFCherenkov.cc.

References momZ, wl, wlatten, wlhem, wlini, wlqeff, and wltrap.

Referenced by computeNPE(), and HFCherenkov().

00285                                {
00286 
00287   wl.clear();
00288   wlini.clear();
00289   wltrap.clear();
00290   wlatten.clear();
00291   wlhem.clear();
00292   wlqeff.clear();
00293   momZ.clear();
00294 }

double HFCherenkov::computeHEMEff ( double  wavelength  )  [private]

Definition at line 244 of file HFCherenkov.cc.

References LogDebug.

Referenced by computeNPE().

00244                                                    {
00245 
00246   double hEMEff = 0;
00247   if (wavelength < 400.) {
00248     hEMEff = 0.;
00249   } else if (wavelength >= 400. && wavelength < 410.) {
00250     //hEMEff = .99 * (wavelength - 400.) / 10.;
00251     hEMEff = (-1322.453 / wavelength) + 4.2056;
00252   } else if (wavelength >= 410.) {
00253     hEMEff = 0.99;
00254     if (wavelength > 415. && wavelength < 445.) {
00255       //abs(wavelength - 430.) < 15.
00256       //hEMEff = 0.95;
00257       hEMEff = 0.97;
00258     } else if (wavelength > 550. && wavelength < 600.) { 
00259       // abs(wavelength - 575.) < 25.) 
00260       //hEMEff = 0.96;
00261       hEMEff = 0.98;
00262     } else if (wavelength > 565. && wavelength <= 635.) { // added later 
00263       // abs(wavelength - 600.) < 35.) 
00264       hEMEff = (701.7268 / wavelength) - 0.186;
00265     }
00266   }
00267   LogDebug("HFShower") << "HFCherenkov::computeHEMEff: wavelength " 
00268                        << wavelength << " hEMEff " << hEMEff;
00269   return hEMEff;
00270 }

int HFCherenkov::computeNbOfPhotons ( double  pBeta,
double  step_length 
) [private]

Referenced by computeNPE(), and computeNPhTrapped().

int HFCherenkov::computeNPE ( G4ParticleDefinition *  pDef,
double  pBeta,
double  u,
double  v,
double  w,
double  step_length,
double  zFiber,
double  Dose,
int  Npe_Dose 
)

Definition at line 85 of file HFCherenkov.cc.

References aperture, checkSurvive, clearVectors(), computeHEMEff(), computeNbOfPhotons(), computeQEff(), funct::cos(), funct::exp(), i, isApplicable(), lambda1, lambda2, LogDebug, momZ, funct::pow(), ref_index, funct::sin(), funct::sqrt(), wl, wlatten, wlhem, wlini, wlqeff, and wltrap.

Referenced by HFShower::getHits().

00088                                                        {
00089 
00090   clearVectors();
00091   if (!isApplicable(pDef)) {return 0;}
00092   if (pBeta < (1/ref_index) || step_length < 0.0001) {
00093     LogDebug("HFShower") << "HFCherenkov::computeNPE: pBeta " << pBeta 
00094                          << " 1/mu " << (1/ref_index) << " step_length " 
00095                          << step_length;
00096     return 0;
00097   }
00098    
00099   double uv = sqrt(u*u + v*v);
00100   int nbOfPhotons = computeNbOfPhotons(pBeta, step_length);
00101   LogDebug("HFShower") << "HFCherenkov::computeNPE: pBeta " << pBeta 
00102                        << " u/v/w " << u << "/" << v << "/" << w 
00103                        << " step_length " << step_length << " zFib " << zFiber 
00104                        << " nbOfPhotons " << nbOfPhotons;
00105    
00106   if (nbOfPhotons < 0) {
00107     return 0;
00108   } else if (nbOfPhotons > 0) {
00109     double u_ph, v_ph, w_ph=0;
00110     for (int i = 0; i < nbOfPhotons; i++) {
00111       double rand     = G4UniformRand();
00112       double theta_C  = acos(1./(pBeta*ref_index));
00113       double phi_C    = 2*M_PI*rand;
00114       double sinTheta = sin(theta_C);
00115       double cosTheta = cos(theta_C);
00116       double sinPhi   = sin(phi_C);
00117       double cosPhi   = cos(phi_C); 
00118       //photon momentum
00119       if (uv < 0.001) { // aligned with z-axis
00120         u_ph = sinTheta * cosPhi;
00121         v_ph = sinTheta * sinPhi;
00122         w_ph = cosTheta;
00123       } else { // general case
00124         u_ph = u * cosTheta  + sinTheta * (v*sinPhi + u*w*cosPhi)/ uv;
00125         v_ph = v * cosTheta  + sinTheta * (-u*sinPhi + v*w*cosPhi)/ uv;
00126         w_ph = w * cosTheta - sinTheta * cosPhi * uv;
00127       }
00128       double r_lambda = G4UniformRand();
00129       double lambda0 = (lambda1 * lambda2) / (lambda2 - r_lambda *
00130                                               (lambda2 - lambda1));
00131       double lambda  = (lambda0/cm) * pow(double(10),7); // lambda is in nm
00132       wlini.push_back(lambda);
00133       LogDebug("HFShower") << "HFCherenkov::computeNPE: " << i << " lambda " 
00134                            << lambda << " w_ph " << w_ph << " aperture " 
00135                            << aperture;
00136       if (w_ph > aperture) { // phton trapped inside fiber
00137         wltrap.push_back(lambda);
00138         double prob_HF  = 1.0; //photon survived in HF
00139         double a0_inv   = 0.1234;  //meter^-1
00140         double prob_MX  = exp( - 0.5 * a0_inv ); //light mixer
00141         if (checkSurvive) {
00142           double a_inv = a0_inv + 0.14 * pow(dose,0.30);
00143           double z_meters = zFiber;
00144           prob_HF  = exp(-z_meters * a_inv ); //photon survived in HF
00145         }
00146         rand = G4UniformRand();
00147         LogDebug("HFShower") << "HFCherenkov::computeNPE: probHF " << prob_HF
00148                              << " prob_MX " << prob_MX << " Random " << rand 
00149                              << " Survive? " << (rand < (prob_HF * prob_MX));
00150         if (rand < (prob_HF * prob_MX)) { // survived and sent to light mixer
00151           wlatten.push_back(lambda);
00152           rand = G4UniformRand();
00153           double effHEM = computeHEMEff(lambda);
00154           LogDebug("HFShower") << "HFCherenkov::computeNPE: w_ph " << w_ph 
00155                                << " effHEM " << effHEM << " Random " << rand 
00156                                << " Survive? " << (w_ph>0.997||(rand<effHEM));
00157           if (w_ph>0.997 || (rand<effHEM)) { // survived HEM
00158             wlhem.push_back(lambda);
00159             double qEffic = computeQEff(lambda);
00160             rand = G4UniformRand();
00161             LogDebug("HFShower") << "HFCherenkov::computeNPE: qEffic " 
00162                                  << qEffic << " Random " << rand 
00163                                  << " Survive? " <<(rand < qEffic);
00164             if (rand < qEffic) { // made photoelectron
00165               npe_Dose += 1;
00166               momZ.push_back(w_ph);
00167               wl.push_back(lambda);
00168               wlqeff.push_back(lambda);
00169             } // made pe
00170           } // passed HEM
00171         } // passed fiber
00172       } // end of  if(w_ph < w_aperture), trapped inside fiber
00173     }// end of ++NbOfPhotons
00174   } // end of if(NbOfPhotons)}
00175   int npe =  npe_Dose; // Nb of photoelectrons
00176   LogDebug("HFShower") << "HFCherenkov::computeNPE: npe " << npe;
00177   return npe;
00178 }

int HFCherenkov::computeNPhTrapped ( double  pBeta,
double  u,
double  v,
double  w,
double  step_length,
double  zFiber,
double  Dose,
int  Npe_Dose 
)

Definition at line 43 of file HFCherenkov.cc.

References apertureTrap, computeNbOfPhotons(), funct::cos(), i, ref_index, funct::sin(), and funct::sqrt().

00046                                                               {
00047    
00048   if (pBeta < (1/ref_index) || step_length < 0.0001) {return 0;}
00049    
00050   double uv = sqrt(u*u + v*v);
00051   int nbOfPhotons = computeNbOfPhotons(pBeta, step_length);
00052 
00053   if (nbOfPhotons < 0) {
00054     return 0;
00055   } else if (nbOfPhotons > 0) {
00056     double u_ph, v_ph, w_ph=0;
00057     for (int i = 0; i < nbOfPhotons; i++) {
00058       double rand     = G4UniformRand();
00059       double theta_C  = acos(1./(pBeta*ref_index));
00060       double phi_C    = 2*M_PI*rand;
00061       double sinTheta = sin(theta_C);
00062       double cosTheta = cos(theta_C);
00063       double sinPhi   = sin(phi_C);
00064       double cosPhi   = cos(phi_C); 
00065       //photon momentum
00066       if (uv < 0.001) { // aligned with z-axis
00067         u_ph = sinTheta * cosPhi;
00068         v_ph = sinTheta * sinPhi;
00069         w_ph = cosTheta;
00070       } else { // general case
00071         u_ph = u * cosTheta  + sinTheta * (v*sinPhi + u*w*cosPhi)/ uv;
00072         v_ph = v * cosTheta  + sinTheta * (-u*sinPhi + v*w*cosPhi)/ uv;
00073         w_ph = w * cosTheta  - sinTheta * cosPhi * uv;
00074       }
00075       if (w_ph > apertureTrap) { // phton trapped inside fiber
00076         npe_Dose += 1; 
00077       }
00078     }
00079   }
00080   int n_photons = npe_Dose;
00081   return n_photons;
00082 }

double HFCherenkov::computeQEff ( double  wavelength  )  [private]

Definition at line 233 of file HFCherenkov.cc.

References funct::exp(), stor::func(), LogDebug, funct::pow(), and y.

Referenced by computeNPE().

00233                                                  {
00234 
00235   double y        = (wavelength - 275.) /180.;
00236   double func     = 1. / (1. + 250.*pow((y/5.),4));
00237   double qE_R7525 = 0.77 * y * exp(-y) * func ;
00238   double qeff     = qE_R7525;
00239   LogDebug("HFShower") << "HFCherenkov::computeQEff: wavelength " << wavelength
00240                        << " y/func " << y << "/" << func << " qeff " << qeff;
00241   return qeff;
00242 }

std::vector< double > HFCherenkov::getMom (  ) 

Definition at line 210 of file HFCherenkov.cc.

References momZ, and v.

00210                                        {
00211   std::vector<double> v = momZ;
00212   return v;
00213 }

std::vector< double > HFCherenkov::getWL (  ) 

Definition at line 205 of file HFCherenkov.cc.

References v, and wl.

Referenced by HFShower::getHits().

00205                                       {
00206   std::vector<double> v = wl;
00207   return v;
00208 }

std::vector< double > HFCherenkov::getWLAtten (  ) 

Definition at line 190 of file HFCherenkov.cc.

References v, and wlatten.

00190                                            {
00191   std::vector<double> v = wlatten;
00192   return v;
00193 }

std::vector< double > HFCherenkov::getWLHEM (  ) 

Definition at line 195 of file HFCherenkov.cc.

References v, and wlhem.

00195                                          {
00196   std::vector<double> v  = wlhem;
00197   return v;
00198 }

std::vector< double > HFCherenkov::getWLIni (  ) 

Definition at line 180 of file HFCherenkov.cc.

References v, and wlini.

00180                                          {
00181   std::vector<double> v = wlini;
00182   return v;
00183 }

std::vector< double > HFCherenkov::getWLQEff (  ) 

Definition at line 200 of file HFCherenkov.cc.

References v, and wlqeff.

00200                                           {
00201   std::vector<double> v = wlqeff;
00202   return v;
00203 }

std::vector< double > HFCherenkov::getWLTrap (  ) 

Definition at line 185 of file HFCherenkov.cc.

References v, and wltrap.

00185                                           {
00186   std::vector<double> v = wltrap;
00187   return v;
00188 }

bool HFCherenkov::isApplicable ( const G4ParticleDefinition *  aParticleType  )  [private]

Definition at line 296 of file HFCherenkov.cc.

References LogDebug, and tmp.

Referenced by computeNPE().

00296                                                                         {
00297   bool tmp = (aParticleType->GetPDGCharge() != 0);
00298   LogDebug("HFShower") << "HFCherenkov::isApplicable: aParticleType " 
00299                        << aParticleType->GetParticleName() << " PDGCharge " 
00300                        << aParticleType->GetPDGCharge() << " Result " << tmp;
00301   return tmp;
00302 }

double HFCherenkov::smearNPE ( G4int  Npe  ) 


Member Data Documentation

double HFCherenkov::aperture [private]

Definition at line 57 of file HFCherenkov.h.

Referenced by computeNPE(), and HFCherenkov().

double HFCherenkov::apertureTrap [private]

Definition at line 57 of file HFCherenkov.h.

Referenced by computeNPhTrapped(), and HFCherenkov().

bool HFCherenkov::checkSurvive [private]

Definition at line 59 of file HFCherenkov.h.

Referenced by computeNPE(), and HFCherenkov().

double HFCherenkov::gain [private]

Definition at line 58 of file HFCherenkov.h.

Referenced by HFCherenkov().

double HFCherenkov::lambda1 [private]

Definition at line 56 of file HFCherenkov.h.

Referenced by computeNPE(), and HFCherenkov().

double HFCherenkov::lambda2 [private]

Definition at line 56 of file HFCherenkov.h.

Referenced by computeNPE(), and HFCherenkov().

std::vector<double> HFCherenkov::momZ [private]

Definition at line 63 of file HFCherenkov.h.

Referenced by clearVectors(), computeNPE(), and getMom().

G4ThreeVector HFCherenkov::phMom [private]

Definition at line 61 of file HFCherenkov.h.

double HFCherenkov::ref_index [private]

Definition at line 55 of file HFCherenkov.h.

Referenced by computeNPE(), computeNPhTrapped(), and HFCherenkov().

std::vector<double> HFCherenkov::wl [private]

Definition at line 62 of file HFCherenkov.h.

Referenced by clearVectors(), computeNPE(), and getWL().

std::vector<double> HFCherenkov::wlatten [private]

Definition at line 66 of file HFCherenkov.h.

Referenced by clearVectors(), computeNPE(), and getWLAtten().

std::vector<double> HFCherenkov::wlhem [private]

Definition at line 67 of file HFCherenkov.h.

Referenced by clearVectors(), computeNPE(), and getWLHEM().

std::vector<double> HFCherenkov::wlini [private]

Definition at line 64 of file HFCherenkov.h.

Referenced by clearVectors(), computeNPE(), and getWLIni().

std::vector<double> HFCherenkov::wlqeff [private]

Definition at line 68 of file HFCherenkov.h.

Referenced by clearVectors(), computeNPE(), and getWLQEff().

std::vector<double> HFCherenkov::wltrap [private]

Definition at line 65 of file HFCherenkov.h.

Referenced by clearVectors(), computeNPE(), and getWLTrap().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:10 2009 for CMSSW by  doxygen 1.5.4