CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DD4hep_ListGroups Class Reference
Inheritance diagram for DD4hep_ListGroups:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DD4hep_ListGroups (const edm::ParameterSet &iConfig)
 
 ~DD4hep_ListGroups () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
void fillColor ()
 
void fillGradient ()
 
void fillMaterialDifferences ()
 
std::vector< std::pair
< std::shared_ptr< TLine >
, std::shared_ptr< TText > > > 
overlayEtaReferences ()
 
void produceAndSaveSummaryPlot (const cms::DDCompactView &cpv)
 

Private Attributes

std::vector< unsigned int > m_color
 
std::map< std::string,
std::pair< float, float > > 
m_diff
 
std::vector< int > m_gradient
 
std::set< std::string_view > m_group_names
 
std::vector
< DD4hep_MaterialAccountingGroup * > 
m_groups
 
std::vector< TH2F * > m_plots
 
bool m_saveSummaryPlot
 
const edm::ESInputTag m_tag
 
std::map< std::string,
std::pair< float, float > > 
m_values
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 36 of file DD4hep_ListGroups.cc.

Constructor & Destructor Documentation

DD4hep_ListGroups::DD4hep_ListGroups ( const edm::ParameterSet iConfig)

Definition at line 64 of file DD4hep_ListGroups.cc.

References fillColor(), fillGradient(), fillMaterialDifferences(), edm::ParameterSet::getUntrackedParameter(), m_groups, m_plots, and m_saveSummaryPlot.

65  : m_tag(iConfig.getParameter<edm::ESInputTag>("DDDetector")) {
66  m_saveSummaryPlot = iConfig.getUntrackedParameter<bool>("SaveSummaryPlot");
67  m_plots.clear();
68  m_groups.clear();
69  TColor::InitializeColors();
70  fillColor();
72  fillGradient();
73 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< TH2F * > m_plots
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< DD4hep_MaterialAccountingGroup * > m_groups
const edm::ESInputTag m_tag
DD4hep_ListGroups::~DD4hep_ListGroups ( )
override

Definition at line 75 of file DD4hep_ListGroups.cc.

75 {}

Member Function Documentation

void DD4hep_ListGroups::analyze ( const edm::Event evt,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 363 of file DD4hep_ListGroups.cc.

References alcazmumu_cfi::filter, edm::EventSetup::get(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, m_group_names, m_saveSummaryPlot, m_tag, fed_dqm_sourceclient-live_cfg::path, produceAndSaveSummaryPlot(), cms::DDFilteredView::specpars(), and submitPVValidationJobs::t.

363  {
365  setup.get<IdealGeometryRecord>().get(m_tag, cpv);
366  cms::DDFilter filter("TrackingMaterialGroup", "");
367  cms::DDFilteredView fv(*cpv, filter);
368 
369  for (const auto &t : fv.specpars()) {
370  m_group_names.insert(t.second->strValue("TrackingMaterialGroup"));
371  }
372 
373  for (const auto &i : m_group_names) {
374  cms::DDFilter filter1("TrackingMaterialGroup", {i.data(), i.size()});
375  cms::DDFilteredView fv1(*cpv, filter1);
376  bool firstChild = fv1.firstChild();
377 
378  for (const auto &j : fv1.specpars()) {
379  for (const auto &k : j.second->paths) {
380  if (firstChild) {
381  std::vector<std::vector<cms::Node *>> children = fv1.children(k);
382  for (auto const &path : children) {
383  for (auto const &node : path) {
384  edm::LogVerbatim("TrackingMaterialGroup") << node->GetName() << "/";
385  }
386  cms::Translation trans = fv1.translation(path);
387  edm::LogVerbatim("TrackingMaterialGroup")
388  << "(" << trans.x() << ", " << trans.y() << ", " << trans.z() << ")\n";
389  }
390  }
391  }
392  }
393  }
394 
395  if (m_saveSummaryPlot)
397 }
Log< level::Info, true > LogVerbatim
void produceAndSaveSummaryPlot(const cms::DDCompactView &cpv)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> Translation
std::set< std::string_view > m_group_names
T get() const
Definition: EventSetup.h:88
const edm::ESInputTag m_tag
void DD4hep_ListGroups::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 43 of file DD4hep_ListGroups.cc.

43 {}
void DD4hep_ListGroups::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 399 of file DD4hep_ListGroups.cc.

399 {}
void DD4hep_ListGroups::fillColor ( void  )
private

Definition at line 193 of file DD4hep_ListGroups.cc.

References m_color.

Referenced by DD4hep_ListGroups().

193  {
194  // With the introduction of the support for PhaseI and PhaseII detectors it
195  // became quite difficult to maintain a list of colors that is in sync with
196  // the real number of grouping used in the different scenarios. We therefore
197  // define some reasonable set and loop over it in case the number of grouping
198  // is larger than the number of colors.
199 
200  m_color.emplace_back(kBlack); // unassigned
201 
202  m_color.emplace_back(kAzure); // PixelBarrelLayer0_Z0
203  m_color.emplace_back(kAzure - 1); // PixelBarrelLayer0_Z20
204  m_color.emplace_back(kAzure + 1); // Layer1_Z0
205  m_color.emplace_back(kAzure + 2); // Layer1_Z20
206 
207  m_color.emplace_back(kGreen); // EndCapDisk1_R0
208  m_color.emplace_back(kGreen + 2); // EndcapDisk1_R11
209  m_color.emplace_back(kGreen + 4); // EndcapDisk1_R7
210  m_color.emplace_back(kSpring + 9); // EndcapDisk2_R0
211  m_color.emplace_back(kSpring + 4); // EndcapDisk2_R7
212  m_color.emplace_back(kSpring); // EndcapDisk2_R7
213 
214  m_color.emplace_back(kRed); // TECDisk0_R20
215  m_color.emplace_back(kRed + 2); // TECDisk0_R40
216  m_color.emplace_back(kRed - 7); // TECDisk0_R50
217  m_color.emplace_back(kRed - 5); // TECDisk0_R60
218  m_color.emplace_back(kRed - 10); // TECDisk0_R90
219  m_color.emplace_back(kRed - 1); // TECDisk1_Inner
220  m_color.emplace_back(kRed - 2); // TECDisk1_Outer
221  m_color.emplace_back(kRed - 3); // TECDisk1_R20
222  m_color.emplace_back(kPink - 2); // TECDisk2_Inner
223  m_color.emplace_back(kPink - 3); // TECDisk2_Outer
224  m_color.emplace_back(kPink - 4); // TECDisk2_R20
225  m_color.emplace_back(kPink + 9); // TECDisk3_Inner
226  m_color.emplace_back(kPink + 8); // TECDisk3_Outer
227  m_color.emplace_back(kPink + 7); // TECDisk3
228  m_color.emplace_back(kMagenta - 2); // TECDisk4_Inner
229  m_color.emplace_back(kMagenta - 3); // TECDisk4_Outer
230  m_color.emplace_back(kMagenta - 4); // TECDisk4_R33
231  m_color.emplace_back(kMagenta - 5); // TECDisk5_Inner
232  m_color.emplace_back(kMagenta - 6); // TECDisk5_Outer
233  m_color.emplace_back(kMagenta - 7); // TECDisk5_R33
234  m_color.emplace_back(kRed); // TECDisk6
235  m_color.emplace_back(kMagenta - 9); // TECDisk7_R40
236  m_color.emplace_back(kViolet); // TECDisk8
237 
238  m_color.emplace_back(kOrange + 9); // TIBLayer0_Z0
239  m_color.emplace_back(kOrange + 7); // TIBLayer0_Z20
240  m_color.emplace_back(kOrange + 5); // TIBLayer0_Z40
241  m_color.emplace_back(kOrange - 2); // TIBLayer1_Z0
242  m_color.emplace_back(kOrange - 3); // TIBLayer1_Z30
243  m_color.emplace_back(kOrange - 6); // TIBLayer1_Z60
244  m_color.emplace_back(kOrange + 4); // TIBLayer2_Z0
245  m_color.emplace_back(kOrange - 7); // TIBLayer2_Z40
246  m_color.emplace_back(kOrange); // TIBLayer3_Z0
247  m_color.emplace_back(kOrange + 10); // TIBLayer3_Z50
248 
249  m_color.emplace_back(kViolet + 10); // TIDDisk1_R0
250  m_color.emplace_back(kViolet + 6); // TIDDisk1_R30
251  m_color.emplace_back(kViolet + 3); // TIDDisk1_R40
252  m_color.emplace_back(kViolet - 7); // TIDDisk2_R25
253  m_color.emplace_back(kViolet - 1); // TIDDisk2_R30
254  m_color.emplace_back(kViolet + 9); // TIDDisk2_R40
255  m_color.emplace_back(kViolet - 5); // TIDDisk3_R24
256  m_color.emplace_back(kViolet - 3); // TIDDisk3_R30
257  m_color.emplace_back(kViolet); // TIDDisk3_R40
258 
259  m_color.emplace_back(kAzure); // TOBLayer0_Z0
260  m_color.emplace_back(kAzure + 8); // TOBLayer0_Z20
261  m_color.emplace_back(kAzure + 2); // TOBLayer0_Z70
262  m_color.emplace_back(kAzure + 4); // TOBLayer0_Z80
263  m_color.emplace_back(kCyan + 1); // TOBLayer1_Z0
264  m_color.emplace_back(kCyan - 9); // TOBLayer1_Z20
265  m_color.emplace_back(kCyan + 3); // TOBLayer1_Z80
266  m_color.emplace_back(kCyan + 4); // TOBLayer1_Z90
267  m_color.emplace_back(kAzure); // TOBLayer2_Z0
268  m_color.emplace_back(kAzure + 8); // TOBLayer2_Z25
269  m_color.emplace_back(kAzure + 2); // TOBLayer2_Z80
270  m_color.emplace_back(kAzure + 5); // TOBLayer2_Z90
271  m_color.emplace_back(kCyan + 1); // TOBLayer3_Z0
272  m_color.emplace_back(kCyan - 9); // TOBLayer3_Z25
273  m_color.emplace_back(kCyan + 3); // TOBLayer3_Z80
274  m_color.emplace_back(kCyan + 4); // TOBLayer3_Z90
275  m_color.emplace_back(kAzure); // TOBLayer4_Z0
276  m_color.emplace_back(kAzure + 8); // TOBLayer4_Z25
277  m_color.emplace_back(kAzure + 2); // TOBLayer4_Z80
278  m_color.emplace_back(kAzure + 5); // TOBLayer4_Z90
279  m_color.emplace_back(kCyan + 1); // TOBLayer5_Z0
280  m_color.emplace_back(kCyan - 9); // TOBLayer5_Z25
281  m_color.emplace_back(kCyan + 3); // TOBLayer5_Z80
282  m_color.emplace_back(kCyan + 4); // TOBLayer5_Z90
283 }
std::vector< unsigned int > m_color
void DD4hep_ListGroups::fillGradient ( )
private

Definition at line 285 of file DD4hep_ListGroups.cc.

References b1, b2, hitfit::delta_r(), diffTwoXMLs::g1, diffTwoXMLs::g2, mps_fire::i, cuy::ii, m_gradient, diffTwoXMLs::r1, diffTwoXMLs::r2, and relval_machine::steps.

Referenced by DD4hep_ListGroups().

285  {
286  m_gradient.reserve(200);
287  unsigned int steps = 100;
288  // if no index was given, find the highest used one and start from that plus one
289  unsigned int index = ((TObjArray *)gROOT->GetListOfColors())->GetLast() + 1;
290 
291  float r1, g1, b1, r2, g2, b2;
292  static_cast<TColor *>(gROOT->GetListOfColors()->At(kBlue + 1))->GetRGB(r1, g1, b1);
293  static_cast<TColor *>(gROOT->GetListOfColors()->At(kAzure + 10))->GetRGB(r2, g2, b2);
294  float delta_r = (r2 - r1) / (steps - 1);
295  float delta_g = (g2 - g1) / (steps - 1);
296  float delta_b = (b2 - b1) / (steps - 1);
297 
298  m_gradient.emplace_back(kBlue + 4); // Underflow lowest bin
299  unsigned int ii = 0;
300  for (unsigned int i = 0; i < steps; ++i, ++ii) {
301  new TColor(static_cast<Int_t>(index + ii), r1 + delta_r * i, g1 + delta_g * i, b1 + delta_b * i);
302  m_gradient.emplace_back(index + ii);
303  }
304 
305  m_gradient.emplace_back(kWhite); // 0 level perfectly white
306 
307  static_cast<TColor *>(gROOT->GetListOfColors()->At(kOrange))->GetRGB(r1, g1, b1);
308  static_cast<TColor *>(gROOT->GetListOfColors()->At(kOrange + 7))->GetRGB(r2, g2, b2);
309  delta_r = (r2 - r1) / (steps - 1);
310  delta_g = (g2 - g1) / (steps - 1);
311  delta_b = (b2 - b1) / (steps - 1);
312  for (unsigned int i = 0; i < steps; ++i, ++ii) {
313  new TColor(static_cast<Int_t>(index + ii), r1 + delta_r * i, g1 + delta_g * i, b1 + delta_b * i);
314  m_gradient.emplace_back(index + ii);
315  }
316  m_gradient.emplace_back(kRed); // Overflow highest bin
317 }
int ii
Definition: cuy.py:589
std::vector< int > m_gradient
double delta_r(const Fourvec &a, const Fourvec &b)
Find the distance between two four-vectors in the two-dimensional space .
Definition: fourvec.cc:238
static constexpr float b2
static constexpr float b1
void DD4hep_ListGroups::fillMaterialDifferences ( )
inlineprivate

Definition at line 6 of file DD4hep_ListGroupsMaterialDifference.h.

Referenced by DD4hep_ListGroups().

6 {}
std::vector< std::pair< std::shared_ptr< TLine >, std::shared_ptr< TText > > > DD4hep_ListGroups::overlayEtaReferences ( )
private

Definition at line 319 of file DD4hep_ListGroups.cc.

References HLT_FULL_cff::deltaR, PVValHelper::eta, funct::exp(), groupFilesInBlocks::lines, funct::tan(), and theta().

Referenced by produceAndSaveSummaryPlot().

319  {
320  std::vector<std::pair<std::shared_ptr<TLine>, std::shared_ptr<TText>>> lines;
321 
322  lines.reserve(40);
323  std::pair<float, float> deltaZ(293, 298);
324  std::pair<float, float> deltaR(115, 118);
325  float text_size = 0.033;
326 
327  for (float eta = 0.; eta <= 3.8; eta += 0.2) {
328  float theta = 2. * atan(exp(-eta));
329  if (eta >= 1.8) {
330  lines.emplace_back(
331  std::make_shared<TLine>(deltaZ.first, deltaZ.first * tan(theta), deltaZ.second, deltaZ.second * tan(theta)),
332  std::make_shared<TText>(deltaZ.first, deltaZ.first * tan(theta), fmt::sprintf("%2.1f", eta).c_str()));
333  lines.back().second->SetTextFont(42);
334  lines.back().second->SetTextSize(text_size);
335  lines.back().second->SetTextAlign(33);
336  lines.emplace_back(
337  std::make_shared<TLine>(-deltaZ.first, deltaZ.first * tan(theta), -deltaZ.second, deltaZ.second * tan(theta)),
338  std::make_shared<TText>(-deltaZ.first, deltaZ.first * tan(theta), fmt::sprintf("-%2.1f", eta).c_str()));
339  lines.back().second->SetTextFont(42);
340  lines.back().second->SetTextSize(text_size);
341  lines.back().second->SetTextAlign(13);
342  } else {
343  lines.emplace_back(
344  std::make_shared<TLine>(deltaR.first / tan(theta), deltaR.first, deltaR.second / tan(theta), deltaR.second),
345  std::make_shared<TText>(deltaR.first / tan(theta), deltaR.first, fmt::sprintf("%2.1f", eta).c_str()));
346  lines.back().second->SetTextFont(42);
347  lines.back().second->SetTextSize(text_size);
348  lines.back().second->SetTextAlign(23);
349  if (eta != 0) {
350  lines.emplace_back(
351  std::make_shared<TLine>(
352  -deltaR.first / tan(theta), deltaR.first, -deltaR.second / tan(theta), deltaR.second),
353  std::make_shared<TText>(-deltaR.first / tan(theta), deltaR.first, fmt::sprintf("-%2.1f", eta).c_str()));
354  lines.back().second->SetTextFont(42);
355  lines.back().second->SetTextSize(text_size);
356  lines.back().second->SetTextAlign(23);
357  }
358  }
359  }
360  return lines;
361 }
Geom::Theta< T > theta() const
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
void DD4hep_ListGroups::produceAndSaveSummaryPlot ( const cms::DDCompactView cpv)
private

Definition at line 77 of file DD4hep_ListGroups.cc.

References svgfig::canvas(), g, geometryCSVtoXML::line, groupFilesInBlocks::lines, m_color, m_diff, m_gradient, m_group_names, m_groups, m_plots, m_values, dqmiodumpmetadata::n, overlayEtaReferences(), and pileupReCalc_HLTpaths::scale.

Referenced by analyze().

77  {
78  const double scale = 10.;
79 
80  static int markerStyles[10] = {kFullCircle,
81  kFullSquare,
82  kFullTriangleUp,
83  kFullTriangleDown,
84  kOpenCircle,
85  kOpenSquare,
86  kOpenTriangleUp,
87  kOpenDiamond,
88  kOpenCross,
89  kFullStar};
90 
91  for (auto n : m_group_names) {
92  m_groups.emplace_back(new DD4hep_MaterialAccountingGroup(n.data(), cpv));
93  }
94 
95  auto canvas = std::make_unique<TCanvas>(
96  "Grouping_rz", "Grouping - RZ view", (int)(600 * scale * 1.25), (int)(120 * scale * 1.50));
97  canvas->GetFrame()->SetFillColor(kWhite);
98  gStyle->SetOptStat(0);
99 
100  unsigned int color_index = 1;
101 
102  auto leg = std::make_unique<TLegend>(0.1, 0.1, 0.23, 0.34);
103  leg->SetHeader("Tracker Material Grouping");
104  leg->SetTextFont(42);
105  leg->SetTextSize(0.008);
106  leg->SetNColumns(3);
107  auto radlen = std::make_unique<TProfile2D>("OverallRadLen", "OverallRadLen", 600., -300., 300, 120., 0., 120.);
108  auto eneloss =
109  std::make_unique<TProfile2D>("OverallEnergyLoss", "OverallEnergyLoss", 600., -300., 300, 120., 0., 120.);
110  auto radlen_diff = std::make_unique<TProfile2D>(
111  "OverallDifferencesRadLen", "OverallDifferencesRadLen", 600., -300., 300, 120., 0., 120.);
112  auto eneloss_diff = std::make_unique<TProfile2D>(
113  "OverallDifferencesEnergyLoss", "OverallDifferencesEnergyLoss", 600., -300., 300, 120., 0., 120.);
114 
115  for (auto g : m_groups) {
116  m_plots.push_back(
117  new TH2F(g->name().c_str(), g->name().c_str(), 6000., -300., 300, 1200., 0., 120.)); // 10x10 points per cm2
118  TH2F &current = *m_plots.back();
119  current.SetMarkerColor(m_color[color_index]);
120  current.SetMarkerStyle(markerStyles[color_index % 10]);
121  current.SetMarkerSize(0.8);
122  current.SetLineWidth(1);
123  for (const auto &element : g->elements()) {
124  current.Fill(element.z(), element.perp());
125  radlen->Fill(element.z(), element.perp(), m_values[g->name()].first);
126  eneloss->Fill(element.z(), element.perp(), m_values[g->name()].second);
127  radlen_diff->Fill(element.z(), element.perp(), m_diff[g->name()].first);
128  eneloss_diff->Fill(element.z(), element.perp(), m_diff[g->name()].second);
129  }
130 
131  if (color_index == 1)
132  current.Draw();
133  else
134  current.Draw("SAME");
135 
136  leg->AddEntry(&current, g->name().c_str(), "lp")->SetTextColor(m_color[color_index]);
137  color_index++;
138 
139  color_index = color_index % m_color.size();
140  }
141  leg->Draw();
142  canvas->SaveAs("Grouping.png");
143 
144  std::vector<std::pair<std::shared_ptr<TLine>, std::shared_ptr<TText>>> lines = overlayEtaReferences();
145 
146  canvas->Clear();
147  radlen->SetMinimum(0);
148  radlen->SetMaximum(0.25);
149  radlen->Draw("COLZ");
150  for (const auto &line : lines) {
151  line.first->SetLineWidth(5);
152  line.first->Draw();
153  line.second->Draw();
154  }
155  canvas->SaveAs("RadLenValues.png");
156 
157  canvas->Clear();
158  eneloss->SetMinimum(0.00001);
159  eneloss->SetMaximum(0.0005);
160  eneloss->Draw("COLZ");
161  for (const auto &line : lines) {
162  line.first->SetLineWidth(5);
163  line.first->Draw();
164  line.second->Draw();
165  }
166  canvas->SaveAs("EnergyLossValues.png");
167 
168  canvas->Clear();
169  gStyle->SetPalette(m_gradient.size(), &m_gradient.front());
170  gStyle->SetNumberContours(m_gradient.size());
171  radlen_diff->SetMinimum(-100);
172  radlen_diff->SetMaximum(100);
173  radlen_diff->Draw("COLZ");
174  for (const auto &line : lines) {
175  line.first->SetLineWidth(5);
176  line.first->Draw();
177  line.second->Draw();
178  }
179  canvas->SaveAs("RadLenChanges.png");
180 
181  canvas->Clear();
182  eneloss_diff->SetMinimum(-100);
183  eneloss_diff->SetMaximum(100);
184  eneloss_diff->Draw("COLZ");
185  for (const auto &line : lines) {
186  line.first->SetLineWidth(5);
187  line.first->Draw();
188  line.second->Draw();
189  }
190  canvas->SaveAs("EnergyLossChanges.png");
191 }
std::vector< unsigned int > m_color
std::vector< int > m_gradient
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
def canvas
Definition: svgfig.py:482
std::map< std::string, std::pair< float, float > > m_diff
std::vector< TH2F * > m_plots
std::map< std::string, std::pair< float, float > > m_values
std::set< std::string_view > m_group_names
std::vector< DD4hep_MaterialAccountingGroup * > m_groups
std::vector< std::pair< std::shared_ptr< TLine >, std::shared_ptr< TText > > > overlayEtaReferences()

Member Data Documentation

std::vector<unsigned int> DD4hep_ListGroups::m_color
private

Definition at line 50 of file DD4hep_ListGroups.cc.

Referenced by fillColor(), and produceAndSaveSummaryPlot().

std::map<std::string, std::pair<float, float> > DD4hep_ListGroups::m_diff
private

Definition at line 58 of file DD4hep_ListGroups.cc.

Referenced by produceAndSaveSummaryPlot().

std::vector<int> DD4hep_ListGroups::m_gradient
private

Definition at line 51 of file DD4hep_ListGroups.cc.

Referenced by fillGradient(), and produceAndSaveSummaryPlot().

std::set<std::string_view> DD4hep_ListGroups::m_group_names
private

Definition at line 49 of file DD4hep_ListGroups.cc.

Referenced by analyze(), and produceAndSaveSummaryPlot().

std::vector<DD4hep_MaterialAccountingGroup *> DD4hep_ListGroups::m_groups
private

Definition at line 52 of file DD4hep_ListGroups.cc.

Referenced by DD4hep_ListGroups(), and produceAndSaveSummaryPlot().

std::vector<TH2F *> DD4hep_ListGroups::m_plots
private

Definition at line 48 of file DD4hep_ListGroups.cc.

Referenced by DD4hep_ListGroups(), and produceAndSaveSummaryPlot().

bool DD4hep_ListGroups::m_saveSummaryPlot
private

Definition at line 47 of file DD4hep_ListGroups.cc.

Referenced by analyze(), and DD4hep_ListGroups().

const edm::ESInputTag DD4hep_ListGroups::m_tag
private

Definition at line 45 of file DD4hep_ListGroups.cc.

Referenced by analyze().

std::map<std::string, std::pair<float, float> > DD4hep_ListGroups::m_values
private

Definition at line 59 of file DD4hep_ListGroups.cc.

Referenced by produceAndSaveSummaryPlot().