|
[Rivet-svn] r3426 - branches/2011-07-aida2yoda/src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Oct 6 22:26:46 BST 2011
Author: hoeth Date: Thu Oct 6 22:26:45 2011 New Revision: 3426 Log: merge r3393-3396 from trunk Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9120807.cc branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8547297.cc branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8656010.cc Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9120807.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9120807.cc Thu Oct 6 22:24:09 2011 (r3425) +++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9120807.cc Thu Oct 6 22:26:45 2011 (r3426) @@ -67,7 +67,7 @@ double eta = fabs(eta_w); int v_iter=0; - for (v_iter=0; v_iter < (int)_eta_bins_areaoffset.size()-1; v_iter++){ + for (v_iter=0; v_iter < (int)_eta_bins_areaoffset.size()-1; v_iter++) { if (inRange(eta, _eta_bins_areaoffset[v_iter], _eta_bins_areaoffset[v_iter+1])) break; } @@ -84,19 +84,17 @@ /// require at least 2 photons in final state /// ParticleVector photons = applyProjection<IdentifiedFinalState>(event, "Photon").particlesByPt(); - if (photons.size() < 2){ + if (photons.size() < 2) { vetoEvent; } /// /// compute the median energy density /// - _ptDensity.clear(); - _sigma.clear(); - _Njets.clear(); + std::vector<double> _ptDensity; std::vector< std::vector<double> > ptDensities; std::vector<double> emptyVec; - ptDensities.assign(_eta_bins_areaoffset.size()-1,emptyVec); + ptDensities.assign(_eta_bins_areaoffset.size()-1, emptyVec); const fastjet::ClusterSequenceArea* clust_seq_area = applyProjection<FastJets>(event, "KtJetsD05").clusterSeqArea(); foreach (const fastjet::PseudoJet& jet, applyProjection<FastJets>(event, "KtJetsD05").pseudoJets(0.0*GeV)) { @@ -106,29 +104,22 @@ /// get the cluster sequence double area = clust_seq_area->area(jet); - if(area > 10e-4 && fabs(eta)<_eta_bins_areaoffset[_eta_bins_areaoffset.size()-1]){ + if(area > 10e-4 && fabs(eta) < _eta_bins_areaoffset[_eta_bins_areaoffset.size()-1]) { ptDensities.at(getEtaBin(fabs(eta))).push_back(pt/area); } } - for(int b=0; b<(int)_eta_bins_areaoffset.size()-1;b++){ + for(int b=0; b<(int)_eta_bins_areaoffset.size()-1; b++) { double median = 0.0; - double sigma = 0.0; - int Njets = 0; - if(ptDensities[b].size() > 0) - { + if(ptDensities[b].size() > 0) { std::sort(ptDensities[b].begin(), ptDensities[b].end()); int nDens = ptDensities[b].size(); if( nDens%2 == 0 ) - median = (ptDensities[b][nDens/2]+ptDensities[b][(nDens-2)/2])/2; + median = (ptDensities[b][nDens/2] + ptDensities[b][(nDens-2)/2]) / 2; else median = ptDensities[b][(nDens-1)/2]; - sigma = ptDensities[b][(int)(.15865*nDens)]; - Njets = nDens; } _ptDensity.push_back(median); - _sigma.push_back(sigma); - _Njets.push_back(Njets); } @@ -142,7 +133,7 @@ /// remove photons in crack /// double eta_P = photon.momentum().eta(); - if(fabs(eta_P)>=1.37 && fabs(eta_P)<1.52) continue; + if (fabs(eta_P)>=1.37 && fabs(eta_P)<1.52) continue; double phi_P = photon.momentum().phi(); @@ -159,18 +150,18 @@ /// check if it's in the 5x7 central core if (fabs(eta_P-p.momentum().eta()) < .025*7.0*0.5 && - fabs(phi_P-p.momentum().phi()) < (PI/128.)*5.0*0.5) continue; + fabs(phi_P-p.momentum().phi()) < (M_PI/128.)*5.0*0.5) continue; mom_in_EtCone += p.momentum(); } /// now figure out the correction (area*density) - float EtCone_area = PI*.4*.4 - (7.0*.025)*(5.0*PI/128.); - float correction = _ptDensity[getEtaBin(eta_P)]*EtCone_area; + double EtCone_area = M_PI*.4*.4 - (7.0*.025)*(5.0*M_PI/128.); + double correction = _ptDensity[getEtaBin(eta_P)]*EtCone_area; /// shouldn't need to subtract photon /// note: using expected cut at hadron/particle level, not cut at reco level - if(mom_in_EtCone.Et()-correction > 4.0*GeV){ + if (mom_in_EtCone.Et()-correction > 4.0*GeV) { continue; } @@ -199,10 +190,10 @@ vetoEvent; } - FourMomentum yy=y1+y2; + FourMomentum yy = y1+y2; double Myy = yy.mass()/GeV; double pTyy = yy.pT()/GeV; - double dPhiyy = mapAngle0ToPi(y1.phi()-y2.phi()); + double dPhiyy = deltaPhi(y1.phi(), y2.phi()); _h_M->fill(Myy, weight); _h_pT->fill(pTyy, weight); @@ -225,15 +216,10 @@ fastjet::AreaDefinition* _area_def; - std::vector<float> _eta_bins_areaoffset; - - std::vector<float> _ptDensity; - std::vector<float> _sigma; - std::vector<float> _Njets; + std::vector<double> _eta_bins_areaoffset; }; - // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9120807); Modified: branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8547297.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8547297.cc Thu Oct 6 22:24:09 2011 (r3425) +++ branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8547297.cc Thu Oct 6 22:26:45 2011 (r3426) @@ -57,7 +57,7 @@ if (pT < 4.0*GeV) { _h_dNch_dpT_all->fill(pT/GeV, weight/(pT/GeV)); if (pT < 2.0*GeV) { - int ietabin = fabs(eta)/0.2; + int ietabin = int(fabs(eta)/0.2); _h_dNch_dpT[ietabin]->fill(pT/GeV, weight); } } Modified: branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8656010.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8656010.cc Thu Oct 6 22:24:09 2011 (r3425) +++ branches/2011-07-aida2yoda/src/Analyses/CMS_2010_S8656010.cc Thu Oct 6 22:26:45 2011 (r3426) @@ -48,7 +48,7 @@ if (pT < 6.0*GeV) { _h_dNch_dpT_all->fill(pT/GeV, weight/(pT/GeV)); if (pT < 2.0*GeV) { - int ietabin = fabs(eta)/0.2; + int ietabin = int(fabs(eta)/0.2); _h_dNch_dpT[ietabin]->fill(pT/GeV, weight); } }
More information about the Rivet-svn mailing list |