FastJet 3.0.4
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 
00017 // This file is distributed with FastJet under the terms of the GNU
00018 // General Public License (v2). Permission to do so has been granted
00019 // by Lars Sonnenschein and the D0 collaboration (see COPYING for
00020 // details)
00021 //
00022 // History of changes in FastJet compared tothe original version of
00023 // HepEntity.h
00024 //
00025 // 2011-12-13  Gregory Soyez  <soyez@fastjet.fr>
00026 // 
00027 //        * added license information
00028 //
00029 // 2011-11-14  Gregory Soyez  <soyez@fastjet.fr>
00030 //
00031 //         * removed some harmless warnings coming with the -Wshadow gcc option
00032 // 
00033 // 2011-10-06  Gregory Soyez  <soyez@fastjet.fr>
00034 //
00035 //        * put the code in the fastjet::d0runi namespace
00036 
00037 class HepEntityIpre96 : public HepEntityI {
00038 
00039  public:
00040 
00041   HepEntityIpre96() {
00042     Et=0.;
00043     eta=0.;
00044     phi=0.;
00045     Ex=0.;
00046     Ey=0.;
00047     Ez=0.;
00048     index = -1;
00049     phi_pre96=0.;
00050     eta_pre96=0.;
00051 
00052     return;
00053   }
00054 
00055 
00056  HepEntityIpre96(double E_in, double px_in, double py_in, double pz_in,
00057                  int index_in = -1) : index(index_in) {
00058    //Snowmass Et scheme    
00059     double pt = sqrt(px_in*px_in+py_in*py_in);
00060     double p = sqrt(pt*pt+pz_in*pz_in);
00061     phi = inline_maths::phi(px_in,py_in);
00062     double theta = asin(pt/p);
00063     eta = inline_maths::eta(theta);
00064 
00065     Et = E_in*sin(theta);
00066 
00067     phi_pre96 = phi;
00068     eta_pre96 = eta;
00069 
00070     Ex = Et*cos(phi_pre96);
00071     Ey = Et*sin(phi_pre96);
00072     Ez = Et*sinh(eta_pre96);
00073   
00074     return;
00075   }
00076 
00077 
00078   inline double px() const {
00079     return Et*cos(phi_pre96);
00080   }
00081 
00082   inline double py() const {
00083     return Et*sin(phi_pre96);
00084   }
00085 
00086   inline double pz() const {
00087     return Et*sinh(eta_pre96);
00088   }
00089   
00090   inline double E() const {
00091     return Et*cosh(eta_pre96);
00092   }
00093   
00094  
00095   inline void Add(const HepEntityIpre96 el) {
00096     //assumes Et, eta and phi stored accurately
00097     double w2 = el.Et;
00098     Et += el.Et;
00099     w2 /= Et;
00100     
00101     eta += w2*(el.eta - eta);
00102     phi += w2*inline_maths::delta_phi(el.phi, phi); 
00103 
00104 
00105     Ex += el.Ex;
00106     Ey += el.Ey;
00107     Ez += el.Ez;
00108     phi_pre96 = atan2(Ey, Ex);
00109     double theta_pre96 = atan2(sqrt(Ex*Ex+Ey*Ey),Ez);
00110     eta_pre96 = -log(tan(theta_pre96/2.));
00111 
00112     return; 
00113   }
00114 
00115 
00116   inline void Fill(double E_in, double px_in, double py_in, double pz_in, int index_in) {
00117     double pt = sqrt(px_in*px_in+py_in*py_in);
00118     double p = sqrt(pt*pt+pz_in*pz_in);
00119     phi = inline_maths::phi(px_in,py_in);
00120     double theta = asin(pt/p);
00121     eta = inline_maths::eta(theta);
00122 
00123     Et = E_in*sin(theta);
00124 
00125     
00126     phi_pre96 = phi;
00127     eta_pre96 = eta;
00128 
00129     Ex = Et*cos(phi_pre96);
00130     Ey = Et*sin(phi_pre96);
00131     Ez = Et*sinh(eta_pre96);
00132 
00133     index = index_in;
00134 
00135     return;
00136   }
00137 
00138 
00139   double Ex;
00140   double Ey;
00141   double Ez;
00142   int index;
00143   double phi_pre96;
00144   double eta_pre96;
00145 
00146  private:
00147 
00148 
00149 
00150 };
00151 //end of class HepEntityIpre96;
00152 
00153 } // end of namespace d0runi
00154 
00155 FASTJET_END_NAMESPACE
00156 
00157 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends