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
 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

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_
 

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  dropTrackRefs_(iConfig.getParameter<std::string>("dropTrackRefs")),
47  dropSpecific_(iConfig.getParameter<std::string>("dropSpecific")),
48  dropTagInfos_(iConfig.getParameter<std::string>("dropTagInfos"))
49 {
50  produces<std::vector<pat::Jet> >();
51 }
T getParameter(std::string const &) const
StringCutObjectSelector< pat::Jet > dropTrackRefs_
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
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 54 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, combine::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_.

54  {
55  using namespace edm;
56  using namespace std;
57 
59  iEvent.getByToken(jets_, src);
61  iEvent.getByToken(pf2pc_,pf2pc);
62 
63  auto_ptr<vector<pat::Jet> > out(new vector<pat::Jet>());
64  out->reserve(src->size());
65 
66  for (edm::View<pat::Jet>::const_iterator it = src->begin(), ed = src->end(); it != ed; ++it) {
67  out->push_back(*it);
68  pat::Jet & jet = out->back();
69  if(dropTagInfos_(*it)){
70  jet.tagInfos_.clear();
71  jet.tagInfosFwdPtr_.clear();
72  }
73  if (dropJetVars_(*it)) {
74  // jet.setJetArea(0);
75  jet.setNPasses(0);
76  // jet.setPileup(0);
77  }
78  if(dropTrackRefs_(*it))
79  {
81  }
82  if (dropDaughters_(*it)) {
83  jet.clearDaughters();
84  jet.pfCandidatesFwdPtr_.clear();
85  jet.caloTowersFwdPtr_.clear();
86  } else { //rekey
87  //copy old
89  jet.clearDaughters();
90  std::map<unsigned int,reco::CandidatePtr> ptrs;
91  for(unsigned int i=0;i<old.size();i++)
92  {
93  // jet.addDaughter(refToPtr((*pf2pc)[old[i]]));
94  ptrs[((*pf2pc)[old[i]]).key()]=refToPtr((*pf2pc)[old[i]]);
95  }
96  for(std::map<unsigned int,reco::CandidatePtr>::iterator itp=ptrs.begin();itp!=ptrs.end();itp++) //iterate on sorted items
97  {
98  jet.addDaughter(itp->second);
99  }
100 
101 
102  }
103  if (dropSpecific_(*it)) {
104  // FIXME add method in pat::Jet
105  jet.specificCalo_.clear();
106  jet.specificPF_.clear();
107  }
108  // if (dropJetCorrFactors_(*it)) {
109  // // FIXME add method in pat::Jet
110  // jet.jetEnergyCorrections_.clear();
111  // }
112  }
113 
114  iEvent.put(out);
115 }
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
CaloTowerFwdPtrVector caloTowersFwdPtr_
Definition: Jet.h:478
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:434
StringCutObjectSelector< pat::Jet > dropTrackRefs_
TagInfoFwdPtrCollection tagInfosFwdPtr_
Definition: Jet.h:514
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
std::vector< PFSpecific > specificPF_
Definition: Jet.h:526
edm::OwnVector< reco::BaseTagInfo > tagInfos_
Definition: Jet.h:513
void setAssociatedTracks(const reco::TrackRefVector &tracks)
method to set the vector of refs to the tracks associated to this jet
Definition: Jet.cc:427
std::vector< CaloSpecific > specificCalo_
Definition: Jet.h:524
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
StringCutObjectSelector< pat::Jet > dropSpecific_
void clear()
Definition: OwnVector.h:371
StringCutObjectSelector< pat::Jet > dropJetVars_
tuple out
Definition: dbtoconf.py:99
std::vector< CandidatePtr > daughters
collection of references to daughters
StringCutObjectSelector< pat::Jet > dropTagInfos_
Analysis-level calorimeter jet class.
Definition: Jet.h:73
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:484
list key
Definition: combine.py:13
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.