CMS 3D CMS Logo

CastorDigiAnalyzer.cc
Go to the documentation of this file.
4 #include <iostream>
5 
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 
14  template <class Collection>
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 
29  // edm::Handle<edm::PCaloHitContainer> hits;
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()) {
38  CastorDigiAnalyzerImpl::analyze<CastorDigiCollection>(e, castorDigiStatistics_, castorDigiCollectionTag_);
39 }
CaloHitAnalyzer castorHitAnalyzer_
CastorDigiStatistics castorDigiStatistics_
void fillHits(MixCollection< PCaloHit > &hits)
should be called each event
edm::InputTag castorDigiCollectionTag_
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
T const * product() const
Definition: Handle.h:74
HLT enums.
void analyze(const Digi &digi)
CastorDigiAnalyzer(edm::ParameterSet const &conf)
void analyze(edm::Event const &e, edm::EventSetup const &c) override