CMS 3D CMS Logo

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

Classes

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

Functions

template<typename T >
energyMap caloSimInfoMatrix (const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, double timeCut=150, bool includeHO=false, bool debug=false)
 
void cGenSimInfo (std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (std::vector< DetId > &vdets, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (int charge, int pdgid, double p, spr::genSimInfo &info, bool debug=false)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &theNavigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string theTrackQuality, bool 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 useRaw=false, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< DetId > &coneRecHitDetIds, double &distFromHotCell, int &ietaHotCell, int &iphiHotCell, GlobalPoint &gposHotCell, int detOnly=-1, bool useRaw=false, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< DetId > &coneRecHitDetIds, std::vector< double > &eHit, bool useRaw=false, bool debug=false)
 
template<typename T >
double eCone_hcal (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, std::vector< DetId > &coneRecHitDetIds, double &distFromHotCell, int &ietaHotCell, int &iphiHotCell, GlobalPoint &gposHotCell, int detOnly=-1, bool useRaw=false, bool debug=false)
 
template<typename T >
double eECALmatrix (CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ietaE, int ietaW, int iphiN, int iphiS, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
eECALmatrixCell (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eECALmatrixTotal (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, CaloNavigator< DetId > &navigator, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
energyMap eECALSimInfoMatrix (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfoTotal (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, std::set< int > &uniqueIdset, bool useRaw=false)
 
template<typename T >
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, GlobalPoint &gPosHotCell, bool useRaw=false)
 
template<typename T >
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, HcalDetId &hotCell, bool includeHO=false, bool useRaw=false, bool debug=false)
 
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 useRaw=false, bool debug=false)
 
template<typename T >
void energyHCALCell (HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
template<typename T >
double energyHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCALmatrixNew (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
template<typename T >
double energyHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
 
void extraIds (const DetId &det, std::vector< DetId > &dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, bool debug=false)
 
void find (edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< HBHERecHitCollection > &hits, DetId thisDet, std::vector< HBHERecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< edm::PCaloHitContainer > &hits, DetId thisDet, std::vector< edm::PCaloHitContainer::const_iterator > &hit, bool debug=false)
 
std::vector
< EcalRecHitCollection::const_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 useRaw=false, bool debug=false)
 
double getEnergy (edm::PCaloHitContainer::const_iterator hit, bool useRaw=false, bool debug=false)
 
EtaPhi getEtaPhi (int ieta, int iphi, bool debug=false)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, int &ieta, int &iphi, bool debug=false)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, int &ieta, int &iphi, bool debug=false)
 
GlobalPoint getGpos (const CaloGeometry *geo, HBHERecHitCollection::const_iterator hit, bool debug=false)
 
GlobalPoint getGpos (const CaloGeometry *geo, edm::PCaloHitContainer::const_iterator hit, bool debug=false)
 
HcalDetId getHotCell (std::vector< HBHERecHitCollection::const_iterator > &hit, bool includeHO, bool useRaw=false, bool debug=false)
 
HcalDetId getHotCell (std::vector< std::vector< PCaloHit >::const_iterator > &hit, bool includeHO, bool useRaw=false, bool debug=false)
 
double getRawEnergy (HBHERecHitCollection::const_iterator hit, bool useRaw=false)
 
double getRawEnergy (edm::PCaloHitContainer::const_iterator hit, bool useRaw=false)
 
bool goodTrack (const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const HcalTopology *topology, int ieta, int iphi, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const HcalTopology *topology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const HcalTopology *topology, int ieta, int iphi, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
void hGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const HcalTopology *topology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool includeHO=false, bool debug=false)
 
template<typename T >
void hitECALmatrix (CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, std::vector< typename T::const_iterator > &hitlist, bool debug=false)
 
template<typename T >
void hitHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, std::vector< typename T::const_iterator > &hitlist, bool includeHO=false, bool debug=false)
 
template<typename T >
void hitHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, std::vector< typename T::const_iterator > &hitlist, bool includeHO=false, bool debug=false)
 
template<typename T >
void hitsHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, std::vector< typename T::const_iterator > &hitlist, bool debug=false)
 
template<typename T >
DetId hotCrystal (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
DetId hotCrystal (std::vector< DetId > &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double tMin=-500, double tMax=500, bool debug=false)
 
edm::SimTrackContainer::const_iterator matchedSimTrack (const edm::Event &iEvent, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, bool debug=false)
 
std::vector< int > matchedSimTrackId (const edm::Event &, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, bool debug=false)
 
simTkInfo matchedSimTrackInfo (unsigned int simTkId, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
void matrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixECALIds (const DetId &det, double dR, const GlobalVector &trackMom, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false, bool igNoreTransition=true)
 
void matrixECALIds (const DetId &det, int ietaE, int ietaW, int iphiN, int iphiS, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ietaE, int ietaW, int iphiN, int iphiS, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdmatrixHCALIds (std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIds (const DetId &det, const CaloGeometry *geo, const HcalTopology *topology, double dR, const GlobalVector &trackMom, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIds (std::vector< DetId > &dets, const HcalTopology *topology, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIdsDepth (std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
missedCaloHits (edm::Handle< T > &hits, std::vector< int > matchedId, std::vector< typename T::const_iterator > caloHits, bool flag, bool includeHO=false, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
missedECALHits (const edm::Event &, CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, bool flag, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
missedHCALHits (const edm::Event &, const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, bool flag, bool includeHO=false, bool debug=false)
 
std::vector< DetIdnewECALIdEW (std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewECALIdEW (std::vector< DetId > &dets, unsigned int last, std::vector< int > &ietaE, std::vector< int > &ietaW, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewECALIdNS (std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewECALIdNS (std::vector< DetId > &dets, unsigned int last, std::vector< int > &ietaE, std::vector< int > &ietaW, std::vector< int > &iphiN, std::vector< int > &iphiS, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false, bool igNoreTransition=true)
 
std::vector< DetIdnewHCALIdEW (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
 
std::vector< DetIdnewHCALIdEW (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ietaE, int ietaW, bool debug=false)
 
std::vector< DetIdnewHCALIdNS (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
 
std::vector< DetIdnewHCALIdNS (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ietaE, int ietaW, int iphiN, int iphiS, bool debug=false)
 
edm::SimTrackContainer::const_iterator parentSimTrack (edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
std::vector
< spr::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< bool, HcalDetIdpropagateHCALBack (const reco::Track *, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateTracker (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, double > propagateTrackerEnd (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToECAL (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToHCAL (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToHCAL (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const MagneticField *, bool debug=false)
 
void simpleMove (DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false, bool igNoreTransition=true)
 
spr::trackAtOrigin simTrackAtOrigin (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
double timeOfFlight (DetId id, const CaloGeometry *geo, bool debug=false)
 
bool validSimTrack (unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 

Variables

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

Function Documentation

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

Definition at line 87 of file GenSimInfo.cc.

References spr::genSimInfo::cHadronEne, spr::genSimInfo::cHadronEne_, RecoTauCleanerPlugins::charge, 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:145
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_, RecoTauCleanerPlugins::charge, 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:145
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 14 of file ChargeIsolationExtra.cc.

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

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

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

54  {
55 
56  bool isIsolated = false;
57 
58  DetId thisDet;
59 
60  for (int dx = -ieta; dx < ieta+1; ++dx) {
61  for (int dy = -iphi; dy < iphi+1; ++dy) {
62 
63  thisDet = navigator.offsetBy(dx, dy);
64  navigator.home();
65 
66  if (thisDet != DetId(0)) {
67  if (thisDet == anyCell) {
68  isIsolated = false;
69  return isIsolated;
70  }
71  }
72  }
73  }
74  return isIsolated;
75  }
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 168 of file ChargeIsolation.cc.

References i.

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

168  {
169  bool isIsolated = true;
170  for (unsigned int i=0; i<vdets.size(); i++){
171  if (anyCell == vdets[i] ) {
172  isIsolated = false;
173  break;
174  }
175  }
176  return isIsolated;
177  }
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 236 of file ChargeIsolation.cc.

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

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

236  {
237 
238  double maxNearP = -1.0;
239  nNearTRKs = 0;
240  if (trkDirs[trkIndex].okHCAL) {
241  if (debug) std::cout << "chargeIsolationCone with " << trkDirs.size() << " tracks " << std::endl;
242  for (unsigned int indx=0; indx<trkDirs.size(); ++indx) {
243  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
244  int isConeChargedIso = spr::coneChargeIsolation(trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
245  if (isConeChargedIso==0) {
246  nNearTRKs++;
247  const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
248  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
249  }
250  }
251  }
252  }
253  if (debug) std::cout << "chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL << " maxNearP " << maxNearP << std::endl;
254  return maxNearP;
255  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:145
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 79 of file ChargeIsolationExtra.cc.

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

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

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

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

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

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

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

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

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

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

Definition at line 258 of file ChargeIsolation.cc.

References getDistInPlaneTrackDir().

258  {
259 
260  int isIsolated = 1;
261  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR) isIsolated = 1;
262  else isIsolated = 0;
263  return isIsolated;
264  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
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:145
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:145
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:145
template<typename T >
void spr::eCaloSimInfo ( std::vector< DetId vdets,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eCaloSimInfo ( const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
std::map<std::string,double> spr::eCaloSimInfo ( caloSimInfo &  info)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eCaloSimInfo ( edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
std::vector< int > &  multiplicityVector,
bool  debug = false 
)
template<typename T >
double spr::eCone_ecal ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
int  detOnly = -1,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< DetId > &  coneRecHitDetIds,
double &  distFromHotCell,
int &  ietaHotCell,
int &  iphiHotCell,
GlobalPoint gposHotCell,
int  detOnly = -1,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< DetId > &  coneRecHitDetIds,
std::vector< double > &  eHit,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eCone_hcal ( const CaloGeometry geo,
edm::Handle< T > &  hits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
std::vector< DetId > &  coneRecHitDetIds,
double &  distFromHotCell,
int &  ietaHotCell,
int &  iphiHotCell,
GlobalPoint gposHotCell,
int  detOnly = -1,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalTrigTowerConstituentsMap ttMap,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
std::pair< double, bool > spr::eECALmatrix ( const DetId detId,
edm::Handle< EcalRecHitCollection > &  hitsEB,
edm::Handle< EcalRecHitCollection > &  hitsEE,
const EcalChannelStatus chStatus,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalSeverityLevelAlgo sevlv,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 8 of file eECALMatrix.cc.

References gather_cfg::cout, TauDecayModes::dec, EcalBarrel, EcalEndcap, CastorDataFrameFilter_impl::energySum(), findHit(), 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:145
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(), 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:145
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:145
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:145
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:145
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:145
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
bool  algoNew = true,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
std::set< int > &  uniqueIdset,
bool  useRaw = false 
)
template<typename T >
double spr::eHCALmatrix ( const CaloGeometry geo,
const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
GlobalPoint gPosHotCell,
bool  useRaw = false 
)
template<typename T >
double spr::eHCALmatrix ( const CaloGeometry geo,
const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
HcalDetId hotCell,
bool  includeHO = false,
bool  useRaw = false,
bool  debug = false 
)
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  useRaw = false,
bool  debug = false 
)
template<typename T >
void spr::energyHCALCell ( HcalDetId  detId,
edm::Handle< T > &  hits,
std::vector< std::pair< double, int > > &  energyCell,
int  maxDepth = 1,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrixNew ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
template<typename T >
double spr::energyHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  useRaw = false,
bool  debug = false 
)
void spr::extraIds ( const DetId det,
std::vector< DetId > &  dets,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
std::vector< DetId > &  cells,
bool  debug = false 
)

Definition at line 686 of file MatrixECALDetIds.cc.

References KineDebug3::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
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
Geom::Phi< T > phi() const
tuple cout
Definition: gather_cfg.py:145
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 PedestalTask::_dump(), ParticleDecayDrawer::accept(), ParticleTreeDrawer::accept(), HcalHitFilter::accepts(), DTVDriftCalibration::cellInfo::add(), Measurement::addAffectingEntriesFromOptO(), reco::CompositeCandidate::addDaughter(), reco::NamedCompositeCandidate::addDaughter(), CRackTrajectoryBuilder::AddHit(), CSCNeutronReader::addHits(), pat::TriggerEvent::addObjectMatchResult(), SiStripQualityHotStripIdentifier::algoAnalyze(), reco::Conversion::algoByName(), reco::TrackBase::algoByName(), GEMRecHitsValidation::analyze(), EcalMatacqAnalyzer::analyze(), EcalPnGraphs::analyze(), EcalDumpRaw::analyze(), SiStripApvGainBuilderFromTag::analyze(), DTT0Calibration::analyze(), DTT0CalibrationNew::analyze(), DTNoiseCalibration::analyze(), EcalABAnalyzer::analyze(), EcalPerEvtLaserAnalyzer::analyze(), HcalQIEDataCheck::analyze(), RecAnalyzerMinbias::analyze(), ParticleListDrawer::analyze(), HcalAutoPedestalValidator::analyze(), HLTBTagPerformanceAnalyzer::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), edmtest::HcalDumpConditions::analyze(), EcalLaserAnalyzer2::analyze(), DQMHcalIsoTrackAlCaReco::analyze(), EcalLaserAnalyzer::analyze(), TestPythiaDecays::analyze(), HcalGainsCheck::analyze(), DQMSourcePi0::analyze(), PixelLumiDQM::analyze(), HeavyFlavorValidation::analyze(), TestTrackHits::analyze(), EcalURecHitHists::analyze(), TestOutliers::analyze(), CastorDumpConditions::analyze(), L1TGT::analyze(), HLTAlCa::analyze(), HLTMuonPlotter::analyze(), IsoTrig::analyze(), HcalIsoTrkAnalyzer::analyze(), EcalCosmicsHists::analyze(), IsoTrackCalibration::analyze(), DTDigiTask::analyze(), PrimaryVertexAnalyzer4PUSlimmed::analyze(), any(), CaloTowersCreationAlgo::assignHitEcal(), CaloTowersCreationAlgo::assignHitHcal(), CSCHitAssociator::associateCSCHitId(), CSCHitAssociator::associateHitId(), TrackerHitAssociator::associateMatchedRecHit(), TrackerHitAssociator::associatePixelRecHit(), RPCHitAssociator::associateRecHit(), GEMHitAssociator::associateRecHit(), TrackerHitAssociator::associateSimpleRecHitCluster(), AlignmentParameterStore::attachCorrelations(), ClusterProducerFP420::badChannel(), ProfilerService::beginPath(), 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(), L1TMuon::DTBunchCrossingCleaner::clean(), BlockFormatter::CleanUp(), cmsswRelease::cmsswIs44X(), cmsswRelease::cmsswIs52X(), edm::Exception::codeToString(), egammaisolation::EgammaRecHitExtractor::collect(), EgammaTowerIsolationNew< NC >::compute(), MVAJetPuId::computeIdVariables(), HDQMInspectorConfigBase::computeIntegral(), vertexTools::computeSharedTracks(), HCALConfigDB::connect(), FastFedCablingHistosUsingDb::connections(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer(), PedeSteererWeakModeConstraints::constructConstraints(), HiHelperTools::contains(), helpers::contains(), Model::copyMeasurements(), createPayload::copyToWorkflowdir(), SiStripFecCabling::countDevices(), DefaultFFTJetObjectFactory< AbsFFTSpecificScaleCalculator >::create(), cmsHarvester::create_and_check_castor_dir(), edm::SharedResourcesRegistry::createAcquirer(), ESDigitizer::createNoisyList(), LaunchOnCondor::CreateTheCmdFile(), customiseForPremixingInput::customiseForPreMixingInput(), 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_ElecFakes::dqmBeginRun(), SUSY_HLT_MuEle_Hadronic::dqmBeginRun(), SUSY_HLT_Muon_Hadronic::dqmBeginRun(), SUSY_HLT_MuonFakes::dqmBeginRun(), SUSY_HLT_VBF_Mu::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(), hcaldqm::RecoRunSummary::endJob(), hcaldqm::TPRunSummary::endJob(), hcaldqm::DigiRunSummary::endLuminosityBlock(), hcaldqm::RawRunSummary::endLuminosityBlock(), TPTask::endLuminosityBlock(), RawTask::endLuminosityBlock(), RecHitTask::endLuminosityBlock(), DigiTask::endLuminosityBlock(), L1ScalersClient::endLuminosityBlock(), GsfVertexTrackCompatibilityEstimator::estimate(), KalmanVertexTrackCompatibilityEstimator< N >::estimate(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), JetPlusTrackCorrector::excludeJta(), edm::ParameterSet::existsAs(), CompositeAlignmentParameters::extractAlignables(), CompositeAlignmentParameters::extractPositionAndLength(), CompositeAlignmentDerivativesExtractor::extractWithMultipleHits(), SiPixelFedCablingMap::fedIds(), VertexFitterResult::fill(), tnp::ProbeFlag::fill(), JetPartonMatcher::fillAlgoritDefinition(), SiPixelActionExecutor::fillFEDErrorSummary(), PhysicsTools::MVATrainer::fillInputVars(), Py8toJetInput::fillJetAlgoInput(), MuonMesh::fillMesh(), JetPartonMatcher::fillPhysicsDefinition(), edm::Principal::fillPrincipal(), CastorShowerLibraryMaker::FillShowerEvent(), SiPixelActionExecutor::fillSummary(), SiStripCommissioningRunTypeFilter::filter(), HltComparator::filter(), LogErrorFilter::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(), BTVHLTOfflineSource::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(), GenHFHadronMatcher::findInMothers(), JetCorrectorParametersCollection::findKey(), MSLayersAtAngle::findLayer(), HLTPerformanceInfo::findModule(), HLTPerformanceInfo::findPath(), JetPlusTrackCorrector::findTrack(), EcalTBReadout::findTTlist(), 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(), CastorCalibrationWidthsSet::getCalibrationWidths(), HcalCalibrationWidthsSet::getCalibrationWidths(), hcalCalib::GetCoefFromMtrxInvOfAve(), HcalLutManager::getCompressionLutXmlFromAsciiMaster(), HcalLutManager::getCompressionLutXmlFromCoder(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), HLTScalersClient::CountLSFifo_t::getCount(), GenParticlePruner::getDaughterKeys(), EgammaHadTower::getDepth1HcalESum(), EgammaHadTower::getDepth2HcalESum(), EcalElectronicsMapping::getDetId(), TrackAssociatorByHitsImpl::getDoubleCount(), QuickTrackAssociatorByHitsImpl::getDoubleCount(), EcalElectronicsMapping::getElectronicsId(), edm::eventsetup::EventSetupsController::getESProducerPSet(), SiPixelActionExecutor::getFEDSummaryME(), SiPixelActionExecutor::getGrandSummaryME(), JetCorrectorParametersCollection::getL5Bin(), JetCorrectorParametersCollection::getL7Bin(), BeamSpotWorkflow::getLastUploadedIOV(), HcalLutManager::getLinearizationLutXmlFromAsciiMasterEmap(), HcalLutManager::getLinearizationLutXmlFromCoder(), HcalLutManager::getLinearizationLutXmlFromCoderEmap(), BeamSpotWorkflow::getListOfRunsAndLumiFromDBS(), HcalLutManager::getLutFromXml_old(), HcalLutManager::getLutXmlFromAsciiMaster(), METCorrectorParametersCollection::getMiniAodBin(), CastorShowerLibraryMaker::GetMissingEnergy(), GenParticlePruner::getMotherKeys(), popcon::EcalPulseSymmCovariancesHandler::getNewObjects(), popcon::EcalPulseShapesHandler::getNewObjects(), LMFCorrCoefDat::getParameters(), HDQMSummary::getPosition(), SiStripSummary::getPosition(), TrackAssociatorByHitsImpl::getShared(), 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::PATSingleVertexSelector::hasMode_(), MisalignmentScenarioBuilder::hasParameter_(), pat::TriggerObjectStandAlone::hasPathOrAlgorithm(), pat::Jet::hasSubjets(), HcalMonitorClient::HcalMonitorClient(), Generator::HepMC2G4(), HepMCSplitter::HepMCSplitter(), HLTMuonTrackMassFilter::hltFilter(), HLTMuonL1RegionalFilter::hltFilter(), HLTMuonL1TFilter::hltFilter(), HLTMuonL1TRegionalFilter::hltFilter(), HLTMuonL2FromL1TPreFilter::hltFilter(), HLTMuonL2PreFilter::hltFilter(), HLTMuonL1Filter::hltFilter(), HLTHcalSimpleRecHitFilter::hltFilter(), GenHFHadronMatcher::idInList(), include(), pat::TriggerPath::indexModule(), MSLayersKeeperX0Averaged::init(), crabWrap::initCrabEnvironment(), SiStripDetKey::initFromPath(), SiStripFecKey::initFromPath(), SiStripFedKey::initFromPath(), XrdAdaptor::RequestManager::initialize(), HBHEHitMap::insert(), MuonHOAcceptance::isChannelDead(), MuonHOAcceptance::isChannelSiPM(), edm::eventsetup::EventSetupsController::isFirstMatch(), EcalElectronicsMapper::isGhost(), cms::MuonTCMETValueMapProducer::isGoodTrack(), TCMETAlgo::isGoodTrack(), CSCBadChambers::isInBadChamber(), edm::eventsetup::EventSetupsController::isLastMatch(), HcalDQMChannelQuality::isMasked(), edm::eventsetup::EventSetupsController::isMatchingESProducer(), edm::eventsetup::EventSetupsController::isMatchingESSource(), AlignmentParameterSelector::isMemberOfVector(), SiPixelDisabledModules::isModuleDisabled(), GenHFHadronMatcher::isNeutralPdg(), EBDetId::isNextToEtaBoundary(), HPDNoiseLibraryReader::IsNoiseApplicable(), heppy::IsolationComputer::isoSumNeutralsWeighted(), heppy::IsolationComputer::isoSumRaw(), RPCCosmicSeedrecHitFinder::isouterLayer(), reco::PFDisplacedVertex::isThereKindTracks(), HLTMuonL2ToL1Map::isTriggeredByL1(), HLTMuonL2ToL1TMap::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(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometrySquare(), 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(), CaloTowersCreationAlgo::makeHcalDropChMap(), HiBremRecoveryClusterAlgo::makeIslandSuperClusters(), EgammaHLTNxNClusterProducer::makeNxNClusters(), HSCPValidator::makeRecoPlots(), HSCPValidator::makeSimDigiPlotsECAL(), HSCPValidator::makeSimDigiPlotsRPC(), HSCPValidator::makeSimTrackPlots(), CSCHitFromStripOnly::makeStripData(), PhysicsTools::MVATrainer::makeTrainCalibration(), TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks(), TemplatedSecondaryVertexProducer< IPTI, VTX >::matchGroomedJets(), JetFlavourClustering::matchGroomedJets(), JetPlusTrackCorrector::matchTracks(), PerformancePayloadFromTable::maxPos(), ecaldqm::memDCCIndex(), merge(), CaloTowersMerger::mergedTower(), l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), 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(), StatusSelector::operator()(), PdgIdExcluder::operator()(), PdgIdSelector::operator()(), rpcrawtodigi::DebugDigisPrintout::operator()(), pat::HLTL1MuonMatcher::operator()(), RecoTrackSelectorBase::operator()(), ReadMapType< std::map< std::string, double > >::operator[](), FFTJetDict< Key, T, Compare, Allocator >::operator[](), edm::DetSetVector< T >::operator[](), cmsHarvester.CMSHarvester::option_handler_input_spec(), TransientVertex::originalTrack(), JetMatchingTools::overlapEnergyFraction(), AlpgenHeader::parameterName(), Args::parse(), AlpgenHeader::parse(), SiStripDbParams::partitionNames(), CastorDbProducer::pedestalsCallback(), HcalDbProducer::pedestalsCallback(), CastorDbProducer::pedestalWidthsCallback(), HcalDbProducer::pedestalWidthsCallback(), PedeSteererWeakModeConstraints::PedeSteererWeakModeConstraints(), HcalDbProducer::PFCorrsCallback(), SelectedElectronFEDListProducer< TEle, TCand >::pixelFedDump(), MatrixInjector.MatrixInjector::prepare(), edm::Principal::Principal(), print_trigger_collection(), SiStripConfigDb::printAnalysisDescriptions(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), SiStripConfigDb::printFedDescriptions(), ParticleTreeDrawer::printInfo(), create_public_peakpu_plots::processdata(), DDLNumeric::processElement(), DDLString::processElement(), HIMultiTrackSelector::processMVA(), InterestingEcalDetIdProducer::produce(), JetTracksAssociationDRVertexAssigned::produce(), PileupSummaryInfoSlimmer::produce(), TtSemiLepJetCombMaxSumPtWMass::produce(), TtDilepEvtSolutionMaker::produce(), QuarkoniaTrackSelector::produce(), EcalTPSkimmer::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), StripCompactDigiSimLinksProducer::produce(), GenTrackMatcher::produce(), EcalListOfFEDSProducer::produce(), ESListOfFEDSProducer::produce(), EgammaHLTCombinedIsolationProducer::produce(), EgammaHLTElectronCombinedIsolationProducer::produce(), SiPixelRawToDigi::produce(), TrackListMerger::produce(), EleIsoDetIdCollectionProducer::produce(), ReducedRecHitCollectionProducer::produce(), pat::PATJetUpdater::produce(), LaserAlignmentT0Producer::produce(), JetSubstructurePacker::produce(), ConversionSeedFilterCharge::produce(), pat::GenPlusSimParticleProducer::produce(), GamIsoDetIdCollectionProducer::produce(), HLTJetCollectionsForBoostedLeptonPlusJets< jetType >::produce(), EcalRawToDigi::produce(), pat::PATTauProducer::produce(), pat::PATJetProducer::produce(), CaloTowersMerger::produce(), InterestingTrackEcalDetIdProducer::produce(), ConvBremSeedProducer::produce(), HighPtTrackEcalDetIdProducer::produce(), FlavorHistoryProducer::produce(), MuonMCClassifier::produce(), LaserAlignment::produce(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), ProfilerService::ProfilerService(), SiStripDbParams::pset(), CastorDbProducer::QIEDataCallback(), HcalDbProducer::QIEDataCallback(), HcalDbProducer::QIETypesCallback(), 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(), BtoCharmDecayVertexMergerT< VTX >::resolveBtoDchain(), HcalDbProducer::respCorrsCallback(), PerformancePayloadFromTable::resultPos(), PerformancePayloadFromBinnedTFormula::resultPos(), PerformancePayloadFromTFormula::resultPos(), EcalRecHitWorkerSimple::run(), ecaldqm::IntegrityWriter::run(), ecaldqm::LaserWriter::run(), ecaldqm::PedestalWriter::run(), ecaldqm::PresampleWriter::run(), ecaldqm::TestPulseWriter::run(), ecaldqm::TimingWriter::run(), ecaldqm::LedWriter::run(), ecaldqm::OccupancyWriter::run(), ecaldqm::SummaryWriter::run(), EgHLTOfflineClient::runClient_(), DTLocalTriggerTest::runClientDiagnostic(), DTLocalTriggerTPTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTLocalTriggerEfficiencyTest::runClientDiagnostic(), DTTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerTask::runDDUvsTMAnalysis(), L1MuDTEtaProcessor::runEtaMatchingUnit(), L1MuBMEtaProcessor::runEtaMatchingUnit(), edm::search_all(), SeedingLayerSetsBuilder::SeedingLayerSetsBuilder(), reco::FlavorHistorySelectorUtil::select(), AlCaIsoTracksProducer::select(), SiStripBadModuleGenerator::selectDetectors(), EcalMipGraphs::selectHits(), EcalDisplaysByEvent::selectHits(), AlignmentParameterStore::selectParameters(), CastorCalibrationsSet::setCalibrations(), HcalCalibrationsSet::setCalibrations(), CastorCalibrationWidthsSet::setCalibrationWidths(), HcalCalibrationWidthsSet::setCalibrationWidths(), RBCProcessRPCDigis::setDigiAt(), RBCProcessRPCSimDigis::setDigiAt(), EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(), EcalRecHitWorkerSimple::setFlagBits(), GlobalOptionMgr::setGlobalOption(), 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(), 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(), MSLayersAtAngle::update(), PedsFullNoiseHistosUsingDb::update(), PedestalsHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), LatencyHistosUsingDb::update(), FineDelayHistosUsingDb::update(), KalmanVertexUpdator< N >::update(), HLTScalersClient::CountLSFifo_t::update(), L1RCTProducer::updateFedVector(), 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 11 of file FindCaloHitCone.cc.

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

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

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

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

Definition at line 88 of file FindCaloHitCone.cc.

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

88  {
89 
90  std::vector<HBHERecHitCollection::const_iterator> hit;
91  // Loop over Hcal RecHits
92  for (HBHERecHitCollection::const_iterator j=hits->begin();
93  j!=hits->end(); j++) {
94  DetId detId(j->id());
95  const GlobalPoint rechitPoint = geo->getPosition(detId);
96  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) hit.push_back(j);
97  }
98  return hit;
99  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
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 102 of file FindCaloHitCone.cc.

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

102  {
103 
104  std::vector<edm::PCaloHitContainer::const_iterator> hit;
105  edm::PCaloHitContainer::const_iterator ihit;
106  for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
107  DetId detId(ihit->id());
108  const GlobalPoint rechitPoint = geo->getPosition(detId);
109  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint, debug) < dR) {
110  hit.push_back(ihit);
111  }
112  }
113  return hit;
114  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc: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
const DetId spr::findDetIdCalo ( const CaloSubdetectorGeometry geo,
double  theta,
double  phi,
double  radius,
bool  debug = false 
)

Definition at line 40 of file DetIdFromEtaPhi.cc.

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

Referenced by findDetIdECAL(), and findDetIdHCAL().

40  {
41 
42  double rcyl = radius*std::sin(theta);
43  double z = radius*std::cos(theta);
44  GlobalPoint point (rcyl*std::cos(phi),rcyl*std::sin(phi),z);
45  const DetId cell = geo->getClosestCell(point);
46  if (debug) {
47  std::cout << "findDetIdCalo: rcyl " << rcyl << " z " << z << " Point " << point << " DetId ";
48  if (cell.det() == DetId::Ecal) {
49  if (cell.subdetId() == EcalBarrel) std::cout << (EBDetId)(cell);
50  else std::cout << (EEDetId)(cell);
51  } else {
52  std::cout << (HcalDetId)(cell);
53  }
54  std::cout << std::endl;
55  }
56  return cell;
57  }
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
Geom::Phi< T > phi() const
tuple cout
Definition: gather_cfg.py:145
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
const DetId spr::findDetIdECAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 12 of file DetIdFromEtaPhi.cc.

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

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

Definition at line 28 of file DetIdFromEtaPhi.cc.

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

28  {
29  double radius=0;
30  double theta=2.0*std::atan(exp(-eta));
31  if (std::abs(eta) > spr::etaBEHcal)
32  radius = spr::zFrontHE/std::abs(std::cos(theta));
33  else
34  radius = spr::rFrontHB/std::sin(theta);
36  if (debug) std::cout << "findDetIdHCAL: eta " << eta <<" theta "<<theta<< " phi " << phi << " radius " << radius << std::endl;
37  return spr::findDetIdCalo (gHCAL, theta, phi, radius, debug);
38  }
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)
static const double etaBEHcal
Definition: CaloConstants.h:15
static const double zFrontHE
Definition: CaloConstants.h:13
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
static const double rFrontHB
Definition: CaloConstants.h:14
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
Geom::Phi< T > phi() const
tuple cout
Definition: gather_cfg.py:145
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 42 of file FindDistCone.cc.

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

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

Definition at line 64 of file FindDistCone.cc.

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

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

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

9  {
10 
11  const GlobalVector caloIntersectVector(caloPoint.x(),
12  caloPoint.y(),
13  caloPoint.z()); //p
14 
15  const GlobalVector caloUnitVector = caloVector.unit();
16  const GlobalVector rechitVector(rechitPoint.x(),
17  rechitPoint.y(),
18  rechitPoint.z());
19  const GlobalVector rechitUnitVector = rechitVector.unit();
20  double dotprod_denominator = caloUnitVector.dot(rechitUnitVector);
21  double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
22  double rechitdist = dotprod_numerator/dotprod_denominator;
23  const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
24  const GlobalPoint effectiveRechitPoint(effectiveRechitVector.x(),
25  effectiveRechitVector.y(),
26  effectiveRechitVector.z());
27  GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
28  if (debug) {
29  std::cout << "getDistInPlaneTrackDir: point " << caloPoint << " dirn "
30  << caloVector << " numerator " << dotprod_numerator
31  << " denominator " << dotprod_denominator << " distance "
32  << distance_vector.mag() << std::endl;
33  }
34  if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
35  return distance_vector.mag();
36  } else {
37  return 999999.;
38  }
39  }
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:145
T x() const
Definition: PV3DBase.h:62
double spr::getEnergy ( HBHERecHitCollection::const_iterator  hit,
bool  useRaw = false,
bool  debug = false 
)

Definition at line 141 of file FindDistCone.cc.

References relval_parameters_module::energy.

Referenced by HLTGenericFilter< T1 >::hltFilter().

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

Definition at line 150 of file FindDistCone.cc.

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

150  {
151  // This will not yet handle Ecal CaloHits!!
152  double samplingWeight = 1.;
153  // Hard coded sampling weights from JFH analysis of iso tracks
154  // Sept 2009.
155  DetId id = hit->id();
156  if (id.det() == DetId::Hcal) {
157  HcalDetId detId(id);
158  if (detId.subdet() == HcalBarrel)
159  samplingWeight = 114.1;
160  else if (detId.subdet() == HcalEndcap)
161  samplingWeight = 167.3;
162  else {
163  // ONLY protection against summing HO, HF simhits
164  return 0.;
165  }
166  }
167 
168  return samplingWeight*hit->energy();
169  }
unsigned int id
Definition: DetId.h:18
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:145
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 87 of file FindDistCone.cc.

87  {
88 
89  RH_ieta.push_back(hit->id().ieta());
90  RH_iphi.push_back(hit->id().iphi());
91  RH_ene.push_back(hit->energy());
92  }
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 94 of file FindDistCone.cc.

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

Definition at line 108 of file FindDistCone.cc.

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

Definition at line 114 of file FindDistCone.cc.

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

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

Definition at line 176 of file FindDistCone.cc.

References CaloGeometry::getPosition().

176  {
177  DetId detId(hit->id());
178  return geo->getPosition(detId);
179  }
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  useRaw = false,
bool  debug = false 
)

Definition at line 9 of file eHCALMatrix.cc.

References relval_parameters_module::energy, newFWLiteAna::found, getRawEnergy(), 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 = getRawEnergy(hit.at(ihit), useRaw);
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  }
unsigned int id
float getRawEnergy(const HcalRecHit &h, float valueIfNoSuchMember=-1.0e20)
Definition: rawEnergy.h:225
HcalDetId spr::getHotCell ( std::vector< std::vector< PCaloHit >::const_iterator > &  hit,
bool  includeHO,
bool  useRaw = false,
bool  debug = false 
)

Definition at line 43 of file eHCALMatrix.cc.

References relval_parameters_module::energy, newFWLiteAna::found, getRawEnergy(), HcalOuter, 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 = getRawEnergy(hit.at(ihit),useRaw);
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:49
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:101
float getRawEnergy(const HcalRecHit &h, float valueIfNoSuchMember=-1.0e20)
Definition: rawEnergy.h:225
double spr::getRawEnergy ( HBHERecHitCollection::const_iterator  hit,
bool  useRaw = false 
)

Definition at line 192 of file FindDistCone.cc.

References relval_parameters_module::energy.

Referenced by getHotCell().

192  {
193  double energy = (useRaw) ? hit->eraw() : hit->energy();
194  return energy;
195  }
double spr::getRawEnergy ( edm::PCaloHitContainer::const_iterator  hit,
bool  useRaw = false 
)

Definition at line 201 of file FindDistCone.cc.

201  {
202  return hit->energy();
203  }
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 IsoTrackCalibration::analyze(), IsoTrackCalib::analyze(), IsolatedTracksHcalScale::analyze(), IsoTrig::chgIsolation(), CSCSkim::doBFieldStudySelection(), HcalIsoTrkAnalyzer::fillTree(), AlCaIsoTracksFilter::filter(), IsoTrig::getGoodTracks(), PFEGammaFilters::isElectronSafeForJetMET(), JetTracksAssociationDRCalo::produce(), AlCaIsoTracksProducer::select(), PFElectronAlgo::SetIDOutputs(), IsoTrig::studyIsolation(), IsoTrig::studyMipCut(), IsoTrig::StudyTrkEbyP(), and PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL().

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:568
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:613
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:556
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:527
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:841
double pt() const
track transverse momentum
Definition: TrackBase.h:616
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:752
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:604
#define debug
Definition: HDRShower.cc:19
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:544
reco::TrackBase::TrackQuality minQuality
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:624
tuple cout
Definition: gather_cfg.py:145
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:586
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:807
void spr::hGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const HcalTopology topology,
int  ieta,
int  iphi,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 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:145
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:145
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:145
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:145
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:145
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:145
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:145
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 KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, DetId::Ecal, EcalBarrel, EcalEndcap, extraIds(), CaloGeometry::getSubdetectorGeometry(), CaloTopology::getSubdetectorTopology(), newECALIdNS(), NORTH, and SOUTH.

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

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:145
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:9
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:145
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 KineDebug3::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:145
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 KineDebug3::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:145
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:9
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:145
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 KineDebug3::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:145
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 KineDebug3::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:145
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 KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, plotBeamSpotDB::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:145
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 KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, plotBeamSpotDB::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:145
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 KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, plotBeamSpotDB::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:145
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 KineDebug3::count(), gather_cfg::cout, debugEcalDets(), heppy_check::dirs, EAST, plotBeamSpotDB::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:145
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 KineDebug3::count(), gather_cfg::cout, debugHcalDets(), HcalTopology::east(), plotBeamSpotDB::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:145
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 KineDebug3::count(), gather_cfg::cout, debugHcalDets(), HcalTopology::east(), plotBeamSpotDB::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:145
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 KineDebug3::count(), gather_cfg::cout, debugHcalDets(), plotBeamSpotDB::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:145
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 KineDebug3::count(), gather_cfg::cout, debugHcalDets(), plotBeamSpotDB::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:145
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, RecoTauCleanerPlugins::charge, and gather_cfg::cout.

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
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:145
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 110 of file CaloPropagateTrack.cc.

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

110  {
111 
112  std::vector<spr::propagatedTrackID> vdets;
113  spr::propagateCALO(trkCollection,geo,bField,theTrackQuality, vdets, debug);
114  return vdets;
115  }
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 117 of file CaloPropagateTrack.cc.

References funct::abs(), gather_cfg::cout, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, spr::propagatedTrackID::etaECAL, spr::propagatedTrackID::etaHCAL, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, 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.

117  {
118 
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)));
122  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
123 
124  unsigned int indx;
125  reco::TrackCollection::const_iterator trkItr;
126  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
127  const reco::Track* pTrack = &(*trkItr);
129  vdet.trkItr = trkItr;
130  vdet.ok = (pTrack->quality(trackQuality_));
131  vdet.detIdECAL = DetId(0);
132  vdet.detIdHCAL = DetId(0);
133  vdet.detIdEHCAL= DetId(0);
134  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << vdet.ok << std::endl;
135 
136  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
137  vdet.okECAL = info.second;
138  if (vdet.okECAL) {
139  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
140  vdet.etaECAL = point.eta();
141  vdet.phiECAL = point.phi();
142  if (std::abs(point.eta())<spr::etaBEEcal) {
143  vdet.detIdECAL = barrelGeom->getClosestCell(point);
144  } else {
145  vdet.detIdECAL = endcapGeom->getClosestCell(point);
146  }
147  vdet.detIdEHCAL = gHB->getClosestCell(point);
148  }
149  info = spr::propagateHCAL (pTrack, bField, debug);
150  vdet.okHCAL = info.second;
151  if (vdet.okHCAL) {
152  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
153  vdet.etaHCAL = point.eta();
154  vdet.phiHCAL = point.phi();
155  vdet.detIdHCAL = gHB->getClosestCell(point);
156  }
157  if (debug) {
158  std::cout << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL ("
159  << vdet.okECAL << ") ";
160  if (vdet.detIdECAL.subdetId() == EcalBarrel)
161  std::cout << (EBDetId)(vdet.detIdECAL);
162  else
163  std::cout << (EEDetId)(vdet.detIdECAL);
164  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
165  }
166  vdets.push_back(vdet);
167  }
168 
169  if (debug) {
170  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
171  for (unsigned int i=0; i<vdets.size(); ++i) {
172  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
173  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
174  std::cout << (EBDetId)(vdets[i].detIdECAL);
175  } else {
176  std::cout << (EEDetId)(vdets[i].detIdECAL);
177  }
178  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
179  }
180  }
181  }
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 double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
TrackQuality
track quality
Definition: TrackBase.h:151
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
reco::TrackCollection::const_iterator trkItr
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
tuple cout
Definition: gather_cfg.py:145
*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 183 of file CaloPropagateTrack.cc.

References funct::abs(), gather_cfg::cout, spr::propagatedTrackDirection::detIdECAL, spr::propagatedTrackDirection::detIdEHCAL, spr::propagatedTrackDirection::detIdHCAL, spr::propagatedTrack::direction, spr::propagatedTrackDirection::directionECAL, spr::propagatedTrackDirection::directionHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, 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.

183  {
184 
185  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
186  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
188  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
189 
190  unsigned int indx;
191  reco::TrackCollection::const_iterator trkItr;
192  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
193  const reco::Track* pTrack = &(*trkItr);
195  trkD.trkItr = trkItr;
196  trkD.ok = (pTrack->quality(trackQuality_));
197  trkD.detIdECAL = DetId(0);
198  trkD.detIdHCAL = DetId(0);
199  trkD.detIdEHCAL= DetId(0);
200  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << trkD.ok << std::endl;
201 
203  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
204  trkD.okECAL = info.ok;
205  trkD.pointECAL = point;
206  trkD.directionECAL = info.direction;
207  if (trkD.okECAL) {
208  if (std::abs(info.point.eta())<spr::etaBEEcal) {
209  trkD.detIdECAL = barrelGeom->getClosestCell(point);
210  } else {
211  trkD.detIdECAL = endcapGeom->getClosestCell(point);
212  }
213  trkD.detIdEHCAL = gHB->getClosestCell(point);
214  }
215  info = spr::propagateTrackToHCAL (pTrack, bField, debug);
216  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
217  trkD.okHCAL = info.ok;
218  trkD.pointHCAL = point;
219  trkD.directionHCAL = info.direction;
220  if (trkD.okHCAL) {
221  trkD.detIdHCAL = gHB->getClosestCell(point);
222  }
223  trkDir.push_back(trkD);
224  }
225 
226  if (debug) {
227  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
228  for (unsigned int i=0; i<trkDir.size(); ++i) {
229  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
230  if (trkDir[i].okECAL) {
231  std::cout << " point " << trkDir[i].pointECAL << " direction "
232  << trkDir[i].directionECAL << " ";
233  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
234  std::cout << (EBDetId)(trkDir[i].detIdECAL);
235  } else {
236  std::cout << (EEDetId)(trkDir[i].detIdECAL);
237  }
238  }
239  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
240  if (trkDir[i].okHCAL) {
241  std::cout << " point " << trkDir[i].pointHCAL << " direction "
242  << trkDir[i].directionHCAL << " "
243  << (HcalDetId)(trkDir[i].detIdHCAL);
244  }
245  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
246  }
247  }
248  }
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 double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
TrackQuality
track quality
Definition: TrackBase.h:151
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
spr::propagatedTrack propagateTrackToECAL(const reco::Track *, const MagneticField *, bool debug=false)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
reco::TrackCollection::const_iterator trkItr
tuple cout
Definition: gather_cfg.py:145
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 250 of file CaloPropagateTrack.cc.

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

250  {
251 
252  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
253  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
255 
257  vdet.ok = true;
258  vdet.detIdECAL = DetId(0);
259  vdet.detIdHCAL = DetId(0);
260  vdet.detIdEHCAL= DetId(0);
261  if (debug) std::cout << "Propagate track: p " << pTrack->p() << " eta " << pTrack->eta() << " phi " << pTrack->phi() << " Flag " << vdet.ok << std::endl;
262 
263  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
264  vdet.okECAL = info.second;
265  if (vdet.okECAL) {
266  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
267  vdet.etaECAL = point.eta();
268  vdet.phiECAL = point.phi();
269  if (std::abs(point.eta())<spr::etaBEEcal) {
270  vdet.detIdECAL = barrelGeom->getClosestCell(point);
271  } else {
272  vdet.detIdECAL = endcapGeom->getClosestCell(point);
273  }
274  vdet.detIdEHCAL = gHB->getClosestCell(point);
275  }
276  info = spr::propagateHCAL (pTrack, bField, debug);
277  vdet.okHCAL = info.second;
278  if (vdet.okHCAL) {
279  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
280  vdet.etaHCAL = point.eta();
281  vdet.phiHCAL = point.phi();
282  vdet.detIdHCAL = gHB->getClosestCell(point);
283  }
284 
285  if (debug) {
286  std::cout << "propagateCALO:: for 1 track" << std::endl;
287  std::cout << "Track [0] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
288  if (vdet.detIdECAL.subdetId() == EcalBarrel) {
289  std::cout << (EBDetId)(vdet.detIdECAL);
290  } else {
291  std::cout << (EEDetId)(vdet.detIdECAL);
292  }
293  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or " << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
294  }
295  return vdet;
296  }
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
static const double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
virtual DetId getClosestCell(const GlobalPoint &r) const
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:145
*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 298 of file CaloPropagateTrack.cc.

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

298  {
299 
300  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
301  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
303 
304  std::vector<spr::propagatedGenTrackID> trkDir;
305  unsigned int indx;
306  HepMC::GenEvent::particle_const_iterator p;
307  for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++p,++indx) {
309  trkD.trkItr = p;
310  trkD.detIdECAL = DetId(0);
311  trkD.detIdHCAL = DetId(0);
312  trkD.detIdEHCAL= DetId(0);
313  trkD.pdgId = ((*p)->pdg_id());
314  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge())/3;
315  GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
316  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
317 
318  // consider stable particles
319  if ( (*p)->status()==1 && std::abs((*p)->momentum().eta()) < etaMax ) {
320  GlobalPoint vertex = GlobalPoint(0.1*(*p)->production_vertex()->position().x(),
321  0.1*(*p)->production_vertex()->position().y(),
322  0.1*(*p)->production_vertex()->position().z());
323  trkD.ok = true;
325  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
326  trkD.okECAL = info.ok;
327  trkD.pointECAL = point;
328  trkD.directionECAL = info.direction;
329  if (trkD.okECAL) {
330  if (std::abs(info.point.eta())<spr::etaBEEcal) {
331  trkD.detIdECAL = barrelGeom->getClosestCell(point);
332  } else {
333  trkD.detIdECAL = endcapGeom->getClosestCell(point);
334  }
335  trkD.detIdEHCAL = gHB->getClosestCell(point);
336  }
337 
338  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
339  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
340  trkD.okHCAL = info.ok;
341  trkD.pointHCAL = point;
342  trkD.directionHCAL = info.direction;
343  if (trkD.okHCAL) {
344  trkD.detIdHCAL = gHB->getClosestCell(point);
345  }
346  }
347  trkDir.push_back(trkD);
348  }
349 
350  if (debug) {
351  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
352  for (unsigned int i=0; i<trkDir.size(); ++i) {
353  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
354  if (trkDir[i].okECAL) {
355  std::cout << " point " << trkDir[i].pointECAL << " direction "
356  << trkDir[i].directionECAL << " ";
357  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
358  std::cout << (EBDetId)(trkDir[i].detIdECAL);
359  } else {
360  std::cout << (EEDetId)(trkDir[i].detIdECAL);
361  }
362  }
363  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
364  if (trkDir[i].okHCAL) {
365  std::cout << " point " << trkDir[i].pointHCAL << " direction "
366  << trkDir[i].directionHCAL << " "
367  << (HcalDetId)(trkDir[i].detIdHCAL);
368  }
369  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
370  }
371  }
372  return trkDir;
373  }
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 double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
virtual DetId getClosestCell(const GlobalPoint &r) const
static const double zFrontHE
Definition: CaloConstants.h:13
uint32_t ID
Definition: Definitions.h:26
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
HepMC::GenEvent::particle_const_iterator trkItr
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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:145
*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 375 of file CaloPropagateTrack.cc.

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

375  {
376 
377  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
378  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
380 
381  std::vector<spr::propagatedGenParticleID> trkDir;
382  unsigned int indx;
383  reco::GenParticleCollection::const_iterator p;
384  for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++p,++indx) {
386  trkD.trkItr = p;
387  trkD.detIdECAL = DetId(0);
388  trkD.detIdHCAL = DetId(0);
389  trkD.detIdEHCAL= DetId(0);
390  trkD.pdgId = (p->pdgId());
391  trkD.charge = p->charge();
392  GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
393  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
394 
395  // consider stable particles
396  if ( p->status()==1 && std::abs(momentum.eta()) < etaMax ) {
397  GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
398  trkD.ok = true;
400  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
401  trkD.okECAL = info.ok;
402  trkD.pointECAL = point;
403  trkD.directionECAL = info.direction;
404  if (trkD.okECAL) {
405  if (std::abs(info.point.eta())<spr::etaBEEcal) {
406  trkD.detIdECAL = barrelGeom->getClosestCell(point);
407  } else {
408  trkD.detIdECAL = endcapGeom->getClosestCell(point);
409  }
410  trkD.detIdEHCAL = gHB->getClosestCell(point);
411  }
412 
413  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, spr::zFrontHE, spr::rFrontHB, spr::etaBEHcal, debug);
414  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
415  trkD.okHCAL = info.ok;
416  trkD.pointHCAL = point;
417  trkD.directionHCAL = info.direction;
418  if (trkD.okHCAL) {
419  trkD.detIdHCAL = gHB->getClosestCell(point);
420  }
421  }
422  trkDir.push_back(trkD);
423  }
424 
425  if (debug) {
426  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
427  for (unsigned int i=0; i<trkDir.size(); ++i) {
428  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
429  if (trkDir[i].okECAL) {
430  std::cout << " point " << trkDir[i].pointECAL << " direction "
431  << trkDir[i].directionECAL << " ";
432  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
433  std::cout << (EBDetId)(trkDir[i].detIdECAL);
434  } else {
435  std::cout << (EEDetId)(trkDir[i].detIdECAL);
436  }
437  }
438  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
439  if (trkDir[i].okHCAL) {
440  std::cout << " point " << trkDir[i].pointHCAL << " direction "
441  << trkDir[i].directionHCAL << " "
442  << (HcalDetId)(trkDir[i].detIdHCAL);
443  }
444  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
445  }
446  }
447  return trkDir;
448  }
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 double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
virtual DetId getClosestCell(const GlobalPoint &r) const
reco::GenParticleCollection::const_iterator trkItr
static const double zFrontHE
Definition: CaloConstants.h:13
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
T eta() const
Definition: PV3DBase.h:76
tuple cout
Definition: gather_cfg.py:145
*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 450 of file CaloPropagateTrack.cc.

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

450  {
451 
452  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
453  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
455 
456  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
458  trkD.ok = trk.ok;
459  trkD.detIdECAL = DetId(0);
460  trkD.detIdHCAL = DetId(0);
461  trkD.detIdEHCAL= DetId(0);
462  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
463 
464  if (trkD.ok) {
466  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
467  trkD.okECAL = info.ok;
468  trkD.pointECAL = point;
469  trkD.directionECAL = info.direction;
470  if (trkD.okECAL) {
471  if (std::abs(info.point.eta())<spr::etaBEEcal) {
472  trkD.detIdECAL = barrelGeom->getClosestCell(point);
473  } else {
474  trkD.detIdECAL = endcapGeom->getClosestCell(point);
475  }
476  trkD.detIdEHCAL = gHB->getClosestCell(point);
477  }
478 
480  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
481  trkD.okHCAL = info.ok;
482  trkD.pointHCAL = point;
483  trkD.directionHCAL = info.direction;
484  if (trkD.okHCAL) {
485  trkD.detIdHCAL = gHB->getClosestCell(point);
486  }
487  }
488 
489  if (debug) {
490  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
491  if (trkD.okECAL) {
492  std::cout << "ECAL point " << trkD.pointECAL << " direction "
493  << trkD.directionECAL << " ";
494  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
495  std::cout << (EBDetId)(trkD.detIdECAL);
496  } else {
497  std::cout << (EEDetId)(trkD.detIdECAL);
498  }
499  }
500  if (trkD.okHCAL) {
501  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
502  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
503  }
504  if (trkD.okECAL) std::cout << " Or " << (HcalDetId)(trkD.detIdEHCAL);
505  std::cout << std::endl;
506  }
507 
508  return trkD;
509  }
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 double etaBEEcal
Definition: CaloConstants.h:12
static const TGPicture * info(bool iBackgroundIsBlack)
static const double etaBEHcal
Definition: CaloConstants.h:15
virtual DetId getClosestCell(const GlobalPoint &r) const
static const double zFrontHE
Definition: CaloConstants.h:13
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
static const double rFrontHB
Definition: CaloConstants.h:14
static const double zFrontEE
Definition: CaloConstants.h:9
static const double rFrontEB
Definition: CaloConstants.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:145
*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 635 of file CaloPropagateTrack.cc.

References funct::abs(), alongMomentum, Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::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(), propagateHCALBack(), propagateTracker(), propagateTrackToECAL(), and propagateTrackToHCAL().

635  {
636 
637  spr::propagatedTrack track;
638  if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
639  FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
640 
643 
645 
646  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
647 
649  if (tpMomentum.eta() < 0) {
650  tsose = myAP.propagate(fts, *lendcap);
651  } else {
652  tsose = myAP.propagate(fts, *rendcap);
653  }
654 
655  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
656 
657  track.ok=true;
658  if (tsose.isValid() && tsosb.isValid()) {
659  float absEta = std::abs(tsosb.globalPosition().eta());
660  if (absEta < corner) {
661  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
662  track.direction = tsosb.globalDirection();
663  } else {
664  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
665  track.direction = tsose.globalDirection();
666  }
667  } else if (tsose.isValid()) {
668  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
669  track.direction = tsose.globalDirection();
670  } else if (tsosb.isValid()) {
671  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
672  track.direction = tsosb.globalDirection();
673  } else {
674  track.point.SetXYZ(-999., -999., -999.);
675  track.direction = GlobalVector(0,0,1);
676  track.ok = false;
677  }
678  if (debug) {
679  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
680  if (track.ok) {
681  math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
682  double dphi = track.direction.phi()-tpMomentum.phi();
683  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
684  double pt = tpMomentum.perp();
685  double rat = 0.5*dphi/std::sin(0.5*dphi);
686  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;
687  }
688  }
689  return track;
690  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
T sqrt(T t)
Definition: SSEVec.h:18
T phi() const
Definition: Phi.h:41
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T eta() const
Definition: PV3DBase.h:76
tuple cout
Definition: gather_cfg.py:145
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 19 of file CaloPropagateTrack.cc.

References funct::abs(), RecoTauCleanerPlugins::charge, reco::TrackBase::charge(), gather_cfg::cout, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, DetId::Ecal, EcalBarrel, EcalEndcap, etaBEEcal, spr::propagatedTrackID::etaECAL, spr::propagatedTrackID::etaHCAL, CaloSubdetectorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, 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.

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

Definition at line 541 of file CaloPropagateTrack.cc.

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

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

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

Definition at line 548 of file CaloPropagateTrack.cc.

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

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

Definition at line 568 of file CaloPropagateTrack.cc.

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

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

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

Definition at line 575 of file CaloPropagateTrack.cc.

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

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

Definition at line 511 of file CaloPropagateTrack.cc.

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

Referenced by HcalHBHEMuonAnalyzer::analyze().

511  {
513  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
514  GlobalVector momentum (track->px(), track->py(), track->pz());
515  int charge (track->charge());
517  if (info.ok) {
518  const GlobalPoint point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
519  return std::pair<bool,HcalDetId>(true,HcalDetId(gHB->getClosestCell(point)));
520  } else {
521  return std::pair<bool,HcalDetId>(false,HcalDetId());
522  }
523  }
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)
static const double etaBEHcal
Definition: CaloConstants.h:15
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static const double zBackHE
Definition: CaloConstants.h:16
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
static const double rBackHB
Definition: CaloConstants.h:17
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
virtual DetId getClosestCell(const GlobalPoint &r) const
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
int charge() const
track electric charge
Definition: TrackBase.h:562
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 580 of file CaloPropagateTrack.cc.

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

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

Definition at line 588 of file CaloPropagateTrack.cc.

References funct::abs(), alongMomentum, Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::build(), RecoTauCleanerPlugins::charge, 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(), PV3DBase< T, PVType, FrameType >::z(), and zFrontTE.

Referenced by IsolatedTracksNxN::analyze().

588  {
589 
590  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
591  GlobalVector momentum (track->px(), track->py(), track->pz());
592  int charge (track->charge());
593  float radius = track->outerPosition().Rho();
594  float zdist = track->outerPosition().Z();
595  if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;
596 
597  FreeTrajectoryState fts (vertex, momentum, charge, bField);
600 
601  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
602 
603  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
604  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
605 
606  math::XYZPoint point(-999.,-999.,-999.);
607  bool ok=false;
608  GlobalVector direction(0,0,1);
609  if (tsosb.isValid() && std::abs(zdist) < spr::zFrontTE) {
610  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
611  direction = tsosb.globalDirection();
612  ok = true;
613  } else if (tsose.isValid()) {
614  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
615  direction = tsose.globalDirection();
616  ok = true;
617  }
618 
619  double length = -1;
620  if (ok) {
621  math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
622  double dphi = direction.phi()-momentum.phi();
623  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
624  double rat = 0.5*dphi/std::sin(0.5*dphi);
625  double dZ = vDiff.z();
626  double dS = rdist*rat; //dZ*momentum.z()/momentum.perp();
627  length = std::sqrt(dS*dS+dZ*dZ);
628  if (debug)
629  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;
630  }
631 
632  return std::pair<math::XYZPoint,double>(point,length);
633  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
T sqrt(T t)
Definition: SSEVec.h:18
T phi() const
Definition: Phi.h:41
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
#define debug
Definition: HDRShower.cc:19
static const double zFrontTE
Definition: CaloConstants.h:20
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
tuple cout
Definition: gather_cfg.py:145
int charge() const
track electric charge
Definition: TrackBase.h:562
T x() const
Definition: PV3DBase.h:62
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
GlobalVector globalDirection() const
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 525 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

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

Definition at line 532 of file CaloPropagateTrack.cc.

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

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

Definition at line 553 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

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

Definition at line 560 of file CaloPropagateTrack.cc.

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

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

Definition at line 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:145
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 692 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().

692  {
693 
694  spr::trackAtOrigin trk;
695 
696  edm::SimTrackContainer::const_iterator itr = SimTk->end();
697  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
698  if ( simTrkItr->trackId() == thisTrk ) {
699  if (debug) std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
700  itr = simTrkItr;
701  break;
702  }
703  }
704 
705  if (itr != SimTk->end()) {
706  int vertIndex = itr->vertIndex();
707  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
708  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
709  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
710  const math::XYZTLorentzVectorD pos = simVtxItr->position();
711  const math::XYZTLorentzVectorD mom = itr->momentum();
712  trk.ok = true;
713  trk.charge = (int)(itr->charge());
714  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
715  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
716  }
717  }
718  if (debug) std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;;
719  return trk;
720  }
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:145
Global3DVector GlobalVector
Definition: GlobalVector.h:10
double spr::timeOfFlight ( DetId  id,
const CaloGeometry geo,
bool  debug = false 
)

Definition at line 13 of file CaloSimInfo.cc.

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

Referenced by GEMHitsValidation::analyze(), and RPCDigiSimLink::RPCDigiSimLink().

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

Definition at line 118 of file MatchingSimTrack.cc.

References begin, and gather_cfg::cout.

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  }
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:145
bool validSimTrack(unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)

Variable Documentation

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

Definition at line 23 of file CaloConstants.h.

Referenced by propagateTracker().

const double spr::rBackHB = 288.8
static

Definition at line 17 of file CaloConstants.h.

Referenced by propagateHCALBack().

const double spr::rBackTB = 109.0
static

Definition at line 22 of file CaloConstants.h.

Referenced by propagateTracker().

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

Definition at line 18 of file CaloConstants.h.

Referenced by timeOfFlight().

const double spr::zBackHE = 549.3
static

Definition at line 16 of file CaloConstants.h.

Referenced by propagateHCALBack().

const double spr::zBackTE = 290.0
static

Definition at line 21 of file CaloConstants.h.

Referenced by propagateTracker().

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

Definition at line 11 of file CaloConstants.h.

Referenced by timeOfFlight().

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

Definition at line 19 of file CaloConstants.h.

Referenced by timeOfFlight().

const double spr::zFrontTE = 110.0
static

Definition at line 20 of file CaloConstants.h.

Referenced by propagateTrackerEnd().