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;
84 LogInfo (
"PixelDQM") <<
"SiPixelClusterSource::~SiPixelClusterSource: Destructor"<<endl;
86 std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
88 delete struct_iter->second;
89 struct_iter->second = 0;
96 LogInfo (
"PixelDQM") <<
" SiPixelClusterSource::beginJob - Initialisation ... " << std::endl;
102 LogInfo (
"PixelDQM") <<
"Smiley (Cluster sizeY vs. Cluster eta) is " <<
smileyOn <<
"\n";
121 std::stringstream ss1, ss2;
124 ss1.str(
std::string()); ss1 <<
"position_siPixelClusters_Layer_" <<
i;
125 ss2.str(
std::string()); ss2 <<
"Clusters Layer" << i <<
";Global Z (cm);Global #phi";
126 meClPosLayer.push_back(iBooker.
book2D(ss1.str(),ss2.str(),200,-30.,30.,128,-3.2,3.2));
130 ss1.str(
std::string()); ss1 <<
"position_siPixelClusters_pz_Disk_" <<
i;
131 ss2.str(
std::string()); ss2 <<
"Clusters +Z Disk" << i <<
";Global X (cm);Global Y (cm)";
133 ss1.str(
std::string()); ss1 <<
"position_siPixelClusters_mz_Disk_" <<
i;
134 ss2.str(
std::string()); ss2 <<
"Clusters -Z Disk" << i <<
";Global X (cm);Global Y (cm)";
140 ss1.str(
std::string()); ss1 <<
"totalNumberOfClustersProfile_siPixelClusters_Barrel";
141 ss2.str(
std::string()); ss2 <<
"Total number of barrel clusters profile;Lumisection;";
147 ss1.str(
std::string()); ss1 <<
"totalNumberOfClustersProfile_siPixelClusters_FPIX+";
148 ss2.str(
std::string()); ss2 <<
"Total number of FPIX+ clusters profile;Lumisection;";
152 ss1.str(
std::string()); ss1 <<
"totalNumberOfClustersProfile_siPixelClusters_FPIX-";
153 ss2.str(
std::string()); ss2 <<
"Total number of FPIX- clusters profile;Lumisection;";
159 int ybins = -1;
float ymin = 0.;
float ymax = 0.;
160 if (
i==1) { ybins = 42; ymin = -10.5; ymax = 10.5; }
161 if (
i==2) { ybins = 66; ymin = -16.5; ymax = 16.5; }
162 if (
i==3) { ybins = 90; ymin = -22.5; ymax = 22.5; }
164 ss2.str(
std::string()); ss2 <<
"Pixel Barrel Occupancy, ROC level (Online): Layer " <<
i;
171 meZeroRocFPIX = iBooker.
book2D(
"ROC_endcap_occupancy",
"Pixel Endcap Occupancy, ROC level (Online)",72, -4.5, 4.5,288,-12.5,12.5);
207 auto const & clustColl = *(input.
product());
223 int nEventFpixClusters = 0;
225 int nEventsBarrel = 0;
226 int nEventsFPIXm = 0;
227 int nEventsFPIXp = 0;
230 std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
233 int numberOfFpixClusters = (*struct_iter).second->fill(*input, tracker,
234 &nEventsBarrel, &nEventsFPIXp, &nEventsFPIXm,
241 nEventFpixClusters = nEventFpixClusters + numberOfFpixClusters;
259 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
261 DetId detId = (*it)->geographicalId();
285 LogInfo (
"PixelDQM") <<
" SiPixelClusterSource::buildStructure" ;
293 LogVerbatim (
"PixelDQM") <<
" *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
294 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->dets().size() <<
" detectors"<<std::endl;
295 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->detTypes().size() <<
" types"<<std::endl;
297 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
299 if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=0){
301 DetId detId = (*it)->geographicalId();
302 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
310 uint32_t
id = detId();
314 LogDebug (
"PixelDQM") <<
" ---> Adding Barrel Module " << detId.
rawId() << endl;
319 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
326 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
327 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
328 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
329 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
330 char smodule[80];sprintf(smodule,
"Module_%i",module);
333 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
334 side_str.find(
"HalfCylinder_2")!=string::npos||
335 side_str.find(
"HalfCylinder_4")!=string::npos||
336 disk_str.find(
"Disk_2")!=string::npos;
339 if(
isPIB && mask)
continue;
354 char title[256]; snprintf(title, 256,
"Rate of events with >%i FPIX clusters;LumiSection;Rate of large FPIX events per LS [Hz]",
bigEventSize);
358 std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
371 <<
"[SiPixelClusterSource::bookMEs] Creation of DQM folder failed";
378 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
385 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LAYER-FOLDER\n";
392 LogDebug (
"PixelDQM") <<
"PROBLEM WITH PHI-FOLDER\n";
399 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
406 LogDebug (
"PixelDQM") <<
"PROBLEM WITH DISK-FOLDER\n";
413 LogDebug (
"PixelDQM") <<
"PROBLEM WITH RING-FOLDER\n";
420 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BARREL-FOLDER\n";
429 std::vector<MonitorElement*> meinput) {
432 if( ipxsearch != diginp.
end() ) {
436 for (pxdi = ipxsearch->
begin(); pxdi != ipxsearch->
end(); pxdi++) {
445 if (DBshell==1 || DBshell==2) { DBmodule = -DBmodule; }
446 if (DBshell==1 || DBshell==3) { DBladder = -DBladder; }
448 int col = pxdi->column();
449 int row = pxdi->row();
451 float modsign = (float)DBmodule/(
abs((
float)DBmodule));
452 float ladsign = (float)DBladder/(
abs((
float)DBladder));
453 float rocx = ((float)col/(52.*8.))*modsign + ((
float)DBmodule-(modsign)*0.5);
454 float rocy = ((float)row/(80.*2.))*ladsign + ((
float)DBladder-(ladsign)*0.5);
458 if ( (DBladder%2==0) && (!isHalfModule) ) { flip =
true; }
459 if ((flip) && (DBladder>0)) {
460 if ( ( ((
float)DBladder-(ladsign)*0.5)<=rocy) && (rocy<(
float)DBladder)) { rocy = rocy + ladsign*0.5; }
461 else if ( ( ((
float)DBladder)<=rocy) && (rocy<((float)DBladder+(ladsign)*0.5)) ) { rocy = rocy - ladsign*0.5; }
465 if (modsign<0) { rocx = rocx -0.0001; }
466 if (ladsign<0) { rocy = rocy -0.0001; }
else { rocy = rocy +0.0001; }
467 if (
abs(DBladder)==1) { rocy = rocy + ladsign*0.5; }
468 meinput[DBlayer-1]->Fill(rocx,rocy);
478 if( ipxsearch != clustColl.
end() ) {
482 for (pxclust = ipxsearch->
begin(); pxclust != ipxsearch->
end(); pxclust++) {
484 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
490 float xclust = pxclust->x();
491 float yclust = pxclust->y();
492 float z = clustgp.
z();
500 if ( (pxfside==1) || (pxfside==3) ) { pxfblade = -1.*pxfblade; }
502 if (z<0.) { pxfdisk = -1.*pxfdisk; }
504 int clu_sdpx = ((pxfdisk>0) ? 1 : -1) * (2 * (
abs(pxfdisk) - 1) + pxfpanel);
505 int binselx = (pxfpanel==1&&(pxfmodule==1||pxfmodule==4)) ? (pxfmodule==1) : ((pxfpanel==1&& xclust<80.0)||(pxfpanel==2&&xclust>=80.0));
506 int nperpan = 2 * pxfmodule + pxfpanel - 1 + binselx;
507 int clu_roc_binx = ((pxfdisk>0) ? nperpan : 9 - nperpan) + (clu_sdpx + 4) * 8 - 2 * ((
abs(pxfdisk)==1) ? pxfdisk : 0);
509 int clu_roc_biny = -99.;
510 int nrocly = pxfmodule + pxfpanel;
511 for (
int i=0;
i<nrocly;
i++) {
512 int j = (pxfdisk<0) ?
i : nrocly - 1 -
i;
513 if (yclust>=(j*52.0)&& yclust<((j+1)*52.0))
514 clu_roc_biny = 6 - nrocly + 2 *
i + ((pxfblade>0) ? pxfblade-1 : pxfblade + 12)*12 + 1;
516 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