42 tree =
file->
make<TTree>(
"responseTree",
"same info as 3dhisto");
53 iEvent.
getByLabel(
"genParticles",
"", GenParticles);
57 if( GenParticles->size() != 1 ) {
59 <<
"Intended for particle guns only\n";
67 float genEta = gen.
eta();
77 bool isFastSim = iEvent.
getByLabel(
"fastSimProducer",
"EcalHitsEB", SimHitsEB );
79 iEvent.
getByLabel(
"fastSimProducer",
"EcalHitsEE", SimHitsEE );
80 iEvent.
getByLabel(
"fastSimProducer",
"EcalHitsES", SimHitsES );
82 iEvent.
getByLabel(
"g4SimHits",
"EcalHitsEB", SimHitsEB );
83 iEvent.
getByLabel(
"g4SimHits",
"EcalHitsEE", SimHitsEE );
84 iEvent.
getByLabel(
"g4SimHits",
"EcalHitsES", SimHitsES );
88 auto SimHits = *SimHitsEB;
89 SimHits.insert( SimHits.end(), SimHitsEE->begin(), SimHitsEE->end() );
90 SimHits.insert( SimHits.end(), SimHitsES->begin(), SimHitsES->end() );
94 float energyTotal = 0;
95 for(
auto const&
Hit : SimHits ) {
96 energyTotal +=
Hit.energy();
109 descriptions.
add(
"ecalScaleFactorCalculator", desc );
double eta() const final
momentum pseudorapidity
edm::Service< TFileService > file
T * make(const Args &...args) const
make new ROOT object
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
double energy() const final
energy
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
~TreeWriterForEcalCorrection() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TreeWriterForEcalCorrection(const edm::ParameterSet &)