Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-20 02:50:35

0001 #ifndef Validation_DTRecHits_DTHitQualityUtils_h
0002 #define Validation_DTRecHits_DTHitQualityUtils_h
0003 
0004 /** \class DTHitQualityUtils
0005  *
0006  *  Define some basic tools and utilities for 1D DT Rec Hit and
0007  *  2D, 4D DT Segment analysis
0008  *
0009  *  \author S. Bolognesi and G. Cerminara - INFN Torino
0010  */
0011 
0012 #include "DataFormats/DetId/interface/DetId.h"
0013 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0014 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0015 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0016 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0017 
0018 #include <atomic>
0019 #include <map>
0020 
0021 class PSimHit;
0022 class DTGeometry;
0023 
0024 namespace DTHitQualityUtils {
0025 
0026   /// Operations
0027   /// Create a map between the SimHits in a chamber and the corrisponding
0028   /// MuBarWireId
0029   std::map<DTWireId, edm::PSimHitContainer> mapSimHitsPerWire(const edm::PSimHitContainer &simhits);
0030   /// Create a map between the Mu SimHits and corresponding MuBarWireId ;
0031   std::map<DTWireId, const PSimHit *> mapMuSimHitsPerWire(
0032       const std::map<DTWireId, edm::PSimHitContainer> &simHitWireMap);
0033   /// Select the SimHit from a muon in a vector of SimHits
0034   const PSimHit *findMuSimHit(const edm::PSimHitContainer &hits);
0035   /// Find Innermost and outermost SimHit from Mu in a SL (they identify a
0036   /// simulated segment)
0037   std::pair<const PSimHit *, const PSimHit *> findMuSimSegment(
0038       const std::map<DTWireId, const PSimHit *> &mapWireAndMuSimHit);
0039   /// Find direction and position of a segment (in local RF) from outer and inner
0040   /// mu SimHit in the RF of object Det
0041   std::pair<LocalVector, LocalPoint> findMuSimSegmentDirAndPos(
0042       const std::pair<const PSimHit *, const PSimHit *> &inAndOutSimHit, const DetId detId, const DTGeometry &muonGeom);
0043   /// Find the angles from a segment direction:
0044   /// atan(dx/dz) = "phi"   angle in the chamber RF
0045   /// atan(dy/dz) = "theta" angle in the chamber RF (note: this has opposite sign
0046   /// in the SLZ RF!)
0047   std::pair<double, double> findSegmentAlphaAndBeta(const LocalVector &direction);
0048 
0049   // Set the verbosity level
0050   extern std::atomic<bool> debug;
0051 
0052   // Find angle error
0053   double sigmaAngle(double Angle, double sigma2TanAngle);
0054 
0055 }  // namespace DTHitQualityUtils
0056 #endif