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