D0_1996_S3214044.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/FastJets.hh"
00007 #include "Rivet/Math/LorentzTrans.hh"
00008 #include "Rivet/Math/Vector3.hh"
00009 #include "Rivet/Math/Units.hh"
00010 
00011 namespace Rivet {
00012 
00013 
00014   /// @brief D0 topological distributions of 3- and 4-jet events.
00015   class D0_1996_S3214044 : public Analysis {
00016   public:
00017 
00018     /// @name Constructors etc.
00019     //@{
00020 
00021     /// Constructor
00022     D0_1996_S3214044() : Analysis("D0_1996_S3214044")
00023     {
00024       setBeams(PROTON, ANTIPROTON);
00025       setNeedsCrossSection(false);
00026     }
00027 
00028 
00029     /// @name Analysis methods
00030     //@{
00031 
00032     /// Book histograms
00033     void init() {
00034       const FinalState fs;
00035       addProjection(fs, "FS");
00036       /// @todo Use correct jet algorithm
00037       addProjection(FastJets(fs, FastJets::D0ILCONE, 0.7), "ConeJets");
00038 
00039       _h_3j_x3 = bookHistogram1D(1, 1, 1);
00040       _h_3j_x5 = bookHistogram1D(2, 1, 1);
00041       _h_3j_costheta3 = bookHistogram1D(3, 1, 1);
00042       _h_3j_psi = bookHistogram1D(4, 1, 1);
00043       _h_3j_mu34 = bookHistogram1D(5, 1, 1);
00044       _h_3j_mu35 = bookHistogram1D(6, 1, 1);
00045       _h_3j_mu45 = bookHistogram1D(7, 1, 1);
00046 
00047       _h_4j_x3 = bookHistogram1D(8, 1, 1);
00048       _h_4j_x4 = bookHistogram1D(9, 1, 1);
00049       _h_4j_x5 = bookHistogram1D(10, 1, 1);
00050       _h_4j_x6 = bookHistogram1D(11, 1, 1);
00051       _h_4j_costheta3 = bookHistogram1D(12, 1, 1);
00052       _h_4j_costheta4 = bookHistogram1D(13, 1, 1);
00053       _h_4j_costheta5 = bookHistogram1D(14, 1, 1);
00054       _h_4j_costheta6 = bookHistogram1D(15, 1, 1);
00055       _h_4j_cosomega34 = bookHistogram1D(16, 1, 1);
00056       _h_4j_cosomega35 = bookHistogram1D(17, 1, 1);
00057       _h_4j_cosomega36 = bookHistogram1D(18, 1, 1);
00058       _h_4j_cosomega45 = bookHistogram1D(19, 1, 1);
00059       _h_4j_cosomega46 = bookHistogram1D(20, 1, 1);
00060       _h_4j_cosomega56 = bookHistogram1D(21, 1, 1);
00061       _h_4j_mu34 = bookHistogram1D(22, 1, 1);
00062       _h_4j_mu35 = bookHistogram1D(23, 1, 1);
00063       _h_4j_mu36 = bookHistogram1D(24, 1, 1);
00064       _h_4j_mu45 = bookHistogram1D(25, 1, 1);
00065       _h_4j_mu46 = bookHistogram1D(26, 1, 1);
00066       _h_4j_mu56 = bookHistogram1D(27, 1, 1);
00067       _h_4j_theta_BZ = bookHistogram1D(28, 1, 1);
00068       _h_4j_costheta_NR = bookHistogram1D(29, 1, 1);
00069 
00070     }
00071 
00072 
00073     void analyze(const Event& event) {
00074       const double weight = event.weight();
00075 
00076       Jets jets_in;
00077       foreach (const Jet& jet, applyProjection<FastJets>(event, "ConeJets").jetsByEt(20.0*GeV)) {
00078         if (fabs(jet.momentum().eta()) < 3.0) {
00079           jets_in.push_back(jet);
00080         }
00081       }
00082 
00083       Jets jets_isolated;
00084       for (size_t i = 0; i < jets_in.size(); ++i) {
00085         bool isolated=true;
00086         for (size_t j = 0; j < jets_in.size(); ++j) {
00087           if (i != j && deltaR(jets_in[i].momentum(), jets_in[j].momentum()) < 1.4) {
00088             isolated = false;
00089             break;
00090           }
00091         }
00092         if (isolated) {
00093           jets_isolated.push_back(jets_in[i]);
00094         }
00095       }
00096 
00097       if (jets_isolated.size() == 0 || jets_isolated[0].momentum().Et() < 60.0*GeV) {
00098         vetoEvent;
00099       }
00100 
00101       if (jets_isolated.size() > 2) _threeJetAnalysis(jets_isolated, weight);
00102       if (jets_isolated.size() > 3) _fourJetAnalysis(jets_isolated, weight);
00103     }
00104 
00105 
00106     void finalize() {
00107       normalize(_h_3j_x3, 1.0);
00108       normalize(_h_3j_x5, 1.0);
00109       normalize(_h_3j_costheta3, 1.0);
00110       normalize(_h_3j_psi, 1.0);
00111       normalize(_h_3j_mu34, 1.0);
00112       normalize(_h_3j_mu35, 1.0);
00113       normalize(_h_3j_mu45, 1.0);
00114       normalize(_h_4j_x3, 1.0);
00115       normalize(_h_4j_x4, 1.0);
00116       normalize(_h_4j_x5, 1.0);
00117       normalize(_h_4j_x6, 1.0);
00118       normalize(_h_4j_costheta3, 1.0);
00119       normalize(_h_4j_costheta4, 1.0);
00120       normalize(_h_4j_costheta5, 1.0);
00121       normalize(_h_4j_costheta6, 1.0);
00122       normalize(_h_4j_cosomega34, 1.0);
00123       normalize(_h_4j_cosomega35, 1.0);
00124       normalize(_h_4j_cosomega36, 1.0);
00125       normalize(_h_4j_cosomega45, 1.0);
00126       normalize(_h_4j_cosomega46, 1.0);
00127       normalize(_h_4j_cosomega56, 1.0);
00128       normalize(_h_4j_mu34, 1.0);
00129       normalize(_h_4j_mu35, 1.0);
00130       normalize(_h_4j_mu36, 1.0);
00131       normalize(_h_4j_mu45, 1.0);
00132       normalize(_h_4j_mu46, 1.0);
00133       normalize(_h_4j_mu56, 1.0);
00134       normalize(_h_4j_theta_BZ, 1.0);
00135       normalize(_h_4j_costheta_NR, 1.0);
00136     }
00137 
00138     //@}
00139 
00140 
00141   private:
00142 
00143     /// @name Helper functions
00144     //@{
00145 
00146     void _threeJetAnalysis(const Jets& jets, const double& weight) {
00147       // >=3 jet events
00148       FourMomentum jjj(jets[0].momentum()+jets[1].momentum()+jets[2].momentum());
00149       const double sqrts = _safeMass(jjj);
00150       if (sqrts<200*GeV) {
00151         return;
00152       }
00153 
00154       LorentzTransform cms_boost(-jjj.boostVector());
00155       vector<FourMomentum> jets_boosted;
00156       foreach (Jet jet, jets) {
00157         jets_boosted.push_back(cms_boost.transform(jet.momentum()));
00158       }
00159       std::sort(jets_boosted.begin(), jets_boosted.end(), FourMomentum::byEDescending());
00160       FourMomentum p3(jets_boosted[0]);
00161       FourMomentum p4(jets_boosted[1]);
00162       FourMomentum p5(jets_boosted[2]);
00163 
00164       Vector3 beam1(0.0, 0.0, 1.0);
00165       Vector3 p1xp3 = beam1.cross(p3.vector3());
00166       Vector3 p4xp5 = p4.vector3().cross(p5.vector3());
00167       const double cospsi = p1xp3.dot(p4xp5)/p1xp3.mod()/p4xp5.mod();
00168 
00169       _h_3j_x3->fill(2.0*p3.E()/sqrts, weight);
00170       _h_3j_x5->fill(2.0*p5.E()/sqrts, weight);
00171       _h_3j_costheta3->fill(fabs(cos(p3.theta())), weight);
00172       _h_3j_psi->fill(acos(cospsi)/degree, weight);
00173       _h_3j_mu34->fill(_safeMass(FourMomentum(p3+p4))/sqrts, weight);
00174       _h_3j_mu35->fill(_safeMass(FourMomentum(p3+p5))/sqrts, weight);
00175       _h_3j_mu45->fill(_safeMass(FourMomentum(p4+p5))/sqrts, weight);
00176     }
00177 
00178 
00179     void _fourJetAnalysis(const Jets& jets, const double& weight) {
00180       // >=4 jet events
00181       FourMomentum jjjj(jets[0].momentum() + jets[1].momentum() + jets[2].momentum()+ jets[3].momentum());
00182       const double sqrts = _safeMass(jjjj);
00183       if (sqrts < 200*GeV) return;
00184 
00185       LorentzTransform cms_boost(-jjjj.boostVector());
00186       vector<FourMomentum> jets_boosted;
00187       foreach (Jet jet, jets) {
00188         jets_boosted.push_back(cms_boost.transform(jet.momentum()));
00189       }
00190       sort(jets_boosted.begin(), jets_boosted.end(), FourMomentum::byEDescending());
00191       FourMomentum p3(jets_boosted[0]);
00192       FourMomentum p4(jets_boosted[1]);
00193       FourMomentum p5(jets_boosted[2]);
00194       FourMomentum p6(jets_boosted[3]);
00195 
00196       Vector3 p3xp4 = p3.vector3().cross(p4.vector3());
00197       Vector3 p5xp6 = p5.vector3().cross(p6.vector3());
00198       const double costheta_BZ = p3xp4.dot(p5xp6)/p3xp4.mod()/p5xp6.mod();
00199       const double costheta_NR = (p3.vector3()-p4.vector3()).dot(p5.vector3()-p6.vector3())/
00200         (p3.vector3()-p4.vector3()).mod()/(p5.vector3()-p6.vector3()).mod();
00201 
00202       _h_4j_x3->fill(2.0*p3.E()/sqrts, weight);
00203       _h_4j_x4->fill(2.0*p4.E()/sqrts, weight);
00204       _h_4j_x5->fill(2.0*p5.E()/sqrts, weight);
00205       _h_4j_x6->fill(2.0*p6.E()/sqrts, weight);
00206       _h_4j_costheta3->fill(fabs(cos(p3.theta())), weight);
00207       _h_4j_costheta4->fill(fabs(cos(p4.theta())), weight);
00208       _h_4j_costheta5->fill(fabs(cos(p5.theta())), weight);
00209       _h_4j_costheta6->fill(fabs(cos(p6.theta())), weight);
00210       _h_4j_cosomega34->fill(cos(p3.angle(p4)), weight);
00211       _h_4j_cosomega35->fill(cos(p3.angle(p5)), weight);
00212       _h_4j_cosomega36->fill(cos(p3.angle(p6)), weight);
00213       _h_4j_cosomega45->fill(cos(p4.angle(p5)), weight);
00214       _h_4j_cosomega46->fill(cos(p4.angle(p6)), weight);
00215       _h_4j_cosomega56->fill(cos(p5.angle(p6)), weight);
00216       _h_4j_mu34->fill(_safeMass(FourMomentum(p3+p4))/sqrts, weight);
00217       _h_4j_mu35->fill(_safeMass(FourMomentum(p3+p5))/sqrts, weight);
00218       _h_4j_mu36->fill(_safeMass(FourMomentum(p3+p6))/sqrts, weight);
00219       _h_4j_mu45->fill(_safeMass(FourMomentum(p4+p5))/sqrts, weight);
00220       _h_4j_mu46->fill(_safeMass(FourMomentum(p4+p6))/sqrts, weight);
00221       _h_4j_mu56->fill(_safeMass(FourMomentum(p5+p6))/sqrts, weight);
00222       _h_4j_theta_BZ->fill(acos(costheta_BZ)/degree, weight);
00223       _h_4j_costheta_NR->fill(costheta_NR, weight);
00224 
00225     }
00226 
00227     double _safeMass(const FourMomentum& p) {
00228       double mass2=p.mass2();
00229       if (mass2>0.0) return sqrt(mass2);
00230       else if (mass2<-1.0e-5) {
00231         getLog() << Log::WARNING << "m2 = " << m2 << ". Assuming m2=0." << endl;
00232         return 0.0;
00233       }
00234       else return 0.0;
00235     }
00236 
00237   private:
00238 
00239     /// @name Histograms
00240     //@{
00241 
00242     AIDA::IHistogram1D *_h_3j_x3;
00243     AIDA::IHistogram1D *_h_3j_x5;
00244     AIDA::IHistogram1D *_h_3j_costheta3;
00245     AIDA::IHistogram1D *_h_3j_psi;
00246     AIDA::IHistogram1D *_h_3j_mu34;
00247     AIDA::IHistogram1D *_h_3j_mu35;
00248     AIDA::IHistogram1D *_h_3j_mu45;
00249 
00250     AIDA::IHistogram1D *_h_4j_x3;
00251     AIDA::IHistogram1D *_h_4j_x4;
00252     AIDA::IHistogram1D *_h_4j_x5;
00253     AIDA::IHistogram1D *_h_4j_x6;
00254     AIDA::IHistogram1D *_h_4j_costheta3;
00255     AIDA::IHistogram1D *_h_4j_costheta4;
00256     AIDA::IHistogram1D *_h_4j_costheta5;
00257     AIDA::IHistogram1D *_h_4j_costheta6;
00258     AIDA::IHistogram1D *_h_4j_cosomega34;
00259     AIDA::IHistogram1D *_h_4j_cosomega35;
00260     AIDA::IHistogram1D *_h_4j_cosomega36;
00261     AIDA::IHistogram1D *_h_4j_cosomega45;
00262     AIDA::IHistogram1D *_h_4j_cosomega46;
00263     AIDA::IHistogram1D *_h_4j_cosomega56;
00264     AIDA::IHistogram1D *_h_4j_mu34;
00265     AIDA::IHistogram1D *_h_4j_mu35;
00266     AIDA::IHistogram1D *_h_4j_mu36;
00267     AIDA::IHistogram1D *_h_4j_mu45;
00268     AIDA::IHistogram1D *_h_4j_mu46;
00269     AIDA::IHistogram1D *_h_4j_mu56;
00270     AIDA::IHistogram1D *_h_4j_theta_BZ;
00271     AIDA::IHistogram1D *_h_4j_costheta_NR;
00272     //@}
00273 
00274   };
00275 
00276 
00277   // This global object acts as a hook for the plugin system
00278   AnalysisBuilder<D0_1996_S3214044> plugin_D0_1996_S3214044;
00279 
00280 }