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 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 ()
 
- 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 Member Functions

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

Private Attributes

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

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 http://cepa.fnal.gov/psm/simulation/mcgen/lund/pythia_manual/pythia6.3/pythia6301/node213.html ( http://cepa.fnal.gov/psm/simulation/mcgen/lund/pythia_manual/pythia6.3/pythia6301/node214.html ) for an explanation of sphericity, aplanarity and the quantities C and D (thrust and oblateness).

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 7 of file EventShapeVarsProducer.cc.

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

8 {
9  srcToken_ = consumes<edm::View<reco::Candidate> >(cfg.getParameter<edm::InputTag>("src"));
10  r_ = cfg.exists("r") ? cfg.getParameter<double>("r") : 2.;
11 
12  produces<double>("thrust");
13  //produces<double>("oblateness");
14  produces<double>("isotropy");
15  produces<double>("circularity");
16  produces<double>("sphericity");
17  produces<double>("aplanarity");
18  produces<double>("C");
19  produces<double>("D");
20 
21 }
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 ( )
inline

Definition at line 44 of file EventShapeVarsProducer.h.

44 {}

Member Function Documentation

void EventShapeVarsProducer::beginJob ( void  )
inlineprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 51 of file EventShapeVarsProducer.h.

51 {}
void EventShapeVarsProducer::endJob ( void  )
inlineprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 53 of file EventShapeVarsProducer.h.

53 {}
void EventShapeVarsProducer::produce ( edm::Event evt,
const edm::EventSetup  
)
privatevirtual

Implements edm::EDProducer.

Definition at line 29 of file EventShapeVarsProducer.cc.

References edm::Event::getByToken(), put(), r_, and srcToken_.

30 {
31  //std::cout << "<EventShapeVarsProducer::produce>:" << std::endl;
32 
34  evt.getByToken(srcToken_, objects);
35 
36  Thrust thrustAlgo(objects->begin(), objects->end());
37  put(evt, thrustAlgo.thrust(), "thrust");
38  //put(evt, thrustAlgo.oblateness(), "oblateness");
39 
40  EventShapeVariables eventShapeVarsAlgo(*objects);
41  put(evt, eventShapeVarsAlgo.isotropy(), "isotropy");
42  put(evt, eventShapeVarsAlgo.circularity(), "circularity");
43  put(evt, eventShapeVarsAlgo.sphericity(r_), "sphericity");
44  put(evt, eventShapeVarsAlgo.aplanarity(r_), "aplanarity");
45  put(evt, eventShapeVarsAlgo.C(r_), "C");
46  put(evt, eventShapeVarsAlgo.D(r_), "D");
47 }
Class for the calculation of several event shape variables.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
void put(edm::Event &evt, double value, const char *instanceName)
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_
Definition: Thrust.h:38

Member Data Documentation

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().