CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonNavigationPrinter.cc
Go to the documentation of this file.
1 
17 
24 
26 
27 #include <iostream>
28 #include <iomanip>
29 using namespace std;
30 
32 
33  edm::LogInfo ("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" ;
34  vector<DetLayer*>::const_iterator iter;
35  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
36  edm::LogInfo ("MuonNavigationPrinter")<< "BARREL:";
37  vector<DetLayer*> barrel;
38  if ( enableRPC ) barrel = muonLayout->allBarrelLayers();
39  else barrel = muonLayout->allDTLayers();
40 
41  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Barrel DetLayers";
42  for ( iter = barrel.begin(); iter != barrel.end(); iter++ ) printLayer(*iter);
43  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
44  edm::LogInfo ("MuonNavigationPrinter") << "BACKWARD:";
45 
46  vector<DetLayer*> backward;
47  if ( enableRPC ) backward = muonLayout->allBackwardLayers();
48  else backward = muonLayout->backwardCSCLayers();
49 
50  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Backward DetLayers";
51  for ( iter = backward.begin(); iter != backward.end(); iter++ ) printLayer(*iter);
52  edm::LogInfo ("MuonNavigationPrinter") << "==============================";
53  edm::LogInfo ("MuonNavigationPrinter") << "FORWARD:";
54  vector<DetLayer*> forward;
55  if ( enableRPC ) forward = muonLayout->allForwardLayers();
56  else forward = muonLayout->forwardCSCLayers();
57 
58  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Forward DetLayers";
59  for ( iter = forward.begin(); iter != forward.end(); iter++ ) printLayer(*iter);
60 
61 }
62 
64 
65  edm::LogInfo ("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" ;
66  vector<DetLayer*>::const_iterator iter;
67 // vector<BarrelDetLayer*>::const_iterator tkiter;
68 // vector<ForwardDetLayer*>::const_iterator tkfiter;
69  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
70  edm::LogInfo ("MuonNavigationPrinter")<< "BARREL:";
71  vector<BarrelDetLayer*> tkbarrel = tracker->barrelLayers();
72  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkbarrel.size()<<" Tk Barrel DetLayers";
73 // for ( tkiter = tkbarrel.begin(); tkiter != tkbarrel.end(); tkiter++ ) printLayer(*tkiter);
74  vector<DetLayer*> barrel = muonLayout->allBarrelLayers();
75  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Mu Barrel DetLayers";
76  for ( iter = barrel.begin(); iter != barrel.end(); iter++ ) printLayer(*iter);
77  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
78  edm::LogInfo ("MuonNavigationPrinter") << "BACKWARD:";
79  vector<ForwardDetLayer*> tkbackward = tracker->negForwardLayers();
80  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkbackward.size()<<" Tk Backward DetLayers";
82  vector<DetLayer*> backward = muonLayout->allBackwardLayers();
83  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Mu Backward DetLayers";
84  for ( iter = backward.begin(); iter != backward.end(); iter++ ) printLayer(*iter);
85  edm::LogInfo ("MuonNavigationPrinter") << "==============================";
86  edm::LogInfo ("MuonNavigationPrinter") << "FORWARD:";
87  vector<ForwardDetLayer*> tkforward = tracker->posForwardLayers();
88  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkforward.size()<<" Tk Forward DetLayers";
89 // for ( tkfiter = tkforward.begin(); tkfiter != tkforward.end(); tkfiter++ ) printLayer(*tkfiter);
90 
91  vector<DetLayer*> forward = muonLayout->allForwardLayers();
92  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Mu Forward DetLayers";
93  for ( iter = forward.begin(); iter != forward.end(); iter++ ) printLayer(*iter);
94 
95 }
96 
99  vector<const DetLayer*> nextLayers = layer->nextLayers(insideOut);
100  vector<const DetLayer*> compatibleLayers = layer->compatibleLayers(insideOut);
101  if (BarrelDetLayer* bdl = dynamic_cast<BarrelDetLayer*>(layer)) {
102  edm::LogInfo ("MuonNavigationPrinter")
103  << layer->location() << " " << layer->subDetector() << " layer at R: "
104  << setiosflags(ios::showpoint | ios::fixed)
105  << setw(8) << setprecision(2)
106  << bdl->specificSurface().radius() << " length: "
107  << setw(6) << setprecision(2)
108  << layer->surface().bounds().length();
109 
110  }
111  else if (ForwardDetLayer* fdl = dynamic_cast<ForwardDetLayer*>(layer)) {
112  edm::LogInfo ("MuonNavigationPrinter") << endl
113  << layer->location() << " " << layer->subDetector() << "layer at z: "
114  << setiosflags(ios::showpoint | ios::fixed)
115  << setw(8) << setprecision(2)
116  << layer->surface().position().z() << " inner r: "
117  << setw(6) << setprecision(2)
118  << fdl->specificSurface().innerRadius() << " outer r: "
119  << setw(6) << setprecision(2)
120  << fdl->specificSurface().outerRadius();
121  }
122  edm::LogInfo ("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction inside-out: ";
123  printLayers(nextLayers);
124 
125  nextLayers.clear();
126  nextLayers = layer->nextLayers(outsideIn);
127 
128  edm::LogInfo ("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction outside-in: ";
129  printLayers(nextLayers);
130 
131  edm::LogInfo ("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction inside-out:: ";
132  printLayers(compatibleLayers);
133  compatibleLayers.clear();
134  compatibleLayers = layer->compatibleLayers(outsideIn);
135 
136  edm::LogInfo ("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction outside-in: ";
137  printLayers(compatibleLayers);
138 
139 }
140 
142 void MuonNavigationPrinter::printLayers(const vector<const DetLayer*>& nextLayers) const {
143 
144  for ( vector<const DetLayer*>::const_iterator inext = nextLayers.begin();
145  inext != nextLayers.end(); inext++ ) {
146 
147  edm::LogInfo ("MuonNavigationPrinter") << " --> ";
148  if ( (*inext)->location() == GeomDetEnumerators::barrel ) {
149  const BarrelDetLayer* l = dynamic_cast<const BarrelDetLayer*>(&(**inext));
150  edm::LogInfo ("MuonNavigationPrinter") << (*inext)->location() << " "
151  << (*inext)->subDetector()
152  << " layer at R: "
153  << setiosflags(ios::showpoint | ios::fixed)
154  << setw(8) << setprecision(2)
155  << l->specificSurface().radius() << " ";
156  }
157  else {
158  const ForwardDetLayer* l = dynamic_cast<const ForwardDetLayer*>(&(**inext));
159  edm::LogInfo ("MuonNavigationPrinter") << (*inext)->location() << " "
160  << (*inext)->subDetector()
161  << " layer at z: "
162  << setiosflags(ios::showpoint | ios::fixed)
163  << setw(8) << setprecision(2)
164  << l->surface().position().z() << " ";
165  }
166  edm::LogInfo ("MuonNavigationPrinter") << setiosflags(ios::showpoint | ios::fixed)
167  << setprecision(1)
168  << setw(6) << (*inext)->surface().bounds().length() << ", "
169  << setw(6) << (*inext)->surface().bounds().width() << ", "
170  << setw(4) <<(*inext)->surface().bounds().thickness() << " : "
171  << (*inext)->surface().position();
172  }
173 
174 }
175 
176 
178 
179 // /// determine whether the layer is forward or backward
180 // string MuonNavigationPrinter::layerPart(const DetLayer* layer) const {
181 
182 // string result = "unknown";
183 
184 // if ( layer->part() == barrel ) return "barrel";
185 // if ( layer->part() == forward && layer->surface().position().z() < 0 ) {
186 // result = "backward";
187 // }
188 // if ( layer->part() == forward && layer->surface().position().z() >= 0 ) {
189 // result = "forward";
190 // }
191 
192 // return result;
193 
194 // }
195 
196 // /// determine the module (pixel, sililcon, msgc, dt, csc, rpc)
197 // string MuonNavigationPrinter::layerModule(const DetLayer* layer) const {
198 
199 // string result = "unknown";
200 
201 // GeomDetEnumerators::SubDetector det = layer->subDetector();
202 
203 // if ( det == Pixel ) return "Pixel";
204 // if ( det == TIB || det == TOB
205 // || det == TID || det == TEC ) return "silicon";
206 // if ( det == DT ) return "DT";
207 // if ( det == CSC ) return "CSC";
208 // if ( det == RPC ) return "RPC";
209 
210 // return result;
211 
212 // }
213 
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
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 printLayers(const std::vector< const DetLayer * > &) const
print next layers
void printLayer(DetLayer *) const
print layer
std::vector< BarrelDetLayer * > const & barrelLayers() const
MuonNavigationPrinter(const MuonDetLayerGeometry *, bool enableRPC=true)
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
T z() const
Definition: PV3DBase.h:64
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 * > & 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 PositionType & position() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
std::vector< const DetLayer * > nextLayers(Args &&...args) const
Definition: DetLayer.h:60
const std::vector< DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out