43 const MuonDetLayerGeometry* muonLayout,
bool enableRPC,
bool enableCSC,
bool enableGEM,
bool enableME0)
44 : theMuonDetLayerGeometry(muonLayout) {
49 vector<const DetLayer*>
barrel;
55 for (
auto i = barrel.begin();
i != barrel.end();
i++) {
58 throw cms::Exception(
"MuonNavigationSchool",
"Bad BarrelDetLayer");
63 vector<const DetLayer*>
endcap;
64 if (enableCSC & enableGEM & enableRPC & enableME0)
66 else if (enableCSC & enableGEM & !enableRPC & !enableME0)
68 else if (!enableCSC & enableGEM & !enableRPC & !enableME0)
70 else if (enableCSC & !enableGEM & !enableRPC & !enableME0)
72 else if (enableCSC & !enableGEM & !enableRPC & enableME0)
74 else if (!enableCSC & !enableGEM & !enableRPC & enableME0)
81 for (
auto i = endcap.begin();
i != endcap.end();
i++) {
84 throw cms::Exception(
"MuonNavigationSchool",
"Bad ForwardDetLayer");
108 vector<MuonBarrelNavigableLayer*>::const_iterator
ib;
109 vector<MuonForwardNavigableLayer*>::const_iterator ie;
112 result.push_back(*ib);
116 result.push_back(*ie);
120 result.push_back(*ie);
129 float radius = bc.radius();
130 float length = bc.bounds().length() / 2.;
133 float eta_min = -eta_max;
141 float outRadius = bd.outerRadius();
142 float inRadius = bd.innerRadius();
143 float thick = bd.bounds().length() / 2.;
144 float z = bd.position().z();
160 return -
log((
tan(atan(r / z) / 2.)));
161 return log(-(
tan(atan(r / z) / 2.)));
175 outerBarrel.insert(*plusOne);
179 allOuterBarrel.insert(*iMBI);
182 MapE allOuterBackward;
184 if ((*el).second.isCompatible(range)) {
185 allOuterBackward.insert(*el);
191 if ((*el).second.isCompatible(range)) {
192 outerBackward.insert(*el);
198 MapE allOuterForward;
200 if ((*el).second.isCompatible(range)) {
201 allOuterForward.insert(*el);
208 if ((*el).second.isCompatible(range)) {
209 outerForward.insert(*el);
215 (*bl).first, outerBarrel, outerBackward, outerForward, allOuterBarrel, allOuterBackward, allOuterForward));
220 for (
MapEI el = layers.begin(); el != layers.end(); el++) {
226 if (plusOne != layers.end() && (*plusOne).second.isCompatible(range)) {
227 outerLayers.insert(*plusOne);
228 if (!range.
isInside((*plusOne).second)) {
230 MapEI tmpel(plusOne);
233 for (
MapEI l = tmpel;
l != layers.end();
l++) {
238 outerLayers.insert(*
l);
245 for (
MapEI iMEI = plusOne; iMEI != layers.end(); iMEI++) {
246 if ((*iMEI).second.isCompatible(range))
247 allOuterLayers.insert(*iMEI);
262 typedef map<const DetLayer*, MapB, less<const DetLayer*> > BarrelMapType;
263 typedef map<const DetLayer*, MapE, less<const DetLayer*> > ForwardMapType;
266 BarrelMapType reachedBarrelLayersMap;
267 ForwardMapType reachedForwardLayersMap;
270 BarrelMapType compatibleBarrelLayersMap;
271 ForwardMapType compatibleForwardLayersMap;
279 for (
MapBI i = reacheableB.begin();
i != reacheableB.end();
i++) {
280 reachedBarrelLayersMap[(*i).first].insert(*bli);
283 for (
MapBI i = compatibleB.begin();
i != compatibleB.end();
i++) {
284 compatibleBarrelLayersMap[(*i).first].insert(*bli);
287 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++) {
288 reachedBarrelLayersMap[(*i).first].insert(*bli);
291 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++) {
292 reachedBarrelLayersMap[(*i).first].insert(*bli);
295 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++) {
296 compatibleBarrelLayersMap[(*i).first].insert(*bli);
299 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++) {
300 compatibleBarrelLayersMap[(*i).first].insert(*bli);
308 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++) {
309 reachedForwardLayersMap[(*i).first].insert(*eli);
313 ->getAllOuterEndcapLayers();
314 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++) {
315 compatibleForwardLayersMap[(*i).first].insert(*eli);
323 for (
MapEI i = reacheableE.begin();
i != reacheableE.end();
i++) {
324 reachedForwardLayersMap[(*i).first].insert(*eli);
328 ->getAllOuterEndcapLayers();
329 for (
MapEI i = compatibleE.begin();
i != compatibleE.end();
i++) {
330 compatibleForwardLayersMap[(*i).first].insert(*eli);
346 mfnl->
setInwardLinks(reachedBarrelLayersMap[(*eli).first], reachedForwardLayersMap[(*eli).first]);
355 mfnl->
setInwardLinks(reachedBarrelLayersMap[(*eli).first], reachedForwardLayersMap[(*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
static std::vector< std::string > checklist log
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
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
const uint16_t range(const Frame &aFrame)
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
void addBarrelLayer(const BarrelDetLayer *)
add barrel layer
bool isInside(float eta, float error=0.) const
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
~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.
virtual const BoundDisk & specificSurface() const final
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)