00001
00002 #include "Rivet/Tools/Logging.hh"
00003 #include "Rivet/Analyses/HepEx0505013.hh"
00004 #include "Rivet/RivetAIDA.hh"
00005
00006
00007 namespace Rivet {
00008
00009
00010 void HepEx0505013::init() {
00011
00012
00013 string hist_title[18][2];
00014
00015
00016 for (int i=0; i<18; ++i) {
00017 stringstream lStream;
00018 lStream << i;
00019 hist_title[i][0] = "Differential Jet Shape Rho, Pt bin " + lStream.str();
00020
00021 _histRho_pT[i] = bookHistogram1D(hist_title[i][0], hist_title[i][0], 7, 0., 1.);
00022 hist_title[i][1] = "Integral Jet Shape Psi, Pt bin " + lStream.str();
00023
00024 _histPsi_pT[i] = bookHistogram1D(hist_title[i][1], hist_title[i][1], 7, 0., 1.);
00025 }
00026
00027 string hist_title_oneminPsi = "One minus Psi(0.3 over R)";
00028
00029 _histOneMinPsi = bookHistogram1D(hist_title_oneminPsi, hist_title_oneminPsi, _pTbins);
00030
00031 }
00032
00033
00034
00035 void HepEx0505013::analyze(const Event& event) {
00036 Log log = getLog();
00037 log << Log::DEBUG << "Starting analyzing" << endl;
00038
00039
00040 #ifdef HAVE_FASTJET
00041 const FastJets& jetpro = event.applyProjection(_jetsproj);
00042 #else
00043 const D0ILConeJets& jetpro = event.applyProjection(_jetsproj);
00044
00045 #endif
00046
00047 log << Log::DEBUG << "Jet multiplicity before any pT cut = " << jetpro.getNJets() << endl;
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #ifdef HAVE_FASTJET
00059 typedef vector<fastjet::PseudoJet> Jets;
00060 const Jets& jets = jetpro.getJetsPt();
00061 #else
00062 typedef list<LorentzVector> Jets;
00063 const Jets& jets = jetpro.getLorentzJets();
00064
00065 #endif
00066
00067 log << Log::DEBUG << "jetlist size = " << jets.size() << endl;
00068
00069 int Njet = 0;
00070 bool jetcutpass = false;
00071
00072 for (Jets::const_iterator jt = jets.begin(); jt != jets.end(); ++jt) {
00073
00074
00075 log << Log::DEBUG << "List item pT = " << jt->perp() << " E=" << jt->e() << " pz=" << jt->pz() << endl;
00076 if (jt->perp()>37. && fabs(jt->rapidity())>0.1 && fabs(jt->rapidity())<0.7) jetcutpass = true;
00077 ++Njet;
00078 log << Log::DEBUG << "Jet pT =" << jt->perp() << " y=" << jt->rapidity() << " phi=" << jt->phi() << endl;
00079 }
00080
00081 if (jetcutpass) {
00082
00083 const TotalVisibleMomentum& caloMissEt = event.applyProjection(_calmetproj);
00084 log << Log::DEBUG << "CaloMissEt.getMomentum().perp() = " << caloMissEt.getMomentum().perp() << endl;
00085
00086 if (caloMissEt.getMomentum().perp()/sqrt(caloMissEt.getSET()) < 3.5) {
00087
00088 LorentzVector jetaxis;
00089 _jetaxes.clear();
00090
00091 for (Jets::const_iterator jt = jets.begin(); jt != jets.end(); ++jt) {
00092
00093 if (fabs(jt->rapidity())<1.1) {
00094 jetaxis.setPx(jt->px());
00095 jetaxis.setPy(jt->py());
00096 jetaxis.setPz(jt->pz());
00097 jetaxis.setE(jt->e());
00098
00099
00100 _jetaxes.push_back(jetaxis);
00101 }
00102 }
00103 if (_jetaxes.size()>0) {
00104
00105 const JetShape& jetShape = event.applyProjection(_jetshapeproj);
00106
00107
00108 for (unsigned int jind=0; jind<_jetaxes.size(); ++jind) {
00109 for (int ipT=0; ipT<18; ++ipT) {
00110 if (_jetaxes[jind].perp() > _pTbins[ipT] && _jetaxes[jind].perp() <= _pTbins[ipT+1]) {
00111 _ShapeWeights[ipT] += event.weight();
00112 for (int rbin=0; rbin<_jetshapeproj.getNbins(); ++rbin) {
00113 double rad = _jetshapeproj.getRmin() +(rbin+0.5)*_jetshapeproj.getInterval();
00114 _histRho_pT[ipT]->fill(rad/_Rjet, double(_diffjetshapes[jind][rbin]) * event.weight());
00115 _histPsi_pT[ipT]->fill(rad/_Rjet, double(_intjetshapes[jind][rbin]) * event.weight());
00116 }
00117 _histOneMinPsi->fill((_pTbins[ipT]+_pTbins[ipT+1])/2.,
00118 _oneminPsishape[jind] * event.weight());
00119 }
00120 }
00121 }
00122 }
00123 }
00124 }
00125
00126
00127
00128
00129 log << Log::DEBUG << "Finished analyzing" << endl;
00130 }
00131
00132
00133
00134 void HepEx0505013::finalize() {
00135
00136 vector<double> OneMinPsiBins(18, 0.);
00137
00138 for (int i=0; i<18; ++i) {
00139
00140 if (_ShapeWeights[i] > 0.) {
00141
00142 _histRho_pT[i]->scale(1./_ShapeWeights[i]);
00143 _histPsi_pT[i]->scale(1./_ShapeWeights[i]);
00144 OneMinPsiBins[i] = _histOneMinPsi->binHeight(i)/_ShapeWeights[i];
00145 }
00146 else OneMinPsiBins[i] = 0.;
00147 }
00148
00149 _histOneMinPsi->reset();
00150 for (int i=0; i<18; ++i) {
00151 _histOneMinPsi->fill((_pTbins[i]+_pTbins[i+1])/2., OneMinPsiBins[i]);
00152 }
00153 }
00154
00155
00156 }