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 //
20 
21 // system include files
22 
23 #include <map>
24 
25 // user include files
26 
27 // forward declarations
28 
55 
56 class TrackerTopology;
57 
59 {
60 
61  public:
62  SiStripElectronAlgo(unsigned int maxHitsOnDetId,
63  double originUncertainty,
64  double phiBandWidth,
65  double maxNormResid,
66  unsigned int minHits,
67  double maxReducedChi2);
68 
69  virtual ~SiStripElectronAlgo();
70 
71  // ---------- const member functions ---------------------
72 
73  // ---------- static member functions --------------------
74 
75  // ---------- member functions ---------------------------
76 
82 
83  // returns true iff an electron/positron was found
84  // and inserts SiStripElectron and trackCandidate into electronOut and trackCandidateOut
86  TrackCandidateCollection& trackCandidateOut,
87  const reco::SuperClusterRef& superclusterIn,
88  const TrackerTopology *tTopo);
89 
90  private:
91  SiStripElectronAlgo(const SiStripElectronAlgo&); // stop default
92 
93  const SiStripElectronAlgo& operator=(const SiStripElectronAlgo&); // stop default
94 
95  // inserts pointers to good hits into hitPointersOut
96  // selects hits on DetIds that have no more than maxHitsOnDetId_
97  // selects from stereo if stereo == true, rphi otherwise
98  // selects from TID or TEC if endcap == true, TIB or TOB otherwise
99  void coarseHitSelection(std::vector<const SiStripRecHit2D*>& hitPointersOut,
100  const TrackerTopology *tTopo,
101  bool stereo, bool endcap);
102  void coarseBarrelMonoHitSelection(std::vector<const SiStripRecHit2D*>& monoHitPointersOut );
103  void coarseEndcapMonoHitSelection(std::vector<const SiStripRecHit2D*>& monoHitPointersOut );
104  void coarseMatchedHitSelection(std::vector<const SiStripMatchedRecHit2D*>& coarseMatchedHitPointersOut);
105 
106 
107  // projects a phi band of width phiBandWidth_ from supercluster into tracker (given a chargeHypothesis)
108  // fills *_pos_ or *_neg_ member data with the results
109  // returns true iff the electron/positron passes cuts
110  bool projectPhiBand(float chargeHypothesis,
111  const reco::SuperClusterRef& superclusterIn,
112  const TrackerTopology *tTopo);
113 
114  double unwrapPhi(double phi) const {
115  while (phi > M_PI) { phi -= 2.*M_PI; }
116  while (phi < -M_PI) { phi += 2.*M_PI; }
117  return phi;
118  }
119 
120  // ---------- member data --------------------------------
121 
122  // parameters
123  unsigned int maxHitsOnDetId_;
127  unsigned int minHits_;
129 
130  // changes with each event
136 
140 
141 
142  std::map<const SiStripRecHit2D*, unsigned int> rphiKey_;
143  std::map<const SiStripRecHit2D*, unsigned int> stereoKey_;
144  std::map<const SiStripMatchedRecHit2D*, unsigned int> matchedKey_;
145 
146  std::map<const TrackingRecHit*, bool> hitUsed_;
147  std::map<const TrackingRecHit*, bool> matchedHitUsed_;
148 
149 
150  double redchi2_pos_;
154  std::vector<const TrackingRecHit*> outputHits_pos_;
155  std::vector<SiStripRecHit2D> outputRphiHits_pos_;
156  std::vector<SiStripRecHit2D> outputStereoHits_pos_;
157  std::vector<SiStripRecHit2D> outputMatchedHits_neg_;
158 
160  double slope_pos_;
162  double chi2_pos_;
165  double pZ_pos_;
171 
172  double redchi2_neg_;
176  std::vector<const TrackingRecHit*> outputHits_neg_;
177  std::vector<SiStripRecHit2D> outputRphiHits_neg_;
178  std::vector<SiStripRecHit2D> outputStereoHits_neg_;
180  double slope_neg_;
182  double chi2_neg_;
185  double pZ_neg_;
190 };
191 
192 
193 #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
tuple magneticField
const SiStripRecHit2D * innerhit_pos_
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_
#define M_PI
const SiStripRecHit2DCollection * stereoHits_p_
bool findElectron(reco::SiStripElectronCollection &electronOut, TrackCandidateCollection &trackCandidateOut, const reco::SuperClusterRef &superclusterIn, const TrackerTopology *tTopo)
unsigned int numberOfStereoHits_pos_
bool projectPhiBand(float chargeHypothesis, const reco::SuperClusterRef &superclusterIn, const TrackerTopology *tTopo)
unsigned int numberOfBarrelRphiHits_pos_
std::vector< SiStripRecHit2D > outputStereoHits_neg_
void coarseHitSelection(std::vector< const SiStripRecHit2D * > &hitPointersOut, const TrackerTopology *tTopo, bool stereo, bool endcap)
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_