CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RPCRecHitValidClient Class Reference

#include <RPCRecHitValidClient.h>

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

Public Member Functions

void dqmEndJob (DQMStore::IBooker &booker, DQMStore::IGetter &getter)
 
 RPCRecHitValidClient (const edm::ParameterSet &pset)
 
 ~RPCRecHitValidClient ()
 
- 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 dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

Private Attributes

std::string subDir_
 

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)
 
- 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 18 of file RPCRecHitValidClient.h.

Constructor & Destructor Documentation

RPCRecHitValidClient::RPCRecHitValidClient ( const edm::ParameterSet pset)
RPCRecHitValidClient::~RPCRecHitValidClient ( )
inline

Definition at line 22 of file RPCRecHitValidClient.h.

22 {};

Member Function Documentation

void RPCRecHitValidClient::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
virtual

Implements DQMEDHarvester.

Definition at line 17 of file RPCRecHitValidClient.cc.

References newFWLiteAna::bin, DQMStore::IBooker::book1D(), alignCSCRings::e, MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getTH1(), min(), nEvent, and DQMStore::IBooker::setCurrentFolder().

18 {
19  booker.setCurrentFolder(subDir_);
20  MEP me_rollEfficiencyBarrel_eff = booker.book1D("RollEfficiencyBarrel_eff", "Roll efficiency in Barrel;Efficiency [%]", 50+2, -2, 100+2);
21  MEP me_rollEfficiencyEndcap_eff = booker.book1D("RollEfficiencyEndcap_eff", "Roll efficiency in Endcap;Efficiency [%]", 50+2, -2, 100+2);
22  MEP me_rollEfficiencyStatCutOffBarrel_eff = booker.book1D("RollEfficiencyCutOffBarrel_eff", "Roll efficiency in Barrel without low stat chamber;Efficiency [%]", 50+2, -2, 100+2);
23  MEP me_rollEfficiencyStatCutOffEndcap_eff = booker.book1D("RollEfficiencyCutOffEndcap_eff", "Roll efficiency in Endcap without low stat chamber;Efficiency [%]", 50+2, -2, 100+2);
24 
25  const double maxNoise = 1e-7;
26  MEP me_rollNoiseBarrel_noise = booker.book1D("RollNoiseBarrel_noise", "Roll noise in Barrel;Noise level [Event^{-1}cm^{-2}]", 25+2, -maxNoise/25, maxNoise+maxNoise/25);
27  MEP me_rollNoiseEndcap_noise = booker.book1D("RollNoiseEndcap_noise", "Roll noise in Endcap;Noise level [Event^{-1}cm^{-2}]", 25+2, -maxNoise/25, maxNoise+maxNoise/25);
28 
29  MEP me_matchOccupancyBarrel_detId = getter.get(subDir_+"/Occupancy/MatchOccupancyBarrel_detId");
30  MEP me_matchOccupancyEndcap_detId = getter.get(subDir_+"/Occupancy/MatchOccupancyEndcap_detId");
31  MEP me_refOccupancyBarrel_detId = getter.get(subDir_+"/Occupancy/RefOccupancyBarrel_detId");
32  MEP me_refOccupancyEndcap_detId = getter.get(subDir_+"/Occupancy/RefOccupancyEndcap_detId");
33 
34  if ( me_matchOccupancyBarrel_detId and me_refOccupancyBarrel_detId )
35  {
36  TH1* h_matchOccupancyBarrel_detId = me_matchOccupancyBarrel_detId->getTH1();
37  TH1* h_refOccupancyBarrel_detId = me_refOccupancyBarrel_detId->getTH1();
38 
39  for ( int bin = 1, nBin = h_matchOccupancyBarrel_detId->GetNbinsX(); bin <= nBin; ++bin )
40  {
41  const double nRec = h_matchOccupancyBarrel_detId->GetBinContent(bin);
42  const double nRef = h_refOccupancyBarrel_detId->GetBinContent(bin);
43 
44  const double eff = nRef ? nRec/nRef*100 : -1;
45 
46  me_rollEfficiencyBarrel_eff->Fill(eff);
47  if ( nRef >= 20 ) me_rollEfficiencyStatCutOffBarrel_eff->Fill(eff);
48  }
49  }
50 
51  if ( me_matchOccupancyEndcap_detId and me_refOccupancyEndcap_detId )
52  {
53  TH1* h_matchOccupancyEndcap_detId = me_matchOccupancyEndcap_detId->getTH1();
54  TH1* h_refOccupancyEndcap_detId = me_refOccupancyEndcap_detId->getTH1();
55 
56  for ( int bin = 1, nBin = h_matchOccupancyEndcap_detId->GetNbinsX(); bin <= nBin; ++bin )
57  {
58  const double nRec = h_matchOccupancyEndcap_detId->GetBinContent(bin);
59  const double nRef = h_refOccupancyEndcap_detId->GetBinContent(bin);
60 
61  const double eff = nRef ? nRec/nRef*100 : -1;
62 
63  me_rollEfficiencyEndcap_eff->Fill(eff);
64  if ( nRef >= 20 ) me_rollEfficiencyStatCutOffEndcap_eff->Fill(eff);
65  }
66  }
67 
68  MEP me_eventCount = getter.get(subDir_+"/Occupancy/EventCount");
69  const double nEvent = me_eventCount ? me_eventCount->getTH1()->GetBinContent(1) : 1;
70  MEP me_noiseOccupancyBarrel_detId = getter.get(subDir_+"/Occupancy/NoiseOccupancyBarrel_detId");
71  MEP me_rollAreaBarrel_detId = getter.get(subDir_+"/Occupancy/RollAreaBarrel_detId");
72  if ( me_noiseOccupancyBarrel_detId and me_rollAreaBarrel_detId )
73  {
74  TH1* h_noiseOccupancyBarrel_detId = me_noiseOccupancyBarrel_detId->getTH1();
75  TH1* h_rollAreaBarrel_detId = me_rollAreaBarrel_detId->getTH1();
76 
77  for ( int bin = 1, nBin = h_noiseOccupancyBarrel_detId->GetNbinsX(); bin <= nBin; ++bin )
78  {
79  const double noiseCount = h_noiseOccupancyBarrel_detId->GetBinContent(bin);
80  const double area = h_rollAreaBarrel_detId->GetBinContent(bin);
81  const double noiseLevel = area > 0 ? noiseCount/area/nEvent : 0;
82  if ( noiseLevel == 0. ) me_rollNoiseBarrel_noise->Fill(-maxNoise/50); // Fill underflow bin if noise is exactly zero
83  else me_rollNoiseBarrel_noise->Fill(std::min(noiseLevel, maxNoise));
84  }
85  }
86 
87  MEP me_noiseOccupancyEndcap_detId = getter.get(subDir_+"/Occupancy/NoiseOccupancyEndcap_detId");
88  MEP me_rollAreaEndcap_detId = getter.get(subDir_+"/Occupancy/RollAreaEndcap_detId");
89  if ( me_noiseOccupancyEndcap_detId and me_rollAreaEndcap_detId )
90  {
91  TH1* h_noiseOccupancyEndcap_detId = me_noiseOccupancyEndcap_detId->getTH1();
92  TH1* h_rollAreaEndcap_detId = me_rollAreaEndcap_detId->getTH1();
93 
94  for ( int bin = 1, nBin = h_noiseOccupancyEndcap_detId->GetNbinsX(); bin <= nBin; ++bin )
95  {
96  const double noiseCount = h_noiseOccupancyEndcap_detId->GetBinContent(bin);
97  const double area = h_rollAreaEndcap_detId->GetBinContent(bin);
98  const double noiseLevel = area > 0 ? noiseCount/area/nEvent : 0;
99  if ( noiseLevel == 0 ) me_rollNoiseEndcap_noise->Fill(-maxNoise/50); // Fill underflow bin if noise if exactly zero
100  else me_rollNoiseEndcap_noise->Fill(std::min(noiseLevel, maxNoise));
101  }
102  }
103 
104 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
int nEvent
Definition: myFastSimVal.cc:49
void Fill(long long x)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
TH1 * getTH1(void) const
T min(T a, T b)
Definition: MathUtil.h:58
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274

Member Data Documentation

std::string RPCRecHitValidClient::subDir_
private

Definition at line 27 of file RPCRecHitValidClient.h.