rivet is hosted by Hepforge, IPPP Durham
ALICE_2011_S8909580.cc
Go to the documentation of this file.
00001 #include "Rivet/Analysis.hh"
00002 #include "Rivet/RivetYODA.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/UnstableFinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   class ALICE_2011_S8909580 : public Analysis {
00011   public:
00012 
00013     ALICE_2011_S8909580()
00014       : Analysis("ALICE_2011_S8909580")
00015     {}
00016 
00017 
00018   public:
00019     void init() {
00020       const UnstableFinalState ufs(-15, 15);
00021       addProjection(ufs, "UFS");
00022 
00023       _histPtK0s        = bookHisto1D("d01-x01-y01");
00024       _histPtLambda     = bookHisto1D("d02-x01-y01");
00025       _histPtAntiLambda = bookHisto1D("d03-x01-y01");
00026       _histPtXi         = bookHisto1D("d04-x01-y01");
00027       _histPtPhi        = bookHisto1D("d05-x01-y01");
00028       _temp_h_Lambdas   = bookHisto1D(6, 1, 1, "temp_h_Lambdas");
00029       _temp_h_Kzeros    = bookHisto1D(6, 1, 1, "temp_h_Kzeros");
00030       _h_LamKzero   = bookScatter2D(6, 1, 1, "_h_LamKzero");
00031     }
00032 
00033     void analyze(const Event& event) {
00034       const double weight = event.weight();
00035       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(event, "UFS");
00036       
00037       foreach (const Particle& p, ufs.particles()) {
00038         const double absrap = fabs(p.momentum().rapidity());
00039         const double pT = p.momentum().pT()/GeV;
00040 
00041         if (absrap<0.8) {
00042           switch(p.pdgId()) {
00043             case 3312:
00044             case -3312:
00045               if ( !( p.hasAncestor(3334) || p.hasAncestor(-3334) ) ) {
00046                 _histPtXi->fill(pT, weight);
00047               }
00048               break;
00049             if (absrap<0.75) {
00050               case 310:
00051                 _histPtK0s->fill(pT, weight);
00052                 _temp_h_Kzeros->fill(pT, 2*weight);
00053                 break;
00054               case 3122:
00055                 if ( !( p.hasAncestor(3322) || p.hasAncestor(-3322) ||
00056                         p.hasAncestor(3312) || p.hasAncestor(-3312) ||
00057                         p.hasAncestor(3334) || p.hasAncestor(-3334) ) ) {
00058                   _histPtLambda->fill(pT, weight);
00059                   _temp_h_Lambdas->fill(pT, weight);
00060                 }
00061                 break;
00062               case -3122:
00063                 if ( !( p.hasAncestor(3322) || p.hasAncestor(-3322) ||
00064                         p.hasAncestor(3312) || p.hasAncestor(-3312) ||
00065                         p.hasAncestor(3334) || p.hasAncestor(-3334) ) ) {
00066                   _histPtAntiLambda->fill(pT, weight);
00067                   _temp_h_Lambdas->fill(pT, weight);
00068                 }
00069                 break;
00070             }
00071             if (absrap<0.6) {
00072               case 333:
00073                 _histPtPhi->fill(pT, weight);
00074                 break;
00075             }
00076           }
00077         }
00078       }
00079     }
00080 
00081     void finalize() {
00082         scale(_histPtK0s,        1./(1.5*sumOfWeights()));
00083         scale(_histPtLambda,     1./(1.5*sumOfWeights()));
00084         scale(_histPtAntiLambda, 1./(1.5*sumOfWeights()));
00085         scale(_histPtXi,         1./(1.6*sumOfWeights()));
00086         scale(_histPtPhi,        1./(1.2*sumOfWeights()));
00087 
00088     divide(_temp_h_Lambdas, _temp_h_Kzeros, _h_LamKzero);
00089     }
00090 
00091 
00092   private:
00093 
00094     Histo1DPtr _histPtK0s;
00095     Histo1DPtr _histPtLambda;
00096     Histo1DPtr _histPtAntiLambda;
00097     Histo1DPtr _histPtXi;
00098     Histo1DPtr _histPtPhi;
00099     Histo1DPtr _temp_h_Lambdas;
00100     Histo1DPtr _temp_h_Kzeros;
00101     Scatter2DPtr _h_LamKzero;
00102 
00103   };
00104 
00105 
00106 
00107   // The hook for the plugin system
00108   DECLARE_RIVET_PLUGIN(ALICE_2011_S8909580);
00109 }