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 
10 // user include files
13 
16 
19 
21 
22 //ECAL clusters
35 
44 
45 
46 //Tracker tracks
50 
51 
52 //photon data format
59 
62 
65 
67  public:
68  explicit ConversionProducer(const edm::ParameterSet&);
70 
71 
72 
73 
74  private:
75 
76  virtual void produce(edm::Event&, const edm::EventSetup&);
77 
79  std::multimap<double, reco::CaloClusterPtr>& basicClusterPtrs,
80  std::multimap<double, reco::CaloClusterPtr>& superClusterPtrs);
81 
82 
83  // ----------member data ---------------------------
85 
87  typedef std::vector<Point> PointCollection;
88 
90 
96 
98 
100 
101  bool usePvtx_;//if use primary vertices
104 
106 
107  double deltaEta_;
108 
109  double halfWayEta_, halfWayPhi_;//halfway open angle to search in basic clusters
110  unsigned int maxNumOfTrackInPU_;
111  double maxTrackZ_;
112  double maxTrackRho_;
113  double minSCEt_;
116  double energyBC_;//1.5GeV for track BC selection
117  double energyTotalBC_;//5GeV for track pair BC selection
118  double d0Cut_;//0 for d0*charge cut
119  double dzCut_;//innerposition of z diff cut
120  double dEtaTkBC_, dPhiTkBC_;//0.06 0.6 for track and BC matching
121 
122  double maxChi2Left_, maxChi2Right_;//5. 5. for track chi2 quality
123  double minHitsLeft_, minHitsRight_;//5 2 for track hits quality
124 
125  double deltaCotTheta_, deltaPhi_, minApproachLow_, minApproachHigh_;//0.02 0.2 for track pair open angle and > -0.1 cm
126 
127 
128  double r_cut;//cross_r cut
129  double vtxChi2_;//vertex chi2 probablity cut
130 
131  bool allowSingleLeg_;//if single track conversion ?
132  bool rightBC_;//if right leg requires matching BC?
133 
134 
135  void buildCollection( edm::Event& iEvent, const edm::EventSetup& iSetup,
136  const std::multimap<float, edm::Ptr<reco::ConversionTrack> >& allTracks,
137  const std::multimap<double, reco::CaloClusterPtr>& superClusterPtrs,
138  const std::multimap<double, reco::CaloClusterPtr>& basicClusterPtrs,
139  const reco::Vertex& the_pvtx,
140  reco::ConversionCollection & outputConvPhotonCollection);
141 
142 
143  //track quality cut, returns pass or no
144  inline bool trackQualityFilter(const edm::RefToBase<reco::Track>& ref, bool isLeft);
145  inline bool trackD0Cut(const edm::RefToBase<reco::Track>& ref);
146  inline bool trackD0Cut(const edm::RefToBase<reco::Track>& ref, const reco::Vertex& the_pvtx);
147 
148  //track impact point at ECAL wall, returns validity to access position ew
149  bool getTrackImpactPosition(const reco::Track* tk_ref,
150  const TrackerGeometry* trackerGeom, const MagneticField* magField,
151  math::XYZPointF& ew);
152 
153  //distance at min approaching point, returns distance
154  // double getMinApproach(const edm::RefToBase<reco::Track>& ll, const edm::RefToBase<reco::Track>& rr,
155  // const MagneticField* magField);
156 
157  bool preselectTrackPair(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r,
158  double& appDist);
159 
160  //cut-based selection, TODO remove global cut variables
163 
164  //kinematic vertex fitting, return true for valid vertex
165  bool checkVertex(const reco::TransientTrack &ttk_l, const reco::TransientTrack &ttk_r,
166  const MagneticField* magField,
167  reco::Vertex& the_vertex);
169  const TrackerGeometry* trackerGeom, const MagneticField* magField,
170  const reco::Vertex& the_vertex);
171 
172  //check the closest BC, returns true for found a BC
173  bool getMatchedBC(const std::multimap<double, reco::CaloClusterPtr>& bcMap,
174  const math::XYZPointF& trackImpactPosition,
175  reco::CaloClusterPtr& closestBC);
176 
177  // finds the super cluster matching with at least one track in the pair
178  bool matchingSC(const std::multimap<double, reco::CaloClusterPtr>& scMap,
181 
182 
183 
184  double etaTransformation( float EtaParticle , float Zvertex);
185 
186 
188  return math::XYZPointF(val.x(),val.y(),val.z());
189  }
190 
192  return math::XYZVectorF(val.x(),val.y(),val.z());
193  }
194 
195 
196 };
197 
198 
199 inline const GeomDet * recHitDet( const TrackingRecHit & hit, const TrackingGeometry * geom ) {
200  return geom->idToDet( hit.geographicalId() );
201 }
202 
203 inline const BoundPlane & recHitSurface( const TrackingRecHit & hit, const TrackingGeometry * geom ) {
204  return recHitDet( hit, geom )->surface();
205 }
206 
207 inline LocalVector toLocal( const reco::Track::Vector & v, const Surface & s ) {
208  return s.toLocal( GlobalVector( v.x(), v.y(), v.z() ) );
209 }
210 
211 #endif
unsigned int maxNumOfTrackInPU_
ConversionVertexFinder * theVertexFinder_
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
bool getTrackImpactPosition(const reco::Track *tk_ref, const TrackerGeometry *trackerGeom, const MagneticField *magField, math::XYZPointF &ew)
static HepMC::IO_HEPEVT conv
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:10
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
bool matchingSC(const std::multimap< double, reco::CaloClusterPtr > &scMap, reco::Conversion &conv, reco::CaloClusterPtrVector &mSC)
int iEvent
Definition: GenABIO.cc:230
math::XYZVectorF toFConverterV(const math::XYZVector &val)
LocalPoint toLocal(const GlobalPoint &gp) const
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scEndcapProducer_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:17
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
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:30
bool trackD0Cut(const edm::RefToBase< reco::Track > &ref)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::string ConvertedPhotonCollection_
const BoundPlane & recHitSurface(const TrackingRecHit &hit, const TrackingGeometry *geom)
edm::EDGetTokenT< edm::View< reco::ConversionTrack > > src_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scBarrelProducer_
std::vector< Point > PointCollection
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:80
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)