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 =
nullptr;
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; }
163 if (
i==4) { ybins = 130; ymin = -32.5; ymax = 32.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();
286 LogInfo (
"PixelDQM") <<
" SiPixelClusterSource::buildStructure" ;
294 LogVerbatim (
"PixelDQM") <<
" *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
295 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->
dets().size() <<
" detectors"<<std::endl;
296 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->
detTypes().size() <<
" types"<<std::endl;
298 for(TrackerGeometry::DetContainer::const_iterator it = pDD->
dets().begin(); it != pDD->
dets().end(); it++){
300 if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=
nullptr){
302 DetId detId = (*it)->geographicalId();
311 uint32_t
id = detId();
315 LogDebug (
"PixelDQM") <<
" ---> Adding Barrel Module " << detId.
rawId() << endl;
320 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
327 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
328 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
329 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
330 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
331 char smodule[80];sprintf(smodule,
"Module_%i",module);
334 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
335 side_str.find(
"HalfCylinder_2")!=string::npos||
336 side_str.find(
"HalfCylinder_4")!=string::npos||
337 disk_str.find(
"Disk_2")!=string::npos;
340 if(
isPIB && mask)
continue;
355 char title[256]; snprintf(title, 256,
"Rate of events with >%i FPIX clusters;LumiSection;Rate of large FPIX events per LS [Hz]",
bigEventSize);
359 std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
372 <<
"[SiPixelClusterSource::bookMEs] Creation of DQM folder failed";
379 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
386 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LAYER-FOLDER\n";
393 LogDebug (
"PixelDQM") <<
"PROBLEM WITH PHI-FOLDER\n";
400 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
407 LogDebug (
"PixelDQM") <<
"PROBLEM WITH DISK-FOLDER\n";
414 LogDebug (
"PixelDQM") <<
"PROBLEM WITH RING-FOLDER\n";
421 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BARREL-FOLDER\n";
430 std::vector<MonitorElement*>
const & meinput) {
433 if( ipxsearch != diginp.
end() ) {
437 for (pxdi = ipxsearch->
begin(); pxdi != ipxsearch->
end(); pxdi++) {
446 if (DBshell==1 || DBshell==2) { DBmodule = -DBmodule; }
447 if (DBshell==1 || DBshell==3) { DBladder = -DBladder; }
449 int col = pxdi->column();
450 int row = pxdi->row();
452 float modsign = (
float)DBmodule/(
abs((
float)DBmodule));
453 float ladsign = (
float)DBladder/(
abs((
float)DBladder));
454 float rocx = ((
float)col/(52.*8.))*modsign + ((
float)DBmodule-(modsign)*0.5);
455 float rocy = ((
float)row/(80.*2.))*ladsign + ((
float)DBladder-(ladsign)*0.5);
459 if ( (DBladder%2==0) && (!isHalfModule) ) { flip =
true; }
460 if ((flip) && (DBladder>0)) {
461 if ( ( ((
float)DBladder-(ladsign)*0.5)<=rocy) && (rocy<(
float)DBladder)) { rocy = rocy + ladsign*0.5; }
462 else if ( ( ((
float)DBladder)<=rocy) && (rocy<((
float)DBladder+(ladsign)*0.5)) ) { rocy = rocy - ladsign*0.5; }
466 if (modsign<0) { rocx = rocx -0.0001; }
467 if (ladsign<0) { rocy = rocy -0.0001; }
else { rocy = rocy +0.0001; }
468 if (
abs(DBladder)==1) { rocy = rocy + ladsign*0.5; }
469 meinput[DBlayer-1]->Fill(rocx,rocy);
479 if( ipxsearch != clustColl.
end() ) {
483 for (pxclust = ipxsearch->
begin(); pxclust != ipxsearch->
end(); pxclust++) {
491 float xclust = pxclust->x();
492 float yclust = pxclust->y();
493 float z = clustgp.
z();
501 if ( (pxfside==1) || (pxfside==3) ) { pxfblade = -1.*pxfblade; }
503 if (z<0.) { pxfdisk = -1.*pxfdisk; }
505 int clu_sdpx = ((pxfdisk>0) ? 1 : -1) * (2 * (
abs(pxfdisk) - 1) + pxfpanel);
506 int binselx = (pxfpanel==1&&(pxfmodule==1||pxfmodule==4)) ? (pxfmodule==1) : ((pxfpanel==1&& xclust<80.0)||(pxfpanel==2&&xclust>=80.0));
507 int nperpan = 2 * pxfmodule + pxfpanel - 1 + binselx;
508 int clu_roc_binx = ((pxfdisk>0) ? nperpan : 9 - nperpan) + (clu_sdpx + 4) * 8 - 2 * ((
abs(pxfdisk)==1) ? pxfdisk : 0);
510 int clu_roc_biny = -99.;
511 int nrocly = pxfmodule + pxfpanel;
512 for (
int i=0;
i<nrocly;
i++) {
513 int j = (pxfdisk<0) ?
i : nrocly - 1 -
i;
514 if (yclust>=(j*52.0)&& yclust<((j+1)*52.0))
515 clu_roc_biny = 6 - nrocly + 2 *
i + ((pxfblade>0) ? pxfblade-1 : pxfblade + 12)*12 + 1;
517 if (pxfblade>0) { clu_roc_biny = clu_roc_biny+144; }
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)
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)
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
constexpr uint32_t rawId() const
get the raw id
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
void getrococcupancy(DetId detId, const edm::DetSetVector< PixelDigi > &diginp, const TrackerTopology *const tTopo, std::vector< MonitorElement * > const &meinput)
data_type const * const_iterator
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
int bladeName() const
blade id
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
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.
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
MonitorElement * meClusBarrelProf
std::vector< MonitorElement * > meClPosLayer
MonitorElement * meClusFpixMProf
~SiPixelClusterSource() override
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
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
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)
T const * product() const
MonitorElement * bigFpixClusterEventRate
std::string topFolderName_
const_iterator begin(bool update=false) const