CMS 3D CMS Logo

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

Classes

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

Functions

template<typename T >
energyMap caloSimInfoMatrix (const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, double timeCut=150, bool includeHO=false, bool debug=false)
 
void cGenSimInfo (std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (std::vector< DetId > &vdets, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
 
void cGenSimInfo (int charge, int pdgid, double p, spr::genSimInfo &info, bool debug=false)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &theNavigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string theTrackQuality, bool debug)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &navigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
bool chargeIsolation (const DetId anyCell, CaloNavigator< DetId > &navigator, int deta, int dphi)
 
bool chargeIsolation (const DetId anyCell, std::vector< DetId > &vdets)
 
double chargeIsolationCone (unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
 
double chargeIsolationEcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationEcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationEcal (const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationHcal (reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double coneChargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
 
int coneChargeIsolation (const GlobalPoint &hpoint1, const GlobalPoint &point2, const GlobalVector &trackMom, double dR)
 
void debugEcalDets (unsigned int, const DetId &, bool)
 
void debugEcalDets (unsigned int, std::vector< DetId > &)
 
void debugEcalDets (unsigned int, std::vector< DetId > &, std::vector< CaloDirection > &)
 
void debugHcalDets (unsigned int, std::vector< DetId > &)
 
template<typename T >
void eCaloSimInfo (std::vector< DetId > vdets, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
void eCaloSimInfo (const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool includeHO=false, bool debug=false)
 
std::map< std::string, double > eCaloSimInfo (caloSimInfo &info)
 
template<typename T >
double eCaloSimInfo (const edm::Event &, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
double eCaloSimInfo (const edm::Event &, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eCaloSimInfo (edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, std::vector< int > &multiplicityVector, bool debug=false)
 
template<typename T >
double eCone_ecal (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500)
 
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)
 
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)
 
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)
 
template<typename T >
double eECALmatrix (CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ietaE, int ietaW, int iphiN, int iphiS, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
eECALmatrixCell (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eECALmatrixTotal (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, CaloNavigator< DetId > &navigator, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
energyMap eECALSimInfoMatrix (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfoTotal (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, spr::genSimInfo &info, bool debug=false)
 
void eGenSimInfo (const DetId &coreDet, reco::GenParticleCollection::const_iterator trkItr, std::vector< spr::propagatedGenParticleID > &trackIds, const CaloGeometry *geo, const CaloTopology *caloTopology, double dR, const GlobalVector &trackMom, spr::genSimInfo &info, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, GlobalPoint &gPosHotCell)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, std::set< int > &uniqueIdset)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
eHCALmatrixCell (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
std::map< std::string, double > eHCALSimInfo (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
void eHCALSimInfo (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
void eHCALSimInfo (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo &info, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
std::map< std::string, double > eHCALSimInfo (const edm::Event &iEvent, const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, std::vector< int > &multiplicityVector, bool debug=false)
 
template<typename T >
energyMap eHCALSimInfoMatrix (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
std::map< std::string, double > eHCALSimInfoTotal (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
energyDetIdHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
energyECALCell (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
double energyECALTower (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vNeighboursDetId, std::vector< DetId > &dets, const HcalTopology *topology, edm::Handle< T > &hits, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCALmatrixNew (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
void extraIds (const DetId &det, std::vector< DetId > &dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, bool debug=false)
 
void find (edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< HBHERecHitCollection > &hits, DetId thisDet, std::vector< HBHERecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< edm::PCaloHitContainer > &hits, DetId thisDet, std::vector< edm::PCaloHitContainer::const_iterator > &hit, bool debug=false)
 
std::vector
< EcalRecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
std::vector
< EcalRecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR)
 
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)
 
std::vector
< HBHERecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< HBHERecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
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)
 
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)
 
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)
 
double getDistInCMatEcal (double eta1, double phi1, double eta2, double phi2)
 
double getDistInCMatHcal (double eta1, double phi1, double eta2, double phi2)
 
double getDistInPlaneTrackDir (const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint)
 
double getEnergy (HBHERecHitCollection::const_iterator hit)
 
double getEnergy (edm::PCaloHitContainer::const_iterator hit)
 
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)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, int &ieta, int &iphi)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, int &ieta, int &iphi)
 
GlobalPoint getGpos (const CaloGeometry *geo, HBHERecHitCollection::const_iterator hit)
 
GlobalPoint getGpos (const CaloGeometry *geo, edm::PCaloHitContainer::const_iterator hit)
 
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)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false)
 
std::vector< DetIdmatrixECALIds (const DetId &det, double dR, const GlobalVector &trackMom, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false)
 
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)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ietaE, int ietaW, int iphiN, int iphiS, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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::pair< math::XYZPoint, bool > propagateECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateECAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateTracker (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, double > propagateTrackerEnd (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToECAL (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToHCAL (const reco::Track *, const MagneticField *, bool debug=false)
 
spr::propagatedTrack propagateTrackToHCAL (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const MagneticField *, bool debug=false)
 
void simpleMove (DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
 
spr::trackAtOrigin simTrackAtOrigin (unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
double timeOfFlight (DetId id, const CaloGeometry *geo, bool debug=false)
 
bool validSimTrack (unsigned int simTkId, edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 

Function Documentation

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

Definition at line 87 of file GenSimInfo.cc.

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

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

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

Definition at line 122 of file GenSimInfo.cc.

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

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

Definition at line 158 of file GenSimInfo.cc.

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

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

Definition at line 13 of file ChargeIsolationExtra.cc.

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

13  {
14 
15  double maxNearP = -1.0;
17 
18  // const DetId anyCell,
19  reco::TrackCollection::const_iterator trkItr2;
20  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
21 
22  const reco::Track* pTrack2 = &(*trkItr2);
23 
24  bool trkQuality = pTrack2->quality(trackQuality_);
25  if ( (trkItr2 != trkItr) && trkQuality ) {
26 
27  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
28  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
29  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());
30 
31  if (info2.isGoodEcal ) {
32  if (std::abs(point2.eta())<1.479) {
33  const DetId anyCell = gEB->getClosestCell(point2);
34  if (!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
35  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
36  }
37  } else {
38  const DetId anyCell = gEE->getClosestCell(point2);
39  if(!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
40  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
41  }
42  }
43  } //info2.isGoodEcal
44  }
45  }
46  return maxNearP;
47  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:591
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:113
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:102
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:479
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
double spr::chargeIsolation ( const edm::Event iEvent,
const edm::EventSetup iSetup,
CaloNavigator< DetId > &  navigator,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const CaloSubdetectorGeometry gEB,
const CaloSubdetectorGeometry gEE,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)
bool spr::chargeIsolation ( const DetId  anyCell,
CaloNavigator< DetId > &  navigator,
int  deta,
int  dphi 
)

Definition at line 51 of file ChargeIsolationExtra.cc.

51  {
52 
53  bool isIsolated = false;
54 
55  DetId thisDet;
56 
57  for (int dx = -ieta; dx < ieta+1; ++dx) {
58  for (int dy = -iphi; dy < iphi+1; ++dy) {
59 
60  thisDet = navigator.offsetBy(dx, dy);
61  navigator.home();
62 
63  if (thisDet != DetId(0)) {
64  if (thisDet == anyCell) {
65  isIsolated = false;
66  return isIsolated;
67  }
68  }
69  }
70  }
71  return isIsolated;
72  }
Definition: DetId.h:18
bool spr::chargeIsolation ( const DetId  anyCell,
std::vector< DetId > &  vdets 
)

Definition at line 164 of file ChargeIsolation.cc.

References i.

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

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

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

Referenced by IsoTrig::analyze(), and IsolatedTracksHcalScale::analyze().

232  {
233 
234  double maxNearP = -1.0;
235  nNearTRKs = 0;
236  if (trkDirs[trkIndex].okHCAL) {
237  for (unsigned int indx=0; indx<trkDirs.size(); ++indx) {
238  if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
239  int isConeChargedIso = spr::coneChargeIsolation(trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
240  if (isConeChargedIso==0) {
241  nNearTRKs++;
242  const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
243  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
244  }
245  }
246  }
247  }
248  return maxNearP;
249  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:591
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 76 of file ChargeIsolationExtra.cc.

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

76  {
77 
78  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
79  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
80 
81  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
82  if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
83 
84  double maxNearP = -1.0;
86 
87  // const DetId anyCell,
88  reco::TrackCollection::const_iterator trkItr2;
89  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
90 
91  const reco::Track* pTrack2 = &(*trkItr2);
92 
93  bool trkQuality = pTrack2->quality(trackQuality_);
94  if ( (trkItr2 != trkItr) && trkQuality ) {
95 
96  const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
97  TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
98  const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());
99 
100  if (info2.isGoodEcal ) {
101  if (std::abs(point2.eta())<1.479) {
102  const DetId anyCell = barrelGeom->getClosestCell(point2);
103  if (!spr::chargeIsolation(anyCell,vdets)) {
104  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
105  }
106  } else {
107  const DetId anyCell = endcapGeom->getClosestCell(point2);
108  if (!spr::chargeIsolation(anyCell,vdets)) {
109  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
110  }
111  }
112  } //info2.isGoodEcal
113  }
114  }
115  return maxNearP;
116  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:591
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:113
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:102
#define debug
Definition: HDRShower.cc:19
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:479
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
tuple cout
Definition: gather_cfg.py:121
double spr::chargeIsolationEcal ( unsigned int  trkIndex,
std::vector< spr::propagatedTrackID > &  vdetIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 13 of file ChargeIsolation.cc.

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

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

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

Definition at line 43 of file ChargeIsolation.cc.

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

43  {
44 
45  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
46  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
47 
48  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
49  if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
50 
51  double maxNearP = -1.0;
53 
54  // const DetId anyCell,
55  reco::TrackCollection::const_iterator trkItr2;
56  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
57 
58  const reco::Track* pTrack2 = &(*trkItr2);
59 
60  bool trkQuality = pTrack2->quality(trackQuality_);
61  if ( (trkItr2 != trkItr) && trkQuality ) {
62 
63  std::pair<math::XYZPoint,bool> info = spr::propagateECAL(pTrack2,bField);
64  const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());
65 
66  if (info.second) {
67  if (std::abs(point2.eta())<1.479) {
68  const DetId anyCell = barrelGeom->getClosestCell(point2);
69  if (!spr::chargeIsolation(anyCell,vdets)) {
70  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
71  }
72  } else {
73  const DetId anyCell = endcapGeom->getClosestCell(point2);
74  if (!spr::chargeIsolation(anyCell,vdets)) {
75  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
76  }
77  }
78  } //info.second
79  }
80  }
81  return maxNearP;
82  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:591
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)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:113
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:102
#define debug
Definition: HDRShower.cc:19
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:479
tuple cout
Definition: gather_cfg.py:121
double spr::chargeIsolationHcal ( const edm::Event iEvent,
const edm::EventSetup iSetup,
reco::TrackCollection::const_iterator  trkItr,
edm::Handle< reco::TrackCollection trkCollection,
const DetId  ClosestCell,
const HcalTopology topology,
const CaloSubdetectorGeometry gHB,
TrackDetectorAssociator associator,
TrackAssociatorParameters parameters_,
int  ieta,
int  iphi,
std::string &  theTrackQuality,
bool  debug = false 
)

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

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

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

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

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

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

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

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

References getDistInPlaneTrackDir().

252  {
253 
254  int isIsolated = 1;
255  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR) isIsolated = 1;
256  else isIsolated = 0;
257  return isIsolated;
258  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint)
Definition: FindDistCone.cc:8
void spr::debugEcalDets ( unsigned int  i,
const DetId det,
bool  flag 
)

Definition at line 11 of file DebugInfo.cc.

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

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

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

Definition at line 26 of file DebugInfo.cc.

References debugEcalDets(), and i.

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

Definition at line 33 of file DebugInfo.cc.

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

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

Definition at line 42 of file DebugInfo.cc.

References gather_cfg::cout, and i.

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

42  {
43 
44  for (unsigned int i=last; i<vdets.size(); ++i) {
45  HcalDetId id = vdets[i]();
46  std::cout << "Cell [" << i << "] 0x" << std::hex << vdets[i]()
47  << std::dec << " " << id << std::endl;
48  }
49  }
int i
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:121
template<typename T >
void spr::eCaloSimInfo ( std::vector< DetId vdets,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eCaloSimInfo ( const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
std::map<std::string,double> spr::eCaloSimInfo ( caloSimInfo &  info)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eCaloSimInfo ( edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
std::vector< int > &  multiplicityVector,
bool  debug = false 
)
template<typename T >
double spr::eCone_ecal ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500 
)
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 
)
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 
)
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 
)
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, EcalBarrel, EcalEndcap, CastorDataFrameFilter_impl::energySum(), findHit(), archive::flag, edm::HandleBase::isValid(), EcalSeverityLevel::kWeird, matrixECALIds(), convertSQLiteXML::ok, edm::Handle< T >::product(), EcalSeverityLevelAlgo::severityLevel(), and groupFilesInBlocks::tt.

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

Definition at line 64 of file eECALMatrix.cc.

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

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

Definition at line 11 of file GenSimInfo.cc.

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

Referenced by IsolatedGenParticles::analyze().

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

Definition at line 20 of file GenSimInfo.cc.

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

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

Definition at line 29 of file GenSimInfo.cc.

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

29  {
30 
31  if (debug) std::cout << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
32 
33  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, false);
34  if (debug) spr::debugEcalDets(0, vdets);
35  spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
36  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void 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
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
void spr::eGenSimInfo ( const DetId coreDet,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
const CaloGeometry geo,
const CaloTopology caloTopology,
double  dR,
const GlobalVector trackMom,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 38 of file GenSimInfo.cc.

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

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

Referenced by eECALmatrix().

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

Definition at line 663 of file MatrixECALDetIds.cc.

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

Referenced by matrixECALIds().

663  {
664 
665  if (det.subdetId() == EcalBarrel) {
666  EBDetId id = det;
667  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
668  << "|" << ietaE << " columns " << iphiS << "|"
669  << iphiN << std::endl;
670  int etaC = id.ietaAbs();
671  int phiC = id.iphi();
672  int zsid = id.zside();
673  for (int eta = -ietaW; eta <= ietaE; ++eta) {
674  for (int phi = -iphiS; phi <= iphiN; ++phi) {
675  int iphi = phiC+phi;
676  if (iphi < 0) iphi += 360;
677  else if (iphi > 360) iphi -= 360;
678  int ieta = zsid*(etaC+eta);
679  if (EBDetId::validDetId(ieta,iphi)) {
680  id = EBDetId(ieta,iphi);
681  if (barrelGeom.present(id)) {
682  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
683  cells.push_back((DetId)id);
684  }
685  }
686  }
687  }
688  }
689  } else if (det.subdetId() == EcalEndcap) {
690  EEDetId id = det;
691  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
692  << "|" << ietaE << " columns " << iphiS << "|"
693  << iphiN << std::endl;
694  int ixC = id.ix();
695  int iyC = id.iy();
696  int zsid = id.zside();
697  for (int kx = -ietaW; kx <= ietaE; ++kx) {
698  for (int ky = -iphiS; ky <= iphiN; ++ky) {
699  int ix = ixC+kx;
700  int iy = iyC+ky;
701  if (EEDetId::validDetId(ix,iy,zsid)) {
702  id = EEDetId(ix,iy,zsid);
703  if (endcapGeom.present(id)) {
704  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
705  cells.push_back((DetId)id);
706  }
707  }
708  }
709  }
710  }
711  }
712 
713  if (debug) {
714  std::cout << "extraIds:: finds " << cells.size() << " new cells"
715  << std::endl;
716  spr::debugEcalDets (0, cells);
717  }
718  }
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
T eta() const
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
void spr::find ( edm::Handle< EcalRecHitCollection > &  hits,
DetId  thisDet,
std::vector< EcalRecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 7 of file FindCaloHit.cc.

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

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

Definition at line 12 of file FindCaloHit.cc.

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

Definition at line 17 of file FindCaloHit.cc.

17  {
18 
19  edm::PCaloHitContainer::const_iterator ihit;
20  for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
21  DetId detId(ihit->id());
22  if (detId == thisDet) {
23  hit.push_back(ihit);
24  }
25  }
26  }
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 
)

Definition at line 9 of file FindCaloHitCone.cc.

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

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

Definition at line 34 of file FindCaloHitCone.cc.

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

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

Definition at line 86 of file FindCaloHitCone.cc.

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

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

Definition at line 100 of file FindCaloHitCone.cc.

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

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

Definition at line 37 of file DetIdFromEtaPhi.cc.

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

Referenced by findDetIdECAL(), and findDetIdHCAL().

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

Definition at line 11 of file DetIdFromEtaPhi.cc.

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

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

Definition at line 27 of file DetIdFromEtaPhi.cc.

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

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

Referenced by eECALmatrix().

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

Definition at line 35 of file FindDistCone.cc.

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

35  {
36 
37  double dR, Rec;
38  if (fabs(eta1)<1.479) Rec=129;
39  else Rec=317;
40  double ce1=cosh(eta1);
41  double ce2=cosh(eta2);
42  double te1=tanh(eta1);
43  double te2=tanh(eta2);
44 
45  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
46  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
47  else dR=999999.;
48  return dR;
49  }
float float float z
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double spr::getDistInCMatHcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)

Definition at line 53 of file FindDistCone.cc.

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

53  {
54 
55  // Radii and eta from Geometry/HcalCommonData/data/hcalendcapalgo.xml
56  // and Geometry/HcalCommonData/data/hcalbarrelalgo.xml
57 
58  double dR, Rec;
59  if (fabs(eta1)<1.392) Rec=177.5;
60  else Rec=391.95;
61  double ce1=cosh(eta1);
62  double ce2=cosh(eta2);
63  double te1=tanh(eta1);
64  double te2=tanh(eta2);
65 
66  double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
67  if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
68  else dR=999999.;
69  return dR;
70  }
float float float z
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double spr::getDistInPlaneTrackDir ( const GlobalPoint caloPoint,
const GlobalVector caloVector,
const GlobalPoint rechitPoint 
)

Definition at line 8 of file FindDistCone.cc.

References Vector3DBase< T, FrameTag >::dot(), PV3DBase< T, PVType, FrameType >::mag(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by IsolatedTracksCone::analyze(), coneChargeIsolation(), findCone(), matrixECALIds(), and matrixHCALIds().

8  {
9 
10  const GlobalVector caloIntersectVector(caloPoint.x(),
11  caloPoint.y(),
12  caloPoint.z()); //p
13 
14  const GlobalVector caloUnitVector = caloVector.unit();
15  const GlobalVector rechitVector(rechitPoint.x(),
16  rechitPoint.y(),
17  rechitPoint.z());
18  const GlobalVector rechitUnitVector = rechitVector.unit();
19  double dotprod_denominator = caloUnitVector.dot(rechitUnitVector);
20  double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
21  double rechitdist = dotprod_numerator/dotprod_denominator;
22  const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
23  const GlobalPoint effectiveRechitPoint(effectiveRechitVector.x(),
24  effectiveRechitVector.y(),
25  effectiveRechitVector.z());
26  GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
27  if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
28  return distance_vector.mag();
29  } else {
30  return 999999.;
31  }
32  }
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
T x() const
Definition: PV3DBase.h:62
double spr::getEnergy ( HBHERecHitCollection::const_iterator  hit)

Definition at line 123 of file FindDistCone.cc.

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

123  {
124  return hit->energy();
125  }
double spr::getEnergy ( edm::PCaloHitContainer::const_iterator  hit)

Definition at line 131 of file FindDistCone.cc.

References HcalBarrel, and HcalEndcap.

131  {
132  // This will not yet handle Ecal CaloHits!!
133  double samplingWeight = 1.;
134  // Hard coded sampling weights from JFH analysis of iso tracks
135  // Sept 2009.
136  HcalDetId detId(hit->id());
137  if (detId.subdet() == HcalBarrel)
138  samplingWeight = 114.1;
139  else if (detId.subdet() == HcalEndcap)
140  samplingWeight = 167.3;
141  else {
142  // ONLY protection against summing HO, HF simhits
143  return 0.;
144  }
145 
146  return samplingWeight*hit->energy();
147  }
unsigned int id
spr::EtaPhi spr::getEtaPhi ( int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 6 of file FindEtaPhi.cc.

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

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

Definition at line 72 of file FindDistCone.cc.

72  {
73 
74  RH_ieta.push_back(hit->id().ieta());
75  RH_iphi.push_back(hit->id().iphi());
76  RH_ene.push_back(hit->energy());
77  }
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 
)

Definition at line 79 of file FindDistCone.cc.

79  {
80  // SimHit function not yet implemented.
81  RH_ieta.push_back(-9);
82  RH_iphi.push_back(-9);
83  RH_ene.push_back(-9.);
84  }
void spr::getEtaPhi ( HBHERecHitCollection::const_iterator  hit,
int &  ieta,
int &  iphi 
)

Definition at line 93 of file FindDistCone.cc.

93  {
94  ieta = hit->id().ieta();
95  iphi = hit->id().iphi();
96  }
unsigned int id
void spr::getEtaPhi ( edm::PCaloHitContainer::const_iterator  hit,
int &  ieta,
int &  iphi 
)

Definition at line 98 of file FindDistCone.cc.

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

98  {
99  DetId id = DetId(hit->id());
100  if (id.det() == DetId::Hcal) {
101  ieta = ((HcalDetId)(hit->id())).ieta();
102  iphi = ((HcalDetId)(hit->id())).iphi();
103  } else if (id.det() == DetId::Ecal && id.subdetId() == EcalBarrel) {
104  ieta = ((EBDetId)(id)).ieta();
105  iphi = ((EBDetId)(id)).iphi();
106  } else {
107  ieta = 999;
108  iphi = 999;
109  }
110  }
unsigned int id
Definition: DetId.h:18
GlobalPoint spr::getGpos ( const CaloGeometry geo,
HBHERecHitCollection::const_iterator  hit 
)

Definition at line 149 of file FindDistCone.cc.

References CaloGeometry::getPosition().

149  {
150  DetId detId(hit->id());
151  return geo->getPosition(detId);
152  }
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 
)

Definition at line 154 of file FindDistCone.cc.

References CaloGeometry::getPosition().

154  {
155  DetId detId(hit->id());
156  return geo->getPosition(detId);
157  }
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
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(), 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::print(), 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 IsoTrig::analyze(), IsolatedTracksHcalScale::analyze(), CSCSkim::doBFieldStudySelection(), and JetTracksAssociationDRCalo::produce().

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  const reco::HitPattern &hitp = pTrack->hitPattern();
25  if (parameters.minLayerCrossed>0 || parameters.minOuterHit>0) {
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;
31  }
32  }
33  if (parameters.maxInMiss >= 0) {
35  if (debug) {
36  std::cout << "Inner Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::MISSING_INNER_HITS) << " hits" << std::endl;
38  }
39  }
40  if (parameters.maxOutMiss >= 0) {
42  if (debug) {
43  std::cout << "Outer Hit Pattern with " << hitp.numberOfHits(reco::HitPattern::MISSING_OUTER_HITS) << " hits" << std::endl;
45  }
46  }
47  if (debug) std::cout << "Final Selection Result " << select << std::endl;
48 
49  return select;
50  }
double qoverp() const
q / p
Definition: TrackBase.h:549
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:486
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:537
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:928
int trackerLayersWithMeasurement() const
Definition: HitPattern.h:912
double pt() const
track transverse momentum
Definition: TrackBase.h:597
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:733
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:585
#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:364
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:479
reco::TrackBase::TrackQuality minQuality
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:497
tuple cout
Definition: gather_cfg.py:121
void print(HitCategory category, std::ostream &stream=std::cout) const
Definition: HitPattern.cc:745
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:567
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:721
void spr::hGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const HcalTopology topology,
int  ieta,
int  iphi,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 47 of file GenSimInfo.cc.

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

Referenced by IsolatedGenParticles::analyze().

47  {
48 
49  if (debug) std::cout << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
50 
51  std::vector<DetId> dets;
52  dets.push_back(coreDet);
53  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
54  if (debug) spr::debugHcalDets(0, vdets);
55  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
56  }
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
void spr::hGenSimInfo ( const DetId coreDet,
HepMC::GenEvent::particle_const_iterator  trkItr,
std::vector< spr::propagatedGenTrackID > &  trackIds,
const CaloGeometry geo,
const HcalTopology topology,
double  dR,
const GlobalVector trackMom,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 58 of file GenSimInfo.cc.

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

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

Definition at line 67 of file GenSimInfo.cc.

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

67  {
68 
69  if (debug) std::cout << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;
70 
71  std::vector<DetId> dets;
72  dets.push_back(coreDet);
73  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, false);
74  if (debug) spr::debugHcalDets(0, vdets);
75  spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
76  }
void cGenSimInfo(std::vector< DetId > &vdets, HepMC::GenEvent::particle_const_iterator trkItr, std::vector< spr::propagatedGenTrackID > &trackIds, bool ifECAL, spr::genSimInfo &info, bool debug=false)
Definition: GenSimInfo.cc:87
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:42
#define debug
Definition: HDRShower.cc:19
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
void spr::hGenSimInfo ( const DetId coreDet,
reco::GenParticleCollection::const_iterator  trkItr,
std::vector< spr::propagatedGenParticleID > &  trackIds,
const CaloGeometry geo,
const HcalTopology topology,
double  dR,
const GlobalVector trackMom,
spr::genSimInfo info,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 78 of file GenSimInfo.cc.

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

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

Referenced by ElectronStudy::analyze().

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

Definition at line 10 of file MatchingSimTrack.cc.

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

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

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

Definition at line 72 of file MatchingSimTrack.cc.

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

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

Definition at line 90 of file MatchingSimTrack.cc.

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

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

Definition at line 14 of file MatrixECALDetIds.cc.

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

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

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

Definition at line 57 of file MatrixECALDetIds.cc.

References matrixECALIds().

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

Definition at line 67 of file MatrixECALDetIds.cc.

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

71  {
72 
73  GlobalPoint core;
74  if (det.subdetId() == EcalEndcap) {
75  EEDetId EEid = EEDetId(det);
76  core = geo->getPosition(EEid);
77  } else {
78  EBDetId EBid = EBDetId(det);
79  core = geo->getPosition(EBid);
80  }
81  int ietaphi = (int)(dR/2.0)+1;
82  std::vector<DetId> vdets, vdetx;
83  spr::matrixECALIds(det, ietaphi, ietaphi, geo, caloTopology, vdets, debug);
84  for (unsigned int i=0; i<vdets.size(); ++i) {
85  GlobalPoint rpoint;
86  if (vdets[i].subdetId() == EcalEndcap) {
87  EEDetId EEid = EEDetId(vdets[i]);
88  rpoint = geo->getPosition(EEid);
89  } else {
90  EBDetId EBid = EBDetId(vdets[i]);
91  rpoint = geo->getPosition(EBid);
92  }
93  if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint)<dR) {
94  vdetx.push_back(vdets[i]);
95  }
96  }
97 
98  if (debug) {
99  std::cout << "matrixECALIds::Final List of cells for dR " << dR
100  << " is with " << vdetx.size() << " from original list of "
101  << vdets.size() << std::endl;
102  spr::debugEcalDets(0, vdetx);
103  }
104  return vdetx;
105  }
int i
Definition: DBlmapReader.cc:9
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint)
Definition: FindDistCone.cc:8
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
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
void spr::matrixECALIds ( const DetId det,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
const CaloGeometry geo,
const CaloTopology caloTopology,
std::vector< DetId > &  vdets,
bool  debug = false 
)

Definition at line 107 of file MatrixECALDetIds.cc.

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

109  {
110 
111  const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
112  const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
113  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
114  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
115 
116  if (debug) {
117  std::cout << "matrixECALIds::Add " << ietaE << "|" << ietaW
118  << " rows and " << iphiN << "|" << iphiS
119  << " columns of cells for 1 cell" << std::endl;
120  debugEcalDets(0, det, true);
121  }
122 
123  std::vector<DetId> dets(1,det);
124  std::vector<CaloDirection> dirs(1,NORTH);
125  std::vector<int> jetaE(1,ietaE), jetaW(1,ietaW);
126  std::vector<int> jphiN(1,iphiN), jphiS(1,iphiS);
127  vdets = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN, jphiS, dirs,
128  *barrelTopo, *endcapTopo, *barrelGeom,
129  *endcapGeom, debug);
130  dirs[0] = SOUTH;
131  std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN,
132  jphiS, dirs, *barrelTopo,
133  *endcapTopo, *barrelGeom,
134  *endcapGeom, debug);
135  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
136  if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
137  vdets.push_back(vdetS[i1]);
138  }
139 
140  unsigned int ndet = (ietaE+ietaW+1)*(iphiN+iphiS+1);
141  if (vdets.size() != ndet) {
142  std::vector<DetId> vdetExtra;
143  spr::extraIds(det, vdets, ietaE, ietaW, iphiN, iphiS,
144  *barrelGeom, *endcapGeom, vdetExtra, debug);
145  if (vdetExtra.size() > 0)
146  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
147  }
148 
149  if (debug) {
150  std::cout << "matrixECALIds::Total number of cells found is "
151  << vdets.size() << std::endl;
152  spr::debugEcalDets(0, vdets);
153  }
154  }
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
tuple cout
Definition: gather_cfg.py:121
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)
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 
)

Definition at line 156 of file MatrixECALDetIds.cc.

References matrixECALIds().

160  {
161 
162  std::vector<DetId> vdets;
163  spr::matrixECALIds(det, ietaE, ietaW, iphiN, iphiS, geo, caloTopology,
164  vdets, debug);
165  return vdets;
166  }
#define debug
Definition: HDRShower.cc:19
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
std::vector< DetId > spr::matrixHCALIds ( std::vector< DetId > &  dets,
const HcalTopology topology,
int  ieta,
int  iphi,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 12 of file MatrixHCALDetIds.cc.

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

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

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

Definition at line 42 of file MatrixHCALDetIds.cc.

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

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

Definition at line 71 of file MatrixHCALDetIds.cc.

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

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

Definition at line 360 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds().

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

Definition at line 458 of file MatrixECALDetIds.cc.

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

Referenced by newECALIdEW(), and newECALIdNS().

464  {
465 
466  if (debug) {
467  std::cout << "newECALIdEW::Add " << ieta << " rows of cells for "
468  << last << ":" << dets.size() << ":" << (dets.size()-last)
469  << " cells" << std::endl;
470  spr::debugEcalDets (last, dets, dir);
471  }
472 
473  std::vector<DetId> vdets; vdets.clear();
474  std::vector<CaloDirection> dirs; dirs.clear();
475  vdets.insert(vdets.end(), dets.begin(), dets.end());
476  dirs.insert(dirs.end(), dir.begin(), dir.end());
477 
478  if (ieta > 0) {
479  for (unsigned int i1=last; i1<dets.size(); i1++) {
480  int flag = 0;
481  std::vector<DetId> cells;
482  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
483  barrelGeom, endcapGeom, cells, flag, debug);
484  if (flag != 0) {
485  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
486  CaloDirection dirn = dir[i1];
487  if (flag < 0) {
488  if (dirn == EAST) dirn = WEST;
489  else dirn = EAST;
490  }
491  vdets.push_back(cells[0]);
492  dirs.push_back(dirn);
493  }
494  }
495  }
496  ieta--;
497  }
498 
499  if (debug) {
500  std::cout << "newECALIdEW::Addition results a set of "
501  << (vdets.size()-dets.size()) << " new cells" << std::endl;
502  spr::debugEcalDets (dets.size(), vdets, dirs);
503  }
504 
505  if (ieta > 0) {
506  last = dets.size();
507  return spr::newECALIdEW(vdets,last,ieta,dirs,barrelTopo,endcapTopo,barrelGeom,endcapGeom,debug);
508  } else {
509  if (debug) {
510  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
511  << " cells" << std::endl;
512  spr::debugEcalDets (0, vdets);
513  }
514  return vdets;
515  }
516  }
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)
#define debug
Definition: HDRShower.cc:19
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > spr::newECALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
std::vector< int > &  ietaE,
std::vector< int > &  ietaW,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry &  barrelGeom,
const EcalEndcapGeometry &  endcapGeom,
bool  debug = false 
)

Definition at line 518 of file MatrixECALDetIds.cc.

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

526  {
527 
528  if (debug) {
529  std::cout << "newECALIdEW::Add " << ietaE[0] << "|" << ietaW[0]
530  << " rows of cells for " << (dets.size()-last)
531  << " cells (last " << last << ")" << std::endl;
532  spr::debugEcalDets (last, dets, dir);
533  }
534 
535  std::vector<DetId> vdets;
536  vdets.insert(vdets.end(), dets.begin(), dets.end());
537  std::vector<CaloDirection> dirs;
538  dirs.insert(dirs.end(), dir.begin(), dir.end());
539  std::vector<int> jetaE, jetaW;
540  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
541  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
542  int keta = 0;
543  for (unsigned int i1=last; i1<dets.size(); i1++) {
544  int ieta = ietaW[i1];
545  if (dir[i1] == EAST) ieta = ietaE[i1];
546  if (ieta > 0) {
547  int flag=0;
548  std::vector<DetId> cells;
549  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
550  barrelGeom, endcapGeom, cells, flag, debug);
551  ieta--;
552  if (ieta > keta) keta = ieta;
553  if (dir[i1] == EAST) jetaE[i1] = ieta;
554  else jetaW[i1] = ieta;
555  if (flag != 0) {
556  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
557  vdets.push_back(cells[0]);
558  CaloDirection dirn = dir[i1];
559  int ketaE = ietaE[i1];
560  int ketaW = ietaW[i1];
561  if (dirn == EAST) ketaE = ieta;
562  else ketaW = ieta;
563  if (flag < 0) {
564  int ktmp = ketaW; ketaW = ketaE; ketaE = ktmp;
565  if (dirn == EAST) dirn = WEST;
566  else dirn = EAST;
567  }
568  dirs.push_back(dirn);
569  jetaE.push_back(ketaE);
570  jetaW.push_back(ketaW);
571  }
572  }
573  }
574  }
575 
576  if (debug) {
577  std::cout << "newECALIdEW::Addition results a set of "
578  << (vdets.size()-dets.size()) << " new cells (last "
579  << dets.size() << ", ieta " << keta << ")" << std::endl;
580  spr::debugEcalDets (dets.size(), vdets);
581  }
582 
583  if (keta > 0) {
584  last = dets.size();
585  return spr::newECALIdEW(vdets, last, jetaE, jetaW, dirs, barrelTopo,
586  endcapTopo, barrelGeom, endcapGeom, debug);
587  } else {
588  if (debug) {
589  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
590  << " cells" << std::endl;
591  spr::debugEcalDets (0, vdets);
592  }
593  return vdets;
594  }
595  }
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)
#define debug
Definition: HDRShower.cc:19
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
std::vector< DetId > spr::newECALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
int  ieta,
int  iphi,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry &  barrelGeom,
const EcalEndcapGeometry &  endcapGeom,
bool  debug = false 
)

Definition at line 168 of file MatrixECALDetIds.cc.

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

Referenced by matrixECALIds(), and newECALIdNS().

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

Definition at line 289 of file MatrixECALDetIds.cc.

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

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

Definition at line 266 of file MatrixHCALDetIds.cc.

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

Referenced by newHCALIdEW(), and newHCALIdNS().

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

Definition at line 311 of file MatrixHCALDetIds.cc.

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

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

Definition at line 102 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds(), and newHCALIdNS().

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

Definition at line 181 of file MatrixHCALDetIds.cc.

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

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

Definition at line 156 of file MatchingSimTrack.cc.

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

Referenced by matchedSimTrackInfo().

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

Definition at line 18 of file CaloPropagateTrack.cc.

Referenced by StudyHLT::analyze(), IsoTrig::analyze(), ElectronStudy::analyze(), IsolatedGenParticles::analyze(), IsolatedTracksHcalScale::analyze(), and IsolatedTracksNxN::analyze().

18  {
19 
20  std::vector<spr::propagatedTrackID> vdets;
21  spr::propagateCALO(trkCollection,geo,bField,theTrackQuality, vdets, debug);
22  return vdets;
23  }
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 25 of file CaloPropagateTrack.cc.

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

25  {
26 
27  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
28  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
31 
32  unsigned int indx;
33  reco::TrackCollection::const_iterator trkItr;
34  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
35  const reco::Track* pTrack = &(*trkItr);
37  vdet.trkItr = trkItr;
38  vdet.ok = (pTrack->quality(trackQuality_));
39  vdet.detIdECAL = DetId(0);
40  vdet.detIdHCAL = DetId(0);
41  vdet.detIdEHCAL= DetId(0);
42  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << vdet.ok << std::endl;
43 
44  std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
45  vdet.okECAL = info.second;
46  if (vdet.okECAL) {
47  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
48  vdet.etaECAL = point.eta();
49  vdet.phiECAL = point.phi();
50  if (std::abs(point.eta())<1.479) {
51  vdet.detIdECAL = barrelGeom->getClosestCell(point);
52  } else {
53  vdet.detIdECAL = endcapGeom->getClosestCell(point);
54  }
55  vdet.detIdEHCAL = gHB->getClosestCell(point);
56  }
57  info = spr::propagateHCAL (pTrack, bField, debug);
58  vdet.okHCAL = info.second;
59  if (vdet.okHCAL) {
60  const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
61  vdet.etaHCAL = point.eta();
62  vdet.phiHCAL = point.phi();
63  vdet.detIdHCAL = gHB->getClosestCell(point);
64  }
65 
66  vdets.push_back(vdet);
67  }
68 
69  if (debug) {
70  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
71  for (unsigned int i=0; i<vdets.size(); ++i) {
72  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
73  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
74  std::cout << (EBDetId)(vdets[i].detIdECAL);
75  } else {
76  std::cout << (EEDetId)(vdets[i].detIdECAL);
77  }
78  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
79  }
80  }
81  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
TrackQuality
track quality
Definition: TrackBase.h:113
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)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:102
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:479
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
void spr::propagateCALO ( edm::Handle< reco::TrackCollection > &  trkCollection,
const CaloGeometry geo,
const MagneticField bField,
std::string &  theTrackQuality,
std::vector< spr::propagatedTrackDirection > &  trkDir,
bool  debug = false 
)

Definition at line 83 of file CaloPropagateTrack.cc.

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

83  {
84 
85  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
86  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
89 
90  unsigned int indx;
91  reco::TrackCollection::const_iterator trkItr;
92  for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
93  const reco::Track* pTrack = &(*trkItr);
95  trkD.trkItr = trkItr;
96  trkD.ok = (pTrack->quality(trackQuality_));
97  trkD.detIdECAL = DetId(0);
98  trkD.detIdHCAL = DetId(0);
99  trkD.detIdEHCAL= DetId(0);
100  if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << trkD.ok << std::endl;
101 
103  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
104  trkD.okECAL = info.ok;
105  trkD.pointECAL = point;
106  trkD.directionECAL = info.direction;
107  if (trkD.okECAL) {
108  if (std::abs(info.point.eta())<1.479) {
109  trkD.detIdECAL = barrelGeom->getClosestCell(point);
110  } else {
111  trkD.detIdECAL = endcapGeom->getClosestCell(point);
112  }
113  trkD.detIdEHCAL = gHB->getClosestCell(point);
114  }
115  info = spr::propagateTrackToHCAL (pTrack, bField, debug);
116  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
117  trkD.okHCAL = info.ok;
118  trkD.pointHCAL = point;
119  trkD.directionHCAL = info.direction;
120  if (trkD.okHCAL) {
121  trkD.detIdHCAL = gHB->getClosestCell(point);
122  }
123  trkDir.push_back(trkD);
124  }
125 
126  if (debug) {
127  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
128  for (unsigned int i=0; i<trkDir.size(); ++i) {
129  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
130  if (trkDir[i].okECAL) {
131  std::cout << " point " << trkDir[i].pointECAL << " direction "
132  << trkDir[i].directionECAL << " ";
133  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
134  std::cout << (EBDetId)(trkDir[i].detIdECAL);
135  } else {
136  std::cout << (EEDetId)(trkDir[i].detIdECAL);
137  }
138  }
139  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
140  if (trkDir[i].okHCAL) {
141  std::cout << " point " << trkDir[i].pointHCAL << " direction "
142  << trkDir[i].directionHCAL << " "
143  << (HcalDetId)(trkDir[i].detIdHCAL);
144  }
145  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
146  }
147  }
148  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
TrackQuality
track quality
Definition: TrackBase.h:113
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:102
#define debug
Definition: HDRShower.cc:19
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:479
reco::TrackCollection::const_iterator trkItr
tuple cout
Definition: gather_cfg.py:121
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
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 150 of file CaloPropagateTrack.cc.

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

150  {
151 
152  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
153  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
155 
156  std::vector<spr::propagatedGenTrackID> trkDir;
157  unsigned int indx;
158  HepMC::GenEvent::particle_const_iterator p;
159  for (p=genEvent->particles_begin(),indx=0; p != genEvent->particles_end(); ++p,++indx) {
161  trkD.trkItr = p;
162  trkD.detIdECAL = DetId(0);
163  trkD.detIdHCAL = DetId(0);
164  trkD.detIdEHCAL= DetId(0);
165  trkD.pdgId = ((*p)->pdg_id());
166  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge())/3;
167  GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
168  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
169 
170  // consider stable particles
171  if ( (*p)->status()==1 && std::abs((*p)->momentum().eta()) < etaMax ) {
172  GlobalPoint vertex = GlobalPoint(0.1*(*p)->production_vertex()->position().x(),
173  0.1*(*p)->production_vertex()->position().y(),
174  0.1*(*p)->production_vertex()->position().z());
175  trkD.ok = true;
176  spr::propagatedTrack info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 319.2, 129.4, 1.479, debug);
177  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
178  trkD.okECAL = info.ok;
179  trkD.pointECAL = point;
180  trkD.directionECAL = info.direction;
181  if (trkD.okECAL) {
182  if (std::abs(info.point.eta())<1.479) {
183  trkD.detIdECAL = barrelGeom->getClosestCell(point);
184  } else {
185  trkD.detIdECAL = endcapGeom->getClosestCell(point);
186  }
187  trkD.detIdEHCAL = gHB->getClosestCell(point);
188  }
189 
190  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 402.7, 180.7, 1.392, debug);
191  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
192  trkD.okHCAL = info.ok;
193  trkD.pointHCAL = point;
194  trkD.directionHCAL = info.direction;
195  if (trkD.okHCAL) {
196  trkD.detIdHCAL = gHB->getClosestCell(point);
197  }
198  }
199  trkDir.push_back(trkD);
200  }
201 
202  if (debug) {
203  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
204  for (unsigned int i=0; i<trkDir.size(); ++i) {
205  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
206  if (trkDir[i].okECAL) {
207  std::cout << " point " << trkDir[i].pointECAL << " direction "
208  << trkDir[i].directionECAL << " ";
209  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
210  std::cout << (EBDetId)(trkDir[i].detIdECAL);
211  } else {
212  std::cout << (EEDetId)(trkDir[i].detIdECAL);
213  }
214  }
215  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
216  if (trkDir[i].okHCAL) {
217  std::cout << " point " << trkDir[i].pointHCAL << " direction "
218  << trkDir[i].directionHCAL << " "
219  << (HcalDetId)(trkDir[i].detIdHCAL);
220  }
221  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
222  }
223  }
224  return trkDir;
225  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
uint32_t ID
Definition: Definitions.h:26
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
HepMC::GenEvent::particle_const_iterator trkItr
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tuple genEvent
Definition: MCTruth.py:33
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::vector< spr::propagatedGenParticleID > spr::propagateCALO ( edm::Handle< reco::GenParticleCollection > &  genParticles,
edm::ESHandle< ParticleDataTable > &  pdt,
const CaloGeometry geo,
const MagneticField bField,
double  etaMax = 3.0,
bool  debug = false 
)

Definition at line 227 of file CaloPropagateTrack.cc.

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

227  {
228 
229  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
230  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
232 
233  std::vector<spr::propagatedGenParticleID> trkDir;
234  unsigned int indx;
235  reco::GenParticleCollection::const_iterator p;
236  for (p=genParticles->begin(),indx=0; p != genParticles->end(); ++p,++indx) {
238  trkD.trkItr = p;
239  trkD.detIdECAL = DetId(0);
240  trkD.detIdHCAL = DetId(0);
241  trkD.detIdEHCAL= DetId(0);
242  trkD.pdgId = (p->pdgId());
243  trkD.charge = p->charge();
244  GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
245  if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
246 
247  // consider stable particles
248  if ( p->status()==1 && std::abs(momentum.eta()) < etaMax ) {
249  GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
250  trkD.ok = true;
251  spr::propagatedTrack info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 319.2, 129.4, 1.479, debug);
252  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
253  trkD.okECAL = info.ok;
254  trkD.pointECAL = point;
255  trkD.directionECAL = info.direction;
256  if (trkD.okECAL) {
257  if (std::abs(info.point.eta())<1.479) {
258  trkD.detIdECAL = barrelGeom->getClosestCell(point);
259  } else {
260  trkD.detIdECAL = endcapGeom->getClosestCell(point);
261  }
262  trkD.detIdEHCAL = gHB->getClosestCell(point);
263  }
264 
265  info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 402.7, 180.7, 1.392, debug);
266  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
267  trkD.okHCAL = info.ok;
268  trkD.pointHCAL = point;
269  trkD.directionHCAL = info.direction;
270  if (trkD.okHCAL) {
271  trkD.detIdHCAL = gHB->getClosestCell(point);
272  }
273  }
274  trkDir.push_back(trkD);
275  }
276 
277  if (debug) {
278  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
279  for (unsigned int i=0; i<trkDir.size(); ++i) {
280  if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
281  if (trkDir[i].okECAL) {
282  std::cout << " point " << trkDir[i].pointECAL << " direction "
283  << trkDir[i].directionECAL << " ";
284  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
285  std::cout << (EBDetId)(trkDir[i].detIdECAL);
286  } else {
287  std::cout << (EEDetId)(trkDir[i].detIdECAL);
288  }
289  }
290  if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
291  if (trkDir[i].okHCAL) {
292  std::cout << " point " << trkDir[i].pointHCAL << " direction "
293  << trkDir[i].directionHCAL << " "
294  << (HcalDetId)(trkDir[i].detIdHCAL);
295  }
296  if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
297  }
298  }
299  return trkDir;
300  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
reco::GenParticleCollection::const_iterator trkItr
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
T eta() const
Definition: PV3DBase.h:76
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Global3DVector GlobalVector
Definition: GlobalVector.h:10
spr::propagatedTrackDirection spr::propagateCALO ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const CaloGeometry geo,
const MagneticField bField,
bool  debug = false 
)

Definition at line 302 of file CaloPropagateTrack.cc.

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

302  {
303 
304  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
305  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
307 
308  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
310  trkD.ok = trk.ok;
311  trkD.detIdECAL = DetId(0);
312  trkD.detIdHCAL = DetId(0);
313  trkD.detIdEHCAL= DetId(0);
314  if (debug) std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p " << trk.momentum << " Flag " << trkD.ok << std::endl;
315 
316  if (trkD.ok) {
317  spr::propagatedTrack info = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bField, 319.2, 129.4, 1.479, debug);
318  GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
319  trkD.okECAL = info.ok;
320  trkD.pointECAL = point;
321  trkD.directionECAL = info.direction;
322  if (trkD.okECAL) {
323  if (std::abs(info.point.eta())<1.479) {
324  trkD.detIdECAL = barrelGeom->getClosestCell(point);
325  } else {
326  trkD.detIdECAL = endcapGeom->getClosestCell(point);
327  }
328  trkD.detIdEHCAL = gHB->getClosestCell(point);
329  }
330 
331  info = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bField, 402.7, 180.7, 1.392, debug);
332  point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
333  trkD.okHCAL = info.ok;
334  trkD.pointHCAL = point;
335  trkD.directionHCAL = info.direction;
336  if (trkD.okHCAL) {
337  trkD.detIdHCAL = gHB->getClosestCell(point);
338  }
339  }
340 
341  if (debug) {
342  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
343  if (trkD.okECAL) {
344  std::cout << "ECAL point " << trkD.pointECAL << " direction "
345  << trkD.directionECAL << " ";
346  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
347  std::cout << (EBDetId)(trkD.detIdECAL);
348  } else {
349  std::cout << (EEDetId)(trkD.detIdECAL);
350  }
351  }
352  if (trkD.okHCAL) {
353  std::cout << " HCAL point " << trkD.pointHCAL << " direction "
354  << trkD.directionHCAL << " " << (HcalDetId)(trkD.detIdHCAL);
355  }
356  if (trkD.okECAL) std::cout << " Or " << (HcalDetId)(trkD.detIdEHCAL);
357  std::cout << std::endl;
358  }
359 
360  return trkD;
361  }
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)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::propagatedTrack spr::propagateCalo ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bField,
float  zdist,
float  radius,
float  corner,
bool  debug = false 
)

Definition at line 473 of file CaloPropagateTrack.cc.

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

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

473  {
474 
475  spr::propagatedTrack track;
476  if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
477  FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
478 
481 
482  Cylinder::CylinderPointer barrel = Cylinder::build(radius, Cylinder::PositionType (0, 0, 0), Cylinder::RotationType ());
483 
484  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
485 
487  if (tpMomentum.eta() < 0) {
488  tsose = myAP.propagate(fts, *lendcap);
489  } else {
490  tsose = myAP.propagate(fts, *rendcap);
491  }
492 
493  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
494 
495  track.ok=true;
496  if (tsose.isValid() && tsosb.isValid()) {
497  float absEta = std::abs(tsosb.globalPosition().eta());
498  if (absEta < corner) {
499  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
500  track.direction = tsosb.globalDirection();
501  } else {
502  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
503  track.direction = tsose.globalDirection();
504  }
505  } else if (tsose.isValid()) {
506  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
507  track.direction = tsose.globalDirection();
508  } else if (tsosb.isValid()) {
509  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
510  track.direction = tsosb.globalDirection();
511  } else {
512  track.point.SetXYZ(-999., -999., -999.);
513  track.direction = GlobalVector(0,0,1);
514  track.ok = false;
515  }
516  if (debug) {
517  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
518  if (track.ok) {
519  math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
520  double dphi = track.direction.phi()-tpMomentum.phi();
521  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
522  double pt = tpMomentum.perp();
523  double rat = 0.5*dphi/std::sin(0.5*dphi);
524  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;
525  }
526  }
527  return track;
528  }
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
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
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
T sqrt(T t)
Definition: SSEVec.h:48
T phi() const
Definition: Phi.h:41
static PlanePointer build(Args &&...args)
Definition: Plane.h:36
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T eta() const
Definition: PV3DBase.h:76
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector globalDirection() const
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 379 of file CaloPropagateTrack.cc.

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

Referenced by chargeIsolationEcal(), and propagateCALO().

379  {
380  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
381  GlobalVector momentum (track->px(), track->py(), track->pz());
382  int charge (track->charge());
383  return spr::propagateECAL (vertex, momentum, charge, bfield, debug);
384  }
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:603
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:615
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:645
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:639
int charge() const
track electric charge
Definition: TrackBase.h:543
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:609
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:633
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 386 of file CaloPropagateTrack.cc.

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

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

Definition at line 406 of file CaloPropagateTrack.cc.

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

Referenced by chargeIsolationHcal(), and propagateCALO().

406  {
407  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
408  GlobalVector momentum (track->px(), track->py(), track->pz());
409  int charge (track->charge());
410  return spr::propagateHCAL (vertex, momentum, charge, bfield, debug);
411  }
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:603
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:615
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:645
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:639
int charge() const
track electric charge
Definition: TrackBase.h:543
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:609
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:633
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 413 of file CaloPropagateTrack.cc.

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

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

Definition at line 418 of file CaloPropagateTrack.cc.

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

418  {
419  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
420  GlobalVector momentum (track->px(), track->py(), track->pz());
421  int charge (track->charge());
422  spr::propagatedTrack track1 = spr::propagateCalo (vertex, momentum, charge, bfield, 290.0, 109.0, 1.705, debug);
423  return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
424  }
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:603
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:615
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:645
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:639
int charge() const
track electric charge
Definition: TrackBase.h:543
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:609
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:633
std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

Definition at line 426 of file CaloPropagateTrack.cc.

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

Referenced by IsolatedTracksNxN::analyze().

426  {
427 
428  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
429  GlobalVector momentum (track->px(), track->py(), track->pz());
430  int charge (track->charge());
431  float radius = track->outerPosition().Rho();
432  float zdist = track->outerPosition().Z();
433  if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;
434 
435  FreeTrajectoryState fts (vertex, momentum, charge, bField);
437  Cylinder::CylinderPointer barrel = Cylinder::build(radius, Cylinder::PositionType (0, 0, 0), Cylinder::RotationType ());
438 
439  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
440 
441  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
442  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
443 
444  math::XYZPoint point(-999.,-999.,-999.);
445  bool ok=false;
446  GlobalVector direction(0,0,1);
447  if (tsosb.isValid() && std::abs(zdist) < 110) {
448  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
449  direction = tsosb.globalDirection();
450  ok = true;
451  } else if (tsose.isValid()) {
452  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
453  direction = tsose.globalDirection();
454  ok = true;
455  }
456 
457  double length = -1;
458  if (ok) {
459  math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
460  double dphi = direction.phi()-momentum.phi();
461  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
462  double rat = 0.5*dphi/std::sin(0.5*dphi);
463  double dZ = vDiff.z();
464  double dS = rdist*rat; //dZ*momentum.z()/momentum.perp();
465  length = std::sqrt(dS*dS+dZ*dZ);
466  if (debug)
467  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;
468  }
469 
470  return std::pair<math::XYZPoint,double>(point,length);
471  }
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
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:603
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
T sqrt(T t)
Definition: SSEVec.h:48
T phi() const
Definition: Phi.h:41
static PlanePointer build(Args &&...args)
Definition: Plane.h:36
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:615
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:645
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:639
tuple cout
Definition: gather_cfg.py:121
int charge() const
track electric charge
Definition: TrackBase.h:543
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:609
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:633
GlobalVector globalDirection() const
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 363 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

363  {
364  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
365  GlobalVector momentum (track->px(), track->py(), track->pz());
366  int charge (track->charge());
367  return spr::propagateCalo (vertex, momentum, charge, bfield, 319.2, 129.4, 1.479, debug);
368  }
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:603
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:615
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:645
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:639
int charge() const
track electric charge
Definition: TrackBase.h:543
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:609
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:633
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 370 of file CaloPropagateTrack.cc.

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

370  {
371 
372  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
374  if (trk.ok)
375  ptrk = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bfield, 319.2, 129.4, 1.479, debug);
376  return ptrk;
377  }
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
#define debug
Definition: HDRShower.cc:19
spr::propagatedTrack spr::propagateTrackToHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 391 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

391  {
392  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
393  GlobalVector momentum (track->px(), track->py(), track->pz());
394  int charge (track->charge());
395  return spr::propagateCalo (vertex, momentum, charge, bfield, 402.7, 180.7, 1.392, debug);
396  }
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:603
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:615
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:645
#define debug
Definition: HDRShower.cc:19
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:639
int charge() const
track electric charge
Definition: TrackBase.h:543
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:609
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:633
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 398 of file CaloPropagateTrack.cc.

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

398  {
399  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
401  if (trk.ok)
402  ptrk = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bfield, 402.7, 180.7, 1.392, debug);
403  return ptrk;
404  }
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
#define debug
Definition: HDRShower.cc:19
void spr::simpleMove ( DetId det,
const CaloDirection dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry &  barrelGeom,
const EcalEndcapGeometry &  endcapGeom,
std::vector< DetId > &  cells,
int &  flag,
bool  debug = false 
)

Definition at line 597 of file MatrixECALDetIds.cc.

References gather_cfg::cout, EcalBarrel, EcalEndcap, CaloSubdetectorTopology::getNeighbours(), EBDetId::ietaAbs(), EEDetId::iPhiOuterRing(), EBDetId::MAX_IETA, and DetId::subdetId().

Referenced by newECALIdEW(), and newECALIdNS().

602  {
603 
604  DetId cell;
605  ok = 0;
606  if (det.subdetId() == EcalBarrel) {
607  EBDetId detId = det;
608  std::vector<DetId> neighbours = barrelTopo.getNeighbours(detId,dir);
609  if (neighbours.size()>0 && !neighbours[0].null()) {
610  cells.push_back(neighbours[0]);
611  cell = neighbours[0];
612  ok = 1;
613  } else {
614  const int ietaAbs ( detId.ietaAbs() ) ; // abs value of ieta
615  if (EBDetId::MAX_IETA == ietaAbs ) {
616  // get ee nbrs for for end of barrel crystals
617  const EcalBarrelGeometry::OrderedListOfEEDetId&
618  ol( * barrelGeom.getClosestEndcapCells(detId) ) ;
619  // take closest neighbour on the other side, that is in the endcap
620  cell = *(ol.begin() );
621  neighbours = endcapTopo.getNeighbours(cell,dir);
622  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
623  else ok =-1;
624  for (EcalBarrelGeometry::OrderedListOfEEDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
625  cells.push_back(*iptr);
626  }
627  }
628  } else if (det.subdetId() == EcalEndcap) {
629  EEDetId detId = det;
630  std::vector<DetId> neighbours = endcapTopo.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  // are we on the outer ring ?
637  const int iphi ( detId.iPhiOuterRing() ) ;
638  if (iphi!= 0) {
639  // get eb nbrs for for end of endcap crystals
640  const EcalEndcapGeometry::OrderedListOfEBDetId&
641  ol( * endcapGeom.getClosestBarrelCells(detId) ) ;
642  // take closest neighbour on the other side, that is in the barrel.
643  cell = *(ol.begin() );
644  neighbours = barrelTopo.getNeighbours(cell,dir);
645  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
646  else ok =-1;
647  for (EcalEndcapGeometry::OrderedListOfEBDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
648  cells.push_back(*iptr);
649  }
650  }
651  }
652  if (debug) {
653  std::cout << "simpleMove:: Move DetId 0x" << std::hex << det()
654  << std::dec << " along " << dir << " to get 0x" << std::hex
655  << cell() << std::dec << " with flag " << ok << " # "
656  << cells.size();
657  for (unsigned int i1=0; i1<cells.size(); ++i1)
658  std::cout << " " << std::hex << cells[0]() << std::dec;
659  std::cout << std::endl;
660  }
661  }
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
int iPhiOuterRing() const
Definition: EEDetId.cc:388
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
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:49
spr::trackAtOrigin spr::simTrackAtOrigin ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

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

530  {
531 
532  spr::trackAtOrigin trk;
533 
534  edm::SimTrackContainer::const_iterator itr = SimTk->end();
535  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
536  if ( simTrkItr->trackId() == thisTrk ) {
537  if (debug) std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
538  itr = simTrkItr;
539  break;
540  }
541  }
542 
543  if (itr != SimTk->end()) {
544  int vertIndex = itr->vertIndex();
545  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
546  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
547  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
548  const math::XYZTLorentzVectorD pos = simVtxItr->position();
549  const math::XYZTLorentzVectorD mom = itr->momentum();
550  trk.ok = true;
551  trk.charge = (int)(itr->charge());
552  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
553  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
554  }
555  }
556  if (debug) std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;;
557  return trk;
558  }
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
#define debug
Definition: HDRShower.cc:19
tuple cout
Definition: gather_cfg.py:121
Global3DVector GlobalVector
Definition: GlobalVector.h:10
double spr::timeOfFlight ( DetId  id,
const CaloGeometry geo,
bool  debug = false 
)

Definition at line 12 of file CaloSimInfo.cc.

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

Referenced by RPCDigiSimLink::RPCDigiSimLink().

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

Definition at line 118 of file MatchingSimTrack.cc.

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

Referenced by matchedSimTrackId(), and matchedSimTrackInfo().

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