Main Page
Namespaces
Classes
Package Documentation
RecoRomanPot
RecoFP420
plugins
TrackerizerFP420.cc
Go to the documentation of this file.
1
// File: TrackerizerFP420.cc
3
// Date: 12.2006
4
// Description: TrackerizerFP420 for FP420
5
// Modifications:
7
#include <memory>
8
#include <string>
9
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
10
#include "
FWCore/Framework/interface/EDProducer.h
"
11
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
12
#include "
FWCore/Framework/interface/Event.h
"
13
#include "
FWCore/Framework/interface/MakerMacros.h
"
14
#include "
FWCore/Framework/interface/EventSetup.h
"
15
#include "
FWCore/Framework/interface/ESHandle.h
"
16
17
#include "
RecoRomanPot/RecoFP420/interface/TrackerizerFP420.h
"
18
#include "
DataFormats/FP420Cluster/interface/ClusterCollectionFP420.h
"
19
#include "
DataFormats/FP420Cluster/interface/TrackCollectionFP420.h
"
20
21
#include <iostream>
22
using namespace
std
;
23
24
//
25
namespace
cms
26
{
27
TrackerizerFP420::TrackerizerFP420(
const
edm::ParameterSet
& conf):conf_(conf) {
28
29
std::string
alias
( conf.
getParameter
<
std::string
>(
"@module_label"
) );
30
31
produces<TrackCollectionFP420>().setBranchAlias( alias );
32
33
trackerContainers
.clear();
34
trackerContainers
= conf.
getParameter
<std::vector<std::string> >(
"ROUList"
);
35
36
verbosity
=
conf_
.
getUntrackedParameter
<
int
>(
"VerbosityLevel"
);
37
if
(verbosity > 0) {
38
std::cout
<<
"Creating a TrackerizerFP420"
<< std::endl;
39
}
40
41
// Initialization:
42
sFP420TrackMain_
=
new
FP420TrackMain
(
conf_
);
43
44
}
45
46
// Virtual destructor needed.
47
TrackerizerFP420::~TrackerizerFP420
() {
48
delete
sFP420TrackMain_
;
49
}
50
51
//Get at the beginning
52
void
TrackerizerFP420::beginJob
() {
53
if
(
verbosity
> 0) {
54
std::cout
<<
"BeginJob method "
<< std::endl;
55
}
56
}
57
58
59
void
TrackerizerFP420::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
60
{
61
// beginJob;
62
// be lazy and include the appropriate namespaces
63
using namespace
edm
;
64
using namespace
std
;
65
66
// Get input
67
//A
68
// edm::Handle<ClusterCollectionFP420> icf_simhit;
69
/*
70
Handle<ClusterCollectionFP420> cf_simhit;
71
std::vector<const ClusterCollectionFP420 *> cf_simhitvec;
72
for(uint32_t i = 0; i< trackerContainers.size();i++){
73
iEvent.getByLabel( trackerContainers[i], cf_simhit);
74
cf_simhitvec.push_back(cf_simhit.product()); }
75
std::auto_ptr<ClusterCollectionFP420 > input(new DigiCollectionFP420(cf_simhitvec));
76
*/
77
78
//B
79
80
Handle<ClusterCollectionFP420>
input
;
81
iEvent.
getByLabel
(
trackerContainers
[0] , input);
82
83
84
85
86
// Step C: create empty output collection
87
auto
toutput = std::make_unique<TrackCollectionFP420>();
88
89
90
91
// put zero to container info from the beginning (important! because not any detID is updated with coming of new event !!!!!!
92
// clean info of container from previous event
93
94
std::vector<TrackFP420> collector;
95
collector.clear();
96
TrackCollectionFP420::Range
inputRange
;
97
inputRange.first = collector.begin();
98
inputRange.second = collector.end();
99
100
unsigned
int
detID = 0;
101
toutput->putclear(inputRange,detID);
102
103
unsigned
int
StID = 1111;
104
toutput->putclear(inputRange,StID);
105
StID = 2222;
106
toutput->putclear(inputRange,StID);
107
108
109
// !!!!!!
110
// if we want to keep Track container/Collection for one event ---> uncomment the line below and vice versa
111
toutput->clear();
//container_.clear() --> start from the beginning of the container
112
113
// RUN now: !!!!!!
114
// startFP420TrackMain_.run(input, toutput);
115
sFP420TrackMain_
->
run
(input, toutput.get());
116
// std::cout <<"======= TrackerizerFP420: end of produce " << std::endl;
117
118
// Step D: write output to file
119
iEvent.
put
(
std::move
(toutput));
120
}
//produce
121
122
}
// namespace cms
123
124
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ClusterCollectionFP420.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
FP420TrackMain
Definition:
FP420TrackMain.h:21
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:127
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
Event.h
MakerMacros.h
edm::Handle
Definition:
AssociativeIterator.h:47
EventSetup.h
std
Definition:
JetResolutionObject.h:80
TrackCollectionFP420::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition:
TrackCollectionFP420.h:14
Frameworkfwd.h
met_cff.alias
alias
Definition:
met_cff.py:11
input
static std::string const input
Definition:
EdmProvDump.cc:44
cms::TrackerizerFP420::beginJob
void beginJob() override
Definition:
TrackerizerFP420.cc:52
ParameterSet.h
cms::TrackerizerFP420::sFP420TrackMain_
FP420TrackMain * sFP420TrackMain_
Definition:
TrackerizerFP420.h:49
cms::TrackerizerFP420::trackerContainers
vstring trackerContainers
Definition:
TrackerizerFP420.h:47
iEvent
int iEvent
Definition:
GenABIO.cc:230
ESHandle.h
cms::TrackerizerFP420::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition:
TrackerizerFP420.cc:59
edm::EventSetup
Definition:
EventSetup.h:44
TrackCollectionFP420.h
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:464
cms
Definition:
ProducerAnalyzer.cc:23
cms::TrackerizerFP420::conf_
edm::ParameterSet conf_
Definition:
TrackerizerFP420.h:46
EDProducer.h
FP420TrackMain::run
void run(edm::Handle< ClusterCollectionFP420 > &input, TrackCollectionFP420 *toutput)
Runs the algorithm.
Definition:
FP420TrackMain.cc:137
cms::TrackerizerFP420::~TrackerizerFP420
~TrackerizerFP420() override
Definition:
TrackerizerFP420.cc:47
cms::TrackerizerFP420::verbosity
int verbosity
Definition:
TrackerizerFP420.h:52
edm
HLT enums.
Definition:
AlignableModifier.h:17
estimatePileup.inputRange
inputRange
Get input source.
Definition:
estimatePileup.py:240
edm::ParameterSet
Definition:
ParameterSet.h:36
gather_cfg.cout
cout
Definition:
gather_cfg.py:145
edm::Event
Definition:
Event.h:69
eostools.move
def move(src, dest)
Definition:
eostools.py:510
TrackerizerFP420.h
Generated for CMSSW Reference Manual by
1.8.11