CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PhotonDataCertification Class Reference

#include <PhotonDataCertification.h>

Inheritance diagram for PhotonDataCertification:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
 PhotonDataCertification (const edm::ParameterSet &pset)
 
 ~PhotonDataCertification ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

float invMassZtest (std::string path, TString name, DQMStore::IGetter &)
 

Private Attributes

edm::ParameterSet parameters_
 
MonitorElementreportSummary_
 
MonitorElementreportSummaryMap_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 47 of file PhotonDataCertification.h.

Constructor & Destructor Documentation

PhotonDataCertification::PhotonDataCertification ( const edm::ParameterSet pset)
explicit

Definition at line 22 of file PhotonDataCertification.cc.

References gather_cfg::cout, and TrackValidation_cff::pset.

24 {
25 
26 
27  parameters_ = pset;
28  verbose_ = parameters_.getParameter<bool>("verbose");
29 
30  if(verbose_) cout << ">>> Constructor (PhotonDataCertification) <<<" << endl;
31 
32 }
T getParameter(std::string const &) const
tuple cout
Definition: gather_cfg.py:145
PhotonDataCertification::~PhotonDataCertification ( )

Definition at line 35 of file PhotonDataCertification.cc.

35 {}

Member Function Documentation

void PhotonDataCertification::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 41 of file PhotonDataCertification.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), gather_cfg::cout, MonitorElement::getTH2F(), and DQMStore::IBooker::setCurrentFolder().

41  {
42 
43  using namespace RooFit;
44  if (verbose_) std::cout << ">>> endJob (PhotonDataCertification) <<<" << std::endl;
45 
46  //booking histograms according to naming conventions
47  ibooker.setCurrentFolder("Egamma/EventInfo/");
48  reportSummary_ = ibooker.bookFloat("reportSummary");
49  reportSummaryMap_ = ibooker.book2D("reportSummaryMap","reportSummaryMap",3,0,3,1,0,1);
50 
51  TH2F * reportSummaryMapTH2 = reportSummaryMap_->getTH2F();
52  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1, "EB");
53  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2, "EE");
54  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3, "Total");
55  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1, "InvMassTest");
56 
57  float EBResult = invMassZtest("Egamma/stdPhotonAnalyzer/InvMass/h_02_invMassIsoPhotonsEBarrel",
58  "invMassIsolatedPhotonsEB", igetter);
59 
60  float EEResult = invMassZtest("Egamma/stdPhotonAnalyzer/InvMass/h_03_invMassIsoPhotonsEEndcap",
61  "invMassIsolatedPhotonsEE", igetter);
62 
63  float AllResult = invMassZtest("Egamma/stdPhotonAnalyzer/InvMass/h_01_invMassAllIsolatedPhotons",
64  "invMassAllIsolatedPhotons", igetter);
65 
66  if (verbose_) {
67  std::cout << "EBResult: " << EBResult << std::endl;
68  std::cout << "EEResult: " << EEResult << std::endl;
69  std::cout << "AllResult: " << AllResult << std::endl;
70  }
71 
72  reportSummaryMapTH2->SetBinContent(1, 1, EBResult);
73  reportSummaryMapTH2->SetBinContent(2, 1, EEResult);
74  reportSummaryMapTH2->SetBinContent(3, 1, AllResult);
75  reportSummary_->Fill(AllResult);
76 }
float invMassZtest(std::string path, TString name, DQMStore::IGetter &)
void Fill(long long x)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
tuple cout
Definition: gather_cfg.py:145
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
TH2F * getTH2F(void) const
float PhotonDataCertification::invMassZtest ( std::string  path,
TString  name,
DQMStore::IGetter  
)
private

Definition at line 78 of file PhotonDataCertification.cc.

References funct::abs(), DQMStore::IGetter::get(), MonitorElement::getTH1F(), and FrontierCondition_GT_autoExpress_cfi::test.

79  {
80 
81  float ZMass = 91.2;
82  float ZWidth = 2.5;
83  MonitorElement *TestElem = 0;
84  TestElem = igetter.get(path);
85  if (TestElem == 0) return 0;
86  TH1F *TestHist = TestElem->getTH1F();
87  if (TestHist == 0) return 0;
88  RooRealVar mass("mass","Mass_{2#gamma}", 0, 200,"GeV");
89  RooRealVar mRes("M_{Z}", "Z Mass", ZMass, 70, 110);
90  RooRealVar gamma("#Gamma", "#Gamma", ZWidth, 0, 10.0);
91  RooBreitWigner BreitWigner("BreitWigner", "Breit-Wigner", mass, mRes, gamma);
92  RooDataHist test(name, name, mass, TestHist);
93 
94  BreitWigner.fitTo(test, RooFit::Range(80, 100));
95 
96  if (abs(mRes.getValV() - ZMass) < ZWidth) {
97  return 1.0;
98  } else if (abs(mRes.getValV() - ZMass) < gamma.getValV()) {
99  return 0.9;
100  } else {
101  return 0.0;
102  }
103 }
PixelRecoRange< float > Range
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH1F * getTH1F(void) const

Member Data Documentation

edm::ParameterSet PhotonDataCertification::parameters_
private
MonitorElement* PhotonDataCertification::reportSummary_
private

Definition at line 60 of file PhotonDataCertification.h.

MonitorElement* PhotonDataCertification::reportSummaryMap_
private

Definition at line 61 of file PhotonDataCertification.h.

bool PhotonDataCertification::verbose_
private

Definition at line 59 of file PhotonDataCertification.h.