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 {
13 }
14 
15 
16 namespace CastorDigiAnalyzerImpl {
17  template<class Collection>
20  e.getByType(digis);
21  if (!digis.isValid()) {
22  edm::LogError("CastorDigiAnalyzer") << "Could not find Castor Digi Container ";
23  } else {
24  for(unsigned i = 0; i < digis->size(); ++i) {
25  statistics.analyze((*digis)[i]);
26  }
27  }
28  }
29 }
30 
31 
33  // edm::Handle<edm::PCaloHitContainer> hits;
35 
36 e.getByLabel("mix", "g4SimHitsCastorFI", castorcf);
37 
38 
39 //access to SimHits
40 std::auto_ptr<MixCollection<PCaloHit> > hits(new MixCollection<PCaloHit>(castorcf.product()));
41 // if (hits.isValid()) {
43  CastorDigiAnalyzerImpl::analyze<CastorDigiCollection>(e, castorDigiStatistics_);
44  }
int i
Definition: DBlmapReader.cc:9
CaloHitAnalyzer castorHitAnalyzer_
bool getByType(Handle< PROD > &result) const
Definition: Event.h:397
CastorDigiStatistics castorDigiStatistics_
void fillHits(MixCollection< PCaloHit > &hits)
should be called each event
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple conf
Definition: dbtoconf.py:185
T const * product() const
Definition: Handle.h:74
void analyze(edm::Event const &e, CastorDigiStatistics &statistics)
void analyze(const Digi &digi)
virtual void analyze(edm::Event const &e, edm::EventSetup const &c)
CastorDigiAnalyzer(edm::ParameterSet const &conf)