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)
 
bool chargeIsolation (const DetId anyCell, std::vector< DetId > &vdets)
 
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)
 
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 (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 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 chargeIsolationGenCone (unsigned int trkIndex, std::vector< spr::propagatedGenParticleID > &trackIDs, double dR, int &nNearTRKs, bool debug=false)
 
double chargeIsolationGenEcal (unsigned int trkIndex, std::vector< spr::propagatedGenParticleID > &trackIDs, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, 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 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 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)
 
std::ostringstream debugEcalDet (unsigned int, const DetId &)
 
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 (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)
 
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 EcalPFRecHitThresholds *eThr, int ieta, int iphi, 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 >
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 >
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 >
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 >
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, const ParticleDataTable *pdt, const CaloGeometry *geo, const MagneticField *bField, double etaMax=3.0, bool debug=false)
 
std::vector< spr::propagatedGenParticleIDpropagateCALO (edm::Handle< reco::GenParticleCollection > &genParticles, const 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

◆ caloSimInfoMatrix()

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 
)

◆ cGenSimInfo() [1/3]

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 176 of file GenSimInfo.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, chargeIsolation(), debug, cms::cuda::for(), mps_fire::i, info(), AlCaHLTBitMon_ParallelJobs::p, and EgammaValidation_cff::pdgid.

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

181  {
182  info.maxNearP = -1.0;
183  info.cHadronEne = info.nHadronEne = info.eleEne = info.muEne = info.photonEne = 0.0;
184  info.isChargedIso = true;
185  for (int i = 0; i < 3; ++i)
186  info.cHadronEne_[i] = 0.0;
187  for (unsigned int i = 0; i < trackIds.size(); ++i) {
188  HepMC::GenEvent::particle_const_iterator trkItr2 = trackIds[i].trkItr;
189  // avoid the track under consideration
190  if ((trkItr2 != trkItr) && trackIds[i].ok) {
191  int charge = trackIds[i].charge;
192  int pdgid = trackIds[i].pdgId;
193  double p = (*trkItr2)->momentum().rho();
194  bool isolat = false;
195  if (ifECAL) {
196  const DetId anyCell = trackIds[i].detIdECAL;
197  isolat = spr::chargeIsolation(anyCell, vdets);
198  } else {
199  const DetId anyCell = trackIds[i].detIdHCAL;
200  isolat = spr::chargeIsolation(anyCell, vdets);
201  }
202  if (!isolat)
204  }
205  }
206 
207  if (debug) {
208  edm::LogVerbatim("IsoTrack") << "Isolation variables: isChargedIso :" << info.isChargedIso << " maxNearP "
209  << info.maxNearP << " Energy e/mu/g/ch/nh " << info.eleEne << "," << info.muEne
210  << "," << info.photonEne << "," << info.cHadronEne << "," << info.nHadronEne
211  << " charge " << info.cHadronEne_[0] << "," << info.cHadronEne_[1] << ","
212  << info.cHadronEne_[2];
213  }
214  }
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
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:176
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19

◆ cGenSimInfo() [2/3]

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 216 of file GenSimInfo.cc.

References cGenSimInfo(), ALCARECOTkAlJpsiMuMu_cff::charge, chargeIsolation(), debug, cms::cuda::for(), mps_fire::i, info(), AlCaHLTBitMon_ParallelJobs::p, and EgammaValidation_cff::pdgid.

221  {
222  info.maxNearP = -1.0;
223  info.cHadronEne = info.nHadronEne = info.eleEne = info.muEne = info.photonEne = 0.0;
224  info.isChargedIso = true;
225  for (int i = 0; i < 3; ++i)
226  info.cHadronEne_[i] = 0.0;
227  for (unsigned int i = 0; i < trackIds.size(); ++i) {
228  reco::GenParticleCollection::const_iterator trkItr2 = trackIds[i].trkItr;
229  // avoid the track under consideration
230  if ((trkItr2 != trkItr) && trackIds[i].ok) {
231  int charge = trackIds[i].charge;
232  int pdgid = trackIds[i].pdgId;
233  double p = trkItr2->momentum().R();
234  bool isolat = false;
235  if (ifECAL) {
236  const DetId anyCell = trackIds[i].detIdECAL;
237  isolat = spr::chargeIsolation(anyCell, vdets);
238  } else {
239  const DetId anyCell = trackIds[i].detIdHCAL;
240  isolat = spr::chargeIsolation(anyCell, vdets);
241  }
242  if (!isolat)
244  }
245  }
246 
247  if (debug) {
248  edm::LogVerbatim("IsoTrack") << "Isolation variables: isChargedIso :" << info.isChargedIso << " maxNearP "
249  << info.maxNearP << " Energy e/mu/g/ch/nh " << info.eleEne << "," << info.muEne
250  << "," << info.photonEne << "," << info.cHadronEne << "," << info.nHadronEne
251  << " charge " << info.cHadronEne_[0] << "," << info.cHadronEne_[1] << ","
252  << info.cHadronEne_[2];
253  }
254  }
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
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:176
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19

◆ cGenSimInfo() [3/3]

void spr::cGenSimInfo ( int  charge,
int  pdgid,
double  p,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 256 of file GenSimInfo.cc.

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, info(), AlCaHLTBitMon_ParallelJobs::p, and EgammaValidation_cff::pdgid.

256  {
257  if (pdgid == 22)
258  info.photonEne += p;
259  else if (pdgid == 11)
260  info.eleEne += p;
261  else if (pdgid == 13)
262  info.muEne += p;
263  else if (std::abs(charge) > 0) {
264  info.isChargedIso = false;
265  info.cHadronEne += p;
266  if (p > 1.0)
267  info.cHadronEne_[0] += p;
268  if (p > 2.0)
269  info.cHadronEne_[1] += p;
270  if (p > 3.0)
271  info.cHadronEne_[2] += p;
272  if (info.maxNearP < p)
273  info.maxNearP = p;
274  } else if (std::abs(charge) == 0) {
275  info.nHadronEne += p;
276  }
277  }
static const TGPicture * info(bool iBackgroundIsBlack)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ chargeIsolation() [1/3]

bool spr::chargeIsolation ( const DetId  anyCell,
std::vector< DetId > &  vdets 
)

Definition at line 231 of file ChargeIsolation.cc.

References mps_fire::i.

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

231  {
232  bool isIsolated = true;
233  for (unsigned int i = 0; i < vdets.size(); i++) {
234  if (anyCell == vdets[i]) {
235  isIsolated = false;
236  break;
237  }
238  }
239  return isIsolated;
240  }

◆ chargeIsolation() [2/3]

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 407 of file ChargeIsolation.cc.

References funct::abs(), LCToCPAssociation_cfi::associator, TrackAssociatorParameters::bFieldToken, chargeIsolation(), debug, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), edm::EventSetup::getData(), hcalRecHitTable_cff::ieta, iEvent, hcalRecHitTable_cff::iphi, TrackDetMatchInfo::isGoodEcal, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), TrackDetMatchInfo::trkGlobPosAtEcal, and run3scouting_cff::trkQuality.

419  {
420  double maxNearP = -1.0;
421  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
422 
423  // const DetId anyCell,
424  reco::TrackCollection::const_iterator trkItr2;
425  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
426  const reco::Track* pTrack2 = &(*trkItr2);
427 
428  bool trkQuality = pTrack2->quality(trackQuality_);
429  if ((trkItr2 != trkItr) && trkQuality) {
430  const FreeTrajectoryState fts2 =
431  associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2);
432  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
433  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(), info2.trkGlobPosAtEcal.y(), info2.trkGlobPosAtEcal.z());
434 
435  if (info2.isGoodEcal) {
436  if (std::abs(point2.eta()) < spr::etaBEEcal) {
437  const DetId anyCell = gEB->getClosestCell(point2);
438  if (debug)
439  edm::LogVerbatim("IsoTrack")
440  << "chargeIsolation:: EB cell " << (EBDetId)(anyCell) << " for pt " << pTrack2->p();
441  if (!spr::chargeIsolation(anyCell, theNavigator, ieta, iphi)) {
442  if (maxNearP < pTrack2->p())
443  maxNearP = pTrack2->p();
444  }
445  } else {
446  const DetId anyCell = gEE->getClosestCell(point2);
447  if (debug)
448  edm::LogVerbatim("IsoTrack")
449  << "chargeIsolation:: EE cell " << (EEDetId)(anyCell) << " for pt " << pTrack2->p();
450  if (!spr::chargeIsolation(anyCell, theNavigator, ieta, iphi)) {
451  if (maxNearP < pTrack2->p())
452  maxNearP = pTrack2->p();
453  }
454  }
455  } //info2.isGoodEcal
456  }
457  }
458  return maxNearP;
459  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
static const double etaBEEcal
Definition: CaloConstants.h:12
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:150
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
#define debug
Definition: HDRShower.cc:19
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.

◆ chargeIsolation() [3/3]

bool spr::chargeIsolation ( const DetId  anyCell,
CaloNavigator< DetId > &  navigator,
int  deta,
int  dphi 
)

Definition at line 463 of file ChargeIsolation.cc.

References PVValHelper::dx, PVValHelper::dy, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, and HLT_2024v14_cff::navigator.

463  {
464  bool isIsolated = false;
465 
466  DetId thisDet;
467 
468  for (int dx = -ieta; dx < ieta + 1; ++dx) {
469  for (int dy = -iphi; dy < iphi + 1; ++dy) {
470  thisDet = navigator.offsetBy(dx, dy);
471  navigator.home();
472 
473  if (thisDet != DetId(0)) {
474  if (thisDet == anyCell) {
475  isIsolated = false;
476  return isIsolated;
477  }
478  }
479  }
480  }
481  return isIsolated;
482  }
Definition: DetId.h:17

◆ chargeIsolationCone() [1/2]

double spr::chargeIsolationCone ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackDirection > &  trkDirs,
double  dR,
int &  nNearTRKs,
bool  debug = false 
)

Definition at line 306 of file ChargeIsolation.cc.

References coneChargeIsolation(), debug, HGC3DClusterGenMatchSelector_cfi::dR, 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(), AlCaHcalIsotrkProducer::getProducts(), AlCaIsoTracksProducer::select(), IsoTrig::studyIsolation(), IsoTrig::studyMipCut(), and IsoTrig::StudyTrkEbyP().

310  {
311  double maxNearP = -1.0;
312  nNearTRKs = 0;
313  if (trkDirs[trkIndex].okHCAL) {
314  if (debug)
315  edm::LogVerbatim("IsoTrack") << "chargeIsolationCone with " << trkDirs.size() << " tracks ";
316  for (unsigned int indx = 0; indx < trkDirs.size(); ++indx) {
317  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
318  int isConeChargedIso = spr::coneChargeIsolation(
319  trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
320  if (isConeChargedIso == 0) {
321  nNearTRKs++;
322  const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
323  if (maxNearP < pTrack->p())
324  maxNearP = pTrack->p();
325  }
326  }
327  }
328  }
329 
330  if (debug)
331  edm::LogVerbatim("IsoTrack") << "chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL << " maxNearP "
332  << maxNearP;
333  return maxNearP;
334  }
Log< level::Info, true > LogVerbatim
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)
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
#define debug
Definition: HDRShower.cc:19

◆ chargeIsolationCone() [2/2]

std::pair< double, double > spr::chargeIsolationCone ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackDirection > &  trkDirs,
double  dR,
bool  debug = false 
)

Definition at line 366 of file ChargeIsolation.cc.

References coneChargeIsolation(), debug, HGC3DClusterGenMatchSelector_cfi::dR, convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, and reco::TrackBase::p().

369  {
370  double maxNearP = -1.0;
371  double sumP = 0;
372  if (trkDirs[trkIndex].okHCAL) {
373  if (debug)
374  edm::LogVerbatim("IsoTrack") << "chargeIsolationCone with " << trkDirs.size() << " tracks ";
375  for (unsigned int indx = 0; indx < trkDirs.size(); ++indx) {
376  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
377  int isConeChargedIso = spr::coneChargeIsolation(
378  trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
379  if (isConeChargedIso == 0) {
380  const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
381  sumP += (pTrack->p());
382  if (maxNearP < pTrack->p())
383  maxNearP = pTrack->p();
384  }
385  }
386  }
387  }
388 
389  if (debug)
390  edm::LogVerbatim("IsoTrack") << "chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL << " maxNearP "
391  << maxNearP << ":" << sumP;
392  return std::pair<double, double>(maxNearP, sumP);
393  }
Log< level::Info, true > LogVerbatim
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)
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
#define debug
Definition: HDRShower.cc:19

◆ chargeIsolationEcal() [1/3]

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 12 of file ChargeIsolation.cc.

References chargeIsolation(), debug, EcalBarrel, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, matrixECALIds(), convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), and DetId::subdetId().

Referenced by StudyCaloResponse::analyze(), IsolatedTracksNxN::analyze(), HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(), HcalIsoTrkAnalyzer::fillTree(), and AlCaHcalIsotrkProducer::getProducts().

18  {
19  const DetId coreDet = vdetIds[trkIndex].detIdECAL;
20  if (debug) {
21  if (coreDet.subdetId() == EcalBarrel)
22  edm::LogVerbatim("IsoTrack") << "DetId " << (EBDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL;
23  else
24  edm::LogVerbatim("IsoTrack") << "DetId " << (EEDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL;
25  }
26  double maxNearP = -1.0;
27  if (vdetIds[trkIndex].okECAL) {
28  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
29  if (debug)
30  edm::LogVerbatim("IsoTrack") << "chargeIsolationEcal:: eta/phi/dets " << ieta << " " << iphi << " "
31  << vdets.size();
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())
39  maxNearP = pTrack->p();
40  }
41  }
42  }
43  }
44  return maxNearP;
45  }
Log< level::Info, true > LogVerbatim
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)
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19

◆ chargeIsolationEcal() [2/3]

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 82 of file ChargeIsolation.cc.

References funct::abs(), Calorimetry_cff::bField, chargeIsolation(), debug, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), hcalRecHitTable_cff::ieta, info(), hcalRecHitTable_cff::iphi, matrixECALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), propagateECAL(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), run3scouting_cff::trkQuality, and reco::TrackBase::undefQuality.

91  {
94 
95  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
96  if (debug)
97  edm::LogVerbatim("IsoTrack") << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size();
98 
99  double maxNearP = -1.0;
100  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
101 
102  // const DetId anyCell,
103  reco::TrackCollection::const_iterator trkItr2;
104  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
105  const reco::Track* pTrack2 = &(*trkItr2);
106 
107  bool trkQuality = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack2->quality(trackQuality_)) : true;
108  if ((trkItr2 != trkItr) && trkQuality) {
109  std::pair<math::XYZPoint, bool> info = spr::propagateECAL(pTrack2, bField);
110  const GlobalPoint point2(info.first.x(), info.first.y(), info.first.z());
111 
112  if (info.second) {
113  if (std::abs(point2.eta()) < spr::etaBEEcal) {
114  const DetId anyCell = barrelGeom->getClosestCell(point2);
115  if (!spr::chargeIsolation(anyCell, vdets)) {
116  if (debug)
117  edm::LogVerbatim("IsoTrack")
118  << "chargeIsolationEcal Cell " << (EBDetId)(anyCell) << " pt " << pTrack2->p();
119  if (maxNearP < pTrack2->p())
120  maxNearP = pTrack2->p();
121  }
122  } else {
123  if (endcapGeom) {
124  const DetId anyCell = endcapGeom->getClosestCell(point2);
125  if (!spr::chargeIsolation(anyCell, vdets)) {
126  if (debug)
127  edm::LogVerbatim("IsoTrack")
128  << "chargeIsolationEcal Cell " << (EEDetId)(anyCell) << " pt " << pTrack2->p();
129  if (maxNearP < pTrack2->p())
130  maxNearP = pTrack2->p();
131  }
132  }
133  }
134  } //info.second
135  }
136  }
137  return maxNearP;
138  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
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:150
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
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:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ chargeIsolationEcal() [3/3]

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 486 of file ChargeIsolation.cc.

References funct::abs(), LCToCPAssociation_cfi::associator, TrackAssociatorParameters::bFieldToken, chargeIsolation(), debug, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), edm::EventSetup::getData(), CaloGeometry::getSubdetectorGeometry(), hcalRecHitTable_cff::ieta, iEvent, hcalRecHitTable_cff::iphi, TrackDetMatchInfo::isGoodEcal, matrixECALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), TrackDetMatchInfo::trkGlobPosAtEcal, and run3scouting_cff::trkQuality.

498  {
501 
502  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
503  if (debug)
504  edm::LogVerbatim("IsoTrack") << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size();
505 
506  double maxNearP = -1.0;
507  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
508 
509  // const DetId anyCell,
510  reco::TrackCollection::const_iterator trkItr2;
511  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
512  const reco::Track* pTrack2 = &(*trkItr2);
513 
514  bool trkQuality = pTrack2->quality(trackQuality_);
515  if ((trkItr2 != trkItr) && trkQuality) {
516  const FreeTrajectoryState fts2 =
517  associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2);
518  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
519  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(), info2.trkGlobPosAtEcal.y(), info2.trkGlobPosAtEcal.z());
520 
521  if (info2.isGoodEcal) {
522  if (std::abs(point2.eta()) < spr::etaBEEcal) {
523  const DetId anyCell = barrelGeom->getClosestCell(point2);
524  if (debug)
525  edm::LogVerbatim("IsoTrack")
526  << "chargeIsolation:: EB cell " << (EBDetId)(anyCell) << " for pt " << pTrack2->p();
527  if (!spr::chargeIsolation(anyCell, vdets)) {
528  if (maxNearP < pTrack2->p())
529  maxNearP = pTrack2->p();
530  }
531  } else {
532  const DetId anyCell = endcapGeom->getClosestCell(point2);
533  if (debug)
534  edm::LogVerbatim("IsoTrack")
535  << "chargeIsolation:: EE cell " << (EEDetId)(anyCell) << " for pt " << pTrack2->p();
536  if (!spr::chargeIsolation(anyCell, vdets)) {
537  if (maxNearP < pTrack2->p())
538  maxNearP = pTrack2->p();
539  }
540  }
541  } //info2.isGoodEcal
542  }
543  }
544  return maxNearP;
545  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
static const double etaBEEcal
Definition: CaloConstants.h:12
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
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:150
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
#define debug
Definition: HDRShower.cc:19
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ chargeIsolationGenCone()

double spr::chargeIsolationGenCone ( unsigned int  trkIndex,
std::vector< spr::propagatedGenParticleID > &  trackIDs,
double  dR,
int &  nNearTRKs,
bool  debug = false 
)

Definition at line 336 of file ChargeIsolation.cc.

References coneChargeIsolation(), debug, HGC3DClusterGenMatchSelector_cfi::dR, convertSQLiteXML::ok, reco::LeafCandidate::p(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by HcalIsoTrkSimAnalyzer::fillTree().

340  {
341  double maxNearP = -1.0;
342  nNearTRKs = 0;
343  if (trkDirs[trkIndex].okHCAL) {
344  if (debug)
345  edm::LogVerbatim("IsoTrack") << "chargeIsolationCone with " << trkDirs.size() << " tracks ";
346  for (unsigned int indx = 0; indx < trkDirs.size(); ++indx) {
347  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
348  int isConeChargedIso = spr::coneChargeIsolation(
349  trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
350  if (isConeChargedIso == 0) {
351  nNearTRKs++;
352  const reco::GenParticle* pTrack = &(*(trkDirs[indx].trkItr));
353  if (maxNearP < pTrack->p())
354  maxNearP = pTrack->p();
355  }
356  }
357  }
358  }
359 
360  if (debug)
361  edm::LogVerbatim("IsoTrack") << "chargeIsolationGenCone Track " << trkDirs[trkIndex].okHCAL << " maxNearP "
362  << maxNearP;
363  return maxNearP;
364  }
Log< level::Info, true > LogVerbatim
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)
double p() const final
magnitude of momentum vector
#define debug
Definition: HDRShower.cc:19

◆ chargeIsolationGenEcal()

double spr::chargeIsolationGenEcal ( unsigned int  trkIndex,
std::vector< spr::propagatedGenParticleID > &  trackIDs,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 47 of file ChargeIsolation.cc.

References chargeIsolation(), debug, EcalBarrel, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, matrixECALIds(), convertSQLiteXML::ok, reco::LeafCandidate::p(), AlCaHLTBitMon_ParallelJobs::p, and DetId::subdetId().

Referenced by HcalIsoTrkSimAnalyzer::fillTree().

53  {
54  const DetId coreDet = vdetIds[trkIndex].detIdECAL;
55  if (debug) {
56  if (coreDet.subdetId() == EcalBarrel)
57  edm::LogVerbatim("IsoTrack") << "DetId " << (EBDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL;
58  else
59  edm::LogVerbatim("IsoTrack") << "DetId " << (EEDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL;
60  }
61  double maxNearP = -1.0;
62  if (vdetIds[trkIndex].okECAL) {
63  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
64  if (debug)
65  edm::LogVerbatim("IsoTrack") << "chargeIsolationGenEcal:: eta/phi/dets " << ieta << " " << iphi << " "
66  << vdets.size();
67 
68  for (unsigned int indx = 0; indx < vdetIds.size(); ++indx) {
69  if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okECAL) {
70  const DetId anyCell = vdetIds[indx].detIdECAL;
71  if (!spr::chargeIsolation(anyCell, vdets)) {
72  const reco::GenParticle* pTrack = &(*(vdetIds[indx].trkItr));
73  if (maxNearP < pTrack->p())
74  maxNearP = pTrack->p();
75  }
76  }
77  }
78  }
79  return maxNearP;
80  }
Log< level::Info, true > LogVerbatim
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)
double p() const final
magnitude of momentum vector
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19

◆ chargeIsolationHcal() [1/3]

double spr::chargeIsolationHcal ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackID > &  vdetIds,
const HcalTopology topology,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 140 of file ChargeIsolation.cc.

References chargeIsolation(), debug, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, matrixHCALIds(), convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), and HLT_2024v14_cff::topology.

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

145  {
146  std::vector<DetId> dets(1, vdetIds[trkIndex].detIdHCAL);
147  if (debug) {
148  edm::LogVerbatim("IsoTrack") << "DetId " << (HcalDetId)(dets[0]) << " Flag " << vdetIds[trkIndex].okHCAL;
149  }
150 
151  double maxNearP = -1.0;
152  if (vdetIds[trkIndex].okHCAL) {
153  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
154  if (debug)
155  edm::LogVerbatim("IsoTrack") << "chargeIsolationHcal:: eta/phi/dets " << ieta << " " << iphi << " "
156  << vdets.size();
157 
158  for (unsigned indx = 0; indx < vdetIds.size(); ++indx) {
159  if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okHCAL) {
160  const DetId anyCell = vdetIds[indx].detIdHCAL;
161  if (!spr::chargeIsolation(anyCell, vdets)) {
162  const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
163  if (debug)
164  edm::LogVerbatim("IsoTrack")
165  << "chargeIsolationHcal Cell " << (HcalDetId)(anyCell) << " pt " << pTrack->p();
166  if (maxNearP < pTrack->p())
167  maxNearP = pTrack->p();
168  }
169  }
170  }
171  }
172  return maxNearP;
173  }
Log< level::Info, true > LogVerbatim
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
Definition: DetId.h:17
#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)

◆ chargeIsolationHcal() [2/3]

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 177 of file ChargeIsolation.cc.

References Calorimetry_cff::bField, chargeIsolation(), debug, reco::TrackBase::eta(), CaloSubdetectorGeometry::getClosestCell(), mps_fire::i, hcalRecHitTable_cff::ieta, info(), hcalRecHitTable_cff::iphi, matrixHCALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::phi(), propagateHCAL(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), HLT_2024v14_cff::topology, run3scouting_cff::trkQuality, and reco::TrackBase::undefQuality.

186  {
187  std::vector<DetId> dets(1, ClosestCell);
188  if (debug)
189  edm::LogVerbatim("IsoTrack") << (HcalDetId)ClosestCell;
190  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
191 
192  if (debug) {
193  for (unsigned int i = 0; i < vdets.size(); i++) {
194  edm::LogVerbatim("IsoTrack") << "HcalDetId in " << 2 * ieta + 1 << "x" << 2 * iphi + 1 << " "
195  << static_cast<HcalDetId>(vdets[i]);
196  }
197  }
198 
199  double maxNearP = -1.0;
200  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
201 
202  reco::TrackCollection::const_iterator trkItr2;
203  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
204  const reco::Track* pTrack2 = &(*trkItr2);
205 
206  bool trkQuality = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack2->quality(trackQuality_)) : true;
207  if ((trkItr2 != trkItr) && trkQuality) {
208  std::pair<math::XYZPoint, bool> info = spr::propagateHCAL(pTrack2, bField);
209  const GlobalPoint point2(info.first.x(), info.first.y(), info.first.z());
210 
211  if (debug)
212  edm::LogVerbatim("IsoTrack") << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " "
213  << pTrack2->phi();
214  if (info.second) {
215  const DetId anyCell = gHB->getClosestCell(point2);
216  if (!spr::chargeIsolation(anyCell, vdets)) {
217  if (maxNearP < pTrack2->p())
218  maxNearP = pTrack2->p();
219  }
220 
221  if (debug)
222  edm::LogVerbatim("IsoTrack") << "maxNearP " << maxNearP << " thisCell " << static_cast<HcalDetId>(anyCell)
223  << " (" << info.first.x() << "," << info.first.y() << "," << info.first.z()
224  << ")";
225  }
226  }
227  }
228  return maxNearP;
229  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:150
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
virtual DetId getClosestCell(const GlobalPoint &r) const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
Definition: DetId.h:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
#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)

◆ chargeIsolationHcal() [3/3]

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 549 of file ChargeIsolation.cc.

References LCToCPAssociation_cfi::associator, TrackAssociatorParameters::bFieldToken, chargeIsolation(), debug, reco::TrackBase::eta(), CaloSubdetectorGeometry::getClosestCell(), edm::EventSetup::getData(), mps_fire::i, hcalRecHitTable_cff::ieta, iEvent, hcalRecHitTable_cff::iphi, TrackDetMatchInfo::isGoodHcal, matrixHCALIds(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::phi(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), HLT_2024v14_cff::topology, TrackDetMatchInfo::trkGlobPosAtHcal, and run3scouting_cff::trkQuality.

561  {
562  std::vector<DetId> dets(1, ClosestCell);
563 
564  if (debug)
565  edm::LogVerbatim("IsoTrack") << static_cast<HcalDetId>(ClosestCell);
566  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
567 
568  if (debug) {
569  for (unsigned int i = 0; i < vdets.size(); i++) {
570  edm::LogVerbatim("IsoTrack") << "HcalDetId in " << 2 * ieta + 1 << "x" << 2 * iphi + 1 << " "
571  << static_cast<HcalDetId>(vdets[i]);
572  }
573  }
574 
575  double maxNearP = -1.0;
576  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
577 
578  reco::TrackCollection::const_iterator trkItr2;
579  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
580  const reco::Track* pTrack2 = &(*trkItr2);
581 
582  bool trkQuality = pTrack2->quality(trackQuality_);
583  if ((trkItr2 != trkItr) && trkQuality) {
584  const FreeTrajectoryState fts2 =
585  associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2);
586  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
587  const GlobalPoint point2(info2.trkGlobPosAtHcal.x(), info2.trkGlobPosAtHcal.y(), info2.trkGlobPosAtHcal.z());
588 
589  if (debug)
590  edm::LogVerbatim("IsoTrack") << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " "
591  << pTrack2->phi();
592 
593  if (info2.isGoodHcal) {
594  const DetId anyCell = gHB->getClosestCell(point2);
595  if (debug)
596  edm::LogVerbatim("IsoTrack") << "chargeIsolation:: HCAL cell " << static_cast<HcalDetId>(anyCell)
597  << " for pt " << pTrack2->p();
598  if (!spr::chargeIsolation(anyCell, vdets)) {
599  if (maxNearP < pTrack2->p())
600  maxNearP = pTrack2->p();
601  }
602  if (debug) {
603  edm::LogVerbatim("IsoTrack") << "maxNearP " << maxNearP << " thisCell " << static_cast<HcalDetId>(anyCell)
604  << " (" << info2.trkGlobPosAtHcal.x() << "," << info2.trkGlobPosAtHcal.y()
605  << "," << info2.trkGlobPosAtHcal.z() << ")";
606  }
607  }
608  }
609  }
610  return maxNearP;
611  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:150
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
math::XYZPoint trkGlobPosAtHcal
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
virtual DetId getClosestCell(const GlobalPoint &r) const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
Definition: DetId.h:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
#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)

◆ coneChargeIsolation() [1/2]

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 242 of file ChargeIsolation.cc.

References LCToCPAssociation_cfi::associator, TrackAssociatorParameters::bFieldToken, HGC3DClusterGenMatchSelector_cfi::dR, edm::EventSetup::getData(), reco::TrackBase::hitPattern(), iEvent, TrackDetMatchInfo::isGoodHcal, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), reco::HitPattern::trackerLayersWithMeasurement(), TrackDetMatchInfo::trkGlobPosAtHcal, run3scouting_cff::trkQuality, and reco::TrackBase::undefQuality.

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

255  {
256  nNearTRKs = 0;
257  nLayers_maxNearP = 0;
258  trkQual_maxNearP = -1;
259  maxNearP_goodTrk = -999.0;
260  double maxNearP = -999.0;
261  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
262 
263  // Iterate over tracks
264  reco::TrackCollection::const_iterator trkItr2;
265  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
266  // Get track
267  const reco::Track* pTrack2 = &(*trkItr2);
268 
269  // Get track qual, nlayers, and hit pattern
270  bool trkQuality = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack2->quality(trackQuality_)) : true;
271  if (trkQuality)
272  trkQual_maxNearP = 1;
273  const reco::HitPattern& hitp = pTrack2->hitPattern();
274  nLayers_maxNearP = hitp.trackerLayersWithMeasurement();
275 
276  // Skip if the neighboring track candidate is the iso-track
277  // candidate
278  if (trkItr2 != trkItr) {
279  // Get propagator
280  const FreeTrajectoryState fts2 =
281  associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2);
282  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
283 
284  // Make sure it reaches Hcal
285  if (info2.isGoodHcal) {
286  const GlobalPoint point2(info2.trkGlobPosAtHcal.x(), info2.trkGlobPosAtHcal.y(), info2.trkGlobPosAtHcal.z());
287 
288  int isConeChargedIso = spr::coneChargeIsolation(hpoint1, point2, trackMom, dR);
289 
290  if (isConeChargedIso == 0) {
291  nNearTRKs++;
292  if (maxNearP < pTrack2->p()) {
293  maxNearP = pTrack2->p();
294  if (trkQual_maxNearP > 0 && nLayers_maxNearP > 7 && maxNearP_goodTrk < pTrack2->p()) {
295  maxNearP_goodTrk = pTrack2->p();
296  }
297  }
298  }
299  }
300  }
301  } // Iterate over track loop
302 
303  return maxNearP;
304  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
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)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
TrackQuality
track quality
Definition: TrackBase.h:150
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:535
math::XYZPoint trkGlobPosAtHcal
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504

◆ coneChargeIsolation() [2/2]

int spr::coneChargeIsolation ( const GlobalPoint hpoint1,
const GlobalPoint point2,
const GlobalVector trackMom,
double  dR 
)

Definition at line 395 of file ChargeIsolation.cc.

References HGC3DClusterGenMatchSelector_cfi::dR, and getDistInPlaneTrackDir().

398  {
399  int isIsolated = 1;
400  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR)
401  isIsolated = 1;
402  else
403  isIsolated = 0;
404  return isIsolated;
405  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9

◆ debugEcalDet()

std::ostringstream spr::debugEcalDet ( unsigned int  i,
const DetId det 
)

Definition at line 12 of file DebugInfo.cc.

References TauDecayModes::dec, EcalBarrel, EcalEndcap, mps_fire::i, EcalPhiSymFlatTableProducers_cfi::id, and DetId::subdetId().

Referenced by debugEcalDets(), matrixECALIds(), and newECALIdNS().

12  {
13  std::ostringstream st1;
14  st1 << "Cell [" << i << "] 0x";
15  if (det.subdetId() == EcalBarrel) {
16  EBDetId id(det);
17  st1 << std::hex << det() << std::dec << " " << id;
18  } else if (det.subdetId() == EcalEndcap) {
19  EEDetId id(det);
20  st1 << std::hex << det() << std::dec << " " << id;
21  } else {
22  st1 << std::hex << det() << std::dec << " Unknown Type";
23  }
24  return st1;
25  }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ debugEcalDets() [1/2]

void spr::debugEcalDets ( unsigned int  last,
std::vector< DetId > &  vdets 
)

Definition at line 27 of file DebugInfo.cc.

References debugEcalDet(), mps_fire::i, and dqmdumpme::last.

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

27  {
28  for (unsigned int i = last; i < vdets.size(); ++i) {
29  edm::LogVerbatim("IsoTrack") << spr::debugEcalDet(i, vdets[i]).str();
30  }
31  }
Log< level::Info, true > LogVerbatim
std::ostringstream debugEcalDet(unsigned int, const DetId &)
Definition: DebugInfo.cc:12

◆ debugEcalDets() [2/2]

void spr::debugEcalDets ( unsigned int  last,
std::vector< DetId > &  vdets,
std::vector< CaloDirection > &  dirs 
)

Definition at line 33 of file DebugInfo.cc.

References debugEcalDet(), heppy_check::dirs, mps_fire::i, and dqmdumpme::last.

33  {
34  for (unsigned int i = last; i < vdets.size(); ++i) {
35  edm::LogVerbatim("IsoTrack") << spr::debugEcalDet(i, vdets[i]).str() << " along " << dirs[i] << std::endl;
36  }
37  }
Log< level::Info, true > LogVerbatim
std::ostringstream debugEcalDet(unsigned int, const DetId &)
Definition: DebugInfo.cc:12

◆ debugHcalDets()

void spr::debugHcalDets ( unsigned int  last,
std::vector< DetId > &  vdets 
)

Definition at line 39 of file DebugInfo.cc.

References TauDecayModes::dec, mps_fire::i, and dqmdumpme::last.

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

39  {
40  for (unsigned int i = last; i < vdets.size(); ++i) {
41  HcalDetId id = vdets[i]();
42  edm::LogVerbatim("IsoTrack") << "Cell [" << i << "] 0x" << std::hex << vdets[i]() << std::dec << " " << id;
43  }
44  }
Log< level::Info, true > LogVerbatim

◆ eCaloSimInfo() [1/6]

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 
)

◆ eCaloSimInfo() [2/6]

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 
)

◆ eCaloSimInfo() [3/6]

std::map<std::string, double> spr::eCaloSimInfo ( caloSimInfo info)

◆ eCaloSimInfo() [4/6]

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 
)

◆ eCaloSimInfo() [5/6]

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 
)

◆ eCaloSimInfo() [6/6]

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 
)

◆ eCone_ecal() [1/2]

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 
)

◆ eCone_ecal() [2/2]

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 
)

◆ eCone_hcal() [1/4]

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 
)

◆ eCone_hcal() [2/4]

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 
)

◆ eCone_hcal() [3/4]

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 
)

◆ eCone_hcal() [4/4]

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 
)

◆ eECALmatrix() [1/8]

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 
)

◆ eECALmatrix() [2/8]

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 
)

◆ eECALmatrix() [3/8]

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 
)

◆ eECALmatrix() [4/8]

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 75 of file eECALMatrix.cc.

References debug, hcalRecHitTable_cff::detId, DetId::Ecal, EcalBarrel, EcalEndcap, energyECAL(), RemoveAddSevLevel::flag, EcalPhiSymFlatTableProducers_cfi::hitsEB, EcalPhiSymFlatTableProducers_cfi::hitsEE, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, EcalSeverityLevel::kWeird, matrixECALIds(), and EcalSeverityLevelAlgo::severityLevel().

88  {
89  std::vector<DetId> vdets;
90  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
91  if (debug)
92  edm::LogVerbatim("IsoTrack") << "Inside eECALmatrix " << 2 * ieta + 1 << "X" << 2 * iphi + 1 << " nXtals "
93  << vdets.size();
94  bool flag(true);
95  for (const auto& id : vdets) {
96  if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalBarrel)) {
97  if (sevlv->severityLevel(id, (*hitsEB)) == EcalSeverityLevel::kWeird)
98  flag = false;
99  } else if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalEndcap)) {
100  if (sevlv->severityLevel(id, (*hitsEE)) == EcalSeverityLevel::kWeird)
101  flag = false;
102  }
103  }
104  return std::pair<double, bool>(spr::energyECAL(vdets, hitsEB, hitsEE, ebThr, eeThr, tMin, tMax, debug), flag);
105  }
Log< level::Info, true > LogVerbatim
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)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
#define debug
Definition: HDRShower.cc:19

◆ eECALmatrix() [5/8]

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 107 of file eECALMatrix.cc.

References debug, TauDecayModes::dec, hcalRecHitTable_cff::detId, DetId::Ecal, EcalBarrel, EcalEndcap, energyECAL(), energyECALTower(), CastorDataFrameFilter_impl::energySum(), RemoveAddSevLevel::flag, EcalPhiSymFlatTableProducers_cfi::hitsEB, EcalPhiSymFlatTableProducers_cfi::hitsEE, EcalPhiSymFlatTableProducers_cfi::id, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, matrixECALIds(), and convertSQLiteXML::ok.

121  {
122  std::vector<DetId> vdets;
123  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
124  if (debug)
125  edm::LogVerbatim("IsoTrack") << "Inside eECALmatrix " << 2 * ieta + 1 << "X" << 2 * iphi + 1 << " nXtals "
126  << vdets.size();
127 
128  bool flag(true);
129  double energySum = 0.0;
130  for (const auto& id : vdets) {
131  if ((id != DetId(0)) && (id.det() == DetId::Ecal) &&
132  ((id.subdetId() == EcalBarrel) || (id.subdetId() == EcalEndcap))) {
133  double eTower = spr::energyECALTower(id, hitsEB, hitsEE, ttMap, debug);
134  bool ok = (id.subdetId() == EcalBarrel) ? (eTower > ebThr) : (eTower > eeThr);
135  if (debug && (!ok))
136  edm::LogVerbatim("IsoTrack") << "Crystal 0x" << std::hex << id() << std::dec << " Flag " << ok;
137  if (ok) {
138  std::pair<double, bool> ecalEn = (id.subdetId() == EcalBarrel)
139  ? spr::energyECAL(id, hitsEB, sevlv, true, tMin, tMax, debug)
140  : spr::energyECAL(id, hitsEE, sevlv, false, tMin, tMax, debug);
141  if (!ecalEn.second)
142  flag = false;
143  energySum += ecalEn.first;
144  }
145  }
146  }
147  if (debug)
148  edm::LogVerbatim("IsoTrack") << "energyECAL: energySum = " << energySum << " flag = " << flag;
149  return std::pair<double, bool>(energySum, flag);
150  }
Log< level::Info, true > LogVerbatim
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:17
#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)

◆ eECALmatrix() [6/8]

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 152 of file eECALMatrix.cc.

References CaloTowerConstituentsMap::constituentsOf(), debug, TauDecayModes::dec, hcalRecHitTable_cff::detId, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, energyECAL(), RemoveAddSevLevel::flag, DetId::Hcal, EcalPhiSymFlatTableProducers_cfi::hitsEB, EcalPhiSymFlatTableProducers_cfi::hitsEE, mps_fire::i, EcalSeverityLevel::kWeird, EcalSeverityLevelAlgo::severityLevel(), l1tHGCalTowerProducer_cfi::tower, and CaloTowerConstituentsMap::towerOf().

162  {
163  CaloTowerDetId tower = ctmap->towerOf(detId);
164  std::vector<DetId> ids = ctmap->constituentsOf(tower);
165  if (debug) {
166  edm::LogVerbatim("IsoTrack") << "eECALmatrix: " << detId << " belongs to " << tower << " which has " << ids.size()
167  << " constituents";
168  for (unsigned int i = 0; i < ids.size(); ++i) {
169  std::ostringstream st1;
170  st1 << "[" << i << "] " << std::hex << ids[i].rawId() << std::dec;
171  if (ids[i].det() == DetId::Ecal && ids[i].subdetId() == EcalBarrel) {
172  st1 << " " << EBDetId(ids[i]);
173  } else if (ids[i].det() == DetId::Ecal && ids[i].subdetId() == EcalEndcap) {
174  st1 << " " << EEDetId(ids[i]);
175  } else if (ids[i].det() == DetId::Ecal && ids[i].subdetId() == EcalPreshower) {
176  st1 << " " << ESDetId(ids[i]);
177  } else if (ids[i].det() == DetId::Hcal) {
178  st1 << " " << HcalDetId(ids[i]);
179  }
180  edm::LogVerbatim("IsoTrack") << st1.str();
181  }
182  }
183 
184  std::vector<DetId> idEBEE;
185  bool flag(true);
186  for (const auto& id : ids) {
187  if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalBarrel)) {
188  idEBEE.emplace_back(id);
189  if (sevlv->severityLevel(id, (*hitsEB)) == EcalSeverityLevel::kWeird)
190  flag = false;
191  } else if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalEndcap)) {
192  idEBEE.emplace_back(id);
193  if (sevlv->severityLevel(id, (*hitsEE)) == EcalSeverityLevel::kWeird)
194  flag = false;
195  }
196  }
197 
198  if (debug)
199  edm::LogVerbatim("IsoTrack") << "eECALmatrix: with " << idEBEE.size() << " EB+EE hits and "
200  << "spike flag " << flag;
201  double etot = (!idEBEE.empty()) ? spr::energyECAL(idEBEE, hitsEB, hitsEE, ebThr, eeThr, tMin, tMax, debug) : 0;
202  return std::pair<double, bool>(etot, flag);
203  }
Log< level::Info, true > LogVerbatim
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)
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )

◆ eECALmatrix() [7/8]

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 EcalPFRecHitThresholds eThr,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 205 of file eECALMatrix.cc.

References debug, TauDecayModes::dec, hcalRecHitTable_cff::detId, DetId::Ecal, EcalBarrel, EcalEndcap, HBHEDarkening_cff::energy, CastorDataFrameFilter_impl::energySum(), findHit(), RemoveAddSevLevel::flag, EcalPhiSymFlatTableProducers_cfi::hitsEB, EcalPhiSymFlatTableProducers_cfi::hitsEE, testProducerWithPsetDescEmpty_cfi::i1, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, EcalSeverityLevel::kWeird, matrixECALIds(), and EcalSeverityLevelAlgo::severityLevel().

215  {
216  std::vector<DetId> vdets;
217  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
218  if (debug)
219  edm::LogVerbatim("IsoTrack") << "Inside eECALmatrix " << 2 * ieta + 1 << "X" << 2 * iphi + 1 << " nXtals "
220  << vdets.size();
221  bool flag(true);
222  for (const auto& id : vdets) {
223  if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalBarrel)) {
224  if (sevlv->severityLevel(id, (*hitsEB)) == EcalSeverityLevel::kWeird)
225  flag = false;
226  } else if ((id.det() == DetId::Ecal) && (id.subdetId() == EcalEndcap)) {
227  if (sevlv->severityLevel(id, (*hitsEE)) == EcalSeverityLevel::kWeird)
228  flag = false;
229  }
230  }
231  double energySum = 0.0;
232  for (unsigned int i1 = 0; i1 < vdets.size(); i1++) {
233  if (vdets[i1] != DetId(0)) {
234  std::vector<EcalRecHitCollection::const_iterator> hit;
235  if (vdets[i1].subdetId() == EcalBarrel) {
236  spr::findHit(hitsEB, vdets[i1], hit, debug);
237  } else if (vdets[i1].subdetId() == EcalEndcap) {
238  spr::findHit(hitsEE, vdets[i1], hit, debug);
239  }
240  std::ostringstream st1;
241  if (debug)
242  st1 << "Crystal 0x" << std::hex << vdets[i1]() << std::dec;
243  double ener = 0, ethr = static_cast<double>((*eThresholds)[vdets[i1]]);
244  for (unsigned int ihit = 0; ihit < hit.size(); ihit++) {
245  double en = 0;
246  if (vdets[i1].subdetId() == EcalBarrel) {
247  if (hit[ihit] != hitsEB->end())
248  en = hit[ihit]->energy();
249  } else if (vdets[i1].subdetId() == EcalEndcap) {
250  if (hit[ihit] != hitsEE->end())
251  en = hit[ihit]->energy();
252  }
253  if (debug)
254  st1 << " " << ihit << " " << en << " Thr " << ethr;
255  ener += en;
256  }
257  if (debug)
258  edm::LogVerbatim("IsoTrack") << st1.str();
259  if (ener > ethr)
260  energySum += ener;
261  }
262  }
263  return std::pair<double, bool>(energySum, flag);
264  }
Log< level::Info, true > LogVerbatim
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
double energySum(const DataFrame &df, int fs, int ls)

◆ eECALmatrix() [8/8]

template<typename T >
double spr::eECALmatrix ( CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  debug = false 
)

◆ eECALmatrixCell()

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 
)

◆ eECALmatrixTotal()

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 
)

◆ eECALSimInfo() [1/4]

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 
)

◆ eECALSimInfo() [2/4]

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 
)

◆ eECALSimInfo() [3/4]

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 
)

◆ eECALSimInfo() [4/4]

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 
)

◆ eECALSimInfoMatrix()

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 
)

◆ eECALSimInfoTotal()

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 
)

◆ eGenSimInfo() [1/4]

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 10 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugEcalDets(), hcalRecHitTable_cff::ieta, info(), hcalRecHitTable_cff::iphi, and matrixECALIds().

Referenced by StudyCaloGen::analyze(), and IsolatedGenParticles::analyze().

18  {
19  if (debug)
20  edm::LogVerbatim("IsoTrack") << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/"
21  << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi()
22  << " with ieta:iphi " << ieta << ":" << iphi;
23 
24  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, false);
25  if (debug)
26  spr::debugEcalDets(0, vdets);
27  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
28  }
Log< level::Info, true > LogVerbatim
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)
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:176
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
#define debug
Definition: HDRShower.cc:19

◆ eGenSimInfo() [2/4]

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 30 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugEcalDets(), HGC3DClusterGenMatchSelector_cfi::dR, info(), and matrixECALIds().

38  {
39  if (debug)
40  edm::LogVerbatim("IsoTrack") << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/"
41  << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi()
42  << " with dR,tMom " << dR << " " << trackMom;
43 
44  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, false);
45  if (debug)
46  spr::debugEcalDets(0, vdets);
47  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
48  }
Log< level::Info, true > LogVerbatim
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)
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:176
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
#define debug
Definition: HDRShower.cc:19

◆ eGenSimInfo() [3/4]

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 50 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugEcalDets(), hcalRecHitTable_cff::ieta, info(), hcalRecHitTable_cff::iphi, and matrixECALIds().

58  {
59  if (debug)
60  edm::LogVerbatim("IsoTrack") << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/"
61  << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi "
62  << ieta << ":" << iphi;
63 
64  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, false);
65  if (debug)
66  spr::debugEcalDets(0, vdets);
67  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
68  }
Log< level::Info, true > LogVerbatim
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)
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:176
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
#define debug
Definition: HDRShower.cc:19

◆ eGenSimInfo() [4/4]

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 70 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugEcalDets(), HGC3DClusterGenMatchSelector_cfi::dR, info(), and matrixECALIds().

78  {
79  if (debug)
80  edm::LogVerbatim("IsoTrack") << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/"
81  << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom "
82  << dR << " " << trackMom;
83 
84  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, false);
85  if (debug)
86  spr::debugEcalDets(0, vdets);
87  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
88  }
Log< level::Info, true > LogVerbatim
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)
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:176
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
#define debug
Definition: HDRShower.cc:19

◆ eHCALmatrix() [1/7]

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 
)

◆ eHCALmatrix() [2/7]

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 10 of file eHCALMatrix.cc.

References debug, debugHcalDets(), eHCALThreshold(), HBHEDarkening_cff::energy, CastorDataFrameFilter_impl::energySum(), findHit(), hfClusterShapes_cfi::hits, mps_fire::i, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, matrixHCALIds(), DetId::rawId(), nano_mu_digi_cff::rawId, hcalRecHitTable_cff::time, and HLT_2024v14_cff::topology.

22  {
23  HcalDetId hcid0(det0.rawId());
24  HcalDetId hcid(hcid0.subdet(), hcid0.ieta(), hcid0.iphi(), 1);
25  DetId det(hcid.rawId());
26  if (debug)
27  edm::LogVerbatim("IsoTrack") << "Inside eHCALmatrix " << 2 * ieta + 1 << "X" << 2 * iphi + 1
28  << " Inclusion of HO Flag " << includeHO;
29 
30  double energySum(0);
31  std::vector<DetId> dets(1, det);
32  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
33  if (debug) {
34  edm::LogVerbatim("IsoTrack") << "matrixHCALIds::Total number of cells found is " << vdets.size();
35  spr::debugHcalDets(0, vdets);
36  }
37 
38  int khit(0);
39  for (unsigned int i = 0; i < vdets.size(); i++) {
40  std::vector<std::vector<PCaloHit>::const_iterator> hit = spr::findHit(hits, vdets[i]);
41  double energy = 0;
42  int subdet = ((HcalDetId)(vdets[i].rawId())).subdet();
43  double eThr = spr::eHCALThreshold(subdet, hbThr, heThr, hfThr, hoThr);
44  for (unsigned int ihit = 0; ihit < hit.size(); ihit++) {
45  if (hit[ihit] != hits.end()) {
46  khit++;
47  if (debug)
48  edm::LogVerbatim("IsoTrack") << "energyHCAL:: Hit " << khit << " " << (HcalDetId)vdets[i] << " E "
49  << hit[ihit]->energy() << " t " << hit[ihit]->time();
50 
51  if (hit[ihit]->time() > tMin && hit[ihit]->time() < tMax) {
52  energy += hit[ihit]->energy();
53  }
54  }
55  }
56  if (energy > eThr)
57  energySum += energy;
58  }
59 
60  if (debug)
61  edm::LogVerbatim("IsoTrack") << "eHCALmatrix::Total energy " << energySum;
62  return energySum;
63  }
Log< level::Info, true > LogVerbatim
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:39
double eHCALThreshold(int subdet, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100)
Definition: eHCALMatrix.cc:241
Definition: DetId.h:17
#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)

◆ eHCALmatrix() [3/7]

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 
)

◆ eHCALmatrix() [4/7]

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 
)

◆ eHCALmatrix() [5/7]

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 
)

◆ eHCALmatrix() [6/7]

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 
)

◆ eHCALmatrix() [7/7]

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 65 of file eHCALMatrix.cc.

References debug, HBHEDarkening_cff::energy, CastorDataFrameFilter_impl::energySum(), findHit(), newFWLiteAna::found, HcalOuter, hfClusterShapes_cfi::hits, mps_fire::i, globals_cff::id1, hcalRecHitTable_cff::ieta, HcalDetId::ieta(), hcalRecHitTable_cff::iphi, HcalDetId::iphi(), matrixHCALIds(), DetId::rawId(), HcalDetId::subdet(), and HLT_2024v14_cff::topology.

73  {
74  HcalDetId hcid0(det0.rawId());
75  HcalDetId hcid(hcid0.subdet(), hcid0.ieta(), hcid0.iphi(), 1);
76  DetId det(hcid.rawId());
77  std::vector<DetId> dets(1, det);
78  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, debug);
79  hotCell = hcid0;
80 
81  std::vector<std::vector<PCaloHit>::const_iterator> hitlist;
82  for (unsigned int i = 0; i < vdets.size(); i++) {
83  std::vector<std::vector<PCaloHit>::const_iterator> hit = spr::findHit(hits, vdets[i]);
84  hitlist.insert(hitlist.end(), hit.begin(), hit.end());
85  }
86 
87  double energySum(0);
88  for (unsigned int ihit = 0; ihit < hitlist.size(); ihit++)
89  energySum += hitlist[ihit]->energy();
90 
91  // Get hotCell ID
92  dets.clear();
93  std::vector<double> energies;
94  for (unsigned int ihit = 0; ihit < hitlist.size(); ihit++) {
95  double energy = hitlist[ihit]->energy();
96  HcalDetId id0 = HcalDetId(hitlist[ihit]->id());
97  if ((id0.subdet() != HcalOuter) || includeHO) {
98  HcalDetId id1(id0.subdet(), id0.ieta(), id0.iphi(), 1);
99  bool found(false);
100  for (unsigned int idet = 0; idet < dets.size(); ++idet) {
101  if (id1 == HcalDetId(dets[idet])) {
102  energies[idet] += energy;
103  found = true;
104  break;
105  }
106  }
107  if (!found) {
108  dets.push_back(DetId(id1));
109  energies.push_back(energy);
110  }
111  }
112  }
113  double energyMax(-99.);
114  for (unsigned int ihit = 0; ihit < dets.size(); ihit++) {
115  if (energies[ihit] > energyMax) {
116  energyMax = energies[ihit];
117  hotCell = HcalDetId(dets[ihit]);
118  }
119  }
120  return energySum;
121  }
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
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)
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157

◆ eHCALmatrixCell()

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 
)

◆ eHCALmatrixTotal()

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 
)

◆ eHCALSimInfo() [1/4]

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 
)

◆ eHCALSimInfo() [2/4]

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 
)

◆ eHCALSimInfo() [3/4]

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 
)

◆ eHCALSimInfo() [4/4]

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 
)

◆ eHCALSimInfoMatrix()

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 
)

◆ eHCALSimInfoTotal()

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 
)

◆ eHCALThreshold()

double spr::eHCALThreshold ( int  subdet,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100 
)

Definition at line 241 of file eHCALMatrix.cc.

References HcalEndcap, HcalForward, and HcalOuter.

Referenced by eHCALmatrix(), and energyHCALCell().

241  {
242  double eThr = hbThr;
243  if (subdet == (int)(HcalEndcap))
244  eThr = heThr;
245  else if (subdet == (int)(HcalForward))
246  eThr = hfThr;
247  else if (subdet == (int)(HcalOuter))
248  eThr = hoThr;
249  return eThr;
250  }

◆ energyDetIdHCAL()

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 
)

◆ energyECAL() [1/4]

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 debug, TauDecayModes::dec, edm::SortedCollection< T, SORT >::end(), findHit(), RemoveAddSevLevel::flag, hfClusterShapes_cfi::hits, EcalPhiSymFlatTableProducers_cfi::id, edm::HandleBase::isValid(), EcalSeverityLevel::kWeird, edm::Handle< T >::product(), EcalSeverityLevelAlgo::severityLevel(), and groupFilesInBlocks::tt.

21  {
22  std::vector<EcalRecHitCollection::const_iterator> hits;
23  spr::findHit(hitsEC, id, hits, debug);
24 
25  std::ostringstream st1;
26  if (debug)
27  st1 << "Xtal 0x" << std::hex << id() << std::dec;
28  const EcalRecHitCollection* recHitsEC = (hitsEC.isValid()) ? hitsEC.product() : nullptr;
29  bool flag = (!testSpike) ? true : (sevlv->severityLevel(id, (*recHitsEC)) != EcalSeverityLevel::kWeird);
30  double ener(0);
31  for (const auto& hit : hits) {
32  double en(0), tt(0);
33  if (hit != hitsEC->end()) {
34  en = hit->energy();
35  tt = hit->time();
36  }
37  if (debug)
38  st1 << " " << tt << " " << en;
39  if (tt > tMin && tt < tMax)
40  ener += en;
41  }
42  if (debug) {
43  if (!flag)
44  st1 << " detected to be a spike";
45  edm::LogVerbatim("IsoTrack") << st1.str();
46  }
47  return std::pair<double, bool>(ener, flag);
48  }
Log< level::Info, true > LogVerbatim
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
T const * product() const
Definition: Handle.h:70
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
Definition: TTTypes.h:54
const_iterator end() const
#define debug
Definition: HDRShower.cc:19
bool isValid() const
Definition: HandleBase.h:70

◆ energyECAL() [2/4]

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 50 of file eECALMatrix.cc.

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

58  {
59  bool flag(true);
60  double energySum(0.0);
61  for (const auto& id : vdets) {
62  if (id != DetId(0)) {
63  std::pair<double, bool> ecalEn = spr::energyECAL(id, hitsEC, sevlv, testSpike, tMin, tMax, debug);
64  if (!ecalEn.second)
65  flag = false;
66  if ((ecalEn.first > eThr) || noThrCut)
67  energySum += ecalEn.first;
68  }
69  }
70  if (debug)
71  edm::LogVerbatim("IsoTrack") << "energyECAL: energySum = " << energySum << " flag = " << flag;
72  return std::pair<double, bool>(energySum, flag);
73  }
Log< level::Info, true > LogVerbatim
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:17
#define debug
Definition: HDRShower.cc:19
double energySum(const DataFrame &df, int fs, int ls)

◆ energyECAL() [3/4]

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 
)

◆ energyECAL() [4/4]

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 
)

◆ energyECALCell()

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 
)

◆ energyECALTower()

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().

◆ energyHCAL() [1/2]

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 
)

◆ energyHCAL() [2/2]

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 
)

◆ energyHCALCell() [1/2]

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 
)

◆ energyHCALCell() [2/2]

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 123 of file eHCALMatrix.cc.

References debug, hcalRecHitTable_cff::detId, eHCALThreshold(), HBHEDarkening_cff::energy, findHit(), photonIsolationHIProducer_cfi::hbhe, HcalBarrel, HcalEndcap, hfClusterShapes_cfi::hits, mps_fire::i, HLT_2024v14_cff::maxDepth, and hcalRecHitTable_cff::time.

134  {
135  energyCell.clear();
136  int subdet = detId.subdet();
137  double eThr = spr::eHCALThreshold(subdet, hbThr, heThr, hfThr, hoThr);
138  bool hbhe = (detId.ietaAbs() == 16);
139  if (debug)
140  edm::LogVerbatim("IsoTrack") << "energyHCALCell: input ID " << detId << " MaxDepth " << maxDepth
141  << " Threshold (E) " << eThr << " (T) " << tMin << ":" << tMax;
142 
143  for (int i = 0; i < maxDepth; i++) {
144  HcalSubdetector subdet0 = (hbhe) ? ((i + 1 >= depthHE) ? HcalEndcap : HcalBarrel) : detId.subdet();
145  HcalDetId hcid(subdet0, detId.ieta(), detId.iphi(), i + 1);
146  DetId det(hcid.rawId());
147  std::vector<std::vector<PCaloHit>::const_iterator> hit = spr::findHit(hits, det);
148  double energy(0);
149  for (unsigned int ihit = 0; ihit < hit.size(); ++ihit) {
150  if (hit[ihit]->time() > tMin && hit[ihit]->time() < tMax)
151  energy += hit[ihit]->energy();
152  if (debug)
153  edm::LogVerbatim("IsoTrack") << "energyHCALCell:: Hit[" << ihit << "] " << hcid << " E "
154  << hit[ihit]->energy() << " t " << hit[ihit]->time();
155  }
156 
157  if (debug)
158  edm::LogVerbatim("IsoTrack") << "energyHCALCell:: Cell " << hcid << " E " << energy << " from " << hit.size()
159  << " threshold " << eThr;
160  if (energy > eThr && !hit.empty()) {
161  energyCell.push_back(std::pair<double, int>(energy, i + 1));
162  }
163  }
164 
165  if (debug) {
166  std::ostringstream st1;
167  st1 << "energyHCALCell:: " << energyCell.size() << " entries from " << maxDepth << " depths:";
168  for (unsigned int i = 0; i < energyCell.size(); ++i) {
169  st1 << " [" << i << "] (" << energyCell[i].first << ":" << energyCell[i].second << ")";
170  }
171  edm::LogVerbatim("IsoTrack") << st1.str();
172  }
173  }
Log< level::Info, true > LogVerbatim
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:241
HcalSubdetector
Definition: HcalAssistant.h:31
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19

◆ energyHCALmatrix()

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 
)

◆ energyHCALmatrixNew()

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 
)

◆ energyHCALmatrixTotal()

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 
)

◆ extraIds()

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 728 of file MatrixECALDetIds.cc.

References hgcalTBTopologyTester_cfi::cells, submitPVResolutionJobs::count, debug, debugEcalDets(), EcalBarrel, EcalEndcap, PVValHelper::eta, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), EcalEndcapGeometry::present(), EcalBarrelGeometry::present(), DetId::subdetId(), EBDetId::validDetId(), and EEDetId::validDetId().

Referenced by matrixECALIds().

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

◆ find() [1/3]

void spr::find ( edm::Handle< EcalRecHitCollection > &  hits,
DetId  thisDet,
std::vector< EcalRecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 19 of file FindCaloHit.cc.

References hfClusterShapes_cfi::hits.

Referenced by PedestalTask::_dump(), LaserTask::_dump(), LEDTask::_process(), DigiTask::_process(), Types.InputTag::_setValues(), ParticleDecayDrawer::accept(), ParticleTreeDrawer::accept(), DefaultFFTJetRcdMapper< FFTPFJetCorrectorSequence >::acquireToken(), HcalHBHEMuonAnalyzer::activeLength(), HcalHBHEMuonHighEtaAnalyzer::activeLength(), AlCaHcalHBHEMuonProducer::activeLength(), DTVDriftCalibration::cellInfo::add(), GEMChMap::add(), Measurement::addAffectingEntriesFromOptO(), RooUtil::Cutflow::addCutToSkipCutflowList(), reco::NamedCompositeCandidate::addDaughter(), reco::CompositeCandidate::addDaughter(), StubKiller::addDeadLayerModulesToDeadModuleList(), tmtt::StubKiller::addDeadLayerModulesToDeadModuleList(), reco::PFDisplacedVertexSeed::addElement(), CRackTrajectoryBuilder::AddHit(), CSCNeutronReader::addHits(), ClusterTPAssociation::addKeyID(), pat::TriggerEvent::addObjectMatchResult(), SiStripQualityHotStripIdentifier::algoAnalyze(), SiStripGainCosmicCalculator::algoBeginJob(), reco::Conversion::algoByName(), reco::TrackBase::algoByName(), CreateIdealTkAlRecords::alignToGT(), HcalFrontEndMap::allRBXs(), HcalFrontEndMap::allRMs(), ME0RecHitsValidation::analyze(), CSCCLCTDigiValidation::analyze(), CSCCorrelatedLCTDigiValidation::analyze(), EcalMatacqAnalyzer::analyze(), DD4hep_ListIds::analyze(), SiPixelBadFEDChannelSimulationSanityChecker::analyze(), edmtest::ESTestAnalyzerA::analyze(), EcalPnGraphs::analyze(), FCDTask::analyze(), SiStripDetVOffPrinter::analyze(), HcalFEDIntegrityTask::analyze(), PrintGeomSolids::analyze(), MaterialBudgetVolumeAnalysis::analyze(), EcalDQMonitorTask::analyze(), HGcalHitIdCheck::analyze(), HGCalTestScintHits::analyze(), HGCalTestPartialWaferRecHits::analyze(), DTT0CalibrationRMS::analyze(), HcalIsoTrackAnalyzer::analyze(), EcalDumpRaw::analyze(), HGCalTestPartialWaferHits::analyze(), SiStripApvGainBuilderFromTag::analyze(), HcalQIEDataCheck::analyze(), DTNoiseCalibration::analyze(), EcalABAnalyzer::analyze(), ParticleListDrawer::analyze(), HcalAutoPedestalValidator::analyze(), DTT0Calibration::analyze(), RecAnalyzerHF::analyze(), DQMHcalIsoTrackAlCaReco::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), EcalPerEvtLaserAnalyzer::analyze(), HLTBTagPerformanceAnalyzer::analyze(), LhcTrackAnalyzer::analyze(), DQMHcalIsolatedBunchAlCaReco::analyze(), DQMSourcePi0::analyze(), HcalCollapseAnalyzer::analyze(), HcalGainsCheck::analyze(), ParticleNetJetTagMonitor::analyze(), SiStripChannelGainFromDBMiscalibrator::analyze(), SiStripNoisesFromDBMiscalibrator::analyze(), HeavyFlavorValidation::analyze(), EcalLaserAnalyzer::analyze(), EcalLaserAnalyzer2::analyze(), L1TGT::analyze(), PixelLumiDQM::analyze(), FastSiPixelFEDChannelContainerFromQuality::analyze(), TestOutliers::analyze(), TestTrackHits::analyze(), EcalURecHitHists::analyze(), HLTMuonPlotter::analyze(), TestPythiaDecays::analyze(), edmtest::ESTestAnalyzerB::analyze(), ListIds::analyze(), CommonModeAnalyzer::analyze(), RecAnalyzerMinbias::analyze(), IsoTrackCalibration::analyze(), DTDigiTask::analyze(), EcalCosmicsHists::analyze(), HcalIsoTrkSimAnalyzer::analyze(), MtdTracksValidation::analyze(), HcalIsoTrkAnalyzer::analyze(), IsoTrig::analyze(), SiPixelLorentzAnglePCLWorker::analyze(), edmtest::ESTestAnalyzerK::analyze(), PrimaryVertexAnalyzer4PUSlimmed::analyze(), edmtest::ESTestAnalyzerAZ::analyze(), any(), CaloTowersCreationAlgo::assignHitEcal(), CSCHitAssociator::associateCSCHitId(), tt::StubAssociation::associateFinal(), CSCHitAssociator::associateHitId(), TrackerHitAssociator::associateMatchedRecHit(), TrackerHitAssociator::associatePhase2TrackerRecHit(), TrackerHitAssociator::associatePixelRecHit(), RPCHitAssociator::associateRecHit(), GEMHitAssociator::associateRecHit(), TrackerHitAssociator::associateSimpleRecHitCluster(), AlignmentParameterStore::attachCorrelations(), ProfilerService::beginPath(), MaterialBudgetHcalProducer::beginRun(), HLTHiggsSubAnalysis::beginRun(), MillePedeAlignmentAlgorithm::beginRun(), SiPixelLorentzAnglePCLHarvester::beginRun(), SiPixelLorentzAnglePCLHarvesterMCS::beginRun(), GctFormatTranslateV35::blockToGctInternEmCand(), Phase1PixelMaps::bookBarrelHistograms(), Phase1PixelMaps::bookForwardHistograms(), CSCCLCTDigiValidation::bookHistograms(), CSCCorrelatedLCTDigiValidation::bookHistograms(), HLTFiltersDQMonitor::bookHistograms(), EcalSimParametersFromDD::build(), HcalSimParametersFromDD::build(), magneticfield::InterpolatorBuilder::build(), CSCTriggerPrimitivesBuilder::build(), PFClusterFromHGCalTrackster::buildClusters(), SiStripFedCabling::buildFedCabling(), AlignmentTask::buildGeometry(), SiStripDetVOffBuilder::buildPSUdetIdMap(), PFEGammaAlgo::buildRefinedSuperCluster(), BXVectorSimpleFlatTableProducer< T >::BXVectorSimpleFlatTableProducer(), VirtualJetProducer::JetType::byName(), HLTEcalResonanceFilter::calcShowerShape(), HLTRegionalEcalResonanceFilter::calcShowerShape(), PtAssignmentEngine2016::calculate_pt_xml(), PtAssignmentEngine2017::calculate_pt_xml(), JetPlusTrackProducerAA::calculateBGtracksJet(), MultipleAlgoIterator::calculateOrphanInput(), PileUpSubtractor::calculateOrphanInput(), HiPuRhoProducer::calculateOrphanInput(), HGCalSD::calibCell(), ValidationOptions_cff::calledBycmsRun(), BestTrackSelection::cancel_multi_bx(), BestTrackSelection::cancel_one_bx(), reco::modules::CandCombinerBase::CandCombinerBase(), trklet::ChannelAssignment::channelId(), RunLumiEventChecker::check(), CSCDCCExaminer::check(), edm::checkForModuleDependencyCorrectness(), tt::Setup::checkGeometry(), Config::checkImportPermission(), ClusterTPAssociation::checkKeyProductID(), Multi5x5ClusterAlgo::checkMaxima(), GlobalTag.GlobalTag::checkPrefix(), ECALpedestalPCLHarvester::checkStatusCode(), MaterialBudgetAction::CheckTouchableInSelectedVolumes(), L1TMuon::DTBunchCrossingCleaner::clean(), BlockFormatter::CleanUp(), LowPtGsfElectronSCProducer::closestCluster(), cmsswRelease::cmsswIs44X(), cmsswRelease::cmsswIs52X(), edm::Exception::codeToString(), egammaisolation::EgammaRecHitExtractor::collect(), trackerTFP::KalmanFilter::comb(), HltDiff::compare(), EgammaTowerIsolationNew< NC >::compute(), MVAJetPuId::computeIdVariables(), vertexTools::computeSharedTracks(), L1TMuonBarrelParamsHelper::configFromDB(), FastFedCablingHistosUsingDb::connections(), CaloTowerConstituentsMap::constituentsOf(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer(), PedeSteererWeakModeConstraints::constructConstraints(), helpers::contains(), Model::copyMeasurements(), createPayload::copyToWorkflowdir(), SiStripFecCabling::countDevices(), hcaldqm::utilities::crate2fed(), DefaultFFTJetObjectFactory< AbsFFTSpecificScaleCalculator >::create(), cmsHarvester::create_and_check_castor_dir(), cmsHarvester::create_crab_config(), cmsHarvester::create_harvesting_output_file_name(), ESDigitizer::createNoisyList(), HcalDbASCIIIO::createObject< HcalDcsMap >(), logErrorHarvester_cff::customiseLogErrorHarvesterUsingOutputCommands(), l1tVertexFinder::VertexFinder::DBSCAN(), DDfetch(), ParticleDecayDrawer::decay(), gen::Py8HMC3InterfaceBase::declareSpecialSettings(), gen::Py8InterfaceBase::declareSpecialSettings(), gen::Pythia6Hadronizer::declareSpecialSettings(), trackerDTC::LayerEncoding::decode(), edm::defaultModuleLabel(), Model::deleteOptO(), muonisolation::CaloExtractor::deposit(), egamma::depth1HcalESum(), egamma::depth2HcalESum(), SiStripFineDelayHit::detId(), HcalTopology::detId2denseIdCALIB(), 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(), SusyPostProcessor::dqmEndJob(), OffsetDQMPostProcessor::dqmEndJob(), PFJetDQMPostProcessor::dqmEndJob(), SiStripLorentzAnglePCLHarvester::dqmEndJob(), SiStripGainsPCLHarvester::dqmEndJob(), JetMETHLTOfflineClient::dqmEndJob(), SiPixelStatusHarvester::dqmEndRun(), Phase1PixelMaps::drawBarrelMaps(), Phase1PixelMaps::drawForwardMaps(), Phase1PixelMaps::drawSummaryMaps(), edm::RootFile::dropOnInputAndReorder(), RPCLinkSynchroStat::dumpDelays(), CastorDumpConditions::dumpIt(), edmtest::HcalDumpConditions::dumpIt(), CaloTowersCreationAlgo::ecalChanStatusForCaloTower(), EcalDumpGeometry::EcalDumpGeometry(), EcalPreshowerMonitorClient::EcalPreshowerMonitorClient(), EmbeddingLHEProducer::EmbeddingLHEProducer(), CSCAnodeLCTProcessor::encodeHighMultiplicityBits(), CSCCathodeLCTProcessor::encodeHighMultiplicityBits(), hcaldqm::RawRunSummary::endLuminosityBlock(), L1ScalersClient::endLuminosityBlock(), HGCalClusterTools::energyInCone(), GsfVertexTrackCompatibilityEstimator::estimate(), KalmanVertexTrackCompatibilityEstimator< N >::estimate(), lowptgsfeleseed::HeavyObjectCache::eval(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), evf::EvFFEDExcluder::EvFFEDExcluder(), JetPlusTrackCorrector::excludeJta(), trklet::PurgeDuplicate::execute(), edm::ParameterSet::existsAs(), CompositeAlignmentParameters::extractAlignables(), CompositeAlignmentParameters::extractPositionAndLength(), CompositeAlignmentDerivativesExtractor::extractWithMultipleHits(), l1tVertexFinder::VertexFinder::fastHisto(), l1tVertexFinder::VertexFinder::fastHistoEmulation(), SiPixelFedCablingMap::fedIds(), DaqScopeModeTask::fill(), VertexFitterResult::fill(), tnp::ProbeFlag::fill(), EmbeddingLHEProducer::fill_lhe_with_particle(), JetPartonMatcher::fillAlgoritDefinition(), MaterialBudgetHcalHistos::fillBeginJob(), SiPixelActionExecutor::fillFEDErrorSummary(), HLTGenValHistCollFilter::fillHists(), Py8toJetInput::fillJetAlgoInput(), HLTMuonValidator::fillLabels(), GenWeightsTableProducer::fillLHEWeightTables(), PrintGeomSummary::fillLV(), MuonMesh::fillMesh(), ParticleNetFeatureEvaluator::fillParticleFeatures(), DeepBoostedJetTagInfoProducer::fillParticleFeatures(), L2TauNNProducerAlpaka::fillPatatracks(), L2TauNNProducer::fillPatatracks(), JetPartonMatcher::fillPhysicsDefinition(), edm::Principal::fillPrincipal(), PrintGeomSummary::fillPV(), TrackingNtuple::fillSeeds(), CastorShowerLibraryMaker::FillShowerEvent(), SiPixelActionExecutor::fillSummary(), edmtest::StreamIDFilter::filter(), ticl::ClusterFilterByAlgo::filter(), ticl::ClusterFilterByAlgoAndSize::filter(), ticl::ClusterFilterByAlgoAndSizeAndLayerRange::filter(), HltComparator::filter(), AlCaHcalIsotrkFilter::filter(), LogErrorFilter::filter(), ErrorSummaryFilter::filter(), SiStripCommissioningRunTypeFilter::filter(), AlCaIsolatedBunchSelector::filter(), HTXSFilter::filter(), AlCaIsoTracksProducerFilter::filter(), EcalSimpleUncalibRecHitFilter::filter(), AlCaHBHEMuonFilter::filter(), AlCaHEMuonFilter::filter(), AlCaLowPUHBHEMuonFilter::filter(), EcalMIPRecHitFilter::filter(), HLTEcalResonanceFilter::filter(), HLTRegionalEcalResonanceFilter::filter(), AlCaIsoTracksFilter::filter(), TTUTrackingAlg::filter(), RooUtil::Cutflow::filterCuts(), CSCDigiFilter::filterDigis(), commentSkipper.cppCommentSkipper::filterFile(), commentSkipper.buildFileCommentSkipper::filterMultilineComment(), commentSkipper.buildFileCommentSkipper::filterOneLineComment(), MuonSeedOrcaPatternRecognition::filterOverlappingChambers(), PFECALSuperClusterAlgo::finalizeSuperCluster(), FourVectorHLT::PathInfoCollection::find(), edm::Trie< T >::find(), BTVHLTOfflineSource::PathInfoCollection::find(), HLTInclusiveVBFSource::PathInfoCollection::find(), JetMETHLTOfflineSource::PathInfoCollection::find(), edm::find_in_all(), NearbyPixelClustersProducer::findAllTrajectoriesCrossings(), HGCalCalibrationCell::findCell(), DTCombinatorialExtendedPatternReco::findCompatibleHits(), SiStripPsuDetIdMap::findDcuIdFromDeviceAddress(), GenHFHadronMatcher::findHadronJets(), GenHFHadronMatcher::findInMothers(), JetCorrectorParametersCollection::findKey(), MSLayersAtAngle::findLayer(), HLTPerformanceInfo::findModule(), HLTPerformanceInfo::findPath(), JetPlusTrackCorrector::findTrack(), RPixPlaneCombinatoryTracking::findTracks(), edm::IndexIntoFile::fixIndexes(), cmsHarvester.CMSHarvester::format_conditions_string(), EcalDQMonitorTask::formSchedule(), ecaldqm::DependencySet::formSequence(), ecaldqm::DependencySet::formSequenceFragment_(), getRunInfo::Func_FillInfoDBS(), getRunInfo::Func_FillInfoRunRegistry(), pkg.AbstractPkg::generate(), SubsystemNeutronReader::generateChamberNoise(), PPSFastLocalSimulation::GenerateTrack(), pat::PATGenCandsFromSimTracksProducer::generatorRef_(), GenJetParticleSelector::GenJetParticleSelector(), VertexClassifier::genPrimaryVertices(), TrackClassifier::genPrimaryVertices(), cms::DDFilteredView::get(), harvestRelVal::get_cond_from_dsetpath(), egHLT::trigTools::getActiveFilters(), trklet::TrackletLUT::getBendCut(), hcaldqm::quantity::CrateQuantity::getBin(), EcalSelectiveReadoutProducer::getBinOfMax(), CastorCalibrationsSet::getCalibrations(), CastorCalibrationWidthsSet::getCalibrationWidths(), egHLT::ComCodes::getCode(), egHLT::TrigCodes::getCode(), hcalCalib::GetCoefFromMtrxInvOfAve(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), HLTScalersClient::CountLSFifo_t::getCount(), hcaldqm::utilities::getCrateList(), GenParticlePruner::getDaughterKeys(), TrackingParticleSelectorByGen::getDaughterKeys(), EcalElectronicsMapping::getDetId(), TrackAssociatorByHitsImpl::getDoubleCount(), QuickTrackAssociatorByHitsImpl::getDoubleCount(), EcalElectronicsMapping::getElectronicsId(), MuonGEMBaseHarvestor::getElement(), edm::eventsetup::EventSetupsController::getESProducerPSet(), HcalDDDRecConstants::getEtaBins(), SiPixelActionExecutor::getFEDSummaryME(), SiPixelActionExecutor::getGrandSummaryME(), JetCorrectorParametersCollection::getL5Bin(), JetCorrectorParametersCollection::getL7Bin(), BeamSpotWorkflow::getLastUploadedIOV(), BeamSpotWorkflow::getListOfRunsAndLumiFromDBS(), METCorrectorParametersCollection::getMiniAodBin(), CastorShowerLibraryMaker::GetMissingEnergy(), GenParticlePruner::getMotherKeys(), TrackingParticleSelectorByGen::getMotherKeys(), HcalSimParametersFromDD::getNames(), HcalTB06BeamParametersFromDD::getNames(), MaterialBudgetHcalHistos::getNames(), MaterialBudgetHcalProducer::getNames(), SiPhase2BadStripChannelBuilder::getNewObject(), popcon::EcalPulseShapesHandler::getNewObjects(), popcon::EcalPulseSymmCovariancesHandler::getNewObjects(), HLTGenValSource::getObjectCollection(), UMNioTask::getOrbitGapIndex(), LMFCorrCoefDat::getParameters(), GEMBaseValidation::getPidIdx(), HDQMSummary::getPosition(), SiStripSummary::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(), LCTContainer::getTimeMatched(), EcalElectronicsMapping::getTriggerElectronicsId(), HGCalWaferType::getType(), HGCalWaferMask::getTypeMode(), HGCalNumberingScheme::getUnitID(), 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(), HLTriggerJSONMonitoring::globalBeginRun(), GenWeightsTableProducer::globalBeginRun(), TPTask::globalEndLuminosityBlock(), RawTask::globalEndLuminosityBlock(), RecHitTask::globalEndLuminosityBlock(), DigiTask::globalEndLuminosityBlock(), RawPCCProducer::globalEndLuminosityBlockProduce(), TrapezoidalGrouping::group_hits(), SiStripMonitorTrack::handleBookMEs(), hitfit::Constraint_Intermed_Labels::has_label(), pat::TriggerObjectStandAlone::hasFilterOrCondition(), SiStripHashedDetId::hashedIndex(), pat::PATSingleVertexSelector::hasMode_(), MisalignmentScenarioBuilder::hasParameter_(), pat::TriggerObjectStandAlone::hasPathOrAlgorithm(), pat::Jet::hasSubjets(), BaseTnPEfficiencyTask::hasTrigger(), MuDTMuonExtTableProducer::hasTrigger(), MuCSCTnPFlatTableProducer::hasTrigger(), HcalDigisClient::HcalDigisEndjob(), HcalDumpGeometry::HcalDumpGeometry(), HcalOfflineHarvesting::HcalOfflineHarvesting(), HcalRawToDigi::HcalRawToDigi(), HcalRecHitsDQMClient::HcalRecHitsEndjob(), HGCalConcentratorProcessorSelection::HGCalConcentratorProcessorSelection(), HLTMuonL1TFilter::hltFilter(), HLTMuonL1RegionalFilter::hltFilter(), HLTMuonL1TRegionalFilter::hltFilter(), HLTMuonTrackMassFilter::hltFilter(), HLTPixelActivityFilter::hltFilter(), HLTMuonL2FromL1TPreFilter::hltFilter(), HLTMuonL2PreFilter::hltFilter(), HLTMuonL1Filter::hltFilter(), HLTHcalSimpleRecHitFilter::hltFilter(), GenHFHadronMatcher::idInList(), PixelInactiveAreaFinder::inactiveAreas(), include(), reco::PixelClusterCountsInEvent::increment(), reco::PixelClusterCounts::increment(), reco::PixelClusterCountsInEvent::incrementRoc(), reco::PixelClusterCounts::incrementRoc(), pat::TriggerPath::indexModule(), JetCorrectorParametersHelper::init(), SiPixelDigitizerAlgorithm::init(), SiStripDetKey::initFromPath(), SiStripFecKey::initFromPath(), SiStripFedKey::initFromPath(), XrdAdaptor::RequestManager::initialize(), GenericTriggerEventFlag::initRun(), egammaTools::EgammaDNNHelper::initScalerFiles(), trackerDTC::Stub::inRegion(), HBHEHitMap::insert(), MillePedeFileReader::isAlignableActive(), GEMEfficiencyAnalyzer::isCSCAllowed(), edm::eventsetup::EventSetupsController::isFirstMatch(), TTTrackAssociationMap< T >::isGenuine(), EcalElectronicsMapper::isGhost(), cms::MuonTCMETValueMapProducer::isGoodTrack(), TCMETAlgo::isGoodTrack(), CSCBadChambers::isInBadChamber(), ticl::Node::isInnerNeighbour(), HcalSimParametersFromDD::isItHF(), edm::eventsetup::EventSetupsController::isLastMatch(), edm::eventsetup::EventSetupsController::isMatchingESProducer(), edm::eventsetup::EventSetupsController::isMatchingESSource(), AlignmentParameterSelector::isMemberOfVector(), OnlineDQMDigiAD::IsModelExist(), SiPixelDisabledModules::isModuleDisabled(), GEMEfficiencyAnalyzer::isMuonSubdetAllowed(), GenHFHadronMatcher::isNeutralPdg(), EBDetId::isNextToEtaBoundary(), heppy::IsolationComputer::isoSumNeutralsWeighted(), heppy::IsolationComputer::isoSumRaw(), TrackingMaterialProducer::isSelectedFast(), reco::PFDisplacedVertex::isThereKindTracks(), trklet::PurgeDuplicate::isTrackInBin(), PPSFilteredProtonProducer::IsTrackOK(), HLTMuonL2ToL1Map::isTriggeredByL1(), HLTMuonL2ToL1TMap::isTriggeredByL1(), HcalLayerDepthMap::isValid(), GEMROMapping::isValidAMC(), GEMChMap::isValidAMC(), JetMatchingEWKFxFx::jetAlgorithmInput(), StubKiller::killStub(), tmtt::StubKiller::killStub(), L1MuGMTHWFileReader::L1MuGMTHWFileReader(), L1TCaloLayer1FetchLUTs(), L1TPFCandMultiMerger::L1TPFCandMultiMerger(), JsonOutputProducer::labelId(), HGVHistoProducerAlgo::layerClusters_to_CaloParticles(), trackerTFP::LayerEncoding::LayerEncoding(), HGCalTBDDDConstants::layerFromIndex(), HGCalDDDConstants::layerFromIndex(), trklet::ChannelAssignment::layerId(), trackerTFP::LayerEncoding::layerIdKF(), reco::PFTrajectoryPoint::layerTypeByName(), PerformancePayloadFromBinnedTFormula::limitPos(), PerformancePayloadFromTFormula::limitPos(), CSCGasCollisions::lnEnergyLoss(), CSCL1TPLookupTableEP::load(), DefaultFFTJetRcdMapper< FFTPFJetCorrectorSequence >::load(), L1MuGMTLUT::Load(), HcalGeomParameters::loadGeometry(), HGCalTBGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometryHexagon8(), HGCalGeomParameters::loadGeometryHexagonModule(), confdb.HLTProcess::loadSetupCff(), edm::service::MessageServicePSetValidation::lookForMatch(), edm::eventsetup::EventSetupsController::lookForMatches(), CommonMethods::ls(), das_client::main(), EcalSensitiveDetectorBuilder::make(), reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >::make(), HybridClusterAlgo::makeClusters(), TSToSimTSHitLCAssociatorByEnergyScoreImpl::makeConnections(), TSToSCAssociatorByEnergyScoreImpl::makeConnections(), MultiClusterAssociatorByEnergyScoreImpl::makeConnections(), LCToSCAssociatorByEnergyScoreImpl< HIT >::makeConnections(), LCToCPAssociatorByEnergyScoreImpl< HIT >::makeConnections(), TSToSimTSAssociatorByEnergyScoreImpl::makeConnections(), CaloTowersCreationAlgo::makeEcalBadChs(), HiBremRecoveryClusterAlgo::makeIslandSuperClusters(), EgammaHLTNxNClusterProducer::makeNxNClusters(), CSCHitFromStripOnly::makeStripData(), egammaObjectModifications_tools::makeVIDBitsModifier(), TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks(), triggerExpression::L1uGTReader::mask(), triggerExpression::PathReader::mask(), CSCStubMatcher::matchALCTsToSimTrack(), CSCStubMatcher::matchCLCTsToSimTrack(), CSCRecHitMatcher::matchCSCRecHit2DsToSimTrack(), matchedSimTrkIdxs(), TemplatedSecondaryVertexProducer< IPTI, VTX >::matchGroomedJets(), JetFlavourClustering::matchGroomedJets(), CSCStubMatcher::matchLCTsToSimTrack(), CSCStubMatcher::matchMPLCTsToSimTrack(), JetPlusTrackCorrector::matchTracks(), PerformancePayloadFromTable::maxPos(), trackerTFP::LayerEncoding::maybePattern(), ecaldqm::memDCCIndex(), merge(), CaloTowersMerger::mergedTower(), ticl::PatternRecognitionbyCA< TILES >::mergeTrackstersTRK(), reco::PFDisplacedVertexSeed::mergeWith(), l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), PerformancePayloadFromTable::minPos(), ModuleAllocMonitor::ModuleAllocMonitor(), MSLayersKeeperX0Averaged::MSLayersKeeperX0Averaged(), PreparePVTrends::multiRunPVValidation(), MultiTrackValidator::MultiTrackValidator(), TFileAdaptor::native(), edm::nonConsumedUnscheduledModules(), ObjectSelectorBase< SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >, OutputCollection, NonNullNumberSelector, PostProcessor, StoreManager, Base, ::reco::modules::EventSetupInit< SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder > >::type >::ObjectSelectorBase(), PdgIdExcluder::operator()(), PdgIdSelector::operator()(), StatusSelector::operator()(), rpcrawtodigi::DebugDigisPrintout::operator()(), pat::HLTL1MuonMatcher::operator()(), VarRangeCutColl< trigger::TriggerObject >::operator()(), RecoTrackSelectorBase::operator()(), FFTJetDict< Key, T, Compare, Allocator >::operator[](), ReadMapType< std::map< std::string, double > >::operator[](), edm::DetSetVector< TotemRPLocalTrack::FittedRecHit >::operator[](), cmsHarvester.CMSHarvester::option_handler_input_spec(), TransientVertex::originalTrack(), JetMatchingTools::overlapEnergyFraction(), AlpgenHeader::parameterName(), RPCLBLinkNameParser::parse(), Args::parse(), edmTracerLogToSimpleConfig.ConsumesParser::parse(), AlpgenHeader::parse(), Page1Parser.Page1Parser::ParseRunSummaryPage(), SiStripDbParams::partitionNames(), pat::PATLostTracks::PATLostTracks(), PFAnalyzer::PFAnalyzer(), SelectedElectronFEDListProducer< TEle, TCand >::pixelFedDump(), DBoxMetadataHelper::DBMetaDataPlotDisplay::plotDiffWithMetadata(), mkfit::StdSeq::prep_simtracks(), MatrixInjector.MatrixInjector::prepare(), ConfigBuilder.ConfigBuilder::prepare(), CaloSubdetectorGeometry::present(), edm::Principal::Principal(), print_trigger_collection(), SiStripConfigDb::printAnalysisDescriptions(), RooUtil::CutTree::printCuts(), SiStripConfigDb::printDeviceDescriptions(), DBoxMetadataHelper::DBMetaDataTableDisplay::printDiffWithMetadata(), SiStripConfigDb::printFedConnections(), SiStripConfigDb::printFedDescriptions(), ParticleTreeDrawer::printInfo(), edm::PluginDescription< T >::printNestedContent_(), edm::FileBlock::processBlockTree(), DDLNumeric::processElement(), StraightTrackAlignment::processEvent(), LaserTask::processLaserMon(), TtSemiLepJetCombMaxSumPtWMass::produce(), TTTrackAssociator< T >::produce(), JetTracksAssociationDRVertexAssigned::produce(), PileupSummaryInfoSlimmer::produce(), InterestingEcalDetIdProducer::produce(), TtDilepEvtSolutionMaker::produce(), QuarkoniaTrackSelector::produce(), GenTrackMatcher::produce(), SimpleJetConstituentTableProducer< T >::produce(), StripCompactDigiSimLinksProducer::produce(), EcalTPSkimmer::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::produce(), L1TrackerEtMissProducer::produce(), TrackListMerger::produce(), MultShiftMETcorrInputProducer::produce(), JetSubstructurePacker::produce(), LaserAlignmentT0Producer::produce(), EgammaIsoDetIdCollectionProducer< T1 >::produce(), JetConstituentTableProducer< T >::produce(), ReducedRecHitCollectionProducer::produce(), ConversionSeedFilterCharge::produce(), pat::PATJetUpdater::produce(), pat::PATPackedCandidateProducer::produce(), CaloTowersMerger::produce(), pat::GenPlusSimParticleProducer::produce(), ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitTopologyESProducer< CAL >::produce(), MuonDetCleaner< T1, T2 >::produce(), InterestingTrackEcalDetIdProducer::produce(), EcalRawToDigi::produce(), SiPhase2BadStripConfigurableFakeESSource::produce(), L1TrackerEtMissEmulatorProducer::produce(), CTPPSPixelLocalTrackProducer::produce(), TrackstersMergeProducer::produce(), SimTrackstersProducer::produce(), pat::PATTauProducer::produce(), pat::PATJetProducer::produce(), FlavorHistoryProducer::produce(), ConvBremSeedProducer::produce(), MuonMCClassifier::produce(), LaserAlignment::produce(), AlCaHcalHBHEMuonProducer::produce(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), AlCaHcalIsotrkProducer::produce(), GenPUProtonProducer::produce(), L2TauNNProducerAlpaka::produce(), L2TauNNProducer::produce(), ProfilerService::ProfilerService(), LowPtGsfElectronSeedProducer::propagateTrackToCalo(), SiStripDbParams::pset(), pixelTrack::qualityByName(), reco::TrackBase::qualityByName(), SurveyPxbImageReader< T >::read(), l1t::LUT::read(), SiStripTFile::readDQMFormat(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), BeamFitter::readEvent(), L1TdeRCT::readFEDVector(), reco::DeepSCGraphEvaluation::readInputFeaturesConfig(), EcalDigiDisplay::readPNDigis(), SiStripDcsInfo::readStatus(), Model::readSystemDescription(), CalorimetryManager::reconstruct(), GenParticlePruner::recursiveFlagDaughters(), TrackingParticleSelectorByGen::recursiveFlagDaughters(), GenParticlePruner::recursiveFlagMothers(), TrackingParticleSelectorByGen::recursiveFlagMothers(), reco::Vertex::refittedTrack(), TransientVertex::refittedTrack(), RooUtil::Cutflow::removeCut(), SiPixelDisabledModules::removeDisabledModule(), ticl::Trackster::removeDuplicates(), edm::PathsAndConsumesOfModules::removeModules(), lhef::LHEEvent::removeResonances(), DDI::LogicalPart::removeSpecifics(), XrdAdaptor::RequestManager::requestFailure(), Phase1PixelMaps::rescaleAllBarrel(), Phase1PixelMaps::rescaleAllForward(), BtoCharmDecayVertexMergerT< VTX >::resolveBtoDchain(), PerformancePayloadFromBinnedTFormula::resultPos(), PerformancePayloadFromTable::resultPos(), PerformancePayloadFromTFormula::resultPos(), edm::RootFile::RootFile(), 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(), mkfit::runBtpCe_MultiIter(), mkfit::runBuildingTestPlexBestHit(), mkfit::runBuildingTestPlexCloneEngine(), mkfit::runBuildingTestPlexStandard(), DTLocalTriggerTest::runClientDiagnostic(), DTLocalTriggerTPTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTLocalTriggerEfficiencyTest::runClientDiagnostic(), DTTriggerEfficiencyTest::runClientDiagnostic(), L1MuDTEtaProcessor::runEtaMatchingUnit(), L1MuBMEtaProcessor::runEtaMatchingUnit(), edm::search_all(), tmtt::TrkRZfilter::seedFilter(), SeedingHitSet::SeedingHitSet(), SeedingLayerSetsBuilder::SeedingLayerSetsBuilder(), ME0TriggerPseudoBuilder::segmentConversion(), GE0TriggerPseudoBuilder::segmentConversion(), AlignmentTrackFromVertexCompositeCandidateSelector::select(), AlignmentTrackFromVertexSelector::select(), PrintG4Solids::select(), reco::FlavorHistorySelectorUtil::select(), AlCaIsoTracksProducer::select(), mkfit::Event::select_tracks_iter(), SiStripBadModuleConfigurableFakeESSource::selectDetectors(), EcalMipGraphs::selectHits(), EcalDisplaysByEvent::selectHits(), AlignmentParameterStore::selectParameters(), CastorCalibrationsSet::setCalibrations(), CastorCalibrationWidthsSet::setCalibrationWidths(), CACut::setCutValuesByInnerLayerIds(), tfaot::BatchStrategy::setDefaultRule(), HGCScintSD::setDetUnitId(), RBCProcessRPCSimDigis::setDigiAt(), RBCProcessRPCDigis::setDigiAt(), EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(), EcalRecHitWorkerSimple::setFlagBits(), GlobalOptionMgr::setGlobalOption(), EcalFenixFgvbEB::setParameters(), ecaldqm::CalibrationSummaryClient::setParams(), ecaldqm::SummaryClient::setParams(), cond::setPermissionData(), edm::RootFile::setPresenceInProductRegistry(), DDLSolid::setReference(), TtSemiLepKinFitter::setupConstraints(), HcalDbProducer::ServiceTokenImpl< ProductType, RecordType, LABEL, EffectiveType >::setupHcalDbService(), CastorDbProducer::setupItem(), egHLT::OffHelper::setupTriggers(), vid_id_tools::setupVIDElectronSelection(), CSCDBL1TPParametersExtended::setValue(), SiStripCondObjBuilderFromDb::setValuesApvTiming(), HcalSimParameterMap::simParameters(), SiStripFedIdListReader::SiStripFedIdListReader(), CRackTrajectoryBuilder::SortHits(), trackerTFP::State::State(), trackerDTC::Stub::Stub(), IsoTrig::studyIsolation(), sumSmallDepths(), MillePedeAlignmentAlgorithm::terminate(), DTSegtoRPC::thePoints(), BeamSpotDipServer::tkStatus(), tkStatus(), cms::alpakatools::toBackend(), PasswordReader::tokenize(), ecalsrcondtools::tokenize(), egamma::towersOf(), HistoryBase::traceSimHistory(), TrackingMaterialProducer::TrackingMaterialProducer(), QcdUeDQM::trackSelection(), HGVHistoProducerAlgo::tracksters_to_SimTracksters_fp(), trackWeight(), TransientVertex::trackWeight(), HLTMuonL3andL2PreFilter::triggeredByPreviousLevel(), triggerExpression::Data::triggerIndex(), pat::TriggerEvent::triggerObjectMatchResult(), JsonOutputProducer::typeId(), PixelDataFormatter::unpackFEDErrors(), PFEGammaAlgo::unwrapSuperCluster(), SaveSimTrack::update(), DaqScopeModeHistosUsingDb::update(), PedestalsHistosUsingDb::update(), MSLayersAtAngle::update(), PedsFullNoiseHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), LatencyHistosUsingDb::update(), FineDelayHistosUsingDb::update(), DBremWatcher::update(), KalmanVertexUpdator< 5 >::update(), SimG4HGCalValidation::update(), CaloSteppingAction::update(), HLTScalersClient::CountLSFifo_t::update(), edm::OutputProcessBlockHelper::updateAfterProductSelection(), L1RCTProducer::updateFedVector(), SiStripConfigDb::uploadAnalysisDescriptions(), CaloSubdetectorGeometry::valid(), edm::ParameterWildcardWithSpecifics::validate_(), HcalTopology::validCalib(), HGCalGeomTools::waferCorner(), reco::btag::weight(), NanoAODOutputModule::write(), CSCValHists::writeHists(), DQMRootOutputModule::writeLuminosityBlock(), L1GtPatternWriter::writePatterns(), AlignPCLThresholdsWriter< T >::writePayload(), edm::RootOutputFile::writeProcessBlock(), DQMRootOutputModule::writeRun(), and CSCGasCollisions::writeSummary().

22  {
23  if (hits->find(thisDet) != hits->end())
24  hit.push_back(hits->find(thisDet));
25  }

◆ find() [2/3]

void spr::find ( edm::Handle< HBHERecHitCollection > &  hits,
DetId  thisDet,
std::vector< HBHERecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 27 of file FindCaloHit.cc.

References hfClusterShapes_cfi::hits.

30  {
31  if (hits->find(thisDet) != hits->end())
32  hit.push_back(hits->find(thisDet));
33  }

◆ find() [3/3]

void spr::find ( edm::Handle< edm::PCaloHitContainer > &  hits,
DetId  thisDet,
std::vector< edm::PCaloHitContainer::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 35 of file FindCaloHit.cc.

References hcalRecHitTable_cff::detId, and hfClusterShapes_cfi::hits.

38  {
39  edm::PCaloHitContainer::const_iterator ihit;
40  for (ihit = hits->begin(); ihit != hits->end(); ihit++) {
41  DetId detId(ihit->id());
42  if (detId == thisDet) {
43  hit.push_back(ihit);
44  }
45  }
46  }
Definition: DetId.h:17

◆ findCone() [1/5]

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 debug, HGC3DClusterGenMatchSelector_cfi::dR, EcalBarrel, EcalEndcap, getDistInPlaneTrackDir(), CaloGeometry::getPosition(), hfClusterShapes_cfi::hits, and dqmiolumiharvest::j.

18  {
19  std::vector<EcalRecHitCollection::const_iterator> hit;
20 
21  for (EcalRecHitCollection::const_iterator j = hits->begin(); j != hits->end(); j++) {
22  bool keepHit = false;
23 
24  if (j->id().subdetId() == EcalEndcap) {
25  EEDetId EEid = EEDetId(j->id());
26  const GlobalPoint& rechitPoint = geo->getPosition(EEid);
27  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR)
28  keepHit = true;
29  } else if (j->id().subdetId() == EcalBarrel) {
30  EBDetId EBid = EBDetId(j->id());
31  const GlobalPoint& rechitPoint = geo->getPosition(EBid);
32  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR)
33  keepHit = true;
34  }
35 
36  if (keepHit)
37  hit.push_back(j);
38  }
39  return hit;
40  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
std::vector< EcalRecHit >::const_iterator const_iterator
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
#define debug
Definition: HDRShower.cc:19

◆ findCone() [2/5]

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 
)

◆ findCone() [3/5]

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 43 of file FindCaloHitCone.cc.

References funct::abs(), edm::SortedCollection< T, SORT >::begin(), debug, deltaEta, HLT_2024v14_cff::doBarrel, multi5x5BasicClusters_cfi::doEndcap, HGC3DClusterGenMatchSelector_cfi::dR, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), PV3DBase< T, PVType, FrameType >::eta(), etaBEEcal, getDistInPlaneTrackDir(), CaloGeometry::getPosition(), and dqmiolumiharvest::j.

50  {
51  std::vector<EcalRecHitCollection::const_iterator> hit;
52 
53  // Only check both barrel and endcap when track is near transition
54  // region: 1.479-2*0.087 < trkEta < 1.479+2*0.087
55 
56  bool doBarrel = false, doEndcap = false;
57  if (std::abs(point1.eta()) < (spr::etaBEEcal + 2 * spr::deltaEta))
58  doBarrel = true; // 1.479+2*0.087
59  if (std::abs(point1.eta()) > (spr::etaBEEcal - 2 * spr::deltaEta))
60  doEndcap = true; // 1.479-2*0.087
61 
62  if (doBarrel) {
63  for (EcalRecHitCollection::const_iterator j = barrelhits->begin(); j != barrelhits->end(); j++) {
64  bool keepHit = false;
65  if (j->id().subdetId() == EcalBarrel) {
66  EBDetId EBid = EBDetId(j->id());
67  const GlobalPoint& rechitPoint = geo->getPosition(EBid);
68  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR)
69  keepHit = true;
70  } else {
71  edm::LogWarning("IsoTrack") << "PROBLEM : Endcap RecHits in Barrel Collection!?";
72  }
73  if (keepHit)
74  hit.push_back(j);
75  }
76  } // doBarrel
77 
78  if (doEndcap) {
79  for (EcalRecHitCollection::const_iterator j = endcaphits->begin(); j != endcaphits->end(); j++) {
80  bool keepHit = false;
81 
82  if (j->id().subdetId() == EcalEndcap) {
83  EEDetId EEid = EEDetId(j->id());
84  const GlobalPoint& rechitPoint = geo->getPosition(EEid);
85  if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint, debug) < dR)
86  keepHit = true;
87  } else {
88  edm::LogWarning("IsoTrack") << "PROBLEM : Barrel RecHits in Endcap Collection!?";
89  }
90  if (keepHit)
91  hit.push_back(j);
92  }
93  } // doEndcap
94 
95  return hit;
96  }
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:9
T eta() const
Definition: PV3DBase.h:73
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:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const_iterator begin() const
const_iterator end() const
#define debug
Definition: HDRShower.cc:19
Log< level::Warning, false > LogWarning

◆ findCone() [4/5]

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 99 of file FindCaloHitCone.cc.

References debug, hcalRecHitTable_cff::detId, HGC3DClusterGenMatchSelector_cfi::dR, getDistInPlaneTrackDir(), CaloGeometry::getSubdetectorGeometry(), hfClusterShapes_cfi::hits, and dqmiolumiharvest::j.

105  {
106  std::vector<HBHERecHitCollection::const_iterator> hit;
107  // Loop over Hcal RecHits
108  for (HBHERecHitCollection::const_iterator j = hits->begin(); j != hits->end(); j++) {
109  DetId detId(j->id());
110  const GlobalPoint rechitPoint =
111  (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(detId)))->getPosition(detId);
112  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR)
113  hit.push_back(j);
114  }
115  return hit;
116  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
std::vector< T >::const_iterator const_iterator
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ findCone() [5/5]

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 119 of file FindCaloHitCone.cc.

References debug, hcalRecHitTable_cff::detId, HGC3DClusterGenMatchSelector_cfi::dR, getDistInPlaneTrackDir(), CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, and hfClusterShapes_cfi::hits.

125  {
126  std::vector<edm::PCaloHitContainer::const_iterator> hit;
127  edm::PCaloHitContainer::const_iterator ihit;
128  for (ihit = hits->begin(); ihit != hits->end(); ihit++) {
129  DetId detId(ihit->id());
130  const GlobalPoint rechitPoint =
131  (detId.det() == DetId::Hcal)
132  ? (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(detId)))->getPosition(detId)
133  : geo->getPosition(detId);
134  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) {
135  hit.push_back(ihit);
136  }
137  }
138  return hit;
139  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ findDetIdCalo()

const DetId spr::findDetIdCalo ( const CaloSubdetectorGeometry geo,
double  theta,
double  phi,
double  radius,
bool  debug = false 
)

Definition at line 47 of file DetIdFromEtaPhi.cc.

References funct::cos(), debug, DetId::det(), DetId::Ecal, EcalBarrel, CaloSubdetectorGeometry::getClosestCell(), point, CosmicsPD_Skims::radius, funct::sin(), DetId::subdetId(), and tauSpinnerTable_cfi::theta.

Referenced by findDetIdECAL(), and findDetIdHCAL().

47  {
48  double rcyl = radius * std::sin(theta);
49  double z = radius * std::cos(theta);
50  GlobalPoint point(rcyl * std::cos(phi), rcyl * std::sin(phi), z);
51  const DetId cell = geo->getClosestCell(point);
52  if (debug) {
53  std::ostringstream st1;
54  if (cell.det() == DetId::Ecal) {
55  if (cell.subdetId() == EcalBarrel)
56  st1 << (EBDetId)(cell);
57  else
58  st1 << (EEDetId)(cell);
59  } else {
60  st1 << (HcalDetId)(cell);
61  }
62  edm::LogVerbatim("IsoTrack") << "findDetIdCalo: rcyl " << rcyl << " z " << z << " Point " << point << " DetId "
63  << st1.str();
64  }
65  return cell;
66  }
Log< level::Info, true > LogVerbatim
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
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:48
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:17
#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

◆ findDetIdECAL()

const DetId spr::findDetIdECAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 15 of file DetIdFromEtaPhi.cc.

References funct::abs(), funct::cos(), debug, DetId::Ecal, EcalBarrel, EcalEndcap, PVValHelper::eta, etaBEEcal, JetChargeProducer_cfi::exp, findDetIdCalo(), CaloGeometry::getSubdetectorGeometry(), CosmicsPD_Skims::radius, rFrontEB, funct::sin(), tauSpinnerTable_cfi::theta, and zFrontEE.

15  {
16  double radius = 0;
17  int subdet = 0;
18  double theta = 2.0 * std::atan(exp(-eta));
19  if (std::abs(eta) > spr::etaBEEcal) {
21  subdet = EcalEndcap;
22  } else {
24  subdet = EcalBarrel;
25  }
26  const CaloSubdetectorGeometry* gECAL = geo->getSubdetectorGeometry(DetId::Ecal, subdet);
27  if (debug)
28  edm::LogVerbatim("IsoTrack") << "findDetIdECAL: eta " << eta << " theta " << theta << " phi " << phi << " radius "
29  << radius << " subdet " << subdet;
30  return spr::findDetIdCalo(gECAL, theta, phi, radius, debug);
31  }
Log< level::Info, true > LogVerbatim
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
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 CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ findDetIdHCAL()

const DetId spr::findDetIdHCAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 33 of file DetIdFromEtaPhi.cc.

References funct::abs(), funct::cos(), debug, PVValHelper::eta, etaBEHcal, JetChargeProducer_cfi::exp, findDetIdCalo(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, CosmicsPD_Skims::radius, rFrontHB, funct::sin(), tauSpinnerTable_cfi::theta, and zFrontHE.

33  {
34  double radius = 0;
35  double theta = 2.0 * std::atan(exp(-eta));
38  else
41  if (debug)
42  edm::LogVerbatim("IsoTrack") << "findDetIdHCAL: eta " << eta << " theta " << theta << " phi " << phi << " radius "
43  << radius;
44  return spr::findDetIdCalo(gHCAL, theta, phi, radius, debug);
45  }
Log< level::Info, true > LogVerbatim
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
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
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ findHit() [1/3]

template<typename T >
std::vector<typename T::const_iterator> spr::findHit ( edm::Handle< T > &  hits,
DetId  thisDet,
bool  debug = false 
)

◆ findHit() [2/3]

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.

References hcalRecHitTable_cff::detId, and hfClusterShapes_cfi::hits.

7  {
8  std::vector<std::vector<PCaloHit>::const_iterator> hit;
9  std::vector<PCaloHit>::const_iterator ihit;
10  for (ihit = hits.begin(); ihit != hits.end(); ihit++) {
11  DetId detId(ihit->id());
12  if (detId == thisDet) {
13  hit.push_back(ihit);
14  }
15  }
16  return hit;
17  }
Definition: DetId.h:17

◆ findHit() [3/3]

template<typename T >
void spr::findHit ( edm::Handle< T > &  hits,
DetId  thisDet,
std::vector< typename T::const_iterator > &  hit,
bool  debug = false 
)

◆ findHitCone() [1/2]

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 
)

◆ findHitCone() [2/2]

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 
)

◆ getDistInCMatEcal()

double spr::getDistInCMatEcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2,
bool  debug = false 
)

Definition at line 39 of file FindDistCone.cc.

References funct::cos(), debug, HGC3DClusterGenMatchSelector_cfi::dR, HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, etaBEEcal, rFrontEB, mathSSE::sqrt(), nnet::tanh(), and zFrontEE.

39  {
40  double dR, Rec;
41  if (fabs(eta1) < spr::etaBEEcal)
42  Rec = spr::rFrontEB;
43  else
44  Rec = spr::zFrontEE;
45  double ce1 = cosh(eta1);
46  double ce2 = cosh(eta2);
47  double te1 = tanh(eta1);
48  double te2 = tanh(eta2);
49 
50  double z = cos(phi1 - phi2) / ce1 / ce2 + te1 * te2;
51  if (z != 0)
52  dR = fabs(Rec * ce1 * sqrt(1. / z / z - 1.));
53  else
54  dR = 999999.;
55  if (debug)
56  edm::LogVerbatim("IsoTrack") << "getDistInCMatEcal: between (" << eta1 << ", " << phi1 << ") and (" << eta2
57  << ", " << phi2 << " is " << dR;
58  return dR;
59  }
Log< level::Info, true > LogVerbatim
static const double etaBEEcal
Definition: CaloConstants.h:12
void tanh(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_in])
static const double zFrontEE
Definition: CaloConstants.h:9
T sqrt(T t)
Definition: SSEVec.h:23
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

◆ getDistInCMatHcal()

double spr::getDistInCMatHcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2,
bool  debug = false 
)

Definition at line 62 of file FindDistCone.cc.

References funct::cos(), debug, HGC3DClusterGenMatchSelector_cfi::dR, HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, etaBEHcal, rFrontHB, mathSSE::sqrt(), nnet::tanh(), and zFrontHE.

62  {
63  // Radii and eta from Geometry/HcalCommonData/data/hcalendcapalgo.xml
64  // and Geometry/HcalCommonData/data/hcalbarrelalgo.xml
65 
66  double dR, Rec;
67  if (fabs(eta1) < spr::etaBEHcal)
68  Rec = spr::rFrontHB;
69  else
70  Rec = spr::zFrontHE;
71  double ce1 = cosh(eta1);
72  double ce2 = cosh(eta2);
73  double te1 = tanh(eta1);
74  double te2 = tanh(eta2);
75 
76  double z = cos(phi1 - phi2) / ce1 / ce2 + te1 * te2;
77  if (z != 0)
78  dR = fabs(Rec * ce1 * sqrt(1. / z / z - 1.));
79  else
80  dR = 999999.;
81  if (debug)
82  edm::LogVerbatim("IsoTrack") << "getDistInCMatHcal: between (" << eta1 << ", " << phi1 << ") and (" << eta2
83  << ", " << phi2 << " is " << dR;
84  return dR;
85  }
Log< level::Info, true > LogVerbatim
void tanh(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_in])
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
static const double rFrontHB
Definition: CaloConstants.h:14
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define debug
Definition: HDRShower.cc:19

◆ getDistInPlaneTrackDir()

double spr::getDistInPlaneTrackDir ( const GlobalPoint caloPoint,
const GlobalVector caloVector,
const GlobalPoint rechitPoint,
bool  debug = false 
)

Definition at line 9 of file FindDistCone.cc.

References 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().

12  {
13  const GlobalVector caloIntersectVector(caloPoint.x(), caloPoint.y(),
14  caloPoint.z()); //p
15 
16  const GlobalVector caloUnitVector = caloVector.unit();
17  const GlobalVector rechitVector(rechitPoint.x(), rechitPoint.y(), rechitPoint.z());
18  const GlobalVector rechitUnitVector = rechitVector.unit();
19  double dotprod_denominator = caloUnitVector.dot(rechitUnitVector);
20  double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
21  double rechitdist = dotprod_numerator / dotprod_denominator;
22  const GlobalVector effectiveRechitVector = rechitdist * rechitUnitVector;
23  const GlobalPoint effectiveRechitPoint(
24  effectiveRechitVector.x(), effectiveRechitVector.y(), effectiveRechitVector.z());
25  GlobalVector distance_vector = effectiveRechitPoint - caloPoint;
26  if (debug) {
27  edm::LogVerbatim("IsoTrack") << "getDistInPlaneTrackDir: point " << caloPoint << " dirn " << caloVector
28  << " numerator " << dotprod_numerator << " denominator " << dotprod_denominator
29  << " distance " << distance_vector.mag();
30  }
31  if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
32  return distance_vector.mag();
33  } else {
34  return 999999.;
35  }
36  }
Log< level::Info, true > LogVerbatim
T z() const
Definition: PV3DBase.h:61
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T mag() const
Definition: PV3DBase.h:64
#define debug
Definition: HDRShower.cc:19
Vector3DBase unit() const
Definition: Vector3DBase.h:54

◆ getEnergy() [1/2]

double spr::getEnergy ( HBHERecHitCollection::const_iterator  hit,
int  useRaw = 0,
bool  debug = false 
)

◆ getEnergy() [2/2]

double spr::getEnergy ( edm::PCaloHitContainer::const_iterator  hit,
int  useRaw = 0,
bool  debug = false 
)

Definition at line 156 of file FindDistCone.cc.

References hcalRecHitTable_cff::detId, DetId::Hcal, HcalBarrel, HcalEndcap, and hit::id.

156  {
157  // This will not yet handle Ecal CaloHits!!
158  double samplingWeight = 1.;
159  // Hard coded sampling weights from JFH analysis of iso tracks
160  // Sept 2009.
161  DetId id = hit->id();
162  if (id.det() == DetId::Hcal) {
163  HcalDetId detId(id);
164  if (detId.subdet() == HcalBarrel)
165  samplingWeight = 114.1;
166  else if (detId.subdet() == HcalEndcap)
167  samplingWeight = 167.3;
168  else {
169  // ONLY protection against summing HO, HF simhits
170  return 0.;
171  }
172  }
173 
174  return samplingWeight * hit->energy();
175  }
unsigned int id
Definition: DetId.h:17

◆ getEtaPhi() [1/5]

spr::EtaPhi spr::getEtaPhi ( int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 6 of file FindEtaPhi.cc.

References debug, fastmath::etaphi(), hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

6  {
7  int ietal = (ieta - 1) / 2;
8  int ietar = ieta - ietal - 1;
9  int iphil = (iphi - 1) / 2;
10  int iphir = iphi - iphil - 1;
12  etaphi.ietaE[0] = ietal;
13  etaphi.ietaW[0] = ietar;
14  etaphi.iphiN[0] = iphil;
15  etaphi.iphiS[0] = iphir;
16  if (ietal == ietar && iphil == iphir) {
17  etaphi.ntrys = 1;
18  } else if (ietal == ietar || iphil == iphir) {
19  etaphi.ntrys = 2;
20  etaphi.ietaE[1] = ietar;
21  etaphi.ietaW[1] = ietal;
22  etaphi.iphiN[1] = iphir;
23  etaphi.iphiS[1] = iphil;
24  } else {
25  etaphi.ntrys = 4;
26  etaphi.ietaE[1] = ietar;
27  etaphi.ietaW[1] = ietal;
28  etaphi.iphiN[1] = iphil;
29  etaphi.iphiS[1] = iphir;
30  etaphi.ietaE[2] = ietal;
31  etaphi.ietaW[1] = ietar;
32  etaphi.iphiN[2] = iphir;
33  etaphi.iphiS[1] = iphil;
34  etaphi.ietaE[3] = ietar;
35  etaphi.ietaW[1] = ietal;
36  etaphi.iphiN[3] = iphir;
37  etaphi.iphiS[1] = iphil;
38  }
39 
40  if (debug) {
41  edm::LogVerbatim("IsoTrack") << "getEtaPhi:: Has " << etaphi.ntrys << " possibilites for " << ieta << "X" << iphi
42  << " matrix";
43  for (int itry = 0; itry < etaphi.ntrys; itry++) {
44  edm::LogVerbatim("IsoTrack") << "Trial " << itry << " with etaE|etaW " << etaphi.ietaE[itry] << "|"
45  << etaphi.ietaW[itry] << " and phiN|PhiS " << etaphi.iphiN[itry] << "|"
46  << etaphi.iphiS[itry];
47  }
48  }
49  return etaphi;
50  }
std::pair< T, T > etaphi(T x, T y, T z)
Definition: FastMath.h:162
Log< level::Info, true > LogVerbatim
#define debug
Definition: HDRShower.cc:19

◆ getEtaPhi() [2/5]

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 87 of file FindDistCone.cc.

References hit::id.

91  {
92  RH_ieta.push_back(hit->id().ieta());
93  RH_iphi.push_back(hit->id().iphi());
94  RH_ene.push_back(hit->energy());
95  }
unsigned int id

◆ getEtaPhi() [3/5]

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 97 of file FindDistCone.cc.

101  {
102  // SimHit function not yet implemented.
103  RH_ieta.push_back(-9);
104  RH_iphi.push_back(-9);
105  RH_ene.push_back(-9.);
106  }

◆ getEtaPhi() [4/5]

void spr::getEtaPhi ( HBHERecHitCollection::const_iterator  hit,
int &  ieta,
int &  iphi,
bool  debug = false 
)

Definition at line 119 of file FindDistCone.cc.

References hit::id, hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

119  {
120  ieta = hit->id().ieta();
121  iphi = hit->id().iphi();
122  }
unsigned int id

◆ getEtaPhi() [5/5]

void spr::getEtaPhi ( edm::PCaloHitContainer::const_iterator  hit,
int &  ieta,
int &  iphi,
bool  debug = false 
)

Definition at line 124 of file FindDistCone.cc.

References DetId::Ecal, EcalBarrel, DetId::Hcal, hit::id, hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

124  {
125  DetId id = DetId(hit->id());
126  if (id.det() == DetId::Hcal) {
127  ieta = ((HcalDetId)(hit->id())).ieta();
128  iphi = ((HcalDetId)(hit->id())).iphi();
129  } else if (id.det() == DetId::Ecal && id.subdetId() == EcalBarrel) {
130  ieta = ((EBDetId)(id)).ieta();
131  iphi = ((EBDetId)(id)).iphi();
132  } else {
133  ieta = 999;
134  iphi = 999;
135  }
136  }
unsigned int id
Definition: DetId.h:17

◆ getGpos() [1/2]

GlobalPoint spr::getGpos ( const CaloGeometry geo,
HBHERecHitCollection::const_iterator  hit,
bool  debug = false 
)

Definition at line 177 of file FindDistCone.cc.

References hcalRecHitTable_cff::detId, CaloGeometry::getSubdetectorGeometry(), and hit::id.

177  {
178  DetId detId(hit->id());
179  return (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(detId)))->getPosition(detId);
180  }
unsigned int id
Definition: DetId.h:17
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ getGpos() [2/2]

GlobalPoint spr::getGpos ( const CaloGeometry geo,
edm::PCaloHitContainer::const_iterator  hit,
bool  debug = false 
)

Definition at line 182 of file FindDistCone.cc.

References hcalRecHitTable_cff::detId, CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, hit::id, and point.

182  {
183  DetId detId(hit->id());
184  GlobalPoint point = (detId.det() == DetId::Hcal)
185  ? (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(detId)))->getPosition(detId)
186  : geo->getPosition(detId);
187  return point;
188  }
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
unsigned int id
Definition: DetId.h:17
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ getHotCell() [1/2]

HcalDetId spr::getHotCell ( std::vector< HBHERecHitCollection::const_iterator > &  hit,
bool  includeHO,
int  useRaw = 0,
bool  debug = false 
)

Definition at line 175 of file eHCALMatrix.cc.

References HBHEDarkening_cff::energy, newFWLiteAna::found, getRawEnergy(), HcalOuter, hit::id, globals_cff::id1, and isoTrackAlCaCommissioning_cfg::useRaw.

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

◆ getHotCell() [2/2]

HcalDetId spr::getHotCell ( std::vector< std::vector< PCaloHit >::const_iterator > &  hit,
bool  includeHO,
int  useRaw = 0,
bool  debug = false 
)

Definition at line 208 of file eHCALMatrix.cc.

References HBHEDarkening_cff::energy, newFWLiteAna::found, getRawEnergy(), HcalOuter, globals_cff::id1, HcalDetId::ieta(), HcalDetId::iphi(), HcalDetId::subdet(), and isoTrackAlCaCommissioning_cfg::useRaw.

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

◆ getRawEnergy() [1/2]

double spr::getRawEnergy ( HBHERecHitCollection::const_iterator  hit,
int  useRaw = 0 
)

Definition at line 201 of file FindDistCone.cc.

References HBHEDarkening_cff::energy, and isoTrackAlCaCommissioning_cfg::useRaw.

Referenced by getHotCell().

201  {
202  double energy = ((useRaw == 1) ? hit->eraw() : ((useRaw == 2) ? hit->eaux() : hit->energy()));
203  return energy;
204  }

◆ getRawEnergy() [2/2]

double spr::getRawEnergy ( edm::PCaloHitContainer::const_iterator  hit,
int  useRaw = 0 
)

Definition at line 208 of file FindDistCone.cc.

208 { return hit->energy(); }

◆ goodTrack()

bool spr::goodTrack ( const reco::Track pTrack,
math::XYZPoint  leadPV,
spr::trackSelectionParameters  parameters,
bool  debug = false 
)

Definition at line 9 of file TrackSelection.cc.

References funct::abs(), debug, PVValHelper::dxy, reco::TrackBase::dxy(), PVValHelper::dz, reco::TrackBase::dz(), reco::TrackBase::hitPattern(), mps_fire::i, 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(), singleTopDQM_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(), HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(), IsoTrig::chgIsolation(), CSCSkim::doBFieldStudySelection(), HcalIsoTrkAnalyzer::fillTree(), AlCaIsoTracksFilter::filter(), tmtt::KFbase::fit(), RPixPlaneCombinatoryTracking::fitTrack(), IsoTrig::getGoodTracks(), AlCaHcalIsotrkProducer::getProducts(), PFEGammaFilters::isElectronSafeForJetMET(), JetTracksAssociationDRCalo::produce(), AlCaIsoTracksProducer::select(), IsoTrig::studyIsolation(), IsoTrig::studyMipCut(), IsoTrig::StudyTrkEbyP(), and PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL().

12  {
13  bool select = pTrack->quality(parameters.minQuality);
14  double dxy = pTrack->dxy(leadPV);
15  double dz = pTrack->dz(leadPV);
16  double dpbyp = 999;
17  if (std::abs(pTrack->qoverp()) > 0.0000001)
18  dpbyp = std::abs(pTrack->qoverpError() / pTrack->qoverp());
19 
20  if (debug)
21  edm::LogVerbatim("IsoTrack") << "Track:: Pt " << pTrack->pt() << " dxy " << dxy << " dz " << dz << " Chi2 "
22  << pTrack->normalizedChi2() << " dpbyp " << dpbyp << " Quality " << select;
23 
24  if (pTrack->pt() < parameters.minPt)
25  select = false;
26  if (dxy > parameters.maxDxyPV || dz > parameters.maxDzPV)
27  select = false;
28  if (pTrack->normalizedChi2() > parameters.maxChi2)
29  select = false;
30  if (dpbyp > parameters.maxDpOverP)
31  select = false;
32 
33  if (parameters.minLayerCrossed > 0 || parameters.minOuterHit > 0) {
34  const reco::HitPattern& hitp = pTrack->hitPattern();
35  if (parameters.minLayerCrossed > 0 && hitp.trackerLayersWithMeasurement() < parameters.minLayerCrossed)
36  select = false;
37  if (parameters.minOuterHit > 0 &&
39  select = false;
40 
41  if (debug) {
42  edm::LogVerbatim("IsoTrack") << "Default Hit Pattern with "
44  for (int i = 0; i < hitp.numberOfAllHits(reco::HitPattern::TRACK_HITS); i++) {
45  std::ostringstream st1;
47  edm::LogVerbatim("IsoTrack") << st1.str();
48  }
49  }
50  }
51  if (parameters.maxInMiss >= 0) {
52  const reco::HitPattern& hitp = pTrack->hitPattern();
54  select = false;
55  if (debug) {
56  edm::LogVerbatim("IsoTrack") << "Inner Hit Pattern with "
58  for (int i = 0; i < hitp.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i++) {
59  std::ostringstream st1;
61  edm::LogVerbatim("IsoTrack") << st1.str();
62  }
63  }
64  }
65  if (parameters.maxOutMiss >= 0) {
66  const reco::HitPattern& hitp = pTrack->hitPattern();
68  select = false;
69  if (debug) {
70  edm::LogVerbatim("IsoTrack") << "Outer Hit Pattern with "
72  for (int i = 0; i < hitp.numberOfAllHits(reco::HitPattern::MISSING_OUTER_HITS); i++) {
73  std::ostringstream st1;
75  edm::LogVerbatim("IsoTrack") << st1.str();
76  }
77  }
78  }
79  if (debug)
80  edm::LogVerbatim("IsoTrack") << "Final Selection Result " << select;
81  return select;
82  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
double qoverp() const
q / p
Definition: TrackBase.h:599
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:732
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:535
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:804
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:629
double pt() const
track transverse momentum
Definition: TrackBase.h:637
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:622
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:619
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:554
#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:504
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:593
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:825
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:608

◆ hGenSimInfo() [1/4]

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 90 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugHcalDets(), hcalRecHitTable_cff::ieta, info(), hcalRecHitTable_cff::iphi, matrixHCALIds(), and HLT_2024v14_cff::topology.

Referenced by StudyCaloGen::analyze(), and IsolatedGenParticles::analyze().

98  {
99  if (debug)
100  edm::LogVerbatim("IsoTrack") << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/"
101  << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi()
102  << " with ieta:iphi " << ieta << ":" << iphi;
103 
104  std::vector<DetId> dets;
105  dets.push_back(coreDet);
106  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
107  if (debug)
108  spr::debugHcalDets(0, vdets);
109  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
110  }
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
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:176
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#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)

◆ hGenSimInfo() [2/4]

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 112 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugHcalDets(), HGC3DClusterGenMatchSelector_cfi::dR, info(), matrixHCALIds(), and HLT_2024v14_cff::topology.

121  {
122  if (debug)
123  edm::LogVerbatim("IsoTrack") << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/"
124  << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi()
125  << " with dR,tMom " << dR << " " << trackMom;
126 
127  std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, false);
128  if (debug)
129  spr::debugHcalDets(0, vdets);
130  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
131  }
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
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:176
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#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)

◆ hGenSimInfo() [3/4]

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 133 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugHcalDets(), hcalRecHitTable_cff::ieta, info(), hcalRecHitTable_cff::iphi, matrixHCALIds(), and HLT_2024v14_cff::topology.

141  {
142  if (debug)
143  edm::LogVerbatim("IsoTrack") << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/"
144  << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi "
145  << ieta << ":" << iphi;
146 
147  std::vector<DetId> dets;
148  dets.push_back(coreDet);
149  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
150  if (debug)
151  spr::debugHcalDets(0, vdets);
152  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
153  }
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
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:176
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#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)

◆ hGenSimInfo() [4/4]

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 155 of file GenSimInfo.cc.

References cGenSimInfo(), debug, debugHcalDets(), HGC3DClusterGenMatchSelector_cfi::dR, info(), matrixHCALIds(), and HLT_2024v14_cff::topology.

164  {
165  if (debug)
166  edm::LogVerbatim("IsoTrack") << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/"
167  << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom "
168  << dR << " " << trackMom;
169 
170  std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, false);
171  if (debug)
172  spr::debugHcalDets(0, vdets);
173  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
174  }
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
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:176
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#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)

◆ hitECALmatrix()

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 
)

◆ hitHCALmatrix()

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 
)

◆ hitHCALmatrixTotal()

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 
)

◆ hitsHCAL()

template<typename T >
void spr::hitsHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
std::vector< typename T::const_iterator > &  hitlist,
bool  debug = false 
)

◆ hotCrystal() [1/2]

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().

◆ hotCrystal() [2/2]

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 
)

◆ matchedSimTrack()

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 10 of file MatchingSimTrack.cc.

References TrackerHitAssociator::associateHit(), debug, newFWLiteAna::found, dqmiolumiharvest::j, and reco::Track::recHits().

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

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

◆ matchedSimTrackId()

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 79 of file MatchingSimTrack.cc.

References debug, iEvent, matchedSimTrack(), and validSimTrack().

84  {
85  // get the matching SimTrack
86  edm::SimTrackContainer::const_iterator trkInfo =
87  spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack, associate, debug);
88  unsigned int matchSimTrk = trkInfo->trackId();
89  if (debug)
90  edm::LogVerbatim("IsoTrack") << "matchedSimTrackId finds the SimTrk ID of the current track to be "
91  << matchSimTrk;
92  std::vector<int> matchTkid;
93  if (trkInfo->type() != 0) {
94  for (auto simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
95  if (validSimTrack(matchSimTrk, simTrkItr, SimTk, SimVtx, false))
96  matchTkid.push_back(static_cast<int>(simTrkItr->trackId()));
97  }
98  }
99  return matchTkid;
100  }
Log< level::Info, true > LogVerbatim
int iEvent
Definition: GenABIO.cc:224
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)

◆ matchedSimTrackInfo()

spr::simTkInfo spr::matchedSimTrackInfo ( unsigned int  simTkId,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 102 of file MatchingSimTrack.cc.

References debug, info(), parentSimTrack(), and validSimTrack().

105  {
107  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
108  if (simTkId == simTrkItr->trackId()) {
109  if (spr::validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug)) {
110  info.found = true;
111  info.pdgId = simTrkItr->type();
112  info.charge = simTrkItr->charge();
113  } else {
114  edm::SimTrackContainer::const_iterator parentItr = spr::parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
115  if (debug) {
116  if (parentItr != SimTk->end())
117  edm::LogVerbatim("IsoTrack") << "original parent of " << simTrkItr->trackId() << " "
118  << parentItr->trackId() << ", " << parentItr->type();
119  else
120  edm::LogVerbatim("IsoTrack") << "original parent of " << simTrkItr->trackId() << " not found";
121  }
122  if (parentItr != SimTk->end()) {
123  info.found = true;
124  info.pdgId = parentItr->type();
125  info.charge = parentItr->charge();
126  }
127  }
128  break;
129  }
130  }
131  return info;
132  }
Log< level::Info, true > LogVerbatim
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)

◆ matrixECALIds() [1/5]

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 submitPVResolutionJobs::count, debug, debugEcalDet(), debugEcalDets(), heppy_check::dirs, DetId::Ecal, EcalBarrel, EcalEndcap, extraIds(), CaloGeometry::getSubdetectorGeometry(), CaloTopology::getSubdetectorTopology(), testProducerWithPsetDescEmpty_cfi::i1, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, newECALIdNS(), NORTH, and SOUTH.

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

23  {
24  const CaloSubdetectorTopology* barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal, EcalBarrel));
25  const CaloSubdetectorTopology* endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal, EcalEndcap));
26  const EcalBarrelGeometry* barrelGeom =
27  (dynamic_cast<const EcalBarrelGeometry*>(geo->getSubdetectorGeometry(DetId::Ecal, EcalBarrel)));
28  const EcalEndcapGeometry* endcapGeom =
29  (dynamic_cast<const EcalEndcapGeometry*>(geo->getSubdetectorGeometry(DetId::Ecal, EcalEndcap)));
30 
31  if (debug) {
32  edm::LogVerbatim("IsoTrack") << "matrixECALIds::Add " << ieta << " rows and " << iphi
33  << " columns of cells for 1 cell" << spr::debugEcalDet(0, det).str();
34  }
35  std::vector<DetId> dets(1, det);
36  std::vector<CaloDirection> dirs(1, NORTH);
37  vdets = spr::newECALIdNS(
38  dets, 0, ieta, iphi, dirs, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
39  dirs[0] = SOUTH;
40  std::vector<DetId> vdetS = spr::newECALIdNS(
41  dets, 0, ieta, iphi, dirs, barrelTopo, endcapTopo, barrelGeom, endcapGeom, 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, barrelGeom, endcapGeom, vdetExtra, debug);
50  if (!vdetExtra.empty())
51  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
52  }
53 
54  if (debug) {
55  edm::LogVerbatim("IsoTrack") << "matrixECALIds::Total number of cells found is " << vdets.size();
56  spr::debugEcalDets(0, vdets);
57  }
58  }
Log< level::Info, true > LogVerbatim
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
std::ostringstream debugEcalDet(unsigned int, const DetId &)
Definition: DebugInfo.cc:12
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:17
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ matrixECALIds() [2/5]

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 60 of file MatrixECALDetIds.cc.

References debug, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, and matrixECALIds().

66  {
67  std::vector<DetId> vdets;
68  spr::matrixECALIds(det, ieta, iphi, geo, caloTopology, vdets, debug, ignoreTransition);
69  return vdets;
70  }
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

◆ matrixECALIds() [3/5]

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 72 of file MatrixECALDetIds.cc.

References debug, debugEcalDets(), HGC3DClusterGenMatchSelector_cfi::dR, EcalEndcap, getDistInPlaneTrackDir(), CaloGeometry::getPosition(), mps_fire::i, createfilelist::int, matrixECALIds(), and DetId::subdetId().

78  {
80  if (det.subdetId() == EcalEndcap) {
81  EEDetId EEid = EEDetId(det);
82  core = geo->getPosition(EEid);
83  } else {
84  EBDetId EBid = EBDetId(det);
85  core = geo->getPosition(EBid);
86  }
87  int ietaphi = (int)(dR / 2.0) + 1;
88  std::vector<DetId> vdets, vdetx;
89  spr::matrixECALIds(det, ietaphi, ietaphi, geo, caloTopology, vdets, debug, ignoreTransition);
90  for (unsigned int i = 0; i < vdets.size(); ++i) {
91  GlobalPoint rpoint;
92  if (vdets[i].subdetId() == EcalEndcap) {
93  EEDetId EEid = EEDetId(vdets[i]);
94  rpoint = geo->getPosition(EEid);
95  } else {
96  EBDetId EBid = EBDetId(vdets[i]);
97  rpoint = geo->getPosition(EBid);
98  }
99  if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint) < dR) {
100  vdetx.push_back(vdets[i]);
101  }
102  }
103 
104  if (debug) {
105  edm::LogVerbatim("IsoTrack") << "matrixECALIds::Final List of cells for dR " << dR << " is with " << vdetx.size()
106  << " from original list of " << vdets.size();
107  spr::debugEcalDets(0, vdetx);
108  }
109  return vdetx;
110  }
Log< level::Info, true > LogVerbatim
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
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
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
#define debug
Definition: HDRShower.cc:19

◆ matrixECALIds() [4/5]

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 112 of file MatrixECALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugEcalDet(), debugEcalDets(), heppy_check::dirs, DetId::Ecal, EcalBarrel, EcalEndcap, extraIds(), CaloGeometry::getSubdetectorGeometry(), CaloTopology::getSubdetectorTopology(), testProducerWithPsetDescEmpty_cfi::i1, newECALIdNS(), NORTH, and SOUTH.

121  {
122  const CaloSubdetectorTopology* barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal, EcalBarrel));
123  const CaloSubdetectorTopology* endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal, EcalEndcap));
124  const EcalBarrelGeometry* barrelGeom =
125  (dynamic_cast<const EcalBarrelGeometry*>(geo->getSubdetectorGeometry(DetId::Ecal, EcalBarrel)));
126  const EcalEndcapGeometry* endcapGeom =
127  (dynamic_cast<const EcalEndcapGeometry*>(geo->getSubdetectorGeometry(DetId::Ecal, EcalEndcap)));
128 
129  if (debug) {
130  edm::LogVerbatim("IsoTrack") << "matrixECALIds::Add " << ietaE << "|" << ietaW << " rows and " << iphiN << "|"
131  << iphiS << " columns of cells for 1 cell" << spr::debugEcalDet(0, det).str();
132  }
133  std::vector<DetId> dets(1, det);
134  std::vector<CaloDirection> dirs(1, NORTH);
135  std::vector<int> jetaE(1, ietaE), jetaW(1, ietaW);
136  std::vector<int> jphiN(1, iphiN), jphiS(1, iphiS);
137  vdets = spr::newECALIdNS(dets,
138  0,
139  jetaE,
140  jetaW,
141  jphiN,
142  jphiS,
143  dirs,
144  barrelTopo,
145  endcapTopo,
146  barrelGeom,
147  endcapGeom,
148  debug,
149  ignoreTransition);
150  dirs[0] = SOUTH;
151  std::vector<DetId> vdetS = spr::newECALIdNS(dets,
152  0,
153  jetaE,
154  jetaW,
155  jphiN,
156  jphiS,
157  dirs,
158  barrelTopo,
159  endcapTopo,
160  barrelGeom,
161  endcapGeom,
162  debug,
163  ignoreTransition);
164  for (unsigned int i1 = 0; i1 < vdetS.size(); i1++) {
165  if (std::count(vdets.begin(), vdets.end(), vdetS[i1]) == 0)
166  vdets.push_back(vdetS[i1]);
167  }
168 
169  unsigned int ndet = (ietaE + ietaW + 1) * (iphiN + iphiS + 1);
170  if (vdets.size() != ndet) {
171  std::vector<DetId> vdetExtra;
172  spr::extraIds(det, vdets, ietaE, ietaW, iphiN, iphiS, barrelGeom, endcapGeom, vdetExtra, debug);
173  if (!vdetExtra.empty())
174  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
175  }
176 
177  if (debug) {
178  edm::LogVerbatim("IsoTrack") << "matrixECALIds::Total number of cells found is " << vdets.size();
179  spr::debugEcalDets(0, vdets);
180  }
181  }
Log< level::Info, true > LogVerbatim
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
std::ostringstream debugEcalDet(unsigned int, const DetId &)
Definition: DebugInfo.cc:12
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:17
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ matrixECALIds() [5/5]

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 183 of file MatrixECALDetIds.cc.

References debug, and matrixECALIds().

191  {
192  std::vector<DetId> vdets;
193  spr::matrixECALIds(det, ietaE, ietaW, iphiN, iphiS, geo, caloTopology, vdets, debug, ignoreTransition);
194  return vdets;
195  }
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

◆ matrixHCALIds() [1/3]

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 13 of file MatrixHCALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugHcalDets(), testProducerWithPsetDescEmpty_cfi::i1, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, matrixHCALIdsDepth(), newHCALIdNS(), and HLT_2024v14_cff::topology.

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

14  {
15  if (debug) {
16  edm::LogVerbatim("IsoTrack") << "matrixHCALIds::Add " << ieta << " rows and " << iphi << " columns of cells for "
17  << dets.size() << " cells";
18  spr::debugHcalDets(0, dets);
19  }
20 
21  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ieta, iphi, debug);
22  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false, ieta, iphi, debug);
23  for (unsigned int i1 = 0; i1 < vdetS.size(); i1++) {
24  if (std::count(vdetN.begin(), vdetN.end(), vdetS[i1]) == 0)
25  vdetN.push_back(vdetS[i1]);
26  }
27 
28  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
29 
30  if (debug) {
31  edm::LogVerbatim("IsoTrack") << "matrixHCALIds::Total number of cells found is " << vdetS.size();
32  spr::debugHcalDets(0, vdetS);
33  }
34  return vdetS;
35  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
Log< level::Info, true > LogVerbatim
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)

◆ matrixHCALIds() [2/3]

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 37 of file MatrixHCALDetIds.cc.

References debug, debugHcalDets(), HGC3DClusterGenMatchSelector_cfi::dR, getDistInPlaneTrackDir(), CaloGeometry::getSubdetectorGeometry(), mps_fire::i, createfilelist::int, matrixHCALIds(), and HLT_2024v14_cff::topology.

43  {
44  HcalDetId hcdet = HcalDetId(det);
45  GlobalPoint core = (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(hcdet)))->getPosition(hcdet);
46  std::vector<DetId> dets, vdetx;
47  dets.push_back(det);
48  int ietaphi = (int)(dR / 15.0) + 1;
49  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ietaphi, ietaphi, includeHO, debug);
50  for (unsigned int i = 0; i < vdets.size(); ++i) {
51  HcalDetId hcdet = HcalDetId(vdets[i]);
52  GlobalPoint rpoint = (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(hcdet)))->getPosition(hcdet);
53  if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint) < dR) {
54  vdetx.push_back(vdets[i]);
55  }
56  }
57 
58  if (debug) {
59  edm::LogVerbatim("IsoTrack") << "matrixHCALIds::Final List of cells for dR " << dR << " is with " << vdetx.size()
60  << " from original list of " << vdets.size() << " cells";
61  spr::debugHcalDets(0, vdetx);
62  }
63  return vdetx;
64  }
Log< level::Info, true > LogVerbatim
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
Definition: __init__.py:1
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#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)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ matrixHCALIds() [3/3]

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 66 of file MatrixHCALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugHcalDets(), testProducerWithPsetDescEmpty_cfi::i1, matrixHCALIdsDepth(), newHCALIdNS(), and HLT_2024v14_cff::topology.

73  {
74  if (debug) {
75  edm::LogVerbatim("IsoTrack") << "matrixHCALIds::Add " << ietaE << "|" << ietaW << " rows and " << iphiN << "|"
76  << iphiS << " columns of cells for " << dets.size() << " cells";
77  spr::debugHcalDets(0, dets);
78  }
79 
80  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ietaE, ietaW, iphiN, iphiS, debug);
81  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false, ietaE, ietaW, iphiN, iphiS, debug);
82  for (unsigned int i1 = 0; i1 < vdetS.size(); i1++) {
83  if (std::count(vdetN.begin(), vdetN.end(), vdetS[i1]) == 0)
84  vdetN.push_back(vdetS[i1]);
85  }
86 
87  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
88 
89  if (debug) {
90  edm::LogVerbatim("IsoTrack") << "matrixHCALIds::Total number of cells found is " << vdetS.size();
91  spr::debugHcalDets(0, vdetS);
92  }
93  return vdetS;
94  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
Log< level::Info, true > LogVerbatim
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)

◆ matrixHCALIdsDepth()

std::vector< DetId > spr::matrixHCALIdsDepth ( std::vector< DetId > &  dets,
const HcalTopology topology,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 370 of file MatrixHCALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugHcalDets(), HcalOuter, testProducerWithPsetDescEmpty_cfi::i1, createfilelist::int, create_idmaps::n, and HLT_2024v14_cff::topology.

Referenced by matrixHCALIds().

373  {
374  if (debug) {
375  edm::LogVerbatim("IsoTrack") << "matrixHCALIdsDepth::Add cells with higher depths with HO"
376  << "Flag set to " << includeHO << " to existing " << dets.size() << " cells";
377  spr::debugHcalDets(0, dets);
378  }
379  std::vector<DetId> vdets(dets);
380  for (unsigned int i1 = 0; i1 < dets.size(); i1++) {
381  HcalDetId vdet = dets[i1];
382  for (int idepth = 0; idepth < 3; idepth++) {
383  std::vector<DetId> vUpDetId = topology->up(vdet);
384  if (!vUpDetId.empty()) {
385  if (includeHO || vUpDetId[0].subdetId() != (int)(HcalOuter)) {
386  int n = std::count(vdets.begin(), vdets.end(), vUpDetId[0]);
387  if (n == 0) {
388  if (debug)
389  edm::LogVerbatim("IsoTrack")
390  << "matrixHCALIdsDepth:: Depth " << idepth << " " << vdet << " " << (HcalDetId)vUpDetId[0];
391  vdets.push_back(vUpDetId[0]);
392  }
393  }
394  vdet = vUpDetId[0];
395  }
396  }
397  }
398 
399  if (debug) {
400  edm::LogVerbatim("IsoTrack") << "matrixHCALIdsDepth::Final list contains " << vdets.size() << " cells";
401  spr::debugHcalDets(0, vdets);
402  }
403  return vdets;
404  }
Log< level::Info, true > LogVerbatim
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#define debug
Definition: HDRShower.cc:19

◆ missedCaloHits()

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 
)

◆ missedECALHits()

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 
)

◆ missedHCALHits()

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 
)

◆ newECALIdEW() [1/2]

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 509 of file MatrixECALDetIds.cc.

References hgcalTBTopologyTester_cfi::cells, submitPVResolutionJobs::count, debug, debugEcalDets(), DeadROC_duringRun::dir, heppy_check::dirs, EAST, RemoveAddSevLevel::flag, testProducerWithPsetDescEmpty_cfi::i1, hcalRecHitTable_cff::ieta, dqmdumpme::last, simpleMove(), and WEST.

Referenced by newECALIdEW(), and newECALIdNS().

518  {
519  if (debug) {
520  edm::LogVerbatim("IsoTrack") << "newECALIdEW::Add " << ieta << " rows of cells for " << last << ":" << dets.size()
521  << ":" << (dets.size() - last) << " cells" << std::endl;
522  spr::debugEcalDets(last, dets, dir);
523  }
524  std::vector<DetId> vdets;
525  vdets.clear();
526  std::vector<CaloDirection> dirs;
527  dirs.clear();
528  vdets.insert(vdets.end(), dets.begin(), dets.end());
529  dirs.insert(dirs.end(), dir.begin(), dir.end());
530 
531  if (ieta > 0) {
532  for (unsigned int i1 = last; i1 < dets.size(); i1++) {
533  int flag = 0;
534  std::vector<DetId> cells;
536  dets[i1], dir[i1], barrelTopo, endcapTopo, barrelGeom, endcapGeom, cells, flag, debug, ignoreTransition);
537  if (flag != 0) {
538  if (std::count(vdets.begin(), vdets.end(), cells[0]) == 0) {
539  CaloDirection dirn = dir[i1];
540  if (flag < 0) {
541  if (dirn == EAST)
542  dirn = WEST;
543  else
544  dirn = EAST;
545  }
546  vdets.push_back(cells[0]);
547  dirs.push_back(dirn);
548  }
549  }
550  }
551  ieta--;
552  }
553 
554  if (debug) {
555  edm::LogVerbatim("IsoTrack") << "newECALIdEW::Addition results a set of " << (vdets.size() - dets.size())
556  << " new cells";
557  spr::debugEcalDets(dets.size(), vdets, dirs);
558  }
559  if (ieta > 0) {
560  last = dets.size();
561  return spr::newECALIdEW(
562  vdets, last, ieta, dirs, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
563  } else {
564  if (debug) {
565  edm::LogVerbatim("IsoTrack") << "newECALIdEW::Final list (EW) consists of " << vdets.size() << " cells";
566  spr::debugEcalDets(0, vdets);
567  }
568  return vdets;
569  }
570  }
Log< level::Info, true > LogVerbatim
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
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
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)

◆ newECALIdEW() [2/2]

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 572 of file MatrixECALDetIds.cc.

References hgcalTBTopologyTester_cfi::cells, submitPVResolutionJobs::count, debug, debugEcalDets(), DeadROC_duringRun::dir, heppy_check::dirs, EAST, RemoveAddSevLevel::flag, testProducerWithPsetDescEmpty_cfi::i1, hcalRecHitTable_cff::ieta, dqmdumpme::last, newECALIdEW(), simpleMove(), and WEST.

582  {
583  if (debug) {
584  edm::LogVerbatim("IsoTrack") << "newECALIdEW::Add " << ietaE[0] << "|" << ietaW[0] << " rows of cells for "
585  << (dets.size() - last) << " cells (last " << last << ")";
586  spr::debugEcalDets(last, dets, dir);
587  }
588  std::vector<DetId> vdets;
589  vdets.insert(vdets.end(), dets.begin(), dets.end());
590  std::vector<CaloDirection> dirs;
591  dirs.insert(dirs.end(), dir.begin(), dir.end());
592  std::vector<int> jetaE, jetaW;
593  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
594  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
595  int keta = 0;
596  for (unsigned int i1 = last; i1 < dets.size(); i1++) {
597  int ieta = ietaW[i1];
598  if (dir[i1] == EAST)
599  ieta = ietaE[i1];
600  if (ieta > 0) {
601  int flag = 0;
602  std::vector<DetId> cells;
604  dets[i1], dir[i1], barrelTopo, endcapTopo, barrelGeom, endcapGeom, cells, flag, debug, ignoreTransition);
605  ieta--;
606  if (ieta > keta)
607  keta = ieta;
608  if (dir[i1] == EAST)
609  jetaE[i1] = ieta;
610  else
611  jetaW[i1] = ieta;
612  if (flag != 0) {
613  if (std::count(vdets.begin(), vdets.end(), cells[0]) == 0) {
614  vdets.push_back(cells[0]);
615  CaloDirection dirn = dir[i1];
616  int ketaE = ietaE[i1];
617  int ketaW = ietaW[i1];
618  if (dirn == EAST)
619  ketaE = ieta;
620  else
621  ketaW = ieta;
622  if (flag < 0) {
623  int ktmp = ketaW;
624  ketaW = ketaE;
625  ketaE = ktmp;
626  if (dirn == EAST)
627  dirn = WEST;
628  else
629  dirn = EAST;
630  }
631  dirs.push_back(dirn);
632  jetaE.push_back(ketaE);
633  jetaW.push_back(ketaW);
634  }
635  }
636  }
637  }
638 
639  if (debug) {
640  edm::LogVerbatim("IsoTrack") << "newECALIdEW::Addition results a set of " << (vdets.size() - dets.size())
641  << " new cells (last " << dets.size() << ", ieta " << keta << ")";
642  spr::debugEcalDets(dets.size(), vdets);
643  }
644  if (keta > 0) {
645  last = dets.size();
646  return spr::newECALIdEW(
647  vdets, last, jetaE, jetaW, dirs, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
648  } else {
649  if (debug) {
650  edm::LogVerbatim("IsoTrack") << "newECALIdEW::Final list (EW) consists of " << vdets.size() << " cells";
651  spr::debugEcalDets(0, vdets);
652  }
653  return vdets;
654  }
655  }
Log< level::Info, true > LogVerbatim
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
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
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)

◆ newECALIdNS() [1/2]

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 197 of file MatrixECALDetIds.cc.

References hgcalTBTopologyTester_cfi::cells, submitPVResolutionJobs::count, debug, debugEcalDets(), DeadROC_duringRun::dir, heppy_check::dirs, EAST, RemoveAddSevLevel::flag, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, dqmdumpme::last, newECALIdEW(), NORTH, simpleMove(), SOUTH, and WEST.

Referenced by matrixECALIds(), and newECALIdNS().

207  {
208  if (debug) {
209  edm::LogVerbatim("IsoTrack") << "newECALIdNS::Add " << iphi << " columns of cells for " << (dets.size() - last)
210  << " cells (last " << last << ")";
211  spr::debugEcalDets(last, dets, dir);
212  }
213  std::vector<DetId> vdets;
214  std::vector<CaloDirection> dirs;
215  vdets.insert(vdets.end(), dets.begin(), dets.end());
216  dirs.insert(dirs.end(), dir.begin(), dir.end());
217 
218  std::vector<DetId> vdetE, vdetW;
219  if (last == 0) {
220  unsigned int ndet = vdets.size();
221  std::vector<CaloDirection> dirE(ndet, EAST), dirW(ndet, WEST);
222  vdetE = spr::newECALIdEW(
223  dets, last, ieta, dirE, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
224  vdetW = spr::newECALIdEW(
225  dets, last, ieta, dirW, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
226  for (unsigned int i1 = 0; i1 < vdetW.size(); i1++) {
227  if (std::count(vdets.begin(), vdets.end(), vdetW[i1]) == 0) {
228  vdets.push_back(vdetW[i1]);
229  dirs.push_back(dir[0]);
230  }
231  }
232  for (unsigned int i1 = 0; i1 < vdetE.size(); i1++) {
233  if (std::count(vdets.begin(), vdets.end(), vdetE[i1]) == 0) {
234  vdets.push_back(vdetE[i1]);
235  dirs.push_back(dir[0]);
236  }
237  }
238  if (debug) {
239  edm::LogVerbatim("IsoTrack") << "newECALIdNS::With Added cells along E/W results a set of "
240  << (vdets.size() - dets.size()) << " new cells";
241  spr::debugEcalDets(dets.size(), vdets, dirs);
242  }
243  }
244 
245  unsigned int last0 = vdets.size();
246  std::vector<DetId> vdetnew;
247  std::vector<CaloDirection> dirnew;
248  if (iphi > 0) {
249  std::vector<DetId> vdetn(1);
250  std::vector<CaloDirection> dirn(1);
251  std::vector<CaloDirection> dirnE(1, EAST), dirnW(1, WEST);
252  int flag = 0;
253  for (unsigned int i1 = last; i1 < dets.size(); i1++) {
254  std::vector<DetId> cells;
256  dets[i1], dir[i1], barrelTopo, endcapTopo, barrelGeom, endcapGeom, cells, flag, debug, ignoreTransition);
257  if (flag != 0) {
258  if (std::count(vdets.begin(), vdets.end(), cells[0]) == 0) {
259  vdetn[0] = cells[0];
260  vdetnew.push_back(vdetn[0]);
261  dirn[0] = dir[i1];
262  if (flag < 0) {
263  if (dirn[0] == NORTH)
264  dirn[0] = SOUTH;
265  else
266  dirn[0] = NORTH;
267  }
268  dirnew.push_back(dirn[0]);
269  vdetE = spr::newECALIdEW(
270  vdetn, 0, ieta, dirnE, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
271  vdetW = spr::newECALIdEW(
272  vdetn, 0, ieta, dirnW, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
273  for (unsigned int i2 = 0; i2 < vdetW.size(); i2++) {
274  if (std::count(vdets.begin(), vdets.end(), vdetW[i2]) == 0 &&
275  std::count(vdetnew.begin(), vdetnew.end(), vdetW[i2]) == 0) {
276  vdets.push_back(vdetW[i2]);
277  dirs.push_back(dirn[0]);
278  }
279  }
280  for (unsigned int i2 = 0; i2 < vdetE.size(); i2++) {
281  if (std::count(vdets.begin(), vdets.end(), vdetE[i2]) == 0 &&
282  std::count(vdetnew.begin(), vdetnew.end(), vdetE[i2]) == 0) {
283  vdets.push_back(vdetE[i2]);
284  dirs.push_back(dirn[0]);
285  }
286  }
287  }
288  }
289  }
290  iphi--;
291  last = vdets.size();
292  for (unsigned int i2 = 0; i2 < vdetnew.size(); i2++) {
293  if (std::count(vdets.begin(), vdets.end(), vdetnew[i2]) == 0) {
294  vdets.push_back(vdetnew[i2]);
295  dirs.push_back(dirnew[i2]);
296  }
297  }
298  if (debug) {
299  edm::LogVerbatim("IsoTrack") << "newECALIdNS::Addition results a set of " << (vdets.size() - last0)
300  << " new cells (last " << last0 << ", iphi " << iphi << ")";
301  spr::debugEcalDets(last0, vdets, dirs);
302  }
303  last0 = last;
304  }
305 
306  if (iphi > 0) {
307  last = last0;
308  return spr::newECALIdNS(
309  vdets, last, ieta, iphi, dirs, barrelTopo, endcapTopo, barrelGeom, endcapGeom, debug, ignoreTransition);
310  } else {
311  if (debug) {
312  edm::LogVerbatim("IsoTrack") << "newECALIdNS::Final list consists of " << vdets.size() << " cells";
313  spr::debugEcalDets(0, vdets);
314  }
315  return vdets;
316  }
317  }
Log< level::Info, true > LogVerbatim
void debugEcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:27
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
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)

◆ newECALIdNS() [2/2]

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 319 of file MatrixECALDetIds.cc.

References hgcalTBTopologyTester_cfi::cells, submitPVResolutionJobs::count, debug, debugEcalDet(), debugEcalDets(), DeadROC_duringRun::dir, heppy_check::dirs, EAST, RemoveAddSevLevel::flag, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, hcalRecHitTable_cff::iphi, dqmdumpme::last, newECALIdEW(), newECALIdNS(), NORTH, simpleMove(), SOUTH, and WEST.

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

◆ newHCALIdEW() [1/2]

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 273 of file MatrixHCALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugHcalDets(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, hcalRecHitTable_cff::ieta, dqmdumpme::last, and HLT_2024v14_cff::topology.

Referenced by newHCALIdEW(), and newHCALIdNS().

274  {
275  if (debug) {
276  edm::LogVerbatim("IsoTrack") << "newHCALIdEW::Add " << ieta << " rows of cells along " << shiftEast << " for "
277  << (dets.size() - last) << " cells";
278  spr::debugHcalDets(last, dets);
279  }
280 
281  std::vector<DetId> vdets;
282  vdets.insert(vdets.end(), dets.begin(), dets.end());
283  if (ieta > 0) {
284  for (unsigned int i1 = last; i1 < dets.size(); i1++) {
285  std::vector<DetId> vdet;
286  if (shiftEast)
287  vdet = topology->east(dets[i1]);
288  else
289  vdet = topology->west(dets[i1]);
290  for (unsigned int i2 = 0; i2 < vdet.size(); i2++) {
291  if (std::count(vdets.begin(), vdets.end(), vdet[i2]) == 0)
292  vdets.push_back(vdet[i2]);
293  }
294  }
295  ieta--;
296  }
297 
298  if (debug) {
299  edm::LogVerbatim("IsoTrack") << "newHCALIdEW::Addition results a set of " << (vdets.size() - dets.size())
300  << " new cells";
301  spr::debugHcalDets(dets.size(), vdets);
302  }
303  if (ieta > 0) {
304  last = dets.size();
305  return spr::newHCALIdEW(vdets, last, topology, shiftEast, ieta, debug);
306  } else {
307  if (debug) {
308  edm::LogVerbatim("IsoTrack") << "newHCALIdEW::Final list (EW) consists of " << vdets.size() << " cells";
309  spr::debugHcalDets(0, vdets);
310  }
311  return vdets;
312  }
313  }
Log< level::Info, true > LogVerbatim
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)

◆ newHCALIdEW() [2/2]

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 315 of file MatrixHCALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugHcalDets(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, hcalRecHitTable_cff::ieta, dqmdumpme::last, newHCALIdEW(), and HLT_2024v14_cff::topology.

321  {
322  if (debug) {
323  edm::LogVerbatim("IsoTrack") << "newHCALIdEW::Add " << ietaE << "|" << ietaW << " rows of cells along "
324  << shiftEast << " for " << (dets.size() - last) << " cells";
325  spr::debugHcalDets(last, dets);
326  }
327 
328  int ieta = ietaW;
329  if (shiftEast)
330  ieta = ietaE;
331  std::vector<DetId> vdets;
332  vdets.insert(vdets.end(), dets.begin(), dets.end());
333  if (ieta > 0) {
334  for (unsigned int i1 = last; i1 < dets.size(); i1++) {
335  std::vector<DetId> vdet;
336  if (shiftEast)
337  vdet = topology->east(dets[i1]);
338  else
339  vdet = topology->west(dets[i1]);
340  for (unsigned int i2 = 0; i2 < vdet.size(); i2++) {
341  if (std::count(vdets.begin(), vdets.end(), vdet[i2]) == 0)
342  vdets.push_back(vdet[i2]);
343  }
344  }
345  ieta--;
346  }
347  if (shiftEast)
348  ietaE = ieta;
349  else
350  ietaW = ieta;
351 
352  if (debug) {
353  edm::LogVerbatim("IsoTrack") << "newHCALIdEW::Addition results a set of " << (vdets.size() - dets.size())
354  << " new cells";
355  spr::debugHcalDets(dets.size(), vdets);
356  }
357 
358  if (ieta > 0) {
359  last = dets.size();
360  return spr::newHCALIdEW(vdets, last, topology, shiftEast, ietaE, ietaW, debug);
361  } else {
362  if (debug) {
363  edm::LogVerbatim("IsoTrack") << "newHCALIdEW::Final list (EW) consists of " << vdets.size() << " cells";
364  spr::debugHcalDets(0, vdets);
365  }
366  return vdets;
367  }
368  }
Log< level::Info, true > LogVerbatim
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)

◆ newHCALIdNS() [1/2]

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 96 of file MatrixHCALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugHcalDets(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, dqmdumpme::last, newHCALIdEW(), and HLT_2024v14_cff::topology.

Referenced by matrixHCALIds(), and newHCALIdNS().

102  {
103  if (debug) {
104  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::Add " << iphi << " columns of cells along " << shiftNorth << " for "
105  << (dets.size() - last) << " cells";
106  spr::debugHcalDets(last, dets);
107  }
108 
109  std::vector<DetId> vdets;
110  vdets.insert(vdets.end(), dets.begin(), dets.end());
111  std::vector<DetId> vdetE, vdetW;
112  if (last == 0) {
113  vdetE = spr::newHCALIdEW(dets, last, topology, true, ieta, debug);
114  vdetW = spr::newHCALIdEW(dets, last, topology, false, ieta, debug);
115  for (unsigned int i1 = 0; i1 < vdetW.size(); i1++) {
116  if (std::count(vdets.begin(), vdets.end(), vdetW[i1]) == 0)
117  vdets.push_back(vdetW[i1]);
118  }
119  for (unsigned int i1 = 0; i1 < vdetE.size(); i1++) {
120  if (std::count(vdets.begin(), vdets.end(), vdetE[i1]) == 0)
121  vdets.push_back(vdetE[i1]);
122  }
123 
124  if (debug) {
125  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::With Added cells along E/W results a set of "
126  << (vdets.size() - dets.size()) << " new cells";
127  spr::debugHcalDets(dets.size(), vdets);
128  }
129  }
130  unsigned int last0 = vdets.size();
131  if (iphi > 0) {
132  std::vector<DetId> vdetnew;
133  for (unsigned int i1 = last; i1 < dets.size(); i1++) {
134  std::vector<DetId> vdet;
135  if (shiftNorth)
136  vdet = topology->north(dets[i1]);
137  else
138  vdet = topology->south(dets[i1]);
139  for (unsigned int i2 = 0; i2 < vdet.size(); i2++) {
140  if (std::count(vdets.begin(), vdets.end(), vdet[i2]) == 0)
141  vdetnew.push_back(vdet[i2]);
142  }
143  }
144  iphi--;
145  vdetE = spr::newHCALIdEW(vdetnew, 0, topology, true, ieta, debug);
146  vdetW = spr::newHCALIdEW(vdetnew, 0, topology, false, ieta, debug);
147  for (unsigned int i2 = 0; i2 < vdetW.size(); i2++) {
148  if (std::count(vdets.begin(), vdets.end(), vdetW[i2]) == 0 &&
149  std::count(vdetnew.begin(), vdetnew.end(), vdetW[i2]) == 0)
150  vdets.push_back(vdetW[i2]);
151  }
152  for (unsigned int i2 = 0; i2 < vdetE.size(); i2++) {
153  if (std::count(vdets.begin(), vdets.end(), vdetE[i2]) == 0 &&
154  std::count(vdetnew.begin(), vdetnew.end(), vdetE[i2]) == 0)
155  vdets.push_back(vdetE[i2]);
156  }
157  last = vdets.size();
158  vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
159 
160  if (debug) {
161  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::Addition results a set of " << (vdets.size() - last0)
162  << " new cells";
163  spr::debugHcalDets(last0, vdets);
164  }
165  last0 = last;
166  }
167 
168  if (iphi > 0) {
169  last = last0;
170  return spr::newHCALIdNS(vdets, last, topology, shiftNorth, ieta, iphi, debug);
171  } else {
172  if (debug) {
173  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::Final list consists of " << vdets.size() << " cells";
174  spr::debugHcalDets(0, vdets);
175  }
176  return vdets;
177  }
178  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
Log< level::Info, true > LogVerbatim
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)

◆ newHCALIdNS() [2/2]

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 180 of file MatrixHCALDetIds.cc.

References submitPVResolutionJobs::count, debug, debugHcalDets(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, hcalRecHitTable_cff::iphi, dqmdumpme::last, newHCALIdEW(), newHCALIdNS(), and HLT_2024v14_cff::topology.

188  {
189  if (debug) {
190  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::Add " << iphiN << "|" << iphiS << " columns of cells along "
191  << shiftNorth << " for " << (dets.size() - last) << " cells";
192  spr::debugHcalDets(last, dets);
193  }
194 
195  std::vector<DetId> vdets;
196  vdets.insert(vdets.end(), dets.begin(), dets.end());
197  std::vector<DetId> vdetE, vdetW;
198  if (last == 0) {
199  vdetE = spr::newHCALIdEW(dets, last, topology, true, ietaE, ietaW, debug);
200  vdetW = spr::newHCALIdEW(dets, last, topology, false, ietaE, ietaW, debug);
201  for (unsigned int i1 = 0; i1 < vdetW.size(); i1++) {
202  if (std::count(vdets.begin(), vdets.end(), vdetW[i1]) == 0)
203  vdets.push_back(vdetW[i1]);
204  }
205  for (unsigned int i1 = 0; i1 < vdetE.size(); i1++) {
206  if (std::count(vdets.begin(), vdets.end(), vdetE[i1]) == 0)
207  vdets.push_back(vdetE[i1]);
208  }
209 
210  if (debug) {
211  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::With Added cells along E/W results a set of "
212  << (vdets.size() - dets.size()) << " new cells";
213  spr::debugHcalDets(dets.size(), vdets);
214  }
215  }
216  unsigned int last0 = vdets.size();
217  int iphi = iphiS;
218  if (shiftNorth)
219  iphi = iphiN;
220  if (iphi > 0) {
221  std::vector<DetId> vdetnew;
222  for (unsigned int i1 = last; i1 < dets.size(); i1++) {
223  std::vector<DetId> vdet;
224  if (shiftNorth)
225  vdet = topology->north(dets[i1]);
226  else
227  vdet = topology->south(dets[i1]);
228  for (unsigned int i2 = 0; i2 < vdet.size(); i2++) {
229  if (std::count(vdets.begin(), vdets.end(), vdet[i2]) == 0)
230  vdetnew.push_back(vdet[i2]);
231  }
232  }
233  iphi--;
234  vdetE = spr::newHCALIdEW(vdetnew, 0, topology, true, ietaE, ietaW, debug);
235  vdetW = spr::newHCALIdEW(vdetnew, 0, topology, false, ietaE, ietaW, debug);
236  for (unsigned int i2 = 0; i2 < vdetW.size(); i2++) {
237  if (std::count(vdets.begin(), vdets.end(), vdetW[i2]) == 0 &&
238  std::count(vdetnew.begin(), vdetnew.end(), vdetW[i2]) == 0)
239  vdets.push_back(vdetW[i2]);
240  }
241  for (unsigned int i2 = 0; i2 < vdetE.size(); i2++) {
242  if (std::count(vdets.begin(), vdets.end(), vdetE[i2]) == 0 &&
243  std::count(vdetnew.begin(), vdetnew.end(), vdetE[i2]) == 0)
244  vdets.push_back(vdetE[i2]);
245  }
246  last = vdets.size();
247  vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
248 
249  if (debug) {
250  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::Addition results a set of " << (vdets.size() - last0)
251  << " new cells";
252  spr::debugHcalDets(last0, vdets);
253  }
254  last0 = last;
255  }
256  if (shiftNorth)
257  iphiN = iphi;
258  else
259  iphiS = iphi;
260 
261  if (iphi > 0) {
262  last = last0;
263  return spr::newHCALIdNS(vdets, last, topology, shiftNorth, ietaE, ietaW, iphiN, iphiS, debug);
264  } else {
265  if (debug) {
266  edm::LogVerbatim("IsoTrack") << "newHCALIdNS::Final list consists of " << vdets.size() << " cells";
267  spr::debugHcalDets(0, vdets);
268  }
269  return vdets;
270  }
271  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
Log< level::Info, true > LogVerbatim
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)

◆ parentSimTrack()

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 185 of file MatchingSimTrack.cc.

References debug, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, and class-composition::parent.

Referenced by matchedSimTrackInfo().

188  {
189  edm::SimTrackContainer::const_iterator itr = SimTk->end();
190 
191  int vertIndex = thisTrkItr->vertIndex();
192  if (debug)
193  edm::LogVerbatim("IsoTrack") << "SimTrackParent " << thisTrkItr->trackId() << " Vertex " << vertIndex << " Type "
194  << thisTrkItr->type() << " Charge " << static_cast<int>(thisTrkItr->charge());
195  if (vertIndex == -1)
196  return thisTrkItr;
197  else if (vertIndex >= static_cast<int>(SimVtx->size()))
198  return itr;
199 
200  edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
201  for (int iv = 0; iv < vertIndex; iv++)
202  simVtxItr++;
203  int parent = simVtxItr->parentIndex();
204 
205  if (parent < 0 && simVtxItr != SimVtx->begin()) {
206  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
207  for (simVtxItr = SimVtx->begin(); simVtxItr != SimVtx->end(); ++simVtxItr) {
208  if (simVtxItr->parentIndex() > 0) {
209  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
210  double dist = pos2.P();
211  if (dist < 0.001) {
212  parent = simVtxItr->parentIndex();
213  break;
214  }
215  }
216  }
217  }
218  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
219  if (static_cast<int>(simTrkItr->trackId()) == parent && simTrkItr != thisTrkItr)
220  return parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
221  }
222 
223  return thisTrkItr;
224  }
Log< level::Info, true > LogVerbatim
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
edm::SimTrackContainer::const_iterator parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)

◆ propagateCALO() [1/7]

std::vector< spr::propagatedTrackID > spr::propagateCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
const std::string &  theTrackQuality,
bool  debug = false 
)

◆ propagateCALO() [2/7]

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 140 of file CaloPropagateTrack.cc.

References funct::abs(), Calorimetry_cff::bField, debug, 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.

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

◆ propagateCALO() [3/7]

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 216 of file CaloPropagateTrack.cc.

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

221  {
225  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
226 
227  unsigned int indx;
228  reco::TrackCollection::const_iterator trkItr;
229  for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
230  const reco::Track* pTrack = &(*trkItr);
232  trkD.trkItr = trkItr;
233  trkD.ok = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack->quality(trackQuality_)) : true;
234  trkD.detIdECAL = DetId(0);
235  trkD.detIdHCAL = DetId(0);
236  trkD.detIdEHCAL = DetId(0);
237  if (debug)
238  edm::LogVerbatim("IsoTrack") << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta()
239  << " phi " << trkItr->phi() << " Flag " << trkD.ok;
241  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
242  trkD.okECAL = info.ok;
243  trkD.pointECAL = point;
244  trkD.directionECAL = info.direction;
245  if (trkD.okECAL) {
246  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
247  trkD.detIdECAL = barrelGeom->getClosestCell(point);
248  } else {
249  if (endcapGeom)
250  trkD.detIdECAL = endcapGeom->getClosestCell(point);
251  else
252  trkD.okECAL = false;
253  }
254  trkD.detIdEHCAL = gHB->getClosestCell(point);
255  }
257  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
258  trkD.okHCAL = info.ok;
259  trkD.pointHCAL = point;
260  trkD.directionHCAL = info.direction;
261  if (trkD.okHCAL) {
262  trkD.detIdHCAL = gHB->getClosestCell(point);
263  }
264  trkDir.push_back(trkD);
265  }
266  if (debug) {
267  edm::LogVerbatim("IsoTrack") << "propagateCALO:: for " << trkDir.size() << " tracks";
268  for (unsigned int i = 0; i < trkDir.size(); ++i) {
269  std::ostringstream st1, st2;
270  if (trkDir[i].okECAL) {
271  st1 << " point " << trkDir[i].pointECAL << " direction " << trkDir[i].directionECAL << " ";
272  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
273  st1 << (EBDetId)(trkDir[i].detIdECAL);
274  } else {
275  st1 << (EEDetId)(trkDir[i].detIdECAL);
276  }
277  }
278  if (trkDir[i].okHCAL) {
279  st2 << " point " << trkDir[i].pointHCAL << " direction " << trkDir[i].directionHCAL << " "
280  << (HcalDetId)(trkDir[i].detIdHCAL);
281  }
282  edm::LogVerbatim("IsoTrack") << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL
283  << ")" << st1.str() << " HCAL (" << trkDir[i].okHCAL << ")" << st2.str() << " Or "
284  << (HcalDetId)(trkDir[i].detIdEHCAL);
285  }
286  }
287  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
TrackQuality
track quality
Definition: TrackBase.h:150
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:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
#define debug
Definition: HDRShower.cc:19
reco::TrackCollection::const_iterator trkItr
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateCALO() [4/7]

spr::propagatedTrackID spr::propagateCALO ( const reco::Track pTrack,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 289 of file CaloPropagateTrack.cc.

References funct::abs(), Calorimetry_cff::bField, debug, 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().

292  {
296 
298  vdet.ok = true;
299  vdet.detIdECAL = DetId(0);
300  vdet.detIdHCAL = DetId(0);
301  vdet.detIdEHCAL = DetId(0);
302  if (debug)
303  edm::LogVerbatim("IsoTrack") << "Propagate track: p " << pTrack->p() << " eta " << pTrack->eta() << " phi "
304  << pTrack->phi() << " Flag " << vdet.ok;
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  if (debug) {
330  edm::LogVerbatim("IsoTrack") << "propagateCALO:: for 1 track";
331  std::ostringstream st1;
332  if (vdet.detIdECAL.subdetId() == EcalBarrel) {
333  st1 << (EBDetId)(vdet.detIdECAL);
334  } else {
335  st1 << (EEDetId)(vdet.detIdECAL);
336  }
337  edm::LogVerbatim("IsoTrack") << "Track [0] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") " << st1.str()
338  << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or "
339  << (HcalDetId)(vdet.detIdEHCAL);
340  }
341  return vdet;
342  }
Log< level::Info, true > LogVerbatim
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 p() const
momentum vector magnitude
Definition: TrackBase.h:631
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
virtual DetId getClosestCell(const GlobalPoint &r) const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateCALO() [5/7]

std::vector< spr::propagatedGenTrackID > spr::propagateCALO ( const HepMC::GenEvent genEvent,
const 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(), Calorimetry_cff::bField, spr::propagatedGenTrackID::charge, debug, spr::propagatedGenTrackID::detIdECAL, spr::propagatedGenTrackID::detIdEHCAL, spr::propagatedGenTrackID::detIdHCAL, spr::propagatedGenTrackID::directionECAL, spr::propagatedGenTrackID::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, etaBEHcal, ALCARECOTkAlBeamHalo_cff::etaMax, genWeightsTable_cfi::genEvent, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, mps_fire::i, info(), spr::propagatedGenTrackID::ok, spr::propagatedGenTrackID::okECAL, spr::propagatedGenTrackID::okHCAL, AlCaHLTBitMon_ParallelJobs::p, spr::propagatedGenTrackID::pdgId, point, spr::propagatedGenTrackID::pointECAL, spr::propagatedGenTrackID::pointHCAL, propagateCalo(), rFrontEB, rFrontHB, spr::propagatedGenTrackID::trkItr, bphysicsOniaDQM_cfi::vertex, zFrontEE, and zFrontHE.

349  {
353 
354  std::vector<spr::propagatedGenTrackID> trkDir;
355  unsigned int indx;
356  HepMC::GenEvent::particle_const_iterator p;
357  for (p = genEvent->particles_begin(), indx = 0; p != genEvent->particles_end(); ++p, ++indx) {
359  trkD.trkItr = p;
360  trkD.detIdECAL = DetId(0);
361  trkD.detIdHCAL = DetId(0);
362  trkD.detIdEHCAL = DetId(0);
363  trkD.pdgId = ((*p)->pdg_id());
364  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge()) / 3;
365  const GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
366  if (debug)
367  edm::LogVerbatim("IsoTrack") << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge
368  << " p " << momentum;
369  // consider stable particles
370  if ((*p)->status() == 1 && std::abs((*p)->momentum().eta()) < etaMax) {
371  const GlobalPoint vertex = GlobalPoint(0.1 * (*p)->production_vertex()->position().x(),
372  0.1 * (*p)->production_vertex()->position().y(),
373  0.1 * (*p)->production_vertex()->position().z());
374  trkD.ok = true;
377  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
378  trkD.okECAL = info.ok;
379  trkD.pointECAL = point;
380  trkD.directionECAL = info.direction;
381  if (trkD.okECAL) {
382  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
383  trkD.detIdECAL = barrelGeom->getClosestCell(point);
384  } else {
385  if (endcapGeom)
386  trkD.detIdECAL = endcapGeom->getClosestCell(point);
387  else
388  trkD.okECAL = false;
389  }
390  trkD.detIdEHCAL = gHB->getClosestCell(point);
391  }
392 
395  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
396  trkD.okHCAL = info.ok;
397  trkD.pointHCAL = point;
398  trkD.directionHCAL = info.direction;
399  if (trkD.okHCAL) {
400  trkD.detIdHCAL = gHB->getClosestCell(point);
401  }
402  }
403  trkDir.push_back(trkD);
404  }
405  if (debug) {
406  edm::LogVerbatim("IsoTrack") << "propagateCALO:: for " << trkDir.size() << " tracks";
407  for (unsigned int i = 0; i < trkDir.size(); ++i) {
408  std::ostringstream st1, st2;
409  if (trkDir[i].okECAL) {
410  st1 << " point " << trkDir[i].pointECAL << " direction " << trkDir[i].directionECAL << " ";
411  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
412  st1 << (EBDetId)(trkDir[i].detIdECAL);
413  } else {
414  st1 << (EEDetId)(trkDir[i].detIdECAL);
415  }
416  }
417  st2 << " HCAL (" << trkDir[i].okHCAL << ")";
418  if (trkDir[i].okHCAL) {
419  st2 << " point " << trkDir[i].pointHCAL << " direction " << trkDir[i].directionHCAL << " "
420  << (HcalDetId)(trkDir[i].detIdHCAL);
421  }
422  edm::LogVerbatim("IsoTrack") << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL
423  << ")" << st1.str() << st2.str() << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL);
424  }
425  }
426  return trkDir;
427  }
Log< level::Info, true > LogVerbatim
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:24
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:17
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateCALO() [6/7]

std::vector< spr::propagatedGenParticleID > spr::propagateCALO ( edm::Handle< reco::GenParticleCollection > &  genParticles,
const ParticleDataTable pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

Definition at line 429 of file CaloPropagateTrack.cc.

References funct::abs(), Calorimetry_cff::bField, spr::propagatedGenParticleID::charge, debug, spr::propagatedGenParticleID::detIdECAL, spr::propagatedGenParticleID::detIdEHCAL, spr::propagatedGenParticleID::detIdHCAL, spr::propagatedGenParticleID::directionECAL, spr::propagatedGenParticleID::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, PV3DBase< T, PVType, FrameType >::eta(), etaBEEcal, etaBEHcal, ALCARECOTkAlBeamHalo_cff::etaMax, AJJGenJetFilter_cfi::genParticles, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, mps_fire::i, info(), spr::propagatedGenParticleID::ok, spr::propagatedGenParticleID::okECAL, spr::propagatedGenParticleID::okHCAL, AlCaHLTBitMon_ParallelJobs::p, spr::propagatedGenParticleID::pdgId, point, spr::propagatedGenParticleID::pointECAL, spr::propagatedGenParticleID::pointHCAL, propagateCalo(), rFrontEB, rFrontHB, spr::propagatedGenParticleID::trkItr, bphysicsOniaDQM_cfi::vertex, zFrontEE, and zFrontHE.

434  {
438 
439  std::vector<spr::propagatedGenParticleID> trkDir;
440  unsigned int indx;
441  reco::GenParticleCollection::const_iterator p;
442  for (p = genParticles->begin(), indx = 0; p != genParticles->end(); ++p, ++indx) {
444  trkD.trkItr = p;
445  trkD.detIdECAL = DetId(0);
446  trkD.detIdHCAL = DetId(0);
447  trkD.detIdEHCAL = DetId(0);
448  trkD.pdgId = (p->pdgId());
449  trkD.charge = p->charge();
450  const GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
451  if (debug)
452  edm::LogVerbatim("IsoTrack") << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge
453  << " p " << momentum;
454  // consider stable particles
455  if (p->status() == 1 && std::abs(momentum.eta()) < etaMax) {
456  const GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
457  trkD.ok = true;
460  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
461  trkD.okECAL = info.ok;
462  trkD.pointECAL = point;
463  trkD.directionECAL = info.direction;
464  if (trkD.okECAL) {
465  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
466  trkD.detIdECAL = barrelGeom->getClosestCell(point);
467  } else {
468  if (endcapGeom)
469  trkD.detIdECAL = endcapGeom->getClosestCell(point);
470  else
471  trkD.okECAL = false;
472  }
473  trkD.detIdEHCAL = gHB->getClosestCell(point);
474  }
475 
478  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
479  trkD.okHCAL = info.ok;
480  trkD.pointHCAL = point;
481  trkD.directionHCAL = info.direction;
482  if (trkD.okHCAL) {
483  trkD.detIdHCAL = gHB->getClosestCell(point);
484  }
485  }
486  trkDir.push_back(trkD);
487  }
488  if (debug) {
489  edm::LogVerbatim("IsoTrack") << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
490  for (unsigned int i = 0; i < trkDir.size(); ++i) {
491  std::ostringstream st1, st2;
492  if (trkDir[i].okECAL) {
493  st1 << " point " << trkDir[i].pointECAL << " direction " << trkDir[i].directionECAL << " ";
494  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
495  st1 << (EBDetId)(trkDir[i].detIdECAL);
496  } else {
497  st1 << (EEDetId)(trkDir[i].detIdECAL);
498  }
499  }
500  st2 << " HCAL (" << trkDir[i].okHCAL << ")";
501  if (trkDir[i].okHCAL) {
502  st2 << " point " << trkDir[i].pointHCAL << " direction " << trkDir[i].directionHCAL << " "
503  << (HcalDetId)(trkDir[i].detIdHCAL);
504  }
505  edm::LogVerbatim("IsoTrack") << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL
506  << ")" << st1.str() << st2.str() << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL);
507  }
508  }
509  return trkDir;
510  }
Log< level::Info, true > LogVerbatim
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
T eta() const
Definition: PV3DBase.h:73
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:17
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateCALO() [7/7]

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 512 of file CaloPropagateTrack.cc.

References funct::abs(), Calorimetry_cff::bField, debug, spr::propagatedTrackDirection::detIdECAL, spr::propagatedTrackDirection::detIdEHCAL, spr::propagatedTrackDirection::detIdHCAL, spr::propagatedTrackDirection::directionECAL, spr::propagatedTrackDirection::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, info(), spr::propagatedTrackDirection::ok, spr::propagatedTrackDirection::okECAL, spr::propagatedTrackDirection::okHCAL, point, spr::propagatedTrackDirection::pointECAL, spr::propagatedTrackDirection::pointHCAL, propagateCalo(), rFrontEB, rFrontHB, simTrackAtOrigin(), DetId::subdetId(), trk, zFrontEE, and zFrontHE.

517  {
521 
522  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
524  trkD.ok = trk.ok;
525  trkD.detIdECAL = DetId(0);
526  trkD.detIdHCAL = DetId(0);
527  trkD.detIdEHCAL = DetId(0);
528  if (debug)
529  edm::LogVerbatim("IsoTrack") << "Propagate track " << thisTrk << " charge " << trk.charge << " position "
530  << trk.position << " p " << trk.momentum << " Flag " << trkD.ok;
531  if (trkD.ok) {
533  trk.position, trk.momentum, trk.charge, bField, spr::zFrontEE, spr::rFrontEB, spr::etaBEEcal, debug);
534  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
535  trkD.okECAL = info.ok;
536  trkD.pointECAL = point;
537  trkD.directionECAL = info.direction;
538  if (trkD.okECAL) {
539  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
540  trkD.detIdECAL = barrelGeom->getClosestCell(point);
541  } else {
542  if (endcapGeom)
543  trkD.detIdECAL = endcapGeom->getClosestCell(point);
544  else
545  trkD.okECAL = false;
546  }
547  trkD.detIdEHCAL = gHB->getClosestCell(point);
548  }
549 
551  trk.position, trk.momentum, trk.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
552  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
553  trkD.okHCAL = info.ok;
554  trkD.pointHCAL = point;
555  trkD.directionHCAL = info.direction;
556  if (trkD.okHCAL) {
557  trkD.detIdHCAL = gHB->getClosestCell(point);
558  }
559  }
560  if (debug) {
561  edm::LogVerbatim("IsoTrack") << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL ("
562  << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")";
563  std::ostringstream st1;
564  if (trkD.okECAL) {
565  st1 << "ECAL point " << trkD.pointECAL << " direction " << trkD.directionECAL << " ";
566  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
567  st1 << (EBDetId)(trkD.detIdECAL);
568  } else {
569  st1 << (EEDetId)(trkD.detIdECAL);
570  }
571  }
572  if (trkD.okHCAL) {
573  st1 << " HCAL point " << trkD.pointHCAL << " direction " << trkD.directionHCAL << " "
574  << (HcalDetId)(trkD.detIdHCAL);
575  }
576  if (trkD.okECAL)
577  st1 << " Or " << (HcalDetId)(trkD.detIdEHCAL);
578  edm::LogVerbatim("IsoTrack") << st1.str();
579  }
580  return trkD;
581  }
Log< level::Info, true > LogVerbatim
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
Trktree trk
Definition: Trktree.cc:2
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateCalo()

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 796 of file CaloPropagateTrack.cc.

References funct::abs(), alongMomentum, Reference_intrackfit_cff::barrel, Calorimetry_cff::bField, Plane::build(), Cylinder::build(), TCMET_cfi::corner, debug, PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), M_PI, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), AnalyticalPropagator::propagate(), DiDispStaMuonMonitor_cfi::pt, CosmicsPD_Skims::radius, funct::sin(), mathSSE::sqrt(), HLT_2024v14_cff::track, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and TCMET_cfi::zdist.

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

803  {
805  if (debug)
806  edm::LogVerbatim("IsoTrack") << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge "
807  << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner;
808  FreeTrajectoryState fts(tpVertex, tpMomentum, tpCharge, bField);
809 
812 
815 
817 
819  if (tpMomentum.eta() < 0) {
820  tsose = myAP.propagate(fts, *lendcap);
821  } else {
822  tsose = myAP.propagate(fts, *rendcap);
823  }
824 
825  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
826 
827  track.ok = true;
828  if (tsose.isValid() && tsosb.isValid()) {
829  float absEta = std::abs(tsosb.globalPosition().eta());
830  if (absEta < corner) {
831  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
832  track.direction = tsosb.globalDirection();
833  } else {
834  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
835  track.direction = tsose.globalDirection();
836  }
837  } else if (tsose.isValid()) {
838  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
839  track.direction = tsose.globalDirection();
840  } else if (tsosb.isValid()) {
841  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
842  track.direction = tsosb.globalDirection();
843  } else {
844  track.point.SetXYZ(-999., -999., -999.);
845  track.direction = GlobalVector(0, 0, 1);
846  track.ok = false;
847  }
848  if (debug) {
849  edm::LogVerbatim("IsoTrack") << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid()
850  << " OverAll " << track.ok << " Point " << track.point << " Direction "
851  << track.direction;
852  if (track.ok) {
853  math::XYZPoint vDiff(
854  track.point.x() - tpVertex.x(), track.point.y() - tpVertex.y(), track.point.z() - tpVertex.z());
855  double dphi = track.direction.phi() - tpMomentum.phi();
856  double rdist = std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
857  double pt = tpMomentum.perp();
858  double rat = 0.5 * dphi / std::sin(0.5 * dphi);
859  edm::LogVerbatim("IsoTrack") << "RDist " << rdist << " pt " << pt << " r/pt " << rdist * rat / pt << " zdist "
860  << vDiff.z() << " pz " << tpMomentum.z() << " z/pz " << vDiff.z() / tpMomentum.z()
861  << std::endl;
862  }
863  }
864  return track;
865  }
Log< level::Info, true > LogVerbatim
T z() const
Definition: PV3DBase.h:61
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T eta() const
Definition: PV3DBase.h:73
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
#define debug
Definition: HDRShower.cc:19
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
GlobalVector globalDirection() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ propagateCosmicCALO()

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(), Calorimetry_cff::bField, ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), debug, 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, bphysicsOniaDQM_cfi::vertex, X, beamSpotPI::Y, and beamSpotPI::Z.

24  {
28  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
29  std::vector<spr::propagatedTrackID> vdets;
30 
31  unsigned int indx;
32  reco::TrackCollection::const_iterator trkItr;
33  for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
34  const reco::Track* pTrack = &(*trkItr);
36  vdet.trkItr = trkItr;
37  vdet.ok = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack->quality(trackQuality_)) : true;
38  vdet.detIdECAL = DetId(0);
39  vdet.detIdHCAL = DetId(0);
40  vdet.detIdEHCAL = DetId(0);
41  if (debug)
42  edm::LogVerbatim("IsoTrack") << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta()
43  << " phi " << trkItr->phi() << " Flag " << vdet.ok;
45  GlobalVector momentum;
46  int charge(pTrack->charge());
47  if (((pTrack->innerPosition()).Perp2()) < ((pTrack->outerPosition()).Perp2())) {
49  ((pTrack->innerPosition()).X()), ((pTrack->innerPosition()).Y()), ((pTrack->innerPosition()).Z()));
50  momentum = GlobalVector(
51  ((pTrack->innerMomentum()).X()), ((pTrack->innerMomentum()).Y()), ((pTrack->innerMomentum()).Z()));
52  } else {
54  ((pTrack->outerPosition()).X()), ((pTrack->outerPosition()).Y()), ((pTrack->outerPosition()).Z()));
55  momentum = GlobalVector(
56  ((pTrack->outerMomentum()).X()), ((pTrack->outerMomentum()).Y()), ((pTrack->outerMomentum()).Z()));
57  }
58  if (debug)
59  edm::LogVerbatim("IsoTrack") << "Track charge " << charge << " p " << momentum << " position " << vertex;
60  std::pair<math::XYZPoint, bool> info = spr::propagateECAL(vertex, momentum, charge, bField, debug);
61  if (debug)
62  edm::LogVerbatim("IsoTrack") << "Propagate to ECAL " << info.second << " at (" << info.first.x() << ", "
63  << info.first.y() << ", " << info.first.z() << ")";
64 
65  vdet.okECAL = info.second;
66  if (vdet.okECAL) {
67  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
68  vdet.etaECAL = point.eta();
69  vdet.phiECAL = point.phi();
70  if (std::abs(point.eta()) < spr::etaBEEcal) {
71  vdet.detIdECAL = barrelGeom->getClosestCell(point);
72  } else {
73  if (endcapGeom)
74  vdet.detIdECAL = endcapGeom->getClosestCell(point);
75  else
76  vdet.okECAL = false;
77  }
78  vdet.detIdEHCAL = gHB->getClosestCell(point);
79  if (debug) {
80  std::ostringstream st1;
81  if (std::abs(point.eta()) < spr::etaBEEcal)
82  st1 << EBDetId(vdet.detIdECAL);
83  else
84  st1 << EEDetId(vdet.detIdECAL);
85  edm::LogVerbatim("IsoTrack") << "Point at ECAL (" << vdet.etaECAL << ", " << vdet.phiECAL << " " << st1.str()
86  << " " << HcalDetId(vdet.detIdEHCAL);
87  }
88  }
90  if (debug)
91  edm::LogVerbatim("IsoTrack") << "Propagate to HCAL " << info.second << " at (" << info.first.x() << ", "
92  << info.first.y() << ", " << info.first.z() << ")";
93  vdet.okHCAL = info.second;
94  if (vdet.okHCAL) {
95  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
96  vdet.etaHCAL = point.eta();
97  vdet.phiHCAL = point.phi();
98  vdet.detIdHCAL = gHB->getClosestCell(point);
99  }
100  if (debug) {
101  std::ostringstream st1;
102  if (vdet.detIdECAL.subdetId() == EcalBarrel)
103  st1 << (EBDetId)(vdet.detIdECAL);
104  else
105  st1 << (EEDetId)(vdet.detIdECAL);
106  edm::LogVerbatim("IsoTrack") << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") "
107  << st1.str() << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL)
108  << " Or " << (HcalDetId)(vdet.detIdEHCAL);
109  }
110  vdets.push_back(vdet);
111  }
112 
113  if (debug) {
114  edm::LogVerbatim("IsoTrack") << "propagateCALO:: for " << vdets.size() << " tracks";
115  for (unsigned int i = 0; i < vdets.size(); ++i) {
116  std::ostringstream st1;
117  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
118  st1 << (EBDetId)(vdets[i].detIdECAL);
119  } else {
120  st1 << (EEDetId)(vdets[i].detIdECAL);
121  }
122  edm::LogVerbatim("IsoTrack") << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL
123  << ") " << st1.str() << " HCAL (" << vdets[i].okHCAL << ") "
124  << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL);
125  }
126  }
127  return vdets;
128  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
Log< level::Info, true > LogVerbatim
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
TrackQuality
track quality
Definition: TrackBase.h:150
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:38
reco::TrackCollection::const_iterator trkItr
int charge() const
track electric charge
Definition: TrackBase.h:596
Abs< T >::type abs(const T &t)
Definition: Abs.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:48
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:17
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
#define debug
Definition: HDRShower.cc:19
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateECAL() [1/2]

std::pair< math::XYZPoint, bool > spr::propagateECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 660 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, debug, HLT_2024v14_cff::track, and bphysicsOniaDQM_cfi::vertex.

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

660  {
661  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
662  const GlobalVector momentum(track->px(), track->py(), track->pz());
663  int charge(track->charge());
664  return spr::propagateECAL(vertex, momentum, charge, bfield, debug);
665  }
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
#define debug
Definition: HDRShower.cc:19

◆ propagateECAL() [2/2]

std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 693 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, debug, etaBEEcal, propagateCalo(), rFrontEB, HLT_2024v14_cff::track, bphysicsOniaDQM_cfi::vertex, and zFrontEE.

694  {
697  return std::pair<math::XYZPoint, bool>(track.point, track.ok);
698  }
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

◆ propagateHCAL() [1/5]

std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 720 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, debug, HLT_2024v14_cff::track, and bphysicsOniaDQM_cfi::vertex.

Referenced by chargeIsolationHcal(), HcalHBHEMuonAnalyzer::goodCell(), HcalHBHEMuonHighEtaAnalyzer::goodCell(), AlCaHcalHBHEMuonProducer::goodCell(), propagateCALO(), propagateCosmicCALO(), and propagateHCAL().

720  {
721  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
722  const GlobalVector momentum(track->px(), track->py(), track->pz());
723  int charge(track->charge());
724  return spr::propagateHCAL(vertex, momentum, charge, bfield, debug);
725  }
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
#define debug
Definition: HDRShower.cc:19

◆ propagateHCAL() [2/5]

std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 727 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, debug, etaBEHcal, propagateCalo(), rFrontHB, HLT_2024v14_cff::track, bphysicsOniaDQM_cfi::vertex, and zFrontHE.

728  {
731  return std::pair<math::XYZPoint, bool>(track.point, track.ok);
732  }
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

◆ propagateHCAL() [3/5]

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 904 of file CaloPropagateTrack.cc.

References Calorimetry_cff::bField, ALCARECOTkAlJpsiMuMu_cff::charge, debug, convertSQLiteXML::ok, propagateHCAL(), HLT_2024v14_cff::track, and bphysicsOniaDQM_cfi::vertex.

909  {
910  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
911  const GlobalVector momentum(track->px(), track->py(), track->pz());
912  int charge(track->charge());
913  if (debug)
914  edm::LogVerbatim("IsoTrack") << "Propagate track with charge " << charge << " position " << vertex << " p "
915  << momentum;
916  std::pair<HcalDetId, HcalDetId> ids = propagateHCAL(geo, bField, vertex, momentum, charge, typeRZ, rz, debug);
917  bool ok = ((ids.first != HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
918  (ids.first.iphi() == ids.second.iphi()));
919  return ok;
920  }
Log< level::Info, true > LogVerbatim
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
#define debug
Definition: HDRShower.cc:19

◆ propagateHCAL() [4/5]

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 922 of file CaloPropagateTrack.cc.

References Calorimetry_cff::bField, debug, convertSQLiteXML::ok, propagateHCAL(), simTrackAtOrigin(), and trk.

929  {
930  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
931  if (debug)
932  edm::LogVerbatim("IsoTrack") << "Propagate track " << thisTrk << " charge " << trk.charge << " position "
933  << trk.position << " p " << trk.momentum;
934  std::pair<HcalDetId, HcalDetId> ids =
935  propagateHCAL(geo, bField, trk.position, trk.momentum, trk.charge, typeRZ, rz, debug);
936  bool ok = ((ids.first != HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
937  (ids.first.iphi() == ids.second.iphi()));
938  return ok;
939  }
Log< level::Info, true > LogVerbatim
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
Trktree trk
Definition: Trktree.cc:2
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

◆ propagateHCAL() [5/5]

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 941 of file CaloPropagateTrack.cc.

References alongMomentum, Reference_intrackfit_cff::barrel, Calorimetry_cff::bField, Plane::build(), Cylinder::build(), ALCARECOTkAlJpsiMuMu_cff::charge, debug, makeMuonMisalignmentScenario::endcap, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), TrajectoryStateOnSurface::globalPosition(), DetId::Hcal, HcalBarrel, globals_cff::id1, globals_cff::id2, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), TrajectoryStateOnSurface::isValid(), isotrackApplyRegressor::k, M_PI, point, AnalyticalPropagator::propagate(), and bphysicsOniaDQM_cfi::vertex.

948  {
949  if (debug)
950  edm::LogVerbatim("IsoTrack") << "propagateCalo:: Vertex " << vertex << " Momentum " << momentum << " Charge "
951  << charge << " R/Z " << rz.first << " : " << rz.second << " Type " << typeRZ;
953  FreeTrajectoryState fts(vertex, momentum, charge, bField);
955 
956  HcalDetId id1, id2;
957  for (int k = 0; k < 2; ++k) {
959  double rzv = (k == 0) ? rz.first : rz.second;
960  if (typeRZ) {
963  tsos = myAP.propagate(fts, *barrel);
964  } else {
966  tsos = myAP.propagate(fts, *endcap);
967  }
968 
969  if (tsos.isValid()) {
971  if (k == 0)
972  id1 = gHB->getClosestCell(point);
973  else
974  id2 = gHB->getClosestCell(point);
975  if (debug) {
976  std::ostringstream st1;
977  if (k == 0)
978  st1 << id1;
979  else
980  st1 << id2;
981  edm::LogVerbatim("IsoTrack") << "Iteration " << k << " Point " << point << " ID " << st1.str();
982  }
983  }
984  }
985  if (debug)
986  edm::LogVerbatim("IsoTrack") << "propagateCalo:: Front " << id1 << " Back " << id2;
987  return std::pair<HcalDetId, HcalDetId>(id1, id2);
988  }
Log< level::Info, true > LogVerbatim
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
GlobalPoint globalPosition() const
virtual DetId getClosestCell(const GlobalPoint &r) const
#define M_PI
#define debug
Definition: HDRShower.cc:19
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateHCALBack() [1/2]

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 583 of file CaloPropagateTrack.cc.

References Calorimetry_cff::bField, debug, spr::propagatedTrackDirection::detIdECAL, spr::propagatedTrackDirection::detIdEHCAL, spr::propagatedTrackDirection::detIdHCAL, spr::propagatedTrackDirection::directionHCAL, etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, info(), spr::propagatedTrackDirection::ok, spr::propagatedTrackDirection::okECAL, spr::propagatedTrackDirection::okHCAL, point, spr::propagatedTrackDirection::pointHCAL, propagateCalo(), rBackHB, simTrackAtOrigin(), trk, and zBackHE.

Referenced by HcalHBHEMuonAnalyzer::analyze(), HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(), and AlCaHcalHBHEMuonProducer::produce().

588  {
590  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
592  trkD.ok = trk.ok;
593  trkD.detIdECAL = DetId(0);
594  trkD.detIdHCAL = DetId(0);
595  trkD.detIdEHCAL = DetId(0);
596  if (debug)
597  edm::LogVerbatim("IsoTrack") << "Propagate track " << thisTrk << " charge " << trk.charge << " position "
598  << trk.position << " p " << trk.momentum << " Flag " << trkD.ok;
599  if (trkD.ok) {
601  trk.position, trk.momentum, trk.charge, bField, spr::zBackHE, spr::rBackHB, spr::etaBEHcal, debug);
602  const GlobalPoint point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
603  trkD.okHCAL = info.ok;
604  trkD.pointHCAL = point;
605  trkD.directionHCAL = info.direction;
606  if (trkD.okHCAL) {
607  trkD.detIdHCAL = gHB->getClosestCell(point);
608  }
609  }
610  if (debug) {
611  std::ostringstream st1;
612  if (trkD.okHCAL) {
613  st1 << " HCAL point " << trkD.pointHCAL << " direction " << trkD.directionHCAL << " "
614  << (HcalDetId)(trkD.detIdHCAL);
615  }
616  edm::LogVerbatim("IsoTrack") << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL ("
617  << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << st1.str();
618  }
619  return trkD;
620  }
Log< level::Info, true > LogVerbatim
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Trktree trk
Definition: Trktree.cc:2
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:17
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateHCALBack() [2/2]

std::pair< bool, HcalDetId > spr::propagateHCALBack ( const reco::Track track,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 622 of file CaloPropagateTrack.cc.

References Calorimetry_cff::bField, ALCARECOTkAlJpsiMuMu_cff::charge, debug, etaBEHcal, CaloSubdetectorGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, info(), point, propagateCalo(), rBackHB, HLT_2024v14_cff::track, bphysicsOniaDQM_cfi::vertex, and zBackHE.

625  {
627  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
628  const GlobalVector momentum(track->px(), track->py(), track->pz());
629  int charge(track->charge());
632  if (info.ok) {
633  const GlobalPoint point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
634  return std::pair<bool, HcalDetId>(true, HcalDetId(gHB->getClosestCell(point)));
635  } else {
636  return std::pair<bool, HcalDetId>(false, HcalDetId());
637  }
638  }
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)
static const double rBackHB
Definition: CaloConstants.h:17
virtual DetId getClosestCell(const GlobalPoint &r) const
#define debug
Definition: HDRShower.cc:19
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateIdECAL()

std::pair< DetId, bool > spr::propagateIdECAL ( const HcalDetId id,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 667 of file CaloPropagateTrack.cc.

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

670  {
671  const HcalGeometry* gHB = static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, HcalBarrel));
672  const GlobalPoint vertex(0, 0, 0);
673  const GlobalPoint hit(gHB->getPosition(id));
674  const GlobalVector momentum = GlobalVector(hit.x(), hit.y(), hit.z());
675  std::pair<math::XYZPoint, bool> info = propagateECAL(vertex, momentum, 0, bField, debug);
676  DetId eId(0);
677  if (info.second) {
678  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
679  if (std::abs(point.eta()) < spr::etaBEEcal) {
681  eId = barrelGeom->getClosestCell(point);
682  } else {
684  if (endcapGeom)
685  eId = endcapGeom->getClosestCell(point);
686  else
687  info.second = false;
688  }
689  }
690  return std::pair<DetId, bool>(eId, info.second);
691  }
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)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
GlobalPoint getPosition(const DetId &id) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*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

◆ propagateTracker()

std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 734 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, debug, etaBETrak, propagateCalo(), rBackTB, HLT_2024v14_cff::track, bphysicsOniaDQM_cfi::vertex, and zBackTE.

734  {
735  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
736  const GlobalVector momentum(track->px(), track->py(), track->pz());
737  int charge(track->charge());
738  spr::propagatedTrack track1 =
740  return std::pair<math::XYZPoint, bool>(track1.point, track1.ok);
741  }
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)
static const double rBackTB
Definition: CaloConstants.h:22
#define debug
Definition: HDRShower.cc:19
static const double etaBETrak
Definition: CaloConstants.h:23

◆ propagateTrackerEnd()

std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

Definition at line 743 of file CaloPropagateTrack.cc.

References funct::abs(), alongMomentum, Reference_intrackfit_cff::barrel, Calorimetry_cff::bField, Plane::build(), Cylinder::build(), ALCARECOTkAlJpsiMuMu_cff::charge, debug, makeMuonMisalignmentScenario::endcap, TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), M_PI, convertSQLiteXML::ok, PV3DBase< T, PVType, FrameType >::phi(), point, AnalyticalPropagator::propagate(), CosmicsPD_Skims::radius, funct::sin(), mathSSE::sqrt(), HLT_2024v14_cff::track, bphysicsOniaDQM_cfi::vertex, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), TCMET_cfi::zdist, and zFrontTE.

Referenced by IsolatedTracksNxN::analyze().

745  {
746  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
747  const GlobalVector momentum(track->px(), track->py(), track->pz());
748  int charge(track->charge());
749  float radius = track->outerPosition().Rho();
750  float zdist = track->outerPosition().Z();
751  if (debug)
752  edm::LogVerbatim("IsoTrack") << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum
753  << " Charge " << charge << " Radius " << radius << " Z " << zdist;
754  FreeTrajectoryState fts(vertex, momentum, charge, bField);
758 
760 
761  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
762  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
763 
764  math::XYZPoint point(-999., -999., -999.);
765  bool ok = false;
766  GlobalVector direction(0, 0, 1);
767  if (tsosb.isValid() && std::abs(zdist) < spr::zFrontTE) {
768  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
769  direction = tsosb.globalDirection();
770  ok = true;
771  } else if (tsose.isValid()) {
772  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
773  direction = tsose.globalDirection();
774  ok = true;
775  }
776 
777  double length = -1;
778  if (ok) {
779  math::XYZPoint vDiff(point.x() - vertex.x(), point.y() - vertex.y(), point.z() - vertex.z());
780  double dphi = direction.phi() - momentum.phi();
781  double rdist = std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
782  double rat = 0.5 * dphi / std::sin(0.5 * dphi);
783  double dZ = vDiff.z();
784  double dS = rdist * rat; //dZ*momentum.z()/momentum.perp();
785  length = std::sqrt(dS * dS + dZ * dZ);
786  if (debug)
787  edm::LogVerbatim("IsoTrack") << "propagateTracker:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid()
788  << " OverAll " << ok << " Point " << point << " RDist " << rdist << " dS " << dS
789  << " dS/pt " << rdist * rat / momentum.perp() << " zdist " << dZ << " dz/pz "
790  << dZ / momentum.z() << " Length " << length;
791  }
792 
793  return std::pair<math::XYZPoint, double>(point, length);
794  }
Log< level::Info, true > LogVerbatim
T z() const
Definition: PV3DBase.h:61
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
#define debug
Definition: HDRShower.cc:19
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
static const double zFrontTE
Definition: CaloConstants.h:20
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
GlobalVector globalDirection() const
*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

◆ propagateTrackToECAL() [1/2]

propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 640 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, debug, etaBEEcal, propagateCalo(), rFrontEB, HLT_2024v14_cff::track, bphysicsOniaDQM_cfi::vertex, and zFrontEE.

Referenced by propagateCALO().

640  {
641  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
642  const GlobalVector momentum(track->px(), track->py(), track->pz());
643  int charge(track->charge());
645  }
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

◆ propagateTrackToECAL() [2/2]

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 647 of file CaloPropagateTrack.cc.

References debug, etaBEEcal, propagateCalo(), rFrontEB, simTrackAtOrigin(), trk, and zFrontEE.

651  {
652  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
654  if (trk.ok)
655  ptrk = spr::propagateCalo(
656  trk.position, trk.momentum, trk.charge, bfield, spr::zFrontEE, spr::rFrontEB, spr::etaBEEcal, debug);
657  return ptrk;
658  }
static const double etaBEEcal
Definition: CaloConstants.h:12
Trktree trk
Definition: Trktree.cc:2
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

◆ propagateTrackToHCAL() [1/2]

spr::propagatedTrack spr::propagateTrackToHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 700 of file CaloPropagateTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, debug, etaBEHcal, propagateCalo(), rFrontHB, HLT_2024v14_cff::track, bphysicsOniaDQM_cfi::vertex, and zFrontHE.

Referenced by propagateCALO().

700  {
701  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
702  const GlobalVector momentum(track->px(), track->py(), track->pz());
703  int charge(track->charge());
705  }
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

◆ propagateTrackToHCAL() [2/2]

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 707 of file CaloPropagateTrack.cc.

References debug, etaBEHcal, propagateCalo(), rFrontHB, simTrackAtOrigin(), trk, and zFrontHE.

711  {
712  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
714  if (trk.ok)
715  ptrk = spr::propagateCalo(
716  trk.position, trk.momentum, trk.charge, bfield, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
717  return ptrk;
718  }
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
Trktree trk
Definition: Trktree.cc:2
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

◆ simpleMove()

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 657 of file MatrixECALDetIds.cc.

References hgcalTBTopologyTester_cfi::cells, debug, TauDecayModes::dec, hcalRecHitTable_cff::detId, DeadROC_duringRun::dir, EcalBarrel, EcalEndcap, EcalEndcapGeometry::getClosestBarrelCells(), EcalBarrelGeometry::getClosestEndcapCells(), CaloSubdetectorTopology::getNeighbours(), testProducerWithPsetDescEmpty_cfi::i1, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::ietaAbs(), hcalRecHitTable_cff::iphi, EBDetId::MAX_IETA, convertSQLiteXML::ok, and DetId::subdetId().

Referenced by newECALIdEW(), and newECALIdNS().

666  {
667  DetId cell;
668  ok = 0;
669  if (det.subdetId() == EcalBarrel) {
670  EBDetId detId = det;
671  std::vector<DetId> neighbours = barrelTopo->getNeighbours(detId, dir);
672  if (!neighbours.empty() && !neighbours[0].null()) {
673  cells.push_back(neighbours[0]);
674  cell = neighbours[0];
675  ok = 1;
676  } else {
677  const int ietaAbs(detId.ietaAbs()); // abs value of ieta
678  if (EBDetId::MAX_IETA == ietaAbs && (!ignoreTransition) && endcapGeom) {
679  // get ee nbrs for for end of barrel crystals
681  // take closest neighbour on the other side, that is in the endcap
682  cell = *(ol.begin());
683  neighbours = endcapTopo->getNeighbours(cell, dir);
684  if (!neighbours.empty() && !neighbours[0].null())
685  ok = 1;
686  else
687  ok = -1;
688  for (EcalBarrelGeometry::OrderedListOfEEDetId::const_iterator iptr = ol.begin(); iptr != ol.end(); ++iptr)
689  cells.push_back(*iptr);
690  }
691  }
692  } else if (det.subdetId() == EcalEndcap && endcapGeom) {
693  EEDetId detId = det;
694  std::vector<DetId> neighbours = endcapTopo->getNeighbours(detId, dir);
695  if (!neighbours.empty() && !neighbours[0].null()) {
696  cells.push_back(neighbours[0]);
697  cell = neighbours[0];
698  ok = 1;
699  } else {
700  // are we on the outer ring ?
701  const int iphi(detId.iPhiOuterRing());
702  // int isc = detId.isc();
703  if (iphi != 0 && (!ignoreTransition)) {
704  // get eb nbrs for for end of endcap crystals
706  // take closest neighbour on the other side, that is in the barrel.
707  cell = *(ol.begin());
708  neighbours = barrelTopo->getNeighbours(cell, dir);
709  if (!neighbours.empty() && !neighbours[0].null())
710  ok = 1;
711  else
712  ok = -1;
713  for (EcalEndcapGeometry::OrderedListOfEBDetId::const_iterator iptr = ol.begin(); iptr != ol.end(); ++iptr)
714  cells.push_back(*iptr);
715  }
716  }
717  }
718  if (debug) {
719  std::ostringstream st1;
720  for (unsigned int i1 = 0; i1 < cells.size(); ++i1)
721  st1 << " " << std::hex << cells[0]() << std::dec;
722  edm::LogVerbatim("IsoTrack") << "simpleMove:: Move DetId 0x" << std::hex << det() << std::dec << " along " << dir
723  << " to get 0x" << std::hex << cell() << std::dec << " with flag " << ok << " # "
724  << cells.size() << st1.str();
725  }
726  }
Log< level::Info, true > LogVerbatim
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ietaAbs(uint32_t id)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
static const int MAX_IETA
Definition: EBDetId.h:136
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:24
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const

◆ simTrackAtOrigin()

spr::trackAtOrigin spr::simTrackAtOrigin ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 867 of file CaloPropagateTrack.cc.

References debug, createfilelist::int, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, and trk.

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

870  {
872 
873  edm::SimTrackContainer::const_iterator itr = SimTk->end();
874  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
875  if (simTrkItr->trackId() == thisTrk) {
876  if (debug)
877  edm::LogVerbatim("IsoTrack") << "matched trackId (maximum occurance) " << thisTrk << " type "
878  << simTrkItr->type();
879  itr = simTrkItr;
880  break;
881  }
882  }
883 
884  if (itr != SimTk->end()) {
885  int vertIndex = itr->vertIndex();
886  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
887  edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
888  for (int iv = 0; iv < vertIndex; iv++)
889  simVtxItr++;
890  const math::XYZTLorentzVectorD pos = simVtxItr->position();
891  const math::XYZTLorentzVectorD mom = itr->momentum();
892  trk.ok = true;
893  trk.charge = (int)(itr->charge());
894  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
895  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
896  }
897  }
898  if (debug)
899  edm::LogVerbatim("IsoTrack") << "Track flag " << trk.ok << " Position " << trk.position << " Momentum "
900  << trk.momentum;
901  return trk;
902  }
Log< level::Info, true > LogVerbatim
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
Trktree trk
Definition: Trktree.cc:2
#define debug
Definition: HDRShower.cc:19
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ timeOfFlight()

double spr::timeOfFlight ( DetId  id,
const CaloGeometry geo,
bool  debug = false 
)

Definition at line 15 of file CaloSimInfo.cc.

References funct::abs(), funct::cos(), debug, DetId::Ecal, EcalBarrel, EcalEndcap, PVValHelper::eta, JetChargeProducer_cfi::exp, CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, point, dttmaxenums::R, rFrontEB, rFrontHB, rFrontHO, funct::sin(), tauSpinnerTable_cfi::theta, createJobs::tmp, zFrontEE, zFrontES, zFrontHE, and zFrontHF.

Referenced by ME0HitsValidation::analyze(), ME0DigisValidation::analyze(), and RPCDigiSimLink::RPCDigiSimLink().

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

◆ validSimTrack()

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 135 of file MatchingSimTrack.cc.

References debug, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, and class-composition::parent.

Referenced by matchedSimTrackId(), and matchedSimTrackInfo().

139  {
140  if (debug)
141  edm::LogVerbatim("IsoTrack") << "Inside validSimTrack: trackId " << thisTrkItr->trackId() << " vtxIndex "
142  << thisTrkItr->vertIndex() << " to be matched to " << simTkId;
143 
144  //This track originates from simTkId
145  if (thisTrkItr->trackId() == simTkId)
146  return true;
147 
148  //Otherwise trace back the history using SimTracks and SimVertices
149  int vertIndex = thisTrkItr->vertIndex();
150  if (vertIndex == -1 || vertIndex >= static_cast<int>(SimVtx->size()))
151  return false;
152 
153  edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
154  for (int iv = 0; iv < vertIndex; iv++)
155  simVtxItr++;
156  int parent = simVtxItr->parentIndex();
157  if (debug)
158  edm::LogVerbatim("IsoTrack") << "validSimTrack:: parent index " << parent << " ";
159 
160  if (parent < 0 && simVtxItr != SimVtx->begin()) {
161  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
162  for (simVtxItr = SimVtx->begin(); simVtxItr != SimVtx->end(); ++simVtxItr) {
163  if (simVtxItr->parentIndex() > 0) {
164  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
165  double dist = pos2.P();
166  if (dist < 0.001) {
167  parent = simVtxItr->parentIndex();
168  break;
169  }
170  }
171  }
172  }
173 
174  if (debug)
175  edm::LogVerbatim("IsoTrack") << "final index " << parent;
176  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
177  if (static_cast<int>(simTrkItr->trackId()) == parent && simTrkItr != thisTrkItr)
178  return validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug);
179  }
180 
181  return false;
182  }
Log< level::Info, true > LogVerbatim
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
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

◆ deltaEta

const double spr::deltaEta = 0.087
static

◆ etaBEEcal

const double spr::etaBEEcal = 1.479
static

◆ etaBEHcal

const double spr::etaBEHcal = 1.392
static

◆ etaBETrak

const double spr::etaBETrak = 1.705
static

Definition at line 23 of file CaloConstants.h.

Referenced by propagateTracker().

◆ rBackHB

const double spr::rBackHB = 288.8
static

Definition at line 17 of file CaloConstants.h.

Referenced by propagateHCALBack().

◆ rBackTB

const double spr::rBackTB = 109.0
static

Definition at line 22 of file CaloConstants.h.

Referenced by propagateTracker().

◆ rFrontEB

const double spr::rFrontEB = 129.4
static

◆ rFrontHB

const double spr::rFrontHB = 180.7
static

◆ rFrontHO

const double spr::rFrontHO = 384.8
static

Definition at line 18 of file CaloConstants.h.

Referenced by timeOfFlight().

◆ zBackHE

const double spr::zBackHE = 549.3
static

Definition at line 16 of file CaloConstants.h.

Referenced by propagateHCALBack().

◆ zBackTE

const double spr::zBackTE = 290.0
static

Definition at line 21 of file CaloConstants.h.

Referenced by propagateTracker().

◆ zFrontEE

const double spr::zFrontEE = 319.2
static

◆ zFrontES

const double spr::zFrontES = 303.2
static

Definition at line 11 of file CaloConstants.h.

Referenced by timeOfFlight().

◆ zFrontHE

const double spr::zFrontHE = 402.7
static

◆ zFrontHF

const double spr::zFrontHF = 1115.
static

Definition at line 19 of file CaloConstants.h.

Referenced by timeOfFlight().

◆ zFrontTE

const double spr::zFrontTE = 110.0
static

Definition at line 20 of file CaloConstants.h.

Referenced by propagateTrackerEnd().