49 trackerHitAssociatorConfig_(ps, consumesCollector()),
66 for (
int i = 0;
i < 8;
i++) {
67 sprintf(histo,
"Clust_y_size_Module%d",
i + 1);
72 for (
int i = 0;
i < 3;
i++) {
73 sprintf(histo,
"Clust_x_size_Layer%d",
i + 1);
78 for (
int i = 0;
i < 8;
i++) {
80 sprintf(histo,
"Clust_charge_Layer1_Module%d",
i + 1);
84 sprintf(histo,
"Clust_charge_Layer2_Module%d",
i + 1);
88 sprintf(histo,
"Clust_charge_Layer3_Module%d",
i + 1);
94 for (
int i = 0;
i < 7;
i++) {
96 sprintf(histo,
"Clust_x_size_Disk1_Plaquette%d",
i + 1);
100 sprintf(histo,
"Clust_x_size_Disk2_Plaquette%d",
i + 1);
104 sprintf(histo,
"Clust_y_size_Disk1_Plaquette%d",
i + 1);
108 sprintf(histo,
"Clust_y_size_Disk2_Plaquette%d",
i + 1);
112 sprintf(histo,
"Clust_charge_Disk1_Plaquette%d",
i + 1);
116 sprintf(histo,
"Clust_charge_Disk2_Plaquette%d",
i + 1);
120 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitBPIX");
122 recHitBunchB = ibooker.
book1D(
"RecHit_Bunch_Barrel",
"RecHit Bunch Crossing, Barrel", 20, -10., 10.);
125 recHitEventB = ibooker.
book1D(
"RecHit_Event_Barrel",
"RecHit Event (in-time bunch), Barrel", 100, 0., 100.);
128 recHitXResAllB = ibooker.
book1D(
"RecHit_xres_b_All",
"RecHit X Res All Modules in Barrel", 100, -200., 200.);
131 recHitYResAllB = ibooker.
book1D(
"RecHit_yres_b_All",
"RecHit Y Res All Modules in Barrel", 100, -200., 200.);
134 recHitXFullModules = ibooker.
book1D(
"RecHit_x_FullModules",
"RecHit X distribution for full modules", 100, -2., 2.);
137 recHitXHalfModules = ibooker.
book1D(
"RecHit_x_HalfModules",
"RecHit X distribution for half modules", 100, -1., 1.);
140 recHitYAllModules = ibooker.
book1D(
"RecHit_y_AllModules",
"RecHit Y distribution for all modules", 100, -4., 4.);
143 for (
int i = 0;
i < 3;
i++) {
145 sprintf(histo,
"RecHit_NsimHit_Layer%d",
i + 1);
149 sprintf(histo,
"RecHit_XRes_FlippedLadder_Layer%d",
i + 1);
153 sprintf(histo,
"RecHit_XRes_UnFlippedLadder_Layer%d",
i + 1);
155 ibooker.
book1D(histo,
"RecHit XRes NonFlipped Ladders by Layer", 100, -200., 200.);
159 for (
int i = 0;
i < 8;
i++) {
161 sprintf(histo,
"RecHit_YRes_Layer1_Module%d",
i + 1);
165 sprintf(histo,
"RecHit_YRes_Layer2_Module%d",
i + 1);
169 sprintf(histo,
"RecHit_YRes_Layer3_Module%d",
i + 1);
173 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitFPIX");
175 recHitBunchF = ibooker.
book1D(
"RecHit_Bunch_Forward",
"RecHit Bunch Crossing, Forward", 20, -10., 10.);
178 recHitEventF = ibooker.
book1D(
"RecHit_Event_Forward",
"RecHit Event (in-time bunch), Forward", 100, 0., 100.);
185 recHitXResAllF = ibooker.
book1D(
"RecHit_xres_f_All",
"RecHit X Res All in Forward", 100, -200., 200.);
188 recHitYResAllF = ibooker.
book1D(
"RecHit_yres_f_All",
"RecHit Y Res All in Forward", 100, -200., 200.);
192 ibooker.
book1D(
"RecHit_x_Plaquette_xsize1",
"RecHit X Distribution for plaquette x-size1", 100, -2., 2.);
196 ibooker.
book1D(
"RecHit_x_Plaquette_xsize2",
"RecHit X Distribution for plaquette x-size2", 100, -2., 2.);
200 ibooker.
book1D(
"RecHit_y_Plaquette_ysize2",
"RecHit Y Distribution for plaquette y-size2", 100, -4., 4.);
204 ibooker.
book1D(
"RecHit_y_Plaquette_ysize3",
"RecHit Y Distribution for plaquette y-size3", 100, -4., 4.);
208 ibooker.
book1D(
"RecHit_y_Plaquette_ysize4",
"RecHit Y Distribution for plaquette y-size4", 100, -4., 4.);
212 ibooker.
book1D(
"RecHit_y_Plaquette_ysize5",
"RecHit Y Distribution for plaquette y-size5", 100, -4., 4.);
215 for (
int i = 0;
i < 7;
i++) {
217 sprintf(histo,
"RecHit_XRes_Disk1_Plaquette%d",
i + 1);
220 sprintf(histo,
"RecHit_XRes_Disk2_Plaquette%d",
i + 1);
224 sprintf(histo,
"RecHit_YRes_Disk1_Plaquette%d",
i + 1);
227 sprintf(histo,
"RecHit_YRes_Disk2_Plaquette%d",
i + 1);
231 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitPullsBPIX");
232 recHitXPullAllB = ibooker.
book1D(
"RecHit_xres_b_All",
"RecHit X Pull All Modules in Barrel", 100, -10.0, 10.0);
233 recHitYPullAllB = ibooker.
book1D(
"RecHit_yres_b_All",
"RecHit Y Pull All Modules in Barrel", 100, -10.0, 10.0);
235 for (
int i = 0;
i < 3;
i++) {
236 sprintf(histo,
"RecHit_XPull_FlippedLadder_Layer%d",
i + 1);
238 ibooker.
book1D(histo,
"RecHit XPull Flipped Ladders by Layer", 100, -10.0, 10.0);
240 sprintf(histo,
"RecHit_XPull_UnFlippedLadder_Layer%d",
i + 1);
242 ibooker.
book1D(histo,
"RecHit XPull NonFlipped Ladders by Layer", 100, -10.0, 10.0);
245 for (
int i = 0;
i < 8;
i++) {
246 sprintf(histo,
"RecHit_YPull_Layer1_Module%d",
i + 1);
249 sprintf(histo,
"RecHit_YPull_Layer2_Module%d",
i + 1);
252 sprintf(histo,
"RecHit_YPull_Layer3_Module%d",
i + 1);
256 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitPullsFPIX");
257 recHitXPullAllF = ibooker.
book1D(
"RecHit_XPull_f_All",
"RecHit X Pull All in Forward", 100, -10.0, 10.0);
259 recHitYPullAllF = ibooker.
book1D(
"RecHit_YPull_f_All",
"RecHit Y Pull All in Forward", 100, -10.0, 10.0);
261 for (
int i = 0;
i < 7;
i++) {
262 sprintf(histo,
"RecHit_XPull_Disk1_Plaquette%d",
i + 1);
264 sprintf(histo,
"RecHit_XPull_Disk2_Plaquette%d",
i + 1);
267 sprintf(histo,
"RecHit_YPull_Disk1_Plaquette%d",
i + 1);
270 sprintf(histo,
"RecHit_YPull_Disk2_Plaquette%d",
i + 1);
280 if (e.
id().
event() % 1000 == 0)
294 for (
const auto& it : theTracker->
dets()) {
295 DetId detId = it->geographicalId();
296 unsigned int subid = detId.
subdetId();
298 if (!((subid == 1) || (subid == 2)))
304 if (pixeldet == recHitColl->end())
310 std::vector<PSimHit> matched;
313 for (; pixeliter != pixelrechitRangeIteratorEnd; pixeliter++) {
317 if (!matched.empty()) {
318 float closest = 9999.9;
319 std::vector<PSimHit>::const_iterator closestit = matched.begin();
321 float rechit_x = lp.
x();
322 float rechit_y = lp.
y();
325 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
m < matched.end();
m++) {
326 float sim_x1 = (*m).entryPoint().x();
327 float sim_x2 = (*m).exitPoint().x();
328 float sim_xpos = 0.5 * (sim_x1 + sim_x2);
330 float sim_y1 = (*m).entryPoint().y();
331 float sim_y2 = (*m).exitPoint().y();
332 float sim_ypos = 0.5 * (sim_y1 + sim_y2);
334 float x_res = fabs(sim_xpos - rechit_x);
335 float y_res = fabs(sim_ypos - rechit_y);
337 float dist =
sqrt(x_res * x_res + y_res * y_res);
339 if (dist < closest) {
346 fillBarrel(*pixeliter, *closestit, detId, theGeomDet, tTopo);
349 fillForward(*pixeliter, *closestit, detId, theGeomDet, tTopo);
354 int NsimHit = matched.size();
356 for (
unsigned int i = 0;
i < 3;
i++)
361 if (tTopo->
pxfDisk(detId) == 1)
389 float lerr_x =
sqrt(lerr.
xx());
390 float lerr_y =
sqrt(lerr.
yy());
396 float sim_xpos = 0.5 * (sim_x1 + sim_x2);
397 float res_x = (lp.
x() - sim_xpos) * cmtomicron;
403 float sim_ypos = 0.5 * (sim_y1 + sim_y2);
404 float res_y = (lp.
y() - sim_ypos) * cmtomicron;
408 float pull_x = (lp_x - sim_xpos) / lerr_x;
409 float pull_y = (lp_y - sim_ypos) / lerr_y;
418 }
else if (rows == 80) {
426 for (
unsigned int i = 0;
i < 3;
i++) {
433 for (
unsigned int i = 0;
i < 3;
i++) {
445 for (
unsigned int i = 0;
i < 8;
i++) {
447 int sizeY = (*clust).sizeY();
451 float charge = (*clust).charge();
455 }
else if (tTopo->
pxbLayer(detId) == 2) {
456 float charge = (*clust).charge();
460 }
else if (tTopo->
pxbLayer(detId) == 3) {
461 float charge = (*clust).charge();
468 int sizeX = (*clust).sizeX();
499 float lerr_x =
sqrt(lerr.
xx());
500 float lerr_y =
sqrt(lerr.
yy());
504 float sim_xpos = 0.5 * (sim_x1 + sim_x2);
508 float sim_ypos = 0.5 * (sim_y1 + sim_y2);
510 float pull_x = (lp_x - sim_xpos) / lerr_x;
511 float pull_y = (lp_y - sim_ypos) / lerr_y;
515 }
else if (rows == 160) {
521 }
else if (cols == 156) {
523 }
else if (cols == 208) {
525 }
else if (cols == 260) {
529 float res_x = (lp.
x() - sim_xpos) * cmtomicron;
534 float res_y = (lp.
y() - sim_ypos) * cmtomicron;
542 for (
unsigned int i = 0;
i < 7;
i++) {
544 if (tTopo->
pxfDisk(detId) == 1) {
545 int sizeX = (*clust).sizeX();
548 int sizeY = (*clust).sizeY();
551 float charge = (*clust).charge();
560 int sizeX = (*clust).sizeX();
563 int sizeY = (*clust).sizeY();
566 float charge = (*clust).charge();
578 if (tTopo->
pxfDisk(detId) == 1) {
579 int sizeX = (*clust).sizeX();
582 int sizeY = (*clust).sizeY();
585 float charge = (*clust).charge();
594 int sizeX = (*clust).sizeX();
597 int sizeY = (*clust).sizeY();
600 float charge = (*clust).charge();
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
EventNumber_t event() const
MonitorElement * clustYSizeModule[8]
MonitorElement * clustXSizeDisk1Plaquettes[7]
MonitorElement * recHitNsimHitDisk1
MonitorElement * recHitXPullDisk2Plaquettes[7]
MonitorElement * recHitXResFlippedLadderLayers[3]
int event() const
get the contents of the subdetector field (should be protected?)
MonitorElement * recHitXFullModules
~SiPixelRecHitsValid() override
MonitorElement * recHitXResAllF
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomEsToken
MonitorElement * recHitXHalfModules
virtual void setCurrentFolder(std::string const &fullpath)
virtual int ncolumns() const =0
MonitorElement * recHitYPullAllF
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * recHitXResDisk1Plaquettes[7]
MonitorElement * recHitEventF
MonitorElement * clustXSizeDisk2Plaquettes[7]
MonitorElement * recHitYResAllB
#define DEFINE_FWK_MODULE(type)
unsigned int pxfDisk(const DetId &id) const
MonitorElement * recHitYPullDisk2Plaquettes[7]
MonitorElement * recHitNsimHitLayer[3]
MonitorElement * clustXSizeLayer[3]
MonitorElement * clustChargeLayer1Modules[8]
virtual int nrows() const =0
MonitorElement * recHitYPlaquetteSize5
unsigned int pxbModule(const DetId &id) const
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
MonitorElement * recHitEventB
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * recHitXPlaquetteSize1
MonitorElement * recHitXResDisk2Plaquettes[7]
const Plane & surface() const
The nominal surface of the GeomDet.
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) override
MonitorElement * recHitXPullNonFlippedLadderLayers[3]
MonitorElement * recHitYPullDisk1Plaquettes[7]
MonitorElement * recHitXPullAllB
MonitorElement * recHitXResAllB
bool getData(T &iHolder) const
MonitorElement * recHitBunchB
MonitorElement * clustChargeLayer2Modules[8]
TrackerHitAssociator::Config trackerHitAssociatorConfig_
MonitorElement * recHitYResDisk2Plaquettes[7]
Local3DPoint exitPoint() const
Exit point in the local Det frame.
MonitorElement * recHitXResNonFlippedLadderLayers[3]
MonitorElement * recHitYResDisk1Plaquettes[7]
MonitorElement * recHitYResLayer2Modules[8]
MonitorElement * recHitYPlaquetteSize2
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int bunchCrossing() const
get the detector field from this detid
MonitorElement * recHitYPullLayer3Modules[8]
edm::EDGetTokenT< SiPixelRecHitCollection > siPixelRecHitCollectionToken_
MonitorElement * clustYSizeDisk1Plaquettes[7]
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * recHitBunchF
void fillForward(const SiPixelRecHit &, const PSimHit &, DetId, const PixelGeomDetUnit *, const TrackerTopology *tTopo)
EncodedEventId eventId() const
const TrackerGeomDet * idToDet(DetId) const override
unsigned int pxfModule(const DetId &id) const
MonitorElement * recHitXPlaquetteSize2
unsigned int pxbLayer(const DetId &id) const
Log< level::Info, false > LogInfo
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoEsToken
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
LocalError localPositionError() const override
MonitorElement * clustChargeLayer3Modules[8]
MonitorElement * recHitYResAllF
MonitorElement * recHitYResLayer3Modules[8]
ClusterRef cluster() const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
MonitorElement * recHitYPullLayer2Modules[8]
MonitorElement * clustYSizeDisk2Plaquettes[7]
MonitorElement * recHitYPlaquetteSize4
MonitorElement * recHitXPullFlippedLadderLayers[3]
MonitorElement * recHitNsimHitDisk2
LocalPoint localPosition() const override
MonitorElement * recHitYResLayer1Modules[8]
MonitorElement * recHitYPullLayer1Modules[8]
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
MonitorElement * recHitXPullDisk1Plaquettes[7]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
SiPixelRecHitsValid(const edm::ParameterSet &conf)
MonitorElement * recHitYPullAllB
MonitorElement * recHitXPullAllF
Local3DPoint entryPoint() const
Entry point in the local Det frame.
MonitorElement * recHitYPlaquetteSize3
MonitorElement * clustChargeDisk1Plaquettes[7]
unsigned int pxfPanel(const DetId &id) const
MonitorElement * clustChargeDisk2Plaquettes[7]
void fillBarrel(const SiPixelRecHit &, const PSimHit &, DetId, const PixelGeomDetUnit *, const TrackerTopology *tTopo)
MonitorElement * recHitYAllModules
Point3DBase< float, LocalTag > Local3DPoint