CMS 3D CMS Logo

IsolatedPixelTrackCandidateProducer Class Reference

#include <Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateProducer.h>

Inheritance diagram for IsolatedPixelTrackCandidateProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void beginJob (edm::EventSetup const &es)
 IsolatedPixelTrackCandidateProducer (const edm::ParameterSet &ps)
virtual void produce (edm::Event &evt, const edm::EventSetup &es)
 ~IsolatedPixelTrackCandidateProducer ()

Private Attributes

edm::InputTag hltGTseedlabel_
edm::InputTag l1eTauJetsSource_
edm::ParameterSet parameters
double pixelIsolationConeSize_
double pixelIsolationConeSizeHB_
double pixelIsolationConeSizeHE_
edm::InputTag pixelTracksSource_
double tauAssocCone_
double tauUnbiasCone_
edm::InputTag vertexLabel_
double vtxCutIsol_
double vtxCutSeed_


Detailed Description

Definition at line 26 of file IsolatedPixelTrackCandidateProducer.h.


Constructor & Destructor Documentation

IsolatedPixelTrackCandidateProducer::IsolatedPixelTrackCandidateProducer ( const edm::ParameterSet ps  ) 

Definition at line 37 of file IsolatedPixelTrackCandidateProducer.cc.

References edm::ParameterSet::getParameter(), hltGTseedlabel_, l1eTauJetsSource_, pixelIsolationConeSizeHB_, pixelIsolationConeSizeHE_, pixelTracksSource_, tauAssocCone_, tauUnbiasCone_, vertexLabel_, vtxCutIsol_, and vtxCutSeed_.

00037                                                                                                      {
00038    
00039   l1eTauJetsSource_=config.getParameter<edm::InputTag>("L1eTauJetsSource");
00040   tauAssocCone_=config.getParameter<double>("tauAssociationCone"); 
00041   tauUnbiasCone_ = config.getParameter<double>("tauUnbiasCone");
00042   pixelTracksSource_=config.getParameter<edm::InputTag>("PixelTracksSource");
00043   pixelIsolationConeSizeHB_=config.getParameter<double>("PixelIsolationConeSizeHB");
00044   pixelIsolationConeSizeHE_=config.getParameter<double>("PixelIsolationConeSizeHE");
00045   hltGTseedlabel_=config.getParameter<edm::InputTag>("L1GTSeedLabel");
00046   vtxCutSeed_=config.getParameter<double>("MaxVtxDXYSeed");
00047   vtxCutIsol_=config.getParameter<double>("MaxVtxDXYIsol");
00048   vertexLabel_=config.getParameter<edm::InputTag>("VertexLabel");
00049   
00050   // Register the product
00051   produces< reco::IsolatedPixelTrackCandidateCollection >();
00052 
00053 }

IsolatedPixelTrackCandidateProducer::~IsolatedPixelTrackCandidateProducer (  ) 

Definition at line 55 of file IsolatedPixelTrackCandidateProducer.cc.

00055                                                                           {
00056 
00057 }


Member Function Documentation

virtual void IsolatedPixelTrackCandidateProducer::beginJob ( edm::EventSetup const &  es  )  [inline, virtual]

Reimplemented from edm::EDProducer.

Definition at line 34 of file IsolatedPixelTrackCandidateProducer.h.

00034 {};

void IsolatedPixelTrackCandidateProducer::produce ( edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 60 of file IsolatedPixelTrackCandidateProducer.cc.

References dPhi(), edm::Event::getByLabel(), hltGTseedlabel_, l1eTauJetsSource_, p, pixelIsolationConeSize_, pixelIsolationConeSizeHB_, pixelIsolationConeSizeHE_, PixelTracks_cfi::pixelTracks, pixelTracksSource_, funct::pow(), edm::Event::put(), dttmaxenums::R, funct::sqrt(), tauAssocCone_, tauUnbiasCone_, track, trigger::TriggerL1CenJet, trigger::TriggerL1TauJet, vertexLabel_, vtxCutIsol_, and vtxCutSeed_.

00060                                                                                                         {
00061 
00062   using namespace edm;
00063   using namespace l1extra;
00064 
00065   reco::IsolatedPixelTrackCandidateCollection * trackCollection=new reco::IsolatedPixelTrackCandidateCollection;
00066 
00067   edm::Handle<reco::TrackCollection> pixelTracks;
00068   theEvent.getByLabel(pixelTracksSource_,pixelTracks);
00069 
00070   edm::Handle<l1extra::L1JetParticleCollection> l1eTauJets;
00071   theEvent.getByLabel(l1eTauJetsSource_,l1eTauJets);
00072 
00073   edm::Handle<reco::VertexCollection> pVert;
00074   theEvent.getByLabel(vertexLabel_,pVert);
00075 
00076   double ptTriggered=-10;
00077   double etaTriggered=-100;
00078   double phiTriggered=-100;
00079   
00080   Handle<trigger::TriggerFilterObjectWithRefs> l1trigobj;
00081   theEvent.getByLabel(hltGTseedlabel_, l1trigobj);
00082   
00083   std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
00084   std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
00085   
00086   l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
00087   l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
00088   
00089   for (unsigned int p=0; p<l1tauobjref.size(); p++)
00090     {
00091       if (l1tauobjref[p]->pt()>ptTriggered)
00092         {
00093           ptTriggered=l1tauobjref[p]->pt(); 
00094           phiTriggered=l1tauobjref[p]->phi();
00095           etaTriggered=l1tauobjref[p]->eta();
00096         }
00097     }
00098   
00099   for (unsigned int p=0; p<l1jetobjref.size(); p++)
00100     {
00101       if (l1jetobjref[p]->pt()>ptTriggered)
00102         {
00103           ptTriggered=l1jetobjref[p]->pt();
00104           phiTriggered=l1jetobjref[p]->phi();
00105           etaTriggered=l1jetobjref[p]->eta();
00106         }
00107     }
00108 
00109   double minPtTrack_=2;
00110   double drMaxL1Track_=tauAssocCone_;
00111   
00112   int ntr=0;
00113   
00114   //loop to select isolated tracks
00115   for (reco::TrackCollection::const_iterator track=pixelTracks->begin(); track!=pixelTracks->end(); track++) 
00116     {
00117       if(track->pt()<minPtTrack_) continue;
00118 
00119       if (fabs(track->eta())<1.479) pixelIsolationConeSize_=pixelIsolationConeSizeHB_;
00120       else pixelIsolationConeSize_=pixelIsolationConeSizeHE_;
00121 
00122       bool good=false;
00123       bool vtxMatch=false;
00124 
00125       reco::VertexCollection::const_iterator vitSel;
00126       double minDXY=100;
00127       for (reco::VertexCollection::const_iterator vit=pVert->begin(); vit!=pVert->end(); vit++)
00128         {
00129           if (fabs(track->dxy(vit->position()))<minDXY)
00130             {
00131               minDXY= fabs(track->dxy(vit->position()));
00132               vitSel=vit;
00133             }
00134         }
00135 
00136       if (minDXY<vtxCutSeed_) vtxMatch=true;
00137       
00138       //selected tracks should match L1 taus
00139       
00140       bool tmatch=false;
00141       
00142       //select tracks not matched to triggered L1 jet
00143       double dPhi=fabs(track->phi()-phiTriggered);
00144       if (dPhi>3.1415926535) dPhi=2*3.1415926535-dPhi;
00145       double R=sqrt(dPhi*dPhi+pow(track->eta()-etaTriggered,2));
00146       if (R<tauUnbiasCone_) continue;
00147       
00148       //check taujet matching
00149       l1extra::L1JetParticleCollection::const_iterator selj;
00150       for (l1extra::L1JetParticleCollection::const_iterator tj=l1eTauJets->begin(); tj!=l1eTauJets->end(); tj++) 
00151         {
00152           if(ROOT::Math::VectorUtil::DeltaR(track->momentum(),tj->momentum()) > drMaxL1Track_) continue;
00153           selj=tj;
00154           tmatch=true;
00155       
00156         } //loop over L1 tau
00157       
00158       //calculate isolation
00159       double maxPt=0;
00160       double sumPt=0;
00161       for (reco::TrackCollection::const_iterator track2=pixelTracks->begin(); track2!=pixelTracks->end(); track2++) 
00162         {
00163           if(track2!=track && ROOT::Math::VectorUtil::DeltaR(track->momentum(),track2->momentum())<pixelIsolationConeSize_)
00164             {
00165               minDXY=100;
00166               for (reco::VertexCollection::const_iterator vit=pVert->begin(); vit!=pVert->end(); vit++)
00167                 {
00168                   if (fabs(track2->dxy(vit->position()))<minDXY)
00169                     {
00170                       minDXY= fabs(track2->dxy(vit->position()));
00171                     }
00172                 }
00173               if (minDXY>vtxCutIsol_) continue;
00174               sumPt+=track2->pt();
00175               if(track2->pt()>maxPt) maxPt=track2->pt();
00176             }
00177         }
00178 
00179       if (tmatch) good=true;
00180       if (!tmatch&&vtxMatch) good=true;
00181 
00182       if (good&&maxPt<5)
00183         {
00184           reco::IsolatedPixelTrackCandidate newCandidate(reco::TrackRef(pixelTracks,track-pixelTracks->begin()), l1extra::L1JetParticleRef(l1eTauJets,selj-l1eTauJets->begin()), maxPt, sumPt);
00185           trackCollection->push_back(newCandidate);
00186           ntr++;
00187         }
00188       
00189     }//loop over pixel tracks
00190   
00191   // put the product in the event
00192   std::auto_ptr< reco::IsolatedPixelTrackCandidateCollection > outCollection(trackCollection);
00193   theEvent.put(outCollection);
00194 
00195 
00196 }


Member Data Documentation

edm::InputTag IsolatedPixelTrackCandidateProducer::hltGTseedlabel_ [private]

Definition at line 39 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

edm::InputTag IsolatedPixelTrackCandidateProducer::l1eTauJetsSource_ [private]

Definition at line 40 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

edm::ParameterSet IsolatedPixelTrackCandidateProducer::parameters [private]

Definition at line 43 of file IsolatedPixelTrackCandidateProducer.h.

double IsolatedPixelTrackCandidateProducer::pixelIsolationConeSize_ [private]

Definition at line 45 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by produce().

double IsolatedPixelTrackCandidateProducer::pixelIsolationConeSizeHB_ [private]

Definition at line 46 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

double IsolatedPixelTrackCandidateProducer::pixelIsolationConeSizeHE_ [private]

Definition at line 47 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

edm::InputTag IsolatedPixelTrackCandidateProducer::pixelTracksSource_ [private]

Definition at line 41 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

double IsolatedPixelTrackCandidateProducer::tauAssocCone_ [private]

Definition at line 50 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

double IsolatedPixelTrackCandidateProducer::tauUnbiasCone_ [private]

Definition at line 51 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

edm::InputTag IsolatedPixelTrackCandidateProducer::vertexLabel_ [private]

Definition at line 42 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

double IsolatedPixelTrackCandidateProducer::vtxCutIsol_ [private]

Definition at line 49 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().

double IsolatedPixelTrackCandidateProducer::vtxCutSeed_ [private]

Definition at line 48 of file IsolatedPixelTrackCandidateProducer.h.

Referenced by IsolatedPixelTrackCandidateProducer(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:56 2009 for CMSSW by  doxygen 1.5.4