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