rivet is hosted by Hepforge, IPPP Durham
ATLAS_2014_I1298811.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/FastJets.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   class ATLAS_2014_I1298811 : public Analysis {
00010   public:
00011 
00012 
00013     ATLAS_2014_I1298811()
00014       : Analysis("ATLAS_2014_I1298811") {    }
00015 
00016 
00017     void init() {
00018       // Configure projections
00019       const FinalState fs(-4.8, 4.8, 0*MeV);
00020       addProjection(fs, "FS");
00021       const FastJets jets(fs, FastJets::ANTIKT, 0.4);
00022       addProjection(jets, "Jets");
00023 
00024       // Book histograms
00025       for (size_t itopo = 0; itopo < 2; ++itopo) {
00026         // Profiles
00027         for (size_t iregion = 0; iregion < 3; ++iregion) {
00028           _p_ptsumch_vs_ptlead[itopo][iregion] = bookProfile1D(1+iregion, 1, itopo+1);
00029           _p_nch_vs_ptlead[itopo][iregion] = bookProfile1D(4+iregion, 1, itopo+1);
00030         }
00031         _p_etsum25_vs_ptlead_trans[itopo] = bookProfile1D(7, 1, itopo+1);
00032         _p_etsum48_vs_ptlead_trans[itopo] = bookProfile1D(8, 1, itopo+1);
00033         _p_chratio_vs_ptlead_trans[itopo] = bookProfile1D(9, 1, itopo+1);
00034         _p_ptmeanch_vs_ptlead_trans[itopo] = bookProfile1D(10, 1, itopo+1);
00035         _p_ptmeanch_vs_nch_trans[0] = bookProfile1D(11, 1, 1);
00036         _p_ptmeanch_vs_nch_trans[1] = bookProfile1D(12, 1, 1);
00037         // 1D histos
00038         for (size_t iregion = 0; iregion < 3; ++iregion) {
00039           for (size_t ipt = 0; ipt < 4; ++ipt) {
00040             _h_ptsumch[ipt][itopo][iregion] = bookHisto1D(13+3*ipt+iregion, 1, itopo+1);
00041             _h_nch[ipt][itopo][iregion] = bookHisto1D(25+3*ipt+iregion, 1, itopo+1);
00042           }
00043         }
00044       }
00045 
00046     }
00047 
00048 
00049 
00050     void analyze(const Event& event) {
00051       // Find the jets with pT > 20 GeV and *rapidity* within 2.8
00052       /// @todo Use Cuts instead rather than an eta cut in the proj and a y cut after
00053       const Jets alljets = applyProjection<FastJets>(event, "Jets").jetsByPt(20*GeV);
00054       Jets jets;
00055       foreach (const Jet& j, alljets)
00056         if (j.absrap() < 2.8) jets.push_back(j);
00057       // Require at least one jet in the event
00058       if (jets.empty()) vetoEvent;
00059 
00060       // Get the event weight since we will be filling some histos
00061       const double weight = event.weight();
00062 
00063       // Identify the leading jet and its phi and pT
00064       const FourMomentum plead = jets[0].momentum();
00065       const double philead = plead.phi();
00066       const double etalead = plead.eta();
00067       const double ptlead  = plead.pT();
00068       MSG_DEBUG("Leading object: pT = " << ptlead << ", eta = " << etalead << ", phi = " << philead);
00069 
00070       // Sum particle properties in the transverse regions
00071       int tmpnch[2] = {0,0};
00072       double tmpptsum[2] = {0,0};
00073       double tmpetsum48[2] = {0,0};
00074       double tmpetsum25[2] = {0,0};
00075       const Particles particles = applyProjection<FinalState>(event, "FS").particles();
00076       foreach (const Particle& p, particles) {
00077         // Only consider the transverse region(s), not toward or away
00078         if (!inRange(deltaPhi(p.phi(), philead), PI/3.0, TWOPI/3.0)) continue;
00079         // Work out which transverse side this particle is on
00080         const size_t iside = (mapAngleMPiToPi(p.phi() - philead) > 0) ? 0 : 1;
00081         MSG_TRACE(p.phi() << " vs. " << philead << ": " << iside);
00082         // Charged or neutral particle?
00083         const bool charged = PID::threeCharge(p.pdgId()) != 0;
00084         // Track observables
00085         if (charged && fabs(p.eta()) < 2.5 && p.pT() > 500*MeV) {
00086           tmpnch[iside] += 1;
00087           tmpptsum[iside] += p.pT();
00088         }
00089         // Cluster observables
00090         if ((charged && p.p3().mod() > 200*MeV) || (!charged && p.p3().mod() > 500*MeV)) {
00091           tmpetsum48[iside] += p.pT();
00092           if (fabs(p.eta()) < 2.5) tmpetsum25[iside] += p.pT();
00093         }
00094       }
00095 
00096       // Construct tot/max/min counts (for trans/max/min, indexed by iregion)
00097       const int nch[3] = { tmpnch[0] + tmpnch[1],
00098                            std::max(tmpnch[0], tmpnch[1]),
00099                            std::min(tmpnch[0], tmpnch[1]) };
00100       const double ptsum[3] = { tmpptsum[0] + tmpptsum[1],
00101                                 std::max(tmpptsum[0], tmpptsum[1]),
00102                                 std::min(tmpptsum[0], tmpptsum[1]) };
00103       const double etsum48[3] = { tmpetsum48[0] + tmpetsum48[1],
00104                                   std::max(tmpetsum48[0], tmpetsum48[1]),
00105                                   std::min(tmpetsum48[0], tmpetsum48[1]) };
00106       const double etsum25[3] = { tmpetsum25[0] + tmpetsum25[1],
00107                                   std::max(tmpetsum25[0], tmpetsum25[1]),
00108                                   std::min(tmpetsum25[0], tmpetsum25[1]) };
00109 
00110 
00111       //////////////////////////////////////////////////////////
00112       // Now fill the histograms with the computed quantities
00113 
00114       // phi sizes of each trans/max/min region (for indexing by iregion)
00115       const double dphi[3] = { 2*PI/3.0, PI/3.0, PI/3.0 };
00116 
00117       // Loop over inclusive jet and exclusive dijet configurations
00118       for (size_t itopo = 0; itopo < 2; ++itopo) {
00119 
00120         // Exit early if in the exclusive dijet iteration and the exclusive dijet cuts are not met
00121         if (itopo == 1) {
00122           if (jets.size() != 2) continue;
00123           const FourMomentum psublead = jets[1].momentum();
00124           // Delta(phi) cut
00125           const double phisublead = psublead.phi();
00126           if (deltaPhi(philead, phisublead) < 2.5) continue;
00127           // pT fraction cut
00128           const double ptsublead  = psublead.pT();
00129           if (ptsublead < 0.5*ptlead) continue;
00130           MSG_DEBUG("Exclusive dijet event");
00131         }
00132 
00133         // Plot profiles and distributions which have no max/min region definition
00134         _p_etsum25_vs_ptlead_trans[itopo]->fill(ptlead/GeV, etsum25[0]/5.0/dphi[0]/GeV, weight);
00135         _p_etsum48_vs_ptlead_trans[itopo]->fill(ptlead/GeV, etsum48[0]/9.6/dphi[0]/GeV, weight);
00136         if (etsum25[0] > 0) {
00137           _p_chratio_vs_ptlead_trans[itopo]->fill(ptlead/GeV, ptsum[0]/etsum25[0], weight);
00138         }
00139         const double ptmean = safediv(ptsum[0], nch[0], -1); ///< Return -1 if div by zero
00140         if (ptmean >= 0) {
00141           _p_ptmeanch_vs_ptlead_trans[itopo]->fill(ptlead/GeV, ptmean/GeV, weight);
00142           _p_ptmeanch_vs_nch_trans[itopo]->fill(nch[0], ptmean/GeV, weight);
00143         }
00144 
00145         // Plot remaining profile and 1D observables, which are defined in all 3 tot/max/min regions
00146         for (size_t iregion = 0; iregion < 3; ++iregion) {
00147           _p_ptsumch_vs_ptlead[itopo][iregion]->fill(ptlead/GeV, ptsum[iregion]/5.0/dphi[iregion]/GeV, weight);
00148           _p_nch_vs_ptlead[itopo][iregion]->fill(ptlead/GeV, nch[iregion]/5.0/dphi[iregion], weight);
00149           for (size_t ipt = 0; ipt < 4; ++ipt) {
00150             if (ipt == 1 && !inRange(ptlead/GeV, 20, 60)) continue;
00151             if (ipt == 2 && !inRange(ptlead/GeV, 60, 210)) continue;
00152             if (ipt == 3 && ptlead/GeV < 210) continue;
00153             _h_ptsumch[ipt][itopo][iregion]->fill(ptsum[iregion]/5.0/dphi[iregion]/GeV, weight);
00154             _h_nch[ipt][itopo][iregion]->fill(nch[iregion]/5.0/dphi[iregion], weight);
00155           }
00156         }
00157       }
00158 
00159     }
00160 
00161 
00162 
00163     void finalize() {
00164       for (size_t iregion = 0; iregion < 3; ++iregion) {
00165         for (size_t itopo = 0; itopo < 2; ++itopo) {
00166           for (size_t ipt = 0; ipt < 4; ++ipt) {
00167             normalize(_h_ptsumch[ipt][itopo][iregion], 1.0);
00168             normalize(_h_nch[ipt][itopo][iregion], 1.0);
00169           }
00170         }
00171       }
00172     }
00173 
00174 
00175   private:
00176 
00177     /// @name Histogram arrays
00178     //@{
00179 
00180     Profile1DPtr _p_ptsumch_vs_ptlead[2][3];
00181     Profile1DPtr _p_nch_vs_ptlead[2][3];
00182     Profile1DPtr _p_ptmeanch_vs_ptlead_trans[2];
00183     Profile1DPtr _p_etsum25_vs_ptlead_trans[2];
00184     Profile1DPtr _p_etsum48_vs_ptlead_trans[2];
00185     Profile1DPtr _p_chratio_vs_ptlead_trans[2];
00186     Profile1DPtr _p_ptmeanch_vs_nch_trans[2];
00187     Histo1DPtr _h_ptsumch[4][2][3];
00188     Histo1DPtr _h_nch[4][2][3];
00189 
00190     //@}
00191 
00192   };
00193 
00194 
00195 
00196   // The hook for the plugin system
00197   DECLARE_RIVET_PLUGIN(ATLAS_2014_I1298811);
00198 
00199 }