rivet is hosted by Hepforge, IPPP Durham
ATLAS_2015_I1408516.cc
Go to the documentation of this file.
00001 #include "Rivet/Analysis.hh"
00002 #include "Rivet/Projections/FinalState.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 
00005 namespace Rivet {
00006 
00007 
00008   class ATLAS_2015_I1408516 : public Analysis {
00009   public:
00010 
00011     /// Constructor
00012     ATLAS_2015_I1408516(string name="ATLAS_2015_I1408516", size_t mode=0)
00013       : Analysis(name), _mode(mode) // using electron channel for combined data
00014     { }
00015 
00016 
00017     /// @name Analysis methods
00018     //@{
00019 
00020     /// Book histograms and initialise projections before the run
00021     void init() {
00022 
00023       // Configure projections
00024       FinalState fs;
00025       Cut cuts = Cuts::abseta < 2.4 && Cuts::pT > 20*GeV;
00026       ZFinder zfinder_el(fs, cuts, (_mode ? PID::MUON : PID::ELECTRON),
00027                          12*GeV, 150*GeV, 0.1, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK);
00028       declare(zfinder_el, "ZFinder");
00029 
00030       // Book histograms
00031       const size_t offset = _mode ? 4 : 1;
00032 
00033       _h["phistar_lo_00_08"] = bookHisto1D( 2, 1, offset);
00034       _h["phistar_lo_08_16"] = bookHisto1D( 3, 1, offset);
00035       _h["phistar_lo_16_24"] = bookHisto1D( 4, 1, offset);
00036 
00037       _h["phistar_me_00_04"] = bookHisto1D( 5, 1, offset);
00038       _h["phistar_me_04_08"] = bookHisto1D( 6, 1, offset);
00039       _h["phistar_me_08_12"] = bookHisto1D( 7, 1, offset);
00040       _h["phistar_me_12_16"] = bookHisto1D( 8, 1, offset);
00041       _h["phistar_me_16_20"] = bookHisto1D( 9, 1, offset);
00042       _h["phistar_me_20_24"] = bookHisto1D(10, 1, offset);
00043 
00044       _h["phistar_hi_00_08"] = bookHisto1D(11, 1, offset);
00045       _h["phistar_hi_08_16"] = bookHisto1D(12, 1, offset);
00046       _h["phistar_hi_16_24"] = bookHisto1D(13, 1, offset);
00047 
00048       _h["phistar_mll_46_66"  ] = bookHisto1D(14, 1, offset);
00049       _h["phistar_mll_66_116" ] = bookHisto1D(15, 1, offset);
00050       _h["phistar_mll_116_150"] = bookHisto1D(16, 1, offset);
00051 
00052       _h["zpt_00_04"] = bookHisto1D(17, 1, offset);
00053       _h["zpt_04_08"] = bookHisto1D(18, 1, offset);
00054       _h["zpt_08_12"] = bookHisto1D(19, 1, offset);
00055       _h["zpt_12_16"] = bookHisto1D(20, 1, offset);
00056       _h["zpt_16_20"] = bookHisto1D(21, 1, offset);
00057       _h["zpt_20_24"] = bookHisto1D(22, 1, offset);
00058 
00059       _h["zpt_mll_12_20"  ] = bookHisto1D(23, 1, offset);
00060       _h["zpt_mll_20_30"  ] = bookHisto1D(24, 1, offset);
00061       _h["zpt_mll_30_46"  ] = bookHisto1D(25, 1, offset);
00062       _h["zpt_mll_46_66"  ] = bookHisto1D(26, 1, offset);
00063       _h["zpt_mll_66_116" ] = bookHisto1D(27, 1, offset);
00064       _h["zpt_mll_116_150"] = bookHisto1D(28, 1, offset);
00065 
00066       _h["zpt_00_04_xsec"] = bookHisto1D(29, 1, offset);
00067       _h["zpt_04_08_xsec"] = bookHisto1D(30, 1, offset);
00068       _h["zpt_08_12_xsec"] = bookHisto1D(31, 1, offset);
00069       _h["zpt_12_16_xsec"] = bookHisto1D(32, 1, offset);
00070       _h["zpt_16_20_xsec"] = bookHisto1D(33, 1, offset);
00071       _h["zpt_20_24_xsec"] = bookHisto1D(34, 1, offset);
00072 
00073       _h["zpt_mll_12_20_xsec"  ] = bookHisto1D(35, 1, offset);
00074       _h["zpt_mll_20_30_xsec"  ] = bookHisto1D(36, 1, offset);
00075       _h["zpt_mll_30_46_xsec"  ] = bookHisto1D(37, 1, offset);
00076       _h["zpt_mll_46_66_xsec"  ] = bookHisto1D(38, 1, offset);
00077       _h["zpt_mll_66_116_xsec" ] = bookHisto1D(39, 1, offset);
00078       _h["zpt_mll_116_150_xsec"] = bookHisto1D(40, 1, offset);
00079 
00080       _h["mll_xsec"] = bookHisto1D(41, 1, 1 + _mode);
00081     }
00082 
00083 
00084     /// Perform the per-event analysis
00085     void analyze(const Event& event) {
00086 
00087       // Get leptonic Z boson
00088       const ZFinder& zfinder = apply<ZFinder>(event, "ZFinder");
00089       if (zfinder.bosons().size() != 1 ) vetoEvent;
00090       const Particle& Zboson = zfinder.boson();
00091 
00092       // Get/cut on heavily used Z boson properties
00093       const double zpt   = Zboson.pT();
00094       const double zrap  = Zboson.absrap();
00095       const double zmass = Zboson.mass();
00096       if (zrap > 2.4) vetoEvent;
00097 
00098       // Get/cut on Z boson leptons
00099       const ParticleVector& leptons = zfinder.constituents();
00100       if (leptons.size() != 2 || leptons[0].threeCharge() * leptons[1].threeCharge() > 0) vetoEvent;
00101       const Particle& lminus = leptons[0].charge() < 0 ? leptons[0] : leptons[1];
00102       const Particle& lplus  = leptons[0].charge() < 0 ? leptons[1] : leptons[0];
00103 
00104       // Compute phi*
00105       const double phi_acop = M_PI - deltaPhi(lminus, lplus);
00106       const double costhetastar = tanh( 0.5 * (lminus.eta() - lplus.eta()) );
00107       const double sin2thetastar = (costhetastar > 1) ? 0.0 : (1.0 - sqr(costhetastar));
00108       const double phistar = tan(0.5 * phi_acop) * sqrt(sin2thetastar);
00109 
00110       // Event weight for histogramming
00111       const double weight = event.weight();
00112 
00113       // Inclusive mll
00114       if (zmass > 46*GeV || zpt > 45*GeV) {
00115         // 46 GeV < mll < 150 GeV OR (12 GeV < mll < 46 GeV AND ZpT >45 GeV)
00116         _h["mll_xsec"]->fill(zmass, weight);
00117       }
00118 
00119       // 12 GeV < mll < 150 GeV observables
00120       if (zmass < 20*GeV) {
00121         // 12 GeV < mll < 20 GeV
00122         if (zpt > 45*GeV) { // ZpT cut only for low-mass regions
00123           _h["zpt_mll_12_20_xsec"]->fill(zpt, weight);
00124           _h["zpt_mll_12_20"     ]->fill(zpt, weight);
00125         }
00126       } else if (zmass < 30*GeV) {
00127         // 20 GeV < mll < 30 GeV
00128         if (zpt > 45*GeV) { // ZpT cut only for low-mass regions
00129           _h["zpt_mll_20_30_xsec"]->fill(zpt, weight);
00130           _h["zpt_mll_20_30"     ]->fill(zpt, weight);
00131         }
00132       } else if (zmass <  46*GeV) {
00133         // 30 GeV < mll < 46 GeV
00134         if (zpt > 45*GeV) { // ZpT cut only for low-mass regions
00135           _h["zpt_mll_30_46_xsec"]->fill(zpt, weight);
00136           _h["zpt_mll_30_46"     ]->fill(zpt, weight);
00137         }
00138       } else if (zmass <  66*GeV) {
00139         // 46 GeV < mll < 66 GeV
00140         _h["zpt_mll_46_66_xsec"]->fill(zpt, weight);
00141         _h["zpt_mll_46_66"     ]->fill(zpt, weight);
00142 
00143         _h["phistar_mll_46_66"]->fill(phistar, weight);
00144         if      (zrap < 0.8)  _h["phistar_lo_00_08"]->fill(phistar, weight);
00145         else if (zrap < 1.6)  _h["phistar_lo_08_16"]->fill(phistar, weight);
00146         else                  _h["phistar_lo_16_24"]->fill(phistar, weight);
00147 
00148       } else if (zmass < 116*GeV) {
00149         // 66 GeV < mll < 116 GeV
00150         _h["zpt_mll_66_116_xsec"]->fill(zpt, weight);
00151         _h["zpt_mll_66_116"     ]->fill(zpt, weight);
00152 
00153         if (zrap < 0.4) {
00154           _h["zpt_00_04_xsec"]->fill(zpt, weight);
00155           _h["zpt_00_04"]->fill(zpt, weight);
00156         } else if (zrap < 0.8) {
00157           _h["zpt_04_08_xsec"]->fill(zpt, weight);
00158           _h["zpt_04_08"]->fill(zpt, weight);
00159         } else if (zrap < 1.2) {
00160           _h["zpt_08_12_xsec"]->fill(zpt, weight);
00161           _h["zpt_08_12"]->fill(zpt, weight);
00162         } else if (zrap < 1.6) {
00163           _h["zpt_12_16_xsec"]->fill(zpt, weight);
00164           _h["zpt_12_16"]->fill(zpt, weight);
00165         } else if (zrap < 2.0) {
00166           _h["zpt_16_20_xsec"]->fill(zpt, weight);
00167           _h["zpt_16_20"]->fill(zpt, weight);
00168         } else {
00169           _h["zpt_20_24_xsec"]->fill(zpt, weight);
00170           _h["zpt_20_24"]->fill(zpt, weight);
00171         }
00172 
00173         _h["phistar_mll_66_116"]->fill(phistar, weight);
00174         if      (zrap < 0.4)  _h["phistar_me_00_04"]->fill(phistar, weight);
00175         else if (zrap < 0.8)  _h["phistar_me_04_08"]->fill(phistar, weight);
00176         else if (zrap < 1.2)  _h["phistar_me_08_12"]->fill(phistar, weight);
00177         else if (zrap < 1.6)  _h["phistar_me_12_16"]->fill(phistar, weight);
00178         else if (zrap < 2.0)  _h["phistar_me_16_20"]->fill(phistar, weight);
00179         else                  _h["phistar_me_20_24"]->fill(phistar, weight);
00180 
00181       } else {
00182 
00183         // 116 GeV < mll < 150 GeV
00184         _h["zpt_mll_116_150_xsec"]->fill(zpt, weight);
00185         _h["zpt_mll_116_150"     ]->fill(zpt, weight);
00186 
00187         _h["phistar_mll_116_150"]->fill(phistar, weight);
00188         if      (zrap < 0.8)  _h["phistar_hi_00_08"]->fill(phistar, weight);
00189         else if (zrap < 1.6)  _h["phistar_hi_08_16"]->fill(phistar, weight);
00190         else                  _h["phistar_hi_16_24"]->fill(phistar, weight);
00191 
00192       }
00193     }
00194 
00195 
00196     /// Normalise histograms etc., after the run
00197     void finalize() {
00198       // Scale non-xsec plots to cross-section
00199       const double sf = crossSection() / picobarn / sumOfWeights();
00200       for (const auto& key_hist : _h) {
00201         scale(key_hist.second, sf);
00202         if (!contains(key_hist.first, "_xsec")) normalize(key_hist.second);
00203       }
00204 
00205       // M(ll) plot isn't a differential cross section so shouldn't be divided by bin width
00206       for (size_t i = 0; i < 6; ++i) {
00207         double bw = _h["mll_xsec"]->bin(i).xWidth();
00208         _h["mll_xsec"]->bin(i).scaleW(bw);
00209       }
00210     }
00211     //@}
00212 
00213 
00214   protected:
00215 
00216     size_t _mode;
00217 
00218 
00219   private:
00220 
00221     /// @name Histograms
00222     //@{
00223     map<string, Histo1DPtr> _h;
00224     //@}
00225 
00226   };
00227 
00228 
00229 
00230   class ATLAS_2015_I1408516_EL : public ATLAS_2015_I1408516 {
00231   public:
00232     ATLAS_2015_I1408516_EL() : ATLAS_2015_I1408516("ATLAS_2015_I1408516_EL", 0) { }
00233   };
00234 
00235   class ATLAS_2015_I1408516_MU : public ATLAS_2015_I1408516 {
00236   public:
00237     ATLAS_2015_I1408516_MU() : ATLAS_2015_I1408516("ATLAS_2015_I1408516_MU", 1) { }
00238   };
00239 
00240 
00241   DECLARE_RIVET_PLUGIN(ATLAS_2015_I1408516);
00242   DECLARE_RIVET_PLUGIN(ATLAS_2015_I1408516_EL);
00243   DECLARE_RIVET_PLUGIN(ATLAS_2015_I1408516_MU);
00244 
00245 }