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 > edm::global::EDAnalyzer< edm::RunCache< dtrechit::Histograms >, Args... > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTRecHitQuality (const edm::ParameterSet &pset)
 Constructor. More...
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< dtrechit::Histograms >, Args... >
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void bookHistograms (DQMStore::ConcurrentBooker &, 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::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 edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 ( const edm::ParameterSet pset)

Constructor.

Definition at line 88 of file DTRecHitQuality.cc.

References edm::ParameterSet::getUntrackedParameter().

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

Member Function Documentation

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

Book the DQM plots.

Implements DQMGlobalEDAnalyzer< dtrechit::Histograms >.

Definition at line 111 of file DTRecHitQuality.cc.

References dtrechit::Histograms::hEff_S1RPhi, dtrechit::Histograms::hEff_S1RPhiWS, dtrechit::Histograms::hEff_S1RZ, dtrechit::Histograms::hEff_S1RZ_W0, dtrechit::Histograms::hEff_S1RZ_W1, dtrechit::Histograms::hEff_S1RZ_W2, dtrechit::Histograms::hEff_S1RZWS, dtrechit::Histograms::hEff_S2RPhi, dtrechit::Histograms::hEff_S2RZ, dtrechit::Histograms::hEff_S2RZ_W0, dtrechit::Histograms::hEff_S2RZ_W1, dtrechit::Histograms::hEff_S2RZ_W2, dtrechit::Histograms::hEff_S3RPhi, dtrechit::Histograms::hEff_S3RPhiWS, dtrechit::Histograms::hEff_S3RZ, dtrechit::Histograms::hEff_S3RZ_W0, dtrechit::Histograms::hEff_S3RZ_W1, dtrechit::Histograms::hEff_S3RZ_W2, dtrechit::Histograms::hEff_S3RZWS, dtrechit::Histograms::hRes_S1RPhi, dtrechit::Histograms::hRes_S1RPhi_W0, dtrechit::Histograms::hRes_S1RPhi_W1, dtrechit::Histograms::hRes_S1RPhi_W2, dtrechit::Histograms::hRes_S1RZ, dtrechit::Histograms::hRes_S1RZ_W0, dtrechit::Histograms::hRes_S1RZ_W1, dtrechit::Histograms::hRes_S1RZ_W2, dtrechit::Histograms::hRes_S2RPhi, dtrechit::Histograms::hRes_S2RPhi_W0, dtrechit::Histograms::hRes_S2RPhi_W1, dtrechit::Histograms::hRes_S2RPhi_W2, dtrechit::Histograms::hRes_S2RZ, dtrechit::Histograms::hRes_S2RZ_W0, dtrechit::Histograms::hRes_S2RZ_W1, dtrechit::Histograms::hRes_S2RZ_W2, dtrechit::Histograms::hRes_S3RPhi, dtrechit::Histograms::hRes_S3RPhi_W0, dtrechit::Histograms::hRes_S3RPhi_W1, dtrechit::Histograms::hRes_S3RPhi_W2, dtrechit::Histograms::hRes_S3RPhiWS, dtrechit::Histograms::hRes_S3RZ, dtrechit::Histograms::hRes_S3RZ_W0, dtrechit::Histograms::hRes_S3RZ_W1, dtrechit::Histograms::hRes_S3RZ_W2, dtrechit::Histograms::hRes_S3RZWS, alignCSCRings::s, and w.

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

References funct::abs(), gather_cfg::cout, PV3DBase< T, PVType, FrameType >::eta(), HRes1DHit::fill(), HEff1DHit::fill(), DTHitQualityUtils::findMuSimHit(), dtrechit::Histograms::hEff_S1RPhi, dtrechit::Histograms::hEff_S1RPhiWS, dtrechit::Histograms::hEff_S1RZ, dtrechit::Histograms::hEff_S1RZ_W0, dtrechit::Histograms::hEff_S1RZ_W1, dtrechit::Histograms::hEff_S1RZ_W2, dtrechit::Histograms::hEff_S1RZWS, dtrechit::Histograms::hEff_S2RPhi, dtrechit::Histograms::hEff_S2RZ, dtrechit::Histograms::hEff_S2RZ_W0, dtrechit::Histograms::hEff_S2RZ_W1, dtrechit::Histograms::hEff_S2RZ_W2, dtrechit::Histograms::hEff_S3RPhi, dtrechit::Histograms::hEff_S3RPhiWS, dtrechit::Histograms::hEff_S3RZ, dtrechit::Histograms::hEff_S3RZ_W0, dtrechit::Histograms::hEff_S3RZ_W1, dtrechit::Histograms::hEff_S3RZ_W2, dtrechit::Histograms::hEff_S3RZWS, dtrechit::Histograms::hRes_S1RPhi, dtrechit::Histograms::hRes_S1RPhi_W0, dtrechit::Histograms::hRes_S1RPhi_W1, dtrechit::Histograms::hRes_S1RPhi_W2, dtrechit::Histograms::hRes_S1RZ, dtrechit::Histograms::hRes_S1RZ_W0, dtrechit::Histograms::hRes_S1RZ_W1, dtrechit::Histograms::hRes_S1RZ_W2, dtrechit::Histograms::hRes_S2RPhi, dtrechit::Histograms::hRes_S2RPhi_W0, dtrechit::Histograms::hRes_S2RPhi_W1, dtrechit::Histograms::hRes_S2RPhi_W2, dtrechit::Histograms::hRes_S2RZ, dtrechit::Histograms::hRes_S2RZ_W0, dtrechit::Histograms::hRes_S2RZ_W1, dtrechit::Histograms::hRes_S2RZ_W2, dtrechit::Histograms::hRes_S3RPhi, dtrechit::Histograms::hRes_S3RPhi_W0, dtrechit::Histograms::hRes_S3RPhi_W1, dtrechit::Histograms::hRes_S3RPhi_W2, dtrechit::Histograms::hRes_S3RPhiWS, dtrechit::Histograms::hRes_S3RZ, dtrechit::Histograms::hRes_S3RZ_W0, dtrechit::Histograms::hRes_S3RZ_W1, dtrechit::Histograms::hRes_S3RZ_W2, dtrechit::Histograms::hRes_S3RZWS, DTGeometry::layer(), PSimHit::localPosition(), PV3DBase< T, PVType, FrameType >::phi(), DTChamberId::station(), DTSuperLayerId::superLayer(), GeomDet::toGlobal(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

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

Perform the real analysis.

Definition at line 212 of file DTRecHitQuality.cc.

References bookConverter::compute(), gather_cfg::cout, edm::EventSetup::get(), ecalSelectiveReadoutValidation_cfi::histograms, edm::HandleBase::isValid(), DTHitQualityUtils::mapSimHitsPerWire(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), and trackerHits::simHits.

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

References rpcPointValidation_cfi::recHit.

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

Definition at line 304 of file DTRecHitQuality.cc.

305  {
306  map<DTWireId, vector<DTRecHit1DPair>> ret;
307 
308  for (const auto &dt1DRecHitPair : *dt1DRecHitPairs) {
309  ret[dt1DRecHitPair.wireId()].push_back(dt1DRecHitPair);
310  }
311 
312  return ret;
313 }
map< DTWireId, vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment2DCollection segment2Ds) const
private

Definition at line 316 of file DTRecHitQuality.cc.

317  {
318  map<DTWireId, vector<DTRecHit1D>> ret;
319 
320  // Loop over all 2D segments
321  for (const auto &segment2D : *segment2Ds) {
322  vector<DTRecHit1D> component1DHits = segment2D.specificRecHits();
323  // Loop over all component 1D hits
324  for (auto &component1DHit : component1DHits) {
325  ret[component1DHit.wireId()].push_back(component1DHit);
326  }
327  }
328  return ret;
329 }
map< DTWireId, std::vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment4DCollection segment4Ds) const
private

Definition at line 332 of file DTRecHitQuality.cc.

References hfClusterShapes_cfi::hits.

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

Definition at line 405 of file DTRecHitQuality.cc.

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

405  {
406  // Compute the rechit distance from wire
407  return fabs(hitPair.localPosition(DTEnums::Left).x() - hitPair.localPosition(DTEnums::Right).x()) / 2.;
408 }
LocalPoint localPosition() const override
T x() const
Definition: PV3DBase.h:62
float DTRecHitQuality::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
) const
private

Definition at line 411 of file DTRecHitQuality.cc.

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

411  {
412  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
413 }
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:60
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
int wire() const
Return the wire number.
Definition: DTWireId.h:56
T x() const
Definition: PV3DBase.h:62
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:107
float DTRecHitQuality::recHitPositionError ( const DTRecHit1DPair recHit) const
private

Definition at line 699 of file DTRecHitQuality.cc.

References DTEnums::Left, DTRecHit1DPair::localPositionError(), mathSSE::sqrt(), and LocalError::xx().

699  {
700  return sqrt(recHit.localPositionError(DTEnums::Left).xx());
701 }
float xx() const
Definition: LocalError.h:24
LocalError localPositionError() const override
T sqrt(T t)
Definition: SSEVec.h:18
float DTRecHitQuality::recHitPositionError ( const DTRecHit1D recHit) const
private

Definition at line 704 of file DTRecHitQuality.cc.

References DEFINE_FWK_MODULE, DTRecHit1D::localPositionError(), mathSSE::sqrt(), and LocalError::xx().

704  {
705  return sqrt(recHit.localPositionError().xx());
706 }
float xx() const
Definition: LocalError.h:24
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
Definition: DTRecHit1D.h:66
T sqrt(T t)
Definition: SSEVec.h:18
float DTRecHitQuality::simHitDistFromFE ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 374 of file DTRecHitQuality.cc.

References DTTopology::cellLenght(), PSimHit::entryPoint(), PSimHit::exitPoint(), DTLayer::specificTopology(), and PV3DBase< T, PVType, FrameType >::y().

374  {
375  LocalPoint entryP = hit.entryPoint();
376  LocalPoint exitP = hit.exitPoint();
377  float wireLenght = layer->specificTopology().cellLenght();
378  // FIXME: should take only wireLenght/2.;
379  // moreover, pos+cellLenght/2. is shorter than the distance from FE.
380  // In fact it would make more sense to make plots vs y.
381  return (entryP.y() + exitP.y()) / 2. + wireLenght;
382 }
T y() const
Definition: PV3DBase.h:63
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
float cellLenght() const
Definition: DTTopology.h:73
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
float DTRecHitQuality::simHitDistFromWire ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 355 of file DTRecHitQuality.cc.

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

355  {
356  float xwire = layer->specificTopology().wirePosition(wireId.wire());
357  LocalPoint entryP = hit.entryPoint();
358  LocalPoint exitP = hit.exitPoint();
359  float xEntry = entryP.x() - xwire;
360  float xExit = exitP.x() - xwire;
361 
362  return fabs(xEntry - (entryP.z() * (xExit - xEntry)) / (exitP.z() - entryP.z())); // FIXME: check...
363 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
T z() const
Definition: PV3DBase.h:64
int wire() const
Return the wire number.
Definition: DTWireId.h:56
T x() const
Definition: PV3DBase.h:62
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
float DTRecHitQuality::simHitImpactAngle ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 366 of file DTRecHitQuality.cc.

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

366  {
367  LocalPoint entryP = hit.entryPoint();
368  LocalPoint exitP = hit.exitPoint();
369  float theta = (exitP.x() - entryP.x()) / (exitP.z() - entryP.z());
370  return atan(theta);
371 }
Geom::Theta< T > theta() const
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43

Member Data Documentation

bool DTRecHitQuality::debug_
private

Definition at line 64 of file DTRecHitQuality.h.

bool DTRecHitQuality::doall_
private

Definition at line 83 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep1_
private

Definition at line 79 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep2_
private

Definition at line 80 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep3_
private

Definition at line 81 of file DTRecHitQuality.h.

bool DTRecHitQuality::local_
private

Definition at line 82 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::recHitLabel_
private

Definition at line 74 of file DTRecHitQuality.h.

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

Definition at line 68 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::segment2DLabel_
private

Definition at line 75 of file DTRecHitQuality.h.

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

Definition at line 69 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::segment4DLabel_
private

Definition at line 76 of file DTRecHitQuality.h.

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

Definition at line 70 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::simHitLabel_
private

Definition at line 71 of file DTRecHitQuality.h.

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

Definition at line 67 of file DTRecHitQuality.h.