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

const MTDNavigationSchoolschool = 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() [1/2]

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

Definition at line 34 of file MTDNavigationPrinter.cc.

38  : school(&sh) {
39  PRINT("MTDNavigationPrinter") << "MTDNavigationPrinter::MTDNavigationPrinter" << std::endl;
40  PRINT("MTDNavigationPrinter") << "================================" << std::endl;
41  PRINT("MTDNavigationPrinter") << "BARREL:" << std::endl;
42  vector<const DetLayer*> barrel;
43  if (enableBTL)
44  barrel = mtdLayout->allBarrelLayers();
45  else
46  barrel = mtdLayout->allBarrelLayers();
47 
48  PRINT("MTDNavigationPrinter") << "There are " << barrel.size() << " Barrel DetLayers";
49  for (auto i : barrel)
50  printLayer(i);
51  PRINT("MTDNavigationPrinter") << "================================" << std::endl;
52  PRINT("MTDNavigationPrinter") << "BACKWARD:" << std::endl;
53 
54  vector<const DetLayer*> backward;
55 
56  if (enableETL)
57  backward = mtdLayout->allBackwardLayers();
58  else
59  backward = mtdLayout->allBackwardLayers();
60 
61  PRINT("MTDNavigationPrinter") << "There are " << backward.size() << " Backward DetLayers";
62  for (auto i : backward)
63  printLayer(i);
64  PRINT("MTDNavigationPrinter") << "==============================" << std::endl;
65  PRINT("MTDNavigationPrinter") << "FORWARD:" << std::endl;
66  vector<const DetLayer*> forward;
67 
68  if (enableETL)
69  forward = mtdLayout->allForwardLayers();
70  else
71  forward = mtdLayout->allForwardLayers();
72 
73  PRINT("MTDNavigationPrinter") << "There are " << forward.size() << " Forward DetLayers" << std::endl;
74  for (auto i : forward)
75  printLayer(i);
76 }

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

◆ MTDNavigationPrinter() [2/2]

MTDNavigationPrinter::MTDNavigationPrinter ( const MTDDetLayerGeometry mtdLayout,
MTDNavigationSchool const &  sh,
const GeometricSearchTracker tracker 
)

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

Definition at line 78 of file MTDNavigationPrinter.cc.

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

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

Member Function Documentation

◆ printLayer()

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

print layer

Definition at line 116 of file MTDNavigationPrinter.cc.

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

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().

◆ printLayers()

void MTDNavigationPrinter::printLayers ( const std::vector< const DetLayer * > &  nextLayers) const
private

print next layers

Definition at line 156 of file MTDNavigationPrinter.cc.

156  {
157  for (vector<const DetLayer*>::const_iterator inext = nextLayers.begin(); inext != nextLayers.end(); inext++) {
158  PRINT("MTDNavigationPrinter") << " --> " << std::endl;
159  if ((*inext)->location() == GeomDetEnumerators::barrel) {
160  const BarrelDetLayer* l = dynamic_cast<const BarrelDetLayer*>(&(**inext));
161  PRINT("MTDNavigationPrinter") << (*inext)->location() << " " << (*inext)->subDetector()
162  << " layer at R: " << setiosflags(ios::showpoint | ios::fixed) << setw(8)
163  << setprecision(2) << l->specificSurface().radius() << " " << std::endl;
164  } else {
165  const ForwardDetLayer* l = dynamic_cast<const ForwardDetLayer*>(&(**inext));
166  PRINT("MTDNavigationPrinter") << (*inext)->location() << " " << (*inext)->subDetector()
167  << " layer at z: " << setiosflags(ios::showpoint | ios::fixed) << setw(8)
168  << setprecision(2) << l->surface().position().z() << " " << std::endl;
169  }
170  PRINT("MTDNavigationPrinter") << setiosflags(ios::showpoint | ios::fixed) << setprecision(1) << setw(6)
171  << (*inext)->surface().bounds().length() << ", " << setw(6)
172  << (*inext)->surface().bounds().width() << ", " << setw(4)
173  << (*inext)->surface().bounds().thickness() << " : " << (*inext)->surface().position()
174  << std::endl;
175  }
176 }

References GeomDetEnumerators::barrel, alignBH_cfg::fixed, cmsLHEtoEOSManager::l, and PRINT.

Referenced by printLayer().

Member Data Documentation

◆ school

const MTDNavigationSchool* MTDNavigationPrinter::school = nullptr
private

return detector part (barrel, forward, backward)

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

Definition at line 38 of file MTDNavigationPrinter.h.

Referenced by printLayer().

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:428
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
DetLayer::subDetector
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
MTDNavigationPrinter::printLayer
void printLayer(const DetLayer *) const
print layer
Definition: MTDNavigationPrinter.cc:116
MTDNavigationPrinter::school
const MTDNavigationSchool * school
return detector part (barrel, forward, backward)
Definition: MTDNavigationPrinter.h:38
Bounds::length
virtual float length() const =0
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GeomDetEnumerators::barrel
Definition: GeomDetEnumerators.h:9
DetLayer::location
virtual Location location() const =0
Which part of the detector (barrel, endcap)
MTDDetLayerGeometry::allBarrelLayers
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel layers
Definition: MTDDetLayerGeometry.cc:62
NavigationSchool::nextLayers
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const
Definition: NavigationSchool.h:33
MTDNavigationPrinter::printLayers
void printLayers(const std::vector< const DetLayer * > &) const
print next layers
Definition: MTDNavigationPrinter.cc:156
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
PRINT
#define PRINT(x)
Definition: MTDNavigationPrinter.cc:31
NavigationSchool::compatibleLayers
std::vector< const DetLayer * > compatibleLayers(const DetLayer &detLayer, Args &&... args) const
Returns all layers compatible.
Definition: NavigationSchool.h:41
BarrelDetLayer
Definition: BarrelDetLayer.h:22
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
MTDDetLayerGeometry::allBackwardLayers
const std::vector< const DetLayer * > & allBackwardLayers() const
return all endcap layers
Definition: MTDDetLayerGeometry.cc:68
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
outsideIn
Definition: NavigationDirection.h:4
ForwardDetLayer
Definition: ForwardDetLayer.h:22
MTDDetLayerGeometry::allForwardLayers
const std::vector< const DetLayer * > & allForwardLayers() const
return all endcap layers
Definition: MTDDetLayerGeometry.cc:66
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
insideOut
Definition: NavigationDirection.h:4