CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EventShapeVarsProducer Class Reference

#include <EventShapeVarsProducer.h>

Inheritance diagram for EventShapeVarsProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EventShapeVarsProducer (const edm::ParameterSet &)
 
 ~EventShapeVarsProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

unsigned fwmax_
 
double r_
 
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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

Produce set of event shape variables. The values of different event shape variables are stored as doubles in the event. They can be retrieved with InputTags like "moduleName::instanceName", where moduleName corresponds to "eventShapeVarsProducer" per default and instance name specifies an individual event shape variable which you wish to retrieve from the event:

See https://arxiv.org/pdf/hep-ph/0603175v2.pdf#page=524 for an explanation of sphericity, aplanarity, the quantities C and D, thrust, oblateness, Fox-Wolfram moments.

Author
Christian Veelken, UC Davis

Definition at line 39 of file EventShapeVarsProducer.h.

Constructor & Destructor Documentation

EventShapeVarsProducer::EventShapeVarsProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 10 of file EventShapeVarsProducer.cc.

References edm::ParameterSet::exists(), fwmax_, edm::ParameterSet::getParameter(), r_, and srcToken_.

11 {
12  srcToken_ = consumes<edm::View<reco::Candidate> >(cfg.getParameter<edm::InputTag>("src"));
13  r_ = cfg.exists("r") ? cfg.getParameter<double>("r") : 2.;
14  fwmax_ = cfg.exists("fwmax") ? cfg.getParameter<unsigned>("fwmax") : 0;
15 
16  produces<double>("thrust");
17  //produces<double>("oblateness");
18  produces<double>("isotropy");
19  produces<double>("circularity");
20  produces<double>("sphericity");
21  produces<double>("aplanarity");
22  produces<double>("C");
23  produces<double>("D");
24  if(fwmax_ > 0) produces<std::vector<double>>("FWmoments");
25 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_
EventShapeVarsProducer::~EventShapeVarsProducer ( )
inlineoverride

Definition at line 44 of file EventShapeVarsProducer.h.

44 {}

Member Function Documentation

void EventShapeVarsProducer::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 52 of file EventShapeVarsProducer.h.

References produce().

52 {}
void EventShapeVarsProducer::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 54 of file EventShapeVarsProducer.h.

54 {}
void EventShapeVarsProducer::produce ( edm::Event evt,
const edm::EventSetup  
)
overrideprivate

Definition at line 32 of file EventShapeVarsProducer.cc.

References DEFINE_FWK_MODULE, fwmax_, edm::Event::getByToken(), eostools::move(), put(), edm::Event::put(), r_, and srcToken_.

Referenced by beginJob().

33 {
34 
36  evt.getByToken(srcToken_, objects);
37 
38  Thrust thrustAlgo(objects->begin(), objects->end());
39  put(evt, thrustAlgo.thrust(), "thrust");
40  //put(evt, thrustAlgo.oblateness(), "oblateness");
41 
42  EventShapeVariables eventShapeVarsAlgo(*objects);
43  eventShapeVarsAlgo.set_r(r_);
44  put(evt, eventShapeVarsAlgo.isotropy(), "isotropy");
45  put(evt, eventShapeVarsAlgo.circularity(), "circularity");
46  put(evt, eventShapeVarsAlgo.sphericity(), "sphericity");
47  put(evt, eventShapeVarsAlgo.aplanarity(), "aplanarity");
48  put(evt, eventShapeVarsAlgo.C(), "C");
49  put(evt, eventShapeVarsAlgo.D(), "D");
50  if(fwmax_ > 0){
51  eventShapeVarsAlgo.setFWmax(fwmax_);
52  auto vfw = std::make_unique<std::vector<double>>(eventShapeVarsAlgo.getFWmoments());
53  evt.put(std::move(vfw),"FWmoments");
54  }
55 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
Class for the calculation of several event shape variables.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
void put(edm::Event &evt, double value, const char *instanceName)
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_
Definition: Thrust.h:38
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

unsigned EventShapeVarsProducer::fwmax_
private

Definition at line 50 of file EventShapeVarsProducer.h.

Referenced by EventShapeVarsProducer(), and produce().

double EventShapeVarsProducer::r_
private

Definition at line 49 of file EventShapeVarsProducer.h.

Referenced by EventShapeVarsProducer(), and produce().

edm::EDGetTokenT<edm::View<reco::Candidate> > EventShapeVarsProducer::srcToken_
private

Definition at line 48 of file EventShapeVarsProducer.h.

Referenced by EventShapeVarsProducer(), and produce().