49 vector<const DetLayer*>
barrel;
53 for (
auto i = barrel.begin();
i != barrel.end();
i++ ) {
55 if ( mbp == 0 )
throw cms::Exception(
"MuonNavigationSchool",
"Bad BarrelDetLayer");
60 vector<const DetLayer*>
endcap;
61 if ( enableCSC & enableGEM & enableRPC ) endcap = muonLayout->
allEndcapLayers();
63 else if ( !enableCSC & enableGEM & !enableRPC ) endcap = muonLayout->
allGEMLayers();
64 else if ( enableCSC & !enableGEM & !enableRPC ) endcap = muonLayout->
allCSCLayers();
67 for (
auto i = endcap.begin();
i != endcap.end();
i++ ) {
69 if ( mep == 0 )
throw cms::Exception(
"MuonNavigationSchool",
"Bad ForwardDetLayer");
100 vector<MuonBarrelNavigableLayer*>::const_iterator
ib;
101 vector<MuonForwardNavigableLayer*>::const_iterator ie;
104 result.push_back(*ib);
108 result.push_back(*ie);
112 result.push_back(*ie);
124 float radius = bc.radius();
125 float length = bc.bounds().length()/2.;
128 float eta_min = -eta_max;
139 float outRadius = bd.outerRadius();
140 float inRadius = bd.innerRadius();
141 float thick = bd.bounds().length()/2.;
142 float z = bd.position().z();
160 if ( z > 0 )
return -
log((
tan(atan(r/z)/2.)));
161 return log(-(
tan(atan(r/z)/2.)));
178 if ( plusOne !=
theBarrelLayers.end() ) { outerBarrel.insert(*plusOne);}
181 allOuterBarrel.insert(*iMBI);
184 MapE allOuterBackward;
187 if ( (*el).second.isCompatible(range) ) {
188 allOuterBackward.insert(*el);
195 if ( (*el).second.isCompatible(range) ) {
196 outerBackward.insert(*el);
202 MapE allOuterForward;
205 if ( (*el).second.isCompatible(range) ) {
206 allOuterForward.insert(*el);
214 if ( (*el).second.isCompatible(range) ) {
215 outerForward.insert(*el);
221 (*bl).first,outerBarrel, outerBackward, outerForward,
222 allOuterBarrel,allOuterBackward,allOuterForward));
229 vector<MuonForwardNavigableLayer*>&
result) {
231 for (
MapEI el = layers.begin(); el != layers.end(); el++) {
238 if ( plusOne != layers.end() && (*plusOne).second.isCompatible(range) ) {
239 outerLayers.insert(*plusOne);
240 if ( !range.
isInside((*plusOne).second) ) {
242 MapEI tmpel(plusOne);
245 for (
MapEI l = tmpel;
l != layers.end();
l++ ) {
250 outerLayers.insert(*
l);
257 for (
MapEI iMEI = plusOne; iMEI!=layers.end(); iMEI++){
258 if ((*iMEI).second.isCompatible(range)) allOuterLayers.insert(*iMEI);
262 (*el).first,outerLayers, allOuterLayers));
278 typedef map<const DetLayer*, MapB, less<const DetLayer*> > BarrelMapType;
279 typedef map<const DetLayer*, MapE, less<const DetLayer*> > ForwardMapType;
282 BarrelMapType reachedBarrelLayersMap;
283 ForwardMapType reachedForwardLayersMap;
286 BarrelMapType compatibleBarrelLayersMap;
287 ForwardMapType compatibleForwardLayersMap;
296 for (
MapBI i = reacheableB.begin();
i != reacheableB.end();
i++ ) {
297 reachedBarrelLayersMap[(*i).first].insert(*bli);
300 for (
MapBI i = compatibleB.begin();
i != compatibleB.end();
i++ ) {
301 compatibleBarrelLayersMap[(*i).first].insert(*bli);
304 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
305 reachedBarrelLayersMap[(*i).first].insert(*bli);
308 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
309 reachedBarrelLayersMap[(*i).first].insert(*bli);
312 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
313 compatibleBarrelLayersMap[(*i).first].insert(*bli);
316 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
317 compatibleBarrelLayersMap[(*i).first].insert(*bli);
327 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
328 reachedForwardLayersMap[(*i).first].insert(*eli);
333 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
334 compatibleForwardLayersMap[(*i).first].insert(*eli);
343 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++ ) {
344 reachedForwardLayersMap[(*i).first].insert(*eli);
349 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++ ) {
350 compatibleForwardLayersMap[(*i).first].insert(*eli);
370 reachedForwardLayersMap[(*eli).first]);
373 compatibleForwardLayersMap[(*eli).first]);
382 reachedForwardLayersMap[(*eli).first]);
385 compatibleForwardLayersMap[(*eli).first]);
void createInverseLinks()
establish inward links
virtual StateType navigableLayers() override
return navigable layers, from base class
std::vector< MuonForwardNavigableLayer * > theForwardNLC
MuonNavigationSchool(const MuonDetLayerGeometry *, bool enableRPC=true, bool enableCSC=true, bool enableGEM=false)
Constructor.
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), -Z to +Z
void addEndcapLayer(const ForwardDetLayer *)
add endcap layer (backward and forward)
MapB::const_iterator MapBI
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
virtual const BoundDisk & specificSurface() const
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
std::map< const ForwardDetLayer *, MuonEtaRange, MuonDetLayerComp > MapE
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
MapE getOuterForwardLayers() const
void addBarrelLayer(const BarrelDetLayer *)
add barrel layer
bool isInside(float eta, float error=0.) const
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
void linkEndcapLayers(const MapE &, std::vector< MuonForwardNavigableLayer * > &)
link endcap layers
~MuonNavigationSchool()
Destructor.
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
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)