CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo Class Reference

#include <PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h>

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
TrajectorySeedCollectiongetTrajectorySeedCollection ()
 
 PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 
 ~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ()
 

Private Types

typedef Regions::const_iterator IR
 
typedef std::vector< std::unique_ptr< TrackingRegion > > Regions
 

Private Member Functions

bool inspect (const TrackingRegion &region)
 
void loop ()
 

Private Attributes

const edm::ParameterSet _conf
 
const edm::EventSetupmyEsetup
 
const edm::EventmyEvent
 
PrintRecoObjects po
 
reco::Vertex primaryVertex
 
edm::ParameterSet QuadCutPSet
 
Regions regions
 
TrajectorySeedCollectionseedCollection
 
std::stringstream ss
 
ClusterChecker theClusterCheck
 
std::unique_ptr< CombinedHitQuadrupletGeneratorForPhotonConversiontheHitsGenerator
 
std::unique_ptr< GlobalTrackingRegionProducerFromBeamSpottheRegionProducer
 
std::unique_ptr< SeedForPhotonConversionFromQuadrupletstheSeedCreator
 
bool theSilentOnClusterCheck
 
edm::EDGetTokenT< reco::VertexCollectiontoken_vertex
 
reco::VertexCollection vertexCollection
 
edm::Handle< reco::VertexCollectionvertexHandle
 

Detailed Description

Definition at line 28 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Member Typedef Documentation

◆ IR

typedef Regions::const_iterator PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::IR
private

◆ Regions

Constructor & Destructor Documentation

◆ PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo()

PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)

Definition at line 21 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

23  : _conf(conf),
24  seedCollection(nullptr),
25  theClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet"), iC),
26  QuadCutPSet(conf.getParameter<edm::ParameterSet>("QuadCutPSet")),
28  .getUntrackedParameter<bool>("silentClusterCheck", false)),
30  conf.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet"), iC)),
33  iC,
34  conf.getParameter<edm::ParameterSet>("SeedComparitorPSet"))),
36  new GlobalTrackingRegionProducerFromBeamSpot(conf.getParameter<edm::ParameterSet>("RegionFactoryPSet"), iC)) {
38 }

References _conf, edm::ParameterSet::getParameter(), and token_vertex.

◆ ~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo()

PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( )

Definition at line 40 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

40  {
41 }

Member Function Documentation

◆ analyze()

void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::analyze ( const edm::Event event,
const edm::EventSetup setup 
)

Definition at line 43 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

44  {
45  myEsetup = &setup;
46  myEvent = &event;
47 
48  if (seedCollection != nullptr)
49  delete seedCollection;
50 
52 
53  size_t clustsOrZero = theClusterCheck.tooManyClusters(event);
54  if (clustsOrZero) {
56  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
57  return;
58  }
59 
60  // Why is the regions variable (and theRegionProducer) needed at all?
61  regions = theRegionProducer->regions(event, setup);
62 
63  event.getByToken(token_vertex, vertexHandle);
64  if (!vertexHandle.isValid()) {
65  edm::LogError("PhotonConversionFinderFromTracks")
66  << "Error! Can't get the product primary Vertex Collection "
67  << _conf.getParameter<edm::InputTag>("primaryVerticesTag") << "\n";
68  return;
69  }
70 
71  //Do the analysis
72  loop();
73 
74 #ifdef mydebug_knuenz
75  std::cout << "Running PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo" << std::endl;
76 #endif
77 
78 #ifdef debugTSPFSLA
79  std::stringstream ss;
80  ss.str("");
81  ss << "\n++++++++++++++++++\n";
82  ss << "seed collection size " << seedCollection->size();
83  for (auto const& tjS : *seedCollection) {
84  po.print(ss, tjS);
85  }
86  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
87  //-------------------------------------------------
88 #endif
89 }

References _conf, gather_cfg::cout, event(), edm::ParameterSet::getParameter(), edm::HandleBase::isValid(), loop(), myEsetup, myEvent, po, PrintRecoObjects::print(), regions, seedCollection, singleTopDQM_cfi::setup, ss, theClusterCheck, theRegionProducer, theSilentOnClusterCheck, token_vertex, ClusterChecker::tooManyClusters(), and vertexHandle.

◆ getTrajectorySeedCollection()

TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::getTrajectorySeedCollection ( )
inline

Definition at line 34 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

34 { return seedCollection; }

References seedCollection.

◆ inspect()

bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::inspect ( const TrackingRegion region)
private

Definition at line 116 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

116  {
117  const OrderedSeedingHits& hitss = theHitsGenerator->run(region, *myEvent, *myEsetup);
118 
119  unsigned int nHitss = hitss.size();
120 
121 #ifdef debugTSPFSLA
122  ss << "\n nHitss " << nHitss << "\n";
123 #endif
124 
125  // don't do multiple reserves in the case of multiple regions: it would make things even worse
126  // as it will cause N re-allocations instead of the normal log(N)/log(2)
127  if (seedCollection->empty())
128  seedCollection->reserve(nHitss / 2);
129 
130  unsigned int iHits = 0, jHits = 1;
131 
132  //
133  // Trivial arbitration
134  //
135  // Vector to store old quad values
136  std::vector<Quad> quadVector;
137 
138  for (; iHits < nHitss && jHits < nHitss; iHits += 2, jHits += 2) {
139 #ifdef debugTSPFSLA
140  // ss << "\n iHits " << iHits << " " << jHits << "\n";
141 #endif
142  //phits is the pair of hits for the positron
143  const SeedingHitSet& phits = hitss[iHits];
144  //mhits is the pair of hits for the electron
145  const SeedingHitSet& mhits = hitss[jHits];
146 
147  try {
148  //FIXME (modify the interface of the seed generator if needed)
149  //passing the region, that is centered around the primary vertex
150  theSeedCreator->trajectorySeed(
151  *seedCollection, phits, mhits, region, *myEvent, *myEsetup, ss, quadVector, QuadCutPSet);
152  } catch (cms::Exception& er) {
153  edm::LogError("SeedingConversion") << " Problem in the Quad Seed creator " << er.what() << std::endl;
154  } catch (std::exception& er) {
155  edm::LogError("SeedingConversion") << " Problem in the Quad Seed creator " << er.what() << std::endl;
156  }
157  }
158  quadVector.clear();
159  return true;
160 }

References cppFunctionSkipper::exception, myEsetup, myEvent, QuadCutPSet, HLT_2018_cff::region, seedCollection, OrderedSeedingHits::size(), ss, theHitsGenerator, theSeedCreator, and cms::Exception::what().

Referenced by loop().

◆ loop()

void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::loop ( )
private

Definition at line 91 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

91  {
92  ss.str("");
93 
94  float ptMin = 0.1;
95 
96  for (auto const& primaryVertex : *vertexHandle) {
97  //FIXME currnetly using the first primaryVertex, should loop on the promaryVertexes
99  ptMin,
101  primaryVertex.xError() * 10,
102  primaryVertex.zError() * 10,
103  true);
104 
105 #ifdef debugTSPFSLA
106  ss << "[PrintRegion] " << region.print() << std::endl;
107 #endif
108 
109  inspect(region);
110  }
111 #ifdef debugTSPFSLA
112  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
113 #endif
114 }

References inspect(), reco::Vertex::position(), primaryVertex, ptMin, HLT_2018_cff::region, ss, vertexHandle, reco::Vertex::xError(), and reco::Vertex::zError().

Referenced by analyze().

Member Data Documentation

◆ _conf

const edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::_conf
private

◆ myEsetup

const edm::EventSetup* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEsetup
private

Definition at line 71 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

◆ myEvent

const edm::Event* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEvent
private

Definition at line 72 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

◆ po

PrintRecoObjects PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::po
private

Definition at line 74 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

◆ primaryVertex

reco::Vertex PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::primaryVertex
private

Definition at line 68 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by loop().

◆ QuadCutPSet

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::QuadCutPSet
private

Definition at line 55 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

◆ regions

Regions PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::regions
private

Definition at line 64 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

◆ seedCollection

TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::seedCollection
private

◆ ss

std::stringstream PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::ss
private

◆ theClusterCheck

ClusterChecker PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theClusterCheck
private

Definition at line 54 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

◆ theHitsGenerator

std::unique_ptr<CombinedHitQuadrupletGeneratorForPhotonConversion> PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theHitsGenerator
private

Definition at line 58 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

◆ theRegionProducer

std::unique_ptr<GlobalTrackingRegionProducerFromBeamSpot> PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theRegionProducer
private

Definition at line 60 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

◆ theSeedCreator

std::unique_ptr<SeedForPhotonConversionFromQuadruplets> PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSeedCreator
private

Definition at line 59 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

◆ theSilentOnClusterCheck

bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSilentOnClusterCheck
private

Definition at line 56 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

◆ token_vertex

edm::EDGetTokenT<reco::VertexCollection> PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::token_vertex
private

◆ vertexCollection

reco::VertexCollection PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::vertexCollection
private

◆ vertexHandle

edm::Handle<reco::VertexCollection> PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::vertexHandle
private

Definition at line 66 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and loop().

PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::po
PrintRecoObjects po
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:74
TrajectorySeedCollection
std::vector< TrajectorySeed > TrajectorySeedCollection
Definition: TrajectorySeedCollection.h:6
PrintRecoObjects::print
void print(std::stringstream &ss, const SiStripCluster &clus)
Definition: PrintRecoObjects.cc:5
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theHitsGenerator
std::unique_ptr< CombinedHitQuadrupletGeneratorForPhotonConversion > theHitsGenerator
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:58
SeedingHitSet
Definition: SeedingHitSet.h:6
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::seedCollection
TrajectorySeedCollection * seedCollection
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:53
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:153
reco::Vertex::position
const Point & position() const
position
Definition: Vertex.h:114
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::vertexHandle
edm::Handle< reco::VertexCollection > vertexHandle
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:66
cms::Exception::what
char const * what() const noexcept override
Definition: Exception.cc:103
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::_conf
const edm::ParameterSet _conf
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:51
GlobalTrackingRegion
Definition: GlobalTrackingRegion.h:13
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSeedCreator
std::unique_ptr< SeedForPhotonConversionFromQuadruplets > theSeedCreator
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:59
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::regions
Regions regions
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:64
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEsetup
const edm::EventSetup * myEsetup
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:71
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::primaryVertex
reco::Vertex primaryVertex
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:68
reco::Vertex::xError
double xError() const
error on x
Definition: Vertex.h:124
CombinedHitQuadrupletGeneratorForPhotonConversion
Definition: CombinedHitQuadrupletGeneratorForPhotonConversion.h:28
OrderedSeedingHits
Definition: OrderedSeedingHits.h:7
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theRegionProducer
std::unique_ptr< GlobalTrackingRegionProducerFromBeamSpot > theRegionProducer
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:60
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::loop
void loop()
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc:91
reco::Vertex::zError
double zError() const
error on z
Definition: Vertex.h:128
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
OrderedSeedingHits::size
virtual unsigned int size() const =0
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::QuadCutPSet
edm::ParameterSet QuadCutPSet
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::inspect
bool inspect(const TrackingRegion &region)
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc:116
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::token_vertex
edm::EDGetTokenT< reco::VertexCollection > token_vertex
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:69
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
SeedForPhotonConversionFromQuadruplets
Definition: SeedForPhotonConversionFromQuadruplets.h:20
cms::Exception
Definition: Exception.h:70
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
event
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of "!*" before the partial wildcard feature was incorporated). The per-event "cost" of each negative criterion with multiple relevant triggers is about the same as ! *was in the past
ClusterChecker::tooManyClusters
size_t tooManyClusters(const edm::Event &e) const
Definition: ClusterChecker.cc:44
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEvent
const edm::Event * myEvent
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:72
edm::InputTag
Definition: InputTag.h:15
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theClusterCheck
ClusterChecker theClusterCheck
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:54
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::ss
std::stringstream ss
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:76
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSilentOnClusterCheck
bool theSilentOnClusterCheck
Definition: PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h:56
GlobalTrackingRegionProducerFromBeamSpot
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:16