RecoTracker
SpecialSeedGenerators
src
CosmicSeedGenerator.cc
Go to the documentation of this file.
1
//
2
// Package: RecoTracker/TkSeedGenerator
3
// Class: GlobalPixelLessSeedGenerator
4
//
5
6
#include <iostream>
7
#include <memory>
8
#include <string>
9
10
#include "
RecoTracker/SpecialSeedGenerators/interface/CosmicSeedGenerator.h
"
11
#include "
DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h
"
12
#include "
DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h
"
13
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
14
#include "
FWCore/Utilities/interface/InputTag.h
"
15
16
using namespace
std
;
17
CosmicSeedGenerator::CosmicSeedGenerator
(
edm::ParameterSet
const
& conf)
18
: cosmic_seed(conf),
19
check
(conf, consumesCollector())
20
21
{
22
edm::LogInfo
(
"CosmicSeedGenerator"
) <<
"Enter the CosmicSeedGenerator"
;
23
// get Inputs
24
matchedrecHitsToken_
= consumes<SiStripMatchedRecHit2DCollection>(conf.
getParameter
<
edm::InputTag
>(
"matchedRecHits"
));
25
rphirecHitsToken_
= consumes<SiStripRecHit2DCollection>(conf.
getParameter
<
edm::InputTag
>(
"rphirecHits"
));
26
stereorecHitsToken_
= consumes<SiStripRecHit2DCollection>(conf.
getParameter
<
edm::InputTag
>(
"stereorecHits"
));
27
28
produces<TrajectorySeedCollection>();
29
}
30
31
// Virtual destructor needed.
32
CosmicSeedGenerator::~CosmicSeedGenerator
() {}
33
34
// Functions that gets called by framework every event
35
void
CosmicSeedGenerator::produce
(
edm::Event
&
ev
,
const
edm::EventSetup
& es) {
36
edm::Handle<SiStripRecHit2DCollection>
rphirecHits
;
37
ev
.getByToken(
rphirecHitsToken_
,
rphirecHits
);
38
edm::Handle<SiStripRecHit2DCollection>
stereorecHits
;
39
ev
.getByToken(
stereorecHitsToken_
,
stereorecHits
);
40
edm::Handle<SiStripMatchedRecHit2DCollection>
matchedrecHits
;
41
ev
.getByToken(
matchedrecHitsToken_
,
matchedrecHits
);
42
43
auto
output
= std::make_unique<TrajectorySeedCollection>();
44
45
//check on the number of clusters
46
size_t
clustsOrZero =
check
.
tooManyClusters
(
ev
);
47
if
(!clustsOrZero) {
48
cosmic_seed
.
init
(*
stereorecHits
, *
rphirecHits
, *
matchedrecHits
, es);
49
50
// invoke the seed finding algorithm
51
cosmic_seed
.
run
(*
output
, es);
52
}
else
53
edm::LogError
(
"TooManyClusters"
) <<
"Found too many clusters ("
<< clustsOrZero <<
"), bailing out.\n"
;
54
55
// write output to file
56
LogDebug
(
"CosmicSeedGenerator"
) <<
" number of seeds = "
<<
output
->size();
57
58
ev
.put(
std::move
(
output
));
59
}
SeedGeneratorForCosmics::init
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)
Definition:
SeedGeneratorForCosmics.cc:7
MessageLogger.h
SeedGeneratorForCosmics::run
void run(TrajectorySeedCollection &, const edm::EventSetup &c)
Definition:
SeedGeneratorForCosmics.cc:66
convertSQLitetoXML_cfg.output
output
Definition:
convertSQLitetoXML_cfg.py:32
CosmicSeedGenerator.h
CosmicSeedGenerator::matchedrecHitsToken_
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
Definition:
CosmicSeedGenerator.h:32
CosmicSeedGenerator::stereorecHitsToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > stereorecHitsToken_
Definition:
CosmicSeedGenerator.h:34
edm::LogInfo
Definition:
MessageLogger.h:254
convBremSeeds_cfi.stereorecHits
stereorecHits
Definition:
convBremSeeds_cfi.py:13
AlignmentTrackSelector_cfi.matchedrecHits
matchedrecHits
Definition:
AlignmentTrackSelector_cfi.py:64
CosmicSeedGenerator::rphirecHitsToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
Definition:
CosmicSeedGenerator.h:33
edm::Handle
Definition:
AssociativeIterator.h:50
CosmicSeedGenerator::CosmicSeedGenerator
CosmicSeedGenerator(const edm::ParameterSet &conf)
Definition:
CosmicSeedGenerator.cc:17
CosmicSeedGenerator::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition:
CosmicSeedGenerator.cc:35
RPCNoise_example.check
check
Definition:
RPCNoise_example.py:71
CosmicSeedGenerator::cosmic_seed
SeedGeneratorForCosmics cosmic_seed
Definition:
CosmicSeedGenerator.h:29
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:670
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::LogError
Definition:
MessageLogger.h:183
SiStripRecHit2DCollection.h
edm::EventSetup
Definition:
EventSetup.h:57
TrajectorySeedCollection.h
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
AlignmentTrackSelector_cfi.rphirecHits
rphirecHits
Definition:
AlignmentTrackSelector_cfi.py:63
edm::Event
Definition:
Event.h:73
ClusterChecker::tooManyClusters
size_t tooManyClusters(const edm::Event &e) const
Definition:
ClusterChecker.cc:44
edm::InputTag
Definition:
InputTag.h:15
CosmicSeedGenerator::~CosmicSeedGenerator
~CosmicSeedGenerator() override
Definition:
CosmicSeedGenerator.cc:32
CosmicSeedGenerator::check
ClusterChecker check
Definition:
CosmicSeedGenerator.h:30
Generated for CMSSW Reference Manual by
1.8.16