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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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_
 
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
 
- 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 184 of file RPCEventSummary.cc.

References 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 detailsBasic3DVector::y.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

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

References clientOperation().

179  {
180 
181  this->clientOperation(igetter);
182 }
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(), archive::flag, edm::EventSetup::get(), hltbtagharvestinganalyzer_cfi::histoName, i, init_, 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 
66  if(0 != setup.find( recordKey ) ) {
67  defaultValue = -1;
68  //get fed summary information
70  setup.get<RunInfoRcd>().get(sumFED);
71  std::vector<int> FedsInIds= sumFED->m_fed_in;
72  unsigned int f = 0;
73  bool flag = false;
74  while(!flag && f < FedsInIds.size()) {
75  int fedID=FedsInIds[f];
76  //make sure fed id is in allowed range
77  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
78  defaultValue = 1;
79  flag = true;
80  }
81  f++;
82  }
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 
170  this->clientOperation(igetter);
171  }
172 
173  lumiCounter_++;
174 
175 }
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:274
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().

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().