CMS 3D CMS Logo

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

#include <RPCDataCertification.h>

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

 RPCDataCertification (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~RPCDataCertification () 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
 
ESProxyIndex const * esGetTokenIndices (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::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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 Member Functions

void checkFED (edm::EventSetup const &)
 
void myBooker (DQMStore::IBooker &)
 

Private Attributes

MonitorElementcertDiskFractions [10]
 
MonitorElementCertMap_
 
MonitorElementcertWheelFractions [5]
 
double defaultValue_
 
std::pair< int, int > FEDRange_
 
bool init_
 
int numberOfDisks_
 
int NumberOfFeds_
 
bool offlineDQM_
 
MonitorElementtotalCertFraction
 

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 10 of file RPCDataCertification.h.

Constructor & Destructor Documentation

RPCDataCertification::RPCDataCertification ( const edm::ParameterSet pset)

Constructor.

Definition at line 15 of file RPCDataCertification.cc.

References defaultValue_, FEDRange_, edm::ParameterSet::getUntrackedParameter(), init_, numberOfDisks_, NumberOfFeds_, and offlineDQM_.

15  {
16 
17  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
18  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
19  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
20  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
21  offlineDQM_ = ps.getUntrackedParameter<bool> ("OfflineDQM",true);
22 
23  init_= false;
24  defaultValue_=1.;
25 }
std::pair< int, int > FEDRange_
RPCDataCertification::~RPCDataCertification ( )
override

Destructor.

Definition at line 27 of file RPCDataCertification.cc.

27 {}

Member Function Documentation

void RPCDataCertification::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 29 of file RPCDataCertification.cc.

29 {}
void RPCDataCertification::checkFED ( edm::EventSetup const &  setup)
private

Definition at line 49 of file RPCDataCertification.cc.

References defaultValue_, f, FEDRange_, RemoveAddSevLevel::flag, init_, RunInfo::m_fed_in, and edm::EventSetup::tryToGet().

Referenced by dqmEndLuminosityBlock().

49  {
50  double defaultValue = 1.;
51 
52  if(auto runInfoRec = setup.tryToGet<RunInfoRcd>()) {
53  defaultValue = -1;
54  //get fed summary information
56  runInfoRec->get(sumFED);
57  std::vector<int> FedsInIds= sumFED->m_fed_in;
58  unsigned int f = 0;
59  bool flag = false;
60  while(!flag && f < FedsInIds.size()) {
61  int fedID=FedsInIds[f];
62  //make sure fed id is in allowed range
63  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
64  defaultValue = 1;
65  flag = true;
66  }
67  f++;
68  }
69  }
70 
71  defaultValue_ = defaultValue;
72 
73  init_= true;
74 
75 }
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
std::pair< int, int > FEDRange_
std::vector< int > m_fed_in
Definition: RunInfo.h:26
double f[11][100]
void RPCDataCertification::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 42 of file RPCDataCertification.cc.

References myBooker(), and offlineDQM_.

42  {
43 
44  if(offlineDQM_){ this->myBooker(ibooker); }
45 
46 }
void myBooker(DQMStore::IBooker &)
void RPCDataCertification::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  LB,
edm::EventSetup const &  setup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 31 of file RPCDataCertification.cc.

References checkFED(), init_, myBooker(), and offlineDQM_.

32  {
33 
34  if(!init_){
35 
36  this->checkFED(setup);
37 
38  if(!offlineDQM_){ this->myBooker(ibooker); }
39  }
40 }
void myBooker(DQMStore::IBooker &)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
void checkFED(edm::EventSetup const &)
void RPCDataCertification::myBooker ( DQMStore::IBooker ibooker)
private

Definition at line 78 of file RPCDataCertification.cc.

References CentralityFilter_cfi::BinLabel, DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), certDiskFractions, CertMap_, certWheelFractions, defaultValue_, MonitorElement::Fill(), mps_fire::i, MessageLogger_cfi::limit, numberOfDisks_, PFRecoTauDiscriminationByIsolation_cfi::offset, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and totalCertFraction.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

78  {
79 
80  ibooker.setCurrentFolder("RPC/EventInfo");
81  // global fraction
82  totalCertFraction = ibooker.bookFloat("CertificationSummary");
84 
85  CertMap_ = ibooker.book2D( "CertificationSummaryMap","RPC Certification Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
86 
87  //customize the 2d histo
88  std::stringstream BinLabel;
89  for (int i= 1 ; i<13; i++){
90  BinLabel.str("");
91  BinLabel<<"Sec"<<i;
92  CertMap_->setBinLabel(i,BinLabel.str(),2);
93  }
94 
95  for(int i = -2 ; i <=2; i++){
96  BinLabel.str("");
97  BinLabel<<"Wheel"<<i;
98  CertMap_->setBinLabel(i+8,BinLabel.str(),1);
99  }
100 
101 
102  for(int i = 1; i<=numberOfDisks_; i++){
103  BinLabel.str("");
104  BinLabel<<"Disk"<<i;
105  CertMap_->setBinLabel((i+11),BinLabel.str(),1);
106  BinLabel.str("");
107  BinLabel<<"Disk"<<-i;
108  CertMap_->setBinLabel((-i+5),BinLabel.str(),1);
109  }
110  //fill the histo with "1" --- just for the moment
111  for(int i=1; i<=15; i++){
112  for (int j=1; j<=12; j++ ){
113  if(i==5 || i==11 || (j>6 && (i<6 || i>10)))
114  CertMap_->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
115  else
117  }
118  }
119 
120 
121  if(numberOfDisks_ < 4){
122  for (int j=1; j<=12; j++ ){
123  CertMap_->setBinContent(1,j,-1);//bins that not correspond to subdetector parts
124  CertMap_->setBinContent(15,j,-1);
125  }
126  }
127  // book the ME
128  ibooker.setCurrentFolder("RPC/EventInfo/CertificationContents");
129 
130  int limit = numberOfDisks_;
131  if(numberOfDisks_ < 2) limit = 2;
132 
133 
134  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
135  if (i>-3 && i<3){//wheels
136  std::stringstream streams;
137  streams << "RPC_Wheel" << i;
138  certWheelFractions[i+2] = ibooker.bookFloat(streams.str());
140  }
141 
142  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
143 
144  int offset = numberOfDisks_;
145  if (i>0) offset --; //used to skip case equale to zero
146  std::stringstream streams;
147  streams << "RPC_Disk" << i;
148  certDiskFractions[i+2] = ibooker.bookFloat(streams.str());
150  }
151 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * certWheelFractions[5]
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)
MonitorElement * CertMap_
MonitorElement * totalCertFraction
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * certDiskFractions[10]
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105

Member Data Documentation

MonitorElement* RPCDataCertification::certDiskFractions[10]
private

Definition at line 32 of file RPCDataCertification.h.

Referenced by myBooker().

MonitorElement* RPCDataCertification::CertMap_
private

Definition at line 29 of file RPCDataCertification.h.

Referenced by myBooker().

MonitorElement* RPCDataCertification::certWheelFractions[5]
private

Definition at line 31 of file RPCDataCertification.h.

Referenced by myBooker().

double RPCDataCertification::defaultValue_
private

Definition at line 37 of file RPCDataCertification.h.

Referenced by checkFED(), myBooker(), and RPCDataCertification().

std::pair<int, int> RPCDataCertification::FEDRange_
private

Definition at line 33 of file RPCDataCertification.h.

Referenced by checkFED(), and RPCDataCertification().

bool RPCDataCertification::init_
private

Definition at line 36 of file RPCDataCertification.h.

Referenced by checkFED(), dqmEndLuminosityBlock(), and RPCDataCertification().

int RPCDataCertification::numberOfDisks_
private

Definition at line 34 of file RPCDataCertification.h.

Referenced by myBooker(), and RPCDataCertification().

int RPCDataCertification::NumberOfFeds_
private

Definition at line 35 of file RPCDataCertification.h.

Referenced by RPCDataCertification().

bool RPCDataCertification::offlineDQM_
private

Definition at line 36 of file RPCDataCertification.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and RPCDataCertification().

MonitorElement* RPCDataCertification::totalCertFraction
private

Definition at line 30 of file RPCDataCertification.h.

Referenced by myBooker().