CMS 3D CMS Logo

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

Classes

struct  caloSimInfo
 
struct  energyMap
 
struct  EtaPhi
 
struct  propagatedTrack
 
struct  propagatedTrackDirection
 
struct  propagatedTrackID
 
struct  simTkInfo
 
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)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &theNavigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string theTrackQuality, bool debug)
 
double chargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, CaloNavigator< DetId > &navigator, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloSubdetectorGeometry *gEB, const CaloSubdetectorGeometry *gEE, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
bool chargeIsolation (const DetId anyCell, CaloNavigator< DetId > &navigator, int deta, int dphi)
 
bool chargeIsolation (const DetId anyCell, std::vector< DetId > &vdets)
 
double chargeIsolationCone (unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
 
double chargeIsolationEcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationEcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationEcal (const DetId &coreDet, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const CaloGeometry *geo, const CaloTopology *caloTopology, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double chargeIsolationHcal (unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
 
double chargeIsolationHcal (reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, const DetId ClosestCell, const HcalTopology *topology, const CaloSubdetectorGeometry *gHB, const MagneticField *bField, int ieta, int iphi, std::string &theTrackQuality, bool debug=false)
 
double coneChargeIsolation (const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
 
int coneChargeIsolation (const GlobalPoint &hpoint1, const GlobalPoint &point2, const GlobalVector &trackMom, double dR)
 
template<typename T >
void eCaloSimInfo (std::vector< DetId > vdets, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
void eCaloSimInfo (const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool includeHO=false, bool debug=false)
 
std::map< std::string, double > eCaloSimInfo (caloSimInfo &info)
 
template<typename T >
double eCaloSimInfo (const edm::Event &, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
double eCaloSimInfo (const edm::Event &, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eCaloSimInfo (edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, std::vector< typename T::const_iterator > hit, edm::SimTrackContainer::const_iterator trkInfo, std::vector< int > &multiplicityVector, bool debug=false)
 
template<typename T >
double eCone_ecal (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits)
 
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)
 
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)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eECALmatrix (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ietaE, int ietaW, int iphiN, int iphiS, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
std::pair< double, bool > eECALmatrix (const DetId &detId, edm::Handle< EcalRecHitCollection > &hitsEB, edm::Handle< EcalRecHitCollection > &hitsEE, const EcalChannelStatus &chStatus, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalTrigTowerConstituentsMap &ttMap, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
eECALmatrixCell (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eECALmatrixTotal (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, CaloNavigator< DetId > &navigator, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
void eECALSimInfo (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo &info, double timeCut=150, bool debug=false)
 
template<typename T >
energyMap eECALSimInfoMatrix (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool debug=false)
 
template<typename T >
std::map< std::string, double > eECALSimInfoTotal (const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double eHCALmatrix (const CaloGeometry *geo, const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, GlobalPoint &gPosHotCell)
 
template<typename T >
double eHCALmatrix (const HcalTopology *topology, const DetId &det0, edm::Handle< T > &hits, int ieta, int iphi, int &nRecHits, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, std::set< int > &uniqueIdset)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
eHCALmatrixCell (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
std::pair< double, int > eHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
std::map< std::string, double > eHCALSimInfo (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
void eHCALSimInfo (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
void eHCALSimInfo (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ietaE, int ietaW, int iphiN, int iphiS, caloSimInfo &info, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
std::map< std::string, double > eHCALSimInfo (const edm::Event &iEvent, const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, std::vector< int > &multiplicityVector, bool debug=false)
 
template<typename T >
energyMap eHCALSimInfoMatrix (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
std::map< std::string, double > eHCALSimInfoTotal (const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool includeHO=false, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
energyDetIdHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyECAL (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
std::vector< std::pair< DetId,
double > > 
energyECALCell (std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, bool debug=false)
 
template<typename T >
double energyECALTower (const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vNeighboursDetId, std::vector< DetId > &dets, const HcalTopology *topology, edm::Handle< T > &hits, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCAL (std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyHCALmatrix (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
 
template<typename T >
double energyHCALmatrixNew (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
template<typename T >
double energyHCALmatrixTotal (const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
 
void extraIds (const DetId &det, std::vector< DetId > &dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, bool debug=false)
 
void find (edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< HBHERecHitCollection > &hits, DetId thisDet, std::vector< HBHERecHitCollection::const_iterator > &hit, bool debug=false)
 
void find (edm::Handle< edm::PCaloHitContainer > &hits, DetId thisDet, std::vector< edm::PCaloHitContainer::const_iterator > &hit, bool debug=false)
 
std::vector
< EcalRecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
std::vector
< EcalRecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR)
 
std::vector
< EcalRecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< EcalRecHitCollection > &barrelhits, edm::Handle< EcalRecHitCollection > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
std::vector
< HBHERecHitCollection::const_iterator
findCone (const CaloGeometry *geo, edm::Handle< HBHERecHitCollection > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
std::vector
< edm::PCaloHitContainer::const_iterator > 
findCone (const CaloGeometry *geo, edm::Handle< edm::PCaloHitContainer > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
const DetId findDetIdCalo (const CaloSubdetectorGeometry *geo, double theta, double phi, double radius, bool debug=false)
 
const DetId findDetIdECAL (const CaloGeometry *geo, double eta, double phi, bool debug=false)
 
const DetId findDetIdHCAL (const CaloGeometry *geo, double eta, double phi, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
findHit (edm::Handle< T > &hits, DetId thisDet, bool debug=false)
 
template<typename T >
void findHit (edm::Handle< T > &hits, DetId thisDet, std::vector< typename T::const_iterator > &hit, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
findHitCone (const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
template<typename T >
std::vector< typename
T::const_iterator > 
findHitCone (const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom)
 
double getDistInCMatEcal (double eta1, double phi1, double eta2, double phi2)
 
double getDistInCMatHcal (double eta1, double phi1, double eta2, double phi2)
 
double getDistInPlaneTrackDir (const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint)
 
double getEnergy (HBHERecHitCollection::const_iterator hit)
 
double getEnergy (edm::PCaloHitContainer::const_iterator hit)
 
EtaPhi getEtaPhi (int ieta, int iphi, bool debug=false)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene)
 
void getEtaPhi (HBHERecHitCollection::const_iterator hit, int &ieta, int &iphi)
 
void getEtaPhi (edm::PCaloHitContainer::const_iterator hit, int &ieta, int &iphi)
 
GlobalPoint getGpos (const CaloGeometry *geo, HBHERecHitCollection::const_iterator hit)
 
GlobalPoint getGpos (const CaloGeometry *geo, edm::PCaloHitContainer::const_iterator hit)
 
bool goodTrack (const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
 
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)
 
void matrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false)
 
void matrixECALIds (const DetId &det, int ietaE, int ietaW, int iphiN, int iphiS, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
 
std::vector< DetIdmatrixECALIds (const DetId &det, int ietaE, int ietaW, int iphiN, int iphiS, const CaloGeometry *geo, const CaloTopology *caloTopology, bool debug=false)
 
std::vector< DetIdmatrixHCALIds (std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIds (std::vector< DetId > &dets, const HcalTopology *topology, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, bool debug=false)
 
std::vector< DetIdmatrixHCALIdsDepth (std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
missedCaloHits (edm::Handle< T > &hits, std::vector< int > matchedId, std::vector< typename T::const_iterator > caloHits, bool flag, bool includeHO=false, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
missedECALHits (const edm::Event &, CaloNavigator< DetId > &navigator, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, bool flag, bool debug=false)
 
template<typename T >
std::vector< typename
T::const_iterator > 
missedHCALHits (const edm::Event &, const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, bool flag, bool includeHO=false, bool debug=false)
 
std::vector< DetIdnewECALIdEW (std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
 
std::vector< DetIdnewECALIdEW (std::vector< DetId > &dets, unsigned int last, std::vector< int > &ietaE, std::vector< int > &ietaW, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
 
std::vector< DetIdnewECALIdNS (std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
 
std::vector< DetIdnewECALIdNS (std::vector< DetId > &dets, unsigned int last, std::vector< int > &ietaE, std::vector< int > &ietaW, std::vector< int > &iphiN, std::vector< int > &iphiS, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
 
std::vector< DetIdnewHCALIdEW (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
 
std::vector< DetIdnewHCALIdEW (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ietaE, int ietaW, bool debug=false)
 
std::vector< DetIdnewHCALIdNS (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
 
std::vector< DetIdnewHCALIdNS (std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ietaE, int ietaW, int iphiN, int iphiS, bool debug=false)
 
edm::SimTrackContainer::const_iterator parentSimTrack (edm::SimTrackContainer::const_iterator thisTrkItr, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
 
std::vector
< spr::propagatedTrackID
propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, std::vector< spr::propagatedTrackID > &vdets, bool debug=false)
 
void propagateCALO (edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, std::vector< spr::propagatedTrackDirection > &trkDir, bool debug=false)
 
propagatedTrack propagateCalo (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateECAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateHCAL (const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, bool > propagateTracker (const reco::Track *, const MagneticField *, bool debug=false)
 
std::pair< math::XYZPoint, double > propagateTrackerEnd (const reco::Track *, const MagneticField *, bool debug=false)
 
propagatedTrack propagateTrackToECAL (const reco::Track *, const MagneticField *, bool debug=false)
 
propagatedTrack propagateTrackToHCAL (const reco::Track *, 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)
 
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 
)
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, L1TEmulatorMonitor_cff::p, reco::TrackBase::p(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtEcal.

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

Definition at line 51 of file ChargeIsolationExtra.cc.

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

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

Definition at line 164 of file ChargeIsolation.cc.

References i.

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

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

Definition at line 232 of file ChargeIsolation.cc.

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

Referenced by IsolatedTracksHcalScale::analyze().

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

Definition at line 76 of file ChargeIsolationExtra.cc.

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

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

Referenced by IsolatedTracksNxN::analyze().

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

43  {
44 
45  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
46  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
47 
48  std::vector<DetId> vdets = spr::matrixECALIds(coreDet, ieta, iphi, geo, caloTopology, debug);
49  if (debug) std::cout << "chargeIsolation:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
50 
51  double maxNearP = -1.0;
53 
54  // const DetId anyCell,
55  reco::TrackCollection::const_iterator trkItr2;
56  for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
57 
58  const reco::Track* pTrack2 = &(*trkItr2);
59 
60  bool trkQuality = pTrack2->quality(trackQuality_);
61  if ( (trkItr2 != trkItr) && trkQuality ) {
62 
63  std::pair<math::XYZPoint,bool> info = spr::propagateECAL(pTrack2,bField);
64  const GlobalPoint point2(info.first.x(),info.first.y(),info.first.z());
65 
66  if (info.second) {
67  if (std::abs(point2.eta())<1.479) {
68  const DetId anyCell = barrelGeom->getClosestCell(point2);
69  if (!spr::chargeIsolation(anyCell,vdets)) {
70  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
71  }
72  } else {
73  const DetId anyCell = endcapGeom->getClosestCell(point2);
74  if (!spr::chargeIsolation(anyCell,vdets)) {
75  if (maxNearP<pTrack2->p()) maxNearP=pTrack2->p();
76  }
77  }
78  } //info.second
79  }
80  }
81  return maxNearP;
82  }
virtual DetId getClosestCell(const GlobalPoint &r) const
double p() const
momentum vector magnitude
Definition: TrackBase.h:128
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
virtual DetId getClosestCell(const GlobalPoint &r) const
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
TrackQuality
track quality
Definition: TrackBase.h:94
#define abs(x)
Definition: mlp_lapack.h:159
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: DetId.h:20
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:348
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
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(), L1TEmulatorMonitor_cff::p, reco::TrackBase::p(), reco::TrackBase::phi(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and TrackDetMatchInfo::trkGlobPosAtHcal.

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

Referenced by IsolatedTracksNxN::analyze().

86  {
87 
88  std::vector<DetId> dets(1,vdetIds[trkIndex].detIdHCAL);
89  if (debug) {
90  std::cout << "DetId " << (HcalDetId)(dets[0]) << " Flag " << vdetIds[trkIndex].okHCAL << std::endl;
91  }
92 
93  double maxNearP = -1.0;
94  if (vdetIds[trkIndex].okHCAL) {
95  std::vector<DetId> vdets = spr::matrixHCALIds(dets, topology, ieta, iphi, false, debug);
96  if (debug) std::cout << "chargeIsolationHcal:: eta/phi/dets " << ieta << " " << iphi << " " << vdets.size() << std::endl;
97 
98  for (unsigned indx = 0; indx<vdetIds.size(); ++indx) {
99  if (indx != trkIndex && vdetIds[indx].ok && vdetIds[indx].okHCAL) {
100  const DetId anyCell = vdetIds[indx].detIdHCAL;
101  if (!spr::chargeIsolation(anyCell,vdets)) {
102  const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
103  if (maxNearP < pTrack->p()) maxNearP = pTrack->p();
104  }
105  }
106  }
107  }
108  return maxNearP;
109  }
double p() const
momentum vector magnitude
Definition: TrackBase.h:128
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
Definition: DetId.h:20
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
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(), L1TEmulatorMonitor_cff::p, reco::TrackBase::p(), reco::TrackBase::phi(), propagateHCAL(), reco::TrackBase::quality(), and reco::TrackBase::qualityByName().

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

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

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

Definition at line 252 of file ChargeIsolation.cc.

References getDistInPlaneTrackDir().

252  {
253 
254  int isIsolated = 1;
255  if (spr::getDistInPlaneTrackDir(hpoint1, trackMom, point2) > dR) isIsolated = 1;
256  else isIsolated = 0;
257  return isIsolated;
258  }
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint)
Definition: FindDistCone.cc:8
template<typename T >
void spr::eCaloSimInfo ( std::vector< DetId vdets,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eCaloSimInfo ( const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
std::map<std::string,double> spr::eCaloSimInfo ( caloSimInfo &  info)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
double spr::eCaloSimInfo ( const edm::Event ,
const CaloGeometry geo,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eCaloSimInfo ( edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
std::vector< typename T::const_iterator >  hit,
edm::SimTrackContainer::const_iterator  trkInfo,
std::vector< int > &  multiplicityVector,
bool  debug = false 
)
template<typename T >
double spr::eCone_ecal ( const CaloGeometry geo,
edm::Handle< T > &  barrelhits,
edm::Handle< T > &  endcaphits,
const GlobalPoint hpoint1,
const GlobalPoint point1,
double  dR,
const GlobalVector trackMom,
int &  nRecHits 
)
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 
)
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 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
const EcalTrigTowerConstituentsMap ttMap,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eECALmatrix ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
std::pair< double, bool > spr::eECALmatrix ( const DetId detId,
edm::Handle< EcalRecHitCollection > &  hitsEB,
edm::Handle< EcalRecHitCollection > &  hitsEE,
const EcalChannelStatus chStatus,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)

Definition at line 9 of file eECALMatrix.cc.

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

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

64  {
65 
66  std::vector<DetId> vdets;
67  spr::matrixECALIds(detId, ieta, iphi, geo, caloTopology, vdets, debug);
68 
69  const EcalRecHitCollection * recHitsEB = 0;
70  if (hitsEB.isValid()) recHitsEB = hitsEB.product();
71  bool flag = true;
72  if (debug) {
73  std::cout << "Inside eECALmatrix " << 2*ieta+1 << "X" << 2*iphi+1
74  << " nXtals " << vdets.size() << std::endl;
75  }
76 
77  double energySum = 0.0;
78  for (unsigned int i1=0; i1<vdets.size(); i1++) {
79  if (vdets[i1] != DetId(0)) {
80  double eTower = spr::energyECALTower(vdets[i1], hitsEB, hitsEE, ttMap, debug);
81  bool ok = true;
82  if (vdets[i1].subdetId()==EcalBarrel) ok = (eTower > ebThr);
83  else if (vdets[i1].subdetId()==EcalEndcap) ok = (eTower > eeThr);
84  if (debug) std::cout << "Crystal 0x" <<std::hex << vdets[i1]()
85  <<std::dec << " Flag " << ok;
86  if (ok) {
87  std::vector<EcalRecHitCollection::const_iterator> hit;
88  if (vdets[i1].subdetId()==EcalBarrel) {
89  spr::findHit(hitsEB,vdets[i1],hit,debug);
90  ok = (EcalSeverityLevelAlgo::severityLevel(vdets[i1], (*recHitsEB), chStatus) != EcalSeverityLevelAlgo::kWeird);
91  } else if (vdets[i1].subdetId()==EcalEndcap) {
92  spr::findHit(hitsEE,vdets[i1],hit,debug);
93  }
94  double ener=0;
95  for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
96  double en=0, tt=0;
97  if (vdets[i1].subdetId()==EcalBarrel) {
98  if (hit[ihit] != hitsEB->end()) {
99  en = hit[ihit]->energy();
100  tt = hit[ihit]->time();
101  }
102  } else if (vdets[i1].subdetId()==EcalEndcap) {
103  if (hit[ihit] != hitsEE->end()) {
104  en = hit[ihit]->energy();
105  tt = hit[ihit]->time();
106  }
107  }
108  if (debug) std::cout << " " << ihit << " E " << en << " T " << tt;
109  if (tt > tMin && tt < tMax) ener += en;
110  }
111  if (!ok) {
112  flag = false;
113  if (debug) std::cout << " detected to be a spike";
114  }
115  energySum += ener;
116  }
117  if (debug) std::cout << "\n";
118  }
119  }
120  if (debug) std::cout << "energyECAL: energySum = " << energySum << " flag = " << flag << std::endl;
121  return std::pair<double,bool>(energySum,flag);
122  }
long int flag
Definition: mlp_lapack.h:47
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
bool isValid() const
Definition: HandleBase.h:76
Definition: DetId.h:20
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
T const * product() const
Definition: Handle.h:74
tuple cout
Definition: gather_cfg.py:41
static int severityLevel(const DetId, const EcalRecHitCollection &, const EcalChannelStatus &, float recHitEtThreshold=5., SpikeId spId=kSwissCross, float spIdThreshold=0.95, float recHitEnergyThresholdForTiming=2., float recHitEnergyThresholdForEE=15, float spIdThresholdIEta85=0.999)
double energySum(const DataFrame &df, int fs, int ls)
#define debug
Definition: MEtoEDMFormat.h:34
double energyECALTower(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
template<typename T >
std::vector<std::pair<DetId,double> > spr::eECALmatrixCell ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
std::pair<double,int> spr::eECALmatrixTotal ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const CaloGeometry geo,
const CaloTopology caloTopology,
int  ieta,
int  iphi,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eECALSimInfo ( const edm::Event ,
CaloNavigator< DetId > &  navigator,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eECALSimInfo ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eECALSimInfo ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
void spr::eECALSimInfo ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
caloSimInfo &  info,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
energyMap spr::eECALSimInfoMatrix ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eECALSimInfoTotal ( const edm::Event ,
const DetId det,
const CaloGeometry geo,
const CaloTopology caloTopology,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
int  itry = -1,
double  timeCut = 150,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
bool  algoNew = true,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::eHCALmatrix ( const CaloGeometry geo,
const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
GlobalPoint gPosHotCell 
)
template<typename T >
double spr::eHCALmatrix ( const HcalTopology topology,
const DetId det0,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
int &  nRecHits,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene,
std::set< int > &  uniqueIdset 
)
template<typename T >
std::vector< std::pair< DetId,double> > spr::eHCALmatrixCell ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
std::pair<double,int> spr::eHCALmatrixTotal ( const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
int  ieta,
int  iphi,
bool  includeHO = false,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eHCALSimInfo ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::eHCALSimInfo ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
void spr::eHCALSimInfo ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
caloSimInfo &  info,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eHCALSimInfo ( const edm::Event iEvent,
const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
std::vector< int > &  multiplicityVector,
bool  debug = false 
)
template<typename T >
energyMap spr::eHCALSimInfoMatrix ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::map<std::string,double> spr::eHCALSimInfoTotal ( const edm::Event ,
const HcalTopology topology,
const DetId det,
const CaloGeometry geo,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
int  itry = -1,
double  timeCut = 150,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::vector<std::pair<DetId,double> > spr::energyDetIdHCAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hits,
double  hbThr = -100,
double  heThr = -100,
double  hfThr = -100,
double  hoThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyECAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
double spr::energyECAL ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const EcalTrigTowerConstituentsMap ttMap,
double  ebThr = -100,
double  eeThr = -100,
double  tMin = -500,
double  tMax = 500,
bool  debug = false 
)
template<typename T >
std::vector<std::pair<DetId,double> > spr::energyECALCell ( std::vector< DetId > &  vdets,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
double  ebThr = -100,
double  eeThr = -100,
bool  debug = false 
)
template<typename T >
double spr::energyECALTower ( const DetId detId,
edm::Handle< T > &  hitsEB,
edm::Handle< T > &  hitsEE,
const EcalTrigTowerConstituentsMap ttMap,
bool  debug = false 
)

Referenced by eECALmatrix().

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

Definition at line 904 of file MatrixECALDetIds.cc.

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

Referenced by matrixECALIds().

904  {
905 
906  if (det.subdetId() == EcalBarrel) {
907  EBDetId id = det;
908  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
909  << "|" << ietaE << " columns " << iphiS << "|"
910  << iphiN << std::endl;
911  int etaC = id.ietaAbs();
912  int phiC = id.iphi();
913  int zsid = id.zside();
914  for (int eta = -ietaW; eta <= ietaE; ++eta) {
915  for (int phi = -iphiS; phi <= iphiN; ++phi) {
916  int iphi = phiC+phi;
917  if (iphi < 0) iphi += 360;
918  else if (iphi > 360) iphi -= 360;
919  int ieta = zsid*(etaC+eta);
920  if (EBDetId::validDetId(ieta,iphi)) {
921  id = EBDetId(ieta,iphi);
922  if (barrelGeom.present(id)) {
923  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
924  cells.push_back((DetId)id);
925  }
926  }
927  }
928  }
929  }
930  } else if (det.subdetId() == EcalEndcap) {
931  EEDetId id = det;
932  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
933  << "|" << ietaE << " columns " << iphiS << "|"
934  << iphiN << std::endl;
935  int ixC = id.ix();
936  int iyC = id.iy();
937  int zsid = id.zside();
938  for (int kx = -ietaW; kx <= ietaE; ++kx) {
939  for (int ky = -iphiS; ky <= iphiN; ++ky) {
940  int ix = ixC+kx;
941  int iy = iyC+ky;
942  if (EEDetId::validDetId(ix,iy,zsid)) {
943  id = EEDetId(ix,iy,zsid);
944  if (endcapGeom.present(id)) {
945  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
946  cells.push_back((DetId)id);
947  }
948  }
949  }
950  }
951  }
952  }
953 
954  if (debug) {
955  std::cout << "extraIds:: finds " << cells.size() << " new cells"
956  << std::endl;
957  for (unsigned int i1=0; i1<cells.size(); ++i1) {
958  if (cells[i1].subdetId() == EcalBarrel) {
959  EBDetId id = cells[i1];
960  std::cout << "extraIds::Cell " << i1 << " " << id << std::endl;
961  } else if (cells[i1].subdetId() == EcalEndcap) {
962  EEDetId id = cells[i1];
963  std::cout << "ectraIds::Cell " << i1 << " " << id << std::endl;
964  } else {
965  std::cout << "extraIds::Cell " << i1 << " 0x" << std::hex
966  << cells[i1]() <<std::dec << " Unknown Type" <<std::endl;
967  }
968  }
969  }
970  }
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.cc:59
T eta() const
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
virtual bool present(const DetId &id) const
is this detid present in the geometry?
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
Definition: DDAxes.h:10
void spr::find ( edm::Handle< EcalRecHitCollection > &  hits,
DetId  thisDet,
std::vector< EcalRecHitCollection::const_iterator > &  hit,
bool  debug = false 
)

Definition at line 7 of file FindCaloHit.cc.

Referenced by BeautifulSoup.Tag::_invert(), ParticleDecayDrawer::accept(), ParticleTreeDrawer::accept(), HcalHitFilter::accepts(), DTVDriftCalibration::cellInfo::add(), Measurement::addAffectingEntriesFromOptO(), reco::NamedCompositeCandidate::addDaughter(), reco::CompositeCandidate::addDaughter(), CRackTrajectoryBuilder::AddHit(), CSCNeutronReader::addHits(), SimpleMetricsUpdator::additionalAlignables(), DummyMetricsUpdator::additionalAlignables(), DummyMetricsUpdator::additionalAlignablesWithDistances(), pat::TriggerEvent::addObjectMatchResult(), SiStripQualityHotStripIdentifier::algoAnalyze(), reco::Conversion::algoByName(), reco::TrackBase::algoByName(), SiStripMonitorTrack::AllClusters(), EcalMatacqAnalyzer::analyze(), RPCMonitorDigi::analyze(), EcalPnGraphs::analyze(), SiStripApvGainBuilderFromTag::analyze(), EcalDumpRaw::analyze(), DTT0Calibration::analyze(), DTT0CalibrationNew::analyze(), EBSummaryClient::analyze(), EESummaryClient::analyze(), EcalPerEvtLaserAnalyzer::analyze(), EcalABAnalyzer::analyze(), HcalQIEDataCheck::analyze(), ParticleListDrawer::analyze(), EBLaserClient::analyze(), EELedClient::analyze(), EELaserClient::analyze(), EBPedestalClient::analyze(), EBTestPulseClient::analyze(), EEPedestalClient::analyze(), EETestPulseClient::analyze(), HcalAutoPedestalValidator::analyze(), HcalCholeskyDecomp::analyze(), HcalPedestalWidthsCheck::analyze(), HcalPedestalsCheck::analyze(), edmtest::HcalDumpConditions::analyze(), EcalLaserAnalyzer2::analyze(), HLTAlCaMonPi0::analyze(), DQMSourcePi0::analyze(), EcalLaserAnalyzer::analyze(), HcalGainsCheck::analyze(), HeavyFlavorValidation::analyze(), TestTrackHits::analyze(), EcalURecHitHists::analyze(), HLTAlCa::analyze(), DTDigiTask::analyze(), TestOutliers::analyze(), EcalCosmicsHists::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(), GctFormatTranslateV35::blockToGctInternEmCand(), GctFormatTranslateV38::blockToGctInternEmCand(), GctFormatTranslateV35::blockToRctCaloRegions(), GctFormatTranslateV38::blockToRctCaloRegions(), edm::BMixingModule::BMixingModule(), CalibrationScanTask::book(), CalibrationTask::book(), SiStripFedCabling::buildFedCabling(), TtSemiLepHypMaxSumPtWMass::buildHypo(), SiStripDetVOffBuilder::buildPSUdetIdMap(), VirtualJetProducer::JetType::byName(), HLTEcalResonanceFilter::calcShowerShape(), PileUpSubtractor::calculateOrphanInput(), ValidationOptions_cfi::calledBycmsRun(), reco::modules::CandCombinerBase::CandCombinerBase(), CastorDbProducer::channelQualityCallback(), HcalDbProducer::channelQualityCallback(), MulticoreRunLumiEventChecker::check(), CSCDCCExaminer::check(), HLTOniaSource::checkHLTConfiguration(), Config::checkImportPermission(), Multi5x5ClusterAlgo::checkMaxima(), BlockFormatter::CleanUp(), EBLaserTask::cleanup(), EBPedestalTask::cleanup(), EELaserTask::cleanup(), EELedTask::cleanup(), EEPedestalTask::cleanup(), EETestPulseTask::cleanup(), EBTestPulseTask::cleanup(), egammaisolation::EgammaRecHitExtractor::collect(), HDQMInspectorConfigBase::computeIntegral(), HLTMonBitSummary::configSelector(), HCALConfigDB::connect(), FastFedCablingHistosUsingDb::connections(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::ConstrainedFitCandProducer(), helpers::contains(), HiHelperTools::contains(), Model::copyMeasurements(), createPayload::copyToWorkflowdir(), SiStripFecCabling::countDevices(), cms::HICFTSfromL1orL2::createFTSfromL1orL2(), ESFastTDigitizer::createNoisyList(), DDfetch(), ParticleDecayDrawer::decay(), gen::Pythia6Hadronizer::declareSpecialSettings(), Model::deleteOptO(), muonisolation::CaloExtractor::deposit(), SiStripFineDelayHit::detId(), TowerBlockFormatter::DigiToRaw(), SiPixelGainCalibrationAnalysis::doFits(), ThePEG::LesHouchesInterface::doReadEvent(), HLTEcalResonanceFilter::doSelection(), DTSegtoRPC::DTSegtoRPC(), RPCLinkSynchroStat::dumpDelays(), SiPixelActionExecutor::dumpEndcapModIds(), python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::dumpPython(), EcalBarrelMonitorClient::EcalBarrelMonitorClient(), EcalEndcapMonitorClient::EcalEndcapMonitorClient(), EcalPreshowerMonitorClient::EcalPreshowerMonitorClient(), EcalListOfFEDSProducer::Egamma(), ESListOfFEDSProducer::Egamma(), CastorDbProducer::electronicsMapCallback(), HcalDbProducer::electronicsMapCallback(), L1ScalersClient::endLuminosityBlock(), DTNoiseTest::endLuminosityBlock(), RPCDqmClient::endRun(), EELedTask::endRun(), GsfVertexTrackCompatibilityEstimator::estimate(), KalmanVertexTrackCompatibilityEstimator< N >::estimate(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), JetPlusTrackCorrector::excludeJta(), edm::ParameterSet::existsAs(), CompositeAlignmentParameters::extractAlignables(), CompositeAlignmentParameters::extractPositionAndLength(), CompositeAlignmentDerivativesExtractor::extractWithMultipleHits(), stor::ResourceMonitorCollection::failIfImportantDisk(), SiPixelFedCablingMap::fedIds(), VertexFitterResult::fill(), tnp::ProbeFlag::fill(), JetPartonMatcher::fillAlgoritDefinition(), SiPixelActionExecutor::fillFEDErrorSummary(), PhysicsTools::MVATrainer::fillInputVars(), MuonMesh::fillMesh(), SiPixelInformationExtractor::fillModuleAndHistoList(), JetPartonMatcher::fillPhysicsDefinition(), MuonAnalyzerSBSM::FillPlots(), CastorShowerLibraryMaker::FillShowerEvent(), SiPixelActionExecutor::fillSummary(), HLTMuonTrackMassFilter::filter(), HLTMuonL2PreFilter::filter(), HLTMuonL1RegionalFilter::filter(), HLTMuonL1Filter::filter(), SiStripCommissioningRunTypeFilter::filter(), HltComparator::filter(), ErrorSummaryFilter::filter(), LogErrorFilter::filter(), HLTHcalSimpleRecHitFilter::filter(), EcalSimpleUncalibRecHitFilter::filter(), EcalMIPRecHitFilter::filter(), HLTEcalResonanceFilter::filter(), HLTPi0RecHitsFilter::filter(), TTUTrackingAlg::filter(), commentSkipper.buildFileCommentSkipper::filterMultilineComment(), commentSkipper.buildFileCommentSkipper::filterOneLineComment(), MuonSeedOrcaPatternRecognition::filterOverlappingChambers(), find(), FourVectorHLT::PathInfoCollection::find(), edm::Trie< T >::find(), HLTJetMETDQMSource::PathInfoCollection::find(), JetMETHLTOfflineSource::PathInfoCollection::find(), FourVectorHLTOnline::PathInfoCollection::find(), TrigResRateMon::PathInfoCollection::find(), FourVectorHLTriggerOffline::PathInfoCollection::find(), FourVectorHLTOffline::PathInfoCollection::find(), edm::find_in_all(), DTCombinatorialExtendedPatternReco::findCompatibleHits(), SiStripPsuDetIdMap::findDcuIdFromDeviceAddress(), python.Vispa.Main.Application.Application::findEvent(), JetCorrectorParametersCollection::findKey(), MSLayersAtAngle::findLayer(), linker::findMatchingFiles(), HLTPerformanceInfo::findModule(), HLTPerformanceInfo::findPath(), JetPlusTrackCorrector::findTrack(), EcalTBReadout::findTTlist(), cond::BlobStreamingService::findVariant(), edm::IndexIntoFile::fixIndexes(), HcalDQMChannelQuality::flagAlgo(), XtoFFbarFilter::found(), getRunInfo::Func_FillInfoDBS(), getRunInfo::Func_FillInfoRunRegistry(), CastorDbProducer::gainsCallback(), HcalDbProducer::gainsCallback(), CastorDbProducer::gainWidthsCallback(), HcalDbProducer::gainWidthsCallback(), SubsystemNeutronReader::generateChamberNoise(), pat::PATGenCandsFromSimTracksProducer::generatorRef_(), GenJetParticleSelector::GenJetParticleSelector(), VertexClassifier::genPrimaryVertices(), TrackClassifier::genPrimaryVertices(), harvestRelVal::get_cond_from_dsetpath(), EcalSelectiveReadoutProducer::getBinOfMax(), ComponentFactoryByName< B >::getBuilder(), PhysicsTools::MVATrainer::getCalibration(), CastorCalibrationsSet::getCalibrations(), HcalCalibrationsSet::getCalibrations(), HcalCalibrationWidthsSet::getCalibrationWidths(), CastorCalibrationWidthsSet::getCalibrationWidths(), python.generateWrappers::getClasses(), hcalCalib::GetCoefFromMtrxInvOfAve(), HcalLutManager::getCompressionLutXmlFromAsciiMaster(), HcalLutManager::getCompressionLutXmlFromCoder(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), HLTScalersClient::CountLSFifo_t::getCount(), EcalElectronicsMapping::getDetId(), TrackAssociatorByHits::getDoubleCount(), EcalElectronicsMapping::getElectronicsId(), SiPixelActionExecutor::getFEDSummaryME(), SiPixelActionExecutor::getGrandSummaryME(), pat::PATObject< ObjectType >::getKinResolution(), JetCorrectorParametersCollection::getL5Bin(), JetCorrectorParametersCollection::getL7Bin(), BeamSpotWorkflow::getLastUploadedIOV(), HcalLutManager::getLinearizationLutXmlFromAsciiMasterEmap(), HcalLutManager::getLinearizationLutXmlFromCoder(), HcalLutManager::getLinearizationLutXmlFromCoderEmap(), BeamSpotWorkflow::getListOfRunsAndLumiFromDBS(), HcalLutManager::getLutFromXml_old(), HcalLutManager::getLutXmlFromAsciiMaster(), LMFCorrCoefDat::getParameters(), SiStripSummary::getPosition(), HDQMSummary::getPosition(), TrackAssociatorByHits::getShared(), PrimaryVertexAnalyzer::getSimPVs(), PrimaryVertexAnalyzer4PU::getSimPVs(), SiPixelInformationExtractor::getSingleModuleHistos(), EgammaRecHitIsolation::getSum_(), SiPixelActionExecutor::getSummaryME(), EcalElectronicsMapping::getTriggerElectronicsId(), checkPayloads::getUploadedIOVs(), 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(), include(), pat::TriggerPath::indexModule(), SiTrivialInduceChargeOnStrips::indexOf(), MSLayersKeeperX0Averaged::init(), EcalEndcapRecHitsMaker::init(), crabWrap::initCrabEnvironment(), SiStripDetKey::initFromPath(), SiStripFecKey::initFromPath(), SiStripFedKey::initFromPath(), HLTMuonValidator::initializeHists(), HBHEHitMap::insert(), MuonHOAcceptance::isChannelDead(), MuonHOAcceptance::isChannelSiPM(), 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(), CommonMethods::ls(), HcalDbProducer::LUTCorrsCallback(), HcalDbProducer::lutMetadataCallback(), Multi5x5ClusterAlgo::mainSearch(), reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >::make(), RPCDqmClient::makeClientMap(), 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(), StatusSelector::operator()(), PdgIdSelector::operator()(), PdgIdExcluder::operator()(), rpcrawtodigi::DebugDigisPrintout::operator()(), RecoTrackSelector::operator()(), ReadMapType< std::map< std::string, double > >::operator[](), edm::DetSetLazyVector< T >::operator[](), edm::DetSetVector< T >::operator[](), edm::DetSetRefVector< T, C >::operator[](), TransientVertex::originalTrack(), JetMatchingTools::overlapEnergyFraction(), pat::PATObject< ObjectType >::overlaps(), AlpgenHeader::parameterName(), AlpgenHeader::parse(), Args::parse(), SiStripDbParams::partitionNames(), CastorDbProducer::pedestalsCallback(), HcalDbProducer::pedestalsCallback(), CastorDbProducer::pedestalWidthsCallback(), HcalDbProducer::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(), DDLNumeric::processElement(), DDLString::processElement(), InterestingEcalDetIdProducer::produce(), QuarkoniaTrackSelector::produce(), MCTrackMatcher::produce(), TtDilepEvtSolutionMaker::produce(), EcalListOfFEDSProducer::produce(), ESListOfFEDSProducer::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), GenTrackMatcher::produce(), EcalTPSkimmer::produce(), EgammaHLTElectronCombinedIsolationProducer::produce(), EgammaHLTCombinedIsolationProducer::produce(), InterestingDetIdCollectionProducer::produce(), ReducedRecHitCollectionProducer::produce(), LaserAlignmentT0Producer::produce(), EleIsoDetIdCollectionProducer::produce(), GamIsoDetIdCollectionProducer::produce(), pat::GenPlusSimParticleProducer::produce(), pat::PATJetProducer::produce(), EcalRawToDigi::produce(), L1Comparator::produce(), CaloTowersMerger::produce(), ConvBremSeedProducer::produce(), InterestingTrackEcalDetIdProducer::produce(), AlCaElectronsProducer::produce(), HighPtTrackEcalDetIdProducer::produce(), FlavorHistoryProducer::produce(), SecondaryVertexProducer::produce(), LaserAlignment::produce(), ProfilerService::ProfilerService(), SiStripDbParams::pset(), CastorDbProducer::QIEDataCallback(), HcalDbProducer::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(), TransientVertex::refittedTrack(), ora::PoolDbCache::remove(), HPSPFRecoTauAlgorithm::removeCandidateFromRefVector(), SiPixelDisabledModules::removeDisabledModule(), lhef::LHEEvent::removeResonances(), DDI::LogicalPart::removeSpecifics(), edm::TransientProductLookupMap::reorderIfNecessary(), EETestPulseTask::reset(), EELaserTask::reset(), EBPedestalTask::reset(), EEPedestalTask::reset(), EBLaserTask::reset(), EBTestPulseTask::reset(), HcalDbProducer::respCorrsCallback(), PerformancePayloadFromTFormula::resultPos(), PerformancePayloadFromTable::resultPos(), EcalRecHitWorkerSimple::run(), ESFastTDigitizer::run(), JetMETHLTOfflineClient::runClient_(), DTLocalTriggerTPTest::runClientDiagnostic(), DTLocalTriggerTest::runClientDiagnostic(), DTLocalTriggerLutTest::runClientDiagnostic(), DTTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerEfficiencyTest::runClientDiagnostic(), DTLocalTriggerTask::runDDUvsDCCAnalysis(), L1MuDTEtaProcessor::runEtaMatchingUnit(), edm::search_all(), reco::FlavorHistorySelectorUtil::select(), EcalMipGraphs::selectHits(), EcalDisplaysByEvent::selectHits(), AlignmentParameterStore::selectParameters(), CastorCalibrationsSet::setCalibrations(), HcalCalibrationsSet::setCalibrations(), HcalCalibrationWidthsSet::setCalibrationWidths(), CastorCalibrationWidthsSet::setCalibrationWidths(), RBCProcessRPCDigis::setDigiAt(), RBCProcessRPCSimDigis::setDigiAt(), GlobalOptionMgr::setGlobalOption(), pat::PATObject< ObjectType >::setKinResolution(), PFConversionAlgo::setLinks(), pat::PATObject< ObjectType >::setOverlaps(), EcalFenixFgvbEB::setParameters(), DDLSolid::setReference(), EELaserTask::setup(), EEPedestalTask::setup(), EBLaserTask::setup(), EELedTask::setup(), EETestPulseTask::setup(), EBPedestalTask::setup(), EBTestPulseTask::setup(), EBSummaryClient::setup(), EESummaryClient::setup(), EELaserClient::setup(), EBLaserClient::setup(), EELedClient::setup(), EBTestPulseClient::setup(), EETestPulseClient::setup(), EBPedestalClient::setup(), EEPedestalClient::setup(), egHLT::OffHelper::setupTriggers(), HcalSimParameterMap::simParameters(), SiStripFedIdListReader::SiStripFedIdListReader(), CRackTrajectoryBuilder::SortHits(), CMSMidpointAlgorithm::splitAndMerge(), sumSmallDepths(), evf::FUEventProcessor::supervisor(), pat::Jet::tagInfo(), cond::TBufferBlobTypeInfo::TBufferBlobTypeInfo(), HcalLutManager::test_emap(), HcalDbProducer::timeCorrsCallback(), PasswordReader::tokenize(), EcalSRCondTools::tokenize(), jetTools.AddJetCollection::toolCode(), cmsswVersionTools.AddJetCollection35X::toolCode(), HistoryBase::traceSimHistory(), TrackParameterAnalyzer::TrackParameterAnalyzer(), QcdUeDQM::trackSelection(), TransientVertex::trackWeight(), pat::TriggerEvent::triggerObjectMatchResult(), MSLayersAtAngle::update(), SimpleMetricsUpdator::update(), DummyMetricsUpdator::update(), PedestalsHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), LatencyHistosUsingDb::update(), FineDelayHistosUsingDb::update(), KalmanVertexUpdator< N >::update(), HLTScalersClient::CountLSFifo_t::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(), CSCValHists::writeHists(), L1GtPatternWriter::writePatterns(), CSCGasCollisions::writeSummary(), HcalDbProducer::zsThresholdsCallback(), and DDLElementRegistry::~DDLElementRegistry().

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

Definition at line 12 of file FindCaloHit.cc.

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

Definition at line 17 of file FindCaloHit.cc.

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

Definition at line 9 of file FindCaloHitCone.cc.

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

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

Definition at line 34 of file FindCaloHitCone.cc.

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

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

Definition at line 86 of file FindCaloHitCone.cc.

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

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

Definition at line 100 of file FindCaloHitCone.cc.

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

100  {
101 
102  std::vector<edm::PCaloHitContainer::const_iterator> hit;
103  edm::PCaloHitContainer::const_iterator ihit;
104  for (ihit=hits->begin(); ihit!=hits->end(); ihit++) {
105  DetId detId(ihit->id());
106  const GlobalPoint rechitPoint = geo->getPosition(detId);
107  if (getDistInPlaneTrackDir(hpoint1, trackMom, rechitPoint)<dR) {
108  hit.push_back(ihit);
109  }
110  }
111  return hit;
112  }
double getDistInPlaneTrackDir(const GlobalPoint caloPoint, const GlobalVector caloVector, const GlobalPoint rechitPoint)
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
Definition: DetId.h:20
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().

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

Definition at line 11 of file DetIdFromEtaPhi.cc.

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

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

Definition at line 27 of file DetIdFromEtaPhi.cc.

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

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

Referenced by eECALmatrix().

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

Definition at line 35 of file FindDistCone.cc.

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

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

Definition at line 53 of file FindDistCone.cc.

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

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

Definition at line 8 of file FindDistCone.cc.

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

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

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

Definition at line 129 of file FindDistCone.cc.

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

Definition at line 137 of file FindDistCone.cc.

References HcalBarrel, and HcalEndcap.

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

Definition at line 6 of file FindEtaPhi.cc.

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

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

Definition at line 72 of file FindDistCone.cc.

72  {
73 
74  RH_ieta.push_back(hit->id().ieta());
75  RH_iphi.push_back(hit->id().iphi());
76  RH_ene.push_back(hit->energy());
77  }
unsigned int id
void spr::getEtaPhi ( edm::PCaloHitContainer::const_iterator  hit,
std::vector< int > &  RH_ieta,
std::vector< int > &  RH_iphi,
std::vector< double > &  RH_ene 
)

Definition at line 79 of file FindDistCone.cc.

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

Definition at line 93 of file FindDistCone.cc.

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

Definition at line 98 of file FindDistCone.cc.

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

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

Definition at line 155 of file FindDistCone.cc.

References CaloGeometry::getPosition().

155  {
156  DetId detId(hit->id());
157  return geo->getPosition(detId);
158  }
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
unsigned int id
Definition: DetId.h:20
GlobalPoint spr::getGpos ( const CaloGeometry geo,
edm::PCaloHitContainer::const_iterator  hit 
)

Definition at line 160 of file FindDistCone.cc.

References CaloGeometry::getPosition().

160  {
161  DetId detId(hit->id());
162  return geo->getPosition(detId);
163  }
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
unsigned int id
Definition: DetId.h:20
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::propagateTracks().

8  {
9 
10  bool select = pTrack->quality(parameters.minQuality);
11  double dxy = pTrack->dxy(leadPV);
12  double dz = pTrack->dz(leadPV);
13  double dpbyp = 999;
14  if (std::abs(pTrack->qoverp()) > 0.0000001)
15  dpbyp = std::abs(pTrack->qoverpError()/pTrack->qoverp());
16 
17  if (debug) std::cout << "Track:: Pt " << pTrack->pt() << " dxy " << dxy << " dz " << dz << " Chi2 " << pTrack->normalizedChi2() << " dpbyp " << dpbyp << " Quality " << select << std::endl;
18 
19  if (pTrack->pt() < parameters.minPt) select = false;
20  if (dxy > parameters.maxDxyPV || dz > parameters.maxDzPV) select = false;
21  if (pTrack->normalizedChi2() > parameters.maxChi2) select = false;
22  if (dpbyp > parameters.maxDpOverP) select = false;
23 
24  if (parameters.minLayerCrossed>0 || parameters.minOuterHit>0) {
25  const reco::HitPattern& hitp = pTrack->hitPattern();
26  if (parameters.minLayerCrossed>0 && hitp.trackerLayersWithMeasurement() < parameters.minLayerCrossed) select = false;
27  if (parameters.minOuterHit>0 && (hitp.stripTOBLayersWithMeasurement()+hitp.stripTECLayersWithMeasurement() ) < parameters.minOuterHit) select = false;
28  if (debug) {
29  std::cout << "Default Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
30  for (int i=0; i<hitp.numberOfHits(); i++)
32  }
33  }
34  if (parameters.maxInMiss >= 0) {
35  const reco::HitPattern& hitp = pTrack->trackerExpectedHitsInner();
36  if (hitp.trackerLayersWithoutMeasurement() > parameters.maxInMiss) select = false;
37  if (debug) {
38  std::cout << "Inner Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
39  for (int i=0; i<hitp.numberOfHits(); i++)
41  }
42  }
43  if (parameters.maxOutMiss >= 0) {
44  const reco::HitPattern& hitp = pTrack->trackerExpectedHitsOuter();
45  if (hitp.trackerLayersWithoutMeasurement() > parameters.maxOutMiss) select = false;
46  if (debug) {
47  std::cout << "Outer Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
48  for (int i=0; i<hitp.numberOfHits(); i++)
50  }
51  }
52  if (debug) std::cout << "Final Selection Result " << select << std::endl;
53 
54  return select;
55  }
double qoverp() const
q/p
Definition: TrackBase.h:114
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:913
int i
Definition: DBlmapReader.cc:9
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:110
#define abs(x)
Definition: mlp_lapack.h:159
int trackerLayersWithoutMeasurement() const
Definition: HitPattern.cc:931
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:860
const HitPattern & trackerExpectedHitsOuter() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers after the last...
Definition: TrackBase.h:220
double pt() const
track transverse momentum
Definition: TrackBase.h:130
int numberOfHits() const
Definition: HitPattern.cc:312
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
Definition: TrackBase.h:218
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:216
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:185
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:126
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:348
reco::TrackBase::TrackQuality minQuality
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:922
tuple cout
Definition: gather_cfg.py:41
void printHitPattern(int position, std::ostream &stream) const
Definition: HitPattern.cc:1144
#define debug
Definition: MEtoEDMFormat.h:34
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:120
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().

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

Definition at line 72 of file MatchingSimTrack.cc.

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

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

Definition at line 90 of file MatchingSimTrack.cc.

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

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

Definition at line 11 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(), and matrixECALIds().

13  {
14 
15  const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
16  const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
17  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
18  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
19 
20  if (debug) {
21  std::cout << "matrixECALIds::Add " << ieta << " rows and " << iphi
22  << " columns of cells for 1 cell" << std::endl;
23  if (det.subdetId() == EcalBarrel) {
24  EBDetId id = det;
25  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
26  << " " << id << std::endl;
27  } else if (det.subdetId() == EcalEndcap) {
28  EEDetId id = det;
29  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
30  << " " << id << std::endl;
31  } else {
32  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
33  << " Unknown Type" << std::endl;
34  }
35  }
36 
37  std::vector<DetId> dets(1,det);
38  std::vector<CaloDirection> dirs(1,NORTH);
39  vdets = spr::newECALIdNS(dets, 0, ieta,iphi, dirs, *barrelTopo,*endcapTopo,
40  *barrelGeom,*endcapGeom,debug);
41  dirs[0] = SOUTH;
42  std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, ieta, iphi, dirs,
43  *barrelTopo,*endcapTopo,
44  *barrelGeom,*endcapGeom,debug);
45  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
46  if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
47  vdets.push_back(vdetS[i1]);
48  }
49  unsigned int ndet = (2*ieta+1)*(2*iphi+1);
50  if (vdets.size() != ndet) {
51  std::vector<DetId> vdetExtra;
52  spr::extraIds(det, vdets, ieta, ieta, iphi, iphi,
53  *barrelGeom, *endcapGeom, vdetExtra, debug);
54  if (vdetExtra.size() > 0)
55  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
56  }
57 
58  if (debug) {
59  std::cout << "matrixECALIds::Total number of cells found is "
60  << vdets.size() << std::endl;
61  for (unsigned int i1=0; i1<vdets.size(); i1++) {
62  if (vdets[i1].subdetId() == EcalBarrel) {
63  EBDetId id = vdets[i1];
64  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
65  << vdets[i1]() << std::dec << " " << id << std::endl;
66  } else if (vdets[i1].subdetId() == EcalEndcap) {
67  EEDetId id = vdets[i1];
68  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
69  << vdets[i1]() << std::dec << " " << id << std::endl;
70  } else {
71  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
72  << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
73  }
74  }
75  }
76  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
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)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
std::vector< DetId > spr::matrixECALIds ( const DetId det,
int  ieta,
int  iphi,
const CaloGeometry geo,
const CaloTopology caloTopology,
bool  debug = false 
)

Definition at line 78 of file MatrixECALDetIds.cc.

References matrixECALIds().

81  {
82 
83  std::vector<DetId> vdets;
84  matrixECALIds(det, ieta, iphi, geo, caloTopology, vdets, debug);
85  return vdets;
86  }
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
#define debug
Definition: MEtoEDMFormat.h:34
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 88 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().

90  {
91 
92  const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
93  const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
94  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
95  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
96 
97  if (debug) {
98  std::cout << "matrixECALIds::Add " << ietaE << "|" << ietaW
99  << " rows and " << iphiN << "|" << iphiS
100  << " columns of cells for 1 cell" << std::endl;
101  if (det.subdetId() == EcalBarrel) {
102  EBDetId id = det;
103  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
104  << " " << id << std::endl;
105  } else if (det.subdetId() == EcalEndcap) {
106  EEDetId id = det;
107  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
108  << " " << id << std::endl;
109  } else {
110  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
111  << " Unknown Type" << std::endl;
112  }
113  }
114 
115  std::vector<DetId> dets(1,det);
116  std::vector<CaloDirection> dirs(1,NORTH);
117  std::vector<int> jetaE(1,ietaE), jetaW(1,ietaW);
118  std::vector<int> jphiN(1,iphiN), jphiS(1,iphiS);
119  vdets = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN, jphiS, dirs,
120  *barrelTopo, *endcapTopo, *barrelGeom,
121  *endcapGeom, debug);
122  dirs[0] = SOUTH;
123  std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN,
124  jphiS, dirs, *barrelTopo,
125  *endcapTopo, *barrelGeom,
126  *endcapGeom, debug);
127  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
128  if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
129  vdets.push_back(vdetS[i1]);
130  }
131 
132  unsigned int ndet = (ietaE+ietaW+1)*(iphiN+iphiS+1);
133  if (vdets.size() != ndet) {
134  std::vector<DetId> vdetExtra;
135  spr::extraIds(det, vdets, ietaE, ietaW, iphiN, iphiS,
136  *barrelGeom, *endcapGeom, vdetExtra, debug);
137  if (vdetExtra.size() > 0)
138  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
139  }
140 
141  if (debug) {
142  std::cout << "matrixECALIds::Total number of cells found is "
143  << vdets.size() << std::endl;
144  for (unsigned int i1=0; i1<vdets.size(); i1++) {
145  if (vdets[i1].subdetId() == EcalBarrel) {
146  EBDetId id = vdets[i1];
147  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
148  << vdets[i1]() << std::dec << " " << id << std::endl;
149  } else if (vdets[i1].subdetId() == EcalEndcap) {
150  EEDetId id = vdets[i1];
151  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
152  << vdets[i1]() << std::dec << " " << id << std::endl;
153  } else {
154  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
155  << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
156  }
157  }
158  }
159  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
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)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
std::vector< DetId > spr::matrixECALIds ( const DetId det,
int  ietaE,
int  ietaW,
int  iphiN,
int  iphiS,
const CaloGeometry geo,
const CaloTopology caloTopology,
bool  debug = false 
)

Definition at line 161 of file MatrixECALDetIds.cc.

References matrixECALIds().

165  {
166 
167  std::vector<DetId> vdets;
168  spr::matrixECALIds(det, ietaE, ietaW, iphiN, iphiS, geo, caloTopology,
169  vdets, debug);
170  return vdets;
171  }
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
#define debug
Definition: MEtoEDMFormat.h:34
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 10 of file MatrixHCALDetIds.cc.

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

Referenced by chargeIsolationHcal().

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

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

50  {
51 
52  if (debug) {
53  std::cout << "matrixHCALIds::Add " <<ietaE << "|" <<ietaW << " rows and "
54  << iphiN << "|" << iphiS << " columns of cells for "
55  << dets.size() << " cells" << std::endl;
56  for (unsigned int i1=0; i1<dets.size(); i1++) {
57  HcalDetId id = HcalDetId(dets[i1]());
58  std::cout << "matrixHCALIds::Cell " << i1 << " 0x" << std::hex
59  << id.rawId() << std::dec << " " << id << std::endl;
60  }
61  }
62 
63  std::vector<DetId> vdetN = spr::newHCALIdNS(dets, 0, topology, true, ietaE,
64  ietaW, iphiN, iphiS, debug);
65  std::vector<DetId> vdetS = spr::newHCALIdNS(dets, 0, topology, false,ietaE,
66  ietaW, iphiN, iphiS, debug);
67  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
68  if (std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
69  vdetN.push_back(vdetS[i1]);
70  }
71 
72  vdetS = spr::matrixHCALIdsDepth(vdetN, topology, includeHO, debug);
73 
74  if (debug) {
75  std::cout << "matrixHCALIds::Total number of cells found is "
76  << vdetS.size() << std::endl;
77  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
78  HcalDetId id = HcalDetId(vdetS[i1]());
79  std::cout << "matrixHCALIds::Cell " << i1 << " " << id << std::endl;
80  }
81  }
82  return vdetS;
83  }
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > spr::matrixHCALIdsDepth ( std::vector< DetId > &  dets,
const HcalTopology topology,
bool  includeHO = false,
bool  debug = false 
)

Definition at line 385 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds().

387  {
388 
389  if (debug) {
390  std::cout << "matrixHCALIdsDepth::Add cells with higher depths with HO"
391  << "Flag set to " << includeHO << " to existing "
392  << dets.size() << " cells" << std::endl;
393  for (unsigned int i1=0; i1<dets.size(); i1++) {
394  HcalDetId id = HcalDetId(dets[i1]());
395  std::cout << "matrixHCALIdsDepth::Cell " << i1 << " " <<id <<std::endl;
396  }
397  }
398 
399  std::vector<DetId> vdets(dets);
400  for (unsigned int i1=0; i1<dets.size(); i1++) {
401  HcalDetId vdet = dets[i1];
402  for (int idepth = 0; idepth < 3; idepth++) {
403  std::vector<DetId> vUpDetId = topology->up(vdet);
404  if (vUpDetId.size() != 0) {
405  if (includeHO || vUpDetId[0].subdetId() != (int)(HcalOuter)) {
406  int n = std::count(vdets.begin(),vdets.end(),vUpDetId[0]);
407  if (n == 0) {
408  if (debug) std::cout << "matrixHCALIdsDepth:: Depth " << idepth << " " << vdet << " " << (HcalDetId)vUpDetId[0] << std::endl;
409  vdets.push_back(vUpDetId[0]);
410  }
411  }
412  vdet = vUpDetId[0];
413  }
414  }
415  }
416 
417  if (debug) {
418  std::cout << "matrixHCALIdsDepth::Final list contains " << vdets.size()
419  << " cells" << std::endl;
420  for (unsigned int i1=0; i1<vdets.size(); i1++) {
421  HcalDetId id = HcalDetId(vdets[i1]());
422  std::cout << "matrixHCALIdsDepth::Cell " << i1 << " " <<id <<std::endl;
423  }
424  }
425  return vdets;
426  }
virtual std::vector< DetId > up(const DetId &id) const
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
template<typename T >
std::vector<typename T::const_iterator> spr::missedCaloHits ( edm::Handle< T > &  hits,
std::vector< int >  matchedId,
std::vector< typename T::const_iterator >  caloHits,
bool  flag,
bool  includeHO = false,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::missedECALHits ( const edm::Event ,
CaloNavigator< DetId > &  navigator,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
bool  flag,
bool  debug = false 
)
template<typename T >
std::vector<typename T::const_iterator> spr::missedHCALHits ( const edm::Event ,
const HcalTopology topology,
const DetId det,
edm::Handle< T > &  hits,
edm::Handle< edm::SimTrackContainer > &  SimTk,
edm::Handle< edm::SimVertexContainer > &  SimVtx,
const reco::Track pTrack,
TrackerHitAssociator associate,
int  ieta,
int  iphi,
bool  flag,
bool  includeHO = false,
bool  debug = false 
)
std::vector< DetId > spr::newECALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
int  ieta,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false 
)

Definition at line 596 of file MatrixECALDetIds.cc.

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

Referenced by newECALIdEW(), and newECALIdNS().

602  {
603 
604  if (debug) {
605  std::cout << "newECALIdEW::Add " << ieta << " rows of cells for "
606  << last << ":" << dets.size() << ":" << (dets.size()-last)
607  << " cells" << std::endl;
608  for (unsigned int i1=last; i1<dets.size(); i1++) {
609  if (dets[i1].subdetId() == EcalBarrel) {
610  EBDetId id = dets[i1];
611  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
612  << dir[i1] << std::endl;
613  } else if (dets[i1].subdetId() == EcalEndcap) {
614  EEDetId id = dets[i1];
615  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
616  << dir[i1] << std::endl;
617  } else {
618  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
619  << dets[i1]() << std::dec << " Unknown Type along "
620  << dir[i1] << std::endl;
621  }
622  }
623  }
624 
625  std::vector<DetId> vdets; vdets.clear();
626  std::vector<CaloDirection> dirs; dirs.clear();
627  vdets.insert(vdets.end(), dets.begin(), dets.end());
628  dirs.insert(dirs.end(), dir.begin(), dir.end());
629 
630  if (ieta > 0) {
631  for (unsigned int i1=last; i1<dets.size(); i1++) {
632  int flag = 0;
633  std::vector<DetId> cells;
634  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
635  barrelGeom, endcapGeom, cells, flag, debug);
636  /*
637  if (dets[i1].subdetId() == EcalBarrel) {
638  EBDetId id = dets[i1];
639  std::cout << "Moved Cell " << i1 << " " << id << " along "
640  << dir[i1] << std::endl;
641  } else if (dets[i1].subdetId() == EcalEndcap) {
642  EEDetId id = dets[i1];
643  std::cout << "Moved Cell " << i1 << " " << id << " along "
644  << dir[i1] << std::endl;
645  } else {
646  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
647  << dets[i1]() << std::dec << " Unknown Type along "
648  << dir[i1] << std::endl;
649  }
650  for (unsigned int kk=0; kk<cells.size(); kk++) {
651  if (cells[kk].subdetId() == EcalBarrel) {
652  EBDetId id = cells[kk];
653  std::cout << "Moved to " << id << " flag " << flag << "\n";
654  } else if (cells[kk].subdetId() == EcalEndcap) {
655  EEDetId id = cells[kk];
656  std::cout << "Moved to " << id << " flag " << flag << "\n";
657  } else {
658  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
659  << cells[kk]() << std::dec << " Unknown Type flag "
660  << flag << std::endl;
661  }
662  }
663  */
664  if (flag != 0) {
665  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
666  CaloDirection dirn = dir[i1];
667  if (flag < 0) {
668  if (dirn == EAST) dirn = WEST;
669  else dirn = EAST;
670  }
671  vdets.push_back(cells[0]);
672  dirs.push_back(dirn);
673  }
674  }
675  }
676  ieta--;
677  }
678 
679  if (debug) {
680  std::cout << "newECALIdEW::Addition results a set of "
681  << (vdets.size()-dets.size()) << " new cells" << std::endl;
682  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
683  if (vdets[i1].subdetId() == EcalBarrel) {
684  EBDetId id = vdets[i1];
685  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
686  << dirs[i1] << std::endl;
687  } else if (vdets[i1].subdetId() == EcalEndcap) {
688  EEDetId id = vdets[i1];
689  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
690  << dirs[i1] << std::endl;
691  } else {
692  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
693  << vdets[i1]() << std::dec << " Unknown Type along "
694  << dirs[i1] << std::endl;
695  }
696  }
697  }
698 
699  if (ieta > 0) {
700  last = dets.size();
701  return spr::newECALIdEW(vdets,last,ieta,dirs,barrelTopo,endcapTopo,barrelGeom,endcapGeom,debug);
702  } else {
703  if (debug) {
704  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
705  << " cells" << std::endl;
706  for (unsigned int i1=0; i1<vdets.size(); i1++) {
707  if (vdets[i1].subdetId() == EcalBarrel) {
708  EBDetId id = vdets[i1];
709  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
710  } else if (vdets[i1].subdetId() == EcalEndcap) {
711  EEDetId id = vdets[i1];
712  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
713  } else {
714  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
715  << vdets[i1]() <<std::dec << " Unknown Type" <<std::endl;
716  }
717  }
718  }
719  return vdets;
720  }
721  }
long int flag
Definition: mlp_lapack.h:47
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
tuple cout
Definition: gather_cfg.py:41
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
#define debug
Definition: MEtoEDMFormat.h:34
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 723 of file MatrixECALDetIds.cc.

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

731  {
732 
733  if (debug) {
734  std::cout << "newECALIdEW::Add " << ietaE[0] << "|" << ietaW[0]
735  << " rows of cells for " << (dets.size()-last)
736  << " cells (last " << last << ")" << std::endl;
737  for (unsigned int i1=last; i1<dets.size(); i1++) {
738  if (dets[i1].subdetId() == EcalBarrel) {
739  EBDetId id = dets[i1];
740  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
741  << dir[i1] << std::endl;
742  } else if (dets[i1].subdetId() == EcalEndcap) {
743  EEDetId id = dets[i1];
744  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
745  << dir[i1] << std::endl;
746  } else {
747  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
748  << dets[i1]() << std::dec << " Unknown Type along "
749  << dir[i1] << std::endl;
750  }
751  }
752  }
753 
754  std::vector<DetId> vdets;
755  vdets.insert(vdets.end(), dets.begin(), dets.end());
756  std::vector<CaloDirection> dirs;
757  dirs.insert(dirs.end(), dir.begin(), dir.end());
758  std::vector<int> jetaE, jetaW;
759  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
760  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
761  int keta = 0;
762  for (unsigned int i1=last; i1<dets.size(); i1++) {
763  int ieta = ietaW[i1];
764  if (dir[i1] == EAST) ieta = ietaE[i1];
765  if (ieta > 0) {
766  int flag=0;
767  std::vector<DetId> cells;
768  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
769  barrelGeom, endcapGeom, cells, flag, debug);
770  ieta--;
771  if (ieta > keta) keta = ieta;
772  if (dir[i1] == EAST) jetaE[i1] = ieta;
773  else jetaW[i1] = ieta;
774  if (flag != 0) {
775  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
776  vdets.push_back(cells[0]);
777  CaloDirection dirn = dir[i1];
778  int ketaE = ietaE[i1];
779  int ketaW = ietaW[i1];
780  if (dirn == EAST) ketaE = ieta;
781  else ketaW = ieta;
782  if (flag < 0) {
783  int ktmp = ketaW; ketaW = ketaE; ketaE = ktmp;
784  if (dirn == EAST) dirn = WEST;
785  else dirn = EAST;
786  }
787  dirs.push_back(dirn);
788  jetaE.push_back(ketaE);
789  jetaW.push_back(ketaW);
790  }
791  }
792  }
793  }
794 
795  if (debug) {
796  std::cout << "newECALIdEW::Addition results a set of "
797  << (vdets.size()-dets.size()) << " new cells (last "
798  << dets.size() << ", ieta " << keta << ")" << std::endl;
799  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
800  if (vdets[i1].subdetId() == EcalBarrel) {
801  EBDetId id = vdets[i1];
802  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
803  } else if (vdets[i1].subdetId() == EcalEndcap) {
804  EEDetId id = vdets[i1];
805  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
806  } else {
807  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
808  << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
809  }
810  }
811  }
812 
813  if (keta > 0) {
814  last = dets.size();
815  return spr::newECALIdEW(vdets, last, jetaE, jetaW, dirs, barrelTopo,
816  endcapTopo, barrelGeom, endcapGeom, debug);
817  } else {
818  if (debug) {
819  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
820  << " cells" << std::endl;
821  for (unsigned int i1=0; i1<vdets.size(); i1++) {
822  if (vdets[i1].subdetId() == EcalBarrel) {
823  EBDetId id = vdets[i1];
824  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
825  } else if (vdets[i1].subdetId() == EcalEndcap) {
826  EEDetId id = vdets[i1];
827  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
828  } else {
829  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
830  << vdets[i1]() <<std::dec << " Unknown Type" <<std::endl;
831  }
832  }
833  }
834  return vdets;
835  }
836  }
long int flag
Definition: mlp_lapack.h:47
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
tuple cout
Definition: gather_cfg.py:41
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
#define debug
Definition: MEtoEDMFormat.h:34
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 173 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().

180  {
181 
182  if (debug) {
183  std::cout << "newECALIdNS::Add " << iphi << " columns of cells for "
184  << (dets.size()-last) << " cells (last " << last << ")"
185  << std::endl;
186  for (unsigned int i1=last; i1<dets.size(); i1++) {
187  if (dets[i1].subdetId() == EcalBarrel) {
188  EBDetId id = dets[i1];
189  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
190  << dir[i1] << std::endl;
191  } else if (dets[i1].subdetId() == EcalEndcap) {
192  EEDetId id = dets[i1];
193  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
194  << dir[i1] << std::endl;
195  } else {
196  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
197  << dets[i1]() << std::dec << " Unknown Type along "
198  << dir[i1] << std::endl;
199  }
200  }
201  }
202 
203  std::vector<DetId> vdets;
204  std::vector<CaloDirection> dirs;
205  vdets.insert(vdets.end(), dets.begin(), dets.end());
206  dirs.insert(dirs.end(), dir.begin(), dir.end());
207 
208  std::vector<DetId> vdetE, vdetW;
209  if (last == 0) {
210  unsigned int ndet = vdets.size();
211  std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
212  vdetE = spr::newECALIdEW(dets, last, ieta, dirE, barrelTopo, endcapTopo,
213  barrelGeom, endcapGeom, debug);
214  vdetW = spr::newECALIdEW(dets, last, ieta, dirW, barrelTopo, endcapTopo,
215  barrelGeom, endcapGeom, debug);
216  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
217  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
218  vdets.push_back(vdetW[i1]);
219  dirs.push_back(dir[0]);
220  }
221  }
222  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
223  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
224  vdets.push_back(vdetE[i1]);
225  dirs.push_back(dir[0]);
226  }
227  }
228  if (debug) {
229  std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
230  << (vdets.size()-dets.size()) << " new cells" << std::endl;
231  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
232  if (vdets[i1].subdetId() == EcalBarrel) {
233  EBDetId id = vdets[i1];
234  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
235  << dirs[i1] << std::endl;
236  } else if (vdets[i1].subdetId() == EcalEndcap) {
237  EEDetId id = vdets[i1];
238  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
239  << dirs[i1] << std::endl;
240  } else {
241  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
242  << vdets[i1]() << std::dec << " Unknown Type along "
243  << dirs[i1] << std::endl;
244  }
245  }
246  }
247  }
248 
249  unsigned int last0 = vdets.size();
250  std::vector<DetId> vdetnew;
251  std::vector<CaloDirection> dirnew;
252  if (iphi > 0) {
253  std::vector<DetId> vdetn(1);
254  std::vector<CaloDirection> dirn(1);
255  std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
256  int flag=0;
257  for (unsigned int i1=last; i1<dets.size(); i1++) {
258  std::vector<DetId> cells;
259  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
260  barrelGeom, endcapGeom, cells, flag, debug);
261  /*
262  if (dets[i1].subdetId() == EcalBarrel) {
263  EBDetId id = dets[i1];
264  std::cout << "Moved Cell " << i1 << " " << id << " along "
265  << dir[i1] << std::endl;
266  } else if (dets[i1].subdetId() == EcalEndcap) {
267  EEDetId id = dets[i1];
268  std::cout << "Moved Cell " << i1 << " " << id << " along "
269  << dir[i1] << std::endl;
270  } else {
271  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
272  << dets[i1]() << std::dec << " Unknown Type along "
273  << dir[i1] << std::endl;
274  }
275  for (unsigned int kk=0; kk<cells.size(); kk++) {
276  if (cells[kk].subdetId() == EcalBarrel) {
277  EBDetId id = cells[kk];
278  std::cout << "Moved to " << id << " flag " << flag << "\n";
279  } else if (cells[kk].subdetId() == EcalEndcap) {
280  EEDetId id = cells[kk];
281  std::cout << "Moved to " << id << " flag " << flag << "\n";
282  } else {
283  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
284  << cells[kk]() << std::dec << " Unknown Type flag "
285  << flag << std::endl;
286  }
287  }
288  */
289  if (flag != 0) {
290  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
291  vdetn[0] = cells[0];
292  vdetnew.push_back(vdetn[0]);
293  dirn[0] = dir[i1];
294  if (flag < 0) {
295  if (dirn[0] == NORTH) dirn[0] = SOUTH;
296  else dirn[0] = NORTH;
297  }
298  dirnew.push_back(dirn[0]);
299  vdetE = spr::newECALIdEW(vdetn, 0, ieta, dirnE, barrelTopo,
300  endcapTopo, barrelGeom, endcapGeom,debug);
301  vdetW = spr::newECALIdEW(vdetn, 0, ieta, dirnW, barrelTopo,
302  endcapTopo, barrelGeom, endcapGeom,debug);
303  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
304  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
305  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
306  vdets.push_back(vdetW[i2]);
307  dirs.push_back(dirn[0]);
308  }
309  }
310  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
311  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
312  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
313  vdets.push_back(vdetE[i2]);
314  dirs.push_back(dirn[0]);
315  }
316  }
317  }
318  }
319  }
320  iphi--;
321  last = vdets.size();
322  for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
323  if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
324  vdets.push_back(vdetnew[i2]);
325  dirs.push_back(dirnew[i2]);
326  }
327  }
328  if (debug) {
329  std::cout << "newECALIdNS::Addition results a set of "
330  << (vdets.size()-last0) << " new cells (last " << last0
331  << ", iphi " << iphi << ")" << std::endl;
332  for (unsigned int i1=last0; i1<vdets.size(); i1++) {
333  if (vdets[i1].subdetId() == EcalBarrel) {
334  EBDetId id = vdets[i1];
335  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
336  << dirs[i1] << std::endl;
337  } else if (vdets[i1].subdetId() == EcalEndcap) {
338  EEDetId id = vdets[i1];
339  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
340  << dirs[i1] << std::endl;
341  } else {
342  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
343  << vdets[i1]() << std::dec << " Unknown Type along "
344  << dirs[i1] << std::endl;
345  }
346  }
347  }
348  last0 = last;
349  }
350 
351  if (iphi > 0) {
352  last = last0;
353  return spr::newECALIdNS(vdets,last,ieta,iphi,dirs,barrelTopo,endcapTopo,barrelGeom,endcapGeom,debug);
354  } else {
355  if (debug) {
356  std::cout << "newECALIdNS::Final list consists of " << vdets.size()
357  << " cells" << std::endl;
358  for (unsigned int i1=0; i1<vdets.size(); i1++) {
359  if (vdets[i1].subdetId() == EcalBarrel) {
360  EBDetId id = vdets[i1];
361  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
362  } else if (vdets[i1].subdetId() == EcalEndcap) {
363  EEDetId id = vdets[i1];
364  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
365  } else {
366  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
367  << vdets[i1]() << std::dec << " Unknown Type"
368  << std::endl;
369  }
370  }
371  }
372  return vdets;
373  }
374  }
long int flag
Definition: mlp_lapack.h:47
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
tuple cout
Definition: gather_cfg.py:41
dbl *** dir
Definition: mlp_gen.cc:35
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
std::vector< DetId > spr::newECALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
std::vector< int > &  ietaE,
std::vector< int > &  ietaW,
std::vector< int > &  iphiN,
std::vector< int > &  iphiS,
std::vector< CaloDirection > &  dir,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorTopology endcapTopo,
const EcalBarrelGeometry barrelGeom,
const EcalEndcapGeometry endcapGeom,
bool  debug = false 
)

Definition at line 376 of file MatrixECALDetIds.cc.

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

386  {
387 
388  if (debug) {
389  std::cout << "newECALIdNS::Add columns of cells for "
390  << (dets.size()-last) << " cells (last) " << last << std::endl;
391  for (unsigned int i1=last; i1<dets.size(); i1++) {
392  if (dets[i1].subdetId() == EcalBarrel) {
393  EBDetId id = dets[i1];
394  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
395  << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
396  << std::endl;
397  } else if (dets[i1].subdetId() == EcalEndcap) {
398  EEDetId id = dets[i1];
399  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
400  << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
401  << std::endl;
402  } else {
403  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
404  << dets[i1]() << std::dec << " Unknown Type along "
405  << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
406  << std::endl;
407  }
408  }
409  }
410 
411  std::vector<DetId> vdets;
412  std::vector<CaloDirection> dirs;
413  std::vector<int> jetaE, jetaW, jphiN, jphiS;
414  vdets.insert(vdets.end(), dets.begin(), dets.end());
415  dirs.insert(dirs.end(), dir.begin(), dir.end());
416  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
417  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
418  jphiN.insert(jphiN.end(), iphiN.begin(), iphiN.end());
419  jphiS.insert(jphiS.end(), iphiS.begin(), iphiS.end());
420  std::vector<DetId> vdetE, vdetW;
421  if (last == 0) {
422  unsigned int ndet = vdets.size();
423  std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
424  vdetE = spr::newECALIdEW(dets, last, ietaE, ietaW, dirE, barrelTopo,
425  endcapTopo, barrelGeom, endcapGeom, debug);
426  vdetW = spr::newECALIdEW(dets, last, ietaE, ietaW, dirW, barrelTopo,
427  endcapTopo, barrelGeom, endcapGeom, debug);
428  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
429  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
430  vdets.push_back(vdetW[i1]);
431  dirs.push_back(dir[0]);
432  jetaE.push_back(0);
433  jetaW.push_back(0);
434  jphiN.push_back(iphiN[0]);
435  jphiS.push_back(iphiS[0]);
436  }
437  }
438  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
439  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
440  vdets.push_back(vdetE[i1]);
441  dirs.push_back(dir[0]);
442  jetaE.push_back(0);
443  jetaW.push_back(0);
444  jphiN.push_back(iphiN[0]);
445  jphiS.push_back(iphiS[0]);
446  }
447  }
448  if (debug) {
449  std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
450  << (vdets.size()-dets.size()) << " new cells" << std::endl;
451  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
452  if (vdets[i1].subdetId() == EcalBarrel) {
453  EBDetId id = vdets[i1];
454  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
455  << dirs[i1] << std::endl;
456  } else if (vdets[i1].subdetId() == EcalEndcap) {
457  EEDetId id = vdets[i1];
458  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
459  << dirs[i1] << std::endl;
460  } else {
461  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
462  << vdets[i1]() << std::dec << " Unknown Type along "
463  << dirs[i1] << std::endl;
464  }
465  }
466  }
467  }
468 
469  unsigned int last0 = vdets.size();
470  std::vector<DetId> vdetnew;
471  std::vector<CaloDirection> dirnew;
472  std::vector<int> kphiN, kphiS, ketaE, ketaW;
473  int kphi = 0;
474  for (unsigned int i1=last; i1<dets.size(); i1++) {
475  int iphi = iphiS[i1];
476  if (dir[i1] == NORTH) iphi = iphiN[i1];
477  if (iphi > 0) {
478  std::vector<DetId> vdetn(1);
479  std::vector<CaloDirection> dirn(1);
480  std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
481  int flag=0;
482  std::vector<DetId> cells;
483  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
484  barrelGeom, endcapGeom, cells, flag, debug);
485  iphi--;
486  if (iphi > kphi) kphi = iphi;
487  if (dir[i1] == NORTH) jphiN[i1] = iphi;
488  else jphiS[i1] = iphi;
489  if (flag != 0) {
490  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
491  int kfiN = iphiN[i1];
492  int kfiS = iphiS[i1];
493  vdetn[0] = cells[0];
494  vdetnew.push_back(vdetn[0]);
495  dirn[0] = dir[i1];
496  if (dir[i1] == NORTH) kfiN = iphi;
497  else kfiS = iphi;
498  if (flag < 0) {
499  int ktmp = kfiS; kfiS = kfiN; kfiN = ktmp;
500  if (dirn[0] == NORTH) dirn[0] = SOUTH;
501  else dirn[0] = NORTH;
502  }
503  dirnew.push_back(dirn[0]);
504  kphiN.push_back(kfiN); ketaE.push_back(ietaE[i1]);
505  kphiS.push_back(kfiS); ketaW.push_back(ietaW[i1]);
506  std::vector<int> ietE(1,ietaE[i1]), ietW(1,ietaW[i1]);
507  vdetE = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnE, barrelTopo,
508  endcapTopo, barrelGeom, endcapGeom,debug);
509  vdetW = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnW, barrelTopo,
510  endcapTopo, barrelGeom, endcapGeom,debug);
511  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
512  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
513  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
514  vdets.push_back(vdetW[i2]);
515  dirs.push_back(dirn[0]);
516  jetaE.push_back(0); jphiN.push_back(kfiN);
517  jetaW.push_back(0); jphiS.push_back(kfiS);
518  }
519  }
520  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
521  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
522  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
523  vdets.push_back(vdetE[i2]);
524  dirs.push_back(dirn[0]);
525  jetaE.push_back(0); jphiN.push_back(kfiN);
526  jetaW.push_back(0); jphiS.push_back(kfiS);
527  }
528  }
529  }
530  }
531  }
532  }
533  last = vdets.size();
534  for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
535  if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
536  vdets.push_back(vdetnew[i2]);
537  dirs.push_back(dirnew[i2]);
538  jetaE.push_back(ketaE[i2]);
539  jetaW.push_back(ketaW[i2]);
540  jphiN.push_back(kphiN[i2]);
541  jphiS.push_back(kphiS[i2]);
542  }
543  }
544  if (debug) {
545  std::cout << "newECALIdNS::Addition results a set of "
546  << (vdets.size()-last0) << " new cells (last " << last0
547  << ", iphi " << kphi << ")" << std::endl;
548  for (unsigned int i1=last0; i1<vdets.size(); i1++) {
549  if (vdets[i1].subdetId() == EcalBarrel) {
550  EBDetId id = vdets[i1];
551  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
552  << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
553  << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
554  } else if (vdets[i1].subdetId() == EcalEndcap) {
555  EEDetId id = vdets[i1];
556  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
557  << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
558  << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
559  } else {
560  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
561  << vdets[i1]() << std::dec << " Unknown Type along "
562  << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
563  << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
564  }
565  }
566  }
567  last0 = last;
568 
569  if (kphi > 0) {
570  last = last0;
571  return spr::newECALIdNS(vdets, last, jetaE, jetaW, jphiN, jphiS, dirs,
572  barrelTopo, endcapTopo, barrelGeom, endcapGeom,
573  debug);
574  } else {
575  if (debug) {
576  std::cout << "newECALIdNS::Final list consists of " << vdets.size()
577  << " cells" << std::endl;
578  for (unsigned int i1=0; i1<vdets.size(); i1++) {
579  if (vdets[i1].subdetId() == EcalBarrel) {
580  EBDetId id = vdets[i1];
581  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
582  } else if (vdets[i1].subdetId() == EcalEndcap) {
583  EEDetId id = vdets[i1];
584  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
585  } else {
586  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
587  << vdets[i1]() << std::dec << " Unknown Type"
588  << std::endl;
589  }
590  }
591  }
592  return vdets;
593  }
594  }
long int flag
Definition: mlp_lapack.h:47
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
tuple cout
Definition: gather_cfg.py:41
dbl *** dir
Definition: mlp_gen.cc:35
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
std::vector< DetId > spr::newHCALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftEast,
int  ieta,
bool  debug = false 
)

Definition at line 273 of file MatrixHCALDetIds.cc.

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

Referenced by newHCALIdEW(), and newHCALIdNS().

275  {
276 
277  if (debug) {
278  std::cout << "newHCALIdEW::Add " << ieta << " rows of cells along "
279  << shiftEast << " for " << (dets.size()-last) << " cells"
280  << std::endl;
281  for (unsigned int i1=last; i1<dets.size(); i1++) {
282  HcalDetId id = HcalDetId(dets[i1]());
283  std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
284  }
285  }
286 
287  std::vector<DetId> vdets;
288  vdets.insert(vdets.end(), dets.begin(), dets.end());
289  if (ieta > 0) {
290  for (unsigned int i1=last; i1<dets.size(); i1++) {
291  std::vector<DetId> vdet;
292  if (shiftEast) vdet = topology->east(dets[i1]);
293  else vdet = topology->west(dets[i1]);
294  for (unsigned int i2=0; i2<vdet.size(); i2++) {
295  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
296  vdets.push_back(vdet[i2]);
297  }
298  }
299  ieta--;
300  }
301 
302  if (debug) {
303  std::cout << "newHCALIdEW::Addition results a set of "
304  << (vdets.size()-dets.size()) << " new cells" << std::endl;
305  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
306  HcalDetId id = HcalDetId(vdets[i1]());
307  std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
308  }
309  }
310 
311  if (ieta > 0) {
312  last = dets.size();
313  return spr::newHCALIdEW(vdets, last, topology, shiftEast, ieta, debug);
314  } else {
315  if (debug) {
316  std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
317  << " cells" << std::endl;
318  for (unsigned int i1=0; i1<vdets.size(); i1++) {
319  HcalDetId id = HcalDetId(vdets[i1]());
320  std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
321  }
322  }
323  return vdets;
324  }
325  }
virtual std::vector< DetId > west(const DetId &id) const
Definition: HcalTopology.cc:84
tuple cout
Definition: gather_cfg.py:41
virtual std::vector< DetId > east(const DetId &id) const
Definition: HcalTopology.cc:76
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdEW ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftEast,
int  ietaE,
int  ietaW,
bool  debug = false 
)

Definition at line 327 of file MatrixHCALDetIds.cc.

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

329  {
330 
331  if (debug) {
332  std::cout << "newHCALIdEW::Add " << ietaE << "|" << ietaW
333  << " rows of cells along " << shiftEast << " for "
334  << (dets.size()-last) << " cells" << std::endl;
335  for (unsigned int i1=last; i1<dets.size(); i1++) {
336  HcalDetId id = HcalDetId(dets[i1]());
337  std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
338  }
339  }
340 
341  int ieta = ietaW;
342  if (shiftEast) ieta = ietaE;
343  std::vector<DetId> vdets;
344  vdets.insert(vdets.end(), dets.begin(), dets.end());
345  if (ieta > 0) {
346  for (unsigned int i1=last; i1<dets.size(); i1++) {
347  std::vector<DetId> vdet;
348  if (shiftEast) vdet = topology->east(dets[i1]);
349  else vdet = topology->west(dets[i1]);
350  for (unsigned int i2=0; i2<vdet.size(); i2++) {
351  if (std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
352  vdets.push_back(vdet[i2]);
353  }
354  }
355  ieta--;
356  }
357  if (shiftEast) ietaE = ieta;
358  else ietaW = ieta;
359 
360  if (debug) {
361  std::cout << "newHCALIdEW::Addition results a set of "
362  << (vdets.size()-dets.size()) << " new cells" << std::endl;
363  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
364  HcalDetId id = HcalDetId(vdets[i1]());
365  std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
366  }
367  }
368 
369  if (ieta > 0) {
370  last = dets.size();
371  return spr::newHCALIdEW(vdets,last,topology,shiftEast,ietaE,ietaW,debug);
372  } else {
373  if (debug) {
374  std::cout << "newHCALIdEW::Final list (EW) consists of " <<vdets.size()
375  << " cells" << std::endl;
376  for (unsigned int i1=0; i1<vdets.size(); i1++) {
377  HcalDetId id = HcalDetId(vdets[i1]());
378  std::cout << "newHCALIdEW::Cell " << i1 << " " << id << std::endl;
379  }
380  }
381  return vdets;
382  }
383  }
virtual std::vector< DetId > west(const DetId &id) const
Definition: HcalTopology.cc:84
tuple cout
Definition: gather_cfg.py:41
virtual std::vector< DetId > east(const DetId &id) const
Definition: HcalTopology.cc:76
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)
std::vector< DetId > spr::newHCALIdNS ( std::vector< DetId > &  dets,
unsigned int  last,
const HcalTopology topology,
bool  shiftNorth,
int  ieta,
int  iphi,
bool  debug = false 
)

Definition at line 85 of file MatrixHCALDetIds.cc.

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

Referenced by matrixHCALIds(), and newHCALIdNS().

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

Definition at line 176 of file MatrixHCALDetIds.cc.

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

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

Definition at line 156 of file MatchingSimTrack.cc.

References begin, DeDxDiscriminatorTools::charge(), gather_cfg::cout, and dbtoconf::parent.

Referenced by matchedSimTrackInfo().

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

Definition at line 18 of file CaloPropagateTrack.cc.

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

18  {
19 
20  std::vector<spr::propagatedTrackID> vdets;
21  spr::propagateCALO(trkCollection,geo,bField,theTrackQuality, vdets, debug);
22  return vdets;
23  }
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
#define debug
Definition: MEtoEDMFormat.h:34
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, EcalEndcapGeometry::getClosestCell(), CaloSubdetectorGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, i, info, spr::propagatedTrackID::ok, spr::propagatedTrackID::okECAL, spr::propagatedTrackID::okHCAL, spr::propagatedTrackID::phiECAL, spr::propagatedTrackID::phiHCAL, point, propagateECAL(), propagateHCAL(), reco::TrackBase::quality(), reco::TrackBase::qualityByName(), and spr::propagatedTrackID::trkItr.

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

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

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

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

243  {
244 
246  if (debug) std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
247  FreeTrajectoryState fts (tpVertex, tpMomentum, tpCharge, bField);
248 
251 
253 
254  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
255 
257  if (tpMomentum.eta() < 0) {
258  tsose = myAP.propagate(fts, *lendcap);
259  } else {
260  tsose = myAP.propagate(fts, *rendcap);
261  }
262 
263  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
264 
265  track.ok=true;
266  if (tsose.isValid() && tsosb.isValid()) {
267  float absEta = std::abs(tsosb.globalPosition().eta());
268  if (absEta < corner) {
269  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
270  track.direction = tsosb.globalDirection();
271  } else {
272  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
273  track.direction = tsose.globalDirection();
274  }
275  } else if (tsose.isValid()) {
276  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
277  track.direction = tsose.globalDirection();
278  } else if (tsosb.isValid()) {
279  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
280  track.direction = tsosb.globalDirection();
281  } else {
282  track.point.SetXYZ(-999., -999., -999.);
283  track.direction = GlobalVector(0,0,1);
284  track.ok = false;
285  }
286  if (debug) {
287  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll " << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
288  if (track.ok) {
289  math::XYZPoint vDiff(track.point.x()-tpVertex.x(), track.point.y()-tpVertex.y(), track.point.z()-tpVertex.z());
290  double dphi = track.direction.phi()-tpMomentum.phi();
291  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
292  double pt = tpMomentum.perp();
293  double rat = 0.5*dphi/std::sin(0.5*dphi);
294  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;
295  }
296  }
297  return track;
298  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T y() const
Definition: PV3DBase.h:57
#define abs(x)
Definition: mlp_lapack.h:159
GlobalPoint globalPosition() const
static PlanePointer build(const PositionType &pos, const RotationType &rot, MediumProperties *mp=0)
Definition: Plane.h:25
T sqrt(T t)
Definition: SSEVec.h:28
T z() const
Definition: PV3DBase.h:58
#define M_PI
Definition: BFit3D.cc:3
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp=0)
Definition: Cylinder.h:29
T eta() const
Definition: PV3DBase.h:70
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
T x() const
Definition: PV3DBase.h:56
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector globalDirection() const
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 157 of file CaloPropagateTrack.cc.

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

Referenced by chargeIsolationEcal(), and propagateCALO().

157  {
158  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
159  GlobalVector momentum (track->px(), track->py(), track->pz());
160  int charge (track->charge());
161  return spr::propagateECAL (vertex, momentum, charge, bfield, debug);
162  }
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:132
double charge(const std::vector< uint8_t > &Ampls)
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:136
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:146
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:144
int charge() const
track electric charge
Definition: TrackBase.h:112
#define debug
Definition: MEtoEDMFormat.h:34
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:134
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:142
std::pair< math::XYZPoint, bool > spr::propagateECAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 164 of file CaloPropagateTrack.cc.

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

164  {
165  spr::propagatedTrack track = spr::propagateCalo (vertex, momentum, charge, bfield, 319.2, 129.4, 1.479, debug);
166  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
167  }
propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double charge(const std::vector< uint8_t > &Ampls)
#define debug
Definition: MEtoEDMFormat.h:34
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 176 of file CaloPropagateTrack.cc.

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

Referenced by chargeIsolationHcal(), and propagateCALO().

176  {
177  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
178  GlobalVector momentum (track->px(), track->py(), track->pz());
179  int charge (track->charge());
180  return spr::propagateHCAL (vertex, momentum, charge, bfield, debug);
181  }
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:132
double charge(const std::vector< uint8_t > &Ampls)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:136
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:146
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:144
int charge() const
track electric charge
Definition: TrackBase.h:112
#define debug
Definition: MEtoEDMFormat.h:34
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:134
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:142
std::pair< math::XYZPoint, bool > spr::propagateHCAL ( const GlobalPoint vertex,
const GlobalVector momentum,
int  charge,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 183 of file CaloPropagateTrack.cc.

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

183  {
184  spr::propagatedTrack track = spr::propagateCalo (vertex, momentum, charge, bfield, 402.7, 180.7, 1.392, debug);
185  return std::pair<math::XYZPoint,bool>(track.point,track.ok);
186  }
propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double charge(const std::vector< uint8_t > &Ampls)
#define debug
Definition: MEtoEDMFormat.h:34
std::pair< math::XYZPoint, bool > spr::propagateTracker ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 188 of file CaloPropagateTrack.cc.

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

188  {
189  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
190  GlobalVector momentum (track->px(), track->py(), track->pz());
191  int charge (track->charge());
192  spr::propagatedTrack track1 = spr::propagateCalo (vertex, momentum, charge, bfield, 290.0, 109.0, 1.705, debug);
193  return std::pair<math::XYZPoint,bool>(track1.point,track1.ok);
194  }
propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:132
double charge(const std::vector< uint8_t > &Ampls)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:136
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:146
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:144
int charge() const
track electric charge
Definition: TrackBase.h:112
#define debug
Definition: MEtoEDMFormat.h:34
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:134
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:142
std::pair< math::XYZPoint, double > spr::propagateTrackerEnd ( const reco::Track track,
const MagneticField bField,
bool  debug = false 
)

Definition at line 196 of file CaloPropagateTrack.cc.

References abs, alongMomentum, Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::build(), DeDxDiscriminatorTools::charge(), reco::TrackBase::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().

196  {
197 
198  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
199  GlobalVector momentum (track->px(), track->py(), track->pz());
200  int charge (track->charge());
201  float radius = track->outerPosition().Rho();
202  float zdist = track->outerPosition().Z();
203  if (debug) std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " Radius " << radius << " Z " << zdist << std::endl;
204 
205  FreeTrajectoryState fts (vertex, momentum, charge, bField);
208 
209  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
210 
211  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
212  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
213 
214  math::XYZPoint point(-999.,-999.,-999.);
215  bool ok=false;
216  GlobalVector direction(0,0,1);
217  if (tsosb.isValid() && std::abs(zdist) < 110) {
218  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
219  direction = tsosb.globalDirection();
220  ok = true;
221  } else if (tsose.isValid()) {
222  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
223  direction = tsose.globalDirection();
224  ok = true;
225  }
226 
227  double length = -1;
228  if (ok) {
229  math::XYZPoint vDiff(point.x()-vertex.x(), point.y()-vertex.y(), point.z()-vertex.z());
230  double dphi = direction.phi()-momentum.phi();
231  double rdist = std::sqrt(vDiff.x()*vDiff.x()+vDiff.y()*vDiff.y());
232  double rat = 0.5*dphi/std::sin(0.5*dphi);
233  double dZ = vDiff.z();
234  double dS = rdist*rat; //dZ*momentum.z()/momentum.perp();
235  length = std::sqrt(dS*dS+dZ*dZ);
236  if (debug)
237  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;
238  }
239 
240  return std::pair<math::XYZPoint,double>(point,length);
241  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T y() const
Definition: PV3DBase.h:57
#define abs(x)
Definition: mlp_lapack.h:159
GlobalPoint globalPosition() const
static PlanePointer build(const PositionType &pos, const RotationType &rot, MediumProperties *mp=0)
Definition: Plane.h:25
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:132
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:47
double charge(const std::vector< uint8_t > &Ampls)
T sqrt(T t)
Definition: SSEVec.h:28
T z() const
Definition: PV3DBase.h:58
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:136
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:146
#define M_PI
Definition: BFit3D.cc:3
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp=0)
Definition: Cylinder.h:29
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:144
tuple cout
Definition: gather_cfg.py:41
int charge() const
track electric charge
Definition: TrackBase.h:112
#define debug
Definition: MEtoEDMFormat.h:34
T x() const
Definition: PV3DBase.h:56
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:134
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:142
GlobalVector globalDirection() const
propagatedTrack spr::propagateTrackToECAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 150 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

150  {
151  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
152  GlobalVector momentum (track->px(), track->py(), track->pz());
153  int charge (track->charge());
154  return spr::propagateCalo (vertex, momentum, charge, bfield, 319.2, 129.4, 1.479, debug);
155  }
propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:132
double charge(const std::vector< uint8_t > &Ampls)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:136
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:146
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:144
int charge() const
track electric charge
Definition: TrackBase.h:112
#define debug
Definition: MEtoEDMFormat.h:34
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:134
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:142
propagatedTrack spr::propagateTrackToHCAL ( const reco::Track track,
const MagneticField bfield,
bool  debug = false 
)

Definition at line 169 of file CaloPropagateTrack.cc.

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

Referenced by propagateCALO().

169  {
170  GlobalPoint vertex (track->vx(), track->vy(), track->vz());
171  GlobalVector momentum (track->px(), track->py(), track->pz());
172  int charge (track->charge());
173  return spr::propagateCalo (vertex, momentum, charge, bfield, 402.7, 180.7, 1.392, debug);
174  }
propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:132
double charge(const std::vector< uint8_t > &Ampls)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:136
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:146
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:144
int charge() const
track electric charge
Definition: TrackBase.h:112
#define debug
Definition: MEtoEDMFormat.h:34
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:134
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:142
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 838 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().

843  {
844 
845  DetId cell;
846  ok = 0;
847  if (det.subdetId() == EcalBarrel) {
848  EBDetId detId = det;
849  std::vector<DetId> neighbours = barrelTopo.getNeighbours(detId,dir);
850  if (neighbours.size()>0 && !neighbours[0].null()) {
851  cells.push_back(neighbours[0]);
852  cell = neighbours[0];
853  ok = 1;
854  } else {
855  const int ietaAbs ( detId.ietaAbs() ) ; // abs value of ieta
856  if (EBDetId::MAX_IETA == ietaAbs ) {
857  // get ee nbrs for for end of barrel crystals
859  ol( * barrelGeom.getClosestEndcapCells(detId) ) ;
860  // take closest neighbour on the other side, that is in the endcap
861  cell = *(ol.begin() );
862  neighbours = endcapTopo.getNeighbours(cell,dir);
863  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
864  else ok =-1;
865  for (EcalBarrelGeometry::OrderedListOfEEDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
866  cells.push_back(*iptr);
867  }
868  }
869  } else if (det.subdetId() == EcalEndcap) {
870  EEDetId detId = det;
871  std::vector<DetId> neighbours = endcapTopo.getNeighbours(detId,dir);
872  if (neighbours.size()>0 && !neighbours[0].null()) {
873  cells.push_back(neighbours[0]);
874  cell = neighbours[0];
875  ok = 1;
876  } else {
877  // are we on the outer ring ?
878  const int iphi ( detId.iPhiOuterRing() ) ;
879  if (iphi!= 0) {
880  // get eb nbrs for for end of endcap crystals
882  ol( * endcapGeom.getClosestBarrelCells(detId) ) ;
883  // take closest neighbour on the other side, that is in the barrel.
884  cell = *(ol.begin() );
885  neighbours = barrelTopo.getNeighbours(cell,dir);
886  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
887  else ok =-1;
888  for (EcalEndcapGeometry::OrderedListOfEBDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
889  cells.push_back(*iptr);
890  }
891  }
892  }
893  if (debug) {
894  std::cout << "simpleMove:: Move DetId 0x" << std::hex << det()
895  << std::dec << " along " << dir << " to get 0x" << std::hex
896  << cell() << std::dec << " with flag " << ok << " # "
897  << cells.size();
898  for (unsigned int i1=0; i1<cells.size(); ++i1)
899  std::cout << " " << std::hex << cells[0]() << std::dec;
900  std::cout << std::endl;
901  }
902  }
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
int iPhiOuterRing() const
Definition: EEDetId.cc:404
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
static const int MAX_IETA
Definition: EBDetId.h:122
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
tuple cout
Definition: gather_cfg.py:41
dbl *** dir
Definition: mlp_gen.cc:35
#define debug
Definition: MEtoEDMFormat.h:34
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:42
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, PV3DBase< T, PVType, FrameType >::eta(), 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(), and RPCDigiSimLink::RPCDigiSimLink().

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

Definition at line 118 of file MatchingSimTrack.cc.

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

Referenced by matchedSimTrackId(), and matchedSimTrackInfo().

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