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
PileupSummaryInfoSlimmer Class Reference
Inheritance diagram for PileupSummaryInfoSlimmer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PileupSummaryInfoSlimmer (const edm::ParameterSet &conf)
 
void produce (edm::StreamID, edm::Event &, edm::EventSetup const &) const overridefinal
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::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 std::vector< int > keepDetailedInfoFor_
 
const edm::EDGetTokenT
< std::vector
< PileupSummaryInfo > > 
src_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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::global::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

Definition at line 10 of file PileupSummaryInfoSlimmer.cc.

Constructor & Destructor Documentation

PileupSummaryInfoSlimmer::PileupSummaryInfoSlimmer ( const edm::ParameterSet conf)
inline

Definition at line 12 of file PileupSummaryInfoSlimmer.cc.

12  :
13  src_(consumes<std::vector<PileupSummaryInfo> >(conf.getParameter<edm::InputTag>("src"))),
14  keepDetailedInfoFor_(conf.getParameter<std::vector<int32_t> >("keepDetailedInfoFor")) {
15  produces<std::vector<PileupSummaryInfo> >();
16  }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const std::vector< int > keepDetailedInfoFor_
const edm::EDGetTokenT< std::vector< PileupSummaryInfo > > src_

Member Function Documentation

void PileupSummaryInfoSlimmer::produce ( edm::StreamID  ,
edm::Event evt,
edm::EventSetup const &  es 
) const
finaloverridevirtual

Implements edm::global::EDProducerBase.

Definition at line 25 of file PileupSummaryInfoSlimmer.cc.

References ZMuMuCategoriesSequences_cff::eventInfo, spr::find(), input, and convertSQLitetoXML_cfg::output.

27  {
29  std::auto_ptr<std::vector<PileupSummaryInfo> > output( new std::vector<PileupSummaryInfo> );
30 
31  evt.getByToken(src_,input);
32 
33  for( const auto& psu : *input ) {
34  const int bunchCrossing = psu.getBunchCrossing();
35  const int bunchSpacing = psu.getBunchSpacing();
36  const int num_PU_vertices = psu.getPU_NumInteractions();
37  const float TrueNumInteractions = psu.getTrueNumInteractions();
38 
39  std::vector<float> zpositions;
40  std::vector<float> sumpT_lowpT;
41  std::vector<float> sumpT_highpT;
42  std::vector<int> ntrks_lowpT;
43  std::vector<int> ntrks_highpT;
44  std::vector<edm::EventID> eventInfo;
45  std::vector<float> pT_hats;
46 
47  const bool keep_details = std::find(keepDetailedInfoFor_.begin(),
49  bunchCrossing) != keepDetailedInfoFor_.end();
50 
51  if( keep_details ) {
52  zpositions = psu.getPU_zpositions();
53  sumpT_lowpT = psu.getPU_sumpT_lowpT();
54  sumpT_highpT = psu.getPU_sumpT_highpT();
55  ntrks_lowpT = psu.getPU_ntrks_lowpT();
56  ntrks_highpT = psu.getPU_ntrks_highpT();
57  eventInfo = psu.getPU_EventID();
58  pT_hats = psu.getPU_pT_hats();
59  }
60  // insert the slimmed vertex info
61  output->emplace_back(num_PU_vertices,
62  zpositions,
63  sumpT_lowpT, sumpT_highpT,
64  ntrks_lowpT, ntrks_highpT,
65  eventInfo,
66  pT_hats,
67  bunchCrossing,
68  TrueNumInteractions,
69  bunchSpacing);
70  }
71 
72  evt.put(output);
73 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
static std::string const input
Definition: EdmProvDump.cc:44
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
const std::vector< int > keepDetailedInfoFor_
const edm::EDGetTokenT< std::vector< PileupSummaryInfo > > src_

Member Data Documentation

const std::vector<int> PileupSummaryInfoSlimmer::keepDetailedInfoFor_
private

Definition at line 22 of file PileupSummaryInfoSlimmer.cc.

const edm::EDGetTokenT<std::vector<PileupSummaryInfo> > PileupSummaryInfoSlimmer::src_
private

Definition at line 21 of file PileupSummaryInfoSlimmer.cc.