CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ListGroups Class Reference
Inheritance diagram for ListGroups:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 ListGroups (const edm::ParameterSet &)
 
 ~ListGroups () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
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 edm::EventSetup &)
 

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 > m_group_names
 
std::vector< MaterialAccountingGroup * > m_groups
 
std::vector< TH2F * > m_plots
 
bool m_saveSummaryPlot
 
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)
 
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<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)
 

Detailed Description

Definition at line 77 of file ListGroups.cc.

Constructor & Destructor Documentation

ListGroups::ListGroups ( const edm::ParameterSet iPSet)

Definition at line 111 of file ListGroups.cc.

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

111  {
112  m_saveSummaryPlot = iPSet.getUntrackedParameter<bool>("SaveSummaryPlot");
113  m_plots.clear();
114  m_groups.clear();
115  TColor::InitializeColors();
116  fillColor();
118  fillGradient();
119 }
T getUntrackedParameter(std::string const &, T const &) const
void fillColor()
Definition: ListGroups.cc:297
std::vector< TH2F * > m_plots
Definition: ListGroups.cc:92
void fillMaterialDifferences()
Definition: ListGroups.cc:130
bool m_saveSummaryPlot
Definition: ListGroups.cc:91
void fillGradient()
Definition: ListGroups.cc:263
std::vector< MaterialAccountingGroup * > m_groups
Definition: ListGroups.cc:94
ListGroups::~ListGroups ( )
override

Definition at line 121 of file ListGroups.cc.

References g, m_groups, m_plots, and plotFactory::plot.

121  {
122  for (auto plot : m_plots)
123  delete plot;
124 
125  if (!m_groups.empty())
126  for (auto g : m_groups)
127  delete g;
128 }
std::vector< TH2F * > m_plots
Definition: ListGroups.cc:92
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
std::vector< MaterialAccountingGroup * > m_groups
Definition: ListGroups.cc:94

Member Function Documentation

void ListGroups::analyze ( const edm::Event evt,
const edm::EventSetup setup 
)
overrideprivate

Definition at line 560 of file ListGroups.cc.

References gather_cfg::cout, dddGetString(), ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::geoHistory(), edm::EventSetup::get(), h, m_group_names, m_saveSummaryPlot, DDFilteredView::next(), position, produceAndSaveSummaryPlot(), and DDFilteredView::translation().

560  {
562  setup.get<IdealGeometryRecord>().get(hDdd);
563 
564  DDSpecificsHasNamedValueFilter filter{"TrackingMaterialGroup"};
565  DDFilteredView fv(*hDdd, filter);
566 
567  while (fv.next()) {
568  // print the group name and full hierarchy of all items
569  std::cout << dddGetString("TrackingMaterialGroup", fv) << '\t';
570  m_group_names.insert(dddGetString("TrackingMaterialGroup", fv));
571 
572  // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
573  const DDGeoHistory &history = fv.geoHistory();
574  std::cout << '/';
575  for (unsigned int h = 2; h < history.size(); ++h)
576  std::cout << '/' << history[h].logicalPart().name().name() << '[' << history[h].copyno() << ']';
577 
578  // DD3Vector and DDTranslation are the same type as math::XYZVector
579  math::XYZVector position = fv.translation() / 10.; // mm -> cm
580  std::cout << "\t(" << position.x() << ", " << position.y() << ", " << position.z() << ") "
581  << "[rho] " << position.Rho() << std::endl;
582  };
583  std::cout << std::endl;
584 
585  if (m_saveSummaryPlot)
587 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void produceAndSaveSummaryPlot(const edm::EventSetup &)
Definition: ListGroups.cc:435
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
bool m_saveSummaryPlot
Definition: ListGroups.cc:91
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
std::set< std::string > m_group_names
Definition: ListGroups.cc:93
static int position[264][3]
Definition: ReadPGInfo.cc:509
T get() const
Definition: EventSetup.h:71
static std::string dddGetString(const std::string &s, DDFilteredView const &view)
Definition: ListGroups.cc:69
void ListGroups::beginJob ( void  )
inlineoverrideprivatevirtual
void ListGroups::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 589 of file ListGroups.cc.

References DEFINE_FWK_MODULE.

Referenced by beginJob().

589 {}
void ListGroups::fillColor ( void  )
private

Definition at line 297 of file ListGroups.cc.

References m_color.

Referenced by beginJob(), and ListGroups().

297  {
298  // With the introduction of the support for PhaseI and PhaseII detectors it
299  // became quite difficult to maintain a list of colors that is in sync with
300  // the real number of grouping used in the different scenarios. We therefore
301  // define some reasonable set and loop over it in case the number of grouping
302  // is larger than the number of colors.
303 
304  m_color.push_back(kBlack); // unassigned
305 
306  m_color.push_back(kAzure); // PixelBarrelLayer0_Z0
307  m_color.push_back(kAzure - 1); // PixelBarrelLayer0_Z20
308  m_color.push_back(kAzure + 1); // Layer1_Z0
309  m_color.push_back(kAzure + 2); // Layer1_Z20
310 
311  m_color.push_back(kGreen); // EndCapDisk1_R0
312  m_color.push_back(kGreen + 2); // EndcapDisk1_R11
313  m_color.push_back(kGreen + 4); // EndcapDisk1_R7
314  m_color.push_back(kSpring + 9); // EndcapDisk2_R0
315  m_color.push_back(kSpring + 4); // EndcapDisk2_R7
316  m_color.push_back(kSpring); // EndcapDisk2_R7
317 
318  m_color.push_back(kRed); // TECDisk0_R20
319  m_color.push_back(kRed + 2); // TECDisk0_R40
320  m_color.push_back(kRed - 7); // TECDisk0_R50
321  m_color.push_back(kRed - 5); // TECDisk0_R60
322  m_color.push_back(kRed - 10); // TECDisk0_R90
323  m_color.push_back(kRed - 1); // TECDisk1_Inner
324  m_color.push_back(kRed - 2); // TECDisk1_Outer
325  m_color.push_back(kRed - 3); // TECDisk1_R20
326  m_color.push_back(kPink - 2); // TECDisk2_Inner
327  m_color.push_back(kPink - 3); // TECDisk2_Outer
328  m_color.push_back(kPink - 4); // TECDisk2_R20
329  m_color.push_back(kPink + 9); // TECDisk3_Inner
330  m_color.push_back(kPink + 8); // TECDisk3_Outer
331  m_color.push_back(kPink + 7); // TECDisk3
332  m_color.push_back(kMagenta - 2); // TECDisk4_Inner
333  m_color.push_back(kMagenta - 3); // TECDisk4_Outer
334  m_color.push_back(kMagenta - 4); // TECDisk4_R33
335  m_color.push_back(kMagenta - 5); // TECDisk5_Inner
336  m_color.push_back(kMagenta - 6); // TECDisk5_Outer
337  m_color.push_back(kMagenta - 7); // TECDisk5_R33
338  m_color.push_back(kRed); // TECDisk6
339  m_color.push_back(kMagenta - 9); // TECDisk7_R40
340  m_color.push_back(kViolet); // TECDisk8
341 
342  m_color.push_back(kOrange + 9); // TIBLayer0_Z0
343  m_color.push_back(kOrange + 7); // TIBLayer0_Z20
344  m_color.push_back(kOrange + 5); // TIBLayer0_Z40
345  m_color.push_back(kOrange - 2); // TIBLayer1_Z0
346  m_color.push_back(kOrange - 3); // TIBLayer1_Z30
347  m_color.push_back(kOrange - 6); // TIBLayer1_Z60
348  m_color.push_back(kOrange + 4); // TIBLayer2_Z0
349  m_color.push_back(kOrange - 7); // TIBLayer2_Z40
350  m_color.push_back(kOrange); // TIBLayer3_Z0
351  m_color.push_back(kOrange + 10); // TIBLayer3_Z50
352 
353  m_color.push_back(kViolet + 10); // TIDDisk1_R0
354  m_color.push_back(kViolet + 6); // TIDDisk1_R30
355  m_color.push_back(kViolet + 3); // TIDDisk1_R40
356  m_color.push_back(kViolet - 7); // TIDDisk2_R25
357  m_color.push_back(kViolet - 1); // TIDDisk2_R30
358  m_color.push_back(kViolet + 9); // TIDDisk2_R40
359  m_color.push_back(kViolet - 5); // TIDDisk3_R24
360  m_color.push_back(kViolet - 3); // TIDDisk3_R30
361  m_color.push_back(kViolet); // TIDDisk3_R40
362 
363  m_color.push_back(kAzure); // TOBLayer0_Z0
364  m_color.push_back(kAzure + 8); // TOBLayer0_Z20
365  m_color.push_back(kAzure + 2); // TOBLayer0_Z70
366  m_color.push_back(kAzure + 4); // TOBLayer0_Z80
367  m_color.push_back(kCyan + 1); // TOBLayer1_Z0
368  m_color.push_back(kCyan - 9); // TOBLayer1_Z20
369  m_color.push_back(kCyan + 3); // TOBLayer1_Z80
370  m_color.push_back(kCyan + 4); // TOBLayer1_Z90
371  m_color.push_back(kAzure); // TOBLayer2_Z0
372  m_color.push_back(kAzure + 8); // TOBLayer2_Z25
373  m_color.push_back(kAzure + 2); // TOBLayer2_Z80
374  m_color.push_back(kAzure + 5); // TOBLayer2_Z90
375  m_color.push_back(kCyan + 1); // TOBLayer3_Z0
376  m_color.push_back(kCyan - 9); // TOBLayer3_Z25
377  m_color.push_back(kCyan + 3); // TOBLayer3_Z80
378  m_color.push_back(kCyan + 4); // TOBLayer3_Z90
379  m_color.push_back(kAzure); // TOBLayer4_Z0
380  m_color.push_back(kAzure + 8); // TOBLayer4_Z25
381  m_color.push_back(kAzure + 2); // TOBLayer4_Z80
382  m_color.push_back(kAzure + 5); // TOBLayer4_Z90
383  m_color.push_back(kCyan + 1); // TOBLayer5_Z0
384  m_color.push_back(kCyan - 9); // TOBLayer5_Z25
385  m_color.push_back(kCyan + 3); // TOBLayer5_Z80
386  m_color.push_back(kCyan + 4); // TOBLayer5_Z90
387 }
std::vector< unsigned int > m_color
Definition: ListGroups.cc:95
void ListGroups::fillGradient ( void  )
private

Definition at line 263 of file ListGroups.cc.

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

Referenced by beginJob(), and ListGroups().

263  {
264  m_gradient.reserve(200);
265  unsigned int steps = 100;
266  // if no index was given, find the highest used one and start from that plus one
267  unsigned int index = ((TObjArray *)gROOT->GetListOfColors())->GetLast() + 1;
268 
269  float r1, g1, b1, r2, g2, b2;
270  static_cast<TColor *>(gROOT->GetListOfColors()->At(kBlue + 1))->GetRGB(r1, g1, b1);
271  static_cast<TColor *>(gROOT->GetListOfColors()->At(kAzure + 10))->GetRGB(r2, g2, b2);
272  float delta_r = (r2 - r1) / (steps - 1);
273  float delta_g = (g2 - g1) / (steps - 1);
274  float delta_b = (b2 - b1) / (steps - 1);
275 
276  m_gradient.push_back(kBlue + 4); // Underflow lowest bin
277  unsigned int ii = 0;
278  for (unsigned int i = 0; i < steps; ++i, ++ii) {
279  new TColor(static_cast<Int_t>(index + ii), r1 + delta_r * i, g1 + delta_g * i, b1 + delta_b * i);
280  m_gradient.push_back(index + ii);
281  }
282 
283  m_gradient.push_back(kWhite); // 0 level perfectly white
284 
285  static_cast<TColor *>(gROOT->GetListOfColors()->At(kOrange))->GetRGB(r1, g1, b1);
286  static_cast<TColor *>(gROOT->GetListOfColors()->At(kOrange + 7))->GetRGB(r2, g2, b2);
287  delta_r = (r2 - r1) / (steps - 1);
288  delta_g = (g2 - g1) / (steps - 1);
289  delta_b = (b2 - b1) / (steps - 1);
290  for (unsigned int i = 0; i < steps; ++i, ++ii) {
291  new TColor(static_cast<Int_t>(index + ii), r1 + delta_r * i, g1 + delta_g * i, b1 + delta_b * i);
292  m_gradient.push_back(index + ii);
293  }
294  m_gradient.push_back(kRed); // Overflow highest bin
295 }
double delta_r(const Fourvec &a, const Fourvec &b)
Find the distance between two four-vectors in the two-dimensional space .
Definition: fourvec.cc:249
ii
Definition: cuy.py:590
std::vector< int > m_gradient
Definition: ListGroups.cc:96
void ListGroups::fillMaterialDifferences ( )
private

Definition at line 130 of file ListGroups.cc.

References m_diff, and m_values.

Referenced by beginJob(), and ListGroups().

130  {
131  m_diff["TrackerRecMaterialTIBLayer0_Z20"] = std::make_pair<float, float>(0.000000, 0.000000);
132  m_diff["TrackerRecMaterialTECDisk0_R60"] = std::make_pair<float, float>(0.000000, 0.000000);
133  m_diff["TrackerRecMaterialTOBLayer1_Z80"] = std::make_pair<float, float>(0.000000, 0.000000);
134  m_diff["TrackerRecMaterialTOBLayer4_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
135  m_diff["TrackerRecMaterialTOBLayer2_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
136  m_diff["TrackerRecMaterialTOBLayer0_Z70"] = std::make_pair<float, float>(0.000000, 0.000000);
137  m_diff["TrackerRecMaterialTECDisk0_R20"] = std::make_pair<float, float>(0.000000, 0.000000);
138  m_diff["TrackerRecMaterialTOBLayer5_Z80"] = std::make_pair<float, float>(338.028085, 425.909863);
139  m_diff["TrackerRecMaterialPixelEndcapDisk1Fw_Outer"] = std::make_pair<float, float>(0.000000, 0.000000);
140  m_diff["TrackerRecMaterialTECDisk1_R20"] = std::make_pair<float, float>(19.426752, 17.294518);
141  m_diff["TrackerRecMaterialTOBLayer5_Z0"] = std::make_pair<float, float>(510.125226, 651.305054);
142  m_diff["TrackerRecMaterialTECDisk8"] = std::make_pair<float, float>(1098.073793, 778.542517);
143  m_diff["TrackerRecMaterialTIDDisk3_R24"] = std::make_pair<float, float>(0.000000, 0.000000);
144  m_diff["TrackerRecMaterialTECDisk4_R33"] = std::make_pair<float, float>(51.925713, 42.900250);
145  m_diff["TrackerRecMaterialTIBLayer1_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
146  m_diff["TrackerRecMaterialPixelEndcapDisk1Bw_Outer"] = std::make_pair<float, float>(0.000000, 0.000000);
147  m_diff["TrackerRecMaterialTIDDisk2_R25"] = std::make_pair<float, float>(0.000000, 0.000000);
148  m_diff["TrackerRecMaterialTIBLayer0_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
149  m_diff["TrackerRecMaterialTOBLayer3_Z25"] = std::make_pair<float, float>(0.000000, 0.000000);
150  m_diff["TrackerRecMaterialTIBLayer1_Z30"] = std::make_pair<float, float>(0.000000, 0.000000);
151  m_diff["TrackerRecMaterialTIDDisk2_R40"] = std::make_pair<float, float>(0.000000, 0.000000);
152  m_diff["TrackerRecMaterialTIBLayer2_Z40"] = std::make_pair<float, float>(0.000000, 0.000000);
153  m_diff["TrackerRecMaterialTOBLayer1_Z20"] = std::make_pair<float, float>(0.000000, 0.000000);
154  m_diff["TrackerRecMaterialPixelEndcapDisk2Bw_Inner"] = std::make_pair<float, float>(0.000000, 0.000000);
155  m_diff["TrackerRecMaterialTOBLayer0_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
156  m_diff["TrackerRecMaterialPixelBarrelLayer0"] = std::make_pair<float, float>(0.000000, 0.000000);
157  m_diff["TrackerRecMaterialPixelBarrelLayer3"] = std::make_pair<float, float>(0.000000, 0.000000);
158  m_diff["TrackerRecMaterialTIBLayer3_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
159  m_diff["TrackerRecMaterialTOBLayer3_Z80"] = std::make_pair<float, float>(118.048766, 116.983451);
160  m_diff["TrackerRecMaterialTOBLayer4_Z80"] = std::make_pair<float, float>(210.657923, 218.401623);
161  m_diff["TrackerRecMaterialTECDisk5_R33"] = std::make_pair<float, float>(69.556218, 54.695749);
162  m_diff["TrackerRecMaterialTOBLayer0_Z20"] = std::make_pair<float, float>(0.000000, 0.000000);
163  m_diff["TrackerRecMaterialTIBLayer2_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
164  m_diff["TrackerRecMaterialTECDisk2_R20"] = std::make_pair<float, float>(43.042551, 39.124220);
165  m_diff["TrackerRecMaterialPixelEndcapDisk1Bw_Inner"] = std::make_pair<float, float>(0.000000, 0.000000);
166  m_diff["TrackerRecMaterialTIDDisk1_R30"] = std::make_pair<float, float>(0.000000, 0.000000);
167  m_diff["TrackerRecMaterialTECDisk0_R50"] = std::make_pair<float, float>(0.000000, 0.000000);
168  m_diff["TrackerRecMaterialTOBLayer5_Z25"] = std::make_pair<float, float>(308.073141, 389.306637);
169  m_diff["TrackerRecMaterialPixelEndcapDisk2Bw_Outer"] = std::make_pair<float, float>(0.000000, 0.000000);
170  m_diff["TrackerRecMaterialTIBLayer3_Z50"] = std::make_pair<float, float>(0.000000, 0.000000);
171  m_diff["TrackerRecMaterialTECDisk3"] = std::make_pair<float, float>(40.109901, 34.382246);
172  m_diff["TrackerRecMaterialPixelBarrelLayer1"] = std::make_pair<float, float>(0.000000, 0.000000);
173  m_diff["TrackerRecMaterialPixelBarrelLayer2_External"] = std::make_pair<float, float>(0.000000, 0.000000);
174  m_diff["TrackerRecMaterialPixelEndcapDisk2Fw_Inner"] = std::make_pair<float, float>(0.000000, 0.000000);
175  m_diff["TrackerRecMaterialTECDisk7_R40"] = std::make_pair<float, float>(219.144902, 162.590326);
176  m_diff["TrackerRecMaterialPixelEndcapDisk3Bw_Inner"] = std::make_pair<float, float>(594.908414, 558.979032);
177  m_diff["TrackerRecMaterialPixelEndcapDisk2Fw_Outer"] = std::make_pair<float, float>(0.000000, 0.000000);
178  m_diff["TrackerRecMaterialPixelEndcapDisk3Fw_Outer"] = std::make_pair<float, float>(0.000000, 0.000000);
179  m_diff["TrackerRecMaterialTECDisk6"] = std::make_pair<float, float>(85.692825, 67.990698);
180  m_diff["TrackerRecMaterialTOBLayer3_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
181  m_diff["TrackerRecMaterialPixelBarrelLayer2"] = std::make_pair<float, float>(0.000000, 0.000000);
182  m_diff["TrackerRecMaterialPixelBarrelLayer3_External"] = std::make_pair<float, float>(0.000000, 0.000000);
183  m_diff["TrackerRecMaterialPixelEndcapDisk3Fw_Inner"] = std::make_pair<float, float>(607.142137, 570.407286);
184  m_diff["TrackerRecMaterialTOBLayer2_Z25"] = std::make_pair<float, float>(0.000000, 0.000000);
185  m_diff["TrackerRecMaterialPixelEndcapDisk3Bw_Outer"] = std::make_pair<float, float>(0.000000, 0.000000);
186  m_diff["TrackerRecMaterialPixelBarrelLayer0_External"] = std::make_pair<float, float>(0.000000, 0.000000);
187  m_diff["TrackerRecMaterialTECDisk0_R90"] = std::make_pair<float, float>(59.694180, 74.636115);
188  m_diff["TrackerRecMaterialTOBLayer1_Z0"] = std::make_pair<float, float>(0.000000, 0.000000);
189  m_diff["TrackerRecMaterialTIDDisk1_R0"] = std::make_pair<float, float>(0.000000, 0.000000);
190  m_diff["TrackerRecMaterialPixelBarrelLayer1_External"] = std::make_pair<float, float>(0.000000, 0.000000);
191  m_diff["TrackerRecMaterialTOBLayer4_Z25"] = std::make_pair<float, float>(0.000000, 0.000000);
192  m_diff["TrackerRecMaterialTOBLayer2_Z80"] = std::make_pair<float, float>(2.291492, 2.290657);
193  m_diff["TrackerRecMaterialPixelEndcapDisk1Fw_Inner"] = std::make_pair<float, float>(0.000000, 0.000000);
194  m_diff["TrackerRecMaterialTECDisk0_R40"] = std::make_pair<float, float>(0.000000, 0.000000);
195  m_diff["TrackerRecMaterialTIDDisk2_R30"] = std::make_pair<float, float>(0.000000, 0.000000);
196  m_values["TrackerRecMaterialTIBLayer0_Z20"] = std::make_pair<float, float>(0.076264, 0.000162);
197  m_values["TrackerRecMaterialTECDisk0_R60"] = std::make_pair<float, float>(0.199482, 0.000368);
198  m_values["TrackerRecMaterialTOBLayer1_Z80"] = std::make_pair<float, float>(0.075550, 0.000145);
199  m_values["TrackerRecMaterialTOBLayer4_Z0"] = std::make_pair<float, float>(0.014804, 0.000033);
200  m_values["TrackerRecMaterialTOBLayer2_Z0"] = std::make_pair<float, float>(0.014947, 0.000033);
201  m_values["TrackerRecMaterialTOBLayer0_Z70"] = std::make_pair<float, float>(0.104496, 0.000208);
202  m_values["TrackerRecMaterialTECDisk0_R20"] = std::make_pair<float, float>(0.177496, 0.000419);
203  m_values["TrackerRecMaterialTOBLayer5_Z80"] = std::make_pair<float, float>(0.095700, 0.000224);
204  m_values["TrackerRecMaterialPixelEndcapDisk1Fw_Outer"] = std::make_pair<float, float>(0.063054, 0.000139);
205  m_values["TrackerRecMaterialTECDisk1_R20"] = std::make_pair<float, float>(0.086704, 0.000189);
206  m_values["TrackerRecMaterialTOBLayer5_Z0"] = std::make_pair<float, float>(0.060576, 0.000155);
207  m_values["TrackerRecMaterialTECDisk8"] = std::make_pair<float, float>(0.329777, 0.000532);
208  m_values["TrackerRecMaterialTIDDisk3_R24"] = std::make_pair<float, float>(0.154447, 0.000366);
209  m_values["TrackerRecMaterialTECDisk4_R33"] = std::make_pair<float, float>(0.072594, 0.000158);
210  m_values["TrackerRecMaterialTIBLayer1_Z0"] = std::make_pair<float, float>(0.049604, 0.000102);
211  m_values["TrackerRecMaterialPixelEndcapDisk1Bw_Outer"] = std::make_pair<float, float>(0.065873, 0.000145);
212  m_values["TrackerRecMaterialTIDDisk2_R25"] = std::make_pair<float, float>(0.067206, 0.000166);
213  m_values["TrackerRecMaterialTIBLayer0_Z0"] = std::make_pair<float, float>(0.056395, 0.000125);
214  m_values["TrackerRecMaterialTOBLayer3_Z25"] = std::make_pair<float, float>(0.035290, 0.000071);
215  m_values["TrackerRecMaterialTIBLayer1_Z30"] = std::make_pair<float, float>(0.068299, 0.000137);
216  m_values["TrackerRecMaterialTIDDisk2_R40"] = std::make_pair<float, float>(0.143121, 0.000310);
217  m_values["TrackerRecMaterialTIBLayer2_Z40"] = std::make_pair<float, float>(0.077840, 0.000155);
218  m_values["TrackerRecMaterialTOBLayer1_Z20"] = std::make_pair<float, float>(0.051913, 0.000103);
219  m_values["TrackerRecMaterialPixelEndcapDisk2Bw_Inner"] = std::make_pair<float, float>(0.039093, 0.000090);
220  m_values["TrackerRecMaterialTOBLayer0_Z0"] = std::make_pair<float, float>(0.029002, 0.000069);
221  m_values["TrackerRecMaterialPixelBarrelLayer0"] = std::make_pair<float, float>(0.018043, 0.000038);
222  m_values["TrackerRecMaterialPixelBarrelLayer3"] = std::make_pair<float, float>(0.020661, 0.000042);
223  m_values["TrackerRecMaterialTIBLayer3_Z0"] = std::make_pair<float, float>(0.048101, 0.000110);
224  m_values["TrackerRecMaterialTOBLayer3_Z80"] = std::make_pair<float, float>(0.093979, 0.000181);
225  m_values["TrackerRecMaterialTOBLayer4_Z80"] = std::make_pair<float, float>(0.101240, 0.000203);
226  m_values["TrackerRecMaterialTECDisk5_R33"] = std::make_pair<float, float>(0.092564, 0.000201);
227  m_values["TrackerRecMaterialTOBLayer0_Z20"] = std::make_pair<float, float>(0.063558, 0.000138);
228  m_values["TrackerRecMaterialTIBLayer2_Z0"] = std::make_pair<float, float>(0.036854, 0.000078);
229  m_values["TrackerRecMaterialTECDisk2_R20"] = std::make_pair<float, float>(0.107900, 0.000237);
230  m_values["TrackerRecMaterialPixelEndcapDisk1Bw_Inner"] = std::make_pair<float, float>(0.039143, 0.000086);
231  m_values["TrackerRecMaterialTIDDisk1_R30"] = std::make_pair<float, float>(0.167774, 0.000321);
232  m_values["TrackerRecMaterialTECDisk0_R50"] = std::make_pair<float, float>(0.108277, 0.000255);
233  m_values["TrackerRecMaterialTOBLayer5_Z25"] = std::make_pair<float, float>(0.086612, 0.000209);
234  m_values["TrackerRecMaterialPixelEndcapDisk2Bw_Outer"] = std::make_pair<float, float>(0.070143, 0.000165);
235  m_values["TrackerRecMaterialTIBLayer3_Z50"] = std::make_pair<float, float>(0.063872, 0.000138);
236  m_values["TrackerRecMaterialTECDisk3"] = std::make_pair<float, float>(0.064126, 0.000139);
237  m_values["TrackerRecMaterialPixelBarrelLayer1"] = std::make_pair<float, float>(0.016379, 0.000028);
238  m_values["TrackerRecMaterialPixelBarrelLayer2_External"] = std::make_pair<float, float>(0.026687, 0.000046);
239  m_values["TrackerRecMaterialPixelEndcapDisk2Fw_Inner"] = std::make_pair<float, float>(0.039737, 0.000091);
240  m_values["TrackerRecMaterialTECDisk7_R40"] = std::make_pair<float, float>(0.126225, 0.000235);
241  m_values["TrackerRecMaterialPixelEndcapDisk3Bw_Inner"] = std::make_pair<float, float>(0.674984, 0.001356);
242  m_values["TrackerRecMaterialPixelEndcapDisk2Fw_Outer"] = std::make_pair<float, float>(0.065935, 0.000151);
243  m_values["TrackerRecMaterialPixelEndcapDisk3Fw_Outer"] = std::make_pair<float, float>(0.100139, 0.000205);
244  m_values["TrackerRecMaterialTECDisk6"] = std::make_pair<float, float>(0.078988, 0.000163);
245  m_values["TrackerRecMaterialTOBLayer3_Z0"] = std::make_pair<float, float>(0.015009, 0.000033);
246  m_values["TrackerRecMaterialPixelBarrelLayer2"] = std::make_pair<float, float>(0.017219, 0.000030);
247  m_values["TrackerRecMaterialPixelBarrelLayer3_External"] = std::make_pair<float, float>(0.036152, 0.000066);
248  m_values["TrackerRecMaterialPixelEndcapDisk3Fw_Inner"] = std::make_pair<float, float>(0.673782, 0.001357);
249  m_values["TrackerRecMaterialTOBLayer2_Z25"] = std::make_pair<float, float>(0.034917, 0.000069);
250  m_values["TrackerRecMaterialPixelEndcapDisk3Bw_Outer"] = std::make_pair<float, float>(0.100143, 0.000204);
251  m_values["TrackerRecMaterialPixelBarrelLayer0_External"] = std::make_pair<float, float>(0.031128, 0.000062);
252  m_values["TrackerRecMaterialTECDisk0_R90"] = std::make_pair<float, float>(0.309342, 0.000539);
253  m_values["TrackerRecMaterialTOBLayer1_Z0"] = std::make_pair<float, float>(0.023489, 0.000050);
254  m_values["TrackerRecMaterialTIDDisk1_R0"] = std::make_pair<float, float>(0.175180, 0.000349);
255  m_values["TrackerRecMaterialPixelBarrelLayer1_External"] = std::make_pair<float, float>(0.022508, 0.000036);
256  m_values["TrackerRecMaterialTOBLayer4_Z25"] = std::make_pair<float, float>(0.036056, 0.000073);
257  m_values["TrackerRecMaterialTOBLayer2_Z80"] = std::make_pair<float, float>(0.062072, 0.000117);
258  m_values["TrackerRecMaterialPixelEndcapDisk1Fw_Inner"] = std::make_pair<float, float>(0.039127, 0.000086);
259  m_values["TrackerRecMaterialTECDisk0_R40"] = std::make_pair<float, float>(0.084231, 0.000209);
260  m_values["TrackerRecMaterialTIDDisk2_R30"] = std::make_pair<float, float>(0.065109, 0.000143);
261 }
std::map< std::string, std::pair< float, float > > m_diff
Definition: ListGroups.cc:107
std::map< std::string, std::pair< float, float > > m_values
Definition: ListGroups.cc:108
std::vector< std::pair< std::shared_ptr< TLine >, std::shared_ptr< TText > > > ListGroups::overlayEtaReferences ( )
private

Definition at line 389 of file ListGroups.cc.

References boostedElectronIsolation_cff::deltaR, PVValHelper::eta, JetChargeProducer_cfi::exp, cmsPerfStripChart::format, groupFilesInBlocks::lines, str, funct::tan(), and theta().

Referenced by beginJob(), and produceAndSaveSummaryPlot().

389  {
390  std::vector<std::pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > > lines;
391 
392  lines.reserve(40);
393  std::pair<float, float> deltaZ(293, 298);
394  std::pair<float, float> deltaR(115, 118);
395  float text_size = 0.033;
396 
397  for (float eta = 0.; eta <= 3.8; eta += 0.2) {
398  float theta = 2. * atan(exp(-eta));
399  if (eta >= 1.8) {
400  lines.push_back(std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> >(
401  std::make_shared<TLine>(deltaZ.first, deltaZ.first * tan(theta), deltaZ.second, deltaZ.second * tan(theta)),
402  std::make_shared<TText>(deltaZ.first, deltaZ.first * tan(theta), str(boost::format("%2.1f") % eta).c_str())));
403  lines.back().second->SetTextFont(42);
404  lines.back().second->SetTextSize(text_size);
405  lines.back().second->SetTextAlign(33);
406  lines.push_back(std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> >(
407  std::make_shared<TLine>(-deltaZ.first, deltaZ.first * tan(theta), -deltaZ.second, deltaZ.second * tan(theta)),
408  std::make_shared<TText>(
409  -deltaZ.first, deltaZ.first * tan(theta), str(boost::format("-%2.1f") % eta).c_str())));
410  lines.back().second->SetTextFont(42);
411  lines.back().second->SetTextSize(text_size);
412  lines.back().second->SetTextAlign(13);
413  } else {
414  lines.push_back(std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> >(
415  std::make_shared<TLine>(deltaR.first / tan(theta), deltaR.first, deltaR.second / tan(theta), deltaR.second),
416  std::make_shared<TText>(deltaR.first / tan(theta), deltaR.first, str(boost::format("%2.1f") % eta).c_str())));
417  lines.back().second->SetTextFont(42);
418  lines.back().second->SetTextSize(text_size);
419  lines.back().second->SetTextAlign(23);
420  if (eta != 0) {
421  lines.push_back(std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> >(
422  std::make_shared<TLine>(
423  -deltaR.first / tan(theta), deltaR.first, -deltaR.second / tan(theta), deltaR.second),
424  std::make_shared<TText>(
425  -deltaR.first / tan(theta), deltaR.first, str(boost::format("-%2.1f") % eta).c_str())));
426  lines.back().second->SetTextFont(42);
427  lines.back().second->SetTextSize(text_size);
428  lines.back().second->SetTextAlign(23);
429  }
430  }
431  }
432  return lines;
433 }
Geom::Theta< T > theta() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
format
Some error handling for the usage.
#define str(s)
void ListGroups::produceAndSaveSummaryPlot ( const edm::EventSetup setup)
private

Definition at line 435 of file ListGroups.cc.

References svgfig::canvas(), g, edm::EventSetup::get(), create_public_lumi_plots::leg, mps_splice::line, groupFilesInBlocks::lines, m_color, m_diff, m_gradient, m_group_names, m_groups, m_plots, m_values, gen::n, overlayEtaReferences(), and Scenarios_cff::scale.

Referenced by analyze(), and beginJob().

435  {
436  const double scale = 10.;
437  std::vector<TText *> nukem_text;
438  static int markerStyles[10] = {kFullCircle,
439  kFullSquare,
440  kFullTriangleUp,
441  kFullTriangleDown,
442  kOpenCircle,
443  kOpenSquare,
444  kOpenTriangleUp,
445  kOpenDiamond,
446  kOpenCross,
447  kFullStar};
448 
450  setup.get<IdealGeometryRecord>().get(hDdd);
451 
452  for (auto n : m_group_names) {
453  m_groups.push_back(new MaterialAccountingGroup(n, *hDdd));
454  };
455 
456  std::unique_ptr<TCanvas> canvas(
457  new TCanvas("Grouping_rz", "Grouping - RZ view", (int)(600 * scale * 1.25), (int)(120 * scale * 1.50)));
458  canvas->GetFrame()->SetFillColor(kWhite);
459  gStyle->SetOptStat(0);
460 
461  unsigned int color_index = 1;
462  // Setup the legend
463  std::unique_ptr<TLegend> leg(new TLegend(0.1, 0.1, 0.23, 0.34));
464  leg->SetHeader("Tracker Material Grouping");
465  leg->SetTextFont(42);
466  leg->SetTextSize(0.008);
467  leg->SetNColumns(3);
468  std::unique_ptr<TProfile2D> radlen(
469  new TProfile2D("OverallRadLen", "OverallRadLen", 600., -300., 300, 120., 0., 120.));
470  std::unique_ptr<TProfile2D> eneloss(
471  new TProfile2D("OverallEnergyLoss", "OverallEnergyLoss", 600., -300., 300, 120., 0., 120.));
472  std::unique_ptr<TProfile2D> radlen_diff(
473  new TProfile2D("OverallDifferencesRadLen", "OverallDifferencesRadLen", 600., -300., 300, 120., 0., 120.));
474  std::unique_ptr<TProfile2D> eneloss_diff(
475  new TProfile2D("OverallDifferencesEnergyLoss", "OverallDifferencesEnergyLoss", 600., -300., 300, 120., 0., 120.));
476 
477  for (auto g : m_groups) {
478  m_plots.push_back(
479  new TH2F(g->name().c_str(), g->name().c_str(), 6000., -300., 300, 1200., 0., 120.)); // 10x10 points per cm2
480  TH2F &current = *m_plots.back();
481  current.SetMarkerColor(m_color[color_index]);
482  current.SetMarkerStyle(markerStyles[color_index % 10]);
483  current.SetMarkerSize(0.8);
484  current.SetLineWidth(1);
485  for (auto element : g->elements()) {
486  current.Fill(element.z(), element.perp());
487  radlen->Fill(element.z(), element.perp(), m_values[g->name()].first);
488  eneloss->Fill(element.z(), element.perp(), m_values[g->name()].second);
489  radlen_diff->Fill(element.z(), element.perp(), m_diff[g->name()].first);
490  eneloss_diff->Fill(element.z(), element.perp(), m_diff[g->name()].second);
491  }
492 
493  if (color_index == 1)
494  current.Draw();
495  else
496  current.Draw("SAME");
497 
498  leg->AddEntry(&current, g->name().c_str(), "lp")->SetTextColor(m_color[color_index]);
499  color_index++;
500 
501  // Loop over the same chromatic scale in case the number of
502  // allocated colors is not big enough.
503  color_index = color_index % m_color.size();
504  }
505  leg->Draw();
506  canvas->SaveAs("Grouping.png");
507 
508  std::vector<std::pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > > lines = overlayEtaReferences();
509 
510  canvas->Clear();
511  radlen->SetMinimum(0);
512  radlen->SetMaximum(0.25);
513  radlen->Draw("COLZ");
514  for (auto line : lines) {
515  line.first->SetLineWidth(5);
516  line.first->Draw();
517  line.second->Draw();
518  }
519  canvas->SaveAs("RadLenValues.png");
520 
521  canvas->Clear();
522  eneloss->SetMinimum(0.00001);
523  eneloss->SetMaximum(0.0005);
524  eneloss->Draw("COLZ");
525  for (auto line : lines) {
526  line.first->SetLineWidth(5);
527  line.first->Draw();
528  line.second->Draw();
529  }
530  canvas->SaveAs("EnergyLossValues.png");
531 
532  canvas->Clear();
533  gStyle->SetPalette(m_gradient.size(), &m_gradient.front());
534  gStyle->SetNumberContours(m_gradient.size());
535  radlen_diff->SetMinimum(-100);
536  radlen_diff->SetMaximum(100);
537  radlen_diff->Draw("COLZ");
538  for (auto line : lines) {
539  line.first->SetLineWidth(5);
540  line.first->Draw();
541  line.second->Draw();
542  }
543  canvas->SaveAs("RadLenChanges.png");
544 
545  canvas->Clear();
546  eneloss_diff->SetMinimum(-100);
547  eneloss_diff->SetMaximum(100);
548  eneloss_diff->Draw("COLZ");
549  for (auto line : lines) {
550  line.first->SetLineWidth(5);
551  line.first->Draw();
552  line.second->Draw();
553  }
554  canvas->SaveAs("EnergyLossChanges.png");
555 
556  for (auto g : nukem_text)
557  delete g;
558 }
std::vector< TH2F * > m_plots
Definition: ListGroups.cc:92
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
std::vector< std::pair< std::shared_ptr< TLine >, std::shared_ptr< TText > > > overlayEtaReferences()
Definition: ListGroups.cc:389
std::vector< unsigned int > m_color
Definition: ListGroups.cc:95
std::map< std::string, std::pair< float, float > > m_diff
Definition: ListGroups.cc:107
std::set< std::string > m_group_names
Definition: ListGroups.cc:93
std::vector< MaterialAccountingGroup * > m_groups
Definition: ListGroups.cc:94
T get() const
Definition: EventSetup.h:71
def canvas(sub, attr)
Definition: svgfig.py:482
std::vector< int > m_gradient
Definition: ListGroups.cc:96
std::map< std::string, std::pair< float, float > > m_values
Definition: ListGroups.cc:108

Member Data Documentation

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

Definition at line 95 of file ListGroups.cc.

Referenced by fillColor(), and produceAndSaveSummaryPlot().

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

Definition at line 107 of file ListGroups.cc.

Referenced by fillMaterialDifferences(), and produceAndSaveSummaryPlot().

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

Definition at line 96 of file ListGroups.cc.

Referenced by fillGradient(), and produceAndSaveSummaryPlot().

std::set<std::string> ListGroups::m_group_names
private

Definition at line 93 of file ListGroups.cc.

Referenced by analyze(), and produceAndSaveSummaryPlot().

std::vector<MaterialAccountingGroup *> ListGroups::m_groups
private

Definition at line 94 of file ListGroups.cc.

Referenced by ListGroups(), produceAndSaveSummaryPlot(), and ~ListGroups().

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

Definition at line 92 of file ListGroups.cc.

Referenced by ListGroups(), produceAndSaveSummaryPlot(), and ~ListGroups().

bool ListGroups::m_saveSummaryPlot
private

Definition at line 91 of file ListGroups.cc.

Referenced by analyze(), and ListGroups().

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

Definition at line 108 of file ListGroups.cc.

Referenced by fillMaterialDifferences(), and produceAndSaveSummaryPlot().