CMS 3D CMS Logo

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

Public Member Functions

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

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
 

Private Attributes

const edm::InputTag labelMBCalo_
 
const std::vector< std::string > listNames_
 
std::vector< TH1D * > me100_
 
std::vector< TH1D * > me200_
 
std::vector< TH1D * > me300_
 
const unsigned int nList_
 
const edm::EDGetTokenT< MaterialAccountingCaloCollectiontokMBCalo_
 

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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
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 23 of file HGCalTBMBAnalyzer.cc.

Constructor & Destructor Documentation

◆ HGCalTBMBAnalyzer()

HGCalTBMBAnalyzer::HGCalTBMBAnalyzer ( const edm::ParameterSet p)

Definition at line 40 of file HGCalTBMBAnalyzer.cc.

References gpuVertexFinder::hist, mps_fire::i, dqmdumpme::k, listNames_, me100_, me200_, me300_, Skims_PA_cff::name, nList_, AlCaHLTBitMon_QueryRunRegistry::string, compare::tfile, and runGCPTkAlMap::title.

41  : listNames_(p.getParameter<std::vector<std::string>>("detectorNames")),
42  labelMBCalo_(p.getParameter<edm::InputTag>("labelMBCalo")),
43  nList_(listNames_.size()),
44  tokMBCalo_(consumes<MaterialAccountingCaloCollection>(labelMBCalo_)) {
45  edm::LogVerbatim("HGCSim") << "HGCalTBMBAnalyzer initialized for " << nList_ << " volumes";
46  for (unsigned int k = 0; k < nList_; ++k)
47  edm::LogVerbatim("HGCSim") << " [" << k << "] " << listNames_[k];
48 
50  if (!tfile.isAvailable())
51  throw cms::Exception("BadConfig") << "TFileService unavailable: "
52  << "please add it to config file";
53  char name[20], title[80];
54  TH1D *hist;
55  for (unsigned int i = 0; i <= nList_; i++) {
56  std::string named = (i == nList_) ? "Total" : listNames_[i];
57  sprintf(name, "RadL%d", i);
58  sprintf(title, "MB(X0) for (%s)", named.c_str());
59  hist = tfile->make<TH1D>(name, title, 100000, 0.0, 100.0);
60  hist->Sumw2(true);
61  me100_.push_back(hist);
62  sprintf(name, "IntL%d", i);
63  sprintf(title, "MB(L0) for (%s)", named.c_str());
64  hist = tfile->make<TH1D>(name, title, 100000, 0.0, 10.0);
65  hist->Sumw2(true);
66  me200_.push_back(hist);
67  sprintf(name, "StepL%d", i);
68  sprintf(title, "MB(Step) for (%s)", named.c_str());
69  hist = tfile->make<TH1D>(name, title, 100000, 0.0, 50000.0);
70  hist->Sumw2(true);
71  me300_.push_back(hist);
72  }
73  edm::LogVerbatim("HGCSim") << "HGCalTBMBAnalyzer: Booking user histos done ===";
74 }
Log< level::Info, true > LogVerbatim
const std::vector< std::string > listNames_
const unsigned int nList_
const edm::EDGetTokenT< MaterialAccountingCaloCollection > tokMBCalo_
const edm::InputTag labelMBCalo_
Definition: tfile.py:1
std::vector< TH1D * > me300_
std::vector< TH1D * > me200_
std::vector< TH1D * > me100_

◆ ~HGCalTBMBAnalyzer()

HGCalTBMBAnalyzer::~HGCalTBMBAnalyzer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 96 of file HGCalTBMBAnalyzer.cc.

References iEvent, cuy::ii, me100_, me200_, me300_, nList_, and tokMBCalo_.

96  {
97 #ifdef EDM_ML_DEBUG
98  edm::LogVerbatim("HGCSim") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity "
99  << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing();
100 #endif
101 
102  // Fill from the MB collection
103  auto const &hgcalMBColl = iEvent.getHandle(tokMBCalo_);
104  if (hgcalMBColl.isValid()) {
105  auto hgcalMB = hgcalMBColl.product();
106 #ifdef EDM_ML_DEBUG
107  edm::LogVerbatim("HGCSim") << "Finds MaterialBudegetCollection with " << hgcalMB->size() << " entries";
108 #endif
109 
110  for (auto itr = hgcalMB->begin(); itr != hgcalMB->end(); ++itr) {
111  for (uint32_t ii = 0; ii < itr->m_stepLen.size(); ++ii) {
112 #ifdef EDM_ML_DEBUG
113  edm::LogVerbatim("HGCSim") << "HGCalTBMBAnalyzer:index " << ii << " integrated step " << itr->m_stepLen[ii]
114  << " X0 " << itr->m_radLen[ii] << " Lamda " << itr->m_intLen[ii];
115 #endif
116  if (ii < nList_) {
117  me100_[ii]->Fill(itr->m_radLen[ii]);
118  me200_[ii]->Fill(itr->m_intLen[ii]);
119  me300_[ii]->Fill(itr->m_stepLen[ii]);
120  }
121  }
122  }
123  }
124 }
Log< level::Info, true > LogVerbatim
const unsigned int nList_
const edm::EDGetTokenT< MaterialAccountingCaloCollection > tokMBCalo_
int iEvent
Definition: GenABIO.cc:224
std::vector< TH1D * > me300_
ii
Definition: cuy.py:589
std::vector< TH1D * > me200_
std::vector< TH1D * > me100_

◆ fillDescriptions()

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

Definition at line 76 of file HGCalTBMBAnalyzer.cc.

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

76  {
78  std::vector<std::string> names = {"HGCalBeamWChamb",
79  "HGCalBeamS1",
80  "HGCalBeamS2",
81  "HGCalBeamS3",
82  "HGCalBeamS4",
83  "HGCalBeamS5",
84  "HGCalBeamS6",
85  "HGCalBeamCK3",
86  "HGCalBeamHaloCounter",
87  "HGCalBeamMuonCounter",
88  "HGCalEE",
89  "HGCalHE",
90  "HGCalAH"};
91  desc.add<std::vector<std::string>>("detectorNames", names);
92  desc.add<edm::InputTag>("labelMBCalo", edm::InputTag("g4SimHits", "HGCalTBMB"));
93  descriptions.add("hgcalTBMBAnalyzer", desc);
94 }
const std::string names[nVars_]
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ labelMBCalo_

const edm::InputTag HGCalTBMBAnalyzer::labelMBCalo_
private

Definition at line 34 of file HGCalTBMBAnalyzer.cc.

◆ listNames_

const std::vector<std::string> HGCalTBMBAnalyzer::listNames_
private

Definition at line 33 of file HGCalTBMBAnalyzer.cc.

Referenced by HGCalTBMBAnalyzer().

◆ me100_

std::vector<TH1D *> HGCalTBMBAnalyzer::me100_
private

Definition at line 37 of file HGCalTBMBAnalyzer.cc.

Referenced by analyze(), and HGCalTBMBAnalyzer().

◆ me200_

std::vector<TH1D *> HGCalTBMBAnalyzer::me200_
private

Definition at line 37 of file HGCalTBMBAnalyzer.cc.

Referenced by analyze(), and HGCalTBMBAnalyzer().

◆ me300_

std::vector<TH1D *> HGCalTBMBAnalyzer::me300_
private

Definition at line 37 of file HGCalTBMBAnalyzer.cc.

Referenced by analyze(), and HGCalTBMBAnalyzer().

◆ nList_

const unsigned int HGCalTBMBAnalyzer::nList_
private

Definition at line 35 of file HGCalTBMBAnalyzer.cc.

Referenced by analyze(), and HGCalTBMBAnalyzer().

◆ tokMBCalo_

const edm::EDGetTokenT<MaterialAccountingCaloCollection> HGCalTBMBAnalyzer::tokMBCalo_
private

Definition at line 36 of file HGCalTBMBAnalyzer.cc.

Referenced by analyze().