CMS 3D CMS Logo

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

#include <RPCDaqInfo.h>

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

 RPCDaqInfo (const edm::ParameterSet &)
 
 ~RPCDaqInfo () override
 
- 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 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 ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, 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 myBooker (DQMStore::IBooker &)
 

Private Attributes

MonitorElementdaqDiskFractions [10]
 
MonitorElementDaqFraction_
 
MonitorElementDaqMap_
 
MonitorElementdaqWheelFractions [5]
 
std::pair< int, int > FEDRange_
 
bool init_
 
int numberOfDisks_
 
int NumberOfFeds_
 

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 14 of file RPCDaqInfo.h.

Constructor & Destructor Documentation

RPCDaqInfo::RPCDaqInfo ( const edm::ParameterSet ps)
explicit

Definition at line 11 of file RPCDaqInfo.cc.

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

11  {
12 
13  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
14  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
15 
16  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
17 
18  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
19 
20  init_=false;
21 }
T getUntrackedParameter(std::string const &, T const &) const
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:35
bool init_
Definition: RPCDaqInfo.h:28
int numberOfDisks_
Definition: RPCDaqInfo.h:37
int NumberOfFeds_
Definition: RPCDaqInfo.h:37
RPCDaqInfo::~RPCDaqInfo ( )
override

Definition at line 23 of file RPCDaqInfo.cc.

23 {}

Member Function Documentation

void RPCDaqInfo::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 24 of file RPCDaqInfo.cc.

24 {}
void RPCDaqInfo::dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter  
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 57 of file RPCDaqInfo.cc.

57 {}
void RPCDaqInfo::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  LB,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 25 of file RPCDaqInfo.cc.

References DaqFraction_, FEDRange_, MonitorElement::Fill(), init_, RunInfo::m_fed_in, myBooker(), NumberOfFeds_, and edm::EventSetup::tryToGet().

25  {
26 
27  if(!init_){this->myBooker(ibooker);}
28 
29  if(auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
30 
31  //get fed summary information
33  runInfoRec->get(sumFED);
34  std::vector<int> FedsInIds= sumFED->m_fed_in;
35 
36  int FedCount=0;
37 
38  //loop on all active feds
39  for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
40  int fedID=FedsInIds[fedItr];
41  //make sure fed id is in allowed range
42 
43  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) ++FedCount;
44  }
45 
46  //Fill active fed fraction ME
47  if(NumberOfFeds_>0) DaqFraction_->Fill( FedCount/NumberOfFeds_);
48  else DaqFraction_->Fill(-1);
49 
50  }else{
51  DaqFraction_->Fill(-1);
52  return;
53  }
54 }
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:35
bool init_
Definition: RPCDaqInfo.h:28
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:30
void Fill(long long x)
std::vector< int > m_fed_in
Definition: RunInfo.h:26
void myBooker(DQMStore::IBooker &)
Definition: RPCDaqInfo.cc:60
int NumberOfFeds_
Definition: RPCDaqInfo.h:37
void RPCDaqInfo::myBooker ( DQMStore::IBooker ibooker)
private

Definition at line 60 of file RPCDaqInfo.cc.

References CentralityFilter_cfi::BinLabel, DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), daqDiskFractions, DaqFraction_, DaqMap_, daqWheelFractions, MonitorElement::Fill(), mps_fire::i, init_, MessageLogger_cfi::limit, numberOfDisks_, PFRecoTauDiscriminationByIsolation_cfi::offset, MonitorElement::setBinLabel(), and DQMStore::IBooker::setCurrentFolder().

Referenced by dqmEndLuminosityBlock().

60  {
61 
62  //fraction of alive FEDs
63  ibooker.setCurrentFolder("RPC/EventInfo/DAQContents");
64 
65  int limit = numberOfDisks_;
66  if(numberOfDisks_ < 2) limit = 2;
67 
68  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
69  if (i>-3 && i<3){//wheels
70  std::stringstream streams;
71  streams << "RPC_Wheel" << i;
72  daqWheelFractions[i+2] = ibooker.bookFloat(streams.str());
73  daqWheelFractions[i+2]->Fill(-1);
74  }
75 
76  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
77 
78  int offset = numberOfDisks_;
79  if (i>0) offset --; //used to skip case equale to zero
80 
81  std::stringstream streams;
82  streams << "RPC_Disk" << i;
83  daqDiskFractions[i+2] = ibooker.bookFloat(streams.str());
84  daqDiskFractions[i+2]->Fill(-1);
85  }
86 
87 
88  //daq summary for RPCs
89  ibooker.setCurrentFolder("RPC/EventInfo");
90 
91  DaqFraction_ = ibooker.bookFloat("DAQSummary");
92 
93  DaqMap_ = ibooker.book2D( "DAQSummaryMap","RPC DAQ Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
94 
95  //customize the 2d histo
96  std::stringstream BinLabel;
97  for (int i= 1 ; i<=15; i++){
98  BinLabel.str("");
99  if(i<13){
100  BinLabel<<"Sec"<<i;
101  DaqMap_->setBinLabel(i,BinLabel.str(),2);
102  }
103 
104  BinLabel.str("");
105  if(i<5)
106  BinLabel<<"Disk"<<i-5;
107  else if(i>11)
108  BinLabel<<"Disk"<<i-11;
109  else if(i==11 || i==5)
110  BinLabel.str("");
111  else
112  BinLabel<<"Wheel"<<i-8;
113 
114  DaqMap_->setBinLabel(i,BinLabel.str(),1);
115  }
116 
117  init_=true;
118 
119 }
MonitorElement * daqDiskFractions[10]
Definition: RPCDaqInfo.h:33
bool init_
Definition: RPCDaqInfo.h:28
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:30
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 * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * daqWheelFractions[5]
Definition: RPCDaqInfo.h:32
MonitorElement * DaqMap_
Definition: RPCDaqInfo.h:31
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
int numberOfDisks_
Definition: RPCDaqInfo.h:37

Member Data Documentation

MonitorElement* RPCDaqInfo::daqDiskFractions[10]
private

Definition at line 33 of file RPCDaqInfo.h.

Referenced by myBooker().

MonitorElement* RPCDaqInfo::DaqFraction_
private

Definition at line 30 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), and myBooker().

MonitorElement* RPCDaqInfo::DaqMap_
private

Definition at line 31 of file RPCDaqInfo.h.

Referenced by myBooker().

MonitorElement* RPCDaqInfo::daqWheelFractions[5]
private

Definition at line 32 of file RPCDaqInfo.h.

Referenced by myBooker().

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

Definition at line 35 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), and RPCDaqInfo().

bool RPCDaqInfo::init_
private

Definition at line 28 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), myBooker(), and RPCDaqInfo().

int RPCDaqInfo::numberOfDisks_
private

Definition at line 37 of file RPCDaqInfo.h.

Referenced by myBooker(), and RPCDaqInfo().

int RPCDaqInfo::NumberOfFeds_
private

Definition at line 37 of file RPCDaqInfo.h.

Referenced by dqmEndLuminosityBlock(), and RPCDaqInfo().