CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
RPCDBPopConAnalyzer Class Reference
Inheritance diagram for RPCDBPopConAnalyzer:
popcon::PopConAnalyzer< RPCDBHandler > edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef RPCDBHandler SourceHandler
 
- Public Types inherited from popcon::PopConAnalyzer< RPCDBHandler >
typedef RPCDBHandler SourceHandler
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 

Public Member Functions

 RPCDBPopConAnalyzer (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from popcon::PopConAnalyzer< RPCDBHandler >
 PopConAnalyzer (const edm::ParameterSet &pset)
 
virtual ~PopConAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &ev, const edm::EventSetup &iSetup)
 
virtual void beginRun (const edm::Run &run, const edm::EventSetup &iSetup)
 
virtual void endJob ()
 
void write ()
 

Private Attributes

DQMStoredbe
 
std::string efficiencyFolder_
 
popcon::PopCon m_populator
 
SourceHandler m_source
 
std::string recHitTypeFolder_
 
RPCDQMObjectrpcDQMObject
 
std::string subsystemFolder_
 
std::string summaryFolder_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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)
 

Detailed Description

Definition at line 25 of file RPCDBPopConAnalyzer.cc.

Member Typedef Documentation

Definition at line 28 of file RPCDBPopConAnalyzer.cc.

Constructor & Destructor Documentation

RPCDBPopConAnalyzer::RPCDBPopConAnalyzer ( const edm::ParameterSet pset)
inline

Definition at line 30 of file RPCDBPopConAnalyzer.cc.

References efficiencyFolder_, edm::ParameterSet::getUntrackedParameter(), recHitTypeFolder_, AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, and summaryFolder_.

30  :
32  m_populator(pset),
33  m_source(pset.getParameter<edm::ParameterSet>("Source")) {
34  subsystemFolder_= pset.getUntrackedParameter<std::string>("RPCFolder", "RPC");
35  recHitTypeFolder_= pset.getUntrackedParameter<std::string>("RecHitTypeFolder", "Noise");
36  summaryFolder_= pset.getUntrackedParameter<std::string>("SummaryFolder", "SummaryHistograms");
37  efficiencyFolder_= pset.getUntrackedParameter<std::string>("EfficiencyFolder", "RPCEfficiency");
38  }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

virtual void RPCDBPopConAnalyzer::analyze ( const edm::Event ev,
const edm::EventSetup iSetup 
)
inlineprivatevirtual

Reimplemented from popcon::PopConAnalyzer< RPCDBHandler >.

Definition at line 54 of file RPCDBPopConAnalyzer.cc.

References RPCDQMObject::DQMObjectItem::bx, RPCDQMObject::DQMObjectItem::bxrms, RPCDQMObject::DQMObjectItem::clusterSize, dbe, rpcdqm::utils::detId2RollNr(), RPCDQMObject::DQMObjectItem::dpid, RPCDQMObject::DQMObjectItem::efficiency, efficiencyFolder_, RPCBookFolderStructure::folderStructure(), edm::EventSetup::get(), DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getMean(), MonitorElement::getRMS(), RPCDetId::layer(), RPCGeomServ::name(), NULL, RPCDQMObject::DQMObjectItem::numcluster, RPCDQMObject::DQMObjectItem::numdigi, alignCSCRings::r, recHitTypeFolder_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCChamber::rolls(), rpcDQMObject, RPCDetId::sector(), RPCGeomServ::segment(), RPCDQMObject::DQMObjectItem::status, AlCaHLTBitMon_QueryRunRegistry::string, subsystemFolder_, summaryFolder_, and RPCDQMObject::v_cls.

54  { //}
55 
56  //virtual void endRun(const edm::Run& r, const edm::EventSetup& iSetup){
57 
58  rpcDQMObject = new RPCDQMObject();
59  RPCDQMObject::DQMObjectItem rpcDqmItem;
60 
62  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
63  //Loop on RPC geometry to access ME for each roll
64 
66  rpcdqm::utils rpcUtils;
67 
68  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
69  if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
70  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
71  std::vector< const RPCRoll*> roles = (ch->rolls());
72  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
73 
74  //Get RPC DetId
75  RPCDetId rpcId = (*r)->id();
76 
77  //Check if rpcId is Valid. If not continue;
78 
79  //Get roll name
80  RPCGeomServ rpcsrv(rpcId);
81  std::string nameRoll = rpcsrv.name();
82 
83  //Get ME
84  std::stringstream mepath;
85  mepath.str("");
86  // mepath<<"RPCPVT";
87  MonitorElement * MEnumcls = dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId) + "/" + "NumberOfClusters_" + nameRoll);
88  MonitorElement * MEcls = dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId) + "/" + "ClusterSize_" + nameRoll);
89  MonitorElement * MEocc= dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId) + "/" + "Occupancy_" + nameRoll);
90  MonitorElement * MEbx = dbe->get(subsystemFolder_ + "/" + recHitTypeFolder_ + "/" + folderStr->folderStructure(rpcId) + "/" + "BXN_" + nameRoll);
91 
92  MonitorElement * MEstatus = NULL;
93  MonitorElement * MEeff = NULL;
94  rpcDqmItem.status = -999;
95  rpcDqmItem.efficiency= -999;
96 
97  if( rpcId.region() == 0){ //BARREL
98 
99  int nr = rpcUtils.detId2RollNr(rpcId);
100  int sector = (int)rpcId.sector();
101 
102  //Status
103  mepath.str("");
104  mepath<<subsystemFolder_<<"/" << recHitTypeFolder_<<"/" << summaryFolder_<<"/RPCChamberQuality_Roll_vs_Sector_Wheel"<<rpcId.ring();
105  MEstatus = dbe->get(mepath.str());
106  if(MEstatus != 0 ){
107  rpcDqmItem.status = MEstatus->getBinContent(sector, nr);
108  }else{
109  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Status for Barrel "<< nameRoll;
110  }
111 
112  //Efficiency
113  mepath.str("");
114  if( rpcId.ring() > 0){
115  mepath<<subsystemFolder_<<"/" << efficiencyFolder_<<"/Efficiency_Roll_vs_Sector_Wheel_+"<<rpcId.ring();
116  }else{
117  mepath<<subsystemFolder_<<"/" << efficiencyFolder_<<"/Efficiency_Roll_vs_Sector_Wheel_"<<rpcId.ring();
118  }
119 
120  MEeff = dbe->get(mepath.str());
121  if(MEeff != 0 ){
122  rpcDqmItem.efficiency = MEeff->getBinContent(sector, nr);
123  }else{
124  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Efficiency for Barrel "<< nameRoll;
125  }
126 
127 
128  }else{
129  int segment = rpcsrv.segment() ;
130  int endcapbin = (rpcId.ring()-1)*3-rpcId.roll()+1;
131  int disk = (rpcId.region() * rpcId.layer());
132 
133  //Status
134  mepath.str("");
135  mepath<<subsystemFolder_<<"/" << recHitTypeFolder_<<"/" << summaryFolder_<<"/RPCChamberQuality_Ring_vs_Segment_Disk"<<disk;
136  MEstatus = dbe->get(mepath.str());
137  if(MEstatus != 0 ){
138  rpcDqmItem.status = MEstatus->getBinContent(segment,endcapbin);
139  }else{
140  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Status for Endcap "<< nameRoll;
141  }
142 
143 
144  //Efficiency
145  mepath.str("");
146  mepath<<subsystemFolder_<<"/" << efficiencyFolder_<<"/Efficiency_Roll_vs_Segment_Disk_"<<disk;
147  MEeff = dbe->get(mepath.str());
148  if(MEeff != 0 ){
149  rpcDqmItem.efficiency = MEeff->getBinContent(segment,endcapbin);
150  }else{
151  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Efficiency for Endcap "<< nameRoll;
152  }
153 
154 
155  }
156 
157  rpcDqmItem.dpid = (int)rpcId;
158  rpcDqmItem.clusterSize = -999;
159  rpcDqmItem.numdigi = -999;
160  rpcDqmItem.numcluster =-999;
161  rpcDqmItem.bx = -999;
162  rpcDqmItem.bxrms = -999;
163  //rpcDqmItem.status = -999;
164 
165  if (MEnumcls != 0) {
166  rpcDqmItem.numcluster = (float)MEnumcls->getMean();
167  }else{
168  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Number of Clusters for Roll "<< nameRoll;
169  }
170 
171  if (MEcls != 0) {
172  rpcDqmItem.clusterSize = (float)MEcls->getMean();
173  }else{
174  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find ClusterSize for Roll "<< nameRoll;
175  }
176 
177  if (MEbx != 0) {
178  rpcDqmItem.bx = (float)MEbx->getMean();
179  rpcDqmItem.bxrms = (float)MEbx->getRMS();
180  }else{
181  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find BX for Roll "<< nameRoll;
182  }
183 
184  if (MEocc != 0) {
185  rpcDqmItem.numdigi = (float)MEocc->getEntries();
186  }else{
187  edm::LogWarning("rpcdbclient")<< "[RPCDBClient] Did not find Occupancy for Roll "<< nameRoll;
188  }
189 
190 
191 
192  (rpcDQMObject->v_cls).push_back(rpcDqmItem);
193  }//End loop Rolls
194  }
195  }//End loop RPC Geometry
196 
197  }
std::vector< DQMObjectItem > v_cls
Definition: RPCDQMObject.h:35
#define NULL
Definition: scimark2.h:8
double getEntries(void) const
get # of entries
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
int roll() const
Definition: RPCDetId.h:123
int ring() const
Definition: RPCDetId.h:75
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:70
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
int layer() const
Definition: RPCDetId.h:111
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:18
std::string folderStructure(RPCDetId detId)
const T & get() const
Definition: EventSetup.h:55
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:105
double getBinContent(int binx) const
get content of bin (1-D)
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:66
virtual void RPCDBPopConAnalyzer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
inlineprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file RPCDBPopConAnalyzer.cc.

References dbe, cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

48  {
50  dbe->setCurrentFolder("RPCPVT");
51  }//beginRun
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
virtual void RPCDBPopConAnalyzer::endJob ( void  )
inlineprivatevirtual

Reimplemented from popcon::PopConAnalyzer< RPCDBHandler >.

Definition at line 41 of file RPCDBPopConAnalyzer.cc.

References dbe, RPCDBHandler::initObject(), m_source, rpcDQMObject, and write().

42  {
44  write();
45  dbe =0;
46  }
void initObject(RPCDQMObject *)
Definition: RPCDBHandler.cc:32
void RPCDBPopConAnalyzer::write ( void  )
inlineprivate

Definition at line 199 of file RPCDBPopConAnalyzer.cc.

References m_populator, m_source, and popcon::PopCon::write().

Referenced by endJob(), and pkg.AbstractPkg::generate().

void write(Source const &source)
Definition: PopCon.h:125

Member Data Documentation

DQMStore* RPCDBPopConAnalyzer::dbe
private

Definition at line 209 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), beginRun(), and endJob().

std::string RPCDBPopConAnalyzer::efficiencyFolder_
private

Definition at line 208 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().

popcon::PopCon RPCDBPopConAnalyzer::m_populator
private

Definition at line 202 of file RPCDBPopConAnalyzer.cc.

Referenced by write().

SourceHandler RPCDBPopConAnalyzer::m_source
private

Definition at line 203 of file RPCDBPopConAnalyzer.cc.

Referenced by endJob(), and write().

std::string RPCDBPopConAnalyzer::recHitTypeFolder_
private

Definition at line 207 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().

RPCDQMObject* RPCDBPopConAnalyzer::rpcDQMObject
private

Definition at line 210 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and endJob().

std::string RPCDBPopConAnalyzer::subsystemFolder_
private

Definition at line 205 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().

std::string RPCDBPopConAnalyzer::summaryFolder_
private

Definition at line 206 of file RPCDBPopConAnalyzer.cc.

Referenced by analyze(), and RPCDBPopConAnalyzer().