CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
< 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 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(0),
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.

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, HcalObjRepresent::setup(), ss, theClusterCheck, theRegionProducer, theSilentOnClusterCheck, token_vertex, ClusterChecker::tooManyClusters(), and vertexHandle.

Referenced by PhotonConversionTrajectorySeedProducerFromQuadruplets::produce().

41  {
42 
43  myEsetup = &setup;
44  myEvent = &event;
45 
46  if(seedCollection!=0)
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  regions = theRegionProducer->regions(event,setup);
59 
60  event.getByToken(token_vertex, vertexHandle);
61  if (!vertexHandle.isValid()){
62  edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _conf.getParameter<edm::InputTag>("primaryVerticesTag") << "\n";
63  return;
64  }
65 
66  //Do the analysis
67  loop();
68 
69 #ifdef mydebug_knuenz
70  std::cout << "Running PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo" <<std::endl;
71 #endif
72 
73 #ifdef debugTSPFSLA
74  std::stringstream ss;
75  ss.str("");
76  ss << "\n++++++++++++++++++\n";
77  ss << "seed collection size " << seedCollection->size();
78  BOOST_FOREACH(TrajectorySeed tjS,*seedCollection){
79  po.print(ss, tjS);
80  }
81  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
82  //-------------------------------------------------
83 #endif
84 }
T getParameter(std::string const &) const
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:76
tuple cout
Definition: gather_cfg.py:121
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::getTrajectorySeedCollection ( )
inline
bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::inspect ( const TrackingRegion region)
private

Definition at line 123 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by loop().

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

Definition at line 88 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by analyze().

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

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