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")),
59 pSimHitSrc_(config_.getParameter<std::
vector<edm::
InputTag>>(
"PSimHitSource")),
60 simTrackSrc_(config_.getParameter<edm::
InputTag>(
"SimTrackSource")),
61 simVertexSrc_(config_.getParameter<edm::
InputTag>(
"SimVertexSource")),
63 otDigiSimLinkToken_(consumes<edm::DetSetVector<
PixelDigiSimLink>>(otDigiSimLinkSrc_)),
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();
134 SimVertex vtx = (*simVertices)[vtxIndex];
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;
172 for (
auto& it : layerMEs) {
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)
206 const PSimHit& simHit = (*isim);
211 unsigned int rawid = (*isim).
detUnitId();
223 DigiMEs& local_mes = pos->second;
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++;
328 bool matched =
false;
332 int col = di->column();
345 bool matched =
false;
349 int col = di->column();
371 folder_name << top_folder <<
"/"
375 edm::LogInfo(
"Phase2TrackerValidateDigi") <<
" Booking Histograms in : " << folder_name.str();
379 HistoName <<
"NumberOfSimulatedTracks";
383 HistoName <<
"NumberOfSimulatedTracksP";
387 HistoName <<
"NumberOfSimulatedTracksS";
391 HistoName <<
"NumberOfSimulatedVertices";
396 HistoName <<
"SimulatedTrackPt";
413 HistoName <<
"SimulatedTrackPtP";
423 HistoName <<
"SimulatedTrackPtS";
435 HistoName <<
"SimulatedTrackEta";
445 HistoName <<
"SimulatedTrackEtaP";
455 HistoName <<
"SimulatedTrackEtaS";
467 HistoName <<
"SimulatedTrackPhi";
478 HistoName <<
"SimulatedTrackPhiP";
489 HistoName <<
"SimulatedTrackPhiS";
501 HistoName <<
"SimulatedXPosVsYPos";
516 HistoName <<
"SimulatedRPosVsZPos";
532 HistoName <<
"SimulatedTOFVsEta";
546 HistoName <<
"SimulatedTOFVsPhi";
560 HistoName <<
"SimulatedTOFVsR";
574 HistoName <<
"SimulatedTOFVsZ";
588 if (theTkDigiGeomWatcher.
check(iSetup)) {
590 unsigned int detId_raw = det_u->geographicalId().rawId();
596 folder_name << top_folder <<
"/"
602 HistoName <<
"MatchedSimXPosVsYPos";
617 HistoName <<
"MatchedSimRPosVsZPos";
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;
667 HistoName <<
"SimTrackPt";
677 HistoName <<
"MatchedTrackPt";
687 HistoName <<
"MissedHitTrackPt";
697 HistoName <<
"MissedDigiTrackPt";
709 HistoName <<
"SimTrackEta";
719 HistoName <<
"MatchedTrackEta";
729 HistoName <<
"MissedHitTrackEta";
739 HistoName <<
"MissedDigiTrackEta";
751 HistoName <<
"SimTrackPhi";
761 HistoName <<
"MatchedTrackPhi";
771 HistoName <<
"MissedHitTrackPhi";
781 HistoName <<
"MissedDigiTrackPhi";
794 HistoName <<
"MatchedSimHitElossS";
804 HistoName <<
"MissedDigiSimHitElossS";
816 HistoName <<
"MatchedSimHitElossP";
826 HistoName <<
"MissedDigiSimHitElossP";
838 HistoName <<
"SimHitDx";
850 HistoName <<
"SimHitDy";
862 HistoName <<
"SimHitDz";
873 HistoName <<
"BunchXingWindow";
877 HistoName <<
"FractionOfOOTPUDigi";
881 HistoName <<
"MissedDigiLocalXPosvsYPos";
883 ibooker.
book2D(HistoName.str(), HistoName.str(), 130, -6.5, 6.5, 130, -6.5, 6.5);
887 HistoName <<
"MissedDigiTimeWindow";
893 layerMEs.insert(std::make_pair(key, local_mes));
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);
936 DigiMEs& local_mes = pos->second;
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);
972 DigiMEs& local_mes = pos->second;
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
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
MonitorElement * MatchedRZPositionMap
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
const float GeVperElectron
MonitorElement * MissedDigiTrackPhi
iterator find(det_id_type id)
MonitorElement * MatchedSimHitElossS
edm::Handle< edm::SimTrackContainer > simTracks
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
unsigned int tidRing(const DetId &id) const
bool isPrimary(const SimTrack &simTrk, const PSimHit &simHit)
MonitorElement * MatchedTrackPt
uint16_t *__restrict__ id
MonitorElement * BunchXTimeBin
virtual void setCurrentFolder(std::string const &fullpath)
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > itPixelDigiSimLinkToken_
virtual int ncolumns() const =0
#define DEFINE_FWK_MODULE(type)
bool findOTDigi(unsigned int detid, unsigned int id)
MonitorElement * MissedHitTrackPhi
Geom::Phi< T > phi() const
MonitorElement * nSimulatedTracksS
MonitorElement * SimulatedTOFPhiMap
unsigned int tidWheel(const DetId &id) const
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 Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * MissedDigiTimeWindow
MonitorElement * MissedDigiTrackPt
MonitorElement * SimulatedTOFRMap
constexpr std::array< uint8_t, layerIndexSize > layer
static int pixelToChannel(int row, int col)
const edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken_
MonitorElement * SimulatedTrackPhiP
MonitorElement * SimulatedTOFZMap
bool getData(T &iHolder) const
unsigned int getSimTrackId(const edm::DetSetVector< PixelDigiSimLink > *simLinks, const DetId &detId, unsigned int &channel)
std::map< std::string, DigiMEs > layerMEs
MonitorElement * SimulatedTrackPhi
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
MonitorElement * SimHitDz
MonitorElement * SimulatedTrackEta
MonitorElement * MissedHitTrackEta
bool findITPixelDigi(unsigned int detid, unsigned int id)
std::string getOTHistoId(uint32_t det_id, const TrackerTopology *tTopo)
MonitorElement * SimTrackPhi
vector< ParameterSet > Parameters
edm::Handle< edm::PSimHitContainer > simHits
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
tuple key
prepare the HTCondor submission files and eventually submit them
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)
bool get(ProductID const &oid, Handle< PROD > &result) const
MonitorElement * SimulatedTrackEtaS
MonitorElement * MissedDigiSimHitElossP
const edm::DetSetVector< PixelDigi > * itdigis_
MonitorElement * MissedDigiSimHitElossS
int getITPixelLayerNumber(const DetId &id) const
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
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
MonitorElement * MatchedXYPositionMap
Log< level::Info, false > LogInfo
MonitorElement * MissedHitTrackPt
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
unsigned int trackId() const
T const * product() const
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
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
T getParameter(std::string const &) const
MonitorElement * nSimVertices
MonitorElement * SimulatedTrackPt
unsigned short processType() const
bool check(const edm::EventSetup &iSetup)
MonitorElement * SimulatedXYPositionMap
MonitorElement * MissedDigiLocalXposVsYPos
Phase2TrackerValidateDigi(const edm::ParameterSet &)
const edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
MonitorElement * SimTrackEta
~Phase2TrackerValidateDigi() override
const math::XYZTLorentzVectorD & momentum() const
MonitorElement * SimulatedTrackPtP
MonitorElement * SimTrackPt
const TrackerGeometry * tkGeom_
std::string getHistoId(uint32_t det_id, bool flag)
unsigned int trackId() const
std::vector< PSimHit > PSimHitContainer
iterator begin()
Return an iterator to the first DetSet.
const edm::DetSetVector< Phase2TrackerDigi > * otdigis_
MonitorElement * MatchedTrackEta
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
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_
int getOTLayerNumber(const DetId &id) const
unsigned int detUnitId() const