CMS 3D CMS Logo

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

#include <DTRecHitQuality.h>

Inheritance diagram for DTRecHitQuality:
DQMGlobalEDAnalyzer< dtrechit::Histograms > DQMGlobalEDAnalyzerBase< dtrechit::Histograms, Args... > edm::global::EDProducer< edm::RunCache< dtrechit::Histograms >, edm::EndRunProducer, edm::Accumulator, Args... > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTRecHitQuality (const edm::ParameterSet &pset)
 Constructor. More...
 
- Public Member Functions inherited from DQMGlobalEDAnalyzer< dtrechit::Histograms >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &, dtrechit::Histograms const &) const
 
void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup) const final
 
- Public Member Functions inherited from DQMGlobalEDAnalyzerBase< dtrechit::Histograms, Args... >
void accumulate (edm::StreamID id, edm::Event const &event, edm::EventSetup const &setup) const final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &, dtrechit::Histograms &) const
 
 DQMGlobalEDAnalyzerBase ()
 
std::shared_ptr< dtrechit::HistogramsglobalBeginRun (edm::Run const &run, edm::EventSetup const &setup) const final
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const final
 
- Public Member Functions inherited from edm::global::EDProducer< edm::RunCache< dtrechit::Histograms >, edm::EndRunProducer, edm::Accumulator, Args... >
 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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, dtrechit::Histograms &) const override
 Book the DQM plots. More...
 
template<typename type >
void compute (const DTGeometry &dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, dtrechit::Histograms const &histograms, int step) const
 
void dqmAnalyze (edm::Event const &, edm::EventSetup const &, dtrechit::Histograms const &) const override
 Perform the real analysis. More...
 
template<typename type >
const typefindBestRecHit (const DTLayer *layer, const DTWireId &wireId, const std::vector< type > &recHits, float simHitDist) const
 
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire (const DTRecHitCollection *dt1DRecHitPairs) const
 
std::map< DTWireId, std::vector< DTRecHit1D > > map1DRecHitsPerWire (const DTRecSegment2DCollection *segment2Ds) const
 
std::map< DTWireId, std::vector< DTRecHit1D > > map1DRecHitsPerWire (const DTRecSegment4DCollection *segment4Ds) const
 
float recHitDistFromWire (const DTRecHit1DPair &hitPair, const DTLayer *layer) const
 
float recHitDistFromWire (const DTRecHit1D &recHit, const DTLayer *layer) const
 
float recHitPositionError (const DTRecHit1DPair &recHit) const
 
float recHitPositionError (const DTRecHit1D &recHit) const
 
float simHitDistFromFE (const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
 
float simHitDistFromWire (const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
 
float simHitImpactAngle (const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
 

Private Attributes

bool debug_
 
bool doall_
 
bool doStep1_
 
bool doStep2_
 
bool doStep3_
 
bool local_
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
edm::InputTag recHitLabel_
 
edm::EDGetTokenT< DTRecHitCollectionrecHitToken_
 
edm::InputTag segment2DLabel_
 
edm::EDGetTokenT< DTRecSegment2DCollectionsegment2DToken_
 
edm::InputTag segment4DLabel_
 
edm::EDGetTokenT< DTRecSegment4DCollectionsegment4DToken_
 
edm::InputTag simHitLabel_
 
edm::EDGetTokenT< edm::PSimHitContainersimHitToken_
 

Additional Inherited Members

- Public Types inherited from DQMGlobalEDAnalyzerBase< dtrechit::Histograms, Args... >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from DQMGlobalEDAnalyzerBase< dtrechit::Histograms, Args... >
uint64_t meId (edm::Run const &run) const
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMGlobalEDAnalyzerBase< dtrechit::Histograms, Args... >
DQMStoredqmstore_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Basic analyzer class which accesses 1D DTRecHits and plot resolution comparing reconstructed and simulated quantities

Residual/pull plots are filled for the rechit with distance from wire closer to that of the muon simhit.

Efficiencies are defined as the fraction of muon simhits with a rechit in the same cell, for the given reconstruction step. Hence, for S2 and S3 the definition incorporate the segment reconstruction efficiency.

Author
G. Cerminara - INFN Torino

Definition at line 47 of file DTRecHitQuality.h.

Constructor & Destructor Documentation

◆ DTRecHitQuality()

DTRecHitQuality::DTRecHitQuality ( const edm::ParameterSet pset)

Constructor.

Definition at line 87 of file DTRecHitQuality.cc.

References debug_, doall_, doStep1_, doStep2_, doStep3_, local_, muonDTDigis_cfi::pset, recHitLabel_, recHitToken_, segment2DLabel_, segment2DToken_, segment4DLabel_, segment4DToken_, simHitLabel_, and simHitToken_.

88  // Get the debug parameter for verbose output
89  debug_ = pset.getUntrackedParameter<bool>("debug");
90  // the name of the simhit collection
91  simHitLabel_ = pset.getUntrackedParameter<InputTag>("simHitLabel");
92  simHitToken_ = consumes<PSimHitContainer>(pset.getUntrackedParameter<InputTag>("simHitLabel"));
93  // the name of the 1D rec hit collection
94  recHitLabel_ = pset.getUntrackedParameter<InputTag>("recHitLabel");
95  recHitToken_ = consumes<DTRecHitCollection>(pset.getUntrackedParameter<InputTag>("recHitLabel"));
96  // the name of the 2D rec hit collection
97  segment2DLabel_ = pset.getUntrackedParameter<InputTag>("segment2DLabel");
98  segment2DToken_ = consumes<DTRecSegment2DCollection>(pset.getUntrackedParameter<InputTag>("segment2DLabel"));
99  // the name of the 4D rec hit collection
100  segment4DLabel_ = pset.getUntrackedParameter<InputTag>("segment4DLabel");
101  segment4DToken_ = consumes<DTRecSegment4DCollection>(pset.getUntrackedParameter<InputTag>("segment4DLabel"));
102  // Switches for analysis at various steps
103  doStep1_ = pset.getUntrackedParameter<bool>("doStep1", false);
104  doStep2_ = pset.getUntrackedParameter<bool>("doStep2", false);
105  doStep3_ = pset.getUntrackedParameter<bool>("doStep3", false);
106  doall_ = pset.getUntrackedParameter<bool>("doall", false);
107  local_ = pset.getUntrackedParameter<bool>("local", true);
108 }
edm::InputTag recHitLabel_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
edm::InputTag segment4DLabel_
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
edm::InputTag simHitLabel_
edm::InputTag segment2DLabel_
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_

Member Function Documentation

◆ bookHistograms()

void DTRecHitQuality::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup,
dtrechit::Histograms histograms 
) const
overrideprivatevirtual

Book the DQM plots.

Implements DQMGlobalEDAnalyzerBase< dtrechit::Histograms, Args... >.

Definition at line 110 of file DTRecHitQuality.cc.

References doall_, doStep1_, doStep2_, doStep3_, local_, hfnoseParametersInitialization_cfi::name2, alignCSCRings::s, and w().

113  {
114  if (doall_ && doStep1_) {
115  histograms.hRes_S1RPhi = std::make_unique<HRes1DHit>("S1RPhi", booker, true, local_); // RecHits, 1. step, RPhi
116  histograms.hRes_S1RPhi_W0 =
117  std::make_unique<HRes1DHit>("S1RPhi_W0", booker, true, local_); // RecHits, 1. step, RZ, wheel 0
118  histograms.hRes_S1RPhi_W1 =
119  std::make_unique<HRes1DHit>("S1RPhi_W1", booker, true, local_); // RecHits, 1. step, RZ, wheel +-1
120  histograms.hRes_S1RPhi_W2 =
121  std::make_unique<HRes1DHit>("S1RPhi_W2", booker, true, local_); // RecHits, 1. step, RZ, wheel +-2
122  histograms.hRes_S1RZ = std::make_unique<HRes1DHit>("S1RZ", booker, true, local_); // RecHits, 1. step, RZ
123  histograms.hRes_S1RZ_W0 =
124  std::make_unique<HRes1DHit>("S1RZ_W0", booker, true, local_); // RecHits, 1. step, RZ, wheel 0
125  histograms.hRes_S1RZ_W1 =
126  std::make_unique<HRes1DHit>("S1RZ_W1", booker, true, local_); // RecHits, 1. step, RZ, wheel +-1
127  histograms.hRes_S1RZ_W2 =
128  std::make_unique<HRes1DHit>("S1RZ_W2", booker, true, local_); // RecHits, 1. step, RZ, wheel +-2
129  histograms.hEff_S1RPhi = std::make_unique<HEff1DHit>("S1RPhi", booker); // RecHits, 1. step, RPhi
130  histograms.hEff_S1RZ = std::make_unique<HEff1DHit>("S1RZ", booker); // RecHits, 1. step, RZ
131  histograms.hEff_S1RZ_W0 = std::make_unique<HEff1DHit>("S1RZ_W0", booker); // RecHits, 1. step, RZ, wheel 0
132  histograms.hEff_S1RZ_W1 = std::make_unique<HEff1DHit>("S1RZ_W1", booker); // RecHits, 1. step, RZ, wheel +-1
133  histograms.hEff_S1RZ_W2 = std::make_unique<HEff1DHit>("S1RZ_W2", booker); // RecHits, 1. step, RZ, wheel +-2
134  }
135  if (doall_ && doStep2_) {
136  histograms.hRes_S2RPhi = std::make_unique<HRes1DHit>("S2RPhi", booker, true, local_); // RecHits, 2. step, RPhi
137  histograms.hRes_S2RPhi_W0 =
138  std::make_unique<HRes1DHit>("S2RPhi_W0", booker, true, local_); // RecHits, 2. step, RPhi, wheel 0
139  histograms.hRes_S2RPhi_W1 =
140  std::make_unique<HRes1DHit>("S2RPhi_W1", booker, true, local_); // RecHits, 2. step, RPhi, wheel +-1
141  histograms.hRes_S2RPhi_W2 =
142  std::make_unique<HRes1DHit>("S2RPhi_W2", booker, true, local_); // RecHits, 2. step, RPhi, wheel +-2
143  histograms.hRes_S2RZ = std::make_unique<HRes1DHit>("S2RZ", booker, true, local_); // RecHits, 2. step, RZ
144  histograms.hRes_S2RZ_W0 =
145  std::make_unique<HRes1DHit>("S2RZ_W0", booker, true, local_); // RecHits, 2. step, RZ, wheel 0
146  histograms.hRes_S2RZ_W1 =
147  std::make_unique<HRes1DHit>("S2RZ_W1", booker, true, local_); // RecHits, 2. step, RZ, wheel +-1
148  histograms.hRes_S2RZ_W2 =
149  std::make_unique<HRes1DHit>("S2RZ_W2", booker, true, local_); // RecHits, 2. step, RZ, wheel +-2
150  histograms.hEff_S2RPhi = std::make_unique<HEff1DHit>("S2RPhi", booker); // RecHits, 2. step, RPhi
151  histograms.hEff_S2RZ_W0 = std::make_unique<HEff1DHit>("S2RZ_W0", booker); // RecHits, 2. step, RZ, wheel 0
152  histograms.hEff_S2RZ_W1 = std::make_unique<HEff1DHit>("S2RZ_W1", booker); // RecHits, 2. step, RZ, wheel +-1
153  histograms.hEff_S2RZ_W2 = std::make_unique<HEff1DHit>("S2RZ_W2", booker); // RecHits, 2. step, RZ, wheel +-2
154  histograms.hEff_S2RZ = std::make_unique<HEff1DHit>("S2RZ", booker); // RecHits, 2. step, RZ
155  }
156  if (doStep3_) {
157  histograms.hRes_S3RPhi = std::make_unique<HRes1DHit>("S3RPhi", booker, doall_, local_); // RecHits, 3. step, RPhi
158  histograms.hRes_S3RPhi_W0 =
159  std::make_unique<HRes1DHit>("S3RPhi_W0", booker, doall_, local_); // RecHits, 3. step, RPhi, wheel 0
160  histograms.hRes_S3RPhi_W1 = std::make_unique<HRes1DHit>("S3RPhi_W1",
161  booker,
162  doall_,
163  local_); // RecHits, 3. step, RPhi, wheel +-1
164  histograms.hRes_S3RPhi_W2 = std::make_unique<HRes1DHit>("S3RPhi_W2",
165  booker,
166  doall_,
167  local_); // RecHits, 3. step, RPhi, wheel +-2
168  histograms.hRes_S3RZ = std::make_unique<HRes1DHit>("S3RZ", booker, doall_, local_); // RecHits, 3. step, RZ
169  histograms.hRes_S3RZ_W0 =
170  std::make_unique<HRes1DHit>("S3RZ_W0", booker, doall_, local_); // RecHits, 3. step, RZ, wheel 0
171  histograms.hRes_S3RZ_W1 =
172  std::make_unique<HRes1DHit>("S3RZ_W1", booker, doall_, local_); // RecHits, 3. step, RZ, wheel +-1
173  histograms.hRes_S3RZ_W2 =
174  std::make_unique<HRes1DHit>("S3RZ_W2", booker, doall_, local_); // RecHits, 3. step, RZ, wheel +-2
175 
176  if (local_) {
177  // Plots with finer granularity, not to be included in DQM
178  TString name1 = "RPhi_W";
179  TString name2 = "RZ_W";
180  for (long w = 0; w <= 2; ++w) {
181  for (long s = 1; s <= 4; ++s) {
182  histograms.hRes_S3RPhiWS[w][s - 1] =
183  std::make_unique<HRes1DHit>(("S3" + name1 + w + "_St" + s).Data(), booker, doall_, local_);
184  histograms.hEff_S1RPhiWS[w][s - 1] =
185  std::make_unique<HEff1DHit>(("S1" + name1 + w + "_St" + s).Data(), booker);
186  histograms.hEff_S3RPhiWS[w][s - 1] =
187  std::make_unique<HEff1DHit>(("S3" + name1 + w + "_St" + s).Data(), booker);
188  if (s != 4) {
189  histograms.hRes_S3RZWS[w][s - 1] =
190  std::make_unique<HRes1DHit>(("S3" + name2 + w + "_St" + s).Data(), booker, doall_, local_);
191  histograms.hEff_S1RZWS[w][s - 1] =
192  std::make_unique<HEff1DHit>(("S1" + name2 + w + "_St" + s).Data(), booker);
193  histograms.hEff_S3RZWS[w][s - 1] =
194  std::make_unique<HEff1DHit>(("S3" + name2 + w + "_St" + s).Data(), booker);
195  }
196  }
197  }
198  }
199 
200  if (doall_) {
201  histograms.hEff_S3RPhi = std::make_unique<HEff1DHit>("S3RPhi", booker); // RecHits, 3. step, RPhi
202  histograms.hEff_S3RZ = std::make_unique<HEff1DHit>("S3RZ", booker); // RecHits, 3. step, RZ
203  histograms.hEff_S3RZ_W0 = std::make_unique<HEff1DHit>("S3RZ_W0", booker); // RecHits, 3. step, RZ, wheel 0
204  histograms.hEff_S3RZ_W1 = std::make_unique<HEff1DHit>("S3RZ_W1", booker); // RecHits, 3. step, RZ, wheel +-1
205  histograms.hEff_S3RZ_W2 = std::make_unique<HEff1DHit>("S3RZ_W2", booker); // RecHits, 3. step, RZ, wheel +-2
206  }
207  }
208 }
T w() const

◆ compute()

template<typename type >
void DTRecHitQuality::compute ( const DTGeometry dtGeom,
const std::map< DTWireId, std::vector< PSimHit >> &  simHitsPerWire,
const std::map< DTWireId, std::vector< type >> &  recHitsPerWire,
dtrechit::Histograms const &  histograms,
int  step 
) const
private

Definition at line 414 of file DTRecHitQuality.cc.

References funct::abs(), gather_cfg::cout, debug_, doall_, PV3DBase< T, PVType, FrameType >::eta(), HRes1DHit::fill(), HEff1DHit::fill(), findBestRecHit(), DTHitQualityUtils::findMuSimHit(), PixelMapPlotter::hRes, nano_mu_digi_cff::layer, DTGeometry::layer(), local_, PSimHit::localPosition(), PV3DBase< T, PVType, FrameType >::phi(), recHitDistFromWire(), recHitPositionError(), FastTrackerRecHitMaskProducer_cfi::recHits, simHitDistFromFE(), simHitDistFromWire(), simHitImpactAngle(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by dqmAnalyze().

418  {
419  // Loop over cells with a muon SimHit
420  for (const auto &wireAndSHits : simHitsPerWire) {
421  DTWireId wireId = wireAndSHits.first;
422  int wheel = wireId.wheel();
423  int sl = wireId.superLayer();
424 
425  vector<PSimHit> simHitsInCell = wireAndSHits.second;
426 
427  // Get the layer
428  const DTLayer *layer = dtGeom.layer(wireId);
429 
430  // Look for a mu hit in the cell
431  const PSimHit *muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
432  if (muSimHit == nullptr) {
433  if (debug_) {
434  cout << " No mu SimHit in channel: " << wireId << ", skipping! " << endl;
435  }
436  continue; // Skip this cell
437  }
438 
439  // Find the distance of the simhit from the wire
440  float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
441  // Skip simhits out of the cell
442  if (simHitWireDist > 2.1) {
443  if (debug_) {
444  cout << " [DTRecHitQuality]###Warning: The mu SimHit in out of the "
445  "cell, skipping!"
446  << endl;
447  }
448  continue; // Skip this cell
449  }
450  GlobalPoint simHitGlobalPos = layer->toGlobal(muSimHit->localPosition());
451 
452  // find SH impact angle
453  float simHitTheta = simHitImpactAngle(layer, wireId, *muSimHit);
454 
455  // find SH distance from FE
456  float simHitFEDist = simHitDistFromFE(layer, wireId, *muSimHit);
457 
458  bool recHitReconstructed = false;
459 
460  // Look for RecHits in the same cell
461  if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
462  // No RecHit found in this cell
463  if (debug_) {
464  cout << " No RecHit found at Step: " << step << " in cell: " << wireId << endl;
465  }
466  } else {
467  recHitReconstructed = true;
468  // vector<type> recHits = (*wireAndRecHits).second;
469  const vector<type> &recHits = recHitsPerWire.at(wireId);
470  if (debug_) {
471  cout << " " << recHits.size() << " RecHits, Step " << step << " in channel: " << wireId << endl;
472  }
473 
474  // Find the best RecHit
475  const type *theBestRecHit = findBestRecHit(layer, wireId, recHits, simHitWireDist);
476 
477  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
478  if (debug_) {
479  cout << " SimHit distance from wire: " << simHitWireDist << endl
480  << " SimHit distance from FE: " << simHitFEDist << endl
481  << " SimHit angle in layer RF: " << simHitTheta << endl
482  << " RecHit distance from wire: " << recHitWireDist << endl;
483  }
484  float recHitErr = recHitPositionError(*theBestRecHit);
485  HRes1DHit *hRes = nullptr;
486  HRes1DHit *hResTot = nullptr;
487 
488  // Mirror angle in phi so that + and - wheels can be plotted together
489  if (mirrorMinusWheels && wheel < 0 && sl != 2) {
490  simHitTheta *= -1.;
491  // Note: local X, if used, would have to be mirrored as well
492  }
493 
494  // Fill residuals and pulls
495  // Select the histo to be filled
496  if (step == 1) {
497  // Step 1
498  if (sl != 2) {
499  hResTot = histograms.hRes_S1RPhi.get();
500  if (wheel == 0) {
501  hRes = histograms.hRes_S1RPhi_W0.get();
502  }
503  if (abs(wheel) == 1) {
504  hRes = histograms.hRes_S1RPhi_W1.get();
505  }
506  if (abs(wheel) == 2) {
507  hRes = histograms.hRes_S1RPhi_W2.get();
508  }
509  } else {
510  hResTot = histograms.hRes_S1RZ.get();
511  if (wheel == 0) {
512  hRes = histograms.hRes_S1RZ_W0.get();
513  }
514  if (abs(wheel) == 1) {
515  hRes = histograms.hRes_S1RZ_W1.get();
516  }
517  if (abs(wheel) == 2) {
518  hRes = histograms.hRes_S1RZ_W2.get();
519  }
520  }
521 
522  } else if (step == 2) {
523  // Step 2
524  if (sl != 2) {
525  hRes = histograms.hRes_S2RPhi.get();
526  if (wheel == 0) {
527  hRes = histograms.hRes_S2RPhi_W0.get();
528  }
529  if (abs(wheel) == 1) {
530  hRes = histograms.hRes_S2RPhi_W1.get();
531  }
532  if (abs(wheel) == 2) {
533  hRes = histograms.hRes_S2RPhi_W2.get();
534  }
535  } else {
536  hResTot = histograms.hRes_S2RZ.get();
537  if (wheel == 0) {
538  hRes = histograms.hRes_S2RZ_W0.get();
539  }
540  if (abs(wheel) == 1) {
541  hRes = histograms.hRes_S2RZ_W1.get();
542  }
543  if (abs(wheel) == 2) {
544  hRes = histograms.hRes_S2RZ_W2.get();
545  }
546  }
547 
548  } else if (step == 3) {
549  // Step 3
550  if (sl != 2) {
551  hResTot = histograms.hRes_S3RPhi.get();
552  if (wheel == 0) {
553  hRes = histograms.hRes_S3RPhi_W0.get();
554  }
555  if (abs(wheel) == 1) {
556  hRes = histograms.hRes_S3RPhi_W1.get();
557  }
558  if (abs(wheel) == 2) {
559  hRes = histograms.hRes_S3RPhi_W2.get();
560  }
561  if (local_) {
562  histograms.hRes_S3RPhiWS[abs(wheel)][wireId.station() - 1]->fill(simHitWireDist,
563  simHitTheta,
564  simHitFEDist,
565  recHitWireDist,
566  simHitGlobalPos.eta(),
567  simHitGlobalPos.phi(),
568  recHitErr,
569  wireId.station());
570  }
571  } else {
572  hResTot = histograms.hRes_S3RZ.get();
573  if (wheel == 0) {
574  hRes = histograms.hRes_S3RZ_W0.get();
575  }
576  if (abs(wheel) == 1) {
577  hRes = histograms.hRes_S3RZ_W1.get();
578  }
579  if (abs(wheel) == 2) {
580  hRes = histograms.hRes_S3RZ_W2.get();
581  }
582  if (local_) {
583  histograms.hRes_S3RZWS[abs(wheel)][wireId.station() - 1]->fill(simHitWireDist,
584  simHitTheta,
585  simHitFEDist,
586  recHitWireDist,
587  simHitGlobalPos.eta(),
588  simHitGlobalPos.phi(),
589  recHitErr,
590  wireId.station());
591  }
592  }
593  }
594 
595  // Fill
596  hRes->fill(simHitWireDist,
597  simHitTheta,
598  simHitFEDist,
599  recHitWireDist,
600  simHitGlobalPos.eta(),
601  simHitGlobalPos.phi(),
602  recHitErr,
603  wireId.station());
604  if (hResTot != nullptr) {
605  hResTot->fill(simHitWireDist,
606  simHitTheta,
607  simHitFEDist,
608  recHitWireDist,
609  simHitGlobalPos.eta(),
610  simHitGlobalPos.phi(),
611  recHitErr,
612  wireId.station());
613  }
614  }
615 
616  // Fill Efficiencies
617  if (doall_) {
618  HEff1DHit *hEff = nullptr;
619  HEff1DHit *hEffTot = nullptr;
620  if (step == 1) {
621  // Step 1
622  if (sl != 2) {
623  hEff = histograms.hEff_S1RPhi.get();
624  if (local_) {
625  histograms.hEff_S1RPhiWS[abs(wheel)][wireId.station() - 1]->fill(
626  simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
627  }
628  } else {
629  hEffTot = histograms.hEff_S1RZ.get();
630  if (wheel == 0) {
631  hEff = histograms.hEff_S1RZ_W0.get();
632  }
633  if (abs(wheel) == 1) {
634  hEff = histograms.hEff_S1RZ_W1.get();
635  }
636  if (abs(wheel) == 2) {
637  hEff = histograms.hEff_S1RZ_W2.get();
638  }
639  if (local_) {
640  histograms.hEff_S1RZWS[abs(wheel)][wireId.station() - 1]->fill(
641  simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
642  }
643  }
644 
645  } else if (step == 2) {
646  // Step 2
647  if (sl != 2) {
648  hEff = histograms.hEff_S2RPhi.get();
649  } else {
650  hEffTot = histograms.hEff_S2RZ.get();
651  if (wheel == 0) {
652  hEff = histograms.hEff_S2RZ_W0.get();
653  }
654  if (abs(wheel) == 1) {
655  hEff = histograms.hEff_S2RZ_W1.get();
656  }
657  if (abs(wheel) == 2) {
658  hEff = histograms.hEff_S2RZ_W2.get();
659  }
660  }
661 
662  } else if (step == 3) {
663  // Step 3
664  if (sl != 2) {
665  hEff = histograms.hEff_S3RPhi.get();
666  if (local_) {
667  histograms.hEff_S3RPhiWS[abs(wheel)][wireId.station() - 1]->fill(
668  simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
669  }
670  } else {
671  hEffTot = histograms.hEff_S3RZ.get();
672  if (wheel == 0) {
673  hEff = histograms.hEff_S3RZ_W0.get();
674  }
675  if (abs(wheel) == 1) {
676  hEff = histograms.hEff_S3RZ_W1.get();
677  }
678  if (abs(wheel) == 2) {
679  hEff = histograms.hEff_S3RZ_W2.get();
680  }
681  if (local_) {
682  histograms.hEff_S3RZWS[abs(wheel)][wireId.station() - 1]->fill(
683  simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
684  }
685  }
686  }
687  // Fill
688  hEff->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
689  if (hEffTot != nullptr) {
690  hEffTot->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
691  }
692  }
693  }
694 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
int superLayer() const
Return the superlayer number.
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer) const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
A set of histograms fo efficiency computation for 1D RecHits (producer)
Definition: Histograms.h:138
T eta() const
Definition: PV3DBase.h:73
float recHitPositionError(const DTRecHit1DPair &recHit) const
void fill(float distSimHit, float thetaSimHit, float distFESimHit, float distRecHit, float etaSimHit, float phiSimHit, float errRecHit, int station)
Definition: Histograms.h:83
float simHitImpactAngle(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
float simHitDistFromWire(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
A set of histograms of residuals and pulls for 1D RecHits.
Definition: Histograms.h:44
const type * findBestRecHit(const DTLayer *layer, const DTWireId &wireId, const std::vector< type > &recHits, float simHitDist) const
Local3DPoint localPosition() const
Definition: PSimHit.h:54
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
void fill(float distSimHit, float etaSimHit, float phiSimHit, bool fillRecHit)
Definition: Histograms.h:157
step
Definition: StallMonitor.cc:98
float simHitDistFromFE(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96

◆ dqmAnalyze()

void DTRecHitQuality::dqmAnalyze ( edm::Event const &  event,
edm::EventSetup const &  setup,
dtrechit::Histograms const &  histograms 
) const
overrideprivatevirtual

Perform the real analysis.

Implements DQMGlobalEDAnalyzerBase< dtrechit::Histograms, Args... >.

Definition at line 211 of file DTRecHitQuality.cc.

References compute(), gather_cfg::cout, debug_, doall_, doStep1_, doStep2_, doStep3_, edm::HandleBase::isValid(), map1DRecHitsPerWire(), DTHitQualityUtils::mapSimHitsPerWire(), muonGeomToken_, edm::Handle< T >::product(), recHitLabel_, recHitToken_, segment2DLabel_, segment2DToken_, segment4DLabel_, segment4DToken_, singleTopDQM_cfi::setup, FastTrackerRecHitCombiner_cfi::simHits, and simHitToken_.

213  {
214  if (debug_) {
215  cout << "--- [DTRecHitQuality] Analysing Event: #Run: " << event.id().run() << " #Event: " << event.id().event()
216  << endl;
217  }
218 
219  // Get the DT Geometry
220  const DTGeometry &dtGeom = setup.getData(muonGeomToken_);
221 
222  // Get the SimHit collection from the event
224  event.getByToken(simHitToken_, simHits);
225 
226  // Map simhits per wire
227  map<DTWireId, PSimHitContainer> simHitsPerWire = DTHitQualityUtils::mapSimHitsPerWire(*(simHits.product()));
228 
229  //=======================================================================================
230  // RecHit analysis at Step 1
231  if (doStep1_ && doall_) {
232  if (debug_) {
233  cout << " -- DTRecHit S1: begin analysis:" << endl;
234  }
235  // Get the rechit collection from the event
236  Handle<DTRecHitCollection> dtRecHits;
237  event.getByToken(recHitToken_, dtRecHits);
238 
239  if (!dtRecHits.isValid()) {
240  if (debug_) {
241  cout << "[DTRecHitQuality]**Warning: no 1DRechits with label: " << recHitLabel_ << " in this event, skipping!"
242  << endl;
243  }
244  return;
245  }
246 
247  // Map rechits per wire
248  auto const &recHitsPerWire = map1DRecHitsPerWire(dtRecHits.product());
249  compute(dtGeom, simHitsPerWire, recHitsPerWire, histograms, 1);
250  }
251 
252  //=======================================================================================
253  // RecHit analysis at Step 2
254  if (doStep2_ && doall_) {
255  if (debug_) {
256  cout << " -- DTRecHit S2: begin analysis:" << endl;
257  }
258 
259  // Get the 2D rechits from the event
261  event.getByToken(segment2DToken_, segment2Ds);
262 
263  if (!segment2Ds.isValid()) {
264  if (debug_) {
265  cout << "[DTRecHitQuality]**Warning: no 2DSegments with label: " << segment2DLabel_
266  << " in this event, skipping!" << endl;
267  }
268 
269  } else {
270  // Map rechits per wire
271  auto const &recHitsPerWire = map1DRecHitsPerWire(segment2Ds.product());
272  compute(dtGeom, simHitsPerWire, recHitsPerWire, histograms, 2);
273  }
274  }
275 
276  //=======================================================================================
277  // RecHit analysis at Step 3
278  if (doStep3_) {
279  if (debug_) {
280  cout << " -- DTRecHit S3: begin analysis:" << endl;
281  }
282 
283  // Get the 4D rechits from the event
285  event.getByToken(segment4DToken_, segment4Ds);
286 
287  if (!segment4Ds.isValid()) {
288  if (debug_) {
289  cout << "[DTRecHitQuality]**Warning: no 4D Segments with label: " << segment4DLabel_
290  << " in this event, skipping!" << endl;
291  }
292  return;
293  }
294 
295  // Map rechits per wire
296  auto const &recHitsPerWire = map1DRecHitsPerWire(segment4Ds.product());
297  compute(dtGeom, simHitsPerWire, recHitsPerWire, histograms, 3);
298  }
299 }
std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
edm::InputTag recHitLabel_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
edm::InputTag segment4DLabel_
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs) const
edm::InputTag segment2DLabel_
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
void compute(const DTGeometry &dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, dtrechit::Histograms const &histograms, int step) const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_

◆ findBestRecHit()

template<typename type >
const type * DTRecHitQuality::findBestRecHit ( const DTLayer layer,
const DTWireId wireId,
const std::vector< type > &  recHits,
float  simHitDist 
) const
private

Definition at line 384 of file DTRecHitQuality.cc.

References nano_mu_digi_cff::layer, rpcPointValidation_cfi::recHit, recHitDistFromWire(), and FastTrackerRecHitMaskProducer_cfi::recHits.

Referenced by compute().

387  {
388  float res = 99999;
389  const type *theBestRecHit = nullptr;
390  // Loop over RecHits within the cell
391  for (auto recHit = recHits.begin(); recHit != recHits.end(); recHit++) {
392  float distTmp = recHitDistFromWire(*recHit, layer);
393  if (fabs(distTmp - simHitDist) < res) {
394  res = fabs(distTmp - simHitDist);
395  theBestRecHit = &(*recHit);
396  }
397  } // End of loop over RecHits within the cell
398 
399  return theBestRecHit;
400 }
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer) const
Definition: Electron.h:6

◆ map1DRecHitsPerWire() [1/3]

map< DTWireId, vector< DTRecHit1DPair > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecHitCollection dt1DRecHitPairs) const
private

Definition at line 302 of file DTRecHitQuality.cc.

References runTheMatrix::ret.

Referenced by dqmAnalyze().

303  {
304  map<DTWireId, vector<DTRecHit1DPair>> ret;
305 
306  for (const auto &dt1DRecHitPair : *dt1DRecHitPairs) {
307  ret[dt1DRecHitPair.wireId()].push_back(dt1DRecHitPair);
308  }
309 
310  return ret;
311 }
ret
prodAgent to be discontinued

◆ map1DRecHitsPerWire() [2/3]

map< DTWireId, vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment2DCollection segment2Ds) const
private

Definition at line 314 of file DTRecHitQuality.cc.

References runTheMatrix::ret.

315  {
316  map<DTWireId, vector<DTRecHit1D>> ret;
317 
318  // Loop over all 2D segments
319  for (const auto &segment2D : *segment2Ds) {
320  vector<DTRecHit1D> component1DHits = segment2D.specificRecHits();
321  // Loop over all component 1D hits
322  for (auto &component1DHit : component1DHits) {
323  ret[component1DHit.wireId()].push_back(component1DHit);
324  }
325  }
326  return ret;
327 }
ret
prodAgent to be discontinued

◆ map1DRecHitsPerWire() [3/3]

map< DTWireId, std::vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment4DCollection segment4Ds) const
private

Definition at line 330 of file DTRecHitQuality.cc.

References hfClusterShapes_cfi::hits, and runTheMatrix::ret.

331  {
332  map<DTWireId, vector<DTRecHit1D>> ret;
333  // Loop over all 4D segments
334  for (const auto &segment4D : *segment4Ds) {
335  // Get component 2D segments
336  vector<const TrackingRecHit *> segment2Ds = segment4D.recHits();
337  // Loop over 2D segments:
338  for (auto &segment2D : segment2Ds) {
339  // Get 1D component rechits
340  vector<const TrackingRecHit *> hits = segment2D->recHits();
341  // Loop over them
342  for (auto &hit : hits) {
343  const auto *hit1D = dynamic_cast<const DTRecHit1D *>(hit);
344  ret[hit1D->wireId()].push_back(*hit1D);
345  }
346  }
347  }
348 
349  return ret;
350 }
ret
prodAgent to be discontinued

◆ recHitDistFromWire() [1/2]

float DTRecHitQuality::recHitDistFromWire ( const DTRecHit1DPair hitPair,
const DTLayer layer 
) const
private

Definition at line 403 of file DTRecHitQuality.cc.

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

Referenced by compute(), and findBestRecHit().

403  {
404  // Compute the rechit distance from wire
405  return fabs(hitPair.localPosition(DTEnums::Left).x() - hitPair.localPosition(DTEnums::Right).x()) / 2.;
406 }
LocalPoint localPosition() const override
T x() const
Definition: PV3DBase.h:59

◆ recHitDistFromWire() [2/2]

float DTRecHitQuality::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
) const
private

Definition at line 409 of file DTRecHitQuality.cc.

References nano_mu_digi_cff::layer, and rpcPointValidation_cfi::recHit.

409  {
410  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
411 }

◆ recHitPositionError() [1/2]

float DTRecHitQuality::recHitPositionError ( const DTRecHit1DPair recHit) const
private

Definition at line 697 of file DTRecHitQuality.cc.

References DTEnums::Left, rpcPointValidation_cfi::recHit, and mathSSE::sqrt().

Referenced by compute().

697  {
698  return sqrt(recHit.localPositionError(DTEnums::Left).xx());
699 }
T sqrt(T t)
Definition: SSEVec.h:19

◆ recHitPositionError() [2/2]

float DTRecHitQuality::recHitPositionError ( const DTRecHit1D recHit) const
private

Definition at line 702 of file DTRecHitQuality.cc.

References rpcPointValidation_cfi::recHit, and mathSSE::sqrt().

702  {
703  return sqrt(recHit.localPositionError().xx());
704 }
T sqrt(T t)
Definition: SSEVec.h:19

◆ simHitDistFromFE()

float DTRecHitQuality::simHitDistFromFE ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 372 of file DTRecHitQuality.cc.

References nano_mu_digi_cff::layer, and PV3DBase< T, PVType, FrameType >::y().

Referenced by compute().

372  {
373  LocalPoint entryP = hit.entryPoint();
374  LocalPoint exitP = hit.exitPoint();
375  float wireLenght = layer->specificTopology().cellLenght();
376  // FIXME: should take only wireLenght/2.;
377  // moreover, pos+cellLenght/2. is shorter than the distance from FE.
378  // In fact it would make more sense to make plots vs y.
379  return (entryP.y() + exitP.y()) / 2. + wireLenght;
380 }
T y() const
Definition: PV3DBase.h:60

◆ simHitDistFromWire()

float DTRecHitQuality::simHitDistFromWire ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 353 of file DTRecHitQuality.cc.

References nano_mu_digi_cff::layer, DTWireId::wire(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by compute().

353  {
354  float xwire = layer->specificTopology().wirePosition(wireId.wire());
355  LocalPoint entryP = hit.entryPoint();
356  LocalPoint exitP = hit.exitPoint();
357  float xEntry = entryP.x() - xwire;
358  float xExit = exitP.x() - xwire;
359 
360  return fabs(xEntry - (entryP.z() * (xExit - xEntry)) / (exitP.z() - entryP.z())); // FIXME: check...
361 }
int wire() const
Return the wire number.
Definition: DTWireId.h:42
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59

◆ simHitImpactAngle()

float DTRecHitQuality::simHitImpactAngle ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 364 of file DTRecHitQuality.cc.

References theta(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by compute().

364  {
365  LocalPoint entryP = hit.entryPoint();
366  LocalPoint exitP = hit.exitPoint();
367  float theta = (exitP.x() - entryP.x()) / (exitP.z() - entryP.z());
368  return atan(theta);
369 }
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
Geom::Theta< T > theta() const

Member Data Documentation

◆ debug_

bool DTRecHitQuality::debug_
private

Definition at line 64 of file DTRecHitQuality.h.

Referenced by compute(), dqmAnalyze(), and DTRecHitQuality().

◆ doall_

bool DTRecHitQuality::doall_
private

Definition at line 86 of file DTRecHitQuality.h.

Referenced by bookHistograms(), compute(), dqmAnalyze(), and DTRecHitQuality().

◆ doStep1_

bool DTRecHitQuality::doStep1_
private

Definition at line 82 of file DTRecHitQuality.h.

Referenced by bookHistograms(), dqmAnalyze(), and DTRecHitQuality().

◆ doStep2_

bool DTRecHitQuality::doStep2_
private

Definition at line 83 of file DTRecHitQuality.h.

Referenced by bookHistograms(), dqmAnalyze(), and DTRecHitQuality().

◆ doStep3_

bool DTRecHitQuality::doStep3_
private

Definition at line 84 of file DTRecHitQuality.h.

Referenced by bookHistograms(), dqmAnalyze(), and DTRecHitQuality().

◆ local_

bool DTRecHitQuality::local_
private

Definition at line 85 of file DTRecHitQuality.h.

Referenced by bookHistograms(), compute(), and DTRecHitQuality().

◆ muonGeomToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTRecHitQuality::muonGeomToken_
private

Definition at line 67 of file DTRecHitQuality.h.

Referenced by dqmAnalyze().

◆ recHitLabel_

edm::InputTag DTRecHitQuality::recHitLabel_
private

Definition at line 77 of file DTRecHitQuality.h.

Referenced by dqmAnalyze(), and DTRecHitQuality().

◆ recHitToken_

edm::EDGetTokenT<DTRecHitCollection> DTRecHitQuality::recHitToken_
private

Definition at line 71 of file DTRecHitQuality.h.

Referenced by dqmAnalyze(), and DTRecHitQuality().

◆ segment2DLabel_

edm::InputTag DTRecHitQuality::segment2DLabel_
private

Definition at line 78 of file DTRecHitQuality.h.

Referenced by dqmAnalyze(), and DTRecHitQuality().

◆ segment2DToken_

edm::EDGetTokenT<DTRecSegment2DCollection> DTRecHitQuality::segment2DToken_
private

Definition at line 72 of file DTRecHitQuality.h.

Referenced by dqmAnalyze(), and DTRecHitQuality().

◆ segment4DLabel_

edm::InputTag DTRecHitQuality::segment4DLabel_
private

Definition at line 79 of file DTRecHitQuality.h.

Referenced by dqmAnalyze(), and DTRecHitQuality().

◆ segment4DToken_

edm::EDGetTokenT<DTRecSegment4DCollection> DTRecHitQuality::segment4DToken_
private

Definition at line 73 of file DTRecHitQuality.h.

Referenced by dqmAnalyze(), and DTRecHitQuality().

◆ simHitLabel_

edm::InputTag DTRecHitQuality::simHitLabel_
private

Definition at line 74 of file DTRecHitQuality.h.

Referenced by DTRecHitQuality().

◆ simHitToken_

edm::EDGetTokenT<edm::PSimHitContainer> DTRecHitQuality::simHitToken_
private

Definition at line 70 of file DTRecHitQuality.h.

Referenced by dqmAnalyze(), and DTRecHitQuality().