19 template <TrackerType pixel_or_strip>
24 iConfig.getParameter<
edm::
ParameterSet>(
"genericTriggerEventPSet"), consumesCollector(), *this)),
25 avalidator_(iConfig, consumesCollector()) {
30 template <TrackerType pixel_or_strip>
36 template <TrackerType pixel_or_strip>
51 tkDetMapHandle.
product(), ibooker, topFolderName_,
"TkHMap_ResidualsMean", 0.0,
true);
54 template <TrackerType pixel_or_strip>
61 template <TrackerType pixel_or_strip>
66 auto id =
DetId(ModuleID);
67 switch (
id.subdetId()) {
75 layer = tTopo->
pxfDisk(
id) * (tTopo->
pxfSide(ModuleID) == 1 ? -1 : +1);
84 layer = tTopo->
tidWheel(
id) * (tTopo->
tidSide(ModuleID) == 1 ? -1 : +1);
92 layer = tTopo->
tecWheel(
id) * (tTopo->
tecSide(ModuleID) == 1 ? -1 : +1);
99 return std::make_pair(subdet, layer);
102 template <TrackerType pixel_or_strip>
114 double d_residual_xmin =
Parameters.getParameter<
double>(
"xmin");
115 double d_residual_xmax =
Parameters.getParameter<
double>(
"xmax");
117 int32_t i_normres_Nbins = Parameters.
getParameter<int32_t>(
"Nbinx");
118 double d_normres_xmin = Parameters.getParameter<
double>(
"xmin");
119 double d_normres_xmax = Parameters.getParameter<
double>(
"xmax");
131 auto ModuleID =
id.rawId();
132 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
138 switch (
id.subdetId()) {
140 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
143 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
150 std::string hid = hidmanager.createHistoId(
"HitResidualsX",
"det", ModuleID);
151 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsX",
"det", ModuleID);
153 histos.x.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
154 histos.x.base->setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
155 histos.x.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
156 histos.x.normed->setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
159 std::string hid = hidmanager.createHistoId(
"HitResidualsY",
"det", ModuleID);
160 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsY",
"det", ModuleID);
162 histos.y.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
163 histos.y.base->setAxisTitle(
"(y_{pred} - y_{rec})' [cm]");
164 histos.y.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
165 histos.y.normed->setAxisTitle(
"(y_{pred} - y_{rec})'/#sigma");
173 switch (
id.subdetId()) {
185 strip_organizer.
setLayerFolder(ModuleID, tTopo, subdetandlayer.second);
188 auto isBarrel = subdetandlayer.first.find(
"B") != std::string::npos;
190 auto xy = std::vector<std::pair<HistoPair &, const char *>>{std::make_pair(std::ref(
histos.x),
"X"),
191 std::make_pair(std::ref(
histos.y),
"Y")};
192 for (
auto &histopair :
xy) {
197 if (!
isPixel && histopair.second[0] ==
'Y')
201 Form(
"HitResiduals%s_%s%d",
203 isBarrel ?
"L" : (subdetandlayer.second > 0 ?
"Dp" :
"Dm"),
205 : (Form(
"HitResiduals_%s__%s__%d",
207 subdetandlayer.first.c_str(),
211 std::string histotitle = Form(
"HitResiduals %s on %s%s full %s %d",
213 subdetandlayer.first.c_str(),
214 isBarrel ?
"" : (subdetandlayer.second > 0 ?
"+" :
"-"),
218 std::string normhistoname = Form(
"Normalized%s", histoname.c_str());
219 std::string normhistotitle = Form(
"Normalized%s", histotitle.c_str());
224 histopair.first.base =
225 ibooker.
book1D(histoname.c_str(), histotitle.c_str(), i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
226 histopair.first.base->
setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
228 histopair.first.normed = ibooker.
book1D(
229 normhistoname.c_str(), normhistotitle.c_str(), i_normres_Nbins, d_normres_xmin, d_normres_xmax);
230 histopair.first.normed->
setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
236 template <TrackerType pixel_or_strip>
238 auto vtracks = std::vector<TrackerValidationVariables::AVTrackStruct>();
245 if (!vertices.
isValid() || vertices->empty())
258 return track.
pt() > 0.75 &&
263 for (
auto &track : vtracks) {
264 for (
auto &it : track.hits) {
265 uint RawId = it.rawDetId;
267 auto id =
DetId(RawId);
268 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
274 mod_histos.x.base->Fill(it.resXprime);
275 mod_histos.x.normed->Fill(it.resXprime / it.resXprimeErr);
276 mod_histos.y.base->Fill(it.resYprime);
277 mod_histos.y.normed->Fill(it.resYprime / it.resYprimeErr);
283 if (it.resXprimeErr != 0 &&
histos.x.base) {
284 histos.x.base->Fill(it.resXprime);
285 histos.x.normed->Fill(it.resXprime / it.resXprimeErr);
289 if (it.resYprimeErr != 0 &&
histos.y.base) {
290 histos.y.base->Fill(it.resYprime);
291 histos.y.normed->Fill(it.resYprime / it.resYprimeErr);
T getParameter(std::string const &) const
void setSiStripFolderName(std::string name)
unsigned int tibLayer(const DetId &id) const
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double dxyError() const
error on dxy
unsigned int pxfDisk(const DetId &id) const
bool isBarrel(GeomDetEnumerators::SubDetector m)
TrackerValidationVariables avalidator_
unsigned int tidWheel(const DetId &id) const
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
edm::EDGetTokenT< reco::VertexCollection > offlinePrimaryVerticesToken_
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
std::unique_ptr< TkHistoMap > tkhisto_ResidualsMean
#define DEFINE_FWK_MODULE(type)
unsigned int tidSide(const DetId &id) const
vector< ParameterSet > Parameters
void setCurrentFolder(std::string const &fullpath)
HistoSet m_ModuleResiduals
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
HistoSet m_SubdetLayerResiduals
double pt() const
track transverse momentum
MonitorElement * book1D(Args &&...args)
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Abs< T >::type abs(const T &t)
MonitorTrackResidualsBase(const edm::ParameterSet &)
unsigned int pxbLayer(const DetId &id) const
~MonitorTrackResidualsBase() override
void fillTrackQuantities(const edm::Event &, const edm::EventSetup &, std::vector< AVTrackStruct > &v_avtrackout)
GenericTriggerEventFlag * genTriggerEventFlag_
void createMEs(DQMStore::IBooker &, const edm::EventSetup &)
bool isPixel(HitType hitType)
unsigned long long m_cacheID_
unsigned int pxfSide(const DetId &id) const
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
void analyze(const edm::Event &, const edm::EventSetup &) override
std::pair< std::string, int32_t > findSubdetAndLayer(uint32_t ModuleID, const TrackerTopology *tTopo)
unsigned int tecWheel(const DetId &id) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const