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)
 
void clear ()
 
TrajectorySeedCollectiongetTrajectorySeedCollection ()
 
void init ()
 
 PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo (const edm::ParameterSet &)
 
 ~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
 
edm::ParameterSet creatorPSet
 
edm::ParameterSet hitsfactoryPSet
 
const edm::EventSetupmyEsetup
 
const edm::EventmyEvent
 
PrintRecoObjects po
 
reco::Vertex primaryVertex
 
edm::ParameterSet QuadCutPSet
 
edm::ParameterSet regfactoryPSet
 
Regions regions
 
TrajectorySeedCollectionseedCollection
 
edm::ParameterSet SeedComparitorPSet
 
std::stringstream ss
 
ClusterChecker theClusterCheck
 
CombinedHitQuadrupletGeneratorForPhotonConversiontheHitsGenerator
 
GlobalTrackingRegionProducerFromBeamSpottheRegionProducer
 
SeedForPhotonConversionFromQuadrupletstheSeedCreator
 
bool theSilentOnClusterCheck
 
reco::VertexCollection vertexCollection
 
edm::Handle
< reco::VertexCollection
vertexHandle
 

Detailed Description

Definition at line 29 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Member Typedef Documentation

typedef Regions::const_iterator PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::IR
private

Constructor & Destructor Documentation

PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( const edm::ParameterSet conf)

Definition at line 22 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

References init().

23  :_conf(conf),seedCollection(0),
24  hitsfactoryPSet(conf.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet")),
25  creatorPSet(conf.getParameter<edm::ParameterSet>("SeedCreatorPSet")),
26  regfactoryPSet(conf.getParameter<edm::ParameterSet>("RegionFactoryPSet")),
27  theClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet")),
28  SeedComparitorPSet(conf.getParameter<edm::ParameterSet>("SeedComparitorPSet")),
29  QuadCutPSet(conf.getParameter<edm::ParameterSet>("QuadCutPSet")),
30  theSilentOnClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false)){
31 
32  init();
33 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( )
inline

Member Function Documentation

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

Definition at line 53 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by PhotonConversionTrajectorySeedProducerFromQuadruplets::produce().

53  {
54 
55  myEsetup = &setup;
56  myEvent = &event;
57 
58  if(seedCollection!=0)
59  delete seedCollection;
60 
62 
63  size_t clustsOrZero = theClusterCheck.tooManyClusters(event);
64  if (clustsOrZero){
66  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
67  return ;
68  }
69 
70  regions = theRegionProducer->regions(event,setup);
71 
72  event.getByLabel(_conf.getParameter<edm::InputTag>("primaryVerticesTag"), vertexHandle);
73  if (!vertexHandle.isValid()){
74  edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _conf.getParameter<edm::InputTag>("primaryVerticesTag") << "\n";
75  return;
76  }
77 
78  //Do the analysis
79  loop();
80 
81 #ifdef mydebug_knuenz
82  std::cout << "Running PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo" <<std::endl;
83 #endif
84 
85 #ifdef debugTSPFSLA
86  std::stringstream ss;
87  ss.str("");
88  ss << "\n++++++++++++++++++\n";
89  ss << "seed collection size " << seedCollection->size();
90  BOOST_FOREACH(TrajectorySeed tjS,*seedCollection){
91  po.print(ss, tjS);
92  }
93  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
94  //-------------------------------------------------
95 #endif
96 }
T getParameter(std::string const &) const
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
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &) const
tuple cout
Definition: gather_cfg.py:121
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::clear ( void  )
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::getTrajectorySeedCollection ( )
inline
void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::init ( void  )

Definition at line 46 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

References creatorPSet, hitsfactoryPSet, regfactoryPSet, theHitsGenerator, theRegionProducer, and theSeedCreator.

Referenced by PhotonConversionTrajectorySeedProducerFromQuadruplets::beginRun(), and PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo().

46  {
50 }
bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::inspect ( const TrackingRegion region)
private

Definition at line 135 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

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

Referenced by loop().

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

Definition at line 100 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().

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

Member Data Documentation

const edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::_conf
private

Definition at line 57 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::creatorPSet
private

Definition at line 60 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by init().

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::hitsfactoryPSet
private

Definition at line 60 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by init().

const edm::EventSetup* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEsetup
private

Definition at line 78 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

const edm::Event* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::myEvent
private

Definition at line 79 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

PrintRecoObjects PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::po
private

Definition at line 81 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

reco::Vertex PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::primaryVertex
private

Definition at line 76 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by loop().

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::QuadCutPSet
private

Definition at line 62 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::regfactoryPSet
private

Definition at line 60 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by init().

Regions PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::regions
private

Definition at line 72 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::seedCollection
private
edm::ParameterSet PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::SeedComparitorPSet
private

Definition at line 62 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by inspect().

std::stringstream PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::ss
private
ClusterChecker PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theClusterCheck
private

Definition at line 61 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

CombinedHitQuadrupletGeneratorForPhotonConversion* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theHitsGenerator
private
GlobalTrackingRegionProducerFromBeamSpot* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theRegionProducer
private
SeedForPhotonConversionFromQuadruplets* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSeedCreator
private
bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::theSilentOnClusterCheck
private

Definition at line 63 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

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

Definition at line 74 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and loop().