SimCalorimetry
CastorSim
plugins
CastorHitAnalyzer.cc
Go to the documentation of this file.
1
#include "
DataFormats/HcalRecHit/interface/HcalRecHitCollections.h
"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
#include "
SimCalorimetry/CastorSim/plugins/CastorHitAnalyzer.h
"
4
#include <iostream>
5
6
CastorHitAnalyzer::CastorHitAnalyzer
(
edm::ParameterSet
const
&conf)
7
: hitReadoutName_(
"CastorHits"
),
8
simParameterMap_(),
9
castorFilter_(),
10
castorAnalyzer_(
"CASTOR"
, 1., &simParameterMap_, &castorFilter_),
11
castorRecHitCollectionTag_(conf.getParameter<
edm
::
InputTag
>(
"castorRecHitCollectionTag"
)) {}
12
13
namespace
CastorHitAnalyzerImpl
{
14
template
<
class
Collection>
15
void
analyze
(
edm::Event
const
&
e
,
CaloHitAnalyzer
&
analyzer
,
edm::InputTag
&
tag
) {
16
edm::Handle<Collection>
recHits
;
17
e
.getByLabel(
tag
,
recHits
);
18
if
(!
recHits
.isValid()) {
19
edm::LogError
(
"CastorHitAnalyzer"
) <<
"Could not find Castor RecHitContainer "
;
20
}
else
{
21
for
(
unsigned
i
= 0;
i
<
recHits
->size(); ++
i
) {
22
analyzer
.analyze((*
recHits
)[
i
].
id
().rawId(), (*
recHits
)[
i
].
energy
());
23
}
24
}
25
}
26
}
// namespace CastorHitAnalyzerImpl
27
28
void
CastorHitAnalyzer::analyze
(
edm::Event
const
&
e
,
edm::EventSetup
const
&
c
) {
29
edm::Handle<CrossingFrame<PCaloHit>
> castorcf;
30
e
.getByLabel(
"mix"
,
"g4SimHitsCastorFI"
, castorcf);
31
32
// access to SimHits
33
std::unique_ptr<MixCollection<PCaloHit>>
hits
(
new
MixCollection<PCaloHit>
(castorcf.
product
()));
34
castorAnalyzer_
.
fillHits
(*
hits
);
35
CastorHitAnalyzerImpl::analyze<CastorRecHitCollection>(
e
,
castorAnalyzer_
,
castorRecHitCollectionTag_
);
36
}
mps_fire.i
i
Definition:
mps_fire.py:428
MessageLogger.h
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
hfClusterShapes_cfi.hits
hits
Definition:
hfClusterShapes_cfi.py:5
edm
HLT enums.
Definition:
AlignableModifier.h:19
CastorHitAnalyzer::CastorHitAnalyzer
CastorHitAnalyzer(edm::ParameterSet const &conf)
Definition:
CastorHitAnalyzer.cc:6
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89287
edm::Handle
Definition:
AssociativeIterator.h:50
CastorHitAnalyzer::castorRecHitCollectionTag_
edm::InputTag castorRecHitCollectionTag_
Definition:
CastorHitAnalyzer.h:29
CastorHitAnalyzer::analyze
void analyze(edm::Event const &e, edm::EventSetup const &c) override
Definition:
CastorHitAnalyzer.cc:28
CastorHitAnalyzerImpl
Definition:
CastorHitAnalyzer.cc:13
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
MixCollection
Definition:
MixCollection.h:11
CaloHitAnalyzer::fillHits
void fillHits(MixCollection< PCaloHit > &hits)
should be called each event
Definition:
CaloHitAnalyzer.cc:22
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition:
HCALHighEnergyHPDFilter_cfi.py:5
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition:
FastTrackerRecHitMaskProducer_cfi.py:8
CastorHitAnalyzer::castorAnalyzer_
CaloHitAnalyzer castorAnalyzer_
Definition:
CastorHitAnalyzer.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
CaloHitAnalyzer
Definition:
CaloHitAnalyzer.h:21
edm::EventSetup
Definition:
EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
analyzer
Definition:
SiPixelLorentzAngle.h:82
HcalRecHitCollections.h
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
CastorHitAnalyzerImpl::analyze
void analyze(edm::Event const &e, CaloHitAnalyzer &analyzer, edm::InputTag &tag)
Definition:
CastorHitAnalyzer.cc:15
CastorHitAnalyzer.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16