CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConversionProducer.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_EgammaPhotonProducers_ConversionProducer_h
2 #define RecoEgamma_EgammaPhotonProducers_ConversionProducer_h
3 
12 // user include files
15 
18 
21 
23 
24 //ECAL clusters
37 
46 
47 
48 //Tracker tracks
52 
53 
54 //photon data format
60 
63 
66 
68  public:
69  explicit ConversionProducer(const edm::ParameterSet&);
71 
72 
73 
74 
75  private:
76 
77  virtual void produce(edm::Event&, const edm::EventSetup&);
78 
80  std::multimap<double, reco::CaloClusterPtr>& basicClusterPtrs,
81  std::multimap<double, reco::CaloClusterPtr>& superClusterPtrs);
82 
83 
84  // ----------member data ---------------------------
85  std::string algoName_;
86 
88  typedef std::vector<Point> PointCollection;
89 
91 
97 
99 
101 
102  bool usePvtx_;//if use primary vertices
103  std::string vertexProducer_;
105 
107 
108  double deltaEta_;
109 
110  double halfWayEta_, halfWayPhi_;//halfway open angle to search in basic clusters
111  unsigned int maxNumOfTrackInPU_;
112  double maxTrackZ_;
113  double maxTrackRho_;
114  double minSCEt_;
117  double energyBC_;//1.5GeV for track BC selection
118  double energyTotalBC_;//5GeV for track pair BC selection
119  double d0Cut_;//0 for d0*charge cut
120  double dzCut_;//innerposition of z diff cut
121  double dEtaTkBC_, dPhiTkBC_;//0.06 0.6 for track and BC matching
122 
123  double maxChi2Left_, maxChi2Right_;//5. 5. for track chi2 quality
124  double minHitsLeft_, minHitsRight_;//5 2 for track hits quality
125 
126  double deltaCotTheta_, deltaPhi_, minApproachLow_, minApproachHigh_;//0.02 0.2 for track pair open angle and > -0.1 cm
127 
128 
129  double r_cut;//cross_r cut
130  double vtxChi2_;//vertex chi2 probablity cut
131 
132  bool allowSingleLeg_;//if single track conversion ?
133  bool rightBC_;//if right leg requires matching BC?
134 
135 
136  void buildCollection( edm::Event& iEvent, const edm::EventSetup& iSetup,
137  const std::multimap<float, edm::Ptr<reco::ConversionTrack> >& allTracks,
138  const std::multimap<double, reco::CaloClusterPtr>& superClusterPtrs,
139  const std::multimap<double, reco::CaloClusterPtr>& basicClusterPtrs,
140  const reco::Vertex& the_pvtx,
141  reco::ConversionCollection & outputConvPhotonCollection);
142 
143 
144  //track quality cut, returns pass or no
145  inline bool trackQualityFilter(const edm::RefToBase<reco::Track>& ref, bool isLeft);
146  inline bool trackD0Cut(const edm::RefToBase<reco::Track>& ref);
147  inline bool trackD0Cut(const edm::RefToBase<reco::Track>& ref, const reco::Vertex& the_pvtx);
148 
149  //track impact point at ECAL wall, returns validity to access position ew
150  bool getTrackImpactPosition(const reco::Track* tk_ref,
151  const TrackerGeometry* trackerGeom, const MagneticField* magField,
152  math::XYZPointF& ew);
153 
154  //distance at min approaching point, returns distance
155  // double getMinApproach(const edm::RefToBase<reco::Track>& ll, const edm::RefToBase<reco::Track>& rr,
156  // const MagneticField* magField);
157 
158  bool preselectTrackPair(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r,
159  double& appDist);
160 
161  //cut-based selection, TODO remove global cut variables
164 
165  //kinematic vertex fitting, return true for valid vertex
166  bool checkVertex(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r,
167  const MagneticField* magField,
168  reco::Vertex& the_vertex);
170  const TrackerGeometry* trackerGeom, const MagneticField* magField,
171  const reco::Vertex& the_vertex);
172 
173  //check the closest BC, returns true for found a BC
174  bool getMatchedBC(const std::multimap<double, reco::CaloClusterPtr>& bcMap,
175  const math::XYZPointF& trackImpactPosition,
176  reco::CaloClusterPtr& closestBC);
177 
178  // finds the super cluster matching with at least one track in the pair
179  bool matchingSC(const std::multimap<double, reco::CaloClusterPtr>& scMap,
182 
183 
184 
185  double etaTransformation( float EtaParticle , float Zvertex);
186 
187 
189  return math::XYZPointF(val.x(),val.y(),val.z());
190  }
191 
193  return math::XYZVectorF(val.x(),val.y(),val.z());
194  }
195 
196 
197 };
198 
199 
200 inline const GeomDet * recHitDet( const TrackingRecHit & hit, const TrackingGeometry * geom ) {
201  return geom->idToDet( hit.geographicalId() );
202 }
203 
204 inline const BoundPlane & recHitSurface( const TrackingRecHit & hit, const TrackingGeometry * geom ) {
205  return recHitDet( hit, geom )->surface();
206 }
207 
208 inline LocalVector toLocal( const reco::Track::Vector & v, const Surface & s ) {
209  return s.toLocal( GlobalVector( v.x(), v.y(), v.z() ) );
210 }
211 
212 #endif
unsigned int maxNumOfTrackInPU_
ConversionVertexFinder * theVertexFinder_
edm::InputTag scBarrelProducer_
bool getTrackImpactPosition(const reco::Track *tk_ref, const TrackerGeometry *trackerGeom, const MagneticField *magField, math::XYZPointF &ew)
static HepMC::IO_HEPEVT conv
edm::InputTag bcBarrelCollection_
const TransientTrackBuilder * thettbuilder_
void buildCollection(edm::Event &iEvent, const edm::EventSetup &iSetup, const std::multimap< float, edm::Ptr< reco::ConversionTrack > > &allTracks, const std::multimap< double, reco::CaloClusterPtr > &superClusterPtrs, const std::multimap< double, reco::CaloClusterPtr > &basicClusterPtrs, const reco::Vertex &the_pvtx, reco::ConversionCollection &outputConvPhotonCollection)
void buildSuperAndBasicClusterGeoMap(const edm::Event &, std::multimap< double, reco::CaloClusterPtr > &basicClusterPtrs, std::multimap< double, reco::CaloClusterPtr > &superClusterPtrs)
math::XYZPointF Point
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:11
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
edm::InputTag scEndcapProducer_
bool matchingSC(const std::multimap< double, reco::CaloClusterPtr > &scMap, reco::Conversion &conv, reco::CaloClusterPtrVector &mSC)
int iEvent
Definition: GenABIO.cc:243
math::XYZVectorF toFConverterV(const math::XYZVector &val)
LocalPoint toLocal(const GlobalPoint &gp) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:18
bool getMatchedBC(const std::multimap< double, reco::CaloClusterPtr > &bcMap, const math::XYZPointF &trackImpactPosition, reco::CaloClusterPtr &closestBC)
bool checkTrackPair(const std::pair< edm::RefToBase< reco::Track >, reco::CaloClusterPtr > &ll, const std::pair< edm::RefToBase< reco::Track >, reco::CaloClusterPtr > &rr)
bool trackQualityFilter(const edm::RefToBase< reco::Track > &ref, bool isLeft)
virtual const GeomDet * idToDet(DetId) const =0
const GeomDet * recHitDet(const TrackingRecHit &hit, const TrackingGeometry *geom)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
bool trackD0Cut(const edm::RefToBase< reco::Track > &ref)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::string ConvertedPhotonCollection_
const BoundPlane & recHitSurface(const TrackingRecHit &hit, const TrackingGeometry *geom)
std::vector< Point > PointCollection
edm::InputTag bcEndcapCollection_
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
double etaTransformation(float EtaParticle, float Zvertex)
math::XYZPointF toFConverterP(const math::XYZPoint &val)
DetId geographicalId() const
virtual void produce(edm::Event &, const edm::EventSetup &)
bool preselectTrackPair(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r, double &appDist)
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:74
mathSSE::Vec4< T > v
bool checkPhi(const edm::RefToBase< reco::Track > &tk_l, const edm::RefToBase< reco::Track > &tk_r, const TrackerGeometry *trackerGeom, const MagneticField *magField, const reco::Vertex &the_vertex)
Global3DVector GlobalVector
Definition: GlobalVector.h:10
ConversionProducer(const edm::ParameterSet &)
bool checkVertex(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r, const MagneticField *magField, reco::Vertex &the_vertex)