CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< CombinedHitQuadrupletGeneratorForPhotonConversion
theHitsGenerator
 
std::unique_ptr
< GlobalTrackingRegionProducerFromBeamSpot
theRegionProducer
 
std::unique_ptr
< SeedForPhotonConversionFromQuadruplets
theSeedCreator
 
bool theSilentOnClusterCheck
 
edm::EDGetTokenT
< reco::VertexCollection
token_vertex
 
reco::VertexCollection vertexCollection
 
edm::Handle
< reco::VertexCollection
vertexHandle
 

Detailed Description

Definition at line 28 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Member Typedef Documentation

typedef Regions::const_iterator PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::IR
private

Constructor & Destructor Documentation

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

Definition at line 21 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

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 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::unique_ptr< CombinedHitQuadrupletGeneratorForPhotonConversion > theHitsGenerator
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( )

Definition at line 40 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

40  {
41 }

Member Function Documentation

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

Definition at line 43 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

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 }
Log< level::Error, false > LogError
std::vector< TrajectorySeed > TrajectorySeedCollection
size_t tooManyClusters(const edm::Event &e) const
void print(std::stringstream &ss, const SiStripCluster &clus)
bool isValid() const
Definition: HandleBase.h:70
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
tuple cout
Definition: gather_cfg.py:144
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::getTrajectorySeedCollection ( )
inline
bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::inspect ( const TrackingRegion region)
private

Definition at line 116 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by loop().

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 }
virtual unsigned int size() const =0
Log< level::Error, false > LogError
std::unique_ptr< CombinedHitQuadrupletGeneratorForPhotonConversion > theHitsGenerator
char const * what() const noexceptoverride
Definition: Exception.cc:103
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ phits
void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::loop ( )
private

Definition at line 91 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by analyze().

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 }
double zError() const
error on z
Definition: Vertex.h:141
constexpr float ptMin
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const Point & position() const
position
Definition: Vertex.h:127
Log< level::Info, false > LogInfo
double xError() const
error on x
Definition: Vertex.h:137

Member Data Documentation

const edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::_conf
private
const edm::EventSetup* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEsetup
private

Definition at line 71 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

const edm::Event* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEvent
private

Definition at line 72 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

PrintRecoObjects PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::po
private

Definition at line 74 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

reco::Vertex PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::primaryVertex
private

Definition at line 68 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by loop().

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::QuadCutPSet
private

Definition at line 55 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

Regions PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::regions
private

Definition at line 64 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::seedCollection
private
std::stringstream PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::ss
private
ClusterChecker PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theClusterCheck
private

Definition at line 54 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

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

Definition at line 58 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

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

Definition at line 60 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

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

Definition at line 59 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSilentOnClusterCheck
private

Definition at line 56 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

edm::EDGetTokenT<reco::VertexCollection> PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::token_vertex
private
reco::VertexCollection PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::vertexCollection
private
edm::Handle<reco::VertexCollection> PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::vertexHandle
private

Definition at line 66 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and loop().