CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloSimInfoExtra.h
Go to the documentation of this file.
1 #ifndef CalibrationIsolatedParticlesCaloSimInfoExtra_h
2 #define CalibrationIsolatedParticlesCaloSimInfoExtra_h
3 
4 // system include files
5 #include <memory>
6 #include <map>
7 #include <vector>
8 #include <string>
9 
10 // user include files
12 
14 
20 
26 
32 
33 namespace spr{
34 
35  struct energyMap {
37  int pdgId;
38  std::vector<std::pair<DetId,double> > matched;
39  std::vector<std::pair<DetId,double> > gamma;
40  std::vector<std::pair<DetId,double> > charged;
41  std::vector<std::pair<DetId,double> > neutral;
42  std::vector<std::pair<DetId,double> > rest;
43  std::vector<std::pair<DetId,double> > all;
44  };
45 
46  // takes the EcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc.
47  template< typename T>
48  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);
49 
50  template< typename T>
51  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);
52 
53  template< typename T>
54  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);
55 
56  // takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc.
57  template <typename T>
58  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);
59 
60  template <typename T>
61  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);
62 
63  // Actual function which does the matching of SimHits to SimTracks using geantTrackId
64  template <typename T>
65  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);
66 
67  // Functions to study the Hits for which history cannot be traced back
68  template <typename T>
69  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);
70 
71  template <typename T>
72  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);
73 
74  template <typename T>
75  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);
76 }
77 
78 #include "Calibration/IsolatedParticles/interface/CaloSimInfoExtra.icc"
79 #endif
std::vector< std::pair< DetId, double > > gamma
CaloTopology const * topology(0)
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)
std::vector< std::pair< DetId, double > > matched
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)
std::vector< std::pair< DetId, double > > charged
std::vector< std::pair< DetId, double > > all
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)
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)
Definition: DetId.h:18
std::vector< std::pair< DetId, double > > rest
#define debug
Definition: HDRShower.cc:19
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)
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)
std::vector< std::pair< DetId, double > > neutral
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)
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)
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)