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
RPCDaqInfo Class Reference

#include <RPCDaqInfo.h>

Inheritance diagram for RPCDaqInfo:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 RPCDaqInfo (const edm::ParameterSet &)
 
 ~RPCDaqInfo ()
 
- 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

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 

Private Attributes

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

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

Constructor & Destructor Documentation

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

Definition at line 7 of file RPCDaqInfo.cc.

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

7  {
8 
9  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
10  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
11 
12  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
13 
14  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
15 }
T getUntrackedParameter(std::string const &, T const &) const
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:45
int numberOfDisks_
Definition: RPCDaqInfo.h:47
int NumberOfFeds_
Definition: RPCDaqInfo.h:47
RPCDaqInfo::~RPCDaqInfo ( )

Definition at line 17 of file RPCDaqInfo.cc.

17 {}

Member Function Documentation

void RPCDaqInfo::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 121 of file RPCDaqInfo.cc.

121 {}
void RPCDaqInfo::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file RPCDaqInfo.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), daqDiskFractions, DaqFraction_, DaqMap_, daqWheelFractions, dbe_, MonitorElement::Fill(), i, MessageLogger_cff::limit, numberOfDisks_, evf::evtn::offset(), cppFunctionSkipper::operator, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and hcal_dqm_sourceclient-file_cfg::streams.

55  {
56 
57  dbe_ = 0;
59 
60  //fraction of alive FEDs
61  dbe_->setCurrentFolder("RPC/EventInfo/DAQContents");
62 
63  int limit = numberOfDisks_;
64  if(numberOfDisks_ < 2) limit = 2;
65 
66  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
67  if (i>-3 && i<3){//wheels
68  std::stringstream streams;
69  streams << "RPC_Wheel" << i;
70  daqWheelFractions[i+2] = dbe_->bookFloat(streams.str());
71  daqWheelFractions[i+2]->Fill(-1);
72  }
73 
74  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
75 
76  int offset = numberOfDisks_;
77  if (i>0) offset --; //used to skip case equale to zero
78 
79  std::stringstream streams;
80  streams << "RPC_Disk" << i;
81  daqDiskFractions[i+2] = dbe_->bookFloat(streams.str());
82  daqDiskFractions[i+2]->Fill(-1);
83  }
84 
85 
86  //daq summary for RPCs
87  dbe_->setCurrentFolder("RPC/EventInfo");
88 
89  DaqFraction_ = dbe_->bookFloat("DAQSummary");
90 
91  DaqMap_ = dbe_->book2D( "DAQSummaryMap","RPC DAQ Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
92 
93  //customize the 2d histo
94  std::stringstream BinLabel;
95  for (int i= 1 ; i<=15; i++){
96  BinLabel.str("");
97  if(i<13){
98  BinLabel<<"Sec"<<i;
99  DaqMap_->setBinLabel(i,BinLabel.str(),2);
100  }
101 
102  BinLabel.str("");
103  if(i<5)
104  BinLabel<<"Disk"<<i-5;
105  else if(i>11)
106  BinLabel<<"Disk"<<i-11;
107  else if(i==11 || i==5)
108  BinLabel.str("");
109  else
110  BinLabel<<"Wheel"<<i-8;
111 
112  DaqMap_->setBinLabel(i,BinLabel.str(),1);
113  }
114 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * daqDiskFractions[10]
Definition: RPCDaqInfo.h:43
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:40
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)
DQMStore * dbe_
Definition: RPCDaqInfo.h:38
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:891
void Fill(long long x)
unsigned int offset(bool)
MonitorElement * daqWheelFractions[5]
Definition: RPCDaqInfo.h:42
MonitorElement * DaqMap_
Definition: RPCDaqInfo.h:41
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1082
int numberOfDisks_
Definition: RPCDaqInfo.h:47
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void RPCDaqInfo::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 19 of file RPCDaqInfo.cc.

References DaqFraction_, FEDRange_, MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), and NumberOfFeds_.

19  {
20 
22 
23 
24  if(0 != iSetup.find( recordKey ) ) {
25 
26  //get fed summary information
28  iSetup.get<RunInfoRcd>().get(sumFED);
29  std::vector<int> FedsInIds= sumFED->m_fed_in;
30 
31  int FedCount=0;
32 
33  //loop on all active feds
34  for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
35  int fedID=FedsInIds[fedItr];
36  //make sure fed id is in allowed range
37 
38  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) ++FedCount;
39  }
40 
41  //Fill active fed fraction ME
42  if(NumberOfFeds_>0) DaqFraction_->Fill( FedCount/NumberOfFeds_);
43  else DaqFraction_->Fill(-1);
44 
45  }else{
46  DaqFraction_->Fill(-1);
47  return;
48  }
49 }
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:45
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:40
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
void Fill(long long x)
const T & get() const
Definition: EventSetup.h:55
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125
int NumberOfFeds_
Definition: RPCDaqInfo.h:47
void RPCDaqInfo::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file RPCDaqInfo.cc.

117 {}
void RPCDaqInfo::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file RPCDaqInfo.cc.

52 {}

Member Data Documentation

MonitorElement* RPCDaqInfo::daqDiskFractions[10]
private

Definition at line 43 of file RPCDaqInfo.h.

Referenced by beginJob().

MonitorElement* RPCDaqInfo::DaqFraction_
private

Definition at line 40 of file RPCDaqInfo.h.

Referenced by beginJob(), and beginLuminosityBlock().

MonitorElement* RPCDaqInfo::DaqMap_
private

Definition at line 41 of file RPCDaqInfo.h.

Referenced by beginJob().

MonitorElement* RPCDaqInfo::daqWheelFractions[5]
private

Definition at line 42 of file RPCDaqInfo.h.

Referenced by beginJob().

DQMStore* RPCDaqInfo::dbe_
private

Definition at line 38 of file RPCDaqInfo.h.

Referenced by beginJob().

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

Definition at line 45 of file RPCDaqInfo.h.

Referenced by beginLuminosityBlock(), and RPCDaqInfo().

int RPCDaqInfo::numberOfDisks_
private

Definition at line 47 of file RPCDaqInfo.h.

Referenced by beginJob(), and RPCDaqInfo().

int RPCDaqInfo::NumberOfFeds_
private

Definition at line 47 of file RPCDaqInfo.h.

Referenced by beginLuminosityBlock(), and RPCDaqInfo().