140 const auto& rechitsEE = *recHitHandleEE;
141 const auto& rechitsFH = *recHitHandleFH;
142 const auto& rechitsBH = *recHitHandleBH;
143 std::map<DetId, const HGCRecHit*> hitmap;
144 for (
unsigned int i = 0;
i < rechitsEE.size(); ++
i) {
145 hitmap[rechitsEE[
i].detid()] = &rechitsEE[
i];
147 for (
unsigned int i = 0;
i < rechitsFH.size(); ++
i) {
148 hitmap[rechitsFH[
i].detid()] = &rechitsFH[
i];
150 for (
unsigned int i = 0;
i < rechitsBH.size(); ++
i) {
151 hitmap[rechitsBH[
i].detid()] = &rechitsBH[
i];
156 std::vector<SimVertex>
const &
simVertices = *simVerticesHandle;
160 std::vector<CaloParticle>
const &
caloParticles = *caloParticleHandle;
164 std::vector<reco::SuperCluster>
const & simPFClusters = *simPFClustersHandle;
170 for (
auto const caloParticle : caloParticles) {
171 if (caloParticle.g4Tracks()[0].eventId().event() != 0
or caloParticle.g4Tracks()[0].eventId().bunchCrossing() != 0) {
172 LogDebug(
"CaloParticleValidation") <<
"Excluding CaloParticles from event: " 173 << caloParticle.g4Tracks()[0].eventId().event()
174 <<
" with BX: " << caloParticle.g4Tracks()[0].eventId().bunchCrossing() << std::endl;
177 int id = caloParticle.pdgId();
180 histo.eta_.fill(caloParticle.eta());
181 histo.pt_.fill(caloParticle.pt());
182 histo.energy_.fill(caloParticle.energy());
183 histo.nSimClusters_.fill(caloParticle.simClusters().size());
185 histo.eta_Zorigin_map_.fill(
186 simVertices.at(caloParticle.g4Tracks()[0].vertIndex()).
position().z(), caloParticle.eta());
189 for (
auto const sc : caloParticle.simClusters()) {
192 if (hitmap.count(h_and_f.first))
193 energy += hitmap[h_and_f.first]->energy() * h_and_f.second;
196 histo.nHitInSimClusters_.fill((
float)simHits);
197 histo.selfEnergy_.fill(energy);
198 histo.energyDifference_.fill(1.- energy/caloParticle.energy());
203 for (
auto const sc : simPFClusters) {
204 histos.at(0).simPFSuperClusterSize_.fill((
float)
sc.clustersSize());
205 histos.at(0).simPFSuperClusterEnergy_.fill(
sc.rawEnergy());
212 for (
auto const pfc : simPFCandidates) {
213 size_t type = offset + pfc.particleId();
216 histos.at(offset).pfcandidateType_.fill(type - offset);
218 histo.pfcandidateEnergy_.fill(pfc.energy());
219 histo.pfcandidatePt_.fill(pfc.pt());
220 histo.pfcandidateEta_.fill(pfc.eta());
221 histo.pfcandidatePhi_.fill(pfc.phi());
222 histo.pfcandidateElementsInBlocks_.fill(pfc.elementsInBlocks().size());
225 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.