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::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

double assocCone_
 
edm::EDGetTokenT
< reco::TrackCollection
tok_cor_
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tok_uncor_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 23 of file IPTCorrector.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file IPTCorrector.cc.

References assocCone_, edm::ParameterSet::getParameter(), tok_cor_, and tok_uncor_.

21  {
22 
23  tok_cor_ = consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("corTracksLabel"));
24  tok_uncor_ = consumes<trigger::TriggerFilterObjectWithRefs>(config.getParameter<edm::InputTag>("filterLabel"));
25  assocCone_=config.getParameter<double>("associationCone");
26 
27  // Register the product
28  produces< reco::IsolatedPixelTrackCandidateCollection >();
29 
30 }
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_uncor_
Definition: IPTCorrector.h:35
double assocCone_
Definition: IPTCorrector.h:36
edm::EDGetTokenT< reco::TrackCollection > tok_cor_
Definition: IPTCorrector.h:34
IPTCorrector::~IPTCorrector ( )

Definition at line 32 of file IPTCorrector.cc.

32 {}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 35 of file IPTCorrector.cc.

References assocCone_, deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, edm::Event::getByToken(), AlCaHLTBitMon_ParallelJobs::p, edm::Event::put(), tok_cor_, tok_uncor_, and trigger::TriggerTrack.

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

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

Member Data Documentation

double IPTCorrector::assocCone_
private

Definition at line 36 of file IPTCorrector.h.

Referenced by IPTCorrector(), and produce().

edm::EDGetTokenT<reco::TrackCollection> IPTCorrector::tok_cor_
private

Definition at line 34 of file IPTCorrector.h.

Referenced by IPTCorrector(), and produce().

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> IPTCorrector::tok_uncor_
private

Definition at line 35 of file IPTCorrector.h.

Referenced by IPTCorrector(), and produce().