CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

AlignmentCSCTrackSelector Class Reference

#include <AlignmentCSCTrackSelector.h>

List of all members.

Public Types

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

Public Member Functions

 AlignmentCSCTrackSelector (const edm::ParameterSet &cfg)
 constructor
Tracks select (const Tracks &tracks, const edm::Event &evt) const
 select tracks
 ~AlignmentCSCTrackSelector ()
 destructor

Private Attributes

int m_maxHitsPerStation
int m_minHitsDT
int m_minHitsPerStation
edm::InputTag m_src
int m_stationA
int m_stationB

Detailed Description

Definition at line 15 of file AlignmentCSCTrackSelector.h.


Member Typedef Documentation

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

Definition at line 20 of file AlignmentCSCTrackSelector.h.


Constructor & Destructor Documentation

AlignmentCSCTrackSelector::AlignmentCSCTrackSelector ( const edm::ParameterSet cfg)

constructor

Definition at line 16 of file AlignmentCSCTrackSelector.cc.

   : m_src(cfg.getParameter<edm::InputTag>("src"))
   , m_stationA(cfg.getParameter<int>("stationA"))
   , m_stationB(cfg.getParameter<int>("stationB"))
   , m_minHitsDT(cfg.getParameter<int>("minHitsDT"))
   , m_minHitsPerStation(cfg.getParameter<int>("minHitsPerStation"))
   , m_maxHitsPerStation(cfg.getParameter<int>("maxHitsPerStation"))
{}
AlignmentCSCTrackSelector::~AlignmentCSCTrackSelector ( )

destructor

Definition at line 27 of file AlignmentCSCTrackSelector.cc.

{}

Member Function Documentation

AlignmentCSCTrackSelector::Tracks AlignmentCSCTrackSelector::select ( const Tracks tracks,
const edm::Event evt 
) const

select tracks

Definition at line 34 of file AlignmentCSCTrackSelector.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, CSCDetId::endcap(), m_maxHitsPerStation, m_minHitsDT, m_minHitsPerStation, m_stationA, m_stationB, DetId::Muon, query::result, relativeConstraints::station, and CSCDetId::station().

Referenced by CSCTrackConfigSelector::select().

{
   Tracks result;

   for (Tracks::const_iterator track = tracks.begin();  track != tracks.end();  ++track) {
      int hitsOnStationA = 0;
      int hitsOnStationB = 0;

      for (trackingRecHit_iterator hit = (*track)->recHitsBegin();  hit != (*track)->recHitsEnd();  ++hit) {
         DetId id = (*hit)->geographicalId();

         if (id.det() == DetId::Muon  &&  id.subdetId() == MuonSubdetId::DT) {
            if (m_stationA == 0) hitsOnStationA++;
            if (m_stationB == 0) hitsOnStationB++;
         }
         else if (id.det() == DetId::Muon  &&  id.subdetId() == MuonSubdetId::CSC) {
            CSCDetId cscid(id.rawId());
            int station = (cscid.endcap() == 1 ? 1 : -1) * cscid.station();

            if (station == m_stationA) hitsOnStationA++;
            if (station == m_stationB) hitsOnStationB++;

         } // end if CSC
      } // end loop over hits

      bool stationAokay;
      if (m_stationA == 0) stationAokay = (m_minHitsDT <= hitsOnStationA);
      else stationAokay = (m_minHitsPerStation <= hitsOnStationA  &&  hitsOnStationA <= m_maxHitsPerStation);

      bool stationBokay;
      if (m_stationB == 0) stationBokay = (m_minHitsDT <= hitsOnStationB);
      else stationBokay = (m_minHitsPerStation <= hitsOnStationB  &&  hitsOnStationB <= m_maxHitsPerStation);

      if (stationAokay  &&  stationBokay) {
         result.push_back(*track);
      }
   } // end loop over tracks
  
   return result;
}

Member Data Documentation

Definition at line 34 of file AlignmentCSCTrackSelector.h.

Referenced by select().

Definition at line 34 of file AlignmentCSCTrackSelector.h.

Referenced by select().

Definition at line 34 of file AlignmentCSCTrackSelector.h.

Referenced by select().

Definition at line 33 of file AlignmentCSCTrackSelector.h.

Definition at line 34 of file AlignmentCSCTrackSelector.h.

Referenced by select().

Definition at line 34 of file AlignmentCSCTrackSelector.h.

Referenced by select().