The class is a Source whose run is chosen randomly. This initializes identically to a cms.Source
and after being initialized the run number distribution is set by calling 'setRunDistribution'.
Definition at line 4 of file RandomRunSource.py.
def RandomRunSource.RandomRunSource.insertInto |
( |
|
self, |
|
|
|
parameterSet, |
|
|
|
myname |
|
) |
| |
Definition at line 15 of file RandomRunSource.py.
References print(), MuonTypeByOrCut.type_, L1TMuonOverlapParams::Node.type_, edm::ObjectWithDict.type_, Histogram_TICLPFValidation.type_, FWJobMetadataManager::Data.type_, L1TTwinMuxParams::Node.type_, L1TMuonGlobalParams::Node.type_, L1TMuonGlobalParams_PUBLIC::Node.type_, CutBasedElectronID.type_, HcalSiPMParameter.type_, StringObjectFunction< T, DefaultLazyness >.type_, StringCutObjectSelector< pat::Tau >.type_, StringObjectFunction< TInputCandidateType >.type_, StringCutObjectSelector< reco::GenParticle >.type_, StringCutObjectSelector< reco::PFCandidate >.type_, StringCutObjectSelector< pat::TriggerObjectStandAlone >.type_, StringCutObjectSelector< T1, true >.type_, StringCutObjectSelector< pat::Muon, false >.type_, StringCutObjectSelector< T, Lazy >.type_, StringCutObjectSelector< reco::Jet, true >.type_, StringObjectFunction< PFTau >.type_, StringCutObjectSelector< reco::RecoTauPiZero >.type_, StringCutObjectSelector< reco::Track >.type_, StringCutObjectSelector< reco::PFRecoTauChargedHadron >.type_, StringObjectFunction< reco::PFRecoTauChargedHadron >.type_, StringCutObjectSelector< reco::GenMET >.type_, StringCutObjectSelector< typename Classifier::Categories >.type_, StringCutObjectSelector< reco::CaloMET, true >.type_, StringObjectFunction< std::vector< TOutputCandidateType > >.type_, StringCutObjectSelector< pat::Muon >.type_, StringCutObjectSelector< reco::MET, true >.type_, L1TMuonBarrelParams::Node.type_, StringCutObjectSelector< reco::Muon >.type_, StringCutObjectSelector< T >.type_, StringCutObjectSelector< pat::DiObjectProxy >.type_, StringCutObjectSelector< Object >.type_, StringCutObjectSelector< reco::Muon, false >.type_, StringCutObjectSelector< edm::Ref, false >.type_, StringCutObjectSelector< reco::MET >.type_, StringCutObjectSelector< reco::Photon >.type_, StringCutObjectSelector< INP_TYPE, true >.type_, StringCutObjectSelector< typename T::value_t >.type_, StringCutObjectSelector< PFTau >.type_, StringCutObjectSelector< pat::IsolatedTrack >.type_, StringCutObjectSelector< reco::utils::ClusterTotals >.type_, StringCutObjectSelector< pat::Electron >.type_, StringCutObjectSelector< reco::Vertex >.type_, StringCutObjectSelector< reco::Candidate >.type_, StringCutObjectSelector< trigger::TriggerObject >.type_, StringCutObjectSelector< pat::Photon >.type_, StringCutObjectSelector< reco::GsfElectron, true >.type_, StringCutObjectSelector< reco::PFJet, true >.type_, StringCutObjectSelector< T, DefaultLazyness >.type_, StringCutObjectSelector< reco::PFTau >.type_, StringCutObjectSelector< MuonPointerPair, true >.type_, StringCutObjectSelector< TInputCandidateType >.type_, StringCutObjectSelector< reco::CaloJet >.type_, StringCutObjectSelector< pat::PackedCandidate >.type_, StringCutObjectSelector< T, true >.type_, StringCutObjectSelector< reco::GsfElectron >.type_, StringCutObjectSelector< reco::Muon, true >.type_, StringCutObjectSelector< reco::CaloMET >.type_, StringCutObjectSelector< reco::Photon, true >.type_, StringCutObjectSelector< l1t::HGCalMulticluster >.type_, StringCutObjectSelector< reco::Candidate, true >.type_, StringCutObjectSelector< pat::DiObjectProxy, true >.type_, StringCutObjectSelector< reco::TrackRef, false >.type_, StringCutObjectSelector< reco::PFMET, true >.type_, StringCutObjectSelector< reco::Track, true >.type_, StringCutObjectSelector< reco::PFJet >.type_, StringCutObjectSelector< reco::CaloMuon, false >.type_, StringCutObjectSelector< reco::CaloJet, true >.type_, StringObjectFunction< reco::Jet >.type_, StringObjectFunction< pat::TriggerObjectStandAlone >.type_, StringObjectFunction< reco::RecoTauPiZero >.type_, StringObjectFunction< ObjType >.type_, StringObjectFunction< T >.type_, StringObjectFunction< Object >.type_, StringObjectFunction< reco::Photon >.type_, StringCutObjectSelector< Jet >.type_, StringObjectFunction< reco::Candidate >.type_, StringObjectFunction< reco::PFTau >.type_, StringObjectFunction< reco::GsfElectron >.type_, StringObjectFunction< T, true >.type_, StringCutObjectSelector< T2, true >.type_, StringObjectFunction< l1t::HGCalMulticluster >.type_, StringObjectFunction< reco::Candidate, true >.type_, vector< TOutputCandidateType >.type_, StringCutObjectSelector< ObjType, true >.type_, OpticalAlignMeasurementInfo.type_, StringCutObjectSelector< reco::LeafCandidate >.type_, StringCutObjectSelector< PATPrimitive >.type_, StringCutObjectSelector< reco::Jet >.type_, StringCutObjectSelector< GenParticle >.type_, StringObjectFunction< Object > ss.type_, StringCutObjectSelector< Object > ss.type_, StringObjectFunction< Object > expr.type_, StringObjectFunction< RecoTauPiZero >.type_, StringCutObjectSelector< PFRecoTauChargedHadron >.type_, StringObjectFunction< PFRecoTauChargedHadron >.type_, StringCutObjectSelector< RecoTauPiZero >.type_, StringCutObjectSelector< reco::Candidate::LorentzVector, true >.type_, StringCutObjectSelector< reco::Track, false >.type_, StringCutObjectSelector< reco::Vertex, true >.type_, StringCutObjectSelector< pat::Jet >.type_, StringCutObjectSelector< pat::PackedCandidate, false >.type_, StringCutObjectSelector< reco::PFTauTransverseImpactParameter >.type_, StringCutObjectSelector< reco::JetID >.type_, StringCutObjectSelector< reco::PFMET >.type_, StringCutObjectSelector< reco::GenJet >.type_, StringCutObjectSelector< std::vector< TOutputCandidateType > >.type_, StringCutObjectSelector< reco::CompositeCandidate, true >.type_, StringCutObjectSelector< reco::Candidate::LorentzVector >.type_, StringCutObjectSelector< T2 >.type_, l1t::CaloParams::Node.type_, ProcessCallGraph::NodeType.type_, L1TMuonBarrelKalmanParams::Node.type_, edm::eventsetup::ComponentDescription.type_, l1t::CaloSpare.type_, reco::MuonMETCorrectionData.type_, omtf::RpcDataWord64.type_, omtf::RpcDataWord64::.type_, cond::hdf5::DataProduct.type_, HcalSiPMParametersGPU.type_, edm::ESParentContext.type_, MuonIDFilterProducerForHLT.type_, MuonRefProducer.type_, cms::cuda::host::impl::HostDeleter.type_, HcalSiPMCharacteristics::PrecisionItem.type_, reco::DeDxHitInfo::DeDxHitInfoContainer.type_, reco::TrackingRecHitInfo.type_, pftools::ParticleFiltrationDecision.type_, omtf::MuonDataWord64::.type_, EcalDumpGeometry.type_, omtf::MuonDataWord64.type_, PGeometricTimingDet::Item.type_, pat::TriggerFilter.type_, pos::PixelTKFECParameters.type_, TauDQMHistPlotter::cfgEntryProcess.type_, trklet::L1SimTrack.type_, EleEnergyRetriever.type_, NoProductErrorThrower.type_, pat::TriggerCondition.type_, MultShiftMETcorrInputProducer.type_, edm::ParentContext.type_, edm::ConsumesInfo.type_, omtf::DtDataWord64::.type_, omtf::DtDataWord64.type_, l1t::TkEtMiss.type_, DQMHcalIsoTrackAlCaReco.type_, DBReader.type_, omtf::CscDataWord64.type_, omtf::CscDataWord64::.type_, edm::ParameterWildcardBase.type_, edm::AllowedLabelsDescriptionBase.type_, edm::eventsetup::EventSetupRecordKey.type_, L1TUtmCondition.type_, NoBranchErrorThrower.type_, l1t::BlockHeader.type_, l1extra::L1EmParticle.type_, reco::PUSubMETCandInfo.type_, l1extra::L1JetParticle.type_, edm::InputSource::ItemTypeInfo.type_, fwlite::internal::DataKey.type_, edm::eventsetup::DataKey.type_, l1t::EtSum.type_, PPSFastLocalSimulation::Distribution.type_, HDF5ProductResolver.type_, jsoncollector::Json::Reader::Token.type_, OpticalAlignInfo.type_, L1TUtmScale.type_, pat::JetCorrFactorsProducer.type_, ProductBranch.type_, Entry.type_, pos::PixelPortCardConfig.type_, edm::ParameterDescriptionBase.type_, l1extra::L1EtMissParticle.type_, pat::helper::AnyNumberAssociationAdaptor.type_, edm::Handle< GenericObject >.type_, edm::Handle< FWGenericObject >.type_, edm::PileUp.type_, L1GctInternHFData.type_, BeamSpotObjects.type_, L1TUtmObject.type_, tt::SensorModule.type_, edm::test::TestProcessorConfig::ProduceEntry.type_, L1GctInternEtSum.type_, reco::PFBlockElement.type_, L1GctInternHtMiss.type_, L1GctInternJetData.type_, l1t::MuonStub.type_, TrackerGeometryCompare.type_, reco::BeamSpot.type_, ScoutingMuon.type_, funct::RootIntegrator.type_, GeometricTimingDet.type_, SiStripConfigDb::Run.type_, GeometricDet.type_, edm::Entry.type_, TrackerDpgAnalysis.type_, ConfigurableHisto.type_, Run3ScoutingMuon.type_, CandMCMatchTableProducer.type_, CSCCorrelatedLCTDigi.type_, reco::Muon.type_, Mixins._TypedParameterizable.type_(), jsoncollector::Json::Value.type_, edm::IndexIntoFile::IndexIntoFileItrImpl.type_, Config.SubProcess.type_(), and Config.ProcessAccelerator.type_().
15 def insertInto(self, parameterSet, myname):
16 from random
import SystemRandom
18 for r,p
in self.__dict__[
'runsAndProbs']:
21 random = SystemRandom()
22 runProb = random.uniform(0,totalProb)
26 for r,p
in self.__dict__[
'runsAndProbs']:
28 if sumProb >= runProb:
31 if self.type_() ==
"PoolSource":
32 self.setRunNumber = cms.untracked.uint32(runNumber)
35 self.firstRun = cms.untracked.uint32(runNumber)
36 super(RandomRunSource,self).insertInto(parameterSet,myname)
37 void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
◆ setRunDistribution()
def RandomRunSource.RandomRunSource.setRunDistribution |
( |
|
self, |
|
|
|
runsAndProbs |
|
) |
| |
Pass a list of tuple pairs, with the first item of the pair a run number
and the second number of the pair a weight. The class will normalize the
weights so you do not have to. The pairs will be used to randomly choose what Run
should be assigned to the job.
Definition at line 8 of file RandomRunSource.py.
8 def setRunDistribution(self,runsAndProbs):
9 """Pass a list of tuple pairs, with the first item of the pair a run number 10 and the second number of the pair a weight. The class will normalize the 11 weights so you do not have to. The pairs will be used to randomly choose what Run 12 should be assigned to the job. 14 self.__dict__[
'runsAndProbs']=runsAndProbs
◆ firstRun
RandomRunSource.RandomRunSource.firstRun |
◆ setRunNumber
RandomRunSource.RandomRunSource.setRunNumber |