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 Types | Private Member Functions | Private Attributes
RPCEventSummary Class Reference

#include <RPCEventSummary.h>

Inheritance diagram for RPCEventSummary:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 RPCEventSummary (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCEventSummary ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 beginJob ()
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup 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)
 

Private Types

enum  RPCQualityFlags { DEAD = 6, PARTIALLY_DEAD =5 }
 

Private Member Functions

void clientOperation (DQMStore::IGetter &igetter)
 

Private Attributes

bool doEndcapCertification_
 
bool enableReportSummary_
 
std::string eventInfoPath_
 
std::pair< int, int > FEDRange_
 
std::string globalFolder_
 
bool init_
 
bool isIn_
 
int lumiCounter_
 
int minimumEvents_
 
int numberDisk_
 
int NumberOfFeds_
 
bool offlineDQM_
 
std::string prefixDir_
 
std::string prefixFolder_
 
int prescaleFactor_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 13 of file RPCEventSummary.h.

Member Enumeration Documentation

Enumerator
DEAD 
PARTIALLY_DEAD 

Definition at line 48 of file RPCEventSummary.h.

Constructor & Destructor Documentation

RPCEventSummary::RPCEventSummary ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file RPCEventSummary.cc.

References doEndcapCertification_, enableReportSummary_, eventInfoPath_, FEDRange_, edm::ParameterSet::getUntrackedParameter(), globalFolder_, minimumEvents_, numberDisk_, NumberOfFeds_, offlineDQM_, prefixFolder_, prescaleFactor_, and AlCaHLTBitMon_QueryRunRegistry::string.

16  {
17  edm::LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Constructor";
18 
19  enableReportSummary_ = ps.getUntrackedParameter<bool>("EnableSummaryReport",true);
20  prescaleFactor_ = ps.getUntrackedParameter<int>("PrescaleFactor", 1);
21  eventInfoPath_ = ps.getUntrackedParameter<std::string>("EventInfoPath", "RPC/EventInfo");
22 
23 
24  std::string subsystemFolder = ps.getUntrackedParameter<std::string>("RPCFolder", "RPC");
25  std::string recHitTypeFolder = ps.getUntrackedParameter<std::string>("RecHitTypeFolder", "AllHits");
26  std::string summaryFolder = ps.getUntrackedParameter<std::string>("SummaryFolder", "SummaryHistograms");
27 
28  globalFolder_ = subsystemFolder +"/"+ recHitTypeFolder +"/"+ summaryFolder ;
29  prefixFolder_ = subsystemFolder +"/"+ recHitTypeFolder ;
30 
31  minimumEvents_= ps.getUntrackedParameter<int>("MinimumRPCEvents", 10000);
32  numberDisk_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
33  doEndcapCertification_ = ps.getUntrackedParameter<bool>("EnableEndcapSummary", false);
34 
35  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
36  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
37 
38  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
39 
40  offlineDQM_ = ps.getUntrackedParameter<bool> ("OfflineDQM",true);
41 
42 
43 }
std::string eventInfoPath_
T getUntrackedParameter(std::string const &, T const &) const
std::string globalFolder_
std::pair< int, int > FEDRange_
std::string prefixFolder_
RPCEventSummary::~RPCEventSummary ( )
virtual

Destructor.

Definition at line 45 of file RPCEventSummary.cc.

45  {
46  edm::LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Destructor ";
47 }

Member Function Documentation

void RPCEventSummary::beginJob ( void  )
protectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 49 of file RPCEventSummary.cc.

References init_.

49  {
50  edm::LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Begin job ";
51  init_ = false;
52 }
void RPCEventSummary::clientOperation ( DQMStore::IGetter igetter)
private

Definition at line 185 of file RPCEventSummary.cc.

References ztail::d, DEAD, doEndcapCertification_, eventInfoPath_, MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), globalFolder_, i, minimumEvents_, numberDisk_, PARTIALLY_DEAD, prefixFolder_, alignCSCRings::r, alignCSCRings::s, MonitorElement::setBinContent(), w, and y.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

185  {
186 
187  float rpcevents = minimumEvents_;
188  MonitorElement * RPCEvents ;
189  RPCEvents = igetter.get( prefixFolder_ +"/RPCEvents");
190 
191  if(RPCEvents) {
192  rpcevents = RPCEvents ->getBinContent(1);
193  }
194 
195 
196  if(rpcevents < minimumEvents_) return;
197  std::stringstream meName;
198  MonitorElement * myMe;
199 
200  meName.str("");
201  meName<<eventInfoPath_ + "/reportSummaryMap";
202  MonitorElement * reportMe = igetter.get(meName.str());
203 
204  MonitorElement * globalMe;
205 
206  //BARREL
207  float barrelFactor = 0;
208 
209  for(int w = -2 ; w<3; w++){
210 
211  meName.str("");
212  meName<<globalFolder_<<"/RPCChamberQuality_Roll_vs_Sector_Wheel"<<w;
213  myMe = igetter.get(meName.str());
214 
215  if(myMe){
216  float wheelFactor = 0;
217 
218  for(int s = 1; s<=myMe->getNbinsX() ; s++){
219  float sectorFactor = 0;
220  int rollInSector = 0;
221 
222 
223  for(int r = 1;r<=myMe->getNbinsY(); r++){
224  if((s!=4 && r > 17 ) || ((s ==9 ||s ==10) && r >15 ) ) continue;
225  rollInSector++;
226 
227 
228  if(myMe->getBinContent(s,r) == PARTIALLY_DEAD) sectorFactor+=0.8;
229  else if(myMe->getBinContent(s,r) == DEAD )sectorFactor+=0;
230  else sectorFactor+=1;
231 
232  }
233  if(rollInSector!=0)
234  sectorFactor = sectorFactor/rollInSector;
235 
236  if(reportMe) reportMe->setBinContent(w+8, s, sectorFactor);
237  wheelFactor += sectorFactor;
238 
239  }//end loop on sectors
240 
241  wheelFactor = wheelFactor/myMe->getNbinsX();
242 
243  meName.str("");
244  meName<<eventInfoPath_ + "/reportSummaryContents/RPC_Wheel"<<w;
245  globalMe=igetter.get(meName.str());
246  if(globalMe) globalMe->Fill(wheelFactor);
247 
248  barrelFactor += wheelFactor;
249  }//
250  }//end loop on wheel
251 
252  barrelFactor = barrelFactor/5;
253 
254 
255  float endcapFactor = 0;
256 
258 
259  //Endcap
260  for(int d = -numberDisk_ ; d<= numberDisk_; d++){
261  if (d==0) continue;
262 
263  meName.str("");
264  meName<<globalFolder_<<"/RPCChamberQuality_Ring_vs_Segment_Disk"<<d;
265  myMe = igetter.get(meName.str());
266 
267  if(myMe){
268  float diskFactor = 0;
269 
270  float sectorFactor[6]= {0,0,0,0,0,0};
271 
272  for (int i = 0 ;i <6;i++){
273  int firstSeg = (i *6 )+1;
274  int lastSeg = firstSeg +6;
275  int rollInSector = 0;
276  for(int seg = firstSeg; seg< lastSeg ; seg++){
277 
278  for(int y = 1;y<=myMe->getNbinsY(); y++){
279  rollInSector++;
280  if(myMe->getBinContent(seg,y) == PARTIALLY_DEAD) sectorFactor[i]+=0.8;
281  else if(myMe->getBinContent(seg,y) == DEAD )sectorFactor[i]+=0;
282  else sectorFactor[i]+=1;
283 
284  }
285  }
286  sectorFactor[i] = sectorFactor[i]/rollInSector;
287  }//end loop on Sectors
288 
289 
290  for (int sec = 0 ; sec<6; sec++){
291  diskFactor += sectorFactor[sec];
292  if(reportMe) {
293  if (d<0) reportMe->setBinContent(d+5, sec+1 , sectorFactor[sec]);
294  else reportMe->setBinContent(d+11, sec+1 , sectorFactor[sec]);
295  }
296  }
297 
298  diskFactor = diskFactor/6;
299 
300  meName.str("");
301  meName<<eventInfoPath_ + "/reportSummaryContents/RPC_Disk"<<d;
302  globalMe=igetter.get(meName.str());
303  if(globalMe) globalMe->Fill(diskFactor);
304 
305  endcapFactor += diskFactor;
306  }//end loop on disks
307 
308  }
309 
310  endcapFactor=endcapFactor/ (numberDisk_ * 2);
311 
312  }
313 
314  //Fill repor summary
315  float rpcFactor = barrelFactor;
316  if(doEndcapCertification_){ rpcFactor = ( barrelFactor + endcapFactor)/2; }
317 
318  globalMe = igetter.get(eventInfoPath_ +"/reportSummary");
319  if(globalMe) globalMe->Fill(rpcFactor);
320 
321 
322 }
std::string eventInfoPath_
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
const double w
Definition: UKUtility.cc:23
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
tuple d
Definition: ztail.py:151
std::string globalFolder_
double getBinContent(int binx) const
get content of bin (1-D)
std::string prefixFolder_
int getNbinsX(void) const
get # of bins in X-axis
void RPCEventSummary::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 180 of file RPCEventSummary.cc.

References clientOperation(), and isIn_.

180  {
181 
182  if(isIn_) { this->clientOperation(igetter);}
183 }
void clientOperation(DQMStore::IGetter &igetter)
void RPCEventSummary::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  setup 
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 54 of file RPCEventSummary.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), clientOperation(), eventInfoPath_, f, FEDRange_, MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), i, init_, isIn_, j, lumiCounter_, numberDisk_, offlineDQM_, prescaleFactor_, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

54  {
55 
56  edm::LogVerbatim ("rpceventsummary") << "[RPCEventSummary]: Begin run";
57 
58 
59  if(!init_){
61 
63 
64  int defaultValue = 1;
65  isIn_ = true;
66 
67  if(0 != setup.find( recordKey ) ) {
68  defaultValue = -1;
69  //get fed summary information
71  setup.get<RunInfoRcd>().get(sumFED);
72  std::vector<int> FedsInIds= sumFED->m_fed_in;
73  unsigned int f = 0;
74  isIn_ = false;
75  while(!isIn_ && f < FedsInIds.size()) {
76  int fedID=FedsInIds[f];
77  //make sure fed id is in allowed range
78  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
79  defaultValue = 1;
80  isIn_ = true;
81  }
82  f++;
83  }
84  }
85 
86  MonitorElement* me;
88 
89  //a global summary float [0,1] providing a global summary of the status
90  //and showing the goodness of the data taken by the the sub-system
91  std::string histoName="reportSummary";
92  me=0;
93  me = ibooker.bookFloat(histoName);
94  me->Fill(defaultValue);
95 
96  //TH2F ME providing a mapof values[0-1] to show if problems are localized or distributed
97  me=0;
98  me = ibooker.book2D("reportSummaryMap", "RPC Report Summary Map", 15, -7.5, 7.5, 12, 0.5 ,12.5);
99 
100  //customize the 2d histo
101  std::stringstream BinLabel;
102  for (int i= 1 ; i<=15; i++){
103  BinLabel.str("");
104  if(i<13){
105  BinLabel<<"Sec"<<i;
106  me->setBinLabel(i,BinLabel.str(),2);
107  }
108 
109  BinLabel.str("");
110  if(i<5)
111  BinLabel<<"Disk"<<i-5;
112  else if(i>11)
113  BinLabel<<"Disk"<<i-11;
114  else if(i==11 || i==5)
115  BinLabel.str("");
116  else
117  BinLabel<<"Wheel"<<i-8;
118 
119  me->setBinLabel(i,BinLabel.str(),1);
120  }
121 
122  //fill the histo with "1" --- just for the moment
123  for(int i=1; i<=15; i++){
124  for (int j=1; j<=12; j++ ){
125  if(i==5 || i==11 || (j>6 && (i<6 || i>10)))
126  me->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
127  else
128  me->setBinContent(i,j,defaultValue);
129  }
130  }
131 
132  if(numberDisk_ < 4)
133  for (int j=1; j<=12; j++ ){
134  me->setBinContent(1,j,-1);//bins that not correspond to subdetector parts
135  me->setBinContent(15,j,-1);
136  }
137 
138  //the reportSummaryContents folder containins a collection of ME floats [0-1] (order of 5-10)
139  // which describe the behavior of the respective subsystem sub-components.
140  ibooker.setCurrentFolder(eventInfoPath_+ "/reportSummaryContents");
141 
142  std::stringstream segName;
143  std::vector<std::string> segmentNames;
144  for(int i=-2; i<=2; i++){
145  segName.str("");
146  segName<<"RPC_Wheel"<<i;
147  segmentNames.push_back(segName.str());
148  }
149 
150  for(int i=-numberDisk_; i<=numberDisk_; i++){
151  if(i==0) continue;
152  segName.str("");
153  segName<<"RPC_Disk"<<i;
154  segmentNames.push_back(segName.str());
155  }
156 
157 
158  for(unsigned int i=0; i<segmentNames.size(); i++){
159  me =0;
160  me = ibooker.bookFloat(segmentNames[i]);
161  me->Fill(defaultValue);
162  }
163 
165  init_ = true;
166  }
167 
168 
169 
171  this->clientOperation(igetter);
172  }
173 
174  lumiCounter_++;
175 
176 }
std::string eventInfoPath_
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
double f[11][100]
void clientOperation(DQMStore::IGetter &igetter)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::pair< int, int > FEDRange_
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125

Member Data Documentation

bool RPCEventSummary::doEndcapCertification_
private

Definition at line 44 of file RPCEventSummary.h.

Referenced by clientOperation(), and RPCEventSummary().

bool RPCEventSummary::enableReportSummary_
private

Definition at line 35 of file RPCEventSummary.h.

Referenced by RPCEventSummary().

std::string RPCEventSummary::eventInfoPath_
private

Definition at line 32 of file RPCEventSummary.h.

Referenced by clientOperation(), dqmEndLuminosityBlock(), and RPCEventSummary().

std::pair<int, int> RPCEventSummary::FEDRange_
private

Definition at line 45 of file RPCEventSummary.h.

Referenced by dqmEndLuminosityBlock(), and RPCEventSummary().

std::string RPCEventSummary::globalFolder_
private

Definition at line 41 of file RPCEventSummary.h.

Referenced by clientOperation(), and RPCEventSummary().

bool RPCEventSummary::init_
private

Definition at line 38 of file RPCEventSummary.h.

Referenced by beginJob(), and dqmEndLuminosityBlock().

bool RPCEventSummary::isIn_
private

Definition at line 38 of file RPCEventSummary.h.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

int RPCEventSummary::lumiCounter_
private

Definition at line 40 of file RPCEventSummary.h.

Referenced by dqmEndLuminosityBlock().

int RPCEventSummary::minimumEvents_
private

Definition at line 36 of file RPCEventSummary.h.

Referenced by clientOperation(), and RPCEventSummary().

int RPCEventSummary::numberDisk_
private

Definition at line 43 of file RPCEventSummary.h.

Referenced by clientOperation(), dqmEndLuminosityBlock(), and RPCEventSummary().

int RPCEventSummary::NumberOfFeds_
private

Definition at line 46 of file RPCEventSummary.h.

Referenced by RPCEventSummary().

bool RPCEventSummary::offlineDQM_
private

Definition at line 39 of file RPCEventSummary.h.

Referenced by dqmEndLuminosityBlock(), and RPCEventSummary().

std::string RPCEventSummary::prefixDir_
private

Definition at line 32 of file RPCEventSummary.h.

std::string RPCEventSummary::prefixFolder_
private

Definition at line 41 of file RPCEventSummary.h.

Referenced by clientOperation(), and RPCEventSummary().

int RPCEventSummary::prescaleFactor_
private

Definition at line 36 of file RPCEventSummary.h.

Referenced by dqmEndLuminosityBlock(), and RPCEventSummary().