CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripElectronAlgo.h
Go to the documentation of this file.
1 #ifndef EgammaElectronAlgos_SiStripElectronAlgo_h
2 #define EgammaElectronAlgos_SiStripElectronAlgo_h
3 // -*- C++ -*-
4 //
5 // Package: EgammaElectronAlgos
6 // Class : SiStripElectronAlgo
7 //
16 //
17 // Original Author: Jim Pivarski
18 // Created: Fri May 26 16:11:58 EDT 2006
19 // $Id: SiStripElectronAlgo.h,v 1.17 2011/03/21 17:10:32 innocent Exp $
20 //
21 
22 // system include files
23 
24 #include <map>
25 
26 // user include files
27 
28 // forward declarations
29 
55 
57 {
58 
59  public:
60  SiStripElectronAlgo(unsigned int maxHitsOnDetId,
61  double originUncertainty,
62  double phiBandWidth,
63  double maxNormResid,
64  unsigned int minHits,
65  double maxReducedChi2);
66 
67  virtual ~SiStripElectronAlgo();
68 
69  // ---------- const member functions ---------------------
70 
71  // ---------- static member functions --------------------
72 
73  // ---------- member functions ---------------------------
74 
79  const edm::ESHandle<MagneticField>& magneticField);
80 
81  // returns true iff an electron/positron was found
82  // and inserts SiStripElectron and trackCandidate into electronOut and trackCandidateOut
84  TrackCandidateCollection& trackCandidateOut,
85  const reco::SuperClusterRef& superclusterIn);
86 
87  private:
88  SiStripElectronAlgo(const SiStripElectronAlgo&); // stop default
89 
90  const SiStripElectronAlgo& operator=(const SiStripElectronAlgo&); // stop default
91 
92  // inserts pointers to good hits into hitPointersOut
93  // selects hits on DetIds that have no more than maxHitsOnDetId_
94  // selects from stereo if stereo == true, rphi otherwise
95  // selects from TID or TEC if endcap == true, TIB or TOB otherwise
96  void coarseHitSelection(std::vector<const SiStripRecHit2D*>& hitPointersOut,
97  bool stereo, bool endcap);
98  void coarseBarrelMonoHitSelection(std::vector<const SiStripRecHit2D*>& monoHitPointersOut );
99  void coarseEndcapMonoHitSelection(std::vector<const SiStripRecHit2D*>& monoHitPointersOut );
100  void coarseMatchedHitSelection(std::vector<const SiStripMatchedRecHit2D*>& coarseMatchedHitPointersOut);
101 
102 
103  // projects a phi band of width phiBandWidth_ from supercluster into tracker (given a chargeHypothesis)
104  // fills *_pos_ or *_neg_ member data with the results
105  // returns true iff the electron/positron passes cuts
106  bool projectPhiBand(float chargeHypothesis, const reco::SuperClusterRef& superclusterIn);
107 
108  double unwrapPhi(double phi) const {
109  while (phi > M_PI) { phi -= 2.*M_PI; }
110  while (phi < -M_PI) { phi += 2.*M_PI; }
111  return phi;
112  }
113 
114  // ---------- member data --------------------------------
115 
116  // parameters
117  unsigned int maxHitsOnDetId_;
121  unsigned int minHits_;
123 
124  // changes with each event
130 
134 
135 
136  std::map<const SiStripRecHit2D*, unsigned int> rphiKey_;
137  std::map<const SiStripRecHit2D*, unsigned int> stereoKey_;
138  std::map<const SiStripMatchedRecHit2D*, unsigned int> matchedKey_;
139 
140  std::map<const TrackingRecHit*, bool> hitUsed_;
141  std::map<const TrackingRecHit*, bool> matchedHitUsed_;
142 
143 
144  double redchi2_pos_;
148  std::vector<const TrackingRecHit*> outputHits_pos_;
149  std::vector<SiStripRecHit2D> outputRphiHits_pos_;
150  std::vector<SiStripRecHit2D> outputStereoHits_pos_;
151  std::vector<SiStripRecHit2D> outputMatchedHits_neg_;
152 
154  double slope_pos_;
156  double chi2_pos_;
159  double pZ_pos_;
165 
166  double redchi2_neg_;
170  std::vector<const TrackingRecHit*> outputHits_neg_;
171  std::vector<SiStripRecHit2D> outputRphiHits_neg_;
172  std::vector<SiStripRecHit2D> outputStereoHits_neg_;
174  double slope_neg_;
176  double chi2_neg_;
179  double pZ_neg_;
184 };
185 
186 
187 #endif
std::vector< SiStripRecHit2D > outputMatchedHits_neg_
std::vector< const TrackingRecHit * > outputHits_pos_
std::vector< SiStripRecHit2D > outputRphiHits_pos_
const edm::Handle< SiStripRecHit2DCollection > * stereoHits_hp_
const SiStripRecHit2D * innerhit_neg_
std::vector< TrackCandidate > TrackCandidateCollection
bool findElectron(reco::SiStripElectronCollection &electronOut, TrackCandidateCollection &trackCandidateOut, const reco::SuperClusterRef &superclusterIn)
const SiStripRecHit2D * innerhit_pos_
bool projectPhiBand(float chargeHypothesis, const reco::SuperClusterRef &superclusterIn)
std::vector< SiStripRecHit2D > outputStereoHits_pos_
std::map< const TrackingRecHit *, bool > matchedHitUsed_
const SiStripElectronAlgo & operator=(const SiStripElectronAlgo &)
std::vector< SiStripElectron > SiStripElectronCollection
collectin of SiStripElectron objects
unsigned int numberOfMatchedHits_pos_
const edm::Handle< SiStripMatchedRecHit2DCollection > * matchedHits_hp_
const SiStripRecHit2DCollection * rphiHits_p_
double unwrapPhi(double phi) const
std::map< const SiStripRecHit2D *, unsigned int > stereoKey_
void coarseBarrelMonoHitSelection(std::vector< const SiStripRecHit2D * > &monoHitPointersOut)
std::vector< SiStripRecHit2D > outputRphiHits_neg_
const SiStripRecHit2DCollection * stereoHits_p_
unsigned int numberOfStereoHits_pos_
#define M_PI
Definition: BFit3D.cc:3
unsigned int numberOfBarrelRphiHits_pos_
void coarseHitSelection(std::vector< const SiStripRecHit2D * > &hitPointersOut, bool stereo, bool endcap)
std::vector< SiStripRecHit2D > outputStereoHits_neg_
const TrackerGeometry * tracker_p_
const edm::Handle< SiStripRecHit2DCollection > * rphiHits_hp_
const SiStripMatchedRecHit2DCollection * matchedHits_p_
std::map< const SiStripMatchedRecHit2D *, unsigned int > matchedKey_
void coarseEndcapMonoHitSelection(std::vector< const SiStripRecHit2D * > &monoHitPointersOut)
std::map< const TrackingRecHit *, bool > hitUsed_
void coarseMatchedHitSelection(std::vector< const SiStripMatchedRecHit2D * > &coarseMatchedHitPointersOut)
const MagneticField * magneticField_p_
std::map< const SiStripRecHit2D *, unsigned int > rphiKey_
SiStripElectronAlgo(unsigned int maxHitsOnDetId, double originUncertainty, double phiBandWidth, double maxNormResid, unsigned int minHits, double maxReducedChi2)
unsigned int numberOfEndcapZphiHits_pos_
void prepareEvent(const edm::ESHandle< TrackerGeometry > &tracker, const edm::Handle< SiStripRecHit2DCollection > &rphiHits, const edm::Handle< SiStripRecHit2DCollection > &stereoHits, const edm::Handle< SiStripMatchedRecHit2DCollection > &matchedHits, const edm::ESHandle< MagneticField > &magneticField)
std::vector< const TrackingRecHit * > outputHits_neg_
Definition: DDAxes.h:10