CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
clientTools.h
Go to the documentation of this file.
1 #ifndef rpcdqmclient_clientTools_H
2 #define rpcdqmclient_clientTools_H
3 
5 
7 
10 
14 
15 #include <vector>
16 #include <iomanip>
17 
18 
19 namespace rpcdqmclient{
20  class clientTools{
21  public:
22 
23  std::vector<MonitorElement*> constructMEVector(const edm::EventSetup& iSetup, const std::string & prefixDir, const std::string & MEName, DQMStore* dbe ){
24  cout<<"Starting ConstructMEVector"<<endl;
25  this->getMEs(iSetup, prefixDir, MEName, dbe);
26 
27  return myMeVect_;
28  }
29 
30  std::vector<RPCDetId> getAssociatedRPCdetId(){
31  std::vector<RPCDetId> myVector;
32  myVector.clear();
33 
34  if (myMeVect_.size() !=0 && myMeVect_.size()==myDetIds_.size() ) myVector= myDetIds_;
35 
36  return myVector;
37  }
38 
39 
40  protected:
41 
42  void getMEs(const edm::EventSetup& iSetup, const std::string & prefixDir, const std::string & MEName , DQMStore* dbe){
43 
44 
45 
47  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
48 
49  //loop on all geometry and get all histos
50  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
51  if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
52 
53  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
54  std::vector< const RPCRoll*> roles = (ch->rolls());
55  //Loop on rolls in given chamber
56  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
57  RPCDetId detId = (*r)->id();
58 
59  //Get Occupancy ME for roll
60  RPCGeomServ RPCname(detId);
62  MonitorElement * myMe = dbe->get(prefixDir+"/"+ folderStr->folderStructure(detId)+"/"+MEName+ "_"+RPCname.name());
63  if (!myMe)continue;
64 
65  myMeVect_.push_back(myMe);
66  myDetIds_.push_back(detId);
67  myRollNames_.push_back(RPCname.name());
68 
69  }
70  }
71  }//end loop on all geometry and get all histos
72  }
73 
74 
75 
76  private:
77  std::vector<MonitorElement *> myMeVect_;
78  std::vector<RPCDetId> myDetIds_;
79  std::vector<std::string> myRollNames_;
80 
81 
82  };
83 }
84 
85 #endif
std::vector< RPCDetId > getAssociatedRPCdetId()
Definition: clientTools.h:30
std::vector< MonitorElement * > myMeVect_
Definition: clientTools.h:77
virtual std::string name()
Definition: RPCGeomServ.cc:20
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:68
std::vector< std::string > myRollNames_
Definition: clientTools.h:79
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
void getMEs(const edm::EventSetup &iSetup, const std::string &prefixDir, const std::string &MEName, DQMStore *dbe)
Definition: clientTools.h:42
std::string folderStructure(RPCDetId detId)
std::vector< RPCDetId > myDetIds_
Definition: clientTools.h:78
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121
std::vector< MonitorElement * > constructMEVector(const edm::EventSetup &iSetup, const std::string &prefixDir, const std::string &MEName, DQMStore *dbe)
Definition: clientTools.h:23