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 30 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 22 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

24  :_conf(conf),seedCollection(nullptr),
25  theClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet"), iC),
26  QuadCutPSet(conf.getParameter<edm::ParameterSet>("QuadCutPSet")),
27  theSilentOnClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false)),
30  iC,
31  conf.getParameter<edm::ParameterSet>("SeedComparitorPSet"))),
33 
35 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
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
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( )

Definition at line 37 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

References analyze().

37  {
38 }

Member Function Documentation

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

Definition at line 41 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by ~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo().

41  {
42 
43  myEsetup = &setup;
44  myEvent = &event;
45 
46  if(seedCollection!=nullptr)
47  delete seedCollection;
48 
50 
51  size_t clustsOrZero = theClusterCheck.tooManyClusters(event);
52  if (clustsOrZero){
54  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
55  return ;
56  }
57 
58  // Why is the regions variable (and theRegionProducer) needed at all?
59  regions = theRegionProducer->regions(event,setup);
60 
61  event.getByToken(token_vertex, vertexHandle);
62  if (!vertexHandle.isValid()){
63  edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _conf.getParameter<edm::InputTag>("primaryVerticesTag") << "\n";
64  return;
65  }
66 
67  //Do the analysis
68  loop();
69 
70 #ifdef mydebug_knuenz
71  std::cout << "Running PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo" <<std::endl;
72 #endif
73 
74 #ifdef debugTSPFSLA
75  std::stringstream ss;
76  ss.str("");
77  ss << "\n++++++++++++++++++\n";
78  ss << "seed collection size " << seedCollection->size();
79  BOOST_FOREACH(TrajectorySeed tjS,*seedCollection){
80  po.print(ss, tjS);
81  }
82  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
83  //-------------------------------------------------
84 #endif
85 }
T getParameter(std::string const &) const
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
return((rh^lh)&mask)
std::vector< TrajectorySeed > TrajectorySeedCollection
size_t tooManyClusters(const edm::Event &e) const
void print(std::stringstream &ss, const SiStripCluster &clus)
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
bool isValid() const
Definition: HandleBase.h:74
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::getTrajectorySeedCollection ( )
inline
bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::inspect ( const TrackingRegion region)
private

Definition at line 124 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by getTrajectorySeedCollection(), and loop().

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

Definition at line 89 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by analyze(), and getTrajectorySeedCollection().

89  {
90 
91 
92  ss.str("");
93 
94  float ptMin=0.1;
95 
96  BOOST_FOREACH(const reco::Vertex primaryVertex, *vertexHandle){
97 
98  //FIXME currnetly using the first primaryVertex, should loop on the promaryVertexes
99  GlobalTrackingRegion region(ptMin
100  ,GlobalPoint(
101  primaryVertex.position().x(),
102  primaryVertex.position().y(),
103  primaryVertex.position().z()
104  )
105  ,primaryVertex.xError()*10
106  ,primaryVertex.zError()*10
107  ,true
108  );
109 
110 #ifdef debugTSPFSLA
111  ss << "[PrintRegion] " << region.print() << std::endl;
112 #endif
113 
114  inspect(region);
115 
116  }
117 #ifdef debugTSPFSLA
118  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
119 #endif
120 }
double zError() const
error on z
Definition: Vertex.h:123
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const Point & position() const
position
Definition: Vertex.h:109
double xError() const
error on x
Definition: Vertex.h:119

Member Data Documentation

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

Definition at line 77 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

const edm::Event* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEvent
private

Definition at line 78 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

PrintRecoObjects PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::po
private

Definition at line 80 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

reco::Vertex PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::primaryVertex
private

Definition at line 74 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by loop().

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::QuadCutPSet
private

Definition at line 60 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

Regions PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::regions
private

Definition at line 70 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

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

Definition at line 59 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

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

Definition at line 63 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

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

Definition at line 65 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

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

Definition at line 64 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSilentOnClusterCheck
private

Definition at line 61 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 72 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and loop().