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, bool enableCSC=true, bool enableGEM=false)
 
 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

Cesare Calabria: GEMs implementation.

Definition at line 27 of file MuonNavigationPrinter.h.

Constructor & Destructor Documentation

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

Definition at line 42 of file MuonNavigationPrinter.cc.

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

42  :
43  school(&sh) {
44 
45  PRINT("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" << std::endl;
46  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
47  PRINT("MuonNavigationPrinter")<< "BARREL:" << std::endl;
48  vector<const DetLayer*> barrel;
49  if ( enableRPC ) barrel = muonLayout->allBarrelLayers();
50  else barrel = muonLayout->allDTLayers();
51 
52  PRINT("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Barrel DetLayers";
53  for (auto i: barrel ) printLayer(i);
54  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
55  PRINT("MuonNavigationPrinter") << "BACKWARD:" << std::endl;
56 
57  vector<const DetLayer*> backward;
58  if ( enableCSC & enableGEM & enableRPC ) backward = muonLayout->allBackwardLayers();
59  else if ( enableCSC & enableGEM & !enableRPC ) backward = muonLayout->allCscGemBackwardLayers(); // CSC + GEM
60  else if ( !enableCSC & enableGEM & !enableRPC ) backward = muonLayout->backwardGEMLayers(); //GEM only
61  else if ( enableCSC & !enableGEM & !enableRPC ) backward = muonLayout->backwardCSCLayers(); //CSC only
62  else backward = muonLayout->allBackwardLayers();
63 
64  PRINT("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Backward DetLayers";
65  for (auto i : backward ) printLayer(i);
66  PRINT("MuonNavigationPrinter") << "==============================" << std::endl;
67  PRINT("MuonNavigationPrinter") << "FORWARD:" << std::endl;
68  vector<const DetLayer*> forward;
69  if ( enableCSC & enableGEM & enableRPC ) forward = muonLayout->allForwardLayers();
70  else if ( enableCSC & enableGEM & !enableRPC ) forward = muonLayout->allCscGemForwardLayers(); // CSC + GEM
71  else if ( !enableCSC & enableGEM & !enableRPC ) forward = muonLayout->forwardGEMLayers(); //GEM only
72  else if ( enableCSC & !enableGEM & !enableRPC ) forward = muonLayout->forwardCSCLayers(); //CSC only
73  else forward = muonLayout->allForwardLayers();
74 
75  PRINT("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Forward DetLayers" << std::endl;
76  for (auto i : forward ) printLayer(i);
77 
78 }
int i
Definition: DBlmapReader.cc:9
const std::vector< const DetLayer * > & backwardGEMLayers() const
return the backward (-Z) GEM DetLayers, inside-out
const std::vector< const DetLayer * > & allCscGemBackwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
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+GEM), 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+GEM), inside-out
const std::vector< const DetLayer * > & forwardGEMLayers() const
return the forward (+Z) GEM DetLayers, inside-out
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
const std::vector< const DetLayer * > & allCscGemForwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
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 80 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().

80  :
81  school(&sh){
82 
83  PRINT("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" << std::endl ;
84 // vector<BarrelDetLayer*>::const_iterator tkiter;
85 // vector<ForwardDetLayer*>::const_iterator tkfiter;
86  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
87  PRINT("MuonNavigationPrinter")<< "BARREL:" << std::endl;
88  vector<const BarrelDetLayer*> tkbarrel = tracker->barrelLayers();
89  PRINT("MuonNavigationPrinter")<<"There are "<<tkbarrel.size()<<" Tk Barrel DetLayers" << std::endl;
90 // for ( tkiter = tkbarrel.begin(); tkiter != tkbarrel.end(); tkiter++ ) printLayer(*tkiter);
91  vector<const DetLayer*> barrel = muonLayout->allBarrelLayers();
92  PRINT("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Mu Barrel DetLayers";
93  for ( auto i : barrel ) printLayer(i);
94  PRINT("MuonNavigationPrinter")<<"================================" << std::endl;
95  PRINT("MuonNavigationPrinter") << "BACKWARD:" << std::endl;
96  vector<const ForwardDetLayer*> tkbackward = tracker->negForwardLayers();
97  PRINT("MuonNavigationPrinter")<<"There are "<<tkbackward.size()<<" Tk Backward DetLayers" << std::endl;
99  vector<const DetLayer*> backward = muonLayout->allBackwardLayers();
100  PRINT("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Mu Backward DetLayers << std::endl";
101  for (auto i : backward ) printLayer(i);
102  PRINT("MuonNavigationPrinter") << "==============================" << std::endl;
103  PRINT("MuonNavigationPrinter") << "FORWARD:" << std::endl;
104  vector<const ForwardDetLayer*> tkforward = tracker->posForwardLayers();
105  PRINT("MuonNavigationPrinter")<<"There are "<<tkforward.size()<<" Tk Forward DetLayers" << std::endl;
106 // for ( tkfiter = tkforward.begin(); tkfiter != tkforward.end(); tkfiter++ ) printLayer(*tkfiter);
107 
108  vector<const DetLayer*> forward = muonLayout->allForwardLayers();
109  PRINT("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Mu Forward DetLayers";
110  for ( auto i : forward ) printLayer(i);
111 
112 }
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+GEM), 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+GEM), 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 115 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().

115  {
116  vector<const DetLayer*> nextLayers = school->nextLayers(*layer,insideOut);
117  vector<const DetLayer*> compatibleLayers = school->compatibleLayers(*layer,insideOut);
118  if (const BarrelDetLayer* bdl = dynamic_cast<const BarrelDetLayer*>(layer)) {
119  PRINT("MuonNavigationPrinter")
120  << layer->location() << " " << layer->subDetector() << " layer at R: "
121  << setiosflags(ios::showpoint | ios::fixed)
122  << setw(8) << setprecision(2)
123  << bdl->specificSurface().radius() << " length: "
124  << setw(6) << setprecision(2)
125  << layer->surface().bounds().length() << std::endl;
126 
127  }
128  else if (const ForwardDetLayer* fdl = dynamic_cast<const ForwardDetLayer*>(layer)) {
129  PRINT("MuonNavigationPrinter") << endl
130  << layer->location() << " " << layer->subDetector() << "layer at z: "
131  << setiosflags(ios::showpoint | ios::fixed)
132  << setw(8) << setprecision(2)
133  << layer->surface().position().z() << " inner r: "
134  << setw(6) << setprecision(2)
135  << fdl->specificSurface().innerRadius() << " outer r: "
136  << setw(6) << setprecision(2)
137  << fdl->specificSurface().outerRadius() << std::endl;
138  }
139  PRINT("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction inside-out: " << std::endl;
140  printLayers(nextLayers);
141 
142  nextLayers.clear();
143  nextLayers = school->nextLayers(*layer,outsideIn);
144 
145  PRINT("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction outside-in: " << std::endl;
146  printLayers(nextLayers);
147 
148  PRINT("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction inside-out:: " << std::endl;
149  printLayers(compatibleLayers);
150  compatibleLayers.clear();
151  compatibleLayers = school->compatibleLayers(*layer,outsideIn);
152 
153  PRINT("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction outside-in: " << std::endl;
154  printLayers(compatibleLayers);
155 
156 }
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 159 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().

159  {
160 
161  for ( vector<const DetLayer*>::const_iterator inext = nextLayers.begin();
162  inext != nextLayers.end(); inext++ ) {
163 
164  PRINT("MuonNavigationPrinter") << " --> " << std::endl;
165  if ( (*inext)->location() == GeomDetEnumerators::barrel ) {
166  const BarrelDetLayer* l = dynamic_cast<const BarrelDetLayer*>(&(**inext));
167  PRINT("MuonNavigationPrinter") << (*inext)->location() << " "
168  << (*inext)->subDetector()
169  << " layer at R: "
170  << setiosflags(ios::showpoint | ios::fixed)
171  << setw(8) << setprecision(2)
172  << l->specificSurface().radius() << " " << std::endl;
173  }
174  else {
175  const ForwardDetLayer* l = dynamic_cast<const ForwardDetLayer*>(&(**inext));
176  PRINT("MuonNavigationPrinter") << (*inext)->location() << " "
177  << (*inext)->subDetector()
178  << " layer at z: "
179  << setiosflags(ios::showpoint | ios::fixed)
180  << setw(8) << setprecision(2)
181  << l->surface().position().z() << " " << std::endl;
182  }
183  PRINT("MuonNavigationPrinter") << setiosflags(ios::showpoint | ios::fixed)
184  << setprecision(1)
185  << setw(6) << (*inext)->surface().bounds().length() << ", "
186  << setw(6) << (*inext)->surface().bounds().width() << ", "
187  << setw(4) <<(*inext)->surface().bounds().thickness() << " : "
188  << (*inext)->surface().position() << std::endl;
189  }
190 
191 }
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 42 of file MuonNavigationPrinter.h.

Referenced by printLayer().