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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 Begin Lumi block. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
void endJob ()
 Endjob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 End Lumi Block. More...
 
void endRun (const edm::Run &, const edm::EventSetup &)
 
 RPCDqmClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCDqmClient ()
 Destructor. More...
 
- 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 ()
 

Protected Member Functions

void getMonitorElements (const edm::Run &, const edm::EventSetup &)
 
void makeClientMap (void)
 
- 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_
 
DQMStoredbe_
 
bool enableDQMClients_
 
std::string globalFolder_
 
bool init_
 
int lumiCounter_
 
int minimumEvents_
 
int numLumBlock_
 
bool offlineDQM_
 
edm::ParameterSet parameters_
 
std::string prefixDir_
 
int prescaleGlobalFactor_
 
MonitorElementRPCEvents_
 
bool useRollInfo_
 

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 &)
 

Detailed Description

Definition at line 14 of file RPCDqmClient.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 21 of file RPCDqmClient.cc.

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

21  {
22 
23  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: Constructor";
24 
25  parameters_ = iConfig;
26 
27  offlineDQM_ = parameters_.getUntrackedParameter<bool> ("OfflineDQM",true);
28  useRollInfo_= parameters_.getUntrackedParameter<bool>("UseRollInfo", false);
29  //check enabling
30  enableDQMClients_ =parameters_.getUntrackedParameter<bool> ("EnableRPCDqmClient",true);
31  minimumEvents_= parameters_.getUntrackedParameter<int>("MinimumRPCEvents", 10000);
32 
33  std::string subsystemFolder = parameters_.getUntrackedParameter<std::string>("RPCFolder", "RPC");
34  std::string recHitTypeFolder= parameters_.getUntrackedParameter<std::string>("RecHitTypeFolder", "AllHits");
35  std::string summaryFolder = parameters_.getUntrackedParameter<std::string>("SummaryFolder", "SummaryHistograms");
36 
37  prefixDir_ = subsystemFolder+ "/"+ recHitTypeFolder;
38  globalFolder_ = subsystemFolder + "/"+ recHitTypeFolder + "/"+ summaryFolder;
39 
40  //get prescale factor
41  prescaleGlobalFactor_ = parameters_.getUntrackedParameter<int>("DiagnosticGlobalPrescale", 5);
42 
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();
54 }
T getUntrackedParameter(std::string const &, T const &) const
std::string prefixDir_
Definition: RPCDqmClient.h:54
std::vector< std::string > clientList_
Definition: RPCDqmClient.h:56
edm::ParameterSet parameters_
Definition: RPCDqmClient.h:66
bool useRollInfo_
Definition: RPCDqmClient.h:53
std::string globalFolder_
Definition: RPCDqmClient.h:55
int minimumEvents_
Definition: RPCDqmClient.h:51
void makeClientMap(void)
bool enableDQMClients_
Definition: RPCDqmClient.h:53
int prescaleGlobalFactor_
Definition: RPCDqmClient.h:51
bool offlineDQM_
Definition: RPCDqmClient.h:50
RPCDqmClient::~RPCDqmClient ( )
virtual

Destructor.

Definition at line 56 of file RPCDqmClient.cc.

References dbe_.

56 {dbe_ = 0;}
DQMStore * dbe_
Definition: RPCDqmClient.h:68

Member Function Documentation

void RPCDqmClient::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 183 of file RPCDqmClient.cc.

References clientModules_, and enableDQMClients_.

183  {
184 
185  if (!enableDQMClients_) return;
186 
187  for ( std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ )
188  (*it)->analyze( iEvent,iSetup);
189 }
bool enableDQMClients_
Definition: RPCDqmClient.h:53
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
void RPCDqmClient::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 58 of file RPCDqmClient.cc.

References clientModules_, dbe_, enableDQMClients_, globalFolder_, cppFunctionSkipper::operator, and DQMStore::setVerbose().

58  {
59 
60  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: Begin Job";
61  if (!enableDQMClients_) return; ;
62 
64  dbe_->setVerbose(0);
65 
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(dbe_, globalFolder_);
70 
71 }
DQMStore * dbe_
Definition: RPCDqmClient.h:68
std::string globalFolder_
Definition: RPCDqmClient.h:55
void setVerbose(unsigned level)
Definition: DQMStore.cc:619
bool enableDQMClients_
Definition: RPCDqmClient.h:53
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
void RPCDqmClient::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Begin Lumi block.

Reimplemented from edm::EDAnalyzer.

Definition at line 176 of file RPCDqmClient.cc.

References clientModules_, and enableDQMClients_.

176  {
177  if (!enableDQMClients_) return;
178 
179  for ( std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ )
180  (*it)->beginLuminosityBlock(lumiSeg,context);
181 }
bool enableDQMClients_
Definition: RPCDqmClient.h:53
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
void RPCDqmClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file RPCDqmClient.cc.

References clientModules_, enableDQMClients_, getMonitorElements(), init_, lumiCounter_, offlineDQM_, and prescaleGlobalFactor_.

74  {
75 
76  if (!enableDQMClients_) return;
77 
78 
79  for ( std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
80  (*it)->beginRun(r,c);
81  }
82 
83  if(!offlineDQM_) this->getMonitorElements(r, c);
84 
86  init_ = false;
87 }
bool enableDQMClients_
Definition: RPCDqmClient.h:53
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
void getMonitorElements(const edm::Run &, const edm::EventSetup &)
int prescaleGlobalFactor_
Definition: RPCDqmClient.h:51
bool offlineDQM_
Definition: RPCDqmClient.h:50
void RPCDqmClient::endJob ( void  )
virtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 230 of file RPCDqmClient.cc.

References clientModules_, and enableDQMClients_.

230  {
231  if (!enableDQMClients_) return;
232 
233  for ( std::vector<RPCClient*>::iterator it= clientModules_.begin(); it!=clientModules_.end(); it++ )
234  (*it)->endJob();
235 }
bool enableDQMClients_
Definition: RPCDqmClient.h:53
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
void RPCDqmClient::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
virtual

End Lumi Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 192 of file RPCDqmClient.cc.

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

192  {
193 
194  if (!enableDQMClients_ ) return;
195 
196  if(offlineDQM_) return;
197 
198  edm::LogVerbatim ("rpcdqmclient") <<"[RPCDqmClient]: End of LS ";
199 
200  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ )
201  (*it)->endLuminosityBlock( lumiSeg, c);
202 
203  float rpcevents = minimumEvents_;
204  if(RPCEvents_) rpcevents = RPCEvents_ ->getBinContent(1);
205 
206  if( rpcevents < minimumEvents_) return;
207 
208  if( !init_ ){
209 
210  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
211  (*it)->clientOperation(c);
212  }
213  init_ = true;
214  return;
215  }
216 
217  lumiCounter_++;
218 
219  if (lumiCounter_%prescaleGlobalFactor_ != 0) return;
220 
221 
222  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
223  (*it)->clientOperation(c);
224  }
225 
226 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:58
int minimumEvents_
Definition: RPCDqmClient.h:51
double getBinContent(int binx) const
get content of bin (1-D)
bool enableDQMClients_
Definition: RPCDqmClient.h:53
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
int prescaleGlobalFactor_
Definition: RPCDqmClient.h:51
bool offlineDQM_
Definition: RPCDqmClient.h:50
void RPCDqmClient::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file RPCDqmClient.cc.

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

91  {
92  edm::LogVerbatim ("rpcdqmclient") << "[RPCDqmClient]: End Run";
93 
94  if (!enableDQMClients_) return;
95 
96  if(offlineDQM_) this->getMonitorElements(r, c);
97 
98  float rpcevents = minimumEvents_;
99  if(RPCEvents_) rpcevents = RPCEvents_ ->getBinContent(1);
100 
101  if(rpcevents < minimumEvents_) return;
102 
103  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
104  (*it)->clientOperation(c);
105  (*it)->endRun(r,c);
106  }
107 }
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:58
int minimumEvents_
Definition: RPCDqmClient.h:51
double getBinContent(int binx) const
get content of bin (1-D)
bool enableDQMClients_
Definition: RPCDqmClient.h:53
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
void getMonitorElements(const edm::Run &, const edm::EventSetup &)
bool offlineDQM_
Definition: RPCDqmClient.h:50
void RPCDqmClient::getMonitorElements ( const edm::Run r,
const edm::EventSetup c 
)
protected

Definition at line 110 of file RPCDqmClient.cc.

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

Referenced by beginRun(), and endRun().

110  {
111 
112  std::vector<MonitorElement *> myMeVect;
113  std::vector<RPCDetId> myDetIds;
114 
116  c.get<MuonGeometryRecord>().get(rpcGeo);
117 
118  //dbe_->setCurrentFolder(prefixDir_);
120  MonitorElement * myMe = NULL;
121  std::string rollName= "";
122  // std::set<int> disk_set, ring_set;
123 
124  //loop on all geometry and get all histos
125  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
126  if( dynamic_cast< const RPCChamber* >( *it ) != 0 ){
127 
128  const RPCChamber* ch = dynamic_cast< const RPCChamber* >( *it );
129  std::vector< const RPCRoll*> roles = (ch->rolls());
130 
131  //Loop on rolls in given chamber
132  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
133 
134  RPCDetId detId = (*r)->id();
135 
136  //Get name
137  RPCGeomServ RPCname(detId);
138  rollName= "";
139  if(useRollInfo_) {
140  rollName = RPCname.name();
141  }else{
142  rollName = RPCname.chambername();
143  }
144 
145  //loop on clients
146  for( unsigned int cl = 0; cl<clientModules_.size(); cl++ ){
147 
148  myMe = NULL;
149  myMe = dbe_->get(prefixDir_ +"/"+ folderStr->folderStructure(detId)+"/"+clientHisto_[cl]+ "_"+rollName);
150 
151  if (!myMe)continue;
152 
153  dbe_->tag(myMe, clientTag_[cl]);
154  myMeVect.push_back(myMe);
155  myDetIds.push_back(detId);
156 
157  }//end loop on clients
158 
159  }//end loop on roll in given chamber
160  }
161  }//end loop on all geometry and get all histos
162 
163 
164  RPCEvents_ = dbe_->get(prefixDir_ +"/RPCEvents");
165 
166  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
167  (*it)->getMonitorElements(myMeVect, myDetIds);
168  }
169 
170  delete folderStr;
171 
172 }
DQMStore * dbe_
Definition: RPCDqmClient.h:68
MonitorElement * RPCEvents_
Definition: RPCDqmClient.h:58
std::string prefixDir_
Definition: RPCDqmClient.h:54
#define NULL
Definition: scimark2.h:8
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1582
std::vector< std::string > clientHisto_
Definition: RPCDqmClient.h:61
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
bool useRollInfo_
Definition: RPCDqmClient.h:53
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1696
std::string folderStructure(RPCDetId detId)
const T & get() const
Definition: EventSetup.h:55
std::vector< int > clientTag_
Definition: RPCDqmClient.h:64
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62
void RPCDqmClient::makeClientMap ( void  )
protected

Definition at line 238 of file RPCDqmClient.cc.

References clientHisto_, clientList_, clientModules_, clientTag_, rpcdqm::CLUSTERSIZE, i, rpcdqm::MULTIPLICITY, rpcdqm::OCCUPANCY, and parameters_.

Referenced by RPCDqmClient().

238  {
239 
240  for(unsigned int i = 0; i<clientList_.size(); i++){
241 
242  if( clientList_[i] == "RPCMultiplicityTest" ) {
243  clientHisto_.push_back("Multiplicity");
244  clientTag_.push_back(rpcdqm::MULTIPLICITY);
246  } else if ( clientList_[i] == "RPCDeadChannelTest" ){
247  clientHisto_.push_back("Occupancy");
249  clientTag_.push_back(rpcdqm::OCCUPANCY);
250  } else if ( clientList_[i] == "RPCClusterSizeTest" ){
251  clientHisto_.push_back("ClusterSize");
253  clientTag_.push_back(rpcdqm::CLUSTERSIZE);
254  } else if ( clientList_[i] == "RPCOccupancyTest" ){
255  clientHisto_.push_back("Occupancy");
257  clientTag_.push_back(rpcdqm::OCCUPANCY);
258  } else if ( clientList_[i] == "RPCNoisyStripTest" ){
259  clientHisto_.push_back("Occupancy");
261  clientTag_.push_back(rpcdqm::OCCUPANCY);
262  }
263  }
264 
265  return;
266 
267 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > clientList_
Definition: RPCDqmClient.h:56
edm::ParameterSet parameters_
Definition: RPCDqmClient.h:66
std::vector< std::string > clientHisto_
Definition: RPCDqmClient.h:61
std::vector< int > clientTag_
Definition: RPCDqmClient.h:64
std::vector< RPCClient * > clientModules_
Definition: RPCDqmClient.h:62

Member Data Documentation

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

Definition at line 61 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and makeClientMap().

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

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

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

Definition at line 64 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and makeClientMap().

DQMStore* RPCDqmClient::dbe_
private

Definition at line 68 of file RPCDqmClient.h.

Referenced by beginJob(), getMonitorElements(), and ~RPCDqmClient().

bool RPCDqmClient::enableDQMClients_
private
std::string RPCDqmClient::globalFolder_
private

Definition at line 55 of file RPCDqmClient.h.

Referenced by beginJob(), and RPCDqmClient().

bool RPCDqmClient::init_
private

Definition at line 53 of file RPCDqmClient.h.

Referenced by beginRun(), and endLuminosityBlock().

int RPCDqmClient::lumiCounter_
private

Definition at line 57 of file RPCDqmClient.h.

Referenced by beginRun(), and endLuminosityBlock().

int RPCDqmClient::minimumEvents_
private

Definition at line 51 of file RPCDqmClient.h.

Referenced by endLuminosityBlock(), endRun(), and RPCDqmClient().

int RPCDqmClient::numLumBlock_
private

Definition at line 51 of file RPCDqmClient.h.

bool RPCDqmClient::offlineDQM_
private

Definition at line 50 of file RPCDqmClient.h.

Referenced by beginRun(), endLuminosityBlock(), endRun(), and RPCDqmClient().

edm::ParameterSet RPCDqmClient::parameters_
private
std::string RPCDqmClient::prefixDir_
private

Definition at line 54 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and RPCDqmClient().

int RPCDqmClient::prescaleGlobalFactor_
private

Definition at line 51 of file RPCDqmClient.h.

Referenced by beginRun(), endLuminosityBlock(), and RPCDqmClient().

MonitorElement* RPCDqmClient::RPCEvents_
private

Definition at line 58 of file RPCDqmClient.h.

Referenced by endLuminosityBlock(), endRun(), and getMonitorElements().

bool RPCDqmClient::useRollInfo_
private

Definition at line 53 of file RPCDqmClient.h.

Referenced by getMonitorElements(), and RPCDqmClient().