test
CMS 3D CMS Logo

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

Public Member Functions

 ListGroups (const edm::ParameterSet &)
 
virtual ~ListGroups ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 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 83 of file ListGroups.cc.

Constructor & Destructor Documentation

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

Definition at line 118 of file ListGroups.cc.

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

118  {
119  m_saveSummaryPlot = iPSet.getUntrackedParameter<bool>("SaveSummaryPlot");
120  m_plots.clear();
121  m_groups.clear();
122  TColor::InitializeColors();
123  fillColor();
125  fillGradient();
126 }
T getUntrackedParameter(std::string const &, T const &) const
void fillColor()
Definition: ListGroups.cc:174
std::vector< TH2F * > m_plots
Definition: ListGroups.cc:99
bool m_saveSummaryPlot
Definition: ListGroups.cc:98
void fillGradient()
Definition: ListGroups.cc:139
std::vector< MaterialAccountingGroup * > m_groups
Definition: ListGroups.cc:101
ListGroups::~ListGroups ( )
virtual

Definition at line 128 of file ListGroups.cc.

References g, m_groups, m_plots, and bigModule::plot().

128  {
129  for (auto plot : m_plots)
130  delete plot;
131 
132  if (m_groups.size())
133  for (auto g : m_groups)
134  delete g;
135 }
std::vector< TH2F * > m_plots
Definition: ListGroups.cc:99
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 plot
Definition: bigModule.py:19
std::vector< MaterialAccountingGroup * > m_groups
Definition: ListGroups.cc:101

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 420 of file ListGroups.cc.

References DDFilteredView::addFilter(), gather_cfg::cout, dddGetString(), alcazmumu_cfi::filter, DDFilteredView::geoHistory(), edm::EventSetup::get(), h, m_group_names, m_saveSummaryPlot, DDFilteredView::next(), not_equals, position, produceAndSaveSummaryPlot(), DDSpecificsFilter::setCriteria(), and DDFilteredView::translation().

420  {
422  setup.get<IdealGeometryRecord>().get( hDdd );
423  DDFilteredView fv(*hDdd);
424 
426  filter.setCriteria(DDValue("TrackingMaterialGroup", ""), DDCompOp::not_equals);
427  fv.addFilter(filter);
428 
429  while (fv.next()) {
430  // print the group name and full hierarchy of all items
431  std::cout << dddGetString("TrackingMaterialGroup", fv) << '\t';
432  m_group_names.insert(dddGetString("TrackingMaterialGroup", fv));
433 
434  // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
435  const DDGeoHistory & history = fv.geoHistory();
436  std::cout << '/';
437  for (unsigned int h = 2; h < history.size(); ++h)
438  std::cout << '/' << history[h].logicalPart().name().name() << '[' << history[h].copyno() << ']';
439 
440  // DD3Vector and DDTranslation are the same type as math::XYZVector
441  math::XYZVector position = fv.translation() / 10.; // mm -> cm
442  std::cout << "\t" << position << std::endl;
443  };
444  std::cout << std::endl;
445 
446  if (m_saveSummaryPlot)
448 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void produceAndSaveSummaryPlot(const edm::EventSetup &)
Definition: ListGroups.cc:297
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
bool m_saveSummaryPlot
Definition: ListGroups.cc:98
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const T & get() const
Definition: EventSetup.h:56
std::set< std::string > m_group_names
Definition: ListGroups.cc:100
static int position[264][3]
Definition: ReadPGInfo.cc:509
tuple cout
Definition: gather_cfg.py:145
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:245
static std::string dddGetString(const std::string &s, DDFilteredView const &view)
Definition: ListGroups.cc:69
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:32
void ListGroups::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file ListGroups.cc.

91 {}
void ListGroups::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 451 of file ListGroups.cc.

451  {
452 }
void ListGroups::fillColor ( void  )
private

Definition at line 174 of file ListGroups.cc.

References m_color.

Referenced by ListGroups().

175 {
176  m_color.push_back(kBlack); // unassigned
177 
178  m_color.push_back(kAzure); // PixelBarrelLayer0
179  m_color.push_back(kAzure + 1) ; // Layer1_Z0
180  m_color.push_back(kAzure + 2) ; // Layer1_Z10
181  m_color.push_back(kAzure + 3) ; // Layer2_Z0
182  m_color.push_back(kAzure + 10); // Layer2_Z15
183 
184  m_color.push_back(kGreen); // EndCapDisk1_R0
185  m_color.push_back(kGreen + 2); // EndcapDisk1_R11
186  m_color.push_back(kGreen + 4); // EndcapDisk1_R7
187  m_color.push_back(kSpring + 9); // EndcapDisk2_R0
188  m_color.push_back(kSpring + 4); // EndcapDisk2_R7
189 
190  m_color.push_back(kRed); // TECDisk0_R20
191  m_color.push_back(kRed + 2); // TECDisk0_R40
192  m_color.push_back(kRed - 7); // TECDisk0_R50
193  m_color.push_back(kRed - 5); // TECDisk0_R60
194  m_color.push_back(kRed - 10); // TECDisk0_R90
195  m_color.push_back(kRed - 3); // TECDisk1_R20
196  m_color.push_back(kPink - 2); // TECDisk2_R20
197  m_color.push_back(kPink + 9); // TECDisk3
198  m_color.push_back(kMagenta - 2); // TECDisk4_R33
199  m_color.push_back(kMagenta - 4); // TECDisk5_R33
200  m_color.push_back(kRed); // TECDisk6
201  m_color.push_back(kMagenta - 9); // TECDisk7_R40
202  m_color.push_back(kViolet); // TECDisk8
203 
204  m_color.push_back(kOrange + 9); // TIBLayer0_Z0
205  m_color.push_back(kOrange + 7); // TIBLayer0_Z20
206  m_color.push_back(kOrange - 2); // TIBLayer1_Z0
207  m_color.push_back(kOrange - 3); // TIBLayer1_Z30
208  m_color.push_back(kOrange + 4); // TIBLayer2_Z0
209  m_color.push_back(kOrange - 7); // TIBLayer2_Z40
210  m_color.push_back(kOrange); // TIBLayer3_Z0
211  m_color.push_back(kOrange + 10); // TIBLayer3_Z50
212 
213  m_color.push_back(kViolet + 10); // TIDDisk1_R0
214  m_color.push_back(kViolet + 6); // TIDDisk1_R30
215  m_color.push_back(kViolet - 7); // TIDDisk2_R25
216  m_color.push_back(kViolet - 1); // TIDDisk2_R30
217  m_color.push_back(kViolet + 9); // TIDDisk2_R40
218  m_color.push_back(kViolet); // TIDDisk3_R24
219 
220  m_color.push_back(kAzure ); // TOBLayer0_Z0
221  m_color.push_back(kAzure + 8); // TOBLayer0_Z20
222  m_color.push_back(kAzure + 2); // TOBLayer0_Z70
223  m_color.push_back(kCyan + 1); // TOBLayer1_Z0
224  m_color.push_back(kCyan - 9); // TOBLayer1_Z20
225  m_color.push_back(kCyan + 3); // TOBLayer1_Z80
226  m_color.push_back(kAzure ); // TOBLayer2_Z0
227  m_color.push_back(kAzure + 8); // TOBLayer2_Z25
228  m_color.push_back(kAzure + 2); // TOBLayer2_Z80
229  m_color.push_back(kCyan + 1); // TOBLayer3_Z0
230  m_color.push_back(kCyan - 9); // TOBLayer3_Z25
231  m_color.push_back(kCyan + 3); // TOBLayer3_Z80
232  m_color.push_back(kAzure ); // TOBLayer4_Z0
233  m_color.push_back(kAzure + 8); // TOBLayer4_Z25
234  m_color.push_back(kAzure + 2); // TOBLayer4_Z80
235  m_color.push_back(kCyan + 1); // TOBLayer5_Z0
236  m_color.push_back(kCyan - 9); // TOBLayer5_Z25
237  m_color.push_back(kCyan + 3); // TOBLayer5_Z80
238 }
std::vector< unsigned int > m_color
Definition: ListGroups.cc:102
void ListGroups::fillGradient ( void  )
private

Definition at line 139 of file ListGroups.cc.

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

Referenced by ListGroups().

140 {
141  m_gradient.reserve(200);
142  unsigned int steps = 100;
143  // if no index was given, find the highest used one and start from that plus one
144  unsigned int index = ((TObjArray*) gROOT->GetListOfColors())->GetLast() + 1;
145 
146  float r1, g1, b1, r2, g2, b2;
147  static_cast<TColor *>(gROOT->GetListOfColors()->At(kBlue + 1))->GetRGB(r1, g1, b1);
148  static_cast<TColor *>(gROOT->GetListOfColors()->At(kAzure + 10))->GetRGB(r2, g2, b2);
149  float delta_r = (r2 - r1) / (steps - 1);
150  float delta_g = (g2 - g1) / (steps - 1);
151  float delta_b = (b2 - b1) / (steps - 1);
152 
153  m_gradient.push_back(kBlue + 4); // Underflow lowest bin
154  unsigned int ii = 0;
155  for (unsigned int i = 0; i < steps; ++i, ++ii) {
156  new TColor(static_cast<Int_t>(index + ii), r1 + delta_r * i, g1 + delta_g * i, b1 + delta_b * i);
157  m_gradient.push_back(index + ii);
158  }
159 
160  m_gradient.push_back(kWhite); // 0 level perfectly white
161 
162  static_cast<TColor *>(gROOT->GetListOfColors()->At(kOrange))->GetRGB(r1, g1, b1);
163  static_cast<TColor *>(gROOT->GetListOfColors()->At(kOrange + 7))->GetRGB(r2, g2, b2);
164  delta_r = (r2 - r1) / (steps - 1);
165  delta_g = (g2 - g1) / (steps - 1);
166  delta_b = (b2 - b1) / (steps - 1);
167  for (unsigned int i = 0; i < steps; ++i, ++ii) {
168  new TColor(static_cast<Int_t>(index + ii), r1 + delta_r * i, g1 + delta_g * i, b1 + delta_b * i);
169  m_gradient.push_back(index + ii);
170  }
171  m_gradient.push_back(kRed); // Overflow highest bin
172 }
int i
Definition: DBlmapReader.cc:9
int ii
Definition: cuy.py:588
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
std::vector< int > m_gradient
Definition: ListGroups.cc:103
void ListGroups::fillMaterialDifferences ( )
private

Definition at line 5 of file ListGroupsMaterialDifference.h.

References m_diff, and m_values.

Referenced by ListGroups().

5  {
6  m_diff["TrackerRecMaterialTIBLayer0_Z20"] = std::make_pair<float, float>(16.056814, 16.197765);
7  m_diff["TrackerRecMaterialTECDisk0_R60"] = std::make_pair<float, float>(-31.053877, -32.702841);
8  m_diff["TrackerRecMaterialTOBLayer1_Z80"] = std::make_pair<float, float>(37.773095, 35.473046);
9  m_diff["TrackerRecMaterialPixelBarrelLayer1_Z0"] = std::make_pair<float, float>(2.628493, 2.343161);
10  m_diff["TrackerRecMaterialTECDisk0_R40"] = std::make_pair<float, float>(-16.302043, -20.209075);
11  m_diff["TrackerRecMaterialTOBLayer2_Z0"] = std::make_pair<float, float>(-3.903762, -4.026092);
12  m_diff["TrackerRecMaterialTOBLayer0_Z70"] = std::make_pair<float, float>(-18.365167, -20.564701);
13  m_diff["TrackerRecMaterialTECDisk0_R20"] = std::make_pair<float, float>(-19.665578, -14.100912);
14  m_diff["TrackerRecMaterialTOBLayer5_Z80"] = std::make_pair<float, float>(-41.741597, -42.000203);
15  m_diff["TrackerRecMaterialTECDisk1_R20"] = std::make_pair<float, float>(-4.724476, 0.014484);
16  m_diff["TrackerRecMaterialTOBLayer5_Z0"] = std::make_pair<float, float>(-31.354385, -35.726992);
17  m_diff["TrackerRecMaterialTECDisk8"] = std::make_pair<float, float>(-39.229430, -41.076982);
18  m_diff["TrackerRecMaterialTIDDisk3_R24"] = std::make_pair<float, float>(63.555382, 72.113454);
19  m_diff["TrackerRecMaterialTECDisk4_R33"] = std::make_pair<float, float>(-6.129653, -6.884744);
20  m_diff["TrackerRecMaterialTIBLayer1_Z0"] = std::make_pair<float, float>(7.350312, 7.198940);
21  m_diff["TrackerRecMaterialPixelEndcapDisk1_R11"] = std::make_pair<float, float>(86.105652, 116.582316);
22  m_diff["TrackerRecMaterialTIBLayer0_Z0"] = std::make_pair<float, float>(21.218330, 20.825005);
23  m_diff["TrackerRecMaterialTOBLayer3_Z25"] = std::make_pair<float, float>(3.797834, 4.132097);
24  m_diff["TrackerRecMaterialTIBLayer1_Z30"] = std::make_pair<float, float>(3.929696, 3.008632);
25  m_diff["TrackerRecMaterialPixelBarrelLayer1_Z10"] = std::make_pair<float, float>(18.790396, 17.923943);
26  m_diff["TrackerRecMaterialTIBLayer2_Z40"] = std::make_pair<float, float>(25.751494, 22.926114);
27  m_diff["TrackerRecMaterialTOBLayer1_Z20"] = std::make_pair<float, float>(5.392382, 5.459755);
28  m_diff["TrackerRecMaterialTOBLayer0_Z0"] = std::make_pair<float, float>(-34.655877, -37.651873);
29  m_diff["TrackerRecMaterialPixelBarrelLayer0"] = std::make_pair<float, float>(2.362646, 1.598524);
30  m_diff["TrackerRecMaterialTIDDisk2_R40"] = std::make_pair<float, float>(103.392632, 112.846575);
31  m_diff["TrackerRecMaterialTIBLayer3_Z0"] = std::make_pair<float, float>(33.793044, 45.410855);
32  m_diff["TrackerRecMaterialTOBLayer3_Z80"] = std::make_pair<float, float>(13.606804, 13.730074);
33  m_diff["TrackerRecMaterialTOBLayer4_Z80"] = std::make_pair<float, float>(-12.848132, -12.758552);
34  m_diff["TrackerRecMaterialPixelEndcapDisk1_R0"] = std::make_pair<float, float>(-32.787435, -31.362235);
35  m_diff["TrackerRecMaterialTOBLayer0_Z20"] = std::make_pair<float, float>(-6.897368, -10.046793);
36  m_diff["TrackerRecMaterialTIBLayer2_Z0"] = std::make_pair<float, float>(-9.398575, -8.540885);
37  m_diff["TrackerRecMaterialPixelEndcapDisk1_R7"] = std::make_pair<float, float>(-17.251968, -14.476754);
38  m_diff["TrackerRecMaterialTECDisk2_R20"] = std::make_pair<float, float>(33.191342, 40.571136);
39  m_diff["TrackerRecMaterialTIDDisk1_R30"] = std::make_pair<float, float>(-8.062821, -7.260307);
40  m_diff["TrackerRecMaterialTECDisk0_R50"] = std::make_pair<float, float>(-35.201551, -34.354707);
41  m_diff["TrackerRecMaterialPixelBarrelLayer2_Z0"] = std::make_pair<float, float>(3.381062, 4.240147);
42  m_diff["TrackerRecMaterialPixelEndcapDisk2_R7"] = std::make_pair<float, float>(206.142827, 202.283633);
43  m_diff["TrackerRecMaterialTIBLayer3_Z50"] = std::make_pair<float, float>(26.073600, 30.486041);
44  m_diff["TrackerRecMaterialPixelEndcapDisk2_R0"] = std::make_pair<float, float>(195.026143, 135.175768);
45  m_diff["TrackerRecMaterialPixelBarrelLayer2_Z15"] = std::make_pair<float, float>(124.213813, 135.002863);
46  m_diff["TrackerRecMaterialTECDisk7_R40"] = std::make_pair<float, float>(-13.429937, -14.434337);
47  m_diff["TrackerRecMaterialTIDDisk2_R25"] = std::make_pair<float, float>(-31.190078, -29.539836);
48  m_diff["TrackerRecMaterialTECDisk6"] = std::make_pair<float, float>(-9.605091, -8.460534);
49  m_diff["TrackerRecMaterialTOBLayer3_Z0"] = std::make_pair<float, float>(1.565944, 0.947421);
50  m_diff["TrackerRecMaterialTECDisk3"] = std::make_pair<float, float>(-3.392546, -3.618323);
51  m_diff["TrackerRecMaterialTOBLayer2_Z25"] = std::make_pair<float, float>(-8.243715, -8.749472);
52  m_diff["TrackerRecMaterialTOBLayer4_Z0"] = std::make_pair<float, float>(-2.095964, -1.552227);
53  m_diff["TrackerRecMaterialTECDisk5_R33"] = std::make_pair<float, float>(4.152597, 6.635490);
54  m_diff["TrackerRecMaterialTECDisk0_R90"] = std::make_pair<float, float>(-30.153410, -34.845443);
55  m_diff["TrackerRecMaterialTOBLayer1_Z0"] = std::make_pair<float, float>(1.294771, 2.545614);
56  m_diff["TrackerRecMaterialTIDDisk1_R0"] = std::make_pair<float, float>(-32.558493, -33.779383);
57  m_diff["TrackerRecMaterialTOBLayer5_Z25"] = std::make_pair<float, float>(-41.702933, -43.418149);
58  m_diff["TrackerRecMaterialTOBLayer4_Z25"] = std::make_pair<float, float>(3.769187, 4.183828);
59  m_diff["TrackerRecMaterialTOBLayer2_Z80"] = std::make_pair<float, float>(41.451692, 37.917966);
60  m_diff["TrackerRecMaterialTIDDisk2_R30"] = std::make_pair<float, float>(10.175168, 10.027210);
61  m_values["TrackerRecMaterialTIBLayer0_Z20"] = std::make_pair<float, float>(0.097308, 0.000207);
62  m_values["TrackerRecMaterialTECDisk0_R60"] = std::make_pair<float, float>(0.199568, 0.000369);
63  m_values["TrackerRecMaterialTOBLayer1_Z80"] = std::make_pair<float, float>(0.075314, 0.000144);
64  m_values["TrackerRecMaterialPixelBarrelLayer1_Z0"] = std::make_pair<float, float>(0.020303, 0.000037);
65  m_values["TrackerRecMaterialTECDisk0_R40"] = std::make_pair<float, float>(0.084373, 0.000209);
66  m_values["TrackerRecMaterialTOBLayer2_Z0"] = std::make_pair<float, float>(0.014846, 0.000033);
67  m_values["TrackerRecMaterialTOBLayer0_Z70"] = std::make_pair<float, float>(0.104713, 0.000208);
68  m_values["TrackerRecMaterialTECDisk0_R20"] = std::make_pair<float, float>(0.165991, 0.000416);
69  m_values["TrackerRecMaterialTOBLayer5_Z80"] = std::make_pair<float, float>(0.022016, 0.000043);
70  m_values["TrackerRecMaterialTECDisk1_R20"] = std::make_pair<float, float>(0.067783, 0.000159);
71  m_values["TrackerRecMaterialTOBLayer5_Z0"] = std::make_pair<float, float>(0.010152, 0.000021);
72  m_values["TrackerRecMaterialTECDisk8"] = std::make_pair<float, float>(0.027502, 0.000060);
73  m_values["TrackerRecMaterialTIDDisk3_R24"] = std::make_pair<float, float>(0.157092, 0.000377);
74  m_values["TrackerRecMaterialTECDisk4_R33"] = std::make_pair<float, float>(0.047624, 0.000110);
75  m_values["TrackerRecMaterialTIBLayer1_Z0"] = std::make_pair<float, float>(0.049595, 0.000102);
76  m_values["TrackerRecMaterialPixelEndcapDisk1_R11"] = std::make_pair<float, float>(0.188445, 0.000395);
77  m_values["TrackerRecMaterialTIBLayer0_Z0"] = std::make_pair<float, float>(0.060527, 0.000138);
78  m_values["TrackerRecMaterialTOBLayer3_Z25"] = std::make_pair<float, float>(0.035527, 0.000071);
79  m_values["TrackerRecMaterialTIBLayer1_Z30"] = std::make_pair<float, float>(0.068575, 0.000137);
80  m_values["TrackerRecMaterialPixelBarrelLayer1_Z10"] = std::make_pair<float, float>(0.026080, 0.000047);
81  m_values["TrackerRecMaterialTIBLayer2_Z40"] = std::make_pair<float, float>(0.077096, 0.000154);
82  m_values["TrackerRecMaterialTOBLayer1_Z20"] = std::make_pair<float, float>(0.052055, 0.000103);
83  m_values["TrackerRecMaterialTOBLayer0_Z0"] = std::make_pair<float, float>(0.029078, 0.000069);
84  m_values["TrackerRecMaterialPixelBarrelLayer0"] = std::make_pair<float, float>(0.026307, 0.000055);
85  m_values["TrackerRecMaterialTIDDisk2_R40"] = std::make_pair<float, float>(0.142732, 0.000309);
86  m_values["TrackerRecMaterialTIBLayer3_Z0"] = std::make_pair<float, float>(0.047740, 0.000109);
87  m_values["TrackerRecMaterialTOBLayer3_Z80"] = std::make_pair<float, float>(0.042836, 0.000083);
88  m_values["TrackerRecMaterialTOBLayer4_Z80"] = std::make_pair<float, float>(0.032720, 0.000064);
89  m_values["TrackerRecMaterialPixelEndcapDisk1_R0"] = std::make_pair<float, float>(0.077026, 0.000152);
90  m_values["TrackerRecMaterialTOBLayer0_Z20"] = std::make_pair<float, float>(0.063733, 0.000138);
91  m_values["TrackerRecMaterialTIBLayer2_Z0"] = std::make_pair<float, float>(0.036641, 0.000077);
92  m_values["TrackerRecMaterialPixelEndcapDisk1_R7"] = std::make_pair<float, float>(0.090302, 0.000177);
93  m_values["TrackerRecMaterialTECDisk2_R20"] = std::make_pair<float, float>(0.071509, 0.000170);
94  m_values["TrackerRecMaterialTIDDisk1_R30"] = std::make_pair<float, float>(0.166250, 0.000318);
95  m_values["TrackerRecMaterialTECDisk0_R50"] = std::make_pair<float, float>(0.107927, 0.000255);
96  m_values["TrackerRecMaterialPixelBarrelLayer2_Z0"] = std::make_pair<float, float>(0.021162, 0.000039);
97  m_values["TrackerRecMaterialPixelEndcapDisk2_R7"] = std::make_pair<float, float>(0.208490, 0.000405);
98  m_values["TrackerRecMaterialTIBLayer3_Z50"] = std::make_pair<float, float>(0.063859, 0.000138);
99  m_values["TrackerRecMaterialPixelEndcapDisk2_R0"] = std::make_pair<float, float>(0.080746, 0.000193);
100  m_values["TrackerRecMaterialPixelBarrelLayer2_Z15"] = std::make_pair<float, float>(0.050700, 0.000096);
101  m_values["TrackerRecMaterialTECDisk7_R40"] = std::make_pair<float, float>(0.039263, 0.000089);
102  m_values["TrackerRecMaterialTIDDisk2_R25"] = std::make_pair<float, float>(0.078947, 0.000193);
103  m_values["TrackerRecMaterialTECDisk6"] = std::make_pair<float, float>(0.042541, 0.000097);
104  m_values["TrackerRecMaterialTOBLayer3_Z0"] = std::make_pair<float, float>(0.015112, 0.000033);
105  m_values["TrackerRecMaterialTECDisk3"] = std::make_pair<float, float>(0.045525, 0.000103);
106  m_values["TrackerRecMaterialTOBLayer2_Z25"] = std::make_pair<float, float>(0.035033, 0.000070);
107  m_values["TrackerRecMaterialTOBLayer4_Z0"] = std::make_pair<float, float>(0.014550, 0.000032);
108  m_values["TrackerRecMaterialTECDisk5_R33"] = std::make_pair<float, float>(0.054963, 0.000130);
109  m_values["TrackerRecMaterialTECDisk0_R90"] = std::make_pair<float, float>(0.194638, 0.000310);
110  m_values["TrackerRecMaterialTOBLayer1_Z0"] = std::make_pair<float, float>(0.023298, 0.000050);
111  m_values["TrackerRecMaterialTIDDisk1_R0"] = std::make_pair<float, float>(0.204252, 0.000414);
112  m_values["TrackerRecMaterialTOBLayer5_Z25"] = std::make_pair<float, float>(0.021138, 0.000042);
113  m_values["TrackerRecMaterialTOBLayer4_Z25"] = std::make_pair<float, float>(0.036019, 0.000073);
114  m_values["TrackerRecMaterialTOBLayer2_Z80"] = std::make_pair<float, float>(0.061188, 0.000116);
115  m_values["TrackerRecMaterialTIDDisk2_R30"] = std::make_pair<float, float>(0.065136, 0.000144);
116 
117 }
std::map< std::string, std::pair< float, float > > m_diff
Definition: ListGroups.cc:114
std::map< std::string, std::pair< float, float > > m_values
Definition: ListGroups.cc:115
std::vector< std::pair< std::shared_ptr< TLine >, std::shared_ptr< TText > > > ListGroups::overlayEtaReferences ( )
private

Definition at line 241 of file ListGroups.cc.

References deltaR(), eta, create_public_lumi_plots::exp, cmsPerfStripChart::format, groupFilesInBlocks::lines, funct::tan(), and theta().

Referenced by produceAndSaveSummaryPlot().

241  {
242  std::vector<std::pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > > lines;
243 
244  lines.reserve(40);
245  std::pair<float, float> deltaZ(293, 298);
246  std::pair<float, float> deltaR(115, 118);
247  float text_size = 0.033;
248 
249  for (float eta = 0.; eta <= 3.8; eta += 0.2) {
250  float theta = 2. * atan (exp(-eta));
251  if (eta >= 1.8) {
252  lines.push_back(
253  std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > (
254  std::make_shared<TLine>(
255  deltaZ.first, deltaZ.first * tan(theta), deltaZ.second, deltaZ.second * tan(theta)),
256  std::make_shared<TText>(
257  deltaZ.first, deltaZ.first * tan(theta), str(boost::format("%2.1f") % eta).c_str())));
258  lines.back().second->SetTextFont(42);
259  lines.back().second->SetTextSize(text_size);
260  lines.back().second->SetTextAlign(33);
261  lines.push_back(
262  std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > (
263  std::make_shared<TLine>(
264  -deltaZ.first, deltaZ.first * tan(theta), -deltaZ.second, deltaZ.second * tan(theta)),
265  std::make_shared<TText>(
266  -deltaZ.first, deltaZ.first * tan(theta), str(boost::format("-%2.1f") % eta).c_str())));
267  lines.back().second->SetTextFont(42);
268  lines.back().second->SetTextSize(text_size);
269  lines.back().second->SetTextAlign(13);
270  } else {
271  lines.push_back(
272  std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > (
273  std::make_shared<TLine>(
274  deltaR.first / tan(theta), deltaR.first, deltaR.second / tan(theta), deltaR.second),
275  std::make_shared<TText>(
276  deltaR.first / tan(theta), deltaR.first, str(boost::format("%2.1f") % eta).c_str())));
277  lines.back().second->SetTextFont(42);
278  lines.back().second->SetTextSize(text_size);
279  lines.back().second->SetTextAlign(23);
280  if (eta != 0) {
281  lines.push_back(
282  std::make_pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > (
283  std::make_shared<TLine>(
284  - deltaR.first / tan(theta), deltaR.first, - deltaR.second / tan(theta), deltaR.second),
285  std::make_shared<TText>(
286  - deltaR.first / tan(theta), deltaR.first, str(boost::format("-%2.1f") % eta).c_str())));
287  lines.back().second->SetTextFont(42);
288  lines.back().second->SetTextSize(text_size);
289  lines.back().second->SetTextAlign(23);
290  }
291  }
292  }
293  return lines;
294 }
Geom::Theta< T > theta() const
string format
Some error handling for the usage.
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
void ListGroups::produceAndSaveSummaryPlot ( const edm::EventSetup setup)
private

Definition at line 297 of file ListGroups.cc.

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

Referenced by analyze().

297  {
298  const double scale = 10.;
299  std::vector<TText *> nukem_text;
300 
302  setup.get<IdealGeometryRecord>().get( hDdd );
303 
304  for (auto n : m_group_names) {
305  m_groups.push_back( new MaterialAccountingGroup(n, *hDdd) );
306  };
307 
308  std::unique_ptr<TCanvas> canvas(
309  new TCanvas("Grouping_rz", "Grouping - RZ view",
310  (int) (600 * scale * 1.25), (int) (120 * scale * 1.50)));
311  canvas->GetFrame()->SetFillColor(kWhite);
312  gStyle->SetOptStat(0);
313 
314  unsigned int color_index = 1;
315  // Setup the legend
316  std::unique_ptr<TLegend> leg(new TLegend(0.1,0.1,0.23,0.34));
317  leg->SetHeader("Tracker Material Grouping");
318  leg->SetTextFont(42);
319  leg->SetTextSize(0.008);
320  leg->SetNColumns(3);
321  std::unique_ptr<TProfile2D> radlen(
322  new TProfile2D( "OverallRadLen", "OverallRadLen",
323  600., -300., 300, 120., 0., 120.));
324  std::unique_ptr<TProfile2D> eneloss(
325  new TProfile2D( "OverallEnergyLoss", "OverallEnergyLoss",
326  600., -300., 300, 120., 0., 120.));
327  std::unique_ptr<TProfile2D> radlen_diff(
328  new TProfile2D( "OverallDifferencesRadLen", "OverallDifferencesRadLen",
329  600., -300., 300, 120., 0., 120.));
330  std::unique_ptr<TProfile2D> eneloss_diff(
331  new TProfile2D( "OverallDifferencesEnergyLoss", "OverallDifferencesEnergyLoss",
332  600., -300., 300, 120., 0., 120.));
333 
334  for (auto g : m_groups) {
335  m_plots.push_back(
336  new TH2F( g->name().c_str(), g->name().c_str(),
337  6000., -300., 300, 1200., 0., 120.)); // 10x10 points per cm2
338  TH2F &current = *m_plots.back();
339  current.SetMarkerColor(m_color[color_index]);
340  current.SetMarkerStyle( color_index%2 == 0 ? kFullCircle : kOpenCircle);
341  current.SetMarkerSize(0.8);
342  for (auto element : g->elements()) {
343  current.Fill(element.z(), element.perp());
344  radlen->Fill(element.z(), element.perp(), m_values[g->name()].first);
345  eneloss->Fill(element.z(), element.perp(), m_values[g->name()].second);
346  radlen_diff->Fill(element.z(), element.perp(), m_diff[g->name()].first);
347  eneloss_diff->Fill(element.z(), element.perp(), m_diff[g->name()].second);
348  }
349 
350  if (color_index == 1)
351  current.Draw();
352  else
353  current.Draw("SAME");
354 
355  leg->AddEntry(&current , g->name().c_str(), "lp")->SetTextColor(m_color[color_index]);
356  color_index++;
357 
358  // Loop over the same chromatic scale in case the number of
359  // allocated colors is not big enough.
360  color_index = color_index%m_color.size();
361  }
362  leg->Draw();
363  canvas->SaveAs("Grouping.png");
364 
365  std::vector<std::pair<std::shared_ptr<TLine>, std::shared_ptr<TText> > > lines = overlayEtaReferences();
366 
367  canvas->Clear();
368  radlen->SetMinimum(0);
369  radlen->SetMaximum(0.25);
370  radlen->Draw("COLZ");
371  for (auto line : lines) {
372  line.first->SetLineWidth(5);
373  line.first->Draw();
374  line.second->Draw();
375  }
376  canvas->SaveAs("RadLenValues.png");
377 
378  canvas->Clear();
379  eneloss->SetMinimum(0.00001);
380  eneloss->SetMaximum(0.0005);
381  eneloss->Draw("COLZ");
382  for (auto line : lines) {
383  line.first->SetLineWidth(5);
384  line.first->Draw();
385  line.second->Draw();
386  }
387  canvas->SaveAs("EnergyLossValues.png");
388 
389  canvas->Clear();
390  gStyle->SetPalette( m_gradient.size(), & m_gradient.front() );
391  gStyle->SetNumberContours( m_gradient.size() );
392  radlen_diff->SetMinimum(-100);
393  radlen_diff->SetMaximum(100);
394  radlen_diff->Draw("COLZ");
395  for (auto line : lines) {
396  line.first->SetLineWidth(5);
397  line.first->Draw();
398  line.second->Draw();
399  }
400  canvas->SaveAs("RadLenChanges.png");
401 
402  canvas->Clear();
403  eneloss_diff->SetMinimum(-100);
404  eneloss_diff->SetMaximum(100);
405  eneloss_diff->Draw("COLZ");
406  for (auto line : lines) {
407  line.first->SetLineWidth(5);
408  line.first->Draw();
409  line.second->Draw();
410  }
411  canvas->SaveAs("EnergyLossChanges.png");
412 
413  for (auto g : nukem_text)
414  delete g;
415 
416 }
std::vector< TH2F * > m_plots
Definition: ListGroups.cc:99
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:481
std::vector< std::pair< std::shared_ptr< TLine >, std::shared_ptr< TText > > > overlayEtaReferences()
Definition: ListGroups.cc:241
std::vector< unsigned int > m_color
Definition: ListGroups.cc:102
std::map< std::string, std::pair< float, float > > m_diff
Definition: ListGroups.cc:114
const T & get() const
Definition: EventSetup.h:56
std::set< std::string > m_group_names
Definition: ListGroups.cc:100
std::vector< MaterialAccountingGroup * > m_groups
Definition: ListGroups.cc:101
std::vector< int > m_gradient
Definition: ListGroups.cc:103
std::map< std::string, std::pair< float, float > > m_values
Definition: ListGroups.cc:115

Member Data Documentation

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

Definition at line 102 of file ListGroups.cc.

Referenced by fillColor(), and produceAndSaveSummaryPlot().

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

Definition at line 114 of file ListGroups.cc.

Referenced by fillMaterialDifferences(), and produceAndSaveSummaryPlot().

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

Definition at line 103 of file ListGroups.cc.

Referenced by fillGradient(), and produceAndSaveSummaryPlot().

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

Definition at line 100 of file ListGroups.cc.

Referenced by analyze(), and produceAndSaveSummaryPlot().

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

Definition at line 101 of file ListGroups.cc.

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

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

Definition at line 99 of file ListGroups.cc.

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

bool ListGroups::m_saveSummaryPlot
private

Definition at line 98 of file ListGroups.cc.

Referenced by analyze(), and ListGroups().

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

Definition at line 115 of file ListGroups.cc.

Referenced by fillMaterialDifferences(), and produceAndSaveSummaryPlot().