test
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 | Private Attributes
MuonNavigationPrinter Class Reference

#include <MuonNavigationPrinter.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

MuonNavigationSchool const * school =nullptr
 return detector part (barrel, forward, backward) More...
 

Detailed Description

Description: class to print the MuonNavigationSchool

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

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 27 of file MuonNavigationPrinter.h.

Constructor & Destructor Documentation

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

Definition at line 39 of file MuonNavigationPrinter.cc.

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

39  :
40  school(&sh) {
41 
42  PRINT("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" << std::endl;
43  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
44  PRINT("MuonNavigationPrinter")<< "BARREL:" << std::endl;
45  vector<const DetLayer*> barrel;
46  if ( enableRPC ) barrel = muonLayout->allBarrelLayers();
47  else barrel = muonLayout->allDTLayers();
48 
49  PRINT("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Barrel DetLayers";
50  for (auto i: barrel ) printLayer(i);
51  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
52  PRINT("MuonNavigationPrinter") << "BACKWARD:" << std::endl;
53 
54  vector<const DetLayer*> backward;
55  if ( enableRPC ) backward = muonLayout->allBackwardLayers();
56  else backward = muonLayout->backwardCSCLayers();
57 
58  PRINT("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Backward DetLayers";
59  for (auto i : backward ) printLayer(i);
60  PRINT("MuonNavigationPrinter") << "==============================" << std::endl;
61  PRINT("MuonNavigationPrinter") << "FORWARD:" << std::endl;
62  vector<const DetLayer*> forward;
63  if ( enableRPC ) forward = muonLayout->allForwardLayers();
64  else forward = muonLayout->forwardCSCLayers();
65 
66  PRINT("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Forward DetLayers" << std::endl;
67  for (auto i : forward ) printLayer(i);
68 
69 }
int i
Definition: DBlmapReader.cc:9
MuonNavigationSchool const * school
return detector part (barrel, forward, backward)
#define PRINT(x)
const std::vector< const DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC), inside-out
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
const std::vector< const DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC), inside-out
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
void printLayer(const DetLayer *) const
print layer
MuonNavigationPrinter::MuonNavigationPrinter ( const MuonDetLayerGeometry muonLayout,
MuonNavigationSchool const &  sh,
const GeometricSearchTracker tracker 
)

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

Definition at line 71 of file MuonNavigationPrinter.cc.

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

71  :
72  school(&sh){
73 
74  PRINT("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" << std::endl ;
75 // vector<BarrelDetLayer*>::const_iterator tkiter;
76 // vector<ForwardDetLayer*>::const_iterator tkfiter;
77  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
78  PRINT("MuonNavigationPrinter")<< "BARREL:" << std::endl;
79  vector<const BarrelDetLayer*> tkbarrel = tracker->barrelLayers();
80  PRINT("MuonNavigationPrinter")<<"There are "<<tkbarrel.size()<<" Tk Barrel DetLayers" << std::endl;
81 // for ( tkiter = tkbarrel.begin(); tkiter != tkbarrel.end(); tkiter++ ) printLayer(*tkiter);
82  vector<const DetLayer*> barrel = muonLayout->allBarrelLayers();
83  PRINT("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Mu Barrel DetLayers";
84  for ( auto i : barrel ) printLayer(i);
85  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
86  PRINT("MuonNavigationPrinter") << "BACKWARD:" << std::endl;
87  vector<const ForwardDetLayer*> tkbackward = tracker->negForwardLayers();
88  PRINT("MuonNavigationPrinter")<<"There are "<<tkbackward.size()<<" Tk Backward DetLayers" << std::endl;
90  vector<const DetLayer*> backward = muonLayout->allBackwardLayers();
91  PRINT("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Mu Backward DetLayers << std::endl";
92  for (auto i : backward ) printLayer(i);
93  PRINT("MuonNavigationPrinter") << "==============================" << std::endl;
94  PRINT("MuonNavigationPrinter") << "FORWARD:" << std::endl;
95  vector<const ForwardDetLayer*> tkforward = tracker->posForwardLayers();
96  PRINT("MuonNavigationPrinter")<<"There are "<<tkforward.size()<<" Tk Forward DetLayers" << std::endl;
97 // for ( tkfiter = tkforward.begin(); tkfiter != tkforward.end(); tkfiter++ ) printLayer(*tkfiter);
98 
99  vector<const DetLayer*> forward = muonLayout->allForwardLayers();
100  PRINT("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Mu Forward DetLayers";
101  for ( auto i : forward ) printLayer(i);
102 
103 }
int i
Definition: DBlmapReader.cc:9
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
MuonNavigationSchool const * school
return detector part (barrel, forward, backward)
#define PRINT(x)
const std::vector< const DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC), inside-out
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
const std::vector< const DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC), inside-out
void printLayer(const DetLayer *) const
print layer
std::vector< BarrelDetLayer const * > const & barrelLayers() const

Member Function Documentation

void MuonNavigationPrinter::printLayer ( const DetLayer layer) const
private

print layer

Definition at line 106 of file MuonNavigationPrinter.cc.

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

Referenced by MuonNavigationPrinter().

106  {
107  vector<const DetLayer*> nextLayers = school->nextLayers(*layer,insideOut);
108  vector<const DetLayer*> compatibleLayers = school->compatibleLayers(*layer,insideOut);
109  if (const BarrelDetLayer* bdl = dynamic_cast<const BarrelDetLayer*>(layer)) {
110  PRINT("MuonNavigationPrinter")
111  << layer->location() << " " << layer->subDetector() << " layer at R: "
112  << setiosflags(ios::showpoint | ios::fixed)
113  << setw(8) << setprecision(2)
114  << bdl->specificSurface().radius() << " length: "
115  << setw(6) << setprecision(2)
116  << layer->surface().bounds().length() << std::endl;
117 
118  }
119  else if (const ForwardDetLayer* fdl = dynamic_cast<const ForwardDetLayer*>(layer)) {
120  PRINT("MuonNavigationPrinter") << endl
121  << layer->location() << " " << layer->subDetector() << "layer at z: "
122  << setiosflags(ios::showpoint | ios::fixed)
123  << setw(8) << setprecision(2)
124  << layer->surface().position().z() << " inner r: "
125  << setw(6) << setprecision(2)
126  << fdl->specificSurface().innerRadius() << " outer r: "
127  << setw(6) << setprecision(2)
128  << fdl->specificSurface().outerRadius() << std::endl;
129  }
130  PRINT("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction inside-out: " << std::endl;
131  printLayers(nextLayers);
132 
133  nextLayers.clear();
134  nextLayers = school->nextLayers(*layer,outsideIn);
135 
136  PRINT("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction outside-in: " << std::endl;
137  printLayers(nextLayers);
138 
139  PRINT("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction inside-out:: " << std::endl;
140  printLayers(compatibleLayers);
141  compatibleLayers.clear();
142  compatibleLayers = school->compatibleLayers(*layer,outsideIn);
143 
144  PRINT("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction outside-in: " << std::endl;
145  printLayers(compatibleLayers);
146 
147 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual float length() const =0
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
MuonNavigationSchool const * school
return detector part (barrel, forward, backward)
#define PRINT(x)
T z() const
Definition: PV3DBase.h:64
std::vector< const DetLayer * > compatibleLayers(const DetLayer &detLayer, Args &&...args) const
Returns all layers compatible.
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
const PositionType & position() const
void MuonNavigationPrinter::printLayers ( const std::vector< const DetLayer * > &  nextLayers) const
private

print next layers

Definition at line 150 of file MuonNavigationPrinter.cc.

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

Referenced by printLayer().

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

Member Data Documentation

MuonNavigationSchool const* MuonNavigationPrinter::school =nullptr
private

return detector part (barrel, forward, backward)

return detector module (pixel, silicon, msgc, dt, csc, rpc)

Definition at line 41 of file MuonNavigationPrinter.h.

Referenced by printLayer().