CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
MuonNavigationPrinter Class Reference

#include <MuonNavigationPrinter.h>

Public Member Functions

 MuonNavigationPrinter (const MuonDetLayerGeometry *, bool enableRPC=true)
 
 MuonNavigationPrinter (const MuonDetLayerGeometry *, const GeometricSearchTracker *)
 

Private Member Functions

void printLayer (DetLayer *) const
 print layer More...
 
void printLayers (const std::vector< const DetLayer * > &) const
 print next layers More...
 

Detailed Description

Description: class to print the MuonNavigationSchool

Date:
2013/05/28 16:39:22
Revision:
1.8
Author
: Stefano Lacaprara - INFN Padova stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t

Modification:

Chang Liu: The class prints nextLayers and compatibleLayers Add new constructor for MuonTkNavigationSchool

Description: class to print the MuonNavigationSchool

Date:
2013/05/28 16:39:22
Revision:
1.11
Author
: Stefano Lacaprara - INFN Padova stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t

Modification:

Chang Liu: add compatibleLayers add constructor for MuonTkNavigation

Definition at line 28 of file MuonNavigationPrinter.h.

Constructor & Destructor Documentation

MuonNavigationPrinter::MuonNavigationPrinter ( const MuonDetLayerGeometry muonLayout,
bool  enableRPC = true 
)

Definition at line 33 of file MuonNavigationPrinter.cc.

References MuonDetLayerGeometry::allBackwardLayers(), MuonDetLayerGeometry::allBarrelLayers(), MuonDetLayerGeometry::allDTLayers(), MuonDetLayerGeometry::allForwardLayers(), MuonDetLayerGeometry::backwardCSCLayers(), Reference_intrackfit_cff::barrel, and MuonDetLayerGeometry::forwardCSCLayers().

33  {
34 
35  edm::LogInfo ("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" ;
36  vector<DetLayer*>::const_iterator iter;
37  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
38  edm::LogInfo ("MuonNavigationPrinter")<< "BARREL:";
39  vector<DetLayer*> barrel;
40  if ( enableRPC ) barrel = muonLayout->allBarrelLayers();
41  else barrel = muonLayout->allDTLayers();
42 
43  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Barrel DetLayers";
44  for ( iter = barrel.begin(); iter != barrel.end(); iter++ ) printLayer(*iter);
45  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
46  edm::LogInfo ("MuonNavigationPrinter") << "BACKWARD:";
47 
48  vector<DetLayer*> backward;
49  if ( enableRPC ) backward = muonLayout->allBackwardLayers();
50  else backward = muonLayout->backwardCSCLayers();
51 
52  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Backward DetLayers";
53  for ( iter = backward.begin(); iter != backward.end(); iter++ ) printLayer(*iter);
54  edm::LogInfo ("MuonNavigationPrinter") << "==============================";
55  edm::LogInfo ("MuonNavigationPrinter") << "FORWARD:";
56  vector<DetLayer*> forward;
57  if ( enableRPC ) forward = muonLayout->allForwardLayers();
58  else forward = muonLayout->forwardCSCLayers();
59 
60  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Forward DetLayers";
61  for ( iter = forward.begin(); iter != forward.end(); iter++ ) printLayer(*iter);
62 
63 }
const std::vector< DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC), inside-out
const std::vector< DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
void printLayer(DetLayer *) const
print layer
const std::vector< DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC), inside-out
const std::vector< DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
const std::vector< DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
const std::vector< DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
MuonNavigationPrinter::MuonNavigationPrinter ( const MuonDetLayerGeometry muonLayout,
const GeometricSearchTracker tracker 
)

for ( tkfiter = tkbackward.begin(); tkfiter != tkbackward.end(); tkfiter++ ) printLayer(*tkfiter);

Definition at line 65 of file MuonNavigationPrinter.cc.

References MuonDetLayerGeometry::allBackwardLayers(), MuonDetLayerGeometry::allBarrelLayers(), MuonDetLayerGeometry::allForwardLayers(), Reference_intrackfit_cff::barrel, GeometricSearchTracker::barrelLayers(), GeometricSearchTracker::negForwardLayers(), and GeometricSearchTracker::posForwardLayers().

65  {
66 
67  edm::LogInfo ("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" ;
68  vector<DetLayer*>::const_iterator iter;
69 // vector<BarrelDetLayer*>::const_iterator tkiter;
70 // vector<ForwardDetLayer*>::const_iterator tkfiter;
71  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
72  edm::LogInfo ("MuonNavigationPrinter")<< "BARREL:";
73  vector<BarrelDetLayer*> tkbarrel = tracker->barrelLayers();
74  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkbarrel.size()<<" Tk Barrel DetLayers";
75 // for ( tkiter = tkbarrel.begin(); tkiter != tkbarrel.end(); tkiter++ ) printLayer(*tkiter);
76  vector<DetLayer*> barrel = muonLayout->allBarrelLayers();
77  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Mu Barrel DetLayers";
78  for ( iter = barrel.begin(); iter != barrel.end(); iter++ ) printLayer(*iter);
79  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
80  edm::LogInfo ("MuonNavigationPrinter") << "BACKWARD:";
81  vector<ForwardDetLayer*> tkbackward = tracker->negForwardLayers();
82  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkbackward.size()<<" Tk Backward DetLayers";
84  vector<DetLayer*> backward = muonLayout->allBackwardLayers();
85  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Mu Backward DetLayers";
86  for ( iter = backward.begin(); iter != backward.end(); iter++ ) printLayer(*iter);
87  edm::LogInfo ("MuonNavigationPrinter") << "==============================";
88  edm::LogInfo ("MuonNavigationPrinter") << "FORWARD:";
89  vector<ForwardDetLayer*> tkforward = tracker->posForwardLayers();
90  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkforward.size()<<" Tk Forward DetLayers";
91 // for ( tkfiter = tkforward.begin(); tkfiter != tkforward.end(); tkfiter++ ) printLayer(*tkfiter);
92 
93  vector<DetLayer*> forward = muonLayout->allForwardLayers();
94  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Mu Forward DetLayers";
95  for ( iter = forward.begin(); iter != forward.end(); iter++ ) printLayer(*iter);
96 
97 }
const std::vector< DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC), inside-out
void printLayer(DetLayer *) const
print layer
std::vector< BarrelDetLayer * > const & barrelLayers() const
std::vector< ForwardDetLayer * > const & negForwardLayers() const
const std::vector< DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC), inside-out
std::vector< ForwardDetLayer * > const & posForwardLayers() const
const std::vector< DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out

Member Function Documentation

void MuonNavigationPrinter::printLayer ( DetLayer layer) const
private

print layer

Definition at line 100 of file MuonNavigationPrinter.cc.

References Surface::bounds(), DetLayer::compatibleLayers(), insideOut, Bounds::length(), DetLayer::location(), DetLayer::nextLayers(), outsideIn, GloballyPositioned< T >::position(), DetLayer::subDetector(), GeometricSearchDet::surface(), and PV3DBase< T, PVType, FrameType >::z().

100  {
101  vector<const DetLayer*> nextLayers = layer->nextLayers(insideOut);
102  vector<const DetLayer*> compatibleLayers = layer->compatibleLayers(insideOut);
103  if (BarrelDetLayer* bdl = dynamic_cast<BarrelDetLayer*>(layer)) {
104  edm::LogInfo ("MuonNavigationPrinter")
105  << layer->location() << " " << layer->subDetector() << " layer at R: "
106  << setiosflags(ios::showpoint | ios::fixed)
107  << setw(8) << setprecision(2)
108  << bdl->specificSurface().radius() << " length: "
109  << setw(6) << setprecision(2)
110  << layer->surface().bounds().length();
111 
112  }
113  else if (ForwardDetLayer* fdl = dynamic_cast<ForwardDetLayer*>(layer)) {
114  edm::LogInfo ("MuonNavigationPrinter") << endl
115  << layer->location() << " " << layer->subDetector() << "layer at z: "
116  << setiosflags(ios::showpoint | ios::fixed)
117  << setw(8) << setprecision(2)
118  << layer->surface().position().z() << " inner r: "
119  << setw(6) << setprecision(2)
120  << fdl->specificSurface().innerRadius() << " outer r: "
121  << setw(6) << setprecision(2)
122  << fdl->specificSurface().outerRadius();
123  }
124  edm::LogInfo ("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction inside-out: ";
125  printLayers(nextLayers);
126 
127  nextLayers.clear();
128  nextLayers = layer->nextLayers(outsideIn);
129 
130  edm::LogInfo ("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction outside-in: ";
131  printLayers(nextLayers);
132 
133  edm::LogInfo ("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction inside-out:: ";
134  printLayers(compatibleLayers);
135  compatibleLayers.clear();
136  compatibleLayers = layer->compatibleLayers(outsideIn);
137 
138  edm::LogInfo ("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction outside-in: ";
139  printLayers(compatibleLayers);
140 
141 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual float length() const =0
std::vector< const DetLayer * > compatibleLayers(Args &&...args) const
Returns all layers compatible.
Definition: DetLayer.h:69
virtual Location location() const =0
Which part of the detector (barrel, endcap)
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
const Bounds & bounds() const
Definition: Surface.h:128
void printLayers(const std::vector< const DetLayer * > &) const
print next layers
T z() const
Definition: PV3DBase.h:64
const PositionType & position() const
std::vector< const DetLayer * > nextLayers(Args &&...args) const
Definition: DetLayer.h:60
void MuonNavigationPrinter::printLayers ( const std::vector< const DetLayer * > &  nextLayers) const
private

print next layers

Definition at line 144 of file MuonNavigationPrinter.cc.

References GeomDetEnumerators::barrel, prof2calltree::l, GloballyPositioned< T >::position(), BarrelDetLayer::specificSurface(), ForwardDetLayer::surface(), and PV3DBase< T, PVType, FrameType >::z().

144  {
145 
146  for ( vector<const DetLayer*>::const_iterator inext = nextLayers.begin();
147  inext != nextLayers.end(); inext++ ) {
148 
149  edm::LogInfo ("MuonNavigationPrinter") << " --> ";
150  if ( (*inext)->location() == GeomDetEnumerators::barrel ) {
151  const BarrelDetLayer* l = dynamic_cast<const BarrelDetLayer*>(&(**inext));
152  edm::LogInfo ("MuonNavigationPrinter") << (*inext)->location() << " "
153  << (*inext)->subDetector()
154  << " layer at R: "
155  << setiosflags(ios::showpoint | ios::fixed)
156  << setw(8) << setprecision(2)
157  << l->specificSurface().radius() << " ";
158  }
159  else {
160  const ForwardDetLayer* l = dynamic_cast<const ForwardDetLayer*>(&(**inext));
161  edm::LogInfo ("MuonNavigationPrinter") << (*inext)->location() << " "
162  << (*inext)->subDetector()
163  << " layer at z: "
164  << setiosflags(ios::showpoint | ios::fixed)
165  << setw(8) << setprecision(2)
166  << l->surface().position().z() << " ";
167  }
168  edm::LogInfo ("MuonNavigationPrinter") << setiosflags(ios::showpoint | ios::fixed)
169  << setprecision(1)
170  << setw(6) << (*inext)->surface().bounds().length() << ", "
171  << setw(6) << (*inext)->surface().bounds().width() << ", "
172  << setw(4) <<(*inext)->surface().bounds().thickness() << " : "
173  << (*inext)->surface().position();
174  }
175 
176 }
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
T z() const
Definition: PV3DBase.h:64
const PositionType & position() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.