CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MTDNavigationPrinter Class Reference

#include <MTDNavigationPrinter.h>

Public Member Functions

 MTDNavigationPrinter (const MTDDetLayerGeometry *, MTDNavigationSchool const &, bool enableBTL=true, bool enableETL=true)
 
 MTDNavigationPrinter (const MTDDetLayerGeometry *, MTDNavigationSchool 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

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

Detailed Description

Description: class to print the MTDNavigationSchool

Author
: L. Gray - FNAL

Definition at line 22 of file MTDNavigationPrinter.h.

Constructor & Destructor Documentation

MTDNavigationPrinter::MTDNavigationPrinter ( const MTDDetLayerGeometry mtdLayout,
MTDNavigationSchool const &  sh,
bool  enableBTL = true,
bool  enableETL = true 
)

Definition at line 34 of file MTDNavigationPrinter.cc.

References MTDDetLayerGeometry::allBackwardLayers(), MTDDetLayerGeometry::allBarrelLayers(), MTDDetLayerGeometry::allForwardLayers(), Reference_intrackfit_cff::barrel, mps_fire::i, PRINT, and printLayer().

34  :
35  school(&sh) {
36 
37  PRINT("MTDNavigationPrinter")<< "MTDNavigationPrinter::MTDNavigationPrinter" << std::endl;
38  PRINT("MTDNavigationPrinter")<<"================================" << std::endl;
39  PRINT("MTDNavigationPrinter")<< "BARREL:" << std::endl;
40  vector<const DetLayer*> barrel;
41  if ( enableBTL ) barrel = mtdLayout->allBarrelLayers();
42  else barrel = mtdLayout->allBarrelLayers();
43 
44  PRINT("MTDNavigationPrinter")<<"There are "<<barrel.size()<<" Barrel DetLayers";
45  for (auto i: barrel ) printLayer(i);
46  PRINT("MTDNavigationPrinter")<<"================================" << std::endl;
47  PRINT("MTDNavigationPrinter") << "BACKWARD:" << std::endl;
48 
49  vector<const DetLayer*> backward;
50 
51  if ( enableETL ) backward = mtdLayout->allBackwardLayers();
52  else backward = mtdLayout->allBackwardLayers();
53 
54  PRINT("MTDNavigationPrinter")<<"There are "<<backward.size()<<" Backward DetLayers";
55  for (auto i : backward ) printLayer(i);
56  PRINT("MTDNavigationPrinter") << "==============================" << std::endl;
57  PRINT("MTDNavigationPrinter") << "FORWARD:" << std::endl;
58  vector<const DetLayer*> forward;
59 
60  if ( enableETL ) forward = mtdLayout->allForwardLayers();
61  else forward = mtdLayout->allForwardLayers();
62 
63  PRINT("MTDNavigationPrinter")<<"There are "<<forward.size()<<" Forward DetLayers" << std::endl;
64  for (auto i : forward ) printLayer(i);
65 
66 }
MTDNavigationSchool const * school
return detector part (barrel, forward, backward)
#define PRINT(x)
const std::vector< const DetLayer * > & allBackwardLayers() const
return all endcap layers
void printLayer(const DetLayer *) const
print layer
const std::vector< const DetLayer * > & allForwardLayers() const
return all endcap layers
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel layers
MTDNavigationPrinter::MTDNavigationPrinter ( const MTDDetLayerGeometry mtdLayout,
MTDNavigationSchool const &  sh,
const GeometricSearchTracker tracker 
)

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

Definition at line 68 of file MTDNavigationPrinter.cc.

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

68  :
69  school(&sh){
70 
71  PRINT("MTDNavigationPrinter")<< "MTDNavigationPrinter::MTDNavigationPrinter" << std::endl ;
72 // vector<BarrelDetLayer*>::const_iterator tkiter;
73 // vector<ForwardDetLayer*>::const_iterator tkfiter;
74  PRINT("MTDNavigationPrinter")<<"================================" << std::endl;
75  PRINT("MTDNavigationPrinter")<< "BARREL:" << std::endl;
76  const vector<const BarrelDetLayer*>& tkbarrel = tracker->barrelLayers();
77  PRINT("MTDNavigationPrinter")<<"There are "<<tkbarrel.size()<<" Tk Barrel DetLayers" << std::endl;
78 // for ( tkiter = tkbarrel.begin(); tkiter != tkbarrel.end(); tkiter++ ) printLayer(*tkiter);
79  vector<const DetLayer*> barrel = mtdLayout->allBarrelLayers();
80  PRINT("MTDNavigationPrinter")<<"There are "<<barrel.size()<<" Mu Barrel DetLayers";
81  for ( auto i : barrel ) printLayer(i);
82  PRINT("MTDNavigationPrinter")<<"================================" << std::endl;
83  PRINT("MTDNavigationPrinter") << "BACKWARD:" << std::endl;
84  const vector<const ForwardDetLayer*>& tkbackward = tracker->negForwardLayers();
85  PRINT("MTDNavigationPrinter")<<"There are "<<tkbackward.size()<<" Tk Backward DetLayers" << std::endl;
87  vector<const DetLayer*> backward = mtdLayout->allBackwardLayers();
88  PRINT("MTDNavigationPrinter")<<"There are "<<backward.size()<<" Mu Backward DetLayers << std::endl";
89  for (auto i : backward ) printLayer(i);
90  PRINT("MTDNavigationPrinter") << "==============================" << std::endl;
91  PRINT("MTDNavigationPrinter") << "FORWARD:" << std::endl;
92  const vector<const ForwardDetLayer*>& tkforward = tracker->posForwardLayers();
93  PRINT("MTDNavigationPrinter")<<"There are "<<tkforward.size()<<" Tk Forward DetLayers" << std::endl;
94 // for ( tkfiter = tkforward.begin(); tkfiter != tkforward.end(); tkfiter++ ) printLayer(*tkfiter);
95 
96  vector<const DetLayer*> forward = mtdLayout->allForwardLayers();
97  PRINT("MTDNavigationPrinter")<<"There are "<<forward.size()<<" Mu Forward DetLayers";
98  for ( auto i : forward ) printLayer(i);
99 
100 }
MTDNavigationSchool const * school
return detector part (barrel, forward, backward)
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
#define PRINT(x)
const std::vector< const DetLayer * > & allBackwardLayers() const
return all endcap layers
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
void printLayer(const DetLayer *) const
print layer
const std::vector< const DetLayer * > & allForwardLayers() const
return all endcap layers
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel layers
std::vector< BarrelDetLayer const * > const & barrelLayers() const

Member Function Documentation

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

print layer

Definition at line 103 of file MTDNavigationPrinter.cc.

References Surface::bounds(), NavigationSchool::compatibleLayers(), alignBH_cfg::fixed, 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 MTDNavigationPrinter().

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

print next layers

Definition at line 147 of file MTDNavigationPrinter.cc.

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

Referenced by printLayer().

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

Member Data Documentation

MTDNavigationSchool const* MTDNavigationPrinter::school =nullptr
private

return detector part (barrel, forward, backward)

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

Definition at line 37 of file MTDNavigationPrinter.h.

Referenced by printLayer().