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
pat::PATJetSlimmer Class Reference

Matcher of reconstructed objects to L1 Muons. More...

Inheritance diagram for pat::PATJetSlimmer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATJetSlimmer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual ~PATJetSlimmer ()
 
- 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

StringCutObjectSelector< pat::JetdropDaughters_
 
StringCutObjectSelector< pat::JetdropJetVars_
 
StringCutObjectSelector< pat::JetdropSpecific_
 
StringCutObjectSelector< pat::JetdropTagInfos_
 
StringCutObjectSelector< pat::JetdropTrackRefs_
 
edm::EDGetTokenT< edm::View
< pat::Jet > > 
jets_
 
edm::EDGetTokenT
< edm::Association
< pat::PackedCandidateCollection > > 
pf2pc_
 
StringCutObjectSelector< pat::JetrekeyDaughters_
 

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

Matcher of reconstructed objects to L1 Muons.

Author
Giovanni Petrucciani

Definition at line 25 of file PATJetSlimmer.cc.

Constructor & Destructor Documentation

pat::PATJetSlimmer::PATJetSlimmer ( const edm::ParameterSet iConfig)
explicit

Definition at line 41 of file PATJetSlimmer.cc.

41  :
44  dropJetVars_(iConfig.getParameter<std::string>("dropJetVars")),
45  dropDaughters_(iConfig.getParameter<std::string>("dropDaughters")),
46  rekeyDaughters_(iConfig.getParameter<std::string>("rekeyDaughters")),
47  dropTrackRefs_(iConfig.getParameter<std::string>("dropTrackRefs")),
48  dropSpecific_(iConfig.getParameter<std::string>("dropSpecific")),
49  dropTagInfos_(iConfig.getParameter<std::string>("dropTagInfos"))
50 {
51  produces<std::vector<pat::Jet> >();
52 }
T getParameter(std::string const &) const
StringCutObjectSelector< pat::Jet > dropTrackRefs_
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
StringCutObjectSelector< pat::Jet > rekeyDaughters_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
StringCutObjectSelector< pat::Jet > dropSpecific_
StringCutObjectSelector< pat::Jet > dropJetVars_
StringCutObjectSelector< pat::Jet > dropTagInfos_
StringCutObjectSelector< pat::Jet > dropDaughters_
virtual pat::PATJetSlimmer::~PATJetSlimmer ( )
inlinevirtual

Definition at line 28 of file PATJetSlimmer.cc.

28 { }

Member Function Documentation

void pat::PATJetSlimmer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 55 of file PATJetSlimmer.cc.

References reco::CompositePtrCandidate::addDaughter(), pat::Jet::caloTowersFwdPtr_, edm::OwnVector< T, P >::clear(), reco::CompositePtrCandidate::clearDaughters(), reco::CompositePtrCandidate::daughterPtrVector(), edm::Event::getByToken(), i, metsig::jet, relval_steps::key, dbtoconf::out, pat::Jet::pfCandidatesFwdPtr_, edm::Event::put(), edm::refToPtr(), pat::Jet::setAssociatedTracks(), reco::Jet::setNPasses(), pat::Jet::specificCalo_, pat::Jet::specificPF_, alcazmumu_cfi::src, pat::Jet::tagInfos_, and pat::Jet::tagInfosFwdPtr_.

55  {
56  using namespace edm;
57  using namespace std;
58 
60  iEvent.getByToken(jets_, src);
62  iEvent.getByToken(pf2pc_,pf2pc);
63 
64  auto_ptr<vector<pat::Jet> > out(new vector<pat::Jet>());
65  out->reserve(src->size());
66 
67  for (edm::View<pat::Jet>::const_iterator it = src->begin(), ed = src->end(); it != ed; ++it) {
68  out->push_back(*it);
69  pat::Jet & jet = out->back();
70  if(dropTagInfos_(*it)){
71  jet.tagInfos_.clear();
72  jet.tagInfosFwdPtr_.clear();
73  }
74  if (dropJetVars_(*it)) {
75  // jet.setJetArea(0);
76  jet.setNPasses(0);
77  // jet.setPileup(0);
78  }
79  if(dropTrackRefs_(*it))
80  {
82  }
83  if (dropDaughters_(*it)) {
84  jet.clearDaughters();
85  jet.pfCandidatesFwdPtr_.clear();
86  jet.caloTowersFwdPtr_.clear();
87  } else if (rekeyDaughters_(*it)) { //rekey
88  //copy old
90  jet.clearDaughters();
91  std::map<unsigned int,reco::CandidatePtr> ptrs;
92  for(unsigned int i=0;i<old.size();i++)
93  {
94  // jet.addDaughter(refToPtr((*pf2pc)[old[i]]));
95  ptrs[((*pf2pc)[old[i]]).key()]=refToPtr((*pf2pc)[old[i]]);
96  }
97  for(std::map<unsigned int,reco::CandidatePtr>::iterator itp=ptrs.begin();itp!=ptrs.end();itp++) //iterate on sorted items
98  {
99  jet.addDaughter(itp->second);
100  }
101 
102 
103  }
104  if (dropSpecific_(*it)) {
105  // FIXME add method in pat::Jet
106  jet.specificCalo_.clear();
107  jet.specificPF_.clear();
108  }
109  // if (dropJetCorrFactors_(*it)) {
110  // // FIXME add method in pat::Jet
111  // jet.jetEnergyCorrections_.clear();
112  // }
113  }
114 
115  iEvent.put(out);
116 }
int i
Definition: DBlmapReader.cc:9
CaloTowerFwdPtrVector caloTowersFwdPtr_
Definition: Jet.h:520
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
Definition: RefToPtr.h:18
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
StringCutObjectSelector< pat::Jet > dropTrackRefs_
TagInfoFwdPtrCollection tagInfosFwdPtr_
Definition: Jet.h:560
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
StringCutObjectSelector< pat::Jet > rekeyDaughters_
std::vector< PFSpecific > specificPF_
Definition: Jet.h:572
edm::OwnVector< reco::BaseTagInfo > tagInfos_
Definition: Jet.h:559
std::vector< CaloSpecific > specificCalo_
Definition: Jet.h:570
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
StringCutObjectSelector< pat::Jet > dropSpecific_
void clear()
Definition: OwnVector.h:377
StringCutObjectSelector< pat::Jet > dropJetVars_
tuple out
Definition: dbtoconf.py:99
std::vector< CandidatePtr > daughters
collection of references to daughters
StringCutObjectSelector< pat::Jet > dropTagInfos_
void setAssociatedTracks(const reco::TrackRefVector &tracks)
method to set the vector of refs to the tracks associated to this jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
void clearDaughters()
clear daughter references
virtual void setNPasses(int fPasses)
Set number of passes taken by algorithm.
Definition: Jet.h:113
reco::PFCandidateFwdPtrVector pfCandidatesFwdPtr_
Definition: Jet.h:526
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
const daughters & daughterPtrVector() const
references to daughtes
void addDaughter(const CandidatePtr &)
add a daughter via a reference
StringCutObjectSelector< pat::Jet > dropDaughters_

Member Data Documentation

StringCutObjectSelector<pat::Jet> pat::PATJetSlimmer::dropDaughters_
private

Definition at line 35 of file PATJetSlimmer.cc.

StringCutObjectSelector<pat::Jet> pat::PATJetSlimmer::dropJetVars_
private

Definition at line 35 of file PATJetSlimmer.cc.

StringCutObjectSelector<pat::Jet> pat::PATJetSlimmer::dropSpecific_
private

Definition at line 35 of file PATJetSlimmer.cc.

StringCutObjectSelector<pat::Jet> pat::PATJetSlimmer::dropTagInfos_
private

Definition at line 35 of file PATJetSlimmer.cc.

StringCutObjectSelector<pat::Jet> pat::PATJetSlimmer::dropTrackRefs_
private

Definition at line 35 of file PATJetSlimmer.cc.

edm::EDGetTokenT<edm::View<pat::Jet> > pat::PATJetSlimmer::jets_
private

Definition at line 34 of file PATJetSlimmer.cc.

edm::EDGetTokenT<edm::Association<pat::PackedCandidateCollection> > pat::PATJetSlimmer::pf2pc_
private

Definition at line 33 of file PATJetSlimmer.cc.

StringCutObjectSelector<pat::Jet> pat::PATJetSlimmer::rekeyDaughters_
private

Definition at line 35 of file PATJetSlimmer.cc.