CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
GlobalTest Class Reference

#include <GlobalTest.h>

Inheritance diagram for GlobalTest:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GlobalTest (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

MonitorElementcaloEnergyEBH_ [nMaxH]
 
MonitorElementcaloEnergyEEH_ [nMaxH]
 
edm::EDGetTokenT< CrossingFrame< SimTrack > > cfTrackToken_
 
edm::EDGetTokenT< CrossingFrame< SimTrack > > cfVertexToken_
 
std::string filename_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > g4SimHits_EB_Token_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > g4SimHits_EE_Token_
 
TFile * histfile_
 
int maxbunch_
 
int minbunch_
 
MonitorElementnrPileupsH_ [nMaxH]
 
MonitorElementnrTracksH_ [nMaxH]
 
MonitorElementnrVerticesH_ [nMaxH]
 
MonitorElementtrackPartIdH_ [nMaxH]
 

Static Private Attributes

const static int nMaxH = 10
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Description: test suite for Mixing Module

Definition at line 43 of file GlobalTest.h.

Constructor & Destructor Documentation

◆ GlobalTest()

GlobalTest::GlobalTest ( const edm::ParameterSet iConfig)
explicit

Definition at line 40 of file GlobalTest.cc.

41  : filename_(iConfig.getParameter<std::string>("fileName")),
42  minbunch_(iConfig.getParameter<int>("minBunch")),
43  maxbunch_(iConfig.getParameter<int>("maxBunch")),
44  cfTrackToken_(consumes<CrossingFrame<SimTrack>>(iConfig.getParameter<edm::InputTag>("cfTrackTag"))),
45  cfVertexToken_(consumes<CrossingFrame<SimTrack>>(iConfig.getParameter<edm::InputTag>("cfVertexTag"))) {
46  std::string ecalsubdetb("");
47  std::string ecalsubdete("g4SimHitsEcalHitsEE");
48  g4SimHits_EB_Token_ = consumes<CrossingFrame<PCaloHit>>(edm::InputTag("mix", "g4SimHitsEcalHitsEB"));
49  g4SimHits_EE_Token_ = consumes<CrossingFrame<PCaloHit>>(edm::InputTag("mix", "g4SimHitsEcalHitsEE"));
50 
51  std::cout << "Constructed GlobalTest, filename: " << filename_ << " minbunch: " << minbunch_
52  << ", maxbunch: " << maxbunch_ << std::endl;
53 }

References gather_cfg::cout, filename_, g4SimHits_EB_Token_, g4SimHits_EE_Token_, HLT_FULL_cff::InputTag, maxbunch_, minbunch_, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Function Documentation

◆ analyze()

void GlobalTest::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 83 of file GlobalTest.cc.

83  {
84  using namespace edm;
85  using namespace std;
86 
87  // Get input
92  std::string ecalsubdetb("g4SimHitsEcalHitsEB");
93  std::string ecalsubdete("g4SimHitsEcalHitsEE");
94  iEvent.getByToken(cfTrackToken_, cf_track);
95  iEvent.getByToken(cfVertexToken_, cf_vertex);
96  iEvent.getByToken(g4SimHits_EB_Token_, cf_calohitB);
97  iEvent.getByToken(g4SimHits_EE_Token_, cf_calohitE);
98 
99  // number of events/bcr ??
100 
101  // number of tracks
102  for (int i = minbunch_; i <= maxbunch_; ++i) {
103  nrTracksH_[i - minbunch_]->Fill(cf_track->getNrPileups(i));
104  }
105 
106  // number of vertices
107  for (int i = minbunch_; i <= maxbunch_; ++i) {
108  nrVerticesH_[i - minbunch_]->Fill(cf_vertex->getNrPileups(i));
109  }
110 
111  // part id for each track
112  std::unique_ptr<MixCollection<SimTrack>> coltr(new MixCollection<SimTrack>(cf_track.product()));
114  for (cfitr = coltr->begin(); cfitr != coltr->end(); cfitr++) {
115  trackPartIdH_[cfitr.bunch() - minbunch_]->Fill(cfitr->type());
116  }
117 
118  // energy sum
119  double sumE[10] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
120  std::unique_ptr<MixCollection<PCaloHit>> colecalb(new MixCollection<PCaloHit>(cf_calohitB.product()));
122  for (cfiecalb = colecalb->begin(); cfiecalb != colecalb->end(); cfiecalb++) {
123  sumE[cfiecalb.bunch() - minbunch_] += cfiecalb->energy();
124  // if (cfiecal.getTrigger()) tofecalhist_sig->Fill(cfiecal->time());
125  // else tofecalhist->Fill(cfiecal->time());
126  }
127  for (int i = minbunch_; i <= maxbunch_; ++i) {
128  caloEnergyEBH_[i - minbunch_]->Fill(sumE[i - minbunch_]);
129  }
130  double sumEE[10] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
131  std::unique_ptr<MixCollection<PCaloHit>> colecale(new MixCollection<PCaloHit>(cf_calohitE.product()));
133  for (cfiecale = colecale->begin(); cfiecale != colecale->end(); cfiecale++) {
134  sumEE[cfiecale.bunch() - minbunch_] += cfiecale->energy();
135  // if (cfiecal.getTrigger()) tofecalhist_sig->Fill(cfiecal->time());
136  // else tofecalhist->Fill(cfiecal->time());
137  }
138  for (int i = minbunch_; i <= maxbunch_; ++i) {
139  caloEnergyEEH_[i - minbunch_]->Fill(sumEE[i - minbunch_]);
140  }
141 }

References MixCollection< T >::MixItr::bunch(), caloEnergyEBH_, caloEnergyEEH_, cfTrackToken_, cfVertexToken_, dqm::impl::MonitorElement::Fill(), g4SimHits_EB_Token_, g4SimHits_EE_Token_, mps_fire::i, iEvent, maxbunch_, minbunch_, nrTracksH_, nrVerticesH_, edm::Handle< T >::product(), AlCaHLTBitMon_QueryRunRegistry::string, and trackPartIdH_.

◆ bookHistograms()

void GlobalTest::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 55 of file GlobalTest.cc.

55  {
56  using namespace std;
57 
58  ibooker.setCurrentFolder("MixingV/Mixing");
59  // book histos
60 
61  for (int i = minbunch_; i <= maxbunch_; ++i) {
62  int ii = i - minbunch_;
63  auto label = fmt::format("NrPileupEvts_{}", i);
64  nrPileupsH_[ii] = ibooker.book1D(label, label, 100, 0, 100);
65  label = fmt::format("NrVertices_{}", i);
66  nrVerticesH_[ii] = ibooker.book1D(label, label, 100, 0, 5000);
67  label = fmt::format("NrTracks_{}", i);
68  nrTracksH_[ii] = ibooker.book1D(label, label, 100, 0, 10000);
69  label = fmt::format("TrackPartId", i);
70  trackPartIdH_[ii] = ibooker.book1D(label, label, 100, 0, 100);
71  label = fmt::format("CaloEnergyEB", i);
72  caloEnergyEBH_[ii] = ibooker.book1D(label, label, 100, 0., 1000.);
73  label = fmt::format("CaloEnergyEE", i);
74  caloEnergyEEH_[ii] = ibooker.book1D(label, label, 100, 0., 1000.);
75  }
76 }

References dqm::implementation::IBooker::book1D(), caloEnergyEBH_, caloEnergyEEH_, dqm-mbProfile::format, mps_fire::i, cuy::ii, label, maxbunch_, minbunch_, nrPileupsH_, nrTracksH_, nrVerticesH_, dqm::implementation::NavigatorBase::setCurrentFolder(), and trackPartIdH_.

Member Data Documentation

◆ caloEnergyEBH_

MonitorElement* GlobalTest::caloEnergyEBH_[nMaxH]
private

Definition at line 61 of file GlobalTest.h.

Referenced by analyze(), and bookHistograms().

◆ caloEnergyEEH_

MonitorElement* GlobalTest::caloEnergyEEH_[nMaxH]
private

Definition at line 62 of file GlobalTest.h.

Referenced by analyze(), and bookHistograms().

◆ cfTrackToken_

edm::EDGetTokenT<CrossingFrame<SimTrack> > GlobalTest::cfTrackToken_
private

Definition at line 64 of file GlobalTest.h.

Referenced by analyze().

◆ cfVertexToken_

edm::EDGetTokenT<CrossingFrame<SimTrack> > GlobalTest::cfVertexToken_
private

Definition at line 65 of file GlobalTest.h.

Referenced by analyze().

◆ filename_

std::string GlobalTest::filename_
private

Definition at line 51 of file GlobalTest.h.

Referenced by GlobalTest().

◆ g4SimHits_EB_Token_

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalTest::g4SimHits_EB_Token_
private

Definition at line 66 of file GlobalTest.h.

Referenced by analyze(), and GlobalTest().

◆ g4SimHits_EE_Token_

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalTest::g4SimHits_EE_Token_
private

Definition at line 67 of file GlobalTest.h.

Referenced by analyze(), and GlobalTest().

◆ histfile_

TFile* GlobalTest::histfile_
private

Definition at line 54 of file GlobalTest.h.

◆ maxbunch_

int GlobalTest::maxbunch_
private

Definition at line 53 of file GlobalTest.h.

Referenced by analyze(), bookHistograms(), and GlobalTest().

◆ minbunch_

int GlobalTest::minbunch_
private

Definition at line 52 of file GlobalTest.h.

Referenced by analyze(), bookHistograms(), and GlobalTest().

◆ nMaxH

const static int GlobalTest::nMaxH = 10
staticprivate

Definition at line 56 of file GlobalTest.h.

◆ nrPileupsH_

MonitorElement* GlobalTest::nrPileupsH_[nMaxH]
private

Definition at line 57 of file GlobalTest.h.

Referenced by bookHistograms().

◆ nrTracksH_

MonitorElement* GlobalTest::nrTracksH_[nMaxH]
private

Definition at line 59 of file GlobalTest.h.

Referenced by analyze(), and bookHistograms().

◆ nrVerticesH_

MonitorElement* GlobalTest::nrVerticesH_[nMaxH]
private

Definition at line 58 of file GlobalTest.h.

Referenced by analyze(), and bookHistograms().

◆ trackPartIdH_

MonitorElement* GlobalTest::trackPartIdH_[nMaxH]
private

Definition at line 60 of file GlobalTest.h.

Referenced by analyze(), and bookHistograms().

GlobalTest::cfVertexToken_
edm::EDGetTokenT< CrossingFrame< SimTrack > > cfVertexToken_
Definition: GlobalTest.h:65
mps_fire.i
i
Definition: mps_fire.py:428
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::Handle
Definition: AssociativeIterator.h:50
MixCollection::MixItr
Definition: MixCollection.h:62
GlobalTest::nrVerticesH_
MonitorElement * nrVerticesH_[nMaxH]
Definition: GlobalTest.h:58
CrossingFrame
Definition: CrossingFrame.h:38
MixCollection::MixItr::bunch
int bunch() const
Definition: MixCollection.h:91
MixCollection
Definition: MixCollection.h:11
dqm-mbProfile.format
format
Definition: dqm-mbProfile.py:16
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
GlobalTest::g4SimHits_EB_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > g4SimHits_EB_Token_
Definition: GlobalTest.h:66
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GlobalTest::caloEnergyEEH_
MonitorElement * caloEnergyEEH_[nMaxH]
Definition: GlobalTest.h:62
GlobalTest::maxbunch_
int maxbunch_
Definition: GlobalTest.h:53
iEvent
int iEvent
Definition: GenABIO.cc:224
GlobalTest::minbunch_
int minbunch_
Definition: GlobalTest.h:52
std
Definition: JetResolutionObject.h:76
GlobalTest::filename_
std::string filename_
Definition: GlobalTest.h:51
GlobalTest::caloEnergyEBH_
MonitorElement * caloEnergyEBH_[nMaxH]
Definition: GlobalTest.h:61
GlobalTest::g4SimHits_EE_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > g4SimHits_EE_Token_
Definition: GlobalTest.h:67
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GlobalTest::trackPartIdH_
MonitorElement * trackPartIdH_[nMaxH]
Definition: GlobalTest.h:60
GlobalTest::cfTrackToken_
edm::EDGetTokenT< CrossingFrame< SimTrack > > cfTrackToken_
Definition: GlobalTest.h:64
cuy.ii
ii
Definition: cuy.py:590
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
GlobalTest::nrPileupsH_
MonitorElement * nrPileupsH_[nMaxH]
Definition: GlobalTest.h:57
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
GlobalTest::nrTracksH_
MonitorElement * nrTracksH_[nMaxH]
Definition: GlobalTest.h:59