CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SusyPostProcessor Class Reference

#include <SusyPostProcessor.h>

Inheritance diagram for SusyPostProcessor:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SusyPostProcessor (const edm::ParameterSet &pSet)
 
 ~SusyPostProcessor () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void QuantilePlots (MonitorElement *&, double, DQMStore::IBooker &)
 

Private Attributes

double _quantile
 
std::vector< std::string > Dirs
 
std::vector< MonitorElement * > histoVector
 
edm::ParameterSet iConfig
 
MonitorElementMEx
 
MonitorElementMEy
 
std::string SUSYFolder
 

Static Private Attributes

static const char * messageLoggerCatregory = "SusyDQMPostProcessor"
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 21 of file SusyPostProcessor.h.

Constructor & Destructor Documentation

◆ SusyPostProcessor()

SusyPostProcessor::SusyPostProcessor ( const edm::ParameterSet pSet)
explicit

Definition at line 12 of file SusyPostProcessor.cc.

References edm::ParameterSet::getParameter().

12  {
13  iConfig = pSet;
14 
15  SUSYFolder = iConfig.getParameter<string>("folderName");
16  _quantile = iConfig.getParameter<double>("quantile");
17 }
edm::ParameterSet iConfig
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::string SUSYFolder

◆ ~SusyPostProcessor()

SusyPostProcessor::~SusyPostProcessor ( )
override

Definition at line 19 of file SusyPostProcessor.cc.

19 {}

Member Function Documentation

◆ dqmEndJob()

void SusyPostProcessor::dqmEndJob ( DQMStore::IBooker ibook_,
DQMStore::IGetter iget_ 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 47 of file SusyPostProcessor.cc.

References dqm::implementation::IGetter::dirExists(), TrackerOfflineValidation_Dqm_cff::dirName, spr::find(), newFWLiteAna::found, dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getContents(), dqm::implementation::IGetter::getSubdirs(), dqm::legacy::MonitorElement::getTH1F(), mps_fire::i, createfilelist::int, hcallasereventfilter2012_cfi::prefix, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and MonitorElementData::TH1F.

47  {
48  // MET
49  //----------------------------------------------------------------------------
50  iget_.setCurrentFolder("JetMET/MET");
51 
52  Dirs = iget_.getSubdirs();
53 
54  std::vector<std::string> metFolders;
55 
56  metFolders.push_back("Uncleaned/");
57  metFolders.push_back("Cleaned/");
58 
59  //Need our own copy for thread safety
60  TF1 mygaus("mygaus", "gaus");
61 
62  for (int i = 0; i < int(Dirs.size()); i++) {
63  std::string prefix = "dummy";
64 
65  if (size_t(Dirs[i].find("met")) != string::npos)
66  prefix = "met";
67  if (size_t(Dirs[i].find("pfMet")) != string::npos)
68  prefix = "pfMET";
69 
70  for (std::vector<std::string>::const_iterator ic = metFolders.begin(); ic != metFolders.end(); ic++) {
71  std::string dirName = Dirs[i] + "/" + *ic;
72 
73  MEx = iget_.get(dirName + "/" + "MEx");
74  MEy = iget_.get(dirName + "/" + "MEy");
75 
76  if (MEx && MEx->kind() == MonitorElement::Kind::TH1F) {
77  if (MEx->getTH1F()->GetEntries() > 50)
78  MEx->getTH1F()->Fit(&mygaus, "q");
79  }
80 
81  if (MEy && MEy->kind() == MonitorElement::Kind::TH1F) {
82  if (MEy->getTH1F()->GetEntries() > 50)
83  MEy->getTH1F()->Fit(&mygaus, "q");
84  }
85  }
86  }
87 
88  // SUSY
89  //----------------------------------------------------------------------------
91  Dirs = iget_.getSubdirs();
92  for (int i = 0; i < int(Dirs.size()); i++) {
93  size_t found = Dirs[i].find("Alpha");
94  if (found != string::npos)
95  continue;
96  if (!iget_.dirExists(Dirs[i])) {
97  edm::LogError(messageLoggerCatregory) << "Directory " << Dirs[i] << " doesn't exist!!";
98  continue;
99  }
100  vector<MonitorElement*> histoVector = iget_.getContents(Dirs[i]);
101  for (int i = 0; i < int(histoVector.size()); i++) {
103  }
104  }
105 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::vector< MonitorElement * > histoVector
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:769
Kind kind() const
Get the type of the monitor element.
MonitorElement * MEy
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
static const char * messageLoggerCatregory
MonitorElement * MEx
void QuantilePlots(MonitorElement *&, double, DQMStore::IBooker &)
std::string SUSYFolder
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
std::vector< std::string > Dirs
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:625
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:739

◆ QuantilePlots()

void SusyPostProcessor::QuantilePlots ( MonitorElement *&  ME,
double  q_value,
DQMStore::IBooker ibooker_ 
)
private

Definition at line 21 of file SusyPostProcessor.cc.

References dqm::implementation::IBooker::book1D(), createfilelist::int, SiStripPI::mean, Skims_PA_cff::name, submitPVResolutionJobs::q, RMS, and dqm::implementation::NavigatorBase::setCurrentFolder().

21  {
22  if (ME->getTH1()->GetEntries() > 0.) {
23  Quantile q(static_cast<const TH1*>(ME->getTH1()));
24  Float_t mean = q[q_value].first;
25  Float_t RMS = q[q_value].second;
26 
27  Float_t xLow = -5.5;
28  Float_t xUp = 9.5;
29  Int_t NBin = 15;
30 
31  if (mean > 0.) {
32  Float_t DBin = RMS * TMath::Sqrt(12.) / 2.;
33  xLow = mean - int(mean / DBin + 2) * DBin;
34  xUp = int(0.2 * mean / DBin) * DBin + mean + 5 * DBin;
35  NBin = (xUp - xLow) / DBin;
36  }
37 
38  ibooker_.setCurrentFolder(ME->getPathname());
39  TString name = ME->getTH1()->GetName();
40  name += "_quant";
41  ME = ibooker_.book1D(name, "", NBin, xLow, xUp);
42  ME->Fill(mean - RMS);
43  ME->Fill(mean + RMS);
44  }
45 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
Definition: ME.h:11
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

Member Data Documentation

◆ _quantile

double SusyPostProcessor::_quantile
private

Definition at line 34 of file SusyPostProcessor.h.

◆ Dirs

std::vector<std::string> SusyPostProcessor::Dirs
private

Definition at line 37 of file SusyPostProcessor.h.

◆ histoVector

std::vector<MonitorElement*> SusyPostProcessor::histoVector
private

Definition at line 36 of file SusyPostProcessor.h.

◆ iConfig

edm::ParameterSet SusyPostProcessor::iConfig
private

Definition at line 27 of file SusyPostProcessor.h.

◆ messageLoggerCatregory

const char * SusyPostProcessor::messageLoggerCatregory = "SusyDQMPostProcessor"
staticprivate

Definition at line 31 of file SusyPostProcessor.h.

◆ MEx

MonitorElement* SusyPostProcessor::MEx
private

Definition at line 39 of file SusyPostProcessor.h.

◆ MEy

MonitorElement* SusyPostProcessor::MEy
private

Definition at line 40 of file SusyPostProcessor.h.

◆ SUSYFolder

std::string SusyPostProcessor::SUSYFolder
private

Definition at line 33 of file SusyPostProcessor.h.