52 : outputFile_( ps.getUntrackedParameter<std::
string>(
"outputFile",
"pixelrechitshisto.root" ) )
53 , runStandalone ( ps.getParameter<bool>(
"runStandalone") )
56 , siPixelRecHitCollectionToken_( consumes<
SiPixelRecHitCollection>( ps.getParameter<edm::InputTag>(
"src" ) ) ) {
80 for (
int i=0;
i<8;
i++) {
81 sprintf(histo,
"Clust_y_size_Module%d",
i+1);
86 for (
int i=0;
i<3;
i++) {
87 sprintf(histo,
"Clust_x_size_Layer%d",
i+1);
92 for (
int i=0;
i<8;
i++) {
94 sprintf(histo,
"Clust_charge_Layer1_Module%d",
i+1);
98 sprintf(histo,
"Clust_charge_Layer2_Module%d",
i+1);
102 sprintf(histo,
"Clust_charge_Layer3_Module%d",
i+1);
108 for (
int i=0;
i<7;
i++) {
110 sprintf(histo,
"Clust_x_size_Disk1_Plaquette%d",
i+1);
114 sprintf(histo,
"Clust_x_size_Disk2_Plaquette%d",
i+1);
118 sprintf(histo,
"Clust_y_size_Disk1_Plaquette%d",
i+1);
122 sprintf(histo,
"Clust_y_size_Disk2_Plaquette%d",
i+1);
126 sprintf(histo,
"Clust_charge_Disk1_Plaquette%d",
i+1);
130 sprintf(histo,
"Clust_charge_Disk2_Plaquette%d",
i+1);
136 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitBPIX");
138 recHitXResAllB = ibooker.
book1D(
"RecHit_xres_b_All",
"RecHit X Res All Modules in Barrel", 100, -200., 200.);
141 recHitYResAllB = ibooker.
book1D(
"RecHit_yres_b_All",
"RecHit Y Res All Modules in Barrel", 100, -200., 200.);
147 recHitXHalfModules = ibooker.
book1D(
"RecHit_x_HalfModules",
"RecHit X distribution for half modules", 100, -1., 1.);
150 recHitYAllModules = ibooker.
book1D(
"RecHit_y_AllModules",
"RecHit Y distribution for all modules", 100, -4., 4.);
153 for (
int i=0;
i<3;
i++) {
155 sprintf(histo,
"RecHit_XRes_FlippedLadder_Layer%d",
i+1);
159 sprintf(histo,
"RecHit_XRes_UnFlippedLadder_Layer%d",
i+1);
164 for (
int i=0;
i<8;
i++) {
166 sprintf(histo,
"RecHit_YRes_Layer1_Module%d",
i+1);
170 sprintf(histo,
"RecHit_YRes_Layer2_Module%d",
i+1);
174 sprintf(histo,
"RecHit_YRes_Layer3_Module%d",
i+1);
178 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitFPIX");
180 recHitXResAllF = ibooker.
book1D(
"RecHit_xres_f_All",
"RecHit X Res All in Forward", 100, -200., 200.);
183 recHitYResAllF = ibooker.
book1D(
"RecHit_yres_f_All",
"RecHit Y Res All in Forward", 100, -200., 200.);
204 for (
int i=0;
i<7;
i++) {
206 sprintf(histo,
"RecHit_XRes_Disk1_Plaquette%d",
i+1);
209 sprintf(histo,
"RecHit_XRes_Disk2_Plaquette%d",
i+1);
213 sprintf(histo,
"RecHit_YRes_Disk1_Plaquette%d",
i+1);
216 sprintf(histo,
"RecHit_YRes_Disk2_Plaquette%d",
i+1);
222 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitPullsBPIX");
223 recHitXPullAllB = ibooker.
book1D(
"RecHit_xres_b_All" ,
"RecHit X Pull All Modules in Barrel" , 100, -10.0, 10.0);
224 recHitYPullAllB = ibooker.
book1D(
"RecHit_yres_b_All" ,
"RecHit Y Pull All Modules in Barrel" , 100, -10.0, 10.0);
226 for (
int i=0;
i<3;
i++)
228 sprintf(histo,
"RecHit_XPull_FlippedLadder_Layer%d",
i+1);
231 sprintf(histo,
"RecHit_XPull_UnFlippedLadder_Layer%d",
i+1);
235 for (
int i=0;
i<8;
i++)
237 sprintf(histo,
"RecHit_YPull_Layer1_Module%d",
i+1);
240 sprintf(histo,
"RecHit_YPull_Layer2_Module%d",
i+1);
243 sprintf(histo,
"RecHit_YPull_Layer3_Module%d",
i+1);
247 ibooker.
setCurrentFolder(
"TrackerRecHitsV/TrackerRecHits/Pixel/recHitPullsFPIX");
248 recHitXPullAllF = ibooker.
book1D(
"RecHit_XPull_f_All",
"RecHit X Pull All in Forward", 100, -10.0, 10.0);
250 recHitYPullAllF = ibooker.
book1D(
"RecHit_YPull_f_All",
"RecHit Y Pull All in Forward", 100, -10.0, 10.0);
252 for (
int i=0;
i<7;
i++)
254 sprintf(histo,
"RecHit_XPull_Disk1_Plaquette%d",
i+1);
256 sprintf(histo,
"RecHit_XPull_Disk2_Plaquette%d",
i+1);
259 sprintf(histo,
"RecHit_YPull_Disk1_Plaquette%d",
i+1);
262 sprintf(histo,
"RecHit_YPull_Disk2_Plaquette%d",
i+1);
281 if ( (
int) e.
id().
event() % 1000 == 0 )
296 for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin(); it != geom->dets().end(); it++)
298 DetId detId = ((*it)->geographicalId());
299 unsigned int subid=detId.
subdetId();
301 if (! ((subid==1) || (subid==2)))
continue;
306 if (pixeldet == recHitColl->end())
continue;
311 std::vector<PSimHit> matched;
314 for ( ; pixeliter != pixelrechitRangeIteratorEnd; pixeliter++)
319 if ( !matched.empty() )
321 float closest = 9999.9;
322 std::vector<PSimHit>::const_iterator closestit = matched.begin();
324 float rechit_x = lp.
x();
325 float rechit_y = lp.
y();
328 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
m<matched.end();
m++)
330 float sim_x1 = (*m).entryPoint().x();
331 float sim_x2 = (*m).exitPoint().x();
332 float sim_xpos = 0.5*(sim_x1+sim_x2);
334 float sim_y1 = (*m).entryPoint().y();
335 float sim_y2 = (*m).exitPoint().y();
336 float sim_ypos = 0.5*(sim_y1+sim_y2);
338 float x_res = fabs(sim_xpos - rechit_x);
339 float y_res = fabs(sim_ypos - rechit_y);
341 float dist =
sqrt(x_res*x_res + y_res*y_res);
343 if ( dist < closest )
352 fillBarrel(*pixeliter, *closestit, detId, theGeomDet,tTopo);
356 fillForward(*pixeliter, *closestit, detId, theGeomDet,tTopo);
368 const float cmtomicron = 10000.0;
374 LocalError lerr = recHit.localPositionError();
375 float lerr_x =
sqrt(lerr.
xx());
376 float lerr_y =
sqrt(lerr.
yy());
382 float sim_xpos = 0.5*(sim_x1 + sim_x2);
383 float res_x = (lp.
x() - sim_xpos)*cmtomicron;
389 float sim_ypos = 0.5*(sim_y1 + sim_y2);
390 float res_y = (lp.
y() - sim_ypos)*cmtomicron;
394 float pull_x = ( lp_x - sim_xpos ) / lerr_x;
395 float pull_y = ( lp_y - sim_ypos ) / lerr_y;
416 for (
unsigned int i=0;
i<3;
i++)
427 for (
unsigned int i=0;
i<3;
i++)
438 SiPixelRecHit::ClusterRef
const& clust = recHit.cluster();
441 for (
unsigned int i=0;
i<8;
i++)
445 int sizeY = (*clust).sizeY();
450 float charge = (*clust).charge();
455 else if (tTopo->
pxbLayer(detId) == 2)
457 float charge = (*clust).charge();
462 else if (tTopo->
pxbLayer(detId) == 3)
464 float charge = (*clust).charge();
471 int sizeX = (*clust).sizeX();
484 const float cmtomicron = 10000.0;
490 LocalError lerr = recHit.localPositionError();
491 float lerr_x =
sqrt(lerr.
xx());
492 float lerr_y =
sqrt(lerr.
yy());
496 float sim_xpos = 0.5*(sim_x1 + sim_x2);
500 float sim_ypos = 0.5*(sim_y1 + sim_y2);
502 float pull_x = ( lp_x - sim_xpos ) / lerr_x;
503 float pull_y = ( lp_y - sim_ypos ) / lerr_y;
510 else if (rows == 160)
519 else if (cols == 156)
523 else if (cols == 208)
527 else if (cols == 260)
532 float res_x = (lp.
x() - sim_xpos)*cmtomicron;
537 float res_y = (lp.
y() - sim_ypos)*cmtomicron;
542 SiPixelRecHit::ClusterRef
const& clust = recHit.cluster();
545 for (
unsigned int i=0;
i<7;
i++)
549 if (tTopo->
pxfDisk(detId) == 1)
551 int sizeX = (*clust).sizeX();
554 int sizeY = (*clust).sizeY();
557 float charge = (*clust).charge();
568 int sizeX = (*clust).sizeX();
571 int sizeY = (*clust).sizeY();
574 float charge = (*clust).charge();
587 if (tTopo->
pxfDisk(detId) == 1)
589 int sizeX = (*clust).sizeX();
592 int sizeY = (*clust).sizeY();
595 float charge = (*clust).charge();
606 int sizeX = (*clust).sizeX();
609 int sizeY = (*clust).sizeY();
612 float charge = (*clust).charge();
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
EventNumber_t event() const
MonitorElement * clustYSizeModule[8]
MonitorElement * clustXSizeDisk1Plaquettes[7]
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
MonitorElement * recHitXPullDisk2Plaquettes[7]
MonitorElement * recHitXResFlippedLadderLayers[3]
MonitorElement * recHitXFullModules
MonitorElement * recHitXResAllF
MonitorElement * recHitXHalfModules
virtual int ncolumns() const =0
MonitorElement * recHitYPullAllF
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * recHitXResDisk1Plaquettes[7]
MonitorElement * clustXSizeDisk2Plaquettes[7]
MonitorElement * recHitYResAllB
#define DEFINE_FWK_MODULE(type)
unsigned int pxfDisk(const DetId &id) const
MonitorElement * recHitYPullDisk2Plaquettes[7]
MonitorElement * clustXSizeLayer[3]
MonitorElement * clustChargeLayer1Modules[8]
virtual int nrows() const =0
MonitorElement * recHitYPlaquetteSize5
unsigned int pxbModule(const DetId &id) const
MonitorElement * recHitXPlaquetteSize1
MonitorElement * recHitXResDisk2Plaquettes[7]
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * recHitXPullNonFlippedLadderLayers[3]
MonitorElement * recHitYPullDisk1Plaquettes[7]
MonitorElement * recHitXPullAllB
MonitorElement * recHitXResAllB
MonitorElement * clustChargeLayer2Modules[8]
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)
MonitorElement * recHitYPullLayer3Modules[8]
edm::EDGetTokenT< SiPixelRecHitCollection > siPixelRecHitCollectionToken_
MonitorElement * clustYSizeDisk1Plaquettes[7]
MonitorElement * book1D(Args &&...args)
void fillForward(const SiPixelRecHit &, const PSimHit &, DetId, const PixelGeomDetUnit *, const TrackerTopology *tTopo)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual const GeomDet * idToDet(DetId) const
unsigned int pxfModule(const DetId &id) const
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * recHitXPlaquetteSize2
unsigned int pxbLayer(const DetId &id) const
Point3DBase< float, LocalTag > Local3DPoint
MonitorElement * clustChargeLayer3Modules[8]
void setCurrentFolder(const std::string &fullpath)
MonitorElement * recHitYResAllF
MonitorElement * recHitYResLayer3Modules[8]
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
T const * product() const
MonitorElement * recHitYPullLayer2Modules[8]
MonitorElement * clustYSizeDisk2Plaquettes[7]
MonitorElement * recHitYPlaquetteSize4
MonitorElement * recHitXPullFlippedLadderLayers[3]
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * recHitYResLayer1Modules[8]
MonitorElement * recHitYPullLayer1Modules[8]
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es)
MonitorElement * recHitXPullDisk1Plaquettes[7]
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