CMS 3D CMS Logo

Public Member Functions | Private Attributes

HITRegionalPixelSeedGenerator Class Reference

#include <HITRegionalPixelSeedGenerator.h>

Inheritance diagram for HITRegionalPixelSeedGenerator:
TrackingRegionProducer

List of all members.

Public Member Functions

 HITRegionalPixelSeedGenerator (const edm::ParameterSet &conf_)
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &e, const edm::EventSetup &es) const
virtual ~HITRegionalPixelSeedGenerator ()

Private Attributes

edm::ParameterSet conf_
float deltaL1JetEta
float deltaL1JetPhi
float deltaTrackEta
float deltaTrackPhi
double etaCenter_
bool fixedReg_
float halflength
edm::InputTag isoTracksrc_
edm::InputTag l1jetsrc_
float originradius
double phiCenter_
float ptmin
edm::InputTag tracksrc_
bool useIsoTracks_
bool usejets_
bool usetracks_
std::string vertexSrc

Detailed Description

Definition at line 35 of file HITRegionalPixelSeedGenerator.h.


Constructor & Destructor Documentation

HITRegionalPixelSeedGenerator::HITRegionalPixelSeedGenerator ( const edm::ParameterSet conf_) [inline, explicit]

Definition at line 38 of file HITRegionalPixelSeedGenerator.h.

References deltaL1JetEta, deltaL1JetPhi, deltaTrackEta, deltaTrackPhi, etaCenter_, fixedReg_, edm::ParameterSet::getParameter(), halflength, isoTracksrc_, l1jetsrc_, originradius, phiCenter_, ptmin, tracksrc_, useIsoTracks_, usejets_, usetracks_, and vertexSrc.

  {
    edm::LogInfo ("HITRegionalPixelSeedGenerator")<<"Enter the HITRegionalPixelSeedGenerator";
    
    edm::ParameterSet regionPSet = conf_.getParameter<edm::ParameterSet>("RegionPSet");
    
    ptmin=regionPSet.getParameter<double>("ptMin");
    originradius=regionPSet.getParameter<double>("originRadius");
    halflength=regionPSet.getParameter<double>("originHalfLength");
    vertexSrc=regionPSet.getParameter<std::string>("vertexSrc");
    etaCenter_=regionPSet.getParameter<double>("etaCenter");
    phiCenter_=regionPSet.getParameter<double>("phiCenter");
    deltaTrackEta = regionPSet.getParameter<double>("deltaEtaTrackRegion");
    deltaTrackPhi = regionPSet.getParameter<double>("deltaPhiTrackRegion");
    deltaL1JetEta = regionPSet.getParameter<double>("deltaEtaL1JetRegion");
    deltaL1JetPhi = regionPSet.getParameter<double>("deltaPhiL1JetRegion");
    tracksrc_ = regionPSet.getParameter<edm::InputTag>("trackSrc");
    isoTracksrc_ = regionPSet.getParameter<edm::InputTag>("isoTrackSrc");
    l1jetsrc_ = regionPSet.getParameter<edm::InputTag>("l1tjetSrc");
    usejets_ = regionPSet.getParameter<bool>("useL1Jets");
    usetracks_ = regionPSet.getParameter<bool>("useTracks");
    useIsoTracks_ = regionPSet.getParameter<bool>("useIsoTracks");
    fixedReg_ = regionPSet.getParameter<bool>("fixedReg");
  }
virtual HITRegionalPixelSeedGenerator::~HITRegionalPixelSeedGenerator ( ) [inline, virtual]

Definition at line 63 of file HITRegionalPixelSeedGenerator.h.

{}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 66 of file HITRegionalPixelSeedGenerator.h.

References funct::cos(), deltaL1JetEta, deltaL1JetPhi, deltaTrackEta, deltaTrackPhi, etaCenter_, funct::exp(), fixedReg_, edm::Event::getByLabel(), halflength, isoTracksrc_, analyzePatCleaning_cfg::jets, l1jetsrc_, originradius, L1TEmulatorMonitor_cff::p, phiCenter_, edm::Handle< T >::product(), ptmin, query::result, funct::sin(), testEve_cfg::tracks, tracksrc_, trigger::TriggerTrack, useIsoTracks_, usejets_, usetracks_, and vertexSrc.

    {
      std::vector<TrackingRegion* > result;
      float originz =0.;
      
      double deltaZVertex =  halflength;
      
      
      
      if (usetracks_)
        {
          edm::Handle<reco::TrackCollection> tracks;
          e.getByLabel(tracksrc_, tracks);
          
          edm::Handle<reco::VertexCollection> vertices;
          e.getByLabel(vertexSrc,vertices);
          const reco::VertexCollection vertCollection = *(vertices.product());
          reco::VertexCollection::const_iterator ci = vertCollection.begin();
          
          if(vertCollection.size() > 0) 
            {
              originz = ci->z();
            }
          else
            {
              deltaZVertex = 15.;
            }
      
          GlobalVector globalVector(0,0,1);
          if(tracks->size() == 0) return result;
          
          reco::TrackCollection::const_iterator itr = tracks->begin();
          for(;itr != tracks->end();itr++)
            {
              
              GlobalVector ptrVec((itr)->px(),(itr)->py(),(itr)->pz());
              globalVector = ptrVec;
              
              
              RectangularEtaPhiTrackingRegion* etaphiRegion = new  RectangularEtaPhiTrackingRegion(globalVector,
                                                                                                   GlobalPoint(0,0,originz), 
                                                                                                   ptmin,
                                                                                                   originradius,
                                                                                                   deltaZVertex,
                                                                                                   deltaTrackEta,
                                                                                                   deltaTrackPhi);
              result.push_back(etaphiRegion);
              
            }
        }
      
      if (useIsoTracks_)
        {
          edm::Handle<trigger::TriggerFilterObjectWithRefs> isotracks;
          e.getByLabel(isoTracksrc_, isotracks);

          std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
        
          isotracks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
          
          edm::Handle<reco::VertexCollection> vertices;
          e.getByLabel(vertexSrc,vertices);
          const reco::VertexCollection vertCollection = *(vertices.product());
          reco::VertexCollection::const_iterator ci = vertCollection.begin();

          if(vertCollection.size() > 0) 
            {
              originz = ci->z();
            }
          else
            {
              deltaZVertex = 15.;
            }
          
          GlobalVector globalVector(0,0,1);
          if(isoPixTrackRefs.size() == 0) return result;
          
          for(uint32_t p=0; p<isoPixTrackRefs.size(); p++)
            {
              GlobalVector ptrVec((isoPixTrackRefs[p]->track())->px(),(isoPixTrackRefs[p]->track())->py(),(isoPixTrackRefs[p]->track())->pz());
              globalVector = ptrVec;
              
              RectangularEtaPhiTrackingRegion* etaphiRegion = new  RectangularEtaPhiTrackingRegion(globalVector,
                                                                                                   GlobalPoint(0,0,originz),
                                                                                                   ptmin,
                                                                                                   originradius,
                                                                                                   deltaZVertex,
                                                                                                   deltaTrackEta,
                                                                                                   deltaTrackPhi);
              result.push_back(etaphiRegion);
            }
        }
      
      if (usejets_)
        {
          edm::Handle<l1extra::L1JetParticleCollection> jets;
          e.getByLabel(l1jetsrc_, jets);
          
          edm::Handle<reco::VertexCollection> vertices;
          e.getByLabel(vertexSrc,vertices);
          const reco::VertexCollection vertCollection = *(vertices.product());
          reco::VertexCollection::const_iterator ci = vertCollection.begin();
          if(vertCollection.size() > 0) 
            {
              originz = ci->z();
            }
          else
            {
              deltaZVertex = 15.;
            }

          GlobalVector globalVector(0,0,1);
          if(jets->size() == 0) return result;
          
          for (l1extra::L1JetParticleCollection::const_iterator iJet = jets->begin(); iJet != jets->end(); iJet++) 
            {
              GlobalVector jetVector(iJet->p4().x(), iJet->p4().y(), iJet->p4().z());
              GlobalPoint  vertex(0, 0, originz);
              
              RectangularEtaPhiTrackingRegion* etaphiRegion = new RectangularEtaPhiTrackingRegion( jetVector,
                                                                                                   vertex,
                                                                                                   ptmin,
                                                                                                   originradius,
                                                                                                   deltaZVertex,
                                                                                                   deltaL1JetEta,
                                                                                                   deltaL1JetPhi );
              result.push_back(etaphiRegion);
            }
        }
      if (fixedReg_)
        {
          GlobalVector fixedVector(cos(phiCenter_)*sin(2*atan(exp(-etaCenter_))), sin(phiCenter_)*sin(2*atan(exp(-etaCenter_))), cos(2*atan(exp(-etaCenter_))));
          GlobalPoint  vertex(0, 0, originz);
          
          edm::Handle<reco::VertexCollection> vertices;
          e.getByLabel(vertexSrc,vertices);
          const reco::VertexCollection vertCollection = *(vertices.product());
          reco::VertexCollection::const_iterator ci = vertCollection.begin();
          if(vertCollection.size() > 0) 
            {
              originz = ci->z();
            }
          else
            {
              deltaZVertex = 15.;
            }
          
          RectangularEtaPhiTrackingRegion* etaphiRegion = new RectangularEtaPhiTrackingRegion( fixedVector,
                                                                                               vertex,
                                                                                               ptmin,
                                                                                               originradius,
                                                                                               deltaZVertex,
                                                                                               deltaL1JetEta,
                                                                                               deltaL1JetPhi );
          result.push_back(etaphiRegion);
        }
      
      return result;
    }

Member Data Documentation

Definition at line 228 of file HITRegionalPixelSeedGenerator.h.

Definition at line 237 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 238 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 235 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 236 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 233 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 245 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 232 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 240 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 242 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 231 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 234 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 230 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 239 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 246 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 243 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 244 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

Definition at line 241 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().