ALEPH_2004_S5765862.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/ChargedFinalState.hh" 00006 #include "Rivet/Projections/Thrust.hh" 00007 #include "Rivet/Projections/Sphericity.hh" 00008 #include "Rivet/Projections/ParisiTensor.hh" 00009 #include "Rivet/Projections/Hemispheres.hh" 00010 #include "Rivet/Projections/Beam.hh" 00011 00012 namespace Rivet { 00013 00014 00015 /// @brief ALEPH jet rates and event shapes at LEP 1 and 2 00016 class ALEPH_2004_S5765862 : public Analysis { 00017 public: 00018 00019 ALEPH_2004_S5765862() 00020 : Analysis("ALEPH_2004_S5765862") , _initialisedJets(false), 00021 _initialisedSpectra(false), _weightedTotalChargedPartNum(0) 00022 { 00023 } 00024 00025 00026 public: 00027 00028 void init() { 00029 _initialisedJets = true; 00030 _initialisedSpectra = true; 00031 // TODO: According to the paper they seem to discard neutral particles 00032 // between 1 and 2 GeV. That correction is included in the systematic 00033 // uncertainties and overly complicated to program, so we ignore it. 00034 const FinalState fs; 00035 addProjection(fs, "FS"); 00036 FastJets durhamjets(fs, FastJets::DURHAM, 0.7); 00037 durhamjets.useInvisibles(true); 00038 addProjection(durhamjets, "DurhamJets"); 00039 00040 const Thrust thrust(fs); 00041 addProjection(thrust, "Thrust"); 00042 addProjection(Sphericity(fs), "Sphericity"); 00043 addProjection(ParisiTensor(fs), "Parisi"); 00044 addProjection(Hemispheres(thrust), "Hemispheres"); 00045 00046 const ChargedFinalState cfs; 00047 addProjection(Beam(), "Beams"); 00048 addProjection(cfs, "CFS"); 00049 00050 // Histos 00051 // offset for the event shapes and jets 00052 int offset = 0; 00053 switch (int(sqrtS()/GeV + 0.5)) { 00054 case 91: offset = 0; break; 00055 case 133: offset = 1; break; 00056 case 161: offset = 2; break; 00057 case 172: offset = 3; break; 00058 case 183: offset = 4; break; 00059 case 189: offset = 5; break; 00060 case 200: offset = 6; break; 00061 case 206: offset = 7; break; 00062 default: 00063 _initialisedJets = false; 00064 } 00065 // event shapes 00066 if(_initialisedJets) { 00067 _h_thrust = bookHisto1D(offset+54, 1, 1); 00068 _h_heavyjetmass = bookHisto1D(offset+62, 1, 1); 00069 _h_totaljetbroadening = bookHisto1D(offset+70, 1, 1); 00070 _h_widejetbroadening = bookHisto1D(offset+78, 1, 1); 00071 _h_cparameter = bookHisto1D(offset+86, 1, 1); 00072 _h_thrustmajor = bookHisto1D(offset+94, 1, 1); 00073 _h_thrustminor = bookHisto1D(offset+102, 1, 1); 00074 _h_jetmassdifference = bookHisto1D(offset+110, 1, 1); 00075 _h_aplanarity = bookHisto1D(offset+118, 1, 1); 00076 _h_planarity = offset==0 ? Histo1DPtr() : bookHisto1D(offset+125, 1, 1); 00077 _h_oblateness = bookHisto1D(offset+133, 1, 1); 00078 _h_sphericity = bookHisto1D(offset+141, 1, 1); 00079 00080 // Durham n->m jet resolutions 00081 _h_y_Durham[0] = bookHisto1D(offset+149, 1, 1); // y12 d149 ... d156 00082 _h_y_Durham[1] = bookHisto1D(offset+157, 1, 1); // y23 d157 ... d164 00083 if (offset<6) { // there is no y34, y45 and y56 for 200 gev 00084 _h_y_Durham[2] = bookHisto1D(offset+165, 1, 1); // y34 d165 ... d172, but not 171 00085 _h_y_Durham[3] = bookHisto1D(offset+173, 1, 1); // y45 d173 ... d179 00086 _h_y_Durham[4] = bookHisto1D(offset+180, 1, 1); // y56 d180 ... d186 00087 } 00088 else if (offset==6) { 00089 _h_y_Durham[2].reset(); 00090 _h_y_Durham[3].reset(); 00091 _h_y_Durham[4].reset(); 00092 } 00093 else if (offset==7) { 00094 _h_y_Durham[2] = bookHisto1D(172, 1, 1); 00095 _h_y_Durham[3] = bookHisto1D(179, 1, 1); 00096 _h_y_Durham[4] = bookHisto1D(186, 1, 1); 00097 } 00098 00099 // Durham n-jet fractions 00100 _h_R_Durham[0] = bookHisto1D(offset+187, 1, 1); // R1 d187 ... d194 00101 _h_R_Durham[1] = bookHisto1D(offset+195, 1, 1); // R2 d195 ... d202 00102 _h_R_Durham[2] = bookHisto1D(offset+203, 1, 1); // R3 d203 ... d210 00103 _h_R_Durham[3] = bookHisto1D(offset+211, 1, 1); // R4 d211 ... d218 00104 _h_R_Durham[4] = bookHisto1D(offset+219, 1, 1); // R5 d219 ... d226 00105 _h_R_Durham[5] = bookHisto1D(offset+227, 1, 1); // R>=6 d227 ... d234 00106 } 00107 // offset for the charged particle distributions 00108 offset = 0; 00109 switch (int(sqrtS()/GeV + 0.5)) { 00110 case 133: offset = 0; break; 00111 case 161: offset = 1; break; 00112 case 172: offset = 2; break; 00113 case 183: offset = 3; break; 00114 case 189: offset = 4; break; 00115 case 196: offset = 5; break; 00116 case 200: offset = 6; break; 00117 case 206: offset = 7; break; 00118 default: 00119 _initialisedSpectra=false; 00120 } 00121 if (_initialisedSpectra) { 00122 _h_xp = bookHisto1D( 2+offset, 1, 1); 00123 _h_xi = bookHisto1D(11+offset, 1, 1); 00124 _h_xe = bookHisto1D(19+offset, 1, 1); 00125 _h_pTin = bookHisto1D(27+offset, 1, 1); 00126 _h_pTout = offset!=7 ? Histo1DPtr() : bookHisto1D(35, 1, 1); 00127 _h_rapidityT = bookHisto1D(36+offset, 1, 1); 00128 _h_rapidityS = bookHisto1D(44+offset, 1, 1); 00129 } 00130 00131 if (!_initialisedSpectra && !_initialisedJets) { 00132 MSG_WARNING("CoM energy of events sqrt(s) = " << sqrtS()/GeV 00133 << " doesn't match any available analysis energy ."); 00134 } 00135 } 00136 00137 00138 void analyze(const Event& e) { 00139 const double weight = e.weight(); 00140 00141 const Thrust& thrust = applyProjection<Thrust>(e, "Thrust"); 00142 const Sphericity& sphericity = applyProjection<Sphericity>(e, "Sphericity"); 00143 00144 if(_initialisedJets) { 00145 bool LEP1 = fuzzyEquals(sqrtS(),91.2*GeV,0.01); 00146 // event shapes 00147 double thr = LEP1 ? thrust.thrust() : 1.0 - thrust.thrust(); 00148 _h_thrust->fill(thr,weight); 00149 _h_thrustmajor->fill(thrust.thrustMajor(),weight); 00150 if(LEP1) 00151 _h_thrustminor->fill(log(thrust.thrustMinor()),weight); 00152 else 00153 _h_thrustminor->fill(thrust.thrustMinor(),weight); 00154 _h_oblateness->fill(thrust.oblateness(),weight); 00155 00156 const Hemispheres& hemi = applyProjection<Hemispheres>(e, "Hemispheres"); 00157 _h_heavyjetmass->fill(hemi.scaledM2high(),weight); 00158 _h_jetmassdifference->fill(hemi.scaledM2diff(),weight); 00159 _h_totaljetbroadening->fill(hemi.Bsum(),weight); 00160 _h_widejetbroadening->fill(hemi.Bmax(),weight); 00161 00162 const ParisiTensor& parisi = applyProjection<ParisiTensor>(e, "Parisi"); 00163 _h_cparameter->fill(parisi.C(),weight); 00164 00165 _h_aplanarity->fill(sphericity.aplanarity(),weight); 00166 if(_h_planarity) 00167 _h_planarity->fill(sphericity.planarity(),weight); 00168 _h_sphericity->fill(sphericity.sphericity(),weight); 00169 00170 // Jet rates 00171 const FastJets& durjet = applyProjection<FastJets>(e, "DurhamJets"); 00172 double log10e = log10(exp(1.)); 00173 if (durjet.clusterSeq()) { 00174 double logynm1=0.; 00175 double logyn; 00176 for (size_t i=0; i<5; ++i) { 00177 logyn = -log(durjet.clusterSeq()->exclusive_ymerge_max(i+1)); 00178 if (_h_y_Durham[i]) { 00179 _h_y_Durham[i]->fill(logyn, weight); 00180 } 00181 if(!LEP1) logyn *= log10e; 00182 for (size_t j = 0; j < _h_R_Durham[i]->numBins(); ++j) { 00183 double val = _h_R_Durham[i]->bin(j).xMin(); 00184 double width = _h_R_Durham[i]->bin(j).width(); 00185 if(-val<=logynm1) break; 00186 if(-val<logyn) { 00187 _h_R_Durham[i]->fill(val+0.5*width, weight*width); 00188 } 00189 } 00190 logynm1 = logyn; 00191 } 00192 for (size_t j = 0; j < _h_R_Durham[5]->numBins(); ++j) { 00193 double val = _h_R_Durham[5]->bin(j).xMin(); 00194 double width = _h_R_Durham[5]->bin(j).width(); 00195 if(-val<=logynm1) break; 00196 _h_R_Durham[5]->fill(val+0.5*width, weight*width); 00197 } 00198 } 00199 if( !_initialisedSpectra) { 00200 const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS"); 00201 const size_t numParticles = cfs.particles().size(); 00202 _weightedTotalChargedPartNum += numParticles * weight; 00203 } 00204 } 00205 00206 // charged particle distributions 00207 if(_initialisedSpectra) { 00208 const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS"); 00209 const size_t numParticles = cfs.particles().size(); 00210 _weightedTotalChargedPartNum += numParticles * weight; 00211 const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams(); 00212 const double meanBeamMom = ( beams.first.momentum().vector3().mod() + 00213 beams.second.momentum().vector3().mod() ) / 2.0; 00214 foreach (const Particle& p, cfs.particles()) { 00215 const double xp = p.momentum().vector3().mod()/meanBeamMom; 00216 _h_xp->fill(xp , weight); 00217 const double logxp = -std::log(xp); 00218 _h_xi->fill(logxp, weight); 00219 const double xe = p.momentum().E()/meanBeamMom; 00220 _h_xe->fill(xe , weight); 00221 const double pTinT = dot(p.momentum().vector3(), thrust.thrustMajorAxis()); 00222 const double pToutT = dot(p.momentum().vector3(), thrust.thrustMinorAxis()); 00223 _h_pTin->fill(fabs(pTinT/GeV), weight); 00224 if(_h_pTout) _h_pTout->fill(fabs(pToutT/GeV), weight); 00225 const double momT = dot(thrust.thrustAxis() ,p.momentum().vector3()); 00226 const double rapidityT = 0.5 * std::log((p.momentum().E() + momT) / 00227 (p.momentum().E() - momT)); 00228 _h_rapidityT->fill(fabs(rapidityT), weight); 00229 const double momS = dot(sphericity.sphericityAxis(),p.momentum().vector3()); 00230 const double rapidityS = 0.5 * std::log((p.momentum().E() + momS) / 00231 (p.momentum().E() - momS)); 00232 _h_rapidityS->fill(fabs(rapidityS), weight); 00233 } 00234 } 00235 } 00236 00237 void finalize() { 00238 if(!_initialisedJets && !_initialisedSpectra) return; 00239 00240 if (_initialisedJets) { 00241 normalize(_h_thrust); 00242 normalize(_h_heavyjetmass); 00243 normalize(_h_totaljetbroadening); 00244 normalize(_h_widejetbroadening); 00245 normalize(_h_cparameter); 00246 normalize(_h_thrustmajor); 00247 normalize(_h_thrustminor); 00248 normalize(_h_jetmassdifference); 00249 normalize(_h_aplanarity); 00250 if(_h_planarity) normalize(_h_planarity); 00251 normalize(_h_oblateness); 00252 normalize(_h_sphericity); 00253 00254 for (size_t n=0; n<6; ++n) { 00255 scale(_h_R_Durham[n], 1./sumOfWeights()); 00256 } 00257 00258 for (size_t n = 0; n < 5; ++n) { 00259 if (_h_y_Durham[n]) { 00260 scale(_h_y_Durham[n], 1.0/sumOfWeights()); 00261 } 00262 } 00263 } 00264 00265 Histo1D temphisto(refData(1, 1, 1)); 00266 const double avgNumParts = _weightedTotalChargedPartNum / sumOfWeights(); 00267 Scatter2DPtr mult = bookScatter2D(1, 1, 1); 00268 for (size_t b = 0; b < temphisto.numBins(); b++) { 00269 const double x = temphisto.bin(b).midpoint(); 00270 const double ex = temphisto.bin(b).width()/2.; 00271 if (inRange(sqrtS()/GeV, x-ex, x+ex)) { 00272 mult->addPoint(x, avgNumParts, ex, 0.); 00273 } 00274 } 00275 00276 if (_initialisedSpectra) { 00277 normalize(_h_xp, avgNumParts); 00278 normalize(_h_xi, avgNumParts); 00279 normalize(_h_xe, avgNumParts); 00280 normalize(_h_pTin , avgNumParts); 00281 if (_h_pTout) normalize(_h_pTout, avgNumParts); 00282 normalize(_h_rapidityT, avgNumParts); 00283 normalize(_h_rapidityS, avgNumParts); 00284 } 00285 } 00286 00287 private: 00288 00289 bool _initialisedJets; 00290 bool _initialisedSpectra; 00291 00292 Histo1DPtr _h_xp; 00293 Histo1DPtr _h_xi; 00294 Histo1DPtr _h_xe; 00295 Histo1DPtr _h_pTin; 00296 Histo1DPtr _h_pTout; 00297 Histo1DPtr _h_rapidityT; 00298 Histo1DPtr _h_rapidityS; 00299 Histo1DPtr _h_thrust; 00300 Histo1DPtr _h_heavyjetmass; 00301 Histo1DPtr _h_totaljetbroadening; 00302 Histo1DPtr _h_widejetbroadening; 00303 Histo1DPtr _h_cparameter; 00304 Histo1DPtr _h_thrustmajor; 00305 Histo1DPtr _h_thrustminor; 00306 Histo1DPtr _h_jetmassdifference; 00307 Histo1DPtr _h_aplanarity; 00308 Histo1DPtr _h_planarity; 00309 Histo1DPtr _h_oblateness; 00310 Histo1DPtr _h_sphericity; 00311 00312 Histo1DPtr _h_R_Durham[6]; 00313 Histo1DPtr _h_y_Durham[5]; 00314 00315 double _weightedTotalChargedPartNum; 00316 00317 }; 00318 00319 00320 00321 // The hook for the plugin system 00322 DECLARE_RIVET_PLUGIN(ALEPH_2004_S5765862); 00323 00324 } Generated on Fri Oct 25 2013 12:41:43 for The Rivet MC analysis system by ![]() |