CMS 3D CMS Logo

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

#include <ME0HitsValidation.h>

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

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 ME0HitsValidation (const edm::ParameterSet &)
 
 ~ME0HitsValidation () override
 
- Public Member Functions inherited from ME0BaseValidation
MonitorElementBookHistXY (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
 
MonitorElementBookHistZR (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
 
 ME0BaseValidation (const edm::ParameterSet &ps)
 
 ~ME0BaseValidation () override
 
- 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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

MonitorElementme0_sh_eloss [2][6]
 
MonitorElementme0_sh_elossMu [2][6]
 
MonitorElementme0_sh_tof [2][6]
 
MonitorElementme0_sh_tofMu [2][6]
 
MonitorElementme0_sh_tot_zr [2]
 
MonitorElementme0_sh_xy [2][6]
 
MonitorElementme0_sh_zr [2][6]
 
Int_t npart
 

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 >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 ME0BaseValidation
edm::ESGetToken< ME0Geometry, MuonGeometryRecordgeomToken_
 
edm::EDGetToken InputTagToken_
 
std::vector< std::string > layerLabel
 
int nBinXY_
 
std::vector< double > nBinZR_
 
std::vector< double > RangeZR_
 
std::vector< std::string > regionLabel
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 6 of file ME0HitsValidation.h.

Constructor & Destructor Documentation

◆ ME0HitsValidation()

ME0HitsValidation::ME0HitsValidation ( const edm::ParameterSet cfg)
explicit

Definition at line 5 of file ME0HitsValidation.cc.

6  InputTagToken_ = consumes<edm::PSimHitContainer>(cfg.getParameter<edm::InputTag>("simInputLabel"));
7 }

References looper::cfg, and ME0BaseValidation::InputTagToken_.

◆ ~ME0HitsValidation()

ME0HitsValidation::~ME0HitsValidation ( )
override

Definition at line 58 of file ME0HitsValidation.cc.

58 {}

Member Function Documentation

◆ analyze()

void ME0HitsValidation::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements ME0BaseValidation.

Definition at line 60 of file ME0HitsValidation.cc.

60  {
61  const ME0Geometry *ME0Geometry_ = &iSetup.getData(geomToken_);
62 
64  e.getByToken(InputTagToken_, ME0Hits);
65  if (!ME0Hits.isValid()) {
66  edm::LogError("ME0HitsValidation") << "Cannot get ME0Hits by Token simInputTagToken";
67  return;
68  }
69 
70  Float_t timeOfFlightMuon = 0.;
71  Float_t energyLossMuon = 0;
72 
73  for (auto hits = ME0Hits->begin(); hits != ME0Hits->end(); hits++) {
74  const ME0DetId id(hits->detUnitId());
75  Int_t region = id.region();
76  Int_t layer = id.layer();
77 
78  // Int_t even_odd = id.chamber()%2;
79  if (ME0Geometry_->idToDet(hits->detUnitId()) == nullptr) {
80  edm::LogInfo("ME0HitsValidation") << "simHit did not matched with GEMGeometry." << std::endl;
81  continue;
82  }
83 
84  const LocalPoint hitLP(hits->localPosition());
85 
86  const GlobalPoint hitGP(ME0Geometry_->idToDet(hits->detUnitId())->surface().toGlobal(hitLP));
87  Float_t g_r = hitGP.perp();
88  Float_t g_x = hitGP.x();
89  Float_t g_y = hitGP.y();
90  Float_t g_z = hitGP.z();
91  Float_t energyLoss = hits->energyLoss();
92  Float_t timeOfFlight = hits->timeOfFlight();
93 
94  if (abs(hits->particleType()) == 13) {
95  timeOfFlightMuon = hits->timeOfFlight();
96  energyLossMuon = hits->energyLoss();
97  // fill histos for Muons only
98  me0_sh_tofMu[(int)(region / 2. + 0.5)][layer - 1]->Fill(timeOfFlightMuon);
99  me0_sh_elossMu[(int)(region / 2. + 0.5)][layer - 1]->Fill(energyLossMuon * 1.e9);
100  }
101 
102  me0_sh_zr[(int)(region / 2. + 0.5)][layer - 1]->Fill(g_z, g_r);
103  me0_sh_tot_zr[(int)(region / 2. + 0.5)]->Fill(g_z, g_r);
104  me0_sh_xy[(int)(region / 2. + 0.5)][layer - 1]->Fill(g_x, g_y);
105  me0_sh_tof[(int)(region / 2. + 0.5)][layer - 1]->Fill(timeOfFlight);
106  me0_sh_eloss[(int)(region / 2. + 0.5)][layer - 1]->Fill(energyLoss * 1.e9);
107  }
108 }

References funct::abs(), MillePedeFileConverter_cfg::e, fastSimProducer_cff::energyLoss, dqm::impl::MonitorElement::Fill(), ME0BaseValidation::geomToken_, edm::EventSetup::getData(), hfClusterShapes_cfi::hits, triggerObjects_cff::id, ME0Geometry::idToDet(), ME0BaseValidation::InputTagToken_, createfilelist::int, edm::HandleBase::isValid(), phase1PixelTopology::layer, me0_sh_eloss, me0_sh_elossMu, me0_sh_tof, me0_sh_tofMu, me0_sh_tot_zr, me0_sh_xy, me0_sh_zr, PV3DBase< T, PVType, FrameType >::perp(), HLT_FULL_cff::region, spr::timeOfFlight(), and GeomDet::toGlobal().

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 9 of file ME0HitsValidation.cc.

9  {
10  LogDebug("MuonME0HitsValidation") << "Info : Loading Geometry information\n";
11  ibooker.setCurrentFolder("MuonME0HitsV/ME0HitsTask");
12 
13  unsigned int nregion = 2;
14 
15  edm::LogInfo("MuonME0HitsValidation") << "+++ Info : # of region : " << nregion << std::endl;
16 
17  LogDebug("MuonME0HitsValidation") << "+++ Info : finish to get geometry information from ES.\n";
18 
19  for (unsigned int region_num = 0; region_num < nregion; region_num++) {
20  me0_sh_tot_zr[region_num] = BookHistZR(ibooker, "me0_sh", "SimHit", region_num);
21  for (unsigned int layer_num = 0; layer_num < 6; layer_num++) {
22  me0_sh_zr[region_num][layer_num] = BookHistZR(ibooker, "me0_sh", "SimHit", region_num, layer_num);
23  me0_sh_xy[region_num][layer_num] = BookHistXY(ibooker, "me0_sh", "SimHit", region_num, layer_num);
24  std::string hist_name_for_tof =
25  std::string("me0_sh_tof_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
26  std::string hist_name_for_tofMu =
27  std::string("me0_sh_tofMuon_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
28  std::string hist_name_for_eloss =
29  std::string("me0_sh_energyloss_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
30  std::string hist_name_for_elossMu =
31  std::string("me0_sh_energylossMuon_r") + regionLabel[region_num] + "_l" + layerLabel[layer_num];
32  std::string hist_label_for_xy = "SimHit occupancy : region" + regionLabel[region_num] + " layer " +
33  layerLabel[layer_num] + " ; globalX [cm]; globalY[cm]";
34  std::string hist_label_for_tof = "SimHit TOF : region" + regionLabel[region_num] + " layer " +
35  layerLabel[layer_num] + " " + " ; Time of flight [ns] ; entries";
36  std::string hist_label_for_tofMu = "SimHit TOF(Muon only) : region" + regionLabel[region_num] + " layer " +
37  layerLabel[layer_num] + " " + " ; Time of flight [ns] ; entries";
38  std::string hist_label_for_eloss = "SimHit energy loss : region" + regionLabel[region_num] + " layer " +
39  layerLabel[layer_num] + " " + " ; Energy loss [eV] ; entries";
40  std::string hist_label_for_elossMu = "SimHit energy loss(Muon only) : region" + regionLabel[region_num] +
41  " layer " + layerLabel[layer_num] + " " + " ; Energy loss [eV] ; entries";
42 
43  double tof_min, tof_max;
44  tof_min = 10;
45  tof_max = 30;
46  me0_sh_tof[region_num][layer_num] =
47  ibooker.book1D(hist_name_for_tof.c_str(), hist_label_for_tof.c_str(), 40, tof_min, tof_max);
48  me0_sh_tofMu[region_num][layer_num] =
49  ibooker.book1D(hist_name_for_tofMu.c_str(), hist_label_for_tofMu.c_str(), 40, tof_min, tof_max);
50  me0_sh_eloss[region_num][layer_num] =
51  ibooker.book1D(hist_name_for_eloss.c_str(), hist_label_for_eloss.c_str(), 60, 0., 6000.);
52  me0_sh_elossMu[region_num][layer_num] =
53  ibooker.book1D(hist_name_for_elossMu.c_str(), hist_label_for_elossMu.c_str(), 60, 0., 6000.);
54  }
55  }
56 }

References dqm::implementation::IBooker::book1D(), ME0BaseValidation::BookHistXY(), ME0BaseValidation::BookHistZR(), ME0BaseValidation::layerLabel, LogDebug, me0_sh_eloss, me0_sh_elossMu, me0_sh_tof, me0_sh_tofMu, me0_sh_tot_zr, me0_sh_xy, me0_sh_zr, ME0BaseValidation::regionLabel, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ me0_sh_eloss

MonitorElement* ME0HitsValidation::me0_sh_eloss[2][6]
private

Definition at line 20 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me0_sh_elossMu

MonitorElement* ME0HitsValidation::me0_sh_elossMu[2][6]
private

Definition at line 21 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me0_sh_tof

MonitorElement* ME0HitsValidation::me0_sh_tof[2][6]
private

Definition at line 18 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me0_sh_tofMu

MonitorElement* ME0HitsValidation::me0_sh_tofMu[2][6]
private

Definition at line 19 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me0_sh_tot_zr

MonitorElement* ME0HitsValidation::me0_sh_tot_zr[2]
private

Definition at line 16 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me0_sh_xy

MonitorElement* ME0HitsValidation::me0_sh_xy[2][6]
private

Definition at line 14 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ me0_sh_zr

MonitorElement* ME0HitsValidation::me0_sh_zr[2][6]
private

Definition at line 15 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ npart

Int_t ME0HitsValidation::npart
private

Definition at line 23 of file ME0HitsValidation.h.

ME0BaseValidation::regionLabel
std::vector< std::string > regionLabel
Definition: ME0BaseValidation.h:31
ME0BaseValidation::layerLabel
std::vector< std::string > layerLabel
Definition: ME0BaseValidation.h:32
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ME0Geometry
Definition: ME0Geometry.h:12
ME0HitsValidation::me0_sh_elossMu
MonitorElement * me0_sh_elossMu[2][6]
Definition: ME0HitsValidation.h:21
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
ME0Geometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:24
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< edm::PSimHitContainer >
ME0BaseValidation::ME0BaseValidation
ME0BaseValidation(const edm::ParameterSet &ps)
Definition: ME0BaseValidation.cc:5
spr::timeOfFlight
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:17
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
ME0HitsValidation::me0_sh_eloss
MonitorElement * me0_sh_eloss[2][6]
Definition: ME0HitsValidation.h:20
ME0HitsValidation::me0_sh_tofMu
MonitorElement * me0_sh_tofMu[2][6]
Definition: ME0HitsValidation.h:19
Point3DBase< float, LocalTag >
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
ME0BaseValidation::BookHistXY
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
Definition: ME0BaseValidation.cc:56
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
ME0BaseValidation::BookHistZR
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
Definition: ME0BaseValidation.cc:24
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
createfilelist.int
int
Definition: createfilelist.py:10
ME0DetId
Definition: ME0DetId.h:16
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
looper.cfg
cfg
Definition: looper.py:296
ME0HitsValidation::me0_sh_zr
MonitorElement * me0_sh_zr[2][6]
Definition: ME0HitsValidation.h:15
ME0HitsValidation::me0_sh_tof
MonitorElement * me0_sh_tof[2][6]
Definition: ME0HitsValidation.h:18
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ME0HitsValidation::me0_sh_xy
MonitorElement * me0_sh_xy[2][6]
Definition: ME0HitsValidation.h:14
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ME0BaseValidation::geomToken_
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geomToken_
Definition: ME0BaseValidation.h:37
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
ME0HitsValidation::me0_sh_tot_zr
MonitorElement * me0_sh_tot_zr[2]
Definition: ME0HitsValidation.h:16
fastSimProducer_cff.energyLoss
energyLoss
Definition: fastSimProducer_cff.py:55
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
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
ME0BaseValidation::InputTagToken_
edm::EDGetToken InputTagToken_
Definition: ME0BaseValidation.h:35
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37