63 const std::map<unsigned int, SimTrack>& selectedSimTrackMap);
75 trackerHitAssociatorConfig_(iConfig, consumesCollector()),
76 simtrackminpt_(iConfig.getParameter<double>(
"SimTrackMinPt")),
79 edm::LogInfo(
"Phase2ITValidateRecHit") <<
">>> Construct Phase2ITValidateRecHit ";
86 edm::LogInfo(
"Phase2ITValidateTrackingRecHit") <<
">>> Destroy Phase2ITValidateTrackingRecHit ";
90 std::vector<edm::Handle<edm::PSimHitContainer>>
simHits;
92 const auto& simHitHandle =
iEvent.getHandle(itoken);
93 if (!simHitHandle.isValid())
95 simHits.emplace_back(simHitHandle);
100 std::map<unsigned int, SimTrack> selectedSimTrackMap;
101 for (
const auto& simTrackIt : *
simTracks) {
103 selectedSimTrackMap.emplace(simTrackIt.trackId(), simTrackIt);
113 const std::map<unsigned int, SimTrack>& selectedSimTrackMap) {
118 std::map<std::string, unsigned int> nrechitLayerMap_primary;
123 for (
auto const&
hit :
track.recHits()) {
127 auto id =
hit->geographicalId();
129 auto subdetid = (
id.subdetId());
138 if (nrechitLayerMap_primary.find(
key) == nrechitLayerMap_primary.end()) {
139 nrechitLayerMap_primary.emplace(
key, 1);
141 nrechitLayerMap_primary[
key] += 1;
148 const std::vector<SimHitIdpr>& matchedId = associateRecHit.
associateHitId(*rechit);
149 const PSimHit* simhitClosest =
nullptr;
152 for (
const auto& simHitCol :
simHits) {
153 for (
const auto& simhitIt : *simHitCol) {
154 if (
id.rawId() != simhitIt.detUnitId())
156 for (
const auto& mId : matchedId) {
157 if (simhitIt.trackId() == mId.first) {
158 if (!simhitClosest ||
std::abs(simhitIt.localPosition().x() - lp.
x()) < minx) {
159 minx =
std::abs(simhitIt.localPosition().x() - lp.
x());
160 simhitClosest = &simhitIt;
171 fillRechitHistos(simhitClosest, rechit, selectedSimTrackMap, nrechitLayerMap_primary);
177 for (
const auto& lme : nrechitLayerMap_primary) {
178 layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]);
190 desc.add<
bool>(
"associatePixel",
true);
191 desc.add<
bool>(
"associateStrip",
false);
192 desc.add<
bool>(
"usePhase2Tracker",
true);
193 desc.add<
bool>(
"associateRecoTracks",
false);
194 desc.add<
bool>(
"associateHitbySimTrack",
true);
196 desc.add<std::vector<std::string>>(
"ROUList",
198 "TrackerHitsPixelBarrelLowTof",
199 "TrackerHitsPixelBarrelHighTof",
200 "TrackerHitsPixelEndcapLowTof",
201 "TrackerHitsPixelEndcapHighTof",
206 desc.add<
double>(
"SimTrackMinPt", 2.0);
208 desc.add<
std::string>(
"TopFolderName",
"TrackerPhase2ITTrackingRecHitV");
209 desc.add<
bool>(
"Verbosity",
false);
210 descriptions.
add(
"Phase2ITValidateTrackingRecHit",
desc);