132 const auto& rechitsEE = *recHitHandleEE;
133 const auto& rechitsFH = *recHitHandleFH;
134 const auto& rechitsBH = *recHitHandleBH;
135 std::map<DetId, const HGCRecHit*> hitmap;
136 for (
unsigned int i = 0;
i < rechitsEE.size(); ++
i) {
137 hitmap[rechitsEE[
i].detid()] = &rechitsEE[
i];
139 for (
unsigned int i = 0;
i < rechitsFH.size(); ++
i) {
140 hitmap[rechitsFH[
i].detid()] = &rechitsFH[
i];
142 for (
unsigned int i = 0;
i < rechitsBH.size(); ++
i) {
143 hitmap[rechitsBH[
i].detid()] = &rechitsBH[
i];
148 std::vector<SimVertex>
const&
simVertices = *simVerticesHandle;
152 std::vector<CaloParticle>
const&
caloParticles = *caloParticleHandle;
156 std::vector<reco::SuperCluster>
const& simPFClusters = *simPFClustersHandle;
162 for (
auto const caloParticle : caloParticles) {
163 if (caloParticle.g4Tracks()[0].eventId().event() != 0
or 164 caloParticle.g4Tracks()[0].eventId().bunchCrossing() != 0) {
165 LogDebug(
"CaloParticleValidation") <<
"Excluding CaloParticles from event: " 166 << caloParticle.g4Tracks()[0].eventId().event()
167 <<
" with BX: " << caloParticle.g4Tracks()[0].eventId().bunchCrossing()
171 int id = caloParticle.pdgId();
174 histo.eta_->Fill(caloParticle.eta());
175 histo.pt_->Fill(caloParticle.pt());
176 histo.energy_->Fill(caloParticle.energy());
177 histo.nSimClusters_->Fill(caloParticle.simClusters().size());
179 histo.eta_Zorigin_map_->Fill(simVertices.at(caloParticle.g4Tracks()[0].vertIndex()).
position().z(),
183 for (
auto const sc : caloParticle.simClusters()) {
186 if (hitmap.count(h_and_f.first))
187 energy += hitmap[h_and_f.first]->energy() * h_and_f.second;
190 histo.nHitInSimClusters_->Fill((
float)simHits);
191 histo.selfEnergy_->Fill(energy);
192 histo.energyDifference_->Fill(1. - energy / caloParticle.energy());
197 for (
auto const sc : simPFClusters) {
198 histos.at(0).simPFSuperClusterSize_->Fill((
float)
sc.clustersSize());
199 histos.at(0).simPFSuperClusterEnergy_->Fill(
sc.rawEnergy());
206 for (
auto const pfc : simPFCandidates) {
207 size_t type = offset + pfc.particleId();
210 histos.at(offset).pfcandidateType_->Fill(type - offset);
212 histo.pfcandidateEnergy_->Fill(pfc.energy());
213 histo.pfcandidatePt_->Fill(pfc.pt());
214 histo.pfcandidateEta_->Fill(pfc.eta());
215 histo.pfcandidatePhi_->Fill(pfc.phi());
216 histo.pfcandidateElementsInBlocks_->Fill(pfc.elementsInBlocks().size());
219 histo.pfcandidate_vect_sum_pt_->Fill(
std::sqrt(ptx_tot * ptx_tot + pty_tot * pty_tot));
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
edm::EDGetTokenT< std::vector< reco::SuperCluster > > simPFClusters_
edm::EDGetTokenT< std::vector< SimVertex > > simVertices_
edm::EDGetTokenT< reco::PFCandidateCollection > simPFCandidates_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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_
std::vector< std::pair< uint32_t, float > > hits_and_fractions() const
Returns list of rechit IDs and fractions for this SimCluster.