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
 
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 174 of file RPCDqmClient.cc.

References clientModules_, and enableDQMClients_.

174  {
175 
176  if (!enableDQMClients_) return;
177 
178  for ( std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ )
179  (*it)->analyze( iEvent,iSetup);
180 }
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:548
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 167 of file RPCDqmClient.cc.

References clientModules_, and enableDQMClients_.

167  {
168  if (!enableDQMClients_) return;
169 
170  for ( std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ )
171  (*it)->beginLuminosityBlock(lumiSeg,context);
172 }
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 221 of file RPCDqmClient.cc.

References clientModules_, and enableDQMClients_.

221  {
222  if (!enableDQMClients_) return;
223 
224  for ( std::vector<RPCClient*>::iterator it= clientModules_.begin(); it!=clientModules_.end(); it++ )
225  (*it)->endJob();
226 }
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 183 of file RPCDqmClient.cc.

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

183  {
184 
185  if (!enableDQMClients_ ) return;
186 
187  if(offlineDQM_) return;
188 
189  edm::LogVerbatim ("rpcdqmclient") <<"[RPCDqmClient]: End of LS ";
190 
191  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ )
192  (*it)->endLuminosityBlock( lumiSeg, c);
193 
194  float rpcevents = minimumEvents_;
195  if(RPCEvents_) rpcevents = RPCEvents_ ->getBinContent(1);
196 
197  if( rpcevents < minimumEvents_) return;
198 
199  if( !init_ ){
200 
201  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
202  (*it)->clientOperation(c);
203  }
204  init_ = true;
205  return;
206  }
207 
208  lumiCounter_++;
209 
210  if (lumiCounter_%prescaleGlobalFactor_ != 0) return;
211 
212 
213  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
214  (*it)->clientOperation(c);
215  }
216 
217 }
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  //loop on all geometry and get all histos
122  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
123  if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
124 
125  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
126  std::vector< const RPCRoll*> roles = (ch->rolls());
127  //Loop on rolls in given chamber
128  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
129  RPCDetId detId = (*r)->id();
130 
131  //Get Occupancy ME for roll
132  RPCGeomServ RPCname(detId);
133  std::string rollName= "";
134  //loop on clients
135  for( unsigned int cl = 0; cl<clientModules_.size(); cl++ ){
136  if(useRollInfo_) rollName = RPCname.name();
137  else rollName = RPCname.chambername();
138 
139  myMe = NULL;
140  myMe = dbe_->get(prefixDir_ +"/"+ folderStr->folderStructure(detId)+"/"+clientHisto_[cl]+ "_"+rollName);
141 
142  if (!myMe)continue;
143 
144  dbe_->tag(myMe, clientTag_[cl]);
145 
146  myMeVect.push_back(myMe);
147  myDetIds.push_back(detId);
148  }//end loop on clients
149  }//end loop on roll in given chamber
150  }
151  }//end loop on all geometry and get all histos
152 
153 
154  RPCEvents_ = dbe_->get(prefixDir_ +"/RPCEvents");
155 
156 
157  for (std::vector<RPCClient*>::iterator it = clientModules_.begin(); it!=clientModules_.end(); it++ ){
158  (*it)->getMonitorElements(myMeVect, myDetIds);
159  }
160 
161  delete folderStr;
162 
163 }
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:1509
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:1623
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 229 of file RPCDqmClient.cc.

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

Referenced by RPCDqmClient().

229  {
230 
231  for(unsigned int i = 0; i<clientList_.size(); i++){
232 
233  if( clientList_[i] == "RPCMultiplicityTest" ) {
234  clientHisto_.push_back("Multiplicity");
235  clientTag_.push_back(rpcdqm::MULTIPLICITY);
237  } else if ( clientList_[i] == "RPCDeadChannelTest" ){
238  clientHisto_.push_back("Occupancy");
240  clientTag_.push_back(rpcdqm::OCCUPANCY);
241  } else if ( clientList_[i] == "RPCClusterSizeTest" ){
242  clientHisto_.push_back("ClusterSize");
244  clientTag_.push_back(rpcdqm::CLUSTERSIZE);
245  } else if ( clientList_[i] == "RPCOccupancyTest" ){
246  clientHisto_.push_back("Occupancy");
248  clientTag_.push_back(rpcdqm::OCCUPANCY);
249  } else if ( clientList_[i] == "RPCNoisyStripTest" ){
250  clientHisto_.push_back("Occupancy");
252  clientTag_.push_back(rpcdqm::OCCUPANCY);
253  }
254  }
255 
256  return;
257 
258 }
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().