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 }
static constexpr int GEM
Definition: MuonSubdetId.h:14
T perp() const
Definition: PV3DBase.h:69
std::string dumpLayer(const DetLayer *layer) const
const GlobalTrajectoryParameters & parameters() const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::string dumpMuonId(const DetId &id) const
std::string dumpFTS(const FreeTrajectoryState &fts) const
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
static constexpr int ME0
Definition: MuonSubdetId.h:15
GlobalVector momentum() const
Definition: DetId.h:17
GlobalPoint position() const
virtual ~MuonPatternRecoDumper()
Destructor.
static constexpr int RPC
Definition: MuonSubdetId.h:13
T eta() const
Definition: PV3DBase.h:73
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
GlobalVector globalDirection() const
MuonPatternRecoDumper()
Constructor.