CMS 3D CMS Logo

EventShapeVarsProducer.cc
Go to the documentation of this file.
2 
4 
6 
7 #include <vector>
8 #include <memory>
9 
11  srcToken_ = consumes<edm::View<reco::Candidate>>(cfg.getParameter<edm::InputTag>("src"));
12  r_ = cfg.exists("r") ? cfg.getParameter<double>("r") : 2.;
13  fwmax_ = cfg.exists("fwmax") ? cfg.getParameter<unsigned>("fwmax") : 0;
14 
15  produces<double>("thrust");
16  //produces<double>("oblateness");
17  produces<double>("isotropy");
18  produces<double>("circularity");
19  produces<double>("sphericity");
20  produces<double>("aplanarity");
21  produces<double>("C");
22  produces<double>("D");
23  if (fwmax_ > 0)
24  produces<std::vector<double>>("FWmoments");
25 }
26 
27 void put(edm::Event& evt, double value, const char* instanceName) {
28  evt.put(std::make_unique<double>(value), instanceName);
29 }
30 
34 
35  Thrust thrustAlgo(objects->begin(), objects->end());
36  put(evt, thrustAlgo.thrust(), "thrust");
37  //put(evt, thrustAlgo.oblateness(), "oblateness");
38 
39  EventShapeVariables eventShapeVarsAlgo(*objects);
40  eventShapeVarsAlgo.set_r(r_);
41  put(evt, eventShapeVarsAlgo.isotropy(), "isotropy");
42  put(evt, eventShapeVarsAlgo.circularity(), "circularity");
43  put(evt, eventShapeVarsAlgo.sphericity(), "sphericity");
44  put(evt, eventShapeVarsAlgo.aplanarity(), "aplanarity");
45  put(evt, eventShapeVarsAlgo.C(), "C");
46  put(evt, eventShapeVarsAlgo.D(), "D");
47  if (fwmax_ > 0) {
48  eventShapeVarsAlgo.setFWmax(fwmax_);
49  auto vfw = std::make_unique<std::vector<double>>(eventShapeVarsAlgo.getFWmoments());
50  evt.put(std::move(vfw), "FWmoments");
51  }
52 }
53 
55 
EventShapeVariables
Class for the calculation of several event shape variables.
Definition: EventShapeVariables.h:32
put
void put(edm::Event &evt, double value, const char *instanceName)
Definition: EventShapeVarsProducer.cc:27
EventShapeVarsProducer::fwmax_
unsigned fwmax_
Definition: EventShapeVarsProducer.h:47
MessageLogger.h
EventShapeVarsProducer.h
objects
Definition: __init__.py:1
edm::Handle
Definition: AssociativeIterator.h:50
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
EventShapeVarsProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: EventShapeVarsProducer.cc:31
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
EventShapeVarsProducer
Definition: EventShapeVarsProducer.h:39
Thrust.h
edm::ParameterSet
Definition: ParameterSet.h:47
value
Definition: value.py:1
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EventSetup
Definition: EventSetup.h:58
EventShapeVarsProducer::r_
double r_
Definition: EventShapeVarsProducer.h:46
hgcalPerformanceValidation.objects
objects
Definition: hgcalPerformanceValidation.py:791
looper.cfg
cfg
Definition: looper.py:297
EventShapeVarsProducer::EventShapeVarsProducer
EventShapeVarsProducer(const edm::ParameterSet &)
Definition: EventShapeVarsProducer.cc:10
eostools.move
def move(src, dest)
Definition: eostools.py:511
EventShapeVarsProducer::srcToken_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_
Definition: EventShapeVarsProducer.h:45
Thrust
Definition: Thrust.h:38
edm::Event
Definition: Event.h:73
MuonErrorMatrixAdjuster_cfi.instanceName
instanceName
Definition: MuonErrorMatrixAdjuster_cfi.py:16
edm::InputTag
Definition: InputTag.h:15