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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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
 
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 const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
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 edm::ParameterSet::getParameter().

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

Definition at line 21 of file SusyPostProcessor.cc.

21  {
22 }

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 57 of file SusyPostProcessor.cc.

References DQMStore::IGetter::dirExists(), TrackerOfflineValidation_Dqm_cff::dirName, MonitorElement::DQM_KIND_TH1F, spr::find(), runEdmFileComparison::found, DQMStore::IGetter::get(), DQMStore::IGetter::getContents(), DQMStore::IGetter::getSubdirs(), MonitorElement::getTH1F(), mps_fire::i, createfilelist::int, tablePrinter::prefix, DQMStore::IGetter::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

58 {
59  // MET
60  //----------------------------------------------------------------------------
61  iget_.setCurrentFolder("JetMET/MET");
62 
63  Dirs = iget_.getSubdirs();
64 
65  std::vector<std::string> metFolders;
66 
67  metFolders.push_back("Uncleaned/");
68  metFolders.push_back("Cleaned/");
69 
70  //Need our own copy for thread safety
71  TF1 mygaus("mygaus","gaus");
72 
73  for (int i=0; i<int(Dirs.size()); i++) {
74 
75  std::string prefix = "dummy";
76 
77  if (size_t(Dirs[i].find("met")) != string::npos) prefix = "met";
78  if (size_t(Dirs[i].find("pfMet")) != string::npos) prefix = "pfMET";
79 
80  for (std::vector<std::string>::const_iterator ic=metFolders.begin();
81  ic!=metFolders.end(); ic++) {
82 
83  std::string dirName = Dirs[i] +"/" + *ic;
84 
85  MEx = iget_.get(dirName + "/"+"MEx");
86  MEy = iget_.get(dirName + "/"+"MEy");
87 
89  if (MEx->getTH1F()->GetEntries() > 50) MEx->getTH1F()->Fit(&mygaus, "q");
90  }
91 
93  if (MEy->getTH1F()->GetEntries() > 50) MEy->getTH1F()->Fit(&mygaus, "q");
94  }
95  }
96  }
97 
98 
99  // SUSY
100  //----------------------------------------------------------------------------
102  Dirs = iget_.getSubdirs();
103  for (int i=0; i<int(Dirs.size()); i++)
104  {
105  size_t found = Dirs[i].find("Alpha");
106  if (found!=string::npos) continue;
107  if(!iget_.dirExists(Dirs[i])){
108  edm::LogError(messageLoggerCatregory)<< "Directory "<<Dirs[i]<<" doesn't exist!!";
109  continue;
110  }
111  vector<MonitorElement*> histoVector = iget_.getContents(Dirs[i]);
112  for (int i=0; i<int(histoVector.size()); i++) {
113  QuantilePlots(histoVector[i],_quantile,ibook_);
114  }
115  }
116 }
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:305
TH1F * getTH1F() const
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
std::vector< MonitorElement * > histoVector
MonitorElement * MEy
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
static const char * messageLoggerCatregory
MonitorElement * MEx
bool dirExists(const std::string &path)
Definition: DQMStore.cc:332
void QuantilePlots(MonitorElement *&, double, DQMStore::IBooker &)
std::string SUSYFolder
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:344
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:320
std::vector< std::string > Dirs
Kind kind() const
Get the type of the monitor element.
void SusyPostProcessor::QuantilePlots ( MonitorElement *&  ME,
double  q_value,
DQMStore::IBooker ibooker_ 
)
private

Definition at line 26 of file SusyPostProcessor.cc.

References DQMStore::IBooker::book1D(), MonitorElement::Fill(), MonitorElement::getPathname(), MonitorElement::getTH1(), createfilelist::int, SiStripPI::mean, dataset::name, lumiQueryAPI::q, RMS, and DQMStore::IBooker::setCurrentFolder().

27 {
28  if(ME->getTH1()->GetEntries()>0.)
29  {
30  Quantile q(static_cast<const TH1*>(ME->getTH1()));
31  Float_t mean=q[q_value].first;
32  Float_t RMS=q[q_value].second;
33 
34  Float_t xLow=-5.5;
35  Float_t xUp=9.5;
36  Int_t NBin=15;
37 
38  if(mean>0.)
39  {
40  Float_t DBin=RMS*TMath::Sqrt(12.)/2.;
41  xLow=mean-int(mean/DBin+2)*DBin;
42  xUp=int(0.2*mean/DBin)*DBin+mean+5*DBin;
43  NBin=(xUp-xLow)/DBin;
44  }
45 
46  ibooker_.setCurrentFolder(ME->getPathname());
47  TString name=ME->getTH1()->GetName();
48  name+="_quant";
49  ME=ibooker_.book1D(name,"",NBin, xLow, xUp);
50  ME->Fill(mean-RMS);
51  ME->Fill(mean+RMS);
52  }
53 }
const std::string & getPathname() const
get pathname of parent folder
TH1 * getTH1() const
void Fill(long long x)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274

Member Data Documentation

double SusyPostProcessor::_quantile
private

Definition at line 38 of file SusyPostProcessor.h.

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

Definition at line 41 of file SusyPostProcessor.h.

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

Definition at line 40 of file SusyPostProcessor.h.

edm::ParameterSet SusyPostProcessor::iConfig
private

Definition at line 31 of file SusyPostProcessor.h.

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

Definition at line 35 of file SusyPostProcessor.h.

MonitorElement* SusyPostProcessor::MEx
private

Definition at line 43 of file SusyPostProcessor.h.

MonitorElement* SusyPostProcessor::MEy
private

Definition at line 44 of file SusyPostProcessor.h.

std::string SusyPostProcessor::SUSYFolder
private

Definition at line 37 of file SusyPostProcessor.h.