CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
RPCEfficiencyPerRingLayer Class Reference

#include <RPCEfficiencyPerRingLayer.h>

Inheritance diagram for RPCEfficiencyPerRingLayer:
DQMEDHarvester edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RPCEfficiencyPerRingLayer (const edm::ParameterSet &iConfig)
 Constructor. More...
 
 ~RPCEfficiencyPerRingLayer () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester (void)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, edm::EventSetup const &) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () 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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginJob () override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- 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)
 

Private Attributes

MonitorElementEfficiencyPerLayer
 
MonitorElementEfficiencyPerRing
 
std::string globalFolder_
 
int innermostRings_
 
int numberOfDisks_
 

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)
 

Detailed Description

Definition at line 10 of file RPCEfficiencyPerRingLayer.h.

Constructor & Destructor Documentation

RPCEfficiencyPerRingLayer::RPCEfficiencyPerRingLayer ( const edm::ParameterSet iConfig)

Constructor.

Definition at line 13 of file RPCEfficiencyPerRingLayer.cc.

References edm::ParameterSet::getUntrackedParameter(), globalFolder_, innermostRings_, numberOfDisks_, and AlCaHLTBitMon_QueryRunRegistry::string.

13  {
14 
15  globalFolder_ = ps.getUntrackedParameter<std::string>("GlobalFolder", "RPC/RPCEfficiency/");
16  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
17  innermostRings_ = ps.getUntrackedParameter<int>("NumberOfInnermostEndcapRings", 2);
18 
19 }
RPCEfficiencyPerRingLayer::~RPCEfficiencyPerRingLayer ( )
override

Destructor.

Definition at line 22 of file RPCEfficiencyPerRingLayer.cc.

22 { }

Member Function Documentation

void RPCEfficiencyPerRingLayer::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 24 of file RPCEfficiencyPerRingLayer.cc.

24 {}
void RPCEfficiencyPerRingLayer::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 28 of file RPCEfficiencyPerRingLayer.cc.

References funct::abs(), DQMStore::IBooker::book1D(), EfficiencyPerLayer, EfficiencyPerRing, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getTH1(), globalFolder_, mps_fire::i, innermostRings_, gen::k, numberOfDisks_, MonitorElement::setBinContent(), MonitorElement::setBinError(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and mathSSE::sqrt().

28  {
29 
30 
32  EfficiencyPerRing = ibooker.book1D("EfficiencyPerRing","Efficiency per Ring",12,0.5,12.5);
33  EfficiencyPerLayer = ibooker.book1D("EfficiencyPerLayer","Efficiency per Layer",6,0.5,6.5);
34 
35 
36 
37  std::stringstream meName1;
38  MonitorElement * myMe1;
39 
40  std::stringstream meName2;
41  MonitorElement * myMe2;
42 
43  std::stringstream binName;
44  binName.str("");
45 
46  meName1.str("");
47  meName1<<globalFolder_;
48 
49  meName2.str("");
50  meName2<<globalFolder_;
51 
52  int k = 0;
53 
54  //EfficiencyPerRing
55 
56  for(int i=(-1*numberOfDisks_ ); i<=numberOfDisks_ ; i++){
57  if(i == 0) continue;
58  for(int j=innermostRings_; j<=3; j++){
59  meName1.str("");
60  meName2.str("");
61  if(i < 0){
62  meName1<<globalFolder_<<"Azimutal/ExGregDistroDm"<<abs(i)<<"R"<<j;
63  meName2<<globalFolder_<<"Azimutal/OcGregDistroDm"<<abs(i)<<"R"<<j;
64  //std::cout<<meName1.str()<<std::endl;
65  //std::cout<<meName2.str()<<std::endl;
66  binName.str("");
67  binName<<"RE-"<<i<<"/"<<j;
68  k++;}
69  else if(i >0){
70  meName1<<globalFolder_<<"Azimutal/ExGregDistroD"<<abs(i)<<"R"<<j;
71  meName2<<globalFolder_<<"Azimutal/OcGregDistroD"<<abs(i)<<"R"<<j;
72  //std::cout<<meName1.str()<<std::endl;
73  //std::cout<<meName2.str()<<std::endl;
74  binName.str("");
75  binName<<"RE+"<<abs(i)<<"/"<<j;
76  k++;}
77 
78  myMe1 = nullptr; myMe1 = nullptr;
79  myMe1 = igetter.get(meName1.str());
80  myMe2 = igetter.get(meName2.str());
81 
82  if(myMe1 && myMe2){
83  TH1 * histo1 = myMe1->getTH1();
84  TH1 * histo2 = myMe2->getTH1();
85 
86  int exg = histo1->Integral();
87  int obg = histo2->Integral();
88  double eff = 0;
89  double err = 0;
90  if(exg != 0){
91  eff = (double)obg/(double)exg;
92  err = sqrt(eff*(1-eff)/(double)exg);}
93 
94  if(k%2 != 0 && k < 7){
96  EfficiencyPerRing->setBinError(k+1, err);
97  EfficiencyPerRing->setBinLabel(k+1, binName.str());}
98  else if(k%2 == 0 && k < 7){
100  EfficiencyPerRing->setBinError(k-1, err);
101  EfficiencyPerRing->setBinLabel(k-1, binName.str());}
102  else if(k >= 7){
105  EfficiencyPerRing->setBinLabel(k, binName.str());}
106  }
107  }
108  }
109 
110  //EfficiencyPerLayer
111 
112  for(int i=1; i<=6; i++){
113 
114  int Exp = 0;
115  int Obs = 0;
116  double eff = 0;
117  double err = 0;
118 
119  for(int j=-2; j<=2; j++){
120  meName1.str("");
121  meName2.str("");
122  if(j < 0){
123  meName1<<globalFolder_<<"BarrelPerLayer/ExpLayerWm"<<abs(j);
124  meName2<<globalFolder_<<"BarrelPerLayer/ObsLayerWm"<<abs(j);}
125  else{
126  meName1<<globalFolder_<<"BarrelPerLayer/ExpLayerW"<<j;
127  meName2<<globalFolder_<<"BarrelPerLayer/ObsLayerW"<<j;}
128  myMe1 = nullptr; myMe1 = nullptr;
129  myMe1 = igetter.get(meName1.str());
130  myMe2 = igetter.get(meName2.str());
131  if(myMe1 && myMe2){
132  Exp += myMe1->getBinContent(i);
133  Obs += myMe2->getBinContent(i);
134  }
135  }
136 
137  if(Exp != 0){
138  eff = (double)Obs/(double)Exp;
139  err = sqrt(eff*(1-eff)/(double)Exp);}
142  binName.str("");
143  binName<<"Layer "<<i;
144  EfficiencyPerLayer->setBinLabel(i, binName.str());
145 
146  }
147 
148 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
T sqrt(T t)
Definition: SSEVec.h:18
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH1 * getTH1(void) const
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
int k[5][pyjets_maxn]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
double getBinContent(int binx) const
get content of bin (1-D)
void RPCEfficiencyPerRingLayer::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 26 of file RPCEfficiencyPerRingLayer.cc.

26 {}

Member Data Documentation

MonitorElement* RPCEfficiencyPerRingLayer::EfficiencyPerLayer
private

Definition at line 30 of file RPCEfficiencyPerRingLayer.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencyPerRingLayer::EfficiencyPerRing
private

Definition at line 29 of file RPCEfficiencyPerRingLayer.h.

Referenced by dqmEndJob().

std::string RPCEfficiencyPerRingLayer::globalFolder_
private

Definition at line 35 of file RPCEfficiencyPerRingLayer.h.

Referenced by dqmEndJob(), and RPCEfficiencyPerRingLayer().

int RPCEfficiencyPerRingLayer::innermostRings_
private

Definition at line 33 of file RPCEfficiencyPerRingLayer.h.

Referenced by dqmEndJob(), and RPCEfficiencyPerRingLayer().

int RPCEfficiencyPerRingLayer::numberOfDisks_
private

Definition at line 32 of file RPCEfficiencyPerRingLayer.h.

Referenced by dqmEndJob(), and RPCEfficiencyPerRingLayer().