|
|
Go to the documentation of this file.
66 const std::map<unsigned int, SimTrack>& selectedSimTrackMap);
102 trackerHitAssociatorConfig_(iConfig, consumesCollector()),
103 simtrackminpt_(iConfig.getParameter<double>(
"SimTrackMinPt")),
108 edm::LogInfo(
"Phase2ITValidateRecHit") <<
">>> Construct Phase2ITValidateRecHit ";
115 edm::LogInfo(
"Phase2ITValidateRecHit") <<
">>> Destroy Phase2ITValidateRecHit ";
119 std::vector<edm::Handle<edm::PSimHitContainer>>
simHits;
122 iEvent.getByToken(itoken, simHitHandle);
125 simHits.emplace_back(simHitHandle);
131 std::map<unsigned int, SimTrack> selectedSimTrackMap;
132 for (
const auto& simTrackIt : *
simTracks) {
134 selectedSimTrackMap.emplace(simTrackIt.trackId(), simTrackIt);
144 const std::map<unsigned int, SimTrack>& selectedSimTrackMap) {
150 std::map<std::string, unsigned int> nrechitLayerMap_primary;
152 for (
const auto& DSViter : *
rechits) {
154 unsigned int rawid(DSViter.detId());
162 if (nrechitLayerMap_primary.find(
key) == nrechitLayerMap_primary.end()) {
163 nrechitLayerMap_primary.emplace(
key, DSViter.size());
165 nrechitLayerMap_primary[
key] += DSViter.size();
168 for (
const auto& rechit : DSViter) {
170 const std::vector<SimHitIdpr>& matchedId = associateRecHit.
associateHitId(rechit);
171 const PSimHit* simhitClosest =
nullptr;
174 for (
const auto& simHitCol :
simHits) {
175 for (
const auto& simhitIt : *simHitCol) {
176 if (detId.rawId() != simhitIt.detUnitId())
178 for (
const auto& mId : matchedId) {
179 if (simhitIt.trackId() == mId.first) {
180 if (!simhitClosest ||
abs(simhitIt.localPosition().x() - lp.
x()) < minx) {
181 minx =
abs(simhitIt.localPosition().x() - lp.
x());
182 simhitClosest = &simhitIt;
190 auto simTrackIt(selectedSimTrackMap.find(simhitClosest->
trackId()));
193 if (simTrackIt != selectedSimTrackMap.end())
196 const LocalError& lperr = rechit.localPositionError();
197 double dx = lp.
x() - simlp.x();
198 double dy = lp.
y() - simlp.y();
202 pullx = (lp.
x() - simlp.x()) /
std::sqrt(lperr.xx());
204 pully = (lp.
y() - simlp.y()) /
std::sqrt(lperr.yy());
205 float eta = geomDetunit->surface().toGlobal(lp).eta();
220 nrechitLayerMap_primary[
key]--;
225 for (
const auto& lme : nrechitLayerMap_primary) {
226 layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]);
243 edm::LogInfo(
"Phase2ITValidateRecHit") <<
" Booking Histograms in : " << top_folder;
245 if (theTkDigiGeomWatcher.
check(iSetup)) {
251 unsigned int detId_raw = det_u->geographicalId().rawId();
266 edm::LogInfo(
"Phase2ITValidateRecHit") <<
" Booking Histograms in : " << (subdir +
"/" +
key);
313 psd0.
add<
std::string>(
"title",
"Delta_X;RecHit resolution X dimension");
314 psd0.
add<
double>(
"xmin", -0.2);
315 psd0.
add<
bool>(
"switch",
true);
316 psd0.
add<
double>(
"xmax", 0.2);
317 psd0.
add<
int>(
"NxBins", 100);
323 psd0.
add<
std::string>(
"title",
"Delta_Y;RecHit resolution Y dimension;");
324 psd0.
add<
double>(
"xmin", -0.2);
325 psd0.
add<
bool>(
"switch",
true);
326 psd0.
add<
double>(
"xmax", 0.2);
327 psd0.
add<
int>(
"NxBins", 100);
334 psd0.
add<
double>(
"xmin", -4.0);
335 psd0.
add<
bool>(
"switch",
true);
336 psd0.
add<
double>(
"xmax", 4.0);
337 psd0.
add<
int>(
"NxBins", 100);
344 psd0.
add<
double>(
"xmin", -4.0);
345 psd0.
add<
bool>(
"switch",
true);
346 psd0.
add<
double>(
"xmax", 4.0);
347 psd0.
add<
int>(
"NxBins", 100);
354 psd0.
add<
double>(
"ymax", 0.02);
355 psd0.
add<
int>(
"NxBins", 82);
356 psd0.
add<
bool>(
"switch",
true);
357 psd0.
add<
double>(
"xmax", 4.1);
358 psd0.
add<
double>(
"xmin", -4.1);
359 psd0.
add<
double>(
"ymin", -0.02);
366 psd0.
add<
double>(
"ymax", 0.02);
367 psd0.
add<
int>(
"NxBins", 82);
368 psd0.
add<
bool>(
"switch",
true);
369 psd0.
add<
double>(
"xmax", 4.1);
370 psd0.
add<
double>(
"xmin", -4.1);
371 psd0.
add<
double>(
"ymin", -0.02);
378 psd0.
add<
double>(
"ymax", 4.0);
379 psd0.
add<
int>(
"NxBins", 82);
380 psd0.
add<
bool>(
"switch",
true);
381 psd0.
add<
double>(
"xmax", 4.1);
382 psd0.
add<
double>(
"xmin", -4.1);
383 psd0.
add<
double>(
"ymin", -4.0);
390 psd0.
add<
double>(
"ymax", 4.0);
391 psd0.
add<
int>(
"NxBins", 82);
392 psd0.
add<
bool>(
"switch",
true);
393 psd0.
add<
double>(
"xmax", 4.1);
394 psd0.
add<
double>(
"xmin", -4.1);
395 psd0.
add<
double>(
"ymin", -4.0);
401 psd0.
add<
std::string>(
"name",
"Number_RecHits_matched_PrimarySimTrack");
402 psd0.
add<
std::string>(
"title",
"Number of RecHits matched to primary SimTrack;;");
403 psd0.
add<
double>(
"xmin", 0.0);
404 psd0.
add<
bool>(
"switch",
true);
405 psd0.
add<
double>(
"xmax", 0.0);
406 psd0.
add<
int>(
"NxBins", 100);
412 psd0.
add<
std::string>(
"title",
"Delta_X_SimHitPrimary;#delta x;");
413 psd0.
add<
double>(
"xmin", -0.2);
414 psd0.
add<
bool>(
"switch",
true);
415 psd0.
add<
double>(
"xmax", 0.2);
416 psd0.
add<
int>(
"NxBins", 100);
422 psd0.
add<
std::string>(
"title",
"Delta_Y_SimHitPrimary;#Delta y;");
423 psd0.
add<
double>(
"xmin", -0.2);
424 psd0.
add<
bool>(
"switch",
true);
425 psd0.
add<
double>(
"xmax", 0.2);
426 psd0.
add<
int>(
"NxBins", 100);
433 psd0.
add<
double>(
"ymax", 4.0);
434 psd0.
add<
int>(
"NxBins", 82);
435 psd0.
add<
bool>(
"switch",
true);
436 psd0.
add<
double>(
"xmax", 4.1);
437 psd0.
add<
double>(
"xmin", -4.1);
438 psd0.
add<
double>(
"ymin", -4.0);
445 psd0.
add<
double>(
"ymax", 4.0);
446 psd0.
add<
int>(
"NxBins", 82);
447 psd0.
add<
bool>(
"switch",
true);
448 psd0.
add<
double>(
"xmax", 4.1);
449 psd0.
add<
double>(
"xmin", -4.1);
450 psd0.
add<
double>(
"ymin", -4.0);
454 desc.add<
bool>(
"associatePixel",
true);
455 desc.add<
bool>(
"associateStrip",
false);
456 desc.add<
bool>(
"usePhase2Tracker",
true);
457 desc.add<
bool>(
"associateRecoTracks",
false);
458 desc.add<
bool>(
"associateHitbySimTrack",
true);
460 desc.add<std::vector<std::string>>(
"ROUList",
462 "TrackerHitsPixelBarrelLowTof",
463 "TrackerHitsPixelBarrelHighTof",
464 "TrackerHitsPixelEndcapLowTof",
465 "TrackerHitsPixelEndcapHighTof",
470 desc.add<
double>(
"SimTrackMinPt", 2.0);
473 desc.add<
bool>(
"Verbosity",
false);
474 descriptions.
add(
"Phase2ITValidateRecHit",
desc);
bool check(const edm::EventSetup &iSetup)
T const * product() const
MonitorElement * book1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MonitorElement * deltaX_eta
const edm::EDGetTokenT< SiPixelRecHitCollection > tokenRecHitsIT_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * pullY_primary
void fillITHistos(const edm::Event &iEvent, const TrackerHitAssociator &associateRecHit, const std::vector< edm::Handle< edm::PSimHitContainer >> &simHits, const std::map< unsigned int, SimTrack > &selectedSimTrackMap)
edm::ParameterSet config_
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
Log< level::Info, false > LogInfo
const TrackerTopology * tTopo_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::map< std::string, RecHitME > layerMEs_
MonitorElement * deltaY_primary
MonitorElement * pullX_primary
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
MonitorElement * pullY_eta
Local3DPoint localPosition() const
const TrackerGeometry * tkGeom_
MonitorElement * numberRecHitsprimary
Phase2ITValidateRecHit(const edm::ParameterSet &)
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
MonitorElement * deltaY_eta
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
bool isPrimary(const SimTrack &simTrk, const PSimHit *simHit)
MonitorElement * deltaX_primary
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const double simtrackminpt_
~Phase2ITValidateRecHit() override
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, std::string &subdir)
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
TrackerHitAssociator::Config trackerHitAssociatorConfig_
MonitorElement * bookProfile1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
std::vector< SimTrack > SimTrackContainer
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
T getParameter(std::string const &) const
unsigned int trackId() const
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
MonitorElement * pullX_eta
std::vector< SimHitIdpr > associateHitId(const TrackingRecHit &thit) const
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_