CMS 3D CMS Logo

Public Member Functions | Private Attributes

CosmicHitTripletGeneratorFromLayerTriplet Class Reference

#include <CosmicHitTripletGeneratorFromLayerTriplet.h>

Inheritance diagram for CosmicHitTripletGeneratorFromLayerTriplet:
HitTripletGenerator OrderedHitsGenerator

List of all members.

Public Member Functions

virtual
CosmicHitTripletGeneratorFromLayerTriplet
clone () const
 CosmicHitTripletGeneratorFromLayerTriplet (const LayerWithHits *inner, const LayerWithHits *middle, const LayerWithHits *outer, const edm::EventSetup &iSetup)
virtual void hitTriplets (const TrackingRegion &ar, OrderedHitTriplets &ap, const edm::Event &ev, const edm::EventSetup &iSetup)
virtual void hitTriplets (const TrackingRegion &ar, OrderedHitTriplets &ap, const edm::EventSetup &iSetup)
void init (const HitPairGenerator &pairs, const std::vector< const LayerWithHits * > &layers)
const LayerWithHitsinnerLayer () const
const LayerWithHitsmiddleLayer () const
const LayerWithHitsouterLayer () const
virtual ~CosmicHitTripletGeneratorFromLayerTriplet ()

Private Attributes

const DetLayerinnerlay
const DetLayermiddlelay
const DetLayerouterlay
const LayerWithHitstheInnerLayer
const LayerWithHitstheMiddleLayer
const LayerWithHitstheOuterLayer
const TrackerGeometrytrackerGeometry
const
TransientTrackingRecHitBuilder
TTRHbuilder

Detailed Description

Definition at line 17 of file CosmicHitTripletGeneratorFromLayerTriplet.h.


Constructor & Destructor Documentation

CosmicHitTripletGeneratorFromLayerTriplet::CosmicHitTripletGeneratorFromLayerTriplet ( const LayerWithHits inner,
const LayerWithHits middle,
const LayerWithHits outer,
const edm::EventSetup iSetup 
)
virtual CosmicHitTripletGeneratorFromLayerTriplet::~CosmicHitTripletGeneratorFromLayerTriplet ( ) [inline, virtual]

Definition at line 27 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

{ }

Member Function Documentation

virtual CosmicHitTripletGeneratorFromLayerTriplet* CosmicHitTripletGeneratorFromLayerTriplet::clone ( void  ) const [inline, virtual]
virtual void CosmicHitTripletGeneratorFromLayerTriplet::hitTriplets ( const TrackingRegion ar,
OrderedHitTriplets ap,
const edm::Event ev,
const edm::EventSetup iSetup 
) [inline, virtual]

Implements HitTripletGenerator.

Definition at line 31 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

{}
void CosmicHitTripletGeneratorFromLayerTriplet::hitTriplets ( const TrackingRegion ar,
OrderedHitTriplets ap,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from HitTripletGenerator.

Definition at line 30 of file CosmicHitTripletGeneratorFromLayerTriplet.cc.

References abs, edm::EventSetup::get(), LayerWithHits::layer(), LayerWithHits::recHits(), AlCaHLTBitMon_QueryRunRegistry::string, theInnerLayer, theMiddleLayer, and theOuterLayer.

{
  
  if (theInnerLayer->recHits().empty()) return;
  if (theMiddleLayer->recHits().empty()) return;
  if (theOuterLayer->recHits().empty()) return;
  float radius1 =dynamic_cast<const BarrelDetLayer*>(theInnerLayer->layer())->specificSurface().radius();
  float radius2 =dynamic_cast<const BarrelDetLayer*>(theMiddleLayer->layer())->specificSurface().radius();
  float radius3 =dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer())->specificSurface().radius();
  bool seedfromoverlaps=((std::abs(radius1-radius2)<0.1)|| (std::abs(radius3-radius2)<0.1))? true : false;
  std::vector<const TrackingRecHit*>::const_iterator ohh;
  std::vector<const TrackingRecHit*>::const_iterator mhh;
  std::vector<const TrackingRecHit*>::const_iterator ihh;

  std::string builderName = "WithTrackAngle";
  edm::ESHandle<TransientTrackingRecHitBuilder> builder;
  iSetup.get<TransientRecHitRecord>().get(builderName, builder);

  if(!seedfromoverlaps){
    for(ohh=theOuterLayer->recHits().begin();ohh!=theOuterLayer->recHits().end();ohh++){
      TkHitPairsCachedHit oh= builder->build(*ohh);
      for(mhh=theMiddleLayer->recHits().begin();mhh!=theMiddleLayer->recHits().end();mhh++){
        TkHitPairsCachedHit mh=  builder->build(*mhh);
        float z_diff =mh->globalPosition().z()-oh->globalPosition().z();
        float midy=mh->globalPosition().y();
        float outy=oh->globalPosition().y();
        float midx=mh->globalPosition().x();
        float outx=oh->globalPosition().x();
        float dxdy=std::abs((outx-midx)/(outy-midy));
        if((std::abs(z_diff)<30) && (outy*midy>0) &&(dxdy<2))     
          {
            for(ihh=theInnerLayer->recHits().begin();ihh!=theInnerLayer->recHits().end();ihh++){
              TkHitPairsCachedHit ih= builder->build(*ihh);
              float z_diff =mh->globalPosition().z()-ih->globalPosition().z();
              float inny=ih->globalPosition().y();
              float innx=ih->globalPosition().x();
              float dxdy=std::abs((innx-midx)/(inny-midy));
              if ((std::abs(z_diff)<30) && (inny*midy>0) &&(dxdy<2)&&(!seedfromoverlaps))
                {
                  result.push_back( OrderedHitTriplet(ih,mh,oh) );
                }
            } 
          }
      }
    }
  } else {
    for(ohh=theOuterLayer->recHits().begin();ohh!=theOuterLayer->recHits().end();ohh++){
      TkHitPairsCachedHit oh= builder->build(*ohh);
      for(mhh=theMiddleLayer->recHits().begin();mhh!=theMiddleLayer->recHits().end();mhh++){
        TkHitPairsCachedHit mh= builder->build(*mhh);
        float z_diff =mh->globalPosition().z()-oh->globalPosition().z();
        float midy=mh->globalPosition().y();
        float outy=oh->globalPosition().y();
        float midx=mh->globalPosition().x();
        float outx=oh->globalPosition().x();
        float dxdy=std::abs((outx-midx)/(outy-midy));
        float DeltaR=oh->globalPosition().perp()-mh->globalPosition().perp();
        if((std::abs(z_diff)<18) && (std::abs(oh->globalPosition().phi()-mh->globalPosition().phi())<0.05) &&(DeltaR<0)&&(dxdy<2)){
          for(ihh=theInnerLayer->recHits().begin();ihh!=theInnerLayer->recHits().end();ihh++){
            TkHitPairsCachedHit ih= builder->build(*ihh);
            float z_diff =mh->globalPosition().z()-ih->globalPosition().z();
            float inny=ih->globalPosition().y();
            float innx=ih->globalPosition().x();
            float dxdy=std::abs((innx-midx)/(inny-midy));
            if ((std::abs(z_diff)<30) && (inny*midy>0) &&(dxdy<2))
              {
                result.push_back( OrderedHitTriplet(ih,mh,oh));
              }
          }
        }
      }
    }
  }
}
void CosmicHitTripletGeneratorFromLayerTriplet::init ( const HitPairGenerator pairs,
const std::vector< const LayerWithHits * > &  layers 
) [inline]

Definition at line 36 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

                                                            {}
const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::innerLayer ( ) const [inline]

Definition at line 38 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

References theInnerLayer.

{ return theInnerLayer; }
const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::middleLayer ( ) const [inline]

Definition at line 39 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

References theMiddleLayer.

{ return theMiddleLayer; }
const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::outerLayer ( ) const [inline]

Definition at line 40 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

References theOuterLayer.

{ return theOuterLayer; }

Member Data Documentation

Definition at line 48 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Definition at line 50 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Definition at line 49 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Definition at line 47 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and innerLayer().

Definition at line 46 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and middleLayer().

Definition at line 45 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and outerLayer().

Definition at line 44 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Definition at line 43 of file CosmicHitTripletGeneratorFromLayerTriplet.h.