CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

cms::HICTkOuterStartingLayerFinder Class Reference

#include <HICTkOuterStartingLayerFinder.h>

List of all members.

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 
)
cms::HICTkOuterStartingLayerFinder::~HICTkOuterStartingLayerFinder ( ) [inline]

Definition at line 30 of file HICTkOuterStartingLayerFinder.h.

{};

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().

{             
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findBarrelLayers::start::zdetlast "<<length<<std::endl;
#endif
  std::vector<BarrelDetLayer*>::const_iterator blayer; 
 //  
 // double zdetlast=(fls.front())->surface().position().z();

  double zdetlast = length+10.;
  //double zseed=fts.parameters().position().z();  
  //double rseed=fts.parameters().position().perp();
  //double dz = NumberOfSigm*fts.curvilinearError().matrix()(5,5);
  //double atrack=tan(fts.parameters().momentum().theta());
  //double btrack=rseed-atrack*zseed;
//  double zvert=-btrack/atrack;
  double r,rmin,rmax;   
  
  BoundSurface* surc = (BoundSurface*)&((theBarrelLayers.back())->surface());
  double zbarrel=surc->bounds().length()/2.;
  BoundCylinder* bc = dynamic_cast<BoundCylinder*>(surc);
  double barrelradius=bc->radius();

  double a1=barrelradius/(fabs(zdetlast)-fabs(theHICConst->zvert));


  rmin=a1*zbarrel-(theBarrelLayers.back())->surface().bounds().thickness();
  rmax=barrelradius+(theBarrelLayers.back())->surface().bounds().thickness();
     
//  if(fabs(zseed)-dz<zbarrel){
//    rmax=barrelradius+(theBarrelLayers.back())->surface().bounds().thickness();
//  } else{
//    a2=barrelradius/(fabs(zseed-theHICConst->zvert)-dz);
//    if(zseed<0.) a2=-1.*a2;
//    rmax=a2*zbarrel+(theBarrelLayers.back())->surface().bounds().thickness();
//  cout<<" Check a2,rmax "<<a2<<" "<<rmax<<endl;
//  }
     
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findBarrelLayers::rmin,rmax "<<rmin<<" "<<rmax<<std::endl;
#endif 

  for(blayer=theBarrelLayers.end()-1;blayer!=theBarrelLayers.begin()-1;blayer--){
  
  BoundSurface* sc = (BoundSurface*)&((*blayer)->surface());
  r=(dynamic_cast<BoundCylinder*>(sc))->radius();

            
    if(r>rmin&&r<=rmax){
      seedlayers.push_back(&(**blayer));
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findBarrelLayers::add "<<r<<std::endl;
#endif
    }
  }//blayer barrel  
  return seedlayers;
}
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().

                                                                                                            {
              
  bool barrel = false;

#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::start "<<NumberOfSigm<<std::endl;
#endif  

  double outrad, zseed, rseed;
  //double theta, atrack, btrack;
  double dz, dr, a1, zdet, newzmin, newzmax;  
  std::vector<ForwardDetLayer*>::const_iterator flayer; 
  double mincoor=fabs(fts.parameters().position().z())-
                                                      NumberOfSigm*fts.curvilinearError().matrix()(4,4);
                                                      
//  double zdetlast=(fls.front())->surface().position().z();
  double zdetlast=length;
  outrad=(fls.back())->specificSurface().outerRadius();
  
  zseed=fts.parameters().position().z();  
  rseed=fts.parameters().position().perp();
  dz = 3.*NumberOfSigm*fts.curvilinearError().matrix()(4,4); // ok
  dr = NumberOfSigm*fts.curvilinearError().matrix()(4,4);
  
  
  //theta=fts.parameters().momentum().theta();
  //atrack=tan(theta);
  //btrack=rseed-atrack*zseed;
  //zvert=-btrack/atrack;


#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers "<<rseed<<" dr "<<dr<<" outrad "<<outrad<<std::endl;
#endif   

  if(rseed+dr<outrad){
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::add last forward layer "<<rseed<<" dr "<<dr<<" outrad "<<outrad<<std::endl;
#endif
    seedlayers.push_back(fls.back());
    zdetlast = fabs((fls.back())->surface().position().z());

  }else{
    if(rseed>outrad) {
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::1 zseed "<<zseed<<" dz "<<dz<<std::endl;
#endif

    newzmin=abs(zseed)-3.*dz; // ok 8*dz now 3*dz
//    newzmin = fabs(zseed)-30.; // ok 16.06.08
    newzmax=fabs(zseed)+dz/(2.*NumberOfSigm); // ok dz
    } else {
    a1=(rseed+dr)/(fabs(zseed)-fabs(theHICConst->zvert));
    if(zseed<0.) a1=-1.*a1;

#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::2 zseed "<<zseed<<" dz "<<dz<<" "<<(fls.back())->surface().position().z()<<std::endl;
#endif

    newzmin=abs(outrad/a1)-3.*dz; //ok 6*dz now 3*dz 
//    newzmin = fabs(zseed)-30.; // ok 16.06.08
    newzmax=fabs((fls.back())->surface().position().z())+dz;
    }
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::newzmin,newzmax "<<newzmin<<" "<<newzmax<<std::endl;
#endif
    
    for(flayer=fls.end()-1;flayer!=fls.begin()-1;flayer--){
     
      zdet=(**flayer).surface().position().z();
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::zdet "<<zdet<<" thickness "<<(**flayer).surface().bounds().thickness()<<std::endl;
#endif
           
//      if(abs(newzmin)<=abs(zdet+(**flayer).surface().bounds().thickness())
//                 && abs(zdet-(**flayer).surface().bounds().thickness())<=abs(newzmax)){ 

      if(fabs(zdet)<length) break;

      if(fabs(newzmin)<=fabs(zdet)+(**flayer).surface().bounds().thickness()
                 && fabs(zdet)-(**flayer).surface().bounds().thickness()<=fabs(newzmax)){

#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::findForwardLayers::add layer "<<zdet<<std::endl;
#endif
         
        seedlayers.push_back(&(**flayer));
        zdetlast=zdet;

      } //zmin

    } //flayer
  }
//  if(mincoor<abs(zdetlast) ){
#ifdef DEBUG

   std::cout<<"HICTkOuterStartingLayerFinder::zdetlast,mincoor "<<zdetlast<<" "<<mincoor<<std::endl;

#endif
  if(fabs(mincoor)<fabs(zdetlast)||fabs(zdetlast)<140.){
#ifdef DEBUG
   std::cout<<"HICTkOuterStartingLayerFinder::add barrel layers to forward "<<std::endl;
#endif
    barrel=true;
  }
  return barrel;
}
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().

{
  vector<DetLayer*> seedlayers;
  
  
  BoundSurface* surc = (BoundSurface*)&((theBarrelLayers.back())->specificSurface());
  
  length=surc->bounds().length()/2.;
  
  double maxcoor=fabs(fts.parameters().position().z())+NumberOfSigm*fts.curvilinearError().matrix()(4,4);
  
  //
  //  barrel part (muon and tracker)
  //
  
#ifdef DEBUG
  std::cout<<"HICTkOuterStartingLayerFinder::startingLayers::maxcoor "<<fabs(fts.parameters().position().z())<<" "<<
  NumberOfSigm<<" "<<fts.curvilinearError().matrix()(4,4)<<" maxcoor "<<maxcoor<<" length "<<length<<std::endl;
#endif
  
  if(maxcoor<length) {
    seedlayers.push_back( theBarrelLayers.back());
    seedlayers.push_back( *(theBarrelLayers.end()-2));
    return seedlayers;
  }

  bool checkBarrel;
  
  if(fts.parameters().position().z() < 0.){
    checkBarrel = findForwardLayers( fts, forwardNegLayers, seedlayers);
  } else {
    checkBarrel = findForwardLayers( fts, forwardPosLayers, seedlayers);
  }
  
  if (!checkBarrel) return seedlayers;
//
// One should attach barrel layers
//  
  if(fts.parameters().position().z() < 0.){
    return findBarrelLayers( fts, forwardNegLayers, seedlayers);
  }else{
    return findBarrelLayers( fts, forwardPosLayers, seedlayers);
  }

  //  return seedlayers;
  
}

Member Data Documentation

Definition at line 47 of file HICTkOuterStartingLayerFinder.h.

Definition at line 46 of file HICTkOuterStartingLayerFinder.h.

Referenced by findForwardLayers(), and startingLayers().

Definition at line 45 of file HICTkOuterStartingLayerFinder.h.

Definition at line 49 of file HICTkOuterStartingLayerFinder.h.

Referenced by findBarrelLayers(), and findForwardLayers().

Definition at line 48 of file HICTkOuterStartingLayerFinder.h.

Referenced by HICTkOuterStartingLayerFinder().