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 }
mps_fire.i
i
Definition: mps_fire.py:428
dqm::implementation::IGetter::getContents
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
MessageLogger.h
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
Quantile.h
MonitorElementData::Kind::TH1F
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::implementation::IGetter::getSubdirs
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:700
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
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
edm::ParameterSet
Definition: ParameterSet.h:47
SusyPostProcessor.h
ModuleDef.h
createfilelist.int
int
Definition: createfilelist.py:10
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SusyPostProcessor::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: SusyPostProcessor.cc:47
SusyPostProcessor::SusyPostProcessor
SusyPostProcessor(const edm::ParameterSet &pSet)
Definition: SusyPostProcessor.cc:12
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
SusyPostProcessor::~SusyPostProcessor
~SusyPostProcessor() override
Definition: SusyPostProcessor.cc:19
ME
Definition: ME.h:11
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
Quantile
Definition: Quantile.h:8
dqm::implementation::IGetter::dirExists
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:730
hcallasereventfilter2012_cfi.prefix
prefix
Definition: hcallasereventfilter2012_cfi.py:10
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98