CMS 3D CMS Logo

BeamHaloPairGenerator.cc
Go to the documentation of this file.
3 
7 
9  : theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(conf.getParameter<edm::InputTag>("LayerSrc"))) {
10  edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
11  theMaxTheta = conf.getParameter<double>("maxTheta");
12  theMaxTheta = fabs(sin(theMaxTheta));
13 }
14 
16  const edm::Event& e,
17  const edm::EventSetup& es) {
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 }
Vector3DBase
Definition: Vector3DBase.h:8
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
MessageLogger.h
edm
HLT enums.
Definition: AlignableModifier.h:19
SeedingHitSet::ConstRecHitPointer
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:10
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
SeedingLayerSetsHits
Definition: SeedingLayerSetsHits.h:18
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
SeedingHit
SeedingHitSet::ConstRecHitPointer SeedingHit
Definition: BeamHaloPairGenerator.cc:2
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
BeamHaloPairGenerator::hitPairs
OrderedHitPairs hitPairs
Definition: BeamHaloPairGenerator.h:24
SeedingLayerSetsHits.h
OrderedSeedingHits
Definition: OrderedSeedingHits.h:7
BeamHaloPairGenerator::BeamHaloPairGenerator
BeamHaloPairGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
Definition: BeamHaloPairGenerator.cc:8
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:84949
edm::EventSetup
Definition: EventSetup.h:57
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
TrackingRegion
Definition: TrackingRegion.h:41
ztail.d
d
Definition: ztail.py:151
BeamHaloPairGenerator::run
const OrderedSeedingHits & run(const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es) override
Definition: BeamHaloPairGenerator.cc:15
ConsumesCollector.h
cms::Exception
Definition: Exception.h:70
BeamHaloPairGenerator::theSeedingLayerToken
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Definition: BeamHaloPairGenerator.h:23
BeamHaloPairGenerator.h
OrderedHitPair
Definition: OrderedHitPair.h:6
edm::Event
Definition: Event.h:73
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37