CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
14  iConfig = pSet;
15 
16  SUSYFolder = iConfig.getParameter<string>("folderName");
17  _quantile = iConfig.getParameter<double>("quantile");
18 
19 }
20 
22 }
23 
24 
25 
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 }
54 
55 
56 
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  for (int i=0; i<int(Dirs.size()); i++) {
71 
72  std::string prefix = "dummy";
73 
74  if (size_t(Dirs[i].find("met")) != string::npos) prefix = "met";
75  if (size_t(Dirs[i].find("pfMet")) != string::npos) prefix = "pfMET";
76 
77  for (std::vector<std::string>::const_iterator ic=metFolders.begin();
78  ic!=metFolders.end(); ic++) {
79 
80  std::string dirName = Dirs[i] +"/" + *ic;
81 
82  MEx = iget_.get(dirName + "/"+"MEx");
83  MEy = iget_.get(dirName + "/"+"MEy");
84 
85  if (MEx && MEx->kind() == MonitorElement::DQM_KIND_TH1F) {
86  if (MEx->getTH1F()->GetEntries() > 50) MEx->getTH1F()->Fit("gaus", "q");
87  }
88 
89  if (MEy && MEy->kind() == MonitorElement::DQM_KIND_TH1F) {
90  if (MEy->getTH1F()->GetEntries() > 50) MEy->getTH1F()->Fit("gaus", "q");
91  }
92  }
93  }
94 
95 
96  // SUSY
97  //----------------------------------------------------------------------------
98  iget_.setCurrentFolder(SUSYFolder);
99  Dirs = iget_.getSubdirs();
100  for (int i=0; i<int(Dirs.size()); i++)
101  {
102  size_t found = Dirs[i].find("Alpha");
103  if (found!=string::npos) continue;
104  if(!iget_.dirExists(Dirs[i])){
105  edm::LogError(messageLoggerCatregory)<< "Directory "<<Dirs[i]<<" doesn't exist!!";
106  continue;
107  }
108  vector<MonitorElement*> histoVector = iget_.getContents(Dirs[i]);
109  for (int i=0; i<int(histoVector.size()); i++) {
110  QuantilePlots(histoVector[i],_quantile,ibook_);
111  }
112  }
113 }
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:194
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:291
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
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
void Fill(long long x)
Definition: ME.h:11
const std::string & getPathname(void) const
get pathname of parent folder
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
TH1 * getTH1(void) const
bool dirExists(const std::string &path)
Definition: DQMStore.cc:307
void QuantilePlots(MonitorElement *&, double, DQMStore::IBooker &)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
TH1F * getTH1F(void) const
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:295
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:319
SusyPostProcessor(const edm::ParameterSet &pSet)