CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonPatternRecoDumper.cc
Go to the documentation of this file.
1 
2 // This Class Header
4 
5 // Collaborating Class Header
10 
16 
17 #include <sstream>
18 
19 using namespace std;
20 
21 // Constructor
23 }
24 
25 // Destructor
27 }
28 
29 // Operations
30 
31 string MuonPatternRecoDumper::dumpLayer(const DetLayer* layer) const {
32  stringstream output;
33 
34  const BoundSurface* sur=0;
35  const BoundCylinder* bc=0;
36  const BoundDisk* bd=0;
37 
38  sur = &(layer->surface());
39  if ( (bc = dynamic_cast<const BoundCylinder*>(sur)) ) {
40  output << " Cylinder of radius: " << bc->radius() << endl;
41  }
42  else if ( (bd = dynamic_cast<const BoundDisk*>(sur)) ) {
43  output << " Disk at: " << bd->position().z() << endl;
44  }
45  return output.str();
46 }
47 
49  stringstream output;
50 
51  output <<
52  " pos: " << fts.position() <<
53  " radius: " << fts.position().perp() << endl <<
54  " charge*pt: " << fts.momentum().perp()*fts.parameters().charge() <<
55  " eta: " << fts.momentum().eta() <<
56  " phi: " << fts.momentum().phi() << endl;
57 
58  return output.str();
59 }
60 
62  stringstream output;
63 
64  output<<tsos<<endl;
65  output<<"dir: "<<tsos.globalDirection()<<endl;
66  output<<dumpFTS(*tsos.freeTrajectoryState());
67 
68  return output.str();
69 }
70 
71 string MuonPatternRecoDumper::dumpMuonId(const DetId &id) const{
72  stringstream output;
73 
74  if(id.subdetId() == MuonSubdetId::DT ){
75  DTWireId wireId(id.rawId());
76 
77  output<<"(DT): "<<wireId<<endl;
78  }
79  else if(id.subdetId() == MuonSubdetId::CSC){
80  CSCDetId chamberId(id.rawId());
81  output<<"(CSC): "<<chamberId<<endl;
82  }
83  else if(id.subdetId() == MuonSubdetId::GEM){
84  GEMDetId chamberId(id.rawId());
85  output<<"(GEM): "<<chamberId<<endl;
86  }
87  else if(id.subdetId() == MuonSubdetId::RPC){
88  RPCDetId chamberId(id.rawId());
89  output<<"(RPC): "<<chamberId<<endl;
90  }
91  else output<<"The DetLayer is not a valid Muon DetLayer. ";
92 
93  return output.str();
94 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
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 CSC
Definition: MuonSubdetId.h:13
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
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.