CMS 3D CMS Logo

MuonPatternRecoDumper.cc
Go to the documentation of this file.
1 
2 // This Class Header
4 
5 // Collaborating Class Header
10 
17 
18 #include <sstream>
19 
20 using namespace std;
21 
22 // Constructor
24 
25 // Destructor
27 
28 // Operations
29 
30 string MuonPatternRecoDumper::dumpLayer(const DetLayer* layer) const {
31  stringstream output;
32 
33  const BoundSurface* sur = nullptr;
34  const BoundCylinder* bc = nullptr;
35  const BoundDisk* bd = nullptr;
36 
37  sur = &(layer->surface());
38  if ((bc = dynamic_cast<const BoundCylinder*>(sur))) {
39  output << " Cylinder of radius: " << bc->radius() << endl;
40  } else if ((bd = dynamic_cast<const BoundDisk*>(sur))) {
41  output << " Disk at: " << bd->position().z() << endl;
42  }
43  return output.str();
44 }
45 
47  stringstream output;
48 
49  output << " pos: " << fts.position() << " radius: " << fts.position().perp() << endl
50  << " charge*pt: " << fts.momentum().perp() * fts.parameters().charge() << " eta: " << fts.momentum().eta()
51  << " phi: " << fts.momentum().phi() << endl;
52 
53  return output.str();
54 }
55 
57  stringstream output;
58 
59  output << tsos << endl;
60  output << "dir: " << tsos.globalDirection() << endl;
61  output << dumpFTS(*tsos.freeTrajectoryState());
62 
63  return output.str();
64 }
65 
66 string MuonPatternRecoDumper::dumpMuonId(const DetId& id) const {
67  stringstream output;
68 
69  if (id.subdetId() == MuonSubdetId::DT) {
70  DTWireId wireId(id.rawId());
71 
72  output << "(DT): " << wireId << endl;
73  } else if (id.subdetId() == MuonSubdetId::CSC) {
74  CSCDetId chamberId(id.rawId());
75  output << "(CSC): " << chamberId << endl;
76  } else if (id.subdetId() == MuonSubdetId::GEM) {
77  GEMDetId chamberId(id.rawId());
78  output << "(GEM): " << chamberId << endl;
79  } else if (id.subdetId() == MuonSubdetId::ME0) {
80  ME0DetId chamberId(id.rawId());
81  output << "(ME0): " << chamberId << endl;
82  } else if (id.subdetId() == MuonSubdetId::RPC) {
83  RPCDetId chamberId(id.rawId());
84  output << "(RPC): " << chamberId << endl;
85  } else
86  output << "The DetLayer is not a valid Muon DetLayer. ";
87 
88  return output.str();
89 }
MuonSubdetId::GEM
static constexpr int GEM
Definition: MuonSubdetId.h:14
TrajectoryStateOnSurface::globalDirection
GlobalVector globalDirection() const
Definition: TrajectoryStateOnSurface.h:67
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
TrajectoryStateOnSurface::freeTrajectoryState
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:60
FreeTrajectoryState.h
MuonPatternRecoDumper.h
DetLayer
Definition: DetLayer.h:21
MuonPatternRecoDumper::dumpMuonId
std::string dumpMuonId(const DetId &id) const
Definition: MuonPatternRecoDumper.cc:66
BoundDisk.h
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
ME0DetId.h
RPCDetId
Definition: RPCDetId.h:16
MuonPatternRecoDumper::~MuonPatternRecoDumper
virtual ~MuonPatternRecoDumper()
Destructor.
Definition: MuonPatternRecoDumper.cc:26
GlobalTrajectoryParameters::charge
TrackCharge charge() const
Definition: GlobalTrajectoryParameters.h:72
Surface
Definition: Surface.h:36
MuonPatternRecoDumper::dumpLayer
std::string dumpLayer(const DetLayer *layer) const
Definition: MuonPatternRecoDumper.cc:30
BoundCylinder.h
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
BoundDisk
CSCDetId.h
DetId
Definition: DetId.h:17
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
DTWireId
Definition: DTWireId.h:12
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
RPCDetId.h
GEMDetId
Definition: GEMDetId.h:17
CSCDetId
Definition: CSCDetId.h:26
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
MuonPatternRecoDumper::dumpTSOS
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
Definition: MuonPatternRecoDumper.cc:56
ME0DetId
Definition: ME0DetId.h:16
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
MuonPatternRecoDumper::MuonPatternRecoDumper
MuonPatternRecoDumper()
Constructor.
Definition: MuonPatternRecoDumper.cc:23
MuonSubdetId.h
GEMDetId.h
std
Definition: JetResolutionObject.h:76
DTWireId.h
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
DetLayer.h
BoundCylinder
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
MuonPatternRecoDumper::dumpFTS
std::string dumpFTS(const FreeTrajectoryState &fts) const
Definition: MuonPatternRecoDumper.cc:46