CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

SeedGeneratorForCRack Class Reference

#include <SeedGeneratorForCRack.h>

List of all members.

Public Types

typedef TrajectoryStateOnSurface TSOS

Public Member Functions

void init (const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)
void run (TrajectorySeedCollection &, const edm::EventSetup &c)
 SeedGeneratorForCRack (const edm::ParameterSet &conf)
void seeds (TrajectorySeedCollection &output, const edm::EventSetup &c, const TrackingRegion &region)
virtual ~SeedGeneratorForCRack ()

Private Attributes

std::string builderName
edm::ParameterSet conf_
std::string geometry
OrderedHitPairs HitPairs
edm::ESHandle< MagneticFieldmagfield
float multipleScatteringFactor
GlobalTrackingRegion region
double seedMomentum
float seedpt
CosmicHitPairGeneratorthePairGenerator
PropagatorWithMaterialthePropagatorAl
PropagatorWithMaterialthePropagatorOp
KFUpdatortheUpdator
edm::ESHandle< TrackerGeometrytracker
const
TransientTrackingRecHitBuilder
TTTRHBuilder

Detailed Description

Definition at line 21 of file SeedGeneratorForCRack.h.


Member Typedef Documentation

Definition at line 23 of file SeedGeneratorForCRack.h.


Constructor & Destructor Documentation

SeedGeneratorForCRack::SeedGeneratorForCRack ( const edm::ParameterSet conf)

Definition at line 31 of file SeedGeneratorForCRack.cc.

References builderName, conf_, geometry, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), multipleScatteringFactor, ptmin, region, seedMomentum, and seedpt.

                                                                       :
  conf_(conf)
{  
  float ptmin=conf_.getParameter<double>("ptMin");
  float originradius=conf_.getParameter<double>("originRadius");
  float halflength=conf_.getParameter<double>("originHalfLength");
  float originz=conf_.getParameter<double>("originZPosition");
  seedpt = conf_.getParameter<double>("SeedPt");

  builderName = conf_.getParameter<std::string>("TTRHBuilder");   
  geometry=conf_.getUntrackedParameter<std::string>("GeometricStructure","STANDARD");
  region=GlobalTrackingRegion(ptmin,originradius,
                              halflength,originz);
  multipleScatteringFactor=conf_.getUntrackedParameter<double>("multipleScatteringFactor", 1.0);
  seedMomentum =conf_.getUntrackedParameter<double>("SeedMomentum",1);
  edm::LogInfo("SeedGeneratorForCRack")<<" PtMin of track is "<<ptmin<< 
    " The Radius of the cylinder for seeds is "<<originradius <<"cm"  << " The set Seed Momentum" <<  seedpt;
}
virtual SeedGeneratorForCRack::~SeedGeneratorForCRack ( ) [inline, virtual]

Definition at line 25 of file SeedGeneratorForCRack.h.

{};

Member Function Documentation

void SeedGeneratorForCRack::init ( const SiStripRecHit2DCollection collstereo,
const SiStripRecHit2DCollection collrphi,
const SiStripMatchedRecHit2DCollection collmatched,
const edm::EventSetup c 
)
void SeedGeneratorForCRack::run ( TrajectorySeedCollection output,
const edm::EventSetup c 
)
void SeedGeneratorForCRack::seeds ( TrajectorySeedCollection output,
const edm::EventSetup c,
const TrackingRegion region 
)

Definition at line 58 of file SeedGeneratorForCRack.cc.

References alongMomentum, TransientTrackingRecHitBuilder::build(), clone(), HitPairs, i, SurfaceOrientation::inner, TrajectoryStateOnSurface::isValid(), LogDebug, magfield, multipleScatteringFactor, oppositeToMomentum, SurfaceOrientation::outer, trajectoryStateTransform::persistentState(), PropagatorWithMaterial::propagate(), edm::OwnVector< T, P >::push_back(), TrajectoryStateOnSurface::rescaleError(), seedMomentum, OrderedHitPairs::size(), thePropagatorOp, theUpdator, tracker, TTTRHBuilder, Vector3DBase< T, FrameTag >::unit(), KFUpdator::update(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by run().

                                                                 {
  for(unsigned int is=0;is<HitPairs.size();is++){

    GlobalPoint inner = tracker->idToDet((*(HitPairs[is].inner())).geographicalId())->surface().toGlobal((*(HitPairs[is].inner())).localPosition());
    GlobalPoint outer = tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface().toGlobal((*(HitPairs[is].outer())).localPosition());
    
    LogDebug("CosmicSeedFinder") <<"inner point of the seed "<<inner <<" outer point of the seed "<<outer; 
    TransientTrackingRecHit::ConstRecHitPointer inrhit=TTTRHBuilder->build(HitPairs[is].inner()->hit());
    TransientTrackingRecHit::ConstRecHitPointer outrhit = TTTRHBuilder->build(HitPairs[is].outer()->hit());

    edm::OwnVector<TrackingRecHit> hits;
    hits.push_back(HitPairs[is].outer()->hit()->clone());

    for (int i=0;i<2;i++){
      //FIRST STATE IS CALCULATED CONSIDERING THAT THE CHARGE CAN BE POSITIVE OR NEGATIVE
      int predsign=(2*i)-1;
      if((outer.y()-inner.y())>0){
        GlobalVector momentum = GlobalVector(inner-outer);
        momentum = momentum.unit()*seedMomentum;
        GlobalTrajectoryParameters Gtp(inner,
                                       momentum,
                                       predsign, 
                                       &(*magfield));
        AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
        TSOS innerState = TSOS(Gtp, CurvilinearTrajectoryError(errMatrix), tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
        const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
        //Cosmic Seed update inner...
        LogDebug("CosmicSeedFinder") << " FirstTSOS " << innerUpdated;
        
        //First propagation
        const TSOS outerState =
          thePropagatorOp->propagate(innerUpdated,
                                     tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
        if ( outerState.isValid()) {
          LogDebug("CosmicSeedFinder") <<"outerState "<<outerState;
          TSOS outerUpdated= theUpdator->update( outerState,*outrhit);
          //fudge factor for multiple scattering
          outerUpdated.rescaleError( multipleScatteringFactor);
          if ( outerUpdated.isValid()) {
            LogDebug("CosmicSeedFinder") <<"outerUpdated "<<outerUpdated;
            
            PTrajectoryStateOnDet PTraj=  
              trajectoryStateTransform::persistentState(outerUpdated, (*(HitPairs[is].outer())).geographicalId().rawId());
            output.push_back(TrajectorySeed(PTraj,hits,alongMomentum));
            
          }else      edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
        }else      edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
      
      
      }
      else{
        GlobalVector momentum= GlobalVector(outer-inner);
        momentum=momentum.unit()*seedMomentum;
        GlobalTrajectoryParameters Gtp(inner,
                                       momentum,
                                       predsign, 
                                       &(*magfield));
        AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
        TSOS innerState = TSOS(Gtp, CurvilinearTrajectoryError(errMatrix), tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
        const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
        LogDebug("CosmicSeedFinder") << " FirstTSOS "<< innerState;
        
        //First propagation
        const TSOS outerState =
          thePropagatorOp->propagate(innerUpdated,
                                     tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
        if ( outerState.isValid()) {
          
          LogDebug("CosmicSeedFinder") <<"outerState "<<outerState;
          TSOS outerUpdated = theUpdator->update( outerState,*outrhit);
          //fudge factor for multiple scattering
          outerUpdated.rescaleError( multipleScatteringFactor);
          if ( outerUpdated.isValid()) {
          LogDebug("CosmicSeedFinder") <<"outerUpdated "<<outerUpdated;
          PTrajectoryStateOnDet PTraj=  
            trajectoryStateTransform::persistentState(outerUpdated,(*(HitPairs[is].outer())).geographicalId().rawId());
          output.push_back(TrajectorySeed(PTraj,hits,oppositeToMomentum));
        
          }else      edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
        }else      edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
      }
    }
  }
}

Member Data Documentation

std::string SeedGeneratorForCRack::builderName [private]

Definition at line 49 of file SeedGeneratorForCRack.h.

Referenced by init(), and SeedGeneratorForCRack().

Definition at line 39 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack().

std::string SeedGeneratorForCRack::geometry [private]

Definition at line 50 of file SeedGeneratorForCRack.h.

Referenced by init(), and SeedGeneratorForCRack().

Definition at line 52 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

Definition at line 42 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

Definition at line 53 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack(), and seeds().

Definition at line 40 of file SeedGeneratorForCRack.h.

Referenced by init(), run(), and SeedGeneratorForCRack().

Definition at line 54 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack(), and seeds().

Definition at line 51 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack().

Definition at line 41 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

Definition at line 46 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

Definition at line 47 of file SeedGeneratorForCRack.h.

Referenced by init(), run(), and seeds().

Definition at line 45 of file SeedGeneratorForCRack.h.

Referenced by init(), run(), and seeds().

Definition at line 43 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

Definition at line 48 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().