OPAL_2004_S6132243.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/Beam.hh" 00004 #include "Rivet/Projections/FinalState.hh" 00005 #include "Rivet/Projections/ChargedFinalState.hh" 00006 #include "Rivet/Projections/Sphericity.hh" 00007 #include "Rivet/Projections/Thrust.hh" 00008 #include "Rivet/Projections/FastJets.hh" 00009 #include "Rivet/Projections/ParisiTensor.hh" 00010 #include "Rivet/Projections/Hemispheres.hh" 00011 #include <cmath> 00012 00013 namespace Rivet { 00014 00015 00016 /// @brief OPAL event shapes and moments at 91, 133, 177, and 197 GeV 00017 /// @author Andy Buckley 00018 class OPAL_2004_S6132243 : public Analysis { 00019 public: 00020 00021 /// Constructor 00022 OPAL_2004_S6132243() 00023 : Analysis("OPAL_2004_S6132243"), 00024 _isqrts(-1), _sumWTrack2(0.0), _sumWJet3(0.0) 00025 { 00026 // 00027 } 00028 00029 00030 /// @name Analysis methods 00031 //@{ 00032 00033 /// Energies: 91, 133, 177 (161-183), 197 (189-209) => index 0..4 00034 int getHistIndex(double sqrts) { 00035 int ih = -1; 00036 if (inRange(sqrts/GeV, 89.9, 91.5)) { 00037 ih = 0; 00038 } else if (fuzzyEquals(sqrts/GeV, 133)) { 00039 ih = 1; 00040 } else if (fuzzyEquals(sqrts/GeV, 177)) { // (161-183) 00041 ih = 2; 00042 } else if (fuzzyEquals(sqrts/GeV, 197)) { // (189-209) 00043 ih = 3; 00044 } else { 00045 stringstream ss; 00046 ss << "Invalid energy for OPAL_2004 analysis: " 00047 << sqrts/GeV << " GeV != 91, 133, 177, or 197 GeV"; 00048 throw Error(ss.str()); 00049 } 00050 assert(ih >= 0); 00051 return ih; 00052 } 00053 00054 00055 void init() { 00056 // Projections 00057 addProjection(Beam(), "Beams"); 00058 const FinalState fs; 00059 addProjection(fs, "FS"); 00060 const ChargedFinalState cfs; 00061 addProjection(cfs, "CFS"); 00062 addProjection(FastJets(fs, FastJets::DURHAM, 0.7), "DurhamJets"); 00063 addProjection(Sphericity(fs), "Sphericity"); 00064 addProjection(ParisiTensor(fs), "Parisi"); 00065 const Thrust thrust(fs); 00066 addProjection(thrust, "Thrust"); 00067 addProjection(Hemispheres(thrust), "Hemispheres"); 00068 00069 // Get beam energy index 00070 _isqrts = getHistIndex(sqrtS()); 00071 00072 // Book histograms 00073 _hist1MinusT[_isqrts] = bookHisto1D(1, 1, _isqrts+1); 00074 _histHemiMassH[_isqrts] = bookHisto1D(2, 1, _isqrts+1); 00075 _histCParam[_isqrts] = bookHisto1D(3, 1, _isqrts+1); 00076 _histHemiBroadT[_isqrts] = bookHisto1D(4, 1, _isqrts+1); 00077 _histHemiBroadW[_isqrts] = bookHisto1D(5, 1, _isqrts+1); 00078 _histY23Durham[_isqrts] = bookHisto1D(6, 1, _isqrts+1); 00079 _histTMajor[_isqrts] = bookHisto1D(7, 1, _isqrts+1); 00080 _histTMinor[_isqrts] = bookHisto1D(8, 1, _isqrts+1); 00081 _histAplanarity[_isqrts] = bookHisto1D(9, 1, _isqrts+1); 00082 _histSphericity[_isqrts] = bookHisto1D(10, 1, _isqrts+1); 00083 _histOblateness[_isqrts] = bookHisto1D(11, 1, _isqrts+1); 00084 _histHemiMassL[_isqrts] = bookHisto1D(12, 1, _isqrts+1); 00085 _histHemiBroadN[_isqrts] = bookHisto1D(13, 1, _isqrts+1); 00086 _histDParam[_isqrts] = bookHisto1D(14, 1, _isqrts+1); 00087 // 00088 _hist1MinusTMom[_isqrts] = bookHisto1D(15, 1, _isqrts+1); 00089 _histHemiMassHMom[_isqrts] = bookHisto1D(16, 1, _isqrts+1); 00090 _histCParamMom[_isqrts] = bookHisto1D(17, 1, _isqrts+1); 00091 _histHemiBroadTMom[_isqrts] = bookHisto1D(18, 1, _isqrts+1); 00092 _histHemiBroadWMom[_isqrts] = bookHisto1D(19, 1, _isqrts+1); 00093 _histY23DurhamMom[_isqrts] = bookHisto1D(20, 1, _isqrts+1); 00094 _histTMajorMom[_isqrts] = bookHisto1D(21, 1, _isqrts+1); 00095 _histTMinorMom[_isqrts] = bookHisto1D(22, 1, _isqrts+1); 00096 _histSphericityMom[_isqrts] = bookHisto1D(23, 1, _isqrts+1); 00097 _histOblatenessMom[_isqrts] = bookHisto1D(24, 1, _isqrts+1); 00098 _histHemiMassLMom[_isqrts] = bookHisto1D(25, 1, _isqrts+1); 00099 _histHemiBroadNMom[_isqrts] = bookHisto1D(26, 1, _isqrts+1); 00100 } 00101 00102 00103 void analyze(const Event& event) { 00104 // Even if we only generate hadronic events, we still need a cut on numCharged >= 2. 00105 const FinalState& cfs = applyProjection<FinalState>(event, "CFS"); 00106 if (cfs.size() < 2) vetoEvent; 00107 00108 // Increment passed-cuts weight sum 00109 const double weight = event.weight(); 00110 _sumWTrack2 += weight; 00111 00112 // Thrusts 00113 const Thrust& thrust = applyProjection<Thrust>(event, "Thrust"); 00114 _hist1MinusT[_isqrts]->fill(1-thrust.thrust(), weight); 00115 _histTMajor[_isqrts]->fill(thrust.thrustMajor(), weight); 00116 _histTMinor[_isqrts]->fill(thrust.thrustMinor(), weight); 00117 _histOblateness[_isqrts]->fill(thrust.oblateness(), weight); 00118 for (int n = 1; n <= 5; ++n) { 00119 _hist1MinusTMom[_isqrts]->fill(n, pow(1-thrust.thrust(), n)*weight); 00120 _histTMajorMom[_isqrts]->fill(n, pow(thrust.thrustMajor(), n)*weight); 00121 _histTMinorMom[_isqrts]->fill(n, pow(thrust.thrustMinor(), n)*weight); 00122 _histOblatenessMom[_isqrts]->fill(n, pow(thrust.oblateness(), n)*weight); 00123 } 00124 00125 // Jets 00126 const FastJets& durjet = applyProjection<FastJets>(event, "DurhamJets"); 00127 if (durjet.clusterSeq()) { 00128 _sumWJet3 += weight; 00129 const double y23 = durjet.clusterSeq()->exclusive_ymerge_max(2); 00130 if (y23>0.0) { 00131 _histY23Durham[_isqrts]->fill(y23, weight); 00132 for (int n = 1; n <= 5; ++n) { 00133 _histY23DurhamMom[_isqrts]->fill(n, pow(y23, n)*weight); 00134 } 00135 } 00136 } 00137 00138 // Sphericities 00139 const Sphericity& sphericity = applyProjection<Sphericity>(event, "Sphericity"); 00140 const double sph = sphericity.sphericity(); 00141 const double apl = sphericity.aplanarity(); 00142 _histSphericity[_isqrts]->fill(sph, weight); 00143 _histAplanarity[_isqrts]->fill(apl, weight); 00144 for (int n = 1; n <= 5; ++n) { 00145 _histSphericityMom[_isqrts]->fill(n, pow(sph, n)*weight); 00146 } 00147 00148 // C & D params 00149 const ParisiTensor& parisi = applyProjection<ParisiTensor>(event, "Parisi"); 00150 const double cparam = parisi.C(); 00151 const double dparam = parisi.D(); 00152 _histCParam[_isqrts]->fill(cparam, weight); 00153 _histDParam[_isqrts]->fill(dparam, weight); 00154 for (int n = 1; n <= 5; ++n) { 00155 _histCParamMom[_isqrts]->fill(n, pow(cparam, n)*weight); 00156 } 00157 00158 // Hemispheres 00159 const Hemispheres& hemi = applyProjection<Hemispheres>(event, "Hemispheres"); 00160 // The paper says that M_H/L are scaled by sqrt(s), but scaling by E_vis is the way that fits the data... 00161 const double hemi_mh = hemi.scaledMhigh(); 00162 const double hemi_ml = hemi.scaledMlow(); 00163 /// @todo This shouldn't be necessary... what's going on? Memory corruption suspected :( 00164 // if (std::isnan(hemi_ml)) { 00165 // MSG_ERROR("NaN in HemiL! Event = " << numEvents()); 00166 // MSG_ERROR(hemi.M2low() << ", " << hemi.E2vis()); 00167 // } 00168 if (!std::isnan(hemi_mh) && !std::isnan(hemi_ml)) { 00169 const double hemi_bmax = hemi.Bmax(); 00170 const double hemi_bmin = hemi.Bmin(); 00171 const double hemi_bsum = hemi.Bsum(); 00172 _histHemiMassH[_isqrts]->fill(hemi_mh, weight); 00173 _histHemiMassL[_isqrts]->fill(hemi_ml, weight); 00174 _histHemiBroadW[_isqrts]->fill(hemi_bmax, weight); 00175 _histHemiBroadN[_isqrts]->fill(hemi_bmin, weight); 00176 _histHemiBroadT[_isqrts]->fill(hemi_bsum, weight); 00177 for (int n = 1; n <= 5; ++n) { 00178 // if (std::isnan(pow(hemi_ml, n))) MSG_ERROR("NaN in HemiL moment! Event = " << numEvents()); 00179 _histHemiMassHMom[_isqrts]->fill(n, pow(hemi_mh, n)*weight); 00180 _histHemiMassLMom[_isqrts]->fill(n, pow(hemi_ml, n)*weight); 00181 _histHemiBroadWMom[_isqrts]->fill(n, pow(hemi_bmax, n)*weight); 00182 _histHemiBroadNMom[_isqrts]->fill(n, pow(hemi_bmin, n)*weight); 00183 _histHemiBroadTMom[_isqrts]->fill(n, pow(hemi_bsum, n)*weight); 00184 } 00185 } 00186 } 00187 00188 00189 void finalize() { 00190 scale(_hist1MinusT[_isqrts], 1.0/_sumWTrack2); 00191 scale(_histTMajor[_isqrts], 1.0/_sumWTrack2); 00192 scale(_histTMinor[_isqrts], 1.0/_sumWTrack2); 00193 scale(_histOblateness[_isqrts], 1.0/_sumWTrack2); 00194 scale(_histSphericity[_isqrts], 1.0/_sumWTrack2); 00195 scale(_histAplanarity[_isqrts], 1.0/_sumWTrack2); 00196 scale(_histHemiMassH[_isqrts], 1.0/_sumWTrack2); 00197 scale(_histHemiMassL[_isqrts], 1.0/_sumWTrack2); 00198 scale(_histHemiBroadW[_isqrts], 1.0/_sumWTrack2); 00199 scale(_histHemiBroadN[_isqrts], 1.0/_sumWTrack2); 00200 scale(_histHemiBroadT[_isqrts], 1.0/_sumWTrack2); 00201 scale(_histCParam[_isqrts], 1.0/_sumWTrack2); 00202 scale(_histDParam[_isqrts], 1.0/_sumWTrack2); 00203 scale(_histY23Durham[_isqrts], 1.0/_sumWJet3); 00204 // 00205 scale(_hist1MinusTMom[_isqrts], 1.0/_sumWTrack2); 00206 scale(_histTMajorMom[_isqrts], 1.0/_sumWTrack2); 00207 scale(_histTMinorMom[_isqrts], 1.0/_sumWTrack2); 00208 scale(_histOblatenessMom[_isqrts], 1.0/_sumWTrack2); 00209 scale(_histSphericityMom[_isqrts], 1.0/_sumWTrack2); 00210 scale(_histHemiMassHMom[_isqrts], 1.0/_sumWTrack2); 00211 scale(_histHemiMassLMom[_isqrts], 1.0/_sumWTrack2); 00212 scale(_histHemiBroadWMom[_isqrts], 1.0/_sumWTrack2); 00213 scale(_histHemiBroadNMom[_isqrts], 1.0/_sumWTrack2); 00214 scale(_histHemiBroadTMom[_isqrts], 1.0/_sumWTrack2); 00215 scale(_histCParamMom[_isqrts], 1.0/_sumWTrack2); 00216 scale(_histY23DurhamMom[_isqrts], 1.0/_sumWJet3); 00217 } 00218 00219 //@} 00220 00221 00222 private: 00223 00224 /// Beam energy index for histograms 00225 int _isqrts; 00226 00227 /// @name Counters of event weights passing the cuts 00228 //@{ 00229 double _sumWTrack2, _sumWJet3; 00230 //@} 00231 00232 /// @name Event shape histos at 4 energies 00233 //@{ 00234 Histo1DPtr _hist1MinusT[4]; 00235 Histo1DPtr _histHemiMassH[4]; 00236 Histo1DPtr _histCParam[4]; 00237 Histo1DPtr _histHemiBroadT[4]; 00238 Histo1DPtr _histHemiBroadW[4]; 00239 Histo1DPtr _histY23Durham[4]; 00240 Histo1DPtr _histTMajor[4]; 00241 Histo1DPtr _histTMinor[4]; 00242 Histo1DPtr _histAplanarity[4]; 00243 Histo1DPtr _histSphericity[4]; 00244 Histo1DPtr _histOblateness[4]; 00245 Histo1DPtr _histHemiMassL[4]; 00246 Histo1DPtr _histHemiBroadN[4]; 00247 Histo1DPtr _histDParam[4]; 00248 //@} 00249 00250 /// @name Event shape moment histos at 4 energies 00251 //@{ 00252 Histo1DPtr _hist1MinusTMom[4]; 00253 Histo1DPtr _histHemiMassHMom[4]; 00254 Histo1DPtr _histCParamMom[4]; 00255 Histo1DPtr _histHemiBroadTMom[4]; 00256 Histo1DPtr _histHemiBroadWMom[4]; 00257 Histo1DPtr _histY23DurhamMom[4]; 00258 Histo1DPtr _histTMajorMom[4]; 00259 Histo1DPtr _histTMinorMom[4]; 00260 Histo1DPtr _histSphericityMom[4]; 00261 Histo1DPtr _histOblatenessMom[4]; 00262 Histo1DPtr _histHemiMassLMom[4]; 00263 Histo1DPtr _histHemiBroadNMom[4]; 00264 //@} 00265 00266 }; 00267 00268 00269 00270 // The hook for the plugin system 00271 DECLARE_RIVET_PLUGIN(OPAL_2004_S6132243); 00272 00273 } Generated on Thu Feb 6 2014 17:38:46 for The Rivet MC analysis system by ![]() |