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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Aug 23 10:25:50 BST 2011


Author: hoeth
Date: Tue Aug 23 10:25:50 2011
New Revision: 3308

Log:
cosmetic cleanup in ALICE_2011_S8945144

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

Modified: branches/2011-07-aida2yoda/src/Analyses/ALICE_2011_S8945144.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ALICE_2011_S8945144.cc	Tue Aug 23 10:20:08 2011	(r3307)
+++ branches/2011-07-aida2yoda/src/Analyses/ALICE_2011_S8945144.cc	Tue Aug 23 10:25:50 2011	(r3308)
@@ -32,38 +32,31 @@
       const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
       foreach (const Particle& p, cfs.particles()) {
         if(fabs(p.momentum().rapidity())<0.5) {
-          if(p.pdgId() == 211) {
-            _histPtPions->fill(p.momentum().pT()/GeV, weight);
-            _histAveragePt->fill(p.mass()/GeV,p.momentum().pT()/GeV,weight);
-            continue;
-          }
-
-          if(p.pdgId() == -211) {
-            _histPtAntiPions->fill(p.momentum().pT()/GeV, weight);
-            _histAveragePt->fill(p.mass()/GeV,p.momentum().pT()/GeV,weight);
-            continue;
-          }
-
-          if(p.pdgId() == 2212) {
-            _histPtProtons->fill(p.momentum().pT()/GeV, weight);
-            _histAveragePt->fill(p.mass()/GeV,p.momentum().pT()/GeV,weight);
-            continue;
-          }
-          if(p.pdgId() == -2212) {
-            _histPtAntiProtons->fill(p.momentum().pT()/GeV, weight);
-            _histAveragePt->fill(p.mass()/GeV,p.momentum().pT()/GeV,weight);
-            continue;
-          }
-
-          if(p.pdgId() == 321) {
-            _histPtKaons->fill(p.momentum().pT()/GeV, weight);
-            _histAveragePt->fill(p.mass()/GeV,p.momentum().pT()/GeV,weight);
-            continue;
-          }
-          if(p.pdgId() == -321) {
-            _histPtAntiKaons->fill(p.momentum().pT()/GeV, weight);
-            _histAveragePt->fill(p.mass()/GeV,p.momentum().pT()/GeV,weight);
-            continue;
+          switch (p.pdgId()) {
+            case 211:
+              _histPtPions->fill(p.momentum().pT()/GeV, weight);
+              _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
+              break;
+            case -211:
+              _histPtAntiPions->fill(p.momentum().pT()/GeV, weight);
+              _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
+              break;
+            case 2212:
+              _histPtProtons->fill(p.momentum().pT()/GeV, weight);
+              _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
+              break;
+            case -2212:
+              _histPtAntiProtons->fill(p.momentum().pT()/GeV, weight);
+              _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
+              break;
+            case 321:
+              _histPtKaons->fill(p.momentum().pT()/GeV, weight);
+              _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
+              break;
+            case -321:
+              _histPtAntiKaons->fill(p.momentum().pT()/GeV, weight);
+              _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
+              break;
           }
         }
       }


More information about the Rivet-svn mailing list