Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
TrackerizerFP420::TrackerizerFP420(
const
edm::ParameterSet
& conf) : conf_(conf) {
27
std::string
alias
(conf.
getParameter
<
std::string
>(
"@module_label"
));
28
29
produces<TrackCollectionFP420>().setBranchAlias(alias);
30
31
trackerContainers
.clear();
32
trackerContainers
= conf.
getParameter
<std::vector<std::string> >(
"ROUList"
);
33
34
verbosity
=
conf_
.
getUntrackedParameter
<
int
>(
"VerbosityLevel"
);
35
if
(verbosity > 0) {
36
std::cout
<<
"Creating a TrackerizerFP420"
<< std::endl;
37
}
38
39
// Initialization:
40
sFP420TrackMain_
=
new
FP420TrackMain
(
conf_
);
41
}
42
43
// Virtual destructor needed.
44
TrackerizerFP420::~TrackerizerFP420
() {
delete
sFP420TrackMain_
; }
45
46
//Get at the beginning
47
void
TrackerizerFP420::beginJob
() {
48
if
(
verbosity
> 0) {
49
std::cout
<<
"BeginJob method "
<< std::endl;
50
}
51
}
52
53
void
TrackerizerFP420::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
54
// beginJob;
55
// be lazy and include the appropriate namespaces
56
using namespace
edm;
57
using namespace
std;
58
59
// Get input
60
//A
61
// edm::Handle<ClusterCollectionFP420> icf_simhit;
62
/*
63
Handle<ClusterCollectionFP420> cf_simhit;
64
std::vector<const ClusterCollectionFP420 *> cf_simhitvec;
65
for(uint32_t i = 0; i< trackerContainers.size();i++){
66
iEvent.getByLabel( trackerContainers[i], cf_simhit);
67
cf_simhitvec.push_back(cf_simhit.product()); }
68
std::unique_ptr<ClusterCollectionFP420 > input(new DigiCollectionFP420(cf_simhitvec));
69
*/
70
71
//B
72
73
Handle<ClusterCollectionFP420>
input
;
74
iEvent.
getByLabel
(
trackerContainers
[0],
input
);
75
76
// Step C: create empty output collection
77
auto
toutput = std::make_unique<TrackCollectionFP420>();
78
79
// put zero to container info from the beginning (important! because not any detID is updated with coming of new event !!!!!!
80
// clean info of container from previous event
81
82
std::vector<TrackFP420> collector;
83
collector.clear();
84
TrackCollectionFP420::Range
inputRange
;
85
inputRange
.first = collector.begin();
86
inputRange
.second = collector.end();
87
88
unsigned
int
detID = 0;
89
toutput->putclear(
inputRange
, detID);
90
91
unsigned
int
StID = 1111;
92
toutput->putclear(
inputRange
, StID);
93
StID = 2222;
94
toutput->putclear(
inputRange
, StID);
95
96
// !!!!!!
97
// if we want to keep Track container/Collection for one event ---> uncomment the line below and vice versa
98
toutput->clear();
//container_.clear() --> start from the beginning of the container
99
100
// RUN now: !!!!!!
101
// startFP420TrackMain_.run(input, toutput);
102
sFP420TrackMain_
->
run
(
input
, toutput.get());
103
// std::cout <<"======= TrackerizerFP420: end of produce " << std::endl;
104
105
// Step D: write output to file
106
iEvent.
put
(
std::move
(toutput));
107
}
//produce
108
109
}
// namespace cms
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:133
HLT_FULL_cff.alias
tuple alias
Definition:
HLT_FULL_cff.py:9825
Event.h
MakerMacros.h
edm::Handle
Definition:
AssociativeIterator.h:50
EventSetup.h
TrackCollectionFP420::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition:
TrackCollectionFP420.h:12
Frameworkfwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
input
static std::string const input
Definition:
EdmProvDump.cc:47
cms::TrackerizerFP420::beginJob
void beginJob() override
Definition:
TrackerizerFP420.cc:47
ParameterSet.h
cms::TrackerizerFP420::sFP420TrackMain_
FP420TrackMain * sFP420TrackMain_
Definition:
TrackerizerFP420.h:43
cms::TrackerizerFP420::trackerContainers
vstring trackerContainers
Definition:
TrackerizerFP420.h:41
iEvent
int iEvent
Definition:
GenABIO.cc:224
eostools.move
def move
Definition:
eostools.py:511
ESHandle.h
cms::TrackerizerFP420::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition:
TrackerizerFP420.cc:53
edm::EventSetup
Definition:
EventSetup.h:59
TrackCollectionFP420.h
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:500
cms::TrackerizerFP420::conf_
edm::ParameterSet conf_
Definition:
TrackerizerFP420.h:40
EDProducer.h
FP420TrackMain::run
void run(edm::Handle< ClusterCollectionFP420 > &input, TrackCollectionFP420 *toutput)
Runs the algorithm.
Definition:
FP420TrackMain.cc:151
cms::TrackerizerFP420::~TrackerizerFP420
~TrackerizerFP420() override
Definition:
TrackerizerFP420.cc:44
pileupCalc.inputRange
tuple inputRange
Definition:
pileupCalc.py:168
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
cms::TrackerizerFP420::verbosity
int verbosity
Definition:
TrackerizerFP420.h:46
edm::ParameterSet
Definition:
ParameterSet.h:47
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:144
edm::Event
Definition:
Event.h:73
TrackerizerFP420.h
Generated for CMSSW Reference Manual by
1.8.5