|
[Rivet-svn] r3752 - trunk/src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgFri Jun 8 15:08:44 BST 2012
Author: hoeth Date: Fri Jun 8 15:08:44 2012 New Revision: 3752 Log: whitespace cleanup to follow Rivet conventions Modified: trunk/src/Analyses/OPAL_1996_S3257789.cc trunk/src/Analyses/SLD_1999_S3743934.cc Modified: trunk/src/Analyses/OPAL_1996_S3257789.cc ============================================================================== --- trunk/src/Analyses/OPAL_1996_S3257789.cc Fri Jun 8 15:07:52 2012 (r3751) +++ trunk/src/Analyses/OPAL_1996_S3257789.cc Fri Jun 8 15:08:44 2012 (r3752) @@ -57,25 +57,25 @@ // Final state of unstable particles to get particle spectra const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS"); - + foreach (const Particle& p, ufs.particles()) { - if(abs(p.pdgId())==443) { - double xp = p.momentum().vector3().mod()/meanBeamMom; - _histXpJPsi->fill(xp, weight); - _multJPsi->fill(91.2,weight); - _weightSum += weight; + if(abs(p.pdgId())==443) { + double xp = p.momentum().vector3().mod()/meanBeamMom; + _histXpJPsi->fill(xp, weight); + _multJPsi->fill(91.2,weight); + _weightSum += weight; + } + else if(abs(p.pdgId())==100443) { + _multPsiPrime->fill(91.2,weight); } - else if(abs(p.pdgId())==100443) { - _multPsiPrime->fill(91.2,weight); - } } } /// Finalize void finalize() { - if(_weightSum>0.) - scale(_histXpJPsi , 0.1/_weightSum); + if(_weightSum>0.) + scale(_histXpJPsi , 0.1/_weightSum); scale(_multJPsi , 1./sumOfWeights()); scale(_multPsiPrime, 1./sumOfWeights()); } Modified: trunk/src/Analyses/SLD_1999_S3743934.cc ============================================================================== --- trunk/src/Analyses/SLD_1999_S3743934.cc Fri Jun 8 15:07:52 2012 (r3751) +++ trunk/src/Analyses/SLD_1999_S3743934.cc Fri Jun 8 15:08:44 2012 (r3752) @@ -21,11 +21,11 @@ /// Constructor SLD_1999_S3743934() : Analysis("SLD_1999_S3743934"), - _SumOfudsWeights(0.), _SumOfcWeights(0.), - _SumOfbWeights(0.), - _multPiPlus(4,0.),_multKPlus(4,0.),_multK0(4,0.), - _multKStar0(4,0.),_multPhi(4,0.), - _multProton(4,0.),_multLambda(4,0.) + _SumOfudsWeights(0.), _SumOfcWeights(0.), + _SumOfbWeights(0.), + _multPiPlus(4,0.),_multKPlus(4,0.),_multK0(4,0.), + _multKStar0(4,0.),_multPhi(4,0.), + _multProton(4,0.),_multLambda(4,0.) {} @@ -45,7 +45,7 @@ MSG_DEBUG("Passed ncharged cut"); // Get event weight for histo filling const double weight = e.weight(); - + // Get beams and average beam momentum const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams(); const double meanBeamMom = ( beams.first.momentum().vector3().mod() + @@ -53,35 +53,35 @@ MSG_DEBUG("Avg beam momentum = " << meanBeamMom); int flavour = 0; const InitialQuarks& iqf = applyProjection<InitialQuarks>(e, "IQF"); - + // If we only have two quarks (qqbar), just take the flavour. // If we have more than two quarks, look for the highest energetic q-qbar pair. ParticleVector quarks; if (iqf.particles().size() == 2) { flavour = abs( iqf.particles().front().pdgId() ); - quarks = iqf.particles(); + quarks = iqf.particles(); } else { map<int, Particle > quarkmap; foreach (const Particle& p, iqf.particles()) { if (quarkmap.find(p.pdgId())==quarkmap.end()) - quarkmap[p.pdgId()] = p; - else if (quarkmap[p.pdgId()].momentum().E() < p.momentum().E()) - quarkmap[p.pdgId()] = p; + quarkmap[p.pdgId()] = p; + else if (quarkmap[p.pdgId()].momentum().E() < p.momentum().E()) + quarkmap[p.pdgId()] = p; } double maxenergy = 0.; for (int i = 1; i <= 5; ++i) { - double energy(0.); - if(quarkmap.find( i)!=quarkmap.end()) - energy += quarkmap[ i].momentum().E(); - if(quarkmap.find(-i)!=quarkmap.end()) - energy += quarkmap[-i].momentum().E(); + double energy(0.); + if(quarkmap.find( i)!=quarkmap.end()) + energy += quarkmap[ i].momentum().E(); + if(quarkmap.find(-i)!=quarkmap.end()) + energy += quarkmap[-i].momentum().E(); if (energy > maxenergy) flavour = i; } - if(quarkmap.find( flavour)!=quarkmap.end()) - quarks.push_back(quarkmap[ flavour]); - if(quarkmap.find(-flavour)!=quarkmap.end()) - quarks.push_back(quarkmap[-flavour]); + if(quarkmap.find( flavour)!=quarkmap.end()) + quarks.push_back(quarkmap[ flavour]); + if(quarkmap.find(-flavour)!=quarkmap.end()) + quarks.push_back(quarkmap[-flavour]); } switch (flavour) { case 1: case 2: case 3: @@ -98,179 +98,179 @@ Vector3 axis = applyProjection<Thrust>(e, "Thrust").thrustAxis(); double dot(0.); if(!quarks.empty()) { - dot = quarks[0].momentum().vector3().dot(axis); - if(quarks[0].pdgId()<0) dot *= -1.; + dot = quarks[0].momentum().vector3().dot(axis); + if(quarks[0].pdgId()<0) dot *= -1.; } foreach (const Particle& p, fs.particles()) { - const double xp = p.momentum().vector3().mod()/meanBeamMom; - // if in quark or antiquark hemisphere - bool quark = p.momentum().vector3().dot(axis)*dot>0.; - _histXpChargedN->fill(xp, weight); - int id = abs(p.pdgId()); - // charged pions - if(id==PIPLUS) { - _histXpPiPlusN->fill(xp, weight); - _multPiPlus[0] += weight; - switch (flavour) { - case DQUARK: case UQUARK: case SQUARK: - _multPiPlus[1] += weight; - _histXpPiPlusLight->fill(xp, weight); - if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) - _histRPiPlus->fill(xp, weight); - else - _histRPiMinus->fill(xp, weight); - break; - case CQUARK: - _multPiPlus[2] += weight; - _histXpPiPlusCharm->fill(xp, weight); - break; - case BQUARK: - _multPiPlus[3] += weight; - _histXpPiPlusBottom->fill(xp, weight); - break; - } - } - else if(id==KPLUS) { - _histXpKPlusN->fill(xp, weight); - _multKPlus[0] += weight; - switch (flavour) { - case DQUARK: case UQUARK: case SQUARK: - _multKPlus[1] += weight; - _tempXpKPlusLight->fill(xp, weight); - _histXpKPlusLight->fill(xp, weight); - if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) - _histRKPlus->fill(xp, weight); - else - _histRKMinus->fill(xp, weight); - break; + const double xp = p.momentum().vector3().mod()/meanBeamMom; + // if in quark or antiquark hemisphere + bool quark = p.momentum().vector3().dot(axis)*dot>0.; + _histXpChargedN->fill(xp, weight); + int id = abs(p.pdgId()); + // charged pions + if(id==PIPLUS) { + _histXpPiPlusN->fill(xp, weight); + _multPiPlus[0] += weight; + switch (flavour) { + case DQUARK: case UQUARK: case SQUARK: + _multPiPlus[1] += weight; + _histXpPiPlusLight->fill(xp, weight); + if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) + _histRPiPlus->fill(xp, weight); + else + _histRPiMinus->fill(xp, weight); + break; + case CQUARK: + _multPiPlus[2] += weight; + _histXpPiPlusCharm->fill(xp, weight); + break; + case BQUARK: + _multPiPlus[3] += weight; + _histXpPiPlusBottom->fill(xp, weight); + break; + } + } + else if(id==KPLUS) { + _histXpKPlusN->fill(xp, weight); + _multKPlus[0] += weight; + switch (flavour) { + case DQUARK: case UQUARK: case SQUARK: + _multKPlus[1] += weight; + _tempXpKPlusLight->fill(xp, weight); + _histXpKPlusLight->fill(xp, weight); + if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) + _histRKPlus->fill(xp, weight); + else + _histRKMinus->fill(xp, weight); + break; break; - case CQUARK: - _multKPlus[2] += weight; - _histXpKPlusCharm->fill(xp, weight); - _tempXpKPlusCharm->fill(xp, weight); - break; - case BQUARK: - _multKPlus[3] += weight; - _histXpKPlusBottom->fill(xp, weight); - break; - } - } - else if(id==PROTON) { - _histXpProtonN->fill(xp, weight); - _multProton[0] += weight; - switch (flavour) { - case DQUARK: case UQUARK: case SQUARK: - _multProton[1] += weight; - _tempXpProtonLight->fill(xp, weight); - _histXpProtonLight->fill(xp, weight); - if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) - _histRProton->fill(xp, weight); - else - _histRPBar ->fill(xp, weight); - break; + case CQUARK: + _multKPlus[2] += weight; + _histXpKPlusCharm->fill(xp, weight); + _tempXpKPlusCharm->fill(xp, weight); + break; + case BQUARK: + _multKPlus[3] += weight; + _histXpKPlusBottom->fill(xp, weight); + break; + } + } + else if(id==PROTON) { + _histXpProtonN->fill(xp, weight); + _multProton[0] += weight; + switch (flavour) { + case DQUARK: case UQUARK: case SQUARK: + _multProton[1] += weight; + _tempXpProtonLight->fill(xp, weight); + _histXpProtonLight->fill(xp, weight); + if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) + _histRProton->fill(xp, weight); + else + _histRPBar ->fill(xp, weight); + break; break; - case CQUARK: - _multProton[2] += weight; - _tempXpProtonCharm->fill(xp, weight); - _histXpProtonCharm->fill(xp, weight); - break; - case BQUARK: - _multProton[3] += weight; - _histXpProtonBottom->fill(xp, weight); - break; - } - } + case CQUARK: + _multProton[2] += weight; + _tempXpProtonCharm->fill(xp, weight); + _histXpProtonCharm->fill(xp, weight); + break; + case BQUARK: + _multProton[3] += weight; + _histXpProtonBottom->fill(xp, weight); + break; + } + } } const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS"); foreach (const Particle& p, ufs.particles()) { - const double xp = p.momentum().vector3().mod()/meanBeamMom; - // if in quark or antiquark hemisphere - bool quark = p.momentum().vector3().dot(axis)*dot>0.; - int id = abs(p.pdgId()); - if(id==LAMBDA) { - _multLambda[0] += weight; - _histXpLambdaN->fill(xp, weight); - switch (flavour) { - case DQUARK: case UQUARK: case SQUARK: - _multLambda[1] += weight; - _histXpLambdaLight->fill(xp, weight); - if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) - _histRLambda->fill(xp, weight); - else - _histRLBar ->fill(xp, weight); - break; - case CQUARK: - _multLambda[2] += weight; - _histXpLambdaCharm->fill(xp, weight); - break; - case BQUARK: - _multLambda[3] += weight; - _histXpLambdaBottom->fill(xp, weight); - break; - } - } - else if(id==313) { - _multKStar0[0] += weight; - _histXpKStar0N->fill(xp, weight); - switch (flavour) { - case DQUARK: case UQUARK: case SQUARK: - _multKStar0[1] += weight; - _tempXpKStar0Light->fill(xp, weight); - _histXpKStar0Light->fill(xp, weight); - if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) - _histRKS0 ->fill(xp, weight); - else - _histRKSBar0->fill(xp, weight); - break; - break; - case CQUARK: - _multKStar0[2] += weight; - _tempXpKStar0Charm->fill(xp, weight); - _histXpKStar0Charm->fill(xp, weight); - break; - case BQUARK: - _multKStar0[3] += weight; - _histXpKStar0Bottom->fill(xp, weight); - break; - } - } - else if(id==333) { - _multPhi[0] += weight; - _histXpPhiN->fill(xp, weight); - switch (flavour) { - case DQUARK: case UQUARK: case SQUARK: - _multPhi[1] += weight; - _histXpPhiLight->fill(xp, weight); - break; - case CQUARK: - _multPhi[2] += weight; - _histXpPhiCharm->fill(xp, weight); - break; - case BQUARK: - _multPhi[3] += weight; - _histXpPhiBottom->fill(xp, weight); - break; - } - } - else if(id==K0S || id == K0L) { - _multK0[0] += weight; - _histXpK0N->fill(xp, weight); - switch (flavour) { - case DQUARK: case UQUARK: case SQUARK: - _multK0[1] += weight; - _histXpK0Light->fill(xp, weight); - break; - case CQUARK: - _multK0[2] += weight; - _histXpK0Charm->fill(xp, weight); - break; - case BQUARK: - _multK0[3] += weight; - _histXpK0Bottom->fill(xp, weight); - break; - } - } + const double xp = p.momentum().vector3().mod()/meanBeamMom; + // if in quark or antiquark hemisphere + bool quark = p.momentum().vector3().dot(axis)*dot>0.; + int id = abs(p.pdgId()); + if(id==LAMBDA) { + _multLambda[0] += weight; + _histXpLambdaN->fill(xp, weight); + switch (flavour) { + case DQUARK: case UQUARK: case SQUARK: + _multLambda[1] += weight; + _histXpLambdaLight->fill(xp, weight); + if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) + _histRLambda->fill(xp, weight); + else + _histRLBar ->fill(xp, weight); + break; + case CQUARK: + _multLambda[2] += weight; + _histXpLambdaCharm->fill(xp, weight); + break; + case BQUARK: + _multLambda[3] += weight; + _histXpLambdaBottom->fill(xp, weight); + break; + } + } + else if(id==313) { + _multKStar0[0] += weight; + _histXpKStar0N->fill(xp, weight); + switch (flavour) { + case DQUARK: case UQUARK: case SQUARK: + _multKStar0[1] += weight; + _tempXpKStar0Light->fill(xp, weight); + _histXpKStar0Light->fill(xp, weight); + if( ( quark && p.pdgId()>0 ) || ( !quark && p.pdgId()<0 )) + _histRKS0 ->fill(xp, weight); + else + _histRKSBar0->fill(xp, weight); + break; + break; + case CQUARK: + _multKStar0[2] += weight; + _tempXpKStar0Charm->fill(xp, weight); + _histXpKStar0Charm->fill(xp, weight); + break; + case BQUARK: + _multKStar0[3] += weight; + _histXpKStar0Bottom->fill(xp, weight); + break; + } + } + else if(id==333) { + _multPhi[0] += weight; + _histXpPhiN->fill(xp, weight); + switch (flavour) { + case DQUARK: case UQUARK: case SQUARK: + _multPhi[1] += weight; + _histXpPhiLight->fill(xp, weight); + break; + case CQUARK: + _multPhi[2] += weight; + _histXpPhiCharm->fill(xp, weight); + break; + case BQUARK: + _multPhi[3] += weight; + _histXpPhiBottom->fill(xp, weight); + break; + } + } + else if(id==K0S || id == K0L) { + _multK0[0] += weight; + _histXpK0N->fill(xp, weight); + switch (flavour) { + case DQUARK: case UQUARK: case SQUARK: + _multK0[1] += weight; + _histXpK0Light->fill(xp, weight); + break; + case CQUARK: + _multK0[2] += weight; + _histXpK0Charm->fill(xp, weight); + break; + case BQUARK: + _multK0[3] += weight; + _histXpK0Bottom->fill(xp, weight); + break; + } + } } } @@ -313,17 +313,17 @@ _histXpPhiBottom = bookHistogram1D(22, 1, 3); _tempXpKPlusCharm = bookHistogram1D( "tempXpKPlusCharm" , - binEdges(13,1,1),"tempXpKPlusCharm" ,"X","Y"); + binEdges(13,1,1),"tempXpKPlusCharm" ,"X","Y"); _tempXpKPlusLight = bookHistogram1D( "tempXpKPlusLight" , - binEdges(13,1,1),"tempXpKPlusLight" ,"X","Y"); + binEdges(13,1,1),"tempXpKPlusLight" ,"X","Y"); _tempXpKStar0Charm = bookHistogram1D( "tempXpKStar0Charm", - binEdges(15,1,1),"tempXpKStar0Charm","X","Y"); + binEdges(15,1,1),"tempXpKStar0Charm","X","Y"); _tempXpKStar0Light = bookHistogram1D( "tempXpKStar0Light", - binEdges(15,1,1),"tempXpKStar0Light","X","Y"); + binEdges(15,1,1),"tempXpKStar0Light","X","Y"); _tempXpProtonCharm = bookHistogram1D( "tempXpProtonCharm", - binEdges(17,1,1),"tempXpProtonCharm","X","Y"); + binEdges(17,1,1),"tempXpProtonCharm","X","Y"); _tempXpProtonLight = bookHistogram1D( "tempXpProtonLight", - binEdges(17,1,1),"tempXpProtonLight","X","Y"); + binEdges(17,1,1),"tempXpProtonLight","X","Y"); _histRPiPlus = bookHistogram1D( 26, 1, 1); _histRPiMinus = bookHistogram1D( 26, 1, 2); @@ -623,42 +623,42 @@ void scale(AIDA::IDataPointSet*& histo, double scale) { if (!histo) { - MSG_ERROR("Failed to scale histo=NULL in analysis " - << name() << " (scale=" << scale << ")"); - return; + MSG_ERROR("Failed to scale histo=NULL in analysis " + << name() << " (scale=" << scale << ")"); + return; } const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); MSG_TRACE("Scaling histo " << hpath); - + vector<double> x, y, ex, ey; for (size_t i = 0, N = histo->size(); i < N; ++i) { - IDataPoint * point = histo->point(i); - assert(point->dimension()==2); - x .push_back(point->coordinate(0)->value()); - ex.push_back(0.5*(point->coordinate(0)->errorPlus()+ - point->coordinate(0)->errorMinus())); - y .push_back(point->coordinate(1)->value()*scale); - ey.push_back(0.5*scale*(point->coordinate(1)->errorPlus()+ - point->coordinate(1)->errorMinus())); + IDataPoint * point = histo->point(i); + assert(point->dimension()==2); + x .push_back(point->coordinate(0)->value()); + ex.push_back(0.5*(point->coordinate(0)->errorPlus()+ + point->coordinate(0)->errorMinus())); + y .push_back(point->coordinate(1)->value()*scale); + ey.push_back(0.5*scale*(point->coordinate(1)->errorPlus()+ + point->coordinate(1)->errorMinus())); } string title = histo->title(); string xtitle = histo->xtitle(); string ytitle = histo->ytitle(); - + tree().mkdir("/tmpnormalize"); tree().mv(hpath, "/tmpnormalize"); - + if (hpath.find(" ") != string::npos) { - throw Error("Histogram path '" + hpath + "' is invalid: spaces are not permitted in paths"); + throw Error("Histogram path '" + hpath + "' is invalid: spaces are not permitted in paths"); } AIDA::IDataPointSet* dps = datapointsetFactory().createXY(hpath, title, x, y, ex, ey); dps->setXTitle(xtitle); dps->setYTitle(ytitle); - + tree().rm(tree().findPath(dynamic_cast<AIDA::IManagedObject&>(*histo))); tree().rmdir("/tmpnormalize"); - + // Set histo pointer to null - it can no longer be used. histo = 0; } @@ -672,31 +672,31 @@ vector<double> _multPiPlus,_multKPlus,_multK0,_multKStar0, _multPhi,_multProton,_multLambda; - AIDA::IHistogram1D *_histXpPiPlusSig; - AIDA::IHistogram1D *_histXpPiPlusN; - AIDA::IHistogram1D *_histXpKPlusSig; - AIDA::IHistogram1D *_histXpKPlusN; - AIDA::IHistogram1D *_histXpProtonSig; - AIDA::IHistogram1D *_histXpProtonN; - AIDA::IHistogram1D *_histXpChargedN; - AIDA::IHistogram1D *_histXpK0N; - AIDA::IHistogram1D *_histXpLambdaN; - AIDA::IHistogram1D *_histXpKStar0N; + AIDA::IHistogram1D *_histXpPiPlusSig; + AIDA::IHistogram1D *_histXpPiPlusN; + AIDA::IHistogram1D *_histXpKPlusSig; + AIDA::IHistogram1D *_histXpKPlusN; + AIDA::IHistogram1D *_histXpProtonSig; + AIDA::IHistogram1D *_histXpProtonN; + AIDA::IHistogram1D *_histXpChargedN; + AIDA::IHistogram1D *_histXpK0N; + AIDA::IHistogram1D *_histXpLambdaN; + AIDA::IHistogram1D *_histXpKStar0N; AIDA::IHistogram1D *_histXpPhiN; - AIDA::IHistogram1D *_histXpPiPlusLight; - AIDA::IHistogram1D *_histXpPiPlusCharm; + AIDA::IHistogram1D *_histXpPiPlusLight; + AIDA::IHistogram1D *_histXpPiPlusCharm; AIDA::IHistogram1D *_histXpPiPlusBottom; - AIDA::IHistogram1D *_histXpKPlusLight; - AIDA::IHistogram1D *_histXpKPlusCharm; + AIDA::IHistogram1D *_histXpKPlusLight; + AIDA::IHistogram1D *_histXpKPlusCharm; AIDA::IHistogram1D *_histXpKPlusBottom; - AIDA::IHistogram1D *_histXpKStar0Light; - AIDA::IHistogram1D *_histXpKStar0Charm; + AIDA::IHistogram1D *_histXpKStar0Light; + AIDA::IHistogram1D *_histXpKStar0Charm; AIDA::IHistogram1D *_histXpKStar0Bottom; - AIDA::IHistogram1D *_histXpProtonLight; - AIDA::IHistogram1D *_histXpProtonCharm; + AIDA::IHistogram1D *_histXpProtonLight; + AIDA::IHistogram1D *_histXpProtonCharm; AIDA::IHistogram1D *_histXpProtonBottom; - AIDA::IHistogram1D *_histXpLambdaLight; - AIDA::IHistogram1D *_histXpLambdaCharm; + AIDA::IHistogram1D *_histXpLambdaLight; + AIDA::IHistogram1D *_histXpLambdaCharm; AIDA::IHistogram1D *_histXpLambdaBottom; AIDA::IHistogram1D *_histXpK0Light; AIDA::IHistogram1D *_histXpK0Charm;
More information about the Rivet-svn mailing list |