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")),
38 label_cp_effic = consumes<std::vector<CaloParticle>>(label_cp_effic_tag);
39 label_cp_fake = consumes<std::vector<CaloParticle>>(label_cp_fake_tag);
52 hitMap_ = consumes<std::unordered_map<DetId, const HGCRecHit*>>(
edm::InputTag(
"hgcalRecHitMapProducer"));
71 pset.getParameter<
double>(
"ptMaxCP"),
72 pset.getParameter<
double>(
"minRapidityCP"),
73 pset.getParameter<
double>(
"maxRapidityCP"),
74 pset.getParameter<
double>(
"lipCP"),
75 pset.getParameter<
double>(
"tipCP"),
76 pset.getParameter<
int>(
"minHitCP"),
77 pset.getParameter<
int>(
"maxSimClustersCP"),
78 pset.getParameter<
bool>(
"signalOnlyCP"),
79 pset.getParameter<
bool>(
"intimeOnlyCP"),
80 pset.getParameter<
bool>(
"chargedOnlyCP"),
81 pset.getParameter<
bool>(
"stableOnlyCP"),
82 pset.getParameter<
bool>(
"notConvertedOnlyCP"),
83 pset.getParameter<std::vector<int>>(
"pdgIdCP"));
97 cummatbudg.insert(std::pair<double, double>(thelay, mbg));
103 histoProducerAlgo_ = std::make_unique<HGVHistoProducerAlgo>(psetForHistoProducerAlgo);
143 if (!
algo.process().empty())
146 if (!
algo.label().empty())
149 if (!
algo.instance().empty())
187 for (
unsigned int www = 0; www <
label_tst.size(); www++) {
191 if (!
algo.process().empty())
194 if (!
algo.label().empty())
197 if (!
algo.instance().empty())
217 ibook,
histograms.histoProducerAlgo, HGVHistoProducerAlgo::validationType::Linking);
221 ibook,
histograms.histoProducerAlgo, HGVHistoProducerAlgo::validationType::PatternRecognition);
227 std::vector<CaloParticle>
const& cPeff,
229 std::vector<size_t>& selected_cPeff,
231 std::unordered_map<DetId, const HGCRecHit*>
const& hitMap)
const {
232 selected_cPeff.reserve(cPeff.size());
235 for (
auto const& caloParticle : cPeff) {
236 int id = caloParticle.pdgId();
239 selected_cPeff.push_back(
j);
252 using namespace reco;
254 LogDebug(
"HGCalValidator") <<
"\n====================================================" 256 <<
"Analyzing new event" 258 <<
"====================================================\n" 263 std::vector<SimVertex>
const&
simVertices = *simVerticesHandle;
267 std::vector<CaloParticle>
const&
caloParticles = *caloParticleHandle;
279 const std::map<uint, std::vector<uint>> cpToSc_SimTrackstersMap = *simTrackstersMapHandle;
287 auto simRecColl = *simtorecoCollectionH;
290 auto recSimColl = *recotosimCollectionH;
293 event.getByToken(
hitMap_, hitMapHandle);
294 const std::unordered_map<DetId, const HGCRecHit*>* hitMap = &*hitMapHandle;
301 std::vector<size_t> cPIndices;
311 std::vector<size_t> selected_cPeff;
318 std::vector<SimCluster>
const& simClusters = *simClustersHandle;
327 event.getByToken(
density_, densityHandle);
328 const Density& densities = *densityHandle;
330 auto nSimClusters = simClusters.size();
331 std::vector<size_t> sCIndices;
334 for (
unsigned int scId = 0; scId < nSimClusters; ++scId) {
335 if (simClusters[scId].g4Tracks()[0].eventId().
event() != 0
or 336 simClusters[scId].g4Tracks()[0].eventId().bunchCrossing() != 0) {
337 LogDebug(
"HGCalValidator") <<
"Excluding SimClusters from event: " 338 << simClusters[scId].g4Tracks()[0].eventId().event()
339 <<
" with BX: " << simClusters[scId].g4Tracks()[0].eventId().bunchCrossing()
343 sCIndices.emplace_back(scId);
358 auto simRecColl = *simtorecoCollectionH;
361 auto recSimColl = *recotosimCollectionH;
377 LogTrace(
"HGCalValidator") <<
"\n# of SimClusters: " << nSimClusters
403 for (
unsigned int layerclusterIndex = 0; layerclusterIndex <
clusters.size(); layerclusterIndex++) {
422 LogTrace(
"HGCalValidator") <<
"\n# of Tracksters from " <<
label_tst[wml].process() <<
":" 424 << tracksters.size() <<
"\n" 432 simTrackstersFromCPs,
433 cpToSc_SimTrackstersMap,
435 caloParticleHandle.
id(),
std::map< double, double > cummatbudg
edm::EDGetTokenT< std::unordered_map< DetId, const HGCRecHit * > > hitMap_
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 HGCRecHit *> const &) const
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_
std::vector< edm::InputTag > label_tst
edm::EDGetTokenT< hgcal::SimToRecoCollectionWithSimClusters > associatorMapSimtR
std::unique_ptr< HGVHistoProducerAlgo > histoProducerAlgo_
std::string to_string(const V &value)
~HGCalValidator() override
Destructor.
edm::EDGetTokenT< hgcal::RecoToSimCollectionWithSimClusters > associatorMapRtSim
CaloParticleSelector cpSelector
const bool doCaloParticlePlots_
unsigned totallayers_to_monitor_
std::vector< int > thicknesses_to_monitor_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms &) const override
Method called to book the DQM histograms.
edm::InputTag label_simTS
const bool SaveGeneralInfo_
const bool doLayerClustersPlots_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< Density > density_
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< hgcal::RecoToSimCollection > associatorMapRtS
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< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
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_
edm::EDGetTokenT< std::vector< SimCluster > > simClusters_
edm::InputTag label_SimClustersPlots_
edm::InputTag label_SimClustersLevel_
std::vector< int > particles_to_monitor_
edm::EDGetTokenT< hgcal::SimToRecoCollection > associatorMapStR
const bool doSimClustersPlots_
std::vector< Trackster > TracksterCollection
hgcal_clustering::Density Density
edm::EDGetTokenT< std::map< uint, std::vector< uint > > > simTrackstersMap_
edm::EDGetTokenT< ticl::TracksterCollection > simTracksters_fromCPs_
edm::InputTag associatorSim_
edm::InputTag label_layerClustersPlots_