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"));
69 pset.getParameter<
double>(
"ptMaxCP"),
70 pset.getParameter<
double>(
"minRapidityCP"),
71 pset.getParameter<
double>(
"maxRapidityCP"),
72 pset.getParameter<
double>(
"lipCP"),
73 pset.getParameter<
double>(
"tipCP"),
74 pset.getParameter<
int>(
"minHitCP"),
75 pset.getParameter<
int>(
"maxSimClustersCP"),
76 pset.getParameter<
bool>(
"signalOnlyCP"),
77 pset.getParameter<
bool>(
"intimeOnlyCP"),
78 pset.getParameter<
bool>(
"chargedOnlyCP"),
79 pset.getParameter<
bool>(
"stableOnlyCP"),
80 pset.getParameter<
bool>(
"notConvertedOnlyCP"),
81 pset.getParameter<std::vector<int>>(
"pdgIdCP"));
95 cummatbudg.insert(std::pair<double, double>(thelay, mbg));
101 histoProducerAlgo_ = std::make_unique<HGVHistoProducerAlgo>(psetForHistoProducerAlgo);
141 if (!
algo.process().empty())
144 if (!
algo.label().empty())
147 if (!
algo.instance().empty())
185 for (
unsigned int www = 0; www <
label_tst.size(); www++) {
189 if (!
algo.process().empty())
192 if (!
algo.label().empty())
195 if (!
algo.instance().empty())
215 ibook,
histograms.histoProducerAlgo, HGVHistoProducerAlgo::validationType::Linking);
219 ibook,
histograms.histoProducerAlgo, HGVHistoProducerAlgo::validationType::PatternRecognition);
225 std::vector<CaloParticle>
const& cPeff,
227 std::vector<size_t>& selected_cPeff,
229 std::unordered_map<DetId, const HGCRecHit*>
const& hitMap)
const {
230 selected_cPeff.reserve(cPeff.size());
233 for (
auto const& caloParticle : cPeff) {
234 int id = caloParticle.pdgId();
237 selected_cPeff.push_back(
j);
250 using namespace reco;
252 LogDebug(
"HGCalValidator") <<
"\n====================================================" 254 <<
"Analyzing new event" 256 <<
"====================================================\n" 261 std::vector<SimVertex>
const&
simVertices = *simVerticesHandle;
265 std::vector<CaloParticle>
const&
caloParticles = *caloParticleHandle;
277 const std::map<uint, std::vector<uint>> cpToSc_SimTrackstersMap = *simTrackstersMapHandle;
285 auto simRecColl = *simtorecoCollectionH;
288 auto recSimColl = *recotosimCollectionH;
291 event.getByToken(
hitMap_, hitMapHandle);
292 const std::unordered_map<DetId, const HGCRecHit*>* hitMap = &*hitMapHandle;
299 std::vector<size_t> cPIndices;
309 std::vector<size_t> selected_cPeff;
316 std::vector<SimCluster>
const& simClusters = *simClustersHandle;
323 auto nSimClusters = simClusters.size();
324 std::vector<size_t> sCIndices;
327 for (
unsigned int scId = 0; scId < nSimClusters; ++scId) {
328 if (simClusters[scId].g4Tracks()[0].eventId().
event() != 0
or 329 simClusters[scId].g4Tracks()[0].eventId().bunchCrossing() != 0) {
330 LogDebug(
"HGCalValidator") <<
"Excluding SimClusters from event: " 331 << simClusters[scId].g4Tracks()[0].eventId().event()
332 <<
" with BX: " << simClusters[scId].g4Tracks()[0].eventId().bunchCrossing()
336 sCIndices.emplace_back(scId);
351 auto simRecColl = *simtorecoCollectionH;
354 auto recSimColl = *recotosimCollectionH;
370 LogTrace(
"HGCalValidator") <<
"\n# of SimClusters: " << nSimClusters
395 for (
unsigned int layerclusterIndex = 0; layerclusterIndex <
clusters.size(); layerclusterIndex++) {
414 LogTrace(
"HGCalValidator") <<
"\n# of Tracksters from " <<
label_tst[wml].process() <<
":" 416 << tracksters.size() <<
"\n" 424 simTrackstersFromCPs,
425 cpToSc_SimTrackstersMap,
427 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_
~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.
static std::string to_string(const XMLCh *ch)
edm::InputTag label_simTS
const bool SaveGeneralInfo_
const bool doLayerClustersPlots_
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< 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
edm::EDGetTokenT< std::map< uint, std::vector< uint > > > simTrackstersMap_
edm::EDGetTokenT< ticl::TracksterCollection > simTracksters_fromCPs_
edm::InputTag associatorSim_
edm::InputTag label_layerClustersPlots_