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::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > 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 beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
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 DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 43 of file PhotonDataCertification.h.

Constructor & Destructor Documentation

◆ PhotonDataCertification()

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

Definition at line 21 of file PhotonDataCertification.cc.

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

23 {
24  parameters_ = pset;
25  verbose_ = parameters_.getParameter<bool>("verbose");
26 
27  if (verbose_)
28  cout << ">>> Constructor (PhotonDataCertification) <<<" << endl;
29 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~PhotonDataCertification()

PhotonDataCertification::~PhotonDataCertification ( )
override

Definition at line 31 of file PhotonDataCertification.cc.

31 {}

Member Function Documentation

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 34 of file PhotonDataCertification.cc.

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookFloat(), gather_cfg::cout, dqm::legacy::MonitorElement::getTH2F(), and dqm::implementation::NavigatorBase::setCurrentFolder().

34  {
35  using namespace RooFit;
36  if (verbose_)
37  std::cout << ">>> endJob (PhotonDataCertification) <<<" << std::endl;
38 
39  //booking histograms according to naming conventions
40  ibooker.setCurrentFolder("Egamma/EventInfo/");
41  reportSummary_ = ibooker.bookFloat("reportSummary");
42  reportSummaryMap_ = ibooker.book2D("reportSummaryMap", "reportSummaryMap", 3, 0, 3, 1, 0, 1);
43 
44  TH2F* reportSummaryMapTH2 = reportSummaryMap_->getTH2F();
45  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1, "EB");
46  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2, "EE");
47  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3, "Total");
48  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1, "InvMassTest");
49 
50  float EBResult = invMassZtest(
51  "Egamma/stdPhotonAnalyzer/InvMass/h_02_invMassIsoPhotonsEBarrel", "invMassIsolatedPhotonsEB", igetter);
52 
53  float EEResult = invMassZtest(
54  "Egamma/stdPhotonAnalyzer/InvMass/h_03_invMassIsoPhotonsEEndcap", "invMassIsolatedPhotonsEE", igetter);
55 
56  float AllResult = invMassZtest(
57  "Egamma/stdPhotonAnalyzer/InvMass/h_01_invMassAllIsolatedPhotons", "invMassAllIsolatedPhotons", igetter);
58 
59  if (verbose_) {
60  std::cout << "EBResult: " << EBResult << std::endl;
61  std::cout << "EEResult: " << EEResult << std::endl;
62  std::cout << "AllResult: " << AllResult << std::endl;
63  }
64 
65  reportSummaryMapTH2->SetBinContent(1, 1, EBResult);
66  reportSummaryMapTH2->SetBinContent(2, 1, EEResult);
67  reportSummaryMapTH2->SetBinContent(3, 1, AllResult);
68  reportSummary_->Fill(AllResult);
69 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
float invMassZtest(std::string path, TString name, DQMStore::IGetter &)
void Fill(long long x)
virtual TH2F * getTH2F() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221

◆ invMassZtest()

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

Definition at line 71 of file PhotonDataCertification.cc.

References funct::abs(), CustomPhysics_cfi::gamma, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), instance, EgHLTOffHistBins_cfi::mass, Skims_PA_cff::name, castor_dqm_sourceclient_file_cfg::path, ctpps_dqm_sourceclient-live_cfg::test, remoteMonitoring_LASER_era2018_cfg::WARNING, and ExhumeParameters_cfi::ZMass.

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

Member Data Documentation

◆ parameters_

edm::ParameterSet PhotonDataCertification::parameters_
private

◆ reportSummary_

MonitorElement* PhotonDataCertification::reportSummary_
private

Definition at line 54 of file PhotonDataCertification.h.

◆ reportSummaryMap_

MonitorElement* PhotonDataCertification::reportSummaryMap_
private

Definition at line 55 of file PhotonDataCertification.h.

◆ verbose_

bool PhotonDataCertification::verbose_
private

Definition at line 53 of file PhotonDataCertification.h.