CMS 3D CMS Logo

Public Member Functions | Private Attributes

L3MumuTrackingRegion Class Reference

#include <L3MumuTrackingRegion.h>

Inheritance diagram for L3MumuTrackingRegion:
TrackingRegionProducer

List of all members.

Public Member Functions

 L3MumuTrackingRegion (const edm::ParameterSet &cfg)
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &ev, const edm::EventSetup &es) const
virtual ~L3MumuTrackingRegion ()

Private Attributes

double m_howToUseMeasurementTracker
std::string m_measurementTracker
bool m_searchOpt
double theDeltaEta
double theDeltaPhi
edm::InputTag theInputTrkSrc
double theOriginHalfLength
double theOriginRadius
double theOriginZPos
double thePtMin
std::string theVertexSrc
bool useVtxTks

Detailed Description

Definition at line 15 of file L3MumuTrackingRegion.h.


Constructor & Destructor Documentation

L3MumuTrackingRegion::L3MumuTrackingRegion ( const edm::ParameterSet cfg) [inline]

Definition at line 19 of file L3MumuTrackingRegion.h.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), m_howToUseMeasurementTracker, m_measurementTracker, m_searchOpt, theDeltaEta, theDeltaPhi, theInputTrkSrc, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertexSrc, and useVtxTks.

                                                   { 

    edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");

    theVertexSrc   = regionPSet.getParameter<std::string>("vertexSrc");
    theInputTrkSrc = regionPSet.getParameter<edm::InputTag>("TrkSrc");

    useVtxTks = regionPSet.getParameter<bool>("UseVtxTks");

    thePtMin              = regionPSet.getParameter<double>("ptMin");
    theOriginRadius       = regionPSet.getParameter<double>("originRadius");
    theOriginHalfLength   = regionPSet.getParameter<double>("originHalfLength");
    theOriginZPos  = regionPSet.getParameter<double>("vertexZDefault");

    theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
    theDeltaPhi =  regionPSet.getParameter<double>("deltaPhiRegion");
    if (regionPSet.exists("searchOpt")){
      m_searchOpt    = regionPSet.getParameter<bool>("searchOpt");
    }
    else{
      m_searchOpt = false;
    }
    m_measurementTracker ="";
    m_howToUseMeasurementTracker=0;
    if (regionPSet.exists("measurementTrackerName")){
      m_measurementTracker = regionPSet.getParameter<std::string>("measurementTrackerName");
      if (regionPSet.exists("howToUseMeasurementTracker")){
        m_howToUseMeasurementTracker = regionPSet.getParameter<double>("howToUseMeasurementTracker");
      }
    }
  }   
virtual L3MumuTrackingRegion::~L3MumuTrackingRegion ( ) [inline, virtual]

Definition at line 51 of file L3MumuTrackingRegion.h.

{}

Member Function Documentation

virtual std::vector<TrackingRegion* > L3MumuTrackingRegion::regions ( const edm::Event ev,
const edm::EventSetup es 
) const [inline, virtual]

Implements TrackingRegionProducer.

Definition at line 53 of file L3MumuTrackingRegion.h.

References edm::Event::getByLabel(), m_howToUseMeasurementTracker, m_measurementTracker, m_searchOpt, edm::Handle< T >::product(), query::result, theDeltaEta, theDeltaPhi, theInputTrkSrc, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertexSrc, and useVtxTks.

                                     {

    std::vector<TrackingRegion* > result;

    // optional constraint for vertex
    // get highest Pt pixel vertex (if existing)
    double deltaZVertex =  theOriginHalfLength;
    double originz = theOriginZPos;
    if (theVertexSrc.length()>1) {
      edm::Handle<reco::VertexCollection> vertices;
      ev.getByLabel(theVertexSrc,vertices);
      const reco::VertexCollection vertCollection = *(vertices.product());
      reco::VertexCollection::const_iterator ci = vertCollection.begin();
      if (vertCollection.size()>0) {
            originz = ci->z();
      } else {
            originz = theOriginZPos;
            deltaZVertex = 15.;
      }
      if (useVtxTks) {

        for(ci=vertCollection.begin();ci!=vertCollection.end();ci++)
          for (reco::Vertex::trackRef_iterator trackIt =  ci->tracks_begin();trackIt !=  ci->tracks_end();trackIt++){
            reco::TrackRef iTrk =  (*trackIt).castTo<reco::TrackRef>() ;
            GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
            result.push_back(
                             new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(ci->z())),
                                                                  thePtMin, theOriginRadius, deltaZVertex, theDeltaEta, theDeltaPhi,
                                                                  m_howToUseMeasurementTracker,
                                                                  true,
                                                                  m_measurementTracker,
                                                                  m_searchOpt) );
          }
        return result;
      }
    }

    edm::Handle<reco::TrackCollection> trks;
    ev.getByLabel(theInputTrkSrc, trks);

    for(reco::TrackCollection::const_iterator iTrk = trks->begin();iTrk != trks->end();iTrk++) {
      GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
      result.push_back( 
          new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(originz)), 
                                               thePtMin, theOriginRadius, deltaZVertex, theDeltaEta, theDeltaPhi,
                                               m_howToUseMeasurementTracker,
                                               true,
                                               m_measurementTracker,
                                               m_searchOpt) );
    }
    return result;
  }

Member Data Documentation

Definition at line 122 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 121 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 123 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 119 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 120 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 110 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 116 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 115 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 117 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 114 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

std::string L3MumuTrackingRegion::theVertexSrc [private]

Definition at line 109 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

Definition at line 112 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().