CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Calibration/IsolatedParticles/interface/CaloPropagateTrack.h

Go to the documentation of this file.
00001 #ifndef CalibrationIsolatedParticlesCaloPropagateTrack_h
00002 #define CalibrationIsolatedParticlesCaloPropagateTrack_h
00003 
00004 #include <cmath>
00005 #include <vector>
00006 #include <string>
00007 
00008 #include "DataFormats/Common/interface/Handle.h"
00009 #include "DataFormats/DetId/interface/DetId.h"
00010 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00011 #include "DataFormats/TrackReco/interface/Track.h"
00012 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00013 #include "MagneticField/Engine/interface/MagneticField.h"
00014 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00015 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00016 
00017 namespace spr{
00018 
00019   struct propagatedTrack {
00020     propagatedTrack() {ok=false;}
00021     bool                ok;
00022     math::XYZPoint      point;
00023     GlobalVector        direction;
00024   };
00025 
00026   struct propagatedTrackID {
00027     propagatedTrackID() {ok=false; okECAL=false; okHCAL=false;}
00028     bool                                  ok, okECAL, okHCAL;
00029     DetId                                 detIdECAL, detIdHCAL, detIdEHCAL;
00030     double                                etaECAL, etaHCAL;
00031     double                                phiECAL, phiHCAL;
00032     reco::TrackCollection::const_iterator trkItr;
00033   };
00034 
00035   struct propagatedTrackDirection {
00036     propagatedTrackDirection() {ok=false; okECAL=false; okHCAL=false;}
00037     bool                                  ok, okECAL, okHCAL;
00038     DetId                                 detIdECAL, detIdHCAL, detIdEHCAL;
00039     GlobalPoint                           pointECAL, pointHCAL;
00040     GlobalVector                          directionECAL, directionHCAL;
00041     reco::TrackCollection::const_iterator trkItr;
00042   };
00043 
00044   // Returns a vector of DetID's of closest cell on the ECAL/HCAL surface of
00045   // all the tracks in the collection. Also saves a boolean if extrapolation
00046   // is satisfactory
00047   std::vector<spr::propagatedTrackID> propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection, const CaloGeometry* geo, const MagneticField* bField, std::string & theTrackQuality, bool debug=false);
00048   void propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection, const CaloGeometry* geo, const MagneticField* bField, std::string & theTrackQuality, std::vector<spr::propagatedTrackID>& vdets, bool debug=false);
00049   void propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection, const CaloGeometry* geo, const MagneticField* bField, std::string & theTrackQuality, std::vector<spr::propagatedTrackDirection>& trkDir, bool debug=false);
00050 
00051   // Propagate tracks to the ECAL surface and optionally returns the 
00052   // extrapolated point (and the track direction at point of extrapolation)
00053   propagatedTrack propagateTrackToECAL(const reco::Track*, const MagneticField*, bool debug=false);
00054   std::pair<math::XYZPoint,bool> propagateECAL(const reco::Track*, const MagneticField*, bool debug=false);
00055   std::pair<math::XYZPoint,bool> propagateECAL(const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, bool debug=false);
00056 
00057   // Propagate tracks to the HCAL surface and optionally returns the 
00058   // extrapolated point (and the track direction at point of extrapolation)
00059   propagatedTrack propagateTrackToHCAL(const reco::Track*, const MagneticField*, bool debug=false);
00060   std::pair<math::XYZPoint,bool> propagateHCAL(const reco::Track*, const MagneticField*, bool debug=false);
00061   std::pair<math::XYZPoint,bool> propagateHCAL(const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, bool debug=false);
00062 
00063   // Propagate the track to the end of the tracker and returns the extrapolated
00064   // point and optionally the length of the track upto the end
00065   std::pair<math::XYZPoint,bool> propagateTracker(const reco::Track*, const MagneticField*, bool debug=false);
00066   std::pair<math::XYZPoint,double> propagateTrackerEnd(const reco::Track*, const MagneticField*, bool debug=false);
00067 
00068   propagatedTrack propagateCalo(const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, float zdist, float radius, float corner, bool debug=false);
00069 
00070 }
00071 #endif