CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
RPCDCSSummary Class Reference

#include <RPCDCSSummary.h>

Inheritance diagram for RPCDCSSummary:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 RPCDCSSummary (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~RPCDCSSummary ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

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

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

Private Attributes

MonitorElementdcsDiskFractions [10]
 
MonitorElementDCSMap_
 
MonitorElementdcsWheelFractions [5]
 
double defaultValue_
 
std::pair< int, int > FEDRange_
 
bool init_
 
int numberOfDisks_
 
int NumberOfFeds_
 
bool offlineDQM_
 
MonitorElementtotalDCSFraction
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 10 of file RPCDCSSummary.h.

Constructor & Destructor Documentation

RPCDCSSummary::RPCDCSSummary ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file RPCDCSSummary.cc.

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

16  {
17 
18  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
19 
20  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
21  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
22 
23  offlineDQM_ = ps.getUntrackedParameter<bool> ("OfflineDQM",true);
24 
25  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
26  init_=false;
27  defaultValue_ = 1.;
28 }
T getUntrackedParameter(std::string const &, T const &) const
double defaultValue_
Definition: RPCDCSSummary.h:31
std::pair< int, int > FEDRange_
Definition: RPCDCSSummary.h:39
RPCDCSSummary::~RPCDCSSummary ( )
virtual

Destructor.

Definition at line 30 of file RPCDCSSummary.cc.

30 {}

Member Function Documentation

void RPCDCSSummary::beginJob ( void  )
protectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 32 of file RPCDCSSummary.cc.

32 {}
void RPCDCSSummary::checkDCSbit ( edm::EventSetup const &  setup)
private

Definition at line 50 of file RPCDCSSummary.cc.

References defaultValue_, f, FEDRange_, edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), and init_.

Referenced by dqmEndLuminosityBlock().

50  {
51 
53 
54  defaultValue_ = 1.;
55 
56  if(0 != setup.find( recordKey ) ) {
57  defaultValue_ = -1.;
58  //get fed summary information
60  setup.get<RunInfoRcd>().get(sumFED);
61  std::vector<int> FedsInIds= sumFED->m_fed_in;
62  unsigned int f = 0;
63  bool flag = false;
64  while(!flag && f < FedsInIds.size()) {
65  int fedID=FedsInIds[f];
66  //make sure fed id is in allowed range
67  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
68  defaultValue_ = 1.;
69  flag = true;
70  }
71  f++;
72  }
73  }
74  init_ = true;
75 }
double defaultValue_
Definition: RPCDCSSummary.h:31
double f[11][100]
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
std::pair< int, int > FEDRange_
Definition: RPCDCSSummary.h:39
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
void RPCDCSSummary::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 43 of file RPCDCSSummary.cc.

References myBooker(), and offlineDQM_.

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

Reimplemented from DQMEDHarvester.

Definition at line 34 of file RPCDCSSummary.cc.

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

34  {
35 
36  if(!init_){
37  this->checkDCSbit(setup);
38  if(!offlineDQM_ ){this->myBooker(ibooker);}
39  }
40 }
void myBooker(DQMStore::IBooker &)
void checkDCSbit(edm::EventSetup const &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void RPCDCSSummary::myBooker ( DQMStore::IBooker ibooker)
private

Definition at line 77 of file RPCDCSSummary.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), dcsDiskFractions, DCSMap_, dcsWheelFractions, defaultValue_, MonitorElement::Fill(), i, j, MessageLogger_cff::limit, numberOfDisks_, hltrates_dqm_sourceclient-live_cfg::offset, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), hcal_dqm_sourceclient-file_cfg::streams, and totalDCSFraction.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

77  {
78 
79  ibooker.setCurrentFolder("RPC/EventInfo");
80  // global fraction
81  totalDCSFraction = ibooker.bookFloat("DCSSummary");
83 
84  DCSMap_ = ibooker.book2D( "DCSSummaryMap","RPC DCS Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
85 
86  //customize the 2d histo
87  std::stringstream BinLabel;
88  for (int i= 1 ; i<13; i++){
89  BinLabel.str("");
90  BinLabel<<"Sec"<<i;
91  DCSMap_->setBinLabel(i,BinLabel.str(),2);
92  }
93 
94  for(int i = -2; i<=2; i++){
95  BinLabel.str("");
96  BinLabel<<"Wheel"<<i;
97  DCSMap_->setBinLabel((i+8),BinLabel.str(),1);
98  }
99 
100  for(int i = 1; i<=numberOfDisks_; i++){
101  BinLabel.str("");
102  BinLabel<<"Disk"<<i;
103  DCSMap_->setBinLabel((i+11),BinLabel.str(),1);
104  BinLabel.str("");
105  BinLabel<<"Disk"<<-i;
106  DCSMap_->setBinLabel((-i+5),BinLabel.str(),1);
107  }
108 
109  //fill the histo with "1" --- just for the moment
110  for(int i=1; i<=15; i++){
111  for (int j=1; j<=12; j++ ){
112  if(i==5 || i==11 || (j>6 && (i<6 || i>10)))
113  DCSMap_->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
114  else
116  }
117  }
118 
119 
120  if(numberOfDisks_ < 4){
121  for (int j=1; j<=12; j++ ){
122  DCSMap_->setBinContent(1,j,-1);//bins that not correspond to subdetector parts
123  DCSMap_->setBinContent(15,j,-1);
124  }
125  }
126 
127  // book the ME
128  ibooker.setCurrentFolder("RPC/EventInfo/DCSContents");
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  dcsWheelFractions[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  dcsDiskFractions[i+2] = ibooker.bookFloat(streams.str());
150  }
151 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * DCSMap_
Definition: RPCDCSSummary.h:35
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)
double defaultValue_
Definition: RPCDCSSummary.h:31
MonitorElement * totalDCSFraction
Definition: RPCDCSSummary.h:36
void Fill(long long x)
MonitorElement * dcsDiskFractions[10]
Definition: RPCDCSSummary.h:38
int j
Definition: DBlmapReader.cc:9
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * dcsWheelFractions[5]
Definition: RPCDCSSummary.h:37
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109

Member Data Documentation

MonitorElement* RPCDCSSummary::dcsDiskFractions[10]
private

Definition at line 38 of file RPCDCSSummary.h.

Referenced by myBooker().

MonitorElement* RPCDCSSummary::DCSMap_
private

Definition at line 35 of file RPCDCSSummary.h.

Referenced by myBooker().

MonitorElement* RPCDCSSummary::dcsWheelFractions[5]
private

Definition at line 37 of file RPCDCSSummary.h.

Referenced by myBooker().

double RPCDCSSummary::defaultValue_
private

Definition at line 31 of file RPCDCSSummary.h.

Referenced by checkDCSbit(), myBooker(), and RPCDCSSummary().

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

Definition at line 39 of file RPCDCSSummary.h.

Referenced by checkDCSbit(), and RPCDCSSummary().

bool RPCDCSSummary::init_
private

Definition at line 30 of file RPCDCSSummary.h.

Referenced by checkDCSbit(), dqmEndLuminosityBlock(), and RPCDCSSummary().

int RPCDCSSummary::numberOfDisks_
private

Definition at line 40 of file RPCDCSSummary.h.

Referenced by myBooker(), and RPCDCSSummary().

int RPCDCSSummary::NumberOfFeds_
private

Definition at line 41 of file RPCDCSSummary.h.

Referenced by RPCDCSSummary().

bool RPCDCSSummary::offlineDQM_
private

Definition at line 33 of file RPCDCSSummary.h.

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

MonitorElement* RPCDCSSummary::totalDCSFraction
private

Definition at line 36 of file RPCDCSSummary.h.

Referenced by myBooker().