RecoLocalTracker
SiStripClusterizer
plugins
SiStripClusterizer.cc
Go to the documentation of this file.
1
#include "
RecoLocalTracker/SiStripClusterizer/plugins/SiStripClusterizer.h
"
2
#include "
DataFormats/SiStripCluster/interface/SiStripCluster.h
"
3
#include "
RecoLocalTracker/SiStripClusterizer/interface/StripClusterizerAlgorithmFactory.h
"
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
FWCore/Utilities/interface/transform.h
"
6
7
SiStripClusterizer::SiStripClusterizer
(
const
edm::ParameterSet
& conf)
8
:
inputTags
(conf.getParameter<
std
::vector<
edm
::
InputTag
>>(
"DigiProducersList"
)),
9
algorithm
(
StripClusterizerAlgorithmFactory
::
create
(conf.getParameter<
edm
::
ParameterSet
>(
"Clusterizer"
))) {
10
produces<edmNew::DetSetVector<SiStripCluster>>();
11
inputTokens
=
edm::vector_transform
(
12
inputTags
, [
this
](
edm::InputTag
const
&
tag
) {
return
consumes<edm::DetSetVector<SiStripDigi>>(
tag
); });
13
}
14
15
void
SiStripClusterizer::produce
(
edm::Event
&
event
,
const
edm::EventSetup
& es) {
16
auto
output
= std::make_unique<edmNew::DetSetVector<SiStripCluster>>();
17
output
->reserve(10000, 4 * 10000);
18
19
edm::Handle<edm::DetSetVector<SiStripDigi>
> inputOld;
20
// edm::Handle< edmNew::DetSetVector<SiStripDigi> > inputNew;
21
22
algorithm
->initialize(es);
23
24
for
(
auto
const
&
token
:
inputTokens
) {
25
if
(
findInput
(
token
, inputOld,
event
))
26
algorithm
->clusterize(*inputOld, *
output
);
27
// else if( findInput( tag, inputNew, event) ) algorithm->clusterize(*inputNew, *output);
28
else
29
edm::LogError
(
"Input Not Found"
) <<
"[SiStripClusterizer::produce] "
;
// << tag;
30
}
31
32
LogDebug
(
"Output"
) <<
output
->dataSize() <<
" clusters from "
<<
output
->size() <<
" modules"
;
33
output
->shrink_to_fit();
34
event
.put(
std::move
(
output
));
35
}
36
37
template
<
class
T>
38
inline
bool
SiStripClusterizer::findInput
(
const
edm::EDGetTokenT<T>
&
tag
,
edm::Handle<T>
&
handle
,
const
edm::Event
&
e
) {
39
e
.getByToken(
tag
,
handle
);
40
return
handle
.isValid();
41
}
convertSQLitetoXML_cfg.output
output
Definition:
convertSQLitetoXML_cfg.py:32
patZpeak.handle
handle
Definition:
patZpeak.py:23
edm::EDGetTokenT
Definition:
EDGetToken.h:33
edm
HLT enums.
Definition:
AlignableModifier.h:19
SiStripClusterizer::algorithm
std::unique_ptr< StripClusterizerAlgorithm > algorithm
Definition:
SiStripClusterizer.h:22
SiStripClusterizer.h
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition:
beamerCreator.py:44
SiStripClusterizer::inputTags
const std::vector< edm::InputTag > inputTags
Definition:
SiStripClusterizer.h:21
edm::Handle
Definition:
AssociativeIterator.h:50
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
HLTMuonOfflineAnalyzer_cfi.inputTags
inputTags
All input tags are specified in this pset for convenience.
Definition:
HLTMuonOfflineAnalyzer_cfi.py:82
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition:
transform.h:11
SiStripClusterizer::findInput
bool findInput(const edm::EDGetTokenT< T > &, edm::Handle< T > &, const edm::Event &)
Definition:
SiStripClusterizer.cc:38
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:670
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::LogError
Definition:
MessageLogger.h:183
SiStripClusterizer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
SiStripClusterizer.cc:15
SiStripCluster.h
Event.h
ParameterSet
Definition:
Functions.h:16
SiStripClusterizer::inputTokens
token_v inputTokens
Definition:
SiStripClusterizer.h:25
qcdUeDQM_cfi.algorithm
algorithm
Definition:
qcdUeDQM_cfi.py:32
edm::EventSetup
Definition:
EventSetup.h:57
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
transform.h
StripClusterizerAlgorithmFactory
Definition:
StripClusterizerAlgorithmFactory.h:10
SiStripClusterizer::SiStripClusterizer
SiStripClusterizer(const edm::ParameterSet &conf)
Definition:
SiStripClusterizer.cc:7
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
StripClusterizerAlgorithmFactory.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
unpackBuffers-CaloStage2.token
token
Definition:
unpackBuffers-CaloStage2.py:316
Generated for CMSSW Reference Manual by
1.8.16