CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
cms::HICTkOuterStartingLayerFinder Class Reference

#include <HICTkOuterStartingLayerFinder.h>

Public Types

typedef std::vector< DetLayer * > LayerContainer
 

Public Member Functions

 HICTkOuterStartingLayerFinder (int &, const MagneticField *mf, const GeometricSearchTracker *th, const HICConst *)
 
LayerContainer startingLayers (FreeTrajectoryState &fts)
 
 ~HICTkOuterStartingLayerFinder ()
 

Private Member Functions

LayerContainer findBarrelLayers (const FreeTrajectoryState &fts, std::vector< ForwardDetLayer * > &fls, LayerContainer &lc)
 
bool findForwardLayers (const FreeTrajectoryState &fts, std::vector< ForwardDetLayer * > &fls, LayerContainer &lc)
 

Private Attributes

std::vector< ForwardDetLayer * > forwardNegLayers
 
std::vector< ForwardDetLayer * > forwardPosLayers
 
double length
 
const MagneticFieldmagfield
 
int NumberOfSigm
 
std::vector< BarrelDetLayer * > theBarrelLayers
 
std::vector< DetLayer * > theDetLayer
 
const HICConsttheHICConst
 
const GeometricSearchTrackertheTracker
 

Detailed Description

Definition at line 24 of file HICTkOuterStartingLayerFinder.h.

Member Typedef Documentation

Definition at line 26 of file HICTkOuterStartingLayerFinder.h.

Constructor & Destructor Documentation

cms::HICTkOuterStartingLayerFinder::HICTkOuterStartingLayerFinder ( int &  numberOfSigmas,
const MagneticField mf,
const GeometricSearchTracker th,
const HICConst hh 
)

Definition at line 20 of file HICTkOuterStartingLayerFinder.cc.

References GeometricSearchTracker::barrelLayers(), forwardNegLayers, forwardPosLayers, GeometricSearchTracker::negForwardLayers(), GeometricSearchTracker::posForwardLayers(), theBarrelLayers, and theTracker.

21  :
22  NumberOfSigm(numberOfSigmas),
23  magfield(mf),
24  theTracker(th),
25  theHICConst(hh)
26 {
27 
28 // Get tracking geometry
29 
33  //cout<<" HICTkOuterStartingLayerFinder::zvert "<<theHICConst->zvert<<endl;
34 }
std::vector< BarrelDetLayer * > const & barrelLayers() const
std::vector< BarrelDetLayer * > theBarrelLayers
std::vector< ForwardDetLayer * > const & negForwardLayers() const
std::vector< ForwardDetLayer * > const & posForwardLayers() const
std::vector< ForwardDetLayer * > forwardPosLayers
std::vector< ForwardDetLayer * > forwardNegLayers
cms::HICTkOuterStartingLayerFinder::~HICTkOuterStartingLayerFinder ( )
inline

Definition at line 30 of file HICTkOuterStartingLayerFinder.h.

30 {};

Member Function Documentation

HICTkOuterStartingLayerFinder::LayerContainer cms::HICTkOuterStartingLayerFinder::findBarrelLayers ( const FreeTrajectoryState fts,
std::vector< ForwardDetLayer * > &  fls,
LayerContainer lc 
)
private

Definition at line 193 of file HICTkOuterStartingLayerFinder.cc.

References BoundSurface::bounds(), gather_cfg::cout, Bounds::length(), length, alignCSCRings::r, Cylinder::radius(), theBarrelLayers, theHICConst, and cms::HICConst::zvert.

Referenced by startingLayers().

195 {
196 #ifdef DEBUG
197  std::cout<<"HICTkOuterStartingLayerFinder::findBarrelLayers::start::zdetlast "<<length<<std::endl;
198 #endif
199  std::vector<BarrelDetLayer*>::const_iterator blayer;
200  //
201  // double zdetlast=(fls.front())->surface().position().z();
202 
203  double zdetlast = length+10.;
204  //double zseed=fts.parameters().position().z();
205  //double rseed=fts.parameters().position().perp();
206  //double dz = NumberOfSigm*fts.curvilinearError().matrix()(5,5);
207  //double atrack=tan(fts.parameters().momentum().theta());
208  //double btrack=rseed-atrack*zseed;
209 // double zvert=-btrack/atrack;
210  double r,rmin,rmax;
211 
212  BoundSurface* surc = (BoundSurface*)&((theBarrelLayers.back())->surface());
213  double zbarrel=surc->bounds().length()/2.;
214  BoundCylinder* bc = dynamic_cast<BoundCylinder*>(surc);
215  double barrelradius=bc->radius();
216 
217  double a1=barrelradius/(fabs(zdetlast)-fabs(theHICConst->zvert));
218 
219 
220  rmin=a1*zbarrel-(theBarrelLayers.back())->surface().bounds().thickness();
221  rmax=barrelradius+(theBarrelLayers.back())->surface().bounds().thickness();
222 
223 // if(fabs(zseed)-dz<zbarrel){
224 // rmax=barrelradius+(theBarrelLayers.back())->surface().bounds().thickness();
225 // } else{
226 // a2=barrelradius/(fabs(zseed-theHICConst->zvert)-dz);
227 // if(zseed<0.) a2=-1.*a2;
228 // rmax=a2*zbarrel+(theBarrelLayers.back())->surface().bounds().thickness();
229 // cout<<" Check a2,rmax "<<a2<<" "<<rmax<<endl;
230 // }
231 
232 #ifdef DEBUG
233  std::cout<<"HICTkOuterStartingLayerFinder::findBarrelLayers::rmin,rmax "<<rmin<<" "<<rmax<<std::endl;
234 #endif
235 
236  for(blayer=theBarrelLayers.end()-1;blayer!=theBarrelLayers.begin()-1;blayer--){
237 
238  BoundSurface* sc = (BoundSurface*)&((*blayer)->surface());
239  r=(dynamic_cast<BoundCylinder*>(sc))->radius();
240 
241 
242  if(r>rmin&&r<=rmax){
243  seedlayers.push_back(&(**blayer));
244 #ifdef DEBUG
245  std::cout<<"HICTkOuterStartingLayerFinder::findBarrelLayers::add "<<r<<std::endl;
246 #endif
247  }
248  }//blayer barrel
249  return seedlayers;
250 }
virtual float length() const =0
float zvert
Definition: HICConst.h:25
std::vector< BarrelDetLayer * > theBarrelLayers
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
const Bounds & bounds() const
Definition: BoundSurface.h:89
tuple cout
Definition: gather_cfg.py:121
bool cms::HICTkOuterStartingLayerFinder::findForwardLayers ( const FreeTrajectoryState fts,
std::vector< ForwardDetLayer * > &  fls,
HICTkOuterStartingLayerFinder::LayerContainer seedlayers 
)
private

Definition at line 84 of file HICTkOuterStartingLayerFinder.cc.

References abs, Reference_intrackfit_cff::barrel, gather_cfg::cout, FreeTrajectoryState::curvilinearError(), length, CurvilinearTrajectoryError::matrix(), NumberOfSigm, FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), GlobalTrajectoryParameters::position(), theHICConst, PV3DBase< T, PVType, FrameType >::z(), and cms::HICConst::zvert.

Referenced by startingLayers().

86  {
87 
88  bool barrel = false;
89 
90 #ifdef DEBUG
91  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::start "<<NumberOfSigm<<std::endl;
92 #endif
93 
94  double outrad, zseed, rseed;
95  //double theta, atrack, btrack;
96  double dz, dr, a1, zdet, newzmin, newzmax;
97  std::vector<ForwardDetLayer*>::const_iterator flayer;
98  double mincoor=fabs(fts.parameters().position().z())-
100 
101 // double zdetlast=(fls.front())->surface().position().z();
102  double zdetlast=length;
103  outrad=(fls.back())->specificSurface().outerRadius();
104 
105  zseed=fts.parameters().position().z();
106  rseed=fts.parameters().position().perp();
107  dz = 3.*NumberOfSigm*fts.curvilinearError().matrix()(4,4); // ok
108  dr = NumberOfSigm*fts.curvilinearError().matrix()(4,4);
109 
110 
111  //theta=fts.parameters().momentum().theta();
112  //atrack=tan(theta);
113  //btrack=rseed-atrack*zseed;
114  //zvert=-btrack/atrack;
115 
116 
117 #ifdef DEBUG
118  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers "<<rseed<<" dr "<<dr<<" outrad "<<outrad<<std::endl;
119 #endif
120 
121  if(rseed+dr<outrad){
122 #ifdef DEBUG
123  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::add last forward layer "<<rseed<<" dr "<<dr<<" outrad "<<outrad<<std::endl;
124 #endif
125  seedlayers.push_back(fls.back());
126  zdetlast = fabs((fls.back())->surface().position().z());
127 
128  }else{
129  if(rseed>outrad) {
130 #ifdef DEBUG
131  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::1 zseed "<<zseed<<" dz "<<dz<<std::endl;
132 #endif
133 
134  newzmin=abs(zseed)-3.*dz; // ok 8*dz now 3*dz
135 // newzmin = fabs(zseed)-30.; // ok 16.06.08
136  newzmax=fabs(zseed)+dz/(2.*NumberOfSigm); // ok dz
137  } else {
138  a1=(rseed+dr)/(fabs(zseed)-fabs(theHICConst->zvert));
139  if(zseed<0.) a1=-1.*a1;
140 
141 #ifdef DEBUG
142  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::2 zseed "<<zseed<<" dz "<<dz<<" "<<(fls.back())->surface().position().z()<<std::endl;
143 #endif
144 
145  newzmin=abs(outrad/a1)-3.*dz; //ok 6*dz now 3*dz
146 // newzmin = fabs(zseed)-30.; // ok 16.06.08
147  newzmax=fabs((fls.back())->surface().position().z())+dz;
148  }
149 #ifdef DEBUG
150  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::newzmin,newzmax "<<newzmin<<" "<<newzmax<<std::endl;
151 #endif
152 
153  for(flayer=fls.end()-1;flayer!=fls.begin()-1;flayer--){
154 
155  zdet=(**flayer).surface().position().z();
156 #ifdef DEBUG
157  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::zdet "<<zdet<<" thickness "<<(**flayer).surface().bounds().thickness()<<std::endl;
158 #endif
159 
160 // if(abs(newzmin)<=abs(zdet+(**flayer).surface().bounds().thickness())
161 // && abs(zdet-(**flayer).surface().bounds().thickness())<=abs(newzmax)){
162 
163  if(fabs(zdet)<length) break;
164 
165  if(fabs(newzmin)<=fabs(zdet)+(**flayer).surface().bounds().thickness()
166  && fabs(zdet)-(**flayer).surface().bounds().thickness()<=fabs(newzmax)){
167 
168 #ifdef DEBUG
169  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::add layer "<<zdet<<std::endl;
170 #endif
171 
172  seedlayers.push_back(&(**flayer));
173  zdetlast=zdet;
174 
175  } //zmin
176 
177  } //flayer
178  }
179 // if(mincoor<abs(zdetlast) ){
180 #ifdef DEBUG
181 
182  std::cout<<"HICTkOuterStartingLayerFinder::zdetlast,mincoor "<<zdetlast<<" "<<mincoor<<std::endl;
183 
184 #endif
185  if(fabs(mincoor)<fabs(zdetlast)||fabs(zdetlast)<140.){
186 #ifdef DEBUG
187  std::cout<<"HICTkOuterStartingLayerFinder::add barrel layers to forward "<<std::endl;
188 #endif
189  barrel=true;
190  }
191  return barrel;
192 }
T perp() const
Definition: PV3DBase.h:71
const GlobalTrajectoryParameters & parameters() const
float zvert
Definition: HICConst.h:25
#define abs(x)
Definition: mlp_lapack.h:159
const CurvilinearTrajectoryError & curvilinearError() const
T z() const
Definition: PV3DBase.h:63
const AlgebraicSymMatrix55 & matrix() const
tuple cout
Definition: gather_cfg.py:121
HICTkOuterStartingLayerFinder::LayerContainer cms::HICTkOuterStartingLayerFinder::startingLayers ( FreeTrajectoryState fts)

Definition at line 36 of file HICTkOuterStartingLayerFinder.cc.

References BoundSurface::bounds(), gather_cfg::cout, FreeTrajectoryState::curvilinearError(), findBarrelLayers(), findForwardLayers(), forwardNegLayers, forwardPosLayers, Bounds::length(), length, CurvilinearTrajectoryError::matrix(), NumberOfSigm, FreeTrajectoryState::parameters(), GlobalTrajectoryParameters::position(), theBarrelLayers, and PV3DBase< T, PVType, FrameType >::z().

Referenced by cms::HITrackVertexMaker::produceTracks().

37 {
38  vector<DetLayer*> seedlayers;
39 
40 
41  BoundSurface* surc = (BoundSurface*)&((theBarrelLayers.back())->specificSurface());
42 
43  length=surc->bounds().length()/2.;
44 
45  double maxcoor=fabs(fts.parameters().position().z())+NumberOfSigm*fts.curvilinearError().matrix()(4,4);
46 
47  //
48  // barrel part (muon and tracker)
49  //
50 
51 #ifdef DEBUG
52  std::cout<<"HICTkOuterStartingLayerFinder::startingLayers::maxcoor "<<fabs(fts.parameters().position().z())<<" "<<
53  NumberOfSigm<<" "<<fts.curvilinearError().matrix()(4,4)<<" maxcoor "<<maxcoor<<" length "<<length<<std::endl;
54 #endif
55 
56  if(maxcoor<length) {
57  seedlayers.push_back( theBarrelLayers.back());
58  seedlayers.push_back( *(theBarrelLayers.end()-2));
59  return seedlayers;
60  }
61 
62  bool checkBarrel;
63 
64  if(fts.parameters().position().z() < 0.){
65  checkBarrel = findForwardLayers( fts, forwardNegLayers, seedlayers);
66  } else {
67  checkBarrel = findForwardLayers( fts, forwardPosLayers, seedlayers);
68  }
69 
70  if (!checkBarrel) return seedlayers;
71 //
72 // One should attach barrel layers
73 //
74  if(fts.parameters().position().z() < 0.){
75  return findBarrelLayers( fts, forwardNegLayers, seedlayers);
76  }else{
77  return findBarrelLayers( fts, forwardPosLayers, seedlayers);
78  }
79 
80  // return seedlayers;
81 
82 }
virtual float length() const =0
const GlobalTrajectoryParameters & parameters() const
const CurvilinearTrajectoryError & curvilinearError() const
std::vector< BarrelDetLayer * > theBarrelLayers
T z() const
Definition: PV3DBase.h:63
bool findForwardLayers(const FreeTrajectoryState &fts, std::vector< ForwardDetLayer * > &fls, LayerContainer &lc)
const Bounds & bounds() const
Definition: BoundSurface.h:89
const AlgebraicSymMatrix55 & matrix() const
tuple cout
Definition: gather_cfg.py:121
std::vector< ForwardDetLayer * > forwardPosLayers
LayerContainer findBarrelLayers(const FreeTrajectoryState &fts, std::vector< ForwardDetLayer * > &fls, LayerContainer &lc)
std::vector< ForwardDetLayer * > forwardNegLayers

Member Data Documentation

std::vector<ForwardDetLayer*> cms::HICTkOuterStartingLayerFinder::forwardNegLayers
private
std::vector<ForwardDetLayer*> cms::HICTkOuterStartingLayerFinder::forwardPosLayers
private
double cms::HICTkOuterStartingLayerFinder::length
private
const MagneticField* cms::HICTkOuterStartingLayerFinder::magfield
private

Definition at line 47 of file HICTkOuterStartingLayerFinder.h.

int cms::HICTkOuterStartingLayerFinder::NumberOfSigm
private

Definition at line 46 of file HICTkOuterStartingLayerFinder.h.

Referenced by findForwardLayers(), and startingLayers().

std::vector<BarrelDetLayer*> cms::HICTkOuterStartingLayerFinder::theBarrelLayers
private
std::vector<DetLayer*> cms::HICTkOuterStartingLayerFinder::theDetLayer
private

Definition at line 45 of file HICTkOuterStartingLayerFinder.h.

const HICConst* cms::HICTkOuterStartingLayerFinder::theHICConst
private

Definition at line 49 of file HICTkOuterStartingLayerFinder.h.

Referenced by findBarrelLayers(), and findForwardLayers().

const GeometricSearchTracker* cms::HICTkOuterStartingLayerFinder::theTracker
private

Definition at line 48 of file HICTkOuterStartingLayerFinder.h.

Referenced by HICTkOuterStartingLayerFinder().