CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

SusyPostProcessor Class Reference

#include <SusyPostProcessor.h>

Inheritance diagram for SusyPostProcessor:
edm::EDAnalyzer

List of all members.

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 ()

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"

Detailed Description

Definition at line 22 of file SusyPostProcessor.h.


Constructor & Destructor Documentation

SusyPostProcessor::SusyPostProcessor ( const edm::ParameterSet pSet) [explicit]
SusyPostProcessor::~SusyPostProcessor ( )

Definition at line 23 of file SusyPostProcessor.cc.

                                     {
}

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.

                                                                                  {
}
void SusyPostProcessor::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 26 of file SusyPostProcessor.cc.

                                    {
}
void SusyPostProcessor::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 29 of file SusyPostProcessor.cc.

                                                                          {
}
void SusyPostProcessor::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file SusyPostProcessor.cc.

{}
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, and prof2calltree::prefix.

{
  // MET
  //----------------------------------------------------------------------------
  dqm->setCurrentFolder("JetMET/MET");

  Dirs = dqm->getSubdirs();

  std::vector<std::string> metFolders;

  metFolders.push_back("All/");
  metFolders.push_back("BasicCleanup/");
  metFolders.push_back("ExtraCleanup/");

  for (int i=0; i<int(Dirs.size()); i++) {

    std::string prefix = "dummy";

    if (size_t(Dirs[i].find("Calo")) != string::npos) prefix = "Calo";
    if (size_t(Dirs[i].find("Pf"))   != string::npos) prefix = "Pf";
    if (size_t(Dirs[i].find("Tc"))   != string::npos) prefix = "";

    for (std::vector<std::string>::const_iterator ic=metFolders.begin();
         ic!=metFolders.end(); ic++) {

      std::string dirName = Dirs[i] + "/" + *ic;

      MEx = dqm->get(dirName + "METTask_" + prefix + "MEx");
      MEy = dqm->get(dirName + "METTask_" + prefix + "MEx");

      if (MEx && MEx->kind() == MonitorElement::DQM_KIND_TH1F) {
        if (MEx->getTH1F()->GetEntries() > 50) MEx->getTH1F()->Fit("gaus", "q");
      }

      if (MEy && MEy->kind() == MonitorElement::DQM_KIND_TH1F) {
        if (MEy->getTH1F()->GetEntries() > 50) MEy->getTH1F()->Fit("gaus", "q");
      }
    }
  }


  // SUSY
  //----------------------------------------------------------------------------
  dqm->setCurrentFolder(SUSYFolder);
  Dirs = dqm->getSubdirs();
  for (int i=0; i<int(Dirs.size()); i++)
    {
      size_t found = Dirs[i].find("Alpha");
      if (found!=string::npos) continue;
      if(!dqm->dirExists(Dirs[i])){
        edm::LogError(messageLoggerCatregory)<< "Directory "<<Dirs[i]<<" doesn't exist!!";
        continue;
      }      
      vector<MonitorElement*> histoVector = dqm->getContents(Dirs[i]);
      for (int i=0; i<int(histoVector.size()); i++) {
        QuantilePlots(histoVector[i],_quantile);
      } 
    }
}
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.

{
  if(ME->getTH1()->GetEntries()>0.)
    {
      Quantile q(static_cast<const TH1*>(ME->getTH1()));
      Float_t mean=q[q_value].first;
      Float_t RMS=q[q_value].second;
      
      Float_t xLow=-5.5;
      Float_t xUp=9.5;
      Int_t NBin=15;
      
      if(mean>0.)
        {
          Float_t DBin=RMS*TMath::Sqrt(12.)/2.;
          xLow=mean-int(mean/DBin+2)*DBin;
          xUp=int(0.2*mean/DBin)*DBin+mean+5*DBin;
          NBin=(xUp-xLow)/DBin;
        }

      dqm->setCurrentFolder(ME->getPathname());
      TString name=ME->getTH1()->GetName();
      name+="_quant";
      ME=dqm->book1D(name,"",NBin, xLow, xUp);
      ME->Fill(mean-RMS);
      ME->Fill(mean+RMS);
    }
}

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.

Definition at line 45 of file SusyPostProcessor.h.

Definition at line 46 of file SusyPostProcessor.h.

Definition at line 37 of file SusyPostProcessor.h.

const char * SusyPostProcessor::messageLoggerCatregory = "SusyDQMPostProcessor" [static, private]

Definition at line 40 of file SusyPostProcessor.h.

Definition at line 49 of file SusyPostProcessor.h.

Definition at line 50 of file SusyPostProcessor.h.

std::string SusyPostProcessor::SUSYFolder [private]

Definition at line 42 of file SusyPostProcessor.h.