CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
IPTCorrector Class Reference

#include <IPTCorrector.h>

Inheritance diagram for IPTCorrector:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 IPTCorrector (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &evt, const edm::EventSetup &es)
 
 ~IPTCorrector ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

double assocCone_
 
edm::InputTag corSource_
 
edm::InputTag uncorSource_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 22 of file IPTCorrector.h.

Constructor & Destructor Documentation

IPTCorrector::IPTCorrector ( const edm::ParameterSet ps)

Definition at line 22 of file IPTCorrector.cc.

References assocCone_, corSource_, edm::ParameterSet::getParameter(), and uncorSource_.

22  {
23 
24  corSource_=config.getParameter<edm::InputTag>("corTracksLabel");
25  uncorSource_=config.getParameter<edm::InputTag>("filterLabel");
26  assocCone_=config.getParameter<double>("associationCone");
27 
28  // Register the product
29  produces< reco::IsolatedPixelTrackCandidateCollection >();
30 
31 }
edm::InputTag corSource_
Definition: IPTCorrector.h:33
edm::InputTag uncorSource_
Definition: IPTCorrector.h:34
tuple config
Definition: cmsDriver.py:17
double assocCone_
Definition: IPTCorrector.h:35
IPTCorrector::~IPTCorrector ( )

Definition at line 33 of file IPTCorrector.cc.

33 {}

Member Function Documentation

void IPTCorrector::produce ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 36 of file IPTCorrector.cc.

References assocCone_, corSource_, deltaR(), edm::Event::getByLabel(), L1TEmulatorMonitor_cff::p, edm::Event::put(), ExpressReco_HICollisions_FallBack::trackCollection, trigger::TriggerTrack, and uncorSource_.

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().

36  {
37 
39 
41  theEvent.getByLabel(corSource_,corTracks);
42 
44  theEvent.getByLabel(uncorSource_,fiCand);
45 
46  std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
47 
48  fiCand->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
49 
50  int nCand=isoPixTrackRefs.size();
51 
52  //loop over input ipt
53 
54  for (int p=0; p<nCand; p++)
55  {
56  double iptEta=isoPixTrackRefs[p]->track()->eta();
57  double iptPhi=isoPixTrackRefs[p]->track()->phi();
58 
59  int ntrk=0;
60  double minDR=100;
61  reco::TrackCollection::const_iterator citSel;
62 
63  for (reco::TrackCollection::const_iterator cit=corTracks->begin(); cit!=corTracks->end(); cit++)
64  {
65  double dR=deltaR(cit->eta(), cit->phi(), iptEta, iptPhi);
66  if (dR<minDR&&dR<assocCone_)
67  {
68  minDR=dR;
69  ntrk++;
70  citSel=cit;
71  }
72  }
73 
74  if (ntrk>0)
75  {
76  reco::IsolatedPixelTrackCandidate newCandidate(reco::TrackRef(corTracks,citSel-corTracks->begin()), isoPixTrackRefs[p]->l1tau(),isoPixTrackRefs[p]->maxPtPxl(), isoPixTrackRefs[p]->sumPtPxl());
77  trackCollection->push_back(newCandidate);
78  }
79  }
80 
81  // put the product in the event
82  std::auto_ptr< reco::IsolatedPixelTrackCandidateCollection > outCollection(trackCollection);
83  theEvent.put(outCollection);
84 
85 
86 }
edm::InputTag corSource_
Definition: IPTCorrector.h:33
std::vector< IsolatedPixelTrackCandidate > IsolatedPixelTrackCandidateCollection
collectin of IsolatedPixelTrackCandidate objects
edm::InputTag uncorSource_
Definition: IPTCorrector.h:34
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double assocCone_
Definition: IPTCorrector.h:35

Member Data Documentation

double IPTCorrector::assocCone_
private

Definition at line 35 of file IPTCorrector.h.

Referenced by IPTCorrector(), and produce().

edm::InputTag IPTCorrector::corSource_
private

Definition at line 33 of file IPTCorrector.h.

Referenced by IPTCorrector(), and produce().

edm::InputTag IPTCorrector::uncorSource_
private

Definition at line 34 of file IPTCorrector.h.

Referenced by IPTCorrector(), and produce().