CMS 3D CMS Logo

SusyPostProcessor.cc
Go to the documentation of this file.
1 #include <iostream>
2 
7 
8 using namespace std;
9 
10 const char* SusyPostProcessor::messageLoggerCatregory = "SusyDQMPostProcessor";
11 
13  iConfig = pSet;
14 
15  SUSYFolder = iConfig.getParameter<string>("folderName");
16  _quantile = iConfig.getParameter<double>("quantile");
17 }
18 
20 
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 }
46 
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++) {
102  QuantilePlots(histoVector[i], _quantile, ibook_);
103  }
104  }
105 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:769
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
Definition: ME.h:11
~SusyPostProcessor() override
void QuantilePlots(MonitorElement *&, double, DQMStore::IBooker &)
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
SusyPostProcessor(const edm::ParameterSet &pSet)
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 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