CMS 3D CMS Logo

Functions | Variables

create_public_pileup_plots Namespace Reference

Functions

def TweakPlot

Variables

tuple arg_parser = optparse.OptionParser(description=desc_str)
tuple ax = fig.add_subplot(111)
list bin_edges
tuple cache_file_dir = cfg_parser.get("general", "cache_dir")
dictionary cfg_defaults
tuple cfg_parser = ConfigParser.SafeConfigParser(cfg_defaults)
string cmd = "pileupCalc.py -i %s --inputLumiJSON=%s %s %s"
tuple cms_energy_str = cfg_parser.get("general", "cms_energy_str")
 color_fill_pileup = color_scheme.color_fill_pileup
 color_line_pileup = color_scheme.color_line_pileup
tuple color_scheme = ColorScheme(color_scheme_name)
list color_scheme_names = [i.strip() for i in color_scheme_names_tmp.split(",")]
tuple color_scheme_names_tmp = cfg_parser.get("general", "color_schemes")
list config_file_name = args[0]
string desc_str = "This script creates the official CMS pileup plots "
 edgecolor = color_line_pileup,
tuple exp = RoundAwayFromZero(math.log10(min_val))
 facecolor = color_fill_pileup)
tuple fig = plt.figure()
 file_suffix = color_scheme.file_suffix
 fontproperties = FONT_PROPS_SUPTITLE)
string help = "Ignore all cached PU results "
string histtype = "stepfilled"
string horizontalalignment = "right"
 ignore_cache = options.ignore_cache
tuple in_file = TFile.Open(tmp_file_name, "READ")
tuple input_json = cfg_parser.get("general", "input_json")
tuple input_lumi_json = cfg_parser.get("general", "input_lumi_json")
tuple is_log = (type == "log")
 log_setting = False
string log_suffix = ""
 logo_name = color_scheme.logo_name
tuple min_val = min(weights)
tuple particle_type_str = cfg_parser.get("general", "particle_type_str")
tuple pileup_hist = in_file.Get("pileup")
tuple pileupcalc_flags_from_cfg = cfg_parser.get("general", "pileupcalc_flags")
tuple tmp_file_name = os.path.join(cache_file_dir,"pileup_calc_tmp.root")
 transform = ax.transAxes,
list vals
tuple verbose = cfg_parser.getboolean("general", "verbose")
list weights
tuple year = int(cfg_parser.get("general", "year"))

Function Documentation

def create_public_pileup_plots::TweakPlot (   fig,
  ax,
  add_extra_head_room = False 
)

Definition at line 61 of file create_public_pileup_plots.py.

00062                                                  :
00063 
00064     # Fiddle with axes ranges etc.
00065     ax.relim()
00066     ax.autoscale_view(False, True, True)
00067     for label in ax.get_xticklabels():
00068         label.set_ha("right")
00069         label.set_rotation(30.)
00070 
00071     # Bit of magic here: increase vertical scale by one tick to make
00072     # room for the legend.
00073     if add_extra_head_room:
00074         y_ticks = ax.get_yticks()
00075         (y_min, y_max) = ax.get_ylim()
00076         is_log = (ax.get_yscale() == "log")
00077         y_max_new = y_max
00078         if is_log:
00079             tmp = y_ticks[-1] / y_ticks[-2]
00080             y_max_new = y_max * math.pow(tmp, add_extra_head_room)
00081         else:
00082             tmp = y_ticks[-1] - y_ticks[-2]
00083             y_max_new = y_max + add_extra_head_room * tmp
00084         ax.set_ylim(y_min, y_max_new)
00085 
00086     # Add a second vertical axis on the right-hand side.
00087     ax_sec = ax.twinx()
00088     ax_sec.set_ylim(ax.get_ylim())
00089     ax_sec.set_yscale(ax.get_yscale())
00090 
00091     for ax_tmp in fig.axes:
00092         for sub_ax in [ax_tmp.xaxis, ax_tmp.yaxis]:
00093             for label in sub_ax.get_ticklabels():
00094                 label.set_font_properties(FONT_PROPS_TICK_LABEL)
00095 
00096     if is_log:
00097         fig.subplots_adjust(top=.89, bottom=.125, left=.11, right=.925)
00098     else:
00099         fig.subplots_adjust(top=.89, bottom=.125, left=.1, right=.925)
00100 
00101     # End of TweakPlot().


Variable Documentation

tuple create_public_pileup_plots::arg_parser = optparse.OptionParser(description=desc_str)

Definition at line 108 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::ax = fig.add_subplot(111)

Definition at line 232 of file create_public_pileup_plots.py.

Initial value:
00001 [pileup_hist.GetBinLowEdge(i) \
00002                  for i in xrange(1, pileup_hist.GetNbinsX() + 1)]

Definition at line 201 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::cache_file_dir = cfg_parser.get("general", "cache_dir")

Definition at line 134 of file create_public_pileup_plots.py.

Initial value:
00001 {
00002         "pileupcalc_flags" : "",
00003         "color_schemes" : "Joe, Greg",
00004         "verbose" : False
00005         }

Definition at line 121 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::cfg_parser = ConfigParser.SafeConfigParser(cfg_defaults)

Definition at line 126 of file create_public_pileup_plots.py.

string create_public_pileup_plots::cmd = "pileupCalc.py -i %s --inputLumiJSON=%s %s %s"

Definition at line 171 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::cms_energy_str = cfg_parser.get("general", "cms_energy_str")

Definition at line 150 of file create_public_pileup_plots.py.

create_public_pileup_plots::color_fill_pileup = color_scheme.color_fill_pileup

Definition at line 217 of file create_public_pileup_plots.py.

create_public_pileup_plots::color_line_pileup = color_scheme.color_line_pileup

Definition at line 216 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::color_scheme = ColorScheme(color_scheme_name)

Definition at line 215 of file create_public_pileup_plots.py.

list create_public_pileup_plots::color_scheme_names = [i.strip() for i in color_scheme_names_tmp.split(",")]

Definition at line 138 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::color_scheme_names_tmp = cfg_parser.get("general", "color_schemes")

Definition at line 137 of file create_public_pileup_plots.py.

Definition at line 118 of file create_public_pileup_plots.py.

string create_public_pileup_plots::desc_str = "This script creates the official CMS pileup plots "

Definition at line 106 of file create_public_pileup_plots.py.

Definition at line 236 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::exp = RoundAwayFromZero(math.log10(min_val))

Definition at line 228 of file create_public_pileup_plots.py.

Definition at line 237 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::fig = plt.figure()

Definition at line 221 of file create_public_pileup_plots.py.

create_public_pileup_plots::file_suffix = color_scheme.file_suffix

Definition at line 219 of file create_public_pileup_plots.py.

Definition at line 243 of file create_public_pileup_plots.py.

string create_public_pileup_plots::help = "Ignore all cached PU results "

Definition at line 110 of file create_public_pileup_plots.py.

string create_public_pileup_plots::histtype = "stepfilled"

Definition at line 235 of file create_public_pileup_plots.py.

Definition at line 255 of file create_public_pileup_plots.py.

Definition at line 119 of file create_public_pileup_plots.py.

Definition at line 185 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::input_json = cfg_parser.get("general", "input_json")

Definition at line 144 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::input_lumi_json = cfg_parser.get("general", "input_lumi_json")

Definition at line 145 of file create_public_pileup_plots.py.

Definition at line 224 of file create_public_pileup_plots.py.

Definition at line 225 of file create_public_pileup_plots.py.

Definition at line 262 of file create_public_pileup_plots.py.

create_public_pileup_plots::logo_name = color_scheme.logo_name

Definition at line 218 of file create_public_pileup_plots.py.

Definition at line 227 of file create_public_pileup_plots.py.

Definition at line 148 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::pileup_hist = in_file.Get("pileup")

Definition at line 190 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::pileupcalc_flags_from_cfg = cfg_parser.get("general", "pileupcalc_flags")

Definition at line 143 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::tmp_file_name = os.path.join(cache_file_dir,"pileup_calc_tmp.root")

Definition at line 169 of file create_public_pileup_plots.py.

Definition at line 254 of file create_public_pileup_plots.py.

Referenced by AlignableBeamSpot::alignments(), AlignableDet::alignments(), AlignableDetUnit::alignments(), AlphaT::AlphaT(), EcalBarrelMonitorClient::analyze(), SiStripRecHitsValid::analyze(), EcalEndcapMonitorClient::analyze(), edm::ContainerMask< T >::applyOrTo(), edm::ScheduleInfo::availableModuleLabels(), edm::Schedule::availablePaths(), reco::helper::JetIDHelper::classifyJetComponents(), reco::helper::JetIDHelper::classifyJetTowers(), edmNew::copyDetSetRange(), ConstrainedTreeBuilder::covarianceMatrix(), ConstrainedTreeBuilderT::covarianceMatrix(), FastCircle::createCircleParameters(), SiStripLorentzAngleGenerator::createObject(), align::createPoints(), evf::iDie::defaultWeb(), FWDetailViewManager::detailViewsFor(), RecoTauMVATransform::discriminate(), evf::iDie::dumpTable(), FWDetailViewManager::findViewersFor(), FWEveViewManager::FWEveViewManager(), EcalFedMap::getFedFromSlice(), edm::DetSetVector< T >::getIds(), CSCStripElectronicsSim::getKeyStripsFromMC(), reco::TaggingVariableList::getList(), edm::ParameterSet::getParameterNames(), edm::ParameterSet::getParameterSetNames(), TValidTrackingRecHit::globalState(), pat::JetCorrFactors::jecFlavor(), ora::MappingRules::nameForSchema(), reco::tau::RecoTauDiscriminantInvariantWidth::operator()(), ThirdHitRZPrediction< Propagator >::operator()(), CSCStripData::operator*=(), GaussianSumUtilities1D::pdfComponents(), evf::iDie::postEntry(), SiStripProcessedRawDigiProducer::pr_process(), pat::MatcherByPulls< T >::produce(), EcalTrivialConditionRetriever::produceEcalAlignmentEB(), EcalTrivialConditionRetriever::produceEcalAlignmentEE(), EcalTrivialConditionRetriever::produceEcalAlignmentES(), edm::eventsetup::EventSetupRecordProvider::proxyProviderDescriptions(), QualityCutsAnalyzer::QualityCutsAnalyzer(), ctfseeding::range2SeedingHits(), RecoTauMVATransform::RecoTauMVATransform(), LMFColoredTable::setColor(), gen::Pythia6Service::setSLHAFromHeader(), Herwig6Hadronizer::setSLHAFromHeader(), LMFPnPrimDat::setSystem(), LMFColoredTable::setSystem(), TrackerGeometryCompare::surveyToTracker(), TauDiscriminationProducerBase< TauType, TauDiscriminator >::TauDiscriminationProducerBase(), TrackerStablePhiSort(), TrackTransformer::transform(), upcaseString(), TrackingMaterialProducer::update(), and sistrip::FEDEmulator::zeroSuppress().

tuple create_public_pileup_plots::verbose = cfg_parser.getboolean("general", "verbose")

Definition at line 140 of file create_public_pileup_plots.py.

tuple create_public_pileup_plots::year = int(cfg_parser.get("general", "year"))

Definition at line 149 of file create_public_pileup_plots.py.