CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HBHEHitMapOrganizer Class Reference

#include <HBHEIsolatedNoiseAlgos.h>

List of all members.

Public Member Functions

void getDiHits (std::vector< HBHEHitMap > &v, double energy) const
void getHPDs (std::vector< HBHEHitMap > &v, double energy) const
void getMonoHits (std::vector< HBHEHitMap > &v, double energy) const
void getRBXs (std::vector< HBHEHitMap > &v, double energy) const
 HBHEHitMapOrganizer (const edm::Handle< HBHERecHitCollection > &hbhehitcoll_h, const ObjectValidatorAbs &objvalidator, const PhysicsTowerOrganizer &pto)
virtual ~HBHEHitMapOrganizer ()

Private Member Functions

void getHPDNeighbors (const HBHERecHit *hit, std::vector< const HBHERecHit * > &neighbors, const PhysicsTowerOrganizer &pto)

Private Attributes

std::vector< HBHEHitMapdihits_
std::map< int, HBHEHitMaphpds_
std::vector< HBHEHitMapmonohits_
std::map< int, HBHEHitMaprbxs_

Detailed Description

Definition at line 332 of file HBHEIsolatedNoiseAlgos.h.


Constructor & Destructor Documentation

HBHEHitMapOrganizer::HBHEHitMapOrganizer ( const edm::Handle< HBHERecHitCollection > &  hbhehitcoll_h,
const ObjectValidatorAbs objvalidator,
const PhysicsTowerOrganizer pto 
)

Definition at line 711 of file HBHEIsolatedNoiseAlgos.cc.

References dihits_, CaloRecHit::energy(), PhysicsTowerOrganizer::findNeighbors(), PhysicsTowerOrganizer::findTower(), getHPDNeighbors(), hpds_, HBHERecHit::id(), HcalDetId::ieta(), HcalHPDRBXMap::indexHPD(), HcalHPDRBXMap::indexRBX(), HBHEHitMap::insert(), HcalDetId::iphi(), monohits_, rbxs_, and ObjectValidatorAbs::validHit().

{
  // loop over the hits
  for(HBHERecHitCollection::const_iterator it=hbhehitcoll_h->begin(); it!=hbhehitcoll_h->end(); ++it) {
    const HBHERecHit *hit=&(*it);
    if(!objvalidator.validHit(*hit)) continue;
    
    // get the Physics Tower and the neighbors
    const PhysicsTower* tower=pto.findTower(hit->id().ieta(), hit->id().iphi());
    
    std::set<const PhysicsTower*> neighbors;
    pto.findNeighbors(hit->id().ieta(), hit->id().iphi(), neighbors);
    
    // organize the RBXs
    int rbxidnum = HcalHPDRBXMap::indexRBX(hit->id());
    rbxs_[rbxidnum].insert(hit, tower, neighbors);
    
    // organize the HPDs
    int hpdidnum = HcalHPDRBXMap::indexHPD(hit->id());
    hpds_[hpdidnum].insert(hit, tower, neighbors);
    
    
    // organize the dihits
    std::vector<const HBHERecHit*> hpdneighbors;
    getHPDNeighbors(hit, hpdneighbors, pto);
    
    if(hpdneighbors.size()==1) {
      std::vector<const HBHERecHit*> hpdneighborsneighbors;
      getHPDNeighbors(hpdneighbors[0], hpdneighborsneighbors, pto);
      
      if(hpdneighborsneighbors.size()==1 && hpdneighborsneighbors[0]==hit && hit->energy()>hpdneighbors[0]->energy()) {
        // we've found two hits who are neighbors in the same HPD, but who have no other
        // neighbors (in the same HPD) in common.  In order not to double-count, we
        // require that the first hit has more energy
        
        const PhysicsTower* tower2=pto.findTower(hpdneighbors[0]->id().ieta(), hpdneighbors[0]->id().iphi());
        std::set<const PhysicsTower*> neighbors2;
        pto.findNeighbors(hpdneighbors[0]->id().ieta(), hpdneighbors[0]->id().iphi(), neighbors2);
        
        HBHEHitMap dihit;
        dihit.insert(hit, tower, neighbors);
        dihit.insert(hpdneighbors[0], tower2, neighbors2);
        dihits_.push_back(dihit);
      }
    } else if(hpdneighbors.size()==0) {
      
      // organize the monohits
      HBHEHitMap monohit;
      monohit.insert(hit, tower, neighbors);
      monohits_.push_back(monohit);
    }
    
  } // finished looping over HBHERecHits
  return;
}
virtual HBHEHitMapOrganizer::~HBHEHitMapOrganizer ( ) [inline, virtual]

Definition at line 339 of file HBHEIsolatedNoiseAlgos.h.

{}

Member Function Documentation

void HBHEHitMapOrganizer::getDiHits ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 787 of file HBHEIsolatedNoiseAlgos.cc.

References dihits_, and relval_parameters_module::energy.

Referenced by HBHEIsolatedNoiseReflagger::produce().

{
  for(std::vector<HBHEHitMap>::const_iterator it=dihits_.begin(); it!=dihits_.end(); ++it) {
    if(it->hitEnergy()>energy) v.push_back(*it);
  }
  return;
}
void HBHEHitMapOrganizer::getHPDNeighbors ( const HBHERecHit hit,
std::vector< const HBHERecHit * > &  neighbors,
const PhysicsTowerOrganizer pto 
) [private]

Definition at line 805 of file HBHEIsolatedNoiseAlgos.cc.

References PhysicsTowerOrganizer::findNeighbors(), PhysicsTowerOrganizer::findTower(), HBHERecHit::id(), HcalDetId::ieta(), HcalHPDRBXMap::indexHPD(), HcalDetId::iphi(), and groupFilesInBlocks::temp.

Referenced by HBHEHitMapOrganizer().

{
  std::set<const PhysicsTower*> temp;
  pto.findNeighbors(hit->id().ieta(), hit->id().iphi(), temp);

  // make sure to include the same tower that the hit is in
  temp.insert(pto.findTower(hit->id().ieta(), hit->id().iphi()));

  // loop over the rechits in the temp neighbors
  for(std::set<const PhysicsTower*>::const_iterator it1=temp.begin(); it1!=temp.end(); ++it1) {
    for(std::set<const HBHERecHit*>::const_iterator it2=(*it1)->hcalhits.begin(); it2!=(*it1)->hcalhits.end(); ++it2) {
      const HBHERecHit* hit2(*it2);
      if(hit!=hit2 && HcalHPDRBXMap::indexHPD(hit->id())==HcalHPDRBXMap::indexHPD(hit2->id())) {
        neighbors.push_back(hit2);
      }
    }
  }
  return;
}
void HBHEHitMapOrganizer::getHPDs ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 778 of file HBHEIsolatedNoiseAlgos.cc.

References relval_parameters_module::energy, HBHEHitMap::hitEnergy(), hpds_, and Association::map.

Referenced by HBHEIsolatedNoiseReflagger::produce().

{
  for(std::map<int, HBHEHitMap>::const_iterator it=hpds_.begin(); it!=hpds_.end(); ++it) {
    const HBHEHitMap &map=it->second;
    if(map.hitEnergy()>energy) v.push_back(map);
  }
  return;
}
void HBHEHitMapOrganizer::getMonoHits ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 795 of file HBHEIsolatedNoiseAlgos.cc.

References relval_parameters_module::energy, and monohits_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

{
  for(std::vector<HBHEHitMap>::const_iterator it=monohits_.begin(); it!=monohits_.end(); ++it) {
    if(it->hitEnergy()>energy) v.push_back(*it);
  }
  return;
}
void HBHEHitMapOrganizer::getRBXs ( std::vector< HBHEHitMap > &  v,
double  energy 
) const

Definition at line 769 of file HBHEIsolatedNoiseAlgos.cc.

References relval_parameters_module::energy, HBHEHitMap::hitEnergy(), Association::map, and rbxs_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

{
  for(std::map<int, HBHEHitMap>::const_iterator it=rbxs_.begin(); it!=rbxs_.end(); ++it) {
    const HBHEHitMap &map=it->second;
    if(map.hitEnergy()>energy) v.push_back(map);
  }
  return;
}

Member Data Documentation

std::vector<HBHEHitMap> HBHEHitMapOrganizer::dihits_ [private]

Definition at line 349 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getDiHits(), and HBHEHitMapOrganizer().

std::map<int, HBHEHitMap> HBHEHitMapOrganizer::hpds_ [private]

Definition at line 348 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getHPDs(), and HBHEHitMapOrganizer().

Definition at line 349 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getMonoHits(), and HBHEHitMapOrganizer().

std::map<int, HBHEHitMap> HBHEHitMapOrganizer::rbxs_ [private]

Definition at line 348 of file HBHEIsolatedNoiseAlgos.h.

Referenced by getRBXs(), and HBHEHitMapOrganizer().