14 template <TrackerType pixel_or_strip>
17 tkDetMapToken_{esConsumes<TkDetMap, TrackerTopologyRcd, edm::Transition::BeginRun>()},
19 trackerGeometryToken_{esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()},
30 template <TrackerType pixel_or_strip>
36 template <TrackerType pixel_or_strip>
50 std::make_unique<TkHistoMap>(tkDetMap, 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>
109 double d_residual_xmin =
Parameters.getParameter<
double>(
"xmin");
110 double d_residual_xmax =
Parameters.getParameter<
double>(
"xmax");
112 int32_t i_normres_Nbins = Parameters.
getParameter<int32_t>(
"Nbinx");
113 double d_normres_xmin = Parameters.getParameter<
double>(
"xmin");
114 double d_normres_xmax = Parameters.getParameter<
double>(
"xmax");
125 for (
DetId id : ids) {
126 auto ModuleID =
id.rawId();
127 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
133 switch (
id.subdetId()) {
135 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
138 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
145 std::string hid = hidmanager.createHistoId(
"HitResidualsX",
"det", ModuleID);
146 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsX",
"det", ModuleID);
148 histos.x.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
149 histos.x.base->setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
150 histos.x.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
151 histos.x.normed->setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
154 std::string hid = hidmanager.createHistoId(
"HitResidualsY",
"det", ModuleID);
155 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsY",
"det", ModuleID);
157 histos.y.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
158 histos.y.base->setAxisTitle(
"(y_{pred} - y_{rec})' [cm]");
159 histos.y.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
160 histos.y.normed->setAxisTitle(
"(y_{pred} - y_{rec})'/#sigma");
168 switch (
id.subdetId()) {
180 strip_organizer.
setLayerFolder(ModuleID, tTopo, subdetandlayer.second);
183 auto isBarrel = subdetandlayer.first.find(
"B") != std::string::npos;
185 auto xy = std::vector<std::pair<HistoPair &, const char *>>{std::make_pair(std::ref(
histos.x),
"X"),
186 std::make_pair(std::ref(
histos.y),
"Y")};
187 for (
auto &histopair :
xy) {
192 if (!
isPixel && histopair.second[0] ==
'Y')
196 Form(
"HitResiduals%s_%s%d",
198 isBarrel ?
"L" : (subdetandlayer.second > 0 ?
"Dp" :
"Dm"),
200 : (Form(
"HitResiduals_%s__%s__%d",
202 subdetandlayer.first.c_str(),
206 std::string histotitle = Form(
"HitResiduals %s on %s%s full %s %d",
208 subdetandlayer.first.c_str(),
209 isBarrel ?
"" : (subdetandlayer.second > 0 ?
"+" :
"-"),
213 std::string normhistoname = Form(
"Normalized%s", histoname.c_str());
214 std::string normhistotitle = Form(
"Normalized%s", histotitle.c_str());
219 histopair.first.base =
220 ibooker.
book1D(histoname.c_str(), histotitle.c_str(), i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
221 histopair.first.base->
setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
223 histopair.first.normed = ibooker.
book1D(
224 normhistoname.c_str(), normhistotitle.c_str(), i_normres_Nbins, d_normres_xmin, d_normres_xmax);
225 histopair.first.normed->
setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
231 template <TrackerType pixel_or_strip>
233 auto vtracks = std::vector<TrackerValidationVariables::AVTrackStruct>();
241 if (!vertices.
isValid() || vertices->empty())
254 (track.
pt() > 0.75 &&
abs(track.
dxy(vertices->at(0).position())) < 5 * track.
dxyError()));
258 for (
auto &track : vtracks) {
259 for (
auto &it : track.hits) {
260 uint RawId = it.rawDetId;
262 auto id =
DetId(RawId);
263 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
269 mod_histos.x.base->Fill(it.resXprime);
270 mod_histos.x.normed->Fill(it.resXprime / it.resXprimeErr);
271 mod_histos.y.base->Fill(it.resYprime);
272 mod_histos.y.normed->Fill(it.resYprime / it.resYprimeErr);
278 if (it.resXprimeErr != 0 &&
histos.x.base) {
279 histos.x.base->Fill(it.resXprime);
280 histos.x.normed->Fill(it.resXprime / it.resXprimeErr);
284 if (it.resYprimeErr != 0 &&
histos.y.base) {
285 histos.y.base->Fill(it.resYprime);
286 histos.y.normed->Fill(it.resYprime / it.resYprimeErr);
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
void setSiStripFolderName(std::string name)
unsigned int tibLayer(const DetId &id) const
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyEventToken_
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
double dxyError() const
error on dxy
#define DEFINE_FWK_MODULE(type)
unsigned int pxfDisk(const DetId &id) const
TrackerValidationVariables avalidator_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyRunToken_
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_
constexpr std::array< uint8_t, layerIndexSize > layer
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
bool getData(T &iHolder) const
std::unique_ptr< TkHistoMap > tkhisto_ResidualsMean
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
Abs< T >::type abs(const T &t)
MonitorTrackResidualsBase(const edm::ParameterSet &)
unsigned int pxbLayer(const DetId &id) const
SiStripHistoId hidmanager
~MonitorTrackResidualsBase() override
Basic2DVector< T > xy() const
void fillTrackQuantities(const edm::Event &, const edm::EventSetup &, std::vector< AVTrackStruct > &v_avtrackout)
GenericTriggerEventFlag * genTriggerEventFlag_
T getParameter(std::string const &) const
SiStripFolderOrganizer folder_organizer
void createMEs(DQMStore::IBooker &, const edm::EventSetup &)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
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.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
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 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)