CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
17 namespace CastorDigiAnalyzerImpl {
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::auto_ptr<MixCollection<PCaloHit> > hits(new MixCollection<PCaloHit>(castorcf.product()));
42 // if (hits.isValid()) {
44  CastorDigiAnalyzerImpl::analyze<CastorDigiCollection>(e, castorDigiStatistics_, castorDigiCollectionTag_);
45  }
int i
Definition: DBlmapReader.cc:9
CaloHitAnalyzer castorHitAnalyzer_
void analyze(edm::Event const &e, CastorDigiStatistics &statistics, edm::InputTag &tag)
CastorDigiStatistics castorDigiStatistics_
void fillHits(MixCollection< PCaloHit > &hits)
should be called each event
edm::InputTag castorDigiCollectionTag_
bool isValid() const
Definition: HandleBase.h:75
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:405
tuple conf
Definition: dbtoconf.py:185
T const * product() const
Definition: Handle.h:81
void analyze(const Digi &digi)
virtual void analyze(edm::Event const &e, edm::EventSetup const &c)
CastorDigiAnalyzer(edm::ParameterSet const &conf)