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.

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

10  edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
11  theMaxTheta = conf.getParameter<double>("maxTheta");
12  theMaxTheta = fabs(sin(theMaxTheta));
13 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Log< level::Info, false > LogInfo

◆ ~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.

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

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(ls[0]);
27  auto outerHits = region.hits(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 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:14
d
Definition: ztail.py:151
def ls(path, rec=False)
Definition: eostools.py:349
#define LogDebug(id)

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