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::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 ()
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
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 endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) 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::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~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 &&)=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
 
EDConsumerBaseoperator= (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)
 

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
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<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
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)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 22 of file SusyPostProcessor.h.

Constructor & Destructor Documentation

◆ SusyPostProcessor()

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

Definition at line 12 of file SusyPostProcessor.cc.

12  {
13  iConfig = pSet;
14 
15  SUSYFolder = iConfig.getParameter<string>("folderName");
16  _quantile = iConfig.getParameter<double>("quantile");
17 }

References edm::ParameterSet::getParameter().

◆ ~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.

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  //----------------------------------------------------------------------------
90  iget_.setCurrentFolder(SUSYFolder);
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 }

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, ZMuMuAnalysisNtupler_cff::prefix, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, tools::TF1, and MonitorElementData::TH1F.

◆ QuantilePlots()

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

Definition at line 21 of file SusyPostProcessor.cc.

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 }

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

Member Data Documentation

◆ _quantile

double SusyPostProcessor::_quantile
private

Definition at line 35 of file SusyPostProcessor.h.

◆ Dirs

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

Definition at line 38 of file SusyPostProcessor.h.

◆ histoVector

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

Definition at line 37 of file SusyPostProcessor.h.

◆ iConfig

edm::ParameterSet SusyPostProcessor::iConfig
private

Definition at line 28 of file SusyPostProcessor.h.

◆ messageLoggerCatregory

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

Definition at line 32 of file SusyPostProcessor.h.

◆ MEx

MonitorElement* SusyPostProcessor::MEx
private

Definition at line 40 of file SusyPostProcessor.h.

◆ MEy

MonitorElement* SusyPostProcessor::MEy
private

Definition at line 41 of file SusyPostProcessor.h.

◆ SUSYFolder

std::string SusyPostProcessor::SUSYFolder
private

Definition at line 34 of file SusyPostProcessor.h.

SusyPostProcessor::histoVector
std::vector< MonitorElement * > histoVector
Definition: SusyPostProcessor.h:37
mps_fire.i
i
Definition: mps_fire.py:355
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
SusyPostProcessor::MEy
MonitorElement * MEy
Definition: SusyPostProcessor.h:41
MonitorElementData::Kind::TH1F
SusyPostProcessor::iConfig
edm::ParameterSet iConfig
Definition: SusyPostProcessor.h:28
data-class-funcs.q
q
Definition: data-class-funcs.py:169
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
tools.TF1
TF1
Definition: tools.py:23
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
dqm::impl::MonitorElement::kind
Kind kind() const
Get the type of the monitor element.
Definition: MonitorElement.h:247
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
SusyPostProcessor::MEx
MonitorElement * MEx
Definition: SusyPostProcessor.h:40
SusyPostProcessor::_quantile
double _quantile
Definition: SusyPostProcessor.h:35
SusyPostProcessor::messageLoggerCatregory
static const char * messageLoggerCatregory
Definition: SusyPostProcessor.h:32
RMS
Definition: trackSplitPlot.h:34
SusyPostProcessor::QuantilePlots
void QuantilePlots(MonitorElement *&, double, DQMStore::IBooker &)
Definition: SusyPostProcessor.cc:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
createfilelist.int
int
Definition: createfilelist.py:10
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SusyPostProcessor::Dirs
std::vector< std::string > Dirs
Definition: SusyPostProcessor.h:38
SusyPostProcessor::SUSYFolder
std::string SUSYFolder
Definition: SusyPostProcessor.h:34
ME
Definition: ME.h:11
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Quantile
Definition: Quantile.h:8
ZMuMuAnalysisNtupler_cff.prefix
prefix
Definition: ZMuMuAnalysisNtupler_cff.py:14