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