CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
GlobalRecHitsAnalyzer Class Reference

#include <GlobalRecHitsAnalyzer.h>

Inheritance diagram for GlobalRecHitsAnalyzer:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::map< uint32_t, float, std::less< uint32_t > > MapType
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 GlobalRecHitsAnalyzer (const edm::ParameterSet &)
 
 ~GlobalRecHitsAnalyzer () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Private Member Functions

template<typename type >
int compute (const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, int step)
 
void fillECal (const edm::Event &, const edm::EventSetup &)
 
void fillHCal (const edm::Event &, const edm::EventSetup &)
 
void fillMuon (const edm::Event &, const edm::EventSetup &)
 
void fillTrk (const edm::Event &, const edm::EventSetup &)
 
template<typename type >
const typefindBestRecHit (const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
 
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire (const DTRecHitCollection *dt1DRecHitPairs)
 
void plotResolution (const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
 
std::pair< LocalPoint, LocalVectorprojectHit (const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
 
float recHitDistFromWire (const DTRecHit1DPair &hitPair, const DTLayer *layer)
 
float recHitDistFromWire (const DTRecHit1D &recHit, const DTLayer *layer)
 
float simHitDistFromWire (const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
 

Private Attributes

unsigned int count
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
 
edm::InputTag ECalEBSrc_
 
edm::EDGetTokenT< EBRecHitCollectionECalEBSrc_Token_
 
edm::InputTag ECalEESrc_
 
edm::EDGetTokenT< EERecHitCollectionECalEESrc_Token_
 
edm::InputTag ECalESSrc_
 
edm::EDGetTokenT< ESRecHitCollectionECalESSrc_Token_
 
edm::InputTag ECalUncalEBSrc_
 
edm::EDGetTokenT< EBUncalibratedRecHitCollectionECalUncalEBSrc_Token_
 
edm::InputTag ECalUncalEESrc_
 
edm::EDGetTokenT< EEUncalibratedRecHitCollectionECalUncalEESrc_Token_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
 
std::string fName
 
int frequency
 
bool getAllProvenances
 
edm::InputTag HCalSrc_
 
edm::EDGetTokenT< edm::PCaloHitContainerHCalSrc_Token_
 
std::string hitsProducer
 
std::string label
 
std::vector< PSimHitmatched
 
MonitorElementmehCSCn
 
MonitorElementmehCSCResRDPhi
 
MonitorElementmehDtMuonn
 
MonitorElementmehDtMuonRes
 
MonitorElementmehEcaln [3]
 
MonitorElementmehEcalRes [3]
 
MonitorElementmehHcaln [4]
 
MonitorElementmehHcalRes [4]
 
MonitorElementmehRPCn
 
MonitorElementmehRPCResX
 
MonitorElementmehSiPixeln [7]
 
MonitorElementmehSiPixelResX [7]
 
MonitorElementmehSiPixelResY [7]
 
MonitorElementmehSiStripn [19]
 
MonitorElementmehSiStripResX [19]
 
MonitorElementmehSiStripResY [19]
 
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
 
edm::InputTag MuCSCSrc_
 
edm::EDGetTokenT< CSCRecHit2DCollectionMuCSCSrc_Token_
 
edm::InputTag MuDTSimSrc_
 
edm::EDGetTokenT< edm::PSimHitContainerMuDTSimSrc_Token_
 
edm::InputTag MuDTSrc_
 
edm::EDGetTokenT< DTRecHitCollectionMuDTSrc_Token_
 
edm::InputTag MuRPCSimSrc_
 
edm::EDGetTokenT< edm::PSimHitContainerMuRPCSimSrc_Token_
 
edm::InputTag MuRPCSrc_
 
edm::EDGetTokenT< RPCRecHitCollectionMuRPCSrc_Token_
 
bool printProvenanceInfo
 
edm::InputTag SiPxlSrc_
 
edm::EDGetTokenT< SiPixelRecHitCollectionSiPxlSrc_Token_
 
edm::InputTag SiStripSrc_
 
edm::EDGetTokenT< SiStripMatchedRecHit2DCollectionSiStripSrc_Token_
 
std::map< int, edm::PSimHitContainertheMap
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
int verbosity
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 140 of file GlobalRecHitsAnalyzer.h.

Member Typedef Documentation

typedef std::map<uint32_t, float, std::less<uint32_t> > GlobalRecHitsAnalyzer::MapType

Definition at line 142 of file GlobalRecHitsAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file GlobalRecHitsAnalyzer.cc.

References EBHits_Token_, ECalEBSrc_, ECalEBSrc_Token_, ECalEESrc_, ECalEESrc_Token_, ECalESSrc_, ECalESSrc_Token_, ECalUncalEBSrc_, ECalUncalEBSrc_Token_, ECalUncalEESrc_, ECalUncalEESrc_Token_, EEHits_Token_, ESHits_Token_, fName, frequency, getAllProvenances, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HCalSrc_, HCalSrc_Token_, hitsProducer, HLT_2018_cff::InputTag, edm::InputTag::instance(), edm::InputTag::label(), MuCSCHits_Token_, MuCSCSrc_, MuCSCSrc_Token_, MuDTSimSrc_, MuDTSimSrc_Token_, MuDTSrc_, MuDTSrc_Token_, MuRPCSimSrc_, MuRPCSimSrc_Token_, MuRPCSrc_, MuRPCSrc_Token_, printProvenanceInfo, SiPxlSrc_, SiPxlSrc_Token_, SiStripSrc_, SiStripSrc_Token_, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

17  : fName(""),
18  verbosity(0),
19  frequency(0),
20  label(""),
21  getAllProvenances(false),
22  printProvenanceInfo(false),
24  count(0) {
25  consumesMany<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit>>>();
26  consumesMany<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>>();
27  consumesMany<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>>();
28  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
29 
30  // get information from parameter set
31  fName = iPSet.getUntrackedParameter<std::string>("Name");
32  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
33  frequency = iPSet.getUntrackedParameter<int>("Frequency");
34  edm::ParameterSet m_Prov = iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
35  getAllProvenances = m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
36  printProvenanceInfo = m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
37  hitsProducer = iPSet.getParameter<std::string>("hitsProducer");
38 
39  //get Labels to use to extract information
40  ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
41  ECalUncalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc");
42  ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
43  ECalUncalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEESrc");
44  ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
45  HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
46  SiStripSrc_ = iPSet.getParameter<edm::InputTag>("SiStripSrc");
47  SiPxlSrc_ = iPSet.getParameter<edm::InputTag>("SiPxlSrc");
48  MuDTSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSrc");
49  MuDTSimSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSimSrc");
50  MuCSCSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCSrc");
51  MuRPCSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSrc");
52  MuRPCSimSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSimSrc");
53 
54  // fix for consumes
55  ECalUncalEBSrc_Token_ = consumes<EBUncalibratedRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc"));
56  ECalUncalEESrc_Token_ = consumes<EEUncalibratedRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalUncalEESrc"));
57  ECalEBSrc_Token_ = consumes<EBRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalEBSrc"));
58  ECalEESrc_Token_ = consumes<EERecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalEESrc"));
59  ECalESSrc_Token_ = consumes<ESRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalESSrc"));
60  HCalSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("HCalSrc"));
61  SiStripSrc_Token_ = consumes<SiStripMatchedRecHit2DCollection>(iPSet.getParameter<edm::InputTag>("SiStripSrc"));
62  SiPxlSrc_Token_ = consumes<SiPixelRecHitCollection>(iPSet.getParameter<edm::InputTag>("SiPxlSrc"));
63 
64  MuDTSrc_Token_ = consumes<DTRecHitCollection>(iPSet.getParameter<edm::InputTag>("MuDTSrc"));
65  MuDTSimSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuDTSimSrc"));
66 
67  MuCSCSrc_Token_ = consumes<CSCRecHit2DCollection>(iPSet.getParameter<edm::InputTag>("MuCSCSrc"));
68  MuCSCHits_Token_ = consumes<CrossingFrame<PSimHit>>(
69  edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("MuonCSCHits")));
70 
71  MuRPCSrc_Token_ = consumes<RPCRecHitCollection>(iPSet.getParameter<edm::InputTag>("MuRPCSrc"));
72  MuRPCSimSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuRPCSimSrc"));
73 
74  EBHits_Token_ = consumes<CrossingFrame<PCaloHit>>(
75  edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEB")));
76  EEHits_Token_ = consumes<CrossingFrame<PCaloHit>>(
77  edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEE")));
78  ESHits_Token_ = consumes<CrossingFrame<PCaloHit>>(
79  edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("EcalHitsES")));
80 
81  // use value of first digit to determine default output level (inclusive)
82  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
83  verbosity %= 10;
84 
85  // create persistent object
86  // produces<PGlobalRecHit>(label);
87 
88  // print out Parameter Set information being used
89  if (verbosity >= 0) {
90  edm::LogInfo(MsgLoggerCat) << "\n===============================\n"
91  << "Initialized as EDProducer with parameter values:\n"
92  << " Name = " << fName << "\n"
93  << " Verbosity = " << verbosity << "\n"
94  << " Frequency = " << frequency << "\n"
95  << " GetProv = " << getAllProvenances << "\n"
96  << " PrintProv = " << printProvenanceInfo << "\n"
97  << " ECalEBSrc = " << ECalEBSrc_.label() << ":" << ECalEBSrc_.instance() << "\n"
98  << " ECalUncalEBSrc = " << ECalUncalEBSrc_.label() << ":"
99  << ECalUncalEBSrc_.instance() << "\n"
100  << " ECalEESrc = " << ECalEESrc_.label() << ":" << ECalUncalEESrc_.instance()
101  << "\n"
102  << " ECalUncalEESrc = " << ECalUncalEESrc_.label() << ":" << ECalEESrc_.instance()
103  << "\n"
104  << " ECalESSrc = " << ECalESSrc_.label() << ":" << ECalESSrc_.instance() << "\n"
105  << " HCalSrc = " << HCalSrc_.label() << ":" << HCalSrc_.instance() << "\n"
106  << " SiStripSrc = " << SiStripSrc_.label() << ":" << SiStripSrc_.instance()
107  << "\n"
108  << " SiPixelSrc = " << SiPxlSrc_.label() << ":" << SiPxlSrc_.instance() << "\n"
109  << " MuDTSrc = " << MuDTSrc_.label() << ":" << MuDTSrc_.instance() << "\n"
110  << " MuDTSimSrc = " << MuDTSimSrc_.label() << ":" << MuDTSimSrc_.instance()
111  << "\n"
112  << " MuCSCSrc = " << MuCSCSrc_.label() << ":" << MuCSCSrc_.instance() << "\n"
113  << " MuRPCSrc = " << MuRPCSrc_.label() << ":" << MuRPCSrc_.instance() << "\n"
114  << " MuRPCSimSrc = " << MuRPCSimSrc_.label() << ":" << MuRPCSimSrc_.instance()
115  << "\n"
116  << "===============================\n";
117  }
118 }
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
std::string const & instance() const
Definition: InputTag.h:37
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
GlobalRecHitsAnalyzer::~GlobalRecHitsAnalyzer ( )
override

Definition at line 120 of file GlobalRecHitsAnalyzer.cc.

120 {}

Member Function Documentation

void GlobalRecHitsAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 292 of file GlobalRecHitsAnalyzer.cc.

References count, edm::EventID::event(), fillECal(), fillHCal(), fillMuon(), fillTrk(), frequency, getAllProvenances, edm::Event::getAllStableProvenance(), mps_fire::i, edm::EventBase::id(), nevt, printProvenanceInfo, edm::EventID::run(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

292  {
293  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_analyze";
294 
295  // keep track of number of events processed
296  ++count;
297 
298  // get event id information
299  edm::RunNumber_t nrun = iEvent.id().run();
300  edm::EventNumber_t nevt = iEvent.id().event();
301 
302  if (verbosity > 0) {
303  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count << " events total)";
304  } else if (verbosity == 0) {
305  if (nevt % frequency == 0 || nevt == 1) {
306  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count
307  << " events total)";
308  }
309  }
310 
311  // look at information available in the event
312  if (getAllProvenances) {
313  std::vector<const edm::StableProvenance*> AllProv;
314  iEvent.getAllStableProvenance(AllProv);
315 
316  if (verbosity >= 0)
317  edm::LogInfo(MsgLoggerCat) << "Number of Provenances = " << AllProv.size();
318 
319  if (printProvenanceInfo && (verbosity >= 0)) {
320  TString eventout("\nProvenance info:\n");
321 
322  for (unsigned int i = 0; i < AllProv.size(); ++i) {
323  eventout += "\n ******************************";
324  eventout += "\n Module : ";
325  eventout += AllProv[i]->moduleLabel();
326  eventout += "\n ProductID : ";
327  eventout += AllProv[i]->productID().id();
328  eventout += "\n ClassName : ";
329  eventout += AllProv[i]->className();
330  eventout += "\n InstanceName : ";
331  eventout += AllProv[i]->productInstanceName();
332  eventout += "\n BranchName : ";
333  eventout += AllProv[i]->branchName();
334  }
335  eventout += "\n ******************************\n";
336  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
337  printProvenanceInfo = false;
338  }
339  getAllProvenances = false;
340  }
341 
342  // call fill functions
343  // gather Ecal information from event
344  fillECal(iEvent, iSetup);
345  // gather Hcal information from event
346  fillHCal(iEvent, iSetup);
347  // gather Track information from event
348  fillTrk(iEvent, iSetup);
349  // gather Muon information from event
350  fillMuon(iEvent, iSetup);
351 
352  if (verbosity > 0)
353  edm::LogInfo(MsgLoggerCat) << "Done gathering data from event.";
354 
355  return;
356 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
void fillMuon(const edm::Event &, const edm::EventSetup &)
unsigned long long EventNumber_t
void fillTrk(const edm::Event &, const edm::EventSetup &)
edm::EventID id() const
Definition: EventBase.h:59
void fillECal(const edm::Event &, const edm::EventSetup &)
unsigned int RunNumber_t
void fillHCal(const edm::Event &, const edm::EventSetup &)
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:126
void GlobalRecHitsAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 122 of file GlobalRecHitsAnalyzer.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), mps_fire::i, dqmiolumiharvest::j, mehCSCn, mehCSCResRDPhi, mehDtMuonn, mehDtMuonRes, mehEcaln, mehEcalRes, mehHcaln, mehHcalRes, mehRPCn, mehRPCResX, mehSiPixeln, mehSiPixelResX, mehSiPixelResY, mehSiStripn, mehSiStripResX, mehSiStripResY, dqm::impl::MonitorElement::setAxisTitle(), and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

122  {
123  // Si Strip
124  string SiStripString[19] = {"TECW1",
125  "TECW2",
126  "TECW3",
127  "TECW4",
128  "TECW5",
129  "TECW6",
130  "TECW7",
131  "TECW8",
132  "TIBL1",
133  "TIBL2",
134  "TIBL3",
135  "TIBL4",
136  "TIDW1",
137  "TIDW2",
138  "TIDW3",
139  "TOBL1",
140  "TOBL2",
141  "TOBL3",
142  "TOBL4"};
143  for (int i = 0; i < 19; ++i) {
144  mehSiStripn[i] = nullptr;
145  mehSiStripResX[i] = nullptr;
146  mehSiStripResY[i] = nullptr;
147  }
148  string hcharname, hchartitle;
149  iBooker.setCurrentFolder("GlobalRecHitsV/SiStrips");
150  for (int amend = 0; amend < 19; ++amend) {
151  hcharname = "hSiStripn_" + SiStripString[amend];
152  hchartitle = SiStripString[amend] + " rechits";
153  mehSiStripn[amend] = iBooker.book1D(hcharname, hchartitle, 200, 0., 200.);
154  mehSiStripn[amend]->setAxisTitle("Number of hits in " + SiStripString[amend], 1);
155  mehSiStripn[amend]->setAxisTitle("Count", 2);
156  hcharname = "hSiStripResX_" + SiStripString[amend];
157  hchartitle = SiStripString[amend] + " rechit x resolution";
158  mehSiStripResX[amend] = iBooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
159  mehSiStripResX[amend]->setAxisTitle("X-resolution in " + SiStripString[amend], 1);
160  mehSiStripResX[amend]->setAxisTitle("Count", 2);
161  hcharname = "hSiStripResY_" + SiStripString[amend];
162  hchartitle = SiStripString[amend] + " rechit y resolution";
163  mehSiStripResY[amend] = iBooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
164  mehSiStripResY[amend]->setAxisTitle("Y-resolution in " + SiStripString[amend], 1);
165  mehSiStripResY[amend]->setAxisTitle("Count", 2);
166  }
167 
168  //HCal
169  //string hcharname, hchartitle;
170  string HCalString[4] = {"HB", "HE", "HF", "HO"};
171  float HCalnUpper[4] = {3000., 3000., 3000., 3000.};
172  float HCalnLower[4] = {0., 0., 0., 0.};
173  for (int j = 0; j < 4; ++j) {
174  mehHcaln[j] = nullptr;
175  mehHcalRes[j] = nullptr;
176  }
177 
178  iBooker.setCurrentFolder("GlobalRecHitsV/HCals");
179  for (int amend = 0; amend < 4; ++amend) {
180  hcharname = "hHcaln_" + HCalString[amend];
181  hchartitle = HCalString[amend] + " rechits";
182  mehHcaln[amend] = iBooker.book1D(hcharname, hchartitle, 1000, HCalnLower[amend], HCalnUpper[amend]);
183  mehHcaln[amend]->setAxisTitle("Number of RecHits", 1);
184  mehHcaln[amend]->setAxisTitle("Count", 2);
185  hcharname = "hHcalRes_" + HCalString[amend];
186  hchartitle = HCalString[amend] + " rechit resolution";
187  mehHcalRes[amend] = iBooker.book1D(hcharname, hchartitle, 25, -2., 2.);
188  mehHcalRes[amend]->setAxisTitle("RecHit E - SimHit E", 1);
189  mehHcalRes[amend]->setAxisTitle("Count", 2);
190  }
191 
192  //Ecal
193  string ECalString[3] = {"EB", "EE", "ES"};
194  int ECalnBins[3] = {1000, 3000, 150};
195  float ECalnUpper[3] = {20000., 62000., 3000.};
196  float ECalnLower[3] = {0., 0., 0.};
197  int ECalResBins[3] = {200, 200, 200};
198  float ECalResUpper[3] = {1., 0.3, .0002};
199  float ECalResLower[3] = {-1., -0.3, -.0002};
200  for (int i = 0; i < 3; ++i) {
201  mehEcaln[i] = nullptr;
202  mehEcalRes[i] = nullptr;
203  }
204  iBooker.setCurrentFolder("GlobalRecHitsV/ECals");
205 
206  for (int amend = 0; amend < 3; ++amend) {
207  hcharname = "hEcaln_" + ECalString[amend];
208  hchartitle = ECalString[amend] + " rechits";
209  mehEcaln[amend] = iBooker.book1D(hcharname, hchartitle, ECalnBins[amend], ECalnLower[amend], ECalnUpper[amend]);
210  mehEcaln[amend]->setAxisTitle("Number of RecHits", 1);
211  mehEcaln[amend]->setAxisTitle("Count", 2);
212  hcharname = "hEcalRes_" + ECalString[amend];
213  hchartitle = ECalString[amend] + " rechit resolution";
214  mehEcalRes[amend] =
215  iBooker.book1D(hcharname, hchartitle, ECalResBins[amend], ECalResLower[amend], ECalResUpper[amend]);
216  mehEcalRes[amend]->setAxisTitle("RecHit E - SimHit E", 1);
217  mehEcalRes[amend]->setAxisTitle("Count", 2);
218  }
219 
220  //Si Pixels
221  string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p", "FWD2n", "FWD2p"};
222  for (int j = 0; j < 7; ++j) {
223  mehSiPixeln[j] = nullptr;
224  mehSiPixelResX[j] = nullptr;
225  mehSiPixelResY[j] = nullptr;
226  }
227 
228  iBooker.setCurrentFolder("GlobalRecHitsV/SiPixels");
229  for (int amend = 0; amend < 7; ++amend) {
230  hcharname = "hSiPixeln_" + SiPixelString[amend];
231  hchartitle = SiPixelString[amend] + " rechits";
232  mehSiPixeln[amend] = iBooker.book1D(hcharname, hchartitle, 200, 0., 200.);
233  mehSiPixeln[amend]->setAxisTitle("Number of hits in " + SiPixelString[amend], 1);
234  mehSiPixeln[amend]->setAxisTitle("Count", 2);
235  hcharname = "hSiPixelResX_" + SiPixelString[amend];
236  hchartitle = SiPixelString[amend] + " rechit x resolution";
237  mehSiPixelResX[amend] = iBooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
238  mehSiPixelResX[amend]->setAxisTitle("X-resolution in " + SiPixelString[amend], 1);
239  mehSiPixelResX[amend]->setAxisTitle("Count", 2);
240  hcharname = "hSiPixelResY_" + SiPixelString[amend];
241  hchartitle = SiPixelString[amend] + " rechit y resolution";
242 
243  mehSiPixelResY[amend] = iBooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
244  mehSiPixelResY[amend]->setAxisTitle("Y-resolution in " + SiPixelString[amend], 1);
245  mehSiPixelResY[amend]->setAxisTitle("Count", 2);
246  }
247 
248  //Muons
249  iBooker.setCurrentFolder("GlobalRecHitsV/Muons");
250 
251  mehDtMuonn = nullptr;
252  mehCSCn = nullptr;
253  mehRPCn = nullptr;
254 
255  string n_List[3] = {"hDtMuonn", "hCSCn", "hRPCn"};
256  string hist_string[3] = {"Dt", "CSC", "RPC"};
257 
258  for (int amend = 0; amend < 3; ++amend) {
259  hchartitle = hist_string[amend] + " rechits";
260  if (amend == 0) {
261  mehDtMuonn = iBooker.book1D(n_List[amend], hchartitle, 50, 0., 500.);
262  mehDtMuonn->setAxisTitle("Number of Rechits", 1);
263  mehDtMuonn->setAxisTitle("Count", 2);
264  }
265  if (amend == 1) {
266  mehCSCn = iBooker.book1D(n_List[amend], hchartitle, 50, 0., 500.);
267  mehCSCn->setAxisTitle("Number of Rechits", 1);
268  mehCSCn->setAxisTitle("Count", 2);
269  }
270  if (amend == 2) {
271  mehRPCn = iBooker.book1D(n_List[amend], hchartitle, 50, 0., 500.);
272  mehRPCn->setAxisTitle("Number of Rechits", 1);
273  mehRPCn->setAxisTitle("Count", 2);
274  }
275  }
276 
277  mehDtMuonRes = nullptr;
278  mehCSCResRDPhi = nullptr;
279  mehRPCResX = nullptr;
280 
281  hcharname = "hDtMuonRes";
282  hchartitle = "DT wire distance resolution";
283  mehDtMuonRes = iBooker.book1D(hcharname, hchartitle, 200, -0.2, 0.2);
284  hcharname = "CSCResRDPhi";
285  hchartitle = "CSC perp*dphi resolution";
286  mehCSCResRDPhi = iBooker.book1D(hcharname, hchartitle, 200, -0.2, 0.2);
287  hcharname = "hRPCResX";
288  hchartitle = "RPC rechits x resolution";
289  mehRPCResX = iBooker.book1D(hcharname, hchartitle, 50, -5., 5.);
290 }
MonitorElement * mehCSCResRDPhi
MonitorElement * mehHcalRes[4]
MonitorElement * mehEcalRes[3]
MonitorElement * mehSiStripn[19]
MonitorElement * mehSiPixelResX[7]
MonitorElement * mehEcaln[3]
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
MonitorElement * mehSiPixeln[7]
MonitorElement * mehHcaln[4]
MonitorElement * mehSiStripResX[19]
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
template<typename type >
int GlobalRecHitsAnalyzer::compute ( const DTGeometry dtGeom,
const std::map< DTWireId, std::vector< PSimHit >> &  simHitsPerWire,
const std::map< DTWireId, std::vector< type >> &  recHitsPerWire,
int  step 
)
private

Definition at line 1479 of file GlobalRecHitsAnalyzer.cc.

References dqm::impl::MonitorElement::Fill(), findBestRecHit(), DTHitQualityUtils::findMuSimHit(), DTGeometry::layer(), genParticles_cff::map, mehDtMuonRes, recHitDistFromWire(), FastTrackerRecHitMaskProducer_cfi::recHits, and simHitDistFromWire().

Referenced by fillMuon().

1482  {
1483  std::map<DTWireId, std::vector<PSimHit>> simHitsPerWire = _simHitsPerWire;
1484  std::map<DTWireId, std::vector<type>> recHitsPerWire = _recHitsPerWire;
1485  int nDt = 0;
1486  // Loop over cells with a muon SimHit
1487  for (std::map<DTWireId, std::vector<PSimHit>>::const_iterator wireAndSHits = simHitsPerWire.begin();
1488  wireAndSHits != simHitsPerWire.end();
1489  wireAndSHits++) {
1490  DTWireId wireId = (*wireAndSHits).first;
1491  std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1492 
1493  // Get the layer
1494  const DTLayer* layer = dtGeom->layer(wireId);
1495 
1496  // Look for a mu hit in the cell
1497  const PSimHit* muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
1498  if (muSimHit == nullptr) {
1499  continue; // Skip this cell
1500  }
1501 
1502  // Find the distance of the simhit from the wire
1503  float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
1504  // Skip simhits out of the cell
1505  if (simHitWireDist > 2.1) {
1506  continue; // Skip this cell
1507  }
1508 
1509  // Look for RecHits in the same cell
1510  if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1511  continue; // No RecHit found in this cell
1512  } else {
1513  std::vector<type> recHits = recHitsPerWire[wireId];
1514 
1515  // Find the best RecHit
1516  const type* theBestRecHit = findBestRecHit(layer, wireId, recHits, simHitWireDist);
1517 
1518  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
1519 
1520  ++nDt;
1521 
1522  mehDtMuonRes->Fill(recHitWireDist - simHitWireDist);
1523 
1524  } // find rechits
1525  } // loop over simhits
1526 
1527  return nDt;
1528 }
type
Definition: HCALResponse.h:21
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
void Fill(long long x)
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
void GlobalRecHitsAnalyzer::fillECal ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 358 of file GlobalRecHitsAnalyzer.cc.

References HLT_2018_cff::barrelHits, edm::SortedCollection< T, SORT >::begin(), EBHits_Token_, CollectionTags_cfi::EBRecHit, CollectionTags_cfi::EBUncalibRecHit, ECalEBSrc_Token_, ECalEESrc_Token_, ECalESSrc_Token_, ECalUncalEBSrc_Token_, ECalUncalEESrc_Token_, EEHits_Token_, CollectionTags_cfi::EERecHit, CollectionTags_cfi::EEUncalibRecHit, edm::SortedCollection< T, SORT >::end(), HLT_2018_cff::endcapHits, ESHits_Token_, dqm::impl::MonitorElement::Fill(), edm::SortedCollection< T, SORT >::find(), edm::Event::getByToken(), edm::HandleBase::isValid(), LogDebug, mehEcaln, mehEcalRes, gedPhotons_cfi::preshowerHits, edm::Handle< T >::product(), DetId::rawId(), rpcPointValidation_cfi::recHit, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

Referenced by analyze().

358  {
359  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillECal";
360 
361  TString eventout;
362  if (verbosity > 0)
363  eventout = "\nGathering info:";
364 
365  // extract crossing frame from event
367 
369  //extract EB information
372  iEvent.getByToken(ECalUncalEBSrc_Token_, EcalUncalibRecHitEB);
373  bool validUncalibRecHitEB = true;
374  if (!EcalUncalibRecHitEB.isValid()) {
375  LogDebug(MsgLoggerCat) << "Unable to find EcalUncalRecHitEB in event!";
376  validUncalibRecHitEB = false;
377  }
378 
379  edm::Handle<EBRecHitCollection> EcalRecHitEB;
380  iEvent.getByToken(ECalEBSrc_Token_, EcalRecHitEB);
381  bool validRecHitEB = true;
382  if (!EcalRecHitEB.isValid()) {
383  LogDebug(MsgLoggerCat) << "Unable to find EcalRecHitEB in event!";
384  validRecHitEB = false;
385  }
386 
387  // loop over simhits
388  iEvent.getByToken(EBHits_Token_, crossingFrame);
389  bool validXFrame = true;
390  if (!crossingFrame.isValid()) {
391  LogDebug(MsgLoggerCat) << "Unable to find cal barrel crossingFrame in event!";
392  validXFrame = false;
393  }
394 
395  MapType ebSimMap;
396  if (validXFrame) {
397  const MixCollection<PCaloHit> barrelHits(crossingFrame.product());
398  // keep track of sum of simhit energy in each crystal
399  for (auto const& iHit : barrelHits) {
400  EBDetId ebid = EBDetId(iHit.id());
401 
402  uint32_t crystid = ebid.rawId();
403  ebSimMap[crystid] += iHit.energy();
404  }
405  }
406 
407  int nEBRecHits = 0;
408  // loop over RecHits
409  if (validUncalibRecHitEB && validRecHitEB) {
410  const EBUncalibratedRecHitCollection* EBUncalibRecHit = EcalUncalibRecHitEB.product();
411  const EBRecHitCollection* EBRecHit = EcalRecHitEB.product();
412 
413  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EBUncalibRecHit->begin();
414  uncalibRecHit != EBUncalibRecHit->end();
415  ++uncalibRecHit) {
416  EBDetId EBid = EBDetId(uncalibRecHit->id());
417 
418  EcalRecHitCollection::const_iterator myRecHit = EBRecHit->find(EBid);
419 
420  if (myRecHit != EBRecHit->end()) {
421  ++nEBRecHits;
422  mehEcalRes[1]->Fill(myRecHit->energy() - ebSimMap[EBid.rawId()]);
423  }
424  }
425 
426  if (verbosity > 1) {
427  eventout += "\n Number of EBRecHits collected:............ ";
428  eventout += nEBRecHits;
429  }
430  mehEcaln[1]->Fill((float)nEBRecHits);
431  }
432 
434  //extract EE information
437  iEvent.getByToken(ECalUncalEESrc_Token_, EcalUncalibRecHitEE);
438  bool validuncalibRecHitEE = true;
439  if (!EcalUncalibRecHitEE.isValid()) {
440  LogDebug(MsgLoggerCat) << "Unable to find EcalUncalRecHitEE in event!";
441  validuncalibRecHitEE = false;
442  }
443 
444  edm::Handle<EERecHitCollection> EcalRecHitEE;
445  iEvent.getByToken(ECalEESrc_Token_, EcalRecHitEE);
446  bool validRecHitEE = true;
447  if (!EcalRecHitEE.isValid()) {
448  LogDebug(MsgLoggerCat) << "Unable to find EcalRecHitEE in event!";
449  validRecHitEE = false;
450  }
451 
452  // loop over simhits
453  iEvent.getByToken(EEHits_Token_, crossingFrame);
454  validXFrame = true;
455  if (!crossingFrame.isValid()) {
456  LogDebug(MsgLoggerCat) << "Unable to find cal endcap crossingFrame in event!";
457  validXFrame = false;
458  }
459 
460  MapType eeSimMap;
461  if (validXFrame) {
462  const MixCollection<PCaloHit> endcapHits(crossingFrame.product());
463  // keep track of sum of simhit energy in each crystal
464  for (auto const& iHit : endcapHits) {
465  EEDetId eeid = EEDetId(iHit.id());
466 
467  uint32_t crystid = eeid.rawId();
468  eeSimMap[crystid] += iHit.energy();
469  }
470  }
471 
472  int nEERecHits = 0;
473  if (validuncalibRecHitEE && validRecHitEE) {
474  // loop over RecHits
475  const EEUncalibratedRecHitCollection* EEUncalibRecHit = EcalUncalibRecHitEE.product();
476  const EERecHitCollection* EERecHit = EcalRecHitEE.product();
477 
478  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EEUncalibRecHit->begin();
479  uncalibRecHit != EEUncalibRecHit->end();
480  ++uncalibRecHit) {
481  EEDetId EEid = EEDetId(uncalibRecHit->id());
482 
483  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
484 
485  if (myRecHit != EERecHit->end()) {
486  ++nEERecHits;
487  mehEcalRes[0]->Fill(myRecHit->energy() - eeSimMap[EEid.rawId()]);
488  }
489  }
490 
491  if (verbosity > 1) {
492  eventout += "\n Number of EERecHits collected:............ ";
493  eventout += nEERecHits;
494  }
495  mehEcaln[0]->Fill((float)nEERecHits);
496  }
497 
499  //extract ES information
501  edm::Handle<ESRecHitCollection> EcalRecHitES;
502  iEvent.getByToken(ECalESSrc_Token_, EcalRecHitES);
503  bool validRecHitES = true;
504  if (!EcalRecHitES.isValid()) {
505  LogDebug(MsgLoggerCat) << "Unable to find EcalRecHitES in event!";
506  validRecHitES = false;
507  }
508 
509  // loop over simhits
510  iEvent.getByToken(ESHits_Token_, crossingFrame);
511  validXFrame = true;
512  if (!crossingFrame.isValid()) {
513  LogDebug(MsgLoggerCat) << "Unable to find cal preshower crossingFrame in event!";
514  validXFrame = false;
515  }
516 
517  MapType esSimMap;
518  if (validXFrame) {
519  const MixCollection<PCaloHit> preshowerHits(crossingFrame.product());
520  // keep track of sum of simhit energy in each crystal
521  for (auto const& iHit : preshowerHits) {
522  ESDetId esid = ESDetId(iHit.id());
523 
524  uint32_t crystid = esid.rawId();
525  esSimMap[crystid] += iHit.energy();
526  }
527  }
528 
529  int nESRecHits = 0;
530  if (validRecHitES) {
531  // loop over RecHits
532  const ESRecHitCollection* ESRecHit = EcalRecHitES.product();
533  for (EcalRecHitCollection::const_iterator recHit = ESRecHit->begin(); recHit != ESRecHit->end(); ++recHit) {
534  ESDetId ESid = ESDetId(recHit->id());
535 
536  ++nESRecHits;
537  mehEcalRes[2]->Fill(recHit->energy() - esSimMap[ESid.rawId()]);
538  }
539 
540  if (verbosity > 1) {
541  eventout += "\n Number of ESRecHits collected:............ ";
542  eventout += nESRecHits;
543  }
544  mehEcaln[2]->Fill(float(nESRecHits));
545  }
546 
547  if (verbosity > 0)
548  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
549 
550  return;
551 }
#define LogDebug(id)
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< T >::const_iterator const_iterator
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
MonitorElement * mehEcalRes[3]
void Fill(long long x)
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
MonitorElement * mehEcaln[3]
bool isValid() const
Definition: HandleBase.h:70
const_iterator end() const
std::map< uint32_t, float, std::less< uint32_t > > MapType
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
T const * product() const
Definition: Handle.h:69
iterator find(key_type k)
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
const_iterator begin() const
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
void GlobalRecHitsAnalyzer::fillHCal ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 553 of file GlobalRecHitsAnalyzer.cc.

References dqm::impl::MonitorElement::Fill(), geometry, edm::EventSetup::get(), edm::Event::getByToken(), CaloSubdetectorGeometry::getGeometry(), edm::Event::getManyByType(), HcalGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), photonIsolationHIProducer_cfi::hbhe, DetId::Hcal, HCalSrc_Token_, photonIsolationHIProducer_cfi::hf, photonIsolationHIProducer_cfi::ho, ihf, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), LogDebug, mehHcaln, mehHcalRes, PV3DBase< T, PVType, FrameType >::phi(), PI, edm::Handle< T >::product(), edm::ESHandle< T >::product(), sdHcalBrl, sdHcalEC, sdHcalFwd, sdHcalOut, HLTBitAnalyser_cfi::simhits, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

Referenced by analyze().

553  {
554  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillHCal";
555 
556  TString eventout;
557  if (verbosity > 0)
558  eventout = "\nGathering info:";
559 
560  // get geometry
562  iSetup.get<CaloGeometryRecord>().get(geometry);
563  if (!geometry.isValid()) {
564  edm::LogWarning(MsgLoggerCat) << "Unable to find CaloGeometry in event!";
565  return;
566  }
567 
569  // extract simhit info
572  iEvent.getByToken(HCalSrc_Token_, hcalHits);
573  bool validhcalHits = true;
574  if (!hcalHits.isValid()) {
575  LogDebug(MsgLoggerCat) << "Unable to find hcalHits in event!";
576  validhcalHits = false;
577  }
578 
579  std::map<HcalDetId, float> fHBEnergySimHits;
580  std::map<HcalDetId, float> fHEEnergySimHits;
581  std::map<HcalDetId, float> fHOEnergySimHits;
582  std::map<HcalDetId, float> fHFEnergySimHits;
583  if (validhcalHits) {
584  const edm::PCaloHitContainer* simhitResult = hcalHits.product();
585 
586  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end();
587  ++simhits) {
588  HcalDetId detId(simhits->id());
589 
590  if (detId.subdet() == sdHcalBrl) {
591  fHBEnergySimHits[detId] += simhits->energy();
592  }
593  if (detId.subdet() == sdHcalEC) {
594  fHEEnergySimHits[detId] += simhits->energy();
595  }
596  if (detId.subdet() == sdHcalOut) {
597  fHOEnergySimHits[detId] += simhits->energy();
598  }
599  if (detId.subdet() == sdHcalFwd) {
600  fHFEnergySimHits[detId] += simhits->energy();
601  }
602  }
603  }
604 
605  // max values to be used (HO is found in HB)
606  Double_t maxHBEnergy = 0.;
607  Double_t maxHEEnergy = 0.;
608  Double_t maxHFEnergy = 0.;
609 
610  Double_t maxHBPhi = -1000.;
611  Double_t maxHEPhi = -1000.;
612  Double_t maxHOPhi = -1000.;
613  Double_t maxHFPhi = -1000.;
614 
615  Double_t PI = 3.141592653589;
616 
618  // get HBHE information
620  std::vector<edm::Handle<HBHERecHitCollection>> hbhe;
621  iEvent.getManyByType(hbhe);
622  bool validHBHE = true;
623  if (!hbhe[0].isValid()) {
624  LogDebug(MsgLoggerCat) << "Unable to find any HBHERecHitCollections in event!";
625  validHBHE = false;
626  }
627 
628  if (validHBHE) {
629  std::vector<edm::Handle<HBHERecHitCollection>>::iterator ihbhe;
630  const CaloGeometry* geo = geometry.product();
631 
632  int iHB = 0;
633  int iHE = 0;
634  for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
635  // find max values
636  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin(); jhbhe != (*ihbhe)->end(); ++jhbhe) {
637  HcalDetId cell(jhbhe->id());
638 
639  if (cell.subdet() == sdHcalBrl) {
640  const HcalGeometry* cellGeometry =
641  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
642  double fPhi = cellGeometry->getPosition(cell).phi();
643  if ((jhbhe->energy()) > maxHBEnergy) {
644  maxHBEnergy = jhbhe->energy();
645  maxHBPhi = fPhi;
646  maxHOPhi = maxHBPhi;
647  }
648  }
649 
650  if (cell.subdet() == sdHcalEC) {
651  const HcalGeometry* cellGeometry =
652  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
653  double fPhi = cellGeometry->getPosition(cell).phi();
654  if ((jhbhe->energy()) > maxHEEnergy) {
655  maxHEEnergy = jhbhe->energy();
656  maxHEPhi = fPhi;
657  }
658  }
659  } // end find max values
660 
661  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin(); jhbhe != (*ihbhe)->end(); ++jhbhe) {
662  HcalDetId cell(jhbhe->id());
663 
664  if (cell.subdet() == sdHcalBrl) {
665  ++iHB;
666 
667  const HcalGeometry* cellGeometry =
668  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
669  double fPhi = cellGeometry->getPosition(cell).phi();
670 
671  float deltaphi = maxHBPhi - fPhi;
672  if (fPhi > maxHBPhi) {
673  deltaphi = fPhi - maxHBPhi;
674  }
675  if (deltaphi > PI) {
676  deltaphi = 2.0 * PI - deltaphi;
677  }
678 
679  mehHcalRes[0]->Fill(jhbhe->energy() - fHBEnergySimHits[cell]);
680  }
681 
682  if (cell.subdet() == sdHcalEC) {
683  ++iHE;
684 
685  const HcalGeometry* cellGeometry =
686  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
687  double fPhi = cellGeometry->getPosition(cell).phi();
688 
689  float deltaphi = maxHEPhi - fPhi;
690  if (fPhi > maxHEPhi) {
691  deltaphi = fPhi - maxHEPhi;
692  }
693  if (deltaphi > PI) {
694  deltaphi = 2.0 * PI - deltaphi;
695  }
696  mehHcalRes[1]->Fill(jhbhe->energy() - fHEEnergySimHits[cell]);
697  }
698  }
699  } // end loop through collection
700 
701  if (verbosity > 1) {
702  eventout += "\n Number of HBRecHits collected:............ ";
703  eventout += iHB;
704  }
705 
706  if (verbosity > 1) {
707  eventout += "\n Number of HERecHits collected:............ ";
708  eventout += iHE;
709  }
710  mehHcaln[0]->Fill((float)iHB);
711  mehHcaln[1]->Fill((float)iHE);
712  }
713 
715  // get HF information
717  std::vector<edm::Handle<HFRecHitCollection>> hf;
718  iEvent.getManyByType(hf);
719  bool validHF = true;
720  if (!hf[0].isValid()) {
721  LogDebug(MsgLoggerCat) << "Unable to find any HFRecHitCollections in event!";
722  validHF = false;
723  }
724  if (validHF) {
725  std::vector<edm::Handle<HFRecHitCollection>>::iterator ihf;
726 
727  int iHF = 0;
728  for (ihf = hf.begin(); ihf != hf.end(); ++ihf) {
729  // find max values
730  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin(); jhf != (*ihf)->end(); ++jhf) {
731  HcalDetId cell(jhf->id());
732 
733  if (cell.subdet() == sdHcalFwd) {
734  auto cellGeometry = geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
735  double fPhi = cellGeometry->getPosition().phi();
736  if ((jhf->energy()) > maxHFEnergy) {
737  maxHFEnergy = jhf->energy();
738  maxHFPhi = fPhi;
739  }
740  }
741  } // end find max values
742 
743  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin(); jhf != (*ihf)->end(); ++jhf) {
744  HcalDetId cell(jhf->id());
745 
746  if (cell.subdet() == sdHcalFwd) {
747  ++iHF;
748 
749  auto cellGeometry = geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
750  double fPhi = cellGeometry->getPosition().phi();
751 
752  float deltaphi = maxHBPhi - fPhi;
753  if (fPhi > maxHFPhi) {
754  deltaphi = fPhi - maxHFPhi;
755  }
756  if (deltaphi > PI) {
757  deltaphi = 2.0 * PI - deltaphi;
758  }
759 
760  mehHcalRes[2]->Fill(jhf->energy() - fHFEnergySimHits[cell]);
761  }
762  }
763  } // end loop through collection
764 
765  if (verbosity > 1) {
766  eventout += "\n Number of HFDigis collected:.............. ";
767  eventout += iHF;
768  }
769  mehHcaln[2]->Fill((float)iHF);
770  }
771 
773  // get HO information
775  std::vector<edm::Handle<HORecHitCollection>> ho;
776  iEvent.getManyByType(ho);
777  bool validHO = true;
778  if (!ho[0].isValid()) {
779  LogDebug(MsgLoggerCat) << "Unable to find any HORecHitCollections in event!";
780  validHO = false;
781  }
782 
783  if (validHO) {
784  std::vector<edm::Handle<HORecHitCollection>>::iterator iho;
785 
786  int iHO = 0;
787  for (iho = ho.begin(); iho != ho.end(); ++iho) {
788  for (HORecHitCollection::const_iterator jho = (*iho)->begin(); jho != (*iho)->end(); ++jho) {
789  HcalDetId cell(jho->id());
790 
791  if (cell.subdet() == sdHcalOut) {
792  ++iHO;
793 
794  auto cellGeometry = geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
795  double fPhi = cellGeometry->getPosition().phi();
796 
797  float deltaphi = maxHOPhi - fPhi;
798  if (fPhi > maxHOPhi) {
799  deltaphi = fPhi - maxHOPhi;
800  }
801  if (deltaphi > PI) {
802  deltaphi = 2.0 * PI - deltaphi;
803  }
804  mehHcalRes[3]->Fill(jho->energy() - fHOEnergySimHits[cell]);
805  }
806  }
807  } // end loop through collection
808 
809  if (verbosity > 1) {
810  eventout += "\n Number of HODigis collected:.............. ";
811  eventout += iHO;
812  }
813  mehHcaln[3]->Fill((float)iHO);
814  }
815 
816  if (verbosity > 0)
817  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
818 
819  return;
820 }
#define LogDebug(id)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
std::vector< PCaloHit > PCaloHitContainer
int ihf
static const int sdHcalOut
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
MonitorElement * mehHcalRes[4]
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::vector< T >::const_iterator const_iterator
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: Event.h:516
void Fill(long long x)
bool isValid() const
Definition: HandleBase.h:70
#define PI
Definition: QcdUeDQM.h:37
GlobalPoint getPosition(const DetId &id) const
T const * product() const
Definition: Handle.h:69
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
static const int sdHcalFwd
static const int sdHcalBrl
ESHandle< TrackerGeometry > geometry
MonitorElement * mehHcaln[4]
T get() const
Definition: EventSetup.h:73
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
static const int sdHcalEC
void GlobalRecHitsAnalyzer::fillMuon ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 1183 of file GlobalRecHitsAnalyzer.cc.

References CSCLayer::chamber(), CSCChamberSpecs::chamberType(), compute(), dqm::impl::MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), mps_fire::i, CSCGeometry::idToDetUnit(), RPCRoll::isForward(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), LogDebug, map1DRecHitsPerWire(), DTHitQualityUtils::mapSimHitsPerWire(), mehCSCn, mehDtMuonn, mehRPCn, mehRPCResX, MuCSCHits_Token_, MuCSCSrc_Token_, MuDTSimSrc_Token_, MuDTSrc_Token_, MuRPCSimSrc_Token_, MuRPCSrc_Token_, plotResolution(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), OfflineHarvestingSequence_cosmic::ptype, alignCSCRings::r, rpcPointValidation_cfi::recHit, RPCGeometry::roll(), rpcPointValidation_cfi::simHit, FastTrackerRecHitCombiner_cfi::simHits, CSCChamber::specs(), AlCaHLTBitMon_QueryRunRegistry::string, theMap, verbosity, and PV3DBase< T, PVType, FrameType >::x().

Referenced by analyze().

1183  {
1184  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillMuon";
1185 
1186  TString eventout;
1187  if (verbosity > 0)
1188  eventout = "\nGathering info:";
1189 
1190  // get DT information
1192  iSetup.get<MuonGeometryRecord>().get(dtGeom);
1193  if (!dtGeom.isValid()) {
1194  edm::LogWarning(MsgLoggerCat) << "Unable to find DTMuonGeometryRecord in event!";
1195  return;
1196  }
1197 
1199  iEvent.getByToken(MuDTSimSrc_Token_, dtsimHits);
1200  bool validdtsim = true;
1201  if (!dtsimHits.isValid()) {
1202  LogDebug(MsgLoggerCat) << "Unable to find dtsimHits in event!";
1203  validdtsim = false;
1204  }
1205 
1207  iEvent.getByToken(MuDTSrc_Token_, dtRecHits);
1208  bool validdtrec = true;
1209  if (!dtRecHits.isValid()) {
1210  LogDebug(MsgLoggerCat) << "Unable to find dtRecHits in event!";
1211  validdtrec = false;
1212  }
1213 
1214  if (validdtsim && validdtrec) {
1215  std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1217 
1218  std::map<DTWireId, std::vector<DTRecHit1DPair>> recHitsPerWire = map1DRecHitsPerWire(dtRecHits.product());
1219 
1220  int nDt = compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 1);
1221 
1222  if (verbosity > 1) {
1223  eventout += "\n Number of DtMuonRecHits collected:........ ";
1224  eventout += nDt;
1225  }
1226  mehDtMuonn->Fill(float(nDt));
1227  }
1228 
1229  // get CSC Strip information
1230  // get map of sim hits
1231  theMap.clear();
1233 
1234  iEvent.getByToken(MuCSCHits_Token_, cf);
1235  bool validXFrame = true;
1236  if (!cf.isValid()) {
1237  LogDebug(MsgLoggerCat) << "Unable to find muo CSC crossingFrame in event!";
1238  validXFrame = false;
1239  }
1240  if (validXFrame) {
1242 
1243  // arrange the hits by detUnit
1244  for (auto const& iHit : simHits) {
1245  theMap[iHit.detUnitId()].push_back(iHit);
1246  }
1247  }
1248 
1249  // get geometry
1251  iSetup.get<MuonGeometryRecord>().get(hGeom);
1252  if (!hGeom.isValid()) {
1253  edm::LogWarning(MsgLoggerCat) << "Unable to find CSCMuonGeometryRecord in event!";
1254  return;
1255  }
1256  const CSCGeometry* theCSCGeometry = &*hGeom;
1257 
1258  // get rechits
1260  iEvent.getByToken(MuCSCSrc_Token_, hRecHits);
1261  bool validCSC = true;
1262  if (!hRecHits.isValid()) {
1263  LogDebug(MsgLoggerCat) << "Unable to find CSC RecHits in event!";
1264  validCSC = false;
1265  }
1266 
1267  if (validCSC) {
1268  const CSCRecHit2DCollection* cscRecHits = hRecHits.product();
1269 
1270  int nCSC = 0;
1271  for (CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin(); recHitItr != cscRecHits->end();
1272  ++recHitItr) {
1273  int detId = (*recHitItr).cscDetId().rawId();
1274 
1276  std::map<int, edm::PSimHitContainer>::const_iterator mapItr = theMap.find(detId);
1277  if (mapItr != theMap.end()) {
1278  simHits = mapItr->second;
1279  }
1280 
1281  if (simHits.size() == 1) {
1282  ++nCSC;
1283 
1284  const GeomDetUnit* detUnit = theCSCGeometry->idToDetUnit(CSCDetId(detId));
1285  const CSCLayer* layer = dynamic_cast<const CSCLayer*>(detUnit);
1286 
1287  int chamberType = layer->chamber()->specs()->chamberType();
1288  plotResolution(simHits[0], *recHitItr, layer, chamberType);
1289  }
1290  }
1291 
1292  if (verbosity > 1) {
1293  eventout += "\n Number of CSCRecHits collected:........... ";
1294  eventout += nCSC;
1295  }
1296  mehCSCn->Fill((float)nCSC);
1297  }
1298 
1299  // get RPC information
1300  std::map<double, int> mapsim, maprec;
1301  std::map<int, double> nmapsim, nmaprec;
1302 
1304  iSetup.get<MuonGeometryRecord>().get(rpcGeom);
1305  if (!rpcGeom.isValid()) {
1306  edm::LogWarning(MsgLoggerCat) << "Unable to find RPCMuonGeometryRecord in event!";
1307  return;
1308  }
1309 
1311  iEvent.getByToken(MuRPCSimSrc_Token_, simHit);
1312  bool validrpcsim = true;
1313  if (!simHit.isValid()) {
1314  LogDebug(MsgLoggerCat) << "Unable to find RPCSimHit in event!";
1315  validrpcsim = false;
1316  }
1317 
1319  iEvent.getByToken(MuRPCSrc_Token_, recHit);
1320  bool validrpc = true;
1321  if (!simHit.isValid()) {
1322  LogDebug(MsgLoggerCat) << "Unable to find RPCRecHit in event!";
1323  validrpc = false;
1324  }
1325 
1326  if (validrpc) {
1327  int nRPC = 0;
1329  int nrec = 0;
1330  for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1331  RPCDetId Rid = (RPCDetId)(*recIt).rpcId();
1332  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(Rid));
1333  if (roll->isForward()) {
1334  if (verbosity > 1) {
1335  eventout += "\n Number of RPCRecHits collected:........... ";
1336  eventout += nRPC;
1337  }
1338 
1339  if (verbosity > 0)
1340  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1341  return;
1342  }
1343  nrec = nrec + 1;
1344  LocalPoint rhitlocal = (*recIt).localPosition();
1345  double rhitlocalx = rhitlocal.x();
1346  maprec[rhitlocalx] = nrec;
1347  }
1348 
1349  int i = 0;
1350  for (std::map<double, int>::iterator iter = maprec.begin(); iter != maprec.end(); ++iter) {
1351  i = i + 1;
1352  nmaprec[i] = (*iter).first;
1353  }
1354 
1355  int nsim = 0;
1356  if (validrpcsim) {
1357  edm::PSimHitContainer::const_iterator simIt;
1358  for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1359  int ptype = (*simIt).particleType();
1360  if (ptype == 13 || ptype == -13) {
1361  nsim = nsim + 1;
1362  LocalPoint shitlocal = (*simIt).localPosition();
1363  double shitlocalx = shitlocal.x();
1364  mapsim[shitlocalx] = nsim;
1365  }
1366  }
1367 
1368  i = 0;
1369  for (std::map<double, int>::iterator iter = mapsim.begin(); iter != mapsim.end(); ++iter) {
1370  i = i + 1;
1371  nmapsim[i] = (*iter).first;
1372  }
1373  }
1374 
1375  if (nsim == nrec) {
1376  for (int r = 0; r < nsim; r++) {
1377  ++nRPC;
1378  mehRPCResX->Fill(nmaprec[r + 1] - nmapsim[r + 1]);
1379  }
1380  }
1381 
1382  if (verbosity > 1) {
1383  eventout += "\n Number of RPCRecHits collected:........... ";
1384  eventout += nRPC;
1385  }
1386  mehRPCn->Fill((float)nRPC);
1387  }
1388 
1389  if (verbosity > 0)
1390  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1391 
1392  return;
1393 }
#define LogDebug(id)
std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
void Fill(long long x)
std::map< int, edm::PSimHitContainer > theMap
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, int step)
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:39
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
T const * product() const
Definition: Handle.h:69
int chamberType() const
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:89
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
T get() const
Definition: EventSetup.h:73
std::vector< PSimHit > PSimHitContainer
bool isValid() const
Definition: ESHandle.h:44
T x() const
Definition: PV3DBase.h:59
bool isForward() const
Definition: RPCRoll.cc:43
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
const CSCChamber * chamber() const
Definition: CSCLayer.h:49
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
void GlobalRecHitsAnalyzer::fillTrk ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 822 of file GlobalRecHitsAnalyzer.cc.

References TrackerHitAssociator::associateHit(), edmNew::DetSet< T >::begin(), TrackerGeometry::dets(), edmNew::DetSet< T >::end(), edmNew::DetSetVector< T >::end(), dqm::impl::MonitorElement::Fill(), edmNew::DetSetVector< T >::find(), TrackingRecHit::geographicalId(), relativeConstraints::geom, edm::EventSetup::get(), edm::Event::getByToken(), mps_fire::i, TrackerGeometry::idToDet(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), BaseTrackerRecHit::localPosition(), LogDebug, visualization-live-secondInstance_cfg::m, matched, mehSiPixeln, mehSiPixelResX, mehSiPixelResY, mehSiStripn, mehSiStripResX, mehSiStripResY, position, edm::ESHandle< T >::product(), projectHit(), TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), sdPxlBrl, sdPxlFwd, sdSiTEC, sdSiTIB, sdSiTID, sdSiTOB, SiPxlSrc_Token_, SiStripSrc_Token_, mathSSE::sqrt(), GluedGeomDet::stereoDet(), AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), GeomDet::surface(), TrackerTopology::tecWheel(), TrackerTopology::tibLayer(), TrackerTopology::tidWheel(), TrackerTopology::tobLayer(), PbPb_ZMuSkimMuonDPG_cff::tracker, trackerHitAssociatorConfig_, verbosity, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

822  {
823  //Retrieve tracker topology from geometry
824  edm::ESHandle<TrackerTopology> tTopoHandle;
825  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
826  const TrackerTopology* const tTopo = tTopoHandle.product();
827 
828  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillTrk";
829 
830  TString eventout;
831  if (verbosity > 0)
832  eventout = "\nGathering info:";
833 
834  // get strip information
836  iEvent.getByToken(SiStripSrc_Token_, rechitsmatched);
837  bool validstrip = true;
838  if (!rechitsmatched.isValid()) {
839  LogDebug(MsgLoggerCat) << "Unable to find stripmatchedrechits in event!";
840  validstrip = false;
841  }
842 
844 
846  iSetup.get<TrackerDigiGeometryRecord>().get(pDD);
847  if (!pDD.isValid()) {
848  edm::LogWarning(MsgLoggerCat) << "Unable to find TrackerDigiGeometry in event!";
849  return;
850  }
851  const TrackerGeometry& tracker(*pDD);
852 
853  if (validstrip) {
854  int nStripBrl = 0, nStripFwd = 0;
855 
856  // loop over det units
857  for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); ++it) {
858  uint32_t myid = ((*it)->geographicalId()).rawId();
859  DetId detid = ((*it)->geographicalId());
860 
861  //loop over rechits-matched in the same subdetector
862  SiStripMatchedRecHit2DCollection::const_iterator rechitmatchedMatch = rechitsmatched->find(detid);
863 
864  if (rechitmatchedMatch != rechitsmatched->end()) {
865  SiStripMatchedRecHit2DCollection::DetSet rechitmatchedRange = *rechitmatchedMatch;
866  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorBegin =
867  rechitmatchedRange.begin();
868  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorEnd =
869  rechitmatchedRange.end();
870  SiStripMatchedRecHit2DCollection::DetSet::const_iterator itermatched = rechitmatchedRangeIteratorBegin;
871 
872  for (itermatched = rechitmatchedRangeIteratorBegin; itermatched != rechitmatchedRangeIteratorEnd;
873  ++itermatched) {
874  SiStripMatchedRecHit2D const rechit = *itermatched;
875  LocalPoint position = rechit.localPosition();
876 
877  float mindist = 999999.;
878  float distx = 999999.;
879  float disty = 999999.;
880  float dist = 999999.;
881  std::pair<LocalPoint, LocalVector> closestPair;
882  matched.clear();
883 
884  float rechitmatchedx = position.x();
885  float rechitmatchedy = position.y();
886 
887  matched = associate.associateHit(rechit);
888 
889  if (!matched.empty()) {
890  //project simhit;
891  const GluedGeomDet* gluedDet = (const GluedGeomDet*)tracker.idToDet(rechit.geographicalId());
892  const StripGeomDetUnit* partnerstripdet = (StripGeomDetUnit*)gluedDet->stereoDet();
893  std::pair<LocalPoint, LocalVector> hitPair;
894 
895  for (std::vector<PSimHit>::const_iterator m = matched.begin(); m != matched.end(); m++) {
896  //project simhit;
897  hitPair = projectHit((*m), partnerstripdet, gluedDet->surface());
898  distx = fabs(rechitmatchedx - hitPair.first.x());
899  disty = fabs(rechitmatchedy - hitPair.first.y());
900  dist = sqrt(distx * distx + disty * disty);
901 
902  if (dist < mindist) {
903  mindist = dist;
904  closestPair = hitPair;
905  }
906  }
907 
908  // get TIB
909  if (detid.subdetId() == sdSiTIB) {
910  ++nStripBrl;
911 
912  if (tTopo->tibLayer(myid) == 1) {
913  mehSiStripResX[8]->Fill(rechitmatchedx - closestPair.first.x());
914  mehSiStripResY[8]->Fill(rechitmatchedy - closestPair.first.y());
915  }
916  if (tTopo->tibLayer(myid) == 2) {
917  mehSiStripResX[9]->Fill(rechitmatchedx - closestPair.first.x());
918  mehSiStripResY[9]->Fill(rechitmatchedy - closestPair.first.y());
919  }
920  if (tTopo->tibLayer(myid) == 3) {
921  mehSiStripResX[10]->Fill(rechitmatchedx - closestPair.first.x());
922  mehSiStripResY[10]->Fill(rechitmatchedy - closestPair.first.y());
923  }
924  if (tTopo->tibLayer(myid) == 4) {
925  mehSiStripResX[11]->Fill(rechitmatchedx - closestPair.first.x());
926  mehSiStripResY[11]->Fill(rechitmatchedy - closestPair.first.y());
927  }
928  }
929 
930  // get TOB
931  if (detid.subdetId() == sdSiTOB) {
932  ++nStripBrl;
933 
934  if (tTopo->tobLayer(myid) == 1) {
935  mehSiStripResX[15]->Fill(rechitmatchedx - closestPair.first.x());
936  mehSiStripResY[15]->Fill(rechitmatchedy - closestPair.first.y());
937  }
938  if (tTopo->tobLayer(myid) == 2) {
939  mehSiStripResX[16]->Fill(rechitmatchedx - closestPair.first.x());
940  mehSiStripResY[16]->Fill(rechitmatchedy - closestPair.first.y());
941  }
942  if (tTopo->tobLayer(myid) == 3) {
943  mehSiStripResX[17]->Fill(rechitmatchedx - closestPair.first.x());
944  mehSiStripResY[17]->Fill(rechitmatchedy - closestPair.first.y());
945  }
946  if (tTopo->tobLayer(myid) == 4) {
947  mehSiStripResX[18]->Fill(rechitmatchedx - closestPair.first.x());
948  mehSiStripResY[18]->Fill(rechitmatchedy - closestPair.first.y());
949  }
950  }
951 
952  // get TID
953  if (detid.subdetId() == sdSiTID) {
954  ++nStripFwd;
955 
956  if (tTopo->tidWheel(myid) == 1) {
957  mehSiStripResX[12]->Fill(rechitmatchedx - closestPair.first.x());
958  mehSiStripResY[12]->Fill(rechitmatchedy - closestPair.first.y());
959  }
960  if (tTopo->tidWheel(myid) == 2) {
961  mehSiStripResX[13]->Fill(rechitmatchedx - closestPair.first.x());
962  mehSiStripResY[13]->Fill(rechitmatchedy - closestPair.first.y());
963  }
964  if (tTopo->tidWheel(myid) == 3) {
965  mehSiStripResX[14]->Fill(rechitmatchedx - closestPair.first.x());
966  mehSiStripResY[14]->Fill(rechitmatchedy - closestPair.first.y());
967  }
968  }
969 
970  // get TEC
971  if (detid.subdetId() == sdSiTEC) {
972  ++nStripFwd;
973 
974  if (tTopo->tecWheel(myid) == 1) {
975  mehSiStripResX[0]->Fill(rechitmatchedx - closestPair.first.x());
976  mehSiStripResY[0]->Fill(rechitmatchedy - closestPair.first.y());
977  }
978  if (tTopo->tecWheel(myid) == 2) {
979  mehSiStripResX[1]->Fill(rechitmatchedx - closestPair.first.x());
980  mehSiStripResY[1]->Fill(rechitmatchedy - closestPair.first.y());
981  }
982  if (tTopo->tecWheel(myid) == 3) {
983  mehSiStripResX[2]->Fill(rechitmatchedx - closestPair.first.x());
984  mehSiStripResY[2]->Fill(rechitmatchedy - closestPair.first.y());
985  }
986  if (tTopo->tecWheel(myid) == 4) {
987  mehSiStripResX[3]->Fill(rechitmatchedx - closestPair.first.x());
988  mehSiStripResY[3]->Fill(rechitmatchedy - closestPair.first.y());
989  }
990  if (tTopo->tecWheel(myid) == 5) {
991  mehSiStripResX[4]->Fill(rechitmatchedx - closestPair.first.x());
992  mehSiStripResY[4]->Fill(rechitmatchedy - closestPair.first.y());
993  }
994  if (tTopo->tecWheel(myid) == 6) {
995  mehSiStripResX[5]->Fill(rechitmatchedx - closestPair.first.x());
996  mehSiStripResY[5]->Fill(rechitmatchedy - closestPair.first.y());
997  }
998  if (tTopo->tecWheel(myid) == 7) {
999  mehSiStripResX[6]->Fill(rechitmatchedx - closestPair.first.x());
1000  mehSiStripResY[6]->Fill(rechitmatchedy - closestPair.first.y());
1001  }
1002  if (tTopo->tecWheel(myid) == 8) {
1003  mehSiStripResX[7]->Fill(rechitmatchedx - closestPair.first.x());
1004  mehSiStripResY[7]->Fill(rechitmatchedy - closestPair.first.y());
1005  }
1006  }
1007 
1008  } // end if matched empty
1009  }
1010  }
1011  } // end loop over det units
1012 
1013  if (verbosity > 1) {
1014  eventout += "\n Number of BrlStripRecHits collected:...... ";
1015  eventout += nStripBrl;
1016  }
1017 
1018  for (int i = 8; i < 12; ++i) {
1019  mehSiStripn[i]->Fill((float)nStripBrl);
1020  }
1021  for (int i = 16; i < 19; ++i) {
1022  mehSiStripn[i]->Fill((float)nStripBrl);
1023  }
1024 
1025  if (verbosity > 1) {
1026  eventout += "\n Number of FrwdStripRecHits collected:..... ";
1027  eventout += nStripFwd;
1028  }
1029  for (int i = 0; i < 8; ++i) {
1030  mehSiStripn[i]->Fill((float)nStripFwd);
1031  }
1032  for (int i = 12; i < 16; ++i) {
1033  mehSiStripn[i]->Fill((float)nStripFwd);
1034  }
1035  }
1036 
1037  // get pixel information
1038  //Get RecHits
1040  iEvent.getByToken(SiPxlSrc_Token_, recHitColl);
1041  bool validpixel = true;
1042  if (!recHitColl.isValid()) {
1043  LogDebug(MsgLoggerCat) << "Unable to find SiPixelRecHitCollection in event!";
1044  validpixel = false;
1045  }
1046 
1047  //Get event setup
1049  iSetup.get<TrackerDigiGeometryRecord>().get(geom);
1050  if (!geom.isValid()) {
1051  edm::LogWarning(MsgLoggerCat) << "Unable to find TrackerDigiGeometry in event!";
1052  return;
1053  }
1054 
1055  if (validpixel) {
1056  int nPxlBrl = 0, nPxlFwd = 0;
1057  //iterate over detunits
1058  for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin(); it != geom->dets().end(); ++it) {
1059  uint32_t myid = ((*it)->geographicalId()).rawId();
1060  DetId detId = ((*it)->geographicalId());
1061  int subid = detId.subdetId();
1062 
1063  if (!((subid == sdPxlBrl) || (subid == sdPxlFwd)))
1064  continue;
1065 
1066  SiPixelRecHitCollection::const_iterator pixeldet = recHitColl->find(detId);
1067  if (pixeldet == recHitColl->end())
1068  continue;
1069  SiPixelRecHitCollection::DetSet pixelrechitRange = *pixeldet;
1070  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorBegin = pixelrechitRange.begin();
1071  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorEnd = pixelrechitRange.end();
1072  SiPixelRecHitCollection::DetSet::const_iterator pixeliter = pixelrechitRangeIteratorBegin;
1073 
1074  std::vector<PSimHit> matched;
1075 
1076  //----Loop over rechits for this detId
1077  for (; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1078  matched.clear();
1079  matched = associate.associateHit(*pixeliter);
1080 
1081  if (!matched.empty()) {
1082  float closest = 9999.9;
1083  LocalPoint lp = pixeliter->localPosition();
1084  float rechit_x = lp.x();
1085  float rechit_y = lp.y();
1086 
1087  float sim_x = 0.;
1088  float sim_y = 0.;
1089 
1090  //loop over sim hits and fill closet
1091  for (std::vector<PSimHit>::const_iterator m = matched.begin(); m != matched.end(); ++m) {
1092  float sim_x1 = (*m).entryPoint().x();
1093  float sim_x2 = (*m).exitPoint().x();
1094  float sim_xpos = 0.5 * (sim_x1 + sim_x2);
1095 
1096  float sim_y1 = (*m).entryPoint().y();
1097  float sim_y2 = (*m).exitPoint().y();
1098  float sim_ypos = 0.5 * (sim_y1 + sim_y2);
1099 
1100  float x_res = fabs(sim_xpos - rechit_x);
1101  float y_res = fabs(sim_ypos - rechit_y);
1102 
1103  float dist = sqrt(x_res * x_res + y_res * y_res);
1104 
1105  if (dist < closest) {
1106  closest = dist;
1107  sim_x = sim_xpos;
1108  sim_y = sim_ypos;
1109  }
1110  } // end sim hit loop
1111 
1112  // get Barrel pixels ***************Pixel STuff******************
1113  if (subid == sdPxlBrl) {
1114  ++nPxlBrl;
1115 
1116  if (tTopo->pxbLayer(myid) == 1) {
1117  mehSiPixelResX[0]->Fill(rechit_x - sim_x);
1118  mehSiPixelResY[0]->Fill(rechit_y - sim_y);
1119  }
1120  if (tTopo->pxbLayer(myid) == 2) {
1121  mehSiPixelResX[1]->Fill(rechit_x - sim_x);
1122  mehSiPixelResY[1]->Fill(rechit_y - sim_y);
1123  }
1124  if (tTopo->pxbLayer(myid) == 3) {
1125  mehSiPixelResX[2]->Fill(rechit_x - sim_x);
1126  mehSiPixelResY[2]->Fill(rechit_y - sim_y);
1127  }
1128  }
1129 
1130  // get Forward pixels
1131  if (subid == sdPxlFwd) {
1132  ++nPxlFwd;
1133 
1134  if (tTopo->pxfDisk(myid) == 1) {
1135  if (tTopo->pxfSide(myid) == 1) {
1136  mehSiPixelResX[3]->Fill(rechit_x - sim_x);
1137  mehSiPixelResY[3]->Fill(rechit_y - sim_y);
1138  }
1139  if (tTopo->pxfSide(myid) == 2) {
1140  mehSiPixelResX[4]->Fill(rechit_x - sim_x);
1141  mehSiPixelResY[4]->Fill(rechit_y - sim_y);
1142  }
1143  }
1144  if (tTopo->pxfDisk(myid) == 2) {
1145  if (tTopo->pxfSide(myid) == 1) {
1146  mehSiPixelResX[5]->Fill(rechit_x - sim_x);
1147  mehSiPixelResY[5]->Fill(rechit_y - sim_y);
1148  }
1149  if (tTopo->pxfSide(myid) == 2) {
1150  mehSiPixelResX[6]->Fill(rechit_x - sim_x);
1151  mehSiPixelResY[6]->Fill(rechit_y - sim_y);
1152  }
1153  }
1154  }
1155  } // end matched emtpy
1156  } // <-----end rechit loop
1157  } // <------ end detunit loop
1158 
1159  if (verbosity > 1) {
1160  eventout += "\n Number of BrlPixelRecHits collected:...... ";
1161  eventout += nPxlBrl;
1162  }
1163  for (int i = 0; i < 3; ++i) {
1164  mehSiPixeln[i]->Fill((float)nPxlBrl);
1165  }
1166 
1167  if (verbosity > 1) {
1168  eventout += "\n Number of FrwdPixelRecHits collected:..... ";
1169  eventout += nPxlFwd;
1170  }
1171 
1172  for (int i = 3; i < 7; ++i) {
1173  mehSiPixeln[i]->Fill((float)nPxlFwd);
1174  }
1175  }
1176 
1177  if (verbosity > 0)
1178  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1179 
1180  return;
1181 }
#define LogDebug(id)
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
const_iterator end(bool update=false) const
unsigned int tibLayer(const DetId &id) const
std::vector< PSimHit > matched
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
unsigned int pxfDisk(const DetId &id) const
static const int sdSiTID
T y() const
Definition: PV3DBase.h:60
unsigned int tidWheel(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
MonitorElement * mehSiStripn[19]
void Fill(long long x)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
static const int sdSiTIB
static const int sdPxlBrl
T sqrt(T t)
Definition: SSEVec.h:19
MonitorElement * mehSiPixelResX[7]
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int sdSiTOB
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
bool isValid() const
Definition: HandleBase.h:70
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
unsigned int pxbLayer(const DetId &id) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetId.h:17
MonitorElement * mehSiPixeln[7]
const_iterator find(id_type i, bool update=false) const
static const int sdSiTEC
iterator end()
Definition: DetSetNew.h:56
static int position[264][3]
Definition: ReadPGInfo.cc:289
T get() const
Definition: EventSetup.h:73
unsigned int pxfSide(const DetId &id) const
LocalPoint localPosition() const final
static const int sdPxlFwd
TrackerHitAssociator::Config trackerHitAssociatorConfig_
DetId geographicalId() const
bool isValid() const
Definition: ESHandle.h:44
T x() const
Definition: PV3DBase.h:59
unsigned int tecWheel(const DetId &id) const
T const * product() const
Definition: ESHandle.h:86
MonitorElement * mehSiStripResX[19]
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
unsigned int tobLayer(const DetId &id) const
iterator begin()
Definition: DetSetNew.h:54
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
template<typename type >
const type * GlobalRecHitsAnalyzer::findBestRecHit ( const DTLayer layer,
DTWireId  wireId,
const std::vector< type > &  recHits,
const float  simHitDist 
)
private

Definition at line 1449 of file GlobalRecHitsAnalyzer.cc.

References rpcPointValidation_cfi::recHit, and recHitDistFromWire().

Referenced by compute().

1452  {
1453  float res = 99999;
1454  const type* theBestRecHit = nullptr;
1455  // Loop over RecHits within the cell
1456  for (typename std::vector<type>::const_iterator recHit = recHits.begin(); recHit != recHits.end(); recHit++) {
1457  float distTmp = recHitDistFromWire(*recHit, layer);
1458  if (fabs(distTmp - simHitDist) < res) {
1459  res = fabs(distTmp - simHitDist);
1460  theBestRecHit = &(*recHit);
1461  }
1462  } // End of loop over RecHits within the cell
1463 
1464  return theBestRecHit;
1465 }
type
Definition: HCALResponse.h:21
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
Definition: Electron.h:6
std::map< DTWireId, std::vector< DTRecHit1DPair > > GlobalRecHitsAnalyzer::map1DRecHitsPerWire ( const DTRecHitCollection dt1DRecHitPairs)
private

Definition at line 1423 of file GlobalRecHitsAnalyzer.cc.

References runTheMatrix::ret.

Referenced by fillMuon().

1424  {
1425  std::map<DTWireId, std::vector<DTRecHit1DPair>> ret;
1426 
1427  for (DTRecHitCollection::const_iterator rechit = dt1DRecHitPairs->begin(); rechit != dt1DRecHitPairs->end();
1428  rechit++) {
1429  ret[(*rechit).wireId()].push_back(*rechit);
1430  }
1431 
1432  return ret;
1433 }
ret
prodAgent to be discontinued
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
void GlobalRecHitsAnalyzer::plotResolution ( const PSimHit simHit,
const CSCRecHit2D recHit,
const CSCLayer layer,
int  chamberType 
)
private

Definition at line 1530 of file GlobalRecHitsAnalyzer.cc.

References dqm::impl::MonitorElement::Fill(), PSimHit::localPosition(), CSCRecHit2D::localPosition(), mehCSCResRDPhi, PV3DBase< T, PVType, FrameType >::phi(), and GeomDet::toGlobal().

Referenced by fillMuon().

1533  {
1534  GlobalPoint simHitPos = layer->toGlobal(simHit.localPosition());
1535  GlobalPoint recHitPos = layer->toGlobal(recHit.localPosition());
1536 
1537  mehCSCResRDPhi->Fill(recHitPos.phi() - simHitPos.phi());
1538 }
MonitorElement * mehCSCResRDPhi
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
LocalPoint localPosition() const override
Definition: CSCRecHit2D.h:56
void Fill(long long x)
Local3DPoint localPosition() const
Definition: PSimHit.h:52
std::pair< LocalPoint, LocalVector > GlobalRecHitsAnalyzer::projectHit ( const PSimHit hit,
const StripGeomDetUnit stripDet,
const BoundPlane plane 
)
private

Definition at line 1396 of file GlobalRecHitsAnalyzer.cc.

References funct::cos(), DeadROC_duringRun::dir, PSimHit::localDirection(), PSimHit::localPosition(), Scenarios_cff::scale, funct::sin(), StripGeomDetUnit::specificTopology(), StripTopology::strip(), StripTopology::stripAngle(), GeomDet::surface(), Surface::toGlobal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by fillTrk().

1398  {
1399  const StripTopology& topol = stripDet->specificTopology();
1400  GlobalPoint globalpos = stripDet->surface().toGlobal(hit.localPosition());
1401  LocalPoint localHit = plane.toLocal(globalpos);
1402  //track direction
1403  LocalVector locdir = hit.localDirection();
1404  //rotate track in new frame
1405 
1406  GlobalVector globaldir = stripDet->surface().toGlobal(locdir);
1407  LocalVector dir = plane.toLocal(globaldir);
1408  float scale = -localHit.z() / dir.z();
1409 
1410  LocalPoint projectedPos = localHit + scale * dir;
1411 
1412  float selfAngle = topol.stripAngle(topol.strip(hit.localPosition()));
1413 
1414  // vector along strip in hit frame
1415  LocalVector stripDir(sin(selfAngle), cos(selfAngle), 0);
1416 
1417  LocalVector localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir)));
1418 
1419  return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
1420 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual float strip(const LocalPoint &) const =0
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Local3DPoint localPosition() const
Definition: PSimHit.h:52
virtual float stripAngle(float strip) const =0
T z() const
Definition: PV3DBase.h:61
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:58
float GlobalRecHitsAnalyzer::recHitDistFromWire ( const DTRecHit1DPair hitPair,
const DTLayer layer 
)
private

Definition at line 1468 of file GlobalRecHitsAnalyzer.cc.

References DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, and PV3DBase< T, PVType, FrameType >::x().

Referenced by compute(), and findBestRecHit().

1468  {
1469  // Compute the rechit distance from wire
1470  return fabs(hitPair.localPosition(DTEnums::Left).x() - hitPair.localPosition(DTEnums::Right).x()) / 2.;
1471 }
LocalPoint localPosition() const override
T x() const
Definition: PV3DBase.h:59
float GlobalRecHitsAnalyzer::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
)
private

Definition at line 1474 of file GlobalRecHitsAnalyzer.cc.

References DTRecHit1D::localPosition(), DTLayer::specificTopology(), DTWireId::wire(), DTRecHit1D::wireId(), DTTopology::wirePosition(), and PV3DBase< T, PVType, FrameType >::x().

1474  {
1475  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
1476 }
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
int wire() const
Return the wire number.
Definition: DTWireId.h:42
T x() const
Definition: PV3DBase.h:59
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:76
float GlobalRecHitsAnalyzer::simHitDistFromWire ( const DTLayer layer,
DTWireId  wireId,
const PSimHit hit 
)
private

Definition at line 1436 of file GlobalRecHitsAnalyzer.cc.

References PSimHit::entryPoint(), PSimHit::exitPoint(), DTLayer::specificTopology(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by compute().

1436  {
1437  float xwire = layer->specificTopology().wirePosition(wireId.wire());
1438  LocalPoint entryP = hit.entryPoint();
1439  LocalPoint exitP = hit.exitPoint();
1440  float xEntry = entryP.x() - xwire;
1441  float xExit = exitP.x() - xwire;
1442 
1443  //FIXME: check...
1444  return fabs(xEntry - (entryP.z() * (xExit - xEntry)) / (exitP.z() - entryP.z()));
1445 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
T z() const
Definition: PV3DBase.h:61
int wire() const
Return the wire number.
Definition: DTWireId.h:42
T x() const
Definition: PV3DBase.h:59
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43

Member Data Documentation

unsigned int GlobalRecHitsAnalyzer::count
private

Definition at line 287 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze().

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalRecHitsAnalyzer::EBHits_Token_
private

Definition at line 190 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalEBSrc_
private

Definition at line 180 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EBRecHitCollection> GlobalRecHitsAnalyzer::ECalEBSrc_Token_
private

Definition at line 185 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalEESrc_
private

Definition at line 182 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EERecHitCollection> GlobalRecHitsAnalyzer::ECalEESrc_Token_
private

Definition at line 186 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalESSrc_
private

Definition at line 184 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<ESRecHitCollection> GlobalRecHitsAnalyzer::ECalESSrc_Token_
private

Definition at line 187 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalUncalEBSrc_
private

Definition at line 181 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EBUncalibratedRecHitCollection> GlobalRecHitsAnalyzer::ECalUncalEBSrc_Token_
private

Definition at line 188 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalUncalEESrc_
private

Definition at line 183 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EEUncalibratedRecHitCollection> GlobalRecHitsAnalyzer::ECalUncalEESrc_Token_
private

Definition at line 189 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalRecHitsAnalyzer::EEHits_Token_
private

Definition at line 191 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalRecHitsAnalyzer::ESHits_Token_
private

Definition at line 192 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::fName
private

Definition at line 166 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

int GlobalRecHitsAnalyzer::frequency
private

Definition at line 168 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

bool GlobalRecHitsAnalyzer::getAllProvenances
private

Definition at line 170 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::HCalSrc_
private

Definition at line 199 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<edm::PCaloHitContainer> GlobalRecHitsAnalyzer::HCalSrc_Token_
private

Definition at line 200 of file GlobalRecHitsAnalyzer.h.

Referenced by fillHCal(), and GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::hitsProducer
private

Definition at line 172 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::label
private
std::vector<PSimHit> GlobalRecHitsAnalyzer::matched
private

Definition at line 212 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehCSCn
private

Definition at line 231 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehCSCResRDPhi
private

Definition at line 234 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and plotResolution().

MonitorElement* GlobalRecHitsAnalyzer::mehDtMuonn
private

Definition at line 230 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehDtMuonRes
private

Definition at line 233 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and compute().

MonitorElement* GlobalRecHitsAnalyzer::mehEcaln[3]
private

Definition at line 177 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillECal().

MonitorElement* GlobalRecHitsAnalyzer::mehEcalRes[3]
private

Definition at line 178 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillECal().

MonitorElement* GlobalRecHitsAnalyzer::mehHcaln[4]
private

Definition at line 196 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillHCal().

MonitorElement* GlobalRecHitsAnalyzer::mehHcalRes[4]
private

Definition at line 197 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillHCal().

MonitorElement* GlobalRecHitsAnalyzer::mehRPCn
private

Definition at line 232 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehRPCResX
private

Definition at line 235 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixeln[7]
private

Definition at line 220 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixelResX[7]
private

Definition at line 221 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixelResY[7]
private

Definition at line 222 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripn[19]
private

Definition at line 205 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripResX[19]
private

Definition at line 206 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripResY[19]
private

Definition at line 207 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

edm::EDGetTokenT<CrossingFrame<PSimHit> > GlobalRecHitsAnalyzer::MuCSCHits_Token_
private

Definition at line 272 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuCSCSrc_
private

Definition at line 270 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<CSCRecHit2DCollection> GlobalRecHitsAnalyzer::MuCSCSrc_Token_
private

Definition at line 271 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuDTSimSrc_
private

Definition at line 238 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<edm::PSimHitContainer> GlobalRecHitsAnalyzer::MuDTSimSrc_Token_
private

Definition at line 240 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuDTSrc_
private

Definition at line 237 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<DTRecHitCollection> GlobalRecHitsAnalyzer::MuDTSrc_Token_
private

Definition at line 239 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuRPCSimSrc_
private

Definition at line 282 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<edm::PSimHitContainer> GlobalRecHitsAnalyzer::MuRPCSimSrc_Token_
private

Definition at line 284 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuRPCSrc_
private

Definition at line 281 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<RPCRecHitCollection> GlobalRecHitsAnalyzer::MuRPCSrc_Token_
private

Definition at line 283 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

bool GlobalRecHitsAnalyzer::printProvenanceInfo
private

Definition at line 171 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::SiPxlSrc_
private

Definition at line 224 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<SiPixelRecHitCollection> GlobalRecHitsAnalyzer::SiPxlSrc_Token_
private

Definition at line 225 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::SiStripSrc_
private

Definition at line 209 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> GlobalRecHitsAnalyzer::SiStripSrc_Token_
private

Definition at line 210 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk(), and GlobalRecHitsAnalyzer().

std::map<int, edm::PSimHitContainer> GlobalRecHitsAnalyzer::theMap
private

Definition at line 274 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon().

TrackerHitAssociator::Config GlobalRecHitsAnalyzer::trackerHitAssociatorConfig_
private

Definition at line 216 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk().

int GlobalRecHitsAnalyzer::verbosity
private