CMS 3D CMS Logo

Classes | Functions | Variables
spr Namespace Reference

Classes

struct  caloSimInfo
 
struct  energyMap
 
struct  EtaPhi
 
struct  genSimInfo
 
struct  propagatedGenParticleID
 
struct  propagatedGenTrackID
 
struct  propagatedTrack
 
struct  propagatedTrackDirection
 
struct  propagatedTrackID
 
struct  simTkInfo
 
struct  trackAtOrigin
 
struct  trackSelectionParameters
 

Functions

template<typename T >
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)
 
void cGenSimInfo (std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (std::vector< DetId > &vdets, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (int charge, int pdgid, double p, spr::genSimInfo &info, bool debug=false)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &theNavigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string theTrackQuality, bool)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &navigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
bool chargeIsolation (const DetId anyCell, CaloNavigator< DetId > &navigator, int deta, int dphi)
 
bool chargeIsolation (const DetId anyCell, std::vector< DetId > &vdets)
 
double chargeIsolationCone (unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
 
double chargeIsolationEcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationEcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationEcal (const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationHcal (reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double coneChargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
 
int coneChargeIsolation (const GlobalPoint &hpoint1, const GlobalPoint &point2, const GlobalVector &trackMom, double dR)
 
void debugEcalDets (unsigned int, const DetId &, bool)
 
void debugEcalDets (unsigned int, std::vector< DetId > &)
 
void debugEcalDets (unsigned int, std::vector< DetId > &, std::vector< CaloDirection > &)
 
void debugHcalDets (unsigned int, std::vector< DetId > &)
 
template<typename T >
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)
 
template<typename T >
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)
 
std::map< std::string, double > eCaloSimInfo (caloSimInfo &info)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
double eCone_ecal (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool useRaw=false, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< DetId > &coneRecHitDetIds, double &distFromHotCell, int &ietaHotCell, int &iphiHotCell, GlobalPoint &gposHotCell, int detOnly=-1, bool useRaw=false, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< DetId > &coneRecHitDetIds, std::vector< double > &eHit, bool useRaw=false, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, std::vector< DetId > &coneRecHitDetIds, double &distFromHotCell, int &ietaHotCell, int &iphiHotCell, GlobalPoint &gposHotCell, int detOnly=-1, bool useRaw=false, bool debug=false)
 
template<typename T >
double eECALmatrix (CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ietaE, int ietaW, int iphiN, int iphiS, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId, double > > eECALmatrixCell (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eECALmatrixTotal (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
double eHCALmatrix (const HcalTopology *topology, const DetId &det, std::vector< PCaloHit > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, std::set< int > &uniqueIdset, bool useRaw=false)
 
template<typename T >
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, GlobalPoint &gPosHotCell, bool useRaw=false)
 
template<typename T >
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, HcalDetId &hotCell, bool includeHO=false, bool useRaw=false, bool debug=false)
 
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, std::vector< PCaloHit > &hits, int ieta, int iphi, HcalDetId &hotCell, bool includeHO=false, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId, double > > eHCALmatrixCell (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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)
 
double eHCALThreshold (int subdet, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100)
 
template<typename T >
std::vector< std::pair< DetId, double > > energyDetIdHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId, double > > energyECALCell (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
double energyECALTower (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vNeighboursDetId, std::vector< DetId > &dets, const HcalTopology *topology, edm::Handle< T > &hits, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
template<typename T >
void energyHCALCell (HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
void energyHCALCell (HcalDetId detId, std::vector< PCaloHit > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCALmatrixNew (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
template<typename T >
double energyHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
void extraIds (const DetId &det, std::vector< DetId > &dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, bool debug=false)
 
void find (edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< HBHERecHitCollection > &hits, DetId thisDet, std::vector< HBHERecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< edm::PCaloHitContainer > &hits, DetId thisDet, std::vector< edm::PCaloHitContainer::const_iterator > &hit, bool debug=false)
 
std::vector< EcalRecHitCollection::const_iteratorfindCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug)
 
std::vector< EcalRecHitCollection::const_iteratorfindCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, bool debug=false)
 
std::vector< EcalRecHitCollection::const_iteratorfindCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &barrelhits, edm::Handle< EcalRecHitCollection > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug=false)
 
std::vector< HBHERecHitCollection::const_iteratorfindCone (const CaloGeometry *geo, edm::Handle< HBHERecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug=false)
 
std::vector< edm::PCaloHitContainer::const_iterator > findCone (const CaloGeometry *geo, edm::Handle< edm::PCaloHitContainer > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug=false)
 
const DetId findDetIdCalo (const CaloSubdetectorGeometry *geo, double theta, double phi, double radius, bool debug=false)
 
const DetId findDetIdECAL (const CaloGeometry *geo, double eta, double phi, bool debug=false)
 
const DetId findDetIdHCAL (const CaloGeometry *geo, double eta, double phi, bool debug=false)
 
template<typename T >
std::vector< typename T::const_iterator > findHit (edm::Handle< T > &hits, DetId thisDet, bool debug=false)
 
std::vector< std::vector< PCaloHit >::const_iterator > findHit (std::vector< PCaloHit > &hits, DetId thisDet, bool debug=false)
 
template<typename T >
void findHit (edm::Handle< T > &hits, DetId thisDet, std::vector< typename T::const_iterator > &hit, bool debug=false)
 
template<typename T >
std::vector< typename T::const_iterator > findHitCone (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug=false)
 
template<typename T >
std::vector< typename T::const_iterator > findHitCone (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug=false)
 
double getDistInCMatEcal (double eta1, double phi1, double eta2, double phi2, bool debug=false)
 
double getDistInCMatHcal (double eta1, double phi1, double eta2, double phi2, bool debug=false)
 
double getDistInPlaneTrackDir (const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
 
double getEnergy (HBHERecHitCollection::const_iterator hit, bool useRaw=false, bool debug=false)
 
double getEnergy (edm::PCaloHitContainer::const_iterator hit, bool useRaw=false, bool debug=false)
 
EtaPhi getEtaPhi (int ieta, int iphi, bool debug=false)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, int &ieta, int &iphi, bool debug=false)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, int &ieta, int &iphi, bool debug=false)
 
GlobalPoint getGpos (const CaloGeometry *geo, HBHERecHitCollection::const_iterator hit, bool debug=false)
 
GlobalPoint getGpos (const CaloGeometry *geo, edm::PCaloHitContainer::const_iterator hit, bool debug=false)
 
HcalDetId getHotCell (std::vector< HBHERecHitCollection::const_iterator > &hit, bool includeHO, bool useRaw=false, bool debug=false)
 
HcalDetId getHotCell (std::vector< std::vector< PCaloHit >::const_iterator > &hit, bool includeHO, bool useRaw=false, bool debug=false)
 
double getRawEnergy (HBHERecHitCollection::const_iterator hit, bool useRaw=false)
 
double getRawEnergy (edm::PCaloHitContainer::const_iterator hit, bool useRaw=false)
 
bool goodTrack (const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const HcalTopology *topology, int ieta, int iphi, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const HcalTopology *topology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const HcalTopology *topology, int ieta, int iphi, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const HcalTopology *topology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
template<typename T >
void hitECALmatrix (CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, std::vector< typename T::const_iterator > &hitlist, bool debug=false)
 
template<typename T >
void hitHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, std::vector< typename T::const_iterator > &hitlist, bool includeHO=false, bool debug=false)
 
template<typename T >
void hitHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, std::vector< typename T::const_iterator > &hitlist, bool includeHO=false, bool debug=false)
 
template<typename T >
void hitsHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, std::vector< typename T::const_iterator > &hitlist, bool debug=false)
 
template<typename T >
DetId hotCrystal (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
DetId hotCrystal (std::vector< DetId > &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double tMin=-500, double tMax=500, bool debug=false)
 
edm::SimTrackContainer::const_iterator matchedSimTrack (const edm::Event &iEvent, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, bool debug=false)
 
std::vector< int > matchedSimTrackId (const edm::Event &, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, bool debug=false)
 
simTkInfo matchedSimTrackInfo (unsigned int simTkId, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
void matrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixECALIds (const DetId &det, double dR, const GlobalVector &trackMom, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false, bool igNoreTransition=true)
 
void matrixECALIds (const DetId &det, int ietaE, int ietaW, int iphiN, int iphiS, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ietaE, int ietaW, int iphiN, int iphiS, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixHCALIds (std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIds (const DetId &det, const CaloGeometry *geo, const HcalTopology *topology, double dR, const GlobalVector &trackMom, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIds (std::vector< DetId > &dets, const HcalTopology *topology, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIdsDepth (std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
 
template<typename T >
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)
 
template<typename T >
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)
 
template<typename T >
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::vector< DetIdnewECALIdEW (std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewECALIdEW (std::vector< DetId > &dets, unsigned int last, std::vector< int > &ietaE, std::vector< int > &ietaW, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewECALIdNS (std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewECALIdNS (std::vector< DetId > &dets, unsigned int last, std::vector< int > &ietaE, std::vector< int > &ietaW, std::vector< int > &iphiN, std::vector< int > &iphiS, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewHCALIdEW (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
 
std::vector< DetIdnewHCALIdEW (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ietaE, int ietaW, bool debug=false)
 
std::vector< DetIdnewHCALIdNS (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
 
std::vector< DetIdnewHCALIdNS (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ietaE, int ietaW, int iphiN, int iphiS, bool debug=false)
 
edm::SimTrackContainer::const_iterator parentSimTrack (edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
std::vector< spr::propagatedTrackIDpropagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, std::vector< spr::propagatedTrackID > &vdets, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, std::vector< spr::propagatedTrackDirection > &trkDir, bool debug=false)
 
spr::propagatedTrackID propagateCALO (const reco::Track *, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
 
std::vector< spr::propagatedGenTrackIDpropagateCALO (const HepMC::GenEvent *genEvent, edm::ESHandle< ParticleDataTable > &pdt, const CaloGeometry *geo, const MagneticField *bField, double etaMax=3.0, bool debug=false)
 
std::vector< spr::propagatedGenParticleIDpropagateCALO (edm::Handle< reco::GenParticleCollection > &genParticles, edm::ESHandle< ParticleDataTable > &pdt, const CaloGeometry *geo, const MagneticField *bField, double etaMax=3.0, bool debug=false)
 
spr::propagatedTrackDirection propagateCALO (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
 
spr::propagatedTrack propagateCalo (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
 
std::vector< spr::propagatedTrackIDpropagateCosmicCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateECAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< bool, HcalDetIdpropagateHCALBack (const reco::Track *, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateTracker (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, double > propagateTrackerEnd (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToECAL (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToHCAL (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToHCAL (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const MagneticField *, bool debug=false)
 
void simpleMove (DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
 
spr::trackAtOrigin simTrackAtOrigin (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
double timeOfFlight (DetId id, const CaloGeometry *geo, bool debug=false)
 
bool validSimTrack (unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 

Variables

static const double deltaEta = 0.087
 
static const double etaBEEcal = 1.479
 
static const double etaBEHcal = 1.392
 
static const double etaBETrak = 1.705
 
static const double rBackHB = 288.8
 
static const double rBackTB = 109.0
 
static const double rFrontEB = 129.4
 
static const double rFrontHB = 180.7
 
static const double rFrontHO = 384.8
 
static const double zBackHE = 549.3
 
static const double zBackTE = 290.0
 
static const double zFrontEE = 319.2
 
static const double zFrontES = 303.2
 
static const double zFrontHE = 402.7
 
static const double zFrontHF = 1115.
 
static const double zFrontTE = 110.0
 

Function Documentation

template<typename T >
energyMap spr::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 
)
void spr::cGenSimInfo ( std::vector< DetId > &  vdets,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
bool  ifECAL,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 113 of file GenSimInfo.cc.

References spr::genSimInfo::cHadronEne, spr::genSimInfo::cHadronEne_, ALCARECOTkAlJpsiMuMu_cff::charge, chargeIsolation(), gather_cfg::cout, spr::genSimInfo::eleEne, mps_fire::i, spr::genSimInfo::isChargedIso, spr::genSimInfo::maxNearP, spr::genSimInfo::muEne, spr::genSimInfo::nHadronEne, AlCaHLTBitMon_ParallelJobs::p, BPhysicsValidation_cfi::pdgid, and spr::genSimInfo::photonEne.

Referenced by cGenSimInfo(), eGenSimInfo(), and hGenSimInfo().

113  {
114 
115  info.maxNearP=-1.0;
116  info.cHadronEne=info.nHadronEne=info.eleEne=info.muEne=info.photonEne=0.0;
117  info.isChargedIso=true;
118  for (int i=0; i<3; ++i) info.cHadronEne_[i]=0.0;
119  for (unsigned int i=0; i<trackIds.size(); ++i) {
120  HepMC::GenEvent::particle_const_iterator trkItr2 = trackIds[i].trkItr;
121  // avoid the track under consideration
122  if ( (trkItr2 != trkItr) && trackIds[i].ok) {
123  int charge = trackIds[i].charge;
124  int pdgid = trackIds[i].pdgId;
125  double p = (*trkItr2)->momentum().rho();
126  bool isolat= false;
127  if (ifECAL) {
128  const DetId anyCell = trackIds[i].detIdECAL;
129  isolat = spr::chargeIsolation(anyCell,vdets);
130  } else {
131  const DetId anyCell = trackIds[i].detIdHCAL;
132  isolat = spr::chargeIsolation(anyCell,vdets);
133  }
134  if (!isolat) spr::cGenSimInfo(charge, pdgid, p, info, debug);
135  }
136  }
137 #ifdef EDM_ML_DEBUG
138  if (debug) {
139  std::cout << "Isolation variables: isChargedIso :" << info.isChargedIso
140  << " maxNearP " << info.maxNearP << " Energy e/mu/g/ch/nh "
141  << info.eleEne << "," << info.muEne << "," << info.photonEne
142  << "," << info.cHadronEne << "," << info.nHadronEne
143  << " charge " << info.cHadronEne_[0] << ","
144  << info.cHadronEne_[1] << "," << info.cHadronEne_[2]
145  << std::endl;
146  }
147 #endif
148  }
double cHadronEne_[3]
Definition: GenSimInfo.h:47
double photonEne
Definition: GenSimInfo.h:45
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
double cHadronEne
Definition: GenSimInfo.h:45
double nHadronEne
Definition: GenSimInfo.h:45
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
double maxNearP
Definition: GenSimInfo.h:44
void spr::cGenSimInfo ( std::vector< DetId > &  vdets,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
bool  ifECAL,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 150 of file GenSimInfo.cc.

References cGenSimInfo(), spr::genSimInfo::cHadronEne, spr::genSimInfo::cHadronEne_, ALCARECOTkAlJpsiMuMu_cff::charge, chargeIsolation(), gather_cfg::cout, spr::genSimInfo::eleEne, mps_fire::i, spr::genSimInfo::isChargedIso, spr::genSimInfo::maxNearP, spr::genSimInfo::muEne, spr::genSimInfo::nHadronEne, AlCaHLTBitMon_ParallelJobs::p, BPhysicsValidation_cfi::pdgid, and spr::genSimInfo::photonEne.

150  {
151 
152  info.maxNearP=-1.0;
153  info.cHadronEne=info.nHadronEne=info.eleEne=info.muEne=info.photonEne=0.0;
154  info.isChargedIso=true;
155  for (int i=0; i<3; ++i) info.cHadronEne_[i]=0.0;
156  for (unsigned int i=0; i<trackIds.size(); ++i) {
157  reco::GenParticleCollection::const_iterator trkItr2 = trackIds[i].trkItr;
158  // avoid the track under consideration
159  if ( (trkItr2 != trkItr) && trackIds[i].ok) {
160  int charge = trackIds[i].charge;
161  int pdgid = trackIds[i].pdgId;
162  double p = trkItr2->momentum().R();
163  bool isolat= false;
164  if (ifECAL) {
165  const DetId anyCell = trackIds[i].detIdECAL;
166  isolat = spr::chargeIsolation(anyCell,vdets);
167  } else {
168  const DetId anyCell = trackIds[i].detIdHCAL;
169  isolat = spr::chargeIsolation(anyCell,vdets);
170  }
171  if (!isolat) spr::cGenSimInfo(charge, pdgid, p, info, debug);
172  }
173  }
174 
175 #ifdef EDM_ML_DEBUG
176  if (debug) {
177  std::cout << "Isolation variables: isChargedIso :" << info.isChargedIso
178  << " maxNearP " << info.maxNearP << " Energy e/mu/g/ch/nh "
179  << info.eleEne << "," << info.muEne << "," << info.photonEne
180  << "," << info.cHadronEne << "," << info.nHadronEne
181  << " charge " << info.cHadronEne_[0] << ","
182  << info.cHadronEne_[1] << "," << info.cHadronEne_[2]
183  << std::endl;
184  }
185 #endif
186  }
double cHadronEne_[3]
Definition: GenSimInfo.h:47
double photonEne
Definition: GenSimInfo.h:45
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
double cHadronEne
Definition: GenSimInfo.h:45
double nHadronEne
Definition: GenSimInfo.h:45
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
double maxNearP
Definition: GenSimInfo.h:44
void spr::cGenSimInfo ( int  charge,
int  pdgid,
double  p,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 188 of file GenSimInfo.cc.

References funct::abs(), spr::genSimInfo::cHadronEne, spr::genSimInfo::cHadronEne_, spr::genSimInfo::eleEne, spr::genSimInfo::isChargedIso, spr::genSimInfo::maxNearP, spr::genSimInfo::muEne, spr::genSimInfo::nHadronEne, AlCaHLTBitMon_ParallelJobs::p, and spr::genSimInfo::photonEne.

189  {
190 
191  if (pdgid==22 ) info.photonEne += p;
192  else if (pdgid==11) info.eleEne += p;
193  else if (pdgid==13) info.muEne += p;
194  else if (std::abs(charge)>0) {
195  info.isChargedIso = false;
196  info.cHadronEne += p;
197  if (p>1.0) info.cHadronEne_[0] += p;
198  if (p>2.0) info.cHadronEne_[1] += p;
199  if (p>3.0) info.cHadronEne_[2] += p;
200  if (info.maxNearP<p) info.maxNearP=p;
201  } else if (std::abs(charge)==0) {
202  info.nHadronEne += p;
203  }
204  }
double cHadronEne_[3]
Definition: GenSimInfo.h:47
double photonEne
Definition: GenSimInfo.h:45
double cHadronEne
Definition: GenSimInfo.h:45
double nHadronEne
Definition: GenSimInfo.h:45
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double maxNearP
Definition: GenSimInfo.h:44
double spr::chargeIsolation ( const edm::Event iEvent,
const edm::EventSetup iSetup,
CaloNavigator< DetId > &  theNavigator,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloSubdetectorGeometry gEB,
const CaloSubdetectorGeometry gEE,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string  theTrackQuality,
bool   
)

Definition at line 16 of file ChargeIsolationExtra.cc.

References funct::abs(), TrackDetectorAssociator::associate(), chargeIsolation(), gather_cfg::cout, debug, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), TrackDetectorAssociator::getFreeTrajectoryState(), TrackDetMatchInfo::isGoodEcal, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtEcal.

29  {
30 
31  double maxNearP = -1.0;
33 
34  // const DetId anyCell,
35  reco::TrackCollection::const_iterator trkItr2;
36  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
37 
38  const reco::Track* pTrack2 = &(*trkItr2);
39 
40  bool trkQuality = pTrack2->quality(trackQuality_);
41  if ( (trkItr2 != trkItr) && trkQuality ) {
42 
43  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
44  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
45  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());
46 
47  if (info2.isGoodEcal ) {
48  if (std::abs(point2.eta())<spr::etaBEEcal) {
49  const DetId anyCell = gEB->getClosestCell(point2);
50 #ifdef EDM_ML_DEBUG
51  if (debug) std::cout << "chargeIsolation:: EB cell " << (EBDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
52 #endif
53  if (!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
54  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
55  }
56  } else {
57  const DetId anyCell = gEE->getClosestCell(point2);
58 #ifdef EDM_ML_DEBUG
59  if (debug) std::cout << "chargeIsolation:: EE cell " << (EEDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
60 #endif
61  if(!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
62  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
63  }
64  }
65  } //info2.isGoodEcal
66  }
67  }
68  return maxNearP;
69  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
static const double etaBEEcal
Definition: CaloConstants.h:12
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:151
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
double spr::chargeIsolation ( const edm::Event iEvent,
const edm::EventSetup iSetup,
CaloNavigator< DetId > &  navigator,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloSubdetectorGeometry gEB,
const CaloSubdetectorGeometry gEE,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)
bool spr::chargeIsolation ( const DetId  anyCell,
CaloNavigator< DetId > &  navigator,
int  deta,
int  dphi 
)

Definition at line 73 of file ChargeIsolationExtra.cc.

References CaloNavigator< T, TOPO >::home(), and CaloNavigator< T, TOPO >::offsetBy().

73  {
74 
75  bool isIsolated = false;
76 
77  DetId thisDet;
78 
79  for (int dx = -ieta; dx < ieta+1; ++dx) {
80  for (int dy = -iphi; dy < iphi+1; ++dy) {
81 
82  thisDet = navigator.offsetBy(dx, dy);
83  navigator.home();
84 
85  if (thisDet != DetId(0)) {
86  if (thisDet == anyCell) {
87  isIsolated = false;
88  return isIsolated;
89  }
90  }
91  }
92  }
93  return isIsolated;
94  }
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
Definition: CaloNavigator.h:80
void home() const
move the navigator back to the starting point
Definition: DetId.h:18
bool spr::chargeIsolation ( const DetId  anyCell,
std::vector< DetId > &  vdets 
)

Definition at line 186 of file ChargeIsolation.cc.

References mps_fire::i.

Referenced by cGenSimInfo(), chargeIsolation(), chargeIsolationEcal(), and chargeIsolationHcal().

186  {
187  bool isIsolated = true;
188  for (unsigned int i=0; i<vdets.size(); i++){
189  if (anyCell == vdets[i] ) {
190  isIsolated = false;
191  break;
192  }
193  }
194  return isIsolated;
195  }
double spr::chargeIsolationCone ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackDirection > &  trkDirs,
double  dR,
int &  nNearTRKs,
bool  debug = false 
)

Definition at line 254 of file ChargeIsolation.cc.

References coneChargeIsolation(), gather_cfg::cout, convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, and reco::TrackBase::p().

Referenced by IsoTrackCalibration::analyze(), IsoTrackCalib::analyze(), IsolatedTracksHcalScale::analyze(), IsoTrig::chgIsolation(), AlCaIsoTracksFilter::filter(), IsoTrig::getGoodTracks(), AlCaIsoTracksProducer::select(), IsoTrig::studyIsolation(), IsoTrig::studyMipCut(), and IsoTrig::StudyTrkEbyP().

254  {
255 
256  double maxNearP = -1.0;
257  nNearTRKs = 0;
258  if (trkDirs[trkIndex].okHCAL) {
259 #ifdef EDM_ML_DEBUG
260  if (debug) std::cout << "chargeIsolationCone with " << trkDirs.size() << " tracks " << std::endl;
261 #endif
262  for (unsigned int indx=0; indx<trkDirs.size(); ++indx) {
263  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
264  int isConeChargedIso = spr::coneChargeIsolation(trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
265  if (isConeChargedIso==0) {
266  nNearTRKs++;
267  const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
268  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
269  }
270  }
271  }
272  }
273 #ifdef EDM_ML_DEBUG
274  if (debug) std::cout << "chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL << " maxNearP " << maxNearP << std::endl;
275 #endif
276  return maxNearP;
277  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
#define debug
Definition: HDRShower.cc:19
double coneChargeIsolation(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
double spr::chargeIsolationEcal ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const DetId coreDet,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloGeometry geo,
const CaloTopology caloTopology,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 98 of file ChargeIsolationExtra.cc.

References funct::abs(), TrackDetectorAssociator::associate(), chargeIsolation(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), TrackDetectorAssociator::getFreeTrajectoryState(), CaloGeometry::getSubdetectorGeometry(), TrackDetMatchInfo::isGoodEcal, matrixECALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtEcal.

98  {
99 
100  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
101  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
102 
103  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
104 #ifdef EDM_ML_DEBUG
105  if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
106 #endif
107  double maxNearP = -1.0;
108  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
109 
110  // const DetId anyCell,
111  reco::TrackCollection::const_iterator trkItr2;
112  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
113 
114  const reco::Track* pTrack2 = &(*trkItr2);
115 
116  bool trkQuality = pTrack2->quality(trackQuality_);
117  if ( (trkItr2 != trkItr) && trkQuality ) {
118 
119  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
120  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
121  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());
122 
123  if (info2.isGoodEcal ) {
124  if (std::abs(point2.eta())<spr::etaBEEcal) {
125  const DetId anyCell = barrelGeom->getClosestCell(point2);
126 #ifdef EDM_ML_DEBUG
127  if (debug) std::cout << "chargeIsolation:: EB cell " << (EBDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
128 #endif
129  if (!spr::chargeIsolation(anyCell,vdets)) {
130  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
131  }
132  } else {
133  const DetId anyCell = endcapGeom->getClosestCell(point2);
134 #ifdef EDM_ML_DEBUG
135  if (debug) std::cout << "chargeIsolation:: EE cell " << (EEDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
136 #endif
137  if (!spr::chargeIsolation(anyCell,vdets)) {
138  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
139  }
140  }
141  } //info2.isGoodEcal
142  }
143  }
144  return maxNearP;
145  }
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
virtual DetId getClosestCell(const GlobalPoint &r) const
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:151
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
double spr::chargeIsolationEcal ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackID > &  vdetIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 16 of file ChargeIsolation.cc.

References chargeIsolation(), gather_cfg::cout, EcalBarrel, matrixECALIds(), convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), and DetId::subdetId().

Referenced by StudyHLT::analyze(), and IsolatedTracksNxN::analyze().

16  {
17 
18  const DetId coreDet = vdetIds[trkIndex].detIdECAL;
19 #ifdef EDM_ML_DEBUG
20  if (debug) {
21  if (coreDet.subdetId() == EcalBarrel)
22  std::cout << "DetId " << (EBDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL << std::endl;
23  else
24  std::cout << "DetId " << (EEDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL << std::endl;
25  }
26 #endif
27  double maxNearP = -1.0;
28  if (vdetIds[trkIndex].okECAL) {
29  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
30 #ifdef EDM_ML_DEBUG
31  if (debug) std::cout << "chargeIsolationEcal:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
32 #endif
33 
34  for (unsigned int indx=0; indx<vdetIds.size(); ++indx) {
35  if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okECAL) {
36  const DetId anyCell = vdetIds[indx].detIdECAL;
37  if (!spr::chargeIsolation(anyCell,vdets)) {
38  const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
39  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
40  }
41  }
42  }
43  }
44  return maxNearP;
45  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
double spr::chargeIsolationEcal ( const DetId coreDet,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloGeometry geo,
const CaloTopology caloTopology,
const MagneticField bField,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 49 of file ChargeIsolation.cc.

References funct::abs(), chargeIsolation(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), info(), matrixECALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), propagateECAL(), reco::TrackBase::quality(), and reco::TrackBase::qualityByName().

49  {
50 
51  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
52  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
53 
54  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
55 #ifdef EDM_ML_DEBUG
56  if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
57 #endif
58  double maxNearP = -1.0;
60 
61  // const DetId anyCell,
62  reco::TrackCollection::const_iterator trkItr2;
63  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
64 
65  const reco::Track* pTrack2 = &(*trkItr2);
66 
67  bool trkQuality = pTrack2->quality(trackQuality_);
68  if ( (trkItr2 != trkItr) && trkQuality ) {
69 
70  std::pair<math::XYZPoint,bool> info = spr::propagateECAL(pTrack2,bField);
71  const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());
72 
73  if (info.second) {
74  if (std::abs(point2.eta())<spr::etaBEEcal) {
75  const DetId anyCell = barrelGeom->getClosestCell(point2);
76  if (!spr::chargeIsolation(anyCell,vdets)) {
77 #ifdef EDM_ML_DEBUG
78  if (debug) std::cout << "chargeIsolationEcal Cell " << (EBDetId)(anyCell) << " pt " << pTrack2->p() << std::endl;
79 #endif
80  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
81  }
82  } else {
83  const DetId anyCell = endcapGeom->getClosestCell(point2);
84  if (!spr::chargeIsolation(anyCell,vdets)) {
85 #ifdef EDM_ML_DEBUG
86  if (debug) std::cout << "chargeIsolationEcal Cell " << (EEDetId)(anyCell) << " pt " << pTrack2->p() << std::endl;
87 #endif
88  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
89  }
90  }
91  } //info.second
92  }
93  }
94  return maxNearP;
95  }
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
virtual DetId getClosestCell(const GlobalPoint &r) const
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:151
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
double spr::chargeIsolationHcal ( const edm::Event iEvent,
const edm::EventSetup iSetup,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const DetId  ClosestCell,
const HcalTopology topology,
const CaloSubdetectorGeometry gHB,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 149 of file ChargeIsolationExtra.cc.

References TrackDetectorAssociator::associate(), chargeIsolation(), gather_cfg::cout, reco::TrackBase::eta(), CaloSubdetectorGeometry::getClosestCell(), TrackDetectorAssociator::getFreeTrajectoryState(), mps_fire::i, TrackDetMatchInfo::isGoodHcal, matrixHCALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::phi(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtHcal.

149  {
150 
151  std::vector<DetId> dets(1,ClosestCell);
152 
153 #ifdef EDM_ML_DEBUG
154  if (debug) std::cout << (HcalDetId) ClosestCell << std::endl;
155 #endif
156  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
157  std::vector<DetId>::iterator it;
158 
159 #ifdef EDM_ML_DEBUG
160  if (debug) {
161  for (unsigned int i=0; i<vdets.size(); i++) {
162  std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
163  }
164  }
165 #endif
166  double maxNearP = -1.0;
167  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
168 
169  reco::TrackCollection::const_iterator trkItr2;
170  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
171 
172  const reco::Track* pTrack2 = &(*trkItr2);
173 
174  bool trkQuality = pTrack2->quality(trackQuality_);
175  if ( (trkItr2 != trkItr) && trkQuality ) {
176  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
177  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
178  const GlobalPoint point2(info2.trkGlobPosAtHcal.x(),info2.trkGlobPosAtHcal.y(),info2.trkGlobPosAtHcal.z());
179 
180 #ifdef EDM_ML_DEBUG
181  if (debug) {
182  std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
183  }
184 #endif
185  if (info2.isGoodHcal ) {
186  const DetId anyCell = gHB->getClosestCell(point2);
187 #ifdef EDM_ML_DEBUG
188  if (debug) std::cout << "chargeIsolation:: HCAL cell " << (HcalDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
189 #endif
190  if (!spr::chargeIsolation(anyCell,vdets)) {
191  if(maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
192  }
193 #ifdef EDM_ML_DEBUG
194  if (debug){
195  std::cout << "maxNearP " << maxNearP << " thisCell "
196  << (HcalDetId)anyCell << " ("
197  << info2.trkGlobPosAtHcal.x() << ","
198  << info2.trkGlobPosAtHcal.y() <<","
199  << info2.trkGlobPosAtHcal.z() <<")" << std::endl;
200  }
201 #endif
202  }
203  }
204  }
205  return maxNearP;
206  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:151
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
math::XYZPoint trkGlobPosAtHcal
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
double spr::chargeIsolationHcal ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackID > &  vdetIds,
const HcalTopology topology,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 99 of file ChargeIsolation.cc.

References chargeIsolation(), gather_cfg::cout, matrixHCALIds(), convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, and reco::TrackBase::p().

Referenced by StudyHLT::analyze(), and IsolatedTracksNxN::analyze().

99  {
100 
101  std::vector<DetId> dets(1,vdetIds[trkIndex].detIdHCAL);
102 #ifdef EDM_ML_DEBUG
103  if (debug) {
104  std::cout << "DetId " << (HcalDetId)(dets[0]) << " Flag " << vdetIds[trkIndex].okHCAL << std::endl;
105  }
106 #endif
107  double maxNearP = -1.0;
108  if (vdetIds[trkIndex].okHCAL) {
109  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
110 #ifdef EDM_ML_DEBUG
111  if (debug) std::cout << "chargeIsolationHcal:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
112 #endif
113  for (unsigned indx = 0; indx<vdetIds.size(); ++indx) {
114  if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okHCAL) {
115  const DetId anyCell = vdetIds[indx].detIdHCAL;
116  if (!spr::chargeIsolation(anyCell,vdets)) {
117  const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
118 #ifdef EDM_ML_DEBUG
119  if (debug) std::cout << "chargeIsolationHcal Cell " << (HcalDetId)(anyCell) << " pt " << pTrack->p() << std::endl;
120 #endif
121  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
122  }
123  }
124  }
125  }
126  return maxNearP;
127  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
double spr::chargeIsolationHcal ( reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const DetId  ClosestCell,
const HcalTopology topology,
const CaloSubdetectorGeometry gHB,
const MagneticField bField,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 131 of file ChargeIsolation.cc.

References chargeIsolation(), gather_cfg::cout, reco::TrackBase::eta(), CaloSubdetectorGeometry::getClosestCell(), mps_fire::i, info(), matrixHCALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::phi(), propagateHCAL(), reco::TrackBase::quality(), and reco::TrackBase::qualityByName().

131  {
132 
133  std::vector<DetId> dets(1,ClosestCell);
134 #ifdef EDM_ML_DEBUG
135  if (debug) std::cout << (HcalDetId) ClosestCell << std::endl;
136 #endif
137  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
138  std::vector<DetId>::iterator it;
139 
140 #ifdef EDM_ML_DEBUG
141  if (debug) {
142  for (unsigned int i=0; i<vdets.size(); i++) {
143  std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
144  }
145  }
146 #endif
147  double maxNearP = -1.0;
148  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
149 
150  reco::TrackCollection::const_iterator trkItr2;
151  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
152 
153  const reco::Track* pTrack2 = &(*trkItr2);
154 
155  bool trkQuality = pTrack2->quality(trackQuality_);
156  if ( (trkItr2 != trkItr) && trkQuality ) {
157  std::pair<math::XYZPoint,bool> info = spr::propagateHCAL(pTrack2,bField);
158  const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());
159 
160 #ifdef EDM_ML_DEBUG
161  if (debug) {
162  std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
163  }
164 #endif
165  if (info.second) {
166  const DetId anyCell = gHB->getClosestCell(point2);
167  if (!spr::chargeIsolation(anyCell,vdets)) {
168  if(maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
169  }
170 #ifdef EDM_ML_DEBUG
171  if (debug){
172  std::cout << "maxNearP " << maxNearP << " thisCell "
173  << (HcalDetId)anyCell << " ("
174  << info.first.x() << "," << info.first.y() <<","
175  << info.first.z() << ")" << std::endl;
176  }
177 #endif
178  }
179  }
180  }
181  return maxNearP;
182  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
static const TGPicture * info(bool iBackgroundIsBlack)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:151
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
double spr::coneChargeIsolation ( const edm::Event iEvent,
const edm::EventSetup iSetup,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
std::string  theTrackQuality,
int &  nNearTRKs,
int &  nLayers_maxNearP,
int &  trkQual_maxNearP,
double &  maxNearP_goodTrk,
const GlobalPoint hpoint1,
const GlobalVector trackMom,
double  dR 
)

Definition at line 199 of file ChargeIsolation.cc.

References TrackDetectorAssociator::associate(), TrackDetectorAssociator::getFreeTrajectoryState(), reco::TrackBase::hitPattern(), TrackDetMatchInfo::isGoodHcal, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), reco::HitPattern::trackerLayersWithMeasurement(), and TrackDetMatchInfo::trkGlobPosAtHcal.

Referenced by IsolatedTracksCone::analyze(), and chargeIsolationCone().

199  {
200 
201  nNearTRKs=0;
202  nLayers_maxNearP=0;
203  trkQual_maxNearP=-1;
204  maxNearP_goodTrk = -999.0;
205  double maxNearP = -999.0;
206  reco::TrackBase::TrackQuality trackQuality_= reco::TrackBase::qualityByName(theTrackQuality);
207 
208  // Iterate over tracks
209  reco::TrackCollection::const_iterator trkItr2;
210  for( trkItr2 = trkCollection->begin();
211  trkItr2 != trkCollection->end(); ++trkItr2){
212 
213  // Get track
214  const reco::Track* pTrack2 = &(*trkItr2);
215 
216  // Get track qual, nlayers, and hit pattern
217  if (pTrack2->quality(trackQuality_)) trkQual_maxNearP = 1;
218  const reco::HitPattern& hitp = pTrack2->hitPattern();
219  nLayers_maxNearP = hitp.trackerLayersWithMeasurement() ;
220 
221  // Skip if the neighboring track candidate is the iso-track
222  // candidate
223  if (trkItr2 != trkItr) {
224 
225  // Get propagator
226  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
227  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
228 
229  // Make sure it reaches Hcal
230  if (info2.isGoodHcal ) {
231 
232  const GlobalPoint point2(info2.trkGlobPosAtHcal.x(),
233  info2.trkGlobPosAtHcal.y(),
234  info2.trkGlobPosAtHcal.z());
235 
236  int isConeChargedIso = spr::coneChargeIsolation(hpoint1, point2, trackMom, dR);
237 
238  if (isConeChargedIso==0) {
239  nNearTRKs++;
240  if(maxNearP<pTrack2->p()) {
241  maxNearP=pTrack2->p();
242  if (trkQual_maxNearP>0 && nLayers_maxNearP>7 && maxNearP_goodTrk<pTrack2->p()) {
243  maxNearP_goodTrk=pTrack2->p();
244  }
245  }
246  }
247  }
248  }
249  } // Iterate over track loop
250 
251  return maxNearP;
252  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
TrackQuality
track quality
Definition: TrackBase.h:151
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:512
math::XYZPoint trkGlobPosAtHcal
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
double coneChargeIsolation(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
int spr::coneChargeIsolation ( const GlobalPoint hpoint1,
const GlobalPoint point2,
const GlobalVector trackMom,
double  dR 
)

Definition at line 280 of file ChargeIsolation.cc.

References getDistInPlaneTrackDir().

280  {
281 
282  int isIsolated = 1;
283  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR) isIsolated = 1;
284  else isIsolated = 0;
285  return isIsolated;
286  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:11
void spr::debugEcalDets ( unsigned int  i,
const DetId det,
bool  flag 
)

Definition at line 11 of file DebugInfo.cc.

References gather_cfg::cout, TauDecayModes::dec, EcalBarrel, EcalEndcap, hcalTTPDigis_cfi::id, and DetId::subdetId().

Referenced by debugEcalDets(), eGenSimInfo(), extraIds(), matrixECALIds(), newECALIdEW(), and newECALIdNS().

11  {
12 
13  std::cout << "Cell [" << i << "] 0x";
14  if (det.subdetId() == EcalBarrel) {
15  EBDetId id = det;
16  std::cout << std::hex << det() << std::dec << " " << id;
17  } else if (det.subdetId() == EcalEndcap) {
18  EEDetId id = det;
19  std::cout << std::hex << det() << std::dec << " " << id;
20  } else {
21  std::cout << std::hex << det() << std::dec << " Unknown Type";
22  }
23  if (flag) std::cout << std::endl;
24  }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
void spr::debugEcalDets ( unsigned int  last,
std::vector< DetId > &  vdets 
)

Definition at line 26 of file DebugInfo.cc.

References debugEcalDets(), and mps_fire::i.

26  {
27 
28  for (unsigned int i=last; i<vdets.size(); ++i) {
29  debugEcalDets (i, vdets[i], true);
30  }
31  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void spr::debugEcalDets ( unsigned int  last,
std::vector< DetId > &  vdets,
std::vector< CaloDirection > &  dirs 
)

Definition at line 33 of file DebugInfo.cc.

References gather_cfg::cout, debugEcalDets(), and mps_fire::i.

34  {
35 
36  for (unsigned int i=last; i<vdets.size(); ++i) {
37  debugEcalDets (i, vdets[i], false);
38  std::cout << " along " << dirs[i] << std::endl;
39  }
40  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void spr::debugHcalDets ( unsigned int  last,
std::vector< DetId > &  vdets 
)

Definition at line 42 of file DebugInfo.cc.

References gather_cfg::cout, TauDecayModes::dec, and mps_fire::i.

Referenced by eHCALmatrix(), hGenSimInfo(), matrixHCALIds(), matrixHCALIdsDepth(), newHCALIdEW(), and newHCALIdNS().

42  {
43 
44  for (unsigned int i=last; i<vdets.size(); ++i) {
45  HcalDetId id = vdets[i]();
46  std::cout << "Cell [" << i << "] 0x" << std::hex << vdets[i]()
47  << std::dec << " " << id << std::endl;
48  }
49  }
template<typename T >
void spr::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 
)
template<typename T >
void spr::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 
)
std::map<std::string,double> spr::eCaloSimInfo ( caloSimInfo info)
template<typename T >
double spr::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 
)
template<typename T >
double spr::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 
)
template<typename T >
std::map<std::string,double> spr::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 
)
template<typename T >
double spr::eCone_ecal ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
int  detOnly = -1,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< DetId > &  coneRecHitDetIds,
double &  distFromHotCell,
int &  ietaHotCell,
int &  iphiHotCell,
GlobalPoint gposHotCell,
int  detOnly = -1,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< DetId > &  coneRecHitDetIds,
std::vector< double > &  eHit,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
std::vector< DetId > &  coneRecHitDetIds,
double &  distFromHotCell,
int &  ietaHotCell,
int &  iphiHotCell,
GlobalPoint gposHotCell,
int  detOnly = -1,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalTrigTowerConstituentsMap ttMap,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
std::pair< double, bool > spr::eECALmatrix ( const DetId detId,
edm::Handle< EcalRecHitCollection > &  hitsEB,
edm::Handle< EcalRecHitCollection > &  hitsEE,
const EcalChannelStatus chStatus,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalSeverityLevelAlgo sevlv,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 10 of file eECALMatrix.cc.

References gather_cfg::cout, TauDecayModes::dec, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), CastorDataFrameFilter_impl::energySum(), findHit(), RemoveAddSevLevel::flag, edm::HandleBase::isValid(), EcalSeverityLevel::kWeird, matrixECALIds(), convertSQLiteXML::ok, edm::Handle< T >::product(), EcalDeadCellBoundaryEnergyFilter_cfi::recHitsEB, EcalSeverityLevelAlgo::severityLevel(), and groupFilesInBlocks::tt.

19  {
20 
21  std::vector<DetId> vdets;
22  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
23 
24  const EcalRecHitCollection * recHitsEB = 0;
25  if (hitsEB.isValid()) recHitsEB = hitsEB.product();
26  bool flag = true;
27 #ifdef EDM_ML_DEBUG
28  if (debug) {
29  std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
30  << " nXtals " << vdets.size() << std::endl;
31  }
32 #endif
33  double energySum = 0.0;
34  for (unsigned int i1=0; i1<vdets.size(); i1++) {
35  if (vdets[i1] != DetId(0)) {
36  bool ok = true;
37  std::vector<EcalRecHitCollection::const_iterator> hit;
38  if (vdets[i1].subdetId()==EcalBarrel) {
39  spr::findHit(hitsEB,vdets[i1],hit,debug);
40 
41  ok = (sevlv->severityLevel(vdets[i1], (*recHitsEB)) != EcalSeverityLevel::kWeird);
42  } else if (vdets[i1].subdetId()==EcalEndcap) {
43  spr::findHit(hitsEE,vdets[i1],hit,debug);
44  }
45 #ifdef EDM_ML_DEBUG
46  if (debug) std::cout << "Xtal 0x" <<std::hex << vdets[i1]() <<std::dec;
47 #endif
48  double ener=0, ethr=ebThr;
49  if (vdets[i1].subdetId() !=EcalBarrel) ethr = eeThr;
50  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
51  double en=0, tt=0;
52  if (vdets[i1].subdetId()==EcalBarrel) {
53  if (hit[ihit] != hitsEB->end()) {
54  en = hit[ihit]->energy();
55  tt = hit[ihit]->time();
56  }
57  } else if (vdets[i1].subdetId()==EcalEndcap) {
58  if (hit[ihit] != hitsEE->end()) {
59  en = hit[ihit]->energy();
60  tt = hit[ihit]->time();
61  }
62  }
63 #ifdef EDM_ML_DEBUG
64  if (debug) std::cout << " " << ihit << " " << en;
65 #endif
66  if (tt > tMin && tt < tMax) ener += en;
67  }
68  if (!ok) {
69  flag = false;
70 #ifdef EDM_ML_DEBUG
71  if (debug) std::cout << " detected to be a spike";
72 #endif
73  }
74 #ifdef EDM_ML_DEBUG
75  if (debug) std::cout << std::endl;
76 #endif
77  if (ener > ethr) energySum += ener;
78  }
79  }
80 #ifdef EDM_ML_DEBUG
81  if (debug) std::cout << "energyECAL: energySum = " << energySum << " flag = " << flag << std::endl;
82 #endif
83  return std::pair<double,bool>(energySum,flag);
84  }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
bool isValid() const
Definition: HandleBase.h:74
const_iterator end() const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
T const * product() const
Definition: Handle.h:81
double energySum(const DataFrame &df, int fs, int ls)
std::pair< double, bool > spr::eECALmatrix ( const DetId detId,
edm::Handle< EcalRecHitCollection > &  hitsEB,
edm::Handle< EcalRecHitCollection > &  hitsEE,
const EcalChannelStatus chStatus,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalSeverityLevelAlgo sevlv,
const EcalTrigTowerConstituentsMap ttMap,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 86 of file eECALMatrix.cc.

References gather_cfg::cout, TauDecayModes::dec, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), energyECALTower(), CastorDataFrameFilter_impl::energySum(), findHit(), RemoveAddSevLevel::flag, edm::HandleBase::isValid(), EcalSeverityLevel::kWeird, matrixECALIds(), convertSQLiteXML::ok, edm::Handle< T >::product(), EcalDeadCellBoundaryEnergyFilter_cfi::recHitsEB, EcalSeverityLevelAlgo::severityLevel(), and groupFilesInBlocks::tt.

96  {
97 
98  std::vector<DetId> vdets;
99  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
100 
101  const EcalRecHitCollection * recHitsEB = 0;
102  if (hitsEB.isValid()) recHitsEB = hitsEB.product();
103  bool flag = true;
104 #ifdef EDM_ML_DEBUG
105  if (debug) {
106  std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
107  << " nXtals " << vdets.size() << std::endl;
108  }
109 #endif
110  double energySum = 0.0;
111  for (unsigned int i1=0; i1<vdets.size(); i1++) {
112  if (vdets[i1] != DetId(0)) {
113  double eTower = spr::energyECALTower(vdets[i1], hitsEB, hitsEE, ttMap, debug);
114  bool ok = true;
115  if (vdets[i1].subdetId()==EcalBarrel) ok = (eTower > ebThr);
116  else if (vdets[i1].subdetId()==EcalEndcap) ok = (eTower > eeThr);
117 #ifdef EDM_ML_DEBUG
118  if (debug) std::cout << "Crystal 0x" <<std::hex << vdets[i1]()
119  <<std::dec << " Flag " << ok;
120 #endif
121  if (ok) {
122  std::vector<EcalRecHitCollection::const_iterator> hit;
123  if (vdets[i1].subdetId()==EcalBarrel) {
124  spr::findHit(hitsEB,vdets[i1],hit,debug);
125 
126  ok = (sevlv->severityLevel(vdets[i1], (*recHitsEB)) != EcalSeverityLevel::kWeird);
127  } else if (vdets[i1].subdetId()==EcalEndcap) {
128  spr::findHit(hitsEE,vdets[i1],hit,debug);
129  }
130  double ener=0;
131  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
132  double en=0, tt=0;
133  if (vdets[i1].subdetId()==EcalBarrel) {
134  if (hit[ihit] != hitsEB->end()) {
135  en = hit[ihit]->energy();
136  tt = hit[ihit]->time();
137  }
138  } else if (vdets[i1].subdetId()==EcalEndcap) {
139  if (hit[ihit] != hitsEE->end()) {
140  en = hit[ihit]->energy();
141  tt = hit[ihit]->time();
142  }
143  }
144 #ifdef EDM_ML_DEBUG
145  if (debug) std::cout << " " << ihit << " E " << en << " T " << tt;
146 #endif
147  if (tt > tMin && tt < tMax) ener += en;
148  }
149  if (!ok) {
150  flag = false;
151 #ifdef EDM_ML_DEBUG
152  if (debug) std::cout << " detected to be a spike";
153 #endif
154  }
155  energySum += ener;
156  }
157 #ifdef EDM_ML_DEBUG
158  if (debug) std::cout << std::endl;
159 #endif
160  }
161  }
162 #ifdef EDM_ML_DEBUG
163  if (debug) std::cout << "energyECAL: energySum = " << energySum << " flag = " << flag << std::endl;
164 #endif
165  return std::pair<double,bool>(energySum,flag);
166  }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
bool isValid() const
Definition: HandleBase.h:74
const_iterator end() const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
T const * product() const
Definition: Handle.h:81
double energySum(const DataFrame &df, int fs, int ls)
double energyECALTower(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
template<typename T >
std::vector<std::pair<DetId,double> > spr::eECALmatrixCell ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
std::pair<double,int> spr::eECALmatrixTotal ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::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 
)
template<typename T >
void spr::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 
)
template<typename T >
std::map<std::string,double> spr::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 
)
template<typename T >
void spr::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 
)
template<typename T >
energyMap spr::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 
)
template<typename T >
std::map<std::string,double> spr::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 
)
void spr::eGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 13 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugEcalDets(), and matrixECALIds().

Referenced by IsolatedGenParticles::analyze().

13  {
14 
15 #ifdef EDM_ML_DEBUG
16  if (debug) std::cout << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
17 #endif
18  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, false);
19 #ifdef EDM_ML_DEBUG
20  if (debug) spr::debugEcalDets(0, vdets);
21 #endif
22  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
23  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
#define debug
Definition: HDRShower.cc:19
void spr::eGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
double  dR,
const GlobalVector trackMom,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 25 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugEcalDets(), and matrixECALIds().

25  {
26 
27 #ifdef EDM_ML_DEBUG
28  if (debug) std::cout << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
29 #endif
30  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, false);
31 #ifdef EDM_ML_DEBUG
32  if (debug) spr::debugEcalDets(0, vdets);
33 #endif
34  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
35  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
#define debug
Definition: HDRShower.cc:19
void spr::eGenSimInfo ( const DetId coreDet,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 37 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugEcalDets(), and matrixECALIds().

37  {
38 
39 #ifdef EDM_ML_DEBUG
40  if (debug) std::cout << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
41 #endif
42  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, false);
43 #ifdef EDM_ML_DEBUG
44  if (debug) spr::debugEcalDets(0, vdets);
45 #endif
46  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
47  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
#define debug
Definition: HDRShower.cc:19
void spr::eGenSimInfo ( const DetId coreDet,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
double  dR,
const GlobalVector trackMom,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 49 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugEcalDets(), and matrixECALIds().

49  {
50 
51 #ifdef EDM_ML_DEBUG
52  if (debug) std::cout << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
53 #endif
54  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, false);
55 #ifdef EDM_ML_DEBUG
56  if (debug) spr::debugEcalDets(0, vdets);
57 #endif
58  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
59  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
#define debug
Definition: HDRShower.cc:19
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
bool  algoNew = true,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
std::vector< PCaloHit > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 11 of file eHCALMatrix.cc.

References gather_cfg::cout, debug, debugHcalDets(), eHCALThreshold(), CastorDataFrameFilter_impl::energySum(), findHit(), mps_fire::i, matrixHCALIds(), DetId::rawId(), and ntuplemaker::time.

18  {
19 
20  HcalDetId hcid0(det0.rawId());
21  HcalDetId hcid(hcid0.subdet(),hcid0.ieta(),hcid0.iphi(),1);
22  DetId det(hcid.rawId());
23 #ifdef EDM_ML_DEBUG
24  if (debug) std::cout << "Inside eHCALmatrix " << 2*ieta+1 << "X" << 2*iphi+1 << " Inclusion of HO Flag " << includeHO << std::endl;
25 #endif
26  double energySum(0);
27  std::vector<DetId> dets(1,det);
28  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
29 #ifdef EDM_ML_DEBUG
30  if (debug) {
31  std::cout << "matrixHCALIds::Total number of cells found is "
32  << vdets.size() << std::endl;
33  spr::debugHcalDets(0, vdets);
34  }
35 #endif
36  int khit(0);
37  for (unsigned int i=0; i<vdets.size(); i++) {
38  std::vector<std::vector<PCaloHit>::const_iterator> hit = spr::findHit(hits, vdets[i]);
39  double energy = 0;
40  int subdet = ((HcalDetId)(vdets[i].rawId())).subdet();
41  double eThr = spr::eHCALThreshold(subdet, hbThr, heThr, hfThr, hoThr);
42  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
43  if (hit[ihit] != hits.end()) {
44  khit++;
45 #ifdef EDM_ML_DEBUG
46  if (debug) std::cout << "energyHCAL:: Hit " << khit << " " << (HcalDetId)vdets[i] << " E " << hit[ihit]->energy() << " t " << hit[ihit]->time() << std::endl;
47 #endif
48  if (hit[ihit]->time() > tMin && hit[ihit]->time() < tMax) {
49  energy += hit[ihit]->energy();
50  }
51  }
52  }
53  if (energy>eThr) energySum += energy;
54  }
55 
56 #ifdef EDM_ML_DEBUG
57  if (debug) std::cout << "eHCALmatrix::Total energy " << energySum << std::endl;
58 #endif
59  return energySum;
60  }
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
double eHCALThreshold(int subdet, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100)
Definition: eHCALMatrix.cc:236
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
double energySum(const DataFrame &df, int fs, int ls)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
std::set< int > &  uniqueIdset,
bool  useRaw = false 
)
template<typename T >
double spr::eHCALmatrix ( const CaloGeometry geo,
const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
GlobalPoint gPosHotCell,
bool  useRaw = false 
)
template<typename T >
double spr::eHCALmatrix ( const CaloGeometry geo,
const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
HcalDetId hotCell,
bool  includeHO = false,
bool  useRaw = false,
bool  debug = false 
)
double spr::eHCALmatrix ( const CaloGeometry geo,
const HcalTopology topology,
const DetId det0,
std::vector< PCaloHit > &  hits,
int  ieta,
int  iphi,
HcalDetId hotCell,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 62 of file eHCALMatrix.cc.

References CastorDataFrameFilter_impl::energySum(), findHit(), runEdmFileComparison::found, HcalOuter, mps_fire::i, HcalDetId::ieta(), HcalDetId::iphi(), matrixHCALIds(), DetId::rawId(), and HcalDetId::subdet().

64  {
65 
66  HcalDetId hcid0(det0.rawId());
67  HcalDetId hcid(hcid0.subdet(),hcid0.ieta(),hcid0.iphi(),1);
68  DetId det(hcid.rawId());
69  std::vector<DetId> dets(1,det);
70  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, debug);
71  hotCell = hcid0;
72 
73  std::vector<std::vector<PCaloHit>::const_iterator> hitlist;
74  for (unsigned int i=0; i<vdets.size(); i++) {
75  std::vector<std::vector<PCaloHit>::const_iterator> hit = spr::findHit(hits, vdets[i]);
76  hitlist.insert(hitlist.end(), hit.begin(), hit.end());
77  }
78 
79  double energySum(0);
80  for (unsigned int ihit=0; ihit<hitlist.size(); ihit++)
81  energySum += hitlist[ihit]->energy();
82 
83  // Get hotCell ID
84  dets.clear();
85  std::vector<double> energies;
86  for (unsigned int ihit=0; ihit<hitlist.size(); ihit++) {
87  double energy = hitlist[ihit]->energy();
88  HcalDetId id0 = HcalDetId(hitlist[ihit]->id());
89  if ((id0.subdet() != HcalOuter) || includeHO) {
90  HcalDetId id1(id0.subdet(),id0.ieta(),id0.iphi(),1);
91  bool found(false);
92  for (unsigned int idet=0; idet<dets.size(); ++idet) {
93  if (id1 == HcalDetId(dets[idet])) {
94  energies[idet] += energy;
95  found = true;
96  break;
97  }
98  }
99  if (!found) {
100  dets.push_back(DetId(id1));
101  energies.push_back(energy);
102  }
103  }
104  }
105  double energyMax(-99.);
106  for (unsigned int ihit=0; ihit<dets.size(); ihit++) {
107  if (energies[ihit] > energyMax) {
108  energyMax = energies[ihit];
109  hotCell = HcalDetId(dets[ihit]);
110  }
111  }
112  return energySum;
113  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
double energySum(const DataFrame &df, int fs, int ls)
template<typename T >
std::vector< std::pair< DetId,double> > spr::eHCALmatrixCell ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
std::pair<double,int> spr::eHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::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 
)
template<typename T >
void spr::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 
)
template<typename T >
void spr::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 
)
template<typename T >
std::map<std::string,double> spr::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 
)
template<typename T >
energyMap spr::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 
)
template<typename T >
std::map<std::string,double> spr::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 
)
double spr::eHCALThreshold ( int  subdet,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100 
)

Definition at line 236 of file eHCALMatrix.cc.

References HcalEndcap, HcalForward, and HcalOuter.

Referenced by eHCALmatrix(), and energyHCALCell().

237  {
238  double eThr = hbThr;
239  if (subdet == (int)(HcalEndcap)) eThr = heThr;
240  else if (subdet == (int)(HcalForward)) eThr = hfThr;
241  else if (subdet == (int)(HcalOuter)) eThr = hoThr;
242  return eThr;
243  }
template<typename T >
std::vector<std::pair<DetId,double> > spr::energyDetIdHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyECAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::energyECAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const EcalTrigTowerConstituentsMap ttMap,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
std::vector<std::pair<DetId,double> > spr::energyECALCell ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyECALTower ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const EcalTrigTowerConstituentsMap ttMap,
bool  debug = false 
)

Referenced by eECALmatrix().

template<typename T >
double spr::energyHCAL ( std::vector< DetId > &  vNeighboursDetId,
std::vector< DetId > &  dets,
const HcalTopology topology,
edm::Handle< T > &  hits,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
void spr::energyHCALCell ( HcalDetId  detId,
edm::Handle< T > &  hits,
std::vector< std::pair< double, int > > &  energyCell,
int  maxDepth = 1,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
void spr::energyHCALCell ( HcalDetId  detId,
std::vector< PCaloHit > &  hits,
std::vector< std::pair< double, int > > &  energyCell,
int  maxDepth = 1,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 115 of file eHCALMatrix.cc.

References gather_cfg::cout, debug, eHCALThreshold(), findHit(), photonIsolationHIProducer_cfi::hbhe, HcalBarrel, HcalEndcap, mps_fire::i, HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), CMSBoostedTauSeedingParameters_cfi::maxDepth, HcalDetId::subdet(), and ntuplemaker::time.

122  {
123 
124  energyCell.clear();
125  int subdet = detId.subdet();
126  double eThr = spr::eHCALThreshold(subdet, hbThr, heThr, hfThr, hoThr);
127  bool hbhe = (detId.ietaAbs() == 16);
128  int depthHE = (maxDepth <= 6) ? 3 : 4;
129 #ifdef EDM_ML_DEBUG
130  if (debug)
131  std::cout << "energyHCALCell: input ID " << detId << " MaxDepth " << maxDepth << " Threshold (E) " << eThr << " (T) " << tMin << ":" << tMax << std::endl;
132 #endif
133  for (int i=0; i<maxDepth; i++) {
134  HcalSubdetector subdet0 = (hbhe) ? ((i+1 >= depthHE) ? HcalEndcap : HcalBarrel) : detId.subdet();
135  HcalDetId hcid(subdet0,detId.ieta(),detId.iphi(),i+1);
136  DetId det(hcid.rawId());
137  std::vector<std::vector<PCaloHit>::const_iterator> hit = spr::findHit(hits, det);
138  double energy(0);
139  for (unsigned int ihit=0; ihit<hit.size(); ++ihit) {
140  if (hit[ihit]->time() > tMin && hit[ihit]->time() < tMax)
141  energy += hit[ihit]->energy();
142 #ifdef EDM_ML_DEBUG
143  if (debug)
144  std::cout << "energyHCALCell:: Hit[" << ihit << "] " << hcid << " E " << hit[ihit]->energy() << " t " << hit[ihit]->time() << std::endl;
145 #endif
146  }
147 #ifdef EDM_ML_DEBUG
148  if (debug)
149  std::cout << "energyHCALCell:: Cell " << hcid << " E " << energy << " from " << hit.size() << " threshold " << eThr << std::endl;
150 #endif
151  if (energy>eThr && hit.size() > 0) {
152  energyCell.push_back(std::pair<double,int>(energy,i+1));
153  }
154  }
155 #ifdef EDM_ML_DEBUG
156  if (debug) {
157  std::cout << "energyHCALCell:: " << energyCell.size() << " entries from "
158  << maxDepth << " depths:";
159  for (unsigned int i=0; i<energyCell.size(); ++i) {
160  std::cout << " [" << i << "] (" << energyCell[i].first << ":"
161  << energyCell[i].second << ")";
162  }
163  std::cout << std::endl;
164  }
165 #endif
166  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
double eHCALThreshold(int subdet, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100)
Definition: eHCALMatrix.cc:236
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalSubdetector
Definition: HcalAssistant.h:31
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.cc:98
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
template<typename T >
double spr::energyHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrixNew ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
void spr::extraIds ( const DetId det,
std::vector< DetId > &  dets,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
std::vector< DetId > &  cells,
bool  debug = false 
)

Definition at line 723 of file MatrixECALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debug, debugEcalDets(), EcalBarrel, EcalEndcap, stringResolutionProvider_cfi::eta, CaloSubdetectorGeometry::present(), DetId::subdetId(), EBDetId::validDetId(), and EEDetId::validDetId().

Referenced by matrixECALIds().

731  {
732 
733  if (det.subdetId() == EcalBarrel) {
734  EBDetId id = det;
735 #ifdef EDM_ML_DEBUG
736  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
737  << "|" << ietaE << " columns " << iphiS << "|"
738  << iphiN << std::endl;
739 #endif
740  int etaC = id.ietaAbs();
741  int phiC = id.iphi();
742  int zsid = id.zside();
743  for (int eta = -ietaW; eta <= ietaE; ++eta) {
744  for (int phi = -iphiS; phi <= iphiN; ++phi) {
745  int iphi = phiC+phi;
746  if (iphi < 0) iphi += 360;
747  else if (iphi > 360) iphi -= 360;
748  int ieta = zsid*(etaC+eta);
749  if (EBDetId::validDetId(ieta,iphi)) {
750  id = EBDetId(ieta,iphi);
751  if (barrelGeom.present(id)) {
752  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
753  cells.push_back((DetId)id);
754  }
755  }
756  }
757  }
758  }
759  } else if (det.subdetId() == EcalEndcap) {
760  EEDetId id = det;
761 #ifdef EDM_ML_DEBUG
762  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
763  << "|" << ietaE << " columns " << iphiS << "|"
764  << iphiN << std::endl;
765 #endif
766  int ixC = id.ix();
767  int iyC = id.iy();
768  int zsid = id.zside();
769  for (int kx = -ietaW; kx <= ietaE; ++kx) {
770  for (int ky = -iphiS; ky <= iphiN; ++ky) {
771  int ix = ixC+kx;
772  int iy = iyC+ky;
773  if (EEDetId::validDetId(ix,iy,zsid)) {
774  id = EEDetId(ix,iy,zsid);
775  if (endcapGeom.present(id)) {
776  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
777  cells.push_back((DetId)id);
778  }
779  }
780  }
781  }
782  }
783  }
784 
785 #ifdef EDM_ML_DEBUG
786  if (debug) {
787  std::cout << "extraIds:: finds " << cells.size() << " new cells"
788  << std::endl;
789  spr::debugEcalDets (0, cells);
790  }
791 #endif
792  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
virtual bool present(const DetId &id) const
is this detid present in the geometry?
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
void spr::find ( edm::Handle< EcalRecHitCollection > &  hits,
DetId  thisDet,
std::vector< EcalRecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 20 of file FindCaloHit.cc.

References edm::SortedCollection< T, SORT >::end(), and edm::SortedCollection< T, SORT >::find().

Referenced by tier0.ResponseError::__str__(), PedestalTask::_dump(), ParticleDecayDrawer::accept(), ParticleTreeDrawer::accept(), DTVDriftCalibration::cellInfo::add(), Measurement::addAffectingEntriesFromOptO(), reco::CompositeCandidate::addDaughter(), reco::NamedCompositeCandidate::addDaughter(), CRackTrajectoryBuilder::AddHit(), CSCNeutronReader::addHits(), pat::TriggerEvent::addObjectMatchResult(), SiStripQualityHotStripIdentifier::algoAnalyze(), reco::Conversion::algoByName(), reco::TrackBase::algoByName(), CreateIdealTkAlRecords::alignToGT(), HcalFrontEndMap::allRBXs(), HcalFrontEndMap::allRMs(), GEMRecHitsValidation::analyze(), ME0RecHitsValidation::analyze(), EcalMatacqAnalyzer::analyze(), EcalPnGraphs::analyze(), DQMHcalIsolatedBunchAlCaReco::analyze(), DTT0Calibration::analyze(), SiStripApvGainBuilderFromTag::analyze(), DTT0CalibrationNew::analyze(), EcalDumpRaw::analyze(), DTNoiseCalibration::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), HcalQIEDataCheck::analyze(), ParticleListDrawer::analyze(), HcalAutoPedestalValidator::analyze(), HLTBTagPerformanceAnalyzer::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), DQMHcalIsoTrackAlCaReco::analyze(), edmtest::HcalDumpConditions::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), DQMSourcePi0::analyze(), TestPythiaDecays::analyze(), HcalGainsCheck::analyze(), AlignPCLThresholdsWriter::analyze(), PixelLumiDQM::analyze(), HeavyFlavorValidation::analyze(), TestTrackHits::analyze(), TestOutliers::analyze(), EcalURecHitHists::analyze(), CastorDumpConditions::analyze(), L1TGT::analyze(), HGCalHitValidation::analyze(), HLTMuonPlotter::analyze(), CommonModeAnalyzer::analyze(), IsoTrig::analyze(), ListIds::analyze(), EcalCosmicsHists::analyze(), IsoTrackCalibration::analyze(), DTDigiTask::analyze(), PrimaryVertexAnalyzer4PUSlimmed::analyze(), any(), CaloTowersCreationAlgo::assignHitEcal(), CaloTowersCreationAlgo::assignHitHcal(), CSCHitAssociator::associateCSCHitId(), CSCHitAssociator::associateHitId(), TrackerHitAssociator::associateMatchedRecHit(), TrackerHitAssociator::associatePhase2TrackerRecHit(), TrackerHitAssociator::associatePixelRecHit(), RPCHitAssociator::associateRecHit(), GEMHitAssociator::associateRecHit(), TrackerHitAssociator::associateSimpleRecHitCluster(), AlignmentParameterStore::attachCorrelations(), ClusterProducerFP420::badChannel(), ProfilerService::beginPath(), HLTHiggsSubAnalysis::beginRun(), MillePedeAlignmentAlgorithm::beginRun(), GctFormatTranslateV35::blockToGctInternEmCand(), CalibrationScanTask::book(), CalibrationTask::book(), EgHLTOfflineSource::bookHistograms(), SiStripFedCabling::buildFedCabling(), SiStripDetVOffBuilder::buildPSUdetIdMap(), PFEGammaAlgo::buildRefinedSuperCluster(), PFECALSuperClusterAlgo::buildSuperCluster(), VirtualJetProducer::JetType::byName(), HLTEcalResonanceFilter::calcShowerShape(), HLTRegionalEcalResonanceFilter::calcShowerShape(), PFEGammaAlgo::calculate_ele_mva(), JetPlusTrackProducerAA::calculateBGtracksJet(), PileUpSubtractor::calculateOrphanInput(), ValidationOptions_cff::calledBycmsRun(), reco::modules::CandCombinerBase::CandCombinerBase(), CastorDbProducer::channelQualityCallback(), HcalDbProducer::channelQualityCallback(), MulticoreRunLumiEventChecker::check(), CSCDCCExaminer::check(), Config::checkImportPermission(), Multi5x5ClusterAlgo::checkMaxima(), GlobalTag.GlobalTag::checkPrefix(), ECALpedestalPCLHarvester::checkStatusCode(), MaterialBudgetAction::CheckTouchableInSelectedVolumes(), L1TMuon::DTBunchCrossingCleaner::clean(), BlockFormatter::CleanUp(), l1t::IntervalManager< TimeType, PayloadType >::clear(), cmsswRelease::cmsswIs44X(), cmsswRelease::cmsswIs52X(), edm::Exception::codeToString(), egammaisolation::EgammaRecHitExtractor::collect(), HltDiff::compare(), EgammaTowerIsolationNew< NC >::compute(), MVAJetPuId::computeIdVariables(), HDQMInspectorConfigBase::computeIntegral(), vertexTools::computeSharedTracks(), L1TMuonBarrelParamsHelper::configFromDB(), HCALConfigDB::connect(), FastFedCablingHistosUsingDb::connections(), CaloTowerConstituentsMap::constituentsOf(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer(), PedeSteererWeakModeConstraints::constructConstraints(), HiHelperTools::contains(), helpers::contains(), Model::copyMeasurements(), createPayload::copyToWorkflowdir(), SiStripFecCabling::countDevices(), DefaultFFTJetObjectFactory< AbsFFTSpecificScaleCalculator >::create(), cmsHarvester::create_and_check_castor_dir(), edm::SharedResourcesRegistry::createAcquirer(), ESDigitizer::createNoisyList(), HcalDbASCIIIO::createObject< HcalDcsMap >(), LaunchOnCondor::CreateTheCmdFile(), customiseForPremixingInput::customiseForPreMixingInput(), DDfetch(), ParticleDecayDrawer::decay(), gen::Py8InterfaceBase::declareSpecialSettings(), gen::Pythia6Hadronizer::declareSpecialSettings(), Model::deleteOptO(), muonisolation::CaloExtractor::deposit(), SiStripFineDelayHit::detId(), edm::DetSetRefVector< Phase2ITPixelCluster >::DetSetRefVector(), TowerBlockFormatter::DigiToRaw(), SiPixelGainCalibrationAnalysis::doFits(), HLTEcalResonanceFilter::doSelection(), HLTRegionalEcalResonanceFilter::doSelection(), SUSY_HLT_DoubleMuon_Hadronic::dqmBeginRun(), SUSY_HLT_Muon_BJet::dqmBeginRun(), SUSY_HLT_DoubleEle_Hadronic::dqmBeginRun(), SUSY_HLT_Electron_BJet::dqmBeginRun(), SUSY_HLT_alphaT::dqmBeginRun(), SUSY_HLT_DiJet_MET::dqmBeginRun(), SUSY_HLT_ElecFakes::dqmBeginRun(), SUSY_HLT_MuEle_Hadronic::dqmBeginRun(), SUSY_HLT_Muon_Hadronic::dqmBeginRun(), SUSY_HLT_MuonFakes::dqmBeginRun(), SUSY_HLT_VBF_Mu::dqmBeginRun(), DTDCSByLumiTask::dqmBeginRun(), HGCGeometryValidation::dqmBeginRun(), HGCalHitValidation::dqmBeginRun(), SusyPostProcessor::dqmEndJob(), SiStripGainsPCLHarvester::dqmEndJob(), JetMETHLTOfflineClient::dqmEndJob(), L1TwinMux::DTBunchCrossingCleaner::DTBunchCrossingCleaner(), DTSegtoRPC::DTSegtoRPC(), RPCLinkSynchroStat::dumpDelays(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::dumpPython(), CaloTowersCreationAlgo::ecalChanStatusForCaloTower(), EcalPreshowerMonitorClient::EcalPreshowerMonitorClient(), EcalListOfFEDSProducer::Egamma(), ESListOfFEDSProducer::Egamma(), CastorDbProducer::electronicsMapCallback(), HcalDbProducer::electronicsMapCallback(), hcaldqm::RawRunSummary::endLuminosityBlock(), TPTask::endLuminosityBlock(), RawTask::endLuminosityBlock(), RecHitTask::endLuminosityBlock(), DigiTask::endLuminosityBlock(), L1ScalersClient::endLuminosityBlock(), GsfVertexTrackCompatibilityEstimator::estimate(), KalmanVertexTrackCompatibilityEstimator< N >::estimate(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), JetPlusTrackCorrector::excludeJta(), edm::ParameterSet::existsAs(), CompositeAlignmentParameters::extractAlignables(), CompositeAlignmentParameters::extractPositionAndLength(), CompositeAlignmentDerivativesExtractor::extractWithMultipleHits(), SiPixelFedCablingMap::fedIds(), VertexFitterResult::fill(), tnp::ProbeFlag::fill(), JetPartonMatcher::fillAlgoritDefinition(), SiPixelActionExecutor::fillFEDErrorSummary(), PhysicsTools::MVATrainer::fillInputVars(), Py8toJetInput::fillJetAlgoInput(), PrintGeomSummary::fillLV(), MuonMesh::fillMesh(), JetPartonMatcher::fillPhysicsDefinition(), edm::Principal::fillPrincipal(), TrackingNtuple::fillSeeds(), CastorShowerLibraryMaker::FillShowerEvent(), TrackingTruthAccumulator::fillSimHits(), SiPixelActionExecutor::fillSummary(), SiStripCommissioningRunTypeFilter::filter(), LogErrorFilter::filter(), HltComparator::filter(), ErrorSummaryFilter::filter(), AlCaIsolatedBunchSelector::filter(), AlCaIsolatedBunchFilter::filter(), AlCaIsoTracksProducerFilter::filter(), EcalSimpleUncalibRecHitFilter::filter(), AlCaHBHEMuonFilter::filter(), EcalMIPRecHitFilter::filter(), AlCaIsoTracksFilter::filter(), HLTEcalResonanceFilter::filter(), HLTRegionalEcalResonanceFilter::filter(), TTUTrackingAlg::filter(), commentSkipper.buildFileCommentSkipper::filterMultilineComment(), commentSkipper.buildFileCommentSkipper::filterOneLineComment(), MuonSeedOrcaPatternRecognition::filterOverlappingChambers(), FourVectorHLT::PathInfoCollection::find(), BTVHLTOfflineSource::PathInfoCollection::find(), HLTInclusiveVBFSource::PathInfoCollection::find(), JetMETHLTOfflineSource::PathInfoCollection::find(), edm::find_in_all(), DTCombinatorialExtendedPatternReco::findCompatibleHits(), SiStripPsuDetIdMap::findDcuIdFromDeviceAddress(), Vispa.Main.Application.Application::findEvent(), GenHFHadronMatcher::findHadronJets(), GenHFHadronMatcher::findInMothers(), JetCorrectorParametersCollection::findKey(), MSLayersAtAngle::findLayer(), HLTPerformanceInfo::findModule(), HLTPerformanceInfo::findPath(), JetPlusTrackCorrector::findTrack(), EcalTBReadout::findTTlist(), edm::IndexIntoFile::fixIndexes(), cmsHarvester.CMSHarvester::format_conditions_string(), ecaldqm::DependencySet::formSequence(), ecaldqm::DependencySet::formSequenceFragment_(), XtoFFbarFilter::found(), HcalDbProducer::frontEndMapCallback(), getRunInfo::Func_FillInfoDBS(), getRunInfo::Func_FillInfoRunRegistry(), CastorDbProducer::gainsCallback(), HcalDbProducer::gainsCallback(), CastorDbProducer::gainWidthsCallback(), HcalDbProducer::gainWidthsCallback(), pkg.AbstractPkg::generate(), SubsystemNeutronReader::generateChamberNoise(), pat::PATGenCandsFromSimTracksProducer::generatorRef_(), pat::GenericOverlapFinder< Distance >::GenericOverlapFinder(), GenJetParticleSelector::GenJetParticleSelector(), VertexClassifier::genPrimaryVertices(), TrackClassifier::genPrimaryVertices(), harvestRelVal::get_cond_from_dsetpath(), egHLT::trigTools::getActiveFilters(), hcaldqm::quantity::CrateQuantity::getBin(), EcalSelectiveReadoutProducer::getBinOfMax(), ComponentFactoryByName< B >::getBuilder(), PhysicsTools::MVATrainer::getCalibration(), CastorCalibrationsSet::getCalibrations(), CastorCalibrationWidthsSet::getCalibrationWidths(), hcalCalib::GetCoefFromMtrxInvOfAve(), HcalLutManager::getCompressionLutXmlFromAsciiMaster(), HcalLutManager::getCompressionLutXmlFromCoder(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), HLTScalersClient::CountLSFifo_t::getCount(), hcaldqm::utilities::getCrateList(), GenParticlePruner::getDaughterKeys(), EgammaHadTower::getDepth1HcalESum(), EgammaHadTower::getDepth2HcalESum(), EcalElectronicsMapping::getDetId(), TrackAssociatorByHitsImpl::getDoubleCount(), QuickTrackAssociatorByHitsImpl::getDoubleCount(), EcalElectronicsMapping::getElectronicsId(), edm::eventsetup::EventSetupsController::getESProducerPSet(), HcalDDDRecConstants::getEtaBins(), SiPixelActionExecutor::getFEDSummaryME(), SiPixelActionExecutor::getGrandSummaryME(), JetCorrectorParametersCollection::getL5Bin(), JetCorrectorParametersCollection::getL7Bin(), BeamSpotWorkflow::getLastUploadedIOV(), HcalLutManager::getLinearizationLutXmlFromAsciiMasterEmap(), HcalLutManager::getLinearizationLutXmlFromCoder(), HcalLutManager::getLinearizationLutXmlFromCoderEmap(), BeamSpotWorkflow::getListOfRunsAndLumiFromDBS(), HcalLutManager::getLutFromXml_old(), HcalLutManager::getLutXmlFromAsciiMaster(), METCorrectorParametersCollection::getMiniAodBin(), CastorShowerLibraryMaker::GetMissingEnergy(), GenParticlePruner::getMotherKeys(), popcon::EcalPulseSymmCovariancesHandler::getNewObjects(), popcon::EcalPulseShapesHandler::getNewObjects(), LMFCorrCoefDat::getParameters(), SiStripSummary::getPosition(), HDQMSummary::getPosition(), TrackAssociatorByHitsImpl::getShared(), MEtXYcorrectParametersCollection::getShiftDataFlavBin(), MEtXYcorrectParametersCollection::getShiftDyFlavBin(), MEtXYcorrectParametersCollection::getShiftMcFlavBin(), MEtXYcorrectParametersCollection::getShiftTTJetsFlavBin(), MEtXYcorrectParametersCollection::getShiftWJetsFlavBin(), EgammaRecHitIsolation::getSum_(), SiPixelActionExecutor::getSummaryME(), fwlite::MultiChainEvent::getThinnedProducts(), EcalElectronicsMapping::getTriggerElectronicsId(), checkPayloads::getUploadedIOVs(), CastorRawGains::getValues(), HcalRawGains::getValues(), HcalLutManager::getZdcLutXml(), SiStripMonitorTrack::handleBookMEs(), cmdline::CmdLine::has(), hitfit::Constraint_Intermed_Labels::has_label(), pat::TriggerObjectStandAlone::hasFilterOrCondition(), SiStripHashedDetId::hashedIndex(), pat::PATSingleVertexSelector::hasMode_(), MisalignmentScenarioBuilder::hasParameter_(), pat::TriggerObjectStandAlone::hasPathOrAlgorithm(), pat::Jet::hasSubjets(), HcalDigisClient::HcalDigisEndjob(), HcalOfflineHarvesting::HcalOfflineHarvesting(), HcalRecHitsDQMClient::HcalRecHitsEndjob(), Generator::HepMC2G4(), HLTMuonTrackMassFilter::hltFilter(), HLTMuonL1RegionalFilter::hltFilter(), HLTMuonL1TFilter::hltFilter(), HLTMuonL1TRegionalFilter::hltFilter(), HLTMuonL2FromL1TPreFilter::hltFilter(), HLTMuonL2PreFilter::hltFilter(), HLTMuonL1Filter::hltFilter(), HLTHcalSimpleRecHitFilter::hltFilter(), GenHFHadronMatcher::idInList(), include(), reco::PixelClusterCounts::increment(), pat::TriggerPath::indexModule(), MSLayersKeeperX0Averaged::init(), JetCorrectorParametersHelper::init(), crabWrap::initCrabEnvironment(), CAHitTripletGenerator::initEvent(), CAHitQuadrupletGenerator::initEvent(), SiStripDetKey::initFromPath(), SiStripFecKey::initFromPath(), SiStripFedKey::initFromPath(), XrdAdaptor::RequestManager::initialize(), GenericTriggerEventFlag::initRun(), HBHEHitMap::insert(), edm::EventSetup::iovSyncValue(), MuonHOAcceptance::isChannelDead(), MuonHOAcceptance::isChannelSiPM(), edm::eventsetup::EventSetupsController::isFirstMatch(), TTTrackAssociationMap< T >::isGenuine(), EcalElectronicsMapper::isGhost(), cms::MuonTCMETValueMapProducer::isGoodTrack(), TCMETAlgo::isGoodTrack(), CSCBadChambers::isInBadChamber(), edm::eventsetup::EventSetupsController::isLastMatch(), edm::eventsetup::EventSetupsController::isMatchingESProducer(), edm::eventsetup::EventSetupsController::isMatchingESSource(), AlignmentParameterSelector::isMemberOfVector(), SiPixelDisabledModules::isModuleDisabled(), GenHFHadronMatcher::isNeutralPdg(), EBDetId::isNextToEtaBoundary(), heppy::IsolationComputer::isoSumNeutralsWeighted(), heppy::IsolationComputer::isoSumRaw(), TrackingMaterialProducer::isSelectedFast(), reco::PFDisplacedVertex::isThereKindTracks(), HLTMuonL2ToL1Map::isTriggeredByL1(), HLTMuonL2ToL1TMap::isTriggeredByL1(), HcalLayerDepthMap::isValid(), JetCorrectionESChain::JetCorrectionESChain(), pat::JetCorrFactorsProducer::JetCorrFactorsProducer(), EcalListOfFEDSProducer::Jets(), ESListOfFEDSProducer::Jets(), L1MuGMTHWFileReader::L1MuGMTHWFileReader(), L1TCaloLayer1FetchLUTs(), HcalDbProducer::L1triggerObjectsCallback(), JsonOutputProducer::labelId(), PerformancePayloadFromBinnedTFormula::limitPos(), PerformancePayloadFromTFormula::limitPos(), CSCGasCollisions::lnEnergyLoss(), DefaultFFTJetRcdMapper< FFTPFJetCorrectorSequence >::load(), L1MuGMTLUT::Load(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometrySquare(), edm::service::MessageServicePSetValidation::lookForMatch(), edm::eventsetup::EventSetupsController::lookForMatches(), CommonMethods::ls(), HcalDbProducer::LUTCorrsCallback(), HcalDbProducer::lutMetadataCallback(), main(), reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >::make(), HybridClusterAlgo::makeClusters(), CaloTowersCreationAlgo::makeEcalBadChs(), HSCPValidator::makeGenPlots(), CaloTowersCreationAlgo::makeHcalDropChMap(), HiBremRecoveryClusterAlgo::makeIslandSuperClusters(), EgammaHLTNxNClusterProducer::makeNxNClusters(), HSCPValidator::makeRecoPlots(), HSCPValidator::makeSimDigiPlotsECAL(), HSCPValidator::makeSimDigiPlotsRPC(), HSCPValidator::makeSimTrackPlots(), CSCHitFromStripOnly::makeStripData(), PhysicsTools::MVATrainer::makeTrainCalibration(), TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks(), TemplatedSecondaryVertexProducer< IPTI, VTX >::matchGroomedJets(), JetFlavourClustering::matchGroomedJets(), JetPlusTrackCorrector::matchTracks(), PerformancePayloadFromTable::maxPos(), HcalDbProducer::MCParamsCallback(), ecaldqm::memDCCIndex(), merge(), CaloTowersMerger::mergedTower(), l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), PerformancePayloadFromTable::minPos(), EcalListOfFEDSProducer::Muon(), ESListOfFEDSProducer::Muon(), reco::modules::NamedCandCombinerBase::NamedCandCombinerBase(), TFileAdaptor::native(), SequentialCombinationGenerator< T >::next_subset(), ObjectPairFilter< C, S >::ObjectPairFilter(), ObjectSelector< SingleElementCollectionSelector< InputCollection, Selector, reco::CandidateCollection, StoreContainer, RefAdder >, reco::CandidateCollection, NonNullNumberSelector >::ObjectSelector(), PdgIdExcluder::operator()(), PdgIdSelector::operator()(), StatusSelector::operator()(), rpcrawtodigi::DebugDigisPrintout::operator()(), pat::HLTL1MuonMatcher::operator()(), VarRangeCutColl< ProbeType >::operator()(), RecoTrackSelectorBase::operator()(), reco::operator<<(), ReadMapType< std::map< std::string, double > >::operator[](), FFTJetDict< Key, T, Compare, Allocator >::operator[](), cond::SmallWORMDict::operator[](), edm::DetSetRefVector< T, C >::operator[](), cmdline::CmdLine::option(), cmsHarvester.CMSHarvester::option_handler_input_spec(), reco::Vertex::originalTrack(), TransientVertex::originalTrack(), JetMatchingTools::overlapEnergyFraction(), AlpgenHeader::parameterName(), RPCLBLinkNameParser::parse(), Args::parse(), AlpgenHeader::parse(), Page1Parser.Page1Parser::ParseRunSummaryPage(), SiStripDbParams::partitionNames(), pat::PATLostTracks::PATLostTracks(), CastorDbProducer::pedestalsCallback(), HcalDbProducer::pedestalsCallback(), CastorDbProducer::pedestalWidthsCallback(), HcalDbProducer::pedestalWidthsCallback(), PedeSteererWeakModeConstraints::PedeSteererWeakModeConstraints(), HcalDbProducer::PFCorrsCallback(), SelectedElectronFEDListProducer< TEle, TCand >::pixelFedDump(), edm::SortedCollection< EcalRecHit >::pop_back(), MatrixInjector.MatrixInjector::prepare(), edm::Principal::Principal(), print_trigger_collection(), SiStripConfigDb::printAnalysisDescriptions(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), SiStripConfigDb::printFedDescriptions(), ParticleTreeDrawer::printInfo(), create_public_peakpu_plots::processdata(), DDLString::processElement(), DDLNumeric::processElement(), HIMultiTrackSelector::processMVA(), TTTrackAssociator< T >::produce(), InterestingEcalDetIdProducer::produce(), PileupSummaryInfoSlimmer::produce(), JetTracksAssociationDRVertexAssigned::produce(), TtSemiLepJetCombMaxSumPtWMass::produce(), TtDilepEvtSolutionMaker::produce(), QuarkoniaTrackSelector::produce(), EcalTPSkimmer::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), GenTrackMatcher::produce(), StripCompactDigiSimLinksProducer::produce(), GenParticles2HepMCConverter::produce(), EcalListOfFEDSProducer::produce(), EgammaHLTCombinedIsolationProducer::produce(), ESListOfFEDSProducer::produce(), EgammaHLTElectronCombinedIsolationProducer::produce(), SiPixelRawToDigi::produce(), TrackListMerger::produce(), ReducedRecHitCollectionProducer::produce(), pat::PATJetUpdater::produce(), EleIsoDetIdCollectionProducer::produce(), LaserAlignmentT0Producer::produce(), MuonDetCleaner< T1, T2 >::produce(), JetSubstructurePacker::produce(), ConversionSeedFilterCharge::produce(), pat::GenPlusSimParticleProducer::produce(), GamIsoDetIdCollectionProducer::produce(), HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::produce(), EcalRawToDigi::produce(), pat::PATTauProducer::produce(), pat::PATJetProducer::produce(), CaloTowersMerger::produce(), InterestingTrackEcalDetIdProducer::produce(), ConvBremSeedProducer::produce(), HighPtTrackEcalDetIdProducer::produce(), FlavorHistoryProducer::produce(), MuonMCClassifier::produce(), LaserAlignment::produce(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), ProfilerService::ProfilerService(), SiStripDbParams::pset(), CastorDbProducer::QIEDataCallback(), HcalDbProducer::QIEDataCallback(), HcalDbProducer::QIETypesCallback(), reco::TrackBase::qualityByName(), SurveyPxbImageReader< T >::read(), l1t::LUT::read(), SiStripTFile::readDQMFormat(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), BeamFitter::readEvent(), L1TdeRCT::readFEDVector(), EcalTBReadout::readOut(), EcalDigiDisplay::readPNDigis(), SiStripDcsInfo::readStatus(), Model::readSystemDescription(), CalorimetryManager::reconstruct(), GenParticlePruner::recursiveFlagDaughters(), GenParticlePruner::recursiveFlagMothers(), TransientVertex::refittedTrack(), HPSPFRecoTauAlgorithm::removeCandidateFromRefVector(), SiPixelDisabledModules::removeDisabledModule(), lhef::LHEEvent::removeResonances(), DDI::LogicalPart::removeSpecifics(), XrdAdaptor::RequestManager::requestFailure(), edm::DetSetVector< TotemRPLocalTrack::FittedRecHit >::reserve(), BtoCharmDecayVertexMergerT< VTX >::resolveBtoDchain(), HcalDbProducer::respCorrsCallback(), PerformancePayloadFromTable::resultPos(), PerformancePayloadFromBinnedTFormula::resultPos(), PerformancePayloadFromTFormula::resultPos(), EcalRecHitWorkerSimple::run(), ecaldqm::IntegrityWriter::run(), ecaldqm::LaserWriter::run(), ecaldqm::PedestalWriter::run(), ecaldqm::PresampleWriter::run(), ecaldqm::TestPulseWriter::run(), ecaldqm::TimingWriter::run(), ecaldqm::LedWriter::run(), ecaldqm::OccupancyWriter::run(), ecaldqm::SummaryWriter::run(), EgHLTOfflineClient::runClient_(), DTLocalTriggerTest::runClientDiagnostic(), DTLocalTriggerTPTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTLocalTriggerEfficiencyTest::runClientDiagnostic(), DTTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerTask::runDDUvsTMAnalysis(), L1MuDTEtaProcessor::runEtaMatchingUnit(), L1MuBMEtaProcessor::runEtaMatchingUnit(), edm::search_all(), SeedingLayerSetsBuilder::SeedingLayerSetsBuilder(), reco::FlavorHistorySelectorUtil::select(), AlCaIsoTracksProducer::select(), SiStripBadModuleConfigurableFakeESSource::selectDetectors(), EcalMipGraphs::selectHits(), EcalDisplaysByEvent::selectHits(), AlignmentParameterStore::selectParameters(), CastorCalibrationsSet::setCalibrations(), CastorCalibrationWidthsSet::setCalibrationWidths(), HcalCellType::setDepth(), RBCProcessRPCDigis::setDigiAt(), RBCProcessRPCSimDigis::setDigiAt(), edm::eventsetup::EventSetupRecord::setEventSetup(), EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(), EcalRecHitWorkerSimple::setFlagBits(), GlobalOptionMgr::setGlobalOption(), EcalFenixFgvbEB::setParameters(), ecaldqm::CalibrationSummaryClient::setParams(), ecaldqm::SummaryClient::setParams(), DDLSolid::setReference(), CSCBaseElectronicsSim::setSignalTimeRange(), TtSemiLepKinFitter::setupConstraints(), egHLT::OffHelper::setupTriggers(), vid_id_tools::setupVIDElectronSelection(), SiStripCondObjBuilderFromDb::setValuesApvTiming(), HcalSimParameterMap::simParameters(), HcalDbProducer::SiPMCharacteristicsCallback(), HcalDbProducer::SiPMParametersCallback(), SiStripFedIdListReader::SiStripFedIdListReader(), CRackTrajectoryBuilder::SortHits(), PhysicsTools::stdStringPrintf(), HLTMuonValidator::stepLabels(), IsoTrig::studyIsolation(), sumSmallDepths(), MillePedeAlignmentAlgorithm::terminate(), HcalLutManager::test_emap(), HcalDbProducer::timeCorrsCallback(), PasswordReader::tokenize(), EcalSRCondTools::tokenize(), EgammaHadTower::towersOf(), HcalDbProducer::TPChannelParametersCallback(), HcalDbProducer::TPParametersCallback(), HistoryBase::traceSimHistory(), QcdUeDQM::trackSelection(), trackWeight(), TransientVertex::trackWeight(), pat::TriggerEvent::triggerObjectMatchResult(), JsonOutputProducer::typeId(), PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL(), PFEGammaAlgo::unlinkRefinableObjectKFandECALWithBadEoverP(), PFEGammaAlgo::unwrapSuperCluster(), SaveSimTrack::update(), MSLayersAtAngle::update(), PedestalsHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), LatencyHistosUsingDb::update(), FineDelayHistosUsingDb::update(), KalmanVertexUpdator< N >::update(), SimG4HGCalValidation::update(), HLTScalersClient::CountLSFifo_t::update(), L1RCTProducer::updateFedVector(), EcalCondDB::usage(), reco::btag::weight(), CSCValHists::writeHists(), DQMRootOutputModule::writeLuminosityBlock(), L1GtPatternWriter::writePatterns(), DQMRootOutputModule::writeRun(), CSCGasCollisions::writeSummary(), HcalDbProducer::zsThresholdsCallback(), and PhysicsTools::Calibration::MVAComputerContainer::~MVAComputerContainer().

20  {
21 
22  if (hits->find(thisDet) != hits->end())
23  hit.push_back( hits->find(thisDet) );
24  }
const_iterator end() const
iterator find(key_type k)
void spr::find ( edm::Handle< HBHERecHitCollection > &  hits,
DetId  thisDet,
std::vector< HBHERecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 26 of file FindCaloHit.cc.

References edm::SortedCollection< T, SORT >::end(), and edm::SortedCollection< T, SORT >::find().

26  {
27 
28  if (hits->find(thisDet) != hits->end())
29  hit.push_back( hits->find(thisDet) );
30  }
const_iterator end() const
iterator find(key_type k)
void spr::find ( edm::Handle< edm::PCaloHitContainer > &  hits,
DetId  thisDet,
std::vector< edm::PCaloHitContainer::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 32 of file FindCaloHit.cc.

32  {
33 
34  edm::PCaloHitContainer::const_iterator ihit;
35  for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
36  DetId detId(ihit->id());
37  if (detId == thisDet) {
38  hit.push_back(ihit);
39  }
40  }
41  }
Definition: DetId.h:18
std::vector<EcalRecHitCollection::const_iterator> spr::findCone ( const CaloGeometry geo,
edm::Handle< EcalRecHitCollection > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug 
)

Definition at line 11 of file FindCaloHitCone.cc.

References edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), getDistInPlaneTrackDir(), and CaloGeometry::getPosition().

11  {
12 
13  std::vector<EcalRecHitCollection::const_iterator> hit;
14 
16  j!=hits->end(); j++) {
17 
18  bool keepHit = false;
19 
20  if (j->id().subdetId() == EcalEndcap) {
21  EEDetId EEid = EEDetId(j->id());
22  const GlobalPoint rechitPoint = geo->getPosition(EEid);
23  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
24  } else if (j->id().subdetId() == EcalBarrel) {
25  EBDetId EBid = EBDetId(j->id());
26  const GlobalPoint rechitPoint = geo->getPosition(EBid);
27  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
28  }
29 
30  if (keepHit) hit.push_back(j);
31  }
32  return hit;
33  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:11
std::vector< EcalRecHit >::const_iterator const_iterator
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
const_iterator end() const
#define debug
Definition: HDRShower.cc:19
const_iterator begin() const
std::vector<EcalRecHitCollection::const_iterator> spr::findCone ( const CaloGeometry geo,
edm::Handle< EcalRecHitCollection > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
bool  debug = false 
)
std::vector< EcalRecHitCollection::const_iterator > spr::findCone ( const CaloGeometry geo,
edm::Handle< EcalRecHitCollection > &  barrelhits,
edm::Handle< EcalRecHitCollection > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug = false 
)

Definition at line 36 of file FindCaloHitCone.cc.

References funct::abs(), edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, deltaEta, cosmicSuperClusters_cfi::doBarrel, multi5x5BasicClusters_cfi::doEndcap, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), PV3DBase< T, PVType, FrameType >::eta(), etaBEEcal, getDistInPlaneTrackDir(), and CaloGeometry::getPosition().

36  {
37 
38  std::vector<EcalRecHitCollection::const_iterator> hit;
39 
40  // Only check both barrel and endcap when track is near transition
41  // region: 1.479-2*0.087 < trkEta < 1.479+2*0.087
42 
43  bool doBarrel=false, doEndcap=false;
44  if ( std::abs(point1.eta()) < (spr::etaBEEcal+2*spr::deltaEta)) doBarrel=true; // 1.479+2*0.087
45  if ( std::abs(point1.eta()) > (spr::etaBEEcal-2*spr::deltaEta)) doEndcap=true; // 1.479-2*0.087
46 
47  if (doBarrel) {
48  for (EcalRecHitCollection::const_iterator j=barrelhits->begin();
49  j!=barrelhits->end(); j++) {
50 
51  bool keepHit = false;
52  if (j->id().subdetId() == EcalBarrel) {
53  EBDetId EBid = EBDetId(j->id());
54  const GlobalPoint rechitPoint = geo->getPosition(EBid);
55  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
56  } else {
57  std::cout << "PROBLEM : Endcap RecHits in Barrel Collection!?"
58  << std::endl;
59  }
60  if (keepHit) hit.push_back(j);
61  }
62  } // doBarrel
63 
64  if (doEndcap) {
65 
66  for (EcalRecHitCollection::const_iterator j=endcaphits->begin();
67  j!=endcaphits->end(); j++) {
68 
69  bool keepHit = false;
70 
71  if (j->id().subdetId() == EcalEndcap) {
72  EEDetId EEid = EEDetId(j->id());
73  const GlobalPoint rechitPoint = geo->getPosition(EEid);
74  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
75  } else {
76  std::cout << "PROBLEM : Barrel RecHits in Endcap Collection!?"
77  << std::endl;
78  }
79  if (keepHit) hit.push_back(j);
80  }
81  } // doEndcap
82 
83  return hit;
84  }
static const double etaBEEcal
Definition: CaloConstants.h:12
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:11
std::vector< EcalRecHit >::const_iterator const_iterator
static const double deltaEta
Definition: CaloConstants.h:8
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
const_iterator end() const
#define debug
Definition: HDRShower.cc:19
T eta() const
Definition: PV3DBase.h:76
const_iterator begin() const
std::vector< HBHERecHitCollection::const_iterator > spr::findCone ( const CaloGeometry geo,
edm::Handle< HBHERecHitCollection > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug = false 
)

Definition at line 88 of file FindCaloHitCone.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), getDistInPlaneTrackDir(), and CaloGeometry::getPosition().

88  {
89 
90  std::vector<HBHERecHitCollection::const_iterator> hit;
91  // Loop over Hcal RecHits
93  j!=hits->end(); j++) {
94  DetId detId(j->id());
95  const GlobalPoint rechitPoint = geo->getPosition(detId);
96  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) hit.push_back(j);
97  }
98  return hit;
99  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:11
std::vector< HBHERecHit >::const_iterator const_iterator
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
const_iterator end() const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
const_iterator begin() const
std::vector< edm::PCaloHitContainer::const_iterator > spr::findCone ( const CaloGeometry geo,
edm::Handle< edm::PCaloHitContainer > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug = false 
)

Definition at line 102 of file FindCaloHitCone.cc.

References getDistInPlaneTrackDir(), and CaloGeometry::getPosition().

102  {
103 
104  std::vector<edm::PCaloHitContainer::const_iterator> hit;
105  edm::PCaloHitContainer::const_iterator ihit;
106  for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
107  DetId detId(ihit->id());
108  const GlobalPoint rechitPoint = geo->getPosition(detId);
109  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) {
110  hit.push_back(ihit);
111  }
112  }
113  return hit;
114  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:11
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
const DetId spr::findDetIdCalo ( const CaloSubdetectorGeometry geo,
double  theta,
double  phi,
double  radius,
bool  debug = false 
)

Definition at line 46 of file DetIdFromEtaPhi.cc.

References funct::cos(), gather_cfg::cout, debug, DetId::det(), DetId::Ecal, EcalBarrel, CaloSubdetectorGeometry::getClosestCell(), point, funct::sin(), and DetId::subdetId().

Referenced by findDetIdECAL(), and findDetIdHCAL().

51  {
52 
53  double rcyl = radius*std::sin(theta);
54  double z = radius*std::cos(theta);
55  GlobalPoint point (rcyl*std::cos(phi),rcyl*std::sin(phi),z);
56  const DetId cell = geo->getClosestCell(point);
57 #ifdef EDM_ML_DEBUG
58  if (debug) {
59  std::cout << "findDetIdCalo: rcyl " << rcyl << " z " << z << " Point " << point << " DetId ";
60  if (cell.det() == DetId::Ecal) {
61  if (cell.subdetId() == EcalBarrel) std::cout << (EBDetId)(cell);
62  else std::cout << (EEDetId)(cell);
63  } else {
64  std::cout << (HcalDetId)(cell);
65  }
66  std::cout << std::endl;
67  }
68 #endif
69  return cell;
70  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
float float float z
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
const DetId spr::findDetIdECAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 14 of file DetIdFromEtaPhi.cc.

References funct::abs(), funct::cos(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, JetChargeProducer_cfi::exp, findDetIdCalo(), CaloGeometry::getSubdetectorGeometry(), TCMET_cfi::radius, rFrontEB, funct::sin(), theta(), and zFrontEE.

14  {
15  double radius=0;
16  int subdet=0;
17  double theta=2.0*std::atan(exp(-eta));
18  if (std::abs(eta) > spr::etaBEEcal) {
19  radius = spr::zFrontEE/std::abs(std::cos(theta));
20  subdet = EcalEndcap;
21  } else {
22  radius = spr::rFrontEB/std::sin(theta);
23  subdet = EcalBarrel;
24  }
26 #ifdef EDM_ML_DEBUG
27  if (debug) std::cout << "findDetIdECAL: eta " << eta << " theta " << theta <<" phi " << phi << " radius " << radius << " subdet " << subdet << std::endl;
28 #endif
29  return spr::findDetIdCalo (gECAL, theta, phi, radius, debug);
30  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
const DetId findDetIdCalo(const CaloSubdetectorGeometry *geo, double theta, double phi, double radius, bool debug=false)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
const DetId spr::findDetIdHCAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 32 of file DetIdFromEtaPhi.cc.

References funct::abs(), funct::cos(), gather_cfg::cout, etaBEHcal, JetChargeProducer_cfi::exp, findDetIdCalo(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, TCMET_cfi::radius, rFrontHB, funct::sin(), theta(), and zFrontHE.

32  {
33  double radius=0;
34  double theta=2.0*std::atan(exp(-eta));
35  if (std::abs(eta) > spr::etaBEHcal)
36  radius = spr::zFrontHE/std::abs(std::cos(theta));
37  else
38  radius = spr::rFrontHB/std::sin(theta);
40  #ifdef EDM_ML_DEBUG
41  if (debug) std::cout << "findDetIdHCAL: eta " << eta <<" theta "<<theta<< " phi " << phi << " radius " << radius << std::endl;
42 #endif
43  return spr::findDetIdCalo (gHCAL, theta, phi, radius, debug);
44  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
const DetId findDetIdCalo(const CaloSubdetectorGeometry *geo, double theta, double phi, double radius, bool debug=false)
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
static const double rFrontHB
Definition: CaloConstants.h:14
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
template<typename T >
std::vector<typename T::const_iterator> spr::findHit ( edm::Handle< T > &  hits,
DetId  thisDet,
bool  debug = false 
)
std::vector< std::vector< PCaloHit >::const_iterator > spr::findHit ( std::vector< PCaloHit > &  hits,
DetId  thisDet,
bool  debug = false 
)

Definition at line 7 of file FindCaloHit.cc.

7  {
8 
9  std::vector<std::vector<PCaloHit>::const_iterator> hit;
10  std::vector<PCaloHit>::const_iterator ihit;
11  for (ihit=hits.begin(); ihit!=hits.end(); ihit++) {
12  DetId detId(ihit->id());
13  if (detId == thisDet) {
14  hit.push_back(ihit);
15  }
16  }
17  return hit;
18  }
Definition: DetId.h:18
template<typename T >
void spr::findHit ( edm::Handle< T > &  hits,
DetId  thisDet,
std::vector< typename T::const_iterator > &  hit,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::findHitCone ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::findHitCone ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug = false 
)
double spr::getDistInCMatEcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2,
bool  debug = false 
)

Definition at line 52 of file FindDistCone.cc.

References funct::cos(), gather_cfg::cout, debug, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, etaBEEcal, rFrontEB, mathSSE::sqrt(), and zFrontEE.

56  {
57 
58  double dR, Rec;
59  if (fabs(eta1)<spr::etaBEEcal) Rec=spr::rFrontEB;
60  else Rec=spr::zFrontEE;
61  double ce1=cosh(eta1);
62  double ce2=cosh(eta2);
63  double te1=tanh(eta1);
64  double te2=tanh(eta2);
65 
66  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
67  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
68  else dR=999999.;
69 #ifdef EDM_ML_DEBUG
70  if (debug) std::cout << "getDistInCMatEcal: between (" << eta1 << ", "
71  << phi1 << ") and (" << eta2 << ", " << phi2 << " is "
72  << dR << std::endl;
73 #endif
74  return dR;
75  }
static const double etaBEEcal
Definition: CaloConstants.h:12
float float float z
static const double zFrontEE
Definition: CaloConstants.h:9
T sqrt(T t)
Definition: SSEVec.h:18
static const double rFrontEB
Definition: CaloConstants.h:10
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define debug
Definition: HDRShower.cc:19
double spr::getDistInCMatHcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2,
bool  debug = false 
)

Definition at line 79 of file FindDistCone.cc.

References funct::cos(), gather_cfg::cout, debug, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, etaBEHcal, rFrontHB, mathSSE::sqrt(), and zFrontHE.

83  {
84 
85  // Radii and eta from Geometry/HcalCommonData/data/hcalendcapalgo.xml
86  // and Geometry/HcalCommonData/data/hcalbarrelalgo.xml
87 
88  double dR, Rec;
89  if (fabs(eta1)<spr::etaBEHcal) Rec=spr::rFrontHB;
90  else Rec=spr::zFrontHE;
91  double ce1=cosh(eta1);
92  double ce2=cosh(eta2);
93  double te1=tanh(eta1);
94  double te2=tanh(eta2);
95 
96  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
97  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
98  else dR=999999.;
99  return dR;
100 #ifdef EDM_ML_DEBUG
101  if (debug) std::cout << "getDistInCMatHcal: between (" << eta1 << ", "
102  << phi1 << ") and (" << eta2 << ", " << phi2 << " is "
103  << dR << std::endl;
104 #endif
105  }
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
float float float z
static const double rFrontHB
Definition: CaloConstants.h:14
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define debug
Definition: HDRShower.cc:19
double spr::getDistInPlaneTrackDir ( const GlobalPoint caloPoint,
const GlobalVector caloVector,
const GlobalPoint rechitPoint,
bool  debug = false 
)

Definition at line 11 of file FindDistCone.cc.

References gather_cfg::cout, debug, Vector3DBase< T, FrameTag >::dot(), PV3DBase< T, PVType, FrameType >::mag(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by IsolatedTracksCone::analyze(), coneChargeIsolation(), findCone(), matrixECALIds(), and matrixHCALIds().

17  {
18 
19  const GlobalVector caloIntersectVector(caloPoint.x(),
20  caloPoint.y(),
21  caloPoint.z()); //p
22 
23  const GlobalVector caloUnitVector = caloVector.unit();
24  const GlobalVector rechitVector(rechitPoint.x(),
25  rechitPoint.y(),
26  rechitPoint.z());
27  const GlobalVector rechitUnitVector = rechitVector.unit();
28  double dotprod_denominator = caloUnitVector.dot(rechitUnitVector);
29  double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
30  double rechitdist = dotprod_numerator/dotprod_denominator;
31  const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
32  const GlobalPoint effectiveRechitPoint(effectiveRechitVector.x(),
33  effectiveRechitVector.y(),
34  effectiveRechitVector.z());
35  GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
36 #ifdef EDM_ML_DEBUG
37  if (debug) {
38  std::cout << "getDistInPlaneTrackDir: point " << caloPoint << " dirn "
39  << caloVector << " numerator " << dotprod_numerator
40  << " denominator " << dotprod_denominator << " distance "
41  << distance_vector.mag() << std::endl;
42  }
43 #endif
44  if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
45  return distance_vector.mag();
46  } else {
47  return 999999.;
48  }
49  }
T y() const
Definition: PV3DBase.h:63
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
Vector3DBase unit() const
Definition: Vector3DBase.h:57
#define debug
Definition: HDRShower.cc:19
T x() const
Definition: PV3DBase.h:62
double spr::getEnergy ( HBHERecHitCollection::const_iterator  hit,
bool  useRaw = false,
bool  debug = false 
)

Definition at line 161 of file FindDistCone.cc.

161  {
162  double energy = (useRaw) ? hit->eraw() : hit->energy();
163  return energy;
164  }
double spr::getEnergy ( edm::PCaloHitContainer::const_iterator  hit,
bool  useRaw = false,
bool  debug = false 
)

Definition at line 170 of file FindDistCone.cc.

References DetId::Hcal, HcalBarrel, HcalEndcap, and HcalDetId::subdet().

170  {
171  // This will not yet handle Ecal CaloHits!!
172  double samplingWeight = 1.;
173  // Hard coded sampling weights from JFH analysis of iso tracks
174  // Sept 2009.
175  DetId id = hit->id();
176  if (id.det() == DetId::Hcal) {
177  HcalDetId detId(id);
178  if (detId.subdet() == HcalBarrel)
179  samplingWeight = 114.1;
180  else if (detId.subdet() == HcalEndcap)
181  samplingWeight = 167.3;
182  else {
183  // ONLY protection against summing HO, HF simhits
184  return 0.;
185  }
186  }
187 
188  return samplingWeight*hit->energy();
189  }
unsigned int id
Definition: DetId.h:18
spr::EtaPhi spr::getEtaPhi ( int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 8 of file FindEtaPhi.cc.

References gather_cfg::cout, debug, fastmath::etaphi(), spr::EtaPhi::ietaE, spr::EtaPhi::ietaW, spr::EtaPhi::iphiN, spr::EtaPhi::iphiS, and spr::EtaPhi::ntrys.

12  {
13 
14  int ietal = (ieta-1)/2;
15  int ietar = ieta - ietal - 1;
16  int iphil = (iphi-1)/2;
17  int iphir = iphi - iphil - 1;
19  etaphi.ietaE[0] = ietal; etaphi.ietaW[0] = ietar;
20  etaphi.iphiN[0] = iphil; etaphi.iphiS[0] = iphir;
21  if (ietal == ietar && iphil == iphir) {
22  etaphi.ntrys = 1;
23  } else if (ietal == ietar || iphil == iphir) {
24  etaphi.ntrys = 2;
25  etaphi.ietaE[1] = ietar; etaphi.ietaW[1] = ietal;
26  etaphi.iphiN[1] = iphir; etaphi.iphiS[1] = iphil;
27  } else {
28  etaphi.ntrys = 4;
29  etaphi.ietaE[1] = ietar; etaphi.ietaW[1] = ietal;
30  etaphi.iphiN[1] = iphil; etaphi.iphiS[1] = iphir;
31  etaphi.ietaE[2] = ietal; etaphi.ietaW[1] = ietar;
32  etaphi.iphiN[2] = iphir; etaphi.iphiS[1] = iphil;
33  etaphi.ietaE[3] = ietar; etaphi.ietaW[1] = ietal;
34  etaphi.iphiN[3] = iphir; etaphi.iphiS[1] = iphil;
35  }
36 
37 #ifdef EDM_ML_DEBUG
38  if (debug) {
39  std::cout << "getEtaPhi:: Has " << etaphi.ntrys << " possibilites for "
40  << ieta << "X" << iphi << " matrix" << std::endl;
41  for (int itry=0; itry<etaphi.ntrys; itry++) {
42  std::cout << "Trial " << itry <<" with etaE|etaW " <<etaphi.ietaE[itry]
43  <<"|" << etaphi.ietaW[itry] << " and phiN|PhiS "
44  << etaphi.iphiN[itry] <<"|" <<etaphi.iphiS[itry] <<std::endl;
45  }
46  }
47 #endif
48  return etaphi;
49  }
int ietaE[4]
Definition: FindEtaPhi.h:16
std::pair< T, T > etaphi(T x, T y, T z)
Definition: FastMath.h:128
#define debug
Definition: HDRShower.cc:19
int ietaW[4]
Definition: FindEtaPhi.h:16
int iphiN[4]
Definition: FindEtaPhi.h:16
int iphiS[4]
Definition: FindEtaPhi.h:16
void spr::getEtaPhi ( HBHERecHitCollection::const_iterator  hit,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
bool  debug = false 
)

Definition at line 107 of file FindDistCone.cc.

Referenced by getEtaPhi().

107  {
108 
109  RH_ieta.push_back(hit->id().ieta());
110  RH_iphi.push_back(hit->id().iphi());
111  RH_ene.push_back(hit->energy());
112  }
unsigned int id
void spr::getEtaPhi ( edm::PCaloHitContainer::const_iterator  hit,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
bool  debug = false 
)

Definition at line 114 of file FindDistCone.cc.

References getEtaPhi().

114  {
115  // SimHit function not yet implemented.
116  RH_ieta.push_back(-9);
117  RH_iphi.push_back(-9);
118  RH_ene.push_back(-9.);
119  }
void spr::getEtaPhi ( HBHERecHitCollection::const_iterator  hit,
int &  ieta,
int &  iphi,
bool  debug = false 
)

Definition at line 128 of file FindDistCone.cc.

129  {
130  ieta = hit->id().ieta();
131  iphi = hit->id().iphi();
132  }
unsigned int id
void spr::getEtaPhi ( edm::PCaloHitContainer::const_iterator  hit,
int &  ieta,
int &  iphi,
bool  debug = false 
)

Definition at line 134 of file FindDistCone.cc.

References DetId::Ecal, EcalBarrel, getEtaPhi(), and DetId::Hcal.

135  {
136  DetId id = DetId(hit->id());
137  if (id.det() == DetId::Hcal) {
138  ieta = ((HcalDetId)(hit->id())).ieta();
139  iphi = ((HcalDetId)(hit->id())).iphi();
140  } else if (id.det() == DetId::Ecal && id.subdetId() == EcalBarrel) {
141  ieta = ((EBDetId)(id)).ieta();
142  iphi = ((EBDetId)(id)).iphi();
143  } else {
144  ieta = 999;
145  iphi = 999;
146  }
147  }
unsigned int id
Definition: DetId.h:18
GlobalPoint spr::getGpos ( const CaloGeometry geo,
HBHERecHitCollection::const_iterator  hit,
bool  debug = false 
)

Definition at line 191 of file FindDistCone.cc.

References CaloGeometry::getPosition().

Referenced by getGpos().

191  {
192  DetId detId(hit->id());
193  return geo->getPosition(detId);
194  }
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
unsigned int id
Definition: DetId.h:18
GlobalPoint spr::getGpos ( const CaloGeometry geo,
edm::PCaloHitContainer::const_iterator  hit,
bool  debug = false 
)

Definition at line 196 of file FindDistCone.cc.

References EcalEndcap, getGpos(), and CaloGeometry::getPosition().

196  {
197  DetId detId(hit->id());
198  return geo->getPosition(detId);
199  }
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
unsigned int id
Definition: DetId.h:18
HcalDetId spr::getHotCell ( std::vector< HBHERecHitCollection::const_iterator > &  hit,
bool  includeHO,
bool  useRaw = false,
bool  debug = false 
)

Definition at line 168 of file eHCALMatrix.cc.

References runEdmFileComparison::found, getRawEnergy(), and HcalOuter.

168  {
169 
170  std::vector<HcalDetId> dets;
171  std::vector<double> energies;
172  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
173  double energy = getRawEnergy(hit.at(ihit), useRaw);
174  HcalDetId id0 = hit.at(ihit)->id();
175  if ((id0.subdet() != HcalOuter) || includeHO) {
176  HcalDetId id1(id0.subdet(),id0.ieta(),id0.iphi(),1);
177  bool found(false);
178  for (unsigned int idet=0; idet<dets.size(); ++idet) {
179  if (id1 == dets[idet]) {
180  energies[idet] += energy;
181  found = true;
182  break;
183  }
184  }
185  if (!found) {
186  dets.push_back(id1);
187  energies.push_back(energy);
188  }
189  }
190  }
191  double energyMax(-99.);
192  HcalDetId hotCell;
193  for (unsigned int ihit=0; ihit<dets.size(); ihit++) {
194  if (energies[ihit] > energyMax) {
195  energyMax = energies[ihit];
196  hotCell = dets[ihit];
197  }
198  }
199  return hotCell;
200  }
unsigned int id
float getRawEnergy(const HcalRecHit &h, float valueIfNoSuchMember=-1.0e20)
Definition: rawEnergy.h:225
HcalDetId spr::getHotCell ( std::vector< std::vector< PCaloHit >::const_iterator > &  hit,
bool  includeHO,
bool  useRaw = false,
bool  debug = false 
)

Definition at line 202 of file eHCALMatrix.cc.

References runEdmFileComparison::found, getRawEnergy(), HcalOuter, HcalDetId::ieta(), HcalDetId::iphi(), and HcalDetId::subdet().

202  {
203 
204  std::vector<HcalDetId> dets;
205  std::vector<double> energies;
206  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
207  double energy = hit.at(ihit)->energy();
208  HcalDetId id0 = getRawEnergy(hit.at(ihit),useRaw);
209  if ((id0.subdet() != HcalOuter) || includeHO) {
210  HcalDetId id1(id0.subdet(),id0.ieta(),id0.iphi(),1);
211  bool found(false);
212  for (unsigned int idet=0; idet<dets.size(); ++idet) {
213  if (id1 == dets[idet]) {
214  energies[idet] += energy;
215  found = true;
216  break;
217  }
218  }
219  if (!found) {
220  dets.push_back(id1);
221  energies.push_back(energy);
222  }
223  }
224  }
225  double energyMax(-99.);
226  HcalDetId hotCell;
227  for (unsigned int ihit=0; ihit<dets.size(); ihit++) {
228  if (energies[ihit] > energyMax) {
229  energyMax = energies[ihit];
230  hotCell = dets[ihit];
231  }
232  }
233  return hotCell;
234  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
float getRawEnergy(const HcalRecHit &h, float valueIfNoSuchMember=-1.0e20)
Definition: rawEnergy.h:225
double spr::getRawEnergy ( HBHERecHitCollection::const_iterator  hit,
bool  useRaw = false 
)

Definition at line 212 of file FindDistCone.cc.

Referenced by getHotCell().

212  {
213  double energy = (useRaw) ? hit->eraw() : hit->energy();
214  return energy;
215  }
double spr::getRawEnergy ( edm::PCaloHitContainer::const_iterator  hit,
bool  useRaw = false 
)

Definition at line 221 of file FindDistCone.cc.

221  {
222  return hit->energy();
223  }
bool spr::goodTrack ( const reco::Track pTrack,
math::XYZPoint  leadPV,
spr::trackSelectionParameters  parameters,
bool  debug = false 
)

Definition at line 10 of file TrackSelection.cc.

References funct::abs(), gather_cfg::cout, debug, particleFlowDisplacedVertexCandidate_cfi::dxy, reco::TrackBase::dxy(), allConversions_cfi::dz, reco::TrackBase::dz(), reco::TrackBase::hitPattern(), mps_fire::i, spr::trackSelectionParameters::maxChi2, spr::trackSelectionParameters::maxDpOverP, spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, reco::HitPattern::MISSING_INNER_HITS, reco::HitPattern::MISSING_OUTER_HITS, reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfHits(), reco::HitPattern::printHitPattern(), reco::TrackBase::pt(), reco::TrackBase::qoverp(), reco::TrackBase::qoverpError(), reco::TrackBase::quality(), TauGenJetsDecayModeSelectorAllHadrons_cfi::select, reco::HitPattern::stripTECLayersWithMeasurement(), reco::HitPattern::stripTOBLayersWithMeasurement(), reco::HitPattern::TRACK_HITS, reco::HitPattern::trackerLayersWithMeasurement(), and reco::HitPattern::trackerLayersWithoutMeasurement().

Referenced by IsoTrackCalibration::analyze(), IsoTrackCalib::analyze(), IsolatedTracksHcalScale::analyze(), IsoTrig::chgIsolation(), CSCSkim::doBFieldStudySelection(), AlCaIsoTracksFilter::filter(), IsoTrig::getGoodTracks(), PFEGammaFilters::isElectronSafeForJetMET(), JetTracksAssociationDRCalo::produce(), AlCaIsoTracksProducer::select(), PFElectronAlgo::SetIDOutputs(), IsoTrig::studyIsolation(), IsoTrig::studyMipCut(), IsoTrig::StudyTrkEbyP(), and PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL().

15  {
16 
17  bool select = pTrack->quality(parameters.minQuality);
18  double dxy = pTrack->dxy(leadPV);
19  double dz = pTrack->dz(leadPV);
20  double dpbyp = 999;
21  if (std::abs(pTrack->qoverp()) > 0.0000001)
22  dpbyp = std::abs(pTrack->qoverpError()/pTrack->qoverp());
23 
24 #ifdef EDM_ML_DEBUG
25  if (debug) std::cout << "Track:: Pt " << pTrack->pt() << " dxy " << dxy << " dz " << dz << " Chi2 " << pTrack->normalizedChi2() << " dpbyp " << dpbyp << " Quality " << select << std::endl;
26 #endif
27  if (pTrack->pt() < parameters.minPt) select = false;
28  if (dxy > parameters.maxDxyPV || dz > parameters.maxDzPV) select = false;
29  if (pTrack->normalizedChi2() > parameters.maxChi2) select = false;
30  if (dpbyp > parameters.maxDpOverP) select = false;
31 
32  if (parameters.minLayerCrossed>0 || parameters.minOuterHit>0) {
33  const reco::HitPattern& hitp = pTrack->hitPattern();
34  if (parameters.minLayerCrossed>0 && hitp.trackerLayersWithMeasurement() < parameters.minLayerCrossed) select = false;
35  if (parameters.minOuterHit>0 && (hitp.stripTOBLayersWithMeasurement()+hitp.stripTECLayersWithMeasurement() ) < parameters.minOuterHit) select = false;
36 #ifdef EDM_ML_DEBUG
37  if (debug) {
38  std::cout << "Default Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::TRACK_HITS) << " hits" << std::endl;
39  for (int i=0; i<hitp.numberOfHits(reco::HitPattern::TRACK_HITS); i++)
41  }
42 #endif
43  }
44  if (parameters.maxInMiss >= 0) {
45  const reco::HitPattern& hitp = pTrack->hitPattern();
47 #ifdef EDM_ML_DEBUG
48  if (debug) {
49  std::cout << "Inner Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::MISSING_INNER_HITS) << " hits" << std::endl;
52  }
53 #endif
54  }
55  if (parameters.maxOutMiss >= 0) {
56  const reco::HitPattern& hitp = pTrack->hitPattern();
58 #ifdef EDM_ML_DEBUG
59  if (debug) {
60  std::cout << "Outer Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::MISSING_OUTER_HITS) << " hits" << std::endl;
63  }
64 #endif
65  }
66 #ifdef EDM_ML_DEBUG
67  if (debug) std::cout << "Final Selection Result " << select << std::endl;
68 #endif
69  return select;
70  }
double qoverp() const
q / p
Definition: TrackBase.h:568
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:598
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:556
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:512
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:826
double pt() const
track transverse momentum
Definition: TrackBase.h:616
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:752
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:604
#define debug
Definition: HDRShower.cc:19
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:529
reco::TrackBase::TrackQuality minQuality
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:609
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:586
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:807
void spr::hGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const HcalTopology topology,
int  ieta,
int  iphi,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 61 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugHcalDets(), and matrixHCALIds().

Referenced by IsolatedGenParticles::analyze().

61  {
62 
63 #ifdef EDM_ML_DEBUG
64  if (debug) std::cout << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
65 #endif
66  std::vector<DetId> dets;
67  dets.push_back(coreDet);
68  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
69 #ifdef EDM_ML_DEBUG
70  if (debug) spr::debugHcalDets(0, vdets);
71 #endif
72  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
73  }
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
void spr::hGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const CaloGeometry geo,
const HcalTopology topology,
double  dR,
const GlobalVector trackMom,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 75 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugHcalDets(), and matrixHCALIds().

75  {
76 
77 #ifdef EDM_ML_DEBUG
78  if (debug) std::cout << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
79 #endif
80  std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, false);
81 #ifdef EDM_ML_DEBUG
82  if (debug) spr::debugHcalDets(0, vdets);
83 #endif
84  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
85  }
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
void spr::hGenSimInfo ( const DetId coreDet,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
const HcalTopology topology,
int  ieta,
int  iphi,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 87 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugHcalDets(), and matrixHCALIds().

87  {
88 
89 #ifdef EDM_ML_DEBUG
90  if (debug) std::cout << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
91 #endif
92  std::vector<DetId> dets;
93  dets.push_back(coreDet);
94  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
95 #ifdef EDM_ML_DEBUG
96  if (debug) spr::debugHcalDets(0, vdets);
97 #endif
98  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
99  }
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
void spr::hGenSimInfo ( const DetId coreDet,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
const CaloGeometry geo,
const HcalTopology topology,
double  dR,
const GlobalVector trackMom,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 101 of file GenSimInfo.cc.

References cGenSimInfo(), gather_cfg::cout, debugHcalDets(), and matrixHCALIds().

101  {
102 
103 #ifdef EDM_ML_DEBUG
104  if (debug) std::cout << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
105 #endif
106  std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, false);
107 #ifdef EDM_ML_DEBUG
108  if (debug) spr::debugHcalDets(0, vdets);
109 #endif
110  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
111  }
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:113
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
template<typename T >
void spr::hitECALmatrix ( CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
std::vector< typename T::const_iterator > &  hitlist,
bool  debug = false 
)
template<typename T >
void spr::hitHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
std::vector< typename T::const_iterator > &  hitlist,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::hitHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
std::vector< typename T::const_iterator > &  hitlist,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::hitsHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
std::vector< typename T::const_iterator > &  hitlist,
bool  debug = false 
)
template<typename T >
DetId spr::hotCrystal ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Referenced by ElectronStudy::analyze().

template<typename T >
DetId spr::hotCrystal ( std::vector< DetId > &  detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
edm::SimTrackContainer::const_iterator spr::matchedSimTrack ( const edm::Event iEvent,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
bool  debug = false 
)

Definition at line 12 of file MatchingSimTrack.cc.

References TrackerHitAssociator::associateHit(), gather_cfg::cout, debug, runEdmFileComparison::found, mps_fire::i, reco::Track::recHitsBegin(), and reco::Track::recHitsEnd().

Referenced by IsolatedTracksCone::analyze(), IsolatedTracksNxN::analyze(), and matchedSimTrackId().

20  {
21 
22  edm::SimTrackContainer::const_iterator itr = SimTk->end();;
23 
24  edm::SimTrackContainer::const_iterator simTrkItr;
25  edm::SimVertexContainer::const_iterator simVtxItr;
26 
27  //Get the vector of PsimHits associated to TrackerRecHits and select the
28  //matching SimTrack on the basis of maximum occurance of trackIds
29  std::vector<unsigned int> trkId, trkOcc;
30  int i=0;
31  for (trackingRecHit_iterator iTrkHit = pTrack->recHitsBegin(); iTrkHit != pTrack->recHitsEnd(); ++iTrkHit, ++i) {
32 
33  std::vector<PSimHit> matchedSimIds = associate.associateHit((**iTrkHit));
34  for (unsigned int isim=0; isim<matchedSimIds.size(); isim++) {
35  unsigned tkId = matchedSimIds[isim].trackId();
36  bool found = false;
37  for (unsigned int j=0; j<trkId.size(); j++) {
38  if ( tkId == trkId[j] ) {
39  trkOcc[j]++;
40  found = true;
41  break;
42  }
43  }
44  if (!found) { trkId.push_back(tkId); trkOcc.push_back(1); }
45  }
46  }
47 
48 #ifdef EDM_ML_DEBUG
49  if (debug) {
50  std::cout << "Reconstructed Track with " << i << " recHits.";
51  for (unsigned int isim=0; isim<trkId.size(); isim++){
52  std::cout << "\n trkId " << trkId[isim] << " Occurance " << trkOcc[isim] << ", ";
53  }
54  std::cout << std::endl;
55  }
56  int matchedId=0;
57 #endif
58 
59  unsigned int matchSimTrk=0;
60  if (trkOcc.size() > 0) {
61  unsigned int maxTrkOcc=0, idxMax=0;
62  for(unsigned int j=0; j<trkOcc.size(); j++) {
63  if(trkOcc[j] > maxTrkOcc ) { maxTrkOcc = trkOcc[j]; idxMax = j; }
64  }
65  matchSimTrk = trkId[idxMax];
66  for (simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
67  if ( simTrkItr->trackId() == matchSimTrk ) {
68 #ifdef EDM_ML_DEBUG
69  matchedId = simTrkItr->type();
70  if (debug) std::cout << "matched trackId (maximum occurance) " << matchSimTrk << " type " << matchedId << std::endl;
71 #endif
72  itr = simTrkItr;
73  break;
74  }
75  }
76  }
77 
78 #ifdef EDM_ML_DEBUG
79  if (matchedId==0 && debug) {
80  std::cout << "Could not find matched SimTrk and track history now " << std::endl;
81  }
82 #endif
83  return itr;
84  }
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
#define debug
Definition: HDRShower.cc:19
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
std::vector< int > spr::matchedSimTrackId ( const edm::Event iEvent,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
bool  debug = false 
)

Definition at line 87 of file MatchingSimTrack.cc.

References gather_cfg::cout, matchedSimTrack(), and validSimTrack().

87  {
88 
89  // get the matching SimTrack
90  edm::SimTrackContainer::const_iterator trkInfo = spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack,associate, debug);
91  unsigned int matchSimTrk = trkInfo->trackId();
92 #ifdef EDM_ML_DEBUG
93  if (debug) std::cout << "matchedSimTrackId finds the SimTrk ID of the current track to be " << matchSimTrk << std::endl;
94 #endif
95  std::vector<int> matchTkid;
96  if( trkInfo->type() != 0) {
97  edm::SimTrackContainer::const_iterator simTrkItr;
98  for(simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
99  if (validSimTrack(matchSimTrk, simTrkItr, SimTk, SimVtx, false))
100  matchTkid.push_back((int)simTrkItr->trackId());
101  }
102  }
103  return matchTkid;
104  }
edm::SimTrackContainer::const_iterator matchedSimTrack(const edm::Event &iEvent, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, bool debug=false)
#define debug
Definition: HDRShower.cc:19
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::simTkInfo spr::matchedSimTrackInfo ( unsigned int  simTkId,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 106 of file MatchingSimTrack.cc.

References spr::simTkInfo::charge, gather_cfg::cout, spr::simTkInfo::found, info(), parentSimTrack(), spr::simTkInfo::pdgId, and validSimTrack().

106  {
108  for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
109  simTrkItr!= SimTk->end(); simTrkItr++) {
110  if (simTkId == simTrkItr->trackId()) {
111  if (spr::validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug)) {
112  info.found = true;
113  info.pdgId = simTrkItr->type();
114  info.charge = simTrkItr->charge();
115  } else {
116  edm::SimTrackContainer::const_iterator parentItr = spr::parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
117 #ifdef EDM_ML_DEBUG
118  if (debug) {
119  if (parentItr != SimTk->end() ) std::cout << "original parent of " << simTrkItr->trackId() << " " << parentItr->trackId() << ", " << parentItr->type() << std::endl;
120  else std::cout << "original parent of " << simTrkItr->trackId() << " not found" << std::endl;
121  }
122 #endif
123  if (parentItr != SimTk->end()) {
124  info.found = true;
125  info.pdgId = parentItr->type();
126  info.charge = parentItr->charge();
127  }
128  }
129  break;
130  }
131  }
132  return info;
133  }
static const TGPicture * info(bool iBackgroundIsBlack)
#define debug
Definition: HDRShower.cc:19
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
edm::SimTrackContainer::const_iterator parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
void spr::matrixECALIds ( const DetId det,
int  ieta,
int  iphi,
const CaloGeometry geo,
const CaloTopology caloTopology,
std::vector< DetId > &  vdets,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 16 of file MatrixECALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, DetId::Ecal, EcalBarrel, EcalEndcap, extraIds(), CaloGeometry::getSubdetectorGeometry(), CaloTopology::getSubdetectorTopology(), newECALIdNS(), NORTH, and SOUTH.

Referenced by chargeIsolationEcal(), eECALmatrix(), eGenSimInfo(), and matrixECALIds().

19  {
20 
21  const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
22  const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
23  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
24  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
25 
26 #ifdef EDM_ML_DEBUG
27  if (debug) {
28  std::cout << "matrixECALIds::Add " << ieta << " rows and " << iphi
29  << " columns of cells for 1 cell" << std::endl;
30  spr::debugEcalDets(0, det, true);
31  }
32 #endif
33  std::vector<DetId> dets(1,det);
34  std::vector<CaloDirection> dirs(1,NORTH);
35  vdets = spr::newECALIdNS(dets, 0, ieta,iphi, dirs, *barrelTopo,*endcapTopo,
36  *barrelGeom, *endcapGeom, debug, ignoreTransition);
37  dirs[0] = SOUTH;
38  std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, ieta, iphi, dirs,
39  *barrelTopo, *endcapTopo,
40  *barrelGeom, *endcapGeom,
41  debug, ignoreTransition);
42  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
43  if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
44  vdets.push_back(vdetS[i1]);
45  }
46  unsigned int ndet = (2*ieta+1)*(2*iphi+1);
47  if (vdets.size() != ndet) {
48  std::vector<DetId> vdetExtra;
49  spr::extraIds(det, vdets, ieta, ieta, iphi, iphi,
50  *barrelGeom, *endcapGeom, vdetExtra, debug);
51  if (vdetExtra.size() > 0)
52  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
53  }
54 
55 #ifdef EDM_ML_DEBUG
56  if (debug) {
57  std::cout << "matrixECALIds::Total number of cells found is "
58  << vdets.size() << std::endl;
59  spr::debugEcalDets(0, vdets);
60  }
61 #endif
62  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void extraIds(const DetId &det, std::vector< DetId > &dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, bool debug=false)
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
std::vector< DetId > spr::matrixECALIds ( const DetId det,
int  ieta,
int  iphi,
const CaloGeometry geo,
const CaloTopology caloTopology,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 64 of file MatrixECALDetIds.cc.

References matrixECALIds().

67  {
68 
69  std::vector<DetId> vdets;
70  spr::matrixECALIds(det, ieta, iphi, geo, caloTopology, vdets, debug,
71  ignoreTransition);
72  return vdets;
73  }
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > spr::matrixECALIds ( const DetId det,
double  dR,
const GlobalVector trackMom,
const CaloGeometry geo,
const CaloTopology caloTopology,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 75 of file MatrixECALDetIds.cc.

References gather_cfg::cout, debugEcalDets(), EcalEndcap, getDistInPlaneTrackDir(), CaloGeometry::getPosition(), mps_fire::i, createfilelist::int, matrixECALIds(), and DetId::subdetId().

79  {
80 
82  if (det.subdetId() == EcalEndcap) {
83  EEDetId EEid = EEDetId(det);
84  core = geo->getPosition(EEid);
85  } else {
86  EBDetId EBid = EBDetId(det);
87  core = geo->getPosition(EBid);
88  }
89  int ietaphi = (int)(dR/2.0)+1;
90  std::vector<DetId> vdets, vdetx;
91  spr::matrixECALIds(det, ietaphi, ietaphi, geo, caloTopology, vdets, debug,
92  ignoreTransition);
93  for (unsigned int i=0; i<vdets.size(); ++i) {
94  GlobalPoint rpoint;
95  if (vdets[i].subdetId() == EcalEndcap) {
96  EEDetId EEid = EEDetId(vdets[i]);
97  rpoint = geo->getPosition(EEid);
98  } else {
99  EBDetId EBid = EBDetId(vdets[i]);
100  rpoint = geo->getPosition(EBid);
101  }
102  if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint)<dR) {
103  vdetx.push_back(vdets[i]);
104  }
105  }
106 
107 #ifdef EDM_ML_DEBUG
108  if (debug) {
109  std::cout << "matrixECALIds::Final List of cells for dR " << dR
110  << " is with " << vdetx.size() << " from original list of "
111  << vdets.size() << std::endl;
112  spr::debugEcalDets(0, vdetx);
113  }
114 #endif
115  return vdetx;
116  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:11
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
Definition: __init__.py:1
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
#define debug
Definition: HDRShower.cc:19
void spr::matrixECALIds ( const DetId det,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
const CaloGeometry geo,
const CaloTopology caloTopology,
std::vector< DetId > &  vdets,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 118 of file MatrixECALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, DetId::Ecal, EcalBarrel, EcalEndcap, extraIds(), CaloGeometry::getSubdetectorGeometry(), CaloTopology::getSubdetectorTopology(), newECALIdNS(), NORTH, and SOUTH.

122  {
123 
124  const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
125  const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
126  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
127  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
128 
129 #ifdef EDM_ML_DEBUG
130  if (debug) {
131  std::cout << "matrixECALIds::Add " << ietaE << "|" << ietaW
132  << " rows and " << iphiN << "|" << iphiS
133  << " columns of cells for 1 cell" << std::endl;
134  debugEcalDets(0, det, true);
135  }
136 #endif
137  std::vector<DetId> dets(1,det);
138  std::vector<CaloDirection> dirs(1,NORTH);
139  std::vector<int> jetaE(1,ietaE), jetaW(1,ietaW);
140  std::vector<int> jphiN(1,iphiN), jphiS(1,iphiS);
141  vdets = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN, jphiS, dirs,
142  *barrelTopo, *endcapTopo, *barrelGeom,
143  *endcapGeom, debug, ignoreTransition);
144  dirs[0] = SOUTH;
145  std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN,
146  jphiS, dirs, *barrelTopo,
147  *endcapTopo, *barrelGeom,
148  *endcapGeom, debug,
149  ignoreTransition);
150  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
151  if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
152  vdets.push_back(vdetS[i1]);
153  }
154 
155  unsigned int ndet = (ietaE+ietaW+1)*(iphiN+iphiS+1);
156  if (vdets.size() != ndet) {
157  std::vector<DetId> vdetExtra;
158  spr::extraIds(det, vdets, ietaE, ietaW, iphiN, iphiS,
159  *barrelGeom, *endcapGeom, vdetExtra, debug);
160  if (vdetExtra.size() > 0)
161  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
162  }
163 
164 #ifdef EDM_ML_DEBUG
165  if (debug) {
166  std::cout << "matrixECALIds::Total number of cells found is "
167  << vdets.size() << std::endl;
168  spr::debugEcalDets(0, vdets);
169  }
170 #endif
171  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void extraIds(const DetId &det, std::vector< DetId > &dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, bool debug=false)
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
std::vector< DetId > spr::matrixECALIds ( const DetId det,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
const CaloGeometry geo,
const CaloTopology caloTopology,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 173 of file MatrixECALDetIds.cc.

References matrixECALIds().

177  {
178 
179  std::vector<DetId> vdets;
180  spr::matrixECALIds(det, ietaE, ietaW, iphiN, iphiS, geo, caloTopology,
181  vdets, debug, ignoreTransition);
182  return vdets;
183  }
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > spr::matrixHCALIds ( std::vector< DetId > &  dets,
const HcalTopology topology,
int  ieta,
int  iphi,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 14 of file MatrixHCALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugHcalDets(), matrixHCALIdsDepth(), and newHCALIdNS().

Referenced by chargeIsolationHcal(), eHCALmatrix(), hGenSimInfo(), and matrixHCALIds().

16  {
17 
18 #ifdef EDM_ML_DEBUG
19  if (debug) {
20  std::cout << "matrixHCALIds::Add " << ieta << " rows and " << iphi
21  << " columns of cells for " << dets.size() << " cells"
22  << std::endl;
23  spr::debugHcalDets(0, dets);
24  }
25 #endif
26  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ieta,
27  iphi, debug);
28  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false, ieta,
29  iphi, debug);
30  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
31  if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
32  vdetN.push_back(vdetS[i1]);
33  }
34 
35  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
36 
37 #ifdef EDM_ML_DEBUG
38  if (debug) {
39  std::cout << "matrixHCALIds::Total number of cells found is "
40  << vdetS.size() << std::endl;
41  spr::debugHcalDets(0, vdetS);
42  }
43 #endif
44  return vdetS;
45  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
std::vector< DetId > spr::matrixHCALIds ( const DetId det,
const CaloGeometry geo,
const HcalTopology topology,
double  dR,
const GlobalVector trackMom,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 47 of file MatrixHCALDetIds.cc.

References gather_cfg::cout, debugHcalDets(), getDistInPlaneTrackDir(), CaloGeometry::getPosition(), mps_fire::i, createfilelist::int, and matrixHCALIds().

50  {
51 
52  HcalDetId hcdet = HcalDetId(det);
53  GlobalPoint core = geo->getPosition(hcdet);
54  std::vector<DetId> dets, vdetx;
55  dets.push_back(det);
56  int ietaphi = (int)(dR/15.0)+1;
57  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ietaphi,
58  ietaphi, includeHO, debug);
59  for (unsigned int i=0; i<vdets.size(); ++i) {
60  HcalDetId hcdet = HcalDetId(vdets[i]);
61  GlobalPoint rpoint = geo->getPosition(hcdet);
62  if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint) < dR) {
63  vdetx.push_back(vdets[i]);
64  }
65  }
66 
67 #ifdef EDM_ML_DEBUG
68  if (debug) {
69  std::cout << "matrixHCALIds::Final List of cells for dR " << dR
70  << " is with " << vdetx.size() << " from original list of "
71  << vdets.size() << " cells" << std::endl;
72  spr::debugHcalDets(0, vdetx);
73  }
74 #endif
75  return vdetx;
76  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:11
Definition: __init__.py:1
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
std::vector< DetId > spr::matrixHCALIds ( std::vector< DetId > &  dets,
const HcalTopology topology,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 78 of file MatrixHCALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugHcalDets(), matrixHCALIdsDepth(), and newHCALIdNS().

81  {
82 
83 #ifdef EDM_ML_DEBUG
84  if (debug) {
85  std::cout << "matrixHCALIds::Add " <<ietaE << "|" <<ietaW << " rows and "
86  << iphiN << "|" << iphiS << " columns of cells for "
87  << dets.size() << " cells" << std::endl;
88  spr::debugHcalDets(0, dets);
89  }
90 #endif
91  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ietaE,
92  ietaW, iphiN, iphiS, debug);
93  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false,ietaE,
94  ietaW, iphiN, iphiS, debug);
95  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
96  if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
97  vdetN.push_back(vdetS[i1]);
98  }
99 
100  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
101 
102 #ifdef EDM_ML_DEBUG
103  if (debug) {
104  std::cout << "matrixHCALIds::Total number of cells found is "
105  << vdetS.size() << std::endl;
106  spr::debugHcalDets(0, vdetS);
107  }
108 #endif
109  return vdetS;
110  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
std::vector< DetId > spr::matrixHCALIdsDepth ( std::vector< DetId > &  dets,
const HcalTopology topology,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 392 of file MatrixHCALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debug, debugHcalDets(), HcalOuter, createfilelist::int, gen::n, and HcalTopology::up().

Referenced by matrixHCALIds().

398  {
399 
400 #ifdef EDM_ML_DEBUG
401  if (debug) {
402  std::cout << "matrixHCALIdsDepth::Add cells with higher depths with HO"
403  << "Flag set to " << includeHO << " to existing "
404  << dets.size() << " cells" << std::endl;
405  spr::debugHcalDets(0, dets);
406  }
407 #endif
408  std::vector<DetId> vdets(dets);
409  for (unsigned int i1=0; i1<dets.size(); i1++) {
410  HcalDetId vdet = dets[i1];
411  for (int idepth = 0; idepth < 3; idepth++) {
412  std::vector<DetId> vUpDetId = topology->up(vdet);
413  if (vUpDetId.size() != 0) {
414  if (includeHO || vUpDetId[0].subdetId() != (int)(HcalOuter)) {
415  int n = std::count(vdets.begin(),vdets.end(),vUpDetId[0]);
416  if (n == 0) {
417 #ifdef EDM_ML_DEBUG
418  if (debug) std::cout << "matrixHCALIdsDepth:: Depth " << idepth
419  << " " << vdet << " "
420  << (HcalDetId)vUpDetId[0] << std::endl;
421 #endif
422  vdets.push_back(vUpDetId[0]);
423  }
424  }
425  vdet = vUpDetId[0];
426  }
427  }
428  }
429 
430 #ifdef EDM_ML_DEBUG
431  if (debug) {
432  std::cout << "matrixHCALIdsDepth::Final list contains " << vdets.size()
433  << " cells" << std::endl;
434  spr::debugHcalDets(0, vdets);
435  }
436 #endif
437  return vdets;
438  }
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
virtual std::vector< DetId > up(const DetId &id) const
template<typename T >
std::vector<typename T::const_iterator> spr::missedCaloHits ( edm::Handle< T > &  hits,
std::vector< int >  matchedId,
std::vector< typename T::const_iterator >  caloHits,
bool  flag,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::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 
)
template<typename T >
std::vector<typename T::const_iterator> spr::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::vector< DetId > spr::newECALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
int  ieta,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 499 of file MatrixECALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, RemoveAddSevLevel::flag, plotBeamSpotDB::last, simpleMove(), and WEST.

Referenced by newECALIdEW(), and newECALIdNS().

505  {
506 
507 #ifdef EDM_ML_DEBUG
508  if (debug) {
509  std::cout << "newECALIdEW::Add " << ieta << " rows of cells for "
510  << last << ":" << dets.size() << ":" << (dets.size()-last)
511  << " cells" << std::endl;
512  spr::debugEcalDets (last, dets, dir);
513  }
514 #endif
515  std::vector<DetId> vdets; vdets.clear();
516  std::vector<CaloDirection> dirs; dirs.clear();
517  vdets.insert(vdets.end(), dets.begin(), dets.end());
518  dirs.insert(dirs.end(), dir.begin(), dir.end());
519 
520  if (ieta > 0) {
521  for (unsigned int i1=last; i1<dets.size(); i1++) {
522  int flag = 0;
523  std::vector<DetId> cells;
524  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
525  barrelGeom, endcapGeom, cells, flag,
526  debug, ignoreTransition);
527  if (flag != 0) {
528  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
529  CaloDirection dirn = dir[i1];
530  if (flag < 0) {
531  if (dirn == EAST) dirn = WEST;
532  else dirn = EAST;
533  }
534  vdets.push_back(cells[0]);
535  dirs.push_back(dirn);
536  }
537  }
538  }
539  ieta--;
540  }
541 
542 #ifdef EDM_ML_DEBUG
543  if (debug) {
544  std::cout << "newECALIdEW::Addition results a set of "
545  << (vdets.size()-dets.size()) << " new cells" << std::endl;
546  spr::debugEcalDets (dets.size(), vdets, dirs);
547  }
548 #endif
549  if (ieta > 0) {
550  last = dets.size();
551  return spr::newECALIdEW(vdets, last, ieta, dirs, barrelTopo, endcapTopo,
552  barrelGeom, endcapGeom, debug, ignoreTransition);
553  } else {
554 #ifdef EDM_ML_DEBUG
555  if (debug) {
556  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
557  << " cells" << std::endl;
558  spr::debugEcalDets (0, vdets);
559  }
560 #endif
561  return vdets;
562  }
563  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > spr::newECALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
std::vector< int > &  ietaE,
std::vector< int > &  ietaW,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 565 of file MatrixECALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, RemoveAddSevLevel::flag, plotBeamSpotDB::last, newECALIdEW(), simpleMove(), and WEST.

573  {
574 
575 #ifdef EDM_ML_DEBUG
576  if (debug) {
577  std::cout << "newECALIdEW::Add " << ietaE[0] << "|" << ietaW[0]
578  << " rows of cells for " << (dets.size()-last)
579  << " cells (last " << last << ")" << std::endl;
580  spr::debugEcalDets (last, dets, dir);
581  }
582 #endif
583  std::vector<DetId> vdets;
584  vdets.insert(vdets.end(), dets.begin(), dets.end());
585  std::vector<CaloDirection> dirs;
586  dirs.insert(dirs.end(), dir.begin(), dir.end());
587  std::vector<int> jetaE, jetaW;
588  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
589  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
590  int keta = 0;
591  for (unsigned int i1=last; i1<dets.size(); i1++) {
592  int ieta = ietaW[i1];
593  if (dir[i1] == EAST) ieta = ietaE[i1];
594  if (ieta > 0) {
595  int flag=0;
596  std::vector<DetId> cells;
597  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
598  barrelGeom, endcapGeom, cells, flag,
599  debug, ignoreTransition);
600  ieta--;
601  if (ieta > keta) keta = ieta;
602  if (dir[i1] == EAST) jetaE[i1] = ieta;
603  else jetaW[i1] = ieta;
604  if (flag != 0) {
605  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
606  vdets.push_back(cells[0]);
607  CaloDirection dirn = dir[i1];
608  int ketaE = ietaE[i1];
609  int ketaW = ietaW[i1];
610  if (dirn == EAST) ketaE = ieta;
611  else ketaW = ieta;
612  if (flag < 0) {
613  int ktmp = ketaW; ketaW = ketaE; ketaE = ktmp;
614  if (dirn == EAST) dirn = WEST;
615  else dirn = EAST;
616  }
617  dirs.push_back(dirn);
618  jetaE.push_back(ketaE);
619  jetaW.push_back(ketaW);
620  }
621  }
622  }
623  }
624 
625 #ifdef EDM_ML_DEBUG
626  if (debug) {
627  std::cout << "newECALIdEW::Addition results a set of "
628  << (vdets.size()-dets.size()) << " new cells (last "
629  << dets.size() << ", ieta " << keta << ")" << std::endl;
630  spr::debugEcalDets (dets.size(), vdets);
631  }
632 #endif
633  if (keta > 0) {
634  last = dets.size();
635  return spr::newECALIdEW(vdets, last, jetaE, jetaW, dirs, barrelTopo,
636  endcapTopo, barrelGeom, endcapGeom,
637  debug, ignoreTransition);
638  } else {
639 #ifdef EDM_ML_DEBUG
640  if (debug) {
641  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
642  << " cells" << std::endl;
643  spr::debugEcalDets (0, vdets);
644  }
645 #endif
646  return vdets;
647  }
648  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > spr::newECALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
int  ieta,
int  iphi,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 185 of file MatrixECALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, RemoveAddSevLevel::flag, plotBeamSpotDB::last, newECALIdEW(), NORTH, simpleMove(), SOUTH, and WEST.

Referenced by matrixECALIds(), and newECALIdNS().

192  {
193 
194 #ifdef EDM_ML_DEBUG
195  if (debug) {
196  std::cout << "newECALIdNS::Add " << iphi << " columns of cells for "
197  << (dets.size()-last) << " cells (last " << last << ")"
198  << std::endl;
199  spr::debugEcalDets(last, dets, dir);
200  }
201 #endif
202  std::vector<DetId> vdets;
203  std::vector<CaloDirection> dirs;
204  vdets.insert(vdets.end(), dets.begin(), dets.end());
205  dirs.insert(dirs.end(), dir.begin(), dir.end());
206 
207  std::vector<DetId> vdetE, vdetW;
208  if (last == 0) {
209  unsigned int ndet = vdets.size();
210  std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
211  vdetE = spr::newECALIdEW(dets, last, ieta, dirE, barrelTopo, endcapTopo,
212  barrelGeom, endcapGeom, debug, ignoreTransition);
213  vdetW = spr::newECALIdEW(dets, last, ieta, dirW, barrelTopo, endcapTopo,
214  barrelGeom, endcapGeom, debug, ignoreTransition);
215  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
216  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
217  vdets.push_back(vdetW[i1]);
218  dirs.push_back(dir[0]);
219  }
220  }
221  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
222  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
223  vdets.push_back(vdetE[i1]);
224  dirs.push_back(dir[0]);
225  }
226  }
227 #ifdef EDM_ML_DEBUG
228  if (debug) {
229  std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
230  << (vdets.size()-dets.size()) << " new cells" << std::endl;
231  spr::debugEcalDets(dets.size(), vdets, dirs);
232  }
233 #endif
234  }
235 
236  unsigned int last0 = vdets.size();
237  std::vector<DetId> vdetnew;
238  std::vector<CaloDirection> dirnew;
239  if (iphi > 0) {
240  std::vector<DetId> vdetn(1);
241  std::vector<CaloDirection> dirn(1);
242  std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
243  int flag=0;
244  for (unsigned int i1=last; i1<dets.size(); i1++) {
245  std::vector<DetId> cells;
246  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
247  barrelGeom, endcapGeom, cells, flag,
248  debug, ignoreTransition);
249  if (flag != 0) {
250  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
251  vdetn[0] = cells[0];
252  vdetnew.push_back(vdetn[0]);
253  dirn[0] = dir[i1];
254  if (flag < 0) {
255  if (dirn[0] == NORTH) dirn[0] = SOUTH;
256  else dirn[0] = NORTH;
257  }
258  dirnew.push_back(dirn[0]);
259  vdetE = spr::newECALIdEW(vdetn, 0, ieta, dirnE, barrelTopo,
260  endcapTopo, barrelGeom, endcapGeom,
261  debug, ignoreTransition);
262  vdetW = spr::newECALIdEW(vdetn, 0, ieta, dirnW, barrelTopo,
263  endcapTopo, barrelGeom, endcapGeom,
264  debug, ignoreTransition);
265  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
266  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
267  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
268  vdets.push_back(vdetW[i2]);
269  dirs.push_back(dirn[0]);
270  }
271  }
272  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
273  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
274  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
275  vdets.push_back(vdetE[i2]);
276  dirs.push_back(dirn[0]);
277  }
278  }
279  }
280  }
281  }
282  iphi--;
283  last = vdets.size();
284  for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
285  if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
286  vdets.push_back(vdetnew[i2]);
287  dirs.push_back(dirnew[i2]);
288  }
289  }
290 #ifdef EDM_ML_DEBUG
291  if (debug) {
292  std::cout << "newECALIdNS::Addition results a set of "
293  << (vdets.size()-last0) << " new cells (last " << last0
294  << ", iphi " << iphi << ")" << std::endl;
295  spr::debugEcalDets(last0, vdets, dirs);
296  }
297 #endif
298  last0 = last;
299  }
300 
301  if (iphi > 0) {
302  last = last0;
303  return spr::newECALIdNS(vdets, last, ieta, iphi, dirs, barrelTopo,
304  endcapTopo, barrelGeom, endcapGeom,
305  debug, ignoreTransition);
306  } else {
307 #ifdef EDM_ML_DEBUG
308  if (debug) {
309  std::cout << "newECALIdNS::Final list consists of " << vdets.size()
310  << " cells" << std::endl;
311  spr::debugEcalDets(0, vdets);
312  }
313 #endif
314  return vdets;
315  }
316  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
dbl *** dir
Definition: mlp_gen.cc:35
std::vector< DetId > spr::newECALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
std::vector< int > &  ietaE,
std::vector< int > &  ietaW,
std::vector< int > &  iphiN,
std::vector< int > &  iphiS,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 318 of file MatrixECALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, RemoveAddSevLevel::flag, plotBeamSpotDB::last, newECALIdEW(), newECALIdNS(), NORTH, simpleMove(), SOUTH, and WEST.

328  {
329 
330 #ifdef EDM_ML_DEBUG
331  if (debug) {
332  std::cout << "newECALIdNS::Add columns of cells for "
333  << (dets.size()-last) << " cells (last) " << last << std::endl;
334  for (unsigned int i1=last; i1<dets.size(); i1++) {
335  spr::debugEcalDets (i1, dets[i1], false);
336  std::cout << " along " << dir[i1] << " # " << iphiN[i1] << "|"
337  << iphiS[i1] << std::endl;
338  }
339  }
340 #endif
341  std::vector<DetId> vdets;
342  std::vector<CaloDirection> dirs;
343  std::vector<int> jetaE, jetaW, jphiN, jphiS;
344  vdets.insert(vdets.end(), dets.begin(), dets.end());
345  dirs.insert(dirs.end(), dir.begin(), dir.end());
346  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
347  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
348  jphiN.insert(jphiN.end(), iphiN.begin(), iphiN.end());
349  jphiS.insert(jphiS.end(), iphiS.begin(), iphiS.end());
350  std::vector<DetId> vdetE, vdetW;
351  if (last == 0) {
352  unsigned int ndet = vdets.size();
353  std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
354  vdetE = spr::newECALIdEW(dets, last, ietaE, ietaW, dirE, barrelTopo,
355  endcapTopo, barrelGeom, endcapGeom,
356  debug, ignoreTransition);
357  vdetW = spr::newECALIdEW(dets, last, ietaE, ietaW, dirW, barrelTopo,
358  endcapTopo, barrelGeom, endcapGeom,
359  debug, ignoreTransition);
360  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
361  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
362  vdets.push_back(vdetW[i1]);
363  dirs.push_back(dir[0]);
364  jetaE.push_back(0);
365  jetaW.push_back(0);
366  jphiN.push_back(iphiN[0]);
367  jphiS.push_back(iphiS[0]);
368  }
369  }
370  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
371  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
372  vdets.push_back(vdetE[i1]);
373  dirs.push_back(dir[0]);
374  jetaE.push_back(0);
375  jetaW.push_back(0);
376  jphiN.push_back(iphiN[0]);
377  jphiS.push_back(iphiS[0]);
378  }
379  }
380 #ifdef EDM_ML_DEBUG
381  if (debug) {
382  std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
383  << (vdets.size()-dets.size()) << " new cells" << std::endl;
384  spr::debugEcalDets(dets.size(), vdets, dirs);
385  }
386 #endif
387  }
388 
389  unsigned int last0 = vdets.size();
390  std::vector<DetId> vdetnew;
391  std::vector<CaloDirection> dirnew;
392  std::vector<int> kphiN, kphiS, ketaE, ketaW;
393  int kphi = 0;
394  for (unsigned int i1=last; i1<dets.size(); i1++) {
395  int iphi = iphiS[i1];
396  if (dir[i1] == NORTH) iphi = iphiN[i1];
397  if (iphi > 0) {
398  std::vector<DetId> vdetn(1);
399  std::vector<CaloDirection> dirn(1);
400  std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
401  int flag=0;
402  std::vector<DetId> cells;
403  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
404  barrelGeom, endcapGeom, cells, flag,
405  debug, ignoreTransition);
406  iphi--;
407  if (iphi > kphi) kphi = iphi;
408  if (dir[i1] == NORTH) jphiN[i1] = iphi;
409  else jphiS[i1] = iphi;
410  if (flag != 0) {
411  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
412  int kfiN = iphiN[i1];
413  int kfiS = iphiS[i1];
414  vdetn[0] = cells[0];
415  vdetnew.push_back(vdetn[0]);
416  dirn[0] = dir[i1];
417  if (dir[i1] == NORTH) kfiN = iphi;
418  else kfiS = iphi;
419  if (flag < 0) {
420  int ktmp = kfiS; kfiS = kfiN; kfiN = ktmp;
421  if (dirn[0] == NORTH) dirn[0] = SOUTH;
422  else dirn[0] = NORTH;
423  }
424  dirnew.push_back(dirn[0]);
425  kphiN.push_back(kfiN); ketaE.push_back(ietaE[i1]);
426  kphiS.push_back(kfiS); ketaW.push_back(ietaW[i1]);
427  std::vector<int> ietE(1,ietaE[i1]), ietW(1,ietaW[i1]);
428  vdetE = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnE, barrelTopo,
429  endcapTopo, barrelGeom, endcapGeom,
430  debug, ignoreTransition);
431  vdetW = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnW, barrelTopo,
432  endcapTopo, barrelGeom, endcapGeom,
433  debug, ignoreTransition);
434  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
435  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
436  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
437  vdets.push_back(vdetW[i2]);
438  dirs.push_back(dirn[0]);
439  jetaE.push_back(0); jphiN.push_back(kfiN);
440  jetaW.push_back(0); jphiS.push_back(kfiS);
441  }
442  }
443  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
444  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
445  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
446  vdets.push_back(vdetE[i2]);
447  dirs.push_back(dirn[0]);
448  jetaE.push_back(0); jphiN.push_back(kfiN);
449  jetaW.push_back(0); jphiS.push_back(kfiS);
450  }
451  }
452  }
453  }
454  }
455  }
456  last = vdets.size();
457  for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
458  if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
459  vdets.push_back(vdetnew[i2]);
460  dirs.push_back(dirnew[i2]);
461  jetaE.push_back(ketaE[i2]);
462  jetaW.push_back(ketaW[i2]);
463  jphiN.push_back(kphiN[i2]);
464  jphiS.push_back(kphiS[i2]);
465  }
466  }
467 #ifdef EDM_ML_DEBUG
468  if (debug) {
469  std::cout << "newECALIdNS::Addition results a set of "
470  << (vdets.size()-last0) << " new cells (last " << last0
471  << ", iphi " << kphi << ")" << std::endl;
472  for (unsigned int i1=last0; i1<vdets.size(); i1++) {
473  spr::debugEcalDets (i1, vdets[i1], false);
474  std::cout << " along " << dirs[i1] << " iphi " << jphiN[i1] << "|"
475  << jphiS[i1] << " ieta " << jetaE[i1] << "|" << jetaW[i1]
476  << std::endl;
477  }
478  }
479 #endif
480  last0 = last;
481 
482  if (kphi > 0) {
483  last = last0;
484  return spr::newECALIdNS(vdets, last, jetaE, jetaW, jphiN, jphiS, dirs,
485  barrelTopo, endcapTopo, barrelGeom, endcapGeom,
486  debug, ignoreTransition);
487  } else {
488 #ifdef EDM_ML_DEBUG
489  if (debug) {
490  std::cout << "newECALIdNS::Final list consists of " << vdets.size()
491  << " cells" << std::endl;
492  spr::debugEcalDets (0, vdets);
493  }
494 #endif
495  return vdets;
496  }
497  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
dbl *** dir
Definition: mlp_gen.cc:35
std::vector< DetId > spr::newHCALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftEast,
int  ieta,
bool  debug = false 
)

Definition at line 290 of file MatrixHCALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugHcalDets(), HcalTopology::east(), plotBeamSpotDB::last, and HcalTopology::west().

Referenced by newHCALIdEW(), and newHCALIdNS().

292  {
293 
294 #ifdef EDM_ML_DEBUG
295  if (debug) {
296  std::cout << "newHCALIdEW::Add " << ieta << " rows of cells along "
297  << shiftEast << " for " << (dets.size()-last) << " cells"
298  << std::endl;
299  spr::debugHcalDets(last, dets);
300  }
301 #endif
302  std::vector<DetId> vdets;
303  vdets.insert(vdets.end(), dets.begin(), dets.end());
304  if (ieta > 0) {
305  for (unsigned int i1=last; i1<dets.size(); i1++) {
306  std::vector<DetId> vdet;
307  if (shiftEast) vdet = topology->east(dets[i1]);
308  else vdet = topology->west(dets[i1]);
309  for (unsigned int i2=0; i2<vdet.size(); i2++) {
310  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
311  vdets.push_back(vdet[i2]);
312  }
313  }
314  ieta--;
315  }
316 
317 #ifdef EDM_ML_DEBUG
318  if (debug) {
319  std::cout << "newHCALIdEW::Addition results a set of "
320  << (vdets.size()-dets.size()) << " new cells" << std::endl;
321  spr::debugHcalDets(dets.size(), vdets);
322  }
323 #endif
324  if (ieta > 0) {
325  last = dets.size();
326  return spr::newHCALIdEW(vdets, last, topology, shiftEast, ieta, debug);
327  } else {
328 #ifdef EDM_ML_DEBUG
329  if (debug) {
330  std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
331  << " cells" << std::endl;
332  spr::debugHcalDets(0, vdets);
333  }
334 #endif
335  return vdets;
336  }
337  }
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
virtual std::vector< DetId > west(const DetId &id) const
#define debug
Definition: HDRShower.cc:19
virtual std::vector< DetId > east(const DetId &id) const
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftEast,
int  ietaE,
int  ietaW,
bool  debug = false 
)

Definition at line 339 of file MatrixHCALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugHcalDets(), HcalTopology::east(), plotBeamSpotDB::last, newHCALIdEW(), and HcalTopology::west().

341  {
342 
343 #ifdef EDM_ML_DEBUG
344  if (debug) {
345  std::cout << "newHCALIdEW::Add " << ietaE << "|" << ietaW
346  << " rows of cells along " << shiftEast << " for "
347  << (dets.size()-last) << " cells" << std::endl;
348  spr::debugHcalDets(last, dets);
349  }
350 #endif
351  int ieta = ietaW;
352  if (shiftEast) ieta = ietaE;
353  std::vector<DetId> vdets;
354  vdets.insert(vdets.end(), dets.begin(), dets.end());
355  if (ieta > 0) {
356  for (unsigned int i1=last; i1<dets.size(); i1++) {
357  std::vector<DetId> vdet;
358  if (shiftEast) vdet = topology->east(dets[i1]);
359  else vdet = topology->west(dets[i1]);
360  for (unsigned int i2=0; i2<vdet.size(); i2++) {
361  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
362  vdets.push_back(vdet[i2]);
363  }
364  }
365  ieta--;
366  }
367  if (shiftEast) ietaE = ieta;
368  else ietaW = ieta;
369 
370 #ifdef EDM_ML_DEBUG
371  if (debug) {
372  std::cout << "newHCALIdEW::Addition results a set of "
373  << (vdets.size()-dets.size()) << " new cells" << std::endl;
374  spr::debugHcalDets(dets.size(), vdets);
375  }
376 #endif
377  if (ieta > 0) {
378  last = dets.size();
379  return spr::newHCALIdEW(vdets,last,topology,shiftEast,ietaE,ietaW,debug);
380  } else {
381 #ifdef EDM_ML_DEBUG
382  if (debug) {
383  std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
384  << " cells" << std::endl;
385  spr::debugHcalDets(0, vdets);
386  }
387 #endif
388  return vdets;
389  }
390  }
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
virtual std::vector< DetId > west(const DetId &id) const
#define debug
Definition: HDRShower.cc:19
virtual std::vector< DetId > east(const DetId &id) const
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftNorth,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 112 of file MatrixHCALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugHcalDets(), plotBeamSpotDB::last, newHCALIdEW(), HcalTopology::north(), and HcalTopology::south().

Referenced by matrixHCALIds(), and newHCALIdNS().

114  {
115 
116 #ifdef EDM_ML_DEBUG
117  if (debug) {
118  std::cout << "newHCALIdNS::Add " << iphi << " columns of cells along "
119  << shiftNorth << " for " << (dets.size()-last) << " cells"
120  << std::endl;
121  spr::debugHcalDets(last, dets);
122  }
123 #endif
124  std::vector<DetId> vdets;
125  vdets.insert(vdets.end(), dets.begin(), dets.end());
126  std::vector<DetId> vdetE, vdetW;
127  if (last == 0) {
128  vdetE = spr::newHCALIdEW(dets, last, topology, true, ieta, debug);
129  vdetW = spr::newHCALIdEW(dets, last, topology, false, ieta, debug);
130  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
131  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
132  vdets.push_back(vdetW[i1]);
133  }
134  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
135  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
136  vdets.push_back(vdetE[i1]);
137  }
138 #ifdef EDM_ML_DEBUG
139  if (debug) {
140  std::cout <<"newHCALIdNS::With Added cells along E/W results a set of "
141  << (vdets.size()-dets.size()) << " new cells" << std::endl;
142  spr::debugHcalDets(dets.size(), vdets);
143  }
144 #endif
145  }
146  unsigned int last0 = vdets.size();
147  if (iphi > 0) {
148  std::vector<DetId> vdetnew;
149  for (unsigned int i1=last; i1<dets.size(); i1++) {
150  std::vector<DetId> vdet;
151  if (shiftNorth) vdet = topology->north(dets[i1]);
152  else vdet = topology->south(dets[i1]);
153  for (unsigned int i2=0; i2<vdet.size(); i2++) {
154  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
155  vdetnew.push_back(vdet[i2]);
156  }
157  }
158  iphi--;
159  vdetE = spr::newHCALIdEW(vdetnew, 0, topology, true, ieta, debug);
160  vdetW = spr::newHCALIdEW(vdetnew, 0, topology, false, ieta, debug);
161  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
162  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
163  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
164  vdets.push_back(vdetW[i2]);
165  }
166  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
167  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
168  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
169  vdets.push_back(vdetE[i2]);
170  }
171  last = vdets.size();
172  vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
173 #ifdef EDM_ML_DEBUG
174  if (debug) {
175  std::cout << "newHCALIdNS::Addition results a set of "
176  << (vdets.size()-last0) << " new cells" << std::endl;
177  spr::debugHcalDets(last0, vdets);
178  }
179 #endif
180  last0 = last;
181  }
182 
183  if (iphi > 0) {
184  last = last0;
185  return spr::newHCALIdNS(vdets,last,topology,shiftNorth,ieta,iphi,debug);
186  } else {
187 #ifdef EDM_ML_DEBUG
188  if (debug) {
189  std::cout << "newHCALIdNS::Final list consists of " << vdets.size()
190  << " cells" << std::endl;
191  spr::debugHcalDets(0, vdets);
192  }
193 #endif
194  return vdets;
195  }
196  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
virtual std::vector< DetId > south(const DetId &id) const
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
virtual std::vector< DetId > north(const DetId &id) const
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftNorth,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  debug = false 
)

Definition at line 198 of file MatrixHCALDetIds.cc.

References KineDebug3::count(), gather_cfg::cout, debugHcalDets(), plotBeamSpotDB::last, newHCALIdEW(), newHCALIdNS(), HcalTopology::north(), and HcalTopology::south().

201  {
202 
203 #ifdef EDM_ML_DEBUG
204  if (debug) {
205  std::cout << "newHCALIdNS::Add " << iphiN << "|" << iphiS
206  << " columns of cells along " << shiftNorth << " for "
207  << (dets.size()-last) << " cells" << std::endl;
208  spr::debugHcalDets(last, dets);
209  }
210 #endif
211  std::vector<DetId> vdets;
212  vdets.insert(vdets.end(), dets.begin(), dets.end());
213  std::vector<DetId> vdetE, vdetW;
214  if (last == 0) {
215  vdetE = spr::newHCALIdEW(dets,last, topology, true, ietaE,ietaW, debug);
216  vdetW = spr::newHCALIdEW(dets,last, topology, false, ietaE,ietaW, debug);
217  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
218  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
219  vdets.push_back(vdetW[i1]);
220  }
221  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
222  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
223  vdets.push_back(vdetE[i1]);
224  }
225 #ifdef EDM_ML_DEBUG
226  if (debug) {
227  std::cout <<"newHCALIdNS::With Added cells along E/W results a set of "
228  << (vdets.size()-dets.size()) << " new cells" << std::endl;
229  spr::debugHcalDets(dets.size(), vdets);
230  }
231 #endif
232  }
233  unsigned int last0 = vdets.size();
234  int iphi = iphiS;
235  if (shiftNorth) iphi = iphiN;
236  if (iphi > 0) {
237  std::vector<DetId> vdetnew;
238  for (unsigned int i1=last; i1<dets.size(); i1++) {
239  std::vector<DetId> vdet;
240  if (shiftNorth) vdet = topology->north(dets[i1]);
241  else vdet = topology->south(dets[i1]);
242  for (unsigned int i2=0; i2<vdet.size(); i2++) {
243  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
244  vdetnew.push_back(vdet[i2]);
245  }
246  }
247  iphi--;
248  vdetE = spr::newHCALIdEW(vdetnew,0, topology, true, ietaE,ietaW, debug);
249  vdetW = spr::newHCALIdEW(vdetnew,0, topology, false, ietaE,ietaW, debug);
250  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
251  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
252  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
253  vdets.push_back(vdetW[i2]);
254  }
255  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
256  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
257  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
258  vdets.push_back(vdetE[i2]);
259  }
260  last = vdets.size();
261  vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
262 #ifdef EDM_ML_DEBUG
263  if (debug) {
264  std::cout << "newHCALIdNS::Addition results a set of "
265  << (vdets.size()-last0) << " new cells" << std::endl;
266  spr::debugHcalDets(last0, vdets);
267  }
268 #endif
269  last0 = last;
270  }
271  if (shiftNorth) iphiN = iphi;
272  else iphiS = iphi;
273 
274  if (iphi > 0) {
275  last = last0;
276  return spr::newHCALIdNS(vdets,last,topology,shiftNorth,ietaE,ietaW,
277  iphiN,iphiS,debug);
278  } else {
279 #ifdef EDM_ML_DEBUG
280  if (debug) {
281  std::cout << "newHCALIdNS::Final list consists of " << vdets.size()
282  << " cells" << std::endl;
283  spr::debugHcalDets(0, vdets);
284  }
285 #endif
286  return vdets;
287  }
288  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
virtual std::vector< DetId > south(const DetId &id) const
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
virtual std::vector< DetId > north(const DetId &id) const
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
edm::SimTrackContainer::const_iterator spr::parentSimTrack ( edm::SimTrackContainer::const_iterator  thisTrkItr,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 179 of file MatchingSimTrack.cc.

References begin, gather_cfg::cout, createfilelist::int, and class-composition::parent.

Referenced by matchedSimTrackInfo().

179  {
180 
181  edm::SimTrackContainer::const_iterator itr = SimTk->end();
182 
183  int vertIndex = thisTrkItr->vertIndex();
184 #ifdef EDM_ML_DEBUG
185  if (debug) std::cout << "SimTrackParent " << thisTrkItr->trackId() << " Vertex " << vertIndex << " Type " << thisTrkItr->type() << " Charge " << (int)thisTrkItr->charge() << std::endl;
186 #endif
187  if( vertIndex == -1 ) return thisTrkItr;
188  else if (vertIndex >= (int)SimVtx->size()) return itr;
189 
190  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
191  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
192  int parent = simVtxItr->parentIndex();
193 
194  if (parent < 0 && simVtxItr != SimVtx->begin()) {
195  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
196  for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
197  if (simVtxItr->parentIndex() > 0) {
198  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
199  double dist = pos2.P();
200  if (dist < 0.001) {
201  parent = simVtxItr->parentIndex();
202  break;
203  }
204  }
205  }
206  }
207  for (edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
208  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
209  }
210 
211  return thisTrkItr;
212  }
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
#define debug
Definition: HDRShower.cc:19
#define begin
Definition: vmac.h:30
edm::SimTrackContainer::const_iterator parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
std::vector< spr::propagatedTrackID > spr::propagateCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 118 of file CaloPropagateTrack.cc.

Referenced by ElectronStudy::analyze(), HcalHBHEMuonSimAnalyzer::analyze(), HcalRaddamMuon::analyze(), HcalHBHEMuonAnalyzer::analyze(), StudyHLT::analyze(), IsoTrackCalibration::analyze(), IsoTrackCalib::analyze(), IsolatedGenParticles::analyze(), IsolatedTracksHcalScale::analyze(), IsolatedTracksNxN::analyze(), IsoTrig::chgIsolation(), AlCaHBHEMuonFilter::filter(), AlCaIsoTracksFilter::filter(), IsoTrig::getGoodTracks(), AlCaIsoTracksProducer::select(), IsoTrig::studyIsolation(), IsoTrig::studyMipCut(), and IsoTrig::StudyTrkEbyP().

118  {
119 
120  std::vector<spr::propagatedTrackID> vdets;
121  spr::propagateCALO(trkCollection,geo,bField,theTrackQuality, vdets, debug);
122  return vdets;
123  }
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
#define debug
Definition: HDRShower.cc:19
void spr::propagateCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
std::vector< spr::propagatedTrackID > &  vdets,
bool  debug = false 
)

Definition at line 125 of file CaloPropagateTrack.cc.

References funct::abs(), gather_cfg::cout, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, spr::propagatedTrackID::etaECAL, spr::propagatedTrackID::etaHCAL, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, mps_fire::i, info(), spr::propagatedTrackID::ok, spr::propagatedTrackID::okECAL, spr::propagatedTrackID::okHCAL, spr::propagatedTrackID::phiECAL, spr::propagatedTrackID::phiHCAL, point, propagateECAL(), propagateHCAL(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), DetId::subdetId(), and spr::propagatedTrackID::trkItr.

125  {
126 
127  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
128  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
130  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
131 
132  unsigned int indx;
133  reco::TrackCollection::const_iterator trkItr;
134  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
135  const reco::Track* pTrack = &(*trkItr);
137  vdet.trkItr = trkItr;
138  vdet.ok = (pTrack->quality(trackQuality_));
139  vdet.detIdECAL = DetId(0);
140  vdet.detIdHCAL = DetId(0);
141  vdet.detIdEHCAL= DetId(0);
142 #ifdef EDM_ML_DEBUG
143  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << vdet.ok << std::endl;
144 #endif
145  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
146  vdet.okECAL = info.second;
147  if (vdet.okECAL) {
148  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
149  vdet.etaECAL = point.eta();
150  vdet.phiECAL = point.phi();
151  if (std::abs(point.eta())<spr::etaBEEcal) {
152  vdet.detIdECAL = barrelGeom->getClosestCell(point);
153  } else {
154  vdet.detIdECAL = endcapGeom->getClosestCell(point);
155  }
156  vdet.detIdEHCAL = gHB->getClosestCell(point);
157  }
158  info = spr::propagateHCAL (pTrack, bField, debug);
159  vdet.okHCAL = info.second;
160  if (vdet.okHCAL) {
161  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
162  vdet.etaHCAL = point.eta();
163  vdet.phiHCAL = point.phi();
164  vdet.detIdHCAL = gHB->getClosestCell(point);
165  }
166 #ifdef EDM_ML_DEBUG
167  if (debug) {
168  std::cout << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL ("
169  << vdet.okECAL << ") ";
170  if (vdet.detIdECAL.subdetId() == EcalBarrel)
171  std::cout << (EBDetId)(vdet.detIdECAL);
172  else
173  std::cout << (EEDetId)(vdet.detIdECAL);
174  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
175  }
176 #endif
177  vdets.push_back(vdet);
178  }
179 
180 #ifdef EDM_ML_DEBUG
181  if (debug) {
182  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
183  for (unsigned int i=0; i<vdets.size(); ++i) {
184  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
185  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
186  std::cout << (EBDetId)(vdets[i].detIdECAL);
187  } else {
188  std::cout << (EEDetId)(vdets[i].detIdECAL);
189  }
190  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
191  }
192  }
193 #endif
194  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
TrackQuality
track quality
Definition: TrackBase.h:151
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
reco::TrackCollection::const_iterator trkItr
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
void spr::propagateCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
std::vector< spr::propagatedTrackDirection > &  trkDir,
bool  debug = false 
)

Definition at line 196 of file CaloPropagateTrack.cc.

References funct::abs(), gather_cfg::cout, spr::propagatedTrackDirection::detIdECAL, spr::propagatedTrackDirection::detIdEHCAL, spr::propagatedTrackDirection::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedTrackDirection::directionECAL, spr::propagatedTrackDirection::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, mps_fire::i, info(), spr::propagatedTrack::ok, spr::propagatedTrackDirection::ok, spr::propagatedTrackDirection::okECAL, spr::propagatedTrackDirection::okHCAL, point, spr::propagatedTrack::point, spr::propagatedTrackDirection::pointECAL, spr::propagatedTrackDirection::pointHCAL, propagateTrackToECAL(), propagateTrackToHCAL(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and spr::propagatedTrackDirection::trkItr.

196  {
197 
198  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
199  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
201  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
202 
203  unsigned int indx;
204  reco::TrackCollection::const_iterator trkItr;
205  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
206  const reco::Track* pTrack = &(*trkItr);
208  trkD.trkItr = trkItr;
209  trkD.ok = (pTrack->quality(trackQuality_));
210  trkD.detIdECAL = DetId(0);
211  trkD.detIdHCAL = DetId(0);
212  trkD.detIdEHCAL= DetId(0);
213 #ifdef EDM_ML_DEBUG
214  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << trkD.ok << std::endl;
215 #endif
217  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
218  trkD.okECAL = info.ok;
219  trkD.pointECAL = point;
220  trkD.directionECAL = info.direction;
221  if (trkD.okECAL) {
222  if (std::abs(info.point.eta())<spr::etaBEEcal) {
223  trkD.detIdECAL = barrelGeom->getClosestCell(point);
224  } else {
225  trkD.detIdECAL = endcapGeom->getClosestCell(point);
226  }
227  trkD.detIdEHCAL = gHB->getClosestCell(point);
228  }
229  info = spr::propagateTrackToHCAL (pTrack, bField, debug);
230  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
231  trkD.okHCAL = info.ok;
232  trkD.pointHCAL = point;
233  trkD.directionHCAL = info.direction;
234  if (trkD.okHCAL) {
235  trkD.detIdHCAL = gHB->getClosestCell(point);
236  }
237  trkDir.push_back(trkD);
238  }
239 
240 #ifdef EDM_ML_DEBUG
241  if (debug) {
242  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
243  for (unsigned int i=0; i<trkDir.size(); ++i) {
244  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
245  if (trkDir[i].okECAL) {
246  std::cout << " point " << trkDir[i].pointECAL << " direction "
247  << trkDir[i].directionECAL << " ";
248  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
249  std::cout << (EBDetId)(trkDir[i].detIdECAL);
250  } else {
251  std::cout << (EEDetId)(trkDir[i].detIdECAL);
252  }
253  }
254  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
255  if (trkDir[i].okHCAL) {
256  std::cout << " point " << trkDir[i].pointHCAL << " direction "
257  << trkDir[i].directionHCAL << " "
258  << (HcalDetId)(trkDir[i].detIdHCAL);
259  }
260  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
261  }
262  }
263 #endif
264  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
TrackQuality
track quality
Definition: TrackBase.h:151
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
spr::propagatedTrack propagateTrackToECAL(const reco::Track *, const MagneticField *, bool debug=false)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
reco::TrackCollection::const_iterator trkItr
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::propagatedTrackID spr::propagateCALO ( const reco::Track pTrack,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 266 of file CaloPropagateTrack.cc.

References funct::abs(), gather_cfg::cout, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, reco::TrackBase::eta(), etaBEEcal, spr::propagatedTrackID::etaECAL, spr::propagatedTrackID::etaHCAL, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, info(), spr::propagatedTrackID::ok, spr::propagatedTrackID::okECAL, spr::propagatedTrackID::okHCAL, reco::TrackBase::p(), reco::TrackBase::phi(), spr::propagatedTrackID::phiECAL, spr::propagatedTrackID::phiHCAL, point, propagateECAL(), propagateHCAL(), and DetId::subdetId().

266  {
267 
268  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
269  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
271 
273  vdet.ok = true;
274  vdet.detIdECAL = DetId(0);
275  vdet.detIdHCAL = DetId(0);
276  vdet.detIdEHCAL= DetId(0);
277 #ifdef EDM_ML_DEBUG
278  if (debug) std::cout << "Propagate track: p " << pTrack->p() << " eta " << pTrack->eta() << " phi " << pTrack->phi() << " Flag " << vdet.ok << std::endl;
279 #endif
280  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
281  vdet.okECAL = info.second;
282  if (vdet.okECAL) {
283  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
284  vdet.etaECAL = point.eta();
285  vdet.phiECAL = point.phi();
286  if (std::abs(point.eta())<spr::etaBEEcal) {
287  vdet.detIdECAL = barrelGeom->getClosestCell(point);
288  } else {
289  vdet.detIdECAL = endcapGeom->getClosestCell(point);
290  }
291  vdet.detIdEHCAL = gHB->getClosestCell(point);
292  }
293  info = spr::propagateHCAL (pTrack, bField, debug);
294  vdet.okHCAL = info.second;
295  if (vdet.okHCAL) {
296  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
297  vdet.etaHCAL = point.eta();
298  vdet.phiHCAL = point.phi();
299  vdet.detIdHCAL = gHB->getClosestCell(point);
300  }
301 
302 #ifdef EDM_ML_DEBUG
303  if (debug) {
304  std::cout << "propagateCALO:: for 1 track" << std::endl;
305  std::cout << "Track [0] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
306  if (vdet.detIdECAL.subdetId() == EcalBarrel) {
307  std::cout << (EBDetId)(vdet.detIdECAL);
308  } else {
309  std::cout << (EEDetId)(vdet.detIdECAL);
310  }
311  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
312  }
313 #endif
314  return vdet;
315  }
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
std::vector< spr::propagatedGenTrackID > spr::propagateCALO ( const HepMC::GenEvent *  genEvent,
edm::ESHandle< ParticleDataTable > &  pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

Definition at line 317 of file CaloPropagateTrack.cc.

References funct::abs(), spr::propagatedGenTrackID::charge, gather_cfg::cout, spr::propagatedGenTrackID::detIdECAL, spr::propagatedGenTrackID::detIdEHCAL, spr::propagatedGenTrackID::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedGenTrackID::directionECAL, spr::propagatedGenTrackID::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, mps_fire::i, info(), spr::propagatedTrack::ok, spr::propagatedGenTrackID::ok, spr::propagatedGenTrackID::okECAL, spr::propagatedGenTrackID::okHCAL, AlCaHLTBitMon_ParallelJobs::p, spr::propagatedGenTrackID::pdgId, point, spr::propagatedTrack::point, spr::propagatedGenTrackID::pointECAL, spr::propagatedGenTrackID::pointHCAL, propagateCalo(), rFrontEB, rFrontHB, spr::propagatedGenTrackID::trkItr, zFrontEE, and zFrontHE.

317  {
318 
319  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
320  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
322 
323  std::vector<spr::propagatedGenTrackID> trkDir;
324  unsigned int indx;
325  HepMC::GenEvent::particle_const_iterator p;
326  for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++p,++indx) {
328  trkD.trkItr = p;
329  trkD.detIdECAL = DetId(0);
330  trkD.detIdHCAL = DetId(0);
331  trkD.detIdEHCAL= DetId(0);
332  trkD.pdgId = ((*p)->pdg_id());
333  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge())/3;
334  GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
335 #ifdef EDM_ML_DEBUG
336  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
337 #endif
338  // consider stable particles
339  if ( (*p)->status()==1 && std::abs((*p)->momentum().eta()) < etaMax ) {
340  GlobalPoint vertex = GlobalPoint(0.1*(*p)->production_vertex()->position().x(),
341  0.1*(*p)->production_vertex()->position().y(),
342  0.1*(*p)->production_vertex()->position().z());
343  trkD.ok = true;
345  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
346  trkD.okECAL = info.ok;
347  trkD.pointECAL = point;
348  trkD.directionECAL = info.direction;
349  if (trkD.okECAL) {
350  if (std::abs(info.point.eta())<spr::etaBEEcal) {
351  trkD.detIdECAL = barrelGeom->getClosestCell(point);
352  } else {
353  trkD.detIdECAL = endcapGeom->getClosestCell(point);
354  }
355  trkD.detIdEHCAL = gHB->getClosestCell(point);
356  }
357 
358  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
359  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
360  trkD.okHCAL = info.ok;
361  trkD.pointHCAL = point;
362  trkD.directionHCAL = info.direction;
363  if (trkD.okHCAL) {
364  trkD.detIdHCAL = gHB->getClosestCell(point);
365  }
366  }
367  trkDir.push_back(trkD);
368  }
369 
370 #ifdef EDM_ML_DEBUG
371  if (debug) {
372  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
373  for (unsigned int i=0; i<trkDir.size(); ++i) {
374  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
375  if (trkDir[i].okECAL) {
376  std::cout << " point " << trkDir[i].pointECAL << " direction "
377  << trkDir[i].directionECAL << " ";
378  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
379  std::cout << (EBDetId)(trkDir[i].detIdECAL);
380  } else {
381  std::cout << (EEDetId)(trkDir[i].detIdECAL);
382  }
383  }
384  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
385  if (trkDir[i].okHCAL) {
386  std::cout << " point " << trkDir[i].pointHCAL << " direction "
387  << trkDir[i].directionHCAL << " "
388  << (HcalDetId)(trkDir[i].detIdHCAL);
389  }
390  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
391  }
392  }
393 #endif
394  return trkDir;
395  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
virtual DetId getClosestCell(const GlobalPoint &r) const
static const double zFrontHE
Definition: CaloConstants.h:13
uint32_t ID
Definition: Definitions.h:26
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
genEvent
Definition: MCTruth.py:33
HepMC::GenEvent::particle_const_iterator trkItr
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::vector< spr::propagatedGenParticleID > spr::propagateCALO ( edm::Handle< reco::GenParticleCollection > &  genParticles,
edm::ESHandle< ParticleDataTable > &  pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

Definition at line 397 of file CaloPropagateTrack.cc.

References funct::abs(), spr::propagatedGenParticleID::charge, gather_cfg::cout, spr::propagatedGenParticleID::detIdECAL, spr::propagatedGenParticleID::detIdEHCAL, spr::propagatedGenParticleID::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedGenParticleID::directionECAL, spr::propagatedGenParticleID::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, PV3DBase< T, PVType, FrameType >::eta(), etaBEEcal, etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, mps_fire::i, info(), spr::propagatedTrack::ok, spr::propagatedGenParticleID::ok, spr::propagatedGenParticleID::okECAL, spr::propagatedGenParticleID::okHCAL, AlCaHLTBitMon_ParallelJobs::p, spr::propagatedGenParticleID::pdgId, point, spr::propagatedTrack::point, spr::propagatedGenParticleID::pointECAL, spr::propagatedGenParticleID::pointHCAL, propagateCalo(), rFrontEB, rFrontHB, spr::propagatedGenParticleID::trkItr, zFrontEE, and zFrontHE.

397  {
398 
399  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
400  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
402 
403  std::vector<spr::propagatedGenParticleID> trkDir;
404  unsigned int indx;
405  reco::GenParticleCollection::const_iterator p;
406  for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++p,++indx) {
408  trkD.trkItr = p;
409  trkD.detIdECAL = DetId(0);
410  trkD.detIdHCAL = DetId(0);
411  trkD.detIdEHCAL= DetId(0);
412  trkD.pdgId = (p->pdgId());
413  trkD.charge = p->charge();
414  GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
415 #ifdef EDM_ML_DEBUG
416  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
417 #endif
418  // consider stable particles
419  if ( p->status()==1 && std::abs(momentum.eta()) < etaMax ) {
420  GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
421  trkD.ok = true;
423  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
424  trkD.okECAL = info.ok;
425  trkD.pointECAL = point;
426  trkD.directionECAL = info.direction;
427  if (trkD.okECAL) {
428  if (std::abs(info.point.eta())<spr::etaBEEcal) {
429  trkD.detIdECAL = barrelGeom->getClosestCell(point);
430  } else {
431  trkD.detIdECAL = endcapGeom->getClosestCell(point);
432  }
433  trkD.detIdEHCAL = gHB->getClosestCell(point);
434  }
435 
436  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
437  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
438  trkD.okHCAL = info.ok;
439  trkD.pointHCAL = point;
440  trkD.directionHCAL = info.direction;
441  if (trkD.okHCAL) {
442  trkD.detIdHCAL = gHB->getClosestCell(point);
443  }
444  }
445  trkDir.push_back(trkD);
446  }
447 
448 #ifdef EDM_ML_DEBUG
449  if (debug) {
450  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
451  for (unsigned int i=0; i<trkDir.size(); ++i) {
452  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
453  if (trkDir[i].okECAL) {
454  std::cout << " point " << trkDir[i].pointECAL << " direction "
455  << trkDir[i].directionECAL << " ";
456  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
457  std::cout << (EBDetId)(trkDir[i].detIdECAL);
458  } else {
459  std::cout << (EEDetId)(trkDir[i].detIdECAL);
460  }
461  }
462  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
463  if (trkDir[i].okHCAL) {
464  std::cout << " point " << trkDir[i].pointHCAL << " direction "
465  << trkDir[i].directionHCAL << " "
466  << (HcalDetId)(trkDir[i].detIdHCAL);
467  }
468  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
469  }
470  }
471 #endif
472  return trkDir;
473  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
virtual DetId getClosestCell(const GlobalPoint &r) const
reco::GenParticleCollection::const_iterator trkItr
static const double zFrontHE
Definition: CaloConstants.h:13
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
T eta() const
Definition: PV3DBase.h:76
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
spr::propagatedTrackDirection spr::propagateCALO ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 475 of file CaloPropagateTrack.cc.

References funct::abs(), spr::trackAtOrigin::charge, gather_cfg::cout, spr::propagatedTrackDirection::detIdECAL, spr::propagatedTrackDirection::detIdEHCAL, spr::propagatedTrackDirection::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedTrackDirection::directionECAL, spr::propagatedTrackDirection::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, info(), spr::trackAtOrigin::momentum, spr::propagatedTrack::ok, spr::propagatedTrackDirection::ok, spr::trackAtOrigin::ok, spr::propagatedTrackDirection::okECAL, spr::propagatedTrackDirection::okHCAL, point, spr::propagatedTrack::point, spr::propagatedTrackDirection::pointECAL, spr::propagatedTrackDirection::pointHCAL, spr::trackAtOrigin::position, propagateCalo(), rFrontEB, rFrontHB, simTrackAtOrigin(), DetId::subdetId(), zFrontEE, and zFrontHE.

475  {
476 
477  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
478  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
480 
481  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
483  trkD.ok = trk.ok;
484  trkD.detIdECAL = DetId(0);
485  trkD.detIdHCAL = DetId(0);
486  trkD.detIdEHCAL= DetId(0);
487 #ifdef EDM_ML_DEBUG
488  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
489 #endif
490  if (trkD.ok) {
492  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
493  trkD.okECAL = info.ok;
494  trkD.pointECAL = point;
495  trkD.directionECAL = info.direction;
496  if (trkD.okECAL) {
497  if (std::abs(info.point.eta())<spr::etaBEEcal) {
498  trkD.detIdECAL = barrelGeom->getClosestCell(point);
499  } else {
500  trkD.detIdECAL = endcapGeom->getClosestCell(point);
501  }
502  trkD.detIdEHCAL = gHB->getClosestCell(point);
503  }
504 
506  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
507  trkD.okHCAL = info.ok;
508  trkD.pointHCAL = point;
509  trkD.directionHCAL = info.direction;
510  if (trkD.okHCAL) {
511  trkD.detIdHCAL = gHB->getClosestCell(point);
512  }
513  }
514 
515 #ifdef EDM_ML_DEBUG
516  if (debug) {
517  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
518  if (trkD.okECAL) {
519  std::cout << "ECAL point " << trkD.pointECAL << " direction "
520  << trkD.directionECAL << " ";
521  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
522  std::cout << (EBDetId)(trkD.detIdECAL);
523  } else {
524  std::cout << (EEDetId)(trkD.detIdECAL);
525  }
526  }
527  if (trkD.okHCAL) {
528  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
529  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
530  }
531  if (trkD.okECAL) std::cout << " Or " << (HcalDetId)(trkD.detIdEHCAL);
532  std::cout << std::endl;
533  }
534 #endif
535  return trkD;
536  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
virtual DetId getClosestCell(const GlobalPoint &r) const
static const double zFrontHE
Definition: CaloConstants.h:13
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::propagatedTrack spr::propagateCalo ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bField,
float  zdist,
float  radius,
float  corner,
bool  debug = false 
)

Definition at line 669 of file CaloPropagateTrack.cc.

References funct::abs(), alongMomentum, Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::build(), gather_cfg::cout, debug, spr::propagatedTrack::direction, PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), M_PI, spr::propagatedTrack::ok, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), spr::propagatedTrack::point, Propagator::propagate(), EnergyCorrector::pt, funct::sin(), mathSSE::sqrt(), HiIsolationCommonParameters_cff::track, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by propagateCALO(), propagateECAL(), propagateHCAL(), propagateHCALBack(), propagateTracker(), propagateTrackToECAL(), and propagateTrackToHCAL().

676  {
677 
679 #ifdef EDM_ML_DEBUG
680  if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
681 #endif
682  FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
683 
686 
688 
689  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
690 
692  if (tpMomentum.eta() < 0) {
693  tsose = myAP.propagate(fts, *lendcap);
694  } else {
695  tsose = myAP.propagate(fts, *rendcap);
696  }
697 
698  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
699 
700  track.ok=true;
701  if (tsose.isValid() && tsosb.isValid()) {
702  float absEta = std::abs(tsosb.globalPosition().eta());
703  if (absEta < corner) {
704  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
705  track.direction = tsosb.globalDirection();
706  } else {
707  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
708  track.direction = tsose.globalDirection();
709  }
710  } else if (tsose.isValid()) {
711  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
712  track.direction = tsose.globalDirection();
713  } else if (tsosb.isValid()) {
714  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
715  track.direction = tsosb.globalDirection();
716  } else {
717  track.point.SetXYZ(-999., -999., -999.);
718  track.direction = GlobalVector(0,0,1);
719  track.ok = false;
720  }
721 #ifdef EDM_ML_DEBUG
722  if (debug) {
723  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
724  if (track.ok) {
725  math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
726  double dphi = track.direction.phi()-tpMomentum.phi();
727  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
728  double pt = tpMomentum.perp();
729  double rat = 0.5*dphi/std::sin(0.5*dphi);
730  std::cout << "RDist " << rdist << " pt " << pt << " r/pt " << rdist*rat/pt << " zdist " << vDiff.z() << " pz " << tpMomentum.z() << " z/pz " << vDiff.z()/tpMomentum.z() << std::endl;
731  }
732  }
733 #endif
734  return track;
735  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
T sqrt(T t)
Definition: SSEVec.h:18
T phi() const
Definition: Phi.h:41
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T eta() const
Definition: PV3DBase.h:76
T x() const
Definition: PV3DBase.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector globalDirection() const
std::vector< spr::propagatedTrackID > spr::propagateCosmicCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 21 of file CaloPropagateTrack.cc.

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), gather_cfg::cout, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, spr::propagatedTrackID::etaECAL, spr::propagatedTrackID::etaHCAL, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, mps_fire::i, info(), reco::Track::innerMomentum(), reco::Track::innerPosition(), spr::propagatedTrackID::ok, spr::propagatedTrackID::okECAL, spr::propagatedTrackID::okHCAL, reco::Track::outerMomentum(), reco::Track::outerPosition(), spr::propagatedTrackID::phiECAL, spr::propagatedTrackID::phiHCAL, point, propagateECAL(), propagateHCAL(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), DetId::subdetId(), spr::propagatedTrackID::trkItr, X, DOFs::Y, and DOFs::Z.

21  {
22 
23  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
24  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
27  std::vector<spr::propagatedTrackID> vdets;
28 
29  unsigned int indx;
30  reco::TrackCollection::const_iterator trkItr;
31  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
32  const reco::Track* pTrack = &(*trkItr);
34  vdet.trkItr = trkItr;
35  vdet.ok = (pTrack->quality(trackQuality_));
36  vdet.detIdECAL = DetId(0);
37  vdet.detIdHCAL = DetId(0);
38  vdet.detIdEHCAL= DetId(0);
39 #ifdef EDM_ML_DEBUG
40  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << vdet.ok << std::endl;
41 #endif
42  GlobalPoint vertex;
43  GlobalVector momentum;
44  int charge (pTrack->charge());
45  if (((pTrack->innerPosition()).Perp2()) <
46  ((pTrack->outerPosition()).Perp2())) {
47  vertex = GlobalPoint(((pTrack->innerPosition()).X()),
48  ((pTrack->innerPosition()).Y()),
49  ((pTrack->innerPosition()).Z()));
50  momentum = GlobalVector(((pTrack->innerMomentum()).X()),
51  ((pTrack->innerMomentum()).Y()),
52  ((pTrack->innerMomentum()).Z()));
53  } else {
54  vertex = GlobalPoint(((pTrack->outerPosition()).X()),
55  ((pTrack->outerPosition()).Y()),
56  ((pTrack->outerPosition()).Z()));
57  momentum = GlobalVector(((pTrack->outerMomentum()).X()),
58  ((pTrack->outerMomentum()).Y()),
59  ((pTrack->outerMomentum()).Z()));
60  }
61 #ifdef EDM_ML_DEBUG
62  if (debug) std::cout << "Track charge " << charge << " p " << momentum << " position " << vertex << std::endl;
63 #endif
64  std::pair<math::XYZPoint,bool> info =
65  spr::propagateECAL (vertex, momentum, charge, bField, debug);
66 
67  vdet.okECAL = info.second;
68  if (vdet.okECAL) {
69  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
70  vdet.etaECAL = point.eta();
71  vdet.phiECAL = point.phi();
72  if (std::abs(point.eta())<spr::etaBEEcal) {
73  vdet.detIdECAL = barrelGeom->getClosestCell(point);
74  } else {
75  vdet.detIdECAL = endcapGeom->getClosestCell(point);
76  }
77  vdet.detIdEHCAL = gHB->getClosestCell(point);
78  }
79  info = spr::propagateHCAL (vertex, momentum, charge, bField, debug);
80  vdet.okHCAL = info.second;
81  if (vdet.okHCAL) {
82  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
83  vdet.etaHCAL = point.eta();
84  vdet.phiHCAL = point.phi();
85  vdet.detIdHCAL = gHB->getClosestCell(point);
86  }
87 #ifdef EDM_ML_DEBUG
88  if (debug) {
89  std::cout << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL ("
90  << vdet.okECAL << ") ";
91  if (vdet.detIdECAL.subdetId() == EcalBarrel)
92  std::cout << (EBDetId)(vdet.detIdECAL);
93  else
94  std::cout << (EEDetId)(vdet.detIdECAL);
95  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
96  }
97 #endif
98  vdets.push_back(vdet);
99  }
100 
101 #ifdef EDM_ML_DEBUG
102  if (debug) {
103  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
104  for (unsigned int i=0; i<vdets.size(); ++i) {
105  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
106  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
107  std::cout << (EBDetId)(vdets[i].detIdECAL);
108  } else {
109  std::cout << (EEDetId)(vdets[i].detIdECAL);
110  }
111  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
112  }
113  }
114 #endif
115  return vdets;
116  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
TrackQuality
track quality
Definition: TrackBase.h:151
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
#define X(str)
Definition: MuonsGrabber.cc:48
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
reco::TrackCollection::const_iterator trkItr
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:70
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:60
int charge() const
track electric charge
Definition: TrackBase.h:562
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 568 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

Referenced by chargeIsolationEcal(), propagateCALO(), and propagateCosmicCALO().

568  {
569  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
570  GlobalVector momentum (track->px(), track->py(), track->pz());
571  int charge (track->charge());
572  return spr::propagateECAL (vertex, momentum, charge, bfield, debug);
573  }
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 575 of file CaloPropagateTrack.cc.

References etaBEEcal, spr::propagatedTrack::ok, spr::propagatedTrack::point, propagateCalo(), rFrontEB, HiIsolationCommonParameters_cff::track, and zFrontEE.

575  {
577  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
578  }
static const double etaBEEcal
Definition: CaloConstants.h:12
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
#define debug
Definition: HDRShower.cc:19
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 595 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

Referenced by chargeIsolationHcal(), propagateCALO(), and propagateCosmicCALO().

595  {
596  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
597  GlobalVector momentum (track->px(), track->py(), track->pz());
598  int charge (track->charge());
599  return spr::propagateHCAL (vertex, momentum, charge, bfield, debug);
600  }
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 602 of file CaloPropagateTrack.cc.

References etaBEHcal, spr::propagatedTrack::ok, spr::propagatedTrack::point, propagateCalo(), rFrontHB, HiIsolationCommonParameters_cff::track, and zFrontHE.

602  {
604  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
605  }
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
#define debug
Definition: HDRShower.cc:19
std::pair< bool, HcalDetId > spr::propagateHCALBack ( const reco::Track track,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 538 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, info(), point, propagateCalo(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), rBackHB, reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), and zBackHE.

Referenced by HcalHBHEMuonAnalyzer::analyze().

538  {
540  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
541  GlobalVector momentum (track->px(), track->py(), track->pz());
542  int charge (track->charge());
544  if (info.ok) {
545  const GlobalPoint point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
546  return std::pair<bool,HcalDetId>(true,HcalDetId(gHB->getClosestCell(point)));
547  } else {
548  return std::pair<bool,HcalDetId>(false,HcalDetId());
549  }
550  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static const double zBackHE
Definition: CaloConstants.h:16
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
static const double rBackHB
Definition: CaloConstants.h:17
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
virtual DetId getClosestCell(const GlobalPoint &r) const
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 607 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), etaBETrak, propagateCalo(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), rBackTB, reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), and zBackTE.

607  {
608  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
609  GlobalVector momentum (track->px(), track->py(), track->pz());
610  int charge (track->charge());
612  return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
613  }
static const double zBackTE
Definition: CaloConstants.h:21
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
static const double rBackTB
Definition: CaloConstants.h:22
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
static const double etaBETrak
Definition: CaloConstants.h:23
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

Definition at line 615 of file CaloPropagateTrack.cc.

References funct::abs(), alongMomentum, Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::build(), ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), gather_cfg::cout, debug, makeMuonMisalignmentScenario::endcap, TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), M_PI, convertSQLiteXML::ok, reco::Track::outerPosition(), Geom::Phi< T >::phi(), PV3DBase< T, PVType, FrameType >::phi(), point, Propagator::propagate(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), TCMET_cfi::radius, funct::sin(), mathSSE::sqrt(), reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), TCMET_cfi::zdist, and zFrontTE.

Referenced by IsolatedTracksNxN::analyze().

620  {
621 
622  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
623  GlobalVector momentum (track->px(), track->py(), track->pz());
624  int charge (track->charge());
625  float radius = track->outerPosition().Rho();
626  float zdist = track->outerPosition().Z();
627 #ifdef EDM_ML_DEBUG
628  if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;
629 #endif
630  FreeTrajectoryState fts (vertex, momentum, charge, bField);
633 
634  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
635 
636  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
637  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
638 
639  math::XYZPoint point(-999.,-999.,-999.);
640  bool ok=false;
641  GlobalVector direction(0,0,1);
642  if (tsosb.isValid() && std::abs(zdist) < spr::zFrontTE) {
643  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
644  direction = tsosb.globalDirection();
645  ok = true;
646  } else if (tsose.isValid()) {
647  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
648  direction = tsose.globalDirection();
649  ok = true;
650  }
651 
652  double length = -1;
653  if (ok) {
654  math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
655  double dphi = direction.phi()-momentum.phi();
656  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
657  double rat = 0.5*dphi/std::sin(0.5*dphi);
658  double dZ = vDiff.z();
659  double dS = rdist*rat; //dZ*momentum.z()/momentum.perp();
660  length = std::sqrt(dS*dS+dZ*dZ);
661 #ifdef EDM_ML_DEBUG
662  if (debug)
663  std::cout << "propagateTracker:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << ok << " Point " << point << " RDist " << rdist << " dS " << dS << " dS/pt " << rdist*rat/momentum.perp() << " zdist " << dZ << " dz/pz " << dZ/momentum.z() << " Length " << length << std::endl;
664 #endif
665  }
666  return std::pair<math::XYZPoint,double>(point,length);
667  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
T sqrt(T t)
Definition: SSEVec.h:18
T phi() const
Definition: Phi.h:41
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
static const double zFrontTE
Definition: CaloConstants.h:20
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
T x() const
Definition: PV3DBase.h:62
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
GlobalVector globalDirection() const
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 552 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), etaBEEcal, propagateCalo(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), rFrontEB, reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), and zFrontEE.

Referenced by propagateCALO().

552  {
553  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
554  GlobalVector momentum (track->px(), track->py(), track->pz());
555  int charge (track->charge());
556  return spr::propagateCalo (vertex, momentum, charge, bfield, spr::zFrontEE, spr::rFrontEB, spr::etaBEEcal, debug);
557  }
static const double etaBEEcal
Definition: CaloConstants.h:12
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
propagatedTrack spr::propagateTrackToECAL ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 559 of file CaloPropagateTrack.cc.

References spr::trackAtOrigin::charge, etaBEEcal, spr::trackAtOrigin::momentum, spr::trackAtOrigin::ok, spr::trackAtOrigin::position, propagateCalo(), rFrontEB, simTrackAtOrigin(), and zFrontEE.

559  {
560 
561  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
563  if (trk.ok)
565  return ptrk;
566  }
static const double etaBEEcal
Definition: CaloConstants.h:12
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
#define debug
Definition: HDRShower.cc:19
spr::propagatedTrack spr::propagateTrackToHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 580 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), etaBEHcal, propagateCalo(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), rFrontHB, reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), and zFrontHE.

Referenced by propagateCALO().

580  {
581  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
582  GlobalVector momentum (track->px(), track->py(), track->pz());
583  int charge (track->charge());
584  return spr::propagateCalo (vertex, momentum, charge, bfield, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
585  }
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
static const double rFrontHB
Definition: CaloConstants.h:14
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
spr::propagatedTrack spr::propagateTrackToHCAL ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 587 of file CaloPropagateTrack.cc.

References spr::trackAtOrigin::charge, etaBEHcal, spr::trackAtOrigin::momentum, spr::trackAtOrigin::ok, spr::trackAtOrigin::position, propagateCalo(), rFrontHB, simTrackAtOrigin(), and zFrontHE.

587  {
588  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
590  if (trk.ok)
592  return ptrk;
593  }
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
#define debug
Definition: HDRShower.cc:19
void spr::simpleMove ( DetId det,
const CaloDirection dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
std::vector< DetId > &  cells,
int &  flag,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 650 of file MatrixECALDetIds.cc.

References gather_cfg::cout, debug, TauDecayModes::dec, EcalBarrel, EcalEndcap, EcalEndcapGeometry::getClosestBarrelCells(), EcalBarrelGeometry::getClosestEndcapCells(), CaloSubdetectorTopology::getNeighbours(), EBDetId::ietaAbs(), EEDetId::iPhiOuterRing(), EBDetId::MAX_IETA, and DetId::subdetId().

Referenced by newECALIdEW(), and newECALIdNS().

659  {
660 
661  DetId cell;
662  ok = 0;
663  if (det.subdetId() == EcalBarrel) {
664  EBDetId detId = det;
665  std::vector<DetId> neighbours = barrelTopo.getNeighbours(detId,dir);
666  if (neighbours.size()>0 && !neighbours[0].null()) {
667  cells.push_back(neighbours[0]);
668  cell = neighbours[0];
669  ok = 1;
670  } else {
671  const int ietaAbs ( detId.ietaAbs() ) ; // abs value of ieta
672  if (EBDetId::MAX_IETA == ietaAbs && (!ignoreTransition)) {
673  // get ee nbrs for for end of barrel crystals
675  ol( * barrelGeom.getClosestEndcapCells(detId) ) ;
676  // take closest neighbour on the other side, that is in the endcap
677  cell = *(ol.begin() );
678  neighbours = endcapTopo.getNeighbours(cell,dir);
679  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
680  else ok =-1;
681  for (EcalBarrelGeometry::OrderedListOfEEDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
682  cells.push_back(*iptr);
683  }
684  }
685  } else if (det.subdetId() == EcalEndcap) {
686  EEDetId detId = det;
687  std::vector<DetId> neighbours = endcapTopo.getNeighbours(detId,dir);
688  if (neighbours.size()>0 && !neighbours[0].null()) {
689  cells.push_back(neighbours[0]);
690  cell = neighbours[0];
691  ok = 1;
692  } else {
693  // are we on the outer ring ?
694  const int iphi ( detId.iPhiOuterRing() ) ;
695 // int isc = detId.isc();
696  if (iphi != 0 && (!ignoreTransition)) {
697  // get eb nbrs for for end of endcap crystals
699  ol( * endcapGeom.getClosestBarrelCells(detId) ) ;
700  // take closest neighbour on the other side, that is in the barrel.
701  cell = *(ol.begin() );
702  neighbours = barrelTopo.getNeighbours(cell,dir);
703  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
704  else ok =-1;
705  for (EcalEndcapGeometry::OrderedListOfEBDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
706  cells.push_back(*iptr);
707  }
708  }
709  }
710 #ifdef EDM_ML_DEBUG
711  if (debug) {
712  std::cout << "simpleMove:: Move DetId 0x" << std::hex << det()
713  << std::dec << " along " << dir << " to get 0x" << std::hex
714  << cell() << std::dec << " with flag " << ok << " # "
715  << cells.size();
716  for (unsigned int i1=0; i1<cells.size(); ++i1)
717  std::cout << " " << std::hex << cells[0]() << std::dec;
718  std::cout << std::endl;
719  }
720 #endif
721  }
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
int iPhiOuterRing() const
Definition: EEDetId.cc:388
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
static const int MAX_IETA
Definition: EBDetId.h:143
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
dbl *** dir
Definition: mlp_gen.cc:35
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:49
spr::trackAtOrigin spr::simTrackAtOrigin ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 737 of file CaloPropagateTrack.cc.

References spr::trackAtOrigin::charge, gather_cfg::cout, debug, createfilelist::int, spr::trackAtOrigin::momentum, spr::trackAtOrigin::ok, and spr::trackAtOrigin::position.

Referenced by HcalHBHEMuonSimAnalyzer::analyze(), propagateCALO(), propagateTrackToECAL(), and propagateTrackToHCAL().

743  {
744 
745  spr::trackAtOrigin trk;
746 
747  edm::SimTrackContainer::const_iterator itr = SimTk->end();
748  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
749  if ( simTrkItr->trackId() == thisTrk ) {
750 #ifdef EDM_ML_DEBUG
751  if (debug) std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
752 #endif
753  itr = simTrkItr;
754  break;
755  }
756  }
757 
758  if (itr != SimTk->end()) {
759  int vertIndex = itr->vertIndex();
760  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
761  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
762  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
763  const math::XYZTLorentzVectorD pos = simVtxItr->position();
764  const math::XYZTLorentzVectorD mom = itr->momentum();
765  trk.ok = true;
766  trk.charge = (int)(itr->charge());
767  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
768  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
769  }
770  }
771 #ifdef EDM_ML_DEBUG
772  if (debug) std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;
773 #endif
774  return trk;
775  }
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
#define debug
Definition: HDRShower.cc:19
Global3DVector GlobalVector
Definition: GlobalVector.h:10
double spr::timeOfFlight ( DetId  id,
const CaloGeometry geo,
bool  debug = false 
)

Definition at line 15 of file CaloSimInfo.cc.

References funct::abs(), funct::cos(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, stringResolutionProvider_cfi::eta, PV3DBase< T, PVType, FrameType >::eta(), JetChargeProducer_cfi::exp, CaloGeometry::getPosition(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, PV3DBase< T, PVType, FrameType >::mag(), dttmaxenums::R, rFrontEB, rFrontHB, rFrontHO, funct::sin(), theta(), tmp, zFrontEE, zFrontES, zFrontHE, and zFrontHF.

Referenced by ME0HitsValidation::analyze(), GEMHitsValidation::analyze(), ME0DigisValidation::analyze(), GEMDigiSimLink::GEMDigiSimLink(), CaloHitResponse::nSignals(), RPCDigiSimLink::RPCDigiSimLink(), and CastorHitCorrection::~CastorHitCorrection().

15  {
16 
17  double R = geo->getPosition(id).mag();
18  double tmp = R/CLHEP::c_light/CLHEP::ns;
19 #ifdef EDM_ML_DEBUG
20  if (debug) {
21  DetId::Detector det = id.det();
22  int subdet = id.subdetId();
23  double eta = geo->getPosition(id).eta();
24  double theta = 2.0*atan(exp(-std::abs(eta)));
25  double dist = 0;
26  if (det == DetId::Ecal) {
27  if (subdet == static_cast<int>(EcalBarrel)) {
28  const double rEB = spr::rFrontEB*CLHEP::cm;
29  dist = rEB/sin(theta);
30  } else if (subdet == static_cast<int>(EcalEndcap)) {
31  const double zEE = spr::zFrontEE*CLHEP::cm;
32  dist = zEE/cos(theta);
33  } else {
34  const double zES = spr::zFrontES*CLHEP::cm;
35  dist = zES/cos(theta);
36  }
37  } else if (det == DetId::Hcal) {
38  if (subdet == static_cast<int>(HcalBarrel)) {
39  const double rHB = spr::rFrontHB*CLHEP::cm;
40  dist = rHB/sin(theta);
41  } else if (subdet == static_cast<int>(HcalEndcap)) {
42  const double zHE = spr::zFrontHE*CLHEP::cm;
43  dist = zHE/cos(theta);
44  } else if (subdet == static_cast<int>(HcalOuter)) {
45  const double rHO = spr::rFrontHO*CLHEP::cm;
46  dist = rHO/sin(theta);
47  } else {
48  const double zHF = spr::zFrontHF*CLHEP::cm;
49  dist = zHF/cos(theta);
50  }
51  }
52  double tmp1 = dist/CLHEP::c_light/CLHEP::ns;
53 
54  std::cout << "Detector " << det << "/" << subdet << " Eta/Theta " << eta
55  << "/" << theta/CLHEP::deg << " Dist " << dist/CLHEP::cm
56  << " R " << R << " TOF " << tmp << ":" << tmp1 << std::endl;
57  }
58 #endif
59  return tmp;
60  }
static const double zFrontHE
Definition: CaloConstants.h:13
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
static const double zFrontHF
Definition: CaloConstants.h:19
static const double rFrontHB
Definition: CaloConstants.h:14
static const double zFrontEE
Definition: CaloConstants.h:9
T mag() const
Definition: PV3DBase.h:67
static const double rFrontEB
Definition: CaloConstants.h:10
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:70
static const double zFrontES
Definition: CaloConstants.h:11
#define debug
Definition: HDRShower.cc:19
Detector
Definition: DetId.h:24
T eta() const
Definition: PV3DBase.h:76
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
static const double rFrontHO
Definition: CaloConstants.h:18
bool spr::validSimTrack ( unsigned int  simTkId,
edm::SimTrackContainer::const_iterator  thisTrkItr,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 136 of file MatchingSimTrack.cc.

References begin, gather_cfg::cout, and class-composition::parent.

Referenced by matchedSimTrackId(), and matchedSimTrackInfo().

136  {
137 
138 #ifdef EDM_ML_DEBUG
139  if (debug) std::cout << "Inside validSimTrack: trackId " << thisTrkItr->trackId() << " vtxIndex " << thisTrkItr->vertIndex() << " to be matched to " << simTkId << std::endl;
140 #endif
141  //This track originates from simTkId
142  if (thisTrkItr->trackId() == simTkId) return true;
143 
144  //Otherwise trace back the history using SimTracks and SimVertices
145  int vertIndex = thisTrkItr->vertIndex();
146  if (vertIndex == -1 || vertIndex >= (int)SimVtx->size()) return false;
147 
148  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
149  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
150  int parent = simVtxItr->parentIndex();
151 #ifdef EDM_ML_DEBUG
152  if (debug) std::cout << "validSimTrack:: parent index " << parent <<" ";
153 #endif
154  if (parent < 0 && simVtxItr != SimVtx->begin()) {
155  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
156  for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
157  if (simVtxItr->parentIndex() > 0) {
158  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
159  double dist = pos2.P();
160  if (dist < 0.001) {
161  parent = simVtxItr->parentIndex();
162  break;
163  }
164  }
165  }
166  }
167 #ifdef EDM_ML_DEBUG
168  if (debug) std::cout << "final index " << parent << std::endl;;
169 #endif
170  for(edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
171  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug) ;
172  }
173 
174  return false;
175 
176  }
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
#define debug
Definition: HDRShower.cc:19
#define begin
Definition: vmac.h:30
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)

Variable Documentation

const double spr::deltaEta = 0.087
static
const double spr::etaBEEcal = 1.479
static
const double spr::etaBEHcal = 1.392
static
const double spr::etaBETrak = 1.705
static

Definition at line 23 of file CaloConstants.h.

Referenced by propagateTracker().

const double spr::rBackHB = 288.8
static

Definition at line 17 of file CaloConstants.h.

Referenced by propagateHCALBack().

const double spr::rBackTB = 109.0
static

Definition at line 22 of file CaloConstants.h.

Referenced by propagateTracker().

const double spr::rFrontEB = 129.4
static
const double spr::rFrontHB = 180.7
static
const double spr::rFrontHO = 384.8
static

Definition at line 18 of file CaloConstants.h.

Referenced by timeOfFlight().

const double spr::zBackHE = 549.3
static

Definition at line 16 of file CaloConstants.h.

Referenced by propagateHCALBack().

const double spr::zBackTE = 290.0
static

Definition at line 21 of file CaloConstants.h.

Referenced by propagateTracker().

const double spr::zFrontEE = 319.2
static
const double spr::zFrontES = 303.2
static

Definition at line 11 of file CaloConstants.h.

Referenced by timeOfFlight().

const double spr::zFrontHE = 402.7
static
const double spr::zFrontHF = 1115.
static

Definition at line 19 of file CaloConstants.h.

Referenced by timeOfFlight().

const double spr::zFrontTE = 110.0
static

Definition at line 20 of file CaloConstants.h.

Referenced by propagateTrackerEnd().