CDF_1994_S2952106.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/FastJets.hh"
00006 #include "Rivet/Projections/VetoedFinalState.hh"
00007 #include "Rivet/Projections/VisibleFinalState.hh"
00008 #include "Rivet/Projections/MissingMomentum.hh"
00009 #include "LWH/Histogram1D.h"
00010 
00011 namespace Rivet {
00012 
00013 
00014   /// @brief CDF Run I color coherence analysis
00015   /// @author Lars Sonnenschein
00016   /// @author Andy Buckley
00017   class CDF_1994_S2952106 : public Analysis {
00018   public:
00019 
00020     /// Constructor
00021     CDF_1994_S2952106() : Analysis("CDF_1994_S2952106")
00022     {
00023       setBeams(PROTON, ANTIPROTON);
00024     }
00025 
00026 
00027     /// @name Analysis methods
00028     //@{
00029 
00030     void init() {
00031       const FinalState fs(-4.2, 4.2);
00032       addProjection(fs, "FS");
00033       addProjection(FastJets(fs, FastJets::CDFJETCLU, 0.7), "Jets");
00034 
00035       // Zero event weight passed-cuts counters
00036       _sumw1 = 0;
00037       _sumw2 = 0;
00038 
00039       // Output histograms
00040       _histJet1Et  = bookHistogram1D(1,1,1);
00041       _histJet2Et  = bookHistogram1D(2,1,1);
00042       _histJet3eta = bookDataPointSet(3,1,1);
00043       _histR23     = bookDataPointSet(4,1,1);
00044       _histAlpha   = bookDataPointSet(5,1,1);
00045 
00046       // Temporary histos: these are the ones we actually fill for the plots which require correction
00047       _tmphistJet3eta.reset(new LWH::Histogram1D(binEdges(3,1,1)));
00048       _tmphistR23.reset(    new LWH::Histogram1D(binEdges(4,1,1)));
00049       _tmphistAlpha.reset(  new LWH::Histogram1D(binEdges(5,1,1)));
00050     }
00051 
00052 
00053 
00054     // Do the analysis
00055     void analyze(const Event & event) {
00056       const Jets jets = applyProjection<FastJets>(event, "Jets").jetsByPt();
00057       MSG_DEBUG("Jet multiplicity before any cuts = " << jets.size());
00058 
00059       // ETs only from jets:
00060       double et_sinphi_sum = 0;
00061       double et_cosphi_sum = 0;
00062       double et_sum = 0;
00063       for (size_t i = 0; i< jets.size(); ++i) {
00064         et_sinphi_sum += jets[i].momentum().Et() * sin(jets[i].phi());
00065         et_cosphi_sum += jets[i].momentum().Et() * cos(jets[i].phi());
00066         et_sum += jets[i].momentum().Et();
00067       }
00068 
00069       // ET requirement
00070       if (sqrt(sqr(et_sinphi_sum) + sqr(et_cosphi_sum))/et_sum > 6.0) vetoEvent;
00071 
00072       // Check jet requirements
00073       if (jets.size() < 3) vetoEvent;
00074       if (jets[0].momentum().pT() < 100*GeV) vetoEvent;
00075 
00076       // More jet 1,2,3 checks
00077       FourMomentum pj1(jets[0].momentum()), pj2(jets[1].momentum()), pj3(jets[2].momentum());
00078       if (fabs(pj1.eta()) > 0.7 || fabs(pj2.eta()) > 0.7) vetoEvent;
00079       MSG_DEBUG("Jet 1 & 2 eta, pT requirements fulfilled");
00080 
00081       // Require that jets are back-to-back within 20 degrees in phi
00082       if ((PI - deltaPhi(pj1.phi(), pj2.phi())) > (20/180.0)*PI) vetoEvent;
00083       MSG_DEBUG("Jet 1 & 2 phi requirement fulfilled");
00084 
00085       const double weight = event.weight();
00086       _sumw1 += weight;
00087 
00088       // Fill histos
00089       _histJet1Et->fill(pj1.pT(), weight);
00090       _histJet2Et->fill(pj2.pT(), weight);
00091       _tmphistJet3eta->fill(pj3.eta(), weight);
00092       _tmphistR23->fill(deltaR(pj2, pj3), weight);
00093 
00094       // Next cut only required for alpha studies
00095       if (pj3.pT() < 10.0*GeV) vetoEvent;
00096       MSG_DEBUG("3rd jet passes alpha histo pT cut");
00097       _sumw2 += weight;
00098 
00099       // Calc and plot alpha
00100       const double dPhi = deltaPhi(pj3.phi(), pj2.phi());
00101       const double dH = sign(pj2.eta()) * (pj3.eta() - pj2.eta());
00102       const double alpha = atan(dH/dPhi);
00103       _tmphistAlpha->fill(alpha*180./PI, weight);
00104     }
00105 
00106 
00107     /// Apply bin-wise detector correction factors
00108     void finalize() {
00109 
00110       // Normal scalings
00111       normalize(_histJet1Et, 12.3);
00112       normalize(_histJet2Et, 12.3);
00113 
00114       // eta3 correction
00115       const double eta3_CDF_sim[] =
00116         { 0.0013, 0.0037, 0.0047, 0.0071, 0.0093, 0.0117, 0.0151, 0.0149, 0.0197, 0.0257,
00117           0.0344, 0.0409, 0.0481, 0.0454, 0.0394, 0.0409, 0.0387, 0.0387, 0.0322, 0.0313,
00118           0.0290, 0.0309, 0.0412, 0.0417, 0.0412, 0.0397, 0.0417, 0.0414, 0.0376, 0.0316,
00119           0.0270, 0.0186, 0.0186, 0.0132, 0.0127, 0.0106, 0.0071, 0.0040, 0.0020, 0.0013 };
00120       const double eta3_CDF_sim_err[] =
00121         { 0.0009, 0.0009, 0.0007, 0.0007, 0.0007, 0.0010, 0.0012, 0.0012, 0.0013, 0.0016,
00122           0.0017, 0.0020, 0.0020, 0.0022, 0.0020, 0.0020, 0.0018, 0.0018, 0.0016, 0.0017,
00123           0.0017, 0.0019, 0.0020, 0.0021, 0.0020, 0.0020, 0.0019, 0.0020, 0.0018, 0.0017,
00124           0.0017, 0.0014, 0.0014, 0.0009, 0.0010, 0.0009, 0.0009, 0.0008, 0.0008, 0.0009 };
00125       const double eta3_Ideal_sim[] =
00126         { 0.0017, 0.0030, 0.0033, 0.0062, 0.0062, 0.0112, 0.0177, 0.0164, 0.0196, 0.0274,
00127           0.0351, 0.0413, 0.0520, 0.0497, 0.0448, 0.0446, 0.0375, 0.0329, 0.0291, 0.0272,
00128           0.0233, 0.0288, 0.0384, 0.0396, 0.0468, 0.0419, 0.0459, 0.0399, 0.0355, 0.0329,
00129           0.0274, 0.0230, 0.0201, 0.0120, 0.0100, 0.0080, 0.0051, 0.0051, 0.0010, 0.0010 };
00130       vector<double> yval_eta3, yerr_eta3;
00131       for (size_t i = 0;  i < 40; ++i) {
00132         const double yval = _tmphistJet3eta->binHeight(i) * (eta3_CDF_sim[i]/eta3_Ideal_sim[i]);
00133         yval_eta3.push_back(yval/_sumw1);
00134         const double yerr = _tmphistJet3eta->binError(i) * (eta3_CDF_sim_err[i]/eta3_Ideal_sim[i]);
00135         yerr_eta3.push_back(yerr/_sumw1);
00136       }
00137       _histJet3eta->setCoordinate(1, yval_eta3, yerr_eta3);
00138 
00139       // R23 correction
00140       const double R23_CDF_sim[] =
00141         { 0.0005, 0.0161, 0.0570, 0.0762, 0.0723, 0.0705, 0.0598, 0.0563, 0.0557, 0.0579,
00142           0.0538, 0.0522, 0.0486, 0.0449, 0.0418, 0.0361, 0.0326, 0.0304, 0.0252, 0.0212,
00143           0.0173, 0.0176, 0.0145, 0.0127, 0.0103, 0.0065, 0.0049, 0.0045, 0.0035, 0.0029,
00144           0.0024, 0.0014, 0.0011, 0.0010, 0.0009 };
00145       const double R23_CDF_sim_err[] =
00146         { 0.0013, 0.0009, 0.0022, 0.0029, 0.0026, 0.0024, 0.0022, 0.0025, 0.0023, 0.0024,
00147           0.0021, 0.0021, 0.0021, 0.0021, 0.0021, 0.0019, 0.0019, 0.0016, 0.0017, 0.0014,
00148           0.0010, 0.0014, 0.0012, 0.0013, 0.0010, 0.0011, 0.0010, 0.0010, 0.0010, 0.0011,
00149           0.0011, 0.0009, 0.0008, 0.0008, 0.0009 };
00150       const double R23_Ideal_sim[] =
00151         { 0.0005, 0.0176, 0.0585, 0.0862, 0.0843, 0.0756, 0.0673, 0.0635, 0.0586, 0.0619,
00152           0.0565, 0.0515, 0.0466, 0.0472, 0.0349, 0.0349, 0.0266, 0.0254, 0.0204, 0.0179,
00153           0.0142, 0.0134, 0.0101, 0.0090, 0.0080, 0.0034, 0.0030, 0.0033, 0.0027, 0.0021,
00154           0.0012, 0.0006, 0.0004, 0.0005, 0.0003 };
00155       vector<double> yval_R23, yerr_R23;
00156       for (size_t i = 0;  i < 35; ++i) {
00157         const double yval = _tmphistR23->binHeight(i) * (R23_CDF_sim[i]/R23_Ideal_sim[i]);
00158         yval_R23.push_back(yval/_sumw1);
00159         const double yerr = _tmphistR23->binError(i) * (R23_CDF_sim_err[i]/R23_Ideal_sim[i]);
00160         yerr_R23.push_back(yerr/_sumw1);
00161       }
00162       _histR23->setCoordinate(1, yval_R23, yerr_R23);
00163 
00164       // alpha correction
00165       const double alpha_CDF_sim[] =
00166         { 0.0517, 0.0461, 0.0490, 0.0452, 0.0451, 0.0435, 0.0317, 0.0287, 0.0294, 0.0261,
00167           0.0231, 0.0220, 0.0233, 0.0192, 0.0213, 0.0166, 0.0176, 0.0146, 0.0136, 0.0156,
00168           0.0142, 0.0152, 0.0151, 0.0147, 0.0164, 0.0186, 0.0180, 0.0210, 0.0198, 0.0189,
00169           0.0197, 0.0211, 0.0270, 0.0236, 0.0243, 0.0269, 0.0257, 0.0276, 0.0246, 0.0286 };
00170       const double alpha_CDF_sim_err[] =
00171         { 0.0024, 0.0025, 0.0024, 0.0024, 0.0024, 0.0022, 0.0019, 0.0018, 0.0019, 0.0016,
00172           0.0017, 0.0017, 0.0019, 0.0013, 0.0017, 0.0014, 0.0016, 0.0013, 0.0012, 0.0009,
00173           0.0014, 0.0014, 0.0014, 0.0014, 0.0014, 0.0015, 0.0014, 0.0016, 0.0016, 0.0015,
00174           0.0016, 0.0016, 0.0019, 0.0017, 0.0019, 0.0018, 0.0018, 0.0018, 0.0018, 0.0019 };
00175       const double alpha_Ideal_sim[] =
00176         { 0.0552, 0.0558, 0.0583, 0.0550, 0.0495, 0.0433, 0.0393, 0.0346, 0.0331, 0.0296,
00177           0.0258, 0.0196, 0.0171, 0.0179, 0.0174, 0.0141, 0.0114, 0.0096, 0.0076, 0.0087,
00178           0.0099, 0.0079, 0.0102, 0.0114, 0.0124, 0.0130, 0.0165, 0.0160, 0.0177, 0.0190,
00179           0.0232, 0.0243, 0.0238, 0.0248, 0.0235, 0.0298, 0.0292, 0.0291, 0.0268, 0.0316 };
00180       vector<double> yval_alpha, yerr_alpha;
00181       for (size_t i = 0;  i < 40; ++i) {
00182         const double yval = _tmphistAlpha->binHeight(i) * (alpha_CDF_sim[i]/alpha_Ideal_sim[i]);
00183         yval_alpha.push_back(yval/_sumw2);
00184         const double yerr = _tmphistAlpha->binError(i) * (alpha_CDF_sim_err[i]/alpha_Ideal_sim[i]);
00185         yerr_alpha.push_back(yerr/_sumw2);
00186       }
00187       _histAlpha->setCoordinate(1, yval_alpha, yerr_alpha);
00188     }
00189 
00190     //@}
00191 
00192 
00193   private:
00194 
00195     /// @name Event weight counters
00196     //@{
00197 
00198     double _sumw1, _sumw2;
00199 
00200     //@}
00201 
00202 
00203     /// @name Histograms
00204     //@{
00205 
00206     /// Straightforward output histos
00207     AIDA::IHistogram1D *_histJet1Et, *_histJet2Et;
00208 
00209     /// Output histos which need to have correction factors applied
00210     AIDA::IDataPointSet *_histR23, *_histJet3eta, *_histAlpha;
00211 
00212     /// Temporary histos, to be converted to DPSes
00213     shared_ptr<LWH::IHistogram1D> _tmphistR23, _tmphistJet3eta, _tmphistAlpha;
00214 
00215     //@}
00216 
00217   };
00218 
00219 
00220 
00221   // This global object acts as a hook for the plugin system
00222   AnalysisBuilder<CDF_1994_S2952106> plugin_CDF_1994_S2952106;
00223 
00224 }