CMS 3D CMS Logo

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

#include <RPCEfficiencyShiftHisto.h>

Inheritance diagram for RPCEfficiencyShiftHisto:
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

 RPCEfficiencyShiftHisto (const edm::ParameterSet &iConfig)
 Constructor. More...
 
 ~RPCEfficiencyShiftHisto () override
 Destructor. More...
 
- 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 ()
 
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)
 

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

MonitorElementEffBarrelRoll
 
int effCut_
 
MonitorElementEffEndcapMinusRoll
 
MonitorElementEffEndcapPlusRoll
 
std::string globalFolder_
 
int numberOfDisks_
 
MonitorElementRollPercentage
 

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 Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 19 of file RPCEfficiencyShiftHisto.h.

Constructor & Destructor Documentation

RPCEfficiencyShiftHisto::RPCEfficiencyShiftHisto ( const edm::ParameterSet iConfig)

Constructor.

Definition at line 24 of file RPCEfficiencyShiftHisto.cc.

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

24  {
25 
26  globalFolder_ = ps.getUntrackedParameter<std::string>("GlobalFolder", "RPC/RPCEfficiency/");
27  effCut_= ps.getUntrackedParameter<int>("EffCut", 90);
28  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
29 }
RPCEfficiencyShiftHisto::~RPCEfficiencyShiftHisto ( )
override

Destructor.

Definition at line 32 of file RPCEfficiencyShiftHisto.cc.

32 { }

Member Function Documentation

void RPCEfficiencyShiftHisto::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 34 of file RPCEfficiencyShiftHisto.cc.

34 {}
void RPCEfficiencyShiftHisto::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 38 of file RPCEfficiencyShiftHisto.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), edmIntegrityCheck::d, EffBarrelRoll, effCut_, EffEndcapMinusRoll, EffEndcapPlusRoll, MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), globalFolder_, numberOfDisks_, alignCSCRings::r, RollPercentage, alignCSCRings::s, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), w, x, and y.

38  {
39 
41  EffBarrelRoll = ibooker.book1D("EffBarrelRoll", "Barrel Efficiency",101,-0.5, 100.5);
42  EffEndcapPlusRoll = ibooker.book1D("EffEndcapPlusRoll", "Endcap + Efficiency",101,-0.5, 100.5);
43  EffEndcapMinusRoll = ibooker.book1D("EffEndcapMinusRoll", "Endcap - Efficiency",101,-0.5, 100.5);
44  RollPercentage = ibooker.book2D("RollPercentage", "RollPercentage",1,0.,1.,3,0.,3.);
45 
46  RollPercentage->setBinLabel(1,"%",1);
47  RollPercentage->setBinLabel(1,"E+",2);
48  RollPercentage->setBinLabel(2,"B",2);
49  RollPercentage->setBinLabel(3,"E-",2);
50 
51 
52  std::stringstream meName;
53  MonitorElement * myMe;
54 
55  meName.str("");
56  meName<<globalFolder_;
57 
58  //Barrel
59 
60  int entriesBarrel = 0;
61  int entriesBarrelBeyondEff = 0;
62  float percBarrel = 0;
63 
64  for(int w = -2 ; w<3; w++){
65 
66  meName.str("");
67  meName<<globalFolder_<<"Efficiency_Roll_vs_Sector_Wheel_"<<w;
68 
69  myMe = igetter.get(meName.str());
70 
71  if(myMe){
72  for(int s = 1; s <= myMe->getNbinsX(); s++){
73  for(int r = 1;r <= myMe->getNbinsY(); r++){
74 
75  double effBarrel = myMe->getBinContent(s,r);
76 
77  if(effBarrel >= 0){//5
78 
79  if (EffBarrelRoll) EffBarrelRoll->Fill(effBarrel);
80  entriesBarrel++;
81 
82  if(effBarrel >= effCut_) entriesBarrelBeyondEff++;
83  }
84  }
85  }
86  }
87  }
88 
89  if(entriesBarrel != 0){
90  percBarrel = 100*entriesBarrelBeyondEff/entriesBarrel;
91  if(RollPercentage)RollPercentage->setBinContent(1,2,percBarrel);}
92 
93 
94  //EndcapMinus
95 
96  int entriesEndcapMinus = 0;
97  int entriesEndcapMinusBeyondEff = 0;
98  float percEndcapMinus = 0;
99  int entriesEndcapPlus = 0;
100  int entriesEndcapPlusBeyondEff = 0;
101  float percEndcapPlus = 0;
102  for(int d = -numberOfDisks_ ; d <= numberOfDisks_; d++){
103 
104  if(d == 0) continue;
105 
106  meName.str("");
107  meName<<globalFolder_<<"Efficiency_Roll_vs_Segment_Disk_"<<d;
108  myMe = igetter.get(meName.str());
109 
110 
111  if(myMe){
112 
113  for (int x = 1 ;x <= myMe->getNbinsX();x++){
114  for(int y = 1;y<=myMe->getNbinsY(); y++){
115 
116  double effEndcap = myMe->getBinContent(x,y);
117 
118  if(d<0 ){
119  entriesEndcapMinus++;
121  if(effEndcap >= effCut_) entriesEndcapMinusBeyondEff++;
122  }else {
123  entriesEndcapPlus++;
125  if(effEndcap >= effCut_) entriesEndcapPlusBeyondEff++;
126  }
127  }
128  }
129  }
130  }
131 
132 
133  if(entriesEndcapMinus != 0){
134  percEndcapMinus = 100*entriesEndcapMinusBeyondEff/entriesEndcapMinus;
135  if( RollPercentage) RollPercentage->setBinContent(1,3,percEndcapMinus);}
136 
137 
138  if(entriesEndcapPlus != 0){
139  percEndcapPlus = 100*entriesEndcapPlusBeyondEff/entriesEndcapPlus;
140  if(RollPercentage) RollPercentage->setBinContent(1,1,percEndcapPlus);
141  }
142 
143 
144 }
void setBinContent(int binx, double content)
set content of bin (1-D)
const double w
Definition: UKUtility.cc:23
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)
void Fill(long long x)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
int getNbinsY() const
get # of bins in Y-axis
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX() const
get # of bins in X-axis
void RPCEfficiencyShiftHisto::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 36 of file RPCEfficiencyShiftHisto.cc.

36 {}

Member Data Documentation

MonitorElement* RPCEfficiencyShiftHisto::EffBarrelRoll
private

Definition at line 37 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().

int RPCEfficiencyShiftHisto::effCut_
private

Definition at line 43 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob(), and RPCEfficiencyShiftHisto().

MonitorElement* RPCEfficiencyShiftHisto::EffEndcapMinusRoll
private

Definition at line 39 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().

MonitorElement* RPCEfficiencyShiftHisto::EffEndcapPlusRoll
private

Definition at line 38 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().

std::string RPCEfficiencyShiftHisto::globalFolder_
private

Definition at line 45 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob(), and RPCEfficiencyShiftHisto().

int RPCEfficiencyShiftHisto::numberOfDisks_
private

Definition at line 42 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob(), and RPCEfficiencyShiftHisto().

MonitorElement* RPCEfficiencyShiftHisto::RollPercentage
private

Definition at line 40 of file RPCEfficiencyShiftHisto.h.

Referenced by dqmEndJob().