test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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/EDProducer.h
"
13
#include "
FWCore/Utilities/interface/InputTag.h
"
14
15
template
<
typename
KeyRefProd,
typename
CVal>
16
class
AssociationVector2ValueMap
:
public
edm::EDProducer
{
17
public
:
18
AssociationVector2ValueMap
(
const
edm::ParameterSet
&);
19
private
:
20
typedef
edm::AssociationVector<KeyRefProd, CVal>
av_t
;
21
typedef
typename
CVal::value_type
value_t
;
22
typedef
edm::ValueMap<value_t>
vm_t
;
23
typedef
typename
av_t::CKey
collection_t
;
24
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
25
edm::EDGetTokenT<av_t>
av_
;
26
};
27
28
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
29
#include "
FWCore/Framework/interface/Event.h
"
30
#include "
DataFormats/Common/interface/Handle.h
"
31
#include "
CommonTools/UtilAlgos/interface/ParameterAdapter.h
"
32
#include "
DataFormats/Common/interface/CloneTrait.h
"
33
34
template
<
typename
KeyRefProd,
typename
CVal>
35
AssociationVector2ValueMap<KeyRefProd, CVal>::AssociationVector2ValueMap
(
const
edm::ParameterSet
&
cfg
) :
36
av_(consumes<
av_t
>(cfg.
template
getParameter<edm::
InputTag
>(
"src"
))) {
37
produces<vm_t>();
38
}
39
40
template
<
typename
KeyRefProd,
typename
CVal>
41
void
AssociationVector2ValueMap<KeyRefProd, CVal>::produce
(
edm::Event
& evt,
const
edm::EventSetup
&) {
42
using namespace
edm;
43
using namespace
std;
44
Handle<av_t>
av;
45
evt.
getByToken
(av_, av);
46
47
auto_ptr<vm_t> vm(
new
vm_t
);
48
typename
vm_t::Filler
filler(*vm);
49
filler.
fill
();
50
size_t
size
= av->size();
51
vector<value_t>
values
;
52
values
.reserve(
size
);
53
for
(
typename
av_t::const_iterator
i
= av->begin();
i
!= av->end(); ++
i
) {
54
values
.push_back(
i
->second);
55
}
56
filler.
insert
(av->keyProduct(),
values
.begin(),
values
.end());
57
evt.
put
(vm);
58
}
59
60
#endif
edm::helper::Filler::fill
void fill()
Definition:
ValueMap.h:62
i
int i
Definition:
DBlmapReader.cc:9
looper.cfg
tuple cfg
Definition:
looper.py:293
edm::AssociationVector::const_iterator
transient_vector_type::const_iterator const_iterator
Definition:
AssociationVector.h:102
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:462
AssociationVector2ValueMap::vm_t
edm::ValueMap< value_t > vm_t
Definition:
AssociationVector2ValueMap.h:22
Event.h
edm::Handle
Definition:
AssociativeIterator.h:47
edm::helper::Filler::insert
void insert(const H &h, I begin, I end)
Definition:
ValueMap.h:52
AssociationVector2ValueMap::av_t
edm::AssociationVector< KeyRefProd, CVal > av_t
Definition:
AssociationVector2ValueMap.h:20
Handle.h
ValueMap.h
edm::EDGetTokenT
Definition:
EDGetToken.h:32
edm::EDProducer
Definition:
EDProducer.h:35
makeHLTPrescaleTable.values
list values
Definition:
makeHLTPrescaleTable.py:222
ParameterSet.h
HLT_25ns10e33_v2_cff.InputTag
tuple InputTag
Definition:
HLT_25ns10e33_v2_cff.py:58467
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
edm::Event::put
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition:
Event.h:121
AssociationVector2ValueMap::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
AssociationVector2ValueMap.h:41
edm::EventSetup
Definition:
EventSetup.h:45
AssociationVector2ValueMap
Definition:
AssociationVector2ValueMap.h:16
edm::AssociationVector::CKey
KeyRefProd::product_type CKey
Definition:
AssociationVector.h:68
edm::helper::Filler
Definition:
ValueMap.h:21
AssociationVector2ValueMap::av_
edm::EDGetTokenT< av_t > av_
Definition:
AssociationVector2ValueMap.h:25
edm::ValueMap
Definition:
ValueMap.h:104
EDProducer.h
AssociationVector2ValueMap::value_t
CVal::value_type value_t
Definition:
AssociationVector2ValueMap.h:21
edm::AssociationVector
Definition:
AssociationVector.h:62
AssociationVector2ValueMap::AssociationVector2ValueMap
AssociationVector2ValueMap(const edm::ParameterSet &)
Definition:
AssociationVector2ValueMap.h:35
AssociationVector2ValueMap::collection_t
av_t::CKey collection_t
Definition:
AssociationVector2ValueMap.h:23
InputTag.h
AssociationVector.h
ParameterAdapter.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:65
CloneTrait.h
findQualityFiles.size
tuple size
Write out results.
Definition:
findQualityFiles.py:442
svgfig.template
def template
Definition:
svgfig.py:520
Generated for CMSSW Reference Manual by
1.8.5