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 Attributes
BeamHaloPairGenerator Class Reference

#include <BeamHaloPairGenerator.h>

Inheritance diagram for BeamHaloPairGenerator:
OrderedHitsGenerator

Public Member Functions

 BeamHaloPairGenerator (const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
 
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 Attributes

OrderedHitPairs hitPairs
 
SeedingLayerSetsBuilder theLayerBuilder
 
ctfseeding::SeedingLayerSets theLss
 
double theMaxTheta
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Definition at line 15 of file BeamHaloPairGenerator.h.

Constructor & Destructor Documentation

BeamHaloPairGenerator::BeamHaloPairGenerator ( const edm::ParameterSet conf,
edm::ConsumesCollector iC 
)

Definition at line 8 of file BeamHaloPairGenerator.cc.

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

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

Definition at line 18 of file BeamHaloPairGenerator.h.

18 {};

Member Function Documentation

const OrderedSeedingHits & BeamHaloPairGenerator::run ( const TrackingRegion region,
const edm::Event ev,
const edm::EventSetup es 
)
virtual

Implements OrderedHitsGenerator.

Definition at line 17 of file BeamHaloPairGenerator.cc.

References SeedingLayerSetsBuilder::check(), edm::hlt::Exception, hitPairs, TrackingRegion::hits(), SeedingLayerSetsBuilder::layers(), LogDebug, python.rootplot.utilities::ls(), funct::sin(), theLayerBuilder, theLss, theMaxTheta, and PV3DBase< T, PVType, FrameType >::theta().

19  {
20  hitPairs.clear();
21  if(theLayerBuilder.check(es)) {
23  }
24  SeedingLayerSets::const_iterator iLss;
25  for (iLss = theLss.begin(); iLss != theLss.end(); iLss++){
26  SeedingLayers ls = *iLss;
27  if (ls.size() != 2){
28  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << ls.size() <<" layers in set instead of 2 ";
29  }
30  std::vector<SeedingHit> innerHits = region.hits(e, es, &ls[0]);
31  std::vector<SeedingHit> outerHits = region.hits(e, es, &ls[1]);
32  std::vector<SeedingHit>::const_iterator iOuterHit;
33  for (iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
34  std::vector<SeedingHit>::const_iterator iInnerHit;
35  for (iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
36  //do something in there... if necessary
37  const TransientTrackingRecHit::ConstRecHitPointer & crhpi = *iInnerHit;
38  const TransientTrackingRecHit::ConstRecHitPointer & crhpo = *iOuterHit;
39  GlobalVector d=crhpo->globalPosition() - crhpi->globalPosition();
40  double ABSsinDtheta = fabs(sin(d.theta()));
41  LogDebug("BeamHaloPairGenerator")<<"position1: "<<crhpo->globalPosition()
42  <<" position2: "<<crhpi->globalPosition()
43  <<" |sin(Dtheta)|: "<< ABSsinDtheta <<((ABSsinDtheta>theMaxTheta)?" skip":" keep");
44 
45  if (ABSsinDtheta>theMaxTheta) {;continue;}
46 
47  hitPairs.push_back(OrderedHitPair(*iInnerHit,
48  *iOuterHit));
49  }
50  }
51  }
52  return hitPairs;
53 }
#define LogDebug(id)
ctfseeding::SeedingLayerSets layers(const edm::EventSetup &es)
SeedingLayerSetsBuilder theLayerBuilder
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
bool check(const edm::EventSetup &es)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
ctfseeding::SeedingLayerSets theLss
std::vector< SeedingLayer > SeedingLayers

Member Data Documentation

OrderedHitPairs BeamHaloPairGenerator::hitPairs
private

Definition at line 25 of file BeamHaloPairGenerator.h.

Referenced by run().

SeedingLayerSetsBuilder BeamHaloPairGenerator::theLayerBuilder
private

Definition at line 23 of file BeamHaloPairGenerator.h.

Referenced by run().

ctfseeding::SeedingLayerSets BeamHaloPairGenerator::theLss
private

Definition at line 24 of file BeamHaloPairGenerator.h.

Referenced by run().

double BeamHaloPairGenerator::theMaxTheta
private

Definition at line 26 of file BeamHaloPairGenerator.h.

Referenced by BeamHaloPairGenerator(), and run().