CMS 3D CMS Logo

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)
 
const OrderedSeedingHitsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es) override
 
 ~BeamHaloPairGenerator () override
 
- Public Member Functions inherited from OrderedHitsGenerator
virtual void clear ()
 
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

Private Attributes

OrderedHitPairs hitPairs
 
double theMaxTheta
 
edm::EDGetTokenT< SeedingLayerSetsHitstheSeedingLayerToken
 

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 9 of file BeamHaloPairGenerator.cc.

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

9  :
11 {
12  edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
13  theMaxTheta=conf.getParameter<double>("maxTheta");
14  theMaxTheta=fabs(sin(theMaxTheta));
15 }
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
BeamHaloPairGenerator::~BeamHaloPairGenerator ( )
inlineoverride

Definition at line 19 of file BeamHaloPairGenerator.h.

References ev, and run().

19 {};

Member Function Documentation

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

Implements OrderedHitsGenerator.

Definition at line 18 of file BeamHaloPairGenerator.cc.

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

Referenced by ~BeamHaloPairGenerator().

20  {
21  hitPairs.clear();
23  e.getByToken(theSeedingLayerToken, hlayers);
24  const SeedingLayerSetsHits& layers = *hlayers;
25  if(layers.numberOfLayersInSet() != 2)
26  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << layers.numberOfLayersInSet() <<" layers in set instead of 2 ";
28  auto innerHits = region.hits(es, ls[0]);
29  auto outerHits = region.hits(es, ls[1]);
30 
31  for (auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
32  for (auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
33  //do something in there... if necessary
34  SeedingHitSet::ConstRecHitPointer crhpi = &(**iInnerHit);
35  SeedingHitSet::ConstRecHitPointer crhpo = &(**iOuterHit);
36  GlobalVector d=crhpo->globalPosition() - crhpi->globalPosition();
37  double ABSsinDtheta = fabs(sin(d.theta()));
38  LogDebug("BeamHaloPairGenerator")<<"position1: "<<crhpo->globalPosition()
39  <<" position2: "<<crhpi->globalPosition()
40  <<" |sin(Dtheta)|: "<< ABSsinDtheta <<((ABSsinDtheta>theMaxTheta)?" skip":" keep");
41 
42  if (ABSsinDtheta>theMaxTheta) {;continue;}
43 
44  hitPairs.push_back(OrderedHitPair(crhpi,
45  crhpo));
46  }
47  }
48  }
49  return hitPairs;
50 }
#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
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:11
def ls(path, rec=False)
Definition: eostools.py:349
virtual Hits hits(const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints

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