CommonTools
UtilAlgos
interface
AssociationVector2ValueMap.h
Go to the documentation of this file.
1
#ifndef CommonTools_UtilAlgos_AssociationVector2ValueMap_h
2
#define CommonTools_UtilAlgos_AssociationVector2ValueMap_h
3
/* \class AssociationVector2ValueMap
4
*
5
* \author Luca Lista, INFN
6
*
7
* \version $Id: AssociationVector2ValueMap.h,v 1.2 2010/02/20 20:55:15 wmtan Exp $
8
*/
9
10
#include "
DataFormats/Common/interface/AssociationVector.h
"
11
#include "
DataFormats/Common/interface/ValueMap.h
"
12
#include "
FWCore/Framework/interface/global/EDProducer.h
"
13
#include "
FWCore/Utilities/interface/InputTag.h
"
14
15
template
<
typename
KeyRefProd,
typename
CVal>
16
class
AssociationVector2ValueMap
:
public
edm::global::EDProducer
<> {
17
public
:
18
AssociationVector2ValueMap
(
const
edm::ParameterSet
&);
19
20
private
:
21
typedef
edm::AssociationVector<KeyRefProd, CVal>
av_t
;
22
typedef
typename
CVal::value_type
value_t
;
23
typedef
edm::ValueMap<value_t>
vm_t
;
24
typedef
typename
av_t::CKey
collection_t
;
25
void
produce
(
edm::StreamID
,
edm::Event
&,
const
edm::EventSetup
&)
const override
;
26
edm::EDGetTokenT<av_t>
av_
;
27
};
28
29
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
30
#include "
FWCore/Framework/interface/Event.h
"
31
#include "
DataFormats/Common/interface/Handle.h
"
32
#include "
CommonTools/UtilAlgos/interface/ParameterAdapter.h
"
33
#include "
DataFormats/Common/interface/CloneTrait.h
"
34
35
template
<
typename
KeyRefProd,
typename
CVal>
36
AssociationVector2ValueMap<KeyRefProd, CVal>::AssociationVector2ValueMap
(
const
edm::ParameterSet
&
cfg
)
37
: av_(consumes<
av_t
>(
cfg
.
template
getParameter<
edm
::
InputTag
>(
"src"
))) {
38
produces<vm_t>();
39
}
40
41
template
<
typename
KeyRefProd,
typename
CVal>
42
void
AssociationVector2ValueMap<KeyRefProd, CVal>::produce
(
edm::StreamID
,
43
edm::Event
& evt,
44
const
edm::EventSetup
&)
const
{
45
using namespace
edm
;
46
using namespace
std
;
47
Handle<av_t>
av;
48
evt.
getByToken
(av_, av);
49
50
unique_ptr<vm_t> vm(
new
vm_t
);
51
typename
vm_t::Filler
filler
(*vm);
52
filler
.fill();
53
size_t
size
= av->size();
54
vector<value_t>
values
;
55
values
.reserve(
size
);
56
for
(
typename
av_t::const_iterator
i
= av->begin();
i
!= av->end(); ++
i
) {
57
values
.push_back(
i
->second);
58
}
59
filler
.insert(av->keyProduct(),
values
.begin(),
values
.end());
60
evt.
put
(
std::move
(vm));
61
}
62
63
#endif
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:133
mps_fire.i
i
Definition:
mps_fire.py:429
edm::AssociationVector::const_iterator
transient_vector_type::const_iterator const_iterator
Definition:
AssociationVector.h:106
AssociationVector2ValueMap::vm_t
edm::ValueMap< value_t > vm_t
Definition:
AssociationVector2ValueMap.h:23
edm::StreamID
Definition:
StreamID.h:30
Event.h
edm::Handle
Definition:
AssociativeIterator.h:50
AssociationVector2ValueMap::av_t
edm::AssociationVector< KeyRefProd, CVal > av_t
Definition:
AssociationVector2ValueMap.h:21
HLT_2022v15_cff.InputTag
InputTag
Definition:
HLT_2022v15_cff.py:60426
std
Definition:
JetResolutionObject.h:76
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:540
ValueMap.h
edm::EDGetTokenT
Definition:
EDGetToken.h:37
ParameterSet.h
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
contentValuesCheck.values
values
Definition:
contentValuesCheck.py:38
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition:
svgfig.py:521
edm::EventSetup
Definition:
EventSetup.h:56
edm::global::EDProducer
Definition:
EDProducer.h:32
AssociationVector2ValueMap
Definition:
AssociationVector2ValueMap.h:16
edm::AssociationVector::CKey
KeyRefProd::product_type CKey
Definition:
AssociationVector.h:74
edm::helper::Filler
Definition:
ValueMap.h:22
looper.cfg
cfg
Definition:
looper.py:296
AssociationVector2ValueMap::av_
edm::EDGetTokenT< av_t > av_
Definition:
AssociationVector2ValueMap.h:26
edm::ValueMap
Definition:
ValueMap.h:107
AssociationVector2ValueMap::value_t
CVal::value_type value_t
Definition:
AssociationVector2ValueMap.h:22
edm::AssociationVector
Definition:
AssociationVector.h:67
AssociationVector2ValueMap::AssociationVector2ValueMap
AssociationVector2ValueMap(const edm::ParameterSet &)
Definition:
AssociationVector2ValueMap.h:36
EDProducer.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
AssociationVector2ValueMap::collection_t
av_t::CKey collection_t
Definition:
AssociationVector2ValueMap.h:24
InputTag.h
AssociationVector.h
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::Event
Definition:
Event.h:73
trigObjTnPSource_cfi.filler
filler
Definition:
trigObjTnPSource_cfi.py:21
CloneTrait.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
AssociationVector2ValueMap::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition:
AssociationVector2ValueMap.h:42
Handle.h
Generated for CMSSW Reference Manual by
1.8.14