CMS 3D CMS Logo

GeometricSearchTracker.cc
Go to the documentation of this file.
3 
5 
6 using namespace std;
7 
8 GeometricSearchTracker::GeometricSearchTracker(const vector<BarrelDetLayer const*>& pxlBar,
9  const vector<BarrelDetLayer const*>& tib,
10  const vector<BarrelDetLayer const*>& tob,
11  const vector<ForwardDetLayer const*>& negPxlFwd,
12  const vector<ForwardDetLayer const*>& negTid,
13  const vector<ForwardDetLayer const*>& negTec,
14  const vector<ForwardDetLayer const*>& posPxlFwd,
15  const vector<ForwardDetLayer const*>& posTid,
16  const vector<ForwardDetLayer const*>& posTec,
17  const TrackerTopology *tTopo):
18  thePixelBarrelLayers(pxlBar.begin(),pxlBar.end()),
19  theTibLayers(tib.begin(),tib.end()),
20  theTobLayers(tob.begin(),tob.end()),
21  theNegPixelForwardLayers(negPxlFwd.begin(),negPxlFwd.end()),
22  theNegTidLayers(negTid.begin(),negTid.end()),
23  theNegTecLayers(negTec.begin(),negTec.end()),
24  thePosPixelForwardLayers(posPxlFwd.begin(),posPxlFwd.end()),
25  thePosTidLayers(posTid.begin(),posTid.end()),
26  thePosTecLayers(posTec.begin(),posTec.end()),
27  theTrkTopo(tTopo)
28 {
30  theBarrelLayers.insert(theBarrelLayers.end(),theTibLayers.begin(),theTibLayers.end());
31  theBarrelLayers.insert(theBarrelLayers.end(),theTobLayers.begin(),theTobLayers.end());
32 
36 
40 
41 
44  theAllLayers.assign(theBarrelLayers.begin(),theBarrelLayers.end());
45  theAllLayers.insert(theAllLayers.end(),
46  theForwardLayers.begin(),
47  theForwardLayers.end());
48 
49  // number the layers
50  int sq=0;
51  for (auto l : theAllLayers)
52  const_cast<DetLayer&>(*l).setSeqNum(sq++);
53 
54  edm::LogInfo("TkDetLayers")
55  << "------ GeometricSearchTracker constructed with: ------" << "\n"
56  << "n pxlBarLayers: " << this->pixelBarrelLayers().size() << "\n"
57  << "n tibLayers: " << this->tibLayers().size() << "\n"
58  << "n tobLayers: " << this->tobLayers().size() << "\n"
59  << "n negPxlFwdLayers: " << this->negPixelForwardLayers().size() << "\n"
60  << "n posPxlFwdLayers: " << this->posPixelForwardLayers().size() << "\n"
61  << "n negTidLayers: " << this->negTidLayers().size() << "\n"
62  << "n posTidLayers: " << this->posTidLayers().size() << "\n"
63  << "n negTecLayers: " << this->negTecLayers().size() << "\n"
64  << "n posTecLayers: " << this->posTecLayers().size() << "\n"
65 
66  << "n barreLayers: " << this->barrelLayers().size() << "\n"
67  << "n negforwardLayers: " << this->negForwardLayers().size() << "\n"
68  << "n posForwardLayers: " << this->posForwardLayers().size()
69  << "\nn Total : " << theAllLayers.size() << " " << sq
70  << std::endl;
71 
72  for (auto l : theAllLayers)
73  edm::LogInfo("TkDetLayers") << (*l).seqNum()<< ": " << (*l).subDetector() << ", ";
74  edm::LogInfo("TkDetLayers") << std::endl;
75 
76 }
77 
78 
80  for (auto l : theAllLayers)
81  delete const_cast<DetLayer*>(l);
82 
83 }
84 
85 
88 
89 const DetLayer*
91 {
92  switch(id.subdetId()) {
94  return theTibLayers[theTrkTopo->tibLayer(id)-1];
95  break;
96 
98  return theTobLayers[theTrkTopo->tobLayer(id)-1];
99  break;
100 
102  if(theTrkTopo->tidSide(id) ==1 ) {
103  return theNegTidLayers[theTrkTopo->tidWheel(id)-1];
104  }else if( theTrkTopo->tidSide(id) == 2 ) {
105  return thePosTidLayers[theTrkTopo->tidWheel(id)-1];
106  }
107  break;
108 
110  if(theTrkTopo->tecSide(id) ==1 ) {
111  return theNegTecLayers[theTrkTopo->tecWheel(id)-1];
112  }else if( theTrkTopo->tecSide(id) == 2 ) {
113  return thePosTecLayers[theTrkTopo->tecWheel(id)-1];
114  }
115  break;
116 
119  break;
120 
122  if(theTrkTopo->pxfSide(id) ==1 ) {
124  }else if( theTrkTopo->pxfSide(id)==2 ) {
126  }
127  break;
128 
129  default:
130  edm::LogError("TkDetLayers") << "ERROR:layer not found!" ;
131  // throw(something);
132  }
133  return nullptr; //just to avoid compile warnings
134 }
std::vector< BarrelDetLayer const * > theBarrelLayers
std::vector< ForwardDetLayer const * > theNegTidLayers
std::vector< ForwardDetLayer const * > theForwardLayers
unsigned int tibLayer(const DetId &id) const
void setSeqNum(int sq)
Definition: DetLayer.h:37
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
unsigned int pxfDisk(const DetId &id) const
std::vector< ForwardDetLayer const * > thePosTidLayers
unsigned int tidWheel(const DetId &id) const
std::vector< BarrelDetLayer const * > const & tobLayers() const
std::vector< DetLayer const * > theAllLayers
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
unsigned int tidSide(const DetId &id) const
std::vector< ForwardDetLayer const * > thePosPixelForwardLayers
std::vector< BarrelDetLayer const * > thePixelBarrelLayers
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
std::vector< BarrelDetLayer const * > theTibLayers
GeometricSearchTracker(const std::vector< BarrelDetLayer const * > &pxlBar, const std::vector< BarrelDetLayer const * > &tib, const std::vector< BarrelDetLayer const * > &tob, const std::vector< ForwardDetLayer const * > &negPxlFwd, const std::vector< ForwardDetLayer const * > &negTid, const std::vector< ForwardDetLayer const * > &negTec, const std::vector< ForwardDetLayer const * > &posPxlFwd, const std::vector< ForwardDetLayer const * > &posTid, const std::vector< ForwardDetLayer const * > &posTec, const TrackerTopology *tTopo) __attribute__((cold))
#define end
Definition: vmac.h:39
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
std::vector< ForwardDetLayer const * > theNegForwardLayers
std::vector< ForwardDetLayer const * > thePosTecLayers
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
std::vector< BarrelDetLayer const * > const & tibLayers() const
~GeometricSearchTracker() override __attribute__((cold))
std::vector< ForwardDetLayer const * > const & posTecLayers() const
std::vector< ForwardDetLayer const * > const & negTidLayers() const
const TrackerTopology * theTrkTopo
std::vector< ForwardDetLayer const * > const & posTidLayers() const
#define begin
Definition: vmac.h:32
std::vector< ForwardDetLayer const * > theNegPixelForwardLayers
unsigned int pxfSide(const DetId &id) const
const DetLayer * idToLayer(const DetId &detId) const override
Give the DetId of a module, returns the pointer to the corresponding DetLayer.
std::vector< ForwardDetLayer const * > const & negTecLayers() const
unsigned int tecWheel(const DetId &id) const
std::vector< BarrelDetLayer const * > theTobLayers
unsigned int tobLayer(const DetId &id) const
std::vector< BarrelDetLayer const * > const & barrelLayers() const
std::vector< ForwardDetLayer const * > theNegTecLayers
unsigned int tecSide(const DetId &id) const
std::vector< ForwardDetLayer const * > thePosForwardLayers