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 Attributes
RPCDqmClient Class Reference

#include <RPCDqmClient.h>

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

Public Member Functions

 RPCDqmClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCDqmClient ()
 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 &)
 
void getMonitorElements (DQMStore::IGetter &)
 
void getRPCdetId (const edm::EventSetup &)
 
void makeClientMap (const edm::ParameterSet &parameters_)
 
- 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

std::vector< std::string > clientHisto_
 
std::vector< std::string > clientList_
 
std::vector< RPCClient * > clientModules_
 
std::vector< std::string > clientNames_
 
std::vector< int > clientTag_
 
bool enableDQMClients_
 
std::string globalFolder_
 
int lumiCounter_
 
int minimumEvents_
 
std::vector< RPCDetIdmyDetIds_
 
int numLumBlock_
 
bool offlineDQM_
 
std::string prefixDir_
 
int prescaleGlobalFactor_
 
MonitorElementRPCEvents_
 
bool useRollInfo_
 

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 13 of file RPCDqmClient.h.

Constructor & Destructor Documentation

RPCDqmClient::RPCDqmClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 22 of file RPCDqmClient.cc.

References clientList_, enableDQMClients_, edm::ParameterSet::getUntrackedParameter(), globalFolder_, lumiCounter_, makeClientMap(), minimumEvents_, offlineDQM_, prefixDir_, prescaleGlobalFactor_, AlCaHLTBitMon_QueryRunRegistry::string, and useRollInfo_.

22  {
23 
24  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: Constructor";
25 
26  offlineDQM_ = parameters_.getUntrackedParameter<bool> ("OfflineDQM",true);
27  useRollInfo_= parameters_.getUntrackedParameter<bool>("UseRollInfo", false);
28  //check enabling
29  enableDQMClients_ = parameters_.getUntrackedParameter<bool> ("EnableRPCDqmClient",true);
30  minimumEvents_= parameters_.getUntrackedParameter<int>("MinimumRPCEvents", 10000);
31 
32  std::string subsystemFolder = parameters_.getUntrackedParameter<std::string>("RPCFolder", "RPC");
33  std::string recHitTypeFolder= parameters_.getUntrackedParameter<std::string>("RecHitTypeFolder", "AllHits");
34  std::string summaryFolder = parameters_.getUntrackedParameter<std::string>("SummaryFolder", "SummaryHistograms");
35 
36  prefixDir_ = subsystemFolder+ "/"+ recHitTypeFolder;
37  globalFolder_ = subsystemFolder + "/"+ recHitTypeFolder + "/"+ summaryFolder;
38 
39  //get prescale factor
40  prescaleGlobalFactor_ = parameters_.getUntrackedParameter<int>("DiagnosticGlobalPrescale", 5);
41 
42  //make default client list
43  clientList_.push_back("RPCMultiplicityTest");
44  clientList_.push_back("RPCDeadChannelTest");
45  clientList_.push_back("RPCClusterSizeTest");
46  clientList_= parameters_.getUntrackedParameter<std::vector<std::string> >("RPCDqmClientList",clientList_);
47 
48  //get all the possible RPC DQM clients
49  this->makeClientMap(parameters_);
50 
51  //clear counters
52  lumiCounter_ = 0;
53 }
std::string prefixDir_
Definition: RPCDqmClient.h:39
std::vector< std::string > clientList_
Definition: RPCDqmClient.h:41
void makeClientMap(const edm::ParameterSet &parameters_)
bool useRollInfo_
Definition: RPCDqmClient.h:38
std::string globalFolder_
Definition: RPCDqmClient.h:40
int minimumEvents_
Definition: RPCDqmClient.h:36
bool enableDQMClients_
Definition: RPCDqmClient.h:38
int prescaleGlobalFactor_
Definition: RPCDqmClient.h:36
bool offlineDQM_
Definition: RPCDqmClient.h:35
RPCDqmClient::~RPCDqmClient ( )
virtual

Destructor.

Definition at line 55 of file RPCDqmClient.cc.

55 {}

Member Function Documentation

void RPCDqmClient::beginJob ( void  )
protectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 57 of file RPCDqmClient.cc.

References clientModules_, enableDQMClients_, and globalFolder_.

57  {
58 
59  if (!enableDQMClients_) {return;} ;
60  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: Begin Job";
61 
62  //Do whatever the begin jobs of all client modules do
63  for(std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
64  (*it)->beginJob( globalFolder_ );
65  }
66 
67 }
std::string globalFolder_
Definition: RPCDqmClient.h:40
bool enableDQMClients_
Definition: RPCDqmClient.h:38
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:46
void RPCDqmClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 115 of file RPCDqmClient.cc.

References clientModules_, enableDQMClients_, MonitorElement::getBinContent(), getMonitorElements(), minimumEvents_, offlineDQM_, and RPCEvents_.

115  {
116 
117  if (!enableDQMClients_) {return;}
118 
119  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: End DQM Job";
120 
121  if(offlineDQM_){ // ...get chamber based histograms and pass them to the client modules
122  this->getMonitorElements( igetter);
123  }
124 
125  float rpcevents = minimumEvents_;
126  if(RPCEvents_) {
127  rpcevents = RPCEvents_ ->getBinContent(1);}
128  if(rpcevents < minimumEvents_) {return;}
129 
130  edm::LogVerbatim ("rpcdqmclient") <<"[RPCDqmClient]: Client operations";
131  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
132  (*it)->clientOperation();
133  }
134 
135 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:43
void getMonitorElements(DQMStore::IGetter &)
int minimumEvents_
Definition: RPCDqmClient.h:36
double getBinContent(int binx) const
get content of bin (1-D)
bool enableDQMClients_
Definition: RPCDqmClient.h:38
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:46
bool offlineDQM_
Definition: RPCDqmClient.h:35
void RPCDqmClient::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 71 of file RPCDqmClient.cc.

References clientModules_, enableDQMClients_, MonitorElement::getBinContent(), getMonitorElements(), getRPCdetId(), lumiCounter_, minimumEvents_, myDetIds_, offlineDQM_, prescaleGlobalFactor_, and RPCEvents_.

71  {
72 
73  if (!enableDQMClients_ ) {return;}
74  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: End DQM LB";
75 
76  if( myDetIds_.empty() ) {
77  //Get RPCdetId...
78 
79 
80  this->getRPCdetId( c);
81 
82  //...book summary histograms
83  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
84  (*it)->myBooker( ibooker);
85  }
86  }
87 
88  if (!offlineDQM_){ //Do this only for the online
89 
90  if (lumiCounter_ == 0){ //only for the first lumi section do this...
91  // ...get chamber based histograms and pass them to the client modules
92  this->getMonitorElements(igetter);
93  }
94 
95  //Do not perform client oparations every lumi block
96  lumiCounter_++;
97  if (lumiCounter_%prescaleGlobalFactor_ != 0) {return;}
98 
99  //Check if there's enough statistics
100  float rpcevents = minimumEvents_;
101  if(RPCEvents_) {rpcevents = RPCEvents_->getBinContent(1);}
102  if( rpcevents < minimumEvents_) {return;}
103 
104  edm::LogVerbatim ("rpcdqmclient") <<"[RPCDqmClient]: Client operations";
105  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
106  (*it)->clientOperation();
107  }
108  }//end of online operations
109 
110 
111 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:43
void getMonitorElements(DQMStore::IGetter &)
void getRPCdetId(const edm::EventSetup &)
int minimumEvents_
Definition: RPCDqmClient.h:36
std::vector< RPCDetId > myDetIds_
Definition: RPCDqmClient.h:44
double getBinContent(int binx) const
get content of bin (1-D)
bool enableDQMClients_
Definition: RPCDqmClient.h:38
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:46
int prescaleGlobalFactor_
Definition: RPCDqmClient.h:36
bool offlineDQM_
Definition: RPCDqmClient.h:35
void RPCDqmClient::getMonitorElements ( DQMStore::IGetter igetter)
protected

Definition at line 139 of file RPCDqmClient.cc.

References RPCGeomServ::chambername(), GetRecoTauVFromDQM_MC_cff::cl, clientHisto_, clientModules_, RPCBookFolderStructure::folderStructure(), DQMStore::IGetter::get(), myDetIds_, RPCGeomServ::name(), NULL, prefixDir_, RPCEvents_, AlCaHLTBitMon_QueryRunRegistry::string, and useRollInfo_.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

139  {
140 
141  std::vector<MonitorElement *> myMeVect;
142  std::vector<RPCDetId> myDetIds;
143 
144  //dbe_->setCurrentFolder(prefixDir_);
146  MonitorElement * myMe = NULL;
147  std::string rollName= "";
148 
149  //loop on all geometry and get all histos
150  for ( auto& detId : myDetIds_ ) {
151  //Get name
152  RPCGeomServ RPCname(detId);
153  rollName = useRollInfo_ ? RPCname.name() : RPCname.chambername();
154 
155  //loop on clients
156  for( unsigned int cl = 0, nCL = clientModules_.size(); cl < nCL; ++cl ){
157  myMe = igetter.get(prefixDir_ +"/"+ folderStr->folderStructure(detId)+"/"+clientHisto_[cl]+ "_"+rollName);
158  if (!myMe){continue;}
159 
160  // dbe_->tag(myMe, clientTag_[cl]);
161  myMeVect.push_back(myMe);
162  myDetIds.push_back(detId);
163 
164  }//end loop on clients
165  }//end loop on all geometry and get all histos
166 
167  RPCEvents_ = igetter.get(prefixDir_ +"/RPCEvents");
168  for ( unsigned int cl = 0; cl < clientModules_.size(); ++cl ) {
169  clientModules_[cl]->getMonitorElements(myMeVect, myDetIds, clientHisto_[cl]);
170  }
171 
172  delete folderStr;
173 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:43
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:304
std::string prefixDir_
Definition: RPCDqmClient.h:39
#define NULL
Definition: scimark2.h:8
std::vector< std::string > clientHisto_
Definition: RPCDqmClient.h:45
bool useRollInfo_
Definition: RPCDqmClient.h:38
std::string folderStructure(RPCDetId detId)
std::vector< RPCDetId > myDetIds_
Definition: RPCDqmClient.h:44
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:46
void RPCDqmClient::getRPCdetId ( const edm::EventSetup eventSetup)
protected

Definition at line 177 of file RPCDqmClient.cc.

References edm::EventSetup::get(), myDetIds_, alignCSCRings::r, and RPCChamber::rolls().

Referenced by dqmEndLuminosityBlock().

177  {
178 
179  myDetIds_.clear();
180 
182  eventSetup.get<MuonGeometryRecord>().get(rpcGeo);
183 
184  for ( auto& det : rpcGeo->dets() ) {
185  const RPCChamber* ch = dynamic_cast< const RPCChamber* >(det);
186  if ( !ch ) continue;
187 
188  //Loop on rolls in given chamber
189  for ( auto& r : ch->rolls() ) {
190  RPCDetId detId = r->id();
191  myDetIds_.push_back(detId);
192  }
193  }
194 
195 }
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
const T & get() const
Definition: EventSetup.h:56
std::vector< RPCDetId > myDetIds_
Definition: RPCDqmClient.h:44
void RPCDqmClient::makeClientMap ( const edm::ParameterSet parameters_)
protected

Definition at line 199 of file RPCDqmClient.cc.

References clientHisto_, clientList_, clientModules_, and i.

Referenced by RPCDqmClient().

199  {
200 
201  for(unsigned int i = 0; i<clientList_.size(); i++){
202 
203  if( clientList_[i] == "RPCMultiplicityTest" ) {
204  clientHisto_.push_back("Multiplicity");
205  // clientTag_.push_back(rpcdqm::MULTIPLICITY);
206  clientModules_.push_back( new RPCMultiplicityTest(parameters_));
207  } else if ( clientList_[i] == "RPCDeadChannelTest" ){
208  clientHisto_.push_back("Occupancy");
209  clientModules_.push_back( new RPCDeadChannelTest(parameters_));
210  // clientTag_.push_back(rpcdqm::OCCUPANCY);
211  } else if ( clientList_[i] == "RPCClusterSizeTest" ){
212  clientHisto_.push_back("ClusterSize");
213  clientModules_.push_back( new RPCClusterSizeTest(parameters_));
214  // clientTag_.push_back(rpcdqm::CLUSTERSIZE);
215  } else if ( clientList_[i] == "RPCOccupancyTest" ){
216  clientHisto_.push_back("Occupancy");
217  clientModules_.push_back( new RPCOccupancyTest(parameters_));
218  // clientTag_.push_back(rpcdqm::OCCUPANCY);
219  } else if ( clientList_[i] == "RPCNoisyStripTest" ){
220  clientHisto_.push_back("Occupancy");
221  clientModules_.push_back( new RPCNoisyStripTest(parameters_));
222  //clientTag_.push_back(rpcdqm::OCCUPANCY);
223  }
224  }
225 
226  return;
227 
228 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > clientList_
Definition: RPCDqmClient.h:41
std::vector< std::string > clientHisto_
Definition: RPCDqmClient.h:45
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:46

Member Data Documentation

std::vector<std::string> RPCDqmClient::clientHisto_
private

Definition at line 45 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and makeClientMap().

std::vector<std::string> RPCDqmClient::clientList_
private

Definition at line 41 of file RPCDqmClient.h.

Referenced by makeClientMap(), and RPCDqmClient().

std::vector<RPCClient*> RPCDqmClient::clientModules_
private
std::vector<std::string> RPCDqmClient::clientNames_
private

Definition at line 45 of file RPCDqmClient.h.

std::vector<int> RPCDqmClient::clientTag_
private

Definition at line 48 of file RPCDqmClient.h.

bool RPCDqmClient::enableDQMClients_
private

Definition at line 38 of file RPCDqmClient.h.

Referenced by beginJob(), dqmEndJob(), dqmEndLuminosityBlock(), and RPCDqmClient().

std::string RPCDqmClient::globalFolder_
private

Definition at line 40 of file RPCDqmClient.h.

Referenced by beginJob(), and RPCDqmClient().

int RPCDqmClient::lumiCounter_
private

Definition at line 42 of file RPCDqmClient.h.

Referenced by dqmEndLuminosityBlock(), and RPCDqmClient().

int RPCDqmClient::minimumEvents_
private

Definition at line 36 of file RPCDqmClient.h.

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

std::vector<RPCDetId> RPCDqmClient::myDetIds_
private

Definition at line 44 of file RPCDqmClient.h.

Referenced by dqmEndLuminosityBlock(), getMonitorElements(), and getRPCdetId().

int RPCDqmClient::numLumBlock_
private

Definition at line 36 of file RPCDqmClient.h.

bool RPCDqmClient::offlineDQM_
private

Definition at line 35 of file RPCDqmClient.h.

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

std::string RPCDqmClient::prefixDir_
private

Definition at line 39 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and RPCDqmClient().

int RPCDqmClient::prescaleGlobalFactor_
private

Definition at line 36 of file RPCDqmClient.h.

Referenced by dqmEndLuminosityBlock(), and RPCDqmClient().

MonitorElement* RPCDqmClient::RPCEvents_
private

Definition at line 43 of file RPCDqmClient.h.

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

bool RPCDqmClient::useRollInfo_
private

Definition at line 38 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and RPCDqmClient().