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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 PhotonDataCertification (const edm::ParameterSet &pset)
 
 ~PhotonDataCertification ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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)
 

Private Attributes

DQMStoredbe_
 
edm::ParameterSet parameters_
 
MonitorElementreportSummary_
 
MonitorElementreportSummaryMap_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 edm::ParameterSet::getParameter().

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

Definition at line 35 of file PhotonDataCertification.cc.

36 {
37 }

Member Function Documentation

void PhotonDataCertification::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 46 of file PhotonDataCertification.cc.

47 {
48  //if(verbose_) std::cout << ">>> Analyze (PhotonDataCertification) <<<" << std::endl;
49 
50 }
void PhotonDataCertification::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file PhotonDataCertification.cc.

References dbe_, and cppFunctionSkipper::operator.

55 {
56  dbe_ = 0;
58  dbe_->setVerbose(0);
59 }
void PhotonDataCertification::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file PhotonDataCertification.cc.

References gather_cfg::cout, and edm::RunBase::id().

70 {
71 
72  if(verbose_) std::cout << ">>> BeginRun (PhotonDataCertification) <<<" << std::endl;
73  if(verbose_) std::cout << ">>> "<< run.id() << std::endl;
74 
75 }
RunID const & id() const
Definition: RunBase.h:41
tuple cout
Definition: gather_cfg.py:121
void PhotonDataCertification::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 63 of file PhotonDataCertification.cc.

64 {
65 }
void PhotonDataCertification::endRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file PhotonDataCertification.cc.

References gather_cfg::cout, and dbe_.

80 {
81  using namespace RooFit;
82  if(verbose_) std::cout << ">>> EndRun (PhotonDataCertification) <<<" << std::endl;
83  if(!dbe_) return;
84 
85  //booking histograms according to naming conventions
86  dbe_->setCurrentFolder("Egamma/EventInfo/");
87  reportSummary_ = dbe_->bookFloat("reportSummary");
88  reportSummaryMap_ = dbe_->book2D("reportSummaryMap","reportSummaryMap",3,0,3,1,0,1);
89 
90  TH2F * reportSummaryMapTH2 = reportSummaryMap_->getTH2F();
91  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1,"EB");
92  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2,"EE");
93  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3,"Total");
94  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1,"InvMassTest");
95 
96  float EBResult = invMassZtest("Egamma/PhotonAnalyzer/InvMass/h_02_invMassIsoPhotonsEBarrel","invMassIsolatedPhotonsEB");
97  float EEResult = invMassZtest("Egamma/PhotonAnalyzer/InvMass/h_03_invMassIsoPhotonsEEndcap","invMassIsolatedPhotonsEE");
98  float AllResult = invMassZtest("Egamma/PhotonAnalyzer/InvMass/h_01_invMassAllIsolatedPhotons","invMassAllIsolatedPhotons");
99 
100  if(verbose_){
101  std::cout << "EBResult: " << EBResult << std::endl;
102  std::cout << "EEResult: " << EEResult << std::endl;
103  std::cout << "AllResult: " << AllResult << std::endl;
104  }
105 
106  reportSummaryMapTH2->SetBinContent(1, 1, EBResult);
107  reportSummaryMapTH2->SetBinContent(2, 1, EEResult);
108  reportSummaryMapTH2->SetBinContent(3, 1, AllResult);
109  reportSummary_->Fill(AllResult);
110 
111 }
void Fill(long long x)
float invMassZtest(std::string path, TString name)
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
float PhotonDataCertification::invMassZtest ( std::string  path,
TString  name 
)
private

Definition at line 113 of file PhotonDataCertification.cc.

References funct::abs(), dbe_, MonitorElement::getTH1F(), and run_regression::test.

113  {
114  float ZMass = 91.2;
115  float ZWidth = 2.5;
116  MonitorElement *TestElem=0;
117  TestElem = dbe_->get(path);
118  if(TestElem==0) return 0;
119  TH1F *TestHist = TestElem->getTH1F();
120  if(TestHist==0) return 0;
121  RooRealVar mass("mass","Mass_{2#gamma}", 0, 200,"GeV");
122  RooRealVar mRes("M_{Z}", "Z Mass", ZMass, 70, 110);
123  RooRealVar gamma("#Gamma", "#Gamma", ZWidth, 0, 10.0);
124  RooBreitWigner BreitWigner("BreitWigner","Breit-Wigner",mass,mRes,gamma);
125  RooDataHist test(name, name, mass, TestHist);
126 
127  BreitWigner.fitTo(test, RooFit::Range(80,100));
128 
129  if(abs(mRes.getValV() - ZMass) < ZWidth){return 1.0;}
130  else if(abs(mRes.getValV() - ZMass) < gamma.getValV()){return 0.9;}
131  else{return 0.0;}
132 
133 }
tuple path
else: Piece not in the list, fine.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PixelRecoRange< float > Range
TH1F * getTH1F(void) const

Member Data Documentation

DQMStore* PhotonDataCertification::dbe_
private

Definition at line 63 of file PhotonDataCertification.h.

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

Definition at line 67 of file PhotonDataCertification.h.

MonitorElement* PhotonDataCertification::reportSummaryMap_
private

Definition at line 68 of file PhotonDataCertification.h.

bool PhotonDataCertification::verbose_
private

Definition at line 66 of file PhotonDataCertification.h.