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
 
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)
 
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 ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, 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.

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

403  {
404  // Loop over cells with a muon SimHit
405  for (const auto & wireAndSHits : simHitsPerWire) {
406  DTWireId wireId = wireAndSHits.first;
407  int wheel = wireId.wheel();
408  int sl = wireId.superLayer();
409 
410  vector<PSimHit> simHitsInCell = wireAndSHits.second;
411 
412  // Get the layer
413  const DTLayer* layer = dtGeom->layer(wireId);
414 
415  // Look for a mu hit in the cell
416  const PSimHit* muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
417  if (muSimHit == nullptr) {
418  if (debug_) {
419  cout << " No mu SimHit in channel: " << wireId << ", skipping! " << endl;
420 }
421  continue; // Skip this cell
422  }
423 
424  // Find the distance of the simhit from the wire
425  float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
426  // Skip simhits out of the cell
427  if (simHitWireDist>2.1) {
428  if (debug_) {
429  cout << " [DTRecHitQuality]###Warning: The mu SimHit in out of the cell, skipping!" << endl;
430 }
431  continue; // Skip this cell
432  }
433  GlobalPoint simHitGlobalPos = layer->toGlobal(muSimHit->localPosition());
434 
435  // find SH impact angle
436  float simHitTheta = simHitImpactAngle(layer, wireId, *muSimHit);
437 
438  // find SH distance from FE
439  float simHitFEDist = simHitDistFromFE(layer, wireId, *muSimHit);
440 
441  bool recHitReconstructed = false;
442 
443  // Look for RecHits in the same cell
444  if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
445  // No RecHit found in this cell
446  if (debug_) {
447  cout << " No RecHit found at Step: " << step << " in cell: " << wireId << endl;
448 }
449  } else {
450  recHitReconstructed = true;
451  // vector<type> recHits = (*wireAndRecHits).second;
452  const vector<type>& recHits = recHitsPerWire.at(wireId);
453  if (debug_) {
454  cout << " " << recHits.size() << " RecHits, Step " << step << " in channel: " << wireId << endl;
455 }
456 
457  // Find the best RecHit
458  const type* theBestRecHit = findBestRecHit(layer, wireId, recHits, simHitWireDist);
459 
460 
461  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
462  if (debug_) {
463  cout << " SimHit distance from wire: " << simHitWireDist << endl
464  << " SimHit distance from FE: " << simHitFEDist << endl
465  << " SimHit angle in layer RF: " << simHitTheta << endl
466  << " RecHit distance from wire: " << recHitWireDist << endl;
467 }
468  float recHitErr = recHitPositionError(*theBestRecHit);
469  HRes1DHit *hRes = nullptr;
470  HRes1DHit *hResTot = nullptr;
471 
472  // Mirror angle in phi so that + and - wheels can be plotted together
473  if (mirrorMinusWheels && wheel<0 && sl!= 2) {
474  simHitTheta *= -1.;
475  // Note: local X, if used, would have to be mirrored as well
476  }
477 
478  // Fill residuals and pulls
479  // Select the histo to be filled
480  if (step == 1) {
481  // Step 1
482  if (sl != 2) {
483  hResTot = histograms.hRes_S1RPhi.get();
484  if (wheel == 0) {
485  hRes = histograms.hRes_S1RPhi_W0.get();
486 }
487  if (abs(wheel) == 1) {
488  hRes = histograms.hRes_S1RPhi_W1.get();
489 }
490  if (abs(wheel) == 2) {
491  hRes = histograms.hRes_S1RPhi_W2.get();
492 }
493  } else {
494  hResTot = histograms.hRes_S1RZ.get();
495  if (wheel == 0) {
496  hRes = histograms.hRes_S1RZ_W0.get();
497 }
498  if (abs(wheel) == 1) {
499  hRes = histograms.hRes_S1RZ_W1.get();
500 }
501  if (abs(wheel) == 2) {
502  hRes = histograms.hRes_S1RZ_W2.get();
503 }
504  }
505 
506  } else if (step == 2) {
507  // Step 2
508  if (sl != 2) {
509  hRes = histograms.hRes_S2RPhi.get();
510  if (wheel == 0) {
511  hRes = histograms.hRes_S2RPhi_W0.get();
512 }
513  if (abs(wheel) == 1) {
514  hRes = histograms.hRes_S2RPhi_W1.get();
515 }
516  if (abs(wheel) == 2) {
517  hRes = histograms.hRes_S2RPhi_W2.get();
518 }
519  } else {
520  hResTot = histograms.hRes_S2RZ.get();
521  if (wheel == 0) {
522  hRes = histograms.hRes_S2RZ_W0.get();
523 }
524  if (abs(wheel) == 1) {
525  hRes = histograms.hRes_S2RZ_W1.get();
526 }
527  if (abs(wheel) == 2) {
528  hRes = histograms.hRes_S2RZ_W2.get();
529 }
530  }
531 
532  } else if (step == 3) {
533  // Step 3
534  if (sl != 2) {
535  hResTot = histograms.hRes_S3RPhi.get();
536  if (wheel == 0) {
537  hRes = histograms.hRes_S3RPhi_W0.get();
538 }
539  if (abs(wheel) == 1) {
540  hRes = histograms.hRes_S3RPhi_W1.get();
541 }
542  if (abs(wheel) == 2) {
543  hRes = histograms.hRes_S3RPhi_W2.get();
544 }
545  if (local_) {
546  histograms.hRes_S3RPhiWS[abs(wheel)][wireId.station()-1]->fill(simHitWireDist, simHitTheta, simHitFEDist, recHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitErr, wireId.station());
547 }
548  } else {
549  hResTot = histograms.hRes_S3RZ.get();
550  if (wheel == 0) {
551  hRes = histograms.hRes_S3RZ_W0.get();
552 }
553  if (abs(wheel) == 1) {
554  hRes = histograms.hRes_S3RZ_W1.get();
555 }
556  if (abs(wheel) == 2) {
557  hRes = histograms.hRes_S3RZ_W2.get();
558 }
559  if (local_) {
560  histograms.hRes_S3RZWS[abs(wheel)][wireId.station()-1]->fill(simHitWireDist, simHitTheta, simHitFEDist, recHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitErr, wireId.station());
561 }
562  }
563  }
564 
565  // Fill
566  hRes->fill(simHitWireDist, simHitTheta, simHitFEDist, recHitWireDist, simHitGlobalPos.eta(),
567  simHitGlobalPos.phi(), recHitErr, wireId.station());
568  if (hResTot != nullptr) {
569  hResTot->fill(simHitWireDist, simHitTheta, simHitFEDist, recHitWireDist, simHitGlobalPos.eta(),
570  simHitGlobalPos.phi(), recHitErr, wireId.station());
571 }
572  }
573 
574  // Fill Efficiencies
575  if (doall_) {
576  HEff1DHit *hEff = nullptr;
577  HEff1DHit *hEffTot = nullptr;
578  if (step == 1) {
579  // Step 1
580  if (sl != 2) {
581  hEff = histograms.hEff_S1RPhi.get();
582  if (local_) { histograms.hEff_S1RPhiWS[abs(wheel)][wireId.station()-1]->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
583 }
584  } else {
585  hEffTot = histograms.hEff_S1RZ.get();
586  if (wheel == 0) {
587  hEff = histograms.hEff_S1RZ_W0.get();
588 }
589  if (abs(wheel) == 1) {
590  hEff = histograms.hEff_S1RZ_W1.get();
591 }
592  if (abs(wheel) == 2) {
593  hEff = histograms.hEff_S1RZ_W2.get();
594 }
595  if (local_) { histograms.hEff_S1RZWS[abs(wheel)][wireId.station()-1]->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
596 }
597  }
598 
599  } else if (step == 2) {
600  // Step 2
601  if (sl != 2) {
602  hEff = histograms.hEff_S2RPhi.get();
603  } else {
604  hEffTot = histograms.hEff_S2RZ.get();
605  if (wheel == 0) {
606  hEff = histograms.hEff_S2RZ_W0.get();
607 }
608  if (abs(wheel) == 1) {
609  hEff = histograms.hEff_S2RZ_W1.get();
610 }
611  if (abs(wheel) == 2) {
612  hEff = histograms.hEff_S2RZ_W2.get();
613 }
614  }
615 
616  } else if (step == 3) {
617  // Step 3
618  if (sl != 2) {
619  hEff = histograms.hEff_S3RPhi.get();
620  if (local_) { histograms.hEff_S3RPhiWS[abs(wheel)][wireId.station()-1]->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
621 }
622  } else {
623  hEffTot = histograms.hEff_S3RZ.get();
624  if (wheel == 0) {
625  hEff = histograms.hEff_S3RZ_W0.get();
626 }
627  if (abs(wheel) == 1) {
628  hEff = histograms.hEff_S3RZ_W1.get();
629 }
630  if (abs(wheel) == 2) {
631  hEff = histograms.hEff_S3RZ_W2.get();
632 }
633  if (local_) { histograms.hEff_S3RZWS[abs(wheel)][wireId.station()-1]->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
634 }
635  }
636 
637  }
638  // Fill
639  hEff->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
640  if (hEffTot != nullptr) {
641  hEffTot->fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
642 }
643  }
644  }
645 }
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:133
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:44
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:46
T eta() const
Definition: PV3DBase.h:76
void fill(float distSimHit, float etaSimHit, float phiSimHit, bool fillRecHit)
Definition: Histograms.h:148
step
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 181 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.

181  {
182  if (debug_) {
183  cout << "--- [DTRecHitQuality] Analysing Event: #Run: " << event.id().run()
184  << " #Event: " << event.id().event() << endl;
185 }
186 
187  // Get the DT Geometry
188  ESHandle<DTGeometry> dtGeom;
189  setup.get<MuonGeometryRecord>().get(dtGeom);
190 
191  // Get the SimHit collection from the event
193  event.getByToken(simHitToken_, simHits);
194 
195  // Map simhits per wire
196  map<DTWireId, PSimHitContainer > simHitsPerWire =
198 
199  //=======================================================================================
200  // RecHit analysis at Step 1
201  if (doStep1_ && doall_) {
202  if (debug_) {
203  cout << " -- DTRecHit S1: begin analysis:" << endl;
204 }
205  // Get the rechit collection from the event
206  Handle<DTRecHitCollection> dtRecHits;
207  event.getByToken(recHitToken_, dtRecHits);
208 
209  if (!dtRecHits.isValid()) {
210  if (debug_) { cout << "[DTRecHitQuality]**Warning: no 1DRechits with label: " << recHitLabel_ << " in this event, skipping!" << endl;
211 }
212  return;
213  }
214 
215  // Map rechits per wire
216  auto const& recHitsPerWire = map1DRecHitsPerWire(dtRecHits.product());
217  compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, histograms, 1);
218  }
219 
220  //=======================================================================================
221  // RecHit analysis at Step 2
222  if (doStep2_ && doall_) {
223  if (debug_) {
224  cout << " -- DTRecHit S2: begin analysis:" << endl;
225 }
226 
227  // Get the 2D rechits from the event
229  event.getByToken(segment2DToken_, segment2Ds);
230 
231  if (!segment2Ds.isValid()) {
232  if (debug_) {
233  cout << "[DTRecHitQuality]**Warning: no 2DSegments with label: " << segment2DLabel_
234  << " in this event, skipping!" << endl;
235 }
236 
237  }
238  else{
239  // Map rechits per wire
240  auto const& recHitsPerWire = map1DRecHitsPerWire(segment2Ds.product());
241  compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, histograms, 2);
242  }
243  }
244 
245  //=======================================================================================
246  // RecHit analysis at Step 3
247  if (doStep3_) {
248  if (debug_) {
249  cout << " -- DTRecHit S3: begin analysis:" << endl;
250 }
251 
252  // Get the 4D rechits from the event
254  event.getByToken(segment4DToken_, segment4Ds);
255 
256  if (!segment4Ds.isValid()) {
257  if (debug_) { cout << "[DTRecHitQuality]**Warning: no 4D Segments with label: " << segment4DLabel_
258  << " in this event, skipping!" << endl;
259 }
260  return;
261  }
262 
263  // Map rechits per wire
264  auto const& recHitsPerWire = map1DRecHitsPerWire(segment4Ds.product());
265  compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, histograms, 3);
266  }
267 }
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
std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
edm::InputTag segment2DLabel_
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
bool isValid() const
Definition: HandleBase.h:74
T const * product() const
Definition: Handle.h:81
T const * product() const
Definition: ESHandle.h:84
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 361 of file DTRecHitQuality.cc.

References rpcPointValidation_cfi::recHit.

364  {
365  float res = 99999;
366  const type* theBestRecHit = nullptr;
367  // Loop over RecHits within the cell
368  for (auto recHit = recHits.begin();
369  recHit != recHits.end();
370  recHit++) {
371  float distTmp = recHitDistFromWire(*recHit, layer);
372  if (fabs(distTmp-simHitDist) < res) {
373  res = fabs(distTmp-simHitDist);
374  theBestRecHit = &(*recHit);
375  }
376  } // End of loop over RecHits within the cell
377 
378  return theBestRecHit;
379 }
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 271 of file DTRecHitQuality.cc.

271  {
272  map<DTWireId, vector<DTRecHit1DPair>> ret;
273 
274  for (const auto & dt1DRecHitPair : *dt1DRecHitPairs) {
275  ret[dt1DRecHitPair.wireId()].push_back(dt1DRecHitPair);
276  }
277 
278  return ret;
279 }
map< DTWireId, vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment2DCollection segment2Ds) const
private

Definition at line 284 of file DTRecHitQuality.cc.

284  {
285  map<DTWireId, vector<DTRecHit1D>> ret;
286 
287  // Loop over all 2D segments
288  for (const auto & segment2D : *segment2Ds) {
289  vector<DTRecHit1D> component1DHits = segment2D.specificRecHits();
290  // Loop over all component 1D hits
291  for (auto & component1DHit : component1DHits) {
292  ret[component1DHit.wireId()].push_back(component1DHit);
293  }
294  }
295  return ret;
296 }
map< DTWireId, std::vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment4DCollection segment4Ds) const
private

Definition at line 300 of file DTRecHitQuality.cc.

References hfClusterShapes_cfi::hits.

300  {
301  map<DTWireId, vector<DTRecHit1D>> ret;
302  // Loop over all 4D segments
303  for (const auto & segment4D : *segment4Ds) {
304  // Get component 2D segments
305  vector<const TrackingRecHit*> segment2Ds = segment4D.recHits();
306  // Loop over 2D segments:
307  for (auto & segment2D : segment2Ds) {
308  // Get 1D component rechits
309  vector<const TrackingRecHit*> hits = segment2D->recHits();
310  // Loop over them
311  for (auto & hit : hits) {
312  const auto* hit1D = dynamic_cast<const DTRecHit1D*>(hit);
313  ret[hit1D->wireId()].push_back(*hit1D);
314  }
315  }
316  }
317 
318  return ret;
319 }
float DTRecHitQuality::recHitDistFromWire ( const DTRecHit1DPair hitPair,
const DTLayer layer 
) const
private

Definition at line 384 of file DTRecHitQuality.cc.

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

384  {
385  // Compute the rechit distance from wire
386  return fabs(hitPair.localPosition(DTEnums::Left).x() -
387  hitPair.localPosition(DTEnums::Right).x())/2.;
388 }
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 394 of file DTRecHitQuality.cc.

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

394  {
395  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
396 }
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 648 of file DTRecHitQuality.cc.

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

648  {
649  return sqrt(recHit.localPositionError(DTEnums::Left).xx());
650 }
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 653 of file DTRecHitQuality.cc.

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

653  {
654  return sqrt(recHit.localPositionError().xx());
655 }
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 345 of file DTRecHitQuality.cc.

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

347  {
348  LocalPoint entryP = hit.entryPoint();
349  LocalPoint exitP = hit.exitPoint();
350  float wireLenght = layer->specificTopology().cellLenght();
351  // FIXME: should take only wireLenght/2.;
352  // moreover, pos+cellLenght/2. is shorter than the distance from FE.
353  // In fact it would make more sense to make plots vs y.
354  return (entryP.y()+exitP.y())/2.+wireLenght;
355 }
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:38
float cellLenght() const
Definition: DTTopology.h:73
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
float DTRecHitQuality::simHitDistFromWire ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 322 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().

324  {
325  float xwire = layer->specificTopology().wirePosition(wireId.wire());
326  LocalPoint entryP = hit.entryPoint();
327  LocalPoint exitP = hit.exitPoint();
328  float xEntry = entryP.x() - xwire;
329  float xExit = exitP.x() - xwire;
330 
331  return fabs(xEntry - (entryP.z()*(xExit-xEntry))/(exitP.z()-entryP.z())); // FIXME: check...
332 }
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:38
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:35
float DTRecHitQuality::simHitImpactAngle ( const DTLayer layer,
const DTWireId wireId,
const PSimHit hit 
) const
private

Definition at line 335 of file DTRecHitQuality.cc.

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

337  {
338  LocalPoint entryP = hit.entryPoint();
339  LocalPoint exitP = hit.exitPoint();
340  float theta =(exitP.x()-entryP.x())/(exitP.z()-entryP.z());
341  return atan(theta);
342 }
Geom::Theta< T > theta() const
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
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:35

Member Data Documentation

bool DTRecHitQuality::debug_
private

Definition at line 62 of file DTRecHitQuality.h.

bool DTRecHitQuality::doall_
private

Definition at line 80 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep1_
private

Definition at line 76 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep2_
private

Definition at line 77 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep3_
private

Definition at line 78 of file DTRecHitQuality.h.

bool DTRecHitQuality::local_
private

Definition at line 79 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::recHitLabel_
private

Definition at line 71 of file DTRecHitQuality.h.

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

Definition at line 66 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::segment2DLabel_
private

Definition at line 72 of file DTRecHitQuality.h.

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

Definition at line 67 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::segment4DLabel_
private

Definition at line 73 of file DTRecHitQuality.h.

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

Definition at line 68 of file DTRecHitQuality.h.

edm::InputTag DTRecHitQuality::simHitLabel_
private

Definition at line 68 of file DTRecHitQuality.h.

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

Definition at line 65 of file DTRecHitQuality.h.