CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/Calibration/IsolatedParticles/interface/CaloSimInfo.h

Go to the documentation of this file.
00001 /* 
00002 Functions to give the details of parent track of SimHits.
00003 
00004 Authors:  Seema Sharma, Sunanda Banerjee
00005 Created: August 2009
00006 */
00007 
00008 #ifndef CalibrationIsolatedParticlesCaloSimInfo_h
00009 #define CalibrationIsolatedParticlesCaloSimInfo_h
00010 
00011 // system include files
00012 #include <memory>
00013 #include <map>
00014 #include <vector>
00015 #include <string>
00016 
00017 // user include files
00018 #include "FWCore/Framework/interface/Frameworkfwd.h"
00019 
00020 #include "FWCore/Framework/interface/Event.h"
00021 
00022 #include "DataFormats/Common/interface/Handle.h"
00023 #include "DataFormats/TrackReco/interface/Track.h"
00024 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00025 #include "DataFormats/DetId/interface/DetId.h"
00026 #include "DataFormats/Candidate/interface/Candidate.h"
00027 
00028 #include "SimDataFormats/Track/interface/SimTrack.h"
00029 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00030 #include "SimDataFormats/Vertex/interface/SimVertex.h"
00031 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00032 #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h"
00033 
00034 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00035 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00036 #include "Geometry/CaloTopology/interface/HcalTopology.h"
00037 #include "RecoCaloTools/Navigation/interface/CaloTowerNavigator.h"
00038 #include "Calibration/IsolatedParticles/interface/MatrixECALDetIds.h"
00039 
00040 namespace spr{
00041 
00042   struct caloSimInfo {
00043     caloSimInfo() {eMatched=eGamma=eNeutralHad=eChargedHad=eRest=eTotal=pdgMatched=0;}
00044     double pdgMatched;
00045     double eMatched;
00046     double eGamma;
00047     double eNeutralHad;
00048     double eChargedHad;
00049     double eRest;
00050     double eTotal;
00051   };
00052 
00053   // takes the EcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in a symmetric matrix (2*ieta+1)*(2*iphi+1)
00054   template< typename T>
00055   void eECALSimInfo(const edm::Event&, const DetId& det, const CaloGeometry* geo, const CaloTopology* caloTopology, edm::Handle<T>& hitsEB, edm::Handle<T>& hitsEE, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, caloSimInfo& info, double timeCut=150, bool debug=false);
00056 
00057   template< typename T>
00058   std::map<std::string,double> eECALSimInfo(const edm::Event&, const DetId& det, const CaloGeometry* geo, const CaloTopology* caloTopology, edm::Handle<T>& hitsEB, edm::Handle<T>& hitsEE, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, double timeCut=150, bool debug=false);
00059 
00060   // takes the EcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in an symmetric matrix (ietaE+ietaW+1)*(iphiN+iphiS+1)
00061   template< typename T>
00062   void eECALSimInfo(const edm::Event&, const DetId& det, const CaloGeometry* geo, const CaloTopology* caloTopology, edm::Handle<T>& hitsEB, edm::Handle<T>& hitsEE, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo& info, double timeCut=150, bool debug=false);
00063   
00064   // takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in a symmetric matrix (2*ieta+1)*(2*iphi+1)
00065   template <typename T>
00066   std::map<std::string,double> eHCALSimInfo(const edm::Event&, const HcalTopology* topology, const DetId& det, const CaloGeometry* geo, edm::Handle<T>& hits,edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false);
00067   template <typename T>
00068   void eHCALSimInfo(const edm::Event&, const HcalTopology* topology, const DetId& det, const CaloGeometry* geo, edm::Handle<T>& hits,edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, caloSimInfo& info, double timeCut=150, bool includeHO=false, bool debug=false);
00069 
00070   //takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in an symmetric matrix (ietaE+ietaW+1)*(iphiN+iphiS+1)
00071   template <typename T>
00072   void eHCALSimInfo(const edm::Event&, const HcalTopology* topology, const DetId& det, const CaloGeometry* geo, edm::Handle<T>& hits,edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo& info, double timeCut=150, bool includeHO=false, bool debug=false);
00073   
00074   // takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in a symmetric matrix (2*ieta+1)*(2*iphi+1) and also a multiplicity vector 
00075   template <typename T>
00076   std::map<std::string,double> eHCALSimInfo(const edm::Event& iEvent, const HcalTopology* topology, const DetId& det, edm::Handle<T>& hits, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, std::vector<int>& multiplicityVector, bool debug=false);
00077 
00078   // Actual function which does the matching of SimHits to SimTracks using geantTrackId
00079   template <typename T>
00080   void eCaloSimInfo(std::vector<DetId> vdets, const CaloGeometry* geo, edm::Handle<T>& hitsEB, edm::Handle<T>& hitsEE,  edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo& info, double timeCut=150, bool debug=false);
00081   template <typename T>
00082   void eCaloSimInfo(const CaloGeometry* geo, edm::Handle<T>& hits, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, std::vector< typename T::const_iterator> hit, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo& info, double timeCut=150, bool includeHO=false, bool debug=false);
00083   std::map<std::string,double> eCaloSimInfo (caloSimInfo& info);
00084 
00085   // Returns total energy of CaloSimHits which originate from the matching SimTrack
00086   template <typename T>
00087   double eCaloSimInfo(const edm::Event&, const CaloGeometry* geo, edm::Handle<T>& hits, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, double timeCut=150, bool includeHO=false, bool debug=false);
00088 
00089   template <typename T>
00090   double eCaloSimInfo(const edm::Event&, const CaloGeometry* geo, edm::Handle<T>& hitsEB, edm::Handle<T>& hitsEE, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, double timeCut=150, bool debug=false);
00091 
00092   template <typename T>
00093   std::map<std::string,double> eCaloSimInfo(edm::Handle<T>& hits, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, std::vector< typename T::const_iterator> hit, edm::SimTrackContainer::const_iterator trkInfo, std::vector<int>& multiplicityVector, bool debug=false);
00094 
00095   double timeOfFlight(DetId id, const CaloGeometry* geo, bool debug=false);
00096 }
00097 
00098 #include "Calibration/IsolatedParticles/interface/CaloSimInfo.icc"
00099 #endif