SimCalorimetry
CastorSim
plugins
CastorDigiAnalyzer.cc
Go to the documentation of this file.
1
#include "
DataFormats/HcalDigi/interface/HcalDigiCollections.h
"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
#include "
SimCalorimetry/CastorSim/plugins/CastorDigiAnalyzer.h
"
4
#include <iostream>
5
6
CastorDigiAnalyzer::CastorDigiAnalyzer
(
edm::ParameterSet
const
&conf)
7
: hitReadoutName_(
"CastorHits"
),
8
simParameterMap_(),
9
castorHitAnalyzer_(
"CASTORDigi"
, 1., &simParameterMap_, &castorFilter_),
10
castorDigiStatistics_(
"CASTORDigi"
, 3, 10., 6., 0.1, 0.5, castorHitAnalyzer_),
11
castorDigiCollectionTag_(conf.getParameter<
edm
::
InputTag
>(
"castorDigiCollectionTag"
)) {}
12
13
namespace
CastorDigiAnalyzerImpl
{
14
template
<
class
Collection>
15
void
analyze
(
edm::Event
const
&
e
,
CastorDigiStatistics
&
statistics
,
edm::InputTag
&
tag
) {
16
edm::Handle<Collection>
digis;
17
e
.getByLabel(
tag
, digis);
18
if
(!digis.
isValid
()) {
19
edm::LogError
(
"CastorDigiAnalyzer"
) <<
"Could not find Castor Digi Container "
;
20
}
else
{
21
for
(
unsigned
i
= 0;
i
< digis->size(); ++
i
) {
22
statistics
.analyze((*digis)[
i
]);
23
}
24
}
25
}
26
}
// namespace CastorDigiAnalyzerImpl
27
28
void
CastorDigiAnalyzer::analyze
(
edm::Event
const
&
e
,
edm::EventSetup
const
&
c
) {
29
// edm::Handle<edm::PCaloHitContainer> hits;
30
edm::Handle<CrossingFrame<PCaloHit>
> castorcf;
31
32
e
.getByLabel(
"mix"
,
"g4SimHitsCastorFI"
, castorcf);
33
34
// access to SimHits
35
std::unique_ptr<MixCollection<PCaloHit>>
hits
(
new
MixCollection<PCaloHit>
(castorcf.
product
()));
36
// if (hits.isValid()) {
37
castorHitAnalyzer_
.
fillHits
(*
hits
);
38
CastorDigiAnalyzerImpl::analyze<CastorDigiCollection>(
e
,
castorDigiStatistics_
,
castorDigiCollectionTag_
);
39
}
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
CastorDigiAnalyzer::castorDigiStatistics_
CastorDigiStatistics castorDigiStatistics_
Definition:
CastorDigiAnalyzer.h:30
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89301
CastorDigiAnalyzer::castorHitAnalyzer_
CaloHitAnalyzer castorHitAnalyzer_
Definition:
CastorDigiAnalyzer.h:29
debug_messages_cfi.statistics
statistics
Definition:
debug_messages_cfi.py:97
CastorDigiAnalyzer.h
edm::Handle
Definition:
AssociativeIterator.h:50
MixCollection
Definition:
MixCollection.h:10
HcalDigiCollections.h
CaloHitAnalyzer::fillHits
void fillHits(MixCollection< PCaloHit > &hits)
should be called each event
Definition:
CaloHitAnalyzer.cc:22
CastorDigiStatistics
Definition:
CastorDigiStatistics.h:9
edm::ParameterSet
Definition:
ParameterSet.h:47
makeGlobalPositionRcd_cfg.tag
tag
Definition:
makeGlobalPositionRcd_cfg.py:6
CastorDigiAnalyzer::castorDigiCollectionTag_
edm::InputTag castorDigiCollectionTag_
Definition:
CastorDigiAnalyzer.h:31
edm::EventSetup
Definition:
EventSetup.h:58
CastorDigiAnalyzer::analyze
void analyze(edm::Event const &e, edm::EventSetup const &c) override
Definition:
CastorDigiAnalyzer.cc:28
CastorDigiAnalyzer::CastorDigiAnalyzer
CastorDigiAnalyzer(edm::ParameterSet const &conf)
Definition:
CastorDigiAnalyzer.cc:6
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
CastorDigiAnalyzerImpl
Definition:
CastorDigiAnalyzer.cc:13
CastorDigiAnalyzerImpl::analyze
void analyze(edm::Event const &e, CastorDigiStatistics &statistics, edm::InputTag &tag)
Definition:
CastorDigiAnalyzer.cc:15
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16