CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/Calibration/IsolatedParticles/interface/CaloSimInfoExtra.h

Go to the documentation of this file.
00001 #ifndef CalibrationIsolatedParticlesCaloSimInfoExtra_h
00002 #define CalibrationIsolatedParticlesCaloSimInfoExtra_h
00003 
00004 // system include files
00005 #include <memory>
00006 #include <map>
00007 #include <vector>
00008 #include <string>
00009 
00010 // user include files
00011 #include "FWCore/Framework/interface/Frameworkfwd.h"
00012 
00013 #include "FWCore/Framework/interface/Event.h"
00014 
00015 #include "DataFormats/Common/interface/Handle.h"
00016 #include "DataFormats/TrackReco/interface/Track.h"
00017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00018 #include "DataFormats/DetId/interface/DetId.h"
00019 #include "DataFormats/Candidate/interface/Candidate.h"
00020 
00021 #include "SimDataFormats/Track/interface/SimTrack.h"
00022 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00023 #include "SimDataFormats/Vertex/interface/SimVertex.h"
00024 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00025 #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h"
00026 
00027 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00028 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00029 #include "Geometry/CaloTopology/interface/HcalTopology.h"
00030 #include "RecoCaloTools/Navigation/interface/CaloTowerNavigator.h"
00031 #include "Calibration/IsolatedParticles/interface/CaloSimInfo.h"
00032 
00033 namespace spr{
00034 
00035   struct energyMap {
00036     energyMap() {pdgId=0;}
00037     int                                   pdgId;
00038     std::vector<std::pair<DetId,double> > matched;
00039     std::vector<std::pair<DetId,double> > gamma;
00040     std::vector<std::pair<DetId,double> > charged;
00041     std::vector<std::pair<DetId,double> > neutral;
00042     std::vector<std::pair<DetId,double> > rest;
00043     std::vector<std::pair<DetId,double> > all;
00044   };
00045 
00046   // takes the EcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc.
00047   template< typename T>
00048   std::map<std::string,double> eECALSimInfo(const edm::Event&, CaloNavigator<DetId>& navigator, 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 debug=false);
00049 
00050   template< typename T>
00051   std::map<std::string,double> eECALSimInfoTotal(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, int itry=-1, double timeCut=150, bool debug=false);
00052 
00053   template< typename T>
00054   energyMap eECALSimInfoMatrix(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);
00055   
00056   // takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc.
00057   template <typename T>
00058   std::map<std::string,double> eHCALSimInfoTotal(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, int itry=-1, double timeCut=150, bool includeHO=false, bool debug=false);
00059 
00060   template <typename T>
00061   energyMap eHCALSimInfoMatrix(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);
00062 
00063   // Actual function which does the matching of SimHits to SimTracks using geantTrackId
00064   template <typename T>
00065   energyMap caloSimInfoMatrix(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, double timeCut=150, bool includeHO=false, bool debug=false);
00066 
00067   // Functions to study the Hits for which history cannot be traced back 
00068   template <typename T>
00069   std::vector<typename T::const_iterator> missedECALHits(const edm::Event&, CaloNavigator<DetId>& navigator, edm::Handle<T>& hits, edm::Handle<edm::SimTrackContainer>& SimTk, edm::Handle<edm::SimVertexContainer>& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, bool flag, bool debug=false);
00070 
00071   template <typename T>
00072   std::vector<typename T::const_iterator> missedHCALHits(const edm::Event&, 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, bool flag, bool includeHO=false, bool debug=false);
00073 
00074   template <typename T>
00075   std::vector<typename T::const_iterator> missedCaloHits(edm::Handle<T>& hits, std::vector<int> matchedId, std::vector< typename T::const_iterator> caloHits, bool flag, bool includeHO=false, bool debug=false); 
00076 }
00077 
00078 #include "Calibration/IsolatedParticles/interface/CaloSimInfoExtra.icc"
00079 #endif