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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

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 ()
 
- 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)
 
virtual ~ME0BaseValidation ()
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
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
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (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)
 
- Protected Attributes inherited from ME0BaseValidation
edm::EDGetToken InputTagToken_
 
std::vector< std::string > layerLabel
 
int nBinXY_
 
std::vector< double > nBinZR_
 
std::vector< double > RangeZR_
 
std::vector< std::string > regionLabel
 

Detailed Description

Definition at line 8 of file ME0HitsValidation.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file ME0HitsValidation.cc.

References edm::ParameterSet::getParameter(), and ME0BaseValidation::InputTagToken_.

5  : ME0BaseValidation(cfg)
6 {
7  InputTagToken_ = consumes<edm::PSimHitContainer>(cfg.getParameter<edm::InputTag>("simInputLabel"));
8 }
T getParameter(std::string const &) const
ME0BaseValidation(const edm::ParameterSet &ps)
edm::EDGetToken InputTagToken_
ME0HitsValidation::~ME0HitsValidation ( )

Definition at line 49 of file ME0HitsValidation.cc.

49  {
50 }

Member Function Documentation

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

Implements ME0BaseValidation.

Definition at line 53 of file ME0HitsValidation.cc.

References funct::abs(), gather_cfg::cout, MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), hfClusterShapes_cfi::hits, triggerObjects_cff::id, ME0Geometry::idToDet(), ME0BaseValidation::InputTagToken_, createfilelist::int, edm::HandleBase::isValid(), me0_sh_eloss, me0_sh_elossMu, me0_sh_tof, me0_sh_tofMu, me0_sh_tot_zr, me0_sh_xy, me0_sh_zr, objects.autophobj::particleType, PV3DBase< T, PVType, FrameType >::perp(), reco::return(), spr::timeOfFlight(), and GeomDet::toGlobal().

55 {
57  iSetup.get<MuonGeometryRecord>().get(hGeom);
58  const ME0Geometry* ME0Geometry_ =( &*hGeom);
59 
61  e.getByToken(InputTagToken_, ME0Hits);
62  if (!ME0Hits.isValid()) {
63  edm::LogError("ME0HitsValidation") << "Cannot get ME0Hits by Token simInputTagToken";
64  return ;
65  }
66 
67  Float_t timeOfFlightMuon = 0.;
68  Float_t energyLossMuon = 0;
69 
70  for (auto hits=ME0Hits->begin(); hits!=ME0Hits->end(); hits++) {
71 
72  const ME0DetId id(hits->detUnitId());
73  Int_t region = id.region();
74  Int_t layer = id.layer();
75 
76 
77 
78  //Int_t even_odd = id.chamber()%2;
79  if ( ME0Geometry_->idToDet(hits->detUnitId()) == nullptr) {
80  std::cout<<"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  {
96  timeOfFlightMuon = hits->timeOfFlight();
97  energyLossMuon = hits->energyLoss();
98  //fill histos for Muons only
99  me0_sh_tofMu[(int)(region/2.+0.5)][layer-1]->Fill(timeOfFlightMuon);
100  me0_sh_elossMu[(int)(region/2.+0.5)][layer-1]->Fill(energyLossMuon*1.e9);
101 
102  }
103 
104  me0_sh_zr[(int)(region/2.+0.5)][layer-1]->Fill(g_z,g_r);
105  me0_sh_tot_zr[(int)(region/2.+0.5)]->Fill(g_z,g_r);
106  me0_sh_xy[(int)(region/2.+0.5)][layer-1]->Fill(g_x,g_y);
107  me0_sh_tof[(int)(region/2.+0.5)][layer-1]->Fill(timeOfFlight);
108  me0_sh_eloss[(int)(region/2.+0.5)][layer-1]->Fill(energyLoss*1.e9);
109 
110  }
111 }
MonitorElement * me0_sh_elossMu[2][6]
MonitorElement * me0_sh_zr[2][6]
T perp() const
Definition: PV3DBase.h:72
MonitorElement * me0_sh_tot_zr[2]
MonitorElement * me0_sh_xy[2][6]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
MonitorElement * me0_sh_tofMu[2][6]
void Fill(long long x)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * me0_sh_tof[2][6]
MonitorElement * me0_sh_eloss[2][6]
const T & get() const
Definition: EventSetup.h:55
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:42
edm::EDGetToken InputTagToken_
return(e1-e2)*(e1-e2)+dp *dp
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:17
void ME0HitsValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  Run,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 10 of file ME0HitsValidation.cc.

References DQMStore::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, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

Member Data Documentation

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

Definition at line 23 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 24 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 21 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 22 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0HitsValidation::me0_sh_tot_zr[2]
private

Definition at line 19 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 17 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 18 of file ME0HitsValidation.h.

Referenced by analyze(), and bookHistograms().

Int_t ME0HitsValidation::npart
private

Definition at line 26 of file ME0HitsValidation.h.