[Rivet-svn] r3742 - trunk/src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Jun 8 15:01:14 BST 2012


Author: hoeth
Date: Fri Jun  8 15:01:14 2012
New Revision: 3742

Log:
code cleanup to follow Rivet conventions

Modified:
   trunk/src/Analyses/ATLAS_2012_I1093738.cc

Modified: trunk/src/Analyses/ATLAS_2012_I1093738.cc
==============================================================================
--- trunk/src/Analyses/ATLAS_2012_I1093738.cc	Fri Jun  8 12:05:55 2012	(r3741)
+++ trunk/src/Analyses/ATLAS_2012_I1093738.cc	Fri Jun  8 15:01:14 2012	(r3742)
@@ -108,22 +108,22 @@
 
       int v_iter=0;
       if (what==0) {
-	for(v_iter=0; v_iter < (int)_eta_bins_ph.size()-1; v_iter++){
-	  if(eta >= _eta_bins_ph.at(v_iter) && eta < _eta_bins_ph.at(v_iter+1))
-	    break;
-	}
+        for(v_iter=0; v_iter < (int)_eta_bins_ph.size()-1; v_iter++){
+          if(eta >= _eta_bins_ph.at(v_iter) && eta < _eta_bins_ph.at(v_iter+1))
+            break;
+        }
       }
       else if (what==1) {
-	for (v_iter=0; v_iter < (int)_eta_bins_jet.size()-1; v_iter++){
-	  if(eta >= _eta_bins_jet.at(v_iter) && eta < _eta_bins_jet.at(v_iter+1))
-	    break;
-	}
+        for (v_iter=0; v_iter < (int)_eta_bins_jet.size()-1; v_iter++){
+          if(eta >= _eta_bins_jet.at(v_iter) && eta < _eta_bins_jet.at(v_iter+1))
+            break;
+        }
       }
       else {
-	for(v_iter=0; v_iter < (int)_eta_bins_areaoffset.size()-1; v_iter++){
-	  if(eta >= _eta_bins_areaoffset.at(v_iter) && eta < _eta_bins_areaoffset.at(v_iter+1))
-	    break;
-	}
+        for(v_iter=0; v_iter < (int)_eta_bins_areaoffset.size()-1; v_iter++){
+          if(eta >= _eta_bins_areaoffset.at(v_iter) && eta < _eta_bins_areaoffset.at(v_iter+1))
+            break;
+        }
       }
 
       return v_iter;
@@ -143,7 +143,7 @@
       // Get the photon
       const FinalState& photonfs = applyProjection<FinalState>(event, "LeadingPhoton");
       if (photonfs.particles().size() < 1) {
-	MYDEBUG << "...Going to veto event(1)." << std::endl;
+        MYDEBUG << "...Going to veto event(1)." << std::endl;
         vetoEvent;
       }
       MYDEBUG << "...Didn't veto event(1)." << std::endl;
@@ -155,7 +155,7 @@
       // Get the jet
       Jets jets = applyProjection<FastJets>(event, "Jets").jetsByPt(20.0*GeV);
       if (jets.size()==0) {
-	MYDEBUG << "...Going to veto event(3)." << std::endl;
+        MYDEBUG << "...Going to veto event(3)." << std::endl;
         vetoEvent;
       }
       MYDEBUG << "...Didn't veto event(3)." << std::endl;
@@ -163,7 +163,7 @@
 
       // Require jet separated from photon
       if (deltaR(eta_P, phi_P, leadingJet.eta(), leadingJet.phi())<1.0) {
-	MYDEBUG << "...Going to veto event(4)." << std::endl;
+        MYDEBUG << "...Going to veto event(4)." << std::endl;
         vetoEvent;
       }
       MYDEBUG << "...Didn't veto event(4)." << std::endl;
@@ -171,57 +171,57 @@
       // Veto if leading jet is outside plotted rapidity regions
       const double abs_y1 = fabs(leadingJet.rapidity());
       if (abs_y1 > 4.4) {
-	MYDEBUG << "...Going to veto event(5)." << std::endl;
+        MYDEBUG << "...Going to veto event(5)." << std::endl;
         vetoEvent;
       }
       MYDEBUG << "...Didn't veto event(5)." << std::endl;
 
 
       // compute the median event energy density
-      const unsigned int skipnhardjets = 0; 
+      const unsigned int skipnhardjets = 0;
       _ptDensity.clear();
       _sigma.clear();
       _Njets.clear();
       std::vector< std::vector<double> > ptDensities;
       std::vector<double> 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)) {
-	double eta = fabs(jet.eta());
-	double pt = fabs(jet.perp());
-	
-	/// 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]){
-	  ptDensities.at(getEtaBin(fabs(eta),2)).push_back(pt/area);
-	}
+        double eta = fabs(jet.eta());
+        double pt = fabs(jet.perp());
+
+        /// 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]){
+          ptDensities.at(getEtaBin(fabs(eta),2)).push_back(pt/area);
+        }
       }
-      
+
       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() > skipnhardjets)
-	  {
-	    std::sort(ptDensities[b].begin(), ptDensities[b].end());
-	    int nDens = ptDensities[b].size() - skipnhardjets;
-	    if( nDens%2 == 0 )
-	      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);
+        double median = 0.0;
+        double sigma = 0.0;
+        int Njets = 0;
+        if(ptDensities[b].size() > skipnhardjets)
+          {
+            std::sort(ptDensities[b].begin(), ptDensities[b].end());
+            int nDens = ptDensities[b].size() - skipnhardjets;
+            if( nDens%2 == 0 )
+              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);
       }
 
 
       // compute photon isolation
-	
+
       // std EtCone
       ParticleVector fs = applyProjection<FinalState>(event, "JetFS").particles();
       FourMomentum mom_in_EtCone;
@@ -229,31 +229,30 @@
       float cluster_eta_width = 0.25*7.0;
       float cluster_phi_width = (PI/128.)*5.0;
       foreach (const Particle& p, fs) {
-	// check if it's in the cone of .4
-	if (deltaR(eta_P, phi_P, p.momentum().eta(), p.momentum().phi()) >= iso_dR) continue;
-	
-	// check if it's in the 5x7 central core
-	if (fabs(eta_P-p.momentum().eta()) < cluster_eta_width*0.5 && 
-	    fabs(phi_P-p.momentum().phi()) < cluster_phi_width*0.5) continue;
-	
-	mom_in_EtCone += p.momentum();
+        // check if it's in the cone of .4
+        if (deltaR(eta_P, phi_P, p.momentum().eta(), p.momentum().phi()) >= iso_dR) continue;
+
+        // check if it's in the 5x7 central core
+        if (fabs(eta_P-p.momentum().eta()) < cluster_eta_width*0.5 &&
+            fabs(phi_P-p.momentum().phi()) < cluster_phi_width*0.5) continue;
+
+        mom_in_EtCone += p.momentum();
       }
       MYDEBUG << "...Done with initial EtCone." << std::endl;
-      
+
       // now figure out the correction (area*density)
       float EtCone_area = PI*iso_dR*iso_dR - cluster_eta_width*cluster_phi_width;
       float correction = _ptDensity[getEtaBin(eta_P,2)]*EtCone_area;
       MYDEBUG << "...Done with jet-area correction." << std::endl;
 
       // require photon to be isolated
-      if(mom_in_EtCone.Et()-correction > 4.0*GeV){ 
-	MYDEBUG << "...Going to veto event(6)." << std::endl;
+      if(mom_in_EtCone.Et()-correction > 4.0*GeV){
+        MYDEBUG << "...Going to veto event(6)." << std::endl;
         vetoEvent;
       }
       MYDEBUG << "...Didn't veto event(6)." << std::endl;
 
 
-      // 
       int photon_jet_sign = sign( leadingJet.rapidity() * photon.rapidity() );
 
       // Fill histos
@@ -263,30 +262,30 @@
 
       if (abs_photon_eta<1.37) {
 
-	if (abs_jet_rapidity < 1.2) {
+        if (abs_jet_rapidity < 1.2) {
 
-	  if (photon_jet_sign >= 1) {
-	    _h_phbarrel_jetcentral_SS->fill(photon_pt, weight);
-	  } else {
-	    _h_phbarrel_jetcentral_OS->fill(photon_pt, weight);
-	  }
-
-	} else if (abs_jet_rapidity < 2.8) {
-
-	  if (photon_jet_sign >= 1) {
-	    _h_phbarrel_jetmedium_SS->fill(photon_pt, weight);
-	  } else {
-	    _h_phbarrel_jetmedium_OS->fill(photon_pt, weight);
-	  }
-
-	} else if (abs_jet_rapidity < 4.4) {
-
-	  if (photon_jet_sign >= 1) {
-	    _h_phbarrel_jetforward_SS->fill(photon_pt, weight);
-	  } else {
-	    _h_phbarrel_jetforward_OS->fill(photon_pt, weight);
-	  }
-	}
+          if (photon_jet_sign >= 1) {
+            _h_phbarrel_jetcentral_SS->fill(photon_pt, weight);
+          } else {
+            _h_phbarrel_jetcentral_OS->fill(photon_pt, weight);
+          }
+
+        } else if (abs_jet_rapidity < 2.8) {
+
+          if (photon_jet_sign >= 1) {
+            _h_phbarrel_jetmedium_SS->fill(photon_pt, weight);
+          } else {
+            _h_phbarrel_jetmedium_OS->fill(photon_pt, weight);
+          }
+
+        } else if (abs_jet_rapidity < 4.4) {
+
+          if (photon_jet_sign >= 1) {
+            _h_phbarrel_jetforward_SS->fill(photon_pt, weight);
+          } else {
+            _h_phbarrel_jetforward_OS->fill(photon_pt, weight);
+          }
+        }
 
       }
 
@@ -330,8 +329,7 @@
     std::vector<float> _Njets;
   };
 
+  // The hook for the plugin system
+  DECLARE_RIVET_PLUGIN(ATLAS_2012_I1093738);
 
-
-  // This global object acts as a hook for the plugin system
-  AnalysisBuilder<ATLAS_2012_I1093738> plugin_ATLAS_2012_I1093738;
 }


More information about the Rivet-svn mailing list