78 "dynamicHybridSuperClusters",
edm::InputTag(
"dynamicHybridSuperClusters")));
80 "correctedHybridSuperClusters",
edm::InputTag(
"correctedHybridSuperClusters")));
83 "correctedDynamicHybridSuperClusters",
edm::InputTag(
"correctedDynamicHybridSuperClusters")));
86 edm::InputTag(
"correctedFixedMatrixSuperClustersWithPreshower")));
89 "fixedMatrixSuperClustersWithPreshower",
edm::InputTag(
"fixedMatrixSuperClustersWithPreshower")));
109 mytree_ =
new TTree(
"energyScale",
"");
110 TString treeVariables =
111 "mc_npar/I:parID:mc_sep/"
112 "F:mc_e:mc_et:mc_phi:mc_eta:mc_theta:";
113 treeVariables +=
"em_dR/F:";
115 "em_isInCrack/I:em_scType:em_e/F:em_et:em_phi:em_eta:em_theta:em_nCell/"
117 treeVariables +=
"em_pet/F:em_pe:em_peta:em_ptheta:";
120 treeVariables +=
"emCorr_e/F:emCorr_et:emCorr_eta:emCorr_phi:emCorr_theta:";
123 treeVariables +=
"emCorr_pet/F:emCorr_peta:emCorr_ptheta:";
125 treeVariables +=
"em_pw/F:em_ew:em_br";
149 if (!(
hepMC.isValid())) {
150 LogInfo(
"EnergyScaleAnalyzer") <<
"Could not get MC Product!";
155 std::vector<Handle<HepMCProduct>> evtHandles;
158 for (
unsigned int i = 0;
i < evtHandles.size(); ++
i) {
164 HepMC::GenEvent::vertex_const_iterator
vtx = evt->vertices_begin();
167 xVtx_ = 0.1 * (*vtx)->position().x();
168 yVtx_ = 0.1 * (*vtx)->position().y();
169 zVtx_ = 0.1 * (*vtx)->position().z();
180 edm::LogError(
"EnergyScaleAnalyzer") <<
"Can't get collection with producer hybridSuperClusters.";
187 edm::LogError(
"EnergyScaleAnalyzer") <<
"Can't get collection with producer dynamicHybridSuperClusters.";
194 edm::LogError(
"EnergyScaleAnalyzer") <<
"Can't get collection with producer "
195 "fixedMatrixSuperClustersWithPreshower.";
203 edm::LogError(
"EnergyScaleAnalyzer") <<
"Can't get collection with producer correctedHybridSuperClusters.";
210 edm::LogError(
"EnergyScaleAnalyzer") <<
"Can't get collection with producer "
211 "correctedDynamicHybridSuperClusters.";
218 edm::LogError(
"EnergyScaleAnalyzer") <<
"Can't get collection with producer "
219 "correctedFixedMatrixSuperClustersWithPreshower.";
269 HepMC::GenEvent::particle_const_iterator
p =
genEvent->particles_begin();
275 std::vector<HepMC::GenParticle *> mcParticles;
277 for (HepMC::GenEvent::particle_const_iterator
p =
genEvent->particles_begin();
p !=
genEvent->particles_end(); ++
p) {
281 if ((*p)->pdg_id() != 22 &&
abs((*p)->pdg_id()) != 11)
285 bool satisfySelectionCriteria = (*p)->momentum().perp() > min_eT && fabs((*p)->momentum().eta()) <
max_eta;
287 if (!satisfySelectionCriteria)
291 mcParticles.push_back(*
p);
295 if (mcParticles.size() == 2) {
299 kinem::delta_R(mc1->momentum().eta(), mc1->momentum().phi(), mc2->momentum().eta(), mc2->momentum().phi());
305 for (std::vector<HepMC::GenParticle *>::const_iterator
p = mcParticles.begin();
p != mcParticles.end(); ++
p) {
348 reco::SuperClusterCollection::const_iterator em = scColl->end();
349 float energyMax = -100.0;
350 for (reco::SuperClusterCollection::const_iterator aClus = scColl->begin(); aClus != scColl->end(); ++aClus) {
353 kinem::delta_R(
mc->momentum().eta(),
mc->momentum().phi(), aClus->position().eta(), aClus->position().phi());
355 float energy = aClus->energy();
363 if (em == scColl->end()) {
374 double emAbsEta = fabs(em->position().eta());
377 if (emAbsEta < 0.018 || (emAbsEta > 0.423 && emAbsEta < 0.461) || (emAbsEta > 0.770 && emAbsEta < 0.806) ||
378 (emAbsEta > 1.127 && emAbsEta < 1.163) || (emAbsEta > 1.460 && emAbsEta < 1.558))
402 etaMax_ = em->position().eta();
403 phiMax_ = em->position().phi();
423 em = corrSCColl->end();
425 for (reco::SuperClusterCollection::const_iterator aClus = corrSCColl->begin(); aClus != corrSCColl->end(); ++aClus) {
428 kinem::delta_R(
mc->momentum().eta(),
mc->momentum().phi(), aClus->position().eta(), aClus->position().phi());
430 float energy = aClus->energy();
438 if (em == corrSCColl->end()) {