18 template <TrackerType pixel_or_strip>
23 iConfig.getParameter<
edm::
ParameterSet>(
"genericTriggerEventPSet"), consumesCollector(), *this)),
24 avalidator_(iConfig, consumesCollector()) {
29 template <TrackerType pixel_or_strip>
35 template <TrackerType pixel_or_strip>
50 tkDetMapHandle.
product(), ibooker, topFolderName_,
"TkHMap_ResidualsMean", 0.0,
true);
53 template <TrackerType pixel_or_strip>
60 template <TrackerType pixel_or_strip>
65 auto id =
DetId(ModuleID);
66 switch (
id.subdetId()) {
74 layer = tTopo->
pxfDisk(
id) * (tTopo->
pxfSide(ModuleID) == 1 ? -1 : +1);
83 layer = tTopo->
tidWheel(
id) * (tTopo->
tidSide(ModuleID) == 1 ? -1 : +1);
91 layer = tTopo->
tecWheel(
id) * (tTopo->
tecSide(ModuleID) == 1 ? -1 : +1);
98 return std::make_pair(subdet, layer);
101 template <TrackerType pixel_or_strip>
113 double d_residual_xmin =
Parameters.getParameter<
double>(
"xmin");
114 double d_residual_xmax =
Parameters.getParameter<
double>(
"xmax");
116 int32_t i_normres_Nbins = Parameters.
getParameter<int32_t>(
"Nbinx");
117 double d_normres_xmin = Parameters.getParameter<
double>(
"xmin");
118 double d_normres_xmax = Parameters.getParameter<
double>(
"xmax");
130 auto ModuleID =
id.rawId();
131 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
137 switch (
id.subdetId()) {
139 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
142 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
149 std::string hid = hidmanager.createHistoId(
"HitResidualsX",
"det", ModuleID);
150 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsX",
"det", ModuleID);
152 histos.x.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
153 histos.x.base->setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
154 histos.x.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
155 histos.x.normed->setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
158 std::string hid = hidmanager.createHistoId(
"HitResidualsY",
"det", ModuleID);
159 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsY",
"det", ModuleID);
161 histos.y.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
162 histos.y.base->setAxisTitle(
"(y_{pred} - y_{rec})' [cm]");
163 histos.y.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
164 histos.y.normed->setAxisTitle(
"(y_{pred} - y_{rec})'/#sigma");
172 switch (
id.subdetId()) {
184 strip_organizer.
setLayerFolder(ModuleID, tTopo, subdetandlayer.second);
187 auto isBarrel = subdetandlayer.first.find(
"B") != std::string::npos;
189 auto xy = std::vector<std::pair<HistoPair &, const char *>>{std::make_pair(std::ref(
histos.x),
"X"),
190 std::make_pair(std::ref(
histos.y),
"Y")};
191 for (
auto &histopair :
xy) {
196 if (!
isPixel && histopair.second[0] ==
'Y')
200 Form(
"HitResiduals%s_%s%d",
202 isBarrel ?
"L" : (subdetandlayer.second > 0 ?
"Dp" :
"Dm"),
204 : (Form(
"HitResiduals_%s__%s__%d",
206 subdetandlayer.first.c_str(),
210 std::string histotitle = Form(
"HitResiduals %s on %s%s full %s %d",
212 subdetandlayer.first.c_str(),
213 isBarrel ?
"" : (subdetandlayer.second > 0 ?
"+" :
"-"),
217 std::string normhistoname = Form(
"Normalized%s", histoname.c_str());
218 std::string normhistotitle = Form(
"Normalized%s", histotitle.c_str());
223 histopair.first.base =
224 ibooker.
book1D(histoname.c_str(), histotitle.c_str(), i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
225 histopair.first.base->
setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
227 histopair.first.normed = ibooker.
book1D(
228 normhistoname.c_str(), normhistotitle.c_str(), i_normres_Nbins, d_normres_xmin, d_normres_xmax);
229 histopair.first.normed->
setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
235 template <TrackerType pixel_or_strip>
237 auto vtracks = std::vector<TrackerValidationVariables::AVTrackStruct>();
244 if (!vertices.
isValid() || vertices->empty())
257 return track.
pt() > 0.75 &&
262 for (
auto &track : vtracks) {
263 for (
auto &it : track.hits) {
264 uint RawId = it.rawDetId;
266 auto id =
DetId(RawId);
267 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
273 mod_histos.x.base->Fill(it.resXprime);
274 mod_histos.x.normed->Fill(it.resXprime / it.resXprimeErr);
275 mod_histos.y.base->Fill(it.resYprime);
276 mod_histos.y.normed->Fill(it.resYprime / it.resYprimeErr);
282 if (it.resXprimeErr != 0 &&
histos.x.base) {
283 histos.x.base->Fill(it.resXprime);
284 histos.x.normed->Fill(it.resXprime / it.resXprimeErr);
288 if (it.resYprimeErr != 0 &&
histos.y.base) {
289 histos.y.base->Fill(it.resYprime);
290 histos.y.normed->Fill(it.resYprime / it.resYprimeErr);
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
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
void setCurrentFolder(std::string const &fullpath)
unsigned int pxfDisk(const DetId &id) const
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
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
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)
primaryVertex
hltOfflineBeamSpot for HLTMON
unsigned int tecWheel(const DetId &id) const
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
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)