test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
mps_alisetup Namespace Reference

Functions

def get_weight_configs
 

Variables

 aligmentConfig = args.alignmentConfig
 
tuple args = parser.parse_args()
 
tuple config = ConfigParser.ConfigParser()
 
tuple configTemplate = config.get('general','configTemplate')
 
tuple currentDir = os.getcwd()
 
string eos = '/afs/cern.ch/project/eos/installation/cms/bin/eos.select'
 
dictionary generalOptions = {}
 
tuple globalTag = config.get('general','globaltag')
 
string help = 'display detailed output of mps_setup'
 
string helpEpilog
 
tuple match = re.search(re.compile('mpproduction\/mp(.+?)$', re.M|re.I),currentDir)
 
tuple milleScript = os.path.join(mpsScriptsDir, "mps_runMille_template.sh")
 
string mpsdirname = ''
 
tuple mpsScriptsDir = os.path.join("src", "Alignment", "MillePedeAlignmentAlgorithm", "scripts")
 
string mssDir = '/store/caf/user/'
 
tuple parser
 
tuple pedeScript = os.path.join(mpsScriptsDir, "mps_runPede_rfcp_template.sh")
 
tuple pedesettings
 
tuple tmpFile = f.read()
 
tuple weight_confs = get_weight_configs(config)
 

Function Documentation

def mps_alisetup.get_weight_configs (   config)
Extracts different weight configurations from `config`.

Arguments:
- `config`: ConfigParser object containing the alignment configuration

Definition at line 24 of file mps_alisetup.py.

References split.

24 
25 def get_weight_configs(config):
26  """Extracts different weight configurations from `config`.
27 
28  Arguments:
29  - `config`: ConfigParser object containing the alignment configuration
30  """
31 
32  weight_dict = collections.OrderedDict()
33  common_weights = {}
34 
35  # loop over datasets to reassign weights
36  for section in config.sections():
37  if 'general' in section:
38  continue
39  elif section == "weights":
40  for option in config.options(section):
41  common_weights[option] = [x.strip() for x in
42  config.get(section, option).split(",")]
43  elif section.startswith("dataset:"):
44  name = section[8:] # get name of dataset by stripping of "dataset:"
45  if config.has_option(section,'weight'):
46  weight_dict[name] = [x.strip() for x in
47  config.get(section, "weight").split(",")]
48  else:
49  weight_dict[name] = ['1.0']
50 
51  weights_list = [[(name, weight) for weight in weight_dict[name]]
52  for name in weight_dict]
53 
54  common_weights_list = [[(name, weight) for weight in common_weights[name]]
55  for name in common_weights]
56  common_weights_dicts = []
57  for item in itertools.product(*common_weights_list):
58  d = {}
59  for name,weight in item:
60  d[name] = weight
61  common_weights_dicts.append(d)
62 
63  configs = []
64  for weight_conf in itertools.product(*weights_list):
65  if len(common_weights) > 0:
66  for common_weight in common_weights_dicts:
67  configs.append([(dataset[0],
68  reduce(lambda x,y: x.replace(y, common_weight[y]),
69  common_weight, dataset[1]))
70  for dataset in weight_conf])
71  else:
72  configs.append(weight_conf)
73 
74  return configs
75 
76 
77 
78 # ------------------------------------------------------------------------------
79 # set up argument parser and config parser
def get_weight_configs
Definition: mps_alisetup.py:24
double split
Definition: MVATrainer.cc:139

Variable Documentation

mps_alisetup.aligmentConfig = args.alignmentConfig

Definition at line 97 of file mps_alisetup.py.

tuple mps_alisetup.args = parser.parse_args()

Definition at line 96 of file mps_alisetup.py.

Referenced by DQMStore::IBooker.book1D(), DQMStore::IBooker.book1DD(), DQMStore::IBooker.book1S(), DQMStore::IBooker.book2D(), DQMStore::IBooker.book2DD(), DQMStore::IBooker.book2S(), DQMStore::IBooker.book3D(), DQMStore::IBooker.bookFloat(), DQMStore::IBooker.bookInt(), DQMStore::IBooker.bookProfile(), DQMStore::IBooker.bookProfile2D(), DQMStore::IBooker.bookString(), Plane.build(), Disk.build(), BasicTrajectoryState.build(), FWTabularWidget.buttonPressed(), FWTabularWidget.buttonReleased(), FWTableWidget.cellClicked(), BasicTrajectoryState.churn(), FWTableWidget.columnClicked(), NavigationSchool.compatibleLayers(), DTLinearDriftFromDBAlgo.compute(), edmplugin::PluginFactory< R *(Args...)>::PMaker< TPlug >.create(), edmplugin::PluginFactory< R *(Args...)>.create(), DQMGenericClient.DQMGenericClient(), DQMRivetClient.DQMRivetClient(), edm::signalslot::Signal< void(StreamID)>.emit(), TempTrajectory.emplace(), edm::ProcessHistory.emplace_back(), cmsutils::bqueue< TrajectoryMeasurement >.emplace_back(), reco.findMethod(), gen::BaseHadronizer.generateLHE(), DQMStore::IGetter.getContents(), main(), NavigationSchool.nextLayers(), reco::parser::MethodSetter.operator()(), edm::serviceregistry::BlockingWrapper< Func >.operator()(), edm::signalslot::Signal< void(StreamID)>.operator()(), OptimalHelixPlaneCrossing.OptimalHelixPlaneCrossing(), AnyMVAEstimatorRun2Base.packMVAVariables(), raiseDQMError(), DQMStore::IGetter.removeElement(), FWCollectionSummaryWidget.requestForModelContextMenu(), FWTableWidget.rowClicked(), TagProbeFitTreeAnalyzer.TagProbeFitTreeAnalyzer(), edmplugin::PluginFactory< R *(Args...)>.tryToCreate(), impl::MakeArray< T, N, I >.value(), and impl::MakeArray< T, N, 0 >.value().

tuple mps_alisetup.config = ConfigParser.ConfigParser()

Definition at line 100 of file mps_alisetup.py.

Referenced by DTBtiChip.acceptMask(), EcalBarrelMonitorDbModule.analyze(), DTBtiChip.computeEqs(), DTBtiChip.computeSums(), PhysicsTools::VarProcessor.configure(), TwoBodyDecayTrajectory.construct(), DualBzeroReferenceTrajectory.construct(), DualReferenceTrajectory.construct(), TwoBodyDecayTrajectoryFactory.constructTrajectories(), edm::ServiceRegistry.createContaining(), egPM::Param< reco::ElectronSeed >.createParamBin_(), Mixing2DB.endJob(), edm::EventProcessor.EventProcessor(), DTBtiChip.findTrig(), getHLTConfigData(), edm::Event.getProcessParameterSet(), CSCTFSectorProcessor.initialize(), DTBtiChip.keepTrig(), DTBtiChip.keepTrigPatt(), pos::PixelConfigFile.makeKey(), edm::ProblemTracker.ProblemTracker(), CSCTFConfigProducer.produceL1MuCSCTFConfigurationRcd(), FWConfigurationManager.readFromOldFile(), edm::MixingModule.reload(), edm::PileUp.reload(), edm::MixingWorker< T >.reload(), CmsShowMainBase.reloadConfiguration(), cond::Utilities.run(), FWGenericParameter< T >.setFrom(), PhysicsTools::MVAComputer.setup(), FWConfigurationManager.to(), TrackingMaterialProducer.TrackingMaterialProducer(), BzeroReferenceTrajectoryFactory.trajectories(), DualTrajectoryFactory.trajectories(), DualBzeroTrajectoryFactory.trajectories(), and ReferenceTrajectoryFactory.trajectories().

tuple mps_alisetup.configTemplate = config.get('general','configTemplate')

Definition at line 189 of file mps_alisetup.py.

tuple mps_alisetup.currentDir = os.getcwd()

Definition at line 119 of file mps_alisetup.py.

string mps_alisetup.eos = '/afs/cern.ch/project/eos/installation/cms/bin/eos.select'

Definition at line 133 of file mps_alisetup.py.

dictionary mps_alisetup.generalOptions = {}

Definition at line 140 of file mps_alisetup.py.

tuple mps_alisetup.globalTag = config.get('general','globaltag')

Definition at line 197 of file mps_alisetup.py.

string mps_alisetup.help = 'display detailed output of mps_setup'

Definition at line 88 of file mps_alisetup.py.

Referenced by CmsShowMainFrame.CmsShowMainFrame().

string mps_alisetup.helpEpilog
Initial value:
1 = '''Builds the config-templates from a universal config-template for each
2 dataset specified in .ini-file that is passed to this script.
3 Then calls mps_setup.pl for all datasets.'''

Definition at line 80 of file mps_alisetup.py.

tuple mps_alisetup.match = re.search(re.compile('mpproduction\/mp(.+?)$', re.M|re.I),currentDir)

Definition at line 121 of file mps_alisetup.py.

tuple mps_alisetup.milleScript = os.path.join(mpsScriptsDir, "mps_runMille_template.sh")

Definition at line 115 of file mps_alisetup.py.

string mps_alisetup.mpsdirname = ''

Definition at line 120 of file mps_alisetup.py.

tuple mps_alisetup.mpsScriptsDir = os.path.join("src", "Alignment", "MillePedeAlignmentAlgorithm", "scripts")

Definition at line 110 of file mps_alisetup.py.

string mps_alisetup.mssDir = '/store/caf/user/'

Definition at line 130 of file mps_alisetup.py.

tuple mps_alisetup.parser
Initial value:
2  description='Setup the alignment as configured in the alignment_config file.',
3  epilog=helpEpilog)

Definition at line 83 of file mps_alisetup.py.

Referenced by bookHistograms(), calcSampleName(), reco::modules::CandCombinerBase.CandCombinerBase(), L1GtTriggerMenuXmlParser.cleanupXML(), DQMParserBase.countNodes(), DCCTBBlockPrototype.DCCTBBlockPrototype(), DDTokenize2(), DQMParserBase.DQMParserBase(), FWPartialConfigGUI.FWPartialConfigGUI(), RPAlignmentCorrectionsMethods.GetCorrectionsDataFromFile(), DQMParserBase.getDocument(), TotemDAQMappingESSourceXML.GetDOMDocument(), DQMParserBase.getNewDocument(), XMLDOMBlock.getNewDocument(), FWConfigurationManager.guessAndReadFromFile(), popcon::EcalSRPHandler.importDccConfigFile(), cond::CredentialStore.importForPrincipal(), edm::FileLocator.init(), XMLDOMBlock.init(), L1GtTriggerMenuXmlParser.initXML(), cscdqm::Collection.load(), HcalPatternSource.loadPatternFile(), RPAlignmentCorrectionsDataSequence.LoadXMLFile(), main(), reco::modules::NamedCandCombinerBase.NamedCandCombinerBase(), MuonAlignmentInputXML.newAlignableMuon(), RPCPatternsParser.parse(), edm::service::SiteLocalConfigService.parse(), triggerExpression.parse(), XMLDOMBlock.parse(), DTFakeT0ESProducer.parseDDD(), L1GtTriggerMenuXmlParser.parseXmlFile(), MiscalibReaderFromXML.parseXMLMiscalibFile(), cond::XMLAuthenticationService::XMLAuthenticationService.processFile(), XMLIdealGeometryESSource.produce(), XMLIdealMagneticFieldGeometryESProducer.produce(), HcalTopologyIdealEP.produce(), RPCTriggerConfig.produce(), magneticfield::VolumeBasedMagneticFieldESProducerFromDB.produce(), XMLIdealGeometryESProducer.produce(), FWConfigurationManager.readFromFile(), xuti.readHeader(), EcalTimeBiasCorrectionsXMLTranslator.readXML(), EcalTPGStripStatusXMLTranslator.readXML(), EcalTPGTowerStatusXMLTranslator.readXML(), EcalDCSTowerStatusXMLTranslator.readXML(), EcalPulseSymmCovariancesXMLTranslator.readXML(), EcalChannelStatusXMLTranslator.readXML(), EcalClusterCrackCorrXMLTranslator.readXML(), EcalPedestalsXMLTranslator.readXML(), EcalPulseShapesXMLTranslator.readXML(), EcalGainRatiosXMLTranslator.readXML(), EcalClusterEnergyCorrectionXMLTranslator.readXML(), EcalClusterLocalContCorrXMLTranslator.readXML(), EcalADCToGeVXMLTranslator.readXML(), EcalTimeOffsetXMLTranslator.readXML(), EcalClusterEnergyCorrectionObjectSpecificXMLTranslator.readXML(), EcalDAQTowerStatusXMLTranslator.readXML(), EcalWeightGroupXMLTranslator.readXML(), EcalFloatCondObjectContainerXMLTranslator.readXML(), EcalTBWeightsXMLTranslator.readXML(), EcalWeightSetXMLTranslator.readXML(), EcalLinearCorrectionsXMLTranslator.readXML(), EcalLaserAPDPNRatiosXMLTranslator.readXML(), RPCPacData.RPCPacData(), cond.schemaLabelForCredentialStore(), LumiCorrectionSource.servletTranslation(), LumiProducer.servletTranslation(), FWPartialConfigSaveGUI.WriteConfig(), XMLDOMBlock.XMLDOMBlock(), DQMParserBase.~DQMParserBase(), and XMLDOMBlock.~XMLDOMBlock().

tuple mps_alisetup.pedeScript = os.path.join(mpsScriptsDir, "mps_runPede_rfcp_template.sh")

Definition at line 116 of file mps_alisetup.py.

tuple mps_alisetup.pedesettings
Initial value:
1 = ([x.strip() for x in config.get("general", "pedesettings").split(",")]
2  if config.has_option("general", "pedesettings") else [None])
double split
Definition: MVATrainer.cc:139

Definition at line 169 of file mps_alisetup.py.

tuple mps_alisetup.tmpFile = f.read()

Definition at line 205 of file mps_alisetup.py.

tuple mps_alisetup.weight_confs = get_weight_configs(config)

Definition at line 172 of file mps_alisetup.py.