CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

BeamHaloPairGenerator Class Reference

#include <BeamHaloPairGenerator.h>

Inheritance diagram for BeamHaloPairGenerator:
OrderedHitsGenerator

List of all members.

Public Member Functions

 BeamHaloPairGenerator (const edm::ParameterSet &conf)
virtual const OrderedSeedingHitsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
virtual ~BeamHaloPairGenerator ()

Private Member Functions

ctfseeding::SeedingLayerSets init (const edm::EventSetup &es)

Private Attributes

edm::ParameterSet conf_
OrderedHitPairs hitPairs
double theMaxTheta

Detailed Description

Definition at line 14 of file BeamHaloPairGenerator.h.


Constructor & Destructor Documentation

BeamHaloPairGenerator::BeamHaloPairGenerator ( const edm::ParameterSet conf)

Definition at line 9 of file BeamHaloPairGenerator.cc.

References edm::ParameterSet::getParameter(), funct::sin(), and theMaxTheta.

                                                                       : conf_(conf){
        edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
        theMaxTheta=conf.getParameter<double>("maxTheta");
        theMaxTheta=fabs(sin(theMaxTheta));
} 
virtual BeamHaloPairGenerator::~BeamHaloPairGenerator ( ) [inline, virtual]

Definition at line 17 of file BeamHaloPairGenerator.h.

{};

Member Function Documentation

SeedingLayerSets BeamHaloPairGenerator::init ( const edm::EventSetup es) [private]

Definition at line 16 of file BeamHaloPairGenerator.cc.

References conf_, and edm::ParameterSet::getParameter().

Referenced by run().

                                                                   {
        edm::ParameterSet leyerPSet = conf_.getParameter<edm::ParameterSet>("LayerPSet");
        SeedingLayerSetsBuilder lsBuilder(leyerPSet);
        SeedingLayerSets lss = lsBuilder.layers(es);
        return lss;     
}
const OrderedSeedingHits & BeamHaloPairGenerator::run ( const TrackingRegion region,
const edm::Event ev,
const edm::EventSetup es 
) [virtual]

Implements OrderedHitsGenerator.

Definition at line 24 of file BeamHaloPairGenerator.cc.

References Exception, hitPairs, TrackingRegion::hits(), init(), LogDebug, python::rootplot::utilities::ls(), funct::sin(), theMaxTheta, and PV3DBase< T, PVType, FrameType >::theta().

                                                                            {
        hitPairs.clear();
        SeedingLayerSets lss = init(es);
        SeedingLayerSets::const_iterator iLss;
        for (iLss = lss.begin(); iLss != lss.end(); iLss++){
                SeedingLayers ls = *iLss;
                if (ls.size() != 2){
                        throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << ls.size() <<" layers in set instead of 2 ";
                }       
                std::vector<SeedingHit> innerHits  = region.hits(e, es, &ls[0]);
                std::vector<SeedingHit> outerHits  = region.hits(e, es, &ls[1]);
                std::vector<SeedingHit>::const_iterator iOuterHit;
                for (iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
                        std::vector<SeedingHit>::const_iterator iInnerHit;
                        for (iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
                          //do something in there... if necessary
                          const TransientTrackingRecHit::ConstRecHitPointer & crhpi = *iInnerHit;
                          const TransientTrackingRecHit::ConstRecHitPointer & crhpo =  *iOuterHit;
                          GlobalVector d=crhpo->globalPosition() - crhpi->globalPosition();
                          double ABSsinDtheta = fabs(sin(d.theta()));
                          LogDebug("BeamHaloPairGenerator")<<"position1: "<<crhpo->globalPosition()
                                                           <<" position2: "<<crhpi->globalPosition()
                                                           <<" |sin(Dtheta)|: "<< ABSsinDtheta <<((ABSsinDtheta>theMaxTheta)?" skip":" keep");

                          if (ABSsinDtheta>theMaxTheta) {;continue;}

                          hitPairs.push_back(OrderedHitPair(*iInnerHit,
                                                            *iOuterHit));
                        }
                }
        }
        return hitPairs;
}

Member Data Documentation

Definition at line 23 of file BeamHaloPairGenerator.h.

Referenced by init().

Definition at line 24 of file BeamHaloPairGenerator.h.

Referenced by run().

Definition at line 25 of file BeamHaloPairGenerator.h.

Referenced by BeamHaloPairGenerator(), and run().