CMS 3D CMS Logo

CaloRecHitCandidateProducer.cc
Go to the documentation of this file.
4 
5 namespace reco {
6  namespace modules {
7 
8  template <typename HitCollection>
10  public:
13  : srcToken_(consumes<HitCollection>(cfg.template getParameter<edm::InputTag>("src"))) {}
16 
17  private:
19  void produce(edm::Event &, const edm::EventSetup &) override;
22  };
23  } // namespace modules
24 } // namespace reco
25 
29 
30 namespace reco {
31  namespace modules {
32 
33  template <typename HitCollection>
35  using namespace edm;
36  using namespace reco;
37  using namespace std;
39  evt.getByToken(srcToken_, hits);
40  unique_ptr<CandidateCollection> cands(new CandidateCollection);
41  size_t size = hits->size();
42  cands->reserve(size);
43  for (size_t idx = 0; idx != size; ++idx) {
44  const CaloRecHit &hit = (*hits)[idx];
46  double eta = 0, phi = 0, energy = hit.energy();
47  math::RhoEtaPhiVector p(1, eta, phi);
48  p *= (energy / p.r());
51  cands->push_back(c);
52  }
53  evt.put(std::move(cands));
54  }
55 
56  } // namespace modules
57 } // namespace reco
58 
61 
66 
Handle.h
EDProducer.h
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
modules
Definition: MuonCleanerBySegments.cc:35
edm::EDGetTokenT< HitCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
HBHERecHitCandidateProducer
reco::modules::CaloRecHitCandidateProducer< HBHERecHitCollection > HBHERecHitCandidateProducer
Definition: CaloRecHitCandidateProducer.cc:64
reco::modules::CaloRecHitCandidateProducer::~CaloRecHitCandidateProducer
~CaloRecHitCandidateProducer() override
destructor
Definition: CaloRecHitCandidateProducer.cc:15
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
CaloRecHit
Definition: CaloRecHit.h:23
math::RhoEtaPhiVector
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:33
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PVValHelper::eta
Definition: PVValidationHelpers.h:70
HORecHitCandidateProducer
reco::modules::CaloRecHitCandidateProducer< HORecHitCollection > HORecHitCandidateProducer
Definition: CaloRecHitCandidateProducer.cc:65
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
reco::modules::CaloRecHitCandidateProducer::srcToken_
edm::EDGetTokenT< HitCollection > srcToken_
source collection tag
Definition: CaloRecHitCandidateProducer.cc:21
CaloRecHitCandidate.h
reco::modules::CaloRecHitCandidateProducer::CaloRecHitCandidateProducer
CaloRecHitCandidateProducer(const edm::ParameterSet &cfg)
constructor
Definition: CaloRecHitCandidateProducer.cc:12
reco::CaloRecHitCandidate
Definition: CaloRecHitCandidate.h:17
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15161
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Event.h
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EventSetup
Definition: EventSetup.h:58
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
HFRecHitCandidateProducer
reco::modules::CaloRecHitCandidateProducer< HFRecHitCollection > HFRecHitCandidateProducer
Definition: CaloRecHitCandidateProducer.cc:62
looper.cfg
cfg
Definition: looper.py:296
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
reco::modules::CaloRecHitCandidateProducer
Definition: CaloRecHitCandidateProducer.cc:9
HitCollection
std::vector< Hit > HitCollection
Definition: HitCollection.h:34
edm::EDProducer
Definition: EDProducer.h:35
edm::RefToBase< CaloRecHit >
HcalRecHitCollections.h
ParameterSet.h
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:159
ZDCRecHitCandidateProducer
reco::modules::CaloRecHitCandidateProducer< ZDCRecHitCollection > ZDCRecHitCandidateProducer
Definition: CaloRecHitCandidateProducer.cc:63
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
reco::modules::CaloRecHitCandidateProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
process one event
Definition: CaloRecHitCandidateProducer.cc:34
Vector3D.h
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector
Definition: OwnVector.h:24
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443