test
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::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) overridefinal
 
 PATJetSlimmer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual ~PATJetSlimmer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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

const StringCutObjectSelector
< pat::Jet
dropDaughters_
 
const StringCutObjectSelector
< pat::Jet
dropJetVars_
 
const StringCutObjectSelector
< pat::Jet
dropSpecific_
 
const StringCutObjectSelector
< pat::Jet
dropTagInfos_
 
const StringCutObjectSelector
< pat::Jet
dropTrackRefs_
 
std::unique_ptr
< pat::ObjectModifier
< pat::Jet > > 
jetModifier_
 
const edm::EDGetTokenT
< edm::View< pat::Jet > > 
jets_
 
const bool modifyJet_
 
const edm::EDGetTokenT
< edm::Association
< pat::PackedCandidateCollection > > 
pf2pc_
 
const StringCutObjectSelector
< pat::Jet
rekeyDaughters_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 26 of file PATJetSlimmer.cc.

Constructor & Destructor Documentation

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

Definition at line 45 of file PATJetSlimmer.cc.

References edm::EDConsumerBase::consumesCollector(), and edm::ParameterSet::getParameter().

45  :
48  dropJetVars_(iConfig.getParameter<std::string>("dropJetVars")),
49  dropDaughters_(iConfig.getParameter<std::string>("dropDaughters")),
50  rekeyDaughters_(iConfig.getParameter<std::string>("rekeyDaughters")),
51  dropTrackRefs_(iConfig.getParameter<std::string>("dropTrackRefs")),
52  dropSpecific_(iConfig.getParameter<std::string>("dropSpecific")),
53  dropTagInfos_(iConfig.getParameter<std::string>("dropTagInfos")),
54  modifyJet_(iConfig.getParameter<bool>("modifyJets"))
55 {
57  if( modifyJet_ ) {
58  const edm::ParameterSet& mod_config = iConfig.getParameter<edm::ParameterSet>("modifierConfig");
59  jetModifier_.reset(new pat::ObjectModifier<pat::Jet>(mod_config) );
60  jetModifier_->setConsumes(sumes);
61  } else {
62  jetModifier_.reset(nullptr);
63  }
64  produces<std::vector<pat::Jet> >();
65 }
std::unique_ptr< pat::ObjectModifier< pat::Jet > > jetModifier_
T getParameter(std::string const &) const
const StringCutObjectSelector< pat::Jet > dropDaughters_
const StringCutObjectSelector< pat::Jet > dropTrackRefs_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const bool modifyJet_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const StringCutObjectSelector< pat::Jet > dropSpecific_
const StringCutObjectSelector< pat::Jet > dropTagInfos_
const StringCutObjectSelector< pat::Jet > rekeyDaughters_
const edm::EDGetTokenT< edm::View< pat::Jet > > jets_
const StringCutObjectSelector< pat::Jet > dropJetVars_
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
virtual pat::PATJetSlimmer::~PATJetSlimmer ( )
inlinevirtual

Definition at line 29 of file PATJetSlimmer.cc.

29 { }

Member Function Documentation

void pat::PATJetSlimmer::beginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup iSetup 
)
finaloverridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 68 of file PATJetSlimmer.cc.

References jetModifier_, and modifyJet_.

68  {
69  if( modifyJet_ ) jetModifier_->setEventContent(iSetup);
70 }
std::unique_ptr< pat::ObjectModifier< pat::Jet > > jetModifier_
const bool modifyJet_
void pat::PATJetSlimmer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 73 of file PATJetSlimmer.cc.

References reco::CompositePtrCandidate::addDaughter(), pat::Jet::caloTowersFwdPtr_, edm::OwnVector< T, P >::clear(), reco::CompositePtrCandidate::clearDaughters(), reco::CompositePtrCandidate::daughterPtrVector(), dropDaughters_, dropJetVars_, dropSpecific_, dropTagInfos_, dropTrackRefs_, edm::Event::getByToken(), i, metsig::jet, jetModifier_, jets_, relval_steps::key, modifyJet_, GenerateHcalLaserBadRunList::out, pf2pc_, pat::Jet::pfCandidatesFwdPtr_, edm::Event::put(), edm::refToPtr(), rekeyDaughters_, pat::Jet::setAssociatedTracks(), reco::Jet::setNPasses(), pat::Jet::specificCalo_, pat::Jet::specificPF_, alcazmumu_cfi::src, pat::Jet::tagInfoLabels_, pat::Jet::tagInfos_, and pat::Jet::tagInfosFwdPtr_.

73  {
74  using namespace edm;
75  using namespace std;
76 
78  iEvent.getByToken(jets_, src);
80  iEvent.getByToken(pf2pc_,pf2pc);
81 
82  auto_ptr<vector<pat::Jet> > out(new vector<pat::Jet>());
83  out->reserve(src->size());
84 
85  if( modifyJet_ ) { jetModifier_->setEvent(iEvent); }
86 
87  for (edm::View<pat::Jet>::const_iterator it = src->begin(), ed = src->end(); it != ed; ++it) {
88  out->push_back(*it);
89  pat::Jet & jet = out->back();
90 
91  if( modifyJet_ ) { jetModifier_->modify(jet); }
92 
93  if(dropTagInfos_(*it)){
94  jet.tagInfoLabels_.clear();
95  jet.tagInfos_.clear();
96  jet.tagInfosFwdPtr_.clear();
97  }
98  if (dropJetVars_(*it)) {
99  // jet.setJetArea(0);
100  jet.setNPasses(0);
101  // jet.setPileup(0);
102  }
103  if(dropTrackRefs_(*it))
104  {
106  }
107  if (dropDaughters_(*it)) {
108  jet.clearDaughters();
109  jet.pfCandidatesFwdPtr_.clear();
110  jet.caloTowersFwdPtr_.clear();
111  } else if (rekeyDaughters_(*it)) { //rekey
112  //copy old
114  jet.clearDaughters();
115  std::map<unsigned int,reco::CandidatePtr> ptrs;
116  for(unsigned int i=0;i<old.size();i++)
117  {
118  // jet.addDaughter(refToPtr((*pf2pc)[old[i]]));
119  ptrs[((*pf2pc)[old[i]]).key()]=refToPtr((*pf2pc)[old[i]]);
120  }
121  for(std::map<unsigned int,reco::CandidatePtr>::iterator itp=ptrs.begin();itp!=ptrs.end();itp++) //iterate on sorted items
122  {
123  jet.addDaughter(itp->second);
124  }
125 
126 
127  }
128  if (dropSpecific_(*it)) {
129  // FIXME add method in pat::Jet
130  jet.specificCalo_.clear();
131  jet.specificPF_.clear();
132  }
133  // if (dropJetCorrFactors_(*it)) {
134  // // FIXME add method in pat::Jet
135  // jet.jetEnergyCorrections_.clear();
136  // }
137  }
138 
139  iEvent.put(out);
140 }
std::unique_ptr< pat::ObjectModifier< pat::Jet > > jetModifier_
int i
Definition: DBlmapReader.cc:9
const StringCutObjectSelector< pat::Jet > dropDaughters_
CaloTowerFwdPtrVector caloTowersFwdPtr_
Definition: Jet.h:522
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:462
TagInfoFwdPtrCollection tagInfosFwdPtr_
Definition: Jet.h:562
const StringCutObjectSelector< pat::Jet > dropTrackRefs_
std::vector< PFSpecific > specificPF_
Definition: Jet.h:574
const bool modifyJet_
edm::OwnVector< reco::BaseTagInfo > tagInfos_
Definition: Jet.h:561
std::vector< CaloSpecific > specificCalo_
Definition: Jet.h:572
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
void clear()
Definition: OwnVector.h:451
const StringCutObjectSelector< pat::Jet > dropSpecific_
const StringCutObjectSelector< pat::Jet > dropTagInfos_
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::vector< std::string > tagInfoLabels_
Definition: Jet.h:560
std::vector< CandidatePtr > daughters
collection of references to daughters
const StringCutObjectSelector< pat::Jet > rekeyDaughters_
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:78
const edm::EDGetTokenT< edm::View< pat::Jet > > jets_
void clearDaughters()
clear daughter references
const StringCutObjectSelector< pat::Jet > dropJetVars_
virtual void setNPasses(int fPasses)
Set number of passes taken by algorithm.
Definition: Jet.h:113
reco::PFCandidateFwdPtrVector pfCandidatesFwdPtr_
Definition: Jet.h:528
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
const daughters & daughterPtrVector() const
references to daughtes
void addDaughter(const CandidatePtr &)
add a daughter via a reference

Member Data Documentation

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

Definition at line 37 of file PATJetSlimmer.cc.

Referenced by produce().

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

Definition at line 37 of file PATJetSlimmer.cc.

Referenced by produce().

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

Definition at line 37 of file PATJetSlimmer.cc.

Referenced by produce().

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

Definition at line 37 of file PATJetSlimmer.cc.

Referenced by produce().

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

Definition at line 37 of file PATJetSlimmer.cc.

Referenced by produce().

std::unique_ptr<pat::ObjectModifier<pat::Jet> > pat::PATJetSlimmer::jetModifier_
private

Definition at line 39 of file PATJetSlimmer.cc.

Referenced by beginLuminosityBlock(), and produce().

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

Definition at line 36 of file PATJetSlimmer.cc.

Referenced by produce().

const bool pat::PATJetSlimmer::modifyJet_
private

Definition at line 38 of file PATJetSlimmer.cc.

Referenced by beginLuminosityBlock(), and produce().

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

Definition at line 35 of file PATJetSlimmer.cc.

Referenced by produce().

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

Definition at line 37 of file PATJetSlimmer.cc.

Referenced by produce().