13 label_lcl(pset.getParameter<edm::
InputTag>(
"label_lcl")),
14 label_tst(pset.getParameter<std::
vector<edm::
InputTag>>(
"label_tst")),
15 label_simTSFromCP(pset.getParameter<edm::
InputTag>(
"label_simTSFromCP")),
16 associator_(pset.getUntrackedParameter<edm::
InputTag>(
"associator")),
17 associatorSim_(pset.getUntrackedParameter<edm::
InputTag>(
"associatorSim")),
18 SaveGeneralInfo_(pset.getUntrackedParameter<bool>(
"SaveGeneralInfo")),
19 doCaloParticlePlots_(pset.getUntrackedParameter<bool>(
"doCaloParticlePlots")),
20 doCaloParticleSelection_(pset.getUntrackedParameter<bool>(
"doCaloParticleSelection")),
21 doSimClustersPlots_(pset.getUntrackedParameter<bool>(
"doSimClustersPlots")),
22 label_SimClustersPlots_(pset.getParameter<edm::
InputTag>(
"label_SimClusters")),
23 label_SimClustersLevel_(pset.getParameter<edm::
InputTag>(
"label_SimClustersLevel")),
24 doLayerClustersPlots_(pset.getUntrackedParameter<bool>(
"doLayerClustersPlots")),
25 label_layerClustersPlots_(pset.getParameter<edm::
InputTag>(
"label_layerClusterPlots")),
26 label_LCToCPLinking_(pset.getParameter<edm::
InputTag>(
"label_LCToCPLinking")),
27 doTrackstersPlots_(pset.getUntrackedParameter<bool>(
"doTrackstersPlots")),
28 label_TSToCPLinking_(pset.getParameter<edm::
InputTag>(
"label_TSToCPLinking")),
29 label_clustersmask(pset.getParameter<std::
vector<edm::
InputTag>>(
"LayerClustersInputMask")),
30 cummatbudinxo_(pset.getParameter<edm::
FileInPath>(
"cummatbudinxo")) {
35 label_cp_effic = consumes<std::vector<CaloParticle>>(label_cp_effic_tag);
36 label_cp_fake = consumes<std::vector<CaloParticle>>(label_cp_fake_tag);
47 hitMap_ = consumes<std::unordered_map<DetId, const HGCRecHit*>>(
edm::InputTag(
"hgcalRecHitMapProducer"));
91 cummatbudg.insert(std::pair<double, double>(thelay, mbg));
138 dirName += algo.
process() +
"_";
139 LogDebug(
"HGCalValidator") << dirName <<
"\n";
140 if (!algo.
label().empty())
141 dirName += algo.
label() +
"_";
142 LogDebug(
"HGCalValidator") << dirName <<
"\n";
145 LogDebug(
"HGCalValidator") << dirName <<
"\n";
147 if (!dirName.empty()) {
148 dirName.resize(dirName.size() - 1);
151 LogDebug(
"HGCalValidator") << dirName <<
"\n";
181 for (
unsigned int www = 0; www <
label_tst.size(); www++) {
186 dirName += algo.
process() +
"_";
187 LogDebug(
"HGCalValidator") << dirName <<
"\n";
188 if (!algo.
label().empty())
189 dirName += algo.
label() +
"_";
190 LogDebug(
"HGCalValidator") << dirName <<
"\n";
193 LogDebug(
"HGCalValidator") << dirName <<
"\n";
195 if (!dirName.empty()) {
196 dirName.resize(dirName.size() - 1);
199 LogDebug(
"HGCalValidator") << dirName <<
"\n";
213 std::vector<CaloParticle>
const& cPeff,
214 std::vector<SimVertex>
const& simVertices,
215 std::vector<size_t>& selected_cPeff,
217 std::unordered_map<DetId, const HGCRecHit*>
const& hitMap)
const {
218 selected_cPeff.reserve(cPeff.size());
221 for (
auto const& caloParticle : cPeff) {
222 int id = caloParticle.pdgId();
225 selected_cPeff.push_back(j);
238 using namespace reco;
240 LogDebug(
"HGCalValidator") <<
"\n===================================================="
242 <<
"Analyzing new event"
244 <<
"====================================================\n"
249 std::vector<SimVertex>
const& simVertices = *simVerticesHandle;
253 std::vector<CaloParticle>
const&
caloParticles = *caloParticleHandle;
265 auto simRecColl = *simtorecoCollectionH;
268 auto recSimColl = *recotosimCollectionH;
271 event.getByToken(
hitMap_, hitMapHandle);
272 const std::unordered_map<DetId, const HGCRecHit*>* hitMap = &*hitMapHandle;
279 std::vector<size_t> cPIndices;
289 std::vector<size_t> selected_cPeff;
296 std::vector<SimCluster>
const& simClusters = *simClustersHandle;
305 event.getByToken(
density_, densityHandle);
306 const Density& densities = *densityHandle;
308 auto nSimClusters = simClusters.size();
309 std::vector<size_t> sCIndices;
312 for (
unsigned int scId = 0; scId < nSimClusters; ++scId) {
313 if (simClusters[scId].g4Tracks()[0].eventId().
event() != 0
or
314 simClusters[scId].g4Tracks()[0].eventId().bunchCrossing() != 0) {
315 LogDebug(
"HGCalValidator") <<
"Excluding SimClusters from event: "
316 << simClusters[scId].g4Tracks()[0].eventId().event()
317 <<
" with BX: " << simClusters[scId].g4Tracks()[0].eventId().bunchCrossing()
321 sCIndices.emplace_back(scId);
336 auto simRecColl = *simtorecoCollectionH;
339 auto recSimColl = *recotosimCollectionH;
355 LogTrace(
"HGCalValidator") <<
"\n# of SimClusters: " << nSimClusters
381 for (
unsigned int layerclusterIndex = 0; layerclusterIndex <
clusters.size(); layerclusterIndex++) {
403 simTrackstersFromCPs,
411 LogTrace(
"HGCalValidator") <<
"\n# of Tracksters with " <<
label_tst[wml].process() <<
":"
413 << tracksters.size() <<
"\n"
std::map< double, double > cummatbudg
edm::EDGetTokenT< std::unordered_map< DetId, const HGCRecHit * > > hitMap_
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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
edm::InputTag label_TSToCPLinking_
const bool doCaloParticlePlots_
edm::EDGetTokenT< ticl::TracksterCollection > simTrackstersFromCPs_
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.
const bool SaveGeneralInfo_
const bool doLayerClustersPlots_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< Density > density_
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
HGVHistoProducerAlgoHistograms histoProducerAlgo
edm::EDGetTokenT< std::vector< SimVertex > > simVertices_
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
edm::EDGetTokenT< std::vector< CaloParticle > > label_cp_fake
edm::EDGetTokenT< std::vector< CaloParticle > > label_cp_effic
const bool doCaloParticleSelection_
std::vector< edm::EDGetTokenT< ticl::TracksterCollection > > label_tstTokens
std::shared_ptr< hgcal::RecHitTools > tools_
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_
std::vector< edm::InputTag > label_clustersmask
std::vector< edm::EDGetTokenT< std::vector< float > > > clustersMaskTokens_
edm::EDGetTokenT< std::vector< SimCluster > > simClusters_
T getParameter(std::string const &) const
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
std::string fullPath() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
hgcal_clustering::Density Density
edm::InputTag associatorSim_
edm::InputTag label_layerClustersPlots_