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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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, fastmath::etaphi(), edm::Event::getByToken(), HLT_25ns14e33_v1_cff::minDR, AlCaHLTBitMon_ParallelJobs::p, edm::Event::put(), reco::IsolatedPixelTrackCandidate::setEnergyIn(), tok_cor_, tok_uncor_, HLT_25ns14e33_v3_cff::trackCollection, 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  double iptEta=isoPixTrackRefs[p]->track()->eta();
55  double iptPhi=isoPixTrackRefs[p]->track()->phi();
56 
57  int ntrk=0;
58  double minDR=100;
59  reco::TrackCollection::const_iterator citSel;
60 
61  for (reco::TrackCollection::const_iterator cit=corTracks->begin(); cit!=corTracks->end(); cit++) {
62  double dR=deltaR(cit->eta(), cit->phi(), iptEta, iptPhi);
63  if (dR<minDR&&dR<assocCone_) {
64  minDR=dR;
65  ntrk++;
66  citSel=cit;
67  }
68  }
69 
70  if (ntrk>0) {
71  reco::IsolatedPixelTrackCandidate newCandidate(reco::TrackRef(corTracks,citSel-corTracks->begin()), isoPixTrackRefs[p]->l1tau(),isoPixTrackRefs[p]->maxPtPxl(), isoPixTrackRefs[p]->sumPtPxl());
72  newCandidate.setEnergyIn(isoPixTrackRefs[p]->energyIn());
73  newCandidate.setEnergyOut(isoPixTrackRefs[p]->energyOut());
74  newCandidate.setNHitIn(isoPixTrackRefs[p]->nHitIn());
75  newCandidate.setNHitOut(isoPixTrackRefs[p]->nHitOut());
76  if (isoPixTrackRefs[p]->etaPhiEcalValid()) {
77  std::pair<double,double> etaphi = (isoPixTrackRefs[p]->etaPhiEcal());
78  newCandidate.setEtaPhiEcal(etaphi.first,etaphi.second);
79  }
80  trackCollection->push_back(newCandidate);
81  }
82  }
83 
84  // put the product in the event
85  std::auto_ptr< reco::IsolatedPixelTrackCandidateCollection > outCollection(trackCollection);
86  theEvent.put(outCollection);
87 
88 
89 }
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_uncor_
Definition: IPTCorrector.h:35
std::pair< T, T > etaphi(T x, T y, T z)
Definition: FastMath.h:128
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().