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
 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 (const std::string &iProcessName, std::vector< const char * > &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 &, const edm::EventSetup &)
 
void makeClientMap (const edm::ParameterSet &parameters_)
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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_
 
bool init_
 
int lumiCounter_
 
int minimumEvents_
 
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
 
- 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_, init_, lumiCounter_, makeClientMap(), minimumEvents_, offlineDQM_, prefixDir_, prescaleGlobalFactor_, AlCaHLTBitMon_QueryRunRegistry::string, and useRollInfo_.

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

Destructor.

Definition at line 60 of file RPCDqmClient.cc.

60 {}

Member Function Documentation

void RPCDqmClient::beginJob ( void  )
protectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 62 of file RPCDqmClient.cc.

References clientModules_, enableDQMClients_, and globalFolder_.

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

Implements DQMEDHarvester.

Definition at line 114 of file RPCDqmClient.cc.

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

114  {
115 
116  if (!enableDQMClients_ || !init_) {return;}
117 
118  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: End DQM Job";
119 
120  float rpcevents = minimumEvents_;
121  if(RPCEvents_) {rpcevents = RPCEvents_ ->getBinContent(1);}
122  if(rpcevents < minimumEvents_) {return;}
123 
124  edm::LogVerbatim ("rpcdqmclient") <<"[RPCDqmClient]: Client operations";
125  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
126  (*it)->clientOperation();
127  }
128 
129 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:42
int minimumEvents_
Definition: RPCDqmClient.h:35
double getBinContent(int binx) const
get content of bin (1-D)
bool enableDQMClients_
Definition: RPCDqmClient.h:37
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:45
void RPCDqmClient::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 75 of file RPCDqmClient.cc.

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

75  {
76 
77  if (!enableDQMClients_ ) {return;}
78  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: End DQM LB";
79 
80 
81  if(!init_) { //At the end of the first LumiBlock...
82  // ...get chamber based histograms
83  this->getMonitorElements(igetter, c);
84 
85  //...book summary histograms
86  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
87  (*it)->myBooker( ibooker);
88  }
89 
91  init_= true;
92  }
93 
94  lumiCounter_++;
95 
96  if (offlineDQM_) {return;} // If in offlineDQM mode, do nothing. Client operation will be done only at endJob
97 
98  //Check if there's enough statistics
99  float rpcevents = minimumEvents_;
100  if(RPCEvents_) {rpcevents = RPCEvents_->getBinContent(1);}
101  if( rpcevents < minimumEvents_) {return;}
102  //Do not perform client oparations every lumi block
103  if (lumiCounter_%prescaleGlobalFactor_ != 0) {return;}
104 
105  edm::LogVerbatim ("rpcdqmclient") <<"[RPCDqmClient]: Client operations";
106  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
107  (*it)->clientOperation();
108  }
109 
110 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:42
void getMonitorElements(DQMStore::IGetter &, const edm::EventSetup &)
int minimumEvents_
Definition: RPCDqmClient.h:35
double getBinContent(int binx) const
get content of bin (1-D)
bool enableDQMClients_
Definition: RPCDqmClient.h:37
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:45
int prescaleGlobalFactor_
Definition: RPCDqmClient.h:35
bool offlineDQM_
Definition: RPCDqmClient.h:34
void RPCDqmClient::getMonitorElements ( DQMStore::IGetter igetter,
const edm::EventSetup c 
)
protected

Definition at line 133 of file RPCDqmClient.cc.

References RPCGeomServ::chambername(), GetRecoTauVFromDQM_MC_cff::cl, clientHisto_, clientModules_, RPCBookFolderStructure::folderStructure(), edm::EventSetup::get(), DQMStore::IGetter::get(), RPCGeomServ::name(), NULL, prefixDir_, alignCSCRings::r, RPCChamber::rolls(), RPCEvents_, AlCaHLTBitMon_QueryRunRegistry::string, and useRollInfo_.

Referenced by dqmEndLuminosityBlock().

133  {
134 
135  std::vector<MonitorElement *> myMeVect;
136  std::vector<RPCDetId> myDetIds;
137 
139  c.get<MuonGeometryRecord>().get(rpcGeo);
140 
141  //dbe_->setCurrentFolder(prefixDir_);
143  MonitorElement * myMe = NULL;
144  std::string rollName= "";
145 
146  //loop on all geometry and get all histos
147  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
148  if( dynamic_cast< const RPCChamber* >( *it ) != 0 ){
149 
150  const RPCChamber* ch = dynamic_cast< const RPCChamber* >( *it );
151  std::vector< const RPCRoll*> roles = (ch->rolls());
152 
153  //Loop on rolls in given chamber
154  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
155 
156  RPCDetId detId = (*r)->id();
157 
158  //Get name
159  RPCGeomServ RPCname(detId);
160  rollName= "";
161  if(useRollInfo_) {
162  rollName = RPCname.name();
163  }else{
164  rollName = RPCname.chambername();
165  }
166 
167  //loop on clients
168  for( unsigned int cl = 0; cl<clientModules_.size(); cl++ ){
169 
170  myMe = NULL;
171  myMe = igetter.get(prefixDir_ +"/"+ folderStr->folderStructure(detId)+"/"+clientHisto_[cl]+ "_"+rollName);
172 
173  if (!myMe)continue;
174  // dbe_->tag(myMe, clientTag_[cl]);
175  myMeVect.push_back(myMe);
176  myDetIds.push_back(detId);
177 
178  }//end loop on clients
179  }//end loop on roll in given chamber
180  }
181  }//end loop on all geometry and get all histos
182 
183 
184  RPCEvents_ = igetter.get(prefixDir_ +"/RPCEvents");
185  unsigned int cl = 0;
186  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
187  (*it)->getMonitorElements(myMeVect, myDetIds, clientHisto_[cl]);
188  cl++;
189  }
190 
191  delete folderStr;
192 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:42
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
std::string prefixDir_
Definition: RPCDqmClient.h:38
#define NULL
Definition: scimark2.h:8
std::vector< std::string > clientHisto_
Definition: RPCDqmClient.h:44
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
bool useRollInfo_
Definition: RPCDqmClient.h:37
std::string folderStructure(RPCDetId detId)
const T & get() const
Definition: EventSetup.h:55
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:45
void RPCDqmClient::makeClientMap ( const edm::ParameterSet parameters_)
protected

Definition at line 198 of file RPCDqmClient.cc.

References clientHisto_, clientList_, clientModules_, and i.

Referenced by RPCDqmClient().

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

Member Data Documentation

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

Definition at line 44 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and makeClientMap().

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

Definition at line 40 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 44 of file RPCDqmClient.h.

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

Definition at line 47 of file RPCDqmClient.h.

bool RPCDqmClient::enableDQMClients_
private

Definition at line 37 of file RPCDqmClient.h.

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

std::string RPCDqmClient::globalFolder_
private

Definition at line 39 of file RPCDqmClient.h.

Referenced by beginJob(), and RPCDqmClient().

bool RPCDqmClient::init_
private

Definition at line 37 of file RPCDqmClient.h.

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

int RPCDqmClient::lumiCounter_
private

Definition at line 41 of file RPCDqmClient.h.

Referenced by dqmEndLuminosityBlock(), and RPCDqmClient().

int RPCDqmClient::minimumEvents_
private

Definition at line 35 of file RPCDqmClient.h.

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

int RPCDqmClient::numLumBlock_
private

Definition at line 35 of file RPCDqmClient.h.

bool RPCDqmClient::offlineDQM_
private

Definition at line 34 of file RPCDqmClient.h.

Referenced by dqmEndLuminosityBlock(), and RPCDqmClient().

std::string RPCDqmClient::prefixDir_
private

Definition at line 38 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and RPCDqmClient().

int RPCDqmClient::prescaleGlobalFactor_
private

Definition at line 35 of file RPCDqmClient.h.

Referenced by dqmEndLuminosityBlock(), and RPCDqmClient().

MonitorElement* RPCDqmClient::RPCEvents_
private

Definition at line 42 of file RPCDqmClient.h.

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

bool RPCDqmClient::useRollInfo_
private

Definition at line 37 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and RPCDqmClient().