CMS 3D CMS Logo

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

#include <BeamHaloPairGenerator.h>

Inheritance diagram for BeamHaloPairGenerator:
OrderedHitsGenerator

Public Member Functions

 BeamHaloPairGenerator (const edm::ParameterSet &conf)
 
virtual const OrderedSeedingHitsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
 
virtual ~BeamHaloPairGenerator ()
 
- Public Member Functions inherited from OrderedHitsGenerator
virtual void clear ()
 
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

Private Member Functions

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

Private Attributes

edm::ParameterSet conf_
 
OrderedHitPairs hitPairs
 
double theMaxTheta
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

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.

9  : conf_(conf){
10  edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
11  theMaxTheta=conf.getParameter<double>("maxTheta");
12  theMaxTheta=fabs(sin(theMaxTheta));
13 }
T getParameter(std::string const &) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual BeamHaloPairGenerator::~BeamHaloPairGenerator ( )
inlinevirtual

Definition at line 17 of file BeamHaloPairGenerator.h.

17 {};

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

16  {
17  edm::ParameterSet leyerPSet = conf_.getParameter<edm::ParameterSet>("LayerPSet");
18  SeedingLayerSetsBuilder lsBuilder(leyerPSet);
19  SeedingLayerSets lss = lsBuilder.layers(es);
20  return lss;
21 }
T getParameter(std::string const &) const
std::vector< std::vector< SeedingLayer > > SeedingLayerSets
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 edm::hlt::Exception, hitPairs, TrackingRegion::hits(), init(), LogDebug, python.rootplot.utilities::ls(), funct::sin(), theMaxTheta, and PV3DBase< T, PVType, FrameType >::theta().

26  {
27  hitPairs.clear();
28  SeedingLayerSets lss = init(es);
29  SeedingLayerSets::const_iterator iLss;
30  for (iLss = lss.begin(); iLss != lss.end(); iLss++){
31  SeedingLayers ls = *iLss;
32  if (ls.size() != 2){
33  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << ls.size() <<" layers in set instead of 2 ";
34  }
35  std::vector<SeedingHit> innerHits = region.hits(e, es, &ls[0]);
36  std::vector<SeedingHit> outerHits = region.hits(e, es, &ls[1]);
37  std::vector<SeedingHit>::const_iterator iOuterHit;
38  for (iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
39  std::vector<SeedingHit>::const_iterator iInnerHit;
40  for (iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
41  //do something in there... if necessary
42  const TransientTrackingRecHit::ConstRecHitPointer & crhpi = *iInnerHit;
43  const TransientTrackingRecHit::ConstRecHitPointer & crhpo = *iOuterHit;
44  GlobalVector d=crhpo->globalPosition() - crhpi->globalPosition();
45  double ABSsinDtheta = fabs(sin(d.theta()));
46  LogDebug("BeamHaloPairGenerator")<<"position1: "<<crhpo->globalPosition()
47  <<" position2: "<<crhpi->globalPosition()
48  <<" |sin(Dtheta)|: "<< ABSsinDtheta <<((ABSsinDtheta>theMaxTheta)?" skip":" keep");
49 
50  if (ABSsinDtheta>theMaxTheta) {;continue;}
51 
52  hitPairs.push_back(OrderedHitPair(*iInnerHit,
53  *iOuterHit));
54  }
55  }
56  }
57  return hitPairs;
58 }
#define LogDebug(id)
virtual Hits hits(const edm::Event &ev, const edm::EventSetup &es, const ctfseeding::SeedingLayer *layer) const =0
get hits from layer compatible with region constraints
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ctfseeding::SeedingLayerSets init(const edm::EventSetup &es)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
std::vector< SeedingLayer > SeedingLayers
std::vector< std::vector< SeedingLayer > > SeedingLayerSets

Member Data Documentation

edm::ParameterSet BeamHaloPairGenerator::conf_
private

Definition at line 23 of file BeamHaloPairGenerator.h.

Referenced by init().

OrderedHitPairs BeamHaloPairGenerator::hitPairs
private

Definition at line 24 of file BeamHaloPairGenerator.h.

Referenced by run().

double BeamHaloPairGenerator::theMaxTheta
private

Definition at line 25 of file BeamHaloPairGenerator.h.

Referenced by BeamHaloPairGenerator(), and run().