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
ME0DigisValidation Class Reference

#include <ME0DigisValidation.h>

Inheritance diagram for ME0DigisValidation:
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
 
 ME0DigisValidation (const edm::ParameterSet &)
 
 ~ME0DigisValidation ()
 
- 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
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 ()
 
 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 & 
itemsToGetFromEvent () 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

edm::EDGetToken InputTagToken_Digi
 
MonitorElementme0_strip_dg_xy [2][6]
 
MonitorElementme0_strip_dg_xy_Muon [2][6]
 
MonitorElementme0_strip_dg_zr [2][6]
 
MonitorElementme0_strip_dg_zr_tot [2]
 
MonitorElementme0_strip_dg_zr_tot_Muon [2]
 
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, 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)
 
- 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 10 of file ME0DigisValidation.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file ME0DigisValidation.cc.

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

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

Definition at line 34 of file ME0DigisValidation.cc.

34  {
35 }

Member Function Documentation

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

Implements ME0BaseValidation.

Definition at line 38 of file ME0DigisValidation.cc.

References funct::abs(), gather_cfg::cout, MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), runTauDisplay::gp, ME0Geometry::idToDet(), ME0BaseValidation::InputTagToken_, InputTagToken_Digi, edm::HandleBase::isValid(), me0_strip_dg_xy, me0_strip_dg_xy_Muon, me0_strip_dg_zr_tot, me0_strip_dg_zr_tot_Muon, HLT_25ns10e33_v2_cff::particleType, HLT_25ns10e33_v2_cff::region, reco::return(), and GeomDet::surface().

40 {
42  iSetup.get<MuonGeometryRecord>().get(hGeom);
43  const ME0Geometry* ME0Geometry_ =( &*hGeom);
45  e.getByToken(InputTagToken_, ME0Hits);
46 
48  e.getByToken(InputTagToken_Digi, ME0Digis);
49 
50  if (!ME0Hits.isValid() | !ME0Digis.isValid() ) {
51  edm::LogError("ME0DigisValidation") << "Cannot get ME0Hits/ME0Digis by Token simInputTagToken";
52  return ;
53  }
54 
55  for (ME0DigiPreRecoCollection::DigiRangeIterator cItr=ME0Digis->begin(); cItr!=ME0Digis->end(); cItr++) {
56  ME0DetId id = (*cItr).first;
57 
58  const GeomDet* gdet = ME0Geometry_->idToDet(id);
59  if ( gdet == nullptr) {
60  std::cout<<"Getting DetId failed. Discard this gem strip hit.Maybe it comes from unmatched geometry."<<std::endl;
61  continue;
62  }
63  const BoundPlane & surface = gdet->surface();
64 
65  Short_t region = (Short_t) id.region();
66  Short_t layer = (Short_t) id.layer();
67 
69  for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
70  {
71  Short_t particleType = digiItr->pdgid();
72  LocalPoint lp(digiItr->x(), digiItr->y(), 0);
73 
74  GlobalPoint gp = surface.toGlobal(lp);
75 
76  Float_t g_r = (Float_t) gp.perp();
77  Float_t g_x = (Float_t) gp.x();
78  Float_t g_y = (Float_t) gp.y();
79  Float_t g_z = (Float_t) gp.z();
80  // fill hist
81  int region_num=0 ;
82  if ( region ==-1 ) region_num = 0 ;
83  else if ( region==1) region_num = 1;
84  int layer_num = layer-1;
85 
86  if ( abs(particleType) == 13) {
87  me0_strip_dg_zr_tot_Muon[region_num]->Fill(g_z,g_r);
88  me0_strip_dg_xy_Muon[region_num][layer_num]->Fill(g_x,g_y);
89  }
90  else {
91  me0_strip_dg_zr_tot[region_num]->Fill(g_z,g_r);
92  me0_strip_dg_xy[region_num][layer_num]->Fill(g_x,g_y);
93  }
94  }
95 }
96 
97 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
virtual const GeomDet * idToDet(DetId) const
Definition: ME0Geometry.cc:42
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
void Fill(long long x)
MonitorElement * me0_strip_dg_zr_tot_Muon[2]
MonitorElement * me0_strip_dg_xy[2][6]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * me0_strip_dg_xy_Muon[2][6]
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetToken InputTagToken_Digi
const T & get() const
Definition: EventSetup.h:56
std::vector< ME0DigiPreReco >::const_iterator const_iterator
edm::EDGetToken InputTagToken_
return(e1-e2)*(e1-e2)+dp *dp
tuple cout
Definition: gather_cfg.py:145
MonitorElement * me0_strip_dg_zr_tot[2]
void ME0DigisValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  Run,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 10 of file ME0DigisValidation.cc.

References ME0BaseValidation::BookHistXY(), ME0BaseValidation::BookHistZR(), LogDebug, me0_strip_dg_xy, me0_strip_dg_xy_Muon, me0_strip_dg_zr_tot, me0_strip_dg_zr_tot_Muon, and DQMStore::IBooker::setCurrentFolder().

10  {
11 
12  LogDebug("MuonME0DigisValidation")<<"Info : Loading Geometry information\n";
13  ibooker.setCurrentFolder("MuonME0DigisV/ME0DigisTask");
14 
15  unsigned int nregion = 2;
16 
17  edm::LogInfo("MuonME0DigisValidation")<<"+++ Info : # of region : "<<nregion<<std::endl;
18 
19  LogDebug("MuonME0DigisValidation")<<"+++ 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_strip_dg_zr_tot[region_num] = BookHistZR(ibooker,"me0_strip_dg_tot","Digi",region_num);
24  me0_strip_dg_zr_tot_Muon[region_num] = BookHistZR(ibooker,"me0_strip_dg_tot","Digi Muon",region_num);
25  for( unsigned int layer_num = 0 ; layer_num < 6 ; layer_num++) {
26 
27  me0_strip_dg_xy[region_num][layer_num] = BookHistXY(ibooker,"me0_strip_dg","Digi",region_num,layer_num);
28  me0_strip_dg_xy_Muon[region_num][layer_num] = BookHistXY(ibooker,"me0_strip_dg","Digi Muon",region_num,layer_num);
29  }
30  }
31 }
#define LogDebug(id)
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
MonitorElement * me0_strip_dg_zr_tot_Muon[2]
MonitorElement * me0_strip_dg_xy[2][6]
MonitorElement * me0_strip_dg_xy_Muon[2][6]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * me0_strip_dg_zr_tot[2]

Member Data Documentation

edm::EDGetToken ME0DigisValidation::InputTagToken_Digi
private

Definition at line 25 of file ME0DigisValidation.h.

Referenced by analyze(), and ME0DigisValidation().

MonitorElement* ME0DigisValidation::me0_strip_dg_xy[2][6]
private

Definition at line 19 of file ME0DigisValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0DigisValidation::me0_strip_dg_xy_Muon[2][6]
private

Definition at line 20 of file ME0DigisValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0DigisValidation::me0_strip_dg_zr[2][6]
private

Definition at line 21 of file ME0DigisValidation.h.

MonitorElement* ME0DigisValidation::me0_strip_dg_zr_tot[2]
private

Definition at line 22 of file ME0DigisValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0DigisValidation::me0_strip_dg_zr_tot_Muon[2]
private

Definition at line 23 of file ME0DigisValidation.h.

Referenced by analyze(), and bookHistograms().

Int_t ME0DigisValidation::npart
private

Definition at line 27 of file ME0DigisValidation.h.