HepEx0409040.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Analyses/HepEx0409040.hh"
00005 using namespace Rivet;
00006 
00007 #include "Rivet/RivetAIDA.hh"
00008 using namespace AIDA;
00009 
00010 #include "HepPDT/ParticleID.hh"
00011 using namespace HepMC;
00012 
00013 
00014 /////////////////////////////////////////////////
00015 
00016 
00017 // Book histograms
00018 void HepEx0409040::init() {
00019   // Use histogram auto-booking
00020   _histJetAzimuth_pTmax75_100  = bookHistogram1D(1, 2, 1, "Jet Jet azimuthal angle, pTmax=75..100");
00021   _histJetAzimuth_pTmax100_130 = bookHistogram1D(2, 2, 1, "Jet Jet azimuthal angle, pTmax=100..130");
00022   _histJetAzimuth_pTmax130_180 = bookHistogram1D(3, 2, 1, "Jet Jet azimuthal angle, pTmax=130..180");
00023   _histJetAzimuth_pTmax180_    = bookHistogram1D(4, 2, 1, "Jet Jet azimuthal angle, pTmax>180");
00024 }
00025 
00026 
00027 // Do the analysis
00028 void HepEx0409040::analyze(const Event & event) {
00029   Log& log = getLog();
00030   log << Log::DEBUG << "Starting analyzing" << endl;
00031 
00032   // Analyse and print some info  
00033   const D0ILConeJets& jetpro = event.applyProjection(_conejetsproj);
00034   log << Log::DEBUG << "Jet multiplicity before any pT cut = " << jetpro.getNJets() << endl;
00035 
00036   // Find vertex and check  that its z-component is < 50 cm from the nominal IP
00037   //const PVertex& pv = event.applyProjection(_vertexproj);
00038   /// @todo SEGV: either the HepMC event record is not filled properly or the F77-Wrapper functions are faulty
00039   /// @todo z- value assumed to be in mm, PYTHIA convention: dangerous!
00040   //if (fabs(pv.getPrimaryVertex().position().z()) < 500.0) {
00041     const list<LorentzVector>& jets = jetpro.getLorentzJets();
00042     list<LorentzVector>::const_iterator jetpTmax = jets.end();
00043     list<LorentzVector>::const_iterator jet2ndpTmax = jets.end();
00044     log << Log::DEBUG << "jetlist size = " << jets.size() << endl;
00045 
00046     int Njet = 0;
00047     for (list<LorentzVector>::const_iterator jt = jets.begin(); jt != jets.end(); ++jt) {
00048       log << Log::DEBUG << "List item pT = " << jt->perp() << " E=" << jt->e() 
00049       << " pz=" << jt->pz() << endl;
00050       if (jt->perp() > 40.0) ++Njet;
00051       log << Log::DEBUG << "Jet pT =" << jt->perp() << " y=" << jt->rapidity() 
00052       << " phi=" << jt->phi() << endl; 
00053       if (jetpTmax == jets.end() || jt->perp() > jetpTmax->perp()) {
00054         jet2ndpTmax = jetpTmax;
00055         jetpTmax = jt;
00056       } else if (jet2ndpTmax == jets.end() || jt->perp() > jet2ndpTmax->perp()) {
00057         jet2ndpTmax = jt;
00058       }
00059     }
00060     
00061     if (Njet >= 2) {
00062       log << Log::DEBUG << "Jet multiplicity after pT > 40GeV cut = " << Njet << endl; 
00063     }
00064 
00065     if (jets.size()>=2 && jet2ndpTmax->perp() > 40.) {
00066       if (fabs(jetpTmax->rapidity())<0.5 && fabs(jet2ndpTmax->rapidity())<0.5) {
00067         log << Log::DEBUG << "Jet eta and pT requirements fulfilled" << endl;
00068 
00069         const TotalVisibleMomentum& caloMissEt = event.applyProjection(_calmetproj);
00070 
00071         log << Log::DEBUG << "CaloMissEt.getMomentum().perp() = " << caloMissEt.getMomentum().perp() << endl;
00072 
00073         if (caloMissEt.getMomentum().perp() < 0.7*jetpTmax->perp()) {
00074           double dphi = delta_phi(jetpTmax->phi(), jet2ndpTmax->phi());
00075           
00076           if (jetpTmax->perp() > 75.0 && jetpTmax->perp() <= 100.0)
00077             _histJetAzimuth_pTmax75_100->fill(dphi, event.weight());
00078           else if (jetpTmax->perp() > 100.0 && jetpTmax->perp() <= 130.0)
00079             _histJetAzimuth_pTmax100_130->fill(dphi, event.weight());
00080           else if (jetpTmax->perp() > 130.0 && jetpTmax->perp() <= 180.0)
00081             _histJetAzimuth_pTmax130_180->fill(dphi, event.weight());
00082           else if (jetpTmax->perp() > 180.0)
00083             _histJetAzimuth_pTmax180_->fill(dphi, event.weight());
00084           
00085         } //CalMET
00086       } //jets N, pT
00087     } //jets y (raqpidity) 
00088     
00089     //} //z-vertex
00090   
00091   
00092   // Finished
00093   log << Log::DEBUG << "Finished analyzing" << endl;
00094 }
00095 
00096 
00097 // Finalize
00098 void HepEx0409040::finalize() { 
00099   Log& log = getLog();
00100 
00101   // Normalize histograms to unit area
00102   normalize(_histJetAzimuth_pTmax75_100);
00103   normalize(_histJetAzimuth_pTmax100_130);
00104   normalize(_histJetAzimuth_pTmax130_180);
00105   normalize(_histJetAzimuth_pTmax180_);
00106 
00107   log << Log::INFO << "Sum of histJetAzimuth_pTmax75_100 bin heights after normalization: "
00108       << _histJetAzimuth_pTmax75_100->sumBinHeights() << endl;
00109   log << Log::INFO << "Sum of histJetAzimuth_pTmax100_130 bin heights after normalization: "
00110       << _histJetAzimuth_pTmax100_130->sumBinHeights() << endl;
00111   log << Log::INFO << "Sum of histJetAzimuth_pTmax130_180 bin heights after normalization: "
00112       << _histJetAzimuth_pTmax130_180->sumBinHeights() << endl;
00113   log << Log::INFO << "Sum of histJetAzimuth_pTmax180_ bin heights after normalization: "
00114       << _histJetAzimuth_pTmax180_->sumBinHeights() << endl;
00115 }