|
[Rivet-svn] r4280 - in trunk: data/plotinfo src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue May 14 21:20:37 BST 2013
Author: buckley Date: Tue May 14 21:20:37 2013 New Revision: 4280 Log: H1 1995 analysis overhauled but still not using HD ref data, and a few other tweaks Modified: trunk/data/plotinfo/H1_1995_S3167097.plot trunk/src/Analyses/ATLAS_2012_I1083318.cc trunk/src/Analyses/H1_1995_S3167097.cc Modified: trunk/data/plotinfo/H1_1995_S3167097.plot ============================================================================== --- trunk/data/plotinfo/H1_1995_S3167097.plot Tue May 14 20:44:00 2013 (r4279) +++ trunk/data/plotinfo/H1_1995_S3167097.plot Tue May 14 21:20:37 2013 (r4280) @@ -10,24 +10,6 @@ YLabel=$1/\mathrm{N} \mathrm{d}E_{\perp}/d\eta [GeV]$ # END PLOT -# BEGIN PLOT /H1_1995_S3167097/21tmp -Title=$\langle E_\perp \rangle$ vs kin. bin -XLabel=Kinematic bin -YLabel=$\langle \mathrm{E}_{\perp}\rangle$ -# END PLOT - -# BEGIN PLOT /H1_1995_S3167097/22tmp -Title=$\langle x \rangle$ vs kin. bin -XLabel=Kinematic bin -YLabel=$\langle x \rangle$ -# END PLOT - -# BEGIN PLOT /H1_1995_S3167097/23tmp -Title=$\langle Q^2 \rangle$ vs kin. bin -XLabel=Kinematic bin -YLabel=$\langle Q^{2}\rangle$ -# END PLOT - # BEGIN PLOT /H1_1995_S3167097/24 Title=Num events vs kin. bin XLabel=Kinematic bin @@ -75,4 +57,3 @@ XLabel=$\eta$ YLabel=$1/\mathrm{N} \mathrm{d}E_{\perp}/d\eta [GeV]$ # END PLOT - Modified: trunk/src/Analyses/ATLAS_2012_I1083318.cc ============================================================================== --- trunk/src/Analyses/ATLAS_2012_I1083318.cc Tue May 14 20:44:00 2013 (r4279) +++ trunk/src/Analyses/ATLAS_2012_I1083318.cc Tue May 14 21:20:37 2013 (r4280) @@ -40,9 +40,7 @@ allleptons.acceptIdPair(PID::MUON); vector< pair<double, double> > etaRanges; etaRanges.push_back(make_pair(-2.5, 2.5)); - LeptonClusters leptons(fs, allleptons, - 0.1, true, - etaRanges, 20.0*GeV); + LeptonClusters leptons(fs, allleptons, 0.1, true, etaRanges, 20.0*GeV); addProjection(leptons, "leptons"); // Leading neutrinos for Etmiss @@ -182,9 +180,9 @@ for (size_t i = 0; i < 2; ++i) { // Construct jet multiplicity ratio - for (int n = 0; n < _h_NjetIncl[i]->numPoints()-1; ++n) { - YODA::Bin& b0 = _h_NjetIncl[i]->bin(n); - YODA::Bin& b1 = _h_NjetIncl[i]->bin(n+1); + for (size_t n = 0; n < _h_NjetIncl[i]->numBins()-1; ++n) { + YODA::HistoBin1D& b0 = _h_NjetIncl[i]->bin(n); + YODA::HistoBin1D& b1 = _h_NjetIncl[i]->bin(n+1); if (b0.height() == 0.0 || b1.height() == 0.0) continue; _h_RatioNjetIncl[i]->point(n).setY(b1.height()/b0.height()); _h_RatioNjetIncl[i]->point(n).setYErr(b1.height()/b0.height() * (b0.relErr() + b1.relErr())); Modified: trunk/src/Analyses/H1_1995_S3167097.cc ============================================================================== --- trunk/src/Analyses/H1_1995_S3167097.cc Tue May 14 20:44:00 2013 (r4279) +++ trunk/src/Analyses/H1_1995_S3167097.cc Tue May 14 21:20:37 2013 (r4280) @@ -9,8 +9,9 @@ /// H1 energy flow in DIS /// - /// @todo Check! + /// @todo Make histograms match those in HepData and use autobooking /// @author Leif Lonnblad + /// @author Andy Buckley class H1_1995_S3167097 : public Analysis { public: @@ -24,28 +25,21 @@ //@{ void init() { + // Projections const DISKinematics& diskin = addProjection(DISKinematics(), "Kinematics"); const DISFinalState& fshcm = addProjection(DISFinalState(diskin, DISFinalState::HCM), "FS"); addProjection(CentralEtHCM(fshcm), "Y1HCM"); - const size_t NBINS = 9; - _hEtFlow = vector<Histo1DPtr>(NBINS); - _hEtFlowStat = vector<Histo1DPtr>(NBINS); - _nev = vector<double>(NBINS); - /// @todo Automate this sort of thing so that the analysis code is more readable. - for (size_t i = 0; i < NBINS; ++i) { - string istr(1, char('1' + i)); - _hEtFlow[i] = bookHisto1D(istr, 24, -6, 6); - _hEtFlowStat[i] = bookHisto1D(istr, 24, -6, 6); - } - /// @todo Replace with really temp (non-persistent) histos? - // _hAvEt = bookScatter2D("21"); - // _hAvX = bookScatter2D("22"); - // _hAvQ2 = bookScatter2D("23"); - _hAvEt = bookHisto1D("21tmp", NBINS, 1.0, 10.0); - _hAvX = bookHisto1D("22tmp", NBINS, 1.0, 10.0); - _hAvQ2 = bookHisto1D("23tmp", NBINS, 1.0, 10.0); - _hN = bookHisto1D("24", NBINS, 1.0, 10.0); + // Histograms + /// @todo Convert to use autobooking and correspond to HepData data tables + _sumw.resize(9); + _hEtFlow.resize(9); + for (size_t i = 0; i < 9; ++i) + _hEtFlow[i] = bookHisto1D(lexical_cast<string>(i), 24, -6, 6); + _tmphAvEt = Histo1D(9, 1.0, 10.0); + _tmphAvX = Histo1D(9, 1.0, 10.0); + _tmphAvQ2 = Histo1D(9, 1.0, 10.0); + _tmphN = Histo1D(9, 1.0, 10.0); } @@ -81,36 +75,21 @@ const double rap = fs.particles()[i].momentum().rapidity(); const double et = fs.particles()[i].momentum().Et(); _hEtFlow[ibin]->fill(rap, weight * et/GeV); - _hEtFlowStat[ibin]->fill(rap, weight * et/GeV); } - _nev[ibin] += weight; - _hAvEt->fill(ibin + 1.5, weight * y1.sumEt()/GeV); - _hAvX->fill(ibin + 1.5, weight * dk.x()); - _hAvQ2->fill(ibin + 1.5, weight * dk.Q2()/GeV2); - _hN->fill(ibin + 1.5, weight); + _sumw[ibin] += weight; + _tmphAvEt.fill(ibin + 1.5, weight * y1.sumEt()/GeV); + _tmphAvX.fill(ibin + 1.5, weight * dk.x()); + _tmphAvQ2.fill(ibin + 1.5, weight * dk.Q2()/GeV2); + _tmphN.fill(ibin + 1.5, weight); } void finalize() { - for (size_t ibin = 0; ibin < 9; ++ibin) { - scale(_hEtFlow[ibin], 0.5/_nev[ibin]); - scale(_hEtFlowStat[ibin], 0.5/_nev[ibin]); - } - - "/H1_1995_S3167097/21"; - - divide(_tmphAvEt, *_hN, ); - h->setTitle(_hAvEt->title()); - histogramFactory().destroy(_hAvEt); - - h = histogramFactory().divide("/H1_1995_S3167097/22", *_hAvX, *_hN); - h->setTitle(_hAvX->title()); - histogramFactory().destroy(_hAvX); - - h = histogramFactory().divide("/H1_1995_S3167097/23", *_hAvQ2, *_hN); - h->setTitle(_hAvQ2->title()); - histogramFactory().destroy(_hAvQ2); + for (size_t ibin = 0; ibin < 9; ++ibin) scale(_hEtFlow[ibin], 0.5/_sumw[ibin]); + addPlot(Scatter2DPtr( new Scatter2D(_tmphAvEt/_tmphN, histoPath("21")) )); + addPlot(Scatter2DPtr( new Scatter2D(_tmphAvX/_tmphN, histoPath("22")) )); + addPlot(Scatter2DPtr( new Scatter2D(_tmphAvQ2/_tmphN, histoPath("23")) )); } //@} @@ -118,14 +97,14 @@ private: - /// Histograms for the \f$ E_T \f$ flows - vector<Histo1DPtr> _hEtFlow, _hEtFlowStat; + /// Histograms for the \f$ E_T \f$ flow + vector<Histo1DPtr> _hEtFlow; - /// Histograms for averages in different kinematical bins. - Histo1DPtr _hAvEt, _hAvX, _hAvQ2, _hN; + /// Temporary histograms for averages in different kinematical bins. + Histo1D _tmphAvEt, _tmphAvX, _tmphAvQ2, _tmphN; - /// Helper vector; - vector<double> _nev; + /// Weights counters for each kinematic bin + vector<double> _sumw; };
More information about the Rivet-svn mailing list |