FastJet 3.0.0
HepEntityIpre96.h
00001 #ifndef  D0RunIconeJets_HepEntityPre96_class
00002 #define  D0RunIconeJets_HepEntityPre96_class
00003 
00004 #include "inline_maths.h"
00005 #include "HepEntityI.h"
00006 #include <fastjet/internal/base.hh>
00007 
00008 FASTJET_BEGIN_NAMESPACE
00009 
00010 namespace d0runi{
00011 
00012 //Author: Lars Sonnenschein 25/Feb/2010
00013 //This is an example class fulfilling the minimal requirements needed by the
00014 //D0 RunI cone jet algorithm implementation prior to 1996, which is an inlined template class
00015 //See FERMILAB-Pub-97-242-E for details
00016 class HepEntityIpre96 : public HepEntityI {
00017 
00018  public:
00019 
00020   HepEntityIpre96() {
00021     Et=0.;
00022     eta=0.;
00023     phi=0.;
00024     Ex=0.;
00025     Ey=0.;
00026     Ez=0.;
00027     index = -1;
00028     phi_pre96=0.;
00029     eta_pre96=0.;
00030 
00031     return;
00032   }
00033 
00034 
00035  HepEntityIpre96(double E, double px, double py, double pz,
00036                  int index_in = -1) : index(index_in) {
00037    //Snowmass Et scheme    
00038     double pt = sqrt(px*px+py*py);
00039     double p = sqrt(pt*pt+pz*pz);
00040     phi = inline_maths::phi(px,py);
00041     double theta = asin(pt/p);
00042     eta = inline_maths::eta(theta);
00043 
00044     Et = E*sin(theta);
00045 
00046     phi_pre96 = phi;
00047     eta_pre96 = eta;
00048 
00049     Ex = Et*cos(phi_pre96);
00050     Ey = Et*sin(phi_pre96);
00051     Ez = Et*sinh(eta_pre96);
00052   
00053     return;
00054   }
00055 
00056 
00057   inline double px() const {
00058     return Et*cos(phi_pre96);
00059   }
00060 
00061   inline double py() const {
00062     return Et*sin(phi_pre96);
00063   }
00064 
00065   inline double pz() const {
00066     return Et*sinh(eta_pre96);
00067   }
00068   
00069   inline double E() const {
00070     return Et*cosh(eta_pre96);
00071   }
00072   
00073  
00074   inline void Add(const HepEntityIpre96 el) {
00075     //assumes Et, eta and phi stored accurately
00076     double w2 = el.Et;
00077     Et += el.Et;
00078     w2 /= Et;
00079     
00080     eta += w2*(el.eta - eta);
00081     phi += w2*inline_maths::delta_phi(el.phi, phi); 
00082 
00083 
00084     Ex += el.Ex;
00085     Ey += el.Ey;
00086     Ez += el.Ez;
00087     phi_pre96 = atan2(Ey, Ex);
00088     double theta_pre96 = atan2(sqrt(Ex*Ex+Ey*Ey),Ez);
00089     eta_pre96 = -log(tan(theta_pre96/2.));
00090 
00091     return; 
00092   }
00093 
00094 
00095   inline void Fill(double E, double px, double py, double pz, int index_in) {
00096     double pt = sqrt(px*px+py*py);
00097     double p = sqrt(pt*pt+pz*pz);
00098     phi = inline_maths::phi(px,py);
00099     double theta = asin(pt/p);
00100     eta = inline_maths::eta(theta);
00101 
00102     Et = E*sin(theta);
00103 
00104     
00105     phi_pre96 = phi;
00106     eta_pre96 = eta;
00107 
00108     Ex = Et*cos(phi_pre96);
00109     Ey = Et*sin(phi_pre96);
00110     Ez = Et*sinh(eta_pre96);
00111 
00112     index = index_in;
00113 
00114     return;
00115   }
00116 
00117 
00118   double Ex;
00119   double Ey;
00120   double Ez;
00121   int index;
00122   double phi_pre96;
00123   double eta_pre96;
00124 
00125  private:
00126 
00127 
00128 
00129 };
00130 //end of class HepEntityIpre96;
00131 
00132 } // end of namespace d0runi
00133 
00134 FASTJET_END_NAMESPACE
00135 
00136 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends