#include <RivetAnalyzer.h>
|
void | analyze (const edm::Event &, const edm::EventSetup &) override |
|
void | beginJob () override |
|
void | beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override |
|
void | beginRun (const edm::Run &, const edm::EventSetup &) override |
|
void | endJob () override |
| List of registered analysis data objects. More...
|
|
void | endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override |
|
void | endRun (const edm::Run &, const edm::EventSetup &) override |
|
| RivetAnalyzer (const edm::ParameterSet &) |
|
| ~RivetAnalyzer () override |
|
| EDAnalyzer ()=default |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () final |
|
SerialTaskQueue * | globalRunsQueue () final |
|
bool | wantsGlobalLuminosityBlocks () const final |
|
bool | wantsGlobalRuns () const final |
|
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
|
| EDAnalyzerBase () |
|
ModuleDescription const & | moduleDescription () const |
|
bool | wantsStreamLuminosityBlocks () const |
|
bool | wantsStreamRuns () const |
|
| ~EDAnalyzerBase () override |
|
std::vector< ConsumesInfo > | consumesInfo () const |
|
void | convertCurrentProcessAlias (std::string const &processName) |
| Convert "@currentProcess" in InputTag process names to the actual current process name. More...
|
|
| EDConsumerBase () |
|
| EDConsumerBase (EDConsumerBase &&)=default |
|
| EDConsumerBase (EDConsumerBase const &)=delete |
|
ESProxyIndex const * | esGetTokenIndices (edm::Transition iTrans) const |
|
ProductResolverIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
|
void | itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
void | itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
std::vector< ProductResolverIndexAndSkipBit > const & | itemsToGetFrom (BranchType iType) const |
|
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
|
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
|
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
|
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
|
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
|
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
|
ProductResolverIndexAndSkipBit | uncheckedIndexFrom (EDGetToken) const |
|
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
|
void | updateLookup (eventsetup::ESRecordsToProxyIndices const &) |
|
virtual | ~EDConsumerBase () noexcept(false) |
|
|
static const std::string & | baseType () |
|
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
|
static void | prevalidate (ConfigurationDescriptions &descriptions) |
|
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
|
ConsumesCollector | consumesCollector () |
| Use a ConsumesCollector to gather consumes information from helper functions. More...
|
|
template<typename ProductType , BranchType B = InEvent> |
void | consumesMany () |
|
void | consumesMany (const TypeToGet &id) |
|
template<BranchType B> |
void | consumesMany (const TypeToGet &id) |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes () |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes (ESInputTag const &tag) |
|
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
|
Definition at line 22 of file RivetAnalyzer.h.
◆ DQMStore
◆ MonitorElement
◆ RivetAnalyzer()
Definition at line 19 of file RivetAnalyzer.cc.
29 usesResource(
"Rivet");
32 std::vector<std::string> analysisNames =
pset.getParameter<std::vector<std::string> >(
"AnalysisNames");
References _analysisHandler, _genLumiInfoToken, _hepmcCollection, _LHECollection, _lheLabel, _lheRunInfoToken, _produceDQM, _useLHEweights, _xsection, dbe, and muonDTDigis_cfi::pset.
◆ ~RivetAnalyzer()
RivetAnalyzer::~RivetAnalyzer |
( |
| ) |
|
|
override |
◆ analyze()
Implements edm::one::EDAnalyzerBase.
Definition at line 117 of file RivetAnalyzer.cc.
124 std::unique_ptr<HepMC::GenEvent> tmpGenEvtPtr;
127 tmpGenEvtPtr = std::make_unique<HepMC::GenEvent>(*(evt->
GetEvent()));
130 HepMC::GenCrossSection xsec;
132 tmpGenEvtPtr->set_cross_section(xsec);
136 std::vector<double> mergedWeights;
137 for (
unsigned int i = 0;
i < tmpGenEvtPtr->weights().size();
i++) {
138 mergedWeights.push_back(tmpGenEvtPtr->weights()[
i]);
144 mergedWeights.push_back(tmpGenEvtPtr->weights()[0] * lheEventHandle->
weights().at(
i).wgt /
148 tmpGenEvtPtr->weights() = mergedWeights;
150 myGenEvent = tmpGenEvtPtr.get();
159 std::vector<std::string> cleanedWeightNames;
161 cleanedWeightNames.push_back(std::regex_replace(wn, std::regex(
"[^A-Za-z\\d\\._=]"),
"_"));
164 const HepMC::GenCrossSection* xs = myGenEvent->cross_section();
165 _analysisHandler.setCrossSection(make_pair(xs->cross_section(), xs->cross_section_error()));
References _analysisHandler, _hepmcCollection, _isFirstEvent, _LHECollection, _lheWeightNames, _useLHEweights, _weightNames, _xsection, edm::HepMCProduct::GetEvent(), mps_fire::i, iEvent, LHEEventProduct::originalXWGTUP(), AlCaHLTBitMon_QueryRunRegistry::string, and LHEEventProduct::weights().
◆ beginJob()
void RivetAnalyzer::beginJob |
( |
void |
| ) |
|
|
overridevirtual |
Reimplemented from edm::one::EDAnalyzerBase.
Definition at line 58 of file RivetAnalyzer.cc.
60 char*
cmsswbase = std::getenv(
"CMSSW_BASE");
61 char* cmsswrelease = std::getenv(
"CMSSW_RELEASE_BASE");
62 if (!std::getenv(
"RIVET_REF_PATH")) {
64 "/src/GeneratorInterface/RivetInterface/data:" +
string(cmsswrelease) +
65 "/src/GeneratorInterface/RivetInterface/data";
66 char* rivetrefCstr = strdup(rivetref.c_str());
70 if (!std::getenv(
"RIVET_INFO_PATH")) {
72 "/src/GeneratorInterface/RivetInterface/data:" +
string(cmsswrelease) +
73 "/src/GeneratorInterface/RivetInterface/data";
74 char* rivetinfoCstr = strdup(rivetinfo.c_str());
75 putenv(rivetinfoCstr);
References SiStripCommissioningSource_FromEDM_cfg::cmsswbase, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ beginLuminosityBlock()
◆ beginRun()
◆ endJob()
void RivetAnalyzer::endJob |
( |
void |
| ) |
|
|
overridevirtual |
◆ endLuminosityBlock()
◆ endRun()
◆ normalizeTree()
void RivetAnalyzer::normalizeTree |
( |
| ) |
|
|
private |
Definition at line 195 of file RivetAnalyzer.cc.
196 using namespace YODA;
200 const string tmpdir =
"/RivetNormalizeTmp";
202 for (
const string& analysis :
analyses) {
207 TH1F
nevent(
"nEvt",
"n analyzed Events", 1, 0., 1.);
References _analysisHandler, _mes, _produceDQM, hltExoticaValidator_cfi::analyses, dqm::implementation::IBooker::book1D(), dbe, nevent, and dqm::implementation::DQMStore::setCurrentFolder().
◆ _analysisHandler
Rivet::AnalysisHandler RivetAnalyzer::_analysisHandler |
|
private |
◆ _doFinalize
bool RivetAnalyzer::_doFinalize |
|
private |
◆ _genEventInfoCollection
◆ _genLumiInfoToken
◆ _GENweightNumber
int RivetAnalyzer::_GENweightNumber |
|
private |
◆ _hepmcCollection
◆ _isFirstEvent
bool RivetAnalyzer::_isFirstEvent |
|
private |
◆ _LHECollection
◆ _lheLabel
◆ _lheRunInfoToken
◆ _lheWeightNames
std::vector<std::string> RivetAnalyzer::_lheWeightNames |
|
private |
◆ _LHEweightNumber
int RivetAnalyzer::_LHEweightNumber |
|
private |
◆ _mes
◆ _outFileName
std::string RivetAnalyzer::_outFileName |
|
private |
◆ _produceDQM
bool RivetAnalyzer::_produceDQM |
|
private |
◆ _useExternalWeight
bool RivetAnalyzer::_useExternalWeight |
|
private |
◆ _useGENweights
bool RivetAnalyzer::_useGENweights |
|
private |
◆ _useLHEweights
bool RivetAnalyzer::_useLHEweights |
|
private |
◆ _weightNames
std::vector<std::string> RivetAnalyzer::_weightNames |
|
private |
◆ _xsection
double RivetAnalyzer::_xsection |
|
private |
◆ dbe
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())