CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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< T > 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< T >
 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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
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)
 
 ~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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::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
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< B > consumes (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 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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 22 of file SusyPostProcessor.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file SusyPostProcessor.cc.

References iConfig.

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

Definition at line 19 of file SusyPostProcessor.cc.

19 {}

Member Function Documentation

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, PostProcessorHGCAL_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++) {
102  QuantilePlots(histoVector[i], _quantile, ibook_);
103  }
104  }
105 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:700
virtual TH1F * getTH1F() const
std::vector< MonitorElement * > histoVector
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
Kind kind() const
Get the type of the monitor element.
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:730
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
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
MonitorElement * MEx
void QuantilePlots(MonitorElement *&, double, DQMStore::IBooker &)
std::string SUSYFolder
std::vector< std::string > Dirs
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(), dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getPathname(), dqm::legacy::MonitorElement::getTH1(), SiStripPI::mean, mergeVDriftHistosByStation::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:32
const std::string & getPathname() const
get pathname of parent folder
void Fill(long long x)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual TH1 * getTH1() const

Member Data Documentation

double SusyPostProcessor::_quantile
private

Definition at line 35 of file SusyPostProcessor.h.

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

Definition at line 38 of file SusyPostProcessor.h.

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

Definition at line 37 of file SusyPostProcessor.h.

edm::ParameterSet SusyPostProcessor::iConfig
private

Definition at line 28 of file SusyPostProcessor.h.

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

Definition at line 32 of file SusyPostProcessor.h.

MonitorElement* SusyPostProcessor::MEx
private

Definition at line 40 of file SusyPostProcessor.h.

MonitorElement* SusyPostProcessor::MEy
private

Definition at line 41 of file SusyPostProcessor.h.

std::string SusyPostProcessor::SUSYFolder
private

Definition at line 34 of file SusyPostProcessor.h.