CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

AlignmentCSCBeamHaloSelector Class Reference

#include <AlignmentCSCBeamHaloSelector.h>

List of all members.

Public Types

typedef std::vector< const
reco::Track * > 
Tracks

Public Member Functions

 AlignmentCSCBeamHaloSelector (const edm::ParameterSet &iConfig)
 constructor
Tracks select (const Tracks &tracks, const edm::Event &iEvent) const
 select tracks
 ~AlignmentCSCBeamHaloSelector ()
 destructor

Private Attributes

unsigned int m_minHitsPerStation
unsigned int m_minStations

Detailed Description

Definition at line 14 of file AlignmentCSCBeamHaloSelector.h.


Member Typedef Documentation

Definition at line 16 of file AlignmentCSCBeamHaloSelector.h.


Constructor & Destructor Documentation

AlignmentCSCBeamHaloSelector::AlignmentCSCBeamHaloSelector ( const edm::ParameterSet iConfig)

constructor

Definition at line 14 of file AlignmentCSCBeamHaloSelector.cc.

References m_minHitsPerStation, and m_minStations.

   : m_minStations(iConfig.getParameter<unsigned int>("minStations"))
   , m_minHitsPerStation(iConfig.getParameter<unsigned int>("minHitsPerStation"))
{
   edm::LogInfo("AlignmentCSCBeamHaloSelector") 
      << "Acceptable tracks must have at least " << m_minHitsPerStation << " hits in " << m_minStations << " different CSC stations." << std::endl;
}
AlignmentCSCBeamHaloSelector::~AlignmentCSCBeamHaloSelector ( )

destructor

Definition at line 24 of file AlignmentCSCBeamHaloSelector.cc.

{}

Member Function Documentation

AlignmentCSCBeamHaloSelector::Tracks AlignmentCSCBeamHaloSelector::select ( const Tracks tracks,
const edm::Event iEvent 
) const

select tracks

Definition at line 29 of file AlignmentCSCBeamHaloSelector.cc.

References MuonSubdetId::CSC, CSCDetId::endcap(), m_minHitsPerStation, m_minStations, DetId::Muon, query::result, relativeConstraints::station, CSCDetId::station(), and mergeVDriftHistosByStation::stations.

Referenced by CSCBeamHaloConfigSelector::select().

                                                                                       {
   Tracks result;

   for (Tracks::const_iterator track = tracks.begin();  track != tracks.end();  ++track) {
      std::map<int, unsigned int> station_map;

      for (trackingRecHit_iterator hit = (*track)->recHitsBegin();  hit != (*track)->recHitsEnd();  ++hit) {
         DetId id = (*hit)->geographicalId();
         if (id.det() == DetId::Muon  &&  id.subdetId() == MuonSubdetId::CSC) {
            CSCDetId cscid(id.rawId());
            int station = (cscid.endcap() == 1 ? 1 : -1) * cscid.station();

            std::map<int, unsigned int>::const_iterator station_iter = station_map.find(station);
            if (station_iter == station_map.end()) {
               station_map[station] = 0;
            }
            station_map[station]++;
         } // end if it's a CSC hit
      } // end loop over hits

      unsigned int stations = 0;
      for (std::map<int, unsigned int>::const_iterator station_iter = station_map.begin();  station_iter != station_map.end();  ++station_iter) {
         if (station_iter->second > m_minHitsPerStation) stations++;
      }
      if (stations >= m_minStations) {
         result.push_back(*track);
      }
   } // end loop over tracks
  
   return result;
}

Member Data Documentation

Definition at line 29 of file AlignmentCSCBeamHaloSelector.h.

Referenced by AlignmentCSCBeamHaloSelector(), and select().

Definition at line 28 of file AlignmentCSCBeamHaloSelector.h.

Referenced by AlignmentCSCBeamHaloSelector(), and select().