test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GeometricSearchTracker.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 
6 GeometricSearchTracker::GeometricSearchTracker(const vector<BarrelDetLayer const*>& pxlBar,
7  const vector<BarrelDetLayer const*>& tib,
8  const vector<BarrelDetLayer const*>& tob,
9  const vector<ForwardDetLayer const*>& negPxlFwd,
10  const vector<ForwardDetLayer const*>& negTid,
11  const vector<ForwardDetLayer const*>& negTec,
12  const vector<ForwardDetLayer const*>& posPxlFwd,
13  const vector<ForwardDetLayer const*>& posTid,
14  const vector<ForwardDetLayer const*>& posTec):
15  thePixelBarrelLayers(pxlBar.begin(),pxlBar.end()),
16  theTibLayers(tib.begin(),tib.end()),
17  theTobLayers(tob.begin(),tob.end()),
18  theNegPixelForwardLayers(negPxlFwd.begin(),negPxlFwd.end()),
19  theNegTidLayers(negTid.begin(),negTid.end()),
20  theNegTecLayers(negTec.begin(),negTec.end()),
21  thePosPixelForwardLayers(posPxlFwd.begin(),posPxlFwd.end()),
22  thePosTidLayers(posTid.begin(),posTid.end()),
23  thePosTecLayers(posTec.begin(),posTec.end())
24 {
26  theBarrelLayers.insert(theBarrelLayers.end(),theTibLayers.begin(),theTibLayers.end());
27  theBarrelLayers.insert(theBarrelLayers.end(),theTobLayers.begin(),theTobLayers.end());
28 
32 
36 
37 
40  theAllLayers.assign(theBarrelLayers.begin(),theBarrelLayers.end());
41  theAllLayers.insert(theAllLayers.end(),
42  theForwardLayers.begin(),
43  theForwardLayers.end());
44 
45  // number the layers
46  int sq=0;
47  for (auto l : theAllLayers)
48  const_cast<DetLayer&>(*l).setSeqNum(sq++);
49 
50  edm::LogInfo("TkDetLayers")
51  << "------ GeometricSearchTracker constructed with: ------" << "\n"
52  << "n pxlBarLayers: " << this->pixelBarrelLayers().size() << "\n"
53  << "n tibLayers: " << this->tibLayers().size() << "\n"
54  << "n tobLayers: " << this->tobLayers().size() << "\n"
55  << "n negPxlFwdLayers: " << this->negPixelForwardLayers().size() << "\n"
56  << "n posPxlFwdLayers: " << this->posPixelForwardLayers().size() << "\n"
57  << "n negTidLayers: " << this->negTidLayers().size() << "\n"
58  << "n posTidLayers: " << this->posTidLayers().size() << "\n"
59  << "n negTecLayers: " << this->negTecLayers().size() << "\n"
60  << "n posTecLayers: " << this->posTecLayers().size() << "\n"
61 
62  << "n barreLayers: " << this->barrelLayers().size() << "\n"
63  << "n negforwardLayers: " << this->negForwardLayers().size() << "\n"
64  << "n posForwardLayers: " << this->posForwardLayers().size()
65  << "\nn Total : " << theAllLayers.size() << " " << sq
66  << std::endl;
67 
68  for (auto l : theAllLayers)
69  edm::LogInfo("TkDetLayers") << (*l).seqNum()<< ": " << (*l).subDetector() << ", ";
70  edm::LogInfo("TkDetLayers") << std::endl;
71 
72 }
73 
74 
76  for (auto l : theAllLayers)
77  delete const_cast<DetLayer*>(l);
78 
79 }
80 
81 
90 
91 const DetLayer*
93 {
94  switch(id.subdetId()) {
96  //edm::LogInfo(TkDetLayers) << "TIB layer n: " << TIBDetId(id).layer() ;
97  return theTibLayers[TIBDetId(id).layer()-1];
98  break;
99 
101  //edm::LogInfo(TkDetLayers) << "TOB layer n: " << TOBDetId(id).layer() ;
102  return theTobLayers[TOBDetId(id).layer()-1];
103  break;
104 
106  //edm::LogInfo(TkDetLayers) << "TID wheel n: " << TIDDetId(id).wheel() ;
107  if(TIDDetId(id).side() ==1 ) {
108  return theNegTidLayers[TIDDetId(id).wheel()-1];
109  }else if( TIDDetId(id).side() == 2 ) {
110  return thePosTidLayers[TIDDetId(id).wheel()-1];
111  }
112  break;
113 
115  //edm::LogInfo(TkDetLayers) << "TEC wheel n: " << TECDetId(id).wheel() ;
116  if(TECDetId(id).side() ==1 ) {
117  return theNegTecLayers[TECDetId(id).wheel()-1];
118  }else if( TECDetId(id).side() == 2 ) {
119  return thePosTecLayers[TECDetId(id).wheel()-1];
120  }
121  break;
122 
124  //edm::LogInfo(TkDetLayers) << "PixelBarrel layer n: " << PXBDetId(id).layer() ;
125  return thePixelBarrelLayers[PXBDetId(id).layer()-1];
126  break;
127 
129  //edm::LogInfo(TkDetLayers) << "PixelEndcap disk n: " << PXFDetId(id).disk() ;
130  if(PXFDetId(id).side() ==1 ) {
131  return theNegPixelForwardLayers[PXFDetId(id).disk()-1];
132  }else if( PXFDetId(id).side() == 2 ) {
133  return thePosPixelForwardLayers[PXFDetId(id).disk()-1];
134  }
135  break;
136 
137  default:
138  edm::LogError("TkDetLayers") << "ERROR:layer not found!" ;
139  // throw(something);
140  }
141  return 0; //just to avoid compile warnings
142 }
std::vector< BarrelDetLayer const * > theBarrelLayers
std::vector< ForwardDetLayer const * > theNegTidLayers
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
std::vector< ForwardDetLayer const * > theForwardLayers
void setSeqNum(int sq)
Definition: DetLayer.h:37
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
std::vector< ForwardDetLayer const * > thePosTidLayers
std::vector< BarrelDetLayer const * > const & tobLayers() const
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) __attribute__((cold))
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
std::vector< DetLayer const * > theAllLayers
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
std::vector< ForwardDetLayer const * > thePosPixelForwardLayers
std::vector< BarrelDetLayer const * > thePixelBarrelLayers
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
std::vector< BarrelDetLayer const * > theTibLayers
#define end
Definition: vmac.h:37
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
std::vector< ForwardDetLayer const * > theNegForwardLayers
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
std::vector< ForwardDetLayer const * > thePosTecLayers
virtual const DetLayer * idToLayer(const DetId &detId) const
Give the DetId of a module, returns the pointer to the corresponding DetLayer.
Definition: DetId.h:18
std::vector< BarrelDetLayer const * > const & tibLayers() const
std::vector< ForwardDetLayer const * > const & posTecLayers() const
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
std::vector< ForwardDetLayer const * > const & negTidLayers() const
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
std::vector< ForwardDetLayer const * > const & posTidLayers() const
#define begin
Definition: vmac.h:30
std::vector< ForwardDetLayer const * > theNegPixelForwardLayers
std::vector< ForwardDetLayer const * > const & negTecLayers() const
virtual ~GeometricSearchTracker() __attribute__((cold))
std::vector< BarrelDetLayer const * > theTobLayers
std::vector< BarrelDetLayer const * > const & barrelLayers() const
std::vector< ForwardDetLayer const * > theNegTecLayers
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
std::vector< ForwardDetLayer const * > thePosForwardLayers