CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
spr Namespace Reference

Classes

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

Functions

template<typename T >
energyMap caloSimInfoMatrix (const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, double timeCut=150, bool includeHO=false, bool debug=false)
 
void cGenSimInfo (std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (std::vector< DetId > &vdets, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (int charge, int pdgid, double p, spr::genSimInfo &info, bool debug=false)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &theNavigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string theTrackQuality, bool debug)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &navigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
bool chargeIsolation (const DetId anyCell, CaloNavigator< DetId > &navigator, int deta, int dphi)
 
bool chargeIsolation (const DetId anyCell, std::vector< DetId > &vdets)
 
double chargeIsolationCone (unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
 
double chargeIsolationEcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationEcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationEcal (const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationHcal (reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double coneChargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
 
int coneChargeIsolation (const GlobalPoint &hpoint1, const GlobalPoint &point2, const GlobalVector &trackMom, double dR)
 
void debugEcalDets (unsigned int, const DetId &, bool)
 
void debugEcalDets (unsigned int, std::vector< DetId > &)
 
void debugEcalDets (unsigned int, std::vector< DetId > &, std::vector< CaloDirection > &)
 
void debugHcalDets (unsigned int, std::vector< DetId > &)
 
template<typename T >
void eCaloSimInfo (std::vector< DetId > vdets, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
void eCaloSimInfo (const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool includeHO=false, bool debug=false)
 
std::map< std::string, double > eCaloSimInfo (caloSimInfo &info)
 
template<typename T >
double eCaloSimInfo (const edm::Event &, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
double eCaloSimInfo (const edm::Event &, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eCaloSimInfo (edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, std::vector< int > &multiplicityVector, bool debug=false)
 
template<typename T >
double eCone_ecal (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< DetId > &coneRecHitDetIds, double &distFromHotCell, int &ietaHotCell, int &iphiHotCell, GlobalPoint &gposHotCell, int detOnly=-1, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< DetId > &coneRecHitDetIds, std::vector< double > &eHit, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, std::vector< DetId > &coneRecHitDetIds, double &distFromHotCell, int &ietaHotCell, int &iphiHotCell, GlobalPoint &gposHotCell, int detOnly=-1, bool debug=false)
 
template<typename T >
double eECALmatrix (CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ietaE, int ietaW, int iphiN, int iphiS, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
eECALmatrixCell (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eECALmatrixTotal (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, CaloNavigator< DetId > &navigator, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
energyMap eECALSimInfoMatrix (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfoTotal (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, GlobalPoint &gPosHotCell)
 
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)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det0, edm::Handle< T > &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)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
energyDetIdHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
energyECALCell (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
double energyECALTower (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vNeighboursDetId, std::vector< DetId > &dets, const HcalTopology *topology, edm::Handle< T > &hits, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
void energyHCALCell (HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCALmatrixNew (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool 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_iterator
findCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug)
 
std::vector
< EcalRecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, bool debug=false)
 
std::vector
< EcalRecHitCollection::const_iterator
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)
 
std::vector
< HBHERecHitCollection::const_iterator
findCone (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)
 
template<typename T >
void findHit (edm::Handle< T > &hits, DetId thisDet, std::vector< typename T::const_iterator > &hit, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
findHitCone (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
findHitCone (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, bool debug=false)
 
double getDistInCMatEcal (double eta1, double phi1, double eta2, double phi2, bool debug=false)
 
double getDistInCMatHcal (double eta1, double phi1, double eta2, double phi2, bool debug=false)
 
double getDistInPlaneTrackDir (const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
 
double getEnergy (HBHERecHitCollection::const_iterator hit, bool debug=false)
 
double getEnergy (edm::PCaloHitContainer::const_iterator hit, bool debug=false)
 
EtaPhi getEtaPhi (int ieta, int iphi, bool debug=false)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, int &ieta, int &iphi, bool debug=false)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, int &ieta, int &iphi, bool debug=false)
 
GlobalPoint getGpos (const CaloGeometry *geo, HBHERecHitCollection::const_iterator hit, bool debug=false)
 
GlobalPoint getGpos (const CaloGeometry *geo, edm::PCaloHitContainer::const_iterator hit, bool debug=false)
 
HcalDetId getHotCell (std::vector< HBHERecHitCollection::const_iterator > &hit, bool &includeHO, bool &debug)
 
HcalDetId getHotCell (std::vector< std::vector< PCaloHit >::const_iterator > &hit, bool &includeHO, bool &debug)
 
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::propagatedTrackID
propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, std::vector< spr::propagatedTrackID > &vdets, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, std::vector< spr::propagatedTrackDirection > &trkDir, bool debug=false)
 
spr::propagatedTrackID propagateCALO (const reco::Track *, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
 
std::vector
< spr::propagatedGenTrackID
propagateCALO (const HepMC::GenEvent *genEvent, edm::ESHandle< ParticleDataTable > &pdt, const CaloGeometry *geo, const MagneticField *bField, double etaMax=3.0, bool debug=false)
 
std::vector
< spr::propagatedGenParticleID
propagateCALO (edm::Handle< reco::GenParticleCollection > &genParticles, edm::ESHandle< ParticleDataTable > &pdt, const CaloGeometry *geo, const MagneticField *bField, double etaMax=3.0, bool debug=false)
 
spr::propagatedTrackDirection propagateCALO (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
 
spr::propagatedTrack propagateCalo (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
 
std::vector
< spr::propagatedTrackID
propagateCosmicCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateECAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< 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)
 

Function Documentation

template<typename T >
energyMap spr::caloSimInfoMatrix ( const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
void spr::cGenSimInfo ( std::vector< DetId > &  vdets,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
bool  ifECAL,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 87 of file GenSimInfo.cc.

References spr::genSimInfo::cHadronEne, spr::genSimInfo::cHadronEne_, chargeIsolation(), gather_cfg::cout, spr::genSimInfo::eleEne, citk::for(), i, spr::genSimInfo::isChargedIso, spr::genSimInfo::maxNearP, spr::genSimInfo::muEne, spr::genSimInfo::nHadronEne, AlCaHLTBitMon_ParallelJobs::p, and spr::genSimInfo::photonEne.

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

87  {
88 
89  info.maxNearP=-1.0;
90  info.cHadronEne=info.nHadronEne=info.eleEne=info.muEne=info.photonEne=0.0;
91  info.isChargedIso=true;
92  for (int i=0; i<3; ++i) info.cHadronEne_[i]=0.0;
93  for (unsigned int i=0; i<trackIds.size(); ++i) {
94  HepMC::GenEvent::particle_const_iterator trkItr2 = trackIds[i].trkItr;
95  // avoid the track under consideration
96  if ( (trkItr2 != trkItr) && trackIds[i].ok) {
97  int charge = trackIds[i].charge;
98  int pdgid = trackIds[i].pdgId;
99  double p = (*trkItr2)->momentum().rho();
100  bool isolat= false;
101  if (ifECAL) {
102  const DetId anyCell = trackIds[i].detIdECAL;
103  isolat = spr::chargeIsolation(anyCell,vdets);
104  } else {
105  const DetId anyCell = trackIds[i].detIdHCAL;
106  isolat = spr::chargeIsolation(anyCell,vdets);
107  }
108  if (!isolat) spr::cGenSimInfo(charge, pdgid, p, info, debug);
109  }
110  }
111  if (debug) {
112  std::cout << "Isolation variables: isChargedIso :" << info.isChargedIso
113  << " maxNearP " << info.maxNearP << " Energy e/mu/g/ch/nh "
114  << info.eleEne << "," << info.muEne << "," << info.photonEne
115  << "," << info.cHadronEne << "," << info.nHadronEne
116  << " charge " << info.cHadronEne_[0] << ","
117  << info.cHadronEne_[1] << "," << info.cHadronEne_[2]
118  << std::endl;
119  }
120  }
int i
Definition: DBlmapReader.cc:9
double cHadronEne_[3]
Definition: GenSimInfo.h:47
double photonEne
Definition: GenSimInfo.h:45
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
double cHadronEne
Definition: GenSimInfo.h:45
double nHadronEne
Definition: GenSimInfo.h:45
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
for(const auto &isodef:isoDefs)
double maxNearP
Definition: GenSimInfo.h:44
void spr::cGenSimInfo ( std::vector< DetId > &  vdets,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
bool  ifECAL,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 122 of file GenSimInfo.cc.

References cGenSimInfo(), spr::genSimInfo::cHadronEne, spr::genSimInfo::cHadronEne_, chargeIsolation(), gather_cfg::cout, spr::genSimInfo::eleEne, citk::for(), i, spr::genSimInfo::isChargedIso, spr::genSimInfo::maxNearP, spr::genSimInfo::muEne, spr::genSimInfo::nHadronEne, AlCaHLTBitMon_ParallelJobs::p, and spr::genSimInfo::photonEne.

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

Definition at line 158 of file GenSimInfo.cc.

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

158  {
159 
160  if (pdgid==22 ) info.photonEne += p;
161  else if (pdgid==11) info.eleEne += p;
162  else if (pdgid==13) info.muEne += p;
163  else if (std::abs(charge)>0) {
164  info.isChargedIso = false;
165  info.cHadronEne += p;
166  if (p>1.0) info.cHadronEne_[0] += p;
167  if (p>2.0) info.cHadronEne_[1] += p;
168  if (p>3.0) info.cHadronEne_[2] += p;
169  if (info.maxNearP<p) info.maxNearP=p;
170  } else if (std::abs(charge)==0) {
171  info.nHadronEne += p;
172  }
173  }
double cHadronEne_[3]
Definition: GenSimInfo.h:47
double photonEne
Definition: GenSimInfo.h:45
double cHadronEne
Definition: GenSimInfo.h:45
double nHadronEne
Definition: GenSimInfo.h:45
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double maxNearP
Definition: GenSimInfo.h:44
double spr::chargeIsolation ( const edm::Event iEvent,
const edm::EventSetup iSetup,
CaloNavigator< DetId > &  theNavigator,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloSubdetectorGeometry gEB,
const CaloSubdetectorGeometry gEE,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string  theTrackQuality,
bool  debug 
)

Definition at line 13 of file ChargeIsolationExtra.cc.

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

13  {
14 
15  double maxNearP = -1.0;
17 
18  // const DetId anyCell,
19  reco::TrackCollection::const_iterator trkItr2;
20  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
21 
22  const reco::Track* pTrack2 = &(*trkItr2);
23 
24  bool trkQuality = pTrack2->quality(trackQuality_);
25  if ( (trkItr2 != trkItr) && trkQuality ) {
26 
27  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
28  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
29  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());
30 
31  if (info2.isGoodEcal ) {
32  if (std::abs(point2.eta())<1.479) {
33  const DetId anyCell = gEB->getClosestCell(point2);
34  if (debug) std::cout << "chargeIsolation:: EB cell " << (EBDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
35  if (!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
36  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
37  }
38  } else {
39  const DetId anyCell = gEE->getClosestCell(point2);
40  if (debug) std::cout << "chargeIsolation:: EE cell " << (EEDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
41  if(!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
42  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
43  }
44  }
45  } //info2.isGoodEcal
46  }
47  }
48  return maxNearP;
49  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:133
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:551
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
tuple cout
Definition: gather_cfg.py:121
double spr::chargeIsolation ( const edm::Event iEvent,
const edm::EventSetup iSetup,
CaloNavigator< DetId > &  navigator,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloSubdetectorGeometry gEB,
const CaloSubdetectorGeometry gEE,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)
bool spr::chargeIsolation ( const DetId  anyCell,
CaloNavigator< DetId > &  navigator,
int  deta,
int  dphi 
)

Definition at line 53 of file ChargeIsolationExtra.cc.

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

53  {
54 
55  bool isIsolated = false;
56 
57  DetId thisDet;
58 
59  for (int dx = -ieta; dx < ieta+1; ++dx) {
60  for (int dy = -iphi; dy < iphi+1; ++dy) {
61 
62  thisDet = navigator.offsetBy(dx, dy);
63  navigator.home();
64 
65  if (thisDet != DetId(0)) {
66  if (thisDet == anyCell) {
67  isIsolated = false;
68  return isIsolated;
69  }
70  }
71  }
72  }
73  return isIsolated;
74  }
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
Definition: CaloNavigator.h:80
void home() const
move the navigator back to the starting point
Definition: DetId.h:18
bool spr::chargeIsolation ( const DetId  anyCell,
std::vector< DetId > &  vdets 
)

Definition at line 167 of file ChargeIsolation.cc.

References i.

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

167  {
168  bool isIsolated = true;
169  for (unsigned int i=0; i<vdets.size(); i++){
170  if (anyCell == vdets[i] ) {
171  isIsolated = false;
172  break;
173  }
174  }
175  return isIsolated;
176  }
int i
Definition: DBlmapReader.cc:9
double spr::chargeIsolationCone ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackDirection > &  trkDirs,
double  dR,
int &  nNearTRKs,
bool  debug = false 
)

Definition at line 235 of file ChargeIsolation.cc.

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

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

235  {
236 
237  double maxNearP = -1.0;
238  nNearTRKs = 0;
239  if (trkDirs[trkIndex].okHCAL) {
240  if (debug) std::cout << "chargeIsolationCone with " << trkDirs.size() << " tracks " << std::endl;
241  for (unsigned int indx=0; indx<trkDirs.size(); ++indx) {
242  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
243  int isConeChargedIso = spr::coneChargeIsolation(trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
244  if (isConeChargedIso==0) {
245  nNearTRKs++;
246  const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
247  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
248  }
249  }
250  }
251  }
252  if (debug) std::cout << "chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL << " maxNearP " << maxNearP << std::endl;
253  return maxNearP;
254  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
double coneChargeIsolation(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
double spr::chargeIsolationEcal ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const DetId coreDet,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloGeometry geo,
const CaloTopology caloTopology,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 78 of file ChargeIsolationExtra.cc.

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

78  {
79 
80  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
81  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
82 
83  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
84  if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
85 
86  double maxNearP = -1.0;
88 
89  // const DetId anyCell,
90  reco::TrackCollection::const_iterator trkItr2;
91  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
92 
93  const reco::Track* pTrack2 = &(*trkItr2);
94 
95  bool trkQuality = pTrack2->quality(trackQuality_);
96  if ( (trkItr2 != trkItr) && trkQuality ) {
97 
98  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
99  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
100  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());
101 
102  if (info2.isGoodEcal ) {
103  if (std::abs(point2.eta())<1.479) {
104  const DetId anyCell = barrelGeom->getClosestCell(point2);
105  if (debug) std::cout << "chargeIsolation:: EB cell " << (EBDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
106  if (!spr::chargeIsolation(anyCell,vdets)) {
107  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
108  }
109  } else {
110  const DetId anyCell = endcapGeom->getClosestCell(point2);
111  if (debug) std::cout << "chargeIsolation:: EE cell " << (EEDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
112  if (!spr::chargeIsolation(anyCell,vdets)) {
113  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
114  }
115  }
116  } //info2.isGoodEcal
117  }
118  }
119  return maxNearP;
120  }
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
virtual DetId getClosestCell(const GlobalPoint &r) const
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:133
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:551
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
tuple cout
Definition: gather_cfg.py:121
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 13 of file ChargeIsolation.cc.

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

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

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

Definition at line 43 of file ChargeIsolation.cc.

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

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

Definition at line 124 of file ChargeIsolationExtra.cc.

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

124  {
125 
126  std::vector<DetId> dets(1,ClosestCell);
127 
128  if (debug) std::cout << (HcalDetId) ClosestCell << std::endl;
129 
130  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
131  std::vector<DetId>::iterator it;
132 
133  if (debug) {
134  for (unsigned int i=0; i<vdets.size(); i++) {
135  std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
136  }
137  }
138 
139  double maxNearP = -1.0;
140  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
141 
142  reco::TrackCollection::const_iterator trkItr2;
143  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
144 
145  const reco::Track* pTrack2 = &(*trkItr2);
146 
147  bool trkQuality = pTrack2->quality(trackQuality_);
148  if ( (trkItr2 != trkItr) && trkQuality ) {
149  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
150  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
151  const GlobalPoint point2(info2.trkGlobPosAtHcal.x(),info2.trkGlobPosAtHcal.y(),info2.trkGlobPosAtHcal.z());
152 
153  if (debug) {
154  std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
155  }
156 
157  if (info2.isGoodHcal ) {
158  const DetId anyCell = gHB->getClosestCell(point2);
159  if (debug) std::cout << "chargeIsolation:: HCAL cell " << (HcalDetId)(anyCell) << " for pt " << pTrack2->p() << std::endl;
160  if (!spr::chargeIsolation(anyCell,vdets)) {
161  if(maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
162  }
163  if (debug){
164  std::cout << "maxNearP " << maxNearP << " thisCell "
165  << (HcalDetId)anyCell << " ("
166  << info2.trkGlobPosAtHcal.x() << ","
167  << info2.trkGlobPosAtHcal.y() <<","
168  << info2.trkGlobPosAtHcal.z() <<")" << std::endl;
169  }
170  }
171  }
172  }
173  return maxNearP;
174  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
int i
Definition: DBlmapReader.cc:9
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:133
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:693
math::XYZPoint trkGlobPosAtHcal
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:551
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
tuple cout
Definition: gather_cfg.py:121
double spr::chargeIsolationHcal ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackID > &  vdetIds,
const HcalTopology topology,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 88 of file ChargeIsolation.cc.

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

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

88  {
89 
90  std::vector<DetId> dets(1,vdetIds[trkIndex].detIdHCAL);
91  if (debug) {
92  std::cout << "DetId " << (HcalDetId)(dets[0]) << " Flag " << vdetIds[trkIndex].okHCAL << std::endl;
93  }
94 
95  double maxNearP = -1.0;
96  if (vdetIds[trkIndex].okHCAL) {
97  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
98  if (debug) std::cout << "chargeIsolationHcal:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
99 
100  for (unsigned indx = 0; indx<vdetIds.size(); ++indx) {
101  if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okHCAL) {
102  const DetId anyCell = vdetIds[indx].detIdHCAL;
103  if (!spr::chargeIsolation(anyCell,vdets)) {
104  const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
105  if (debug) std::cout << "chargeIsolationHcal Cell " << (HcalDetId)(anyCell) << " pt " << pTrack->p() << std::endl;
106  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
107  }
108  }
109  }
110  }
111  return maxNearP;
112  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
double spr::chargeIsolationHcal ( reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const DetId  ClosestCell,
const HcalTopology topology,
const CaloSubdetectorGeometry gHB,
const MagneticField bField,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 116 of file ChargeIsolation.cc.

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

116  {
117 
118  std::vector<DetId> dets(1,ClosestCell);
119 
120  if (debug) std::cout << (HcalDetId) ClosestCell << std::endl;
121 
122  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
123  std::vector<DetId>::iterator it;
124 
125  if (debug) {
126  for (unsigned int i=0; i<vdets.size(); i++) {
127  std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
128  }
129  }
130 
131  double maxNearP = -1.0;
132  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
133 
134  reco::TrackCollection::const_iterator trkItr2;
135  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
136 
137  const reco::Track* pTrack2 = &(*trkItr2);
138 
139  bool trkQuality = pTrack2->quality(trackQuality_);
140  if ( (trkItr2 != trkItr) && trkQuality ) {
141  std::pair<math::XYZPoint,bool> info = spr::propagateHCAL(pTrack2,bField);
142  const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());
143 
144  if (debug) {
145  std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
146  }
147 
148  if (info.second) {
149  const DetId anyCell = gHB->getClosestCell(point2);
150  if (!spr::chargeIsolation(anyCell,vdets)) {
151  if(maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
152  }
153  if (debug){
154  std::cout << "maxNearP " << maxNearP << " thisCell "
155  << (HcalDetId)anyCell << " ("
156  << info.first.x() << "," << info.first.y() <<","
157  << info.first.z() << ")" << std::endl;
158  }
159  }
160  }
161  }
162  return maxNearP;
163  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:133
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:693
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:551
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
double spr::coneChargeIsolation ( const edm::Event iEvent,
const edm::EventSetup iSetup,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
std::string  theTrackQuality,
int &  nNearTRKs,
int &  nLayers_maxNearP,
int &  trkQual_maxNearP,
double &  maxNearP_goodTrk,
const GlobalPoint hpoint1,
const GlobalVector trackMom,
double  dR 
)

Definition at line 180 of file ChargeIsolation.cc.

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

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

180  {
181 
182  nNearTRKs=0;
183  nLayers_maxNearP=0;
184  trkQual_maxNearP=-1;
185  maxNearP_goodTrk = -999.0;
186  double maxNearP = -999.0;
187  reco::TrackBase::TrackQuality trackQuality_= reco::TrackBase::qualityByName(theTrackQuality);
188 
189  // Iterate over tracks
190  reco::TrackCollection::const_iterator trkItr2;
191  for( trkItr2 = trkCollection->begin();
192  trkItr2 != trkCollection->end(); ++trkItr2){
193 
194  // Get track
195  const reco::Track* pTrack2 = &(*trkItr2);
196 
197  // Get track qual, nlayers, and hit pattern
198  if (pTrack2->quality(trackQuality_)) trkQual_maxNearP = 1;
199  const reco::HitPattern& hitp = pTrack2->hitPattern();
200  nLayers_maxNearP = hitp.trackerLayersWithMeasurement() ;
201 
202  // Skip if the neighboring track candidate is the iso-track
203  // candidate
204  if (trkItr2 != trkItr) {
205 
206  // Get propagator
207  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
208  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
209 
210  // Make sure it reaches Hcal
211  if (info2.isGoodHcal ) {
212 
213  const GlobalPoint point2(info2.trkGlobPosAtHcal.x(),
214  info2.trkGlobPosAtHcal.y(),
215  info2.trkGlobPosAtHcal.z());
216 
217  int isConeChargedIso = spr::coneChargeIsolation(hpoint1, point2, trackMom, dR);
218 
219  if (isConeChargedIso==0) {
220  nNearTRKs++;
221  if(maxNearP<pTrack2->p()) {
222  maxNearP=pTrack2->p();
223  if (trkQual_maxNearP>0 && nLayers_maxNearP>7 && maxNearP_goodTrk<pTrack2->p()) {
224  maxNearP_goodTrk=pTrack2->p();
225  }
226  }
227  }
228  }
229  }
230  } // Iterate over track loop
231 
232  return maxNearP;
233  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
TrackQuality
track quality
Definition: TrackBase.h:133
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:477
math::XYZPoint trkGlobPosAtHcal
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:384
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:551
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
double coneChargeIsolation(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
int spr::coneChargeIsolation ( const GlobalPoint hpoint1,
const GlobalPoint point2,
const GlobalVector trackMom,
double  dR 
)

Definition at line 257 of file ChargeIsolation.cc.

References getDistInPlaneTrackDir().

257  {
258 
259  int isIsolated = 1;
260  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR) isIsolated = 1;
261  else isIsolated = 0;
262  return isIsolated;
263  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:8
void spr::debugEcalDets ( unsigned int  i,
const DetId det,
bool  flag 
)

Definition at line 11 of file DebugInfo.cc.

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

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

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

Definition at line 26 of file DebugInfo.cc.

References debugEcalDets(), and i.

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

Definition at line 33 of file DebugInfo.cc.

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

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

Definition at line 42 of file DebugInfo.cc.

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

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

42  {
43 
44  for (unsigned int i=last; i<vdets.size(); ++i) {
45  HcalDetId id = vdets[i]();
46  std::cout << "Cell [" << i << "] 0x" << std::hex << vdets[i]()
47  << std::dec << " " << id << std::endl;
48  }
49  }
int i
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:121
template<typename T >
void spr::eCaloSimInfo ( std::vector< DetId vdets,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eCaloSimInfo ( const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
std::map<std::string,double> spr::eCaloSimInfo ( caloSimInfo &  info)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eCaloSimInfo ( edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
std::vector< int > &  multiplicityVector,
bool  debug = false 
)
template<typename T >
double spr::eCone_ecal ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
int  detOnly = -1,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< DetId > &  coneRecHitDetIds,
double &  distFromHotCell,
int &  ietaHotCell,
int &  iphiHotCell,
GlobalPoint gposHotCell,
int  detOnly = -1,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< DetId > &  coneRecHitDetIds,
std::vector< double > &  eHit,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
std::vector< DetId > &  coneRecHitDetIds,
double &  distFromHotCell,
int &  ietaHotCell,
int &  iphiHotCell,
GlobalPoint gposHotCell,
int  detOnly = -1,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalTrigTowerConstituentsMap ttMap,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
std::pair< double, bool > spr::eECALmatrix ( const DetId detId,
edm::Handle< EcalRecHitCollection > &  hitsEB,
edm::Handle< EcalRecHitCollection > &  hitsEE,
const EcalChannelStatus chStatus,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalSeverityLevelAlgo sevlv,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 8 of file eECALMatrix.cc.

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

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

Definition at line 64 of file eECALMatrix.cc.

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

64  {
65 
66  std::vector<DetId> vdets;
67  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
68 
69  const EcalRecHitCollection * recHitsEB = 0;
70  if (hitsEB.isValid()) recHitsEB = hitsEB.product();
71  bool flag = true;
72  if (debug) {
73  std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
74  << " nXtals " << vdets.size() << std::endl;
75  }
76 
77  double energySum = 0.0;
78  for (unsigned int i1=0; i1<vdets.size(); i1++) {
79  if (vdets[i1] != DetId(0)) {
80  double eTower = spr::energyECALTower(vdets[i1], hitsEB, hitsEE, ttMap, debug);
81  bool ok = true;
82  if (vdets[i1].subdetId()==EcalBarrel) ok = (eTower > ebThr);
83  else if (vdets[i1].subdetId()==EcalEndcap) ok = (eTower > eeThr);
84  if (debug) std::cout << "Crystal 0x" <<std::hex << vdets[i1]()
85  <<std::dec << " Flag " << ok;
86  if (ok) {
87  std::vector<EcalRecHitCollection::const_iterator> hit;
88  if (vdets[i1].subdetId()==EcalBarrel) {
89  spr::findHit(hitsEB,vdets[i1],hit,debug);
90 
91  ok = (sevlv->severityLevel(vdets[i1], (*recHitsEB)) != EcalSeverityLevel::kWeird);
92  } else if (vdets[i1].subdetId()==EcalEndcap) {
93  spr::findHit(hitsEE,vdets[i1],hit,debug);
94  }
95  double ener=0;
96  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
97  double en=0, tt=0;
98  if (vdets[i1].subdetId()==EcalBarrel) {
99  if (hit[ihit] != hitsEB->end()) {
100  en = hit[ihit]->energy();
101  tt = hit[ihit]->time();
102  }
103  } else if (vdets[i1].subdetId()==EcalEndcap) {
104  if (hit[ihit] != hitsEE->end()) {
105  en = hit[ihit]->energy();
106  tt = hit[ihit]->time();
107  }
108  }
109  if (debug) std::cout << " " << ihit << " E " << en << " T " << tt;
110  if (tt > tMin && tt < tMax) ener += en;
111  }
112  if (!ok) {
113  flag = false;
114  if (debug) std::cout << " detected to be a spike";
115  }
116  energySum += ener;
117  }
118  if (debug) std::cout << "\n";
119  }
120  }
121  if (debug) std::cout << "energyECAL: energySum = " << energySum << " flag = " << flag << std::endl;
122  return std::pair<double,bool>(energySum,flag);
123  }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
bool isValid() const
Definition: HandleBase.h:75
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
T const * product() const
Definition: Handle.h:81
tuple cout
Definition: gather_cfg.py:121
double energySum(const DataFrame &df, int fs, int ls)
double energyECALTower(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
template<typename T >
std::vector<std::pair<DetId,double> > spr::eECALmatrixCell ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
std::pair<double,int> spr::eECALmatrixTotal ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eECALSimInfo ( const edm::Event ,
CaloNavigator< DetId > &  navigator,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eECALSimInfo ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eECALSimInfo ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eECALSimInfo ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
energyMap spr::eECALSimInfoMatrix ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eECALSimInfoTotal ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
int  itry = -1,
double  timeCut = 150,
bool  debug = false 
)
void spr::eGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 11 of file GenSimInfo.cc.

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

Referenced by IsolatedGenParticles::analyze().

11  {
12 
13  if (debug) std::cout << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
14 
15  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, false);
16  if (debug) spr::debugEcalDets(0, vdets);
17  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
18  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
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 20 of file GenSimInfo.cc.

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

20  {
21 
22  if (debug) std::cout << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
23 
24  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, false);
25  if (debug) spr::debugEcalDets(0, vdets);
26  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
27  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
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 29 of file GenSimInfo.cc.

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

29  {
30 
31  if (debug) std::cout << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
32 
33  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, false);
34  if (debug) spr::debugEcalDets(0, vdets);
35  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
36  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
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 38 of file GenSimInfo.cc.

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

38  {
39 
40  if (debug) std::cout << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
41 
42  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, false);
43  if (debug) spr::debugEcalDets(0, vdets);
44  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
45  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
bool  algoNew = true,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const CaloGeometry geo,
const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
GlobalPoint gPosHotCell 
)
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 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
HcalDetId hotCell,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::vector< std::pair< DetId,double> > spr::eHCALmatrixCell ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
std::pair<double,int> spr::eHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eHCALSimInfo ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::eHCALSimInfo ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::eHCALSimInfo ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eHCALSimInfo ( const edm::Event iEvent,
const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
std::vector< int > &  multiplicityVector,
bool  debug = false 
)
template<typename T >
energyMap spr::eHCALSimInfoMatrix ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eHCALSimInfoTotal ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
int  itry = -1,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::vector<std::pair<DetId,double> > spr::energyDetIdHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyECAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::energyECAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const EcalTrigTowerConstituentsMap ttMap,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
std::vector<std::pair<DetId,double> > spr::energyECALCell ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyECALTower ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const EcalTrigTowerConstituentsMap ttMap,
bool  debug = false 
)

Referenced by eECALmatrix().

template<typename T >
double spr::energyHCAL ( std::vector< DetId > &  vNeighboursDetId,
std::vector< DetId > &  dets,
const HcalTopology topology,
edm::Handle< T > &  hits,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
void spr::energyHCALCell ( HcalDetId  detId,
edm::Handle< T > &  hits,
std::vector< std::pair< double, int > > &  energyCell,
int  maxDepth = 1,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrixNew ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
void spr::extraIds ( const DetId det,
std::vector< DetId > &  dets,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
std::vector< DetId > &  cells,
bool  debug = false 
)

Definition at line 686 of file MatrixECALDetIds.cc.

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

Referenced by matrixECALIds().

690  {
691 
692  if (det.subdetId() == EcalBarrel) {
693  EBDetId id = det;
694  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
695  << "|" << ietaE << " columns " << iphiS << "|"
696  << iphiN << std::endl;
697  int etaC = id.ietaAbs();
698  int phiC = id.iphi();
699  int zsid = id.zside();
700  for (int eta = -ietaW; eta <= ietaE; ++eta) {
701  for (int phi = -iphiS; phi <= iphiN; ++phi) {
702  int iphi = phiC+phi;
703  if (iphi < 0) iphi += 360;
704  else if (iphi > 360) iphi -= 360;
705  int ieta = zsid*(etaC+eta);
706  if (EBDetId::validDetId(ieta,iphi)) {
707  id = EBDetId(ieta,iphi);
708  if (barrelGeom.present(id)) {
709  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
710  cells.push_back((DetId)id);
711  }
712  }
713  }
714  }
715  }
716  } else if (det.subdetId() == EcalEndcap) {
717  EEDetId id = det;
718  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
719  << "|" << ietaE << " columns " << iphiS << "|"
720  << iphiN << std::endl;
721  int ixC = id.ix();
722  int iyC = id.iy();
723  int zsid = id.zside();
724  for (int kx = -ietaW; kx <= ietaE; ++kx) {
725  for (int ky = -iphiS; ky <= iphiN; ++ky) {
726  int ix = ixC+kx;
727  int iy = iyC+ky;
728  if (EEDetId::validDetId(ix,iy,zsid)) {
729  id = EEDetId(ix,iy,zsid);
730  if (endcapGeom.present(id)) {
731  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
732  cells.push_back((DetId)id);
733  }
734  }
735  }
736  }
737  }
738  }
739 
740  if (debug) {
741  std::cout << "extraIds:: finds " << cells.size() << " new cells"
742  << std::endl;
743  spr::debugEcalDets (0, cells);
744  }
745  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
T eta() const
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
virtual bool present(const DetId &id) const
is this detid present in the geometry?
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
void spr::find ( edm::Handle< EcalRecHitCollection > &  hits,
DetId  thisDet,
std::vector< EcalRecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 7 of file FindCaloHit.cc.

Referenced by ParticleDecayDrawer::accept(), ParticleTreeDrawer::accept(), HcalHitFilter::accepts(), DTVDriftCalibration::cellInfo::add(), Measurement::addAffectingEntriesFromOptO(), reco::CompositeCandidate::addDaughter(), reco::NamedCompositeCandidate::addDaughter(), GenParticlePruner::addDaughterRefs(), CRackTrajectoryBuilder::AddHit(), CSCNeutronReader::addHits(), SimpleMetricsUpdator::additionalAlignables(), DummyMetricsUpdator::additionalAlignables(), DummyMetricsUpdator::additionalAlignablesWithDistances(), GenParticlePruner::addMotherRefs(), pat::TriggerEvent::addObjectMatchResult(), SiStripQualityHotStripIdentifier::algoAnalyze(), reco::Conversion::algoByName(), reco::TrackBase::algoByName(), EcalMatacqAnalyzer::analyze(), EcalPnGraphs::analyze(), EcalDumpRaw::analyze(), DTT0Calibration::analyze(), SiStripApvGainBuilderFromTag::analyze(), DTT0CalibrationNew::analyze(), DTNoiseCalibration::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), HcalQIEDataCheck::analyze(), ParticleListDrawer::analyze(), HcalAutoPedestalValidator::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), HLTBTagPerformanceAnalyzer::analyze(), DQMHcalIsoTrackAlCaReco::analyze(), EcalLaserAnalyzer2::analyze(), edmtest::HcalDumpConditions::analyze(), EcalLaserAnalyzer::analyze(), DQMSourcePi0::analyze(), TestPythiaDecays::analyze(), HcalGainsCheck::analyze(), HeavyFlavorValidation::analyze(), TestTrackHits::analyze(), EcalURecHitHists::analyze(), CastorDumpConditions::analyze(), TestOutliers::analyze(), L1TGT::analyze(), HLTAlCa::analyze(), HLTMuonPlotter::analyze(), HcalIsoTrkAnalyzer::analyze(), IsoTrig::analyze(), EcalCosmicsHists::analyze(), IsoTrackCalib::analyze(), IsoTrackCalibration::analyze(), DTDigiTask::analyze(), PrimaryVertexAnalyzer4PUSlimmed::analyze(), any(), CaloTowersCreationAlgo::assignHitEcal(), CSCHitAssociator::associateCSCHitId(), CSCHitAssociator::associateHitId(), TrackerHitAssociator::associateMatchedRecHit(), TrackerHitAssociator::associatePixelRecHit(), RPCHitAssociator::associateRecHit(), TrackerHitAssociator::associateSimpleRecHitCluster(), AlignmentParameterStore::attachCorrelations(), ClusterProducerFP420::badChannel(), ProfilerService::beginPath(), PhysicalPartsTree::beginRun(), PileUpProducer::beginRun(), HLTHiggsSubAnalysis::beginRun(), GctFormatTranslateV35::blockToGctInternEmCand(), CalibrationScanTask::book(), CalibrationTask::book(), EgHLTOfflineSource::bookHistograms(), SiStripFedCabling::buildFedCabling(), SiStripDetVOffBuilder::buildPSUdetIdMap(), PFEGammaAlgo::buildRefinedSuperCluster(), PFECALSuperClusterAlgo::buildSuperCluster(), VirtualJetProducer::JetType::byName(), HLTEcalResonanceFilter::calcShowerShape(), HLTRegionalEcalResonanceFilter::calcShowerShape(), PFEGammaAlgo::calculate_ele_mva(), Basic2DGenericPFlowPositionCalc::calculateAndSetPositionActual(), JetPlusTrackProducerAA::calculateBGtracksJet(), PileUpSubtractor::calculateOrphanInput(), ValidationOptions_cff::calledBycmsRun(), reco::modules::CandCombinerBase::CandCombinerBase(), CastorDbProducer::channelQualityCallback(), HcalDbProducer::channelQualityCallback(), MulticoreRunLumiEventChecker::check(), CSCDCCExaminer::check(), Config::checkImportPermission(), Multi5x5ClusterAlgo::checkMaxima(), GlobalTag.GlobalTag::checkPrefix(), BlockFormatter::CleanUp(), cmsswRelease::cmsswIs44X(), cmsswRelease::cmsswIs52X(), edm::Exception::codeToString(), egammaisolation::EgammaRecHitExtractor::collect(), EgammaTowerIsolationNew< NC >::compute(), PileupJetIdAlgo::computeIdVariables(), HDQMInspectorConfigBase::computeIntegral(), vertexTools::computeSharedTracks(), HCALConfigDB::connect(), FastFedCablingHistosUsingDb::connections(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer(), HiHelperTools::contains(), helpers::contains(), Model::copyMeasurements(), createPayload::copyToWorkflowdir(), SiStripFecCabling::countDevices(), DefaultFFTJetObjectFactory< AbsFFTSpecificScaleCalculator >::create(), cmsHarvester::create_and_check_castor_dir(), edm::SharedResourcesRegistry::createAcquirer(), ESDigitizer::createNoisyList(), LaunchOnCondor::CreateTheCmdFile(), DDfetch(), ParticleDecayDrawer::decay(), gen::Py8InterfaceBase::declareSpecialSettings(), gen::Pythia6Hadronizer::declareSpecialSettings(), Model::deleteOptO(), muonisolation::CaloExtractor::deposit(), SiStripFineDelayHit::detId(), TowerBlockFormatter::DigiToRaw(), SiPixelGainCalibrationAnalysis::doFits(), ThePEG::LesHouchesInterface::doReadEvent(), HLTEcalResonanceFilter::doSelection(), HLTRegionalEcalResonanceFilter::doSelection(), SUSY_HLT_DoubleMuon_Hadronic::dqmBeginRun(), SUSY_HLT_Muon_BJet::dqmBeginRun(), SUSY_HLT_DoubleEle_Hadronic::dqmBeginRun(), SUSY_HLT_Electron_BJet::dqmBeginRun(), SUSY_HLT_alphaT::dqmBeginRun(), SUSY_HLT_DiJet_MET::dqmBeginRun(), SUSY_HLT_MuEle_Hadronic::dqmBeginRun(), SUSY_HLT_Muon_Hadronic::dqmBeginRun(), DTDCSByLumiTask::dqmBeginRun(), SusyPostProcessor::dqmEndJob(), JetMETHLTOfflineClient::dqmEndJob(), DTSegtoRPC::DTSegtoRPC(), RPCLinkSynchroStat::dumpDelays(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::dumpPython(), CaloTowersCreationAlgo::ecalChanStatusForCaloTower(), EcalPreshowerMonitorClient::EcalPreshowerMonitorClient(), EcalListOfFEDSProducer::Egamma(), ESListOfFEDSProducer::Egamma(), CastorDbProducer::electronicsMapCallback(), HcalDbProducer::electronicsMapCallback(), L1ScalersClient::endLuminosityBlock(), GsfVertexTrackCompatibilityEstimator::estimate(), KalmanVertexTrackCompatibilityEstimator< N >::estimate(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), JetPlusTrackCorrector::excludeJta(), edm::ParameterSet::existsAs(), CompositeAlignmentParameters::extractAlignables(), CompositeAlignmentParameters::extractPositionAndLength(), CompositeAlignmentDerivativesExtractor::extractWithMultipleHits(), SiPixelFedCablingMap::fedIds(), VertexFitterResult::fill(), tnp::ProbeFlag::fill(), JetPartonMatcher::fillAlgoritDefinition(), SiPixelActionExecutor::fillFEDErrorSummary(), PhysicsTools::MVATrainer::fillInputVars(), Py8toJetInput::fillJetAlgoInput(), MuonMesh::fillMesh(), JetPartonMatcher::fillPhysicsDefinition(), MuonAnalyzerSBSM::FillPlots(), edm::Principal::fillPrincipal(), CastorShowerLibraryMaker::FillShowerEvent(), SiPixelActionExecutor::fillSummary(), SiStripCommissioningRunTypeFilter::filter(), LogErrorFilter::filter(), HltComparator::filter(), ErrorSummaryFilter::filter(), AlCaHBHEMuonFilter::filter(), AlCaIsoTracksFilter::filter(), HLTEcalResonanceFilter::filter(), HLTRegionalEcalResonanceFilter::filter(), TTUTrackingAlg::filter(), commentSkipper.buildFileCommentSkipper::filterMultilineComment(), commentSkipper.buildFileCommentSkipper::filterOneLineComment(), MuonSeedOrcaPatternRecognition::filterOverlappingChambers(), find(), FourVectorHLT::PathInfoCollection::find(), edm::Trie< T >::find(), HLTInclusiveVBFSource::PathInfoCollection::find(), JetMETHLTOfflineSource::PathInfoCollection::find(), edm::find_in_all(), DTCombinatorialExtendedPatternReco::findCompatibleHits(), SiStripPsuDetIdMap::findDcuIdFromDeviceAddress(), Vispa.Main.Application.Application::findEvent(), GenHFHadronMatcher::findHadronJets(), JetCorrectorParametersCollection::findKey(), MSLayersAtAngle::findLayer(), HLTPerformanceInfo::findModule(), HLTPerformanceInfo::findPath(), JetPlusTrackCorrector::findTrack(), EcalTBReadout::findTTlist(), cond::BlobStreamingService::findVariant(), edm::IndexIntoFile::fixIndexes(), HcalDQMChannelQuality::flagAlgo(), cmsHarvester.CMSHarvester::format_conditions_string(), ecaldqm::DependencySet::formSequence(), ecaldqm::DependencySet::formSequenceFragment_(), XtoFFbarFilter::found(), getRunInfo::Func_FillInfoDBS(), getRunInfo::Func_FillInfoRunRegistry(), CastorDbProducer::gainsCallback(), HcalDbProducer::gainsCallback(), CastorDbProducer::gainWidthsCallback(), HcalDbProducer::gainWidthsCallback(), pkg.AbstractPkg::generate(), SubsystemNeutronReader::generateChamberNoise(), pat::PATGenCandsFromSimTracksProducer::generatorRef_(), GenJetParticleSelector::GenJetParticleSelector(), VertexClassifier::genPrimaryVertices(), TrackClassifier::genPrimaryVertices(), harvestRelVal::get_cond_from_dsetpath(), egHLT::trigTools::getActiveFilters(), EcalSelectiveReadoutProducer::getBinOfMax(), ComponentFactoryByName< B >::getBuilder(), PhysicsTools::MVATrainer::getCalibration(), CastorCalibrationsSet::getCalibrations(), HcalCalibrationsSet::getCalibrations(), HcalCalibrationWidthsSet::getCalibrationWidths(), CastorCalibrationWidthsSet::getCalibrationWidths(), generateWrappers::getClasses(), hcalCalib::GetCoefFromMtrxInvOfAve(), HcalLutManager::getCompressionLutXmlFromAsciiMaster(), HcalLutManager::getCompressionLutXmlFromCoder(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), HLTScalersClient::CountLSFifo_t::getCount(), EgammaHadTower::getDepth1HcalESum(), EgammaHadTower::getDepth2HcalESum(), EcalElectronicsMapping::getDetId(), TrackAssociatorByHitsImpl::getDoubleCount(), QuickTrackAssociatorByHitsImpl::getDoubleCount(), QuickTrackAssociatorByHits::getDoubleCount(), TrackAssociatorByHits::getDoubleCount(), EcalElectronicsMapping::getElectronicsId(), edm::eventsetup::EventSetupsController::getESProducerPSet(), SiPixelActionExecutor::getFEDSummaryME(), SiPixelActionExecutor::getGrandSummaryME(), pat::PATObject< ObjectType >::getKinResolution(), JetCorrectorParametersCollection::getL5Bin(), JetCorrectorParametersCollection::getL7Bin(), BeamSpotWorkflow::getLastUploadedIOV(), HcalLutManager::getLinearizationLutXmlFromAsciiMasterEmap(), HcalLutManager::getLinearizationLutXmlFromCoder(), HcalLutManager::getLinearizationLutXmlFromCoderEmap(), BeamSpotWorkflow::getListOfRunsAndLumiFromDBS(), HcalLutManager::getLutFromXml_old(), HcalLutManager::getLutXmlFromAsciiMaster(), CastorShowerLibraryMaker::GetMissingEnergy(), popcon::EcalPulseCovariancesHandler::getNewObjects(), popcon::EcalPulseShapesHandler::getNewObjects(), LMFCorrCoefDat::getParameters(), SiStripSummary::getPosition(), HDQMSummary::getPosition(), TrackAssociatorByHits::getShared(), TrackAssociatorByHitsImpl::getShared(), PrimaryVertexAnalyzer::getSimPVs(), PrimaryVertexAnalyzer4PU::getSimPVs(), EgammaRecHitIsolation::getSum_(), SiPixelActionExecutor::getSummaryME(), fwlite::MultiChainEvent::getThinnedProducts(), EcalElectronicsMapping::getTriggerElectronicsId(), checkPayloads::getUploadedIOVs(), CastorRawGains::getValues(), HcalRawGains::getValues(), HcalLutManager::getZdcLutXml(), SiStripMonitorTrack::handleBookMEs(), hitfit::Constraint_Intermed_Labels::has_label(), pat::TriggerObjectStandAlone::hasFilterOrCondition(), SiStripHashedDetId::hashedIndex(), pat::PATObject< ObjectType >::hasKinResolution(), pat::PATSingleVertexSelector::hasMode_(), pat::PATObject< ObjectType >::hasOverlaps(), MisalignmentScenarioBuilder::hasParameter_(), pat::TriggerObjectStandAlone::hasPathOrAlgorithm(), pat::Jet::hasSubjets(), pat::PATObject< reco::Muon >::hasUserCand(), pat::PATObject< reco::Muon >::hasUserFloat(), pat::PATObject< reco::Muon >::hasUserInt(), HcalMonitorClient::HcalMonitorClient(), Generator::HepMC2G4(), HepMCSplitter::HepMCSplitter(), HLTMuonTrackMassFilter::hltFilter(), HLTMuonL1RegionalFilter::hltFilter(), HLTMuonL2PreFilter::hltFilter(), HLTMuonL1Filter::hltFilter(), HLTHcalSimpleRecHitFilter::hltFilter(), include(), pat::TriggerPath::indexModule(), MSLayersKeeperX0Averaged::init(), EcalEndcapRecHitsMaker::init(), crabWrap::initCrabEnvironment(), SiStripDetKey::initFromPath(), SiStripFecKey::initFromPath(), SiStripFedKey::initFromPath(), XrdAdaptor::RequestManager::initialize(), HBHEHitMap::insert(), MuonHOAcceptance::isChannelDead(), MuonHOAcceptance::isChannelSiPM(), edm::eventsetup::EventSetupsController::isFirstMatch(), EcalElectronicsMapper::isGhost(), CSCBadChambers::isInBadChamber(), edm::eventsetup::EventSetupsController::isLastMatch(), HcalDQMChannelQuality::isMasked(), edm::eventsetup::EventSetupsController::isMatchingESProducer(), edm::eventsetup::EventSetupsController::isMatchingESSource(), AlignmentParameterSelector::isMemberOfVector(), SiPixelDisabledModules::isModuleDisabled(), EBDetId::isNextToEtaBoundary(), HPDNoiseLibraryReader::IsNoiseApplicable(), heppy::IsolationComputer::isoSumNeutralsWeighted(), heppy::IsolationComputer::isoSumRaw(), RPCCosmicSeedrecHitFinder::isouterLayer(), reco::PFDisplacedVertex::isThereKindTracks(), HLTMuonL2ToL1Map::isTriggeredByL1(), JetCorrectionESChain::JetCorrectionESChain(), pat::JetCorrFactorsProducer::JetCorrFactorsProducer(), EcalListOfFEDSProducer::Jets(), ESListOfFEDSProducer::Jets(), L1MuGMTHWFileReader::L1MuGMTHWFileReader(), HcalDbProducer::L1triggerObjectsCallback(), PerformancePayloadFromBinnedTFormula::limitPos(), PerformancePayloadFromTFormula::limitPos(), CSCGasCollisions::lnEnergyLoss(), DefaultFFTJetRcdMapper< FFTPFJetCorrectorSequence >::load(), L1MuGMTLUT::Load(), edm::service::MessageServicePSetValidation::lookForMatch(), edm::eventsetup::EventSetupsController::lookForMatches(), CommonMethods::ls(), HcalDbProducer::LUTCorrsCallback(), HcalDbProducer::lutMetadataCallback(), reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >::make(), HybridClusterAlgo::makeClusters(), CaloTowersCreationAlgo::makeEcalBadChs(), HSCPValidator::makeGenPlots(), HiBremRecoveryClusterAlgo::makeIslandSuperClusters(), EgammaHLTNxNClusterProducer::makeNxNClusters(), HSCPValidator::makeRecoPlots(), HSCPValidator::makeSimDigiPlotsECAL(), HSCPValidator::makeSimDigiPlotsRPC(), HSCPValidator::makeSimTrackPlots(), CSCHitFromStripOnly::makeStripData(), PhysicsTools::MVATrainer::makeTrainCalibration(), TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks(), DuplicateListMerger::matchCandidateToTrack(), TemplatedSecondaryVertexProducer< IPTI, VTX >::matchGroomedJets(), JetFlavourClustering::matchGroomedJets(), JetPlusTrackCorrector::matchTracks(), PerformancePayloadFromTable::maxPos(), ecaldqm::memDCCIndex(), merge(), CaloTowersMerger::mergedTower(), PerformancePayloadFromTable::minPos(), EcalListOfFEDSProducer::Muon(), ESListOfFEDSProducer::Muon(), ora::PoolDbCache::nameById(), reco::modules::NamedCandCombinerBase::NamedCandCombinerBase(), TFileAdaptor::native(), SequentialCombinationGenerator< T >::next_subset(), ObjectPairFilter< C, S >::ObjectPairFilter(), ObjectSelector< SingleElementCollectionSelector< InputCollection, Selector, reco::CandidateCollection, StoreContainer, RefAdder >, reco::CandidateCollection, NonNullNumberSelector >::ObjectSelector(), ThePEG::LesHouchesInterface::open(), PdgIdSelector::operator()(), StatusSelector::operator()(), PdgIdExcluder::operator()(), rpcrawtodigi::DebugDigisPrintout::operator()(), pat::HLTL1MuonMatcher::operator()(), RecoTrackSelector::operator()(), ReadMapType< std::map< std::string, double > >::operator[](), FFTJetDict< Key, T, Compare, Allocator >::operator[](), edm::DetSetLazyVector< T >::operator[](), edm::DetSetVector< T >::operator[](), cmsHarvester.CMSHarvester::option_handler_input_spec(), TransientVertex::originalTrack(), JetMatchingTools::overlapEnergyFraction(), pat::PATObject< ObjectType >::overlaps(), AlpgenHeader::parameterName(), Args::parse(), AlpgenHeader::parse(), SiStripDbParams::partitionNames(), CastorDbProducer::pedestalsCallback(), HcalDbProducer::pedestalsCallback(), CastorDbProducer::pedestalWidthsCallback(), HcalDbProducer::pedestalWidthsCallback(), HcalDbProducer::PFCorrsCallback(), SelectedElectronFEDListProducer< TEle, TCand >::pixelFedDump(), HDQMInspector::plot(), cond::PayLoadInspector< DataT >::plot(), MatrixInjector.MatrixInjector::prepare(), edm::Principal::Principal(), SiStripConfigDb::printAnalysisDescriptions(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), SiStripConfigDb::printFedDescriptions(), ParticleTreeDrawer::printInfo(), create_public_peakpu_plots::processdata(), DDLNumeric::processElement(), DDLString::processElement(), InterestingEcalDetIdProducer::produce(), JetTracksAssociationDRVertexAssigned::produce(), TtSemiLepJetCombMaxSumPtWMass::produce(), TtDilepEvtSolutionMaker::produce(), QuarkoniaTrackSelector::produce(), GenTrackMatcher::produce(), EcalTPSkimmer::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), StripCompactDigiSimLinksProducer::produce(), EcalListOfFEDSProducer::produce(), ESListOfFEDSProducer::produce(), EgammaHLTCombinedIsolationProducer::produce(), EgammaHLTElectronCombinedIsolationProducer::produce(), TrackListMerger::produce(), SiPixelRawToDigi::produce(), pat::PATJetUpdater::produce(), EleIsoDetIdCollectionProducer::produce(), ReducedRecHitCollectionProducer::produce(), LaserAlignmentT0Producer::produce(), JetSubstructurePacker::produce(), ConversionSeedFilterCharge::produce(), pat::GenPlusSimParticleProducer::produce(), GamIsoDetIdCollectionProducer::produce(), EcalRawToDigi::produce(), pat::PATTauProducer::produce(), pat::PATJetProducer::produce(), CaloTowersMerger::produce(), InterestingTrackEcalDetIdProducer::produce(), ConvBremSeedProducer::produce(), HighPtTrackEcalDetIdProducer::produce(), FlavorHistoryProducer::produce(), MuonMCClassifier::produce(), LaserAlignment::produce(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), ProfilerService::ProfilerService(), SiStripDbParams::pset(), CastorDbProducer::QIEDataCallback(), HcalDbProducer::QIEDataCallback(), HcalDQMChannelQuality::quality(), reco::TrackBase::qualityByName(), SurveyPxbImageReader< T >::read(), l1t::LUT::read(), SiStripTFile::readDQMFormat(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), BeamFitter::readEvent(), L1TdeRCT::readFEDVector(), EcalTBReadout::readOut(), EcalDigiDisplay::readPNDigis(), SiStripDcsInfo::readStatus(), Model::readSystemDescription(), CalorimetryManager::reconstruct(), GenParticlePruner::recursiveFlagDaughters(), GenParticlePruner::recursiveFlagMothers(), TransientVertex::refittedTrack(), ora::PoolDbCache::remove(), HPSPFRecoTauAlgorithm::removeCandidateFromRefVector(), SiPixelDisabledModules::removeDisabledModule(), lhef::LHEEvent::removeResonances(), DDI::LogicalPart::removeSpecifics(), XrdAdaptor::RequestManager::requestFailure(), BtoCharmDecayVertexMerger::resolveBtoDchain(), HcalDbProducer::respCorrsCallback(), PerformancePayloadFromTable::resultPos(), PerformancePayloadFromBinnedTFormula::resultPos(), PerformancePayloadFromTFormula::resultPos(), EcalRecHitWorkerSimple::run(), ecaldqm::IntegrityWriter::run(), ecaldqm::LaserWriter::run(), ecaldqm::PedestalWriter::run(), ecaldqm::PresampleWriter::run(), ecaldqm::TestPulseWriter::run(), ecaldqm::TimingWriter::run(), ecaldqm::LedWriter::run(), ecaldqm::OccupancyWriter::run(), ecaldqm::SummaryWriter::run(), EgHLTOfflineClient::runClient_(), DTLocalTriggerTest::runClientDiagnostic(), DTLocalTriggerTPTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTLocalTriggerEfficiencyTest::runClientDiagnostic(), DTTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerTask::runDDUvsDCCAnalysis(), L1MuDTEtaProcessor::runEtaMatchingUnit(), confdb::runL1Emulator(), edm::search_all(), SeedingLayerSetsBuilder::SeedingLayerSetsBuilder(), reco::FlavorHistorySelectorUtil::select(), AlCaIsoTracksProducer::select(), SiStripBadModuleGenerator::selectDetectors(), EcalMipGraphs::selectHits(), EcalDisplaysByEvent::selectHits(), AlignmentParameterStore::selectParameters(), CastorCalibrationsSet::setCalibrations(), HcalCalibrationsSet::setCalibrations(), HcalCalibrationWidthsSet::setCalibrationWidths(), CastorCalibrationWidthsSet::setCalibrationWidths(), RBCProcessRPCSimDigis::setDigiAt(), RBCProcessRPCDigis::setDigiAt(), EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(), EcalRecHitWorkerSimple::setFlagBits(), GlobalOptionMgr::setGlobalOption(), pat::PATObject< ObjectType >::setKinResolution(), pat::PATObject< ObjectType >::setOverlaps(), EcalFenixFgvbEB::setParameters(), ecaldqm::CalibrationSummaryClient::setParams(), ecaldqm::SummaryClient::setParams(), DDLSolid::setReference(), TtSemiLepKinFitter::setupConstraints(), egHLT::OffHelper::setupTriggers(), HcalSimParameterMap::simParameters(), SiStripFedIdListReader::SiStripFedIdListReader(), CRackTrajectoryBuilder::SortHits(), HLTMuonValidator::stepLabels(), IsoTrig::studyIsolation(), sumSmallDepths(), cond::TBufferBlobTypeInfo::TBufferBlobTypeInfo(), HcalLutManager::test_emap(), HcalDbProducer::timeCorrsCallback(), PasswordReader::tokenize(), EcalSRCondTools::tokenize(), EgammaHadTower::towersOf(), HistoryBase::traceSimHistory(), QcdUeDQM::trackSelection(), trackWeight(), TransientVertex::trackWeight(), pat::TriggerEvent::triggerObjectMatchResult(), PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL(), PFEGammaAlgo::unlinkRefinableObjectKFandECALWithBadEoverP(), PFEGammaAlgo::unwrapSuperCluster(), SimpleMetricsUpdator::update(), MSLayersAtAngle::update(), PedsFullNoiseHistosUsingDb::update(), PedestalsHistosUsingDb::update(), DummyMetricsUpdator::update(), ApvTimingHistosUsingDb::update(), LatencyHistosUsingDb::update(), FineDelayHistosUsingDb::update(), KalmanVertexUpdator< N >::update(), HLTScalersClient::CountLSFifo_t::update(), L1RCTProducer::updateFedVector(), KalmanAlignmentUpdator::updateUserVariables(), KalmanAlignmentSetup::useForExternalTracking(), KalmanAlignmentSetup::useForTracking(), pat::PATObject< ObjectType >::userCand(), pat::PATObject< ObjectType >::userDataObject_(), pat::PATObject< ObjectType >::userFloat(), pat::PATObject< ObjectType >::userInt(), reco::btag::weight(), CSCValHists::writeHists(), DQMRootOutputModule::writeLuminosityBlock(), L1GtPatternWriter::writePatterns(), DQMRootOutputModule::writeRun(), CSCGasCollisions::writeSummary(), HcalDbProducer::zsThresholdsCallback(), and DDLElementRegistry::~DDLElementRegistry().

7  {
8 
9  if (hits->find(thisDet) != hits->end())
10  hit.push_back( hits->find(thisDet) );
11  }
void spr::find ( edm::Handle< HBHERecHitCollection > &  hits,
DetId  thisDet,
std::vector< HBHERecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 13 of file FindCaloHit.cc.

13  {
14 
15  if (hits->find(thisDet) != hits->end())
16  hit.push_back( hits->find(thisDet) );
17  }
void spr::find ( edm::Handle< edm::PCaloHitContainer > &  hits,
DetId  thisDet,
std::vector< edm::PCaloHitContainer::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 19 of file FindCaloHit.cc.

19  {
20 
21  edm::PCaloHitContainer::const_iterator ihit;
22  for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
23  DetId detId(ihit->id());
24  if (detId == thisDet) {
25  hit.push_back(ihit);
26  }
27  }
28  }
Definition: DetId.h:18
std::vector<EcalRecHitCollection::const_iterator> spr::findCone ( const CaloGeometry geo,
edm::Handle< EcalRecHitCollection > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug 
)

Definition at line 10 of file FindCaloHitCone.cc.

References EcalBarrel, EcalEndcap, getDistInPlaneTrackDir(), CaloGeometry::getPosition(), and j.

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

Definition at line 35 of file FindCaloHitCone.cc.

References funct::abs(), gather_cfg::cout, HLT_50ns_5e33_v1_cff::doBarrel, EcalBarrel, EcalEndcap, PV3DBase< T, PVType, FrameType >::eta(), getDistInPlaneTrackDir(), CaloGeometry::getPosition(), and j.

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

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

87  {
88 
89  std::vector<HBHERecHitCollection::const_iterator> hit;
90  // Loop over Hcal RecHits
91  for (HBHERecHitCollection::const_iterator j=hits->begin();
92  j!=hits->end(); j++) {
93  DetId detId(j->id());
94  const GlobalPoint rechitPoint = geo->getPosition(detId);
95  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) hit.push_back(j);
96  }
97  return hit;
98  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:8
std::vector< HBHERecHit >::const_iterator const_iterator
int j
Definition: DBlmapReader.cc:9
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
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 101 of file FindCaloHitCone.cc.

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

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

Definition at line 37 of file DetIdFromEtaPhi.cc.

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

Referenced by findDetIdECAL(), and findDetIdHCAL().

37  {
38 
39  double rcyl = radius*std::sin(theta);
40  double z = radius*std::cos(theta);
41  GlobalPoint point (rcyl*std::cos(phi),rcyl*std::sin(phi),z);
42  const DetId cell = geo->getClosestCell(point);
43  if (debug) {
44  std::cout << "findDetIdCalo: rcyl " << rcyl << " z " << z << " Point " << point << " DetId ";
45  if (cell.det() == DetId::Ecal) {
46  if (cell.subdetId() == EcalBarrel) std::cout << (EBDetId)(cell);
47  else std::cout << (EEDetId)(cell);
48  } else {
49  std::cout << (HcalDetId)(cell);
50  }
51  std::cout << std::endl;
52  }
53  return cell;
54  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
float float float z
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Definition: DDAxes.h:10
const DetId spr::findDetIdECAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 11 of file DetIdFromEtaPhi.cc.

References funct::abs(), funct::cos(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, create_public_lumi_plots::exp, findDetIdCalo(), CaloGeometry::getSubdetectorGeometry(), CosmicsPD_Skims::radius, funct::sin(), and theta().

11  {
12  double radius=0;
13  int subdet=0;
14  double theta=2.0*std::atan(exp(-eta));
15  if (std::abs(eta) > 1.479) {
16  radius = 319.2/std::abs(std::cos(theta));
17  subdet = EcalEndcap;
18  } else {
19  radius = 129.4/std::sin(theta);
20  subdet = EcalBarrel;
21  }
23  if (debug) std::cout << "findDetIdECAL: eta " << eta << " theta " << theta <<" phi " << phi << " radius " << radius << " subdet " << subdet << std::endl;
24  return spr::findDetIdCalo (gECAL, theta, phi, radius, debug);
25  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const DetId findDetIdCalo(const CaloSubdetectorGeometry *geo, double theta, double phi, double radius, bool debug=false)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
T eta() const
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
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
const DetId spr::findDetIdHCAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 27 of file DetIdFromEtaPhi.cc.

References funct::abs(), funct::cos(), gather_cfg::cout, create_public_lumi_plots::exp, findDetIdCalo(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, CosmicsPD_Skims::radius, funct::sin(), and theta().

27  {
28  double radius=0;
29  double theta=2.0*std::atan(exp(-eta));
30  if (std::abs(eta) > 1.392) radius = 402.7/std::abs(std::cos(theta));
31  else radius = 180.7/std::sin(theta);
33  if (debug) std::cout << "findDetIdHCAL: eta " << eta <<" theta "<<theta<< " phi " << phi << " radius " << radius << std::endl;
34  return spr::findDetIdCalo (gHCAL, theta, phi, radius, debug);
35  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const DetId findDetIdCalo(const CaloSubdetectorGeometry *geo, double theta, double phi, double radius, bool debug=false)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
T eta() const
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
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
template<typename T >
std::vector<typename T::const_iterator> spr::findHit ( edm::Handle< T > &  hits,
DetId  thisDet,
bool  debug = false 
)

Referenced by eECALmatrix().

template<typename T >
void spr::findHit ( edm::Handle< T > &  hits,
DetId  thisDet,
std::vector< typename T::const_iterator > &  hit,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::findHitCone ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::findHitCone ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
bool  debug = false 
)
double spr::getDistInCMatEcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2,
bool  debug = false 
)

Definition at line 41 of file FindDistCone.cc.

References funct::cos(), gather_cfg::cout, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, mathSSE::sqrt(), and detailsBasic3DVector::z.

42  {
43 
44  double dR, Rec;
45  if (fabs(eta1)<1.479) Rec=129;
46  else Rec=317;
47  double ce1=cosh(eta1);
48  double ce2=cosh(eta2);
49  double te1=tanh(eta1);
50  double te2=tanh(eta2);
51 
52  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
53  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
54  else dR=999999.;
55  if (debug) std::cout << "getDistInCMatEcal: between (" << eta1 << ", "
56  << phi1 << ") and (" << eta2 << ", " << phi2 << " is "
57  << dR << std::endl;
58  return dR;
59  }
float float float z
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
double spr::getDistInCMatHcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2,
bool  debug = false 
)

Definition at line 63 of file FindDistCone.cc.

References funct::cos(), gather_cfg::cout, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, mathSSE::sqrt(), and detailsBasic3DVector::z.

64  {
65 
66  // Radii and eta from Geometry/HcalCommonData/data/hcalendcapalgo.xml
67  // and Geometry/HcalCommonData/data/hcalbarrelalgo.xml
68 
69  double dR, Rec;
70  if (fabs(eta1)<1.392) Rec=177.5;
71  else Rec=391.95;
72  double ce1=cosh(eta1);
73  double ce2=cosh(eta2);
74  double te1=tanh(eta1);
75  double te2=tanh(eta2);
76 
77  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
78  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
79  else dR=999999.;
80  return dR;
81  if (debug) std::cout << "getDistInCMatHcal: between (" << eta1 << ", "
82  << phi1 << ") and (" << eta2 << ", " << phi2 << " is "
83  << dR << std::endl;
84  }
float float float z
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
double spr::getDistInPlaneTrackDir ( const GlobalPoint caloPoint,
const GlobalVector caloVector,
const GlobalPoint rechitPoint,
bool  debug = false 
)

Definition at line 8 of file FindDistCone.cc.

References gather_cfg::cout, 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().

8  {
9 
10  const GlobalVector caloIntersectVector(caloPoint.x(),
11  caloPoint.y(),
12  caloPoint.z()); //p
13 
14  const GlobalVector caloUnitVector = caloVector.unit();
15  const GlobalVector rechitVector(rechitPoint.x(),
16  rechitPoint.y(),
17  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(effectiveRechitVector.x(),
24  effectiveRechitVector.y(),
25  effectiveRechitVector.z());
26  GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
27  if (debug) {
28  std::cout << "getDistInPlaneTrackDir: point " << caloPoint << " dirn "
29  << caloVector << " numerator " << dotprod_numerator
30  << " denominator " << dotprod_denominator << " distance "
31  << distance_vector.mag() << std::endl;
32  }
33  if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
34  return distance_vector.mag();
35  } else {
36  return 999999.;
37  }
38  }
T y() const
Definition: PV3DBase.h:63
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
Vector3DBase unit() const
Definition: Vector3DBase.h:57
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:62
double spr::getEnergy ( HBHERecHitCollection::const_iterator  hit,
bool  debug = false 
)

Definition at line 140 of file FindDistCone.cc.

Referenced by getHotCell(), and HLTGenericFilter< T1 >::hltFilter().

140  {
141  return hit->energy();
142  }
double spr::getEnergy ( edm::PCaloHitContainer::const_iterator  hit,
bool  debug = false 
)

Definition at line 148 of file FindDistCone.cc.

References HcalBarrel, and HcalEndcap.

148  {
149  // This will not yet handle Ecal CaloHits!!
150  double samplingWeight = 1.;
151  // Hard coded sampling weights from JFH analysis of iso tracks
152  // Sept 2009.
153  HcalDetId detId(hit->id());
154  if (detId.subdet() == HcalBarrel)
155  samplingWeight = 114.1;
156  else if (detId.subdet() == HcalEndcap)
157  samplingWeight = 167.3;
158  else {
159  // ONLY protection against summing HO, HF simhits
160  return 0.;
161  }
162 
163  return samplingWeight*hit->energy();
164  }
unsigned int id
spr::EtaPhi spr::getEtaPhi ( int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 6 of file FindEtaPhi.cc.

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

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

Definition at line 86 of file FindDistCone.cc.

86  {
87 
88  RH_ieta.push_back(hit->id().ieta());
89  RH_iphi.push_back(hit->id().iphi());
90  RH_ene.push_back(hit->energy());
91  }
unsigned int id
void spr::getEtaPhi ( edm::PCaloHitContainer::const_iterator  hit,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
bool  debug = false 
)

Definition at line 93 of file FindDistCone.cc.

93  {
94  // SimHit function not yet implemented.
95  RH_ieta.push_back(-9);
96  RH_iphi.push_back(-9);
97  RH_ene.push_back(-9.);
98  }
void spr::getEtaPhi ( HBHERecHitCollection::const_iterator  hit,
int &  ieta,
int &  iphi,
bool  debug = false 
)

Definition at line 107 of file FindDistCone.cc.

108  {
109  ieta = hit->id().ieta();
110  iphi = hit->id().iphi();
111  }
unsigned int id
void spr::getEtaPhi ( edm::PCaloHitContainer::const_iterator  hit,
int &  ieta,
int &  iphi,
bool  debug = false 
)

Definition at line 113 of file FindDistCone.cc.

References DetId::Ecal, EcalBarrel, and DetId::Hcal.

114  {
115  DetId id = DetId(hit->id());
116  if (id.det() == DetId::Hcal) {
117  ieta = ((HcalDetId)(hit->id())).ieta();
118  iphi = ((HcalDetId)(hit->id())).iphi();
119  } else if (id.det() == DetId::Ecal && id.subdetId() == EcalBarrel) {
120  ieta = ((EBDetId)(id)).ieta();
121  iphi = ((EBDetId)(id)).iphi();
122  } else {
123  ieta = 999;
124  iphi = 999;
125  }
126  }
unsigned int id
Definition: DetId.h:18
GlobalPoint spr::getGpos ( const CaloGeometry geo,
HBHERecHitCollection::const_iterator  hit,
bool  debug = false 
)

Definition at line 166 of file FindDistCone.cc.

References CaloGeometry::getPosition().

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

Definition at line 171 of file FindDistCone.cc.

References CaloGeometry::getPosition().

171  {
172  DetId detId(hit->id());
173  return geo->getPosition(detId);
174  }
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
unsigned int id
Definition: DetId.h:18
HcalDetId spr::getHotCell ( std::vector< HBHERecHitCollection::const_iterator > &  hit,
bool &  includeHO,
bool &  debug 
)

Definition at line 9 of file eHCALMatrix.cc.

References relval_parameters_module::energy, newFWLiteAna::found, getEnergy(), and HcalOuter.

9  {
10 
11  std::vector<HcalDetId> dets;
12  std::vector<double> energies;
13  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
14  double energy = getEnergy(hit.at(ihit));
15  HcalDetId id0 = hit.at(ihit)->id();
16  if ((id0.subdet() != HcalOuter) || includeHO) {
17  HcalDetId id1(id0.subdet(),id0.ieta(),id0.iphi(),1);
18  bool found(false);
19  for (unsigned int idet=0; idet<dets.size(); ++idet) {
20  if (id1 == dets[idet]) {
21  energies[idet] += energy;
22  found = true;
23  break;
24  }
25  }
26  if (!found) {
27  dets.push_back(id1);
28  energies.push_back(energy);
29  }
30  }
31  }
32  double energyMax(-99.);
33  HcalDetId hotCell;
34  for (unsigned int ihit=0; ihit<dets.size(); ihit++) {
35  if (energies[ihit] > energyMax) {
36  energyMax = energies[ihit];
37  hotCell = dets[ihit];
38  }
39  }
40  return hotCell;
41  }
double getEnergy(HBHERecHitCollection::const_iterator hit, bool debug=false)
unsigned int id
HcalDetId spr::getHotCell ( std::vector< std::vector< PCaloHit >::const_iterator > &  hit,
bool &  includeHO,
bool &  debug 
)

Definition at line 43 of file eHCALMatrix.cc.

References relval_parameters_module::energy, newFWLiteAna::found, HcalOuter, hit::id, HcalDetId::ieta(), HcalDetId::iphi(), and HcalDetId::subdet().

43  {
44 
45  std::vector<HcalDetId> dets;
46  std::vector<double> energies;
47  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
48  double energy = hit.at(ihit)->energy();
49  HcalDetId id0 = hit.at(ihit)->id();
50  if ((id0.subdet() != HcalOuter) || includeHO) {
51  HcalDetId id1(id0.subdet(),id0.ieta(),id0.iphi(),1);
52  bool found(false);
53  for (unsigned int idet=0; idet<dets.size(); ++idet) {
54  if (id1 == dets[idet]) {
55  energies[idet] += energy;
56  found = true;
57  break;
58  }
59  }
60  if (!found) {
61  dets.push_back(id1);
62  energies.push_back(energy);
63  }
64  }
65  }
66  double energyMax(-99.);
67  HcalDetId hotCell;
68  for (unsigned int ihit=0; ihit<dets.size(); ihit++) {
69  if (energies[ihit] > energyMax) {
70  energyMax = energies[ihit];
71  hotCell = dets[ihit];
72  }
73  }
74  return hotCell;
75  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:30
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
unsigned int id
int iphi() const
get the cell iphi
Definition: HcalDetId.h:38
bool spr::goodTrack ( const reco::Track pTrack,
math::XYZPoint  leadPV,
spr::trackSelectionParameters  parameters,
bool  debug = false 
)

Definition at line 8 of file TrackSelection.cc.

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

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

8  {
9 
10  bool select = pTrack->quality(parameters.minQuality);
11  double dxy = pTrack->dxy(leadPV);
12  double dz = pTrack->dz(leadPV);
13  double dpbyp = 999;
14  if (std::abs(pTrack->qoverp()) > 0.0000001)
15  dpbyp = std::abs(pTrack->qoverpError()/pTrack->qoverp());
16 
17  if (debug) std::cout << "Track:: Pt " << pTrack->pt() << " dxy " << dxy << " dz " << dz << " Chi2 " << pTrack->normalizedChi2() << " dpbyp " << dpbyp << " Quality " << select << std::endl;
18 
19  if (pTrack->pt() < parameters.minPt) select = false;
20  if (dxy > parameters.maxDxyPV || dz > parameters.maxDzPV) select = false;
21  if (pTrack->normalizedChi2() > parameters.maxChi2) select = false;
22  if (dpbyp > parameters.maxDpOverP) select = false;
23 
24  if (parameters.minLayerCrossed>0 || parameters.minOuterHit>0) {
25  const reco::HitPattern& hitp = pTrack->hitPattern();
26  if (parameters.minLayerCrossed>0 && hitp.trackerLayersWithMeasurement() < parameters.minLayerCrossed) select = false;
27  if (parameters.minOuterHit>0 && (hitp.stripTOBLayersWithMeasurement()+hitp.stripTECLayersWithMeasurement() ) < parameters.minOuterHit) select = false;
28  if (debug) {
29  std::cout << "Default Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::TRACK_HITS) << " hits" << std::endl;
30  for (int i=0; i<hitp.numberOfHits(reco::HitPattern::TRACK_HITS); i++)
32  }
33  }
34  if (parameters.maxInMiss >= 0) {
35  const reco::HitPattern& hitp = pTrack->hitPattern();
37  if (debug) {
38  std::cout << "Inner Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::MISSING_INNER_HITS) << " hits" << std::endl;
41  }
42  }
43  if (parameters.maxOutMiss >= 0) {
44  const reco::HitPattern& hitp = pTrack->hitPattern();
46  if (debug) {
47  std::cout << "Outer Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::MISSING_OUTER_HITS) << " hits" << std::endl;
50  }
51  }
52  if (debug) std::cout << "Final Selection Result " << select << std::endl;
53 
54  return select;
55  }
double qoverp() const
q / p
Definition: TrackBase.h:621
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:563
int i
Definition: DBlmapReader.cc:9
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:609
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:477
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:791
double pt() const
track transverse momentum
Definition: TrackBase.h:669
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:805
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:657
#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:384
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:551
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:494
reco::TrackBase::TrackQuality minQuality
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:574
tuple cout
Definition: gather_cfg.py:121
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:639
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:718
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 47 of file GenSimInfo.cc.

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

Referenced by IsolatedGenParticles::analyze().

47  {
48 
49  if (debug) std::cout << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
50 
51  std::vector<DetId> dets;
52  dets.push_back(coreDet);
53  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
54  if (debug) spr::debugHcalDets(0, vdets);
55  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
56  }
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:87
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
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 58 of file GenSimInfo.cc.

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

58  {
59 
60  if (debug) std::cout << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
61 
62  std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, false);
63  if (debug) spr::debugHcalDets(0, vdets);
64  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
65  }
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:87
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
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 67 of file GenSimInfo.cc.

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

67  {
68 
69  if (debug) std::cout << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
70 
71  std::vector<DetId> dets;
72  dets.push_back(coreDet);
73  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
74  if (debug) spr::debugHcalDets(0, vdets);
75  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
76  }
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:87
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
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 78 of file GenSimInfo.cc.

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

78  {
79 
80  if (debug) std::cout << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;
81 
82  std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, false);
83  if (debug) spr::debugHcalDets(0, vdets);
84  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
85  }
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
template<typename T >
void spr::hitECALmatrix ( CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
std::vector< typename T::const_iterator > &  hitlist,
bool  debug = false 
)
template<typename T >
void spr::hitHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
std::vector< typename T::const_iterator > &  hitlist,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::hitHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
std::vector< typename T::const_iterator > &  hitlist,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::hitsHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
std::vector< typename T::const_iterator > &  hitlist,
bool  debug = false 
)
template<typename T >
DetId spr::hotCrystal ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Referenced by ElectronStudy::analyze().

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

Definition at line 10 of file MatchingSimTrack.cc.

References TrackerHitAssociator::associateHit(), gather_cfg::cout, newFWLiteAna::found, i, j, reco::Track::recHitsBegin(), and reco::Track::recHitsEnd().

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

10  {
11 
12  edm::SimTrackContainer::const_iterator itr = SimTk->end();;
13 
14  edm::SimTrackContainer::const_iterator simTrkItr;
15  edm::SimVertexContainer::const_iterator simVtxItr;
16 
17  //Get the vector of PsimHits associated to TrackerRecHits and select the
18  //matching SimTrack on the basis of maximum occurance of trackIds
19  std::vector<unsigned int> trkId, trkOcc;
20  int i=0;
21  for (trackingRecHit_iterator iTrkHit = pTrack->recHitsBegin(); iTrkHit != pTrack->recHitsEnd(); ++iTrkHit, ++i) {
22 
23  std::vector<PSimHit> matchedSimIds = associate.associateHit((**iTrkHit));
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) { trkId.push_back(tkId); trkOcc.push_back(1); }
35  }
36  }
37 
38  if (debug) {
39  std::cout << "Reconstructed Track with " << i << " recHits.";
40  for (unsigned int isim=0; isim<trkId.size(); isim++){
41  std::cout << "\n trkId " << trkId[isim] << " Occurance " << trkOcc[isim] << ", ";
42  }
43  std::cout << std::endl;
44  }
45 
46  int matchedId=0;
47  unsigned int matchSimTrk=0;
48  if (trkOcc.size() > 0) {
49  unsigned int maxTrkOcc=0, idxMax=0;
50  for(unsigned int j=0; j<trkOcc.size(); j++) {
51  if(trkOcc[j] > maxTrkOcc ) { maxTrkOcc = trkOcc[j]; idxMax = j; }
52  }
53  matchSimTrk = trkId[idxMax];
54  for (simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
55  if ( simTrkItr->trackId() == matchSimTrk ) {
56  matchedId = simTrkItr->type();
57  if (debug) std::cout << "matched trackId (maximum occurance) " << matchSimTrk << " type " << matchedId << std::endl;
58  itr = simTrkItr;
59  break;
60  }
61  }
62  }
63 
64  if (matchedId==0 && debug) {
65  std::cout << "Could not find matched SimTrk and track history now " << std::endl;
66  }
67 
68  return itr;
69  }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
#define debug
Definition: HDRShower.cc:19
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
tuple cout
Definition: gather_cfg.py:121
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
std::vector< int > spr::matchedSimTrackId ( const edm::Event iEvent,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
bool  debug = false 
)

Definition at line 72 of file MatchingSimTrack.cc.

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

72  {
73 
74  // get the matching SimTrack
75  edm::SimTrackContainer::const_iterator trkInfo = spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack,associate, debug);
76  unsigned int matchSimTrk = trkInfo->trackId();
77  if (debug) std::cout << "matchedSimTrackId finds the SimTrk ID of the current track to be " << matchSimTrk << std::endl;
78 
79  std::vector<int> matchTkid;
80  if( trkInfo->type() != 0) {
81  edm::SimTrackContainer::const_iterator simTrkItr;
82  for(simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
83  if (validSimTrack(matchSimTrk, simTrkItr, SimTk, SimVtx, false))
84  matchTkid.push_back((int)simTrkItr->trackId());
85  }
86  }
87  return matchTkid;
88  }
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
tuple cout
Definition: gather_cfg.py:121
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::simTkInfo spr::matchedSimTrackInfo ( unsigned int  simTkId,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 90 of file MatchingSimTrack.cc.

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

90  {
92  for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
93  simTrkItr!= SimTk->end(); simTrkItr++) {
94  if (simTkId == simTrkItr->trackId()) {
95  if (spr::validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug)) {
96  info.found = true;
97  info.pdgId = simTrkItr->type();
98  info.charge = simTrkItr->charge();
99  } else {
100  edm::SimTrackContainer::const_iterator parentItr = spr::parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
101  if (debug) {
102  if (parentItr != SimTk->end() ) std::cout << "original parent of " << simTrkItr->trackId() << " " << parentItr->trackId() << ", " << parentItr->type() << std::endl;
103  else std::cout << "original parent of " << simTrkItr->trackId() << " not found" << std::endl;
104  }
105  if (parentItr != SimTk->end()) {
106  info.found = true;
107  info.pdgId = parentItr->type();
108  info.charge = parentItr->charge();
109  }
110  }
111  break;
112  }
113  }
114  return info;
115  }
static const TGPicture * info(bool iBackgroundIsBlack)
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
edm::SimTrackContainer::const_iterator parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
void spr::matrixECALIds ( const DetId det,
int  ieta,
int  iphi,
const CaloGeometry geo,
const CaloTopology caloTopology,
std::vector< DetId > &  vdets,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 14 of file MatrixECALDetIds.cc.

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

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

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

References matrixECALIds().

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

Definition at line 70 of file MatrixECALDetIds.cc.

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

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

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

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

References matrixECALIds().

167  {
168 
169  std::vector<DetId> vdets;
170  spr::matrixECALIds(det, ietaE, ietaW, iphiN, iphiS, geo, caloTopology,
171  vdets, debug, ignoreTransition);
172  return vdets;
173  }
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > spr::matrixHCALIds ( std::vector< DetId > &  dets,
const HcalTopology topology,
int  ieta,
int  iphi,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 12 of file MatrixHCALDetIds.cc.

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

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

14  {
15 
16  if (debug) {
17  std::cout << "matrixHCALIds::Add " << ieta << " rows and " << iphi
18  << " columns of cells for " << dets.size() << " cells"
19  << std::endl;
20  spr::debugHcalDets(0, dets);
21  }
22 
23  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ieta,
24  iphi, debug);
25  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false, ieta,
26  iphi, debug);
27  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
28  if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
29  vdetN.push_back(vdetS[i1]);
30  }
31 
32  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
33 
34  if (debug) {
35  std::cout << "matrixHCALIds::Total number of cells found is "
36  << vdetS.size() << std::endl;
37  spr::debugHcalDets(0, vdetS);
38  }
39  return vdetS;
40  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
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 42 of file MatrixHCALDetIds.cc.

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

45  {
46 
47  HcalDetId hcdet = HcalDetId(det);
48  GlobalPoint core = geo->getPosition(hcdet);
49  std::vector<DetId> dets, vdetx;
50  dets.push_back(det);
51  int ietaphi = (int)(dR/15.0)+1;
52  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ietaphi,
53  ietaphi, includeHO, debug);
54  for (unsigned int i=0; i<vdets.size(); ++i) {
55  HcalDetId hcdet = HcalDetId(vdets[i]);
56  GlobalPoint rpoint = geo->getPosition(hcdet);
57  if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint) < dR) {
58  vdetx.push_back(vdets[i]);
59  }
60  }
61 
62  if (debug) {
63  std::cout << "matrixHCALIds::Final List of cells for dR " << dR
64  << " is with " << vdetx.size() << " from original list of "
65  << vdets.size() << " cells" << std::endl;
66  spr::debugHcalDets(0, vdetx);
67  }
68  return vdetx;
69  }
int i
Definition: DBlmapReader.cc:9
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:8
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
#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)
tuple cout
Definition: gather_cfg.py:121
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 71 of file MatrixHCALDetIds.cc.

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

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

Definition at line 360 of file MatrixHCALDetIds.cc.

References prof2calltree::count, gather_cfg::cout, debugHcalDets(), HcalOuter, gen::n, and HcalTopology::up().

Referenced by matrixHCALIds().

362  {
363 
364  if (debug) {
365  std::cout << "matrixHCALIdsDepth::Add cells with higher depths with HO"
366  << "Flag set to " << includeHO << " to existing "
367  << dets.size() << " cells" << std::endl;
368  spr::debugHcalDets(0, dets);
369  }
370 
371  std::vector<DetId> vdets(dets);
372  for (unsigned int i1=0; i1<dets.size(); i1++) {
373  HcalDetId vdet = dets[i1];
374  for (int idepth = 0; idepth < 3; idepth++) {
375  std::vector<DetId> vUpDetId = topology->up(vdet);
376  if (vUpDetId.size() != 0) {
377  if (includeHO || vUpDetId[0].subdetId() != (int)(HcalOuter)) {
378  int n = std::count(vdets.begin(),vdets.end(),vUpDetId[0]);
379  if (n == 0) {
380  if (debug) std::cout << "matrixHCALIdsDepth:: Depth " << idepth
381  << " " << vdet << " "
382  << (HcalDetId)vUpDetId[0] << std::endl;
383  vdets.push_back(vUpDetId[0]);
384  }
385  }
386  vdet = vUpDetId[0];
387  }
388  }
389  }
390 
391  if (debug) {
392  std::cout << "matrixHCALIdsDepth::Final list contains " << vdets.size()
393  << " cells" << std::endl;
394  spr::debugHcalDets(0, vdets);
395  }
396  return vdets;
397  }
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
virtual std::vector< DetId > up(const DetId &id) const
tuple cout
Definition: gather_cfg.py:121
template<typename T >
std::vector<typename T::const_iterator> spr::missedCaloHits ( edm::Handle< T > &  hits,
std::vector< int >  matchedId,
std::vector< typename T::const_iterator >  caloHits,
bool  flag,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::missedECALHits ( const edm::Event ,
CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
bool  flag,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::missedHCALHits ( const edm::Event ,
const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
bool  flag,
bool  includeHO = false,
bool  debug = false 
)
std::vector< DetId > spr::newECALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
int  ieta,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 475 of file MatrixECALDetIds.cc.

References prof2calltree::count, gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, archive::flag, prof2calltree::last, simpleMove(), and WEST.

Referenced by newECALIdEW(), and newECALIdNS().

481  {
482 
483  if (debug) {
484  std::cout << "newECALIdEW::Add " << ieta << " rows of cells for "
485  << last << ":" << dets.size() << ":" << (dets.size()-last)
486  << " cells" << std::endl;
487  spr::debugEcalDets (last, dets, dir);
488  }
489 
490  std::vector<DetId> vdets; vdets.clear();
491  std::vector<CaloDirection> dirs; dirs.clear();
492  vdets.insert(vdets.end(), dets.begin(), dets.end());
493  dirs.insert(dirs.end(), dir.begin(), dir.end());
494 
495  if (ieta > 0) {
496  for (unsigned int i1=last; i1<dets.size(); i1++) {
497  int flag = 0;
498  std::vector<DetId> cells;
499  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
500  barrelGeom, endcapGeom, cells, flag,
501  debug, ignoreTransition);
502  if (flag != 0) {
503  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
504  CaloDirection dirn = dir[i1];
505  if (flag < 0) {
506  if (dirn == EAST) dirn = WEST;
507  else dirn = EAST;
508  }
509  vdets.push_back(cells[0]);
510  dirs.push_back(dirn);
511  }
512  }
513  }
514  ieta--;
515  }
516 
517  if (debug) {
518  std::cout << "newECALIdEW::Addition results a set of "
519  << (vdets.size()-dets.size()) << " new cells" << std::endl;
520  spr::debugEcalDets (dets.size(), vdets, dirs);
521  }
522 
523  if (ieta > 0) {
524  last = dets.size();
525  return spr::newECALIdEW(vdets, last, ieta, dirs, barrelTopo, endcapTopo,
526  barrelGeom, endcapGeom, debug, ignoreTransition);
527  } else {
528  if (debug) {
529  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
530  << " cells" << std::endl;
531  spr::debugEcalDets (0, vdets);
532  }
533  return vdets;
534  }
535  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > spr::newECALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
std::vector< int > &  ietaE,
std::vector< int > &  ietaW,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 537 of file MatrixECALDetIds.cc.

References prof2calltree::count, gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, archive::flag, prof2calltree::last, newECALIdEW(), simpleMove(), and WEST.

545  {
546 
547  if (debug) {
548  std::cout << "newECALIdEW::Add " << ietaE[0] << "|" << ietaW[0]
549  << " rows of cells for " << (dets.size()-last)
550  << " cells (last " << last << ")" << std::endl;
551  spr::debugEcalDets (last, dets, dir);
552  }
553 
554  std::vector<DetId> vdets;
555  vdets.insert(vdets.end(), dets.begin(), dets.end());
556  std::vector<CaloDirection> dirs;
557  dirs.insert(dirs.end(), dir.begin(), dir.end());
558  std::vector<int> jetaE, jetaW;
559  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
560  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
561  int keta = 0;
562  for (unsigned int i1=last; i1<dets.size(); i1++) {
563  int ieta = ietaW[i1];
564  if (dir[i1] == EAST) ieta = ietaE[i1];
565  if (ieta > 0) {
566  int flag=0;
567  std::vector<DetId> cells;
568  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
569  barrelGeom, endcapGeom, cells, flag,
570  debug, ignoreTransition);
571  ieta--;
572  if (ieta > keta) keta = ieta;
573  if (dir[i1] == EAST) jetaE[i1] = ieta;
574  else jetaW[i1] = ieta;
575  if (flag != 0) {
576  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
577  vdets.push_back(cells[0]);
578  CaloDirection dirn = dir[i1];
579  int ketaE = ietaE[i1];
580  int ketaW = ietaW[i1];
581  if (dirn == EAST) ketaE = ieta;
582  else ketaW = ieta;
583  if (flag < 0) {
584  int ktmp = ketaW; ketaW = ketaE; ketaE = ktmp;
585  if (dirn == EAST) dirn = WEST;
586  else dirn = EAST;
587  }
588  dirs.push_back(dirn);
589  jetaE.push_back(ketaE);
590  jetaW.push_back(ketaW);
591  }
592  }
593  }
594  }
595 
596  if (debug) {
597  std::cout << "newECALIdEW::Addition results a set of "
598  << (vdets.size()-dets.size()) << " new cells (last "
599  << dets.size() << ", ieta " << keta << ")" << std::endl;
600  spr::debugEcalDets (dets.size(), vdets);
601  }
602 
603  if (keta > 0) {
604  last = dets.size();
605  return spr::newECALIdEW(vdets, last, jetaE, jetaW, dirs, barrelTopo,
606  endcapTopo, barrelGeom, endcapGeom,
607  debug, ignoreTransition);
608  } else {
609  if (debug) {
610  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
611  << " cells" << std::endl;
612  spr::debugEcalDets (0, vdets);
613  }
614  return vdets;
615  }
616  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > spr::newECALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
int  ieta,
int  iphi,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 175 of file MatrixECALDetIds.cc.

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

Referenced by matrixECALIds(), and newECALIdNS().

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

Definition at line 301 of file MatrixECALDetIds.cc.

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

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

Definition at line 266 of file MatrixHCALDetIds.cc.

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

Referenced by newHCALIdEW(), and newHCALIdNS().

268  {
269 
270  if (debug) {
271  std::cout << "newHCALIdEW::Add " << ieta << " rows of cells along "
272  << shiftEast << " for " << (dets.size()-last) << " cells"
273  << std::endl;
274  spr::debugHcalDets(last, dets);
275  }
276 
277  std::vector<DetId> vdets;
278  vdets.insert(vdets.end(), dets.begin(), dets.end());
279  if (ieta > 0) {
280  for (unsigned int i1=last; i1<dets.size(); i1++) {
281  std::vector<DetId> vdet;
282  if (shiftEast) vdet = topology->east(dets[i1]);
283  else vdet = topology->west(dets[i1]);
284  for (unsigned int i2=0; i2<vdet.size(); i2++) {
285  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
286  vdets.push_back(vdet[i2]);
287  }
288  }
289  ieta--;
290  }
291 
292  if (debug) {
293  std::cout << "newHCALIdEW::Addition results a set of "
294  << (vdets.size()-dets.size()) << " new cells" << std::endl;
295  spr::debugHcalDets(dets.size(), vdets);
296  }
297 
298  if (ieta > 0) {
299  last = dets.size();
300  return spr::newHCALIdEW(vdets, last, topology, shiftEast, ieta, debug);
301  } else {
302  if (debug) {
303  std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
304  << " cells" << std::endl;
305  spr::debugHcalDets(0, vdets);
306  }
307  return vdets;
308  }
309  }
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
virtual std::vector< DetId > west(const DetId &id) const
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
virtual std::vector< DetId > east(const DetId &id) const
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftEast,
int  ietaE,
int  ietaW,
bool  debug = false 
)

Definition at line 311 of file MatrixHCALDetIds.cc.

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

313  {
314 
315  if (debug) {
316  std::cout << "newHCALIdEW::Add " << ietaE << "|" << ietaW
317  << " rows of cells along " << shiftEast << " for "
318  << (dets.size()-last) << " cells" << std::endl;
319  spr::debugHcalDets(last, dets);
320  }
321 
322  int ieta = ietaW;
323  if (shiftEast) ieta = ietaE;
324  std::vector<DetId> vdets;
325  vdets.insert(vdets.end(), dets.begin(), dets.end());
326  if (ieta > 0) {
327  for (unsigned int i1=last; i1<dets.size(); i1++) {
328  std::vector<DetId> vdet;
329  if (shiftEast) vdet = topology->east(dets[i1]);
330  else vdet = topology->west(dets[i1]);
331  for (unsigned int i2=0; i2<vdet.size(); i2++) {
332  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
333  vdets.push_back(vdet[i2]);
334  }
335  }
336  ieta--;
337  }
338  if (shiftEast) ietaE = ieta;
339  else ietaW = ieta;
340 
341  if (debug) {
342  std::cout << "newHCALIdEW::Addition results a set of "
343  << (vdets.size()-dets.size()) << " new cells" << std::endl;
344  spr::debugHcalDets(dets.size(), vdets);
345  }
346 
347  if (ieta > 0) {
348  last = dets.size();
349  return spr::newHCALIdEW(vdets,last,topology,shiftEast,ietaE,ietaW,debug);
350  } else {
351  if (debug) {
352  std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
353  << " cells" << std::endl;
354  spr::debugHcalDets(0, vdets);
355  }
356  return vdets;
357  }
358  }
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
virtual std::vector< DetId > west(const DetId &id) const
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
virtual std::vector< DetId > east(const DetId &id) const
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftNorth,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 102 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds(), and newHCALIdNS().

104  {
105 
106  if (debug) {
107  std::cout << "newHCALIdNS::Add " << iphi << " columns of cells along "
108  << shiftNorth << " for " << (dets.size()-last) << " cells"
109  << std::endl;
110  spr::debugHcalDets(last, dets);
111  }
112 
113  std::vector<DetId> vdets;
114  vdets.insert(vdets.end(), dets.begin(), dets.end());
115  std::vector<DetId> vdetE, vdetW;
116  if (last == 0) {
117  vdetE = spr::newHCALIdEW(dets, last, topology, true, ieta, debug);
118  vdetW = spr::newHCALIdEW(dets, last, topology, false, ieta, debug);
119  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
120  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
121  vdets.push_back(vdetW[i1]);
122  }
123  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
124  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
125  vdets.push_back(vdetE[i1]);
126  }
127  if (debug) {
128  std::cout <<"newHCALIdNS::With Added cells along E/W results a set of "
129  << (vdets.size()-dets.size()) << " new cells" << std::endl;
130  spr::debugHcalDets(dets.size(), vdets);
131  }
132  }
133  unsigned int last0 = vdets.size();
134  if (iphi > 0) {
135  std::vector<DetId> vdetnew;
136  for (unsigned int i1=last; i1<dets.size(); i1++) {
137  std::vector<DetId> vdet;
138  if (shiftNorth) vdet = topology->north(dets[i1]);
139  else vdet = topology->south(dets[i1]);
140  for (unsigned int i2=0; i2<vdet.size(); i2++) {
141  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
142  vdetnew.push_back(vdet[i2]);
143  }
144  }
145  iphi--;
146  vdetE = spr::newHCALIdEW(vdetnew, 0, topology, true, ieta, debug);
147  vdetW = spr::newHCALIdEW(vdetnew, 0, topology, false, ieta, debug);
148  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
149  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
150  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
151  vdets.push_back(vdetW[i2]);
152  }
153  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
154  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
155  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
156  vdets.push_back(vdetE[i2]);
157  }
158  last = vdets.size();
159  vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
160  if (debug) {
161  std::cout << "newHCALIdNS::Addition results a set of "
162  << (vdets.size()-last0) << " new cells" << std::endl;
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  std::cout << "newHCALIdNS::Final list consists of " << vdets.size()
174  << " cells" << std::endl;
175  spr::debugHcalDets(0, vdets);
176  }
177  return vdets;
178  }
179  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
virtual std::vector< DetId > south(const DetId &id) const
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
virtual std::vector< DetId > north(const DetId &id) const
tuple cout
Definition: gather_cfg.py:121
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftNorth,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  debug = false 
)

Definition at line 181 of file MatrixHCALDetIds.cc.

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

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

Definition at line 156 of file MatchingSimTrack.cc.

References begin, gather_cfg::cout, and dbtoconf::parent.

Referenced by matchedSimTrackInfo().

156  {
157 
158  edm::SimTrackContainer::const_iterator itr = SimTk->end();
159 
160  int vertIndex = thisTrkItr->vertIndex();
161  int type = thisTrkItr->type(); int charge = (int)thisTrkItr->charge();
162  if (debug) std::cout << "SimTrackParent " << thisTrkItr->trackId() << " Vertex " << vertIndex << " Type " << type << " Charge " << charge << std::endl;
163 
164  if( vertIndex == -1 ) return thisTrkItr;
165  else if (vertIndex >= (int)SimVtx->size()) return itr;
166 
167  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
168  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
169  int parent = simVtxItr->parentIndex();
170 
171  if (parent < 0 && simVtxItr != SimVtx->begin()) {
172  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
173  for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
174  if (simVtxItr->parentIndex() > 0) {
175  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
176  double dist = pos2.P();
177  if (dist < 0.001) {
178  parent = simVtxItr->parentIndex();
179  break;
180  }
181  }
182  }
183  }
184  for (edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
185  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
186  }
187 
188  return thisTrkItr;
189  }
type
Definition: HCALResponse.h:21
list parent
Definition: dbtoconf.py:74
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
#define debug
Definition: HDRShower.cc:19
#define begin
Definition: vmac.h:30
tuple cout
Definition: gather_cfg.py:121
edm::SimTrackContainer::const_iterator parentSimTrack(edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
std::vector< spr::propagatedTrackID > spr::propagateCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 109 of file CaloPropagateTrack.cc.

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

109  {
110 
111  std::vector<spr::propagatedTrackID> vdets;
112  spr::propagateCALO(trkCollection,geo,bField,theTrackQuality, vdets, debug);
113  return vdets;
114  }
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
#define debug
Definition: HDRShower.cc:19
void spr::propagateCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
std::vector< spr::propagatedTrackID > &  vdets,
bool  debug = false 
)

Definition at line 116 of file CaloPropagateTrack.cc.

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

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

Definition at line 182 of file CaloPropagateTrack.cc.

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

182  {
183 
184  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
185  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
187  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
188 
189  unsigned int indx;
190  reco::TrackCollection::const_iterator trkItr;
191  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
192  const reco::Track* pTrack = &(*trkItr);
194  trkD.trkItr = trkItr;
195  trkD.ok = (pTrack->quality(trackQuality_));
196  trkD.detIdECAL = DetId(0);
197  trkD.detIdHCAL = DetId(0);
198  trkD.detIdEHCAL= DetId(0);
199  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << trkD.ok << std::endl;
200 
202  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
203  trkD.okECAL = info.ok;
204  trkD.pointECAL = point;
205  trkD.directionECAL = info.direction;
206  if (trkD.okECAL) {
207  if (std::abs(info.point.eta())<1.479) {
208  trkD.detIdECAL = barrelGeom->getClosestCell(point);
209  } else {
210  trkD.detIdECAL = endcapGeom->getClosestCell(point);
211  }
212  trkD.detIdEHCAL = gHB->getClosestCell(point);
213  }
214  info = spr::propagateTrackToHCAL (pTrack, bField, debug);
215  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
216  trkD.okHCAL = info.ok;
217  trkD.pointHCAL = point;
218  trkD.directionHCAL = info.direction;
219  if (trkD.okHCAL) {
220  trkD.detIdHCAL = gHB->getClosestCell(point);
221  }
222  trkDir.push_back(trkD);
223  }
224 
225  if (debug) {
226  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
227  for (unsigned int i=0; i<trkDir.size(); ++i) {
228  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
229  if (trkDir[i].okECAL) {
230  std::cout << " point " << trkDir[i].pointECAL << " direction "
231  << trkDir[i].directionECAL << " ";
232  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
233  std::cout << (EBDetId)(trkDir[i].detIdECAL);
234  } else {
235  std::cout << (EEDetId)(trkDir[i].detIdECAL);
236  }
237  }
238  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
239  if (trkDir[i].okHCAL) {
240  std::cout << " point " << trkDir[i].pointHCAL << " direction "
241  << trkDir[i].directionHCAL << " "
242  << (HcalDetId)(trkDir[i].detIdHCAL);
243  }
244  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
245  }
246  }
247  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
TrackQuality
track quality
Definition: TrackBase.h:133
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
spr::propagatedTrack propagateTrackToECAL(const reco::Track *, const MagneticField *, bool debug=false)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:551
reco::TrackCollection::const_iterator trkItr
tuple cout
Definition: gather_cfg.py:121
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::propagatedTrackID spr::propagateCALO ( const reco::Track pTrack,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 249 of file CaloPropagateTrack.cc.

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

249  {
250 
251  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
252  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
254 
256  vdet.ok = true;
257  vdet.detIdECAL = DetId(0);
258  vdet.detIdHCAL = DetId(0);
259  vdet.detIdEHCAL= DetId(0);
260  if (debug) std::cout << "Propagate track: p " << pTrack->p() << " eta " << pTrack->eta() << " phi " << pTrack->phi() << " Flag " << vdet.ok << std::endl;
261 
262  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
263  vdet.okECAL = info.second;
264  if (vdet.okECAL) {
265  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
266  vdet.etaECAL = point.eta();
267  vdet.phiECAL = point.phi();
268  if (std::abs(point.eta())<1.479) {
269  vdet.detIdECAL = barrelGeom->getClosestCell(point);
270  } else {
271  vdet.detIdECAL = endcapGeom->getClosestCell(point);
272  }
273  vdet.detIdEHCAL = gHB->getClosestCell(point);
274  }
275  info = spr::propagateHCAL (pTrack, bField, debug);
276  vdet.okHCAL = info.second;
277  if (vdet.okHCAL) {
278  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
279  vdet.etaHCAL = point.eta();
280  vdet.phiHCAL = point.phi();
281  vdet.detIdHCAL = gHB->getClosestCell(point);
282  }
283 
284  if (debug) {
285  std::cout << "propagateCALO:: for 1 track" << std::endl;
286  std::cout << "Track [0] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
287  if (vdet.detIdECAL.subdetId() == EcalBarrel) {
288  std::cout << (EBDetId)(vdet.detIdECAL);
289  } else {
290  std::cout << (EEDetId)(vdet.detIdECAL);
291  }
292  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
293  }
294  return vdet;
295  }
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:693
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
std::vector< spr::propagatedGenTrackID > spr::propagateCALO ( const HepMC::GenEvent *  genEvent,
edm::ESHandle< ParticleDataTable > &  pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

Definition at line 297 of file CaloPropagateTrack.cc.

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

297  {
298 
299  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
300  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
302 
303  std::vector<spr::propagatedGenTrackID> trkDir;
304  unsigned int indx;
305  HepMC::GenEvent::particle_const_iterator p;
306  for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++p,++indx) {
308  trkD.trkItr = p;
309  trkD.detIdECAL = DetId(0);
310  trkD.detIdHCAL = DetId(0);
311  trkD.detIdEHCAL= DetId(0);
312  trkD.pdgId = ((*p)->pdg_id());
313  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge())/3;
314  GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
315  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
316 
317  // consider stable particles
318  if ( (*p)->status()==1 && std::abs((*p)->momentum().eta()) < etaMax ) {
319  GlobalPoint vertex = GlobalPoint(0.1*(*p)->production_vertex()->position().x(),
320  0.1*(*p)->production_vertex()->position().y(),
321  0.1*(*p)->production_vertex()->position().z());
322  trkD.ok = true;
323  spr::propagatedTrack info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 319.2, 129.4, 1.479, debug);
324  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
325  trkD.okECAL = info.ok;
326  trkD.pointECAL = point;
327  trkD.directionECAL = info.direction;
328  if (trkD.okECAL) {
329  if (std::abs(info.point.eta())<1.479) {
330  trkD.detIdECAL = barrelGeom->getClosestCell(point);
331  } else {
332  trkD.detIdECAL = endcapGeom->getClosestCell(point);
333  }
334  trkD.detIdEHCAL = gHB->getClosestCell(point);
335  }
336 
337  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 402.7, 180.7, 1.392, debug);
338  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
339  trkD.okHCAL = info.ok;
340  trkD.pointHCAL = point;
341  trkD.directionHCAL = info.direction;
342  if (trkD.okHCAL) {
343  trkD.detIdHCAL = gHB->getClosestCell(point);
344  }
345  }
346  trkDir.push_back(trkD);
347  }
348 
349  if (debug) {
350  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
351  for (unsigned int i=0; i<trkDir.size(); ++i) {
352  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
353  if (trkDir[i].okECAL) {
354  std::cout << " point " << trkDir[i].pointECAL << " direction "
355  << trkDir[i].directionECAL << " ";
356  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
357  std::cout << (EBDetId)(trkDir[i].detIdECAL);
358  } else {
359  std::cout << (EEDetId)(trkDir[i].detIdECAL);
360  }
361  }
362  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
363  if (trkDir[i].okHCAL) {
364  std::cout << " point " << trkDir[i].pointHCAL << " direction "
365  << trkDir[i].directionHCAL << " "
366  << (HcalDetId)(trkDir[i].detIdHCAL);
367  }
368  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
369  }
370  }
371  return trkDir;
372  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
uint32_t ID
Definition: Definitions.h:26
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
HepMC::GenEvent::particle_const_iterator trkItr
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tuple genEvent
Definition: MCTruth.py:33
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::vector< spr::propagatedGenParticleID > spr::propagateCALO ( edm::Handle< reco::GenParticleCollection > &  genParticles,
edm::ESHandle< ParticleDataTable > &  pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

Definition at line 374 of file CaloPropagateTrack.cc.

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

374  {
375 
376  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
377  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
379 
380  std::vector<spr::propagatedGenParticleID> trkDir;
381  unsigned int indx;
382  reco::GenParticleCollection::const_iterator p;
383  for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++p,++indx) {
385  trkD.trkItr = p;
386  trkD.detIdECAL = DetId(0);
387  trkD.detIdHCAL = DetId(0);
388  trkD.detIdEHCAL= DetId(0);
389  trkD.pdgId = (p->pdgId());
390  trkD.charge = p->charge();
391  GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
392  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
393 
394  // consider stable particles
395  if ( p->status()==1 && std::abs(momentum.eta()) < etaMax ) {
396  GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
397  trkD.ok = true;
398  spr::propagatedTrack info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 319.2, 129.4, 1.479, debug);
399  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
400  trkD.okECAL = info.ok;
401  trkD.pointECAL = point;
402  trkD.directionECAL = info.direction;
403  if (trkD.okECAL) {
404  if (std::abs(info.point.eta())<1.479) {
405  trkD.detIdECAL = barrelGeom->getClosestCell(point);
406  } else {
407  trkD.detIdECAL = endcapGeom->getClosestCell(point);
408  }
409  trkD.detIdEHCAL = gHB->getClosestCell(point);
410  }
411 
412  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 402.7, 180.7, 1.392, debug);
413  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
414  trkD.okHCAL = info.ok;
415  trkD.pointHCAL = point;
416  trkD.directionHCAL = info.direction;
417  if (trkD.okHCAL) {
418  trkD.detIdHCAL = gHB->getClosestCell(point);
419  }
420  }
421  trkDir.push_back(trkD);
422  }
423 
424  if (debug) {
425  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
426  for (unsigned int i=0; i<trkDir.size(); ++i) {
427  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
428  if (trkDir[i].okECAL) {
429  std::cout << " point " << trkDir[i].pointECAL << " direction "
430  << trkDir[i].directionECAL << " ";
431  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
432  std::cout << (EBDetId)(trkDir[i].detIdECAL);
433  } else {
434  std::cout << (EEDetId)(trkDir[i].detIdECAL);
435  }
436  }
437  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
438  if (trkDir[i].okHCAL) {
439  std::cout << " point " << trkDir[i].pointHCAL << " direction "
440  << trkDir[i].directionHCAL << " "
441  << (HcalDetId)(trkDir[i].detIdHCAL);
442  }
443  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
444  }
445  }
446  return trkDir;
447  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
reco::GenParticleCollection::const_iterator trkItr
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)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
T eta() const
Definition: PV3DBase.h:76
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
spr::propagatedTrackDirection spr::propagateCALO ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 449 of file CaloPropagateTrack.cc.

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

449  {
450 
451  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
452  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
454 
455  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
457  trkD.ok = trk.ok;
458  trkD.detIdECAL = DetId(0);
459  trkD.detIdHCAL = DetId(0);
460  trkD.detIdEHCAL= DetId(0);
461  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
462 
463  if (trkD.ok) {
464  spr::propagatedTrack info = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bField, 319.2, 129.4, 1.479, debug);
465  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
466  trkD.okECAL = info.ok;
467  trkD.pointECAL = point;
468  trkD.directionECAL = info.direction;
469  if (trkD.okECAL) {
470  if (std::abs(info.point.eta())<1.479) {
471  trkD.detIdECAL = barrelGeom->getClosestCell(point);
472  } else {
473  trkD.detIdECAL = endcapGeom->getClosestCell(point);
474  }
475  trkD.detIdEHCAL = gHB->getClosestCell(point);
476  }
477 
478  info = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bField, 402.7, 180.7, 1.392, debug);
479  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
480  trkD.okHCAL = info.ok;
481  trkD.pointHCAL = point;
482  trkD.directionHCAL = info.direction;
483  if (trkD.okHCAL) {
484  trkD.detIdHCAL = gHB->getClosestCell(point);
485  }
486  }
487 
488  if (debug) {
489  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
490  if (trkD.okECAL) {
491  std::cout << "ECAL point " << trkD.pointECAL << " direction "
492  << trkD.directionECAL << " ";
493  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
494  std::cout << (EBDetId)(trkD.detIdECAL);
495  } else {
496  std::cout << (EEDetId)(trkD.detIdECAL);
497  }
498  }
499  if (trkD.okHCAL) {
500  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
501  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
502  }
503  if (trkD.okECAL) std::cout << " Or " << (HcalDetId)(trkD.detIdEHCAL);
504  std::cout << std::endl;
505  }
506 
507  return trkD;
508  }
virtual DetId getClosestCell(const GlobalPoint &r) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::propagatedTrack spr::propagateCalo ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bField,
float  zdist,
float  radius,
float  corner,
bool  debug = false 
)

Definition at line 620 of file CaloPropagateTrack.cc.

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

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

620  {
621 
622  spr::propagatedTrack track;
623  if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
624  FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
625 
628 
630 
631  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
632 
634  if (tpMomentum.eta() < 0) {
635  tsose = myAP.propagate(fts, *lendcap);
636  } else {
637  tsose = myAP.propagate(fts, *rendcap);
638  }
639 
640  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
641 
642  track.ok=true;
643  if (tsose.isValid() && tsosb.isValid()) {
644  float absEta = std::abs(tsosb.globalPosition().eta());
645  if (absEta < corner) {
646  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
647  track.direction = tsosb.globalDirection();
648  } else {
649  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
650  track.direction = tsose.globalDirection();
651  }
652  } else if (tsose.isValid()) {
653  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
654  track.direction = tsose.globalDirection();
655  } else if (tsosb.isValid()) {
656  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
657  track.direction = tsosb.globalDirection();
658  } else {
659  track.point.SetXYZ(-999., -999., -999.);
660  track.direction = GlobalVector(0,0,1);
661  track.ok = false;
662  }
663  if (debug) {
664  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
665  if (track.ok) {
666  math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
667  double dphi = track.direction.phi()-tpMomentum.phi();
668  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
669  double pt = tpMomentum.perp();
670  double rat = 0.5*dphi/std::sin(0.5*dphi);
671  std::cout << "RDist " << rdist << " pt " << pt << " r/pt " << rdist*rat/pt << " zdist " << vDiff.z() << " pz " << tpMomentum.z() << " z/pz " << vDiff.z()/tpMomentum.z() << std::endl;
672  }
673  }
674  return track;
675  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
T sqrt(T t)
Definition: SSEVec.h:48
T phi() const
Definition: Phi.h:41
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T eta() const
Definition: PV3DBase.h:76
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector globalDirection() const
std::vector< spr::propagatedTrackID > spr::propagateCosmicCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
bool  debug = false 
)

Definition at line 18 of file CaloPropagateTrack.cc.

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

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

Definition at line 526 of file CaloPropagateTrack.cc.

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

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

526  {
527  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
528  GlobalVector momentum (track->px(), track->py(), track->pz());
529  int charge (track->charge());
530  return spr::propagateECAL (vertex, momentum, charge, bfield, debug);
531  }
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:717
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:711
int charge() const
track electric charge
Definition: TrackBase.h:615
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:705
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 533 of file CaloPropagateTrack.cc.

References spr::propagatedTrack::ok, spr::propagatedTrack::point, and propagateCalo().

533  {
534  spr::propagatedTrack track = spr::propagateCalo (vertex, momentum, charge, bfield, 319.2, 129.4, 1.479, debug);
535  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
536  }
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
#define debug
Definition: HDRShower.cc:19
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 553 of file CaloPropagateTrack.cc.

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

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

553  {
554  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
555  GlobalVector momentum (track->px(), track->py(), track->pz());
556  int charge (track->charge());
557  return spr::propagateHCAL (vertex, momentum, charge, bfield, debug);
558  }
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:717
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:711
int charge() const
track electric charge
Definition: TrackBase.h:615
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:705
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 560 of file CaloPropagateTrack.cc.

References spr::propagatedTrack::ok, spr::propagatedTrack::point, and propagateCalo().

560  {
561  spr::propagatedTrack track = spr::propagateCalo (vertex, momentum, charge, bfield, 402.7, 180.7, 1.392, debug);
562  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
563  }
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
#define debug
Definition: HDRShower.cc:19
std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 565 of file CaloPropagateTrack.cc.

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

565  {
566  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
567  GlobalVector momentum (track->px(), track->py(), track->pz());
568  int charge (track->charge());
569  spr::propagatedTrack track1 = spr::propagateCalo (vertex, momentum, charge, bfield, 290.0, 109.0, 1.705, debug);
570  return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
571  }
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:717
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:711
int charge() const
track electric charge
Definition: TrackBase.h:615
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:705
std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

Definition at line 573 of file CaloPropagateTrack.cc.

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

Referenced by IsolatedTracksNxN::analyze().

573  {
574 
575  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
576  GlobalVector momentum (track->px(), track->py(), track->pz());
577  int charge (track->charge());
578  float radius = track->outerPosition().Rho();
579  float zdist = track->outerPosition().Z();
580  if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;
581 
582  FreeTrajectoryState fts (vertex, momentum, charge, bField);
585 
586  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
587 
588  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
589  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
590 
591  math::XYZPoint point(-999.,-999.,-999.);
592  bool ok=false;
593  GlobalVector direction(0,0,1);
594  if (tsosb.isValid() && std::abs(zdist) < 110) {
595  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
596  direction = tsosb.globalDirection();
597  ok = true;
598  } else if (tsose.isValid()) {
599  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
600  direction = tsose.globalDirection();
601  ok = true;
602  }
603 
604  double length = -1;
605  if (ok) {
606  math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
607  double dphi = direction.phi()-momentum.phi();
608  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
609  double rat = 0.5*dphi/std::sin(0.5*dphi);
610  double dZ = vDiff.z();
611  double dS = rdist*rat; //dZ*momentum.z()/momentum.perp();
612  length = std::sqrt(dS*dS+dZ*dZ);
613  if (debug)
614  std::cout << "propagateTracker:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << ok << " Point " << point << " RDist " << rdist << " dS " << dS << " dS/pt " << rdist*rat/momentum.perp() << " zdist " << dZ << " dz/pz " << dZ/momentum.z() << " Length " << length << std::endl;
615  }
616 
617  return std::pair<math::XYZPoint,double>(point,length);
618  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
T sqrt(T t)
Definition: SSEVec.h:48
T phi() const
Definition: Phi.h:41
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:717
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:711
tuple cout
Definition: gather_cfg.py:121
int charge() const
track electric charge
Definition: TrackBase.h:615
T x() const
Definition: PV3DBase.h:62
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:705
GlobalVector globalDirection() const
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 510 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

510  {
511  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
512  GlobalVector momentum (track->px(), track->py(), track->pz());
513  int charge (track->charge());
514  return spr::propagateCalo (vertex, momentum, charge, bfield, 319.2, 129.4, 1.479, debug);
515  }
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:717
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:711
int charge() const
track electric charge
Definition: TrackBase.h:615
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:705
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 517 of file CaloPropagateTrack.cc.

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

517  {
518 
519  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
521  if (trk.ok)
522  ptrk = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bfield, 319.2, 129.4, 1.479, debug);
523  return ptrk;
524  }
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)
#define debug
Definition: HDRShower.cc:19
spr::propagatedTrack spr::propagateTrackToHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 538 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

538  {
539  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
540  GlobalVector momentum (track->px(), track->py(), track->pz());
541  int charge (track->charge());
542  return spr::propagateCalo (vertex, momentum, charge, bfield, 402.7, 180.7, 1.392, debug);
543  }
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:717
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:711
int charge() const
track electric charge
Definition: TrackBase.h:615
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:705
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 545 of file CaloPropagateTrack.cc.

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

545  {
546  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
548  if (trk.ok)
549  ptrk = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bfield, 402.7, 180.7, 1.392, debug);
550  return ptrk;
551  }
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)
#define debug
Definition: HDRShower.cc:19
void spr::simpleMove ( DetId det,
const CaloDirection dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
std::vector< DetId > &  cells,
int &  flag,
bool  debug = false,
bool  igNoreTransition = true 
)

Definition at line 618 of file MatrixECALDetIds.cc.

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

Referenced by newECALIdEW(), and newECALIdNS().

624  {
625 
626  DetId cell;
627  ok = 0;
628  if (det.subdetId() == EcalBarrel) {
629  EBDetId detId = det;
630  std::vector<DetId> neighbours = barrelTopo.getNeighbours(detId,dir);
631  if (neighbours.size()>0 && !neighbours[0].null()) {
632  cells.push_back(neighbours[0]);
633  cell = neighbours[0];
634  ok = 1;
635  } else {
636  const int ietaAbs ( detId.ietaAbs() ) ; // abs value of ieta
637  if (EBDetId::MAX_IETA == ietaAbs && (!ignoreTransition)) {
638  // get ee nbrs for for end of barrel crystals
640  ol( * barrelGeom.getClosestEndcapCells(detId) ) ;
641  // take closest neighbour on the other side, that is in the endcap
642  cell = *(ol.begin() );
643  neighbours = endcapTopo.getNeighbours(cell,dir);
644  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
645  else ok =-1;
646  for (EcalBarrelGeometry::OrderedListOfEEDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
647  cells.push_back(*iptr);
648  }
649  }
650  } else if (det.subdetId() == EcalEndcap) {
651  EEDetId detId = det;
652  std::vector<DetId> neighbours = endcapTopo.getNeighbours(detId,dir);
653  if (neighbours.size()>0 && !neighbours[0].null()) {
654  cells.push_back(neighbours[0]);
655  cell = neighbours[0];
656  ok = 1;
657  } else {
658  // are we on the outer ring ?
659  const int iphi ( detId.iPhiOuterRing() ) ;
660 // int isc = detId.isc();
661  if (iphi != 0 && (!ignoreTransition)) {
662  // get eb nbrs for for end of endcap crystals
664  ol( * endcapGeom.getClosestBarrelCells(detId) ) ;
665  // take closest neighbour on the other side, that is in the barrel.
666  cell = *(ol.begin() );
667  neighbours = barrelTopo.getNeighbours(cell,dir);
668  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
669  else ok =-1;
670  for (EcalEndcapGeometry::OrderedListOfEBDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
671  cells.push_back(*iptr);
672  }
673  }
674  }
675  if (debug) {
676  std::cout << "simpleMove:: Move DetId 0x" << std::hex << det()
677  << std::dec << " along " << dir << " to get 0x" << std::hex
678  << cell() << std::dec << " with flag " << ok << " # "
679  << cells.size();
680  for (unsigned int i1=0; i1<cells.size(); ++i1)
681  std::cout << " " << std::hex << cells[0]() << std::dec;
682  std::cout << std::endl;
683  }
684  }
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
int iPhiOuterRing() const
Definition: EEDetId.cc:388
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
static const int MAX_IETA
Definition: EBDetId.h:143
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:49
spr::trackAtOrigin spr::simTrackAtOrigin ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 677 of file CaloPropagateTrack.cc.

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

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

677  {
678 
679  spr::trackAtOrigin trk;
680 
681  edm::SimTrackContainer::const_iterator itr = SimTk->end();
682  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
683  if ( simTrkItr->trackId() == thisTrk ) {
684  if (debug) std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
685  itr = simTrkItr;
686  break;
687  }
688  }
689 
690  if (itr != SimTk->end()) {
691  int vertIndex = itr->vertIndex();
692  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
693  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
694  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
695  const math::XYZTLorentzVectorD pos = simVtxItr->position();
696  const math::XYZTLorentzVectorD mom = itr->momentum();
697  trk.ok = true;
698  trk.charge = (int)(itr->charge());
699  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
700  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
701  }
702  }
703  if (debug) std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;;
704  return trk;
705  }
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
Global3DVector GlobalVector
Definition: GlobalVector.h:10
double spr::timeOfFlight ( DetId  id,
const CaloGeometry geo,
bool  debug = false 
)

Definition at line 12 of file CaloSimInfo.cc.

References funct::abs(), funct::cos(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, PV3DBase< T, PVType, FrameType >::eta(), eta(), create_public_lumi_plots::exp, CaloGeometry::getPosition(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, contentValuesFiles::m, PV3DBase< T, PVType, FrameType >::mag(), dttmaxenums::R, funct::sin(), theta(), and tmp.

Referenced by RPCDigiSimLink::RPCDigiSimLink().

12  {
13 
14  double R = geo->getPosition(id).mag();
15  double tmp = R/CLHEP::c_light/CLHEP::ns;
16  if (debug) {
17  DetId::Detector det = id.det();
18  int subdet = id.subdetId();
19  double eta = geo->getPosition(id).eta();
20  double theta = 2.0*atan(exp(-std::abs(eta)));
21  double dist = 0;
22  if (det == DetId::Ecal) {
23  if (subdet == static_cast<int>(EcalBarrel)) {
24  const double rEB = 1292*CLHEP::mm;
25  dist = rEB/sin(theta);
26  } else if (subdet == static_cast<int>(EcalEndcap)) {
27  const double zEE = 3192*CLHEP::mm;
28  dist = zEE/cos(theta);
29  } else {
30  const double zES = 3032*CLHEP::mm;
31  dist = zES/cos(theta);
32  }
33  } else if (det == DetId::Hcal) {
34  if (subdet == static_cast<int>(HcalBarrel)) {
35  const double rHB = 1807*CLHEP::mm;
36  dist = rHB/sin(theta);
37  } else if (subdet == static_cast<int>(HcalEndcap)) {
38  const double zHE = 4027*CLHEP::mm;
39  dist = zHE/cos(theta);
40  } else if (subdet == static_cast<int>(HcalOuter)) {
41  const double rHO = 3848*CLHEP::mm;
42  dist = rHO/sin(theta);
43  } else {
44  const double zHF = 11.15*CLHEP::m;
45  dist = zHF/cos(theta);
46  }
47  }
48  double tmp1 = dist/CLHEP::c_light/CLHEP::ns;
49 
50  std::cout << "Detector " << det << "/" << subdet << " Eta/Theta " << eta
51  << "/" << theta/CLHEP::deg << " Dist " << dist/CLHEP::cm
52  << " R " << R << " TOF " << tmp << ":" << tmp1 << std::endl;
53  }
54  return tmp;
55  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
T eta() const
T mag() const
Definition: PV3DBase.h:67
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
#define debug
Definition: HDRShower.cc:19
Detector
Definition: DetId.h:24
T eta() const
Definition: PV3DBase.h:76
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
tuple cout
Definition: gather_cfg.py:121
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 118 of file MatchingSimTrack.cc.

References begin, gather_cfg::cout, and dbtoconf::parent.

Referenced by matchedSimTrackId(), and matchedSimTrackInfo().

118  {
119 
120  if (debug) std::cout << "Inside validSimTrack: trackId " << thisTrkItr->trackId() << " vtxIndex " << thisTrkItr->vertIndex() << " to be matched to " << simTkId << std::endl;
121 
122  //This track originates from simTkId
123  if (thisTrkItr->trackId() == simTkId) return true;
124 
125  //Otherwise trace back the history using SimTracks and SimVertices
126  int vertIndex = thisTrkItr->vertIndex();
127  if (vertIndex == -1 || vertIndex >= (int)SimVtx->size()) return false;
128 
129  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
130  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
131  int parent = simVtxItr->parentIndex();
132  if (debug) std::cout << "validSimTrack:: parent index " << parent <<" ";
133  if (parent < 0 && simVtxItr != SimVtx->begin()) {
134  const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
135  for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
136  if (simVtxItr->parentIndex() > 0) {
137  const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
138  double dist = pos2.P();
139  if (dist < 0.001) {
140  parent = simVtxItr->parentIndex();
141  break;
142  }
143  }
144  }
145  }
146  if (debug) std::cout << "final index " << parent << std::endl;;
147  for(edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
148  if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug) ;
149  }
150 
151  return false;
152 
153  }
list parent
Definition: dbtoconf.py:74
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
#define debug
Definition: HDRShower.cc:19
#define begin
Definition: vmac.h:30
tuple cout
Definition: gather_cfg.py:121
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)