test
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
GlobalHitsTester Class Reference

#include <GlobalHitsTester.h>

Inheritance diagram for GlobalHitsTester:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GlobalHitsTester (const edm::ParameterSet &)
 
virtual ~GlobalHitsTester ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::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 ()
 

Private Attributes

unsigned int count
 
bool doOutput
 
std::string fName
 
int frequency
 
bool getAllProvenances
 
std::string label
 
MonitorElementmeTestFloat
 
MonitorElementmeTestInt
 
MonitorElementmeTestProfile1
 
MonitorElementmeTestProfile2
 
MonitorElementmeTestString
 
MonitorElementmeTestTH1F
 
MonitorElementmeTestTH2F
 
MonitorElementmeTestTH3F
 
std::string outputfile
 
bool printProvenanceInfo
 
TRandom * Random
 
double RandomVal1
 
double RandomVal2
 
double RandomVal3
 
int verbosity
 
int vtxunit
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::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 76 of file GlobalHitsTester.h.

Constructor & Destructor Documentation

GlobalHitsTester::GlobalHitsTester ( const edm::ParameterSet iPSet)
explicit

Definition at line 4 of file GlobalHitsTester.cc.

References doOutput, fName, frequency, getAllProvenances, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputfile, printProvenanceInfo, AlCaHLTBitMon_QueryRunRegistry::string, verbosity, and vtxunit.

4  :
5  fName(""), verbosity(0), frequency(0), vtxunit(0), label(""),
7 {
8  std::string MsgLoggerCat = "GlobalHitsTester_GlobalHitsTester";
9 
10  fName = iPSet.getUntrackedParameter<std::string>("Name");
11  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
12  frequency = iPSet.getUntrackedParameter<int>("Frequency");
13  vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit");
14  outputfile = iPSet.getParameter<std::string>("OutputFile");
15  doOutput = iPSet.getParameter<bool>("DoOutput");
16  edm::ParameterSet m_Prov =
17  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
19  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
21  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
22 
23  if (verbosity >= 0) {
24  edm::LogInfo(MsgLoggerCat)
25  << "\n===============================\n"
26  << "Initialized as EDAnalyzer with parameter values:\n"
27  << " Name = " << fName << "\n"
28  << " Verbosity = " << verbosity << "\n"
29  << " Frequency = " << frequency << "\n"
30  << " VtxUnit = " << vtxunit << "\n"
31  << " OutputFile = " << outputfile << "\n"
32  << " DoOutput = " << doOutput << "\n"
33  << " GetProv = " << getAllProvenances << "\n"
34  << " PrintProv = " << printProvenanceInfo << "\n"
35  << "===============================\n";
36  }
37 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string outputfile
unsigned int count
GlobalHitsTester::~GlobalHitsTester ( )
virtual

Definition at line 39 of file GlobalHitsTester.cc.

40 {
41 }

Member Function Documentation

void GlobalHitsTester::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 95 of file GlobalHitsTester.cc.

References MonitorElement::Fill(), i, meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestTH1F, meTestTH2F, meTestTH3F, RandomVal1, RandomVal2, and RandomVal3.

97 {
98 
99  for(int i = 0; i < 1000; ++i) {
100  RandomVal1 = Random->Gaus(0.,1.);
101  RandomVal2 = Random->Gaus(0.,1.);
102  RandomVal3 = Random->Gaus(0.,1.);
103 
109  }
110 
111  meTestInt->Fill(100);
112  meTestFloat->Fill(3.141592);
113 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meTestProfile1
MonitorElement * meTestInt
MonitorElement * meTestTH3F
void Fill(long long x)
MonitorElement * meTestProfile2
MonitorElement * meTestTH1F
MonitorElement * meTestFloat
MonitorElement * meTestTH2F
void GlobalHitsTester::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 43 of file GlobalHitsTester.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::book3D(), DQMStore::IBooker::bookFloat(), DQMStore::IBooker::bookInt(), DQMStore::IBooker::bookProfile(), DQMStore::IBooker::bookProfile2D(), DQMStore::IBooker::bookString(), meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestString, meTestTH1F, meTestTH2F, meTestTH3F, DQMStore::IBooker::setCurrentFolder(), and DQMStore::IBooker::tag().

44  {
45 
46  meTestString = 0;
47  meTestInt = 0;
48  meTestFloat = 0;
49  meTestTH1F = 0;
50  meTestTH2F = 0;
51  meTestTH3F = 0;
52  meTestProfile1 = 0;
53  meTestProfile2 = 0;
54  Random = new TRandom3();
55 
56  ibooker.setCurrentFolder("GlobalTestV/String");
57  meTestString = ibooker.bookString("TestString", "Hello World" );
58 
59  ibooker.setCurrentFolder("GlobalTestV/Int");
60  meTestInt = ibooker.bookInt("TestInt");
61 
62  ibooker.setCurrentFolder("GlobalTestV/Float");
63  meTestFloat = ibooker.bookFloat("TestFloat");
64 
65  ibooker.setCurrentFolder("GlobalTestV/TH1F");
66  meTestTH1F = ibooker.book1D("Random1D", "Random1D", 100, -10., 10.);
67 
68  ibooker.setCurrentFolder("GlobalTestV/TH2F");
69  meTestTH2F = ibooker.book2D("Random2D", "Random2D", 100, -10, 10., 100, -10.,
70  10.);
71 
72  ibooker.setCurrentFolder("GlobalTestV/TH3F");
73  meTestTH3F = ibooker.book3D("Random3D", "Random3D", 100, -10., 10., 100,
74  -10., 10., 100, -10., 10.);
75 
76  ibooker.setCurrentFolder("GlobalTestV/TProfile");
77  meTestProfile1 = ibooker.bookProfile("Profile1", "Profile1", 100, -10., 10.,
78  100, -10., 10.);
79 
80  ibooker.setCurrentFolder("GlobalTestV/TProfile2D");
81  meTestProfile2 = ibooker.bookProfile2D("Profile2", "Profile2", 100, -10.,
82  10., 100, -10, 10., 100, -10., 10.);
83 
84  ibooker.tag(meTestTH1F, 1);
85  ibooker.tag(meTestTH2F, 2);
86  ibooker.tag(meTestTH3F, 3);
87  ibooker.tag(meTestProfile1, 4);
88  ibooker.tag(meTestProfile2, 5);
89  ibooker.tag(meTestString, 6);
90  ibooker.tag(meTestInt, 7);
91  ibooker.tag(meTestFloat, 8);
92 
93 }
MonitorElement * meTestProfile1
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:97
MonitorElement * meTestInt
MonitorElement * meTestString
MonitorElement * meTestTH3F
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:288
MonitorElement * meTestProfile2
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * meTestTH1F
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * meTestFloat
MonitorElement * book3D(Args &&...args)
Definition: DQMStore.h:151
MonitorElement * meTestTH2F

Member Data Documentation

unsigned int GlobalHitsTester::count
private

Definition at line 114 of file GlobalHitsTester.h.

bool GlobalHitsTester::doOutput
private

Definition at line 97 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

std::string GlobalHitsTester::fName
private

Definition at line 88 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

int GlobalHitsTester::frequency
private

Definition at line 90 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

bool GlobalHitsTester::getAllProvenances
private

Definition at line 93 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

std::string GlobalHitsTester::label
private
MonitorElement* GlobalHitsTester::meTestFloat
private

Definition at line 101 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestInt
private

Definition at line 100 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestProfile1
private

Definition at line 105 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestProfile2
private

Definition at line 106 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestString
private

Definition at line 99 of file GlobalHitsTester.h.

Referenced by bookHistograms().

MonitorElement* GlobalHitsTester::meTestTH1F
private

Definition at line 102 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestTH2F
private

Definition at line 103 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestTH3F
private

Definition at line 104 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

std::string GlobalHitsTester::outputfile
private

Definition at line 96 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

bool GlobalHitsTester::printProvenanceInfo
private

Definition at line 94 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

TRandom* GlobalHitsTester::Random
private

Definition at line 108 of file GlobalHitsTester.h.

double GlobalHitsTester::RandomVal1
private

Definition at line 109 of file GlobalHitsTester.h.

Referenced by analyze().

double GlobalHitsTester::RandomVal2
private

Definition at line 110 of file GlobalHitsTester.h.

Referenced by analyze().

double GlobalHitsTester::RandomVal3
private

Definition at line 111 of file GlobalHitsTester.h.

Referenced by analyze().

int GlobalHitsTester::verbosity
private

Definition at line 89 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

int GlobalHitsTester::vtxunit
private

Definition at line 91 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().