#include <DQM/RPCMonitorClient/interface/RPCDeadChannelTest.h>
Public Member Functions | |
void | analyze (const edm::Event &, const edm::EventSetup &) |
Analyze. | |
void | beginJob (const edm::EventSetup &) |
BeginJob. | |
void | beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) |
Begin Lumi block. | |
void | beginRun (const edm::Run &, const edm::EventSetup &) |
void | endJob () |
Endjob. | |
void | endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) |
End Lumi Block. | |
void | endRun (const edm::Run &, const edm::EventSetup &) |
RPCDeadChannelTest (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~RPCDeadChannelTest () |
Destructor. | |
Protected Member Functions | |
void | fillDeadChannelHisto (const std::map< int, std::map< int, std::pair< float, float > > > &sumMap, int region) |
Private Attributes | |
DQMStore * | dbe_ |
std::string | globalFolder_ |
std::map< RPCDetId, MonitorElement * > | meCollection |
edm::ESHandle< RPCGeometry > | muonGeom |
edm::ParameterSet | parameters |
std::string | prefixDir_ |
int | prescaleFactor_ |
Definition at line 38 of file RPCDeadChannelTest.h.
RPCDeadChannelTest::RPCDeadChannelTest | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 26 of file RPCDeadChannelTest.cc.
References edm::ParameterSet::getUntrackedParameter(), globalFolder_, prefixDir_, and prescaleFactor_.
00026 { 00027 00028 LogVerbatim ("deadChannel") << "[RPCDeadChannelTest]: Constructor"; 00029 00030 globalFolder_ = ps.getUntrackedParameter<string>("GlobalFolder", "SummaryHistograms"); 00031 prescaleFactor_ = ps.getUntrackedParameter<int>("diagnosticPrescale", 1); 00032 prefixDir_= ps.getUntrackedParameter<string>("GlobalFolder", "RPC/RecHits"); 00033 }
RPCDeadChannelTest::~RPCDeadChannelTest | ( | ) | [virtual] |
Destructor.
Definition at line 35 of file RPCDeadChannelTest.cc.
References dbe_.
00035 { 00036 dbe_ = 0; 00037 }
void RPCDeadChannelTest::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | c | |||
) | [virtual] |
void RPCDeadChannelTest::beginJob | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
BeginJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 39 of file RPCDeadChannelTest.cc.
References dbe_, and DQMStore::setVerbose().
00039 { 00040 00041 LogVerbatim ("deadChannel") << "[RPCDeadChannelTest]: Begin job"; 00042 dbe_ = Service<DQMStore>().operator->(); 00043 dbe_->setVerbose(0); 00044 }
void RPCDeadChannelTest::beginLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, | |
edm::EventSetup const & | context | |||
) | [virtual] |
Begin Lumi block.
Reimplemented from edm::EDAnalyzer.
Definition at line 179 of file RPCDeadChannelTest.cc.
void RPCDeadChannelTest::beginRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 46 of file RPCDeadChannelTest.cc.
References DQMStore::book2D(), dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, i, me, prefixDir_, DQMStore::removeElement(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().
00046 { 00047 00048 edm::LogVerbatim ("deadChannel") << "[RPCDeadChannelTest]: Begin run"; 00049 00050 MonitorElement* me; 00051 dbe_->setCurrentFolder( prefixDir_+"/"+globalFolder_); 00052 00053 stringstream histoName, histoTitle; 00054 00055 for (int i = -4; i<=4;i++ ){ 00056 if (i>-3 && i<3){//wheels 00057 histoName.str(""); 00058 histoName<<"DeadChannels_Wheel"<<i; 00059 histoTitle.str(""); 00060 histoTitle<<"DeadChannels for Wheel "<<i; 00061 if ( me = dbe_->get(prefixDir_+"/"+globalFolder_ +"/"+ histoName.str()) ) { 00062 dbe_->removeElement(me->getName()); 00063 } 00064 00065 me = dbe_->book2D(histoName.str().c_str(), histoTitle.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5); 00066 for(int bin =1; bin<13;bin++) { 00067 histoName.str(""); 00068 histoName<<"Sec"<<bin; 00069 me->setBinLabel(bin,histoName.str().c_str(),1); 00070 } 00071 histoName.str(""); 00072 histoName<<"ClusterSize_vs_AliveStrips_Wheel"<<i; 00073 histoTitle.str(""); 00074 histoTitle<<"ClusterSize vs AliveStrips Wheel "<<i; 00075 if ( me = dbe_->get(prefixDir_+"/"+globalFolder_ +"/"+ histoName.str()) ) { 00076 dbe_->removeElement(me->getName()); 00077 } 00078 00079 me = dbe_->book2D(histoName.str().c_str(), histoTitle.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5); 00080 00081 00082 for(int bin =1; bin<13;bin++) { 00083 histoName.str(""); 00084 histoName<<"Sec"<<bin; 00085 me->setBinLabel(bin,histoName.str().c_str(),1); 00086 } 00087 }//end wheels 00088 00089 00090 histoName.str(""); 00091 histoName<<"DeadChannels_Disk"<<i; 00092 histoTitle.str(""); 00093 histoTitle<<"DeadChannels for Disk "<<i; 00094 if ( me = dbe_->get(prefixDir_+"/"+globalFolder_ +"/"+ histoName.str()) ) { 00095 dbe_->removeElement(me->getName()); 00096 } 00097 me = dbe_->book2D(histoName.str().c_str(), histoTitle.str().c_str(), 6, 0.5, 6.5, 54, 0.5, 54.5); 00098 00099 for(int bin =1; bin<7;bin++) { 00100 histoName.str(""); 00101 histoName<<"Sec"<<bin; 00102 me->setBinLabel(bin,histoName.str().c_str(),1); 00103 } 00104 00105 histoName.str(""); 00106 histoName<<"ClusterSize_vs_AliveStrips_Disk"<<i; 00107 histoTitle.str(""); 00108 histoTitle<<"ClusterSize vs AliveStrips Disk "<<i; 00109 if ( me = dbe_->get(prefixDir_+"/"+globalFolder_ +"/"+ histoName.str()) ) { 00110 dbe_->removeElement(me->getName()); 00111 } 00112 00113 me = dbe_->book2D(histoName.str().c_str(), histoTitle.str().c_str(), 6, 0.5, 6.5, 54, 0.5, 54.5); 00114 00115 00116 for(int bin =1; bin<7;bin++) { 00117 histoName.str(""); 00118 histoName<<"Sec"<<bin; 00119 me->setBinLabel(bin,histoName.str().c_str(),1); 00120 } 00121 } 00122 00123 histoName.str(""); 00124 histoName<<"DeadChannelPercentageBarrel"; 00125 if ( me = dbe_->get(prefixDir_+"/"+globalFolder_ +"/"+ histoName.str()) ) { 00126 dbe_->removeElement(me->getName()); 00127 } 00128 me = dbe_->book2D(histoName.str().c_str(), "Dead Channel Fraction in Barrel", 12, 0.5, 12.5, 5, -2.5, 2.5); 00129 00130 for(int xbin =1; xbin<13; xbin++) { 00131 histoName.str(""); 00132 histoName<<"Sec"<<xbin; 00133 me->setBinLabel(xbin,histoName.str().c_str(),1); 00134 } 00135 for(int ybin =1; ybin<5; ybin++) { 00136 histoName.str(""); 00137 histoName<<"Wheel"<<(ybin-3); 00138 me->setBinLabel(ybin,histoName.str().c_str(),2); 00139 } 00140 00141 histoName.str(""); 00142 histoName<<"DeadChannelPercentageEndcapPositive"; 00143 if ( me = dbe_->get(prefixDir_+"/"+globalFolder_ +"/"+ histoName.str()) ) { 00144 dbe_->removeElement(me->getName()); 00145 } 00146 me = dbe_->book2D(histoName.str().c_str(), "Dead Channel Fraction in Endcap+", 6, 0.5, 6.5, 4, -2, 2); 00147 00148 for(int xbin =1; xbin<7; xbin++) { 00149 histoName.str(""); 00150 histoName<<"Sec"<< xbin; 00151 me->setBinLabel( xbin,histoName.str().c_str(),1); 00152 } 00153 for(int ybin =1; ybin<5; ybin++) { 00154 histoName.str(""); 00155 histoName<<"Disk"<<ybin; 00156 me->setBinLabel(ybin,histoName.str().c_str(),2); 00157 } 00158 00159 histoName.str(""); 00160 histoName<<"DeadChannelPercentageEndcapNegative"; 00161 if ( me = dbe_->get(prefixDir_+"/"+globalFolder_ +"/"+ histoName.str()) ) { 00162 dbe_->removeElement(me->getName()); 00163 } 00164 me = dbe_->book2D(histoName.str().c_str(), "Dead Channel Fraction in Endcap-", 6, 0.5, 6.5,4, -2, 2); 00165 00166 for(int xbin =1; xbin<7; xbin++) { 00167 histoName.str(""); 00168 histoName<<"Sec"<< xbin; 00169 me->setBinLabel( xbin,histoName.str().c_str(),1); 00170 } 00171 for(int ybin =1; ybin<5; ybin++) { 00172 histoName.str(""); 00173 histoName<<"Disk-"<<ybin; 00174 me->setBinLabel(ybin,histoName.str().c_str(),2); 00175 } 00176 00177 }
void RPCDeadChannelTest::endLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, | |
edm::EventSetup const & | iSetup | |||
) | [virtual] |
End Lumi Block.
Reimplemented from edm::EDAnalyzer.
Definition at line 185 of file RPCDeadChannelTest.cc.
References dbe_, detId, rpcdqm::utils::detId2RollNr(), fillDeadChannelHisto(), RPCBookFolderStructure::folderStructure(), edm::EventSetup::get(), DQMStore::get(), QReport::getBadChannels(), MonitorElement::getBinContent(), MonitorElement::getQReport(), globalFolder_, edm::LuminosityBlock::id(), it, edm::LuminosityBlockID::luminosityBlock(), RPCGeomServ::name(), prefixDir_, prescaleFactor_, r, RPCDetId::region(), RPCDetId::ring(), RPCChamber::rolls(), RPCDetId::sector(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), and RPCDetId::station().
00185 { 00186 00187 edm::LogVerbatim ("deadChannel") <<"[RPCDeadChannelTest]: End of LS transition, performing the DQM client operation"; 00188 00189 // counts number of lumiSegs 00190 int nLumiSegs = lumiSeg.id().luminosityBlock(); 00191 00192 //check some statements and prescale Factor 00193 if(nLumiSegs%prescaleFactor_ == 0) { 00194 00195 ESHandle<RPCGeometry> rpcGeo; 00196 iSetup.get<MuonGeometryRecord>().get(rpcGeo); 00197 00198 map<int, map< int , pair<float,float> > > barrelMap, endcapMap; 00199 stringstream meName; 00200 //Loop on chambers 00201 for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){ 00202 if( dynamic_cast< RPCChamber* >( *it ) != 0 ){ 00203 RPCChamber* ch = dynamic_cast< RPCChamber* >( *it ); 00204 std::vector< const RPCRoll*> roles = (ch->rolls()); 00205 //Loop on rolls in given chamber 00206 for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){ 00207 RPCDetId detId = (*r)->id(); 00208 //Get Occupancy ME for roll 00209 RPCGeomServ RPCname(detId); 00210 00211 RPCBookFolderStructure * folderStr = new RPCBookFolderStructure(); 00212 MonitorElement * myMe = dbe_->get(prefixDir_+"/"+ folderStr->folderStructure(detId)+"/Occupancy_"+RPCname.name()); 00213 if (!myMe)continue; 00214 00215 MonitorElement * myGlobalMe; 00216 MonitorElement * myGlobalMe2; 00217 00218 const QReport * theOccupancyQReport = myMe->getQReport("DeadChannel_0"); 00219 if(!theOccupancyQReport) continue; 00220 00221 vector<dqm::me_util::Channel> badChannels = theOccupancyQReport->getBadChannels(); 00222 00223 if (detId.region()==0) { 00224 barrelMap[detId.ring()][detId.sector()].first += badChannels.size(); 00225 barrelMap[detId.ring()][detId.sector()].second += (*r)->nstrips() ; 00226 meName.str(""); 00227 meName<<prefixDir_+"/"+ globalFolder_+"/DeadChannels_Wheel"<<detId.ring(); 00228 }else{ 00229 endcapMap[detId.region()*detId.station()][detId.sector()].first += badChannels.size(); 00230 endcapMap[detId.region()*detId.station()][detId.sector()].second+=(*r)->nstrips() ; 00231 meName.str(""); 00232 meName<<prefixDir_+"/"+ globalFolder_+"/DeadChannels_Disk"<<detId.region()*detId.station(); 00233 } 00234 myGlobalMe = dbe_->get(meName.str()); 00235 if (!myGlobalMe)continue; 00236 rpcdqm::utils prova; 00237 int nr = prova.detId2RollNr(detId); 00238 myGlobalMe->setBinContent(detId.sector(),nr, badChannels.size()*100/(*r)->nstrips() ); 00239 00240 string Yaxis=RPCname.name(); 00241 if (detId.region()==0){ 00242 Yaxis.erase (1,1); 00243 Yaxis.erase(0,3); 00244 Yaxis.replace(Yaxis.find("S"),4,""); 00245 Yaxis.erase(Yaxis.find("_")+2,8); 00246 }else{ 00247 Yaxis.erase(0,8); 00248 } 00249 00250 myGlobalMe->setBinLabel(nr, Yaxis, 2); 00251 if (detId.region()==0){ 00252 meName.str(""); 00253 meName<<prefixDir_+"/"+ globalFolder_+"/ClusterSize_vs_AliveStrips_Wheel"<<detId.ring(); 00254 myGlobalMe = dbe_->get(meName.str()); 00255 meName.str(""); 00256 meName<<prefixDir_+"/"+ globalFolder_+"/ClusterSize_meanValue_Wheel_"<<detId.ring(); 00257 myGlobalMe2 = dbe_->get(meName.str()); 00258 00259 if(badChannels.size()!=(*r)->nstrips() ) 00260 myGlobalMe->setBinContent(detId.sector(),nr, (myGlobalMe2->getBinContent(detId.sector(),nr))/((*r)->nstrips()-badChannels.size()) ); 00261 else 00262 myGlobalMe->setBinContent(detId.sector(),nr, 100 ); 00263 } 00264 00265 myGlobalMe->setBinLabel(nr, Yaxis, 2); 00266 }//End loop on rolls in given chambers 00267 } 00268 }//End loop on chamber 00269 00270 this->fillDeadChannelHisto(barrelMap, 0); 00271 00272 this->fillDeadChannelHisto(endcapMap, 1); 00273 } 00274 }
void RPCDeadChannelTest::endRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [virtual] |
void RPCDeadChannelTest::fillDeadChannelHisto | ( | const std::map< int, std::map< int, std::pair< float, float > > > & | sumMap, | |
int | region | |||
) | [protected] |
Referenced by endLuminosityBlock().
DQMStore* RPCDeadChannelTest::dbe_ [private] |
Definition at line 79 of file RPCDeadChannelTest.h.
Referenced by beginJob(), beginRun(), endLuminosityBlock(), and ~RPCDeadChannelTest().
std::string RPCDeadChannelTest::globalFolder_ [private] |
Definition at line 76 of file RPCDeadChannelTest.h.
Referenced by beginRun(), endLuminosityBlock(), and RPCDeadChannelTest().
std::map<RPCDetId,MonitorElement*> RPCDeadChannelTest::meCollection [private] |
Definition at line 83 of file RPCDeadChannelTest.h.
edm::ESHandle<RPCGeometry> RPCDeadChannelTest::muonGeom [private] |
Definition at line 82 of file RPCDeadChannelTest.h.
Definition at line 81 of file RPCDeadChannelTest.h.
std::string RPCDeadChannelTest::prefixDir_ [private] |
Definition at line 76 of file RPCDeadChannelTest.h.
Referenced by beginRun(), endLuminosityBlock(), and RPCDeadChannelTest().
int RPCDeadChannelTest::prescaleFactor_ [private] |
Definition at line 75 of file RPCDeadChannelTest.h.
Referenced by endLuminosityBlock(), and RPCDeadChannelTest().