rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_S9035664.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/UnstableFinalState.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief  J/psi production at ATLAS
00012   class ATLAS_2011_S9035664: public Analysis {
00013   public:
00014 
00015     /// Constructor
00016     ATLAS_2011_S9035664()
00017       : Analysis("ATLAS_2011_S9035664")
00018     {}
00019 
00020 
00021     /// @name Analysis methods
00022     //@{
00023 
00024     void init() {
00025       addProjection(UnstableFinalState(), "UFS");
00026       _nonPrRapHigh    = bookHisto1D( 14, 1, 1);
00027       _nonPrRapMedHigh = bookHisto1D( 13, 1, 1);
00028       _nonPrRapMedLow  = bookHisto1D( 12, 1, 1);
00029       _nonPrRapLow     = bookHisto1D( 11, 1, 1);
00030       _PrRapHigh       = bookHisto1D( 18, 1, 1);
00031       _PrRapMedHigh    = bookHisto1D( 17, 1, 1);
00032       _PrRapMedLow     = bookHisto1D( 16, 1, 1);
00033       _PrRapLow        = bookHisto1D( 15, 1, 1);
00034       _IncRapHigh      = bookHisto1D( 20, 1, 1);
00035       _IncRapMedHigh   = bookHisto1D( 21, 1, 1);
00036       _IncRapMedLow    = bookHisto1D( 22, 1, 1);
00037       _IncRapLow       = bookHisto1D( 23, 1, 1);
00038     }
00039 
00040 
00041     void analyze(const Event& e) {
00042 
00043       // Get event weight for histo filling
00044       const double weight = e.weight();
00045 
00046 
00047       // Final state of unstable particles to get particle spectra
00048       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00049 
00050       foreach (const Particle& p, ufs.particles()) {
00051         if (abs(p.pdgId()) != 443) continue;
00052         HepMC::GenVertex* gv = p.genParticle()->production_vertex();
00053         bool nonPrompt = false;
00054         if (gv) {
00055           foreach (const GenParticle* pi, Rivet::particles(gv, HepMC::ancestors)) {
00056             const PdgId pid2 = pi->pdg_id();
00057             if (PID::isHadron(pid2) && PID::hasBottom(pid2)) {
00058               nonPrompt = true;
00059               break;
00060             }
00061           }
00062         }
00063         double rapidity = p.rapidity();
00064         double xp = p.momentum().perp();
00065 
00066         if (rapidity<=2.4 and rapidity>2.) {
00067           if (nonPrompt) _nonPrRapHigh->fill(xp, weight);
00068           else if (!nonPrompt) _PrRapHigh->fill(xp, weight);
00069           _IncRapHigh->fill(xp, weight);
00070         }
00071         else if (rapidity<=2. and rapidity>1.5) {
00072           if (nonPrompt) _nonPrRapMedHigh->fill(xp, weight);
00073           else if (!nonPrompt) _PrRapMedHigh->fill(xp, weight);
00074           _IncRapMedHigh->fill(xp, weight);
00075         }
00076         else if (rapidity<=1.5 and rapidity>0.75) {
00077           if (nonPrompt) _nonPrRapMedLow->fill(xp, weight);
00078           else if (!nonPrompt) _PrRapMedLow->fill(xp, weight);
00079           _IncRapMedLow->fill(xp, weight);
00080         }
00081 
00082         else if (rapidity<=0.75) {
00083           if (nonPrompt) _nonPrRapLow->fill(xp, weight);
00084           else if (!nonPrompt) _PrRapLow->fill(xp, weight);
00085           _IncRapLow->fill(xp, weight);
00086         }
00087       }
00088     }
00089 
00090 
00091     /// Finalize
00092     void finalize() {
00093       double factor = crossSection()/nanobarn*0.0593;
00094 
00095       scale(_PrRapHigh      , factor/sumOfWeights());
00096       scale(_PrRapMedHigh   , factor/sumOfWeights());
00097       scale(_PrRapMedLow    , factor/sumOfWeights());
00098       scale(_PrRapLow       , factor/sumOfWeights());
00099 
00100       scale(_nonPrRapHigh   , factor/sumOfWeights());
00101       scale(_nonPrRapMedHigh, factor/sumOfWeights());
00102       scale(_nonPrRapMedLow , factor/sumOfWeights());
00103       scale(_nonPrRapLow    , factor/sumOfWeights());
00104 
00105       scale(_IncRapHigh     , 1000.*factor/sumOfWeights());
00106       scale(_IncRapMedHigh  , 1000.*factor/sumOfWeights());
00107       scale(_IncRapMedLow   , 1000.*factor/sumOfWeights());
00108       scale(_IncRapLow      , 1000.*factor/sumOfWeights());
00109 
00110     }
00111 
00112     //@}
00113 
00114 
00115   private:
00116 
00117     Histo1DPtr _nonPrRapHigh;
00118     Histo1DPtr _nonPrRapMedHigh;
00119     Histo1DPtr _nonPrRapMedLow;
00120     Histo1DPtr _nonPrRapLow;
00121 
00122     Histo1DPtr _PrRapHigh;
00123     Histo1DPtr _PrRapMedHigh;
00124     Histo1DPtr _PrRapMedLow;
00125     Histo1DPtr _PrRapLow;
00126 
00127     Histo1DPtr _IncRapHigh;
00128     Histo1DPtr _IncRapMedHigh;
00129     Histo1DPtr _IncRapMedLow;
00130     Histo1DPtr _IncRapLow;
00131     //@}
00132 
00133   };
00134 
00135   // The hook for the plugin system
00136   DECLARE_RIVET_PLUGIN(ATLAS_2011_S9035664);
00137 
00138 }