50 vector<const DetLayer*>
barrel;
54 for (
auto i = barrel.begin();
i != barrel.end();
i++ ) {
56 if ( mbp ==
nullptr )
throw cms::Exception(
"MuonNavigationSchool",
"Bad BarrelDetLayer");
62 vector<const DetLayer*>
endcap;
63 if ( enableCSC & enableGEM & enableRPC & enableME0) endcap = muonLayout->
allEndcapLayers();
64 else if ( enableCSC & enableGEM & !enableRPC & !enableME0) endcap = muonLayout->
allEndcapCscGemLayers();
65 else if ( !enableCSC & enableGEM & !enableRPC & !enableME0) endcap = muonLayout->
allGEMLayers();
66 else if ( enableCSC & !enableGEM & !enableRPC & !enableME0) endcap = muonLayout->
allCSCLayers();
67 else if ( enableCSC & !enableGEM & !enableRPC & enableME0) endcap = muonLayout->
allEndcapCscME0Layers();
68 else if ( !enableCSC & !enableGEM & !enableRPC & enableME0) endcap = muonLayout->
allME0Layers();
73 for (
auto i = endcap.begin();
i != endcap.end();
i++ ) {
75 if ( mep ==
nullptr )
throw cms::Exception(
"MuonNavigationSchool",
"Bad ForwardDetLayer");
106 vector<MuonBarrelNavigableLayer*>::const_iterator
ib;
107 vector<MuonForwardNavigableLayer*>::const_iterator ie;
110 result.push_back(*ib);
114 result.push_back(*ie);
118 result.push_back(*ie);
130 float radius = bc.radius();
131 float length = bc.bounds().length()/2.;
145 float outRadius = bd.outerRadius();
146 float inRadius = bd.innerRadius();
147 float thick = bd.bounds().length()/2.;
148 float z = bd.position().z();
166 if ( z > 0 )
return -
log((
tan(atan(r/z)/2.)));
167 return log(-(
tan(atan(r/z)/2.)));
184 if ( plusOne !=
theBarrelLayers.end() ) { outerBarrel.insert(*plusOne);}
187 allOuterBarrel.insert(*iMBI);
190 MapE allOuterBackward;
193 if ( (*el).second.isCompatible(range) ) {
194 allOuterBackward.insert(*el);
201 if ( (*el).second.isCompatible(range) ) {
202 outerBackward.insert(*el);
208 MapE allOuterForward;
211 if ( (*el).second.isCompatible(range) ) {
212 allOuterForward.insert(*el);
220 if ( (*el).second.isCompatible(range) ) {
221 outerForward.insert(*el);
227 (*bl).first,outerBarrel, outerBackward, outerForward,
228 allOuterBarrel,allOuterBackward,allOuterForward));
235 vector<MuonForwardNavigableLayer*>&
result) {
237 for (
MapEI el = layers.begin(); el != layers.end(); el++) {
244 if ( plusOne != layers.end() && (*plusOne).second.isCompatible(range) ) {
245 outerLayers.insert(*plusOne);
246 if ( !range.
isInside((*plusOne).second) ) {
248 MapEI tmpel(plusOne);
251 for (
MapEI l = tmpel;
l != layers.end();
l++ ) {
256 outerLayers.insert(*
l);
263 for (
MapEI iMEI = plusOne; iMEI!=layers.end(); iMEI++){
264 if ((*iMEI).second.isCompatible(range)) allOuterLayers.insert(*iMEI);
268 (*el).first,outerLayers, allOuterLayers));
284 typedef map<const DetLayer*, MapB, less<const DetLayer*> > BarrelMapType;
285 typedef map<const DetLayer*, MapE, less<const DetLayer*> > ForwardMapType;
288 BarrelMapType reachedBarrelLayersMap;
289 ForwardMapType reachedForwardLayersMap;
292 BarrelMapType compatibleBarrelLayersMap;
293 ForwardMapType compatibleForwardLayersMap;
302 for (
MapBI i = reacheableB.begin();
i != reacheableB.end();
i++ ) {
303 reachedBarrelLayersMap[(*i).first].insert(*bli);
306 for (
MapBI i = compatibleB.begin();
i != compatibleB.end();
i++ ) {
307 compatibleBarrelLayersMap[(*i).first].insert(*bli);
310 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
311 reachedBarrelLayersMap[(*i).first].insert(*bli);
314 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
315 reachedBarrelLayersMap[(*i).first].insert(*bli);
318 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
319 compatibleBarrelLayersMap[(*i).first].insert(*bli);
322 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
323 compatibleBarrelLayersMap[(*i).first].insert(*bli);
333 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
334 reachedForwardLayersMap[(*i).first].insert(*eli);
339 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
340 compatibleForwardLayersMap[(*i).first].insert(*eli);
349 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
350 reachedForwardLayersMap[(*i).first].insert(*eli);
355 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
356 compatibleForwardLayersMap[(*i).first].insert(*eli);
376 reachedForwardLayersMap[(*eli).first]);
379 compatibleForwardLayersMap[(*eli).first]);
388 reachedForwardLayersMap[(*eli).first]);
391 compatibleForwardLayersMap[(*eli).first]);
void createInverseLinks()
establish inward links
const std::vector< const DetLayer * > & allEndcapCscME0Layers() const
return all endcap DetLayers (CSC+ME0), -Z to +Z
StateType navigableLayers() override
return navigable layers, from base class
std::vector< MuonForwardNavigableLayer * > theForwardNLC
MapB getOuterBarrelLayers() const
MapE getAllOuterForwardLayers() const
MuonEtaRange add(const MuonEtaRange &) const
create maximum of ranges
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
MapE theBackwardLayers
+z endcap
const std::vector< const DetLayer * > & allEndcapLayers() const
return all endcap DetLayers (CSC+RPC+GEM+ME0), -Z to +Z
void addEndcapLayer(const ForwardDetLayer *)
add endcap layer (backward and forward)
MapB::const_iterator MapBI
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
std::map< const BarrelDetLayer *, MuonEtaRange, MuonDetLayerComp > MapB
const std::vector< const DetLayer * > & allCSCLayers() const
return the CSC DetLayers (endcap), -Z to +Z
MapB getAllOuterBarrelLayers() const
void setInwardLinks(const MapB &, const MapE &)
set inward links
MapE getAllOuterBackwardLayers() const
void setInwardCompatibleLinks(const MapB &)
std::vector< MuonForwardNavigableLayer * > theBackwardNLC
float calculateEta(const float &, const float &) const
calculate pseudorapidity from r and z
MapE::const_iterator MapEI
std::vector< MuonBarrelNavigableLayer * > theBarrelNLC
-z endcap
StateType theAllNavigableLayer
Tan< T >::type tan(const T &t)
void linkBarrelLayers()
link barrel layers
MapE getOuterBackwardLayers() const
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel DetLayers (DT+RPC), inside-out
std::vector< NavigableLayer * > StateType
const std::vector< const DetLayer * > * theAllDetLayersInSystem
const std::vector< const DetLayer * > & allME0Layers() const
return the ME0 DetLayers (endcap), -Z to +Z
std::map< const ForwardDetLayer *, MuonEtaRange, MuonDetLayerComp > MapE
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
MapE getOuterForwardLayers() const
virtual const BoundDisk & specificSurface() const final
void addBarrelLayer(const BarrelDetLayer *)
add barrel layer
bool isInside(float eta, float error=0.) const
~MuonNavigationSchool() override
Destructor.
void linkEndcapLayers(const MapE &, std::vector< MuonForwardNavigableLayer * > &)
link endcap layers
bool isCompatible(const MuonEtaRange &range) const
true if this overlaps with range
void setInwardLinks(const MapB &)
set inward links
void setInwardCompatibleLinks(const MapB &, const MapE &)
const std::vector< const DetLayer * > & allGEMLayers() const
return the GEM DetLayers (endcap), -Z to +Z
MuonNavigationSchool(const MuonDetLayerGeometry *, bool enableRPC=true, bool enableCSC=true, bool enableGEM=false, bool enableME0=false)
Constructor.
const std::vector< const DetLayer * > & allLayers() const
return all layers (DT+CSC+RPC+GEM), order: backward, barrel, forward
MuonEtaRange subtract(const MuonEtaRange &) const
create new range of size this minus range
MapE theForwardLayers
barrel
const std::vector< const DetLayer * > & allEndcapCscGemLayers() const
return all endcap DetLayers (CSC+GEM), -Z to +Z
void setState(const StateType &state)