16 associatorSim_(
pset.getUntrackedParameter<
edm::
InputTag>(
"associatorSim")),
17 SaveGeneralInfo_(
pset.getUntrackedParameter<
bool>(
"SaveGeneralInfo")),
18 doCaloParticlePlots_(
pset.getUntrackedParameter<
bool>(
"doCaloParticlePlots")),
19 doCaloParticleSelection_(
pset.getUntrackedParameter<
bool>(
"doCaloParticleSelection")),
20 doSimClustersPlots_(
pset.getUntrackedParameter<
bool>(
"doSimClustersPlots")),
21 doLayerClustersPlots_(
pset.getUntrackedParameter<
bool>(
"doLayerClustersPlots")),
22 doMultiClustersPlots_(
pset.getUntrackedParameter<
bool>(
"doMultiClustersPlots")),
29 label_cp_effic = consumes<std::vector<CaloParticle>>(label_cp_effic_tag);
30 label_cp_fake = consumes<std::vector<CaloParticle>>(label_cp_fake_tag);
41 hitMap_ = consumes<std::unordered_map<DetId, const HGCRecHit*>>(
edm::InputTag(
"hgcalRecHitMapProducer"));
57 pset.getParameter<
double>(
"ptMaxCP"),
58 pset.getParameter<
double>(
"minRapidityCP"),
59 pset.getParameter<
double>(
"maxRapidityCP"),
60 pset.getParameter<
double>(
"lipCP"),
61 pset.getParameter<
double>(
"tipCP"),
62 pset.getParameter<
int>(
"minHitCP"),
63 pset.getParameter<
int>(
"maxSimClustersCP"),
64 pset.getParameter<
bool>(
"signalOnlyCP"),
65 pset.getParameter<
bool>(
"intimeOnlyCP"),
66 pset.getParameter<
bool>(
"chargedOnlyCP"),
67 pset.getParameter<
bool>(
"stableOnlyCP"),
68 pset.getParameter<
bool>(
"notConvertedOnlyCP"),
69 pset.getParameter<std::vector<int>>(
"pdgIdCP"));
83 cummatbudg.insert(std::pair<double, double>(thelay, mbg));
129 if (!
algo.process().empty())
132 if (!
algo.label().empty())
135 if (!
algo.instance().empty())
173 for (
unsigned int www = 0; www <
label_mcl.size(); www++) {
177 if (!
algo.process().empty())
180 if (!
algo.label().empty())
183 if (!
algo.instance().empty())
203 std::vector<CaloParticle>
const& cPeff,
205 std::vector<size_t>& selected_cPeff,
207 std::unordered_map<DetId, const HGCRecHit*>
const& hitMap)
const {
208 selected_cPeff.reserve(cPeff.size());
211 for (
auto const& caloParticle : cPeff) {
212 int id = caloParticle.pdgId();
215 selected_cPeff.push_back(
j);
228 using namespace reco;
230 LogDebug(
"HGCalValidator") <<
"\n===================================================="
232 <<
"Analyzing new event"
234 <<
"====================================================\n"
239 std::vector<SimVertex>
const&
simVertices = *simVerticesHandle;
243 std::vector<CaloParticle>
const&
caloParticles = *caloParticleHandle;
251 auto simRecColl = *simtorecoCollectionH;
254 auto recSimColl = *recotosimCollectionH;
257 event.getByToken(
hitMap_, hitMapHandle);
258 const std::unordered_map<DetId, const HGCRecHit*>* hitMap = &*hitMapHandle;
265 std::vector<size_t> cPIndices;
275 std::vector<size_t> selected_cPeff;
282 std::vector<SimCluster>
const&
simclusters = *simClustersHandle;
291 event.getByToken(
density_, densityHandle);
292 const Density& densities = *densityHandle;
295 std::vector<size_t> sCIndices;
298 for (
unsigned int scId = 0; scId < nSimClusters; ++scId) {
300 simclusters[scId].g4Tracks()[0].eventId().bunchCrossing() != 0) {
301 LogDebug(
"HGCalValidator") <<
"Excluding SimClusters from event: "
302 <<
simclusters[scId].g4Tracks()[0].eventId().event()
303 <<
" with BX: " <<
simclusters[scId].g4Tracks()[0].eventId().bunchCrossing()
307 sCIndices.emplace_back(scId);
322 auto simRecColl = *simtorecoCollectionH;
325 auto recSimColl = *recotosimCollectionH;
341 LogTrace(
"HGCalValidator") <<
"\n# of simclusters: " << nSimClusters <<
" label_clustersmask[ws].label() "
367 for (
unsigned int layerclusterIndex = 0; layerclusterIndex <
clusters.size(); layerclusterIndex++) {
383 const std::vector<reco::HGCalMultiCluster>& multiClusters = *multiClusterHandle;
395 LogTrace(
"HGCalValidator") <<
"\n# of multi clusters with " <<
label_mcl[wml].process() <<
":"
397 << multiClusters.size() <<
"\n"