Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:56

0001 #ifndef RecoLocalFastTime_FTLClusterizer_BTLRecHitsErrorEstimatorIM_H
0002 #define RecoLocalFastTime_FTLClusterizer_BTLRecHitsErrorEstimatorIM_H 1
0003 
0004 //-----------------------------------------------------------------------------
0005 // \class         BTLRecHitsErrorEstimatorIM
0006 // Used to improve the local error of recHits and TrackingrecHits in BTL
0007 //-----------------------------------------------------------------------------
0008 
0009 #include "Geometry/MTDGeometryBuilder/interface/MTDGeomDetUnit.h"
0010 #include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"
0011 #include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
0012 
0013 #include "Geometry/CommonDetUnit/interface/GeomDetEnumerators.h"
0014 
0015 #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h"
0016 
0017 #include "MagneticField/Engine/interface/MagneticField.h"
0018 #include "FWCore/Utilities/interface/Exception.h"
0019 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0021 
0022 class BTLRecHitsErrorEstimatorIM {
0023 public:
0024   BTLRecHitsErrorEstimatorIM(const MTDGeomDet* det, const LocalPoint& lp) : det_(det), lp_(lp) {
0025     if (GeomDetEnumerators::isEndcap(det->type().subDetector())) {
0026       throw cms::Exception("BTLRecHitsErrorEstimatorIM")
0027           << "This is an object from Endcap. Only use it for the Barrel!" << std::endl;
0028     }
0029   }
0030   LocalError localError() const {
0031     /// position error, refer to:
0032     /// https://indico.cern.ch/event/825902/contributions/3455359/attachments/1858923/3054344/residual_calculation_0607.pdf
0033     const float positionError2 = std::pow(positionError(), 2);
0034     const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(det_->topology());
0035     const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
0036     MeasurementPoint mp = topo.measurementPosition(lp_);
0037     MeasurementError simpleRect(1. / 12., 0, 1. / 12.);
0038     LocalError error_before = topo.localError(mp, simpleRect);
0039     LocalError error_modified(positionError2, error_before.xy(), error_before.yy());
0040     return error_modified;
0041   }
0042   static float positionError() {
0043     constexpr float positionError = 0.6f;
0044     return positionError;
0045   }
0046 
0047 private:
0048   const MTDGeomDet* det_;
0049   const LocalPoint& lp_;
0050 };
0051 
0052 #endif