50 src_( conf_.getParameter<edm::
InputTag>(
"src" ) ),
51 digisrc_( conf_.getParameter<edm::
InputTag>(
"digisrc" ) ),
52 saveFile( conf_.getUntrackedParameter<bool>(
"saveFile",
false) ),
53 isPIB( conf_.getUntrackedParameter<bool>(
"isPIB",
false) ),
54 slowDown( conf_.getUntrackedParameter<bool>(
"slowDown",
false) ),
55 modOn( conf_.getUntrackedParameter<bool>(
"modOn",
true) ),
56 twoDimOn( conf_.getUntrackedParameter<bool>(
"twoDimOn",
true) ),
57 reducedSet( conf_.getUntrackedParameter<bool>(
"reducedSet",
false) ),
58 ladOn( conf_.getUntrackedParameter<bool>(
"ladOn",
false) ),
59 layOn( conf_.getUntrackedParameter<bool>(
"layOn",
false) ),
60 phiOn( conf_.getUntrackedParameter<bool>(
"phiOn",
false) ),
61 ringOn( conf_.getUntrackedParameter<bool>(
"ringOn",
false) ),
62 bladeOn( conf_.getUntrackedParameter<bool>(
"bladeOn",
false) ),
63 diskOn( conf_.getUntrackedParameter<bool>(
"diskOn",
false) ),
64 smileyOn(conf_.getUntrackedParameter<bool>(
"smileyOn",
false) ),
65 bigEventSize( conf_.getUntrackedParameter<int>(
"bigEventSize",100) ),
66 isUpgrade( conf_.getUntrackedParameter<bool>(
"isUpgrade",
false) ),
70 LogInfo (
"PixelDQM") <<
"SiPixelClusterSource::SiPixelClusterSource: Got DQM BackEnd interface"<<endl;
85 LogInfo (
"PixelDQM") <<
"SiPixelClusterSource::~SiPixelClusterSource: Destructor"<<endl;
87 std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
89 delete struct_iter->second;
90 struct_iter->second = 0;
97 LogInfo (
"PixelDQM") <<
" SiPixelClusterSource::beginJob - Initialisation ... " << std::endl;
103 LogInfo (
"PixelDQM") <<
"Smiley (Cluster sizeY vs. Cluster eta) is " <<
smileyOn <<
"\n";
122 std::stringstream ss1, ss2;
125 ss1.str(
std::string()); ss1 <<
"position_siPixelClusters_Layer_" <<
i;
126 ss2.str(
std::string()); ss2 <<
"Clusters Layer" << i <<
";Global Z (cm);Global #phi";
127 meClPosLayer.push_back(iBooker.
book2D(ss1.str(),ss2.str(),200,-30.,30.,128,-3.2,3.2));
131 ss1.str(
std::string()); ss1 <<
"position_siPixelClusters_pz_Disk_" <<
i;
132 ss2.str(
std::string()); ss2 <<
"Clusters +Z Disk" << i <<
";Global X (cm);Global Y (cm)";
134 ss1.str(
std::string()); ss1 <<
"position_siPixelClusters_mz_Disk_" <<
i;
135 ss2.str(
std::string()); ss2 <<
"Clusters -Z Disk" << i <<
";Global X (cm);Global Y (cm)";
141 ss1.str(
std::string()); ss1 <<
"totalNumberOfClustersProfile_siPixelClusters_Barrel";
142 ss2.str(
std::string()); ss2 <<
"Total number of barrel clusters profile;Lumisection;";
148 ss1.str(
std::string()); ss1 <<
"totalNumberOfClustersProfile_siPixelClusters_FPIX+";
149 ss2.str(
std::string()); ss2 <<
"Total number of FPIX+ clusters profile;Lumisection;";
153 ss1.str(
std::string()); ss1 <<
"totalNumberOfClustersProfile_siPixelClusters_FPIX-";
154 ss2.str(
std::string()); ss2 <<
"Total number of FPIX- clusters profile;Lumisection;";
160 int ybins = -1;
float ymin = 0.;
float ymax = 0.;
161 if (
i==1) { ybins = 42; ymin = -10.5; ymax = 10.5; }
162 if (
i==2) { ybins = 66; ymin = -16.5; ymax = 16.5; }
163 if (
i==3) { ybins = 90; ymin = -22.5; ymax = 22.5; }
165 ss2.str(
std::string()); ss2 <<
"Pixel Barrel Occupancy, ROC level (Online): Layer " <<
i;
172 meZeroRocFPIX = iBooker.
book2D(
"ROC_endcap_occupancy",
"Pixel Endcap Occupancy, ROC level (Online)",72, -4.5, 4.5,288,-12.5,12.5);
208 auto const & clustColl = *(input.
product());
224 int nEventFpixClusters = 0;
226 int nEventsBarrel = 0;
227 int nEventsFPIXm = 0;
228 int nEventsFPIXp = 0;
231 std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
234 int numberOfFpixClusters = (*struct_iter).second->fill(*input, tracker,
235 &nEventsBarrel, &nEventsFPIXp, &nEventsFPIXm,
242 nEventFpixClusters = nEventFpixClusters + numberOfFpixClusters;
260 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
262 DetId detId = (*it)->geographicalId();
288 LogInfo (
"PixelDQM") <<
" SiPixelClusterSource::buildStructure" ;
296 LogVerbatim (
"PixelDQM") <<
" *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
297 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->dets().size() <<
" detectors"<<std::endl;
298 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->detTypes().size() <<
" types"<<std::endl;
300 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
302 if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=0){
304 DetId detId = (*it)->geographicalId();
305 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
313 uint32_t
id = detId();
317 LogDebug (
"PixelDQM") <<
" ---> Adding Barrel Module " << detId.
rawId() << endl;
322 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
329 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
330 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
331 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
332 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
333 char smodule[80];sprintf(smodule,
"Module_%i",module);
336 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
337 side_str.find(
"HalfCylinder_2")!=string::npos||
338 side_str.find(
"HalfCylinder_4")!=string::npos||
339 disk_str.find(
"Disk_2")!=string::npos;
342 if(
isPIB && mask)
continue;
357 char title[256]; snprintf(title, 256,
"Rate of events with >%i FPIX clusters;LumiSection;Rate of large FPIX events per LS [Hz]",
bigEventSize);
361 std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
374 <<
"[SiPixelClusterSource::bookMEs] Creation of DQM folder failed";
381 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
388 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LAYER-FOLDER\n";
395 LogDebug (
"PixelDQM") <<
"PROBLEM WITH PHI-FOLDER\n";
402 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
409 LogDebug (
"PixelDQM") <<
"PROBLEM WITH DISK-FOLDER\n";
416 LogDebug (
"PixelDQM") <<
"PROBLEM WITH RING-FOLDER\n";
423 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BARREL-FOLDER\n";
435 if( ipxsearch != diginp.
end() ) {
439 for (pxdi = ipxsearch->
begin(); pxdi != ipxsearch->
end(); pxdi++) {
448 if (DBshell==1 || DBshell==2) { DBmodule = -DBmodule; }
449 if (DBshell==1 || DBshell==3) { DBladder = -DBladder; }
451 int col = pxdi->column();
452 int row = pxdi->row();
454 float modsign = (float)DBmodule/(
abs((
float)DBmodule));
455 float ladsign = (float)DBladder/(
abs((
float)DBladder));
456 float rocx = ((float)col/(52.*8.))*modsign + ((
float)DBmodule-(modsign)*0.5);
457 float rocy = ((float)row/(80.*2.))*ladsign + ((
float)DBladder-(ladsign)*0.5);
461 if ( (DBladder%2==0) && (!isHalfModule) ) { flip =
true; }
462 if ((flip) && (DBladder>0)) {
463 if ( ( ((
float)DBladder-(ladsign)*0.5)<=rocy) && (rocy<(
float)DBladder)) { rocy = rocy + ladsign*0.5; }
464 else if ( ( ((
float)DBladder)<=rocy) && (rocy<((float)DBladder+(ladsign)*0.5)) ) { rocy = rocy - ladsign*0.5; }
468 if (modsign<0) { rocx = rocx -0.0001; }
469 if (ladsign<0) { rocy = rocy -0.0001; }
else { rocy = rocy +0.0001; }
470 if (
abs(DBladder)==1) { rocy = rocy + ladsign*0.5; }
471 meinput[DBlayer-1]->Fill(rocx,rocy);
482 if( ipxsearch != clustColl.
end() ) {
486 for (pxclust = ipxsearch->
begin(); pxclust != ipxsearch->
end(); pxclust++) {
488 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
494 float xclust = pxclust->x();
495 float yclust = pxclust->y();
496 float z = clustgp.
z();
504 if ( (pxfside==1) || (pxfside==3) ) { pxfblade = -1.*pxfblade; }
506 if (z<0.) { pxfdisk = -1.*pxfdisk; }
508 int clu_sdpx = ((pxfdisk>0) ? 1 : -1) * (2 * (
abs(pxfdisk) - 1) + pxfpanel);
509 int binselx = (pxfpanel==1&&(pxfmodule==1||pxfmodule==4)) ? (pxfmodule==1) : ((pxfpanel==1&& xclust<80.0)||(pxfpanel==2&&xclust>=80.0));
510 int nperpan = 2 * pxfmodule + pxfpanel - 1 + binselx;
511 int clu_roc_binx = ((pxfdisk>0) ? nperpan : 9 - nperpan) + (clu_sdpx + 4) * 8 - 2 * ((
abs(pxfdisk)==1) ? pxfdisk : 0);
513 int clu_roc_biny = -99.;
514 int nrocly = pxfmodule + pxfpanel;
515 for (
int i=0;
i<nrocly;
i++) {
516 int j = (pxfdisk<0) ?
i : nrocly - 1 -
i;
517 if (yclust>=(j*52.0)&& yclust<((j+1)*52.0))
518 clu_roc_biny = 6 - nrocly + 2 *
i + ((pxfblade>0) ? pxfblade-1 : pxfblade + 12)*12 + 1;
520 if (pxfblade>0) { clu_roc_biny = clu_roc_biny+144; }
void getrococcupancy(DetId detId, const edm::DetSetVector< PixelDigi > diginp, const TrackerTopology *const tTopo, std::vector< MonitorElement * > meinput)
int plaquetteName() const
plaquetteId (in pannel)
virtual void buildStructure(edm::EventSetup const &)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void setBinContent(int binx, double content)
set content of bin (1-D)
const_iterator end(bool update=false) const
iterator find(det_id_type id)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
int moduleName() const
module id (index in z)
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > meClPosDiskmz
#define DEFINE_FWK_MODULE(type)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::LuminosityBlockNumber_t luminosityBlock() const
data_type const * const_iterator
virtual void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > srcToken_
std::vector< MonitorElement * > meZeroRocBPIX
MonitorElement * meZeroRocFPIX
const Plane & surface() const
The nominal surface of the GeomDet.
SiPixelClusterSource(const edm::ParameterSet &conf)
static std::string const input
uint32_t rawId() const
get the raw id
int bladeName() const
blade id
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
std::vector< MonitorElement * > meClPosDiskpz
bool isHalfModule() const
full or half module
bool setModuleFolder(const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
Set folder name for a module or plaquette.
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
MonitorElement * meClusBarrelProf
std::vector< MonitorElement * > meClPosLayer
MonitorElement * meClusFpixMProf
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
iterator end()
Return the off-the-end iterator.
int ladderName() const
ladder id (index in phi)
void setCurrentFolder(const std::string &fullpath)
T const * product() const
MonitorElement * book2D(Args &&...args)
void getrococcupancye(DetId detId, const edmNew::DetSetVector< SiPixelCluster > &clustColl, const TrackerTopology *const pTT, edm::ESHandle< TrackerGeometry > pDD, MonitorElement *meinput)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > digisrcToken_
MonitorElement * meClusFpixPProf
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
int layerName() const
layer id
T const * product() const
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const_iterator find(id_type i, bool update=false) const
double getBinContent(int binx) const
get content of bin (1-D)
int pannelName() const
pannel id
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
int diskName() const
disk id
iterator begin()
Return an iterator to the first DetSet.
std::map< uint32_t, SiPixelClusterModule * > thePixelStructure
volatile std::atomic< bool > shutdown_flag false
collection_type::const_iterator const_iterator
HalfCylinder halfCylinder() const
collection_type::const_iterator const_iterator
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * bigFpixClusterEventRate
std::string topFolderName_
const_iterator begin(bool update=false) const