CMS 3D CMS Logo

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

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(), mps_fire::i, PRINT, and printLayer().

50  : school(&sh) {
51  PRINT("MuonNavigationPrinter") << "MuonNavigationPrinter::MuonNavigationPrinter" << std::endl;
52  PRINT("MuonNavigationPrinter") << "================================" << std::endl;
53  PRINT("MuonNavigationPrinter") << "BARREL:" << std::endl;
54  vector<const DetLayer*> barrel;
55  if (enableRPC)
56  barrel = muonLayout->allBarrelLayers();
57  else
58  barrel = muonLayout->allDTLayers();
59 
60  PRINT("MuonNavigationPrinter") << "There are " << barrel.size() << " Barrel DetLayers";
61  for (auto i : barrel)
62  printLayer(i);
63  PRINT("MuonNavigationPrinter") << "================================" << std::endl;
64  PRINT("MuonNavigationPrinter") << "BACKWARD:" << std::endl;
65 
66  vector<const DetLayer*> backward;
67 
68  if (enableCSC & enableGEM & enableRPC & enableME0)
69  backward = muonLayout->allBackwardLayers();
70  else if (enableCSC & enableGEM & !enableRPC & !enableME0)
71  backward = muonLayout->allCscGemBackwardLayers(); // CSC + GEM
72  else if (!enableCSC & enableGEM & !enableRPC & !enableME0)
73  backward = muonLayout->backwardGEMLayers(); //GEM only
74  else if (enableCSC & !enableGEM & !enableRPC & !enableME0)
75  backward = muonLayout->backwardCSCLayers(); //CSC only
76  else if (enableCSC & !enableGEM & !enableRPC & enableME0)
77  backward = muonLayout->allCscME0BackwardLayers(); //CSC + ME0
78  else if (!enableCSC & !enableGEM & !enableRPC & enableME0)
79  backward = muonLayout->backwardME0Layers(); //ME0 only
80  else
81  backward = muonLayout->allBackwardLayers();
82 
83  PRINT("MuonNavigationPrinter") << "There are " << backward.size() << " Backward DetLayers";
84  for (auto i : backward)
85  printLayer(i);
86  PRINT("MuonNavigationPrinter") << "==============================" << std::endl;
87  PRINT("MuonNavigationPrinter") << "FORWARD:" << std::endl;
88  vector<const DetLayer*> forward;
89 
90  if (enableCSC & enableGEM & enableRPC & enableME0)
91  forward = muonLayout->allForwardLayers();
92  else if (enableCSC & enableGEM & !enableRPC & !enableME0)
93  forward = muonLayout->allCscGemForwardLayers(); // CSC + GEM
94  else if (!enableCSC & enableGEM & !enableRPC & !enableME0)
95  forward = muonLayout->forwardGEMLayers(); //GEM only
96  else if (enableCSC & !enableGEM & !enableRPC & !enableME0)
97  forward = muonLayout->forwardCSCLayers(); //CSC only
98  else if (enableCSC & !enableGEM & !enableRPC & enableME0)
99  forward = muonLayout->allCscME0ForwardLayers(); //CSC + ME0
100  else if (!enableCSC & !enableGEM & !enableRPC & enableME0)
101  forward = muonLayout->forwardME0Layers(); //ME0 only
102  else
103  forward = muonLayout->allForwardLayers();
104 
105  PRINT("MuonNavigationPrinter") << "There are " << forward.size() << " Forward DetLayers" << std::endl;
106  for (auto i : forward)
107  printLayer(i);
108 }
const std::vector< const DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC+GEM+ME0), inside-out
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
const std::vector< const DetLayer * > & allCscGemForwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
const std::vector< const DetLayer * > & backwardME0Layers() const
return the backward (-Z) ME0 DetLayers, inside-out
const std::vector< const DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC+GEM+ME0), inside-out
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
const std::vector< const DetLayer * > & forwardME0Layers() const
return the forward (+Z) ME0 DetLayers, inside-out
MuonNavigationSchool const * school
return detector part (barrel, forward, backward)
#define PRINT(x)
const std::vector< const DetLayer * > & forwardGEMLayers() const
return the forward (+Z) GEM DetLayers, inside-out
const std::vector< const DetLayer * > & allCscGemBackwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
void printLayer(const DetLayer *) const
print layer
const std::vector< const DetLayer * > & backwardGEMLayers() const
return the backward (-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 * > & allCscME0BackwardLayers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
const std::vector< const DetLayer * > & allCscME0ForwardLayers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z

◆ MuonNavigationPrinter() [2/2]

MuonNavigationPrinter::MuonNavigationPrinter ( const MuonDetLayerGeometry muonLayout,
MuonNavigationSchool const &  sh,
const GeometricSearchTracker tracker 
)

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

Definition at line 110 of file MuonNavigationPrinter.cc.

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

113  : school(&sh) {
114  PRINT("MuonNavigationPrinter") << "MuonNavigationPrinter::MuonNavigationPrinter" << std::endl;
115  // vector<BarrelDetLayer*>::const_iterator tkiter;
116  // vector<ForwardDetLayer*>::const_iterator tkfiter;
117  PRINT("MuonNavigationPrinter") << "================================" << std::endl;
118  PRINT("MuonNavigationPrinter") << "BARREL:" << std::endl;
119  const vector<const BarrelDetLayer*>& tkbarrel = tracker->barrelLayers();
120  PRINT("MuonNavigationPrinter") << "There are " << tkbarrel.size() << " Tk Barrel DetLayers" << std::endl;
121  // for ( tkiter = tkbarrel.begin(); tkiter != tkbarrel.end(); tkiter++ ) printLayer(*tkiter);
122  vector<const DetLayer*> barrel = muonLayout->allBarrelLayers();
123  PRINT("MuonNavigationPrinter") << "There are " << barrel.size() << " Mu Barrel DetLayers";
124  for (auto i : barrel)
125  printLayer(i);
126  PRINT("MuonNavigationPrinter") << "================================" << std::endl;
127  PRINT("MuonNavigationPrinter") << "BACKWARD:" << std::endl;
128  const vector<const ForwardDetLayer*>& tkbackward = tracker->negForwardLayers();
129  PRINT("MuonNavigationPrinter") << "There are " << tkbackward.size() << " Tk Backward DetLayers" << std::endl;
131  vector<const DetLayer*> backward = muonLayout->allBackwardLayers();
132  PRINT("MuonNavigationPrinter") << "There are " << backward.size() << " Mu Backward DetLayers << std::endl";
133  for (auto i : backward)
134  printLayer(i);
135  PRINT("MuonNavigationPrinter") << "==============================" << std::endl;
136  PRINT("MuonNavigationPrinter") << "FORWARD:" << std::endl;
137  const vector<const ForwardDetLayer*>& tkforward = tracker->posForwardLayers();
138  PRINT("MuonNavigationPrinter") << "There are " << tkforward.size() << " Tk Forward DetLayers" << std::endl;
139  // for ( tkfiter = tkforward.begin(); tkfiter != tkforward.end(); tkfiter++ ) printLayer(*tkfiter);
140 
141  vector<const DetLayer*> forward = muonLayout->allForwardLayers();
142  PRINT("MuonNavigationPrinter") << "There are " << forward.size() << " Mu Forward DetLayers";
143  for (auto i : forward)
144  printLayer(i);
145 }
const std::vector< const DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC+GEM+ME0), inside-out
const std::vector< const DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC+GEM+ME0), inside-out
MuonNavigationSchool const * school
return detector part (barrel, forward, backward)
#define PRINT(x)
void printLayer(const DetLayer *) const
print layer
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out

Member Function Documentation

◆ printLayer()

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

print layer

Definition at line 148 of file MuonNavigationPrinter.cc.

References NavigationSchool::compatibleLayers(), alignBH_cfg::fixed, insideOut, nano_mu_digi_cff::layer, NavigationSchool::nextLayers(), outsideIn, PRINT, printLayers(), and school.

Referenced by MuonNavigationPrinter().

148  {
149  vector<const DetLayer*> nextLayers = school->nextLayers(*layer, insideOut);
150  vector<const DetLayer*> compatibleLayers = school->compatibleLayers(*layer, insideOut);
151  if (const BarrelDetLayer* bdl = dynamic_cast<const BarrelDetLayer*>(layer)) {
152  PRINT("MuonNavigationPrinter") << layer->location() << " " << layer->subDetector()
153  << " layer at R: " << setiosflags(ios::showpoint | ios::fixed) << setw(8)
154  << setprecision(2) << bdl->specificSurface().radius() << " length: " << setw(6)
155  << setprecision(2) << layer->surface().bounds().length() << std::endl;
156 
157  } else if (const ForwardDetLayer* fdl = dynamic_cast<const ForwardDetLayer*>(layer)) {
158  PRINT("MuonNavigationPrinter") << endl
159  << layer->location() << " " << layer->subDetector()
160  << "layer at z: " << setiosflags(ios::showpoint | ios::fixed) << setw(8)
161  << setprecision(2) << layer->surface().position().z() << " inner r: " << setw(6)
162  << setprecision(2) << fdl->specificSurface().innerRadius()
163  << " outer r: " << setw(6) << setprecision(2)
164  << fdl->specificSurface().outerRadius() << std::endl;
165  }
166  PRINT("MuonNavigationPrinter") << " has " << nextLayers.size()
167  << " next layers in the direction inside-out: " << std::endl;
168  printLayers(nextLayers);
169 
170  nextLayers.clear();
171  nextLayers = school->nextLayers(*layer, outsideIn);
172 
173  PRINT("MuonNavigationPrinter") << " has " << nextLayers.size()
174  << " next layers in the direction outside-in: " << std::endl;
175  printLayers(nextLayers);
176 
177  PRINT("MuonNavigationPrinter") << " has " << compatibleLayers.size()
178  << " compatible layers in the direction inside-out:: " << std::endl;
179  printLayers(compatibleLayers);
180  compatibleLayers.clear();
181  compatibleLayers = school->compatibleLayers(*layer, outsideIn);
182 
183  PRINT("MuonNavigationPrinter") << " has " << compatibleLayers.size()
184  << " compatible layers in the direction outside-in: " << std::endl;
185  printLayers(compatibleLayers);
186 }
MuonNavigationSchool const * school
return detector part (barrel, forward, backward)
#define PRINT(x)
std::vector< const DetLayer * > compatibleLayers(const DetLayer &detLayer, Args &&... args) const
Returns all layers compatible.
void printLayers(const std::vector< const DetLayer *> &) const
print next layers
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const

◆ printLayers()

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

print next layers

Definition at line 189 of file MuonNavigationPrinter.cc.

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

Referenced by printLayer().

189  {
190  for (vector<const DetLayer*>::const_iterator inext = nextLayers.begin(); inext != nextLayers.end(); inext++) {
191  PRINT("MuonNavigationPrinter") << " --> " << std::endl;
192  if ((*inext)->location() == GeomDetEnumerators::barrel) {
193  const BarrelDetLayer* l = dynamic_cast<const BarrelDetLayer*>(&(**inext));
194  PRINT("MuonNavigationPrinter") << (*inext)->location() << " " << (*inext)->subDetector()
195  << " layer at R: " << setiosflags(ios::showpoint | ios::fixed) << setw(8)
196  << setprecision(2) << l->specificSurface().radius() << " " << std::endl;
197  } else {
198  const ForwardDetLayer* l = dynamic_cast<const ForwardDetLayer*>(&(**inext));
199  PRINT("MuonNavigationPrinter") << (*inext)->location() << " " << (*inext)->subDetector()
200  << " layer at z: " << setiosflags(ios::showpoint | ios::fixed) << setw(8)
201  << setprecision(2) << l->surface().position().z() << " " << std::endl;
202  }
203  PRINT("MuonNavigationPrinter") << setiosflags(ios::showpoint | ios::fixed) << setprecision(1) << setw(6)
204  << (*inext)->surface().bounds().length() << ", " << setw(6)
205  << (*inext)->surface().bounds().width() << ", " << setw(4)
206  << (*inext)->surface().bounds().thickness() << " : "
207  << (*inext)->surface().position() << std::endl;
208  }
209 }
#define PRINT(x)

Member Data Documentation

◆ school

MuonNavigationSchool const* MuonNavigationPrinter::school = nullptr
private

return detector part (barrel, forward, backward)

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

Definition at line 51 of file MuonNavigationPrinter.h.

Referenced by printLayer().