18 associatorSim_(
pset.getUntrackedParameter<
edm::
InputTag>(
"associatorSim")),
19 SaveGeneralInfo_(
pset.getUntrackedParameter<
bool>(
"SaveGeneralInfo")),
20 doCaloParticlePlots_(
pset.getUntrackedParameter<
bool>(
"doCaloParticlePlots")),
21 doCaloParticleSelection_(
pset.getUntrackedParameter<
bool>(
"doCaloParticleSelection")),
22 doSimClustersPlots_(
pset.getUntrackedParameter<
bool>(
"doSimClustersPlots")),
23 label_SimClustersPlots_(
pset.getParameter<
edm::
InputTag>(
"label_SimClusters")),
24 label_SimClustersLevel_(
pset.getParameter<
edm::
InputTag>(
"label_SimClustersLevel")),
25 doLayerClustersPlots_(
pset.getUntrackedParameter<
bool>(
"doLayerClustersPlots")),
26 label_layerClustersPlots_(
pset.getParameter<
edm::
InputTag>(
"label_layerClusterPlots")),
27 label_LCToCPLinking_(
pset.getParameter<
edm::
InputTag>(
"label_LCToCPLinking")),
28 doTrackstersPlots_(
pset.getUntrackedParameter<
bool>(
"doTrackstersPlots")),
30 label_TSToCPLinking_(
pset.getParameter<
std::
string>(
"label_TSToCPLinking")),
31 label_TSToSTSPR_(
pset.getParameter<
std::
string>(
"label_TSToSTSPR")),
33 doCandidatesPlots_(
pset.getUntrackedParameter<
bool>(
"doCandidatesPlots")),
34 label_candidates_(
pset.getParameter<
std::
string>(
"ticlCandidates")),
36 isTICLv5_(
pset.getUntrackedParameter<
bool>(
"isticlv5")),
45 label_cp_effic = consumes<std::vector<CaloParticle>>(label_cp_effic_tag);
46 label_cp_fake = consumes<std::vector<CaloParticle>>(label_cp_fake_tag);
60 consumes<std::unordered_map<DetId, const unsigned int>>(
edm::InputTag(
"recHitMapProducer",
"hgcalRecHitMap"));
68 consumes<std::vector<TICLCandidate>>(
pset.getParameter<
edm::InputTag>(
"ticlTrackstersMerge"));
70 consumes<std::vector<TICLCandidate>>(
pset.getParameter<
edm::InputTag>(
"simTiclCandidates"));
72 consumes<std::vector<reco::Track>>(
pset.getParameter<
edm::InputTag>(
"recoTracks"));
74 consumes<std::vector<ticl::Trackster>>(
pset.getParameter<
edm::InputTag>(
"ticlTrackstersMerge"));
76 consumes<ticl::SimToRecoCollectionSimTracksters>(
pset.getParameter<
edm::InputTag>(
"mergeRecoToSimAssociator"));
78 consumes<ticl::SimToRecoCollectionSimTracksters>(
pset.getParameter<
edm::InputTag>(
"mergeSimToRecoAssociator"));
80 consumes<ticl::SimToRecoCollectionSimTracksters>(
83 candidateVal_ = std::make_unique<TICLCandidateValidator>(TICLCandidatesToken,
84 simTICLCandidatesToken,
87 associatorMapRtSToken,
88 associatorMapStRToken,
89 associatorMapRtSPUToken,
104 pset.getParameter<
double>(
"ptMaxCP"),
105 pset.getParameter<
double>(
"minRapidityCP"),
106 pset.getParameter<
double>(
"maxRapidityCP"),
107 pset.getParameter<
double>(
"lipCP"),
108 pset.getParameter<
double>(
"tipCP"),
109 pset.getParameter<
int>(
"minHitCP"),
110 pset.getParameter<
int>(
"maxSimClustersCP"),
111 pset.getParameter<
bool>(
"signalOnlyCP"),
112 pset.getParameter<
bool>(
"intimeOnlyCP"),
113 pset.getParameter<
bool>(
"chargedOnlyCP"),
114 pset.getParameter<
bool>(
"stableOnlyCP"),
115 pset.getParameter<
bool>(
"notConvertedOnlyCP"),
116 pset.getParameter<std::vector<int>>(
"pdgIdCP"));
129 fmb >> thelay >> mbg;
136 histoProducerAlgo_ = std::make_unique<HGVHistoProducerAlgo>(psetForHistoProducerAlgo);
176 if (!
algo.process().empty())
179 if (!
algo.label().empty())
182 if (!
algo.instance().empty())
220 for (
unsigned int www = 0; www <
label_tst.size(); www++) {
224 if (!
algo.process().empty())
227 if (!
algo.label().empty())
230 if (!
algo.instance().empty())
267 std::vector<CaloParticle>
const& cPeff,
269 std::vector<size_t>& selected_cPeff,
271 std::unordered_map<DetId, const unsigned int>
const& hitMap,
272 std::vector<HGCRecHit>
const&
hits)
const {
273 selected_cPeff.reserve(cPeff.size());
276 for (
auto const& caloParticle : cPeff) {
277 int id = caloParticle.pdgId();
280 selected_cPeff.push_back(
j);
293 using namespace reco;
295 LogDebug(
"HGCalValidator") <<
"\n====================================================" 297 <<
"Analyzing new event" 299 <<
"====================================================\n" 304 std::vector<SimVertex>
const&
simVertices = *simVerticesHandle;
308 std::vector<CaloParticle>
const&
caloParticles = *caloParticleHandle;
320 const std::map<uint, std::vector<uint>> cpToSc_SimTrackstersMap = *simTrackstersMapHandle;
328 auto simRecColl = *simtorecoCollectionH;
331 auto recSimColl = *recotosimCollectionH;
334 event.getByToken(
hitMap_, hitMapHandle);
335 const std::unordered_map<DetId, const unsigned int>* hitMap = &*hitMapHandle;
337 std::vector<HGCRecHit>
hits;
340 event.getByToken(
token, hitsHandle);
341 hits.insert(
hits.end(), (*hitsHandle).begin(), (*hitsHandle).end());
349 std::vector<size_t> cPIndices;
359 std::vector<size_t> selected_cPeff;
367 std::vector<SimCluster>
const& simClusters = *simClustersHandle;
374 auto nSimClusters = simClusters.size();
375 std::vector<size_t> sCIndices;
378 for (
unsigned int scId = 0; scId < nSimClusters; ++scId) {
379 if (simClusters[scId].g4Tracks()[0].eventId().
event() != 0
or 380 simClusters[scId].g4Tracks()[0].eventId().bunchCrossing() != 0) {
381 LogDebug(
"HGCalValidator") <<
"Excluding SimClusters from event: " 382 << simClusters[scId].g4Tracks()[0].eventId().event()
383 <<
" with BX: " << simClusters[scId].g4Tracks()[0].eventId().bunchCrossing()
387 sCIndices.emplace_back(scId);
402 auto simRecColl = *simtorecoCollectionH;
405 auto recSimColl = *recotosimCollectionH;
422 LogTrace(
"HGCalValidator") <<
"\n# of SimClusters: " << nSimClusters
448 for (
unsigned int layerclusterIndex = 0; layerclusterIndex <
clusters.size(); layerclusterIndex++) {
467 LogTrace(
"HGCalValidator") <<
"\n# of Tracksters from " <<
label_tst[wml].process() <<
":" 469 << tracksters.size() <<
"\n" 477 simTrackstersFromCPs,
478 cpToSc_SimTrackstersMap,
480 caloParticleHandle.
id(),
std::string fullPath() const
virtual void setCurrentFolder(std::string const &fullpath)
void dqmAnalyze(const edm::Event &, const edm::EventSetup &, const Histograms &) const override
Method called once per event.
edm::InputTag associator_
edm::EDGetTokenT< std::unordered_map< DetId, const unsigned int > > hitMap_
std::vector< edm::InputTag > label_tst
std::unique_ptr< HGVHistoProducerAlgo > histoProducerAlgo_
~HGCalValidator() override
Destructor.
CaloParticleSelector cpSelector
const bool doCaloParticlePlots_
const bool doCandidatesPlots_
unsigned totallayers_to_monitor_
std::vector< int > thicknesses_to_monitor_
void cpParametersAndSelection(const Histograms &histograms, std::vector< CaloParticle > const &cPeff, std::vector< SimVertex > const &simVertices, std::vector< size_t > &selected_cPeff, unsigned int layers, std::unordered_map< DetId, const unsigned int > const &, std::vector< HGCRecHit > const &hits) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms &) const override
Method called to book the DQM histograms.
static std::string to_string(const XMLCh *ch)
edm::InputTag label_simTS
const bool SaveGeneralInfo_
const bool doLayerClustersPlots_
edm::EDGetTokenT< ticl::RecoToSimCollectionWithSimClusters > associatorMapRtSim
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string label_TSToSTSPR_
cc *****************************************************cc the common blocks pinput and cwdidth are for input parameters cc these parameters needed to be interfaced to other program common pinput fmb
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::EDGetTokenT< ticl::SimToRecoCollectionWithSimClusters > associatorMapSimtR
edm::EDGetTokenT< std::vector< SimVertex > > simVertices_
edm::EDGetTokenT< std::vector< CaloParticle > > label_cp_fake
edm::EDGetTokenT< std::vector< CaloParticle > > label_cp_effic
const bool doCaloParticleSelection_
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
std::vector< edm::EDGetTokenT< ticl::TracksterCollection > > label_tstTokens
std::shared_ptr< hgcal::RecHitTools > tools_
std::string label_TSToCPLinking_
std::vector< edm::EDGetTokenT< HGCRecHitCollection > > hits_token_
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
std::map< double, double > cumulative_material_budget
edm::EDGetTokenT< ticl::SimToRecoCollection > associatorMapStR
edm::InputTag label_LCToCPLinking_
edm::InputTag label_simTSFromCP
edm::EDGetTokenT< reco::CaloClusterCollection > layerclusters_
HGCalValidator(const edm::ParameterSet &pset)
Constructor.
const bool doTrackstersPlots_
const edm::FileInPath cummatbudinxo_
edm::EDGetTokenT< ticl::TracksterCollection > simTracksters_
std::vector< edm::InputTag > label_clustersmask
std::vector< edm::EDGetTokenT< std::vector< float > > > clustersMaskTokens_
std::unique_ptr< TICLCandidateValidator > candidateVal_
edm::EDGetTokenT< std::vector< SimCluster > > simClusters_
std::string label_candidates_
edm::InputTag label_SimClustersPlots_
edm::InputTag label_SimClustersLevel_
std::vector< int > particles_to_monitor_
const bool doSimClustersPlots_
std::vector< Trackster > TracksterCollection
edm::EDGetTokenT< ticl::RecoToSimCollection > associatorMapRtS
edm::EDGetTokenT< std::map< uint, std::vector< uint > > > simTrackstersMap_
edm::EDGetTokenT< ticl::TracksterCollection > simTracksters_fromCPs_
std::vector< edm::InputTag > hits_label_
edm::InputTag associatorSim_
edm::InputTag label_layerClustersPlots_