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

Definition at line 8 of file BeamHaloPairGenerator.cc.

10  edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
11  theMaxTheta = conf.getParameter<double>("maxTheta");
12  theMaxTheta = fabs(sin(theMaxTheta));
13 }

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

◆ ~BeamHaloPairGenerator()

BeamHaloPairGenerator::~BeamHaloPairGenerator ( )
inlineoverride

Definition at line 19 of file BeamHaloPairGenerator.h.

19 {};

Member Function Documentation

◆ run()

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

Implements OrderedHitsGenerator.

Definition at line 15 of file BeamHaloPairGenerator.cc.

17  {
18  hitPairs.clear();
20  e.getByToken(theSeedingLayerToken, hlayers);
21  const SeedingLayerSetsHits& layers = *hlayers;
22  if (layers.numberOfLayersInSet() != 2)
23  throw cms::Exception("CtfSpecialSeedGenerator")
24  << "You are using " << layers.numberOfLayersInSet() << " layers in set instead of 2 ";
26  auto innerHits = region.hits(es, ls[0]);
27  auto outerHits = region.hits(es, ls[1]);
28 
29  for (auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++) {
30  for (auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++) {
31  //do something in there... if necessary
32  SeedingHitSet::ConstRecHitPointer crhpi = &(**iInnerHit);
33  SeedingHitSet::ConstRecHitPointer crhpo = &(**iOuterHit);
34  GlobalVector d = crhpo->globalPosition() - crhpi->globalPosition();
35  double ABSsinDtheta = fabs(sin(d.theta()));
36  LogDebug("BeamHaloPairGenerator")
37  << "position1: " << crhpo->globalPosition() << " position2: " << crhpi->globalPosition()
38  << " |sin(Dtheta)|: " << ABSsinDtheta << ((ABSsinDtheta > theMaxTheta) ? " skip" : " keep");
39 
40  if (ABSsinDtheta > theMaxTheta) {
41  continue;
42  }
43 
44  hitPairs.push_back(OrderedHitPair(crhpi, crhpo));
45  }
46  }
47  }
48  return hitPairs;
49 }

References ztail::d, MillePedeFileConverter_cfg::e, hitPairs, hgcalTopologyTester_cfi::layers, LogDebug, eostools::ls(), HLT_FULL_cff::region, funct::sin(), theMaxTheta, and theSeedingLayerToken.

Member Data Documentation

◆ hitPairs

OrderedHitPairs BeamHaloPairGenerator::hitPairs
private

Definition at line 24 of file BeamHaloPairGenerator.h.

Referenced by run().

◆ theMaxTheta

double BeamHaloPairGenerator::theMaxTheta
private

Definition at line 25 of file BeamHaloPairGenerator.h.

Referenced by BeamHaloPairGenerator(), and run().

◆ theSeedingLayerToken

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

Definition at line 23 of file BeamHaloPairGenerator.h.

Referenced by run().

Vector3DBase
Definition: Vector3DBase.h:8
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
SeedingHitSet::ConstRecHitPointer
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:10
SeedingLayerSetsHits
Definition: SeedingLayerSetsHits.h:18
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
BeamHaloPairGenerator::hitPairs
OrderedHitPairs hitPairs
Definition: BeamHaloPairGenerator.h:24
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88267
SeedingLayerSetsHits::SeedingLayerSet
Definition: SeedingLayerSetsHits.h:65
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
BeamHaloPairGenerator::theMaxTheta
double theMaxTheta
Definition: BeamHaloPairGenerator.h:25
ztail.d
d
Definition: ztail.py:151
cms::Exception
Definition: Exception.h:70
BeamHaloPairGenerator::theSeedingLayerToken
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Definition: BeamHaloPairGenerator.h:23
OrderedHitPair
Definition: OrderedHitPair.h:6
edm::InputTag
Definition: InputTag.h:15
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37