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, bool enableME0=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

Cesare Calabria: GEMs implementation.

David Nash: ME0s implementation

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. David Nash: ME0s implementation.

Definition at line 33 of file MuonNavigationPrinter.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file MuonNavigationPrinter.cc.

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

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

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

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

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

Referenced by printLayer().

167  {
168 
169  for ( vector<const DetLayer*>::const_iterator inext = nextLayers.begin();
170  inext != nextLayers.end(); inext++ ) {
171 
172  PRINT("MuonNavigationPrinter") << " --> " << std::endl;
173  if ( (*inext)->location() == GeomDetEnumerators::barrel ) {
174  const BarrelDetLayer* l = dynamic_cast<const BarrelDetLayer*>(&(**inext));
175  PRINT("MuonNavigationPrinter") << (*inext)->location() << " "
176  << (*inext)->subDetector()
177  << " layer at R: "
178  << setiosflags(ios::showpoint | ios::fixed)
179  << setw(8) << setprecision(2)
180  << l->specificSurface().radius() << " " << std::endl;
181  }
182  else {
183  const ForwardDetLayer* l = dynamic_cast<const ForwardDetLayer*>(&(**inext));
184  PRINT("MuonNavigationPrinter") << (*inext)->location() << " "
185  << (*inext)->subDetector()
186  << " layer at z: "
187  << setiosflags(ios::showpoint | ios::fixed)
188  << setw(8) << setprecision(2)
189  << l->surface().position().z() << " " << std::endl;
190  }
191  PRINT("MuonNavigationPrinter") << setiosflags(ios::showpoint | ios::fixed)
192  << setprecision(1)
193  << setw(6) << (*inext)->surface().bounds().length() << ", "
194  << setw(6) << (*inext)->surface().bounds().width() << ", "
195  << setw(4) <<(*inext)->surface().bounds().thickness() << " : "
196  << (*inext)->surface().position() << std::endl;
197  }
198 
199 }
#define PRINT(x)
T z() const
Definition: PV3DBase.h:64
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
virtual const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
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 48 of file MuonNavigationPrinter.h.

Referenced by printLayer().