CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventShapeVarsProducer.cc
Go to the documentation of this file.
2 
4 
7 
10 
12 {
13  src_ = cfg.getParameter<edm::InputTag>("src");
14  r_ = cfg.exists("r") ? cfg.getParameter<double>("r") : 2.;
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 
25 }
26 
27 void put(edm::Event& evt, double value, const char* instanceName)
28 {
29  std::auto_ptr<double> eventShapeVarPtr(new double(value));
30  evt.put(eventShapeVarPtr, instanceName);
31 }
32 
34 {
35  //std::cout << "<EventShapeVarsProducer::produce>:" << std::endl;
36 
38  evt.getByLabel(src_, objects);
39 
40  Thrust thrustAlgo(objects->begin(), objects->end());
41  put(evt, thrustAlgo.thrust(), "thrust");
42  //put(evt, thrustAlgo.oblateness(), "oblateness");
43 
44  EventShapeVariables eventShapeVarsAlgo(*objects);
45  put(evt, eventShapeVarsAlgo.isotropy(), "isotropy");
46  put(evt, eventShapeVarsAlgo.circularity(), "circularity");
47  put(evt, eventShapeVarsAlgo.sphericity(r_), "sphericity");
48  put(evt, eventShapeVarsAlgo.aplanarity(r_), "aplanarity");
49  put(evt, eventShapeVarsAlgo.C(r_), "C");
50  put(evt, eventShapeVarsAlgo.D(r_), "D");
51 }
52 
54 
T getParameter(std::string const &) const
EventShapeVarsProducer(const edm::ParameterSet &)
Class for the calculation of several event shape variables.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool exists(std::string const &parameterName) const
checks if a parameter exists
void put(edm::Event &evt, double value, const char *instanceName)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void produce(edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
Definition: Thrust.h:40