[Rivet-svn] r3765 - branches/2011-07-aida2yoda/src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Jun 8 15:53:09 BST 2012


Author: hoeth
Date: Fri Jun  8 15:53:09 2012
New Revision: 3765

Log:
merge c3736, 3751 from trunk

Modified:
   branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc

Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc	Fri Jun  8 15:48:47 2012	(r3764)
+++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc	Fri Jun  8 15:53:09 2012	(r3765)
@@ -98,204 +98,185 @@
       const double weight = event.weight();
 
       ParticleVector veto_e
-	= applyProjection<IdentifiedFinalState>(event, "veto_elecs").particles();
+        = applyProjection<IdentifiedFinalState>(event, "veto_elecs").particles();
       if ( ! veto_e.empty() ) {
-       	MSG_DEBUG("electrons in veto region");
-       	vetoEvent;
+        MSG_DEBUG("electrons in veto region");
+        vetoEvent;
       }
 
       Jets cand_jets;
       foreach (const Jet& jet,
-       	applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
+        applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
         if ( fabs( jet.momentum().eta() ) < 2.5 ) {
           cand_jets.push_back(jet);
         }
       }
 
       ParticleVector cand_e =
-	applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
-      ParticleVector candtemp_mu =
-	applyProjection<IdentifiedFinalState>(event,"muons").particlesByPt();
-      ParticleVector chg_tracks =
-	applyProjection<ChargedFinalState>(event, "cfs").particles();
-      ParticleVector cand_mu;
+        applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
 
+      // charged particle for isolation
+      ParticleVector chg_tracks =
+        applyProjection<ChargedFinalState>(event, "cfs").particles();
 
+      // apply muon isolation
+      ParticleVector cand_mu;
       // pTcone around muon track
-      foreach ( const Particle & mu, candtemp_mu ) {
-	double pTinCone = -mu.momentum().pT();
-	foreach ( const Particle & track, chg_tracks ) {
-	  if ( deltaR(mu.momentum(),track.momentum()) < 0.2 )
-	    pTinCone += track.momentum().pT();
-	}
-	if ( pTinCone < 1.8*GeV )
-	  cand_mu.push_back(mu);
+      foreach ( const Particle & mu,
+                applyProjection<IdentifiedFinalState>(event,"muons").particlesByPt() ) {
+        double pTinCone = -mu.momentum().pT();
+        foreach ( const Particle & track, chg_tracks ) {
+          if ( deltaR(mu.momentum(),track.momentum()) < 0.2 )
+            pTinCone += track.momentum().pT();
+        }
+        if ( pTinCone < 1.8*GeV )
+          cand_mu.push_back(mu);
       }
 
-
       // Discard jets that overlap with electrons
-      Jets cand_jets_2;
+      Jets recon_jets;
       foreach ( const Jet& jet, cand_jets ) {
-	if ( fabs( jet.momentum().eta() ) < 1.5 )
-	  cand_jets_2.push_back( jet );
-	else {
-	  bool away_from_e = true;
-	  foreach ( const Particle & e, cand_e ) {
-	    if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
-	      away_from_e = false;
-	      break;
-	    }
-	  }
-	  if ( away_from_e )
-	    cand_jets_2.push_back( jet );
-	}
+        bool away_from_e = true;
+        foreach ( const Particle & e, cand_e ) {
+          if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
+            away_from_e = false;
+            break;
+          }
+        }
+        if ( away_from_e )
+         recon_jets.push_back( jet );
       }
 
-
       // Leptons far from jet
-      ParticleVector recon_e, recon_mu;
+      ParticleVector recon_e;
       foreach ( const Particle & e, cand_e ) {
         bool e_near_jet = false;
-	foreach ( const Jet& jet, cand_jets_2 ) {
-          if ( deltaR(e.momentum(),jet.momentum()) < 0.4 )
-	    e_near_jet = true;
-	}
-        if ( e_near_jet == false )
-          recon_e.push_back( e );
+        foreach ( const Jet& jet, recon_jets ) {
+          if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
+            e_near_jet = true;
+            break;
+          }
+        }
+        // Electron isolation criterion
+        if ( ! e_near_jet ) {
+          double EtinCone = -e.momentum().Et();
+          foreach ( const Particle & track, chg_tracks) {
+            if ( deltaR(e.momentum(),track.momentum()) <= 0.2 )
+              EtinCone += track.momentum().Et();
+          }
+          if ( EtinCone/e.momentum().pT() <= 0.15 )
+            recon_e.push_back( e );
+        }
       }
 
+      ParticleVector recon_mu;
       foreach ( const Particle & mu, cand_mu ) {
          bool mu_near_jet = false;
-         foreach ( const Jet& jet, cand_jets_2 ) {
-           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 )
-	     mu_near_jet = true;
-	 }
-	 if ( mu_near_jet == false)
-	  recon_mu.push_back( mu );
+         foreach ( const Jet& jet, recon_jets ) {
+           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
+             mu_near_jet = true;
+             break;
+           }
+         }
+         if ( ! mu_near_jet )
+          recon_mu.push_back( mu );
        }
 
 
       // pTmiss
       ParticleVector vfs_particles
-	= applyProjection<VisibleFinalState>(event, "vfs").particles();
+        = applyProjection<VisibleFinalState>(event, "vfs").particles();
       FourMomentum pTmiss;
       foreach ( const Particle & p, vfs_particles ) {
-	pTmiss -= p.momentum();
+        pTmiss -= p.momentum();
       }
       double eTmiss = pTmiss.pT();
 
-
-      // Final jet filter
-      Jets recon_jets;
-      foreach ( const Jet& jet, cand_jets_2 ) {
-	  recon_jets.push_back( jet );
-      }
-
-
-      // Electron isolation criterion
-      foreach ( Particle e, recon_e ) {
-	double EtinCone = -e.momentum().Et();
-	foreach ( const Particle & track, chg_tracks) {
-	  if ( deltaR(e.momentum(),track.momentum()) <= 0.2 )
-	    EtinCone += track.momentum().Et();
-	}
-	if ( EtinCone/e.momentum().pT() >= 0.15 )
-	  vetoEvent;
-      }
-
-
       // Exactly two leptons for each event
-      int num_leptons = recon_mu.size() + recon_e.size();
-      if ( num_leptons != 2)
-	vetoEvent;
-
-
+      if ( recon_mu.size() + recon_e.size() != 2)
+        vetoEvent;
 
       // Lepton pair mass
-      double mass_leptons = 0;
+      FourMomentum p_leptons;
       foreach ( Particle e, recon_e ) {
-        mass_leptons += e.momentum().E();
+        p_leptons +=  e.momentum();
       }
       foreach ( Particle mu, recon_mu) {
-        mass_leptons += mu.momentum().E();
+        p_leptons += mu.momentum();
       }
 
-      if ( mass_leptons <= 5.0 * GeV) {
-	MSG_DEBUG("Not enough m_ll: " << mass_leptons << " < 5");
+      if ( p_leptons.mass() <= 5.0 * GeV)
         vetoEvent;
-      }
-
 
-
-    // ==================== FILL ====================
+      // ==================== FILL ====================
 
 
       // electron, electron
       if (recon_e.size() == 2 ) {
 
-	// SS ee
-	if ( recon_e[0].pdgId() * recon_e[1].pdgId() > 0 ) {
-	  _hist_eTmiss_SS->fill(eTmiss, weight);
-	  if ( eTmiss > 100 ) {
-	    MSG_DEBUG("Hits SS e+/-e+/-");
-  	    _count_SS_e_e->fill(0.5, weight);
-	  }
-	}
-
-	// OS ee
-	else if ( recon_e[0].pdgId() * recon_e[1].pdgId() < 0) {
-	  _hist_eTmiss_OS->fill(eTmiss, weight);
-	  if ( eTmiss > 150 ) {
-	    MSG_DEBUG("Hits OS e+e-");
-	    _count_OS_e_e->fill(0.5, weight);
-	  }
-	}
+        // SS ee
+        if ( recon_e[0].pdgId() * recon_e[1].pdgId() > 0 ) {
+          _hist_eTmiss_SS->fill(eTmiss, weight);
+          if ( eTmiss > 100 ) {
+            MSG_DEBUG("Hits SS e+/-e+/-");
+            _count_SS_e_e->fill(0.5, weight);
+          }
+        }
+
+        // OS ee
+        else if ( recon_e[0].pdgId() * recon_e[1].pdgId() < 0) {
+          _hist_eTmiss_OS->fill(eTmiss, weight);
+          if ( eTmiss > 150 ) {
+            MSG_DEBUG("Hits OS e+e-");
+            _count_OS_e_e->fill(0.5, weight);
+          }
+        }
       }
 
 
       // muon, electron
       else if ( recon_e.size() == 1 ) {
 
-	// SS mu_e
-	if ( recon_e[0].pdgId() * recon_mu[0].pdgId() > 0 ) {
-	  _hist_eTmiss_SS->fill(eTmiss, weight);
-	  if ( eTmiss > 100 ) {
-	    MSG_DEBUG("Hits SS e+/-mu+/-");
-	    _count_SS_e_mu->fill(0.5, weight);
-	  }
-	}
-
-	// OS mu_e
-	else if ( recon_e[0].pdgId() * recon_mu[0].pdgId() < 0) {
-	  _hist_eTmiss_OS->fill(eTmiss, weight);
-	  if ( eTmiss > 150 ) {
-	    MSG_DEBUG("Hits OS e+mu-");
-	    _count_OS_e_mu->fill(0.5, weight);
-	  }
-	}
+        // SS mu_e
+        if ( recon_e[0].pdgId() * recon_mu[0].pdgId() > 0 ) {
+          _hist_eTmiss_SS->fill(eTmiss, weight);
+          if ( eTmiss > 100 ) {
+            MSG_DEBUG("Hits SS e+/-mu+/-");
+            _count_SS_e_mu->fill(0.5, weight);
+          }
+        }
+
+        // OS mu_e
+        else if ( recon_e[0].pdgId() * recon_mu[0].pdgId() < 0) {
+          _hist_eTmiss_OS->fill(eTmiss, weight);
+          if ( eTmiss > 150 ) {
+            MSG_DEBUG("Hits OS e+mu-");
+            _count_OS_e_mu->fill(0.5, weight);
+          }
+        }
       }
 
 
       // muon, muon
       else if ( recon_mu.size() == 2 ) {
 
-	// SS mu_mu
-	if ( recon_mu[0].pdgId() * recon_mu[1].pdgId() > 0 ) {
-	  _hist_eTmiss_SS->fill(eTmiss, weight);
-	  if ( eTmiss > 100 ) {
-	    MSG_DEBUG("Hits SS mu+/-mu+/-");
-	    _count_SS_mu_mu->fill(0.5, weight);
-	  }
-	}
-
-	// OS mu_mu
-	else if ( recon_mu[0].pdgId() * recon_mu[1].pdgId() < 0) {
-	  _hist_eTmiss_OS->fill(eTmiss, weight);
-	  if ( eTmiss > 150 ) {
-	    MSG_DEBUG("Hits OS mu+mu-");
-	    _count_OS_mu_mu->fill(0.5, weight);
-	  }
-	}
+        // SS mu_mu
+        if ( recon_mu[0].pdgId() * recon_mu[1].pdgId() > 0 ) {
+          _hist_eTmiss_SS->fill(eTmiss, weight);
+          if ( eTmiss > 100 ) {
+            MSG_DEBUG("Hits SS mu+/-mu+/-");
+            _count_SS_mu_mu->fill(0.5, weight);
+          }
+        }
+
+        // OS mu_mu
+        else if ( recon_mu[0].pdgId() * recon_mu[1].pdgId() < 0) {
+          _hist_eTmiss_OS->fill(eTmiss, weight);
+          if ( eTmiss > 150 ) {
+            MSG_DEBUG("Hits OS mu+mu-");
+            _count_OS_mu_mu->fill(0.5, weight);
+          }
+        }
       }
 
 
@@ -304,7 +285,18 @@
     //@}
 
 
-    void finalize() { }
+    void finalize() {
+      double norm = crossSection()/picobarn*35./sumOfWeights();
+      // event counts
+      scale(_count_OS_e_mu ,norm);
+      scale(_count_OS_e_e  ,norm);
+      scale(_count_OS_mu_mu,norm);
+      scale(_count_SS_e_mu ,norm);
+      scale(_count_SS_e_e  ,norm);
+      scale(_count_SS_mu_mu,norm);
+      scale(_hist_eTmiss_OS,10.*norm);
+      scale(_hist_eTmiss_SS,10.*norm);
+    }
 
 
   private:


More information about the Rivet-svn mailing list