CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual void beginJob (void)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &iSetup)
 
virtual void endJob ()
 
void endRun (const edm::Run &, const edm::EventSetup &)
 
 SusyPostProcessor (const edm::ParameterSet &pSet)
 
 ~SusyPostProcessor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void QuantilePlots (MonitorElement *ME, double q_value)
 

Private Attributes

double _quantile
 
std::vector< std::string > Dirs
 
DQMStoredqm
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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)
 

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(), and cppFunctionSkipper::operator.

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

Definition at line 23 of file SusyPostProcessor.cc.

23  {
24 }

Member Function Documentation

void SusyPostProcessor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 32 of file SusyPostProcessor.cc.

32  {
33 }
void SusyPostProcessor::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 26 of file SusyPostProcessor.cc.

26  {
27 }
void SusyPostProcessor::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 29 of file SusyPostProcessor.cc.

29  {
30 }
void SusyPostProcessor::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file SusyPostProcessor.cc.

127 {}
void SusyPostProcessor::endRun ( const edm::Run ,
const edm::EventSetup  
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 66 of file SusyPostProcessor.cc.

References TrackerOfflineValidation_Dqm_cff::dirName, MonitorElement::DQM_KIND_TH1F, spr::find(), newFWLiteAna::found, i, prof2calltree::prefix, and AlCaHLTBitMon_QueryRunRegistry::string.

67 {
68  // MET
69  //----------------------------------------------------------------------------
70  dqm->setCurrentFolder("JetMET/MET");
71 
72  Dirs = dqm->getSubdirs();
73 
74  std::vector<std::string> metFolders;
75 
76  metFolders.push_back("All/");
77  metFolders.push_back("BasicCleanup/");
78  metFolders.push_back("ExtraCleanup/");
79 
80  for (int i=0; i<int(Dirs.size()); i++) {
81 
82  std::string prefix = "dummy";
83 
84  if (size_t(Dirs[i].find("Calo")) != string::npos) prefix = "Calo";
85  if (size_t(Dirs[i].find("Pf")) != string::npos) prefix = "Pf";
86  if (size_t(Dirs[i].find("Tc")) != string::npos) prefix = "";
87 
88  for (std::vector<std::string>::const_iterator ic=metFolders.begin();
89  ic!=metFolders.end(); ic++) {
90 
91  std::string dirName = Dirs[i] + "/" + *ic;
92 
93  MEx = dqm->get(dirName + "METTask_" + prefix + "MEx");
94  MEy = dqm->get(dirName + "METTask_" + prefix + "MEx");
95 
97  if (MEx->getTH1F()->GetEntries() > 50) MEx->getTH1F()->Fit("gaus", "q");
98  }
99 
100  if (MEy && MEy->kind() == MonitorElement::DQM_KIND_TH1F) {
101  if (MEy->getTH1F()->GetEntries() > 50) MEy->getTH1F()->Fit("gaus", "q");
102  }
103  }
104  }
105 
106 
107  // SUSY
108  //----------------------------------------------------------------------------
110  Dirs = dqm->getSubdirs();
111  for (int i=0; i<int(Dirs.size()); i++)
112  {
113  size_t found = Dirs[i].find("Alpha");
114  if (found!=string::npos) continue;
115  if(!dqm->dirExists(Dirs[i])){
116  edm::LogError(messageLoggerCatregory)<< "Directory "<<Dirs[i]<<" doesn't exist!!";
117  continue;
118  }
119  vector<MonitorElement*> histoVector = dqm->getContents(Dirs[i]);
120  for (int i=0; i<int(histoVector.size()); i++) {
121  QuantilePlots(histoVector[i],_quantile);
122  }
123  }
124 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1575
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:7
static const char * messageLoggerCatregory
MonitorElement * MEx
Kind kind(void) const
Get the type of the monitor element.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1653
void QuantilePlots(MonitorElement *ME, double q_value)
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:649
std::string SUSYFolder
TH1F * getTH1F(void) const
std::vector< std::string > Dirs
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void SusyPostProcessor::QuantilePlots ( MonitorElement ME,
double  q_value 
)
private

Definition at line 35 of file SusyPostProcessor.cc.

References MonitorElement::Fill(), MonitorElement::getPathname(), MonitorElement::getTH1(), timingPdfMaker::mean, mergeVDriftHistosByStation::name, and lumiQueryAPI::q.

36 {
37  if(ME->getTH1()->GetEntries()>0.)
38  {
39  Quantile q(static_cast<const TH1*>(ME->getTH1()));
40  Float_t mean=q[q_value].first;
41  Float_t RMS=q[q_value].second;
42 
43  Float_t xLow=-5.5;
44  Float_t xUp=9.5;
45  Int_t NBin=15;
46 
47  if(mean>0.)
48  {
49  Float_t DBin=RMS*TMath::Sqrt(12.)/2.;
50  xLow=mean-int(mean/DBin+2)*DBin;
51  xUp=int(0.2*mean/DBin)*DBin+mean+5*DBin;
52  NBin=(xUp-xLow)/DBin;
53  }
54 
56  TString name=ME->getTH1()->GetName();
57  name+="_quant";
58  ME=dqm->book1D(name,"",NBin, xLow, xUp);
59  ME->Fill(mean-RMS);
60  ME->Fill(mean+RMS);
61  }
62 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
void Fill(long long x)
const std::string & getPathname(void) const
get pathname of parent folder
TH1 * getTH1(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585

Member Data Documentation

double SusyPostProcessor::_quantile
private

Definition at line 43 of file SusyPostProcessor.h.

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

Definition at line 47 of file SusyPostProcessor.h.

DQMStore* SusyPostProcessor::dqm
private

Definition at line 45 of file SusyPostProcessor.h.

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

Definition at line 46 of file SusyPostProcessor.h.

edm::ParameterSet SusyPostProcessor::iConfig
private

Definition at line 37 of file SusyPostProcessor.h.

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

Definition at line 40 of file SusyPostProcessor.h.

MonitorElement* SusyPostProcessor::MEx
private

Definition at line 49 of file SusyPostProcessor.h.

MonitorElement* SusyPostProcessor::MEy
private

Definition at line 50 of file SusyPostProcessor.h.

std::string SusyPostProcessor::SUSYFolder
private

Definition at line 42 of file SusyPostProcessor.h.