127 iConfig.getParameter<std::vector<edm::InputTag> >(
"occupancyMaps"),
128 [
this](
edm::InputTag const&
tag) { return consumes<std::map<unsigned int, int> >(tag); })),
130 "file",
edm::FileInPath(
"CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt"))),
131 m_tkGeomToken(esConsumes<edm::Transition::EndRun>()),
132 m_stripQualityToken(esConsumes<edm::Transition::EndRun>()),
133 m_pixelQualityToken(esConsumes<edm::Transition::EndRun>()),
134 m_rhm(consumesCollector()),
138 m_avemultiplicity = m_rhm.makeTProfile(
"avemult",
"Average Multiplicty", 6000, 0.5, 6000.5);
139 m_aveoccupancy = m_rhm.makeTProfile(
"aveoccu",
"Average Occupancy", 6000, 0.5, 6000.5);
141 m_nchannels_ideal = m_rhm.makeTH1F(
"nchannels_ideal",
"Number of channels (ideal)", 6000, 0.5, 6000.5);
142 m_nchannels_real = m_rhm.makeTH1F(
"nchannels_real",
"Number of channels (real)", 6000, 0.5, 6000.5);
144 m_averadius = m_rhm.makeTProfile(
"averadius",
"Average Module Radius", 6000, 0.5, 6000.5);
145 m_avez = m_rhm.makeTProfile(
"avez",
"Average Module z coordinate", 6000, 0.5, 6000.5);
146 m_avex = m_rhm.makeTProfile(
"avex",
"Average Module x coordinate", 6000, 0.5, 6000.5);
147 m_avey = m_rhm.makeTProfile(
"avey",
"Average Module y coordinate", 6000, 0.5, 6000.5);
149 m_zavedr = m_rhm.makeTProfile(
"zavedr",
"Average z unit vector dr", 6000, 0.5, 6000.5);
150 m_zavedz = m_rhm.makeTProfile(
"zavedz",
"Average z unit vector dz", 6000, 0.5, 6000.5);
151 m_zavedrphi = m_rhm.makeTProfile(
"zavedrphi",
"Average z unit vector drphi", 6000, 0.5, 6000.5);
152 m_xavedr = m_rhm.makeTProfile(
"xavedr",
"Average x unit vector dr", 6000, 0.5, 6000.5);
153 m_xavedz = m_rhm.makeTProfile(
"xavedz",
"Average x unit vctor dz", 6000, 0.5, 6000.5);
154 m_xavedrphi = m_rhm.makeTProfile(
"xavedrphi",
"Average Module x unit vector drphi", 6000, 0.5, 6000.5);
155 m_yavedr = m_rhm.makeTProfile(
"yavedr",
"Average y unit vector dr", 6000, 0.5, 6000.5);
156 m_yavedz = m_rhm.makeTProfile(
"yavedz",
"Average y unit vector dz", 6000, 0.5, 6000.5);
157 m_yavedrphi = m_rhm.makeTProfile(
"yavedrphi",
"Average y unit vector drphi", 6000, 0.5, 6000.5);
159 std::vector<edm::ParameterSet> wantedsubdets_ps =
160 iConfig.getParameter<std::vector<edm::ParameterSet> >(
"wantedSubDets");
162 for (std::vector<edm::ParameterSet>::const_iterator wsdps = wantedsubdets_ps.begin(); wsdps != wantedsubdets_ps.end();
164 unsigned int detsel = wsdps->getParameter<
unsigned int>(
"detSelection");
165 std::vector<std::string> selstr = wsdps->getUntrackedParameter<std::vector<std::string> >(
"selection");
188 iEvent.getByToken(*mapToken, mults);
190 for (std::map<unsigned int, int>::const_iterator
mult = mults->begin();
mult != mults->end();
mult++) {
192 (*m_avemultiplicity)->Fill(
mult->first,
mult->second);
201 iEvent.getByToken(*mapToken, occus);
203 for (std::map<unsigned int, int>::const_iterator occu = occus->begin(); occu != occus->end(); occu++) {
205 (*m_aveoccupancy)->Fill(occu->first, occu->second);
219 LogDebug(
"IsThereTest") <<
"Test of TrackerGeometry::isThere";
241 for (TrackingGeometry::DetIdContainer::const_iterator det = detunits.begin(); det != detunits.end(); ++det) {
248 GlobalPoint zpos = trkgeo.idToDet(*det)->toGlobal(locz);
249 GlobalPoint xpos = trkgeo.idToDet(*det)->toGlobal(locx);
250 GlobalPoint ypos = trkgeo.idToDet(*det)->toGlobal(locy);
256 double dzdr = posvect.
perp() > 0 ? (
dz.x() * posvect.
x() +
dz.y() * posvect.
y()) / posvect.
perp() : 0.;
257 double dxdr = posvect.
perp() > 0 ? (
dx.x() * posvect.
x() +
dx.y() * posvect.
y()) / posvect.
perp() : 0.;
258 double dydr = posvect.
perp() > 0 ? (
dy.x() * posvect.
x() +
dy.y() * posvect.
y()) / posvect.
perp() : 0.;
260 double dzdrphi = posvect.
perp() > 0 ? (
dz.y() * posvect.
x() -
dz.x() * posvect.
y()) / posvect.
perp() : 0.;
261 double dxdrphi = posvect.
perp() > 0 ? (
dx.y() * posvect.
x() -
dx.x() * posvect.
y()) / posvect.
perp() : 0.;
262 double dydrphi = posvect.
perp() > 0 ? (
dy.y() * posvect.
x() -
dy.x() * posvect.
y()) / posvect.
perp() : 0.;
264 for (std::map<unsigned int, DetIdSelector>::const_iterator
sel =
m_wantedsubdets.begin();
267 if (
sel->second.isSelected(*det)) {
279 (*m_zavedr)->Fill(
sel->first, dzdr);
281 (*m_zavedz)->Fill(
sel->first,
dz.z());
283 (*m_zavedrphi)->Fill(
sel->first, dzdrphi);
285 (*m_xavedr)->Fill(
sel->first, dxdr);
287 (*m_xavedz)->Fill(
sel->first,
dx.z());
289 (*m_xavedrphi)->Fill(
sel->first, dxdrphi);
291 (*m_yavedr)->Fill(
sel->first, dydr);
293 (*m_yavedz)->Fill(
sel->first,
dy.z());
295 (*m_yavedrphi)->Fill(
sel->first, dydrphi);
305 (*m_nchannels_ideal)->Reset();
307 (*m_nchannels_real)->Reset();
311 for (
const auto det : trkgeo.detUnits()) {
313 if (stripDet !=
nullptr) {
324 for (std::map<unsigned int, DetIdSelector>::const_iterator
sel =
m_wantedsubdets.begin();
327 if (
sel->second.isSelected(
detid)) {
329 (*m_nchannels_ideal)->Fill(
sel->first, nchannideal);
331 (*m_nchannels_real)->Fill(
sel->first, nchannreal);
341 const std::vector<uint32_t>& pxldetids = pxlreader.
getAllDetIds();
343 for (std::vector<uint32_t>::const_iterator
detid = pxldetids.begin();
detid != pxldetids.end(); ++
detid) {
344 int nchannideal = pxlreader.getDetUnitDimensions(*detid).first * pxlreader.getDetUnitDimensions(*detid).second;
346 if (!pxlquality.IsModuleBad(*
detid)) {
347 nchannreal = pxlreader.getDetUnitDimensions(*detid).first * pxlreader.getDetUnitDimensions(*detid).second;
356 for (std::map<unsigned int, DetIdSelector>::const_iterator
sel =
m_wantedsubdets.begin();
359 if (
sel->second.isSelected(*
detid)) {
361 (*m_nchannels_ideal)->Fill(
sel->first, nchannideal);
363 (*m_nchannels_real)->Fill(
sel->first, nchannreal);
OccupancyPlots(const edm::ParameterSet &)
virtual int nstrips() const =0
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
TH1F ** m_nchannels_ideal
void beginRun(const edm::Run &, const edm::EventSetup &) override
std::map< unsigned int, DetIdSelector > m_wantedsubdets
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
RunHistogramManager m_rhm
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > m_multiplicityMapTokens
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_tkGeomToken
TProfile ** m_aveoccupancy
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
#define DEFINE_FWK_MODULE(type)
DetId geographicalId() const
The label of this GeomDet.
Log< level::Info, false > LogInfo
TProfile ** m_avemultiplicity
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_stripQualityToken
void beginRun(const edm::Run &iRun)
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > m_occupancyMapTokens
std::vector< DetId > DetIdContainer
~OccupancyPlots() override
const std::vector< uint32_t > & getAllDetIds() const
static int position[264][3]
const std::string & fullPath() const
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > m_pixelQualityToken
void endRun(const edm::Run &, const edm::EventSetup &) override
void analyze(const edm::Event &, const edm::EventSetup &) override