CMS 3D CMS Logo

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::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
 PhotonDataCertification (const edm::ParameterSet &pset)
 
 ~PhotonDataCertification () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
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)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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 muonDTDigis_cfi::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
PhotonDataCertification::~PhotonDataCertification ( )
override

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(std::string const &fullpath)
Definition: DQMStore.cc:268
TH2F * getTH2F() const
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
float PhotonDataCertification::invMassZtest ( std::string  path,
TString  name,
DQMStore::IGetter  
)
private

Definition at line 78 of file PhotonDataCertification.cc.

References funct::abs(), CustomPhysics_cfi::gamma, DQMStore::IGetter::get(), MonitorElement::getTH1F(), instance, ResonanceBuilder::mass, PFTauMVAInputDiscriminatorTranslator_cfi::test, and dqm::qstatus::WARNING.

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

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.