Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:14

0001 /** \class MuonNavigableLayer
0002  *
0003  *  base class for MuonBarrelNavigableLayer and MuonForwardNavigableLayer.
0004  *  trackingRange defines an MuonEtaRange for an FTS, 
0005  *  which is used for searching compatible DetLayers.
0006  *
0007  *
0008  * \author : Chang Liu - Purdue University <Chang.Liu@cern.ch>
0009  * with contributions from: R. Bellan - INFN Torino
0010  *
0011  * code of trackingRange is from MuonGlobalNavigation in ORCA
0012  * whose author is Stefano Lacaprara - INFN Padova
0013  * Modification:
0014  *
0015  */
0016 
0017 #include "RecoMuon/Navigation/interface/MuonNavigableLayer.h"
0018 
0019 /* Collaborating Class Header */
0020 #include "TrackingTools/DetLayers/interface/DetLayer.h"
0021 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
0022 #include "RecoMuon/Navigation/interface/MuonDetLayerMap.h"
0023 #include "RecoMuon/Navigation/interface/MuonEtaRange.h"
0024 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0025 /* C++ Headers */
0026 #include <algorithm>
0027 
0028 using namespace std;
0029 
0030 extern float calculateEta(float r, float z) {
0031   if (z > 0)
0032     return -log((tan(atan(r / z) / 2.)));
0033   return log(-(tan(atan(r / z) / 2.)));
0034 }
0035 
0036 MuonEtaRange MuonNavigableLayer::trackingRange(const FreeTrajectoryState& fts) const {
0037   float z = fts.position().z();
0038   float r = fts.position().perp();
0039   float eta;
0040   if (z > 0)
0041     eta = -log((tan(atan(r / z) / 2.)));
0042   else
0043     eta = log(-(tan(atan(r / z) / 2.)));
0044 
0045   double theta = atan(r / z);
0046 
0047   double spread = 5.0 * sqrt(fts.curvilinearError().matrix()(2, 2)) / fabs(sin(theta));  //5*sigma(eta)
0048 
0049   //C.L.: this spread could be too large to use.
0050   // convert it to a smaller one by assuming a virtual radius
0051   // that transforms the error on angle to error on z axis.
0052   // not accurate, but works!
0053 
0054   double eta_max = 0;
0055 
0056   if (z > 0)
0057     eta_max = calculateEta(r, z + spread);
0058   else
0059     eta_max = calculateEta(r, z - spread);
0060 
0061   spread = std::min(0.07, fabs(eta_max - eta));
0062 
0063   MuonEtaRange range(eta + spread, eta - spread);
0064 
0065   spread = 0.07;
0066   // special treatment for special geometry in overlap region
0067 
0068   if (eta > 1.0 && eta < 1.1)
0069     range = MuonEtaRange(eta + 3.0 * spread, eta - spread);
0070   if (eta < -1.0 && eta > -1.1)
0071     range = MuonEtaRange(eta + spread, eta - 3.0 * spread);
0072 
0073   return range;
0074 }
0075 
0076 bool MuonNavigableLayer::isInsideOut(const FreeTrajectoryState& fts) const {
0077   return (fts.position().basicVector().dot(fts.momentum().basicVector()) > 0);
0078 }