CMS 3D CMS Logo

CastorDigiAnalyzer.cc
Go to the documentation of this file.
4 #include<iostream>
5 
6 
8 : hitReadoutName_("CastorHits"),
9  simParameterMap_(),
10  castorHitAnalyzer_("CASTORDigi", 1., &simParameterMap_, &castorFilter_),
11  castorDigiStatistics_("CASTORDigi", 3, 10., 6., 0.1, 0.5, castorHitAnalyzer_),
12  castorDigiCollectionTag_(conf.getParameter<edm::InputTag>("castorDigiCollectionTag"))
13 {
14 }
15 
16 
18  template<class Collection>
21  e.getByLabel(tag, digis);
22  if (!digis.isValid()) {
23  edm::LogError("CastorDigiAnalyzer") << "Could not find Castor Digi Container ";
24  } else {
25  for(unsigned i = 0; i < digis->size(); ++i) {
26  statistics.analyze((*digis)[i]);
27  }
28  }
29  }
30 }
31 
32 
34  // edm::Handle<edm::PCaloHitContainer> hits;
36 
37 e.getByLabel("mix", "g4SimHitsCastorFI", castorcf);
38 
39 
40 //access to SimHits
41 std::unique_ptr<MixCollection<PCaloHit> > hits(new MixCollection<PCaloHit>(castorcf.product()));
42 // if (hits.isValid()) {
44  CastorDigiAnalyzerImpl::analyze<CastorDigiCollection>(e, castorDigiStatistics_, castorDigiCollectionTag_);
45  }
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:535
T const * product() const
Definition: Handle.h:81
HLT enums.
void analyze(const Digi &digi)
CastorDigiAnalyzer(edm::ParameterSet const &conf)
void analyze(edm::Event const &e, edm::EventSetup const &c) override