CMS 3D CMS Logo

Public Member Functions | Private Attributes

DQMHcalIsoTrackPostProcessor Class Reference

Inheritance diagram for DQMHcalIsoTrackPostProcessor:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup)
 DQMHcalIsoTrackPostProcessor (const edm::ParameterSet &pset)
void endJob ()
void endRun (edm::Run const &, edm::EventSetup const &)
 ~DQMHcalIsoTrackPostProcessor ()

Private Attributes

std::string outputRootFileName_
bool saveToFile_
std::string subDir_

Detailed Description

Definition at line 16 of file DQMHcalIsoTrackPostProcessor.cc.


Constructor & Destructor Documentation

DQMHcalIsoTrackPostProcessor::DQMHcalIsoTrackPostProcessor ( const edm::ParameterSet pset)

Definition at line 34 of file DQMHcalIsoTrackPostProcessor.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputRootFileName_, saveToFile_, and subDir_.

{
  subDir_ = pset.getUntrackedParameter<std::string>("subDir");
  saveToFile_=pset.getParameter<bool>("saveToFile");
  outputRootFileName_=pset.getParameter<std::string>("outputFile");
}
DQMHcalIsoTrackPostProcessor::~DQMHcalIsoTrackPostProcessor ( ) [inline]

Definition at line 19 of file DQMHcalIsoTrackPostProcessor.cc.

{};

Member Function Documentation

void DQMHcalIsoTrackPostProcessor::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
) [inline, virtual]

Implements edm::EDAnalyzer.

Definition at line 21 of file DQMHcalIsoTrackPostProcessor.cc.

{};
void DQMHcalIsoTrackPostProcessor::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file DQMHcalIsoTrackPostProcessor.cc.

References DQMStore::book1D(), DQMStore::cd(), gather_cfg::cout, DQMStore::dirExists(), DQMStore::get(), getTH1F(), MonitorElement::getTH1F(), cmsCodeRules::cppFunctionSkipper::operator, outputRootFileName_, DQMStore::pwd(), DQMStore::save(), saveToFile_, and subDir_.

{

  DQMStore* dqm;
  dqm = 0;
  dqm = edm::Service<DQMStore>().operator->();

  if ( ! dqm ) {
    edm::LogInfo("DQMHcalIsoTrackPostProcessor") << "Cannot create DQMStore instance\n";
    return;
  }

  std::cout<<"endjob"<<std::endl;
  if(dqm->dirExists(subDir_)) dqm->cd(subDir_);
  else {
   edm::LogWarning("DQMHcalIsoTrackPostProcessor") << "cannot find directory: " << subDir_ << " , skipping";
    return;
  }

  MonitorElement* hPurityEta=dqm->book1D("hPurityEta","Purity of sample vs eta",16,-2,2);
  MonitorElement* hPurityPhi=dqm->book1D("hPurityPhi","Purity of sample vs phi",16,-3.2,3.2);

  MonitorElement* hSumOffEta=dqm->book1D("hSumOffEta","hSumOffEta",16,-2,2);
  MonitorElement* hSumOffPhi=dqm->book1D("hSumOffPhi","hSumOffPhi",16,-3.2,3.2);
  
  MonitorElement* hSumL3Eta=dqm->book1D("hSumL3Eta","hSumL3Eta",16,-2,2);
  MonitorElement* hSumL3Phi=dqm->book1D("hSumL3Phi","hSumL3Phi",16,-3.2,3.2);

  hSumOffEta->getTH1F()->Add(dqm->get(dqm->pwd() + "/hOffEtaFP")->getTH1F(),1);
  hSumOffPhi->getTH1F()->Add(dqm->get(dqm->pwd() + "/hOffPhiFP")->getTH1F(),1);
    
  hSumL3Eta->getTH1F()->Add(dqm->get(dqm->pwd() + "/hl3eta")->getTH1F(),1);
  hSumL3Phi->getTH1F()->Add(dqm->get(dqm->pwd() + "/hl3phi")->getTH1F(),1);
 

  hSumOffEta->getTH1F()->TH1F::Sumw2();
  hSumOffPhi->getTH1F()->TH1F::Sumw2();
  hSumL3Eta->getTH1F()->TH1F::Sumw2();
  hSumL3Phi->getTH1F()->TH1F::Sumw2();

  hPurityEta->getTH1F()->Divide(hSumOffEta->getTH1F(),hSumL3Eta->getTH1F(),1,1);
  hPurityPhi->getTH1F()->Divide(hSumOffPhi->getTH1F(),hSumL3Phi->getTH1F(),1,1);

  if (saveToFile_) dqm->save(outputRootFileName_);
}
void DQMHcalIsoTrackPostProcessor::endRun ( edm::Run const &  run,
edm::EventSetup const &  es 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file DQMHcalIsoTrackPostProcessor.cc.

{
}

Member Data Documentation

Definition at line 29 of file DQMHcalIsoTrackPostProcessor.cc.

Referenced by DQMHcalIsoTrackPostProcessor(), and endJob().

Definition at line 28 of file DQMHcalIsoTrackPostProcessor.cc.

Referenced by DQMHcalIsoTrackPostProcessor(), and endJob().

Definition at line 27 of file DQMHcalIsoTrackPostProcessor.cc.

Referenced by DQMHcalIsoTrackPostProcessor(), and endJob().