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 > &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, const 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)
 
std::pair< double, double > chargeIsolationCone (unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, 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, const 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, const 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, const 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, const 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_, const 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_ecal (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, std::vector< DetId > &coneRecHitDetIds, std::vector< double > &eHit, 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, int useRaw=0, 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, int useRaw=0, 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, int useRaw=0, 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, int useRaw=0, 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)
 
std::pair< double, bool > eECALmatrix (const HcalDetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const CaloGeometry *geo, const CaloTowerConstituentsMap *ctmap, const EcalSeverityLevelAlgo *sevlv, 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, int useRaw=0, 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, int useRaw=0, 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, int useRaw=0)
 
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, int useRaw=0)
 
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, int useRaw=0, 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)
 
std::pair< double, bool > energyECAL (const DetId &id, edm::Handle< EcalRecHitCollection > &hitsEC, const EcalSeverityLevelAlgo *sevlv, bool testSpike, double tMin, double tMax, bool debug)
 
std::pair< double, bool > energyECAL (const std::vector< DetId > &vdets, edm::Handle< EcalRecHitCollection > &hitsEC, const EcalSeverityLevelAlgo *sevlv, bool noThrCut, bool testSpike, double eThr, double tMin, double tMax, bool debug)
 
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, int useRaw=0, 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, int useRaw=0, int depthHE=3, 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, int depthHE=3, 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, int useRaw=0, 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, int useRaw=0, 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, int useRaw=0, bool debug=false)
 
double getEnergy (edm::PCaloHitContainer::const_iterator hit, int useRaw=0, 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, int useRaw=0, bool debug=false)
 
HcalDetId getHotCell (std::vector< std::vector< PCaloHit >::const_iterator > &hit, bool includeHO, int useRaw=0, bool debug=false)
 
double getRawEnergy (HBHERecHitCollection::const_iterator hit, int useRaw=0)
 
double getRawEnergy (edm::PCaloHitContainer::const_iterator hit, int useRaw=0)
 
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, const std::string &theTrackQuality, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, std::vector< spr::propagatedTrackID > &vdets, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const 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, const 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)
 
bool propagateHCAL (const reco::Track *track, const CaloGeometry *geo, const MagneticField *bField, bool typeRZ, const std::pair< double, double > rz, bool debug)
 
bool propagateHCAL (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool typeRZ, const std::pair< double, double > rz, bool debug)
 
std::pair< HcalDetId, HcalDetIdpropagateHCAL (const CaloGeometry *geo, const MagneticField *bField, const GlobalPoint &vertex, const GlobalVector &momentum, int charge, bool typeRZ, const std::pair< double, double > rz, bool debug)
 
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< DetId, bool > propagateIdECAL (const HcalDetId &id, const CaloGeometry *geo, const MagneticField *, 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 > &  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,
const std::string &  theTrackQuality,
bool  debug = false 
)

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:654
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:134
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
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 182 of file ChargeIsolation.cc.

References mps_fire::i.

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

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

Definition at line 250 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(), HcalIsoTrkAnalyzer::fillTree(), AlCaIsoTracksFilter::filter(), IsoTrig::getGoodTracks(), AlCaIsoTracksProducer::select(), IsoTrig::studyIsolation(), IsoTrig::studyMipCut(), and IsoTrig::StudyTrkEbyP().

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

Definition at line 275 of file ChargeIsolation.cc.

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

275  {
276 
277  double maxNearP = -1.0;
278  double sumP = 0;
279  if (trkDirs[trkIndex].okHCAL) {
280 #ifdef EDM_ML_DEBUG
281  if (debug) std::cout << "chargeIsolationCone with " << trkDirs.size() << " tracks " << std::endl;
282 #endif
283  for (unsigned int indx=0; indx<trkDirs.size(); ++indx) {
284  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
285  int isConeChargedIso = spr::coneChargeIsolation(trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
286  if (isConeChargedIso==0) {
287  const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
288  sumP += (pTrack->p());
289  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
290  }
291  }
292  }
293  }
294 #ifdef EDM_ML_DEBUG
295  if (debug) std::cout << "chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL << " maxNearP " << maxNearP << ":" << sumP <<std::endl;
296 #endif
297  return std::pair<double,double>(maxNearP,sumP);
298  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
double coneChargeIsolation(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, const std::string &theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
#define debug
Definition: HDRShower.cc:19
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,
const 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, CaloSubdetectorGeometry::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 
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:654
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
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:134
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
double spr::chargeIsolationEcal ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackID > &  vdetIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 15 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(), IsolatedTracksNxN::analyze(), and HcalIsoTrkAnalyzer::fillTree().

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

Definition at line 46 of file ChargeIsolation.cc.

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

46  {
47 
50 
51  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
52 #ifdef EDM_ML_DEBUG
53  if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
54 #endif
55  double maxNearP = -1.0;
57 
58  // const DetId anyCell,
59  reco::TrackCollection::const_iterator trkItr2;
60  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
61 
62  const reco::Track* pTrack2 = &(*trkItr2);
63 
64  bool trkQuality = (trackQuality_ != reco::TrackBase::undefQuality) ?
65  (pTrack2->quality(trackQuality_)) : true;
66  if ( (trkItr2 != trkItr) && trkQuality ) {
67 
68  std::pair<math::XYZPoint,bool> info = spr::propagateECAL(pTrack2,bField);
69  const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());
70 
71  if (info.second) {
72  if (std::abs(point2.eta())<spr::etaBEEcal) {
73  const DetId anyCell = barrelGeom->getClosestCell(point2);
74  if (!spr::chargeIsolation(anyCell,vdets)) {
75 #ifdef EDM_ML_DEBUG
76  if (debug) std::cout << "chargeIsolationEcal Cell " << (EBDetId)(anyCell) << " pt " << pTrack2->p() << std::endl;
77 #endif
78  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
79  }
80  } else {
81  if (endcapGeom) {
82  const DetId anyCell = endcapGeom->getClosestCell(point2);
83  if (!spr::chargeIsolation(anyCell,vdets)) {
84 #ifdef EDM_ML_DEBUG
85  if (debug) std::cout << "chargeIsolationEcal Cell " << (EEDetId)(anyCell) << " pt " << pTrack2->p() << std::endl;
86 #endif
87  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
88  }
89  }
90  }
91  } //info.second
92  }
93  }
94  return maxNearP;
95  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
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)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
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,
const 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 
158 #ifdef EDM_ML_DEBUG
159  if (debug) {
160  for (unsigned int i=0; i<vdets.size(); i++) {
161  std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
162  }
163  }
164 #endif
165  double maxNearP = -1.0;
166  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
167 
168  reco::TrackCollection::const_iterator trkItr2;
169  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
170 
171  const reco::Track* pTrack2 = &(*trkItr2);
172 
173  bool trkQuality = pTrack2->quality(trackQuality_);
174  if ( (trkItr2 != trkItr) && trkQuality ) {
175  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
176  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
177  const GlobalPoint point2(info2.trkGlobPosAtHcal.x(),info2.trkGlobPosAtHcal.y(),info2.trkGlobPosAtHcal.z());
178 
179 #ifdef EDM_ML_DEBUG
180  if (debug) {
181  std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
182  }
183 #endif
184  if (info2.isGoodHcal ) {
185  const DetId anyCell = gHB->getClosestCell(point2);
186 #ifdef EDM_ML_DEBUG
187  if (debug) std::cout << "chargeIsolation:: HCAL cell " << (HcalDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
188 #endif
189  if (!spr::chargeIsolation(anyCell,vdets)) {
190  if(maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
191  }
192 #ifdef EDM_ML_DEBUG
193  if (debug){
194  std::cout << "maxNearP " << maxNearP << " thisCell "
195  << (HcalDetId)anyCell << " ("
196  << info2.trkGlobPosAtHcal.x() << ","
197  << info2.trkGlobPosAtHcal.y() <<","
198  << info2.trkGlobPosAtHcal.z() <<")" << std::endl;
199  }
200 #endif
201  }
202  }
203  }
204  return maxNearP;
205  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
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:684
math::XYZPoint trkGlobPosAtHcal
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:690
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
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 97 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().

97  {
98 
99  std::vector<DetId> dets(1,vdetIds[trkIndex].detIdHCAL);
100 #ifdef EDM_ML_DEBUG
101  if (debug) {
102  std::cout << "DetId " << (HcalDetId)(dets[0]) << " Flag " << vdetIds[trkIndex].okHCAL << std::endl;
103  }
104 #endif
105  double maxNearP = -1.0;
106  if (vdetIds[trkIndex].okHCAL) {
107  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
108 #ifdef EDM_ML_DEBUG
109  if (debug) std::cout << "chargeIsolationHcal:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
110 #endif
111  for (unsigned indx = 0; indx<vdetIds.size(); ++indx) {
112  if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okHCAL) {
113  const DetId anyCell = vdetIds[indx].detIdHCAL;
114  if (!spr::chargeIsolation(anyCell,vdets)) {
115  const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
116 #ifdef EDM_ML_DEBUG
117  if (debug) std::cout << "chargeIsolationHcal Cell " << (HcalDetId)(anyCell) << " pt " << pTrack->p() << std::endl;
118 #endif
119  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
120  }
121  }
122  }
123  }
124  return maxNearP;
125  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
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,
const std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 129 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(), reco::TrackBase::qualityByName(), and reco::TrackBase::undefQuality.

129  {
130 
131  std::vector<DetId> dets(1,ClosestCell);
132 #ifdef EDM_ML_DEBUG
133  if (debug) std::cout << (HcalDetId) ClosestCell << std::endl;
134 #endif
135  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
136 
137 #ifdef EDM_ML_DEBUG
138  if (debug) {
139  for (unsigned int i=0; i<vdets.size(); i++) {
140  std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
141  }
142  }
143 #endif
144  double maxNearP = -1.0;
145  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
146 
147  reco::TrackCollection::const_iterator trkItr2;
148  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
149 
150  const reco::Track* pTrack2 = &(*trkItr2);
151 
152  bool trkQuality = (trackQuality_ != reco::TrackBase::undefQuality) ?
153  (pTrack2->quality(trackQuality_)) : true;
154  if ( (trkItr2 != trkItr) && trkQuality ) {
155  std::pair<math::XYZPoint,bool> info = spr::propagateHCAL(pTrack2,bField);
156  const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());
157 
158 #ifdef EDM_ML_DEBUG
159  if (debug) {
160  std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
161  }
162 #endif
163  if (info.second) {
164  const DetId anyCell = gHB->getClosestCell(point2);
165  if (!spr::chargeIsolation(anyCell,vdets)) {
166  if(maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
167  }
168 #ifdef EDM_ML_DEBUG
169  if (debug){
170  std::cout << "maxNearP " << maxNearP << " thisCell "
171  << (HcalDetId)anyCell << " ("
172  << info.first.x() << "," << info.first.y() <<","
173  << info.first.z() << ")" << std::endl;
174  }
175 #endif
176  }
177  }
178  }
179  return maxNearP;
180  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
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:684
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:690
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
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_,
const 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 193 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(), TrackDetMatchInfo::trkGlobPosAtHcal, and reco::TrackBase::undefQuality.

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

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

Definition at line 300 of file ChargeIsolation.cc.

References getDistInPlaneTrackDir().

300  {
301 
302  int isIsolated = 1;
303  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR) isIsolated = 1;
304  else isIsolated = 0;
305  return isIsolated;
306  }
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, triggerObjects_cff::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  }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
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_ecal ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
std::vector< DetId > &  coneRecHitDetIds,
std::vector< double > &  eHit,
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,
int  useRaw = 0,
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,
int  useRaw = 0,
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,
int  useRaw = 0,
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,
int  useRaw = 0,
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 71 of file eECALMatrix.cc.

References gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, energyECAL(), RemoveAddSevLevel::flag, EcalSeverityLevel::kWeird, matrixECALIds(), and EcalSeverityLevelAlgo::severityLevel().

80  {
81 
82  std::vector<DetId> vdets;
83  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
84 #ifdef EDM_ML_DEBUG
85  if (debug) {
86  std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
87  << " nXtals " << vdets.size() << std::endl;
88  }
89 #endif
90  bool flag(true);
91  for (const auto& id : vdets) {
92  if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalBarrel)) {
93  if (sevlv->severityLevel(id,(*hitsEB)) == EcalSeverityLevel::kWeird)
94  flag = false;
95  } else if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalEndcap)) {
96  if (sevlv->severityLevel(id,(*hitsEE)) == EcalSeverityLevel::kWeird)
97  flag = false;
98  }
99  }
100  return std::pair<double,bool>(spr::energyECAL(vdets,hitsEB,hitsEE,ebThr,eeThr,tMin,tMax,debug),flag);
101  }
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)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
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::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 103 of file eECALMatrix.cc.

References gather_cfg::cout, TauDecayModes::dec, DetId::Ecal, EcalBarrel, EcalEndcap, energyECAL(), energyECALTower(), CastorDataFrameFilter_impl::energySum(), RemoveAddSevLevel::flag, matrixECALIds(), and convertSQLiteXML::ok.

113  {
114 
115  std::vector<DetId> vdets;
116  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
117 #ifdef EDM_ML_DEBUG
118  if (debug) {
119  std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
120  << " nXtals " << vdets.size() << std::endl;
121  }
122 #endif
123 
124  bool flag(true);
125  double energySum = 0.0;
126  for (const auto & id : vdets) {
127  if ((id != DetId(0)) && (id.det() == DetId::Ecal) &&
128  ((id.subdetId()==EcalBarrel) || (id.subdetId()==EcalEndcap))) {
129  double eTower = spr::energyECALTower(id, hitsEB, hitsEE, ttMap, debug);
130  bool ok = (id.subdetId()==EcalBarrel) ? (eTower > ebThr) : (eTower > eeThr);
131 #ifdef EDM_ML_DEBUG
132  if (debug && (!ok)) std::cout << "Crystal 0x" << std::hex << id()
133  << std::dec << " Flag " << ok <<std::endl;
134 #endif
135  if (ok) {
136  std::pair<double,bool> ecalEn = (id.subdetId()==EcalBarrel) ?
137  spr::energyECAL(id,hitsEB,sevlv,true,tMin,tMax,debug) :
138  spr::energyECAL(id,hitsEE,sevlv,false,tMin,tMax,debug);
139  if (!ecalEn.second) flag = false;
140  energySum += ecalEn.first;
141  }
142  }
143  }
144 #ifdef EDM_ML_DEBUG
145  if (debug) std::cout << "energyECAL: energySum = " << energySum
146  << " flag = " << flag << std::endl;
147 #endif
148  return std::pair<double,bool>(energySum,flag);
149  }
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)
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: DetId.h:18
#define debug
Definition: HDRShower.cc:19
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)
std::pair< double, bool > spr::eECALmatrix ( const HcalDetId detId,
edm::Handle< EcalRecHitCollection > &  hitsEB,
edm::Handle< EcalRecHitCollection > &  hitsEE,
const CaloGeometry geo,
const CaloTowerConstituentsMap ctmap,
const EcalSeverityLevelAlgo sevlv,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 151 of file eECALMatrix.cc.

References CaloTowerConstituentsMap::constituentsOf(), gather_cfg::cout, TauDecayModes::dec, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, energyECAL(), RemoveAddSevLevel::flag, DetId::Hcal, mps_fire::i, EcalSeverityLevel::kWeird, EcalSeverityLevelAlgo::severityLevel(), and CaloTowerConstituentsMap::towerOf().

158  {
159 
160  CaloTowerDetId tower = ctmap->towerOf(detId);
161  std::vector<DetId> ids = ctmap->constituentsOf(tower);
162 #ifdef EDM_ML_DEBUG
163  if (debug) {
164  std::cout << "eECALmatrix: " << detId << " belongs to " << tower
165  << " which has " << ids.size() << " constituents" << std::endl;
166  for (unsigned int i=0; i<ids.size(); ++i) {
167  std::cout << "[" << i << "] " << std::hex << ids[i].rawId() <<std::dec;
168  if (ids[i].det()==DetId::Ecal && ids[i].subdetId()==EcalBarrel){
169  std::cout << " " << EBDetId(ids[i]) << std::endl;
170  } else if (ids[i].det()==DetId::Ecal && ids[i].subdetId()==EcalEndcap){
171  std::cout << " " << EEDetId(ids[i]) << std::endl;
172  } else if (ids[i].det()==DetId::Ecal && ids[i].subdetId()==EcalPreshower) {
173  std::cout << " " << ESDetId(ids[i]) << std::endl;
174  } else if (ids[i].det()==DetId::Hcal) {
175  std::cout << " " << HcalDetId(ids[i]) << std::endl;
176  } else {
177  std::cout << std::endl;
178  }
179  }
180  }
181 #endif
182  std::vector<DetId> idEBEE;
183  bool flag(true);
184  for (const auto& id : ids) {
185  if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalBarrel)) {
186  idEBEE.emplace_back(id);
187  if (sevlv->severityLevel(id,(*hitsEB)) == EcalSeverityLevel::kWeird)
188  flag = false;
189  } else if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalEndcap)) {
190  idEBEE.emplace_back(id);
191  if (sevlv->severityLevel(id,(*hitsEE)) == EcalSeverityLevel::kWeird)
192  flag = false;
193  }
194  }
195 #ifdef EDM_ML_DEBUG
196  if (debug)
197  std::cout << "eECALmatrix: with " << idEBEE.size() << " EB+EE hits and "
198  << "spike flag " << flag << std::endl;
199 #endif
200  double etot = (!idEBEE.empty()) ?
201  spr::energyECAL(idEBEE,hitsEB,hitsEE,ebThr,eeThr,tMin,tMax,debug) : 0;
202  return std::pair<double,bool>(etot,flag);
203  }
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)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
#define debug
Definition: HDRShower.cc:19
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,
int  useRaw = 0,
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 protons_cff::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:235
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,
int  useRaw = 0,
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,
int  useRaw = 0 
)
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,
int  useRaw = 0 
)
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,
int  useRaw = 0,
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, globals_cff::id1, 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:146
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
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 235 of file eHCALMatrix.cc.

References HcalEndcap, HcalForward, and HcalOuter.

Referenced by eHCALmatrix(), and energyHCALCell().

236  {
237  double eThr = hbThr;
238  if (subdet == (int)(HcalEndcap)) eThr = heThr;
239  else if (subdet == (int)(HcalForward)) eThr = hfThr;
240  else if (subdet == (int)(HcalOuter)) eThr = hoThr;
241  return eThr;
242  }
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 
)
std::pair<double,bool> spr::energyECAL ( const DetId id,
edm::Handle< EcalRecHitCollection > &  hitsEC,
const EcalSeverityLevelAlgo sevlv,
bool  testSpike,
double  tMin,
double  tMax,
bool  debug 
)

Definition at line 15 of file eECALMatrix.cc.

References gather_cfg::cout, TauDecayModes::dec, edm::SortedCollection< T, SORT >::end(), findHit(), RemoveAddSevLevel::flag, hfClusterShapes_cfi::hits, triggerObjects_cff::id, edm::HandleBase::isValid(), EcalSeverityLevel::kWeird, edm::Handle< T >::product(), EcalSeverityLevelAlgo::severityLevel(), and groupFilesInBlocks::tt.

19  {
20  std::vector<EcalRecHitCollection::const_iterator> hits;
21  spr::findHit(hitsEC,id,hits,debug);
22 #ifdef EDM_ML_DEBUG
23  if (debug) std::cout << "Xtal 0x" << std::hex << id() <<std::dec;
24 #endif
25  const EcalRecHitCollection* recHitsEC = (hitsEC.isValid()) ? hitsEC.product() : nullptr;
26  bool flag = (!testSpike) ? true :
27  (sevlv->severityLevel(id,(*recHitsEC)) != EcalSeverityLevel::kWeird);
28  double ener(0);
29  for (const auto& hit : hits) {
30  double en(0), tt(0);
31  if (hit != hitsEC->end()) {
32  en = hit->energy();
33  tt = hit->time();
34  }
35 #ifdef EDM_ML_DEBUG
36  if (debug) std::cout << " " << tt << " " << en;
37 #endif
38  if (tt > tMin && tt < tMax) ener += en;
39  }
40 #ifdef EDM_ML_DEBUG
41  if (!flag && debug) std::cout << " detected to be a spike";
42  if (debug) std::cout << std::endl;
43 #endif
44  return std::pair<double,bool>(ener,flag);
45  }
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)
bool isValid() const
Definition: HandleBase.h:74
const_iterator end() const
#define debug
Definition: HDRShower.cc:19
T const * product() const
Definition: Handle.h:74
std::pair<double,bool> spr::energyECAL ( const std::vector< DetId > &  vdets,
edm::Handle< EcalRecHitCollection > &  hitsEC,
const EcalSeverityLevelAlgo sevlv,
bool  noThrCut,
bool  testSpike,
double  eThr,
double  tMin,
double  tMax,
bool  debug 
)

Definition at line 47 of file eECALMatrix.cc.

References gather_cfg::cout, energyECAL(), CastorDataFrameFilter_impl::energySum(), and RemoveAddSevLevel::flag.

51  {
52 
53  bool flag(true);
54  double energySum(0.0);
55  for (const auto& id : vdets) {
56  if (id != DetId(0)) {
57  std::pair<double,bool> ecalEn = spr::energyECAL(id,hitsEC,sevlv,
58  testSpike,tMin,tMax,
59  debug);
60  if (!ecalEn.second) flag = false;
61  if ((ecalEn.first>eThr) || noThrCut) energySum += ecalEn.first;
62  }
63  }
64 #ifdef EDM_ML_DEBUG
65  if (debug) std::cout << "energyECAL: energySum = " << energySum
66  << " flag = " << flag << std::endl;
67 #endif
68  return std::pair<double,bool>(energySum,flag);
69  }
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)
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
double energySum(const DataFrame &df, int fs, int ls)
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,
int  useRaw = 0,
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,
int  useRaw = 0,
int  depthHE = 3,
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,
int  depthHE = 3,
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 protons_cff::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 #ifdef EDM_ML_DEBUG
129  if (debug)
130  std::cout << "energyHCALCell: input ID " << detId << " MaxDepth " << maxDepth << " Threshold (E) " << eThr << " (T) " << tMin << ":" << tMax << std::endl;
131 #endif
132  for (int i=0; i<maxDepth; i++) {
133  HcalSubdetector subdet0 = (hbhe) ? ((i+1 >= depthHE) ? HcalEndcap : HcalBarrel) : detId.subdet();
134  HcalDetId hcid(subdet0,detId.ieta(),detId.iphi(),i+1);
135  DetId det(hcid.rawId());
136  std::vector<std::vector<PCaloHit>::const_iterator> hit = spr::findHit(hits, det);
137  double energy(0);
138  for (unsigned int ihit=0; ihit<hit.size(); ++ihit) {
139  if (hit[ihit]->time() > tMin && hit[ihit]->time() < tMax)
140  energy += hit[ihit]->energy();
141 #ifdef EDM_ML_DEBUG
142  if (debug)
143  std::cout << "energyHCALCell:: Hit[" << ihit << "] " << hcid << " E " << hit[ihit]->energy() << " t " << hit[ihit]->time() << std::endl;
144 #endif
145  }
146 #ifdef EDM_ML_DEBUG
147  if (debug)
148  std::cout << "energyHCALCell:: Cell " << hcid << " E " << energy << " from " << hit.size() << " threshold " << eThr << std::endl;
149 #endif
150  if (energy>eThr && !hit.empty()) {
151  energyCell.push_back(std::pair<double,int>(energy,i+1));
152  }
153  }
154 #ifdef EDM_ML_DEBUG
155  if (debug) {
156  std::cout << "energyHCALCell:: " << energyCell.size() << " entries from "
157  << maxDepth << " depths:";
158  for (unsigned int i=0; i<energyCell.size(); ++i) {
159  std::cout << " [" << i << "] (" << energyCell[i].first << ":"
160  << energyCell[i].second << ")";
161  }
162  std::cout << std::endl;
163  }
164 #endif
165  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
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:235
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
HcalSubdetector
Definition: HcalAssistant.h:31
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:154
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
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,
int  useRaw = 0,
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,
int  useRaw = 0,
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, EcalEndcapGeometry::present(), EcalBarrelGeometry::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 && endcapGeom) {
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;
790  }
791 #endif
792  }
bool present(const DetId &id) const override
is this detid present in the geometry?
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
bool present(const DetId &id) const override
is this detid present in the geometry?
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
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(), LaserTask::_dump(), LEDTask::_process(), DigiTask::_process(), ParticleDecayDrawer::accept(), ParticleTreeDrawer::accept(), HcalHBHEMuonAnalyzer::activeLength(), DTVDriftCalibration::cellInfo::add(), Measurement::addAffectingEntriesFromOptO(), reco::CompositeCandidate::addDaughter(), reco::NamedCompositeCandidate::addDaughter(), reco::PFDisplacedVertexSeed::addElement(), CRackTrajectoryBuilder::AddHit(), CSCNeutronReader::addHits(), ClusterTPAssociation::addKeyID(), 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(), FCDTask::analyze(), SiStripDetVOffPrinter::analyze(), DQMHcalIsolatedBunchAlCaReco::analyze(), DTT0CalibrationRMS::analyze(), SiStripApvGainBuilderFromTag::analyze(), DQMSourcePi0::analyze(), EcalDumpRaw::analyze(), DTNoiseCalibration::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), HcalQIEDataCheck::analyze(), ParticleListDrawer::analyze(), DTT0Calibration::analyze(), HcalAutoPedestalValidator::analyze(), RecAnalyzerHF::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), HLTBTagPerformanceAnalyzer::analyze(), DQMHcalIsoTrackAlCaReco::analyze(), edmtest::HcalDumpConditions::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), HcalCollapseAnalyzer::analyze(), TestPythiaDecays::analyze(), HcalGainsCheck::analyze(), AlignPCLThresholdsWriter::analyze(), PixelLumiDQM::analyze(), SiStripChannelGainFromDBMiscalibrator::analyze(), SiStripNoisesFromDBMiscalibrator::analyze(), EcalURecHitHists::analyze(), HeavyFlavorValidation::analyze(), TestTrackHits::analyze(), TestOutliers::analyze(), L1TGT::analyze(), HLTMuonPlotter::analyze(), ListIds::analyze(), HGCalHitValidation::analyze(), EcalCosmicsHists::analyze(), RecAnalyzerMinbias::analyze(), CommonModeAnalyzer::analyze(), IsoTrackCalibration::analyze(), DTDigiTask::analyze(), HcalIsoTrkAnalyzer::analyze(), IsoTrig::analyze(), PrimaryVertexAnalyzer4PUSlimmed::analyze(), any(), CaloTowersCreationAlgo::assignHitEcal(), 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(), SiStripFedCabling::buildFedCabling(), SiStripDetVOffBuilder::buildPSUdetIdMap(), PFEGammaAlgo::buildRefinedSuperCluster(), VirtualJetProducer::JetType::byName(), HLTEcalResonanceFilter::calcShowerShape(), HLTRegionalEcalResonanceFilter::calcShowerShape(), PtAssignmentEngine2016::calculate_pt_xml(), PtAssignmentEngine2017::calculate_pt_xml(), JetPlusTrackProducerAA::calculateBGtracksJet(), PFEGammaAlgo::calculateEleMVA(), PileUpSubtractor::calculateOrphanInput(), ValidationOptions_cff::calledBycmsRun(), BestTrackSelection::cancel_multi_bx(), BestTrackSelection::cancel_one_bx(), reco::modules::CandCombinerBase::CandCombinerBase(), RunLumiEventChecker::check(), CSCDCCExaminer::check(), Config::checkImportPermission(), ClusterTPAssociation::checkKeyProductID(), Multi5x5ClusterAlgo::checkMaxima(), GlobalTag.GlobalTag::checkPrefix(), checkrunlist(), ECALpedestalPCLHarvester::checkStatusCode(), MaterialBudgetAction::CheckTouchableInSelectedVolumes(), L1TMuon::DTBunchCrossingCleaner::clean(), BlockFormatter::CleanUp(), l1t::IntervalManager< TimeType, PayloadType >::clear(), LowPtGsfElectronSCProducer::closestCluster(), 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(), logErrorHarvester_cff::customiseLogErrorHarvesterUsingOutputCommands(), DDfetch(), ParticleDecayDrawer::decay(), gen::Py8InterfaceBase::declareSpecialSettings(), gen::Pythia6Hadronizer::declareSpecialSettings(), Model::deleteOptO(), muonisolation::CaloExtractor::deposit(), SiStripFineDelayHit::detId(), edm::DetSetRefVector< T, C >::DetSetRefVector(), PixelInactiveAreaFinder::detWorks(), SiPixelGainCalibrationAnalysis::doFits(), HLTEcalResonanceFilter::doSelection(), HLTRegionalEcalResonanceFilter::doSelection(), SUSY_HLT_DoubleMuon_Hadronic::dqmBeginRun(), SUSY_HLT_Muon_BJet::dqmBeginRun(), SUSY_HLT_DoubleEle_Hadronic::dqmBeginRun(), SUSY_HLT_Electron_BJet::dqmBeginRun(), SUSY_HLT_DiJet_MET::dqmBeginRun(), SUSY_HLT_ElecFakes::dqmBeginRun(), SUSY_HLT_Muon_Hadronic::dqmBeginRun(), SUSY_HLT_MuonFakes::dqmBeginRun(), SUSY_HLT_VBF_Mu::dqmBeginRun(), SUSY_HLT_MuEle_Hadronic::dqmBeginRun(), SUSY_HLT_alphaT::dqmBeginRun(), DTDCSByLumiTask::dqmBeginRun(), HGCGeometryValidation::dqmBeginRun(), HGCalHitValidation::dqmBeginRun(), SusyPostProcessor::dqmEndJob(), SiStripGainsPCLHarvester::dqmEndJob(), JetMETHLTOfflineClient::dqmEndJob(), DTSegtoRPC::DTSegtoRPC(), RPCLinkSynchroStat::dumpDelays(), edmtest::HcalDumpConditions::dumpIt(), CastorDumpConditions::dumpIt(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::dumpPython(), CaloTowersCreationAlgo::ecalChanStatusForCaloTower(), EcalPreshowerMonitorClient::EcalPreshowerMonitorClient(), ESListOfFEDSProducer::Egamma(), EcalListOfFEDSProducer::Egamma(), EmbeddingLHEProducer::EmbeddingLHEProducer(), hcaldqm::RawRunSummary::endLuminosityBlock(), TPTask::endLuminosityBlock(), RawTask::endLuminosityBlock(), RecHitTask::endLuminosityBlock(), DigiTask::endLuminosityBlock(), L1ScalersClient::endLuminosityBlock(), SiPixelStatusHarvester::endRunProduce(), GsfVertexTrackCompatibilityEstimator::estimate(), KalmanVertexTrackCompatibilityEstimator< N >::estimate(), LowPtGsfElectronIDProducer::eval(), lowptgsfeleid::HeavyObjectCache::eval(), lowptgsfeleseed::HeavyObjectCache::eval(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), JetPlusTrackCorrector::excludeJta(), edm::ParameterSet::existsAs(), CompositeAlignmentParameters::extractAlignables(), CompositeAlignmentParameters::extractPositionAndLength(), CompositeAlignmentDerivativesExtractor::extractWithMultipleHits(), SiPixelFedCablingMap::fedIds(), DaqScopeModeTask::fill(), VertexFitterResult::fill(), tnp::ProbeFlag::fill(), EmbeddingLHEProducer::fill_lhe_with_particle(), JetPartonMatcher::fillAlgoritDefinition(), SiPixelActionExecutor::fillFEDErrorSummary(), PhysicsTools::MVATrainer::fillInputVars(), Py8toJetInput::fillJetAlgoInput(), GenWeightsTableProducer::fillLHEWeightTables(), 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(), AlCaIsolatedBunchFilter::filter(), AlCaIsolatedBunchSelector::filter(), AlCaIsoTracksProducerFilter::filter(), EcalSimpleUncalibRecHitFilter::filter(), AlCaHBHEMuonFilter::filter(), AlCaHEMuonFilter::filter(), AlCaLowPUHBHEMuonFilter::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(), RPixPlaneCombinatoryTracking::findTracks(), EcalTBReadout::findTTlist(), edm::IndexIntoFile::fixIndexes(), cmsHarvester.CMSHarvester::format_conditions_string(), ecaldqm::DependencySet::formSequence(), ecaldqm::DependencySet::formSequenceFragment_(), XtoFFbarFilter::found(), getRunInfo::Func_FillInfoDBS(), getRunInfo::Func_FillInfoRunRegistry(), 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(), egHLT::ComCodes::getCode(), egHLT::TrigCodes::getCode(), hcalCalib::GetCoefFromMtrxInvOfAve(), HcalLutManager::getCompressionLutXmlFromAsciiMaster(), HcalLutManager::getCompressionLutXmlFromCoder(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), HLTScalersClient::CountLSFifo_t::getCount(), hcaldqm::utilities::getCrateList(), GenParticlePruner::getDaughterKeys(), TrackingParticleSelectorByGen::getDaughterKeys(), EgammaHadTower::getDepth1HcalESum(), EgammaHadTower::getDepth2HcalESum(), EcalElectronicsMapping::getDetId(), TrackAssociatorByHitsImpl::getDoubleCount(), QuickTrackAssociatorByHitsImpl::getDoubleCount(), EcalElectronicsMapping::getElectronicsId(), edm::eventsetup::EventSetupsController::getESProducerPSet(), HcalDDDRecConstants::getEtaBins(), SiPixelActionExecutor::getFEDSummaryME(), SiPixelActionExecutor::getGrandSummaryME(), edm::eventsetup::EventSetupRecord::getHandleImpl(), HcalLutManager::getHEFineGrainLUTs(), 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(), TrackingParticleSelectorByGen::getMotherKeys(), popcon::EcalPulseShapesHandler::getNewObjects(), popcon::EcalPulseSymmCovariancesHandler::getNewObjects(), UMNioTask::getOrbitGapIndex(), LMFCorrCoefDat::getParameters(), SiStripSummary::getPosition(), HDQMSummary::getPosition(), JME::JetResolutionScaleFactor::getScaleFactor(), TrackAssociatorByHitsImpl::getShared(), MEtXYcorrectParametersCollection::getShiftDataFlavBin(), MEtXYcorrectParametersCollection::getShiftDyFlavBin(), MEtXYcorrectParametersCollection::getShiftMcFlavBin(), MEtXYcorrectParametersCollection::getShiftTTJetsFlavBin(), MEtXYcorrectParametersCollection::getShiftWJetsFlavBin(), SiPixelFEDChannelContainer::getSiPixelBadFedChannelsInDetId(), EgammaRecHitIsolation::getSum_(), SiPixelActionExecutor::getSummaryME(), fwlite::MultiChainEvent::getThinnedProducts(), CSCUpgradeMotherboard::LCTContainer::getTimeMatched(), EcalElectronicsMapping::getTriggerElectronicsId(), HGCalWaferType::getType(), 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(), CSCDBL1TPParametersExtended::getValueBool(), CSCDBL1TPParametersExtended::getValueInt(), CastorRawGains::getValues(), HcalRawGains::getValues(), HcalLutManager::getZdcLutXml(), GenWeightsTableProducer::globalBeginRun(), RawPCCProducer::globalEndLuminosityBlockProduce(), 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(), HcalRawToDigi::HcalRawToDigi(), HcalRecHitsDQMClient::HcalRecHitsEndjob(), HLTPixelActivityFilter::hltFilter(), HLTMuonTrackMassFilter::hltFilter(), HLTMuonL1RegionalFilter::hltFilter(), HLTMuonL1TFilter::hltFilter(), HLTMuonL1TRegionalFilter::hltFilter(), HLTMuonL2PreFilter::hltFilter(), HLTMuonL2FromL1TPreFilter::hltFilter(), HLTMuonL1Filter::hltFilter(), HLTHcalSimpleRecHitFilter::hltFilter(), GenHFHadronMatcher::idInList(), PixelInactiveAreaFinder::inactiveAreas(), include(), reco::PixelClusterCounts::increment(), pat::TriggerPath::indexModule(), MSLayersKeeperX0Averaged::init(), JetCorrectorParametersHelper::init(), SiPixelDigitizerAlgorithm::init(), CAHitTripletGenerator::initEvent(), CAHitQuadrupletGenerator::initEvent(), SiStripDetKey::initFromPath(), SiStripFecKey::initFromPath(), SiStripFedKey::initFromPath(), XrdAdaptor::RequestManager::initialize(), GenericTriggerEventFlag::initRun(), HBHEHitMap::insert(), 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(), PPSFilteredProtonProducer::IsTrackOK(), HLTMuonL2ToL1Map::isTriggeredByL1(), HLTMuonL2ToL1TMap::isTriggeredByL1(), HcalLayerDepthMap::isValid(), JetCorrectionESChain::JetCorrectionESChain(), pat::JetCorrFactorsProducer::JetCorrFactorsProducer(), EcalListOfFEDSProducer::Jets(), ESListOfFEDSProducer::Jets(), L1MuGMTHWFileReader::L1MuGMTHWFileReader(), L1TCaloLayer1FetchLUTs(), JsonOutputProducer::labelId(), HGVHistoProducerAlgo::layerClusters_to_CaloParticles(), PerformancePayloadFromBinnedTFormula::limitPos(), PerformancePayloadFromTFormula::limitPos(), CSCGasCollisions::lnEnergyLoss(), DefaultFFTJetRcdMapper< FFTPFJetCorrectorSequence >::load(), L1MuGMTLUT::Load(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometryHexagon8(), edm::service::MessageServicePSetValidation::lookForMatch(), edm::eventsetup::EventSetupsController::lookForMatches(), CommonMethods::ls(), main(), reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >::make(), HybridClusterAlgo::makeClusters(), CaloTowersCreationAlgo::makeEcalBadChs(), HSCPValidator::makeGenPlots(), HiBremRecoveryClusterAlgo::makeIslandSuperClusters(), EgammaHLTNxNClusterProducer::makeNxNClusters(), HSCPValidator::makeRecoPlots(), HSCPValidator::makeSimDigiPlotsECAL(), HSCPValidator::makeSimDigiPlotsRPC(), HSCPValidator::makeSimTrackPlots(), CSCHitFromStripOnly::makeStripData(), PhysicsTools::MVATrainer::makeTrainCalibration(), egammaObjectModifications_tools::makeVIDBitsModifier(), TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks(), TemplatedSecondaryVertexProducer< IPTI, VTX >::matchGroomedJets(), JetFlavourClustering::matchGroomedJets(), JetPlusTrackCorrector::matchTracks(), PerformancePayloadFromTable::maxPos(), ecaldqm::memDCCIndex(), merge(), cms::DDFilteredView::mergedSpecifics(), CaloTowersMerger::mergedTower(), reco::PFDisplacedVertexSeed::mergeWith(), 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(), PdgIdExcluder::operator()(), PdgIdSelector::operator()(), StatusSelector::operator()(), rpcrawtodigi::DebugDigisPrintout::operator()(), pat::HLTL1MuonMatcher::operator()(), VarRangeCutColl< trigger::TriggerObject >::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(), edmTracerLogToSimpleConfig.ConsumesParser::parse(), AlpgenHeader::parse(), Page1Parser.Page1Parser::ParseRunSummaryPage(), SiStripDbParams::partitionNames(), pat::PATLostTracks::PATLostTracks(), PedeSteererWeakModeConstraints::PedeSteererWeakModeConstraints(), SelectedElectronFEDListProducer< TEle, TCand >::pixelFedDump(), PixelInactiveAreaFinder::PixelInactiveAreaFinder(), edm::SortedCollection< EcalRecHit >::pop_back(), edm::PreMixingModule::PreMixingModule(), MatrixInjector.MatrixInjector::prepare(), CaloSubdetectorGeometry::present(), edm::Principal::Principal(), print_trigger_collection(), SiStripConfigDb::printAnalysisDescriptions(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), SiStripConfigDb::printFedDescriptions(), ParticleTreeDrawer::printInfo(), edm::PluginDescription< T >::printNestedContent_(), create_public_peakpu_plots::processdata(), DDLNumeric::processElement(), LaserTask::processLaserMon(), HIMultiTrackSelector::processMVA(), TTTrackAssociator< T >::produce(), InterestingEcalDetIdProducer::produce(), JetTracksAssociationDRVertexAssigned::produce(), PileupSummaryInfoSlimmer::produce(), TtSemiLepJetCombMaxSumPtWMass::produce(), TtDilepEvtSolutionMaker::produce(), QuarkoniaTrackSelector::produce(), EcalTPSkimmer::produce(), StripCompactDigiSimLinksProducer::produce(), GenTrackMatcher::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), GenParticles2HepMCConverter::produce(), EcalListOfFEDSProducer::produce(), ESListOfFEDSProducer::produce(), EgammaHLTCombinedIsolationProducer::produce(), EgammaHLTElectronCombinedIsolationProducer::produce(), SiPixelRawToDigi::produce(), TrackListMerger::produce(), ReducedRecHitCollectionProducer::produce(), EleIsoDetIdCollectionProducer::produce(), pat::PATJetUpdater::produce(), LaserAlignmentT0Producer::produce(), ConversionSeedFilterCharge::produce(), MuonDetCleaner< T1, T2 >::produce(), JetSubstructurePacker::produce(), pat::PATPackedCandidateProducer::produce(), pat::GenPlusSimParticleProducer::produce(), GamIsoDetIdCollectionProducer::produce(), HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::produce(), CTPPSPixelLocalTrackProducer::produce(), EcalRawToDigi::produce(), pat::PATTauProducer::produce(), pat::PATJetProducer::produce(), CaloTowersMerger::produce(), ConvBremSeedProducer::produce(), InterestingTrackEcalDetIdProducer::produce(), HighPtTrackEcalDetIdProducer::produce(), FlavorHistoryProducer::produce(), MuonMCClassifier::produce(), LaserAlignment::produce(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), GenPUProtonProducer::produce(), ProfilerService::ProfilerService(), LowPtGsfElectronSeedProducer::propagateTrackToCalo(), SiStripDbParams::pset(), 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(), TrackingParticleSelectorByGen::recursiveFlagDaughters(), GenParticlePruner::recursiveFlagMothers(), TrackingParticleSelectorByGen::recursiveFlagMothers(), TransientVertex::refittedTrack(), HPSPFRecoTauAlgorithm::removeCandidateFromRefVector(), SiPixelDisabledModules::removeDisabledModule(), lhef::LHEEvent::removeResonances(), DDI::LogicalPart::removeSpecifics(), XrdAdaptor::RequestManager::requestFailure(), edm::DetSetVector< TotemRPLocalTrack::FittedRecHit >::reserve(), BtoCharmDecayVertexMergerT< VTX >::resolveBtoDchain(), PerformancePayloadFromTable::resultPos(), PerformancePayloadFromBinnedTFormula::resultPos(), PerformancePayloadFromTFormula::resultPos(), EcalRecHitWorkerSimple::run(), cms::Ort::ONNXRuntime::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(), DTLocalTriggerTPTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTLocalTriggerEfficiencyTest::runClientDiagnostic(), DTTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerTask::runDDUvsTMAnalysis(), L1MuDTEtaProcessor::runEtaMatchingUnit(), L1MuBMEtaProcessor::runEtaMatchingUnit(), edm::search_all(), SeedingLayerSetsBuilder::SeedingLayerSetsBuilder(), ME0TriggerPseudoBuilder::segmentConversion(), reco::FlavorHistorySelectorUtil::select(), AlCaIsoTracksProducer::select(), SiStripBadModuleConfigurableFakeESSource::selectDetectors(), EcalMipGraphs::selectHits(), EcalDisplaysByEvent::selectHits(), AlignmentParameterStore::selectParameters(), CastorCalibrationsSet::setCalibrations(), CastorCalibrationWidthsSet::setCalibrationWidths(), HcalCellType::setDepth(), RBCProcessRPCSimDigis::setDigiAt(), RBCProcessRPCDigis::setDigiAt(), edm::eventsetup::EventSetupRecordImpl::setEventSetup(), EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(), EcalRecHitWorkerSimple::setFlagBits(), GlobalOptionMgr::setGlobalOption(), EcalFenixFgvbEB::setParameters(), ecaldqm::CalibrationSummaryClient::setParams(), ecaldqm::SummaryClient::setParams(), DDLSolid::setReference(), CSCBaseElectronicsSim::setSignalTimeRange(), CastorDbProducer::setupChannelQuality(), TtSemiLepKinFitter::setupConstraints(), HcalDbProducer::setupEffectivePedestals(), HcalDbProducer::setupEffectivePedestalWidths(), CastorDbProducer::setupElectronicsMap(), CastorDbProducer::setupGains(), CastorDbProducer::setupGainWidths(), HcalDbProducer::setupHcalDbService(), CastorDbProducer::setupPedestals(), HcalDbProducer::setupPedestals(), CastorDbProducer::setupPedestalWidths(), HcalDbProducer::setupPedestalWidths(), CastorDbProducer::setupQIEData(), egHLT::OffHelper::setupTriggers(), vid_id_tools::setupVIDElectronSelection(), CSCDBL1TPParametersExtended::setValue(), SiStripCondObjBuilderFromDb::setValuesApvTiming(), HcalSimParameterMap::simParameters(), SiStripFedIdListReader::SiStripFedIdListReader(), CRackTrajectoryBuilder::SortHits(), PhysicsTools::stdStringPrintf(), HLTMuonValidator::stepLabels(), IsoTrig::studyIsolation(), sumSmallDepths(), MillePedeAlignmentAlgorithm::terminate(), HcalLutManager::test_emap(), PasswordReader::tokenize(), EcalSRCondTools::tokenize(), EgammaHadTower::towersOf(), HistoryBase::traceSimHistory(), QcdUeDQM::trackSelection(), trackWeight(), TransientVertex::trackWeight(), pat::TriggerEvent::triggerObjectMatchResult(), JsonOutputProducer::typeId(), PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL(), PFEGammaAlgo::unlinkRefinableObjectKFandECALWithBadEoverP(), PFEGammaAlgo::unwrapSuperCluster(), SaveSimTrack::update(), MSLayersAtAngle::update(), PedestalsHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), DaqScopeModeHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), LatencyHistosUsingDb::update(), FineDelayHistosUsingDb::update(), KalmanVertexUpdator< N >::update(), CaloSteppingAction::update(), SimG4HGCalValidation::update(), HLTScalersClient::CountLSFifo_t::update(), L1RCTProducer::updateFedVector(), SiStripConfigDb::uploadAnalysisDescriptions(), EcalCondDB::usage(), HGCalGeomTools::waferCorner(), reco::btag::weight(), NanoAODOutputModule::write(), CSCValHists::writeHists(), DQMRootOutputModule::writeLuminosityBlock(), L1GtPatternWriter::writePatterns(), DQMRootOutputModule::writeRun(), CSCGasCollisions::writeSummary(), 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
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:74
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
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:74
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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  (static_cast<const 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:49
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:12
std::vector< T >::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  (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(detId)))->getPosition(detId) : geo->getPosition(detId);
112  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) {
113  hit.push_back(ihit);
114  }
115  }
116  return hit;
117  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:12
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:74
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
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
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
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
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:49
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:49
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, 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, 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,
int  useRaw = 0,
bool  debug = false 
)

Definition at line 162 of file FindDistCone.cc.

Referenced by RealisticSimClusterMapper::buildClusters().

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

Definition at line 172 of file FindDistCone.cc.

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

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

References CaloGeometry::getSubdetectorGeometry().

Referenced by getGpos().

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

Definition at line 198 of file FindDistCone.cc.

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

198  {
199  DetId detId(hit->id());
200  GlobalPoint point = (detId.det() == DetId::Hcal) ?
201  (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(detId)))->getPosition(detId) : 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:49
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:74
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,
int  useRaw = 0,
bool  debug = false 
)

Definition at line 167 of file eHCALMatrix.cc.

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

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

Definition at line 201 of file eHCALMatrix.cc.

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

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

Definition at line 216 of file FindDistCone.cc.

Referenced by getHotCell().

216  {
217  double energy = ((useRaw == 1) ? hit->eraw() :
218  ((useRaw == 2) ? hit->eaux() : hit->energy()));
219  return energy;
220  }
double spr::getRawEnergy ( edm::PCaloHitContainer::const_iterator  hit,
int  useRaw = 0 
)

Definition at line 226 of file FindDistCone.cc.

226  {
227  return hit->energy();
228  }
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::numberOfAllHits(), 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(), HcalIsoTrkAnalyzer::fillTree(), AlCaIsoTracksFilter::filter(), RPixPlaneCombinatoryTracking::fitTrack(), 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.numberOfAllHits(reco::HitPattern::TRACK_HITS) << " hits" << std::endl;
39  for (int i=0; i<hitp.numberOfAllHits(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.numberOfAllHits(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.numberOfAllHits(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:612
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:643
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:600
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:557
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:871
double pt() const
track transverse momentum
Definition: TrackBase.h:660
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:875
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:808
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:648
#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:485
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:574
reco::TrackBase::TrackQuality minQuality
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:654
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:630
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, and reco::Track::recHits().

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

20  {
21 
22  edm::SimTrackContainer::const_iterator itr = SimTk->end();;
23 
24  //Get the vector of PsimHits associated to TrackerRecHits and select the
25  //matching SimTrack on the basis of maximum occurance of trackIds
26  std::vector<unsigned int> trkId, trkOcc;
27  for(auto const& trkHit : pTrack->recHits()) {
28 
29  std::vector<PSimHit> matchedSimIds = associate.associateHit(*trkHit);
30  for (unsigned int isim=0; isim<matchedSimIds.size(); isim++) {
31  unsigned tkId = matchedSimIds[isim].trackId();
32  bool found = false;
33  for (unsigned int j=0; j<trkId.size(); j++) {
34  if ( tkId == trkId[j] ) {
35  trkOcc[j]++;
36  found = true;
37  break;
38  }
39  }
40  if (!found) { trkId.push_back(tkId); trkOcc.push_back(1); }
41  }
42  }
43 
44 #ifdef EDM_ML_DEBUG
45  if (debug) {
46  std::cout << "Reconstructed Track with " << i << " recHits.";
47  for (unsigned int isim=0; isim<trkId.size(); isim++){
48  std::cout << "\n trkId " << trkId[isim] << " Occurance " << trkOcc[isim] << ", ";
49  }
50  std::cout << std::endl;
51  }
52  int matchedId=0;
53 #endif
54 
55  unsigned int matchSimTrk=0;
56  if (!trkOcc.empty()) {
57  unsigned int maxTrkOcc=0, idxMax=0;
58  for(unsigned int j=0; j<trkOcc.size(); j++) {
59  if(trkOcc[j] > maxTrkOcc ) { maxTrkOcc = trkOcc[j]; idxMax = j; }
60  }
61  matchSimTrk = trkId[idxMax];
62  for (auto simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
63  if ( simTrkItr->trackId() == matchSimTrk ) {
64 #ifdef EDM_ML_DEBUG
65  matchedId = simTrkItr->type();
66  if (debug) std::cout << "matched trackId (maximum occurance) " << matchSimTrk << " type " << matchedId << std::endl;
67 #endif
68  itr = simTrkItr;
69  break;
70  }
71  }
72  }
73 
74 #ifdef EDM_ML_DEBUG
75  if (matchedId==0 && debug) {
76  std::cout << "Could not find matched SimTrk and track history now " << std::endl;
77  }
78 #endif
79  return itr;
80  }
auto recHits() const
Access to reconstructed hits on the track.
Definition: Track.h:106
#define debug
Definition: HDRShower.cc:19
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
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 83 of file MatchingSimTrack.cc.

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

83  {
84 
85  // get the matching SimTrack
86  edm::SimTrackContainer::const_iterator trkInfo = spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack,associate, debug);
87  unsigned int matchSimTrk = trkInfo->trackId();
88 #ifdef EDM_ML_DEBUG
89  if (debug) std::cout << "matchedSimTrackId finds the SimTrk ID of the current track to be " << matchSimTrk << std::endl;
90 #endif
91  std::vector<int> matchTkid;
92  if( trkInfo->type() != 0) {
93  for(auto simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
94  if (validSimTrack(matchSimTrk, simTrkItr, SimTk, SimVtx, false))
95  matchTkid.push_back((int)simTrkItr->trackId());
96  }
97  }
98  return matchTkid;
99  }
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 101 of file MatchingSimTrack.cc.

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

101  {
103  for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
104  simTrkItr!= SimTk->end(); simTrkItr++) {
105  if (simTkId == simTrkItr->trackId()) {
106  if (spr::validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug)) {
107  info.found = true;
108  info.pdgId = simTrkItr->type();
109  info.charge = simTrkItr->charge();
110  } else {
111  edm::SimTrackContainer::const_iterator parentItr = spr::parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
112 #ifdef EDM_ML_DEBUG
113  if (debug) {
114  if (parentItr != SimTk->end() ) std::cout << "original parent of " << simTrkItr->trackId() << " " << parentItr->trackId() << ", " << parentItr->type() << std::endl;
115  else std::cout << "original parent of " << simTrkItr->trackId() << " not found" << std::endl;
116  }
117 #endif
118  if (parentItr != SimTk->end()) {
119  info.found = true;
120  info.pdgId = parentItr->type();
121  info.charge = parentItr->charge();
122  }
123  }
124  break;
125  }
126  }
127  return info;
128  }
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.empty())
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:49
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
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)
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:20
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
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:74
#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.empty())
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:49
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
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)
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:20
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 = (static_cast<const 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 = (static_cast<const 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:49
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 postprocess-scan-build::cells, 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)
#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
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)
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 postprocess-scan-build::cells, 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)
#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
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)
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 postprocess-scan-build::cells, 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)
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)
#define debug
Definition: HDRShower.cc:19
dbl *** dir
Definition: mlp_gen.cc:35
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)
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 postprocess-scan-build::cells, 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)
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)
#define debug
Definition: HDRShower.cc:19
dbl *** dir
Definition: mlp_gen.cc:35
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)
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 174 of file MatchingSimTrack.cc.

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

Referenced by matchedSimTrackInfo().

174  {
175 
176  edm::SimTrackContainer::const_iterator itr = SimTk->end();
177 
178  int vertIndex = thisTrkItr->vertIndex();
179 #ifdef EDM_ML_DEBUG
180  if (debug) std::cout << "SimTrackParent " << thisTrkItr->trackId() << " Vertex " << vertIndex << " Type " << thisTrkItr->type() << " Charge " << (int)thisTrkItr->charge() << std::endl;
181 #endif
182  if( vertIndex == -1 ) return thisTrkItr;
183  else if (vertIndex >= (int)SimVtx->size()) return itr;
184 
185  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
186  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
187  int parent = simVtxItr->parentIndex();
188 
189  if (parent < 0 && simVtxItr != SimVtx->begin()) {
190  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
191  for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
192  if (simVtxItr->parentIndex() > 0) {
193  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
194  double dist = pos2.P();
195  if (dist < 0.001) {
196  parent = simVtxItr->parentIndex();
197  break;
198  }
199  }
200  }
201  }
202  for (edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
203  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
204  }
205 
206  return thisTrkItr;
207  }
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:32
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,
const std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 137 of file CaloPropagateTrack.cc.

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

137  {
138 
139  std::vector<spr::propagatedTrackID> vdets;
140  spr::propagateCALO(trkCollection,geo,bField,theTrackQuality, vdets, debug);
141  return vdets;
142  }
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const 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,
const std::string &  theTrackQuality,
std::vector< spr::propagatedTrackID > &  vdets,
bool  debug = false 
)

Definition at line 144 of file CaloPropagateTrack.cc.

References funct::abs(), gather_cfg::cout, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, spr::propagatedTrackID::etaECAL, spr::propagatedTrackID::etaHCAL, CaloSubdetectorGeometry::getClosestCell(), 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(), spr::propagatedTrackID::trkItr, and reco::TrackBase::undefQuality.

144  {
145 
149  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
150 
151  unsigned int indx;
152  reco::TrackCollection::const_iterator trkItr;
153  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
154  const reco::Track* pTrack = &(*trkItr);
156  vdet.trkItr = trkItr;
157  vdet.ok = (trackQuality_ != reco::TrackBase::undefQuality) ?
158  (pTrack->quality(trackQuality_)) : true;
159  vdet.detIdECAL = DetId(0);
160  vdet.detIdHCAL = DetId(0);
161  vdet.detIdEHCAL= DetId(0);
162 #ifdef EDM_ML_DEBUG
163  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << vdet.ok << std::endl;
164 #endif
165  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
166  vdet.okECAL = info.second;
167  if (vdet.okECAL) {
168  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
169  vdet.etaECAL = point.eta();
170  vdet.phiECAL = point.phi();
171  if (std::abs(point.eta())<spr::etaBEEcal) {
172  vdet.detIdECAL = barrelGeom->getClosestCell(point);
173  } else {
174  if (endcapGeom)
175  vdet.detIdECAL = endcapGeom->getClosestCell(point);
176  else
177  vdet.okECAL = false;
178  }
179  vdet.detIdEHCAL = gHB->getClosestCell(point);
180  }
181  info = spr::propagateHCAL (pTrack, bField, debug);
182  vdet.okHCAL = info.second;
183  if (vdet.okHCAL) {
184  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
185  vdet.etaHCAL = point.eta();
186  vdet.phiHCAL = point.phi();
187  vdet.detIdHCAL = gHB->getClosestCell(point);
188  }
189 #ifdef EDM_ML_DEBUG
190  if (debug) {
191  std::cout << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL ("
192  << vdet.okECAL << ") ";
193  if (vdet.detIdECAL.subdetId() == EcalBarrel)
194  std::cout << (EBDetId)(vdet.detIdECAL);
195  else
196  std::cout << (EEDetId)(vdet.detIdECAL);
197  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
198  }
199 #endif
200  vdets.push_back(vdet);
201  }
202 #ifdef EDM_ML_DEBUG
203  if (debug) {
204  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
205  for (unsigned int i=0; i<vdets.size(); ++i) {
206  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
207  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
208  std::cout << (EBDetId)(vdets[i].detIdECAL);
209  } else {
210  std::cout << (EEDetId)(vdets[i].detIdECAL);
211  }
212  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
213  }
214  }
215 #endif
216  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
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)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
*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,
const std::string &  theTrackQuality,
std::vector< spr::propagatedTrackDirection > &  trkDir,
bool  debug = false 
)

Definition at line 218 of file CaloPropagateTrack.cc.

References funct::abs(), gather_cfg::cout, spr::propagatedTrackDirection::detIdECAL, spr::propagatedTrackDirection::detIdEHCAL, spr::propagatedTrackDirection::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedTrackDirection::directionECAL, spr::propagatedTrackDirection::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), 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(), spr::propagatedTrackDirection::trkItr, and reco::TrackBase::undefQuality.

218  {
219 
223  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
224 
225  unsigned int indx;
226  reco::TrackCollection::const_iterator trkItr;
227  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
228  const reco::Track* pTrack = &(*trkItr);
230  trkD.trkItr = trkItr;
231  trkD.ok = (trackQuality_ != reco::TrackBase::undefQuality) ?
232  (pTrack->quality(trackQuality_)) : true;
233  trkD.detIdECAL = DetId(0);
234  trkD.detIdHCAL = DetId(0);
235  trkD.detIdEHCAL= DetId(0);
236 #ifdef EDM_ML_DEBUG
237  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << trkD.ok << std::endl;
238 #endif
240  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
241  trkD.okECAL = info.ok;
242  trkD.pointECAL = point;
243  trkD.directionECAL = info.direction;
244  if (trkD.okECAL) {
245  if (std::abs(info.point.eta())<spr::etaBEEcal) {
246  trkD.detIdECAL = barrelGeom->getClosestCell(point);
247  } else {
248  if (endcapGeom)
249  trkD.detIdECAL = endcapGeom->getClosestCell(point);
250  else
251  trkD.okECAL = false;
252  }
253  trkD.detIdEHCAL = gHB->getClosestCell(point);
254  }
255  info = spr::propagateTrackToHCAL (pTrack, bField, debug);
256  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
257  trkD.okHCAL = info.ok;
258  trkD.pointHCAL = point;
259  trkD.directionHCAL = info.direction;
260  if (trkD.okHCAL) {
261  trkD.detIdHCAL = gHB->getClosestCell(point);
262  }
263  trkDir.push_back(trkD);
264  }
265 #ifdef EDM_ML_DEBUG
266  if (debug) {
267  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
268  for (unsigned int i=0; i<trkDir.size(); ++i) {
269  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
270  if (trkDir[i].okECAL) {
271  std::cout << " point " << trkDir[i].pointECAL << " direction "
272  << trkDir[i].directionECAL << " ";
273  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
274  std::cout << (EBDetId)(trkDir[i].detIdECAL);
275  } else {
276  std::cout << (EEDetId)(trkDir[i].detIdECAL);
277  }
278  }
279  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
280  if (trkDir[i].okHCAL) {
281  std::cout << " point " << trkDir[i].pointHCAL << " direction "
282  << trkDir[i].directionHCAL << " "
283  << (HcalDetId)(trkDir[i].detIdHCAL);
284  }
285  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
286  }
287  }
288 #endif
289  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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:134
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
reco::TrackCollection::const_iterator trkItr
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::propagatedTrackID spr::propagateCALO ( const reco::Track pTrack,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

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

291  {
292 
296 
298  vdet.ok = true;
299  vdet.detIdECAL = DetId(0);
300  vdet.detIdHCAL = DetId(0);
301  vdet.detIdEHCAL= DetId(0);
302 #ifdef EDM_ML_DEBUG
303  if (debug) std::cout << "Propagate track: p " << pTrack->p() << " eta " << pTrack->eta() << " phi " << pTrack->phi() << " Flag " << vdet.ok << std::endl;
304 #endif
305  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
306  vdet.okECAL = info.second;
307  if (vdet.okECAL) {
308  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
309  vdet.etaECAL = point.eta();
310  vdet.phiECAL = point.phi();
311  if (std::abs(point.eta())<spr::etaBEEcal) {
312  vdet.detIdECAL = barrelGeom->getClosestCell(point);
313  } else {
314  if (endcapGeom)
315  vdet.detIdECAL = endcapGeom->getClosestCell(point);
316  else
317  vdet.okECAL = false;
318  }
319  vdet.detIdEHCAL = gHB->getClosestCell(point);
320  }
321  info = spr::propagateHCAL (pTrack, bField, debug);
322  vdet.okHCAL = info.second;
323  if (vdet.okHCAL) {
324  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
325  vdet.etaHCAL = point.eta();
326  vdet.phiHCAL = point.phi();
327  vdet.detIdHCAL = gHB->getClosestCell(point);
328  }
329 #ifdef EDM_ML_DEBUG
330  if (debug) {
331  std::cout << "propagateCALO:: for 1 track" << std::endl;
332  std::cout << "Track [0] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
333  if (vdet.detIdECAL.subdetId() == EcalBarrel) {
334  std::cout << (EBDetId)(vdet.detIdECAL);
335  } else {
336  std::cout << (EEDetId)(vdet.detIdECAL);
337  }
338  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
339  }
340 #endif
341  return vdet;
342  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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:684
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:690
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
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)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
std::vector< spr::propagatedGenTrackID > spr::propagateCALO ( const HepMC::GenEvent genEvent,
edm::ESHandle< ParticleDataTable > &  pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

Definition at line 344 of file CaloPropagateTrack.cc.

References funct::abs(), spr::propagatedGenTrackID::charge, gather_cfg::cout, spr::propagatedGenTrackID::detIdECAL, spr::propagatedGenTrackID::detIdEHCAL, spr::propagatedGenTrackID::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedGenTrackID::directionECAL, spr::propagatedGenTrackID::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), 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.

344  {
345 
349 
350  std::vector<spr::propagatedGenTrackID> trkDir;
351  unsigned int indx;
352  HepMC::GenEvent::particle_const_iterator p;
353  for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++p,++indx) {
355  trkD.trkItr = p;
356  trkD.detIdECAL = DetId(0);
357  trkD.detIdHCAL = DetId(0);
358  trkD.detIdEHCAL= DetId(0);
359  trkD.pdgId = ((*p)->pdg_id());
360  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge())/3;
361  const GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
362 #ifdef EDM_ML_DEBUG
363  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
364 #endif
365  // consider stable particles
366  if ( (*p)->status()==1 && std::abs((*p)->momentum().eta()) < etaMax ) {
367  const GlobalPoint vertex = GlobalPoint(0.1*(*p)->production_vertex()->position().x(),
368  0.1*(*p)->production_vertex()->position().y(),
369  0.1*(*p)->production_vertex()->position().z());
370  trkD.ok = true;
372  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
373  trkD.okECAL = info.ok;
374  trkD.pointECAL = point;
375  trkD.directionECAL = info.direction;
376  if (trkD.okECAL) {
377  if (std::abs(info.point.eta())<spr::etaBEEcal) {
378  trkD.detIdECAL = barrelGeom->getClosestCell(point);
379  } else {
380  if (endcapGeom)
381  trkD.detIdECAL = endcapGeom->getClosestCell(point);
382  else
383  trkD.okECAL = false;
384  }
385  trkD.detIdEHCAL = gHB->getClosestCell(point);
386  }
387 
388  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
389  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
390  trkD.okHCAL = info.ok;
391  trkD.pointHCAL = point;
392  trkD.directionHCAL = info.direction;
393  if (trkD.okHCAL) {
394  trkD.detIdHCAL = gHB->getClosestCell(point);
395  }
396  }
397  trkDir.push_back(trkD);
398  }
399 #ifdef EDM_ML_DEBUG
400  if (debug) {
401  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
402  for (unsigned int i=0; i<trkDir.size(); ++i) {
403  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
404  if (trkDir[i].okECAL) {
405  std::cout << " point " << trkDir[i].pointECAL << " direction "
406  << trkDir[i].directionECAL << " ";
407  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
408  std::cout << (EBDetId)(trkDir[i].detIdECAL);
409  } else {
410  std::cout << (EEDetId)(trkDir[i].detIdECAL);
411  }
412  }
413  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
414  if (trkDir[i].okHCAL) {
415  std::cout << " point " << trkDir[i].pointHCAL << " direction "
416  << trkDir[i].directionHCAL << " "
417  << (HcalDetId)(trkDir[i].detIdHCAL);
418  }
419  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
420  }
421  }
422 #endif
423  return trkDir;
424  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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
HepMC::GenEvent::particle_const_iterator trkItr
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::vector< spr::propagatedGenParticleID > spr::propagateCALO ( edm::Handle< reco::GenParticleCollection > &  genParticles,
edm::ESHandle< ParticleDataTable > &  pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

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

426  {
427 
431 
432  std::vector<spr::propagatedGenParticleID> trkDir;
433  unsigned int indx;
434  reco::GenParticleCollection::const_iterator p;
435  for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++p,++indx) {
437  trkD.trkItr = p;
438  trkD.detIdECAL = DetId(0);
439  trkD.detIdHCAL = DetId(0);
440  trkD.detIdEHCAL= DetId(0);
441  trkD.pdgId = (p->pdgId());
442  trkD.charge = p->charge();
443  const GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
444 #ifdef EDM_ML_DEBUG
445  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
446 #endif
447  // consider stable particles
448  if ( p->status()==1 && std::abs(momentum.eta()) < etaMax ) {
449  const GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
450  trkD.ok = true;
452  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
453  trkD.okECAL = info.ok;
454  trkD.pointECAL = point;
455  trkD.directionECAL = info.direction;
456  if (trkD.okECAL) {
457  if (std::abs(info.point.eta())<spr::etaBEEcal) {
458  trkD.detIdECAL = barrelGeom->getClosestCell(point);
459  } else {
460  if (endcapGeom)
461  trkD.detIdECAL = endcapGeom->getClosestCell(point);
462  else
463  trkD.okECAL = false;
464  }
465  trkD.detIdEHCAL = gHB->getClosestCell(point);
466  }
467 
468  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
469  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
470  trkD.okHCAL = info.ok;
471  trkD.pointHCAL = point;
472  trkD.directionHCAL = info.direction;
473  if (trkD.okHCAL) {
474  trkD.detIdHCAL = gHB->getClosestCell(point);
475  }
476  }
477  trkDir.push_back(trkD);
478  }
479 #ifdef EDM_ML_DEBUG
480  if (debug) {
481  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
482  for (unsigned int i=0; i<trkDir.size(); ++i) {
483  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
484  if (trkDir[i].okECAL) {
485  std::cout << " point " << trkDir[i].pointECAL << " direction "
486  << trkDir[i].directionECAL << " ";
487  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
488  std::cout << (EBDetId)(trkDir[i].detIdECAL);
489  } else {
490  std::cout << (EEDetId)(trkDir[i].detIdECAL);
491  }
492  }
493  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
494  if (trkDir[i].okHCAL) {
495  std::cout << " point " << trkDir[i].pointHCAL << " direction "
496  << trkDir[i].directionHCAL << " "
497  << (HcalDetId)(trkDir[i].detIdHCAL);
498  }
499  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
500  }
501  }
502 #endif
503  return trkDir;
504  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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
*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 506 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(), 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.

506  {
507 
511 
512  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
514  trkD.ok = trk.ok;
515  trkD.detIdECAL = DetId(0);
516  trkD.detIdHCAL = DetId(0);
517  trkD.detIdEHCAL= DetId(0);
518 #ifdef EDM_ML_DEBUG
519  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
520 #endif
521  if (trkD.ok) {
523  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
524  trkD.okECAL = info.ok;
525  trkD.pointECAL = point;
526  trkD.directionECAL = info.direction;
527  if (trkD.okECAL) {
528  if (std::abs(info.point.eta())<spr::etaBEEcal) {
529  trkD.detIdECAL = barrelGeom->getClosestCell(point);
530  } else {
531  if (endcapGeom)
532  trkD.detIdECAL = endcapGeom->getClosestCell(point);
533  else
534  trkD.okECAL = false;
535  }
536  trkD.detIdEHCAL = gHB->getClosestCell(point);
537  }
538 
540  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
541  trkD.okHCAL = info.ok;
542  trkD.pointHCAL = point;
543  trkD.directionHCAL = info.direction;
544  if (trkD.okHCAL) {
545  trkD.detIdHCAL = gHB->getClosestCell(point);
546  }
547  }
548 #ifdef EDM_ML_DEBUG
549  if (debug) {
550  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
551  if (trkD.okECAL) {
552  std::cout << "ECAL point " << trkD.pointECAL << " direction "
553  << trkD.directionECAL << " ";
554  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
555  std::cout << (EBDetId)(trkD.detIdECAL);
556  } else {
557  std::cout << (EEDetId)(trkD.detIdECAL);
558  }
559  }
560  if (trkD.okHCAL) {
561  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
562  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
563  }
564  if (trkD.okECAL) std::cout << " Or " << (HcalDetId)(trkD.detIdEHCAL);
565  std::cout << std::endl;
566  }
567 #endif
568  return trkD;
569  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
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 762 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().

769  {
770 
772 #ifdef EDM_ML_DEBUG
773  if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
774 #endif
775  FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
776 
779 
781 
782  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
783 
785  if (tpMomentum.eta() < 0) {
786  tsose = myAP.propagate(fts, *lendcap);
787  } else {
788  tsose = myAP.propagate(fts, *rendcap);
789  }
790 
791  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
792 
793  track.ok=true;
794  if (tsose.isValid() && tsosb.isValid()) {
795  float absEta = std::abs(tsosb.globalPosition().eta());
796  if (absEta < corner) {
797  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
798  track.direction = tsosb.globalDirection();
799  } else {
800  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
801  track.direction = tsose.globalDirection();
802  }
803  } else if (tsose.isValid()) {
804  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
805  track.direction = tsose.globalDirection();
806  } else if (tsosb.isValid()) {
807  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
808  track.direction = tsosb.globalDirection();
809  } else {
810  track.point.SetXYZ(-999., -999., -999.);
811  track.direction = GlobalVector(0,0,1);
812  track.ok = false;
813  }
814 #ifdef EDM_ML_DEBUG
815  if (debug) {
816  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
817  if (track.ok) {
818  math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
819  double dphi = track.direction.phi()-tpMomentum.phi();
820  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
821  double pt = tpMomentum.perp();
822  double rat = 0.5*dphi/std::sin(0.5*dphi);
823  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;
824  }
825  }
826 #endif
827  return track;
828  }
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
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,
const std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 20 of file CaloPropagateTrack.cc.

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), gather_cfg::cout, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, spr::propagatedTrackID::etaECAL, spr::propagatedTrackID::etaHCAL, CaloSubdetectorGeometry::getClosestCell(), 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, reco::TrackBase::undefQuality, X, DOFs::Y, and DOFs::Z.

20  {
21 
26  std::vector<spr::propagatedTrackID> vdets;
27 
28  unsigned int indx;
29  reco::TrackCollection::const_iterator trkItr;
30  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
31  const reco::Track* pTrack = &(*trkItr);
33  vdet.trkItr = trkItr;
34  vdet.ok = (trackQuality_ != reco::TrackBase::undefQuality) ?
35  (pTrack->quality(trackQuality_)) : true;
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 #ifdef EDM_ML_DEBUG
67  if (debug) std::cout << "Propagate to ECAL " << info.second << " at (" << info.first.x() << ", "<< info.first.y() << ", " << info.first.z() << ")\n";
68 #endif
69 
70  vdet.okECAL = info.second;
71  if (vdet.okECAL) {
72  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
73  vdet.etaECAL = point.eta();
74  vdet.phiECAL = point.phi();
75  if (std::abs(point.eta())<spr::etaBEEcal) {
76  vdet.detIdECAL = barrelGeom->getClosestCell(point);
77  } else {
78  if (endcapGeom)
79  vdet.detIdECAL = endcapGeom->getClosestCell(point);
80  else
81  vdet.okECAL = false;
82  }
83  vdet.detIdEHCAL = gHB->getClosestCell(point);
84 #ifdef EDM_ML_DEBUG
85  if (debug) {
86  std::cout << "Point at ECAL (" << vdet.etaECAL << ", " << vdet.phiECAL << " ";
87  if (std::abs(point.eta())<spr::etaBEEcal)
88  std::cout << EBDetId(vdet.detIdECAL);
89  else
90  std::cout << EEDetId(vdet.detIdECAL);
91  std::cout << " " << HcalDetId(vdet.detIdEHCAL) << std::endl;
92  }
93 #endif
94  }
95  info = spr::propagateHCAL (vertex, momentum, charge, bField, debug);
96 #ifdef EDM_ML_DEBUG
97  if (debug) std::cout << "Propagate to HCAL " << info.second << " at (" << info.first.x() << ", "<< info.first.y() << ", " << info.first.z() << ")\n";
98 #endif
99  vdet.okHCAL = info.second;
100  if (vdet.okHCAL) {
101  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
102  vdet.etaHCAL = point.eta();
103  vdet.phiHCAL = point.phi();
104  vdet.detIdHCAL = gHB->getClosestCell(point);
105  }
106 #ifdef EDM_ML_DEBUG
107  if (debug) {
108  std::cout << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL ("
109  << vdet.okECAL << ") ";
110  if (vdet.detIdECAL.subdetId() == EcalBarrel)
111  std::cout << (EBDetId)(vdet.detIdECAL);
112  else
113  std::cout << (EEDetId)(vdet.detIdECAL);
114  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
115  }
116 #endif
117  vdets.push_back(vdet);
118  }
119 
120 #ifdef EDM_ML_DEBUG
121  if (debug) {
122  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
123  for (unsigned int i=0; i<vdets.size(); ++i) {
124  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
125  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
126  std::cout << (EBDetId)(vdets[i].detIdECAL);
127  } else {
128  std::cout << (EEDetId)(vdets[i].detIdECAL);
129  }
130  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
131  }
132  }
133 #endif
134  return vdets;
135  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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:67
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:57
reco::TrackCollection::const_iterator trkItr
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
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)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
#define debug
Definition: HDRShower.cc:19
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:72
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:549
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:62
int charge() const
track electric charge
Definition: TrackBase.h:606
*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 636 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(), propagateCosmicCALO(), and propagateIdECAL().

636  {
637  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
638  const GlobalVector momentum (track->px(), track->py(), track->pz());
639  int charge (track->charge());
640  return spr::propagateECAL (vertex, momentum, charge, bfield, debug);
641  }
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:666
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:678
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:702
int charge() const
track electric charge
Definition: TrackBase.h:606
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 667 of file CaloPropagateTrack.cc.

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

667  {
669  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
670  }
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 687 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(), HcalHBHEMuonAnalyzer::goodCell(), propagateCALO(), propagateCosmicCALO(), and propagateHCAL().

687  {
688  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
689  const GlobalVector momentum (track->px(), track->py(), track->pz());
690  int charge (track->charge());
691  return spr::propagateHCAL (vertex, momentum, charge, bfield, debug);
692  }
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:666
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:702
int charge() const
track electric charge
Definition: TrackBase.h:606
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 694 of file CaloPropagateTrack.cc.

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

694  {
696  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
697  }
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
bool spr::propagateHCAL ( const reco::Track track,
const CaloGeometry geo,
const MagneticField bField,
bool  typeRZ,
const std::pair< double, double >  rz,
bool  debug 
)

Definition at line 870 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), gather_cfg::cout, convertSQLiteXML::ok, propagateHCAL(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

870  {
871  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
872  const GlobalVector momentum (track->px(), track->py(), track->pz());
873  int charge (track->charge());
874 #ifdef EDM_ML_DEBUG
875  if (debug) std::cout << "Propagate track with charge " << charge << " position " << vertex << " p " << momentum << std::endl;
876 #endif
877  std::pair<HcalDetId,HcalDetId> ids = propagateHCAL(geo, bField, vertex, momentum, charge, typeRZ, rz, debug);
878  bool ok = ((ids.first != HcalDetId()) &&
879  (ids.first.ieta() == ids.second.ieta()) &&
880  (ids.first.iphi() == ids.second.iphi()));
881  return ok;
882  }
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:666
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:702
int charge() const
track electric charge
Definition: TrackBase.h:606
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
bool spr::propagateHCAL ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const CaloGeometry geo,
const MagneticField bField,
bool  typeRZ,
const std::pair< double, double >  rz,
bool  debug 
)

Definition at line 884 of file CaloPropagateTrack.cc.

References spr::trackAtOrigin::charge, gather_cfg::cout, spr::trackAtOrigin::momentum, convertSQLiteXML::ok, spr::trackAtOrigin::position, propagateHCAL(), and simTrackAtOrigin().

884  {
885 
886  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
887 #ifdef EDM_ML_DEBUG
888  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << std::endl;
889 #endif
890  std::pair<HcalDetId,HcalDetId> ids = propagateHCAL(geo, bField, trk.position, trk.momentum, trk.charge, typeRZ, rz, debug);
891  bool ok = ((ids.first != HcalDetId()) &&
892  (ids.first.ieta() == ids.second.ieta()) &&
893  (ids.first.iphi() == ids.second.iphi()));
894  return ok;
895  }
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
#define debug
Definition: HDRShower.cc:19
std::pair< HcalDetId, HcalDetId > spr::propagateHCAL ( const CaloGeometry geo,
const MagneticField bField,
const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
bool  typeRZ,
const std::pair< double, double >  rz,
bool  debug 
)

Definition at line 897 of file CaloPropagateTrack.cc.

References alongMomentum, Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::build(), gather_cfg::cout, debug, makeMuonMisalignmentScenario::endcap, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), TrajectoryStateOnSurface::globalPosition(), DetId::Hcal, HcalBarrel, globals_cff::id1, globals_cff::id2, TrajectoryStateOnSurface::isValid(), gen::k, M_PI, point, and Propagator::propagate().

906  {
907 
908 #ifdef EDM_ML_DEBUG
909  if (debug) std::cout << "propagateCalo:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " R/Z " << rz.first << " : " << rz.second << " Type " << typeRZ << std::endl;
910 #endif
912  FreeTrajectoryState fts (vertex, momentum, charge, bField);
913  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
914 
915  HcalDetId id1, id2;
916  for (int k=0; k<2; ++k) {
918  double rzv = (k == 0) ? rz.first : rz.second;
919  if (typeRZ) {
921  tsos = myAP.propagate(fts, *barrel);
922  } else {
924  tsos = myAP.propagate(fts, *endcap);
925  }
926 
927  if (tsos.isValid()) {
929  if (k == 0) id1 = gHB->getClosestCell(point);
930  else id2 = gHB->getClosestCell(point);
931 #ifdef EDM_ML_DEBUG
932  if (debug) {
933  std::cout << "Iteration " << k << " Point " << point << " ID ";
934  if (k == 0) std::cout << id1;
935  else std::cout << id2;
936  std::cout << std::endl;
937  }
938 #endif
939  }
940  }
941 #ifdef EDM_ML_DEBUG
942  if (debug) std::cout << "propagateCalo:: Front " << id1 << " Back " << id2 << std::endl;
943 #endif
944  return std::pair<HcalDetId,HcalDetId>(id1,id2);
945  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
GlobalPoint globalPosition() const
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
#define M_PI
int k[5][pyjets_maxn]
virtual DetId getClosestCell(const GlobalPoint &r) const
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::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 571 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().

571  {
572 
574  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
576  trkD.ok = trk.ok;
577  trkD.detIdECAL = DetId(0);
578  trkD.detIdHCAL = DetId(0);
579  trkD.detIdEHCAL= DetId(0);
580 #ifdef EDM_ML_DEBUG
581  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
582 #endif
583  if (trkD.ok) {
585  const GlobalPoint point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
586  trkD.okHCAL = info.ok;
587  trkD.pointHCAL = point;
588  trkD.directionHCAL = info.direction;
589  if (trkD.okHCAL) {
590  trkD.detIdHCAL = gHB->getClosestCell(point);
591  }
592  }
593 #ifdef EDM_ML_DEBUG
594  if (debug) {
595  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
596  if (trkD.okHCAL) {
597  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
598  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
599  }
600  }
601 #endif
602  return trkD;
603  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
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 606 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.

606  {
608  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
609  const GlobalVector momentum (track->px(), track->py(), track->pz());
610  int charge (track->charge());
612  if (info.ok) {
613  const GlobalPoint point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
614  return std::pair<bool,HcalDetId>(true,HcalDetId(gHB->getClosestCell(point)));
615  } else {
616  return std::pair<bool,HcalDetId>(false,HcalDetId());
617  }
618  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
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:666
static const double rBackHB
Definition: CaloConstants.h:17
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
virtual DetId getClosestCell(const GlobalPoint &r) const
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:702
int charge() const
track electric charge
Definition: TrackBase.h:606
*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:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
std::pair< DetId, bool > spr::propagateIdECAL ( const HcalDetId id,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 643 of file CaloPropagateTrack.cc.

References funct::abs(), DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), HcalGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, info(), point, propagateECAL(), hit::x, hit::y, and hit::z.

643  {
644 
645  const HcalGeometry* gHB = static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal,HcalBarrel));
646  const GlobalPoint vertex(0,0,0);
647  const GlobalPoint hit(gHB->getPosition(id));
648  const GlobalVector momentum = GlobalVector(hit.x(),hit.y(),hit.z());
649  std::pair<math::XYZPoint,bool> info = propagateECAL(vertex,momentum,0,bField,debug);
650  DetId eId(0);
651  if (info.second) {
652  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
653  if (std::abs(point.eta())<spr::etaBEEcal) {
655  eId = barrelGeom->getClosestCell(point);
656  } else {
658  if (endcapGeom)
659  eId = endcapGeom->getClosestCell(point);
660  else
661  info.second = false;
662  }
663  }
664  return std::pair<DetId,bool>(eId,info.second);
665  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
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)
GlobalPoint getPosition(const DetId &id) const
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

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

699  {
700  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
701  const GlobalVector momentum (track->px(), track->py(), track->pz());
702  int charge (track->charge());
704  return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
705  }
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:666
static const double rBackTB
Definition: CaloConstants.h:22
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:702
int charge() const
track electric charge
Definition: TrackBase.h:606
static const double etaBETrak
Definition: CaloConstants.h:23
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

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

712  {
713 
714  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
715  const GlobalVector momentum (track->px(), track->py(), track->pz());
716  int charge (track->charge());
717  float radius = track->outerPosition().Rho();
718  float zdist = track->outerPosition().Z();
719 #ifdef EDM_ML_DEBUG
720  if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;
721 #endif
722  FreeTrajectoryState fts (vertex, momentum, charge, bField);
725 
726  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
727 
728  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
729  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
730 
731  math::XYZPoint point(-999.,-999.,-999.);
732  bool ok=false;
733  GlobalVector direction(0,0,1);
734  if (tsosb.isValid() && std::abs(zdist) < spr::zFrontTE) {
735  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
736  direction = tsosb.globalDirection();
737  ok = true;
738  } else if (tsose.isValid()) {
739  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
740  direction = tsose.globalDirection();
741  ok = true;
742  }
743 
744  double length = -1;
745  if (ok) {
746  math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
747  double dphi = direction.phi()-momentum.phi();
748  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
749  double rat = 0.5*dphi/std::sin(0.5*dphi);
750  double dZ = vDiff.z();
751  double dS = rdist*rat; //dZ*momentum.z()/momentum.perp();
752  length = std::sqrt(dS*dS+dZ*dZ);
753 #ifdef EDM_ML_DEBUG
754  if (debug)
755  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;
756 #endif
757  }
758 
759  return std::pair<math::XYZPoint,double>(point,length);
760  }
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:666
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:67
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
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:678
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#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:702
int charge() const
track electric charge
Definition: TrackBase.h:606
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:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
GlobalVector globalDirection() const
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

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

620  {
621  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
622  const GlobalVector momentum (track->px(), track->py(), track->pz());
623  int charge (track->charge());
624  return spr::propagateCalo (vertex, momentum, charge, bfield, spr::zFrontEE, spr::rFrontEB, spr::etaBEEcal, debug);
625  }
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:666
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:678
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:702
int charge() const
track electric charge
Definition: TrackBase.h:606
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
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 627 of file CaloPropagateTrack.cc.

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

627  {
628 
629  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
631  if (trk.ok)
633  return ptrk;
634  }
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 672 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().

672  {
673  const GlobalPoint vertex (track->vx(), track->vy(), track->vz());
674  const GlobalVector momentum (track->px(), track->py(), track->pz());
675  int charge (track->charge());
676  return spr::propagateCalo (vertex, momentum, charge, bfield, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
677  }
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:666
static const double rFrontHB
Definition: CaloConstants.h:14
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:708
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:702
int charge() const
track electric charge
Definition: TrackBase.h:606
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:696
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 679 of file CaloPropagateTrack.cc.

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

679  {
680  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
682  if (trk.ok)
684  return ptrk;
685  }
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.empty() && !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) && endcapGeom) {
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.empty() && !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 && endcapGeom) {
686  EEDetId detId = det;
687  std::vector<DetId> neighbours = endcapTopo->getNeighbours(detId,dir);
688  if (!neighbours.empty() && !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.empty() && !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
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
int iPhiOuterRing() const
Definition: EEDetId.cc:295
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
static const int MAX_IETA
Definition: EBDetId.h:136
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:47
spr::trackAtOrigin spr::simTrackAtOrigin ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 830 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(), propagateHCAL(), propagateHCALBack(), propagateTrackToECAL(), and propagateTrackToHCAL().

836  {
837 
838  spr::trackAtOrigin trk;
839 
840  edm::SimTrackContainer::const_iterator itr = SimTk->end();
841  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
842  if ( simTrkItr->trackId() == thisTrk ) {
843 #ifdef EDM_ML_DEBUG
844  if (debug) std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
845 #endif
846  itr = simTrkItr;
847  break;
848  }
849  }
850 
851  if (itr != SimTk->end()) {
852  int vertIndex = itr->vertIndex();
853  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
854  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
855  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
856  const math::XYZTLorentzVectorD pos = simVtxItr->position();
857  const math::XYZTLorentzVectorD mom = itr->momentum();
858  trk.ok = true;
859  trk.charge = (int)(itr->charge());
860  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
861  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
862  }
863  }
864 #ifdef EDM_ML_DEBUG
865  if (debug) std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;
866 #endif
867  return trk;
868  }
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(), ME0DigisValidation::analyze(), GEMHitsValidation::analyze(), GEMDigiSimLink::GEMDigiSimLink(), CaloHitResponse::nSignals(), RPCDigiSimLink::RPCDigiSimLink(), and CastorHitCorrection::~CastorHitCorrection().

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

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

Referenced by matchedSimTrackId(), and matchedSimTrackInfo().

131  {
132 
133 #ifdef EDM_ML_DEBUG
134  if (debug) std::cout << "Inside validSimTrack: trackId " << thisTrkItr->trackId() << " vtxIndex " << thisTrkItr->vertIndex() << " to be matched to " << simTkId << std::endl;
135 #endif
136  //This track originates from simTkId
137  if (thisTrkItr->trackId() == simTkId) return true;
138 
139  //Otherwise trace back the history using SimTracks and SimVertices
140  int vertIndex = thisTrkItr->vertIndex();
141  if (vertIndex == -1 || vertIndex >= (int)SimVtx->size()) return false;
142 
143  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
144  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
145  int parent = simVtxItr->parentIndex();
146 #ifdef EDM_ML_DEBUG
147  if (debug) std::cout << "validSimTrack:: parent index " << parent <<" ";
148 #endif
149  if (parent < 0 && simVtxItr != SimVtx->begin()) {
150  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
151  for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
152  if (simVtxItr->parentIndex() > 0) {
153  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
154  double dist = pos2.P();
155  if (dist < 0.001) {
156  parent = simVtxItr->parentIndex();
157  break;
158  }
159  }
160  }
161  }
162 #ifdef EDM_ML_DEBUG
163  if (debug) std::cout << "final index " << parent << std::endl;;
164 #endif
165  for(edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
166  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug) ;
167  }
168 
169  return false;
170 
171  }
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:32
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().