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)
 
spr::propagatedTrackDirection propagateHCALBack (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, 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:615
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:510
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 PVValHelper::dx, PVValHelper::dy, 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:615
#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  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
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
DetId getClosestCell(const GlobalPoint &r) const override
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)
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:510
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
DetId getClosestCell(const GlobalPoint &r) const override
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:615
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  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
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)
DetId getClosestCell(const GlobalPoint &r) const override
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)
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:510
DetId getClosestCell(const GlobalPoint &r) const override
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:615
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:645
math::XYZPoint trkGlobPosAtHcal
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
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:510
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:615
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:615
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:645
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
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:510
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:615
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:446
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:510
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:12
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, PVValHelper::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(), HcalHBHEMuonAnalyzer::activeLength(), 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(), DTNoiseCalibration::analyze(), EcalDumpRaw::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), HcalQIEDataCheck::analyze(), ParticleListDrawer::analyze(), HcalAutoPedestalValidator::analyze(), HLTBTagPerformanceAnalyzer::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), EcalLaserAnalyzer2::analyze(), DQMHcalIsoTrackAlCaReco::analyze(), edmtest::HcalDumpConditions::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(), 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(), 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(), CSCComparatorDigiFitter::comparatorInLCTPattern(), 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(), hcaldqm::utilities::crate2fed(), 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(), ThePEG::LesHouchesInterface::doReadEvent(), 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_VBF_Mu::dqmBeginRun(), SUSY_HLT_MuonFakes::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(), HltComparator::filter(), LogErrorFilter::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(), HDQMSummary::getPosition(), SiStripSummary::getPosition(), TrackAssociatorByHitsImpl::getShared(), MEtXYcorrectParametersCollection::getShiftDataFlavBin(), MEtXYcorrectParametersCollection::getShiftDyFlavBin(), MEtXYcorrectParametersCollection::getShiftMcFlavBin(), MEtXYcorrectParametersCollection::getShiftTTJetsFlavBin(), MEtXYcorrectParametersCollection::getShiftWJetsFlavBin(), EgammaRecHitIsolation::getSum_(), SiPixelActionExecutor::getSummaryME(), fwlite::MultiChainEvent::getThinnedProducts(), EcalElectronicsMapping::getTriggerElectronicsId(), checkPayloads::getUploadedIOVs(), hcaldqm::quantity::getValue_Crate(), hcaldqm::quantity::getValue_CrateuTCA(), hcaldqm::quantity::getValue_CrateVME(), hcaldqm::quantity::getValue_FED(), hcaldqm::quantity::getValue_FEDuTCA(), hcaldqm::quantity::getValue_FEDVME(), 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(), MultiTrackValidator::MultiTrackValidator(), 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(), ThePEG::LesHouchesInterface::open(), PdgIdExcluder::operator()(), StatusSelector::operator()(), PdgIdSelector::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(), ESListOfFEDSProducer::produce(), EgammaHLTCombinedIsolationProducer::produce(), EgammaHLTElectronCombinedIsolationProducer::produce(), SiPixelRawToDigi::produce(), TrackListMerger::produce(), ReducedRecHitCollectionProducer::produce(), pat::PATJetUpdater::produce(), EleIsoDetIdCollectionProducer::produce(), LaserAlignmentT0Producer::produce(), MuonDetCleaner< T1, T2 >::produce(), ConversionSeedFilterCharge::produce(), JetSubstructurePacker::produce(), pat::GenPlusSimParticleProducer::produce(), GamIsoDetIdCollectionProducer::produce(), HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::produce(), EcalRawToDigi::produce(), pat::PATTauProducer::produce(), pat::PATJetProducer::produce(), InterestingTrackEcalDetIdProducer::produce(), CaloTowersMerger::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(), DTLocalTriggerTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTLocalTriggerTPTest::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(), CSCMotherboardME11GEM::sortLCTsByGEMDPhi(), CSCMotherboardME11GEM::sortLCTsByQuality(), 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(), PedsFullNoiseHistosUsingDb::update(), PedestalsHistosUsingDb::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 12 of file FindCaloHitCone.cc.

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

12  {
13 
14  std::vector<EcalRecHitCollection::const_iterator> hit;
15 
17  j!=hits->end(); j++) {
18 
19  bool keepHit = false;
20 
21  if (j->id().subdetId() == EcalEndcap) {
22  EEDetId EEid = EEDetId(j->id());
23  const GlobalPoint & rechitPoint = geo->getPosition(EEid);
24  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
25  } else if (j->id().subdetId() == EcalBarrel) {
26  EBDetId EBid = EBDetId(j->id());
27  const GlobalPoint & rechitPoint = geo->getPosition(EBid);
28  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
29  }
30 
31  if (keepHit) hit.push_back(j);
32  }
33  return hit;
34  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:12
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 37 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().

37  {
38 
39  std::vector<EcalRecHitCollection::const_iterator> hit;
40 
41  // Only check both barrel and endcap when track is near transition
42  // region: 1.479-2*0.087 < trkEta < 1.479+2*0.087
43 
44  bool doBarrel=false, doEndcap=false;
45  if ( std::abs(point1.eta()) < (spr::etaBEEcal+2*spr::deltaEta)) doBarrel=true; // 1.479+2*0.087
46  if ( std::abs(point1.eta()) > (spr::etaBEEcal-2*spr::deltaEta)) doEndcap=true; // 1.479-2*0.087
47 
48  if (doBarrel) {
49  for (EcalRecHitCollection::const_iterator j=barrelhits->begin();
50  j!=barrelhits->end(); j++) {
51 
52  bool keepHit = false;
53  if (j->id().subdetId() == EcalBarrel) {
54  EBDetId EBid = EBDetId(j->id());
55  const GlobalPoint & rechitPoint = geo->getPosition(EBid);
56  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
57  } else {
58  std::cout << "PROBLEM : Endcap RecHits in Barrel Collection!?"
59  << std::endl;
60  }
61  if (keepHit) hit.push_back(j);
62  }
63  } // doBarrel
64 
65  if (doEndcap) {
66 
67  for (EcalRecHitCollection::const_iterator j=endcaphits->begin();
68  j!=endcaphits->end(); j++) {
69 
70  bool keepHit = false;
71 
72  if (j->id().subdetId() == EcalEndcap) {
73  EEDetId EEid = EEDetId(j->id());
74  const GlobalPoint & rechitPoint = geo->getPosition(EEid);
75  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR) keepHit = true;
76  } else {
77  std::cout << "PROBLEM : Barrel RecHits in Endcap Collection!?"
78  << std::endl;
79  }
80  if (keepHit) hit.push_back(j);
81  }
82  } // doEndcap
83 
84  return hit;
85  }
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:12
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 89 of file FindCaloHitCone.cc.

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

89  {
90 
91  std::vector<HBHERecHitCollection::const_iterator> hit;
92  // Loop over Hcal RecHits
94  j!=hits->end(); j++) {
95  DetId detId(j->id());
96  const GlobalPoint rechitPoint =
97  ((HcalGeometry*)(geo->getSubdetectorGeometry(detId)))->getPosition(detId);
98  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) hit.push_back(j);
99  }
100  return hit;
101  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:12
std::vector< HBHERecHit >::const_iterator const_iterator
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 104 of file FindCaloHitCone.cc.

References getDistInPlaneTrackDir(), CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), and DetId::Hcal.

104  {
105 
106  std::vector<edm::PCaloHitContainer::const_iterator> hit;
107  edm::PCaloHitContainer::const_iterator ihit;
108  for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
109  DetId detId(ihit->id());
110  const GlobalPoint rechitPoint = (detId.det() == DetId::Hcal) ?
111  ((HcalGeometry*)(geo->getSubdetectorGeometry(detId)))->getPosition(detId) :
112  geo->getPosition(detId);
113  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) {
114  hit.push_back(ihit);
115  }
116  }
117  return hit;
118  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:12
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 53 of file FindDistCone.cc.

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

57  {
58 
59  double dR, Rec;
60  if (fabs(eta1)<spr::etaBEEcal) Rec=spr::rFrontEB;
61  else Rec=spr::zFrontEE;
62  double ce1=cosh(eta1);
63  double ce2=cosh(eta2);
64  double te1=tanh(eta1);
65  double te2=tanh(eta2);
66 
67  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
68  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
69  else dR=999999.;
70 #ifdef EDM_ML_DEBUG
71  if (debug) std::cout << "getDistInCMatEcal: between (" << eta1 << ", "
72  << phi1 << ") and (" << eta2 << ", " << phi2 << " is "
73  << dR << std::endl;
74 #endif
75  return dR;
76  }
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 80 of file FindDistCone.cc.

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

84  {
85 
86  // Radii and eta from Geometry/HcalCommonData/data/hcalendcapalgo.xml
87  // and Geometry/HcalCommonData/data/hcalbarrelalgo.xml
88 
89  double dR, Rec;
90  if (fabs(eta1)<spr::etaBEHcal) Rec=spr::rFrontHB;
91  else Rec=spr::zFrontHE;
92  double ce1=cosh(eta1);
93  double ce2=cosh(eta2);
94  double te1=tanh(eta1);
95  double te2=tanh(eta2);
96 
97  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
98  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
99  else dR=999999.;
100  return dR;
101 #ifdef EDM_ML_DEBUG
102  if (debug) std::cout << "getDistInCMatHcal: between (" << eta1 << ", "
103  << phi1 << ") and (" << eta2 << ", " << phi2 << " is "
104  << dR << std::endl;
105 #endif
106  }
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 12 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().

18  {
19 
20  const GlobalVector caloIntersectVector(caloPoint.x(),
21  caloPoint.y(),
22  caloPoint.z()); //p
23 
24  const GlobalVector caloUnitVector = caloVector.unit();
25  const GlobalVector rechitVector(rechitPoint.x(),
26  rechitPoint.y(),
27  rechitPoint.z());
28  const GlobalVector rechitUnitVector = rechitVector.unit();
29  double dotprod_denominator = caloUnitVector.dot(rechitUnitVector);
30  double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
31  double rechitdist = dotprod_numerator/dotprod_denominator;
32  const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
33  const GlobalPoint effectiveRechitPoint(effectiveRechitVector.x(),
34  effectiveRechitVector.y(),
35  effectiveRechitVector.z());
36  GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
37 #ifdef EDM_ML_DEBUG
38  if (debug) {
39  std::cout << "getDistInPlaneTrackDir: point " << caloPoint << " dirn "
40  << caloVector << " numerator " << dotprod_numerator
41  << " denominator " << dotprod_denominator << " distance "
42  << distance_vector.mag() << std::endl;
43  }
44 #endif
45  if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
46  return distance_vector.mag();
47  } else {
48  return 999999.;
49  }
50  }
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 162 of file FindDistCone.cc.

Referenced by RealisticSimClusterMapper::buildClusters().

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

Definition at line 171 of file FindDistCone.cc.

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

171  {
172  // This will not yet handle Ecal CaloHits!!
173  double samplingWeight = 1.;
174  // Hard coded sampling weights from JFH analysis of iso tracks
175  // Sept 2009.
176  DetId id = hit->id();
177  if (id.det() == DetId::Hcal) {
178  HcalDetId detId(id);
179  if (detId.subdet() == HcalBarrel)
180  samplingWeight = 114.1;
181  else if (detId.subdet() == HcalEndcap)
182  samplingWeight = 167.3;
183  else {
184  // ONLY protection against summing HO, HF simhits
185  return 0.;
186  }
187  }
188 
189  return samplingWeight*hit->energy();
190  }
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 108 of file FindDistCone.cc.

Referenced by getEtaPhi().

108  {
109 
110  RH_ieta.push_back(hit->id().ieta());
111  RH_iphi.push_back(hit->id().iphi());
112  RH_ene.push_back(hit->energy());
113  }
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 115 of file FindDistCone.cc.

References getEtaPhi().

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

Definition at line 129 of file FindDistCone.cc.

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

Definition at line 135 of file FindDistCone.cc.

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

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

Definition at line 192 of file FindDistCone.cc.

References CaloGeometry::getSubdetectorGeometry().

Referenced by getGpos().

192  {
193  DetId detId(hit->id());
194  return ((HcalGeometry*)(geo->getSubdetectorGeometry(detId)))->getPosition(detId);
195  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
unsigned int id
Definition: DetId.h:18
GlobalPoint spr::getGpos ( const CaloGeometry geo,
edm::PCaloHitContainer::const_iterator  hit,
bool  debug = false 
)

Definition at line 197 of file FindDistCone.cc.

References EcalEndcap, getGpos(), CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, and point.

197  {
198  DetId detId(hit->id());
199  GlobalPoint point = (detId.det() == DetId::Hcal) ?
200  ((HcalGeometry*)(geo->getSubdetectorGeometry(detId)))->getPosition(detId) :
201  geo->getPosition(detId);
202  return point;
203  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
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
*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
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 216 of file FindDistCone.cc.

Referenced by getHotCell().

216  {
217  double energy = (useRaw) ? hit->eraw() : hit->energy();
218  return energy;
219  }
double spr::getRawEnergy ( edm::PCaloHitContainer::const_iterator  hit,
bool  useRaw = false 
)

Definition at line 225 of file FindDistCone.cc.

225  {
226  return hit->energy();
227  }
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, PVValHelper::dxy, reco::TrackBase::dxy(), PVValHelper::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:573
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:561
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:621
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:757
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:609
#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:446
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:510
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:591
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:25
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:12
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:25
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 15 of file MatrixHCALDetIds.cc.

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

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

17  {
18 
19 #ifdef EDM_ML_DEBUG
20  if (debug) {
21  std::cout << "matrixHCALIds::Add " << ieta << " rows and " << iphi
22  << " columns of cells for " << dets.size() << " cells"
23  << std::endl;
24  spr::debugHcalDets(0, dets);
25  }
26 #endif
27  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ieta,
28  iphi, debug);
29  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false, ieta,
30  iphi, debug);
31  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
32  if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
33  vdetN.push_back(vdetS[i1]);
34  }
35 
36  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
37 
38 #ifdef EDM_ML_DEBUG
39  if (debug) {
40  std::cout << "matrixHCALIds::Total number of cells found is "
41  << vdetS.size() << std::endl;
42  spr::debugHcalDets(0, vdetS);
43  }
44 #endif
45  return vdetS;
46  }
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 48 of file MatrixHCALDetIds.cc.

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

51  {
52 
53  HcalDetId hcdet = HcalDetId(det);
54  GlobalPoint core = ((HcalGeometry*)(geo->getSubdetectorGeometry(hcdet)))->getPosition(hcdet);
55  std::vector<DetId> dets, vdetx;
56  dets.push_back(det);
57  int ietaphi = (int)(dR/15.0)+1;
58  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ietaphi,
59  ietaphi, includeHO, debug);
60  for (unsigned int i=0; i<vdets.size(); ++i) {
61  HcalDetId hcdet = HcalDetId(vdets[i]);
62  GlobalPoint rpoint = ((HcalGeometry*)(geo->getSubdetectorGeometry(hcdet)))->getPosition(hcdet);
63  if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint) < dR) {
64  vdetx.push_back(vdets[i]);
65  }
66  }
67 
68 #ifdef EDM_ML_DEBUG
69  if (debug) {
70  std::cout << "matrixHCALIds::Final List of cells for dR " << dR
71  << " is with " << vdetx.size() << " from original list of "
72  << vdets.size() << " cells" << std::endl;
73  spr::debugHcalDets(0, vdetx);
74  }
75 #endif
76  return vdetx;
77  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:12
Definition: __init__.py:1
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)
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 79 of file MatrixHCALDetIds.cc.

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

82  {
83 
84 #ifdef EDM_ML_DEBUG
85  if (debug) {
86  std::cout << "matrixHCALIds::Add " <<ietaE << "|" <<ietaW << " rows and "
87  << iphiN << "|" << iphiS << " columns of cells for "
88  << dets.size() << " cells" << std::endl;
89  spr::debugHcalDets(0, dets);
90  }
91 #endif
92  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ietaE,
93  ietaW, iphiN, iphiS, debug);
94  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false,ietaE,
95  ietaW, iphiN, iphiS, debug);
96  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
97  if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
98  vdetN.push_back(vdetS[i1]);
99  }
100 
101  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
102 
103 #ifdef EDM_ML_DEBUG
104  if (debug) {
105  std::cout << "matrixHCALIds::Total number of cells found is "
106  << vdetS.size() << std::endl;
107  spr::debugHcalDets(0, vdetS);
108  }
109 #endif
110  return vdetS;
111  }
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 393 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds().

399  {
400 
401 #ifdef EDM_ML_DEBUG
402  if (debug) {
403  std::cout << "matrixHCALIdsDepth::Add cells with higher depths with HO"
404  << "Flag set to " << includeHO << " to existing "
405  << dets.size() << " cells" << std::endl;
406  spr::debugHcalDets(0, dets);
407  }
408 #endif
409  std::vector<DetId> vdets(dets);
410  for (unsigned int i1=0; i1<dets.size(); i1++) {
411  HcalDetId vdet = dets[i1];
412  for (int idepth = 0; idepth < 3; idepth++) {
413  std::vector<DetId> vUpDetId = topology->up(vdet);
414  if (!vUpDetId.empty()) {
415  if (includeHO || vUpDetId[0].subdetId() != (int)(HcalOuter)) {
416  int n = std::count(vdets.begin(),vdets.end(),vUpDetId[0]);
417  if (n == 0) {
418 #ifdef EDM_ML_DEBUG
419  if (debug) std::cout << "matrixHCALIdsDepth:: Depth " << idepth
420  << " " << vdet << " "
421  << (HcalDetId)vUpDetId[0] << std::endl;
422 #endif
423  vdets.push_back(vUpDetId[0]);
424  }
425  }
426  vdet = vUpDetId[0];
427  }
428  }
429  }
430 
431 #ifdef EDM_ML_DEBUG
432  if (debug) {
433  std::cout << "matrixHCALIdsDepth::Final list contains " << vdets.size()
434  << " cells" << std::endl;
435  spr::debugHcalDets(0, vdets);
436  }
437 #endif
438  return vdets;
439  }
std::vector< DetId > up(const DetId &id) const override
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
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 291 of file MatrixHCALDetIds.cc.

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

Referenced by newHCALIdEW(), and newHCALIdNS().

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

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

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

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

Referenced by matrixHCALIds(), and newHCALIdNS().

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

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

202  {
203 
204 #ifdef EDM_ML_DEBUG
205  if (debug) {
206  std::cout << "newHCALIdNS::Add " << iphiN << "|" << iphiS
207  << " columns of cells along " << shiftNorth << " for "
208  << (dets.size()-last) << " cells" << std::endl;
209  spr::debugHcalDets(last, dets);
210  }
211 #endif
212  std::vector<DetId> vdets;
213  vdets.insert(vdets.end(), dets.begin(), dets.end());
214  std::vector<DetId> vdetE, vdetW;
215  if (last == 0) {
216  vdetE = spr::newHCALIdEW(dets,last, topology, true, ietaE,ietaW, debug);
217  vdetW = spr::newHCALIdEW(dets,last, topology, false, ietaE,ietaW, debug);
218  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
219  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
220  vdets.push_back(vdetW[i1]);
221  }
222  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
223  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
224  vdets.push_back(vdetE[i1]);
225  }
226 #ifdef EDM_ML_DEBUG
227  if (debug) {
228  std::cout <<"newHCALIdNS::With Added cells along E/W results a set of "
229  << (vdets.size()-dets.size()) << " new cells" << std::endl;
230  spr::debugHcalDets(dets.size(), vdets);
231  }
232 #endif
233  }
234  unsigned int last0 = vdets.size();
235  int iphi = iphiS;
236  if (shiftNorth) iphi = iphiN;
237  if (iphi > 0) {
238  std::vector<DetId> vdetnew;
239  for (unsigned int i1=last; i1<dets.size(); i1++) {
240  std::vector<DetId> vdet;
241  if (shiftNorth) vdet = topology->north(dets[i1]);
242  else vdet = topology->south(dets[i1]);
243  for (unsigned int i2=0; i2<vdet.size(); i2++) {
244  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
245  vdetnew.push_back(vdet[i2]);
246  }
247  }
248  iphi--;
249  vdetE = spr::newHCALIdEW(vdetnew,0, topology, true, ietaE,ietaW, debug);
250  vdetW = spr::newHCALIdEW(vdetnew,0, topology, false, ietaE,ietaW, debug);
251  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
252  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
253  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
254  vdets.push_back(vdetW[i2]);
255  }
256  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
257  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
258  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
259  vdets.push_back(vdetE[i2]);
260  }
261  last = vdets.size();
262  vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
263 #ifdef EDM_ML_DEBUG
264  if (debug) {
265  std::cout << "newHCALIdNS::Addition results a set of "
266  << (vdets.size()-last0) << " new cells" << std::endl;
267  spr::debugHcalDets(last0, vdets);
268  }
269 #endif
270  last0 = last;
271  }
272  if (shiftNorth) iphiN = iphi;
273  else iphiS = iphi;
274 
275  if (iphi > 0) {
276  last = last0;
277  return spr::newHCALIdNS(vdets,last,topology,shiftNorth,ietaE,ietaW,
278  iphiN,iphiS,debug);
279  } else {
280 #ifdef EDM_ML_DEBUG
281  if (debug) {
282  std::cout << "newHCALIdNS::Final list consists of " << vdets.size()
283  << " cells" << std::endl;
284  spr::debugHcalDets(0, vdets);
285  }
286 #endif
287  return vdets;
288  }
289  }
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
std::vector< DetId > south(const DetId &id) const override
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > north(const DetId &id) const override
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(), StudyHLT::analyze(), HcalHBHEMuonAnalyzer::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, EcalEndcapGeometry::getClosestCell(), CaloSubdetectorGeometry::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 #ifdef EDM_ML_DEBUG
180  if (debug) {
181  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
182  for (unsigned int i=0; i<vdets.size(); ++i) {
183  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
184  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
185  std::cout << (EBDetId)(vdets[i].detIdECAL);
186  } else {
187  std::cout << (EEDetId)(vdets[i].detIdECAL);
188  }
189  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
190  }
191  }
192 #endif
193  }
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)
DetId getClosestCell(const GlobalPoint &r) const override
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:510
DetId getClosestCell(const GlobalPoint &r) const override
*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 195 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, EcalEndcapGeometry::getClosestCell(), CaloSubdetectorGeometry::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.

195  {
196 
197  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
198  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
200  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
201 
202  unsigned int indx;
203  reco::TrackCollection::const_iterator trkItr;
204  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
205  const reco::Track* pTrack = &(*trkItr);
207  trkD.trkItr = trkItr;
208  trkD.ok = (pTrack->quality(trackQuality_));
209  trkD.detIdECAL = DetId(0);
210  trkD.detIdHCAL = DetId(0);
211  trkD.detIdEHCAL= DetId(0);
212 #ifdef EDM_ML_DEBUG
213  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << trkD.ok << std::endl;
214 #endif
216  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
217  trkD.okECAL = info.ok;
218  trkD.pointECAL = point;
219  trkD.directionECAL = info.direction;
220  if (trkD.okECAL) {
221  if (std::abs(info.point.eta())<spr::etaBEEcal) {
222  trkD.detIdECAL = barrelGeom->getClosestCell(point);
223  } else {
224  trkD.detIdECAL = endcapGeom->getClosestCell(point);
225  }
226  trkD.detIdEHCAL = gHB->getClosestCell(point);
227  }
228  info = spr::propagateTrackToHCAL (pTrack, bField, debug);
229  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
230  trkD.okHCAL = info.ok;
231  trkD.pointHCAL = point;
232  trkD.directionHCAL = info.direction;
233  if (trkD.okHCAL) {
234  trkD.detIdHCAL = gHB->getClosestCell(point);
235  }
236  trkDir.push_back(trkD);
237  }
238 #ifdef EDM_ML_DEBUG
239  if (debug) {
240  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
241  for (unsigned int i=0; i<trkDir.size(); ++i) {
242  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
243  if (trkDir[i].okECAL) {
244  std::cout << " point " << trkDir[i].pointECAL << " direction "
245  << trkDir[i].directionECAL << " ";
246  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
247  std::cout << (EBDetId)(trkDir[i].detIdECAL);
248  } else {
249  std::cout << (EEDetId)(trkDir[i].detIdECAL);
250  }
251  }
252  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
253  if (trkDir[i].okHCAL) {
254  std::cout << " point " << trkDir[i].pointHCAL << " direction "
255  << trkDir[i].directionHCAL << " "
256  << (HcalDetId)(trkDir[i].detIdHCAL);
257  }
258  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
259  }
260  }
261 #endif
262  }
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)
DetId getClosestCell(const GlobalPoint &r) const override
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:510
reco::TrackCollection::const_iterator trkItr
DetId getClosestCell(const GlobalPoint &r) const override
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 264 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().

264  {
265 
266  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
267  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
269 
271  vdet.ok = true;
272  vdet.detIdECAL = DetId(0);
273  vdet.detIdHCAL = DetId(0);
274  vdet.detIdEHCAL= DetId(0);
275 #ifdef EDM_ML_DEBUG
276  if (debug) std::cout << "Propagate track: p " << pTrack->p() << " eta " << pTrack->eta() << " phi " << pTrack->phi() << " Flag " << vdet.ok << std::endl;
277 #endif
278  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
279  vdet.okECAL = info.second;
280  if (vdet.okECAL) {
281  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
282  vdet.etaECAL = point.eta();
283  vdet.phiECAL = point.phi();
284  if (std::abs(point.eta())<spr::etaBEEcal) {
285  vdet.detIdECAL = barrelGeom->getClosestCell(point);
286  } else {
287  vdet.detIdECAL = endcapGeom->getClosestCell(point);
288  }
289  vdet.detIdEHCAL = gHB->getClosestCell(point);
290  }
291  info = spr::propagateHCAL (pTrack, bField, debug);
292  vdet.okHCAL = info.second;
293  if (vdet.okHCAL) {
294  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
295  vdet.etaHCAL = point.eta();
296  vdet.phiHCAL = point.phi();
297  vdet.detIdHCAL = gHB->getClosestCell(point);
298  }
299 #ifdef EDM_ML_DEBUG
300  if (debug) {
301  std::cout << "propagateCALO:: for 1 track" << std::endl;
302  std::cout << "Track [0] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
303  if (vdet.detIdECAL.subdetId() == EcalBarrel) {
304  std::cout << (EBDetId)(vdet.detIdECAL);
305  } else {
306  std::cout << (EEDetId)(vdet.detIdECAL);
307  }
308  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
309  }
310 #endif
311  return vdet;
312  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
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)
DetId getClosestCell(const GlobalPoint &r) const override
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:645
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
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
DetId getClosestCell(const GlobalPoint &r) const override
*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 314 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, EcalEndcapGeometry::getClosestCell(), CaloSubdetectorGeometry::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.

314  {
315 
316  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
317  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
319 
320  std::vector<spr::propagatedGenTrackID> trkDir;
321  unsigned int indx;
322  HepMC::GenEvent::particle_const_iterator p;
323  for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++p,++indx) {
325  trkD.trkItr = p;
326  trkD.detIdECAL = DetId(0);
327  trkD.detIdHCAL = DetId(0);
328  trkD.detIdEHCAL= DetId(0);
329  trkD.pdgId = ((*p)->pdg_id());
330  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge())/3;
331  GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
332 #ifdef EDM_ML_DEBUG
333  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
334 #endif
335  // consider stable particles
336  if ( (*p)->status()==1 && std::abs((*p)->momentum().eta()) < etaMax ) {
337  GlobalPoint vertex = GlobalPoint(0.1*(*p)->production_vertex()->position().x(),
338  0.1*(*p)->production_vertex()->position().y(),
339  0.1*(*p)->production_vertex()->position().z());
340  trkD.ok = true;
342  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
343  trkD.okECAL = info.ok;
344  trkD.pointECAL = point;
345  trkD.directionECAL = info.direction;
346  if (trkD.okECAL) {
347  if (std::abs(info.point.eta())<spr::etaBEEcal) {
348  trkD.detIdECAL = barrelGeom->getClosestCell(point);
349  } else {
350  trkD.detIdECAL = endcapGeom->getClosestCell(point);
351  }
352  trkD.detIdEHCAL = gHB->getClosestCell(point);
353  }
354 
355  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
356  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
357  trkD.okHCAL = info.ok;
358  trkD.pointHCAL = point;
359  trkD.directionHCAL = info.direction;
360  if (trkD.okHCAL) {
361  trkD.detIdHCAL = gHB->getClosestCell(point);
362  }
363  }
364  trkDir.push_back(trkD);
365  }
366 #ifdef EDM_ML_DEBUG
367  if (debug) {
368  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
369  for (unsigned int i=0; i<trkDir.size(); ++i) {
370  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
371  if (trkDir[i].okECAL) {
372  std::cout << " point " << trkDir[i].pointECAL << " direction "
373  << trkDir[i].directionECAL << " ";
374  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
375  std::cout << (EBDetId)(trkDir[i].detIdECAL);
376  } else {
377  std::cout << (EEDetId)(trkDir[i].detIdECAL);
378  }
379  }
380  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
381  if (trkDir[i].okHCAL) {
382  std::cout << " point " << trkDir[i].pointHCAL << " direction "
383  << trkDir[i].directionHCAL << " "
384  << (HcalDetId)(trkDir[i].detIdHCAL);
385  }
386  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
387  }
388  }
389 #endif
390  return trkDir;
391  }
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)
DetId getClosestCell(const GlobalPoint &r) const override
static const double etaBEHcal
Definition: CaloConstants.h:15
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
DetId getClosestCell(const GlobalPoint &r) const override
*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 393 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.

393  {
394 
395  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
396  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
398 
399  std::vector<spr::propagatedGenParticleID> trkDir;
400  unsigned int indx;
401  reco::GenParticleCollection::const_iterator p;
402  for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++p,++indx) {
404  trkD.trkItr = p;
405  trkD.detIdECAL = DetId(0);
406  trkD.detIdHCAL = DetId(0);
407  trkD.detIdEHCAL= DetId(0);
408  trkD.pdgId = (p->pdgId());
409  trkD.charge = p->charge();
410  GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
411 #ifdef EDM_ML_DEBUG
412  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
413 #endif
414  // consider stable particles
415  if ( p->status()==1 && std::abs(momentum.eta()) < etaMax ) {
416  GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
417  trkD.ok = true;
419  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
420  trkD.okECAL = info.ok;
421  trkD.pointECAL = point;
422  trkD.directionECAL = info.direction;
423  if (trkD.okECAL) {
424  if (std::abs(info.point.eta())<spr::etaBEEcal) {
425  trkD.detIdECAL = barrelGeom->getClosestCell(point);
426  } else {
427  trkD.detIdECAL = endcapGeom->getClosestCell(point);
428  }
429  trkD.detIdEHCAL = gHB->getClosestCell(point);
430  }
431 
432  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
433  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
434  trkD.okHCAL = info.ok;
435  trkD.pointHCAL = point;
436  trkD.directionHCAL = info.direction;
437  if (trkD.okHCAL) {
438  trkD.detIdHCAL = gHB->getClosestCell(point);
439  }
440  }
441  trkDir.push_back(trkD);
442  }
443 #ifdef EDM_ML_DEBUG
444  if (debug) {
445  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
446  for (unsigned int i=0; i<trkDir.size(); ++i) {
447  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
448  if (trkDir[i].okECAL) {
449  std::cout << " point " << trkDir[i].pointECAL << " direction "
450  << trkDir[i].directionECAL << " ";
451  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
452  std::cout << (EBDetId)(trkDir[i].detIdECAL);
453  } else {
454  std::cout << (EEDetId)(trkDir[i].detIdECAL);
455  }
456  }
457  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
458  if (trkDir[i].okHCAL) {
459  std::cout << " point " << trkDir[i].pointHCAL << " direction "
460  << trkDir[i].directionHCAL << " "
461  << (HcalDetId)(trkDir[i].detIdHCAL);
462  }
463  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
464  }
465  }
466 #endif
467  return trkDir;
468  }
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)
DetId getClosestCell(const GlobalPoint &r) const override
static const double etaBEHcal
Definition: CaloConstants.h:15
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
DetId getClosestCell(const GlobalPoint &r) const override
*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 470 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.

470  {
471 
472  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
473  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
475 
476  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
478  trkD.ok = trk.ok;
479  trkD.detIdECAL = DetId(0);
480  trkD.detIdHCAL = DetId(0);
481  trkD.detIdEHCAL= DetId(0);
482 #ifdef EDM_ML_DEBUG
483  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
484 #endif
485  if (trkD.ok) {
487  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
488  trkD.okECAL = info.ok;
489  trkD.pointECAL = point;
490  trkD.directionECAL = info.direction;
491  if (trkD.okECAL) {
492  if (std::abs(info.point.eta())<spr::etaBEEcal) {
493  trkD.detIdECAL = barrelGeom->getClosestCell(point);
494  } else {
495  trkD.detIdECAL = endcapGeom->getClosestCell(point);
496  }
497  trkD.detIdEHCAL = gHB->getClosestCell(point);
498  }
499 
501  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
502  trkD.okHCAL = info.ok;
503  trkD.pointHCAL = point;
504  trkD.directionHCAL = info.direction;
505  if (trkD.okHCAL) {
506  trkD.detIdHCAL = gHB->getClosestCell(point);
507  }
508  }
509 #ifdef EDM_ML_DEBUG
510  if (debug) {
511  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
512  if (trkD.okECAL) {
513  std::cout << "ECAL point " << trkD.pointECAL << " direction "
514  << trkD.directionECAL << " ";
515  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
516  std::cout << (EBDetId)(trkD.detIdECAL);
517  } else {
518  std::cout << (EEDetId)(trkD.detIdECAL);
519  }
520  }
521  if (trkD.okHCAL) {
522  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
523  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
524  }
525  if (trkD.okECAL) std::cout << " Or " << (HcalDetId)(trkD.detIdEHCAL);
526  std::cout << std::endl;
527  }
528 #endif
529  return trkD;
530  }
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)
DetId getClosestCell(const GlobalPoint &r) const override
static const double etaBEHcal
Definition: CaloConstants.h:15
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
DetId getClosestCell(const GlobalPoint &r) const override
*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 699 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().

706  {
707 
709 #ifdef EDM_ML_DEBUG
710  if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
711 #endif
712  FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
713 
716 
718 
719  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
720 
722  if (tpMomentum.eta() < 0) {
723  tsose = myAP.propagate(fts, *lendcap);
724  } else {
725  tsose = myAP.propagate(fts, *rendcap);
726  }
727 
728  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
729 
730  track.ok=true;
731  if (tsose.isValid() && tsosb.isValid()) {
732  float absEta = std::abs(tsosb.globalPosition().eta());
733  if (absEta < corner) {
734  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
735  track.direction = tsosb.globalDirection();
736  } else {
737  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
738  track.direction = tsose.globalDirection();
739  }
740  } else if (tsose.isValid()) {
741  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
742  track.direction = tsose.globalDirection();
743  } else if (tsosb.isValid()) {
744  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
745  track.direction = tsosb.globalDirection();
746  } else {
747  track.point.SetXYZ(-999., -999., -999.);
748  track.direction = GlobalVector(0,0,1);
749  track.ok = false;
750  }
751 #ifdef EDM_ML_DEBUG
752  if (debug) {
753  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
754  if (track.ok) {
755  math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
756  double dphi = track.direction.phi()-tpMomentum.phi();
757  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
758  double pt = tpMomentum.perp();
759  double rat = 0.5*dphi/std::sin(0.5*dphi);
760  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;
761  }
762  }
763 #endif
764  return track;
765  }
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, EcalEndcapGeometry::getClosestCell(), CaloSubdetectorGeometry::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  }
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)
DetId getClosestCell(const GlobalPoint &r) const override
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:510
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:567
DetId getClosestCell(const GlobalPoint &r) const override
*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 597 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().

597  {
598  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
599  GlobalVector momentum (track->px(), track->py(), track->pz());
600  int charge (track->charge());
601  return spr::propagateECAL (vertex, momentum, charge, bfield, debug);
602  }
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:627
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:639
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
int charge() const
track electric charge
Definition: TrackBase.h:567
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 604 of file CaloPropagateTrack.cc.

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

604  {
606  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
607  }
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 624 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().

624  {
625  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
626  GlobalVector momentum (track->px(), track->py(), track->pz());
627  int charge (track->charge());
628  return spr::propagateHCAL (vertex, momentum, charge, bfield, debug);
629  }
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:627
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:639
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
int charge() const
track electric charge
Definition: TrackBase.h:567
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 631 of file CaloPropagateTrack.cc.

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

631  {
633  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
634  }
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
spr::propagatedTrackDirection spr::propagateHCALBack ( 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 532 of file CaloPropagateTrack.cc.

References spr::trackAtOrigin::charge, gather_cfg::cout, spr::propagatedTrackDirection::detIdECAL, spr::propagatedTrackDirection::detIdEHCAL, spr::propagatedTrackDirection::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedTrackDirection::directionHCAL, etaBEHcal, CaloSubdetectorGeometry::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::pointHCAL, spr::trackAtOrigin::position, propagateCalo(), rBackHB, simTrackAtOrigin(), and zBackHE.

Referenced by HcalHBHEMuonSimAnalyzer::analyze(), and HcalHBHEMuonAnalyzer::analyze().

532  {
533 
535  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
537  trkD.ok = trk.ok;
538  trkD.detIdECAL = DetId(0);
539  trkD.detIdHCAL = DetId(0);
540  trkD.detIdEHCAL= DetId(0);
541 #ifdef EDM_ML_DEBUG
542  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
543 #endif
544  if (trkD.ok) {
546  GlobalPoint point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
547  trkD.okHCAL = info.ok;
548  trkD.pointHCAL = point;
549  trkD.directionHCAL = info.direction;
550  if (trkD.okHCAL) {
551  trkD.detIdHCAL = gHB->getClosestCell(point);
552  }
553  }
554 #ifdef EDM_ML_DEBUG
555  if (debug) {
556  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
557  if (trkD.okHCAL) {
558  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
559  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
560  }
561  }
562 #endif
563  return trkD;
564  }
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
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
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)
static const double rBackHB
Definition: CaloConstants.h:17
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::pair< bool, HcalDetId > spr::propagateHCALBack ( const reco::Track track,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 567 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.

567  {
569  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
570  GlobalVector momentum (track->px(), track->py(), track->pz());
571  int charge (track->charge());
573  if (info.ok) {
574  const GlobalPoint point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
575  return std::pair<bool,HcalDetId>(true,HcalDetId(gHB->getClosestCell(point)));
576  } else {
577  return std::pair<bool,HcalDetId>(false,HcalDetId());
578  }
579  }
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:627
static const double rBackHB
Definition: CaloConstants.h:17
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:639
virtual DetId getClosestCell(const GlobalPoint &r) const
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
int charge() const
track electric charge
Definition: TrackBase.h:567
*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:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 636 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.

636  {
637  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
638  GlobalVector momentum (track->px(), track->py(), track->pz());
639  int charge (track->charge());
641  return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
642  }
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:627
static const double rBackTB
Definition: CaloConstants.h:22
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:639
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
int charge() const
track electric charge
Definition: TrackBase.h:567
static const double etaBETrak
Definition: CaloConstants.h:23
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

Definition at line 644 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().

649  {
650 
651  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
652  GlobalVector momentum (track->px(), track->py(), track->pz());
653  int charge (track->charge());
654  float radius = track->outerPosition().Rho();
655  float zdist = track->outerPosition().Z();
656 #ifdef EDM_ML_DEBUG
657  if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;
658 #endif
659  FreeTrajectoryState fts (vertex, momentum, charge, bField);
662 
663  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
664 
665  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
666  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
667 
668  math::XYZPoint point(-999.,-999.,-999.);
669  bool ok=false;
670  GlobalVector direction(0,0,1);
671  if (tsosb.isValid() && std::abs(zdist) < spr::zFrontTE) {
672  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
673  direction = tsosb.globalDirection();
674  ok = true;
675  } else if (tsose.isValid()) {
676  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
677  direction = tsose.globalDirection();
678  ok = true;
679  }
680 
681  double length = -1;
682  if (ok) {
683  math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
684  double dphi = direction.phi()-momentum.phi();
685  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
686  double rat = 0.5*dphi/std::sin(0.5*dphi);
687  double dZ = vDiff.z();
688  double dS = rdist*rat; //dZ*momentum.z()/momentum.perp();
689  length = std::sqrt(dS*dS+dZ*dZ);
690 #ifdef EDM_ML_DEBUG
691  if (debug)
692  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;
693 #endif
694  }
695 
696  return std::pair<math::XYZPoint,double>(point,length);
697  }
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:627
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:639
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
#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:663
int charge() const
track electric charge
Definition: TrackBase.h:567
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:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
GlobalVector globalDirection() const
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 581 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().

581  {
582  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
583  GlobalVector momentum (track->px(), track->py(), track->pz());
584  int charge (track->charge());
585  return spr::propagateCalo (vertex, momentum, charge, bfield, spr::zFrontEE, spr::rFrontEB, spr::etaBEEcal, debug);
586  }
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:627
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:639
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
int charge() const
track electric charge
Definition: TrackBase.h:567
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
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 588 of file CaloPropagateTrack.cc.

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

588  {
589 
590  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
592  if (trk.ok)
594  return ptrk;
595  }
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 609 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().

609  {
610  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
611  GlobalVector momentum (track->px(), track->py(), track->pz());
612  int charge (track->charge());
613  return spr::propagateCalo (vertex, momentum, charge, bfield, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
614  }
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:627
static const double rFrontHB
Definition: CaloConstants.h:14
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:639
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
int charge() const
track electric charge
Definition: TrackBase.h:567
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
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 616 of file CaloPropagateTrack.cc.

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

616  {
617  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
619  if (trk.ok)
621  return ptrk;
622  }
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 767 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(), propagateHCALBack(), propagateTrackToECAL(), and propagateTrackToHCAL().

773  {
774 
775  spr::trackAtOrigin trk;
776 
777  edm::SimTrackContainer::const_iterator itr = SimTk->end();
778  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
779  if ( simTrkItr->trackId() == thisTrk ) {
780 #ifdef EDM_ML_DEBUG
781  if (debug) std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
782 #endif
783  itr = simTrkItr;
784  break;
785  }
786  }
787 
788  if (itr != SimTk->end()) {
789  int vertIndex = itr->vertIndex();
790  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
791  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
792  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
793  const math::XYZTLorentzVectorD pos = simVtxItr->position();
794  const math::XYZTLorentzVectorD mom = itr->momentum();
795  trk.ok = true;
796  trk.charge = (int)(itr->charge());
797  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
798  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
799  }
800  }
801 #ifdef EDM_ML_DEBUG
802  if (debug) std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;
803 #endif
804  return trk;
805  }
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 17 of file CaloSimInfo.cc.

References funct::abs(), funct::cos(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), JetChargeProducer_cfi::exp, CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, PV3DBase< T, PVType, FrameType >::mag(), point, 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().

17  {
18 
19  GlobalPoint point = (id.det() == DetId::Hcal) ?
20  ((HcalGeometry*)(geo->getSubdetectorGeometry(id)))->getPosition(id) :
21  geo->getPosition(id);
22  double R = point.mag();
23  double tmp = R/CLHEP::c_light/CLHEP::ns;
24 #ifdef EDM_ML_DEBUG
25  if (debug) {
26  DetId::Detector det = id.det();
27  int subdet = id.subdetId();
28  double eta = point.eta();
29  double theta = 2.0*atan(exp(-std::abs(eta)));
30  double dist = 0;
31  if (det == DetId::Ecal) {
32  if (subdet == static_cast<int>(EcalBarrel)) {
33  const double rEB = spr::rFrontEB*CLHEP::cm;
34  dist = rEB/sin(theta);
35  } else if (subdet == static_cast<int>(EcalEndcap)) {
36  const double zEE = spr::zFrontEE*CLHEP::cm;
37  dist = zEE/cos(theta);
38  } else {
39  const double zES = spr::zFrontES*CLHEP::cm;
40  dist = zES/cos(theta);
41  }
42  } else if (det == DetId::Hcal) {
43  if (subdet == static_cast<int>(HcalBarrel)) {
44  const double rHB = spr::rFrontHB*CLHEP::cm;
45  dist = rHB/sin(theta);
46  } else if (subdet == static_cast<int>(HcalEndcap)) {
47  const double zHE = spr::zFrontHE*CLHEP::cm;
48  dist = zHE/cos(theta);
49  } else if (subdet == static_cast<int>(HcalOuter)) {
50  const double rHO = spr::rFrontHO*CLHEP::cm;
51  dist = rHO/sin(theta);
52  } else {
53  const double zHF = spr::zFrontHF*CLHEP::cm;
54  dist = zHF/cos(theta);
55  }
56  }
57  double tmp1 = dist/CLHEP::c_light/CLHEP::ns;
58 
59  std::cout << "Detector " << det << "/" << subdet << " Eta/Theta " << eta
60  << "/" << theta/CLHEP::deg << " Dist " << dist/CLHEP::cm
61  << " R " << R << " TOF " << tmp << ":" << tmp1 << std::endl;
62  }
63 #endif
64  return tmp;
65  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
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
*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
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().