CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/GeneratorInterface/RivetInterface/src/CMS_2012_I1087342.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 
00007 
00008 namespace Rivet {
00009 
00010   // This analysis is a derived from the class Analysis:
00011   class CMS_2012_I1087342 : public Analysis {
00012 
00013  
00014   private:
00015     AIDA::IHistogram1D* _hist_jetpt_fwdincl;
00016     AIDA::IHistogram1D* _hist_jetpt_forward;
00017     AIDA::IHistogram1D* _hist_jetpt_central;
00018 
00019   public:
00020   
00021     // Constructor
00022     CMS_2012_I1087342() : Analysis("CMS_2012_I1087342") {
00023       setBeams(PROTON, PROTON);
00024       setNeedsCrossSection(true);
00025     }
00026 
00027     void init() {      
00028       const FinalState fs;
00029       addProjection(FastJets(fs, FastJets::ANTIKT, 0.5),"Jets");
00030 
00031       _hist_jetpt_fwdincl = bookHistogram1D(1,1,1);
00032       _hist_jetpt_forward = bookHistogram1D(2,1,1);
00033       _hist_jetpt_central = bookHistogram1D(3,1,1);      
00034     }
00035 
00036     void analyze(const Event &event) {
00037       const double weight = event.weight();
00038       
00039       const FastJets &fj = applyProjection<FastJets>(event,"Jets");
00040       const Jets jets = fj.jets(35*GeV, 150*GeV, -4.7, 4.7, ETA);
00041 
00042       double cjet_pt=0.0;
00043       double fjet_pt=0.0;
00044       
00045       foreach(const Jet &j, jets) {
00046         if(j.momentum().eta() > 3.2 || j.momentum().eta() < -3.2) {
00047           _hist_jetpt_fwdincl -> fill(j.momentum().pT(), weight);
00048         }
00049         double pT = j.momentum().pT()*GeV;
00050         if (fabs(j.momentum().eta()) < 2.8) {
00051           if(cjet_pt < pT) cjet_pt = pT;
00052         }       
00053         if (fabs(j.momentum().eta()) < 4.7  && fabs(j.momentum().eta()) > 3.2) {
00054           if(fjet_pt < pT) fjet_pt = pT;
00055         }       
00056       }
00057 
00058       if (cjet_pt > 35 && fjet_pt > 35) {
00059         _hist_jetpt_forward->fill(fjet_pt, weight);
00060         _hist_jetpt_central->fill(cjet_pt, weight);
00061       }
00062 
00063     }
00064 
00065     void finalize() {
00066       scale(_hist_jetpt_fwdincl, crossSection() / picobarn / sumOfWeights() / 3.0);
00067       scale(_hist_jetpt_forward, crossSection() / picobarn / sumOfWeights() / 3.0); 
00068       scale(_hist_jetpt_central, crossSection() / picobarn / sumOfWeights() / 5.6);
00069     }
00070     
00071   };
00072 
00073   // This global object acts as a hook for the plugin system.
00074   AnalysisBuilder<CMS_2012_I1087342> plugin_CMS_2012_I1087342;
00075 
00076 }
00077