139 const auto& rechitsEE = *recHitHandleEE;
140 const auto& rechitsFH = *recHitHandleFH;
141 const auto& rechitsBH = *recHitHandleBH;
142 std::map<DetId, const HGCRecHit*> hitmap;
143 for (
unsigned int i = 0;
i < rechitsEE.size(); ++
i) {
144 hitmap[rechitsEE[
i].detid()] = &rechitsEE[
i];
146 for (
unsigned int i = 0;
i < rechitsFH.size(); ++
i) {
147 hitmap[rechitsFH[
i].detid()] = &rechitsFH[
i];
149 for (
unsigned int i = 0;
i < rechitsBH.size(); ++
i) {
150 hitmap[rechitsBH[
i].detid()] = &rechitsBH[
i];
155 std::vector<SimVertex>
const & simVertices = *simVerticesHandle;
159 std::vector<CaloParticle>
const &
caloParticles = *caloParticleHandle;
163 std::vector<reco::SuperCluster>
const & simPFClusters = *simPFClustersHandle;
169 for (
auto const caloParticle : caloParticles) {
170 int id = caloParticle.pdgId();
173 histo.eta_.fill(caloParticle.eta());
174 histo.pt_.fill(caloParticle.pt());
175 histo.energy_.fill(caloParticle.energy());
176 histo.nSimClusters_.fill(caloParticle.simClusters().size());
178 histo.eta_Zorigin_map_.fill(
179 simVertices.at(caloParticle.g4Tracks()[0].vertIndex()).
position().z(), caloParticle.eta());
182 for (
auto const sc : caloParticle.simClusters()) {
185 if (hitmap.count(h_and_f.first))
186 energy += hitmap[h_and_f.first]->energy() * h_and_f.second;
189 histo.nHitInSimClusters_.fill((
float)simHits);
190 histo.selfEnergy_.fill(energy);
191 histo.energyDifference_.fill(1.- energy/caloParticle.energy());
196 for (
auto const sc : simPFClusters) {
197 histos.at(0).simPFSuperClusterSize_.fill((
float)
sc.clustersSize());
198 histos.at(0).simPFSuperClusterEnergy_.fill(
sc.rawEnergy());
203 for (
auto const pfc : simPFCandidates) {
204 size_t type = offset + pfc.particleId();
205 histos.at(offset).pfcandidateType_.fill(type - offset);
207 histo.pfcandidateEnergy_.fill(pfc.energy());
208 histo.pfcandidatePt_.fill(pfc.pt());
209 histo.pfcandidateEta_.fill(pfc.eta());
210 histo.pfcandidatePhi_.fill(pfc.phi());
211 histo.pfcandidateElementsInBlocks_.fill(pfc.elementsInBlocks().size());
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
std::vector< std::pair< uint32_t, float > > hits_and_fractions() const
Returns list of rechit IDs and fractions for this SimCluster.
edm::EDGetTokenT< std::vector< reco::SuperCluster > > simPFClusters_
edm::EDGetTokenT< std::vector< SimVertex > > simVertices_
edm::EDGetTokenT< reco::PFCandidateCollection > simPFCandidates_
edm::EDGetTokenT< std::vector< CaloParticle > > caloParticles_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
static int position[264][3]
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_