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*>& pxlBar,
7  const vector<BarrelDetLayer*>& tib,
8  const vector<BarrelDetLayer*>& tob,
9  const vector<ForwardDetLayer*>& negPxlFwd,
10  const vector<ForwardDetLayer*>& negTid,
11  const vector<ForwardDetLayer*>& negTec,
12  const vector<ForwardDetLayer*>& posPxlFwd,
13  const vector<ForwardDetLayer*>& posTid,
14  const vector<ForwardDetLayer*>& 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  (*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(vector<DetLayer*>::const_iterator it=theAllLayers.begin(); it!=theAllLayers.end();it++){
77  delete *it;
78  }
79 
80 }
81 
82 
91 
92 const DetLayer*
94 {
95  switch(id.subdetId()) {
97  //edm::LogInfo(TkDetLayers) << "TIB layer n: " << TIBDetId(id).layer() ;
98  return theTibLayers[TIBDetId(id).layer()-1];
99  break;
100 
102  //edm::LogInfo(TkDetLayers) << "TOB layer n: " << TOBDetId(id).layer() ;
103  return theTobLayers[TOBDetId(id).layer()-1];
104  break;
105 
107  //edm::LogInfo(TkDetLayers) << "TID wheel n: " << TIDDetId(id).wheel() ;
108  if(TIDDetId(id).side() ==1 ) {
109  return theNegTidLayers[TIDDetId(id).wheel()-1];
110  }else if( TIDDetId(id).side() == 2 ) {
111  return thePosTidLayers[TIDDetId(id).wheel()-1];
112  }
113  break;
114 
116  //edm::LogInfo(TkDetLayers) << "TEC wheel n: " << TECDetId(id).wheel() ;
117  if(TECDetId(id).side() ==1 ) {
118  return theNegTecLayers[TECDetId(id).wheel()-1];
119  }else if( TECDetId(id).side() == 2 ) {
120  return thePosTecLayers[TECDetId(id).wheel()-1];
121  }
122  break;
123 
125  //edm::LogInfo(TkDetLayers) << "PixelBarrel layer n: " << PXBDetId(id).layer() ;
126  return thePixelBarrelLayers[PXBDetId(id).layer()-1];
127  break;
128 
130  //edm::LogInfo(TkDetLayers) << "PixelEndcap disk n: " << PXFDetId(id).disk() ;
131  if(PXFDetId(id).side() ==1 ) {
132  return theNegPixelForwardLayers[PXFDetId(id).disk()-1];
133  }else if( PXFDetId(id).side() == 2 ) {
134  return thePosPixelForwardLayers[PXFDetId(id).disk()-1];
135  }
136  break;
137 
138  default:
139  edm::LogError("TkDetLayers") << "ERROR:layer not found!" ;
140  // throw(something);
141  }
142  return 0; //just to avoid compile warnings
143 }
std::vector< ForwardDetLayer * > theForwardLayers
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
std::vector< ForwardDetLayer * > const & posTecLayers() const
std::vector< ForwardDetLayer * > theNegTidLayers
std::vector< BarrelDetLayer * > theTibLayers
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
std::vector< ForwardDetLayer * > thePosTidLayers
std::vector< BarrelDetLayer * > const & barrelLayers() const
std::vector< ForwardDetLayer * > const & negTecLayers() const
std::vector< BarrelDetLayer * > theBarrelLayers
std::vector< BarrelDetLayer * > thePixelBarrelLayers
std::vector< BarrelDetLayer * > theTobLayers
std::vector< ForwardDetLayer * > const & posPixelForwardLayers() const
std::vector< ForwardDetLayer * > theNegPixelForwardLayers
std::vector< ForwardDetLayer * > thePosPixelForwardLayers
#define end
Definition: vmac.h:37
std::vector< ForwardDetLayer * > const & negForwardLayers() const
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
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< ForwardDetLayer * > const & posForwardLayers() const
std::vector< ForwardDetLayer * > thePosForwardLayers
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
std::vector< ForwardDetLayer * > thePosTecLayers
std::vector< BarrelDetLayer * > const & tibLayers() const
#define begin
Definition: vmac.h:30
std::vector< ForwardDetLayer * > const & posTidLayers() const
GeometricSearchTracker(const std::vector< BarrelDetLayer * > &pxlBar, const std::vector< BarrelDetLayer * > &tib, const std::vector< BarrelDetLayer * > &tob, const std::vector< ForwardDetLayer * > &negPxlFwd, const std::vector< ForwardDetLayer * > &negTid, const std::vector< ForwardDetLayer * > &negTec, const std::vector< ForwardDetLayer * > &posPxlFwd, const std::vector< ForwardDetLayer * > &posTid, const std::vector< ForwardDetLayer * > &posTec)
std::vector< DetLayer * > theAllLayers
std::vector< ForwardDetLayer * > theNegForwardLayers
std::vector< ForwardDetLayer * > const & negTidLayers() const
std::vector< ForwardDetLayer * > theNegTecLayers
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
std::vector< BarrelDetLayer * > const & tobLayers() const
std::vector< BarrelDetLayer * > const & pixelBarrelLayers() const
std::vector< ForwardDetLayer * > const & negPixelForwardLayers() const