53 pixelFlag_(config_.getParameter<
bool>(
"PixelPlotFillingFlag")),
54 geomType_(config_.getParameter<
std::
string>(
"GeometryType")),
55 otDigiSrc_(config_.getParameter<
edm::
InputTag>(
"OuterTrackerDigiSource")),
56 otDigiSimLinkSrc_(config_.getParameter<
edm::
InputTag>(
"OuterTrackerDigiSimLinkSource")),
57 itPixelDigiSrc_(config_.getParameter<
edm::
InputTag>(
"InnerPixelDigiSource")),
58 itPixelDigiSimLinkSrc_(config_.getParameter<
edm::
InputTag>(
"InnerPixelDigiSimLinkSource")),
60 simTrackSrc_(config_.getParameter<
edm::
InputTag>(
"SimTrackSource")),
61 simVertexSrc_(config_.getParameter<
edm::
InputTag>(
"SimVertexSource")),
64 itPixelDigiToken_(consumes<
edm::DetSetVector<
PixelDigi>>(itPixelDigiSrc_)),
65 itPixelDigiSimLinkToken_(consumes<
edm::DetSetVector<
PixelDigiSimLink>>(itPixelDigiSimLinkSrc_)),
70 GeVperElectron(3.61E-09),
73 simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag));
80 edm::LogInfo(
"Phase2TrackerValidateDigi") <<
">>> Construct Phase2TrackerValidateDigi ";
89 edm::LogInfo(
"Phase2TrackerValidateDigi") <<
">>> Destroy Phase2TrackerValidateDigi ";
96 if (theTkDigiGeomWatcher.
check(iSetup)) {
127 for (edm::SimTrackContainer::const_iterator simTrkItr =
simTracks->begin(); simTrkItr !=
simTracks->end();
129 if (simTrkItr->charge() == 0)
131 int vtxIndex = simTrkItr->vertIndex();
135 if (!
vtx.noParent()) {
136 int trkId =
vtx.parentIndex();
141 if (vtxIndex == 0 || vtxParent == 0)
151 float simTk_pt = simTrkItr->momentum().pt();
152 float simTk_eta = simTrkItr->momentum().eta();
153 float simTk_phi = simTrkItr->momentum().phi();
164 it.second.nDigis = 0;
173 DigiMEs& local_mes = it.second;
174 if (it.second.nHits < nHitCutoff) {
175 if (std::fabs(simTk_eta) < 1.0)
177 if (simTk_pt >
ptCut_ && std::fabs(simTk_eta) < 1.0)
179 if (std::fabs(simTk_eta) < 1.0 && simTk_pt >
ptCut_)
195 unsigned int id = simTrk.
trackId();
199 const auto& simHitHandle =
iEvent.getHandle(itoken);
200 if (!simHitHandle.isValid())
203 for (edm::PSimHitContainer::const_iterator isim =
simHits.begin(); isim !=
simHits.end(); ++isim) {
204 if ((*isim).trackId() !=
id)
211 unsigned int rawid = (*isim).detUnitId();
225 const DetId detId(rawid);
226 float dZ = (*isim).entryPoint().z() - (*isim).exitPoint().z();
227 if (fabs(
dZ) <= 0.01)
257 local_mes.
SimHitDx->
Fill(std::fabs((*isim).entryPoint().x() - (*isim).exitPoint().x()));
259 local_mes.
SimHitDy->
Fill(std::fabs((*isim).entryPoint().y() - (*isim).exitPoint().y()));
261 local_mes.
SimHitDz->
Fill(std::fabs((*isim).entryPoint().z() - (*isim).exitPoint().z()));
304 pos->second.nDigis++;
332 int col = di->column();
349 int col = di->column();
391 HistoName <<
"NumberOfSimulatedVertices";
588 if (theTkDigiGeomWatcher.
check(iSetup)) {
590 unsigned int detId_raw = det_u->geographicalId().rawId();
644 std::map<std::string, DigiMEs>::iterator
pos =
layerMEs.find(
key);
650 bool isPStypeModForTEDD_1 =
652 bool isPStypeModForTEDD_2 =
656 (
flag || (layer < 4 || (layer > 6 && (isPStypeModForTEDD_1 || isPStypeModForTEDD_2)))) ?
true :
false;
660 edm::LogInfo(
"Phase2TrackerValidateDigi") <<
" Booking Histograms in : " <<
key;
881 HistoName <<
"MissedDigiLocalXPosvsYPos";
901 unsigned int& channel) {
904 unsigned int simTrkId(0);
905 if (isearch == simLinks->
end())
913 if (channel == it->channel()) {
914 simTrkId = it->SimTrackId();
924 unsigned int rawid = DSViter->id;
933 std::map<std::string, DigiMEs>::iterator
pos =
layerMEs.find(
key);
938 std::map<int, float> bxMap;
941 int bx = di->eventId().bunchCrossing();
942 std::map<int, float>::iterator ic = bxMap.find(
bx);
943 if (ic == bxMap.end())
948 for (
const auto&
v : bxMap) {
960 unsigned int rawid = DSViter->id;
969 std::map<std::string, DigiMEs>::iterator
pos =
layerMEs.find(
key);
974 std::map<int, float> bxMap;
977 int bx = di->eventId().bunchCrossing();
978 std::map<int, float>::iterator ic = bxMap.find(
bx);
979 if (ic == bxMap.end())
984 for (
const auto&
v : bxMap) {
997 for (
unsigned int it = 0; it < sim_tracks.size(); it++) {
998 if (sim_tracks[it].trackId() == simTrkId) {
1008 bool retval =
false;
1009 unsigned int trkId = simTrk.
trackId();
1010 if (trkId !=
simHit.trackId())
1014 if ((vtxIndex == 0) && (
ptype == 0))
1025 if (th2 && primary == 1)
1027 if (th3 && primary != 1)
MonitorElement * SimulatedTrackEtaP
MonitorElement * MatchedRZPositionMap
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
T getParameter(std::string const &) const
const float GeVperElectron
MonitorElement * MissedDigiTrackPhi
iterator find(det_id_type id)
MonitorElement * MatchedSimHitElossS
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
edm::Handle< edm::SimTrackContainer > simTracks
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
bool isPrimary(const SimTrack &simTrk, const PSimHit &simHit)
MonitorElement * MatchedTrackPt
MonitorElement * BunchXTimeBin
virtual void setCurrentFolder(std::string const &fullpath)
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > itPixelDigiSimLinkToken_
virtual int ncolumns() const =0
bool findOTDigi(unsigned int detid, unsigned int id)
Geom::Phi< T > phi() const
MonitorElement * MissedHitTrackPhi
unsigned int tidWheel(const DetId &id) const
T const * product() const
MonitorElement * nSimulatedTracksS
MonitorElement * SimulatedTOFPhiMap
const edm::DetSetVector< PixelDigiSimLink > * itSimLink_
int matchedSimTrack(edm::Handle< edm::SimTrackContainer > &SimTk, unsigned int simTrkId)
MonitorElement * MatchedTrackPhi
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
MonitorElement * SimHitDx
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
void dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
std::vector< edm::InputTag > pSimHitSrc_
const math::XYZTLorentzVectorD & momentum() const
MonitorElement * MissedDigiTimeWindow
MonitorElement * MissedDigiTrackPt
MonitorElement * SimulatedTOFRMap
static int pixelToChannel(int row, int col)
const edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken_
MonitorElement * SimulatedTrackPhiP
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
MonitorElement * SimulatedTOFZMap
unsigned int getSimTrackId(const edm::DetSetVector< PixelDigiSimLink > *simLinks, const DetId &detId, unsigned int &channel)
std::map< std::string, DigiMEs > layerMEs
MonitorElement * SimulatedTrackPhi
int getITPixelLayerNumber(const DetId &id) const
MonitorElement * SimHitDz
MonitorElement * SimulatedTrackEta
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
MonitorElement * MissedHitTrackEta
bool findITPixelDigi(unsigned int detid, unsigned int id)
std::string getOTHistoId(uint32_t det_id, const TrackerTopology *tTopo)
MonitorElement * SimTrackPhi
edm::Handle< edm::PSimHitContainer > simHits
int getOTLayerNumber(const DetId &id) const
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
MonitorElement * SimulatedTOFEtaMap
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
MonitorElement * SimulatedRZPositionMap
MonitorElement * nSimulatedTracksP
void fillHistogram(MonitorElement *th1, MonitorElement *th2, MonitorElement *th3, float val, int primary)
MonitorElement * SimulatedTrackPhiS
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, bool flag)
MonitorElement * SimulatedTrackEtaS
#define DEFINE_FWK_MODULE(type)
MonitorElement * MissedDigiSimHitElossP
const edm::DetSetVector< PixelDigi > * itdigis_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * MissedDigiSimHitElossS
const TrackerGeomDet * idToDet(DetId) const override
iterator end()
Return the off-the-end iterator.
edm::Handle< edm::SimVertexContainer > simVertices
MonitorElement * FractionOfOOTDigis
MonitorElement * SimHitDy
MonitorElement * nSimulatedTracks
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
MonitorElement * MatchedXYPositionMap
Log< level::Info, false > LogInfo
MonitorElement * MissedHitTrackPt
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
const Plane & surface() const
The nominal surface of the GeomDet.
int fillSimHitInfo(const edm::Event &iEvent, const SimTrack simTrk)
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > otDigiSimLinkToken_
MonitorElement * MatchedSimHitElossP
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
const edm::DetSetVector< PixelDigiSimLink > * otSimLink_
std::vector< SimVertex > SimVertexContainer
MonitorElement * nSimVertices
MonitorElement * SimulatedTrackPt
bool check(const edm::EventSetup &iSetup)
MonitorElement * SimulatedXYPositionMap
std::vector< AlignmentParameters * > Parameters
MonitorElement * MissedDigiLocalXposVsYPos
Phase2TrackerValidateDigi(const edm::ParameterSet &)
const edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
MonitorElement * SimTrackEta
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
~Phase2TrackerValidateDigi() override
MonitorElement * SimulatedTrackPtP
MonitorElement * SimTrackPt
unsigned int trackId() const
const TrackerGeometry * tkGeom_
std::string getHistoId(uint32_t det_id, bool flag)
unsigned int tidRing(const DetId &id) const
std::vector< PSimHit > PSimHitContainer
iterator begin()
Return an iterator to the first DetSet.
const edm::DetSetVector< Phase2TrackerDigi > * otdigis_
MonitorElement * MatchedTrackEta
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
MonitorElement * MissedDigiTrackEta
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
MonitorElement * SimulatedTrackPtS
edm::ParameterSet config_
std::vector< SimTrack > SimTrackContainer
const TrackerTopology * tTopo_