rivet is hosted by Hepforge, IPPP Durham
CDF_1996_S3349578.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 #include "Rivet/Projections/SmearedJets.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief CDF properties of high-mass multi-jet events
00011   class CDF_1996_S3349578 : public Analysis {
00012   public:
00013 
00014     /// @name Constructors etc.
00015     //@{
00016 
00017     /// Constructor
00018     CDF_1996_S3349578()
00019       : Analysis("CDF_1996_S3349578")
00020     {
00021     }
00022 
00023     //@}
00024 
00025 
00026     /// @name Analysis methods
00027     //@{
00028 
00029     /// Book histograms and initialise projections before the run
00030     void init() {
00031 
00032       /// Initialise and register projections here
00033       const FinalState fs(-4.2, 4.2);
00034       FastJets fj(fs, FastJets::CDFJETCLU, 0.7);
00035       declare(fj, "Jets");
00036       
00037       // Smear Energy and mass with the 10% uncertainty quoted in the paper
00038       SmearedJets sj_E(fj, [](const Jet& jet){ return P4_SMEAR_MASS_GAUSS(P4_SMEAR_E_GAUSS(jet, 0.1*jet.E()), 0.1*jet.mass()); });
00039       declare(sj_E, "SmearedJets");
00040 
00041       /// Book histograms here, e.g.:
00042       _h_3_mNJ = bookHisto1D(1, 1, 1);
00043       _h_3_X3 = bookHisto1D(2, 1, 1);
00044       _h_3_X4 = bookHisto1D(3, 1, 1);
00045       _h_3_costheta3 = bookHisto1D(8, 1, 1);
00046       _h_3_psi3 = bookHisto1D(9, 1, 1);
00047       _h_3_f3 = bookHisto1D(14, 1, 1);
00048       _h_3_f4 = bookHisto1D(14, 1, 2);
00049       _h_3_f5 = bookHisto1D(14, 1, 3);
00050 
00051       _h_4_mNJ = bookHisto1D(1, 1, 2);
00052       _h_4_X3 = bookHisto1D(4, 1, 1);
00053       _h_4_X4 = bookHisto1D(5, 1, 1);
00054       _h_4_costheta3 = bookHisto1D(10, 1, 1);
00055       _h_4_psi3 = bookHisto1D(11, 1, 1);
00056       _h_4_f3 = bookHisto1D(15, 1, 1);
00057       _h_4_f4 = bookHisto1D(15, 1, 2);
00058       _h_4_f5 = bookHisto1D(15, 1, 3);
00059       _h_4_XA = bookHisto1D(17, 1, 1);
00060       _h_4_psiAB = bookHisto1D(19, 1, 1);
00061       _h_4_fA = bookHisto1D(21, 1, 1);
00062       _h_4_fB = bookHisto1D(21, 1, 2);
00063 
00064       _h_5_mNJ = bookHisto1D(1, 1, 3);
00065       _h_5_X3 = bookHisto1D(6, 1, 1);
00066       _h_5_X4 = bookHisto1D(7, 1, 1);
00067       _h_5_costheta3 = bookHisto1D(12, 1, 1);
00068       _h_5_psi3 = bookHisto1D(13, 1, 1);
00069       _h_5_f3 = bookHisto1D(16, 1, 1);
00070       _h_5_f4 = bookHisto1D(16, 1, 2);
00071       _h_5_f5 = bookHisto1D(16, 1, 3);
00072       _h_5_XA = bookHisto1D(18, 1, 1);
00073       _h_5_XC = bookHisto1D(18, 1, 2);
00074       _h_5_psiAB = bookHisto1D(20, 1, 1);
00075       _h_5_psiCD = bookHisto1D(20, 1, 2);
00076       _h_5_fA = bookHisto1D(22, 1, 1);
00077       _h_5_fB = bookHisto1D(23, 1, 1);
00078       _h_5_fC = bookHisto1D(24, 1, 1);
00079       _h_5_fD = bookHisto1D(25, 1, 1);
00080 
00081     }
00082 
00083 
00084     void analyze(const Event& event) {
00085       Jets jets;
00086       FourMomentum jetsystem(0.0, 0.0, 0.0, 0.0);
00087       foreach (const Jet& jet, apply<JetAlg>(event, "SmearedJets").jets(Cuts::Et > 20.0*GeV, cmpMomByEt)) {
00088         bool separated = true;
00089         foreach (const Jet& ref, jets) {
00090           if (deltaR(jet, ref) < 0.9) {
00091             separated = false;
00092             break;
00093           }
00094         }
00095         if (!separated) continue;
00096         jets.push_back(jet);
00097         jetsystem += jet.momentum();
00098         if (jets.size() >= 5) break;
00099       }
00100 
00101       const double weight = event.weight();
00102       if (jets.size() > 4) {
00103         _fiveJetAnalysis(jets, weight);
00104         jets.resize(4);
00105       }
00106       if (jets.size() > 3) {
00107         _fourJetAnalysis(jets, weight);
00108         jets.resize(3);
00109       }
00110       if (jets.size() > 2) {
00111         _threeJetAnalysis(jets, weight);
00112       }
00113     }
00114 
00115 
00116     void _threeJetAnalysis(const Jets& jets, const double& weight) {
00117       MSG_DEBUG("3 jet analysis");
00118 
00119       double sumEt = 0.0;
00120       FourMomentum jetsystem(0.0, 0.0, 0.0, 0.0);
00121       foreach (const Jet& jet, jets) {
00122         sumEt += jet.Et();
00123         jetsystem += jet.momentum();
00124       }
00125       if (sumEt < 420.0*GeV) return;
00126 
00127       const double m3J = _safeMass(jetsystem);
00128       if (m3J < 600*GeV) return;
00129 
00130       const LorentzTransform cms_boost = LorentzTransform::mkFrameTransformFromBeta(jetsystem.betaVec());
00131       vector<FourMomentum> jets3;
00132       foreach (Jet jet, jets) {
00133         jets3.push_back(cms_boost.transform(jet.momentum()));
00134       }
00135       std::sort(jets3.begin(), jets3.end(), FourMomentum::byEDescending());
00136       FourMomentum p3(jets3[0]), p4(jets3[1]), p5(jets3[2]);
00137 
00138       FourMomentum pAV = cms_boost.transform(_avg_beam_in_lab(m3J, jetsystem.rapidity()));
00139       double costheta3 = pAV.p3().unit().dot(p3.p3().unit());
00140       if (fabs(costheta3) > 0.6) return;
00141 
00142       double X3 = 2.0*p3.E()/m3J;
00143       if (X3 > 0.9) return;
00144 
00145       const double X4 = 2.0*p4.E()/m3J;
00146       const double psi3 = _psi(p3, pAV, p4, p5);
00147       const double f3 = _safeMass(p3)/m3J;
00148       const double f4 = _safeMass(p4)/m3J;
00149       const double f5 = _safeMass(p5)/m3J;
00150 
00151       _h_3_mNJ->fill(m3J, weight);
00152       _h_3_X3->fill(X3, weight);
00153       _h_3_X4->fill(X4, weight);
00154       _h_3_costheta3->fill(costheta3, weight);
00155       _h_3_psi3->fill(psi3, weight);
00156       _h_3_f3->fill(f3, weight);
00157       _h_3_f4->fill(f4, weight);
00158       _h_3_f5->fill(f5, weight);
00159 
00160     }
00161 
00162 
00163 
00164 
00165     void _fourJetAnalysis(const Jets& jets, const double& weight) {
00166       MSG_DEBUG("4 jet analysis");
00167 
00168       double sumEt=0.0;
00169       FourMomentum jetsystem(0.0, 0.0, 0.0, 0.0);
00170       foreach (const Jet& jet, jets) {
00171         sumEt+=jet.Et();
00172         jetsystem+=jet.momentum();
00173       }
00174       if (sumEt < 420.0*GeV) return;
00175 
00176       const double m4J = _safeMass(jetsystem);
00177       if (m4J < 650*GeV) return;
00178 
00179       const LorentzTransform cms_boost = LorentzTransform::mkFrameTransformFromBeta(jetsystem.betaVec());
00180       vector<FourMomentum> jets4;
00181       foreach (Jet jet, jets) {
00182         jets4.push_back(cms_boost.transform(jet.momentum()));
00183       }
00184       std::sort(jets4.begin(), jets4.end(), FourMomentum::byEDescending());
00185 
00186       FourMomentum pA, pB;
00187       vector<FourMomentum> jets3(_reduce(jets4, pA, pB));
00188       std::sort(jets3.begin(), jets3.end(), FourMomentum::byEDescending());
00189       FourMomentum p3(jets3[0]);
00190       FourMomentum p4(jets3[1]);
00191       FourMomentum p5(jets3[2]);
00192 
00193       FourMomentum pAV = cms_boost.transform(_avg_beam_in_lab(m4J, jetsystem.rapidity()));
00194       double costheta3=pAV.p3().unit().dot(p3.p3().unit());
00195       if (fabs(costheta3)>0.8) {
00196         return;
00197       }
00198 
00199       const double X3 = 2.0*p3.E()/m4J;
00200       if (X3>0.9) {
00201         return;
00202       }
00203 
00204       // fill histograms
00205       const double X4 = 2.0*p4.E()/m4J;
00206       const double psi3 = _psi(p3, pAV, p4, p5);
00207       const double f3 = _safeMass(p3)/m4J;
00208       const double f4 = _safeMass(p4)/m4J;
00209       const double f5 = _safeMass(p5)/m4J;
00210       const double fA = _safeMass(pA)/m4J;
00211       const double fB = _safeMass(pB)/m4J;
00212       const double XA = pA.E()/(pA.E()+pB.E());
00213       const double psiAB = _psi(pA, pB, pA+pB, pAV);
00214 
00215       _h_4_mNJ->fill(m4J, weight);
00216       _h_4_X3->fill(X3, weight);
00217       _h_4_X4->fill(X4, weight);
00218       _h_4_costheta3->fill(costheta3, weight);
00219       _h_4_psi3->fill(psi3, weight);
00220       _h_4_f3->fill(f3, weight);
00221       _h_4_f4->fill(f4, weight);
00222       _h_4_f5->fill(f5, weight);
00223       _h_4_XA->fill(XA, weight);
00224       _h_4_psiAB->fill(psiAB, weight);
00225       _h_4_fA->fill(fA, weight);
00226       _h_4_fB->fill(fB, weight);
00227     }
00228 
00229 
00230 
00231 
00232     void _fiveJetAnalysis(const Jets& jets, const double& weight) {
00233       MSG_DEBUG("5 jet analysis");
00234 
00235       double sumEt=0.0;
00236       FourMomentum jetsystem(0.0, 0.0, 0.0, 0.0);
00237       foreach (const Jet& jet, jets) {
00238         sumEt+=jet.Et();
00239         jetsystem+=jet.momentum();
00240       }
00241       if (sumEt < 420.0*GeV) return;
00242 
00243       const double m5J = _safeMass(jetsystem);
00244       if (m5J < 750*GeV) return;
00245 
00246       const LorentzTransform cms_boost = LorentzTransform::mkFrameTransformFromBeta(jetsystem.betaVec());
00247       vector<FourMomentum> jets5;
00248       foreach (Jet jet, jets) {
00249         jets5.push_back(cms_boost.transform(jet.momentum()));
00250       }
00251       std::sort(jets5.begin(), jets5.end(), FourMomentum::byEDescending());
00252 
00253       FourMomentum pC, pD;
00254       vector<FourMomentum> jets4(_reduce(jets5, pC, pD));
00255       std::sort(jets4.begin(), jets4.end(), FourMomentum::byEDescending());
00256 
00257       FourMomentum pA, pB;
00258       vector<FourMomentum> jets3(_reduce(jets4, pA, pB));
00259       std::sort(jets3.begin(), jets3.end(), FourMomentum::byEDescending());
00260       FourMomentum p3(jets3[0]);
00261       FourMomentum p4(jets3[1]);
00262       FourMomentum p5(jets3[2]);
00263 
00264       // fill histograms
00265       FourMomentum pAV = cms_boost.transform(_avg_beam_in_lab(m5J, jetsystem.rapidity()));
00266       const double costheta3 = pAV.p3().unit().dot(p3.p3().unit());
00267       const double X3 = 2.0*p3.E()/m5J;
00268       const double X4 = 2.0*p4.E()/m5J;
00269       const double psi3 = _psi(p3, pAV, p4, p5);
00270       const double f3 = _safeMass(p3)/m5J;
00271       const double f4 = _safeMass(p4)/m5J;
00272       const double f5 = _safeMass(p5)/m5J;
00273       const double fA = _safeMass(pA)/m5J;
00274       const double fB = _safeMass(pB)/m5J;
00275       const double XA = pA.E()/(pA.E()+pB.E());
00276       const double psiAB = _psi(pA, pB, pA+pB, pAV);
00277       const double fC = _safeMass(pC)/m5J;
00278       const double fD = _safeMass(pD)/m5J;
00279       const double XC = pC.E()/(pC.E()+pD.E());
00280       const double psiCD = _psi(pC, pD, pC+pD, pAV);
00281 
00282       _h_5_mNJ->fill(m5J, weight);
00283       _h_5_X3->fill(X3, weight);
00284       _h_5_X4->fill(X4, weight);
00285       _h_5_costheta3->fill(costheta3, weight);
00286       _h_5_psi3->fill(psi3, weight);
00287       _h_5_f3->fill(f3, weight);
00288       _h_5_f4->fill(f4, weight);
00289       _h_5_f5->fill(f5, weight);
00290       _h_5_XA->fill(XA, weight);
00291       _h_5_psiAB->fill(psiAB, weight);
00292       _h_5_fA->fill(fA, weight);
00293       _h_5_fB->fill(fB, weight);
00294       _h_5_XC->fill(XC, weight);
00295       _h_5_psiCD->fill(psiCD, weight);
00296       _h_5_fC->fill(fC, weight);
00297       _h_5_fD->fill(fD, weight);
00298     }
00299 
00300 
00301     /// Normalise histograms etc., after the run
00302     void finalize() {
00303 
00304       /// Normalise, scale and otherwise manipulate histograms here
00305       normalize(_h_3_mNJ, 1.0);
00306       normalize(_h_3_X3, 1.0);
00307       normalize(_h_3_X4, 1.0);
00308       normalize(_h_3_costheta3, 1.0);
00309       normalize(_h_3_psi3, 1.0);
00310       normalize(_h_3_f3, 1.0);
00311       normalize(_h_3_f4, 1.0);
00312       normalize(_h_3_f5, 1.0);
00313 
00314       normalize(_h_4_mNJ, 1.0);
00315       normalize(_h_4_X3, 1.0);
00316       normalize(_h_4_X4, 1.0);
00317       normalize(_h_4_costheta3, 1.0);
00318       normalize(_h_4_psi3, 1.0);
00319       normalize(_h_4_f3, 1.0);
00320       normalize(_h_4_f4, 1.0);
00321       normalize(_h_4_f5, 1.0);
00322       normalize(_h_4_XA, 1.0);
00323       normalize(_h_4_psiAB, 1.0);
00324       normalize(_h_4_fA, 1.0);
00325       normalize(_h_4_fB, 1.0);
00326 
00327       normalize(_h_5_mNJ, 1.0);
00328       normalize(_h_5_X3, 1.0);
00329       normalize(_h_5_X4, 1.0);
00330       normalize(_h_5_costheta3, 1.0);
00331       normalize(_h_5_psi3, 1.0);
00332       normalize(_h_5_f3, 1.0);
00333       normalize(_h_5_f4, 1.0);
00334       normalize(_h_5_f5, 1.0);
00335       normalize(_h_5_XA, 1.0);
00336       normalize(_h_5_XC, 1.0);
00337       normalize(_h_5_psiAB, 1.0);
00338       normalize(_h_5_psiCD, 1.0);
00339       normalize(_h_5_fA, 1.0);
00340       normalize(_h_5_fB, 1.0);
00341       normalize(_h_5_fC, 1.0);
00342       normalize(_h_5_fD, 1.0);
00343 
00344     }
00345 
00346     //@}
00347 
00348 
00349   private:
00350     vector<FourMomentum> _reduce(const vector<FourMomentum>& jets,
00351                                  FourMomentum& combined1,
00352                                  FourMomentum& combined2) {
00353       double minMass2 = 1e9;
00354       size_t idx1(jets.size()), idx2(jets.size());
00355       for (size_t i=0; i<jets.size(); ++i) {
00356         for (size_t j=i+1; j<jets.size(); ++j) {
00357           double mass2 = FourMomentum(jets[i]+jets[j]).mass2();
00358           if (mass2<minMass2) {
00359             idx1=i;
00360             idx2=j;
00361           }
00362         }
00363       }
00364       vector<FourMomentum> newjets;
00365       for (size_t i=0; i<jets.size(); ++i) {
00366         if (i!=idx1 && i!=idx2) newjets.push_back(jets[i]);
00367       }
00368       newjets.push_back(jets[idx1]+jets[idx2]);
00369       combined1 = jets[idx1];
00370       combined2 = jets[idx2];
00371       return newjets;
00372     }
00373 
00374     FourMomentum _avg_beam_in_lab(const double& m, const double& y) {
00375       const double mt = m/2.0;
00376       FourMomentum beam1(mt, 0, 0, mt);
00377       FourMomentum beam2(mt, 0, 0, -mt);
00378       if (fabs(y)>1e-3) {
00379         FourMomentum boostvec(cosh(y), 0.0, 0.0, sinh(y));
00380         const LorentzTransform cms_boost = LorentzTransform::mkFrameTransformFromBeta(boostvec.betaVec()).inverse();
00381         beam1 = cms_boost.transform(beam1);
00382         beam2 = cms_boost.transform(beam2);
00383       }
00384       return (beam1.E() > beam2.E()) ? beam1-beam2 : beam2-beam1;
00385     }
00386 
00387     double _psi(const FourMomentum& p1, const FourMomentum& p2,
00388                 const FourMomentum& p3, const FourMomentum& p4) {
00389       Vector3 p1xp2 = p1.p3().cross(p2.p3());
00390       Vector3 p3xp4 = p3.p3().cross(p4.p3());
00391       return mapAngle0ToPi(acos(p1xp2.unit().dot(p3xp4.unit())));
00392     }
00393 
00394     double _safeMass(const FourMomentum& p) {
00395       double mass2=p.mass2();
00396       if (mass2>0.0) return sqrt(mass2);
00397       else if (mass2<-1.0e-5) {
00398         MSG_WARNING("m2 = " << m2 << ". Assuming m2=0.");
00399         return 0.0;
00400       }
00401       else return 0.0;
00402     }
00403 
00404 
00405   private:
00406 
00407     /// @name Histograms
00408     //@{
00409     Histo1DPtr _h_3_mNJ;
00410     Histo1DPtr _h_3_X3;
00411     Histo1DPtr _h_3_X4;
00412     Histo1DPtr _h_3_costheta3;
00413     Histo1DPtr _h_3_psi3;
00414     Histo1DPtr _h_3_f3;
00415     Histo1DPtr _h_3_f4;
00416     Histo1DPtr _h_3_f5;
00417 
00418     Histo1DPtr _h_4_mNJ;
00419     Histo1DPtr _h_4_X3;
00420     Histo1DPtr _h_4_X4;
00421     Histo1DPtr _h_4_costheta3;
00422     Histo1DPtr _h_4_psi3;
00423     Histo1DPtr _h_4_f3;
00424     Histo1DPtr _h_4_f4;
00425     Histo1DPtr _h_4_f5;
00426     Histo1DPtr _h_4_XA;
00427     Histo1DPtr _h_4_psiAB;
00428     Histo1DPtr _h_4_fA;
00429     Histo1DPtr _h_4_fB;
00430 
00431     Histo1DPtr _h_5_mNJ;
00432     Histo1DPtr _h_5_X3;
00433     Histo1DPtr _h_5_X4;
00434     Histo1DPtr _h_5_costheta3;
00435     Histo1DPtr _h_5_psi3;
00436     Histo1DPtr _h_5_f3;
00437     Histo1DPtr _h_5_f4;
00438     Histo1DPtr _h_5_f5;
00439     Histo1DPtr _h_5_XA;
00440     Histo1DPtr _h_5_XC;
00441     Histo1DPtr _h_5_psiAB;
00442     Histo1DPtr _h_5_psiCD;
00443     Histo1DPtr _h_5_fA;
00444     Histo1DPtr _h_5_fB;
00445     Histo1DPtr _h_5_fC;
00446     Histo1DPtr _h_5_fD;
00447     //@}
00448 
00449   };
00450 
00451 
00452 
00453   // The hook for the plugin system
00454   DECLARE_RIVET_PLUGIN(CDF_1996_S3349578);
00455 
00456 }