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

const MuonNavigationSchoolschool = 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.

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 }

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

◆ 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.

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 }

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

Member Function Documentation

◆ printLayer()

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

print layer

Definition at line 148 of file MuonNavigationPrinter.cc.

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 }

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

◆ printLayers()

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

print next layers

Definition at line 189 of file MuonNavigationPrinter.cc.

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 }

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

Referenced by printLayer().

Member Data Documentation

◆ school

const MuonNavigationSchool* 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().

MuonDetLayerGeometry::allBarrelLayers
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
Definition: MuonDetLayerGeometry.cc:189
MuonDetLayerGeometry::backwardGEMLayers
const std::vector< const DetLayer * > & backwardGEMLayers() const
return the backward (-Z) GEM DetLayers, inside-out
Definition: MuonDetLayerGeometry.cc:163
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:355
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
MuonDetLayerGeometry::forwardGEMLayers
const std::vector< const DetLayer * > & forwardGEMLayers() const
return the forward (+Z) GEM DetLayers, inside-out
Definition: MuonDetLayerGeometry.cc:161
DetLayer::subDetector
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
MuonNavigationPrinter::printLayers
void printLayers(const std::vector< const DetLayer * > &) const
print next layers
Definition: MuonNavigationPrinter.cc:189
MuonDetLayerGeometry::backwardME0Layers
const std::vector< const DetLayer * > & backwardME0Layers() const
return the backward (-Z) ME0 DetLayers, inside-out
Definition: MuonDetLayerGeometry.cc:173
PRINT
#define PRINT(x)
Definition: MuonNavigationPrinter.cc:41
MuonDetLayerGeometry::allDTLayers
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
Definition: MuonDetLayerGeometry.cc:150
Bounds::length
virtual float length() const =0
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
MuonDetLayerGeometry::forwardME0Layers
const std::vector< const DetLayer * > & forwardME0Layers() const
return the forward (+Z) ME0 DetLayers, inside-out
Definition: MuonDetLayerGeometry.cc:171
MuonDetLayerGeometry::backwardCSCLayers
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
Definition: MuonDetLayerGeometry.cc:156
GeomDetEnumerators::barrel
Definition: GeomDetEnumerators.h:9
DetLayer::location
virtual Location location() const =0
Which part of the detector (barrel, endcap)
NavigationSchool::nextLayers
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const
Definition: NavigationSchool.h:33
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
MuonDetLayerGeometry::forwardCSCLayers
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
Definition: MuonDetLayerGeometry.cc:154
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
MuonDetLayerGeometry::allCscGemBackwardLayers
const std::vector< const DetLayer * > & allCscGemBackwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
Definition: MuonDetLayerGeometry.cc:203
MuonDetLayerGeometry::allForwardLayers
const std::vector< const DetLayer * > & allForwardLayers() const
return all forward (+Z) layers (CSC+RPC+GEM+ME0), inside-out
Definition: MuonDetLayerGeometry.cc:193
MuonNavigationPrinter::printLayer
void printLayer(const DetLayer *) const
print layer
Definition: MuonNavigationPrinter.cc:148
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:193
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
outsideIn
Definition: NavigationDirection.h:4
ForwardDetLayer
Definition: ForwardDetLayer.h:22
MuonDetLayerGeometry::allBackwardLayers
const std::vector< const DetLayer * > & allBackwardLayers() const
return all backward (-Z) layers (CSC+RPC+GEM+ME0), inside-out
Definition: MuonDetLayerGeometry.cc:195
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
MuonNavigationPrinter::school
const MuonNavigationSchool * school
return detector part (barrel, forward, backward)
Definition: MuonNavigationPrinter.h:51
insideOut
Definition: NavigationDirection.h:4
MuonDetLayerGeometry::allCscME0BackwardLayers
const std::vector< const DetLayer * > & allCscME0BackwardLayers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z
Definition: MuonDetLayerGeometry.cc:211
MuonDetLayerGeometry::allCscME0ForwardLayers
const std::vector< const DetLayer * > & allCscME0ForwardLayers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z
Definition: MuonDetLayerGeometry.cc:209
MuonDetLayerGeometry::allCscGemForwardLayers
const std::vector< const DetLayer * > & allCscGemForwardLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
Definition: MuonDetLayerGeometry.cc:201