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
 
double theMaxTheta
 
edm::EDGetTokenT
< SeedingLayerSetsHits
theSeedingLayerToken
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Definition at line 16 of file BeamHaloPairGenerator.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file BeamHaloPairGenerator.cc.

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

10  :
12 {
13  edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
14  theMaxTheta=conf.getParameter<double>("maxTheta");
15  theMaxTheta=fabs(sin(theMaxTheta));
16 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
virtual BeamHaloPairGenerator::~BeamHaloPairGenerator ( )
inlinevirtual

Definition at line 19 of file BeamHaloPairGenerator.h.

19 {};

Member Function Documentation

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

Implements OrderedHitsGenerator.

Definition at line 19 of file BeamHaloPairGenerator.cc.

References ztail::d, edm::Event::getByToken(), hitPairs, TrackingRegion::hits(), LayerTriplets::layers(), LogDebug, python.rootplot.utilities::ls(), SeedingLayerSetsHits::numberOfLayersInSet(), funct::sin(), theMaxTheta, theSeedingLayerToken, and PV3DBase< T, PVType, FrameType >::theta().

21  {
22  hitPairs.clear();
24  e.getByToken(theSeedingLayerToken, hlayers);
25  const SeedingLayerSetsHits& layers = *hlayers;
26  if(layers.numberOfLayersInSet() != 2)
27  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << layers.numberOfLayersInSet() <<" layers in set instead of 2 ";
29  auto innerHits = region.hits(e, es, ls[0]);
30  auto outerHits = region.hits(e, es, ls[1]);
31 
32  for (auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
33  for (auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
34  //do something in there... if necessary
35  SeedingHitSet::ConstRecHitPointer crhpi = &(**iInnerHit);
36  SeedingHitSet::ConstRecHitPointer crhpo = &(**iOuterHit);
37  GlobalVector d=crhpo->globalPosition() - crhpi->globalPosition();
38  double ABSsinDtheta = fabs(sin(d.theta()));
39  LogDebug("BeamHaloPairGenerator")<<"position1: "<<crhpo->globalPosition()
40  <<" position2: "<<crhpi->globalPosition()
41  <<" |sin(Dtheta)|: "<< ABSsinDtheta <<((ABSsinDtheta>theMaxTheta)?" skip":" keep");
42 
43  if (ABSsinDtheta>theMaxTheta) {;continue;}
44 
45  hitPairs.push_back(OrderedHitPair(crhpi,
46  crhpo));
47  }
48  }
49  }
50  return hitPairs;
51 }
#define LogDebug(id)
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual Hits hits(const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
tuple d
Definition: ztail.py:151
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:11

Member Data Documentation

OrderedHitPairs BeamHaloPairGenerator::hitPairs
private

Definition at line 25 of file BeamHaloPairGenerator.h.

Referenced by run().

double BeamHaloPairGenerator::theMaxTheta
private

Definition at line 26 of file BeamHaloPairGenerator.h.

Referenced by BeamHaloPairGenerator(), and run().

edm::EDGetTokenT<SeedingLayerSetsHits> BeamHaloPairGenerator::theSeedingLayerToken
private

Definition at line 24 of file BeamHaloPairGenerator.h.

Referenced by run().