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 
15  dqm = edm::Service<DQMStore>().operator->();
16  iConfig = pSet;
17 
18  SUSYFolder = iConfig.getParameter<string>("folderName");
19  _quantile = iConfig.getParameter<double>("quantile");
20 
21 }
22 
24 }
25 
27 }
28 
30 }
31 
33 }
34 
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 
55  dqm->setCurrentFolder(ME->getPathname());
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 }
63 
64 
65 
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 
96  if (MEx && MEx->kind() == MonitorElement::DQM_KIND_TH1F) {
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  //----------------------------------------------------------------------------
109  dqm->setCurrentFolder(SUSYFolder);
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 }
125 
126 
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
virtual void beginJob(void)
void endRun(const edm::Run &, const edm::EventSetup &)
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
int iEvent
Definition: GenABIO.cc:243
const std::string & getPathname(void) const
get pathname of parent folder
TH1 * getTH1(void) const
void QuantilePlots(MonitorElement *ME, double q_value)
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
virtual void beginRun(const edm::Run &, const edm::EventSetup &iSetup)
SusyPostProcessor(const edm::ParameterSet &pSet)
virtual void endJob()
Definition: Run.h:41