CMS 3D CMS Logo

Functions | Variables
UKUtility.cc File Reference
#include "TLorentzVector.h"
#include "TVector3.h"
#include "GeneratorInterface/Hydjet2Interface/interface/Particle.h"
#include "GeneratorInterface/Hydjet2Interface/interface/UKUtility.h"
#include "CLHEP/Random/RandomEngine.h"
#include "CLHEP/Random/RandFlat.h"

Go to the source code of this file.

Functions

void IsotropicR3 (double r, double *x, double *y, double *z)
 
void IsotropicR3 (double r, TVector3 &pos)
 
void MomAntiMom (TLorentzVector &mom, double mass, TLorentzVector &antiMom, double antiMass, double initialMass)
 

Variables

const double fermi = 1.
 
const double GeV = 1.
 
const double hbarc = 0.197 * GeV * fermi
 
const double hbarc_squared = hbarc * hbarc
 
CLHEP::HepRandomEngine * hjRandomEngine
 
const double w = 1.0 / 0.1973
 

Function Documentation

◆ IsotropicR3() [1/2]

void IsotropicR3 ( double  r,
double *  x,
double *  y,
double *  z 
)

Definition at line 26 of file UKUtility.cc.

26  {
27  double pZ = 1. - 2. * (CLHEP::RandFlat::shoot(hjRandomEngine));
28  double st = TMath::Sqrt(1. - pZ * pZ) * r;
29  double phi = 2. * TMath::Pi() * (CLHEP::RandFlat::shoot(hjRandomEngine));
30 
31  *x = st * cos(phi);
32  *y = st * sin(phi);
33  *z = pZ * r;
34 }

References funct::cos(), hjRandomEngine, PVValHelper::phi, Pi, alignCSCRings::r, funct::sin(), genVertex_cff::x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by MomAntiMom().

◆ IsotropicR3() [2/2]

void IsotropicR3 ( double  r,
TVector3 &  pos 
)

Definition at line 36 of file UKUtility.cc.

36  {
37  double pZ = 1. - 2. * (CLHEP::RandFlat::shoot(hjRandomEngine));
38  double st = TMath::Sqrt(1. - pZ * pZ) * r;
39  double phi = 2. * TMath::Pi() * (CLHEP::RandFlat::shoot(hjRandomEngine));
40  pos.SetX(st * TMath::Cos(phi));
41  pos.SetY(st * TMath::Sin(phi));
42  pos.SetZ(pZ * r);
43 }

References hjRandomEngine, PVValHelper::phi, Pi, and alignCSCRings::r.

◆ MomAntiMom()

void MomAntiMom ( TLorentzVector &  mom,
double  mass,
TLorentzVector &  antiMom,
double  antiMass,
double  initialMass 
)

Definition at line 45 of file UKUtility.cc.

45  {
46  double r = initialMass * initialMass - mass * mass - antiMass * antiMass;
47  if (r * r - 4 * mass * mass * antiMass * antiMass < 0.)
48  throw "MomAntiMom";
49 
50  double pAbs = .5 * TMath::Sqrt(r * r - 4 * mass * mass * antiMass * antiMass) / initialMass;
51  TVector3 mom3;
52  IsotropicR3(pAbs, mom3);
53  mom.SetVectM(mom3, mass);
54  antiMom.SetVectM(-mom3, antiMass);
55 }

References IsotropicR3(), EgHLTOffHistBins_cfi::mass, and alignCSCRings::r.

Referenced by Decay().

Variable Documentation

◆ fermi

const double fermi = 1.

Definition at line 21 of file UKUtility.cc.

◆ GeV

const double GeV = 1.

Definition at line 20 of file UKUtility.cc.

◆ hbarc

const double hbarc = 0.197 * GeV * fermi

Definition at line 22 of file UKUtility.cc.

◆ hbarc_squared

const double hbarc_squared = hbarc * hbarc

Definition at line 24 of file UKUtility.cc.

◆ hjRandomEngine

CLHEP::HepRandomEngine* hjRandomEngine

◆ w

const double w = 1.0 / 0.1973

Definition at line 23 of file UKUtility.cc.

Referenced by EcalSelectiveReadoutSuppressor::accept(), reco::Vertex::add(), FastLineRecognition::Cluster::add(), lhef::LHERunInfo::Process::addAccepted(), lhef::LHERunInfo::Process::addAcceptedBr(), reco::PFDisplacedVertex::addElement(), MinL3Algorithm::addEvent(), MinL3AlgoUniv< DetId >::addEvent(), lhef::LHERunInfo::Process::addKilled(), hi::GenPlane::addParticle(), ParabolaFit::addPoint(), lhef::LHERunInfo::Process::addSelected(), edm::PreMixingModule::addSignals(), edm::WorkerManager::addToAllWorkers(), edm::StreamSchedule::addToAllWorkers(), lhef::LHERunInfo::Process::addTried(), DQMMessageLogger::analyze(), L1TDTTF::analyze(), ValidationMisalignedTracker::analyze(), MuonTrackValidator::analyze(), EcalSimHitStudy::analyzeHits(), BaseTagInfoPlotter::analyzeTag(), SoftLeptonTagPlotter::analyzeTag(), TrackCountingTagPlotter::analyzeTag(), TrackProbabilityTagPlotter::analyzeTag(), IPTagPlotter< Container, Base >::analyzeTag(), TaggingVariablePlotter::analyzeTag(), MVAJetTagPlotter::analyzeTag(), JetTagPlotter::analyzeTag(), TagCorrelationPlotter::analyzeTags(), edm::PreMixingModule::beginLuminosityBlock(), edm::PreMixingModule::beginRun(), DAClusterizerInZ::beta0(), DAClusterizerInZ_vect::beta0(), DAClusterizerInZT_vect::beta0(), DTSegment4DQuality::bookHistograms(), DTRecHitQuality::bookHistograms(), HGCalGeometryLoader::build(), FWVertexProxyBuilder::build(), PPSAlignmentHarvester::buildModeGraph(), CSCEventData::calcALCTcrc(), L1RCTElectronIsolationCard::calcElectronCandidates(), BoostedDoubleSVProducer::calcNsubjettiness(), FastCircleFit::calculate(), ClusterShapeAlgo::Calculate_Covariances(), PFPileUpAlgo::chargedHadronVertex(), PrimaryVertexAssignment::chargedHadronVertex(), PFIsolationEstimator::chargedHadronVertex(), JetCharge::chargeFromRef(), JetCharge::chargeFromValIterator(), CSCDCCExaminer::check(), AdaptiveVertexReconstructor::cleanUpVertices(), RPCEventSummary::clientOperation(), CmsShowMain::CmsShowMain(), EcalDccWeightBuilder::computeAllWeights(), UrbanMscModel93::ComputeCrossSectionPerAtom(), GaussianSumUtilities1D::computeMode(), HFCherenkov::computeNPE(), HFCherenkov::computeNPEinPMT(), HFCherenkov::computeNPhTrapped(), l1tpf_impl::PuppiAlgo::computePuppiAlphas(), l1tpf_impl::PuppiAlgo::computePuppiMedRMS(), EcalClusterToolsT< noZS >::covariances(), TagProbeFitter::createPdf(), pdg::cTau(), TtFullLepKinSolver::cubic(), EcalSelectiveReadoutValidation::dccZsFIR(), ESDataFormatterV1_1::DigiToRaw(), ESDataFormatterV4::DigiToRaw(), npstat::HistoND< Numeric, Axis >::dispatch(), FWGUISubviewArea::dock(), TagProbeFitter::doCntEfficiency(), TagProbeFitter::doFitEfficiency(), edm::PreMixingModule::doPileUp(), MultiTrackValidatorGenPs::dqmAnalyze(), HGCalValidator::dqmAnalyze(), MultiTrackValidator::dqmAnalyze(), DTRecHitClients::dqmEndJob(), FWFramedTextTableCellRenderer::draw(), FWTextTableCellRenderer::draw(), FWColorRow::DrawHighlight(), EcalDccWeightBuilder::encodeWeight(), l1t::EndCapParamsHelper::EndCapParamsHelper(), edm::PreMixingModule::endRun(), AbsPlan1RechitCombiner::energyWeightedAverage(), AdaptiveVertexReconstructor::erase(), edmtest::ESTestDataB::ESTestDataB(), ESRecHitAnalyticAlgo::EvalAmplitude(), ESRecHitSimAlgo::evalAmplitude(), EcalTBEventHeader::eventType(), HFShowerLibrary::extrapolate(), TrackIPHistograms< T >::fill(), CSCMonitorObject::Fill(), FlavourHistograms< T >::fill(), FlavourHistograms2D< T, G >::fill(), npstat::HistoND< Numeric, Axis >::fill(), dqm::impl::MonitorElement::Fill(), EcalSelectiveReadoutValidation::fill(), QcdUeDQM::fill1D(), QcdLowPtDQM::fill1D(), QcdUeDQM::fill2D(), QcdLowPtDQM::fill2D(), QcdLowPtDQM::fill3D(), npstat::HistoND< Numeric, Axis >::fillC(), EvtPlaneProducer::fillCastor(), EvtPlaneProducer::fillHF(), tadqm::TrackAnalyzer::fillHistosForState(), JetMETHLTOfflineSource::fillMEforMonTriggerSummary(), npstat::HistoND< Numeric, Axis >::fillPreservingCentroid(), QcdUeDQM::fillProfile(), EvtPlaneProducer::fillTracker(), QcdUeDQM::fillUE_with_ChargedJets(), QcdUeDQM::fillUE_with_MaxpTtrack(), TrackIPHistograms< T >::fillVariable(), FlavourHistograms< T >::fillVariable(), FlavourHistograms2D< T, G >::fillVariable(), edm::fillWorkerSummaryAux(), CSCDigiValidator::filter(), CSCHitFromStripOnly::findHitOnStripPosition(), FFTJetPFPileupCleaner::findSomeVertexWFakes(), hgcalsimclustertime::ComputeClusterTime::fixSizeHighestDensity(), FKDPoint< TYPE, numberOfDimensions >::FKDPoint(), L1GTDigiToRaw::flipPtQ(), calo::multifit::fnnls(), FsmwClusterizer1DNameSpace::fsmw(), FWFFHelper::FWFFHelper(), FWTGLViewer::GenerateFbo(), hi::GenPlane::getAngle(), MultiTrackSelector::getBestVertex(), FWTabularWidget::GetDefaultSize(), ECFAdder::getECF(), HFShower::getHits(), npstat::UniformAxis::getInterval(), npstat::GridAxis::getInterval(), popcon::EcalTPGWeightIdMapHandler::getNewObjects(), FastLineRecognition::getOneLine(), FastLineRecognition::getPatterns(), HcalSiPMnonlinearity::getPixelsFired(), NjettinessAdder::getTau(), FWGUISubviewArea::getToolBarFromWindow(), l1t::GlobalParamsHelper::GlobalParamsHelper(), GlobalTrackerMuonAlignment::gradientGlobal(), graph_tree_output(), TtGenEvent::hadronicDecayQuark(), CmsAnnotation::Handle(), FWGUIEventFilter::HandleKey(), FWTableWidget::handleResize(), CSCAFEBConnectAnalysis::hf1ForId(), CSCAFEBThrAnalysis::hf1ForId(), CSCAFEBConnectAnalysis::hf2ForId(), CSCAFEBThrAnalysis::hf2ForId(), FWEveViewManager::highlightAdded(), TtFullHadHypothesis::hypo(), popcon::EcalSRPHandler::importDccConfigFile(), EcalSRCondTools::importParameterSet(), InduceChargeFP420::InduceChargeFP420(), l1t::ClusterShapes::Init(), edm::StreamSchedule::initializeEarlyDelete(), edm::PreMixingModule::initializeEvent(), VirtualJetProducer::inputTowers(), HFShowerLibrary::interpolate(), npstat::ArrayND< Num1, Len1, Dim1 >::interpolate1(), CSCLayerGeometry::intersectionOfStripAndWire(), heppy::IsolationComputer::isoSumNeutralsWeighted(), GenericMinL3Algorithm::iterate(), CSCLayerGeometry::lengthOfWireGroup(), npstat::UniformAxis::linearInterval(), npstat::GridAxis::linearInterval(), CSCLayerGeometry::localCenterOfWireGroup(), EcalClusterToolsT< noZS >::localCovariances(), HFClusterAlgo::makeCluster(), FWTGLViewer::MakeFboScale(), MuScleFitUtils::massProb(), FWHistSliceSelector::matchCell(), CSCDigiMatcher::matchWiresToSimTrack(), FWTableWidget::MoveResize(), RPCNoisyStripTest::myBooker(), RPCClusterSizeTest::myBooker(), RPCOccupancyTest::myBooker(), RPCChamberQuality::myBooker(), TracksClusteringFromDisplacedSeed::nearTracks(), CSCRecoConditions::noiseMatrix(), ESRecHitSimAlgo::oldEvalAmplitude(), GhostTrackComputer::operator()(), PropagationDirectionChooser::operator()(), CombinedSVComputer::operator()(), npstat::LinInterpolatedTableND< Numeric, Axis >::operator()(), output(), L1GTDigiToRaw::packGMT(), InnerDeltaPhi::phiRange(), edm::PreMixingModule::pileWorker(), FWColorPopup::PlacePopup(), PlotCombiner(), DD4hep_TrackingMaterialPlotter::plotSegmentInLayer(), TrackingMaterialPlotter::plotSegmentInLayer(), DD4hep_TrackingMaterialPlotter::plotSegmentUnassigned(), TrackingMaterialPlotter::plotSegmentUnassigned(), l1t::PrescalesVetosFractHelper::PrescalesVetosFractHelper(), l1t::PrescalesVetosHelper::PrescalesVetosHelper(), GctDigiToRaw::print(), VFATFrame::Print(), DTConfigBti::print(), sistrip::printHex(), Phase2Tracker::printHex(), pps::RawDataUnpacker::processOptoRxFrameSerial(), pps::RawDataUnpacker::processVFATDataParallel(), TOFPIDProducer::produce(), GEMDigiToRawModule::produce(), CTPPSProtonProducer::produce(), PrimaryVertexProducer::produce(), TemplatedInclusiveVertexFinder< InputContainer, VTX >::produce(), TemplatedSecondaryVertexProducer< IPTI, VTX >::produce(), JetFlavourClustering::produce(), CTPPSProtonReconstructionSimulationValidator::PlotGroup::profileToRMSGraph(), LA_Filler_Fitter::pull(), edm::PreMixingModule::put(), PrimaryVertexMonitor::pvTracksPlots(), TtFullLepKinSolver::quartic(), emtf::Forest::rankVariables(), RPCPackingModule::rawData(), StoreESCondition::readESTimeSampleWeightsFromFile(), popcon::EcalTPGWeightIdMapHandler::readtxtFile(), popcon::EcalTPGWeightIdMapHandler::readxmlFile(), DQMNet::releaseFromWait(), edm::maker::ModuleHolderT< T >::replaceModuleFor(), FWTableWidget::Resize(), ParabolaFit::result(), SiG4UniversalFluctuation::SampleFluctuations(), LandauFP420::SampleFluctuations(), TagProbeFitter::saveDistributionsPlot(), TagProbeFitter::saveFitPlot(), EcalClusterToolsT< noZS >::scLocalCovariances(), MuonHitsChamberResidual::segment_fit(), GFHistManager::SetCanvasWidth(), helper::MuonCollectionStoreManager::setCloneClusters(), helper::TrackCollectionStoreManager::setCloneClusters(), LMFLaserConfigDat::setData(), DTConfigBti::setDefaults(), TagProbeFitter::setInitialValues(), FWMuonBuilder::setLineWidth(), PHcalTB06Info::setVtxPrim(), PHcalTB04Info::setVtxPrim(), LMFLaserConfigDat::setWavelength(), AdaptiveVertexFitter::setWeightThreshold(), RPCSimParam::simulate(), DDErrorDetection::so(), DAClusterizerInZ::split(), DAClusterizerInZ_vect::split(), TFileAdaptor::statsXML(), CSCRecoConditions::stripWeight(), FWGUIManager::subviewDestroyAll(), dtCalibration::DTT0FEBPathCorrection::t0FEBPathCorrection(), TestPythiaDecays::TestPythiaDecays(), TrackVertexArbitration< VTX >::trackVertexArbitrator(), DDDWorldObserver< Event >::update(), DAClusterizerInZ::update(), DAClusterizerInZ_vect::update(), DAClusterizerInZT_vect::update(), DAClusterizerInZ_vect::updateTc(), svhelper::updateVertexTime(), MultiVertexFitter::updateWeights(), TagProbeFitter::varFixer(), TagProbeFitter::varRestorer(), TagProbeFitter::varSaver(), MultiVertexFitter::vertices(), CSCDCCUnpacker::visual_raw(), G4SimEvent::weight(), muonisolation::IsolatorByNominalEfficiency::weightedSum(), muonisolation::IsolatorByDeposit::weightedSum(), PosteriorWeightsCalculator::weights(), RPCCompDetId::wheel(), FWCollectionSummaryModelCellRenderer::width(), FWTextTreeCellRenderer::width(), CSCDigiMatcher::wiregroupsInChamber(), edm::WorkerInPath::WorkerInPath(), FEConfigFgrParamDat::writeArrayDB(), MonLaserPulseDat::writeArrayDB(), FEConfigLinDat::writeArrayDB(), MonLaserRedDat::writeArrayDB(), MonLaserIRedDat::writeArrayDB(), FEConfigParamDat::writeArrayDB(), MonLaserBlueDat::writeArrayDB(), MonPNPedDat::writeArrayDB(), MonLed2Dat::writeArrayDB(), MonLaserGreenDat::writeArrayDB(), MonLed1Dat::writeArrayDB(), MonMemChConsistencyDat::writeArrayDB(), MonCrystalConsistencyDat::writeArrayDB(), MonPedestalsDat::writeArrayDB(), MonMemTTConsistencyDat::writeArrayDB(), MonTTConsistencyDat::writeArrayDB(), MonTestPulseDat::writeArrayDB(), MonPNGreenDat::writeArrayDB(), MonPNRedDat::writeArrayDB(), MonPNLed2Dat::writeArrayDB(), MonPNIRedDat::writeArrayDB(), MonPNMGPADat::writeArrayDB(), MonPNLed1Dat::writeArrayDB(), MonPNBlueDat::writeArrayDB(), DCULVRVoltagesDat::writeArrayDB(), EcalDccWeightBuilder::writeWeightToDB(), and OverlapValidation::~OverlapValidation().

detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
IsotropicR3
void IsotropicR3(double r, double *x, double *y, double *z)
Definition: UKUtility.cc:26
pos
Definition: PixelAliasList.h:18
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
PVValHelper::phi
Definition: PVValidationHelpers.h:68
hjRandomEngine
CLHEP::HepRandomEngine * hjRandomEngine
Definition: Hydjet2Hadronizer.h:55
alignCSCRings.r
r
Definition: alignCSCRings.py:93
genVertex_cff.x
x
Definition: genVertex_cff.py:12
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
Pi
const double Pi
Definition: CosmicMuonParameters.h:18