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 
26 // Destructor
28 }
29 
30 // Operations
31 
32 string MuonPatternRecoDumper::dumpLayer(const DetLayer* layer) const {
33  stringstream output;
34 
35  const BoundSurface* sur=nullptr;
36  const BoundCylinder* bc=nullptr;
37  const BoundDisk* bd=nullptr;
38 
39  sur = &(layer->surface());
40  if ( (bc = dynamic_cast<const BoundCylinder*>(sur)) ) {
41  output << " Cylinder of radius: " << bc->radius() << endl;
42  }
43  else if ( (bd = dynamic_cast<const BoundDisk*>(sur)) ) {
44  output << " Disk at: " << bd->position().z() << endl;
45  }
46  return output.str();
47 }
48 
50  stringstream output;
51 
52  output <<
53  " pos: " << fts.position() <<
54  " radius: " << fts.position().perp() << endl <<
55  " charge*pt: " << fts.momentum().perp()*fts.parameters().charge() <<
56  " eta: " << fts.momentum().eta() <<
57  " phi: " << fts.momentum().phi() << endl;
58 
59  return output.str();
60 }
61 
63  stringstream output;
64 
65  output<<tsos<<endl;
66  output<<"dir: "<<tsos.globalDirection()<<endl;
67  output<<dumpFTS(*tsos.freeTrajectoryState());
68 
69  return output.str();
70 }
71 
72 string MuonPatternRecoDumper::dumpMuonId(const DetId &id) const{
73  stringstream output;
74 
75  if(id.subdetId() == MuonSubdetId::DT ){
76  DTWireId wireId(id.rawId());
77 
78  output<<"(DT): "<<wireId<<endl;
79  }
80  else if(id.subdetId() == MuonSubdetId::CSC){
81  CSCDetId chamberId(id.rawId());
82  output<<"(CSC): "<<chamberId<<endl;
83  }
84  else if(id.subdetId() == MuonSubdetId::GEM){
85  GEMDetId chamberId(id.rawId());
86  output<<"(GEM): "<<chamberId<<endl;
87  }
88  else if(id.subdetId() == MuonSubdetId::ME0){
89  ME0DetId chamberId(id.rawId());
90  output<<"(ME0): "<<chamberId<<endl;
91  }
92  else if(id.subdetId() == MuonSubdetId::RPC){
93  RPCDetId chamberId(id.rawId());
94  output<<"(RPC): "<<chamberId<<endl;
95  }
96  else output<<"The DetLayer is not a valid Muon DetLayer. ";
97 
98  return output.str();
99 }
T perp() const
Definition: PV3DBase.h:72
std::string dumpLayer(const DetLayer *layer) const
const GlobalTrajectoryParameters & parameters() const
static const int GEM
Definition: MuonSubdetId.h:15
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::string dumpMuonId(const DetId &id) const
std::string dumpFTS(const FreeTrajectoryState &fts) const
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
static const int ME0
Definition: MuonSubdetId.h:16
static const int CSC
Definition: MuonSubdetId.h:13
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
GlobalVector momentum() const
Definition: DetId.h:18
GlobalPoint position() const
virtual ~MuonPatternRecoDumper()
Destructor.
T eta() const
Definition: PV3DBase.h:76
static const int RPC
Definition: MuonSubdetId.h:14
static const int DT
Definition: MuonSubdetId.h:12
GlobalVector globalDirection() const
MuonPatternRecoDumper()
Constructor.