CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

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::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

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,
LocalVector
projectHit (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

edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
caloGeomToken_
 
unsigned int count
 
edm::ESGetToken< CSCGeometry,
MuonGeometryRecord
cscGeomToken_
 
edm::ESGetToken< DTGeometry,
MuonGeometryRecord
dtGeomToken_
 
edm::EDGetTokenT
< CrossingFrame< PCaloHit > > 
EBHits_Token_
 
edm::InputTag ECalEBSrc_
 
edm::EDGetTokenT
< EBRecHitCollection
ECalEBSrc_Token_
 
edm::InputTag ECalEESrc_
 
edm::EDGetTokenT
< EERecHitCollection
ECalEESrc_Token_
 
edm::InputTag ECalESSrc_
 
edm::EDGetTokenT
< ESRecHitCollection
ECalESSrc_Token_
 
edm::InputTag ECalUncalEBSrc_
 
edm::EDGetTokenT
< EBUncalibratedRecHitCollection
ECalUncalEBSrc_Token_
 
edm::InputTag ECalUncalEESrc_
 
edm::EDGetTokenT
< EEUncalibratedRecHitCollection
ECalUncalEESrc_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::PCaloHitContainer
HCalSrc_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
< CSCRecHit2DCollection
MuCSCSrc_Token_
 
edm::InputTag MuDTSimSrc_
 
edm::EDGetTokenT
< edm::PSimHitContainer
MuDTSimSrc_Token_
 
edm::InputTag MuDTSrc_
 
edm::EDGetTokenT
< DTRecHitCollection
MuDTSrc_Token_
 
edm::InputTag MuRPCSimSrc_
 
edm::EDGetTokenT
< edm::PSimHitContainer
MuRPCSimSrc_Token_
 
edm::InputTag MuRPCSrc_
 
edm::EDGetTokenT
< RPCRecHitCollection
MuRPCSrc_Token_
 
bool printProvenanceInfo
 
edm::ESGetToken< RPCGeometry,
MuonGeometryRecord
rpcGeomToken_
 
edm::InputTag SiPxlSrc_
 
edm::EDGetTokenT
< SiPixelRecHitCollection
SiPxlSrc_Token_
 
edm::InputTag SiStripSrc_
 
edm::EDGetTokenT
< SiStripMatchedRecHit2DCollection
SiStripSrc_Token_
 
edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
tGeomToken_
 
std::map< int,
edm::PSimHitContainer
theMap
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 
int verbosity
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 142 of file GlobalRecHitsAnalyzer.h.

Member Typedef Documentation

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

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

Definition at line 126 of file GlobalRecHitsAnalyzer.cc.

126 {}

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 298 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.

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

Implements DQMEDAnalyzer.

Definition at line 128 of file GlobalRecHitsAnalyzer.cc.

References dqm::implementation::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::implementation::NavigatorBase::setCurrentFolder().

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

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

Referenced by fillMuon().

1474  {
1475  std::map<DTWireId, std::vector<PSimHit>> simHitsPerWire = _simHitsPerWire;
1476  std::map<DTWireId, std::vector<type>> recHitsPerWire = _recHitsPerWire;
1477  int nDt = 0;
1478  // Loop over cells with a muon SimHit
1479  for (std::map<DTWireId, std::vector<PSimHit>>::const_iterator wireAndSHits = simHitsPerWire.begin();
1480  wireAndSHits != simHitsPerWire.end();
1481  wireAndSHits++) {
1482  DTWireId wireId = (*wireAndSHits).first;
1483  std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1484 
1485  // Get the layer
1486  const DTLayer* layer = dtGeom->layer(wireId);
1487 
1488  // Look for a mu hit in the cell
1489  const PSimHit* muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
1490  if (muSimHit == nullptr) {
1491  continue; // Skip this cell
1492  }
1493 
1494  // Find the distance of the simhit from the wire
1495  float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
1496  // Skip simhits out of the cell
1497  if (simHitWireDist > 2.1) {
1498  continue; // Skip this cell
1499  }
1500 
1501  // Look for RecHits in the same cell
1502  if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1503  continue; // No RecHit found in this cell
1504  } else {
1505  std::vector<type> recHits = recHitsPerWire[wireId];
1506 
1507  // Find the best RecHit
1508  const type* theBestRecHit = findBestRecHit(layer, wireId, recHits, simHitWireDist);
1509 
1510  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
1511 
1512  ++nDt;
1513 
1514  mehDtMuonRes->Fill(recHitWireDist - simHitWireDist);
1515 
1516  } // find rechits
1517  } // loop over simhits
1518 
1519  return nDt;
1520 }
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
constexpr std::array< uint8_t, layerIndexSize > layer
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 364 of file GlobalRecHitsAnalyzer.cc.

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

Referenced by analyze().

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

Definition at line 559 of file GlobalRecHitsAnalyzer.cc.

References caloGeomToken_, dqm::impl::MonitorElement::Fill(), relativeConstraints::geometry, edm::Event::getByToken(), edm::EventSetup::getHandle(), edm::Event::getManyByType(), HcalGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HCalSrc_Token_, hcalSimParameters_cfi::ho, ihf, sistrip::SpyUtilities::isValid(), edm::HandleBase::isValid(), LogDebug, mehHcaln, mehHcalRes, PV3DBase< T, PVType, FrameType >::phi(), PI, edm::Handle< T >::product(), sdHcalBrl, sdHcalEC, sdHcalFwd, sdHcalOut, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

Referenced by analyze().

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

Definition at line 1179 of file GlobalRecHitsAnalyzer.cc.

References CSCLayer::chamber(), CSCChamberSpecs::chamberType(), compute(), CSCDetId, cscGeomToken_, dtGeomToken_, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), edm::EventSetup::getHandle(), mps_fire::i, CSCGeometry::idToDetUnit(), RPCRoll::isForward(), edm::HandleBase::isValid(), phase1PixelTopology::layer, 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(), alignCSCRings::r, RPCDetId, rpcGeomToken_, trackerHits::simHits, CSCChamber::specs(), AlCaHLTBitMon_QueryRunRegistry::string, theMap, verbosity, and PV3DBase< T, PVType, FrameType >::x().

Referenced by analyze().

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

Definition at line 827 of file GlobalRecHitsAnalyzer.cc.

References TrackerHitAssociator::associateHit(), edmNew::DetSet< T >::begin(), edmNew::DetSet< T >::end(), dqm::impl::MonitorElement::Fill(), TrackingRecHit::geographicalId(), edm::Event::getByToken(), edm::EventSetup::getData(), edm::EventSetup::getHandle(), mps_fire::i, TrackerGeometry::idToDet(), edm::HandleBase::isValid(), BaseTrackerRecHit::localPosition(), LogDebug, visualization-live-secondInstance_cfg::m, matched, mehSiPixeln, mehSiPixelResX, mehSiPixelResY, mehSiStripn, mehSiStripResX, mehSiStripResY, position, 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(), tGeomToken_, TrackerTopology::tibLayer(), TrackerTopology::tidWheel(), TrackerTopology::tobLayer(), trackerHitAssociatorConfig_, tTopoToken_, verbosity, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

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

References recHitDistFromWire().

Referenced by compute().

1444  {
1445  float res = 99999;
1446  const type* theBestRecHit = nullptr;
1447  // Loop over RecHits within the cell
1448  for (typename std::vector<type>::const_iterator recHit = recHits.begin(); recHit != recHits.end(); recHit++) {
1449  float distTmp = recHitDistFromWire(*recHit, layer);
1450  if (fabs(distTmp - simHitDist) < res) {
1451  res = fabs(distTmp - simHitDist);
1452  theBestRecHit = &(*recHit);
1453  }
1454  } // End of loop over RecHits within the cell
1455 
1456  return theBestRecHit;
1457 }
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
std::map< DTWireId, std::vector< DTRecHit1DPair > > GlobalRecHitsAnalyzer::map1DRecHitsPerWire ( const DTRecHitCollection dt1DRecHitPairs)
private

Definition at line 1415 of file GlobalRecHitsAnalyzer.cc.

References runTheMatrix::ret.

Referenced by fillMuon().

1416  {
1417  std::map<DTWireId, std::vector<DTRecHit1DPair>> ret;
1418 
1419  for (DTRecHitCollection::const_iterator rechit = dt1DRecHitPairs->begin(); rechit != dt1DRecHitPairs->end();
1420  rechit++) {
1421  ret[(*rechit).wireId()].push_back(*rechit);
1422  }
1423 
1424  return ret;
1425 }
tuple 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 1522 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().

1525  {
1526  GlobalPoint simHitPos = layer->toGlobal(simHit.localPosition());
1527  GlobalPoint recHitPos = layer->toGlobal(recHit.localPosition());
1528 
1529  mehCSCResRDPhi->Fill(recHitPos.phi() - simHitPos.phi());
1530 }
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
void Fill(long long x)
Local3DPoint localPosition() const
Definition: PSimHit.h:52
LocalPoint localPosition() const override
Definition: CSCRecHit2D.h:56
std::pair< LocalPoint, LocalVector > GlobalRecHitsAnalyzer::projectHit ( const PSimHit hit,
const StripGeomDetUnit stripDet,
const BoundPlane plane 
)
private

Definition at line 1388 of file GlobalRecHitsAnalyzer.cc.

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

Referenced by fillTrk().

1390  {
1391  const StripTopology& topol = stripDet->specificTopology();
1392  GlobalPoint globalpos = stripDet->surface().toGlobal(hit.localPosition());
1393  LocalPoint localHit = plane.toLocal(globalpos);
1394  //track direction
1395  LocalVector locdir = hit.localDirection();
1396  //rotate track in new frame
1397 
1398  GlobalVector globaldir = stripDet->surface().toGlobal(locdir);
1399  LocalVector dir = plane.toLocal(globaldir);
1400  float scale = -localHit.z() / dir.z();
1401 
1402  LocalPoint projectedPos = localHit + scale * dir;
1403 
1404  float selfAngle = topol.stripAngle(topol.strip(hit.localPosition()));
1405 
1406  // vector along strip in hit frame
1407  LocalVector stripDir(sin(selfAngle), cos(selfAngle), 0);
1408 
1409  LocalVector localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir)));
1410 
1411  return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
1412 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
virtual float stripAngle(float strip) const =0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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
virtual float strip(const LocalPoint &) const =0
Local3DPoint localPosition() const
Definition: PSimHit.h:52
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 1460 of file GlobalRecHitsAnalyzer.cc.

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

Referenced by compute(), and findBestRecHit().

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

Definition at line 1466 of file GlobalRecHitsAnalyzer.cc.

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

1466  {
1467  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
1468 }
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
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
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 1428 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().

1428  {
1429  float xwire = layer->specificTopology().wirePosition(wireId.wire());
1430  LocalPoint entryP = hit.entryPoint();
1431  LocalPoint exitP = hit.exitPoint();
1432  float xEntry = entryP.x() - xwire;
1433  float xExit = exitP.x() - xwire;
1434 
1435  //FIXME: check...
1436  return fabs(xEntry - (entryP.z() * (xExit - xEntry)) / (exitP.z() - entryP.z()));
1437 }
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

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> GlobalRecHitsAnalyzer::caloGeomToken_
private

Definition at line 288 of file GlobalRecHitsAnalyzer.h.

Referenced by fillHCal().

unsigned int GlobalRecHitsAnalyzer::count
private

Definition at line 296 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze().

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> GlobalRecHitsAnalyzer::cscGeomToken_
private

Definition at line 292 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon().

edm::ESGetToken<DTGeometry, MuonGeometryRecord> GlobalRecHitsAnalyzer::dtGeomToken_
private

Definition at line 291 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon().

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

Definition at line 192 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalEBSrc_
private

Definition at line 182 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 187 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalEESrc_
private

Definition at line 184 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 188 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalESSrc_
private

Definition at line 186 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 189 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalUncalEBSrc_
private

Definition at line 183 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 190 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalUncalEESrc_
private

Definition at line 185 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 191 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

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

Definition at line 193 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

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

Definition at line 194 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::fName
private

Definition at line 168 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

int GlobalRecHitsAnalyzer::frequency
private

Definition at line 170 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

bool GlobalRecHitsAnalyzer::getAllProvenances
private

Definition at line 172 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::HCalSrc_
private

Definition at line 201 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 202 of file GlobalRecHitsAnalyzer.h.

Referenced by fillHCal(), and GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::hitsProducer
private

Definition at line 174 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::label
private

Definition at line 171 of file GlobalRecHitsAnalyzer.h.

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

Definition at line 214 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehCSCn
private

Definition at line 233 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehCSCResRDPhi
private

Definition at line 236 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and plotResolution().

MonitorElement* GlobalRecHitsAnalyzer::mehDtMuonn
private

Definition at line 232 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehDtMuonRes
private

Definition at line 235 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and compute().

MonitorElement* GlobalRecHitsAnalyzer::mehEcaln[3]
private

Definition at line 179 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillECal().

MonitorElement* GlobalRecHitsAnalyzer::mehEcalRes[3]
private

Definition at line 180 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillECal().

MonitorElement* GlobalRecHitsAnalyzer::mehHcaln[4]
private

Definition at line 198 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillHCal().

MonitorElement* GlobalRecHitsAnalyzer::mehHcalRes[4]
private

Definition at line 199 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillHCal().

MonitorElement* GlobalRecHitsAnalyzer::mehRPCn
private

Definition at line 234 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehRPCResX
private

Definition at line 237 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixeln[7]
private

Definition at line 222 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixelResX[7]
private

Definition at line 223 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixelResY[7]
private

Definition at line 224 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripn[19]
private

Definition at line 207 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripResX[19]
private

Definition at line 208 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripResY[19]
private

Definition at line 209 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

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

Definition at line 274 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuCSCSrc_
private

Definition at line 272 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 273 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuDTSimSrc_
private

Definition at line 240 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 242 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuDTSrc_
private

Definition at line 239 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 241 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuRPCSimSrc_
private

Definition at line 284 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 286 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuRPCSrc_
private

Definition at line 283 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 285 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

bool GlobalRecHitsAnalyzer::printProvenanceInfo
private

Definition at line 173 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> GlobalRecHitsAnalyzer::rpcGeomToken_
private

Definition at line 293 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon().

edm::InputTag GlobalRecHitsAnalyzer::SiPxlSrc_
private

Definition at line 226 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 227 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::SiStripSrc_
private

Definition at line 211 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

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

Definition at line 212 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk(), and GlobalRecHitsAnalyzer().

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> GlobalRecHitsAnalyzer::tGeomToken_
private

Definition at line 290 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk().

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

Definition at line 276 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon().

TrackerHitAssociator::Config GlobalRecHitsAnalyzer::trackerHitAssociatorConfig_
private

Definition at line 218 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk().

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> GlobalRecHitsAnalyzer::tTopoToken_
private

Definition at line 289 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk().

int GlobalRecHitsAnalyzer::verbosity
private