CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
MathUtil.h File Reference
#include <iostream>
#include <math.h>
#include <Rtypes.h>

Go to the source code of this file.

Functions

template<class T >
T Abs (T a)
 
template<class T >
T Max (T a, T b)
 
template<class T >
T max (T a, T b)
 
template<class T >
T Min (T a, T b)
 
template<class T >
T min (T a, T b)
 
template<class T >
T Sign (T A, T B)
 
template<class T >
void Swap (T &a, T &b)
 
template<class T >
void SwapObj (T *a, T *b)
 

Variables

const double fermi = 1.
 
const double GeV = 1.
 
const double hbarc = 0.197*GeV*fermi
 
const double N_INFINITY = 9.0E99
 
const double N_PI = 3.14159265359
 
const double N_SMALL = 1.E-10
 

Function Documentation

template<class T >
T Abs ( T  a)
inline

Definition at line 49 of file MathUtil.h.

References a.

Referenced by FWOverlapTableManager::addOverlapEntry(), MonitorElement::addProfiles(), EmbeddingKineReweightNtupleProducer::analyze(), ZeePlots::analyze(), AnaL1CaloCleaner::analyze(), WenuPlots::analyze(), BeamHaloAnalyzer::analyze(), MCEmbeddingValidationAnalyzer::analyze(), BesselI0(), BesselI1(), FWConvTrackHitsDetailView::build(), FWMET3DProxyBuilder::build(), FWMETProxyBuilder::buildViewType(), HcalHaloAlgo::Calculate(), MEzCalculator::Calculate(), EcalHaloAlgo::Calculate(), METzCalculator::Calculate(), GlobalHaloAlgo::Calculate(), CSCHaloAlgo::Calculate(), SiStripBadAPVAlgorithmFromClusterOccupancy::CalculateMeanAndRMS(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::CalculateMeanAndRMS(), NAStrangePotential::CalculateStrangePotential(), MillePedeAlignmentAlgorithm::callMille2D(), WenuPlots::CheckCut(), ZeePlots::CheckCut1(), ZeePlots::CheckCut1Inv(), ZeePlots::CheckCut2(), ZeePlots::CheckCut2Inv(), WenuPlots::CheckCutInv(), WenuPlots::CheckCuts(), ZeePlots::CheckCuts1(), ZeePlots::CheckCuts2(), reco::modules::TrackerTrackHitFilter::checkHitAngle(), MuonRadiationFilter::checkMuonRadiation(), EventShapeVariables::circularity(), reco::helper::JetIDHelper::classifyJetComponents(), TrackerGeometryCompare::compareSurfaceDeformations(), compareTracklets(), MuonRadiationFilter::compPFIso_raw(), TEveEllipsoid::ComputeBBox(), TEveEllipsoidProjected::ComputeBBox(), EnergyUncertaintyPhotonSpecific::computePhotonEnergyUncertainty_highR9(), EnergyUncertaintyPhotonSpecific::computePhotonEnergyUncertainty_lowR9(), PedeSteererWeakModeConstraints::constructConstraints(), TKinFitter::converged(), EGEnergyCorrector::CorrectedEnergyWithError(), EGEnergyCorrector::CorrectedEnergyWithErrorV3(), PFEnergyCalibration::CorrEta(), JetIDSelectionFunctor::craft08Cuts(), CosmicGenFilterHelix::createHistsEnd(), AntiElectronIDMVA5GBR::dCrackEta(), AntiElectronIDMVA5GBR::dCrackPhi(), Decay(), PFRecoTauDiscriminationAgainstElectronMVA5GBR::discriminate(), PFRecoTauDiscriminationAgainstMuonMVA::discriminate(), PFRecoTauDiscriminationByIsolationMVA2::discriminate(), AntiElectronIDCut2::Discriminator(), IntegralOverPhiFunction::DoEval(), IntegrandThetaFunction::DoEval(), SiPixelGainCalibrationAnalysis::doFits(), TEveEllipsoidProjectedGL::DrawRhoPhi(), TEveEllipsoidProjectedGL::DrawRhoZ(), TEveEllipsoidProjectedGL::drawRhoZAxis(), PFEnergyCalibration::Ecorr(), PFEnergyCalibration::EcorrPS_ePSNil(), EncodedEventId::EncodedEventId(), HOCalibAnalyzer::endJob(), EcalDeadChannelRecoveryNN< DetIdT >::estimateEnergy(), metsig::SignAlgoResolutions::evalPFJet(), ElectronEnergyCorrector::fBremEta(), EcalClusterEnergyCorrectionObjectSpecific::fBremEta(), GenSpecificAlgo::fillCommonMETData(), MillePedeMonitor::fillDerivatives(), QcdLowPtDQM::filldNdeta(), MillePedeMonitor::fillFrameToFrame(), MCEmbeddingValidationAnalyzer::metDistributionType::fillHistograms(), MillePedeMonitor::fillRefTrajectory(), MillePedeMonitor::fillResiduals(), QcdLowPtDQM::fillTracklets(), ZeeCandidateFilter::filter(), fnc_dscb(), fnc_gaussalpha(), fnc_gaussalpha1alpha2(), JetIDSelectionFunctor::fwd09Cuts(), gen::Hydjet2Hadronizer::generatePartonsAndHadronize(), PedeSteererWeakModeConstraints::getCoefficient(), HIPixelClusterVtxProducer::getContainedHits(), pat::PATMHTProducer::getElectrons(), PFEnergyResolution::getEnergyResolutionEm(), HWWFunctions::getExtraLeptons(), TKinFitter::getF(), FWMagField::GetField(), HWWFunctions::getJets(), pat::PATMHTProducer::getJets(), PrimaryVertexValidation::getMAD(), FWMagField::GetMaxFieldMag(), PhotonMIPHaloTagger::GetMipTrailFit(), pat::PATMHTProducer::getMuons(), PFResolutionMap::getRes(), getTheElectron(), getTheMuon(), EcalClusterLocalContCorrection::getValue(), EcalClusterEnergyUncertaintyObjectSpecific::getValue(), EcalBasicClusterLocalContCorrection::getValue(), EcalClusterCrackCorrection::getValue(), reco::helper::JetIDHelper::HBHE_oddness(), FWEveViewManager::highlightAdded(), gen::Hydjet2Hadronizer::initializeForInternalPartons(), PFResolutionMap::IsInAPhiCrack(), CommonUtils::isinf(), ZeeCandidateFilter::isInFiducial(), EventShapeVariables::isotropy(), HDQMUtil::langaupro(), langaupro(), EcalClusterLocal::localCoordsEE(), PFIsolationEstimator::matchPFObject(), PFResolutionMap::minimum(), PFEnergyCalibration::minimum(), AntiElectronIDMVA5GBR::minimum(), GenSpecificAlgo::mkSpecificGenMETData(), HWWFunctions::muonId(), HWWFunctions::muonIdNotIsolated(), AntiElectronIDMVA5GBR::MVAValue(), HWWFunctions::numberOfSoftMuons(), passesElectronId(), passesElectronPreId(), Type0PFMETcorrInputProducer::produce(), CastorTowerProducer::produce(), SmearedJetProducerT< T, Textractor >::produce(), BoostedTopProducer::Psi(), Comp2RefKolmogorov::runTest(), NoisyChannel::runTest(), ContentsWithinExpected::runTest(), scaleFunctionType22< T >::scale(), scaleFunctionType23< T >::scale(), scaleFunctionType24< T >::scale(), scaleFunctionType25< T >::scale(), SiPixelHistoryDQMService::setDBValuesForUser(), TKinFitter::setMaxDeltaS(), TKinFitter::setMaxF(), TopologyWorker::setPartList(), TEcnaResultType::SetSizeHis(), TEcnaResultType::SetSizeMat(), Sign(), TopologyWorker::sign(), HWWFunctions::toptag(), QcdLowPtDQM::trackletVertexUnbinned(), TopologyWorker::ulAngle(), QcdLowPtDQM::vertexZFromClusters(), and HWWFunctions::ww_muIso().

50 {
51  return (a > 0) ? a : -a;
52  }
double a
Definition: hdecay.h:121
template<class T >
T Max ( T  a,
T  b 
)
inline

Definition at line 44 of file MathUtil.h.

References b.

Referenced by FWItemValueGetter::addEntry(), DQMSourceEleCalib::analyze(), ZMuMuIsolationAnalyzer::analyze(), TrackerHitAnalyzer::analyze(), EcalABAnalyzer::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalTestPulseAnalyzer::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), TAPDPulse::arePulseRatioOK(), FWECALDetailViewBuilder::buildCaloData(), reco::helper::JetIDHelper::calculate(), FWInvMassDialog::Calculate(), MuonRadiationFilter::compPFIso_puCorr(), TEveEllipsoid::ComputeBBox(), TEveEllipsoidProjected::ComputeBBox(), PFRecoTauDiscriminationAgainstMuonMVA::discriminate(), PFRecoTauDiscriminationByIsolationMVA2::discriminate(), IntegralOverPhiFunction::DoEval(), TEveEllipsoidProjectedGL::DrawRhoZ(), InvRingCalib::duringLoop(), EcalEleCalibLooper::duringLoop(), GenXSecAnalyzer::endRun(), TauDQMHistPlotter::endRun(), FWTEventList::Enter(), TrackerHitProducer::fillG4MC(), MatrixFillMap::fillMap(), FWHFTowerProxyBuilderBase::fillTowerForDetId(), JetIDSelectionFunctor::fwd09Cuts(), CMSCGEN::generate(), FWCompactVerticalLayout::GetDefaultSize(), FWMagField::GetMaxFieldMag(), GetMPV(), FWGeometryTableViewBase::getTopNodeIdx(), HWWFunctions::goodElectronTMVA(), CmsAnnotation::Handle(), EGammaMvaEleEstimator::IDIsoCombinedMvaValue(), EGammaMvaEleEstimator::isoMvaValue(), TAPDPulse::isPulseRatioMaxOK(), FWCompactVerticalLayout::Layout(), PFRecoTauDiscriminationAgainstElectronDeadECAL::loopXtals(), lorentzianPeak(), AntiElectronIDMVA5GBR::MVAValue(), MuonMVAEstimator::mvaValue_Iso(), TopologyWorker::planes_sphe(), TopologyWorker::planes_sphe_wei(), SmearedJetProducerT< T, Textractor >::produce(), MuonTrackCleanerBase::produceTracks(), FWGeometryTableManager::recalculateVisibility(), ZeePlots::ReturnCandVar(), Comp2RefKolmogorov::runTest(), TopologyWorker::sanda(), muon::segmentCompatibility(), SiStripMonitorDigi::SiStripMonitorDigi(), fireworks::Context::voteMaxEtAndEnergy(), FWGeoTopNode::wrapTransparency(), and L1TOccupancyClient::xySymmetry().

45 {
46  return (a > b) ? a : b;
47  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
template<class T >
T max ( T  a,
T  b 
)
inline

Definition at line 63 of file MathUtil.h.

References b.

64 {
65  return (a > b)?a:b;
66  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
template<class T >
T Min ( T  a,
T  b 
)
inline

Definition at line 39 of file MathUtil.h.

References b.

Referenced by TrackerHitAnalyzer::analyze(), DisplayGeom::analyze(), TAPDPulse::arePulseRatioOK(), FWVertexProxyBuilder::build(), FWTauProxyBuilderBase::buildBaseTau(), FWECALDetailViewBuilder::buildCaloData(), FWJetProxyBuilder::buildViewType(), HcalDataCertification::CertifyHcal(), EGEnergyCorrector::CorrectedEnergyWithErrorV3(), PFRecoTauDiscriminationAgainstMuon2::discriminate(), PFRecoTauDiscriminationAgainstElectronMVA5GBR::discriminate(), PFRecoTauDiscriminationByIsolationMVA2::discriminate(), IntegralOverPhiFunction::DoEval(), TEveEllipsoidProjectedGL::DrawRhoZ(), TrackerHitProducer::fillG4MC(), FWHFTowerProxyBuilderBase::fillTowerForDetId(), JetIDSelectionFunctor::fwd09Cuts(), CMSCGEN::generate(), GetMPV(), CmsAnnotation::Handle(), EGammaMvaEleEstimator::IDIsoCombinedMvaValue(), FWProxyBuilderBase::increaseComponentTransparency(), EGammaMvaEleEstimator::isoMvaValue(), TAPDPulse::isPulseRatioMinOK(), AntiElectronIDMVA5GBR::MVAValue(), MuonMVAEstimator::mvaValue_Iso(), HWWFunctions::nearestDeltaPhi(), reco::tau::PFRecoTauChargedHadronFromTrackPlugin::operator()(), TopologyWorker::planes_sphe(), TopologyWorker::planes_sphe_wei(), TKinFitter::printMatrix(), L1ExtraMixerPluginT< T >::produce(), radius(), JetUtil::radius(), TopologyWorker::sanda(), TopologyWorker::setPartList(), FWMET3DProxyBuilder::Arrow::setScale(), and FWTableView::updateItems().

40 {
41  return (a < b) ? a : b;
42  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
template<class T >
T min ( T  a,
T  b 
)
inline

Definition at line 58 of file MathUtil.h.

References b.

Referenced by argparse.HelpFormatter::_format_action(), python.rootplot.argparse.HelpFormatter::_format_action(), BeautifulSoup.PageElement::_invert(), argparse.ArgumentParser::_parse_known_args(), python.rootplot.argparse.ArgumentParser::_parse_known_args(), abcd(), SiStripAPVRestorer::AbnormalBaselineInspect(), SiPixelCluster::add(), TMom::addEntry(), fit::RootMinuit< Function >::addParameter(), SideBandSubtract::addSideBandRegion(), SideBandSubtract::addSignalRegion(), L1GlobalTriggerObjectMaps::AlgorithmResult::AlgorithmResult(), revisionDML::alldataTags(), FedTimingAlgorithm::analyse(), ApvTimingAlgorithm::analyse(), OptoScanAlgorithm::analyse(), HLTBJet::analyseCorrectedJets(), HLTBJet::analyseCorrectedJetsL1FastJet(), HLTBJet::analyseJets(), HLTBJet::analyseLifetime(), HLTBJet::analyseLifetimeL1FastJet(), HLTBJet::analyseLifetimePF(), HLTBJet::analyseLifetimeSingleTrack(), HLTBJet::analyseLifetimeSingleTrackL1FastJet(), HLTBJet::analysePerformance(), HLTBJet::analysePerformanceL1FastJet(), HLTBJet::analysePFJets(), RECOVertex::analyze(), ZDCMonitorClient::analyze(), HLTMonBTagMuSource::analyze(), HLTMonBTagIPSource::analyze(), BasicGenParticleValidation::analyze(), ValidationMisalignedTracker::analyze(), L1TRPCTF::analyze(), DTLocalTriggerLutTask::analyze(), MuonTrackValidator::analyze(), SiStripTrackingRecHitsValid::analyze(), approx_erf(), approx_expf(), FWProxyBuilderConfiguration::assertParam(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea::autosizeScrollWidget(), HLTMonBitSummary::beginJob(), HWWFunctions::bestHypothesis(), PeriodicBinFinderInPhi< float >::binIndex(), PeriodicBinFinderInZ< float >::binIndex(), GeneralBinFinderInR< T >::binIndex(), GeneralBinFinderInZforGeometricSearchDet< float >::binIndex(), GenericBinFinderInZ< float, GeomDet >::binIndex(), MagBinFinders::GeneralBinFinderInR< double >::binIndex(), RBorderFinder::binIndex(), MagBinFinders::GeneralBinFinderInZ< double >::binIndex(), GctFormatTranslateV38::blockToGctEmCandsAndEnergySums(), GctFormatTranslateV38::blockToGctJetCandsAndCounts(), MaterialBudgetForward::book(), HcalDigisClient::book1D(), HcalDigisValidation::book1D(), DTTriggerEfficiencyTask::bookChamberHistos(), DTLocalTriggerEfficiencyTest::bookChambHistos(), HLTExoticaPlotter::bookHist(), HLTHiggsPlotter::bookHist(), HLTHiggsSubAnalysis::bookHist(), HLTExoticaSubAnalysis::bookHist(), HLTMuonPlotter::bookHist(), PhotonOfflineClient::bookHisto(), PhotonAnalyzer::bookHisto(), HLTHiggsSubAnalysis::bookHistograms(), MuonTrackValidator::bookHistograms(), DTLocalTriggerSynchTask::bookHistos(), DTLocalTriggerTask::bookHistos(), Vispa.Views.LineDecayView.DecayLine::boundingRect(), FWLongParameterSetter::build(), FWDoubleParameterSetter::build(), MagGeoBuilderFromDDD::eLayer::buildMagELayer(), FWCaloTauProxyBuilder::buildViewType(), L1GlobalCaloTrigger::bxSetup(), LocalCacheFile::cache(), parserTimingReport::calc_MinMaxAvgRMS(), LRHelpFunctions::calcPtdrLRval(), SiPixelDigitizerAlgorithm::calcQ(), PFEGammaAlgo::calculate_ele_mva(), barrelUtil::calculatePhiWindow(), HcalDetDiagLaserClient::calculateProblems(), HcalDetDiagNoiseMonitorClient::calculateProblems(), HcalDetDiagPedestalClient::calculateProblems(), HcalDetDiagTimingClient::calculateProblems(), HcalHotCellClient::calculateProblems(), HcalDeadCellClient::calculateProblems(), HcalNZSClient::calculateProblems(), HcalRecHitClient::calculateProblems(), HcalRawDataClient::calculateProblems(), CSCXonStrip_MatchGatti::calculateXonStripError(), CSCXonStrip_MatchGatti::calculateXonStripPosition(), condbon::cdbon_write(), RectangularStripTopology::channel(), TrapezoidalStripTopology::channel(), CSCRadialStripTopology::channel(), TkRadialStripTopology::channel(), GsfElectronAlgo::ElectronData::checkCtfTrack(), SimpleCosmicBONSeeder::checkNoisyModules(), RectangularEtaPhiTrackingRegion::checkRZOld(), StraightLineCylinderCrossing::chooseSolution(), SpikeAndDoubleSpikeCleaner::clean(), TrajectoryCleanerBySharedHits::clean(), TrackCleaner::cleanTracks(), Grid1D::closestNode(), PixelCPEGeneric::collect_edge_charges(), CSCStripElectronicsSim::comparatorReading(), TrajectorySeedProducer::compatibleWithBeamAxis(), EgammaTowerIsolationNew< NC >::compute(), svgfig.Ticks::compute_logticks(), svgfig.Ticks::compute_miniticks(), EcalDccWeightBuilder::computeAllWeights(), ForwardDiskSectorBuilderFromWedges::computeBounds(), ForwardDiskSectorBuilderFromDet::computeBounds(), ForwardRingDiskBuilderFromDet::computeBounds(), DeDxDiscriminatorProducer::ComputeDiscriminator(), TIDLayer::computeDisk(), PileupJetIdAlgo::computeIdVariables(), BarrelDetLayer::computeSurface(), ForwardDetLayer::computeSurface(), MuRingForwardDoubleLayer::computeSurface(), EcalTPGParamBuilder::computeWeights(), Vispa.Views.LineDecayView.DecayLine::containsPoint(), MuonHOAcceptance::convertRegions(), GsfBetheHeitlerUpdator::correctedFirstMean(), SamplingAlgorithm::correctProfile(), SiPixelActionExecutor::createMaps(), LaserSorter::createOutStream(), GaussianSumUtilities1D::d1LnPdf(), GaussianSumUtilities1D::d2LnPdf(), Qjets::d_ij(), revisionDML::dataTagInfo(), DateHandler::dateToTm(), LaserSorter::dcc2Lme(), Vispa.Gui.VispaWidget.VispaWidget::defineCircleBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget::defineRoundRectBackgroundShape(), AlphaTVarProducer::deltaHt(), python.rootplot.core::display_bin_text(), HWWFunctions::doCutFlow(), CSCSkim::doLongSATrack(), CSCStripElectronicsSim::doSaturation(), SideBandSubtract::doSubtraction(), PhysicsTools::TrainProcessor::doTrainData(), EmissionVetoHook1::doVetoFSREmission(), Comparator::Draw(), Vispa.Gui.PortConnection.PointToPointConnection::drawCorner(), Vispa.Gui.MenuWidget.MenuWidget::drawMenuEntries(), ClusterizingHistogram::dump(), VVIObjFDetails::dzero(), VVIObjDetails::dzero(), sistripvvi::VVIObjDetails::dzero(), EcalMonitorPrescaler::EcalMonitorPrescaler(), SiPixelCertification::endLuminosityBlock(), RPCRecHitValidClient::endRun(), AlcaBeamMonitorClient::endRun(), DTCertificationSummary::endRun(), SiPixelCertification::endRun(), PFEnergyCalibration::energyEmHad(), GSUtilities::errorMode(), RectangularEtaPhiTrackingRegion::estimator(), EtaMultiRangeCut::EtaMultiRangeCut(), GflashShowino::evaluateLengths(), HcalTopology::exclude(), cond::ExportIOVUtilities::execute(), cond::AlignSplitIOV::execute(), sistrip::SpyUtilities::extractFrameInfo(), MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), HcalDigiMonitor::fill_Nevents(), MTVHistoProducerAlgoForTracker::fill_recoAssociated_simTrack_histos(), HcalTB06Analysis::fillBuffer(), HcalTB04Analysis::fillBuffer(), HLTMuonMatchAndPlot::fillEdges(), TriggerSummaryProducerAOD::fillFilterObjectMembers(), HcalDetDiagLaserMonitor::fillHistos(), HcalTB04Histo::fillLongProf(), HcalDeadCellMonitor::fillNevents_problemCells(), FastTimerServiceClient::fillPathSummaryPlots(), SiStripQualityChecker::fillSubDetStatus(), ExtractAppInfoFromXML::fillTable(), LRHelpFunctions::fillToSignalCorrelation(), HcalTB04Histo::fillTrnsProf(), ProbeTreeProducer::filter(), CSCDigiValidator::filter(), RPCNoise::filter(), RPCRunIOV::filterIMON(), HEPTopTagger::Filtering(), LA_Filler_Fitter::find_rebin(), ThirdHitPrediction::findArcIntersection(), GaussianSumUtilities1D::findMode(), ThirdHitPrediction::findRectangle(), SymmetryFit::findUsableMinMax(), SequentialPartitionGenerator::first_part(), tauImpactParameter::Chi2VertexFitter::fit(), reco::PositiveSideGhostTrackFitter::fit(), LA_Filler_Fitter::fit_width_profile(), CaloRecHit::flagField(), SiStripAPVRestorer::FlatRegionsFinder(), EcalSelectiveReadoutValidation::frame2Energy(), FWExpressionValidator::FWExpressionValidator(), cmsPerfStripChart::get_yaxis_range(), RPCSimAverage::getClSize(), RPCSimAverageNoise::getClSize(), RPCSimAverageNoiseEff::getClSize(), RPCSimAverageNoiseEffCls::getClSize(), RPCSimAsymmetricCls::getClSize(), sistrip::SpyEventMatcher::getCollections(), GsfElectronCoreBaseProducer::getCtfTrackRef(), ZdcSD::getEnergyDeposit(), CastorSD::getEnergyDeposit(), EcalSelectiveReadoutValidation::getFIRWeights(), EcalSelectiveReadoutSuppressor::getFIRWeigths(), CastorShowerLibraryMaker::GetKinematics(), TMom::getMin(), popcon::EcalDAQHandler::getNewObjects(), popcon::EcalPedestalsHandler::getNewObjectsP5(), TMom::getPeak(), fireworks::getPhiRange(), ThirdHitPrediction::getRanges(), HcalTB02HcalNumberingScheme::getUnitID(), create_public_peakpu_plots::GetXLocator(), create_public_lumi_plots::GetXLocator(), EcalBarrelRecHitsMaker::geVtoGainAdc(), EcalEndcapRecHitsMaker::geVtoGainAdc(), HFGflash::gfParameterization(), CachingSeedCleanerBySharedInput::good(), GsfEleSCEtaMultiRangeCut::GsfEleSCEtaMultiRangeCut(), dataDML::guessDataIdForRange(), Pythia8Hadronizer::hadronize(), mpl_axes_hist_fix::hist(), ApvTimingHistograms::histoAnalysis(), FedTimingHistograms::histoAnalysis(), npstat::HistoND< Numeric, Axis >::HistoND(), PixelTripletLargeTipGenerator::hitTriplets(), PixelTripletHLTGenerator::hitTriplets(), HLTDiMuonGlbTrkFilter::hltFilter(), EGammaMvaEleEstimator::IDIsoCombinedMvaValue(), Vispa.Gui.VispaWidget.VispaWidget::imageRectF(), SiPixelCPEGenericDBErrorParametrization::index(), Grid1D::index(), SiTrivialInduceChargeOnStrips::induceOriginal(), SiTrivialInduceChargeOnStrips::induceVector(), reco::MustacheKernel::inDynamicDPhiWindow(), EcalBarrelRecHitsMaker::init(), TMom::init(), ThirdHitPredictionFromInvParabola::init(), EcalSelectiveReadoutSuppressor::initCellThresholds(), ExpressionHisto< T >::initialize(), reco::MustacheKernel::inMustache(), funct::integral_f(), EcalSelectiveReadoutSuppressor::internalThreshold(), dataDML::intglumiForRange(), cond::IOVRange::IOVRange(), DTHitPairForFit::isCompatible(), PFMuonAlgo::isGlobalLooseMuon(), PFMuonAlgo::isGlobalTightMuon(), L1MuGMTMatrix< T >::isMin(), TangentCircle::isTangent(), npstat::LinInterpolatedTableND< Numeric, Axis >::isWithinLimits(), reco::TrackProbabilityTagInfo::jetProbability(), JetProbabilityComputer::jetProbability(), JetBProbabilityComputer::jetProbability(), SimpleNavigationSchool::linkOuterGroup(), GaussianSumUtilities1D::lnPdf(), HcalNumberingFromDDD::loadGeometry(), CaloTPGTranscoderULUT::loadHCALCompress(), CSCRadialStripTopology::localPitch(), GflashHadronShowerProfile::locateHitPosition(), npstat::ArrayRange::lowerLimits(), main(), PixelThresholdClusterizer::make_cluster(), SiPixelDigitizerAlgorithm::make_digis(), generateEDF::makeEDFplot(), MuIsoValidation::MakeLogBinsForProfile(), EcalUncalibRecHitMaxSampleAlgo< C >::makeRecHit(), CSCHitFromStripOnly::makeStripData(), cmsTiming_parser::manipulate_log(), SiPixelActionExecutor::mapMin(), btag::Matching< Delta >::match(), lhef::Matching< Delta >::match(), AlignmentGlobalTrackSelector::matchTracks(), maxDiff(), GflashHadronShowerProfile::medianLateralArm(), MuonHOAcceptance::deadIdRegion::merge(), PixelTripletHLTGenerator::mergePhiRanges(), PixelTripletLargeTipGenerator::mergePhiRanges(), MultiHitGeneratorFromChi2::mergePhiRanges(), QuadrupletSeedMerger::mergeTriplets(), TrackerInteractionGeometry::minDim(), FlatEvtVtxGenerator::minX(), FlatEvtVtxGenerator::minY(), FlatEvtVtxGenerator::minZ(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), FWEventItem::moveToFront(), FWEventItem::moveToLayer(), MuRingForwardLayer::MuRingForwardLayer(), HWWFunctions::nearestDeltaPhi(), CSCRadialStripTopology::nearestStrip(), TkRadialStripTopology::nearestStrip(), L1CaloHcalScaleConfigOnlineProd::newObject(), CosmicMuonGenerator::nextMultiEvent(), SiStripMonitorMuonHLT::Normalizer(), tauImpactParameter::MultiProngTauSolver::numericalESolver(), RK4PreciseStep::operator()(), reco::parser::min_f::operator()(), CylinderBuilderFromDet::operator()(), funct::GaussLegendreIntegrator::operator()(), npstat::LinInterpolatedTableND< Numeric, Axis >::operator()(), edm::operator<<(), CastorCORData::pack(), SiPixelCluster::pack_(), GflashEMShowerProfile::parameterization(), python.rootplot.core::parse_legend_root(), python.rootplot.core::parse_range(), HWWFunctions::passFirstCuts(), HWWFunctions::passMinMet(), HWWFunctions::passMinMet40(), python.rootplot.rootmath::pathdiff3(), HelixForwardPlaneCrossing::pathLength(), CmsTrackerDiskBuilder::PhiPosNegSplit_innerOuter(), DTTrigGeomUtils::phiRange(), InnerDeltaPhi::phiRange(), RectangularEtaPhiTrackingRegion::phiWindow(), PixelForwardLayerPhase1::PixelForwardLayerPhase1(), SiPixelTemplateSplit::PixelTempSplit(), PixelTrackErrorParam::PixelTrackErrorParam(), HDQMInspector::plot(), cond::PayLoadInspector< DataT >::plot(), plotMaker(), matplotRender.matplotRender::plotPeakPerday_Time(), matplotRender.matplotRender::plotPerdayX_Time(), PFTauRenderPlugin::preDraw(), CSCCrosstalkConditions::prefillCrosstalk(), CSCFakeDBCrosstalk::prefillDBCrosstalk(), CSCGainsConditions::prefillGains(), sipixelobjects::PixelFEDLink::printForMap(), PFMuonAlgo::printMuonProperties(), SiStripNoises::printSummary(), HcalDigiMonitor::process_Digi(), PFAlgo::processBlock(), HcalRecHitMonitor::processEvent_rechit(), reco::modules::MultiTrackSelector::processMVA(), CandOneToOneDeltaRMatcher::produce(), ConversionTrackMerger::produce(), cms::SimpleTrackListMerger::produce(), cms::TrackListMerger::produce(), FastL1CaloSim::produce(), reco::modules::DuplicateListMerger::produce(), AlCaHOCalibProducer::produce(), BaseParticlePropagator::propagate(), Qjets::Prune(), SamplingAlgorithm::pruneProfile(), CSCTFPtMethods::Pt2StnChiSq(), CSCTFPtMethods::Pt3StnChiSq(), EmissionVetoHook1::pTcalc(), ThePEGInterface::pthat(), edm::DataMixingEMDigiWorker::putEM(), TrackClassifier::qualityInformation(), cond::IOVProxyData::range(), rangeIntersection(), ThirdHitPredictionFromInvParabola::rangeRPhi(), RunInfoRead::readData(), HcalSimpleRecAlgoImpl::recoHFTime(), reco::tau::RecoTauPiZeroStripPlugin2::RecoTauPiZeroStripPlugin2(), RecoTauPlotDiscriminator::RecoTauPlotDiscriminator(), reco::GhostTrackVertexFinder::recursiveMerge(), SiStripQuality::ReduceGranularity(), MuonTrackingRegionBuilder::region(), HcalSimpleRecAlgoImpl::removePileup(), svgfig::rgb(), SubjetFilterAlgorithm::run(), HEPTopTagger::run_tagger(), ecaldqm::LaserTask::runOnDigis(), ecaldqm::LedTask::runOnDigis(), TrackerMap::save_as_HVtrackermap(), SiStripBaseCondObjDQM::saveTkMap(), KDTreeLinkerTrackEcal::searchLinks(), PixelForwardLayer::searchNeighbors(), PixelForwardLayerPhase1::searchNeighbors(), TIBRing::searchNeighbors(), reco::modules::MultiTrackSelector::select(), set_mean(), set_sigma(), GlobalHaloAlgo::SetEcalMatchingRadius(), CaloRecHit::setFlagField(), GlobalHaloAlgo::SetHcalMatchingRadius(), CondDBESSource::setIntervalFor(), DatabasePDG::SetMassRange(), CompareToMedian::setMin(), CompareLastFilledBin::setMin(), HistoDef::setMinimum(), FlavourHistograms2D< double, double >::SetMinimum(), FlavourHistograms< int >::SetMinimum(), CSCHaloAlgo::SetMinMaxInnerRadius(), CSCHaloAlgo::SetMinMaxOuterMomentumTheta(), CSCHaloAlgo::SetMinMaxOuterRadius(), SetMinMaxRange(), reco::PhiWedge::SetMinMaxTime(), CompareToMedian::setMinMedian(), TrackerMap::setRange(), Vispa.Main.SplitterTab.SplitterToolBar::setSectionSizes(), SiStripLorentzAngleGenerator::setUniform(), egHLT::BinData::Data1D::setup(), DatabasePDG::SetWidthRange(), HcalZSAlgoRealistic::shouldKeep(), CSCStripHitSim::simulate(), SiPixelCluster::SiPixelCluster(), Vispa.Gui.VispaWidget.VispaWidget::sizeHint(), StripCPEgeometric::WrappedCluster::smallerEdgeStrip(), QGLikelihoodCalculator::smearingFunction(), TrackClusterSplitter::splitCluster(), CSCRadialStripTopology::strip(), TkRadialStripTopology::strip(), npstat::ArrayRange::stripOuterLayer(), SiStripTemplateSplit::StripTempSplit(), PixelRecoRange< float >::sum(), svgfig.XErrorBars::SVG(), svgfig.YErrorBars::SVG(), SiStripTemplate::sxtemp(), ConeIsolationAlgorithm::tag(), TkStripMeasurementDet::testStrips(), LinkByRecHit::testTrackAndClusterByRecHit(), root::tf1(), DTTrigGeomUtils::thetaRange(), HcalNumberingFromDDD::tileHB(), HcalNumberingFromDDD::tileHE(), create_public_lumi_plots.LumiDataBlock::time_begin(), create_public_lumi_plots.LumiDataBlockCollection::time_begin(), RPCRunIOV::toUNIX(), cond::toUNIX(), MuonNavigableLayer::trackingRange(), TrajectoryAtInvalidHit::TrajectoryAtInvalidHit(), funct::trapezoid_integral(), cond::PayLoadInspector< DataT >::trend_plot(), TwoBowedSurfacesDeformation::TwoBowedSurfacesDeformation(), GflashHadronShowerProfile::twoGammaProfile(), HcalNumberingFromDDD::unitID(), HcalRawDataMonitor::unpack(), DCCTowerBlock::unpackXtalData(), DCCSCBlock::unpackXtalData(), HcaluLUTTPGCoder::update(), HcalTB02Analysis::update(), sistrip::RawToDigiUnpacker::update(), CastorTestAnalysis::update(), GaussianSumUtilities1D::update(), Vispa.Main.Application.Application::updateMenu(), RPCFw::UTtoT(), validateGlobalMuonPair(), npstat::HistoND< Numeric, Axis >::volume(), edm::Lumi3DReWeighting::weight3D(), reweight::LumiReWeighting::weight3D(), edm::Lumi3DReWeighting::weight3D_init(), reweight::LumiReWeighting::weight3D_init(), npstat::BoxND< Numeric >::write(), CSCXonStrip_MatchGatti::xfError_Noise(), CSCXonStrip_MatchGatti::xfError_XTasym(), and SiPixelTemplate2D::xytemp().

59 {
60  return (a < b)?a:b;
61  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
template<class T >
T Sign ( T  A,
T  B 
)
inline
template<class T >
void Swap ( T a,
T b 
)
inline

Definition at line 32 of file MathUtil.h.

References a, b, and tmp.

33 {
34  T tmp = a;
35  a = b;
36  b = tmp;
37  }
double b
Definition: hdecay.h:120
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double a
Definition: hdecay.h:121
long double T
template<class T >
void SwapObj ( T a,
T b 
)
inline

Definition at line 25 of file MathUtil.h.

References a, b, and tmp.

26 {
27  T tmp= *a;
28  *a = *b;
29  *b = tmp;
30  }
double b
Definition: hdecay.h:120
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double a
Definition: hdecay.h:121
long double T

Variable Documentation

const double fermi = 1.
const double GeV = 1.

Definition at line 16 of file MathUtil.h.

Referenced by CustomParticleFactory::addCustomParticle(), CustomPhysicsList::addCustomPhysics(), CustomPhysicsListSS::addCustomPhysics(), Rivet::CMS_EWK_10_010::analyze(), Rivet::CMS_EWK_11_021::analyze(), Rivet::CMS_2011_I930319::analyze(), Rivet::CMS_FSQ_12_020::analyze(), Rivet::MC_LES_HOUCHES_SYSTEMATICS_CMS::analyze(), Rivet::CMS_EWK_10_012::analyze(), Bcm1fSD::Bcm1fSD(), CaloSD::CaloSD(), CastorSD::CastorSD(), CMSMonopolePhysics::CMSMonopolePhysics(), CMSMonopolePhysics::ConstructParticle(), CMSMonopolePhysics::ConstructProcess(), Bcm1fSD::createHit(), PltSD::createHit(), TkAccumulatingSensitiveDetector::createHit(), MuonSensitiveDetector::createHit(), HadronPhysicsQGSPCMS_FTFP_BERT::CreateModels(), HadronPhysicsQGSPCMS_FTFP_BERT_WP::CreateModels(), HadronPhysicsCMS::CreateModels(), HadronPhysicsQGSP_BERT_WP::CreateModels(), CaloSD::createNewHit(), Decay3Body::doDecay(), GflashHadronShowerModel::DoIt(), GFlashEMShowerModel::DoIt(), GflashEMShowerModel::DoIt(), GflashHadronShowerModel::excludeDetectorRegion(), HcalTestAnalysis::fill(), SimG4HcalValidation::fill(), ThePEGInterface::fillAuxiliary(), HcalTB06Analysis::fillBuffer(), HcalTB04Analysis::fillBuffer(), HcalTB02Analysis::fillEvent(), MaterialBudgetCastorHistos::fillStartTrack(), MaterialBudgetHcalHistos::fillStartTrack(), Rivet::CMS_2011_I930319::finalize(), ZdcShowerLibrary::getEnergyFromLibrary(), ZdcSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), HFShowerPMT::getHits(), HFShowerParam::getHits(), HFShowerLibrary::getHits(), CastorShowerLibraryMaker::GetKinematics(), TotemSD::GetStepInfo(), BscSD::GetStepInfo(), FP420SD::GetStepInfo(), CaloMeanResponse::getWeight(), HFGflash::gfParameterization(), GflashHadronShowerProfile::hadronicParameterization(), CalorimetryManager::HDShowerSimulation(), Generator::HepMC2G4(), HFShowerLibrary::HFShowerLibrary(), HCalSD::hitForFibre(), Rivet::CMS_EWK_11_021::init(), Rivet::CMS_EWK_10_012::init(), Rivet::CMS_EWK_10_010::init(), Rivet::CMS_2011_I930319::init(), Rivet::CMS_2010_S8808686::init(), Rivet::MC_LES_HOUCHES_SYSTEMATICS_CMS::init(), ThePEG::HepMCConverter< HepMCEventT, Traits >::init(), TreatSecondary::initTrack(), HFShowerLibrary::interpolate(), GflashHadronShowerModel::isFirstInelasticInteraction(), G4SimEvent::load(), CustomParticleFactory::loadCustomParticles(), CastorShowerLibrary::loadEventInfo(), HFShowerLibrary::loadEventInfo(), GflashHadronShowerModel::ModelTrigger(), GFlashEMShowerModel::ModelTrigger(), GflashEMShowerModel::ModelTrigger(), NAStrangeDensity::NAStrangeDensity(), Generator::nonBeamEvent2G4(), GflashEMShowerProfile::parameterization(), Generator::particleAssignDaughters(), Generator::particlePassesPrimaryCuts(), PltSD::PltSD(), GflashHadronWrapperProcess::Print(), CaloSD::ProcessHits(), ThePEGInterface::pthat(), CaloMeanResponse::readResponse(), CaloSD::resetForNewPrimary(), UrbanMscModel93::SampleCosineTheta(), CaloSD::saveHit(), PhysicsList::SetCuts(), CustomPhysicsList::setupRHadronPhycis(), CustomPhysicsListSS::setupRHadronPhycis(), TkAccumulatingSensitiveDetector::TkAccumulatingSensitiveDetector(), TreatSecondary::tracks(), MonopoleSteppingAction::update(), RHStopTracer::update(), GflashG4Watcher::update(), MaterialBudget::update(), MaterialBudgetForward::update(), TrackingVerboseAction::update(), HcalTB02Analysis::update(), DoCastorAnalysis::update(), PltSD::updateHit(), Bcm1fSD::updateHit(), TkAccumulatingSensitiveDetector::updateHit(), MuonSensitiveDetector::updateHit(), ZdcSD::ZdcSD(), and PhysicsList::~PhysicsList().

const double hbarc = 0.197*GeV*fermi
const double N_INFINITY = 9.0E99

Definition at line 21 of file MathUtil.h.

const double N_PI = 3.14159265359

Definition at line 19 of file MathUtil.h.

Referenced by NAStrangeDensity::ParticleNumberDensity().

const double N_SMALL = 1.E-10

Definition at line 22 of file MathUtil.h.