CMS 3D CMS Logo

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)
bool chargeIsolation (const DetId anyCell, std::vector< DetId > &vdets)
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)
bool chargeIsolation (const DetId anyCell, CaloNavigator< DetId > &navigator, int deta, int dphi)
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)
double chargeIsolationCone (unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, 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 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 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 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 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)
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)
std::map< std::string, double > eCaloSimInfo (caloSimInfo &info)
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)
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)
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)
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)
template<typename T >
double eECALmatrix (CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, int ieta, int iphi, 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 >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, 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)
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, 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 >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, 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)
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 &, 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 > 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 ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo &info, 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 >
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 > &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 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 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< 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)
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 >
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 > 
findHit (edm::Handle< T > &hits, DetId thisDet, 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)
void getEtaPhi (HBHERecHitCollection::const_iterator hit, int &ieta, int &iphi)
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)
EtaPhi getEtaPhi (int ieta, int iphi, bool debug=false)
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, 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)
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)
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)
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)
std::vector< DetIdmatrixECALIds (const DetId &det, double dR, const GlobalVector &trackMom, const CaloGeometry *geo, const CaloTopology *caloTopology, 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)
void matrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, 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 ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, 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< 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 ieta, int iphi, 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, 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< 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< 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< 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< 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)
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, std::vector< spr::propagatedTrackID > &vdets, bool debug=false)
spr::propagatedTrack propagateCalo (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
std::vector
< spr::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)
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::propagatedTrackDirection > &trkDir, 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 > propagateECAL (const reco::Track *, 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 78 of file GenSimInfo.cc.

References spr::genSimInfo::cHadronEne, spr::genSimInfo::cHadronEne_, DeDxDiscriminatorTools::charge(), chargeIsolation(), gather_cfg::cout, spr::genSimInfo::eleEne, 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().

                                                                                                                                                                                      {

    for (unsigned int i=0; i<trackIds.size(); ++i) {
      HepMC::GenEvent::particle_const_iterator trkItr2 = trackIds[i].trkItr;
      // avoid the track under consideration
      if ( (trkItr2 != trkItr) && trackIds[i].ok) {
        int charge = trackIds[i].charge;
        int pdgid  = trackIds[i].pdgId;
        double p   = (*trkItr2)->momentum().rho();
        bool isolat= false;
        if (ifECAL) {
          const DetId anyCell = trackIds[i].detIdECAL;
          isolat              = spr::chargeIsolation(anyCell,vdets);
        } else {
          const DetId anyCell = trackIds[i].detIdHCAL;
          isolat              = spr::chargeIsolation(anyCell,vdets);
        }
        if (!isolat) spr::cGenSimInfo(charge, pdgid, p, info, debug);
      }
    }
    if (debug) {
      std::cout << "Isolation variables: isChargedIso :" << info.isChargedIso 
                << " maxNearP " << info.maxNearP << " Energy e/mu/g/ch/nh "
                << info.eleEne << "," << info.muEne << "," << info.photonEne
                << "," << info.cHadronEne << "," << info.nHadronEne 
                << " charge " << info.cHadronEne_[0] << "," 
                << info.cHadronEne_[1] << "," << info.cHadronEne_[2] 
                << std::endl;
    }
  }
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 109 of file GenSimInfo.cc.

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

                                                                                                                                                                                            {

    for (unsigned int i=0; i<trackIds.size(); ++i) {
      reco::GenParticleCollection::const_iterator trkItr2 = trackIds[i].trkItr;
      // avoid the track under consideration
      if ( (trkItr2 != trkItr) && trackIds[i].ok) {
        int charge = trackIds[i].charge;
        int pdgid  = trackIds[i].pdgId;
        double p   = trkItr2->momentum().R();
        bool isolat= false;
        if (ifECAL) {
          const DetId anyCell = trackIds[i].detIdECAL;
          isolat              = spr::chargeIsolation(anyCell,vdets);
        } else {
          const DetId anyCell = trackIds[i].detIdHCAL;
          isolat              = spr::chargeIsolation(anyCell,vdets);
        }
        if (!isolat) spr::cGenSimInfo(charge, pdgid, p, info, debug);
      }
    }

    if (debug) {
      std::cout << "Isolation variables: isChargedIso :" << info.isChargedIso 
                << " maxNearP " << info.maxNearP << " Energy e/mu/g/ch/nh "
                << info.eleEne << "," << info.muEne << "," << info.photonEne
                << "," << info.cHadronEne << "," << info.nHadronEne 
                << " charge " << info.cHadronEne_[0] << "," 
                << info.cHadronEne_[1] << "," << info.cHadronEne_[2] 
                << std::endl;
    }
  }
void spr::cGenSimInfo ( int  charge,
int  pdgid,
double  p,
spr::genSimInfo info,
bool  debug = false 
)

Definition at line 141 of file GenSimInfo.cc.

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

                                                                                      {

    if      (pdgid==22 ) info.photonEne  += p;
    else if (pdgid==11)  info.eleEne     += p;
    else if (pdgid==13)  info.muEne      += p;
    else if (std::abs(charge)>0)   { 
      info.isChargedIso = false; 
      info.cHadronEne  += p;
      if (p>1.0) info.cHadronEne_[0] += p;
      if (p>2.0) info.cHadronEne_[1] += p;
      if (p>3.0) info.cHadronEne_[2] += p;
      if (info.maxNearP<p) info.maxNearP=p;
    } else if (std::abs(charge)==0)  { 
      info.nHadronEne += p;
    }
  }
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().

                                                                     {
    bool isIsolated = true;
    for (unsigned int i=0; i<vdets.size(); i++){
      if (anyCell == vdets[i] ) {
        isIsolated = false;
        break;
      }
    }
    return isIsolated;
  }
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 abs, TrackDetectorAssociator::associate(), chargeIsolation(), CaloSubdetectorGeometry::getClosestCell(), TrackDetectorAssociator::getFreeTrajectoryState(), TrackDetMatchInfo::isGoodEcal, reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtEcal.

                                                                                                                                                                                                                                                                                                                                                                                                                          {
  
    double maxNearP = -1.0;
    reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);

    // const DetId anyCell,
    reco::TrackCollection::const_iterator trkItr2;
    for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {

      const reco::Track* pTrack2 = &(*trkItr2);

      bool   trkQuality  = pTrack2->quality(trackQuality_);
      if ( (trkItr2 != trkItr) && trkQuality )  {
      
        const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
        TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
        const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());

        if (info2.isGoodEcal ) {
          if (std::abs(point2.eta())<1.479) {
            const DetId anyCell = gEB->getClosestCell(point2);
            if (!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
              if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
            }
          } else {
            const DetId anyCell = gEE->getClosestCell(point2);
            if(!spr::chargeIsolation(anyCell,theNavigator,ieta, iphi)) {
              if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
            }
          }
        } //info2.isGoodEcal
      }
    }
    return maxNearP;
  }
bool spr::chargeIsolation ( const DetId  anyCell,
CaloNavigator< DetId > &  navigator,
int  deta,
int  dphi 
)

Definition at line 51 of file ChargeIsolationExtra.cc.

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

                                                                                              {

    bool isIsolated = false;

    DetId thisDet;

    for (int dx = -ieta; dx < ieta+1; ++dx) {
      for (int dy = -iphi; dy < iphi+1; ++dy) {

        thisDet = navigator.offsetBy(dx, dy);
        navigator.home();
      
        if (thisDet != DetId(0)) {
          if (thisDet == anyCell) {
            isIsolated = false;
            return isIsolated;
          }
        }
      }
    }
    return isIsolated;
  }
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 
)
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, reco::TrackBase::p(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by IsolatedTracksHcalScale::analyze().

                                                                                                                                              {

    double maxNearP = -1.0;
    nNearTRKs = 0;
    if (trkDirs[trkIndex].okHCAL) {
      for (unsigned int indx=0; indx<trkDirs.size(); ++indx) {
        if (indx != trkIndex && trkDirs[indx].ok && trkDirs[indx].okHCAL) {
          int isConeChargedIso = spr::coneChargeIsolation(trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL, dR);
          if (isConeChargedIso==0) {
            nNearTRKs++;
            const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
            if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
          }
        }
      }
    }
    return maxNearP;
  }
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, reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, and DetId::subdetId().

Referenced by IsolatedTracksNxN::analyze().

                                                                                                                                                                                         {
  
    const DetId coreDet = vdetIds[trkIndex].detIdECAL;
    if (debug) {
      if (coreDet.subdetId() == EcalBarrel) 
        std::cout << "DetId " << (EBDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL << std::endl;
      else
        std::cout << "DetId " << (EEDetId)(coreDet) << " Flag " << vdetIds[trkIndex].okECAL << std::endl;
    }

    double maxNearP = -1.0;
    if (vdetIds[trkIndex].okECAL) {
      std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
      if (debug) std::cout << "chargeIsolationEcal:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;

      for (unsigned int indx=0; indx<vdetIds.size(); ++indx) {
        if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okECAL) {
          const DetId anyCell = vdetIds[indx].detIdECAL;
          if (!spr::chargeIsolation(anyCell,vdets)) {
            const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
            if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
          }
        }
      }
    }
    return maxNearP;
  }
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 abs, chargeIsolation(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, EcalBarrelGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), info, matrixECALIds(), reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, propagateECAL(), reco::TrackBase::quality(), and reco::TrackBase::qualityByName().

                                                                                                                                                                                                                                                                                               {
  
    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));

    std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
    if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;

    double maxNearP = -1.0;
    reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);

    // const DetId anyCell,
    reco::TrackCollection::const_iterator trkItr2;
    for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {

      const reco::Track* pTrack2 = &(*trkItr2);

      bool   trkQuality  = pTrack2->quality(trackQuality_);
      if ( (trkItr2 != trkItr) && trkQuality )  {
      
        std::pair<math::XYZPoint,bool> info = spr::propagateECAL(pTrack2,bField);
        const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());

        if (info.second) {
          if (std::abs(point2.eta())<1.479) {
            const DetId anyCell = barrelGeom->getClosestCell(point2);
            if (!spr::chargeIsolation(anyCell,vdets)) {
              if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
            }
          } else {
            const DetId anyCell = endcapGeom->getClosestCell(point2);
            if (!spr::chargeIsolation(anyCell,vdets)) {
              if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
            }
          }
        } //info.second
      }
    }
    return maxNearP;
  }
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 abs, TrackDetectorAssociator::associate(), chargeIsolation(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, EcalBarrelGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), TrackDetectorAssociator::getFreeTrajectoryState(), CaloGeometry::getSubdetectorGeometry(), TrackDetMatchInfo::isGoodEcal, matrixECALIds(), reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtEcal.

                                                                                                                                                                                                                                                                                                                                                                                                    {
  
    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));

    std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
    if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;

    double maxNearP = -1.0;
    reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);

    // const DetId anyCell,
    reco::TrackCollection::const_iterator trkItr2;
    for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {

      const reco::Track* pTrack2 = &(*trkItr2);

      bool   trkQuality  = pTrack2->quality(trackQuality_);
      if ( (trkItr2 != trkItr) && trkQuality )  {
      
        const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
        TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
        const GlobalPoint point2(info2.trkGlobPosAtEcal.x(),info2.trkGlobPosAtEcal.y(),info2.trkGlobPosAtEcal.z());

        if (info2.isGoodEcal ) {
          if (std::abs(point2.eta())<1.479) {
            const DetId anyCell = barrelGeom->getClosestCell(point2);
            if (!spr::chargeIsolation(anyCell,vdets)) {
              if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
            }
          } else {
            const DetId anyCell = endcapGeom->getClosestCell(point2);
            if (!spr::chargeIsolation(anyCell,vdets)) {
              if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
            }
          }
        } //info2.isGoodEcal
      }
    }
    return maxNearP;
  }
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, reco::TrackBase::p(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by IsolatedTracksNxN::analyze().

                                                                                                                                                             {
  
    std::vector<DetId> dets(1,vdetIds[trkIndex].detIdHCAL);
    if (debug) {
      std::cout << "DetId " << (HcalDetId)(dets[0]) << " Flag " << vdetIds[trkIndex].okHCAL << std::endl;
    }

    double maxNearP = -1.0;
    if (vdetIds[trkIndex].okHCAL) {
      std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
      if (debug) std::cout << "chargeIsolationHcal:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;

      for (unsigned indx = 0; indx<vdetIds.size(); ++indx) {
        if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okHCAL) {
          const DetId anyCell = vdetIds[indx].detIdHCAL;
          if (!spr::chargeIsolation(anyCell,vdets)) {
            const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
            if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
          }
        }
      }
    }
    return maxNearP;
  }
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(), reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::phi(), propagateHCAL(), reco::TrackBase::quality(), and reco::TrackBase::qualityByName().

                                                                                                                                                                                                                                                                                                         {

    std::vector<DetId> dets(1,ClosestCell);

    if (debug) std::cout << (HcalDetId) ClosestCell << std::endl;

    std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
    std::vector<DetId>::iterator it;  
  
    if (debug) {
      for (unsigned int i=0; i<vdets.size(); i++) {
        std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
      }
    }

    double maxNearP = -1.0;
    reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
  
    reco::TrackCollection::const_iterator trkItr2;
    for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
    
      const reco::Track* pTrack2 = &(*trkItr2);
    
      bool   trkQuality  = pTrack2->quality(trackQuality_);
      if ( (trkItr2 != trkItr) && trkQuality )  {
        std::pair<math::XYZPoint,bool> info = spr::propagateHCAL(pTrack2,bField);
        const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());

        if (debug) {
          std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
        }

        if (info.second) {
          const DetId anyCell = gHB->getClosestCell(point2);
          if (!spr::chargeIsolation(anyCell,vdets)) {   
            if(maxNearP<pTrack2->p())  maxNearP=pTrack2->p();
          }
          if (debug){
            std::cout << "maxNearP " << maxNearP << " thisCell " 
                      << (HcalDetId)anyCell << " (" 
                      << info.first.x() << "," << info.first.y() <<","
                      << info.first.z() << ")" << std::endl;
          }
        }
      }
    }
    return maxNearP;
  }
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(), reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::phi(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtHcal.

                                                                                                                                                                                                                                                                                                                                                                                                              {

    std::vector<DetId> dets(1,ClosestCell);

    if (debug) std::cout << (HcalDetId) ClosestCell << std::endl;

    std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
    std::vector<DetId>::iterator it;  
  
    if (debug) {
      for (unsigned int i=0; i<vdets.size(); i++) {
        std::cout << "HcalDetId in " <<2*ieta+1 << "x" << 2*iphi+1 << " " << (HcalDetId) vdets[i] << std::endl;
      }
    }

    double maxNearP = -1.0;
    reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
  
    reco::TrackCollection::const_iterator trkItr2;
    for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
    
      const reco::Track* pTrack2 = &(*trkItr2);
    
      bool   trkQuality  = pTrack2->quality(trackQuality_);
      if ( (trkItr2 != trkItr) && trkQuality )  {
        const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
        TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
        const GlobalPoint point2(info2.trkGlobPosAtHcal.x(),info2.trkGlobPosAtHcal.y(),info2.trkGlobPosAtHcal.z());

        if (debug) {
          std::cout << "Track2 (p,eta,phi) " << pTrack2->p() << " " << pTrack2->eta() << " " << pTrack2->phi() << std::endl;
        }

        if (info2.isGoodHcal ) {
          const DetId anyCell = gHB->getClosestCell(point2);
          if (!spr::chargeIsolation(anyCell,vdets)) {   
            if(maxNearP<pTrack2->p())  maxNearP=pTrack2->p();
          }
          if (debug){
            std::cout << "maxNearP " << maxNearP << " thisCell " 
                      << (HcalDetId)anyCell << " (" 
                      << info2.trkGlobPosAtHcal.x() << ","
                      << info2.trkGlobPosAtHcal.y() <<","
                      << info2.trkGlobPosAtHcal.z() <<")" << std::endl;
          }
        }
      }
    }
    return maxNearP;
  }
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, reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::quality(), reco::TrackBase::qualityByName(), reco::HitPattern::trackerLayersWithMeasurement(), and TrackDetMatchInfo::trkGlobPosAtHcal.

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

                                                                                                                                                                                                                                                                                                                                                                                                                                               {

    nNearTRKs=0;
    nLayers_maxNearP=0;
    trkQual_maxNearP=-1; 
    maxNearP_goodTrk = -999.0;
    double maxNearP = -999.0;
    reco::TrackBase::TrackQuality trackQuality_=  reco::TrackBase::qualityByName(theTrackQuality);

    // Iterate over tracks
    reco::TrackCollection::const_iterator trkItr2;
    for( trkItr2 = trkCollection->begin(); 
         trkItr2 != trkCollection->end(); ++trkItr2){

      // Get track
      const reco::Track* pTrack2 = &(*trkItr2);
    
      // Get track qual, nlayers, and hit pattern
      if (pTrack2->quality(trackQuality_)) trkQual_maxNearP  = 1;
      const reco::HitPattern& hitp = pTrack2->hitPattern();
      nLayers_maxNearP = hitp.trackerLayersWithMeasurement() ;        
    
      // Skip if the neighboring track candidate is the iso-track
      // candidate
      if (trkItr2 != trkItr) {
    
        // Get propagator
        const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2);
        TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_);
    
        // Make sure it reaches Hcal
        if (info2.isGoodHcal ) {
    
          const GlobalPoint point2(info2.trkGlobPosAtHcal.x(),
                                   info2.trkGlobPosAtHcal.y(),
                                   info2.trkGlobPosAtHcal.z());
    
          int isConeChargedIso = spr::coneChargeIsolation(hpoint1, point2, trackMom, dR);
    
          if (isConeChargedIso==0) {
            nNearTRKs++;
            if(maxNearP<pTrack2->p()) {
              maxNearP=pTrack2->p();
              if (trkQual_maxNearP>0 && nLayers_maxNearP>7 && maxNearP_goodTrk<pTrack2->p()) {
                maxNearP_goodTrk=pTrack2->p();
              }
            }
          }
        }
      }
    } // Iterate over track loop
    
    return maxNearP;
  }
int spr::coneChargeIsolation ( const GlobalPoint hpoint1,
const GlobalPoint point2,
const GlobalVector trackMom,
double  dR 
)

Definition at line 252 of file ChargeIsolation.cc.

References getDistInPlaneTrackDir().

                                                                                                                          {                      

    int isIsolated = 1;
    if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR) isIsolated = 1;
    else isIsolated = 0;
    return isIsolated;
  } 
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 
)
std::map<std::string,double> spr::eCaloSimInfo ( caloSimInfo &  info)
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 
)
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 
)
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 
)
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 
)
template<typename T >
double spr::eECALmatrix ( CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
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,
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(), edm::HandleBase::isValid(), EcalSeverityLevel::kWeird, matrixECALIds(), convertSQLiteXML::ok, edm::Handle< T >::product(), and EcalSeverityLevelAlgo::severityLevel().

                                                                                                                                                                                                                                                                                                                                                                                                            {

    std::vector<DetId> vdets;
    spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);

    const EcalRecHitCollection * recHitsEB = 0;
    if (hitsEB.isValid())  recHitsEB = hitsEB.product();
    bool flag = true;
    if (debug) {
      std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
                << " nXtals " << vdets.size() << std::endl;
   }

    double energySum = 0.0;
    for (unsigned int i1=0; i1<vdets.size(); i1++) {
      if (vdets[i1] != DetId(0)) {
        double eTower = spr::energyECALTower(vdets[i1], hitsEB, hitsEE, ttMap, debug);
        bool ok = true;
        if      (vdets[i1].subdetId()==EcalBarrel) ok = (eTower > ebThr);
        else if (vdets[i1].subdetId()==EcalEndcap) ok = (eTower > eeThr);
        if (debug) std::cout << "Crystal 0x" <<std::hex << vdets[i1]() 
                             <<std::dec << " Flag " << ok;
        if (ok) {
          std::vector<EcalRecHitCollection::const_iterator> hit;
          if (vdets[i1].subdetId()==EcalBarrel) {
            spr::findHit(hitsEB,vdets[i1],hit,debug);

            ok  = (sevlv->severityLevel(vdets[i1], (*recHitsEB)) != EcalSeverityLevel::kWeird);
          } else if (vdets[i1].subdetId()==EcalEndcap) {
            spr::findHit(hitsEE,vdets[i1],hit,debug);
          }
          double ener=0;
          for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
            double en=0, tt=0;
            if (vdets[i1].subdetId()==EcalBarrel) {
              if (hit[ihit] != hitsEB->end()) {
                en = hit[ihit]->energy();
                tt = hit[ihit]->time();
              }
            } else if (vdets[i1].subdetId()==EcalEndcap) {
              if (hit[ihit] != hitsEE->end()) {
                en = hit[ihit]->energy();
                tt = hit[ihit]->time();
              }
            }
            if (debug) std::cout << " " << ihit << " E " << en << " T " << tt;
            if (tt > tMin && tt < tMax) ener += en;
          }
          if (!ok) {
            flag = false;
            if (debug) std::cout << " detected to be a spike";
          }
          energySum += ener;
        }
        if (debug) std::cout << "\n";
      }
    }
    if (debug) std::cout << "energyECAL: energySum = " << energySum << " flag = " << flag << std::endl;
    return std::pair<double,bool>(energySum,flag);
  }
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
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 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
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 >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalSeverityLevelAlgo sevlv,
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(), edm::HandleBase::isValid(), EcalSeverityLevel::kWeird, matrixECALIds(), convertSQLiteXML::ok, edm::Handle< T >::product(), and EcalSeverityLevelAlgo::severityLevel().

                                                                                                                                                                                                                                                                                                                                                                 {

    std::vector<DetId> vdets;
    spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);

    const EcalRecHitCollection * recHitsEB = 0;
    if (hitsEB.isValid())  recHitsEB = hitsEB.product();
    bool flag = true;
    if (debug) {
      std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
                << " nXtals " << vdets.size() << std::endl;
   }

    double energySum = 0.0;
    for (unsigned int i1=0; i1<vdets.size(); i1++) {
      if (vdets[i1] != DetId(0)) {
        bool ok = true;
        std::vector<EcalRecHitCollection::const_iterator> hit;
        if (vdets[i1].subdetId()==EcalBarrel) {
          spr::findHit(hitsEB,vdets[i1],hit,debug);

          ok  = (sevlv->severityLevel(vdets[i1], (*recHitsEB)) != EcalSeverityLevel::kWeird);
        } else if (vdets[i1].subdetId()==EcalEndcap) {
          spr::findHit(hitsEE,vdets[i1],hit,debug);
        }
        if (debug) std::cout << "Xtal 0x" <<std::hex << vdets[i1]() <<std::dec;
        double ener=0, ethr=ebThr;
        if (vdets[i1].subdetId() !=EcalBarrel) ethr = eeThr;
        for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
          double en=0, tt=0;
          if (vdets[i1].subdetId()==EcalBarrel) {
            if (hit[ihit] != hitsEB->end()) {
              en = hit[ihit]->energy();
              tt = hit[ihit]->time();
            }
          } else if (vdets[i1].subdetId()==EcalEndcap) {
            if (hit[ihit] != hitsEE->end()) {
              en = hit[ihit]->energy();
              tt = hit[ihit]->time();
            }
          }
          if (debug) std::cout << " " << ihit << " " << en;
          if (tt > tMin && tt < tMax) ener += en;
        }
        if (!ok) {
          flag = false;
          if (debug) std::cout << " detected to be a spike";
        }
        if (debug) std::cout << "\n";
        if (ener > ethr) energySum += ener;
      }
    }
    if (debug) std::cout << "energyECAL: energySum = " << energySum << " flag = " << flag << std::endl;
    return std::pair<double,bool>(energySum,flag);
  }
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 ,
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::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  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
caloSimInfo &  info,
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 >
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 10 of file GenSimInfo.cc.

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

Referenced by IsolatedGenParticles::analyze().

                                                                                                                                                                                                                                                  {
    
    if (debug) std::cout << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;

    std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
  }
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 18 of file GenSimInfo.cc.

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

                                                                                                                                                                                                                                                                          {

    if (debug) std::cout << "eGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;

    std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
  }
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 26 of file GenSimInfo.cc.

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

                                                                                                                                                                                                                                                        {
    
    if (debug) std::cout << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;

    std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
  }
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 34 of file GenSimInfo.cc.

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

                                                                                                                                                                                                                                                                                {

    if (debug) std::cout << "eGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;

    std::vector<DetId> vdets = spr::matrixECALIds(coreDet, dR, trackMom, geo, caloTopology, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, true, info, debug);
  }
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 > &  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::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::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 959 of file MatrixECALDetIds.cc.

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

Referenced by matrixECALIds().

                                                                                                                                                                                                                       {

    if (det.subdetId() == EcalBarrel) {
      EBDetId id = det;
      if (debug) std::cout << "extraIds::Cell " << id << " rows "  << ietaW
                           << "|" << ietaE << " columns " << iphiS << "|"
                           << iphiN << std::endl;
      int etaC = id.ietaAbs();
      int phiC = id.iphi();
      int zsid = id.zside();
      for (int eta = -ietaW; eta <= ietaE; ++eta) {
        for (int phi = -iphiS; phi <= iphiN; ++phi) {
          int iphi = phiC+phi;
          if (iphi < 0)        iphi += 360;
          else if (iphi > 360) iphi -= 360;    
          int ieta = zsid*(etaC+eta);
          if (EBDetId::validDetId(ieta,iphi)) {
            id = EBDetId(ieta,iphi);
            if (barrelGeom.present(id)) {
              if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
                cells.push_back((DetId)id);
              }
            }
          }
        }
      }
    } else if (det.subdetId() == EcalEndcap) {
      EEDetId id = det;
      if (debug) std::cout << "extraIds::Cell " << id << " rows "  << ietaW
                           << "|" << ietaE << " columns " << iphiS << "|"
                           << iphiN << std::endl;
      int ixC  = id.ix();
      int iyC  = id.iy();
      int zsid = id.zside();
      for (int kx = -ietaW; kx <= ietaE; ++kx) {
        for (int ky = -iphiS; ky <= iphiN; ++ky) {
          int ix = ixC+kx;
          int iy = iyC+ky;
          if (EEDetId::validDetId(ix,iy,zsid)) {
            id = EEDetId(ix,iy,zsid);
            if (endcapGeom.present(id)) {
              if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
                cells.push_back((DetId)id);
              }
            }
          }
        }
      }
    } 

    if (debug) {
      std::cout << "extraIds:: finds " << cells.size() << " new cells" 
                << std::endl;
      for (unsigned int i1=0; i1<cells.size(); ++i1) {
        if (cells[i1].subdetId() == EcalBarrel) {
          EBDetId id = cells[i1];
          std::cout << "extraIds::Cell " << i1 << " "  << id << std::endl;
        } else if (cells[i1].subdetId() == EcalEndcap) {
          EEDetId id = cells[i1];
          std::cout << "ectraIds::Cell " << i1 << " " << id << std::endl;
        } else {
          std::cout << "extraIds::Cell " << i1 << " 0x" << std::hex 
                    << cells[i1]() <<std::dec << " Unknown Type" <<std::endl;
        }
      }
    }
  }
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 ParticleTreeDrawer::accept(), EcalZeroSuppressor< EBDataFrame >::accept(), HcalHitFilter::accepts(), VertexUpdator< 5 >::add(), Measurement::addAffectingEntriesFromOptO(), reco::CompositeCandidate::addDaughter(), reco::NamedCompositeCandidate::addDaughter(), DummyMetricsUpdator::additionalAlignables(), SimpleMetricsUpdator::additionalAlignables(), DummyMetricsUpdator::additionalAlignablesWithDistances(), pat::TriggerEvent::addObjectMatchResult(), SiStripQualityHotStripIdentifier::algoAnalyze(), reco::TrackBase::algoByName(), reco::Conversion::algoByName(), SiStripMonitorTrack::AllClusters(), HLTAlCaMonPi0::analyze(), HcalQIEDataCheck::analyze(), EcalPnGraphs::analyze(), DTT0CalibrationNew::analyze(), EEPedestalClient::analyze(), EESummaryClient::analyze(), HcalPedestalsCheck::analyze(), HcalAutoPedestalValidator::analyze(), EcalURecHitHists::analyze(), ParticleListDrawer::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), EELaserClient::analyze(), EcalCosmicsHists::analyze(), HcalCholeskyDecomp::analyze(), EcalMatacqAnalyzer::analyze(), EETestPulseClient::analyze(), HcalPedestalWidthsCheck::analyze(), CastorDumpConditions::analyze(), DTT0Calibration::analyze(), EcalLaserAnalyzer2::analyze(), HLTAlCa::analyze(), EcalDumpRaw::analyze(), EBSummaryClient::analyze(), TestTrackHits::analyze(), HcalGainsCheck::analyze(), SiStripApvGainBuilderFromTag::analyze(), TestOutliers::analyze(), HeavyFlavorValidation::analyze(), EELedClient::analyze(), EBTestPulseClient::analyze(), EBLaserClient::analyze(), DQMSourcePi0::analyze(), EBPedestalClient::analyze(), DTDigiTask::analyze(), edmtest::HcalDumpConditions::analyze(), DTNoiseCalibration::analyze(), MuonTruth::associateCSCHitId(), MuonTruth::associateHitId(), TrackerHitAssociator::associateMatchedRecHit(), TrackerHitAssociator::associatePixelRecHit(), RPCHitAssociator::associateRecHit(), TrackerHitAssociator::associateSimpleRecHitCluster(), AlignmentParameterStore::attachCorrelations(), ClusterProducerFP420::badChannel(), EcalTrigPrimProducer::beginJob(), ProfilerService::beginPath(), PileUpProducer::beginRun(), PhysicalPartsTree::beginRun(), HLTJetMETDQMSource::beginRun(), DQMRootOutputModule::beginRun(), EgHLTOfflineSource::beginRun(), DTDCSByLumiTask::beginRun(), GctFormatTranslateV35::blockToGctInternEmCand(), GctFormatTranslateV38::blockToGctInternEmCand(), GctFormatTranslateV35::blockToRctCaloRegions(), GctFormatTranslateV38::blockToRctCaloRegions(), edm::BMixingModule::BMixingModule(), CalibrationTask::book(), CalibrationScanTask::book(), SiStripFedCabling::buildFedCabling(), TtSemiLepHypMaxSumPtWMass::buildHypo(), SiStripDetVOffBuilder::buildPSUdetIdMap(), VirtualJetProducer::JetType::byName(), HLTEcalResonanceFilter::calcShowerShape(), JetPlusTrackProducerAA::calculateBGtracksJet(), reco::modules::CandCombinerBase::CandCombinerBase(), HcalDbProducer::channelQualityCallback(), CastorDbProducer::channelQualityCallback(), MulticoreRunLumiEventChecker::check(), CSCDCCExaminer::check(), HLTOniaSource::checkHLTConfiguration(), Multi5x5ClusterAlgo::checkMaxima(), EEPedestalTask::cleanup(), EELedTask::cleanup(), EELaserTask::cleanup(), PFJetAlgorithm::CleanUp(), EETestPulseTask::cleanup(), EBTestPulseTask::cleanup(), EBLaserTask::cleanup(), EBPedestalTask::cleanup(), egammaisolation::EgammaRecHitExtractor::collect(), HDQMInspectorConfigBase::computeIntegral(), HLTMonBitSummary::configSelector(), HCALConfigDB::connect(), FastFedCablingHistosUsingDb::connections(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer(), Model::copyMeasurements(), SiStripFecCabling::countDevices(), cms::HICFTSfromL1orL2::createFTSfromL1orL2(), ESDigitizer::createNoisyList(), DDfetch(), ParticleDecayDrawer::decay(), gen::Pythia6Hadronizer::declareSpecialSettings(), Pythia8Hadronizer::declareSpecialSettings(), Model::deleteOptO(), muonisolation::CaloExtractor::deposit(), SiStripFineDelayHit::detId(), TowerBlockFormatter::DigiToRaw(), SiPixelGainCalibrationAnalysis::doFits(), ThePEG::LesHouchesInterface::doReadEvent(), HLTEcalResonanceFilter::doSelection(), DTSegtoRPC::DTSegtoRPC(), RPCLinkSynchroStat::dumpDelays(), SiPixelActionExecutor::dumpEndcapModIds(), EcalBarrelMonitorClient::EcalBarrelMonitorClient(), CaloTowersCreationAlgo::ecalChanStatusForCaloTower(), EcalEndcapMonitorClient::EcalEndcapMonitorClient(), EcalPreshowerMonitorClient::EcalPreshowerMonitorClient(), EcalListOfFEDSProducer::Egamma(), ESListOfFEDSProducer::Egamma(), CastorDbProducer::electronicsMapCallback(), HcalDbProducer::electronicsMapCallback(), L1ScalersClient::endLuminosityBlock(), DTNoiseTest::endLuminosityBlock(), EELedTask::endRun(), KalmanVertexTrackCompatibilityEstimator< N >::estimate(), GsfVertexTrackCompatibilityEstimator::estimate(), L1GtAlgorithmEvaluation::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(), MuonMesh::fillMesh(), SiPixelInformationExtractor::fillModuleAndHistoList(), JetPartonMatcher::fillPhysicsDefinition(), MuonAnalyzerSBSM::FillPlots(), CastorShowerLibraryMaker::FillShowerEvent(), StorageAccount::fillSummary(), HLTPi0RecHitsFilter::filter(), SiStripCommissioningRunTypeFilter::filter(), HltComparator::filter(), EcalSimpleUncalibRecHitFilter::filter(), HLTMuonL1RegionalFilter::filter(), HLTMuonL1Filter::filter(), HLTMuonTrackMassFilter::filter(), LogErrorFilter::filter(), HLTEcalResonanceFilter::filter(), EcalMIPRecHitFilter::filter(), TTUTrackingAlg::filter(), ErrorSummaryFilter::filter(), HLTHcalSimpleRecHitFilter::filter(), HLTMuonL2PreFilter::filter(), MuonSeedOrcaPatternRecognition::filterOverlappingChambers(), find(), edm::Trie< T >::find(), edm::find_in_all(), DTCombinatorialPatternReco::findCompatibleHits(), SiStripPsuDetIdMap::findDcuIdFromDeviceAddress(), JetCorrectorParametersCollection::findKey(), MSLayersAtAngle::findLayer(), HLTPerformanceInfo::findModule(), HLTPerformanceInfo::findPath(), JetPlusTrackCorrector::findTrack(), EcalTBReadout::findTTlist(), edm::IndexIntoFile::fixIndexes(), HcalDQMChannelQuality::flagAlgo(), XtoFFbarFilter::found(), HcalDbProducer::gainsCallback(), CastorDbProducer::gainsCallback(), HcalDbProducer::gainWidthsCallback(), CastorDbProducer::gainWidthsCallback(), SubsystemNeutronReader::generateChamberNoise(), pat::PATGenCandsFromSimTracksProducer::generatorRef_(), GenJetParticleSelector::GenJetParticleSelector(), TrackClassifier::genPrimaryVertices(), VertexClassifier::genPrimaryVertices(), egHLT::trigTools::getActiveFilters(), EcalSelectiveReadoutProducer::getBinOfMax(), ComponentFactoryByName< B >::getBuilder(), PhysicsTools::MVATrainer::getCalibration(), HcalCalibrationsSet::getCalibrations(), CastorCalibrationsSet::getCalibrations(), CastorCalibrationWidthsSet::getCalibrationWidths(), HcalCalibrationWidthsSet::getCalibrationWidths(), hcalCalib::GetCoefFromMtrxInvOfAve(), HcalLutManager::getCompressionLutXmlFromAsciiMaster(), HcalLutManager::getCompressionLutXmlFromCoder(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), HLTScalersClient::CountLSFifo_t::getCount(), EgammaHadTower::getDepth1HcalESum(), EgammaHadTower::getDepth2HcalESum(), EcalElectronicsMapping::getDetId(), TrackAssociatorByHits::getDoubleCount(), EcalElectronicsMapping::getElectronicsId(), SiPixelActionExecutor::getFEDSummaryME(), SiPixelActionExecutor::getGrandSummaryME(), pat::PATObject< ObjectType >::getKinResolution(), JetCorrectorParametersCollection::getL5Bin(), JetCorrectorParametersCollection::getL7Bin(), HcalLutManager::getLinearizationLutXmlFromAsciiMasterEmap(), HcalLutManager::getLinearizationLutXmlFromCoder(), HcalLutManager::getLinearizationLutXmlFromCoderEmap(), HcalLutManager::getLutFromXml_old(), HcalLutManager::getLutXmlFromAsciiMaster(), CastorShowerLibraryMaker::GetMissingEnergy(), SiStripSummary::getPosition(), HDQMSummary::getPosition(), TrackAssociatorByHits::getShared(), PrimaryVertexAnalyzer4PU::getSimPVs(), PrimaryVertexAnalyzer::getSimPVs(), SiStripInformationExtractor::getSingleModuleHistos(), EgammaRecHitIsolation::getSum_(), SiStripSummaryCreator::getSummaryME(), EgammaTowerIsolation::getTowerESum(), EgammaTowerIsolation::getTowerEtSum(), EcalElectronicsMapping::getTriggerElectronicsId(), CastorRawGains::getValues(), HcalRawGains::getValues(), HcalLutManager::getZdcLutXml(), 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(), ctfseeding::HitExtractorPIX::hits(), HLTMonSimpleBTag::HLTMonSimpleBTag(), include(), pat::TriggerPath::indexModule(), SiTrivialInduceChargeOnStrips::indexOf(), EcalEndcapRecHitsMaker::init(), MSLayersKeeperX0Averaged::init(), SiStripFecKey::initFromPath(), SiStripFedKey::initFromPath(), SiStripDetKey::initFromPath(), HLTMuonValidator::initializeHists(), HBHEHitMap::insert(), MuonHOAcceptance::isChannelDead(), MuonHOAcceptance::isChannelSiPM(), EcalElectronicsMapper::isGhost(), stor::ResourceMonitorCollection::isImportantDisk(), CSCBadChambers::isInBadChamber(), HcalDQMChannelQuality::isMasked(), AlignmentParameterSelector::isMemberOfVector(), SiPixelDisabledModules::isModuleDisabled(), HPDNoiseLibraryReader::IsNoiseApplicable(), RPCCosmicSeedrecHitFinder::isouterLayer(), reco::PFDisplacedVertex::isThereKindTracks(), HLTMuonL2ToL1Map::isTriggeredByL1(), JetCorrectionServiceChain::JetCorrectionServiceChain(), pat::JetCorrFactorsProducer::JetCorrFactorsProducer(), EcalListOfFEDSProducer::Jets(), ESListOfFEDSProducer::Jets(), L1MuGMTHWFileReader::L1MuGMTHWFileReader(), HcalDbProducer::L1triggerObjectsCallback(), PerformancePayloadFromTFormula::limitPos(), CSCGasCollisions::lnEnergyLoss(), L1MuGMTLUT::Load(), edm::service::MessageServicePSetValidation::lookForMatch(), HcalDbProducer::LUTCorrsCallback(), HcalDbProducer::lutMetadataCallback(), Multi5x5ClusterAlgo::mainSearch(), reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >::make(), HybridClusterAlgo::makeClusters(), HSCPValidator::makeGenPlots(), HiBremRecoveryClusterAlgo::makeIslandSuperClusters(), Multi5x5BremRecoveryClusterAlgo::makeIslandSuperClusters(), EgammaHLTNxNClusterProducer::makeNxNClusters(), HSCPValidator::makeSimDigiPlotsECAL(), HSCPValidator::makeSimDigiPlotsRPC(), HSCPValidator::makeSimTrackPlots(), CSCHitFromStripOnly::makeStripData(), PhysicsTools::MVATrainer::makeTrainCalibration(), PerformancePayloadFromTable::maxPos(), merge(), CaloTowersMerger::mergedTower(), PerformancePayloadFromTable::minPos(), edm::MixingModule::MixingModule(), EcalListOfFEDSProducer::Muon(), ESListOfFEDSProducer::Muon(), ora::PoolDbCache::nameById(), reco::modules::NamedCandCombinerBase::NamedCandCombinerBase(), TFileAdaptor::native(), SequentialCombinationGenerator< T >::next_subset(), ObjectPairFilter< C, S >::ObjectPairFilter(), ObjectSelector< SingleElementCollectionSelector< InputCollection, Selector, reco::CandidateCollection, StoreContainer, RefAdder >, reco::CandidateCollection, NonNullNumberSelector >::ObjectSelector(), ThePEG::LesHouchesInterface::open(), PdgIdSelector::operator()(), rpcrawtodigi::DebugDigisPrintout::operator()(), PdgIdExcluder::operator()(), RecoTrackSelector::operator()(), StatusSelector::operator()(), edm::DetSetVector< T >::operator[](), ReadMapType< std::map< std::string, double > >::operator[](), edm::DetSetLazyVector< T >::operator[](), TransientVertex::originalTrack(), JetMatchingTools::overlapEnergyFraction(), pat::PATObject< ObjectType >::overlaps(), AlpgenHeader::parameterName(), AlpgenHeader::parse(), Args::parse(), SiStripDbParams::partitionNames(), CastorDbProducer::pedestalsCallback(), HcalDbProducer::pedestalsCallback(), HcalDbProducer::pedestalWidthsCallback(), CastorDbProducer::pedestalWidthsCallback(), HcalDbProducer::PFCorrsCallback(), HDQMInspector::plot(), cond::PayLoadInspector< DataT >::plot(), edm::rootfix::LockService::preModule(), edm::rootfix::LockService::preSourceConstruction(), PrimaryVertexAnalyzer::PrimaryVertexAnalyzer(), PrimaryVertexAnalyzer4PU::PrimaryVertexAnalyzer4PU(), SiStripConfigDb::printAnalysisDescriptions(), SiStripConfigDb::printDeviceDescriptions(), SiStripConfigDb::printFedConnections(), SiStripConfigDb::printFedDescriptions(), ParticleTreeDrawer::printInfo(), DDLString::processElement(), DDLNumeric::processElement(), QuarkoniaTrackSelector::produce(), HighPtTrackEcalDetIdProducer::produce(), MCTrackMatcher::produce(), cms::TrackListMerger::produce(), InterestingTrackEcalDetIdProducer::produce(), EcalTPSkimmer::produce(), CaloTowersMerger::produce(), FlavorHistoryProducer::produce(), TtDilepEvtSolutionMaker::produce(), LaserAlignmentT0Producer::produce(), pat::PATJetProducer::produce(), LaserAlignment::produce(), GamIsoDetIdCollectionProducer::produce(), AlCaElectronsProducer::produce(), L1Comparator::produce(), EgammaHLTCombinedIsolationProducer::produce(), ESListOfFEDSProducer::produce(), EleIsoDetIdCollectionProducer::produce(), GenTrackMatcher::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), pat::GenPlusSimParticleProducer::produce(), ReducedRecHitCollectionProducer::produce(), EcalRawToDigi::produce(), EgammaHLTElectronCombinedIsolationProducer::produce(), SiPixelRawToDigi::produce(), pat::PATTauProducer::produce(), EcalListOfFEDSProducer::produce(), ConvBremSeedProducer::produce(), ConversionSeedFilterCharge::produce(), InterestingEcalDetIdProducer::produce(), SecondaryVertexProducer::produce(), ProfilerService::ProfilerService(), SiStripDbParams::pset(), HcalDbProducer::QIEDataCallback(), CastorDbProducer::QIEDataCallback(), HcalDQMChannelQuality::quality(), reco::TrackBase::qualityByName(), SurveyPxbImageReader< T >::read(), SiStripTFile::readDQMFormat(), EcalDigiDisplay::readEBDigis(), EcalPedHists::readEBdigis(), EcalDigiDisplay::readEEDigis(), EcalPedHists::readEEdigis(), BeamFitter::readEvent(), L1TdeRCT::readFEDVector(), EcalTBReadout::readOut(), EcalDigiDisplay::readPNDigis(), SiStripDcsInfo::readStatus(), Model::readSystemDescription(), evf::FUEventProcessor::receivingAndMonitor(), SiStripMonitorTrack::RecHitInfo(), CalorimetryManager::reconstruct(), reco::Vertex::refittedTrack(), TransientVertex::refittedTrack(), ora::PoolDbCache::remove(), HPSPFRecoTauAlgorithm::removeCandidateFromRefVector(), SiPixelDisabledModules::removeDisabledModule(), lhef::LHEEvent::removeResonances(), DDI::LogicalPart::removeSpecifics(), edm::TransientProductLookupMap::reorderIfNecessary(), EELaserTask::reset(), EETestPulseTask::reset(), EBLaserTask::reset(), EEPedestalTask::reset(), EBTestPulseTask::reset(), EBPedestalTask::reset(), HcalDbProducer::respCorrsCallback(), PerformancePayloadFromTFormula::resultPos(), PerformancePayloadFromTable::resultPos(), EcalRecHitWorkerSimple::run(), JetMETHLTOfflineClient::runClient_(), EgHLTOfflineClient::runClient_(), BTagHLTOfflineClient::runClient_(), DTLocalTriggerTPTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerTest::runClientDiagnostic(), DTLocalTriggerTask::runDDUvsDCCAnalysis(), L1MuDTEtaProcessor::runEtaMatchingUnit(), edm::search_all(), reco::FlavorHistorySelectorUtil::select(), SiStripBadModuleGenerator::selectDetectors(), EcalDisplaysByEvent::selectHits(), EcalMipGraphs::selectHits(), AlignmentParameterStore::selectParameters(), HcalCalibrationsSet::setCalibrations(), CastorCalibrationsSet::setCalibrations(), CastorCalibrationWidthsSet::setCalibrationWidths(), HcalCalibrationWidthsSet::setCalibrationWidths(), RBCProcessRPCSimDigis::setDigiAt(), RBCProcessRPCDigis::setDigiAt(), GlobalOptionMgr::setGlobalOption(), PFBlockAlgo::setInput(), pat::PATObject< ObjectType >::setKinResolution(), pat::PATObject< ObjectType >::setOverlaps(), EcalFenixFgvbEB::setParameters(), DDLSolid::setReference(), EEPedestalClient::setup(), EBTestPulseTask::setup(), EBPedestalTask::setup(), EBTestPulseClient::setup(), EELaserTask::setup(), EELaserClient::setup(), EETestPulseClient::setup(), EBLaserTask::setup(), EBPedestalClient::setup(), EBSummaryClient::setup(), EBLaserClient::setup(), EELedClient::setup(), EETestPulseTask::setup(), EEPedestalTask::setup(), EELedTask::setup(), EESummaryClient::setup(), egHLT::OffHelper::setupTriggers(), HcalSimParameterMap::simParameters(), SiStripFedIdListReader::SiStripFedIdListReader(), ctfseeding::HitExtractorSTRP::skipThis(), CRackTrajectoryBuilder::SortHits(), CMSMidpointAlgorithm::splitAndMerge(), sumSmallDepths(), evf::FUEventProcessor::supervisor(), pat::Jet::tagInfo(), cond::TBufferBlobTypeInfo::TBufferBlobTypeInfo(), HcalLutManager::test_emap(), HcalDbProducer::timeCorrsCallback(), EcalSRCondTools::tokenize(), EgammaHadTower::towersOf(), HistoryBase::traceSimHistory(), TrackParameterAnalyzer::TrackParameterAnalyzer(), QcdUeDQM::trackSelection(), reco::Vertex::trackWeight(), TransientVertex::trackWeight(), pat::TriggerEvent::triggerObjectMatchResult(), KalmanVertexUpdator< N >::update(), MSLayersAtAngle::update(), PedsFullNoiseHistosUsingDb::update(), SimpleMetricsUpdator::update(), PedestalsHistosUsingDb::update(), LatencyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), DummyMetricsUpdator::update(), HLTScalersClient::CountLSFifo_t::update(), FineDelayHistosUsingDb::update(), L1RCTProducer::updateConfiguration(), KalmanAlignmentUpdator::updateUserVariables(), KalmanAlignmentSetup::useForExternalTracking(), KalmanAlignmentSetup::useForTracking(), pat::PATObject< ObjectType >::userCand(), pat::PATObject< ObjectType >::userDataObject_(), pat::PATObject< ObjectType >::userFloat(), pat::PATObject< ObjectType >::userInt(), MagGeoBuilderFromDDD::volumeHandle::volumeHandle(), CSCValHists::writeHists(), L1GtPatternWriter::writePatterns(), CSCGasCollisions::writeSummary(), HcalDbProducer::zsThresholdsCallback(), and DDLElementRegistry::~DDLElementRegistry().

                                                                                                                                  {

    hit.push_back( hits->find(thisDet) );
  }
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.

                                                                                                                                  {

    edm::PCaloHitContainer::const_iterator ihit;
    for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
      DetId detId(ihit->id());
      if (detId == thisDet) {
        hit.push_back(ihit);
      }
    }
  }
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 abs, gather_cfg::cout, EcalBarrel, EcalEndcap, PV3DBase< T, PVType, FrameType >::eta(), getDistInPlaneTrackDir(), CaloGeometry::getPosition(), and j.

                                                                                                                                                                                                                                                                            {
  
    std::vector<EcalRecHitCollection::const_iterator> hit;
  
    // Only check both barrel and endcap when track is near transition
    // region: 1.479-2*0.087 < trkEta < 1.479+2*0.087
  
    bool doBarrel=false, doEndcap=false;
    if ( std::abs(point1.eta()) < 1.653) doBarrel=true; // 1.479+2*0.087
    if ( std::abs(point1.eta()) > 1.305) doEndcap=true; // 1.479-2*0.087    
  
    if (doBarrel) {  
      for (EcalRecHitCollection::const_iterator j=barrelhits->begin(); 
           j!=barrelhits->end(); j++) {

        bool keepHit = false;
        if (j->id().subdetId() == EcalBarrel) {
          EBDetId EBid = EBDetId(j->id());
          const GlobalPoint rechitPoint = geo->getPosition(EBid);
          if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint)<dR) keepHit = true;
        } else {
          std::cout << "PROBLEM : Endcap RecHits in Barrel Collection!?" 
                    << std::endl;
        }
        if (keepHit) hit.push_back(j);
      }
    } // doBarrel
  
    if (doEndcap) {  
    
      for (EcalRecHitCollection::const_iterator j=endcaphits->begin(); 
           j!=endcaphits->end(); j++) {
      
        bool keepHit = false;
      
        if (j->id().subdetId() == EcalEndcap) {
          EEDetId EEid = EEDetId(j->id());
          const GlobalPoint rechitPoint = geo->getPosition(EEid);
          if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint)<dR) keepHit = true;
        } else {
          std::cout << "PROBLEM : Barrel RecHits in Endcap Collection!?" 
                    << std::endl;
        }
        if (keepHit) hit.push_back(j);
      }
    } // doEndcap
  
    return hit;
  }
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 9 of file FindCaloHitCone.cc.

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

                                                                                                                                                                                                                         {
  
    std::vector<EcalRecHitCollection::const_iterator> hit;
  
    for (EcalRecHitCollection::const_iterator j=hits->begin(); 
         j!=hits->end(); j++) {

      bool keepHit = false;
    
      if (j->id().subdetId() == EcalEndcap) {
        EEDetId EEid = EEDetId(j->id());
        const GlobalPoint rechitPoint = geo->getPosition(EEid);
        if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint)<dR) keepHit = true;
      } else if (j->id().subdetId() == EcalBarrel) {
        EBDetId EBid = EBDetId(j->id());
        const GlobalPoint rechitPoint = geo->getPosition(EBid);
        if (spr::getDistInPlaneTrackDir(point1, trackMom, rechitPoint)<dR) keepHit = true;
      }

      if (keepHit) hit.push_back(j);
    }
    return hit;
  }
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().

                                                                                                                                                                                                                         {

    std::vector<edm::PCaloHitContainer::const_iterator> hit;  
    edm::PCaloHitContainer::const_iterator ihit;
    for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
      DetId detId(ihit->id());
      const GlobalPoint rechitPoint = geo->getPosition(detId);
      if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint)<dR) {
        hit.push_back(ihit);
      }
    }
    return hit;
  }
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 z.

Referenced by findDetIdECAL(), and findDetIdHCAL().

                                                                                                                      {
    
    double rcyl = radius*std::sin(theta);
    double z    = radius*std::cos(theta);
    GlobalPoint  point (rcyl*std::cos(phi),rcyl*std::sin(phi),z);
    const DetId cell = geo->getClosestCell(point);
    if (debug) {
      std::cout << "findDetIdCalo: rcyl " << rcyl << " z " << z << " Point " << point << " DetId ";
      if (cell.det() == DetId::Ecal) {
        if (cell.subdetId() == EcalBarrel) std::cout << (EBDetId)(cell);
        else                               std::cout << (EEDetId)(cell);
      } else {
        std::cout << (HcalDetId)(cell);
      }
      std::cout << std::endl;
    }
    return cell;
  }
const DetId spr::findDetIdECAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 11 of file DetIdFromEtaPhi.cc.

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

                                                                                          {
    double radius=0;
    int    subdet=0;
    double theta=2.0*std::atan(exp(-eta));
    if (std::abs(eta) > 1.479) {
      radius = 319.2/std::abs(std::cos(theta));
      subdet = EcalEndcap;
    } else {
      radius = 129.4/std::sin(theta);
      subdet = EcalBarrel;
    }
    const CaloSubdetectorGeometry* gECAL = geo->getSubdetectorGeometry(DetId::Ecal,subdet);
    if (debug) std::cout << "findDetIdECAL: eta " << eta << " theta " << theta <<" phi " << phi << " radius " << radius << " subdet " << subdet << std::endl;
    return spr::findDetIdCalo (gECAL, theta, phi, radius, debug);
  }
const DetId spr::findDetIdHCAL ( const CaloGeometry geo,
double  eta,
double  phi,
bool  debug = false 
)

Definition at line 27 of file DetIdFromEtaPhi.cc.

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

                                                                                          {
    double radius=0;
    double theta=2.0*std::atan(exp(-eta));
    if (std::abs(eta) > 1.392) radius = 402.7/std::abs(std::cos(theta));
    else                       radius = 180.7/std::sin(theta);
    const CaloSubdetectorGeometry* gHCAL = geo->getSubdetectorGeometry(DetId::Hcal,HcalBarrel);
    if (debug) std::cout << "findDetIdHCAL: eta " << eta <<" theta "<<theta<< " phi " << phi << " radius " << radius << std::endl;
    return spr::findDetIdCalo (gHCAL, theta, phi, radius, debug);
  }
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::findHit ( edm::Handle< T > &  hits,
DetId  thisDet,
bool  debug = false 
)

Referenced by eECALmatrix().

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(), mathSSE::sqrt(), and z.

                                                                              {

    double dR, Rec;
    if (fabs(eta1)<1.479) Rec=129;
    else Rec=317;
    double ce1=cosh(eta1);
    double ce2=cosh(eta2);
    double te1=tanh(eta1);
    double te2=tanh(eta2);
  
    double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
    if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
    else     dR=999999.;
    return dR;
  }
double spr::getDistInCMatHcal ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)

Definition at line 53 of file FindDistCone.cc.

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

                                                                              {

    // Radii and eta from Geometry/HcalCommonData/data/hcalendcapalgo.xml
    // and Geometry/HcalCommonData/data/hcalbarrelalgo.xml

    double dR, Rec;
    if (fabs(eta1)<1.392) Rec=177.5; 
    else Rec=391.95;
    double ce1=cosh(eta1);
    double ce2=cosh(eta2);
    double te1=tanh(eta1);
    double te2=tanh(eta2);
  
    double z=cos(phi1-phi2)/ce1/ce2+te1*te2;
    if(z!=0) dR=fabs(Rec*ce1*sqrt(1./z/z-1.));
    else     dR=999999.;
    return dR;
  }
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 coneChargeIsolation(), findCone(), matrixECALIds(), and matrixHCALIds().

                                                                                                                                {
  
    const GlobalVector caloIntersectVector(caloPoint.x(), 
                                           caloPoint.y(), 
                                           caloPoint.z()); //p

    const GlobalVector caloUnitVector = caloVector.unit();
    const GlobalVector rechitVector(rechitPoint.x(),
                                    rechitPoint.y(),
                                    rechitPoint.z());
    const GlobalVector rechitUnitVector = rechitVector.unit();
    double dotprod_denominator = caloUnitVector.dot(rechitUnitVector);
    double dotprod_numerator   = caloUnitVector.dot(caloIntersectVector);
    double rechitdist = dotprod_numerator/dotprod_denominator;
    const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
    const GlobalPoint effectiveRechitPoint(effectiveRechitVector.x(),
                                           effectiveRechitVector.y(),
                                           effectiveRechitVector.z());
    GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
    if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
      return distance_vector.mag();
    } else {
      return 999999.;
    }
  }
double spr::getEnergy ( HBHERecHitCollection::const_iterator  hit)

Definition at line 129 of file FindDistCone.cc.

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

Definition at line 137 of file FindDistCone.cc.

References HcalBarrel, and HcalEndcap.

                                                           {
    // This will not yet handle Ecal CaloHits!!
    double samplingWeight = 1.;
    // Hard coded sampling weights from JFH analysis of iso tracks
    // Sept 2009.
    HcalDetId detId(hit->id());
    if (detId.subdet() == HcalBarrel)
      samplingWeight = 114.1;
    else if (detId.subdet() == HcalEndcap) 
      samplingWeight = 167.3;
    else {
      // ONLY protection against summing HO, HF simhits
      return 0.;
    }
    
    return samplingWeight*hit->energy();
  }
void spr::getEtaPhi ( HBHERecHitCollection::const_iterator  hit,
int &  ieta,
int &  iphi 
)

Definition at line 93 of file FindDistCone.cc.

                                                                            {
    ieta = hit->id().ieta();
    iphi = hit->id().iphi();
  }
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.

                                                                                                                                      {

    RH_ieta.push_back(hit->id().ieta());
    RH_iphi.push_back(hit->id().iphi());
    RH_ene.push_back(hit->energy());
  }
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.

                                                                                                                                       {
    // SimHit function not yet implemented.
    RH_ieta.push_back(-9);
    RH_iphi.push_back(-9);
    RH_ene.push_back(-9.);
  }
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.

                                                      {

    int ietal = (ieta-1)/2;
    int ietar = ieta - ietal - 1;
    int iphil = (iphi-1)/2;
    int iphir = iphi - iphil - 1;
    spr::EtaPhi etaphi;
    etaphi.ietaE[0] = ietal; etaphi.ietaW[0] = ietar;
    etaphi.iphiN[0] = iphil; etaphi.iphiS[0] = iphir;
    if (ietal == ietar && iphil == iphir) {
      etaphi.ntrys = 1;
    } else if (ietal == ietar || iphil == iphir) {
      etaphi.ntrys = 2;
      etaphi.ietaE[1] = ietar; etaphi.ietaW[1] = ietal;
      etaphi.iphiN[1] = iphir; etaphi.iphiS[1] = iphil;
    } else {
      etaphi.ntrys = 4;
      etaphi.ietaE[1] = ietar; etaphi.ietaW[1] = ietal;
      etaphi.iphiN[1] = iphil; etaphi.iphiS[1] = iphir;
      etaphi.ietaE[2] = ietal; etaphi.ietaW[1] = ietar;
      etaphi.iphiN[2] = iphir; etaphi.iphiS[1] = iphil;
      etaphi.ietaE[3] = ietar; etaphi.ietaW[1] = ietal;
      etaphi.iphiN[3] = iphir; etaphi.iphiS[1] = iphil;
    }

    if (debug) {
      std::cout << "getEtaPhi:: Has " <<  etaphi.ntrys << " possibilites for "
                << ieta << "X" << iphi << " matrix" << std::endl;
      for (int itry=0; itry<etaphi.ntrys; itry++) {
        std::cout << "Trial " << itry <<" with etaE|etaW " <<etaphi.ietaE[itry]
                  <<"|" << etaphi.ietaW[itry] << " and phiN|PhiS " 
                  << etaphi.iphiN[itry] <<"|" <<etaphi.iphiS[itry] <<std::endl;
      }
    }
    return etaphi;
  }
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.

                                                                            {
    DetId id = DetId(hit->id());
    if (id.det() == DetId::Hcal) {
      ieta = ((HcalDetId)(hit->id())).ieta();
      iphi = ((HcalDetId)(hit->id())).iphi();
    } else if (id.det() == DetId::Ecal && id.subdetId() == EcalBarrel) {
      ieta = ((EBDetId)(id)).ieta();
      iphi = ((EBDetId)(id)).iphi();
//    } else if (id.det() == DetId::Ecal && id.subdetId() == EcalEndcap) {
//      ieta = ((EEDetId)(id)).ieta();
//      iphi = ((EEDetId)(id)).iphi();
    } else {
      ieta = 999;
      iphi = 999;
    }
  }
GlobalPoint spr::getGpos ( const CaloGeometry geo,
HBHERecHitCollection::const_iterator  hit 
)

Definition at line 155 of file FindDistCone.cc.

References CaloGeometry::getPosition().

                                                                                      {
    DetId detId(hit->id());
    return geo->getPosition(detId);
  }
GlobalPoint spr::getGpos ( const CaloGeometry geo,
edm::PCaloHitContainer::const_iterator  hit 
)

Definition at line 160 of file FindDistCone.cc.

References CaloGeometry::getPosition().

                                                                                      {
    DetId detId(hit->id());
    return geo->getPosition(detId);
  }
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 abs, gather_cfg::cout, reco::TrackBase::dxy(), reco::TrackBase::dz(), reco::TrackBase::hitPattern(), i, spr::trackSelectionParameters::maxChi2, spr::trackSelectionParameters::maxDpOverP, spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfHits(), reco::HitPattern::printHitPattern(), reco::TrackBase::pt(), reco::TrackBase::qoverp(), reco::TrackBase::qoverpError(), reco::TrackBase::quality(), benchmark_cfg::select, reco::HitPattern::stripTECLayersWithMeasurement(), reco::HitPattern::stripTOBLayersWithMeasurement(), reco::TrackBase::trackerExpectedHitsInner(), reco::TrackBase::trackerExpectedHitsOuter(), reco::HitPattern::trackerLayersWithMeasurement(), and reco::HitPattern::trackerLayersWithoutMeasurement().

Referenced by IsolatedTracksHcalScale::analyze(), CSCSkim::doBFieldStudySelection(), and JetTracksAssociationDRCalo::produce().

                                                                                                                    {

    bool select = pTrack->quality(parameters.minQuality);
    double dxy = pTrack->dxy(leadPV);
    double dz  = pTrack->dz(leadPV);
    double dpbyp = 999;
    if (std::abs(pTrack->qoverp()) > 0.0000001) 
      dpbyp = std::abs(pTrack->qoverpError()/pTrack->qoverp());

    if (debug) std::cout << "Track:: Pt " << pTrack->pt() << " dxy " << dxy << " dz " << dz << " Chi2 " << pTrack->normalizedChi2()  << " dpbyp " << dpbyp << " Quality " << select << std::endl;

    if (pTrack->pt() < parameters.minPt)                      select = false;
    if (dxy > parameters.maxDxyPV || dz > parameters.maxDzPV) select = false;
    if (pTrack->normalizedChi2() > parameters.maxChi2)        select = false;
    if (dpbyp > parameters.maxDpOverP)                        select = false;

    if (parameters.minLayerCrossed>0 || parameters.minOuterHit>0) {
      const reco::HitPattern& hitp = pTrack->hitPattern();
      if (parameters.minLayerCrossed>0 && hitp.trackerLayersWithMeasurement() < parameters.minLayerCrossed) select = false;
      if (parameters.minOuterHit>0 && (hitp.stripTOBLayersWithMeasurement()+hitp.stripTECLayersWithMeasurement() ) < parameters.minOuterHit) select = false;
      if (debug) {
        std::cout << "Default Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
        for (int i=0; i<hitp.numberOfHits(); i++) 
          hitp.printHitPattern(i, std::cout);
      }
    }
    if (parameters.maxInMiss >= 0) {
      const reco::HitPattern& hitp  = pTrack->trackerExpectedHitsInner();
      if (hitp.trackerLayersWithoutMeasurement() > parameters.maxInMiss) select = false;
      if (debug) {
        std::cout << "Inner Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
        for (int i=0; i<hitp.numberOfHits(); i++) 
          hitp.printHitPattern(i, std::cout);
      }
    }
    if (parameters.maxOutMiss >= 0) {
      const reco::HitPattern& hitp  = pTrack->trackerExpectedHitsOuter();
      if (hitp.trackerLayersWithoutMeasurement() > parameters.maxOutMiss) select = false;
      if (debug) {
        std::cout << "Outer Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
        for (int i=0; i<hitp.numberOfHits(); i++) 
          hitp.printHitPattern(i, std::cout);
      }
    }
    if (debug) std::cout << "Final Selection Result " << select << std::endl;

    return select;
  }
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 70 of file GenSimInfo.cc.

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

                                                                                                                                                                                                                                                                                            {
    
    if (debug) std::cout << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;

    std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
  }
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 42 of file GenSimInfo.cc.

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

Referenced by IsolatedGenParticles::analyze().

                                                                                                                                                                                                                                     {
    
    if (debug) std::cout << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;

    std::vector<DetId> dets;
    dets.push_back(coreDet);
    std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
  }
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 52 of file GenSimInfo.cc.

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

                                                                                                                                                                                                                                                                                      {
    
    if (debug) std::cout << "hGenSimInfo:: For track " << (*trkItr)->momentum().rho() << "/" << (*trkItr)->momentum().eta() << "/" << (*trkItr)->momentum().phi() << " with dR,tMom " << dR << " " << trackMom << std::endl;

    std::vector<DetId> vdets = spr::matrixHCALIds(coreDet, geo, topology, dR, trackMom, includeHO, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
  }
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 60 of file GenSimInfo.cc.

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

                                                                                                                                                                                                                                           {
    
    if (debug) std::cout << "hGenSimInfo:: For track " << trkItr->momentum().R() << "/" << trkItr->momentum().eta() << "/" << trkItr->momentum().phi() << " with ieta:iphi " << ieta << ":" << iphi << std::endl;

    std::vector<DetId> dets;
    dets.push_back(coreDet);
    std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, includeHO, debug);
    spr::cGenSimInfo(vdets, trkItr, trackIds, false, info, debug);
  }
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 
)
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().

                                                                                                                                                                                                                                    {
  
    edm::SimTrackContainer::const_iterator itr = SimTk->end();;
    
    edm::SimTrackContainer::const_iterator simTrkItr;
    edm::SimVertexContainer::const_iterator simVtxItr;
 
    //Get the vector of PsimHits associated to TrackerRecHits and select the 
    //matching SimTrack on the basis of maximum occurance of trackIds
    std::vector<unsigned int> trkId, trkOcc;
    int i=0;
    for (trackingRecHit_iterator iTrkHit = pTrack->recHitsBegin(); iTrkHit != pTrack->recHitsEnd(); ++iTrkHit, ++i) {
    
      std::vector<PSimHit> matchedSimIds = associate.associateHit((**iTrkHit));
      for (unsigned int isim=0; isim<matchedSimIds.size(); isim++) {
        unsigned tkId = matchedSimIds[isim].trackId();
        bool found = false;
        for (unsigned int j=0; j<trkId.size(); j++) {
          if ( tkId == trkId[j] ) {
            trkOcc[j]++;
            found = true;
            break;
          }
        }
        if (!found) { trkId.push_back(tkId); trkOcc.push_back(1); }
      }
    }

    if (debug) {
      std::cout << "Reconstructed Track with " << i << " recHits.";
      for (unsigned int isim=0; isim<trkId.size(); isim++){
        std::cout << "\n trkId " << trkId[isim] << "  Occurance " << trkOcc[isim] << ", ";
      } 
      std::cout << std::endl;
    }
  
    int matchedId=0; 
    unsigned int matchSimTrk=0;
    if (trkOcc.size() > 0) {
      unsigned int maxTrkOcc=0, idxMax=0;
      for(unsigned int j=0; j<trkOcc.size(); j++) {
        if(trkOcc[j] > maxTrkOcc ) { maxTrkOcc = trkOcc[j]; idxMax = j; }
      }
      matchSimTrk = trkId[idxMax];
      for (simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
        if ( simTrkItr->trackId() == matchSimTrk ) {
          matchedId = simTrkItr->type();
          if (debug) std::cout << "matched trackId (maximum occurance) " << matchSimTrk << " type " << matchedId << std::endl;
          itr = simTrkItr;
          break;
        }
      }
    }
  
    if (matchedId==0 && debug) {
      std::cout << "Could not find matched SimTrk and track history now " << std::endl;
    }

    return itr;
  }
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().

                                                                                                                                                                                                                   {

    // get the matching SimTrack
    edm::SimTrackContainer::const_iterator trkInfo = spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack,associate, debug);
    unsigned int matchSimTrk = trkInfo->trackId();
    if (debug) std::cout << "matchedSimTrackId finds the SimTrk ID of the current track to be " << matchSimTrk << std::endl;
  
    std::vector<int> matchTkid;
    if( trkInfo->type() != 0) {
      edm::SimTrackContainer::const_iterator simTrkItr;
      for(simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
        if (validSimTrack(matchSimTrk, simTrkItr, SimTk, SimVtx, false))
          matchTkid.push_back((int)simTrkItr->trackId());
      }
    }
    return matchTkid;
  }
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().

                                                                                                                                                       {
    spr::simTkInfo info;
    for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin(); 
         simTrkItr!= SimTk->end(); simTrkItr++) {
      if (simTkId == simTrkItr->trackId()) {
        if (spr::validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug)) {
          info.found  = true;
          info.pdgId  = simTrkItr->type();
          info.charge = simTrkItr->charge();
        } else {
          edm::SimTrackContainer::const_iterator parentItr =  spr::parentSimTrack(simTrkItr, SimTk, SimVtx, debug);
          if (debug) {
            if (parentItr != SimTk->end() ) std::cout << "original parent of " << simTrkItr->trackId() << " " << parentItr->trackId() << ", " << parentItr->type() << std::endl;
            else                            std::cout << "original parent of " << simTrkItr->trackId() << " not found" << std::endl;
          }
          if (parentItr != SimTk->end()) {
            info.found  = true;
            info.pdgId  = parentItr->type();
            info.charge = parentItr->charge();
          }
        }
        break;
      }
    }
    return info;
  }
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 90 of file MatrixECALDetIds.cc.

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

                                               {

    GlobalPoint core;
    if (det.subdetId() == EcalEndcap) {
      EEDetId EEid = EEDetId(det);
      core = geo->getPosition(EEid);
    } else {
      EBDetId EBid = EBDetId(det);
      core = geo->getPosition(EBid);
    }
    int ietaphi = (int)(dR/2.0)+1;
    std::vector<DetId> vdets, vdetx;
    spr::matrixECALIds(det, ietaphi, ietaphi, geo, caloTopology, vdets, debug);
    for (unsigned int i=0; i<vdets.size(); ++i) {
      GlobalPoint rpoint;
      if (vdets[i].subdetId() == EcalEndcap) {
        EEDetId EEid = EEDetId(vdets[i]);
        rpoint = geo->getPosition(EEid);
      } else {
        EBDetId EBid = EBDetId(vdets[i]);
        rpoint = geo->getPosition(EBid);
      }
      if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint)<dR) {
        vdetx.push_back(vdets[i]);
      }
    }

    if (debug) {
      std::cout << "matrixECALIds::Final List of cells for dR " << dR
                << " is with " << vdetx.size() << " from original list of " 
                << vdets.size() << std::endl;
      for (unsigned int i=0; i < vdetx.size(); ++i) {
        if (vdetx[i].subdetId() == EcalBarrel) {
          EBDetId id = vdetx[i];
          std::cout << "matrixECALIds::Cell " << i << " 0x" << std::hex 
                    << vdetx[i]() << std::dec << " " << id << std::endl;
        } else if (vdetx[i].subdetId() == EcalEndcap) {
          EEDetId id = vdetx[i];
          std::cout << "matrixECALIds::Cell " << i << " 0x" << std::hex 
                    << vdetx[i]() << std::dec<< " " << id << std::endl;
        } else {
          std::cout << "matrixECALIds::Cell " << i << " 0x" << std::hex 
                    << vdetx[i]() << std::dec << " Unknown Type" << std::endl;
        }
      }
    }
    return vdetx;
  }
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 216 of file MatrixECALDetIds.cc.

References matrixECALIds().

                                               {

    std::vector<DetId> vdets;
    spr::matrixECALIds(det, ietaE, ietaW, iphiN, iphiS, geo, caloTopology,
                       vdets, debug);
    return vdets;
  }
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 13 of file MatrixECALDetIds.cc.

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

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

                                                          {

    const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
    const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));

    if (debug) {
      std::cout << "matrixECALIds::Add " << ieta << " rows and " << iphi 
                << " columns of cells for 1 cell" << std::endl;
      if (det.subdetId() == EcalBarrel) {
        EBDetId id = det;
        std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec 
                  << " " << id << std::endl;
      } else if (det.subdetId() == EcalEndcap) {
        EEDetId id = det;
        std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
                  << " " << id << std::endl;
      } else {
        std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
                  << " Unknown Type" << std::endl;
      }
    }

    std::vector<DetId> dets(1,det);
    std::vector<CaloDirection> dirs(1,NORTH);
    vdets = spr::newECALIdNS(dets, 0, ieta,iphi, dirs, *barrelTopo,*endcapTopo,
                             *barrelGeom,*endcapGeom,debug);
    dirs[0] = SOUTH;
    std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, ieta, iphi, dirs,
                                                *barrelTopo,*endcapTopo, 
                                                *barrelGeom,*endcapGeom,debug);
    for (unsigned int i1=0; i1<vdetS.size(); i1++) {
      if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
        vdets.push_back(vdetS[i1]);
    }
    unsigned int ndet = (2*ieta+1)*(2*iphi+1);
    if (vdets.size() != ndet) {
      std::vector<DetId> vdetExtra;
      spr::extraIds(det, vdets, ieta, ieta, iphi, iphi, 
                    *barrelGeom, *endcapGeom, vdetExtra, debug);
      if (vdetExtra.size() > 0) 
        vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
    }

    if (debug) {
      std::cout << "matrixECALIds::Total number of cells found is " 
                << vdets.size() << std::endl;
      for (unsigned int i1=0; i1<vdets.size(); i1++) {
        if (vdets[i1].subdetId() == EcalBarrel) {
          EBDetId id = vdets[i1];
          std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " " << id << std::endl;
        } else if (vdets[i1].subdetId() == EcalEndcap) {
          EEDetId id = vdets[i1];
          std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " " << id << std::endl;
        } else {
          std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
        }
      }
    }
  }
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 143 of file MatrixECALDetIds.cc.

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

                                                          {

    const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
    const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));

    if (debug) {
      std::cout << "matrixECALIds::Add " << ietaE << "|" << ietaW
                << " rows and " << iphiN << "|" << iphiS
                << " columns of cells for 1 cell" << std::endl;
      if (det.subdetId() == EcalBarrel) {
        EBDetId id = det;
        std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec 
                  << " " << id << std::endl;
      } else if (det.subdetId() == EcalEndcap) {
        EEDetId id = det;
        std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
                  << " " << id << std::endl;
      } else {
        std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
                  << " Unknown Type" << std::endl;
      }
    }

    std::vector<DetId> dets(1,det);
    std::vector<CaloDirection> dirs(1,NORTH);
    std::vector<int> jetaE(1,ietaE), jetaW(1,ietaW);
    std::vector<int> jphiN(1,iphiN), jphiS(1,iphiS);
    vdets = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN, jphiS, dirs, 
                             *barrelTopo, *endcapTopo, *barrelGeom,
                             *endcapGeom, debug);
    dirs[0] = SOUTH;
    std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN,
                                                jphiS, dirs, *barrelTopo,
                                                *endcapTopo, *barrelGeom,
                                                *endcapGeom, debug);
    for (unsigned int i1=0; i1<vdetS.size(); i1++) {
      if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
        vdets.push_back(vdetS[i1]);
    }

    unsigned int ndet = (ietaE+ietaW+1)*(iphiN+iphiS+1);
    if (vdets.size() != ndet) {
      std::vector<DetId> vdetExtra;
      spr::extraIds(det, vdets, ietaE, ietaW, iphiN, iphiS, 
                    *barrelGeom, *endcapGeom, vdetExtra, debug);
      if (vdetExtra.size() > 0) 
        vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
    }

    if (debug) {
      std::cout << "matrixECALIds::Total number of cells found is " 
                << vdets.size() << std::endl;
      for (unsigned int i1=0; i1<vdets.size(); i1++) {
        if (vdets[i1].subdetId() == EcalBarrel) {
          EBDetId id = vdets[i1];
          std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " " << id << std::endl;
        } else if (vdets[i1].subdetId() == EcalEndcap) {
          EEDetId id = vdets[i1];
          std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " " << id << std::endl;
        } else {
          std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
        }
      }
    }
  }
std::vector< DetId > spr::matrixECALIds ( const DetId det,
int  ieta,
int  iphi,
const CaloGeometry geo,
const CaloTopology caloTopology,
bool  debug = false 
)

Definition at line 80 of file MatrixECALDetIds.cc.

References matrixECALIds().

                                               {

    std::vector<DetId> vdets;
    spr::matrixECALIds(det, ieta, iphi, geo, caloTopology, vdets, debug);
    return vdets;
  }
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 81 of file MatrixHCALDetIds.cc.

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

                                                               {

    if (debug) {
      std::cout << "matrixHCALIds::Add " <<ietaE << "|" <<ietaW << " rows and "
                << iphiN << "|" << iphiS << " columns of cells for " 
                << dets.size() << " cells" << std::endl;
      for (unsigned int i1=0; i1<dets.size(); i1++) {
        HcalDetId id = HcalDetId(dets[i1]());   
        std::cout << "matrixHCALIds::Cell " << i1 << " 0x" << std::hex 
                  << id.rawId() << std::dec << " " << id << std::endl;
      }
    }

    std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ietaE,
                                                ietaW, iphiN, iphiS, debug);
    std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false,ietaE,
                                                ietaW, iphiN, iphiS, debug);
    for (unsigned int i1=0; i1<vdetS.size(); i1++) {
      if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
        vdetN.push_back(vdetS[i1]);
    }

    vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);

    if (debug) {
      std::cout << "matrixHCALIds::Total number of cells found is " 
                << vdetS.size() << std::endl;
      for (unsigned int i1=0; i1<vdetS.size(); i1++) {
        HcalDetId id = HcalDetId(vdetS[i1]());  
        std::cout << "matrixHCALIds::Cell " << i1 << " " << id << std::endl;
      }
    }
    return vdetS;
  }
std::vector< DetId > spr::matrixHCALIds ( const DetId det,
const CaloGeometry geo,
const HcalTopology topology,
double  dR,
const GlobalVector trackMom,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 48 of file MatrixHCALDetIds.cc.

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

                                               {
 
    HcalDetId   hcdet = HcalDetId(det);
    GlobalPoint core  = geo->getPosition(hcdet);
    std::vector<DetId> dets, vdetx;
    dets.push_back(det);
    int ietaphi = (int)(dR/15.0)+1;
    std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ietaphi, 
                                                  ietaphi, includeHO, debug);
    for (unsigned int i=0; i<vdets.size(); ++i) {
      HcalDetId   hcdet  = HcalDetId(vdets[i]);
      GlobalPoint rpoint = geo->getPosition(hcdet);
      if (spr::getDistInPlaneTrackDir(core, trackMom, rpoint) < dR) {
        vdetx.push_back(vdets[i]);
      }
    }

    if (debug) {
      std::cout << "matrixHCALIds::Final List of cells for dR " << dR
                << " is with " << vdetx.size() << " from original list of "
                << vdets.size() << " cells" << std::endl;
      for (unsigned int i=0; i < vdetx.size(); ++i) {
        HcalDetId   hcdet  = HcalDetId(vdets[i]);
        std::cout << "matrixHCALIds::Cell " << i << " 0x" << std::hex 
                    << vdetx[i]() << std::dec << " " << hcdet << std::endl;
      }
    }
    return vdetx;
 }
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 11 of file MatrixHCALDetIds.cc.

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

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

                                                                         {

    if (debug) {
      std::cout << "matrixHCALIds::Add " << ieta << " rows and " << iphi 
                << " columns of cells for " << dets.size() << " cells" 
                << std::endl;
      for (unsigned int i1=0; i1<dets.size(); i1++) {
        HcalDetId id = HcalDetId(dets[i1]());   
        std::cout << "matrixHCALIds::Cell " << i1 << " 0x" << std::hex 
                  << id.rawId() << std::dec << " " << id << std::endl;
      }
    }

    std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true,  ieta,
                                               iphi, debug);
    std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false, ieta,
                                                iphi, debug);
    for (unsigned int i1=0; i1<vdetS.size(); i1++) {
      if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
        vdetN.push_back(vdetS[i1]);
    }

    vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);

    if (debug) {
      std::cout << "matrixHCALIds::Total number of cells found is " 
                << vdetS.size() << std::endl;
      for (unsigned int i1=0; i1<vdetS.size(); i1++) {
        HcalDetId id = HcalDetId(vdetS[i1]());  
        std::cout << "matrixHCALIds::Cell " << i1 << " " << id << std::endl;
      }
    }
    return vdetS;
  }
std::vector< DetId > spr::matrixHCALIdsDepth ( std::vector< DetId > &  dets,
const HcalTopology topology,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 419 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds().

                                                                    {

    if (debug) {
      std::cout << "matrixHCALIdsDepth::Add cells with higher depths with HO" 
                << "Flag set to " << includeHO << " to existing "
                << dets.size() << " cells" << std::endl;
      for (unsigned int i1=0; i1<dets.size(); i1++) {
        HcalDetId id = HcalDetId(dets[i1]());   
        std::cout << "matrixHCALIdsDepth::Cell " << i1 << " " <<id <<std::endl;
      }
    }
 
    std::vector<DetId> vdets(dets);
    for (unsigned int i1=0; i1<dets.size(); i1++) {
      HcalDetId vdet = dets[i1];
      for (int idepth = 0; idepth < 3; idepth++) {
        std::vector<DetId> vUpDetId = topology->up(vdet);
        if (vUpDetId.size() != 0) {
          if (includeHO || vUpDetId[0].subdetId() != (int)(HcalOuter)) {
            int n = std::count(vdets.begin(),vdets.end(),vUpDetId[0]);
            if (n == 0) {
              if (debug) std::cout << "matrixHCALIdsDepth:: Depth " << idepth << " " << vdet << " " << (HcalDetId)vUpDetId[0] << std::endl;
              vdets.push_back(vUpDetId[0]);
            }
          }
          vdet = vUpDetId[0];
        }
      }
    }

    if (debug) {
      std::cout << "matrixHCALIdsDepth::Final list contains " << vdets.size() 
                << " cells" << std::endl;
      for (unsigned int i1=0; i1<vdets.size(); i1++) {
        HcalDetId id = HcalDetId(vdets[i1]());  
        std::cout << "matrixHCALIdsDepth::Cell " << i1 << " " <<id <<std::endl;
      }
    }
    return vdets;
  }
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,
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 778 of file MatrixECALDetIds.cc.

References prof2calltree::count, gather_cfg::cout, EAST, EcalBarrel, EcalEndcap, prof2calltree::last, newECALIdEW(), simpleMove(), and WEST.

                                             {

    if (debug) {
      std::cout << "newECALIdEW::Add " << ietaE[0] << "|" << ietaW[0]
                << " rows of cells for " << (dets.size()-last) 
                << " cells (last " << last << ")" << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        if (dets[i1].subdetId() == EcalBarrel) {
          EBDetId id = dets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " "  << id << " along "
                    << dir[i1] << std::endl;
        } else if (dets[i1].subdetId() == EcalEndcap) {
          EEDetId id = dets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
                    << dir[i1] << std::endl;
        } else {
          std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex 
                    << dets[i1]() << std::dec << " Unknown Type along " 
                    << dir[i1] << std::endl;
        }
      }
    }

    std::vector<DetId> vdets;
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    std::vector<CaloDirection> dirs;
    dirs.insert(dirs.end(), dir.begin(), dir.end());
    std::vector<int> jetaE, jetaW;
    jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
    jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
    int keta = 0;
    for (unsigned int i1=last; i1<dets.size(); i1++) {
      int ieta = ietaW[i1];
      if (dir[i1] == EAST) ieta = ietaE[i1]; 
      if (ieta > 0) {
        int flag=0;
        std::vector<DetId> cells;
        spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
                        barrelGeom, endcapGeom, cells, flag, debug);
        ieta--;
        if (ieta > keta) keta = ieta;
        if (dir[i1] == EAST) jetaE[i1] = ieta;
        else                 jetaW[i1] = ieta;
        if (flag != 0) {
          if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
            vdets.push_back(cells[0]);
            CaloDirection dirn = dir[i1];
            int ketaE = ietaE[i1];
            int ketaW = ietaW[i1];
            if (dirn == EAST) ketaE = ieta;
            else              ketaW = ieta;
            if (flag < 0) {
              int ktmp = ketaW; ketaW    = ketaE; ketaE    = ktmp;
              if (dirn == EAST) dirn = WEST;
              else              dirn = EAST;
            }
            dirs.push_back(dirn);
            jetaE.push_back(ketaE);
            jetaW.push_back(ketaW);
          }
        }
      }
    }
    
    if (debug) {
      std::cout << "newECALIdEW::Addition results a set of " 
                << (vdets.size()-dets.size()) << " new  cells (last " 
                << dets.size() << ", ieta " << keta << ")" << std::endl;
      for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
        if (vdets[i1].subdetId() == EcalBarrel) {
          EBDetId id = vdets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " "  << id << std::endl;
        } else if (vdets[i1].subdetId() == EcalEndcap) {
          EEDetId id = vdets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
        } else {
          std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
        }
      }
    }

    if (keta > 0) {
      last = dets.size();
      return spr::newECALIdEW(vdets, last, jetaE, jetaW, dirs, barrelTopo,
                              endcapTopo, barrelGeom, endcapGeom, debug);
    } else {
      if (debug) {
        std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          if (vdets[i1].subdetId() == EcalBarrel) {
            EBDetId id = vdets[i1];
            std::cout << "newECALIdEW::Cell " << i1 << " "  << id << std::endl;
          } else if (vdets[i1].subdetId() == EcalEndcap) {
            EEDetId id = vdets[i1];
            std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
          } else {
            std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex 
                      << vdets[i1]() <<std::dec << " Unknown Type" <<std::endl;
          }
        }
      }
      return vdets;
    }
  }
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 651 of file MatrixECALDetIds.cc.

References prof2calltree::count, gather_cfg::cout, EAST, EcalBarrel, EcalEndcap, prof2calltree::last, simpleMove(), and WEST.

Referenced by newECALIdEW(), and newECALIdNS().

                                             {

    if (debug) {
      std::cout << "newECALIdEW::Add " << ieta << " rows of cells for " 
                << last << ":" << dets.size() << ":" << (dets.size()-last) 
                << " cells" << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        if (dets[i1].subdetId() == EcalBarrel) {
          EBDetId id = dets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " "  << id << " along "
                    << dir[i1] << std::endl;
        } else if (dets[i1].subdetId() == EcalEndcap) {
          EEDetId id = dets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
                    << dir[i1] << std::endl;
        } else {
          std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex 
                    << dets[i1]() << std::dec << " Unknown Type along " 
                    << dir[i1] << std::endl;
        }
      }
    }

    std::vector<DetId> vdets; vdets.clear();
    std::vector<CaloDirection> dirs; dirs.clear();
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    dirs.insert(dirs.end(), dir.begin(), dir.end());

    if (ieta > 0) {
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        int flag = 0;
        std::vector<DetId> cells;
        spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
                        barrelGeom, endcapGeom, cells, flag, debug);
        /*
        if (dets[i1].subdetId() == EcalBarrel) {
          EBDetId id = dets[i1];
          std::cout << "Moved Cell " << i1 << " "  << id << " along "
                    << dir[i1] << std::endl;
        } else if (dets[i1].subdetId() == EcalEndcap) {
          EEDetId id = dets[i1];
          std::cout << "Moved Cell " << i1 << " " << id << " along "
                    << dir[i1] << std::endl;
        } else {
          std::cout << "Moved Cell " << i1 << " 0x" << std::hex 
                    << dets[i1]() << std::dec << " Unknown Type along " 
                    << dir[i1] << std::endl;
        }
        for (unsigned int kk=0; kk<cells.size(); kk++) {
          if (cells[kk].subdetId() == EcalBarrel) {
            EBDetId id = cells[kk];
            std::cout << "Moved to " << id << " flag " << flag << "\n";
          } else if (cells[kk].subdetId() == EcalEndcap) {
            EEDetId id = cells[kk];
            std::cout << "Moved to " << id << " flag " << flag << "\n";
          } else {
            std::cout << "Moved Cell " << i1 << " 0x" << std::hex 
                      << cells[kk]() << std::dec << " Unknown Type flag " 
                      << flag << std::endl;
          }
        }
        */
        if (flag != 0) {
          if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
            CaloDirection dirn = dir[i1];
            if (flag < 0) {
              if (dirn == EAST) dirn = WEST;
              else              dirn = EAST;
            }
            vdets.push_back(cells[0]);
            dirs.push_back(dirn);
          }
        }
      }
      ieta--;
    }
    
    if (debug) {
      std::cout << "newECALIdEW::Addition results a set of " 
                << (vdets.size()-dets.size()) << " new  cells" << std::endl;
      for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
        if (vdets[i1].subdetId() == EcalBarrel) {
          EBDetId id = vdets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " "  << id << " along " 
                    << dirs[i1] << std::endl;
        } else if (vdets[i1].subdetId() == EcalEndcap) {
          EEDetId id = vdets[i1];
          std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along " 
                    << dirs[i1] << std::endl;
        } else {
          std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " Unknown Type along " 
                    << dirs[i1] << std::endl;
        }
      }
    }

    if (ieta > 0) {
      last = dets.size();
      return spr::newECALIdEW(vdets,last,ieta,dirs,barrelTopo,endcapTopo,barrelGeom,endcapGeom,debug);
    } else {
      if (debug) {
        std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          if (vdets[i1].subdetId() == EcalBarrel) {
            EBDetId id = vdets[i1];
            std::cout << "newECALIdEW::Cell " << i1 << " "  << id << std::endl;
          } else if (vdets[i1].subdetId() == EcalEndcap) {
            EEDetId id = vdets[i1];
            std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
          } else {
            std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex 
                      << vdets[i1]() <<std::dec << " Unknown Type" <<std::endl;
          }
        }
      }
      return vdets;
    }
  }
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 431 of file MatrixECALDetIds.cc.

References prof2calltree::count, gather_cfg::cout, EAST, EcalBarrel, EcalEndcap, prof2calltree::last, newECALIdEW(), newECALIdNS(), NORTH, simpleMove(), SOUTH, and WEST.

                                             {

    if (debug) {
      std::cout << "newECALIdNS::Add columns of cells for " 
                << (dets.size()-last) << " cells (last) " << last << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        if (dets[i1].subdetId() == EcalBarrel) {
          EBDetId id = dets[i1];
          std::cout << "newECALIdNS::Cell " << i1 << " "  << id << " along "
                    << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
                    << std::endl;
        } else if (dets[i1].subdetId() == EcalEndcap) {
          EEDetId id = dets[i1];
          std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
                    << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
                    << std::endl;
        } else {
          std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                    << dets[i1]() << std::dec << " Unknown Type along " 
                    << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1] 
                    << std::endl;
        }
      }
    }

    std::vector<DetId> vdets;
    std::vector<CaloDirection> dirs;
    std::vector<int> jetaE, jetaW, jphiN, jphiS;
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    dirs.insert(dirs.end(), dir.begin(), dir.end());
    jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
    jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
    jphiN.insert(jphiN.end(), iphiN.begin(), iphiN.end());
    jphiS.insert(jphiS.end(), iphiS.begin(), iphiS.end());
    std::vector<DetId> vdetE, vdetW;
    if (last == 0) {
      unsigned int ndet = vdets.size();
      std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
      vdetE = spr::newECALIdEW(dets, last, ietaE, ietaW, dirE, barrelTopo, 
                               endcapTopo, barrelGeom, endcapGeom, debug);
      vdetW = spr::newECALIdEW(dets, last, ietaE, ietaW, dirW, barrelTopo,
                               endcapTopo, barrelGeom, endcapGeom, debug);
      for (unsigned int i1=0; i1<vdetW.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
          vdets.push_back(vdetW[i1]);
          dirs.push_back(dir[0]);
          jetaE.push_back(0);
          jetaW.push_back(0);
          jphiN.push_back(iphiN[0]);
          jphiS.push_back(iphiS[0]);
        }
      }
      for (unsigned int i1=0; i1<vdetE.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
          vdets.push_back(vdetE[i1]);
          dirs.push_back(dir[0]);
          jetaE.push_back(0);
          jetaW.push_back(0);
          jphiN.push_back(iphiN[0]);
          jphiS.push_back(iphiS[0]);
        }
      }
      if (debug) {
        std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
                  << (vdets.size()-dets.size()) << " new  cells" << std::endl;
        for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
          if (vdets[i1].subdetId() == EcalBarrel) {
            EBDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " "  << id << " along "
                      << dirs[i1] << std::endl;
          } else if (vdets[i1].subdetId() == EcalEndcap) {
            EEDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
                      << dirs[i1] << std::endl;
          } else {
            std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                      << vdets[i1]() << std::dec << " Unknown Type along " 
                      << dirs[i1] << std::endl;
          }
        }
      }
    }

    unsigned int last0 = vdets.size();
    std::vector<DetId> vdetnew;
    std::vector<CaloDirection> dirnew;
    std::vector<int> kphiN, kphiS, ketaE, ketaW;
    int kphi = 0;
    for (unsigned int i1=last; i1<dets.size(); i1++) {
      int iphi = iphiS[i1];
      if (dir[i1] == NORTH) iphi = iphiN[i1];
      if (iphi > 0) {
        std::vector<DetId>         vdetn(1);
        std::vector<CaloDirection> dirn(1);
        std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
        int flag=0;
        std::vector<DetId> cells;
        spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
                        barrelGeom, endcapGeom, cells, flag, debug);
        iphi--;
        if (iphi > kphi) kphi = iphi;
        if (dir[i1] == NORTH) jphiN[i1] = iphi;
        else                  jphiS[i1] = iphi;
        if (flag != 0) {
          if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
            int kfiN = iphiN[i1];
            int kfiS = iphiS[i1];
            vdetn[0] = cells[0];
            vdetnew.push_back(vdetn[0]);
            dirn[0] = dir[i1];
            if (dir[i1] == NORTH) kfiN = iphi;
            else                  kfiS = iphi;
            if (flag < 0) {
              int ktmp = kfiS; kfiS = kfiN; kfiN = ktmp;
              if (dirn[0] == NORTH) dirn[0] = SOUTH;
              else                  dirn[0] = NORTH;
            }
            dirnew.push_back(dirn[0]);
            kphiN.push_back(kfiN); ketaE.push_back(ietaE[i1]);
            kphiS.push_back(kfiS); ketaW.push_back(ietaW[i1]);
            std::vector<int>       ietE(1,ietaE[i1]), ietW(1,ietaW[i1]);
            vdetE = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnE, barrelTopo,
                                     endcapTopo, barrelGeom, endcapGeom,debug);
            vdetW = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnW, barrelTopo,
                                     endcapTopo, barrelGeom, endcapGeom,debug);
            for (unsigned int i2=0; i2<vdetW.size(); i2++) {
              if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
                  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
                vdets.push_back(vdetW[i2]);
                dirs.push_back(dirn[0]);
                jetaE.push_back(0); jphiN.push_back(kfiN);
                jetaW.push_back(0); jphiS.push_back(kfiS);
              }
            }
            for (unsigned int i2=0; i2<vdetE.size(); i2++) {
              if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
                  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
                vdets.push_back(vdetE[i2]);
                dirs.push_back(dirn[0]);
                jetaE.push_back(0); jphiN.push_back(kfiN);
                jetaW.push_back(0); jphiS.push_back(kfiS);
              }
            }
          } 
        }
      }
    }
    last = vdets.size();
    for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
      if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
        vdets.push_back(vdetnew[i2]);
        dirs.push_back(dirnew[i2]);
        jetaE.push_back(ketaE[i2]);
        jetaW.push_back(ketaW[i2]);
        jphiN.push_back(kphiN[i2]);
        jphiS.push_back(kphiS[i2]);
      }
    }
    if (debug) {
      std::cout << "newECALIdNS::Addition results a set of " 
                << (vdets.size()-last0)  << " new  cells (last " << last0
                << ", iphi " << kphi << ")" << std::endl;
      for (unsigned int i1=last0; i1<vdets.size(); i1++) {
        if (vdets[i1].subdetId() == EcalBarrel) {
          EBDetId id = vdets[i1];
          std::cout << "newECALIdNS::Cell " << i1 << " "  << id << " along "
                    << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
                    << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
        } else if (vdets[i1].subdetId() == EcalEndcap) {
          EEDetId id = vdets[i1];
          std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
                    << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
                    << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
        } else {
          std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                    << vdets[i1]() << std::dec << " Unknown Type along "
                    << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
                    << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
        }
      }
    }
    last0 = last;
      
    if (kphi > 0) {
      last = last0;
      return spr::newECALIdNS(vdets, last, jetaE, jetaW, jphiN, jphiS, dirs,
                              barrelTopo, endcapTopo, barrelGeom, endcapGeom,
                              debug);
    } else {
      if (debug) {
        std::cout << "newECALIdNS::Final list consists of " << vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          if (vdets[i1].subdetId() == EcalBarrel) {
            EBDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " "  << id << std::endl;
          } else if (vdets[i1].subdetId() == EcalEndcap) {
            EEDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
          } else {
            std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                      << vdets[i1]() << std::dec << " Unknown Type" 
                      << std::endl;
          }
        }
      }
      return vdets;
    }
  }
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 228 of file MatrixECALDetIds.cc.

References prof2calltree::count, gather_cfg::cout, EAST, EcalBarrel, EcalEndcap, prof2calltree::last, newECALIdEW(), NORTH, simpleMove(), SOUTH, and WEST.

Referenced by matrixECALIds(), and newECALIdNS().

                                             {

    if (debug) {
      std::cout << "newECALIdNS::Add " << iphi << " columns of cells for " 
                << (dets.size()-last) << " cells (last " << last << ")"
                << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        if (dets[i1].subdetId() == EcalBarrel) {
          EBDetId id = dets[i1];
          std::cout << "newECALIdNS::Cell " << i1 << " "  << id << " along "
                    << dir[i1] << std::endl;
        } else if (dets[i1].subdetId() == EcalEndcap) {
          EEDetId id = dets[i1];
          std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
                    << dir[i1] << std::endl;
        } else {
          std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                    << dets[i1]() << std::dec << " Unknown Type along " 
                    << dir[i1] << std::endl;
        }
      }
    }
    
    std::vector<DetId> vdets;
    std::vector<CaloDirection> dirs;
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    dirs.insert(dirs.end(), dir.begin(), dir.end());

    std::vector<DetId> vdetE, vdetW;
    if (last == 0) {
      unsigned int ndet = vdets.size();
      std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
      vdetE = spr::newECALIdEW(dets, last, ieta, dirE, barrelTopo, endcapTopo, 
                               barrelGeom, endcapGeom, debug);
      vdetW = spr::newECALIdEW(dets, last, ieta, dirW, barrelTopo, endcapTopo,
                               barrelGeom, endcapGeom, debug);
      for (unsigned int i1=0; i1<vdetW.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
          vdets.push_back(vdetW[i1]);
          dirs.push_back(dir[0]);
        }
      }
      for (unsigned int i1=0; i1<vdetE.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
          vdets.push_back(vdetE[i1]);
          dirs.push_back(dir[0]);
        }
      }
      if (debug) {
        std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
                  << (vdets.size()-dets.size()) << " new  cells" << std::endl;
        for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
          if (vdets[i1].subdetId() == EcalBarrel) {
            EBDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " "  << id << " along "
                      << dirs[i1] << std::endl;
          } else if (vdets[i1].subdetId() == EcalEndcap) {
            EEDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
                      << dirs[i1] << std::endl;
          } else {
            std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                      << vdets[i1]() << std::dec << " Unknown Type along " 
                      << dirs[i1] << std::endl;
          }
        }
      }
    }

    unsigned int last0 = vdets.size();
    std::vector<DetId> vdetnew;
    std::vector<CaloDirection> dirnew;
    if (iphi > 0) {
      std::vector<DetId> vdetn(1);
      std::vector<CaloDirection> dirn(1);
      std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
      int flag=0;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        std::vector<DetId> cells;
        spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
                        barrelGeom, endcapGeom, cells, flag, debug);
        /*
        if (dets[i1].subdetId() == EcalBarrel) {
          EBDetId id = dets[i1];
          std::cout << "Moved Cell " << i1 << " "  << id << " along "
                    << dir[i1] << std::endl;
        } else if (dets[i1].subdetId() == EcalEndcap) {
          EEDetId id = dets[i1];
          std::cout << "Moved Cell " << i1 << " " << id << " along "
                    << dir[i1] << std::endl;
        } else {
          std::cout << "Moved Cell " << i1 << " 0x" << std::hex 
                    << dets[i1]() << std::dec << " Unknown Type along " 
                    << dir[i1] << std::endl;
        }
        for (unsigned int kk=0; kk<cells.size(); kk++) {
          if (cells[kk].subdetId() == EcalBarrel) {
            EBDetId id = cells[kk];
            std::cout << "Moved to " << id << " flag " << flag << "\n";
          } else if (cells[kk].subdetId() == EcalEndcap) {
            EEDetId id = cells[kk];
            std::cout << "Moved to " << id << " flag " << flag << "\n";
          } else {
            std::cout << "Moved Cell " << i1 << " 0x" << std::hex 
                      << cells[kk]() << std::dec << " Unknown Type flag " 
                      << flag << std::endl;
          }
        }
        */
        if (flag != 0) {
          if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
            vdetn[0] = cells[0];
            vdetnew.push_back(vdetn[0]);
            dirn[0] = dir[i1];
            if (flag < 0) {
              if (dirn[0] == NORTH) dirn[0] = SOUTH;
              else                  dirn[0] = NORTH;
            }
            dirnew.push_back(dirn[0]);
            vdetE = spr::newECALIdEW(vdetn, 0, ieta, dirnE, barrelTopo, 
                                     endcapTopo, barrelGeom, endcapGeom,debug);
            vdetW = spr::newECALIdEW(vdetn, 0, ieta, dirnW, barrelTopo, 
                                     endcapTopo, barrelGeom, endcapGeom,debug);
            for (unsigned int i2=0; i2<vdetW.size(); i2++) {
              if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
                  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
                vdets.push_back(vdetW[i2]);
                dirs.push_back(dirn[0]);
              }
            }
            for (unsigned int i2=0; i2<vdetE.size(); i2++) {
              if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
                  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
                vdets.push_back(vdetE[i2]);
                dirs.push_back(dirn[0]);
              }
            }
          }
        }
      }
      iphi--;
      last = vdets.size();
      for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
        if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
          vdets.push_back(vdetnew[i2]);
          dirs.push_back(dirnew[i2]);
        }
      }
      if (debug) {
        std::cout << "newECALIdNS::Addition results a set of " 
                  << (vdets.size()-last0)  << " new  cells (last " << last0
                  << ", iphi " << iphi << ")" << std::endl;
        for (unsigned int i1=last0; i1<vdets.size(); i1++) {
          if (vdets[i1].subdetId() == EcalBarrel) {
            EBDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " "  << id << " along "
                      << dirs[i1] << std::endl;
          } else if (vdets[i1].subdetId() == EcalEndcap) {
            EEDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
                      << dirs[i1] << std::endl;
          } else {
            std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                      << vdets[i1]() << std::dec << " Unknown Type along " 
                      << dirs[i1] << std::endl;
          }
        }
      }
      last0 = last;
    }

    if (iphi > 0) {
      last = last0;
      return spr::newECALIdNS(vdets,last,ieta,iphi,dirs,barrelTopo,endcapTopo,barrelGeom,endcapGeom,debug);
    } else {
      if (debug) {
        std::cout << "newECALIdNS::Final list consists of " << vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          if (vdets[i1].subdetId() == EcalBarrel) {
            EBDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " "  << id << std::endl;
          } else if (vdets[i1].subdetId() == EcalEndcap) {
            EEDetId id = vdets[i1];
            std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
          } else {
            std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex 
                      << vdets[i1]() << std::dec << " Unknown Type" 
                      << std::endl;
          }
        }
      }
      return vdets;
    }
  }
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 307 of file MatrixHCALDetIds.cc.

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

Referenced by newHCALIdEW(), and newHCALIdNS().

                                                       {

    if (debug) {
      std::cout << "newHCALIdEW::Add " << ieta << " rows of cells along " 
                << shiftEast << " for " << (dets.size()-last) << " cells" 
                << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        HcalDetId id = HcalDetId(dets[i1]());   
        std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
      }
    }

    std::vector<DetId> vdets;
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    if (ieta > 0) {
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        std::vector<DetId> vdet;
        if (shiftEast) vdet = topology->east(dets[i1]);
        else           vdet = topology->west(dets[i1]);
        for (unsigned int i2=0; i2<vdet.size(); i2++) {
          if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
            vdets.push_back(vdet[i2]);
        }
      }
      ieta--;
    }
    
    if (debug) {
      std::cout << "newHCALIdEW::Addition results a set of " 
                << (vdets.size()-dets.size()) << " new  cells" << std::endl;
      for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
        HcalDetId id = HcalDetId(vdets[i1]());  
        std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
      }
    }

    if (ieta > 0) {
      last = dets.size();
      return spr::newHCALIdEW(vdets, last, topology, shiftEast, ieta, debug);
    } else {
      if (debug) {
        std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
        }
      }
      return vdets;
    }
  }
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 361 of file MatrixHCALDetIds.cc.

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

                                                                   {

    if (debug) {
      std::cout << "newHCALIdEW::Add " << ietaE << "|" << ietaW
                << " rows of cells along " << shiftEast << " for " 
                << (dets.size()-last) << " cells" << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        HcalDetId id = HcalDetId(dets[i1]());   
        std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
      }
    }

    int ieta = ietaW;
    if (shiftEast) ieta = ietaE;
    std::vector<DetId> vdets;
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    if (ieta > 0) {
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        std::vector<DetId> vdet;
        if (shiftEast) vdet = topology->east(dets[i1]);
        else           vdet = topology->west(dets[i1]);
        for (unsigned int i2=0; i2<vdet.size(); i2++) {
          if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
            vdets.push_back(vdet[i2]);
        }
      }
      ieta--;
    }
    if (shiftEast) ietaE = ieta;
    else           ietaW = ieta;
    
    if (debug) {
      std::cout << "newHCALIdEW::Addition results a set of " 
                << (vdets.size()-dets.size()) << " new  cells" << std::endl;
      for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
        HcalDetId id = HcalDetId(vdets[i1]());  
        std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
      }
    }

    if (ieta > 0) {
      last = dets.size();
      return spr::newHCALIdEW(vdets,last,topology,shiftEast,ietaE,ietaW,debug);
    } else {
      if (debug) {
        std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
        }
      }
      return vdets;
    }
  }
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 119 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds(), and newHCALIdNS().

                                                                 {

    if (debug) {
      std::cout << "newHCALIdNS::Add " << iphi << " columns of cells along " 
                << shiftNorth << " for " << (dets.size()-last) << " cells" 
                << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        HcalDetId id = HcalDetId(dets[i1]());   
        std::cout << "newHCALIdNS::Cell " << i1 << " " << id << std::endl;
      }
    }

    std::vector<DetId> vdets;
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    std::vector<DetId> vdetE, vdetW;
    if (last == 0) {
      vdetE = spr::newHCALIdEW(dets, last, topology, true,  ieta, debug);
      vdetW = spr::newHCALIdEW(dets, last, topology, false, ieta, debug);
      for (unsigned int i1=0; i1<vdetW.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
          vdets.push_back(vdetW[i1]);
      }
      for (unsigned int i1=0; i1<vdetE.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
          vdets.push_back(vdetE[i1]);
      }
      if (debug) {
        std::cout <<"newHCALIdNS::With Added cells along E/W results a set of "
                  << (vdets.size()-dets.size()) << " new  cells" << std::endl;
        for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
        }
      }
    }
    unsigned int last0 = vdets.size();
    if (iphi > 0) {
      std::vector<DetId> vdetnew;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        std::vector<DetId> vdet;
        if (shiftNorth) vdet = topology->north(dets[i1]);
        else            vdet = topology->south(dets[i1]);
        for (unsigned int i2=0; i2<vdet.size(); i2++) {
          if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
            vdetnew.push_back(vdet[i2]);
        }
      }
      iphi--;
      vdetE = spr::newHCALIdEW(vdetnew, 0, topology, true,  ieta, debug);
      vdetW = spr::newHCALIdEW(vdetnew, 0, topology, false, ieta, debug);
      for (unsigned int i2=0; i2<vdetW.size(); i2++) {
        if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
            std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
          vdets.push_back(vdetW[i2]);
      }
      for (unsigned int i2=0; i2<vdetE.size(); i2++) {
        if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
            std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
          vdets.push_back(vdetE[i2]);
      }
      last = vdets.size();
      vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
      if (debug) {
        std::cout << "newHCALIdNS::Addition results a set of " 
                  << (vdets.size()-last0)  << " new  cells" << std::endl;
        for (unsigned int i1=last0; i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdNS::Cell " << i1 << " " << id << std::endl;
        }
      }
      last0 = last;
    }

    if (iphi > 0) {
      last = last0;
      return spr::newHCALIdNS(vdets,last,topology,shiftNorth,ieta,iphi,debug);
    } else {
      if (debug) {
        std::cout << "newHCALIdNS::Final list consists of " << vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdNS::Cell " << i1 << " " << id << std::endl;
        }
      }
      return vdets;
    }
  }
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 210 of file MatrixHCALDetIds.cc.

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

                                             {

    if (debug) {
      std::cout << "newHCALIdNS::Add " << iphiN << "|" << iphiS
                << " columns of cells along " << shiftNorth << " for " 
                << (dets.size()-last) << " cells" << std::endl;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        HcalDetId id = HcalDetId(dets[i1]());   
        std::cout << "newHCALIdNS::Cell " << i1 << " " << id << std::endl;
      }
    }

    std::vector<DetId> vdets;
    vdets.insert(vdets.end(), dets.begin(), dets.end());
    std::vector<DetId> vdetE, vdetW;
    if (last == 0) {
      vdetE = spr::newHCALIdEW(dets,last, topology, true,  ietaE,ietaW, debug);
      vdetW = spr::newHCALIdEW(dets,last, topology, false, ietaE,ietaW, debug);
      for (unsigned int i1=0; i1<vdetW.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
          vdets.push_back(vdetW[i1]);
      }
      for (unsigned int i1=0; i1<vdetE.size(); i1++) {
        if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
          vdets.push_back(vdetE[i1]);
      }
      if (debug) {
        std::cout <<"newHCALIdNS::With Added cells along E/W results a set of "
                  << (vdets.size()-dets.size()) << " new  cells" << std::endl;
        for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
        }
      }
    }
    unsigned int last0 = vdets.size();
    int iphi = iphiS;
    if (shiftNorth) iphi = iphiN;
    if (iphi > 0) {
      std::vector<DetId> vdetnew;
      for (unsigned int i1=last; i1<dets.size(); i1++) {
        std::vector<DetId> vdet;
        if (shiftNorth) vdet = topology->north(dets[i1]);
        else            vdet = topology->south(dets[i1]);
        for (unsigned int i2=0; i2<vdet.size(); i2++) {
          if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
            vdetnew.push_back(vdet[i2]);
        }
      }
      iphi--;
      vdetE = spr::newHCALIdEW(vdetnew,0, topology, true,  ietaE,ietaW, debug);
      vdetW = spr::newHCALIdEW(vdetnew,0, topology, false, ietaE,ietaW, debug);
      for (unsigned int i2=0; i2<vdetW.size(); i2++) {
        if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
            std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
          vdets.push_back(vdetW[i2]);
      }
      for (unsigned int i2=0; i2<vdetE.size(); i2++) {
        if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
            std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
          vdets.push_back(vdetE[i2]);
      }
      last = vdets.size();
      vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
      if (debug) {
        std::cout << "newHCALIdNS::Addition results a set of " 
                  << (vdets.size()-last0)  << " new  cells" << std::endl;
        for (unsigned int i1=last0; i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdNS::Cell " << i1 << " " << id << std::endl;
        }
      }
      last0 = last;
    }
    if (shiftNorth) iphiN = iphi;
    else            iphiS = iphi;

    if (iphi > 0) {
      last = last0;
      return spr::newHCALIdNS(vdets,last,topology,shiftNorth,ietaE,ietaW,
                              iphiN,iphiS,debug);
    } else {
      if (debug) {
        std::cout << "newHCALIdNS::Final list consists of " << vdets.size()
                  << " cells" << std::endl;
        for (unsigned int i1=0; i1<vdets.size(); i1++) {
          HcalDetId id = HcalDetId(vdets[i1]());        
          std::cout << "newHCALIdNS::Cell " << i1 << " " << id << std::endl;
        }
      }
      return vdets;
    }
  }
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, DeDxDiscriminatorTools::charge(), gather_cfg::cout, and dbtoconf::parent.

Referenced by matchedSimTrackInfo().

                                                                                                                                                                                                {
  
    edm::SimTrackContainer::const_iterator itr = SimTk->end();

    int vertIndex = thisTrkItr->vertIndex();
    int type = thisTrkItr->type(); int charge = (int)thisTrkItr->charge();
    if (debug) std::cout << "SimTrackParent " << thisTrkItr->trackId() << " Vertex " <<  vertIndex << " Type " << type << " Charge " << charge << std::endl;

    if( vertIndex == -1 )                      return thisTrkItr;  
    else if (vertIndex >= (int)SimVtx->size()) return itr; 

    edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
    for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
    int parent = simVtxItr->parentIndex();

    if (parent < 0 && simVtxItr != SimVtx->begin()) {
      const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
      for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
        if (simVtxItr->parentIndex() > 0) {
          const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
          double dist = pos2.P();
          if (dist < 0.001) {
            parent = simVtxItr->parentIndex();
            break;
          }
        }
      }
    }
    for (edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
      if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return  parentSimTrack(simTrkItr, SimTk, SimVtx, debug); 
    }

    return thisTrkItr; 
  }
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 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(), EcalBarrelGeometry::getClosestCell(), EcalEndcapGeometry::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.

                                                                                                                                                                                                           {

    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
    const CaloSubdetectorGeometry* gHB = geo->getSubdetectorGeometry(DetId::Hcal,HcalBarrel);
    reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);

    unsigned int indx;
    reco::TrackCollection::const_iterator trkItr;
    for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
      const reco::Track* pTrack = &(*trkItr);
      spr::propagatedTrackID vdet;
      vdet.trkItr = trkItr;
      vdet.ok     = (pTrack->quality(trackQuality_));
      vdet.detIdECAL = DetId(0);
      vdet.detIdHCAL = DetId(0);
      vdet.detIdEHCAL= DetId(0);
      if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << vdet.ok << std::endl;

      std::pair<math::XYZPoint,bool> info = spr::propagateECAL (pTrack, bField, debug);
      vdet.okECAL = info.second;
      if (vdet.okECAL) {
        const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
        vdet.etaECAL = point.eta();
        vdet.phiECAL = point.phi();
        if (std::abs(point.eta())<1.479) {
          vdet.detIdECAL = barrelGeom->getClosestCell(point);
        } else {
          vdet.detIdECAL = endcapGeom->getClosestCell(point);
        }
        vdet.detIdEHCAL = gHB->getClosestCell(point);
      }
      info = spr::propagateHCAL (pTrack, bField, debug);
      vdet.okHCAL = info.second;
      if (vdet.okHCAL) {
        const GlobalPoint point(info.first.x(),info.first.y(),info.first.z());
        vdet.etaHCAL = point.eta();
        vdet.phiHCAL = point.phi();
        vdet.detIdHCAL = gHB->getClosestCell(point);
      }

      vdets.push_back(vdet);
    }
    
    if (debug) {
      std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
      for (unsigned int i=0; i<vdets.size(); ++i) {
        std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
        if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
          std::cout << (EBDetId)(vdets[i].detIdECAL);
        } else {
          std::cout << (EEDetId)(vdets[i].detIdECAL); 
        }
        std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or " << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
      }
    }
  }
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 411 of file CaloPropagateTrack.cc.

References abs, alongMomentum, Reference_intrackfit_cff::barrel, 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, AnalyticalPropagator::propagate(), 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().

                                                                                                                                                                                                {
    
    spr::propagatedTrack track;
    if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
    FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
    
    Plane::PlanePointer lendcap = Plane::build(Plane::PositionType (0, 0, -zdist), Plane::RotationType());
    Plane::PlanePointer rendcap = Plane::build(Plane::PositionType (0, 0,  zdist), Plane::RotationType());
    
    Cylinder::CylinderPointer barrel = Cylinder::build(Cylinder::PositionType (0, 0, 0), Cylinder::RotationType (), radius);
  
    AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);

    TrajectoryStateOnSurface tsose;
    if (tpMomentum.eta() < 0) {
      tsose = myAP.propagate(fts, *lendcap);
    } else {
      tsose = myAP.propagate(fts, *rendcap);
    }

    TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);

    track.ok=true;
    if (tsose.isValid() && tsosb.isValid()) {
      float absEta = std::abs(tsosb.globalPosition().eta());
      if (absEta < corner) {
        track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
        track.direction = tsosb.globalDirection();
      } else {
        track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
        track.direction = tsose.globalDirection();
      }
    } else if (tsose.isValid()) {
      track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
      track.direction = tsose.globalDirection();
    } else if (tsosb.isValid()) {
      track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
      track.direction = tsosb.globalDirection();
    } else {
      track.point.SetXYZ(-999., -999., -999.);
      track.direction = GlobalVector(0,0,1);
      track.ok = false;
    }
    if (debug) {
      std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
      if (track.ok) {
        math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
        double dphi = track.direction.phi()-tpMomentum.phi();
        double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
        double pt    = tpMomentum.perp();
        double rat   = 0.5*dphi/std::sin(0.5*dphi);
        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;
      }
    }
    return track;
  }
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 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(), EcalBarrelGeometry::getClosestCell(), EcalEndcapGeometry::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.

                                                                                                                                                                                                         {

    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
    const CaloSubdetectorGeometry* gHB = geo->getSubdetectorGeometry(DetId::Hcal,HcalBarrel);

    std::vector<spr::propagatedGenTrackID> trkDir;
    unsigned int indx;
    HepMC::GenEvent::particle_const_iterator p;
    for (p=genEvent->particles_begin(),indx=0;   p != genEvent->particles_end(); ++p,++indx) {
      spr::propagatedGenTrackID trkD;
      trkD.trkItr    = p;
      trkD.detIdECAL = DetId(0);
      trkD.detIdHCAL = DetId(0);
      trkD.detIdEHCAL= DetId(0);
      trkD.pdgId  = ((*p)->pdg_id());
      trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge())/3;
      GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
      if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
      
      // consider stable particles
      if ( (*p)->status()==1 && std::abs((*p)->momentum().eta()) < etaMax ) { 
        GlobalPoint vertex = GlobalPoint(0.1*(*p)->production_vertex()->position().x(), 
                                         0.1*(*p)->production_vertex()->position().y(), 
                                         0.1*(*p)->production_vertex()->position().z());
        trkD.ok = true;
        spr::propagatedTrack info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 319.2, 129.4, 1.479, debug);
        GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
        trkD.okECAL        = info.ok;
        trkD.pointECAL     = point;
        trkD.directionECAL = info.direction;
        if (trkD.okECAL) {
          if (std::abs(info.point.eta())<1.479) {
            trkD.detIdECAL = barrelGeom->getClosestCell(point);
          } else {
            trkD.detIdECAL = endcapGeom->getClosestCell(point);
          }
          trkD.detIdEHCAL = gHB->getClosestCell(point);
        }

        info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 402.7, 180.7, 1.392, debug);
        point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
        trkD.okHCAL        = info.ok;
        trkD.pointHCAL     = point;
        trkD.directionHCAL = info.direction;
        if (trkD.okHCAL) {
          trkD.detIdHCAL = gHB->getClosestCell(point);
        }
      }
      trkDir.push_back(trkD);
    }

    if (debug) {
      std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
      for (unsigned int i=0; i<trkDir.size(); ++i) {
        if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
        if (trkDir[i].okECAL) {
          std::cout << " point " << trkDir[i].pointECAL << " direction "
                    << trkDir[i].directionECAL << " "; 
          if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
            std::cout << (EBDetId)(trkDir[i].detIdECAL);
          } else {
            std::cout << (EEDetId)(trkDir[i].detIdECAL); 
          }
        }
        if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
        if (trkDir[i].okHCAL) {
          std::cout << " point " << trkDir[i].pointHCAL << " direction "
                    << trkDir[i].directionHCAL << " " 
                    << (HcalDetId)(trkDir[i].detIdHCAL); 
        }
        if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
      }
    }
    return trkDir;
  }
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 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(), EcalBarrelGeometry::getClosestCell(), EcalEndcapGeometry::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.

                                                                                                                                                                                                                                {

    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
    const CaloSubdetectorGeometry* gHB = geo->getSubdetectorGeometry(DetId::Hcal,HcalBarrel);

    std::vector<spr::propagatedGenParticleID> trkDir;
    unsigned int indx;
    reco::GenParticleCollection::const_iterator p;
    for (p=genParticles->begin(),indx=0;   p != genParticles->end(); ++p,++indx) {
      spr::propagatedGenParticleID trkD;
      trkD.trkItr    = p;
      trkD.detIdECAL = DetId(0);
      trkD.detIdHCAL = DetId(0);
      trkD.detIdEHCAL= DetId(0);
      trkD.pdgId     = (p->pdgId());
      trkD.charge    = p->charge();
      GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
      if (debug) std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p " << momentum << std::endl;
      
      // consider stable particles
      if ( p->status()==1 && std::abs(momentum.eta()) < etaMax ) { 
        GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
        trkD.ok = true;
        spr::propagatedTrack info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 319.2, 129.4, 1.479, debug);
        GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
        trkD.okECAL        = info.ok;
        trkD.pointECAL     = point;
        trkD.directionECAL = info.direction;
        if (trkD.okECAL) {
          if (std::abs(info.point.eta())<1.479) {
            trkD.detIdECAL = barrelGeom->getClosestCell(point);
          } else {
            trkD.detIdECAL = endcapGeom->getClosestCell(point);
          }
          trkD.detIdEHCAL = gHB->getClosestCell(point);
        }

        info = spr::propagateCalo (vertex, momentum, trkD.charge, bField, 402.7, 180.7, 1.392, debug);
        point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
        trkD.okHCAL        = info.ok;
        trkD.pointHCAL     = point;
        trkD.directionHCAL = info.direction;
        if (trkD.okHCAL) {
          trkD.detIdHCAL = gHB->getClosestCell(point);
        }
      }
      trkDir.push_back(trkD);
    }

    if (debug) {
      std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
      for (unsigned int i=0; i<trkDir.size(); ++i) {
        if (trkDir[i].okECAL) std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
        if (trkDir[i].okECAL) {
          std::cout << " point " << trkDir[i].pointECAL << " direction "
                    << trkDir[i].directionECAL << " "; 
          if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
            std::cout << (EBDetId)(trkDir[i].detIdECAL);
          } else {
            std::cout << (EEDetId)(trkDir[i].detIdECAL); 
          }
        }
        if (trkDir[i].okECAL) std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
        if (trkDir[i].okHCAL) {
          std::cout << " point " << trkDir[i].pointHCAL << " direction "
                    << trkDir[i].directionHCAL << " " 
                    << (HcalDetId)(trkDir[i].detIdHCAL); 
        }
        if (trkDir[i].okECAL) std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
      }
    }
    return trkDir;
  }
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 IsolatedGenParticles::analyze(), IsolatedTracksHcalScale::analyze(), and IsolatedTracksNxN::analyze().

                                                                                                                                                                                              {

    std::vector<spr::propagatedTrackID> vdets;
    spr::propagateCALO(trkCollection,geo,bField,theTrackQuality, vdets, debug);
    return vdets;
  }
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 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(), EcalBarrelGeometry::getClosestCell(), EcalEndcapGeometry::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.

                                                                                                                                                                                                                   {

    const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
    const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
    const CaloSubdetectorGeometry* gHB = geo->getSubdetectorGeometry(DetId::Hcal,HcalBarrel);
    reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);

    unsigned int indx;
    reco::TrackCollection::const_iterator trkItr;
    for (trkItr = trkCollection->begin(),indx=0; trkItr != trkCollection->end(); ++trkItr,indx++) {
      const reco::Track* pTrack = &(*trkItr);
      spr::propagatedTrackDirection trkD;
      trkD.trkItr = trkItr;
      trkD.ok     = (pTrack->quality(trackQuality_));
      trkD.detIdECAL = DetId(0);
      trkD.detIdHCAL = DetId(0);
      trkD.detIdEHCAL= DetId(0);
      if (debug) std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi " << trkItr->phi() << " Flag " << trkD.ok << std::endl;

      spr::propagatedTrack info = spr::propagateTrackToECAL (pTrack, bField, debug);
      GlobalPoint point(info.point.x(),info.point.y(),info.point.z());
      trkD.okECAL        = info.ok;
      trkD.pointECAL     = point;
      trkD.directionECAL = info.direction;
      if (trkD.okECAL) {
        if (std::abs(info.point.eta())<1.479) {
          trkD.detIdECAL = barrelGeom->getClosestCell(point);
        } else {
          trkD.detIdECAL = endcapGeom->getClosestCell(point);
        }
        trkD.detIdEHCAL = gHB->getClosestCell(point);
      }
      info = spr::propagateTrackToHCAL (pTrack, bField, debug);
      point = GlobalPoint(info.point.x(),info.point.y(),info.point.z());
      trkD.okHCAL        = info.ok;
      trkD.pointHCAL     = point;
      trkD.directionHCAL = info.direction;
      if (trkD.okHCAL) {
        trkD.detIdHCAL = gHB->getClosestCell(point);
      }
      trkDir.push_back(trkD);
    }
    
    if (debug) {
      std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
      for (unsigned int i=0; i<trkDir.size(); ++i) {
        std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
        if (trkDir[i].okECAL) {
          std::cout << " point " << trkDir[i].pointECAL << " direction "
                    << trkDir[i].directionECAL << " "; 
          if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
            std::cout << (EBDetId)(trkDir[i].detIdECAL);
          } else {
            std::cout << (EEDetId)(trkDir[i].detIdECAL); 
          }
        }
        std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
        if (trkDir[i].okHCAL) {
          std::cout << " point " << trkDir[i].pointHCAL << " direction "
                    << trkDir[i].directionHCAL << " " 
                    << (HcalDetId)(trkDir[i].detIdHCAL); 
        }
        std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
      }
    }
  }
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 324 of file CaloPropagateTrack.cc.

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

                                                                                                                                                         {
    spr::propagatedTrack track = spr::propagateCalo (vertex, momentum, charge, bfield, 319.2, 129.4, 1.479, debug);
    return std::pair<math::XYZPoint,bool>(track.point,track.ok);
  }
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 317 of file CaloPropagateTrack.cc.

References reco::TrackBase::charge(), DeDxDiscriminatorTools::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().

                                                                                                            {    
    GlobalPoint  vertex (track->vx(), track->vy(), track->vz());
    GlobalVector momentum (track->px(), track->py(), track->pz());
    int charge (track->charge());
    return spr::propagateECAL (vertex, momentum, charge, bfield, debug);
  }
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 344 of file CaloPropagateTrack.cc.

References reco::TrackBase::charge(), DeDxDiscriminatorTools::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().

                                                                                                            {
    GlobalPoint  vertex (track->vx(), track->vy(), track->vz());
    GlobalVector momentum (track->px(), track->py(), track->pz());
    int charge (track->charge());
    return spr::propagateHCAL (vertex, momentum, charge, bfield, debug);
  }
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 351 of file CaloPropagateTrack.cc.

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

                                                                                                                                                         {
    spr::propagatedTrack track = spr::propagateCalo (vertex, momentum, charge, bfield, 402.7, 180.7, 1.392, debug);
    return std::pair<math::XYZPoint,bool>(track.point,track.ok);
  }
std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 356 of file CaloPropagateTrack.cc.

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

                                                                                                               {
    GlobalPoint  vertex (track->vx(), track->vy(), track->vz());
    GlobalVector momentum (track->px(), track->py(), track->pz());
    int charge (track->charge());
    spr::propagatedTrack track1 = spr::propagateCalo (vertex, momentum, charge, bfield, 290.0, 109.0, 1.705, debug);
    return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
  }
std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

Definition at line 364 of file CaloPropagateTrack.cc.

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

Referenced by IsolatedTracksNxN::analyze().

                                                                                                                    {

    GlobalPoint  vertex (track->vx(), track->vy(), track->vz());
    GlobalVector momentum (track->px(), track->py(), track->pz());
    int charge (track->charge());
    float radius = track->outerPosition().Rho();
    float zdist  = track->outerPosition().Z();
    if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;

    FreeTrajectoryState fts (vertex, momentum, charge, bField);
    Plane::PlanePointer endcap = Plane::build(Plane::PositionType (0, 0, zdist), Plane::RotationType());
    Cylinder::CylinderPointer barrel = Cylinder::build(Cylinder::PositionType (0, 0, 0), Cylinder::RotationType (), radius);

    AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);

    TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
    TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);

    math::XYZPoint point(-999.,-999.,-999.);
    bool ok=false;
    GlobalVector direction(0,0,1);
    if (tsosb.isValid() && std::abs(zdist) < 110) {
      point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
      direction = tsosb.globalDirection();
      ok = true;
    } else if (tsose.isValid()) {
      point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
      direction = tsose.globalDirection();
      ok = true;
    }

    double length = -1;
    if (ok) {
      math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
      double dphi  = direction.phi()-momentum.phi();
      double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
      double rat   = 0.5*dphi/std::sin(0.5*dphi);
      double dZ    = vDiff.z();
      double dS    = rdist*rat; //dZ*momentum.z()/momentum.perp();
      length       = std::sqrt(dS*dS+dZ*dZ);
      if (debug) 
        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;
    }

    return std::pair<math::XYZPoint,double>(point,length);
  }
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 302 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

                                                                                                        {
    GlobalPoint  vertex (track->vx(), track->vy(), track->vz());
    GlobalVector momentum (track->px(), track->py(), track->pz());
    int charge (track->charge());
    return spr::propagateCalo (vertex, momentum, charge, bfield, 319.2, 129.4, 1.479, debug);
  }
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 309 of file CaloPropagateTrack.cc.

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

                                                                                                                                                                                        {
    spr::trackAtOrigin   trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
    spr::propagatedTrack ptrk;
    if (trk.ok) 
      ptrk = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bfield, 319.2, 129.4, 1.479, debug);
    return ptrk;
  }
spr::propagatedTrack spr::propagateTrackToHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 329 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

                                                                                                           {
    GlobalPoint  vertex (track->vx(), track->vy(), track->vz());
    GlobalVector momentum (track->px(), track->py(), track->pz());
    int charge (track->charge());
    return spr::propagateCalo (vertex, momentum, charge, bfield, 402.7, 180.7, 1.392, debug);
  }
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 336 of file CaloPropagateTrack.cc.

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

                                                                                                                                                                                           {
    spr::trackAtOrigin   trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
    spr::propagatedTrack ptrk;
    if (trk.ok) 
      ptrk = spr::propagateCalo (trk.position, trk.momentum, trk.charge, bfield, 402.7, 180.7, 1.392, debug);
    return ptrk;
  }
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 893 of file MatrixECALDetIds.cc.

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

Referenced by newECALIdEW(), and newECALIdNS().

                                                                {

    DetId cell;
    ok = 0;
    if (det.subdetId() == EcalBarrel) {
      EBDetId detId = det;
      std::vector<DetId> neighbours = barrelTopo.getNeighbours(detId,dir);
      if (neighbours.size()>0 && !neighbours[0].null()) {
        cells.push_back(neighbours[0]);
        cell = neighbours[0];
        ok   = 1;
      } else {
        const int ietaAbs ( detId.ietaAbs() ) ; // abs value of ieta
        if (EBDetId::MAX_IETA == ietaAbs ) {
          // get ee nbrs for for end of barrel crystals
          const EcalBarrelGeometry::OrderedListOfEEDetId&
            ol( * barrelGeom.getClosestEndcapCells(detId) ) ;
          // take closest neighbour on the other side, that is in the endcap
          cell = *(ol.begin() );
          neighbours = endcapTopo.getNeighbours(cell,dir);
          if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
          else                                              ok =-1;
          for (EcalBarrelGeometry::OrderedListOfEEDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
            cells.push_back(*iptr);
        }
      }
    } else if (det.subdetId() == EcalEndcap) {
      EEDetId detId = det;
      std::vector<DetId> neighbours = endcapTopo.getNeighbours(detId,dir);
      if (neighbours.size()>0 && !neighbours[0].null()) {
        cells.push_back(neighbours[0]);
        cell = neighbours[0];
        ok   = 1;
      } else {
        // are we on the outer ring ?
        const int iphi ( detId.iPhiOuterRing() ) ;
        if (iphi!= 0) {
          // get eb nbrs for for end of endcap crystals
          const EcalEndcapGeometry::OrderedListOfEBDetId&
            ol( * endcapGeom.getClosestBarrelCells(detId) ) ;
          // take closest neighbour on the other side, that is in the barrel.
          cell = *(ol.begin() );
          neighbours = barrelTopo.getNeighbours(cell,dir);
          if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
          else                                              ok =-1;
          for (EcalEndcapGeometry::OrderedListOfEBDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
            cells.push_back(*iptr);
        }
      }
    }  
    if (debug) {
      std::cout << "simpleMove:: Move DetId 0x" << std::hex << det() 
                << std::dec << " along " << dir << " to get 0x" << std::hex
                << cell() << std::dec << " with flag " << ok << " # "
                << cells.size();
      for (unsigned int i1=0; i1<cells.size(); ++i1) 
        std::cout << " " << std::hex << cells[0]() << std::dec;
      std::cout << std::endl;
    }
  }
spr::trackAtOrigin spr::simTrackAtOrigin ( unsigned int  thisTrk,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
bool  debug = false 
)

Definition at line 468 of file CaloPropagateTrack.cc.

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

Referenced by propagateTrackToECAL(), and propagateTrackToHCAL().

                                                                                                                                                        {

    spr::trackAtOrigin trk;

    edm::SimTrackContainer::const_iterator itr = SimTk->end();
    for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++) {
      if ( simTrkItr->trackId() == thisTrk ) {
        if (debug) std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
        itr = simTrkItr;
        break;
      }
    }

    if (itr != SimTk->end()) {
      int vertIndex = itr->vertIndex();
      if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
        edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
        for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
        const math::XYZTLorentzVectorD pos = simVtxItr->position();
        const math::XYZTLorentzVectorD mom = itr->momentum();
        trk.ok = true;
        trk.charge   = (int)(itr->charge());
        trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
        trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
      }
    }
    if (debug) std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;;
    return trk;
  }
double spr::timeOfFlight ( DetId  id,
const CaloGeometry geo,
bool  debug = false 
)

Definition at line 12 of file CaloSimInfo.cc.

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

Referenced by CrossingFrame< T >::addPileups(), SiStripFineDelayHit::detId(), and RPCDigiSimLink::RPCDigiSimLink().

                                                                     {

    double R   = geo->getPosition(id).mag();
    double tmp = R/CLHEP::c_light/CLHEP::ns;
    if (debug) {
      DetId::Detector det = id.det();
      int subdet   = id.subdetId();
      double eta   = geo->getPosition(id).eta();
      double theta = 2.0*atan(exp(-std::abs(eta)));
      double dist  = 0;
      if (det == DetId::Ecal) {
        if (subdet == static_cast<int>(EcalBarrel)) {
          const double rEB = 1292*CLHEP::mm;
          dist = rEB/sin(theta);
        } else if (subdet == static_cast<int>(EcalEndcap)) {
          const double zEE = 3192*CLHEP::mm;
          dist = zEE/cos(theta);
        } else {
          const double zES = 3032*CLHEP::mm;
          dist = zES/cos(theta);
        }
      } else if (det == DetId::Hcal) {
        if (subdet == static_cast<int>(HcalBarrel)) {
          const double rHB = 1807*CLHEP::mm;
          dist = rHB/sin(theta);
        } else if (subdet == static_cast<int>(HcalEndcap)) {
          const double zHE = 4027*CLHEP::mm;
          dist = zHE/cos(theta);
        } else if (subdet == static_cast<int>(HcalOuter)) {
          const double rHO = 3848*CLHEP::mm;
          dist = rHO/sin(theta);
        } else {
          const double zHF = 11.15*CLHEP::m;
          dist = zHF/cos(theta);
        }
      }
      double tmp1 = dist/CLHEP::c_light/CLHEP::ns;

      std::cout << "Detector " << det << "/" << subdet << " Eta/Theta " << eta 
                << "/" << theta/CLHEP::deg << " Dist " << dist/CLHEP::cm 
                << " R " << R << " TOF " << tmp << ":" << tmp1 << std::endl;
    }
    return tmp;
  }
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().

                                                                                                                                                                                       {
    
    if (debug) std::cout << "Inside validSimTrack: trackId " << thisTrkItr->trackId() << " vtxIndex " <<  thisTrkItr->vertIndex() << " to be matched to " << simTkId << std::endl;
    
    //This track originates from simTkId
    if (thisTrkItr->trackId() == simTkId) return true;

    //Otherwise trace back the history using SimTracks and SimVertices
    int vertIndex = thisTrkItr->vertIndex();
    if (vertIndex == -1 || vertIndex >= (int)SimVtx->size()) return false;
    
    edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
    for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
    int parent = simVtxItr->parentIndex();
    if (debug) std::cout << "validSimTrack:: parent index " << parent <<" ";
    if (parent < 0 && simVtxItr != SimVtx->begin()) {
      const math::XYZTLorentzVectorD pos1 = simVtxItr->position();
      for (simVtxItr=SimVtx->begin(); simVtxItr!=SimVtx->end(); ++simVtxItr) {
        if (simVtxItr->parentIndex() > 0) {
          const math::XYZTLorentzVectorD pos2 = pos1 - simVtxItr->position();
          double dist = pos2.P();
          if (dist < 0.001) {
            parent = simVtxItr->parentIndex();
            break;
          }
        }
      }
    }
    if (debug) std::cout << "final index " << parent << std::endl;;
    for(edm::SimTrackContainer::const_iterator simTrkItr= SimTk->begin(); simTrkItr!= SimTk->end(); simTrkItr++){
      if ((int)simTrkItr->trackId() == parent && simTrkItr != thisTrkItr) return  validSimTrack(simTkId, simTrkItr, SimTk, SimVtx, debug) ; 
    }
  
    return false;
  
  }