MC_WPOL.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/FinalState.hh" 00004 #include "Rivet/Projections/WFinder.hh" 00005 #include "Rivet/Projections/Beam.hh" 00006 00007 namespace Rivet { 00008 00009 00010 /// @brief MC validation analysis for W polarisation 00011 class MC_WPOL : public Analysis { 00012 public: 00013 00014 /// @name Constructors etc. 00015 //@{ 00016 00017 /// Constructor 00018 MC_WPOL() 00019 : Analysis("MC_WPOL") 00020 { } 00021 00022 //@} 00023 00024 00025 public: 00026 00027 /// @name Analysis methods 00028 //@{ 00029 00030 /// Book histograms and initialise projections before the run 00031 void init() { 00032 00033 FinalState fs; 00034 WFinder wfinder(fs, Cuts::open(), PID::ELECTRON, 00035 60.0*GeV, 100.0*GeV, 0.0*GeV, 0.0); 00036 addProjection(wfinder, "WFinder"); 00037 Beam beams; 00038 addProjection(beams, "Beams"); 00039 00040 vector<string> tags; 00041 tags += "_wplus", "_wminus"; 00042 _h_dists.resize(tags.size()); 00043 _h_histos.resize(tags.size()); 00044 for (size_t i=0; i<tags.size(); ++i) { 00045 _h_dists[i].resize(11,Profile1DPtr()); 00046 _h_dists[i][0] = bookProfile1D("A0"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00047 _h_dists[i][1] = bookProfile1D("A1"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00048 _h_dists[i][2] = bookProfile1D("A2"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00049 _h_dists[i][3] = bookProfile1D("A3"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00050 _h_dists[i][4] = bookProfile1D("A4"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00051 _h_dists[i][5] = bookProfile1D("A5"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00052 _h_dists[i][6] = bookProfile1D("A6"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00053 _h_dists[i][7] = bookProfile1D("A7"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00054 _h_dists[i][8] = bookProfile1D("fL"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00055 _h_dists[i][9] = bookProfile1D("fR"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00056 _h_dists[i][10] = bookProfile1D("f0"+tags[i],logspace(100, 1.0, 0.5*sqrtS())); 00057 _h_histos[i].resize(4,Histo1DPtr()); 00058 _h_histos[i][0] = bookHisto1D("thetastar"+tags[i],100,-1.0,1.0); 00059 _h_histos[i][1] = bookHisto1D("phistar"+tags[i],90,0.0,360.0); 00060 _h_histos[i][2] = bookHisto1D("thetastar_ptw20"+tags[i],100,-1.0,1.0); 00061 _h_histos[i][3] = bookHisto1D("phistar_ptw20"+tags[i],90,0.0,360.0); 00062 } 00063 } 00064 00065 00066 /// Perform the per-event analysis 00067 void analyze(const Event& event) { 00068 const double weight = event.weight(); 00069 00070 const WFinder& wfinder = applyProjection<WFinder>(event, "WFinder"); 00071 if (wfinder.bosons().size() != 1) { 00072 vetoEvent; 00073 } 00074 const ParticlePair& beams = applyProjection<Beam>(event, "Beams").beams(); 00075 00076 FourMomentum pb1(beams.second.momentum()), pb2(beams.first.momentum()); 00077 Particle lepton=wfinder.constituentLeptons()[0]; 00078 FourMomentum pl(lepton.momentum()); 00079 size_t idx = (PID::threeCharge(lepton.pdgId())>0 ? 0 : 1); 00080 FourMomentum plnu(wfinder.bosons()[0].momentum()); 00081 00082 LorentzTransform cms(-plnu.boostVector()); 00083 Matrix3 zrot(plnu.vector3(), Vector3(0.0, 0.0, 1.0)); 00084 pl=cms.transform(pl); 00085 pb1=cms.transform(pb1); 00086 pb2=cms.transform(pb2); 00087 Vector3 pl3=pl.vector3(); 00088 Vector3 pb13=pb1.vector3(); 00089 Vector3 pb23=pb2.vector3(); 00090 pl3=zrot*pl3; 00091 pb13=zrot*pb13; 00092 pb23=zrot*pb23; 00093 Vector3 xref(cos(pb13.theta())>cos(pb23.theta())?pb13:pb23); 00094 Matrix3 xrot(Vector3(xref.x(), xref.y(), 0.0), Vector3(1.0, 0.0, 0.0)); 00095 pl3=xrot*pl3; 00096 00097 double ptw(wfinder.bosons()[0].pT()/GeV); 00098 double thetas(pl3.theta()), phis(pl3.phi()); 00099 double costhetas(cos(thetas)), sinthetas(sin(thetas)); 00100 double cosphis(cos(phis)), sinphis(sin(phis)); 00101 if (phis<0.0) phis+=2.0*M_PI; 00102 00103 _h_histos[idx][0]->fill(costhetas,weight); 00104 _h_histos[idx][1]->fill(phis*180.0/M_PI,weight); 00105 if (ptw>20.0) { 00106 _h_histos[idx][2]->fill(costhetas,weight); 00107 _h_histos[idx][3]->fill(phis*180.0/M_PI,weight); 00108 } 00109 _h_dists[idx][0]->fill(ptw,10.0/3.0*(1.0-3.0*sqr(costhetas))+2.0/3.0,weight); 00110 _h_dists[idx][1]->fill(ptw,10.0*sinthetas*costhetas*cosphis,weight); 00111 _h_dists[idx][2]->fill(ptw,10.0*sqr(sinthetas)*(sqr(cosphis)-sqr(sinphis)),weight); 00112 _h_dists[idx][3]->fill(ptw,4.0*sinthetas*cosphis,weight); 00113 _h_dists[idx][4]->fill(ptw,4.0*costhetas,weight); 00114 _h_dists[idx][5]->fill(ptw,4.0*sinthetas*sinphis,weight); 00115 _h_dists[idx][6]->fill(ptw,10.0*costhetas*sinthetas*sinphis,weight); 00116 _h_dists[idx][7]->fill(ptw,10.0*sqr(sinthetas)*cosphis*sinphis,weight); 00117 _h_dists[idx][8]->fill(ptw,0.5*sqr(1.0-costhetas)-(1.0-2.0*sqr(costhetas)),weight); 00118 _h_dists[idx][9]->fill(ptw,0.5*sqr(1.0+costhetas)-(1.0-2.0*sqr(costhetas)),weight); 00119 _h_dists[idx][10]->fill(ptw,5.0*sqr(sinthetas)-3.0,weight); 00120 00121 } 00122 00123 00124 /// Normalise histograms etc., after the run 00125 void finalize() { 00126 00127 for (size_t i=0; i<_h_histos.size(); ++i) { 00128 foreach (Histo1DPtr histo, _h_histos[i]) { 00129 scale(histo, crossSectionPerEvent()); 00130 } 00131 } 00132 00133 } 00134 00135 //@} 00136 00137 00138 private: 00139 00140 /// @name Histograms 00141 //@{ 00142 00143 std::vector<std::vector<Profile1DPtr> > _h_dists; 00144 std::vector<std::vector<Histo1DPtr> > _h_histos; 00145 //@} 00146 00147 00148 }; 00149 00150 00151 00152 // The hook for the plugin system 00153 DECLARE_RIVET_PLUGIN(MC_WPOL); 00154 00155 } Generated on Thu Feb 6 2014 17:38:45 for The Rivet MC analysis system by ![]() |