CMS 3D CMS Logo

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

Public Member Functions

 MaterialBudgetVolumeAnalysis (edm::ParameterSet const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void bookHisto ()
 

Private Attributes

const int binEta_
 
const int binPhi_
 
const double etaHigh_
 
const double etaLow_
 
std::vector< TProfile * > meIntLEta_
 
std::vector< TProfile2D * > meIntLEtaPhi_
 
std::vector< TProfile * > meIntLPhi_
 
std::vector< TProfile * > meRadLEta_
 
std::vector< TProfile2D * > meRadLEtaPhi_
 
std::vector< TProfile * > meRadLPhi_
 
std::vector< TProfile * > meStepEta_
 
std::vector< TProfile2D * > meStepEtaPhi_
 
std::vector< TProfile * > meStepPhi_
 
const std::vector< std::string > names_
 
const double phiHigh_
 
const double phiLow_
 
const edm::InputTag tag_
 
edm::EDGetTokenT< edm::MaterialInformationContainertok_info_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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 27 of file MaterialBudgetVolumeAnalysis.cc.

Constructor & Destructor Documentation

◆ MaterialBudgetVolumeAnalysis()

MaterialBudgetVolumeAnalysis::MaterialBudgetVolumeAnalysis ( edm::ParameterSet const &  p)
explicit

Definition at line 48 of file MaterialBudgetVolumeAnalysis.cc.

References binEta_, binPhi_, bookHisto(), etaHigh_, etaLow_, isotrackApplyRegressor::k, TFileService::kSharedResource, names_, tag_, and tok_info_.

49  : names_(p.getParameter<std::vector<std::string> >("names")),
50  tag_(p.getParameter<edm::InputTag>("inputTag")),
51  binEta_(p.getParameter<int>("nBinEta")),
52  binPhi_(p.getParameter<int>("nBinPhi")),
53  etaLow_(p.getParameter<double>("etaLow")),
54  etaHigh_(p.getParameter<double>("etaHigh")),
55  phiLow_(-1._pi),
56  phiHigh_(1._pi) {
57  usesResource(TFileService::kSharedResource);
58  tok_info_ = consumes<edm::MaterialInformationContainer>(tag_);
59 
60  edm::LogVerbatim("MaterialBudget") << "MaterialBudgetVolumeAnalysis: Eta plot: NX " << binEta_ << " Range "
61  << -etaLow_ << ":" << etaHigh_ << " Phi plot: NX " << binPhi_ << " Range "
62  << -1._pi << ":" << 1._pi << " for " << names_.size() << " detectors from "
63  << tag_;
64  std::ostringstream st1;
65  for (unsigned int k = 0; k < names_.size(); ++k)
66  st1 << " [" << k << "] " << names_[k];
67  edm::LogVerbatim("MaterialBudget") << "MaterialBudgetVolume: " << st1.str();
68  bookHisto();
69 }
static const std::string kSharedResource
Definition: TFileService.h:76
Log< level::Info, true > LogVerbatim
const std::vector< std::string > names_
edm::EDGetTokenT< edm::MaterialInformationContainer > tok_info_

Member Function Documentation

◆ analyze()

void MaterialBudgetVolumeAnalysis::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 96 of file MaterialBudgetVolumeAnalysis.cc.

References spr::find(), iEvent, edm::HandleBase::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, isotrackApplyRegressor::k, meIntLEta_, meIntLEtaPhi_, meIntLPhi_, meRadLEta_, meRadLEtaPhi_, meRadLPhi_, meStepEta_, meStepEtaPhi_, meStepPhi_, names_, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::ntot, edm::Handle< T >::product(), and tok_info_.

96  {
97  edm::Handle<edm::MaterialInformationContainer> materialInformationContainer;
98  iEvent.getByToken(tok_info_, materialInformationContainer);
99 #ifdef EDM_ML_DEBUG
100  unsigned int nsize(0), ntot(0), nused(0);
101 #endif
102  if (materialInformationContainer.isValid()) {
103 #ifdef EDM_ML_DEBUG
104  nsize = materialInformationContainer->size();
105 #endif
106  for (const auto& it : *(materialInformationContainer.product())) {
107 #ifdef EDM_ML_DEBUG
108  ntot++;
109 #endif
110  if (std::find(names_.begin(), names_.end(), it.vname()) != names_.end()) {
111 #ifdef EDM_ML_DEBUG
112  nused++;
113 #endif
114  unsigned int k =
115  static_cast<unsigned int>(std::find(names_.begin(), names_.end(), it.vname()) - names_.begin());
116  meStepEta_[k]->Fill(it.trackEta(), it.stepLength());
117  meRadLEta_[k]->Fill(it.trackEta(), it.radiationLength());
118  meIntLEta_[k]->Fill(it.trackEta(), it.interactionLength());
119  meStepPhi_[k]->Fill(it.trackPhi(), it.stepLength());
120  meRadLPhi_[k]->Fill(it.trackPhi(), it.radiationLength());
121  meIntLPhi_[k]->Fill(it.trackPhi(), it.interactionLength());
122  meStepEtaPhi_[k]->Fill(it.trackEta(), it.trackPhi(), it.stepLength());
123  meRadLEtaPhi_[k]->Fill(it.trackEta(), it.trackPhi(), it.radiationLength());
124  meIntLEtaPhi_[k]->Fill(it.trackEta(), it.trackPhi(), it.interactionLength());
125  }
126  }
127  }
128 #ifdef EDM_ML_DEBUG
129  edm::LogVerbatim("MaterialBudget") << "MaterialInformation with " << nsize << ":" << ntot << " elements of which "
130  << nused << " are used";
131 #endif
132 }
Log< level::Info, true > LogVerbatim
std::vector< TProfile2D * > meStepEtaPhi_
std::vector< TProfile2D * > meIntLEtaPhi_
T const * product() const
Definition: Handle.h:70
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
int iEvent
Definition: GenABIO.cc:224
const std::vector< std::string > names_
bool isValid() const
Definition: HandleBase.h:70
std::vector< TProfile2D * > meRadLEtaPhi_
edm::EDGetTokenT< edm::MaterialInformationContainer > tok_info_

◆ bookHisto()

void MaterialBudgetVolumeAnalysis::bookHisto ( )
private

Definition at line 134 of file MaterialBudgetVolumeAnalysis.cc.

References binEta_, binPhi_, etaHigh_, etaLow_, make_classfiles::fs, isotrackApplyRegressor::k, meIntLEta_, meIntLEtaPhi_, meIntLPhi_, meRadLEta_, meRadLEtaPhi_, meRadLPhi_, meStepEta_, meStepEtaPhi_, meStepPhi_, mergeVDriftHistosByStation::name, names_, phiHigh_, phiLow_, and runGCPTkAlMap::title.

Referenced by MaterialBudgetVolumeAnalysis().

134  {
136  char name[40], title[100];
137  for (unsigned int k = 0; k < names_.size(); ++k) {
138  sprintf(name, "stepEta%s", names_[k].c_str());
139  sprintf(title, "MB(Step) vs #eta for %s", names_[k].c_str());
140  meStepEta_.emplace_back(fs->make<TProfile>(name, title, binEta_, etaLow_, etaHigh_));
141  sprintf(name, "radlEta%s", names_[k].c_str());
142  sprintf(title, "MB(X0) vs #eta for %s", names_[k].c_str());
143  meRadLEta_.emplace_back(fs->make<TProfile>(name, title, binEta_, etaLow_, etaHigh_));
144  sprintf(name, "intlEta%s", names_[k].c_str());
145  sprintf(title, "MB(L0) vs #eta for %s", names_[k].c_str());
146  meIntLEta_.emplace_back(fs->make<TProfile>(name, title, binEta_, etaLow_, etaHigh_));
147  sprintf(name, "stepPhi%s", names_[k].c_str());
148  sprintf(title, "MB(Step) vs #phi for %s", names_[k].c_str());
149  meStepPhi_.emplace_back(fs->make<TProfile>(name, title, binPhi_, phiLow_, phiHigh_));
150  sprintf(name, "radlPhi%s", names_[k].c_str());
151  sprintf(title, "MB(X0) vs #phi for %s", names_[k].c_str());
152  meRadLPhi_.emplace_back(fs->make<TProfile>(name, title, binPhi_, phiLow_, phiHigh_));
153  sprintf(name, "intlPhi%s", names_[k].c_str());
154  sprintf(title, "MB(L0) vs #phi for %s", names_[k].c_str());
155  meIntLPhi_.emplace_back(fs->make<TProfile>(name, title, binPhi_, phiLow_, phiHigh_));
156  sprintf(name, "stepEtaPhi%s", names_[k].c_str());
157  sprintf(title, "MB(Step) vs #eta and #phi for %s", names_[k].c_str());
158  meStepEtaPhi_.emplace_back(
159  fs->make<TProfile2D>(name, title, binEta_ / 2, etaLow_, etaHigh_, binPhi_ / 2, phiLow_, phiHigh_));
160  sprintf(name, "radlEtaPhi%s", names_[k].c_str());
161  sprintf(title, "MB(X0) vs #eta and #phi for %s", names_[k].c_str());
162  meRadLEtaPhi_.emplace_back(
163  fs->make<TProfile2D>(name, title, binEta_ / 2, etaLow_, etaHigh_, binPhi_ / 2, phiLow_, phiHigh_));
164  sprintf(name, "intlEtaPhi%s", names_[k].c_str());
165  sprintf(title, "MB(L0) vs #eta and #phi for %s", names_[k].c_str());
166  meIntLEtaPhi_.emplace_back(
167  fs->make<TProfile2D>(name, title, binEta_ / 2, etaLow_, etaHigh_, binPhi_ / 2, phiLow_, phiHigh_));
168  }
169 }
std::vector< TProfile2D * > meStepEtaPhi_
std::vector< TProfile2D * > meIntLEtaPhi_
const std::vector< std::string > names_
std::vector< TProfile2D * > meRadLEtaPhi_

◆ fillDescriptions()

void MaterialBudgetVolumeAnalysis::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 71 of file MaterialBudgetVolumeAnalysis.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and names.

71  {
73  std::vector<std::string> names = {"BEAM",
74  "BEAM1",
75  "BEAM2",
76  "BEAM3",
77  "BEAM4",
78  "Tracker",
79  "ECAL",
80  "HCal",
81  "MUON",
82  "VCAL",
83  "MGNT",
84  "OQUA",
85  "CALOEC",
86  "HFNoseVol"};
87  desc.add<std::vector<std::string> >("names", names);
88  desc.add<edm::InputTag>("inputTag", edm::InputTag("g4SimHits", "MaterialInformation"));
89  desc.add<int>("nBinEta", 300);
90  desc.add<int>("nBinPhi", 180);
91  desc.add<double>("etaLow", -6.0);
92  desc.add<double>("etaHigh", 6.0);
93  descriptions.add("materialBudgetVolumeAnalysis", desc);
94 }
const std::string names[nVars_]
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ binEta_

const int MaterialBudgetVolumeAnalysis::binEta_
private

Definition at line 39 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by bookHisto(), and MaterialBudgetVolumeAnalysis().

◆ binPhi_

const int MaterialBudgetVolumeAnalysis::binPhi_
private

Definition at line 39 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by bookHisto(), and MaterialBudgetVolumeAnalysis().

◆ etaHigh_

const double MaterialBudgetVolumeAnalysis::etaHigh_
private

Definition at line 40 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by bookHisto(), and MaterialBudgetVolumeAnalysis().

◆ etaLow_

const double MaterialBudgetVolumeAnalysis::etaLow_
private

Definition at line 40 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by bookHisto(), and MaterialBudgetVolumeAnalysis().

◆ meIntLEta_

std::vector<TProfile*> MaterialBudgetVolumeAnalysis::meIntLEta_
private

Definition at line 44 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meIntLEtaPhi_

std::vector<TProfile2D*> MaterialBudgetVolumeAnalysis::meIntLEtaPhi_
private

Definition at line 45 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meIntLPhi_

std::vector<TProfile*> MaterialBudgetVolumeAnalysis::meIntLPhi_
private

Definition at line 44 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meRadLEta_

std::vector<TProfile*> MaterialBudgetVolumeAnalysis::meRadLEta_
private

Definition at line 43 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meRadLEtaPhi_

std::vector<TProfile2D*> MaterialBudgetVolumeAnalysis::meRadLEtaPhi_
private

Definition at line 45 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meRadLPhi_

std::vector<TProfile*> MaterialBudgetVolumeAnalysis::meRadLPhi_
private

Definition at line 43 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meStepEta_

std::vector<TProfile*> MaterialBudgetVolumeAnalysis::meStepEta_
private

Definition at line 42 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meStepEtaPhi_

std::vector<TProfile2D*> MaterialBudgetVolumeAnalysis::meStepEtaPhi_
private

Definition at line 45 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ meStepPhi_

std::vector<TProfile*> MaterialBudgetVolumeAnalysis::meStepPhi_
private

Definition at line 42 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and bookHisto().

◆ names_

const std::vector<std::string> MaterialBudgetVolumeAnalysis::names_
private

◆ phiHigh_

const double MaterialBudgetVolumeAnalysis::phiHigh_
private

Definition at line 40 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by bookHisto().

◆ phiLow_

const double MaterialBudgetVolumeAnalysis::phiLow_
private

Definition at line 40 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by bookHisto().

◆ tag_

const edm::InputTag MaterialBudgetVolumeAnalysis::tag_
private

Definition at line 38 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by MaterialBudgetVolumeAnalysis().

◆ tok_info_

edm::EDGetTokenT<edm::MaterialInformationContainer> MaterialBudgetVolumeAnalysis::tok_info_
private

Definition at line 41 of file MaterialBudgetVolumeAnalysis.cc.

Referenced by analyze(), and MaterialBudgetVolumeAnalysis().