CMS 3D CMS Logo

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

Public Member Functions

 EcalSimHitDump (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

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)
 

Protected Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Attributes

const std::string g4Label_
 
const std::vector< std::string > hitLab_
 
int kount_
 
const int maxEvent_
 
const std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > toksCalo_
 
const std::vector< int > types_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 22 of file EcalSimHitDump.cc.

Constructor & Destructor Documentation

◆ EcalSimHitDump()

EcalSimHitDump::EcalSimHitDump ( const edm::ParameterSet ps)

Definition at line 39 of file EcalSimHitDump.cc.

40  : g4Label_(ps.getParameter<std::string>("ModuleLabel")),
41  hitLab_(ps.getParameter<std::vector<std::string>>("HitCollections")),
43  [this](const std::string& name) {
44  return consumes<edm::PCaloHitContainer>(edm::InputTag{g4Label_, name});
45  })},
46  types_(ps.getParameter<std::vector<int>>("CollectionTypes")),
47  maxEvent_(ps.getParameter<int>("MaxEvent")),
48  kount_(0) {
49  edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " with " << hitLab_.size()
50  << " collections and maxEvent = " << maxEvent_;
51  for (unsigned int k = 0; k < hitLab_.size(); ++k)
52  edm::LogVerbatim("HitStudy") << "[" << k << "] Type " << types_[k] << " Label " << hitLab_[k];
53 }

References g4Label_, hitLab_, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, and edm::vector_transform().

Member Function Documentation

◆ analyze()

void EcalSimHitDump::analyze ( edm::Event const &  e,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 66 of file EcalSimHitDump.cc.

66  {
67  ++kount_;
68  edm::LogVerbatim("HitStudy") << "[" << kount_ << "] Run = " << e.id().run() << " Event = " << e.id().event();
69 
70  if ((kount_ <= maxEvent_) || (maxEvent_ <= 0)) {
71  for (unsigned int k = 0; k < toksCalo_.size(); ++k) {
73  e.getByToken(toksCalo_[k], hitsCalo);
74  if (hitsCalo.isValid())
75  edm::LogVerbatim("HitStudy") << "EcalSimHitDump: Input " << hitsCalo->size() << " hits of type " << types_[k];
76  unsigned int i(0);
77  for (auto const& hit : *hitsCalo) {
78  double edep = hit.energy();
79  double time = hit.time();
80  unsigned int id = hit.id();
81  if (types_[k] == 0)
82  edm::LogVerbatim("HitStudy") << "[" << i << "] " << EBDetId(id) << " E" << edep << " T " << time;
83  else if (types_[k] == 1)
84  edm::LogVerbatim("HitStudy") << "[" << i << "] " << EEDetId(id) << " E" << edep << " T " << time;
85  else
86  edm::LogVerbatim("HitStudy") << "[" << i << "] " << ESDetId(id) << " E" << edep << " T " << time;
87  ++i;
88  }
89  }
90  }
91 }

References MillePedeFileConverter_cfg::e, mps_fire::i, hit::id, edm::HandleBase::isValid(), dqmdumpme::k, kount_, maxEvent_, ntuplemaker::time, toksCalo_, and types_.

◆ fillDescriptions()

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

Definition at line 55 of file EcalSimHitDump.cc.

55  {
57  std::vector<std::string> coll = {"EcalHitsEB", "EcalHitsEE", "EcalHitsES"};
58  std::vector<int> type = {0, 1, 2};
59  desc.add<std::string>("ModuleLabel", "g4SimHits");
60  desc.add<std::vector<std::string>>("HitCollections", coll);
61  desc.add<std::vector<int>>("CollectionTypes", type);
62  desc.add<int>("MaxEvent", 10);
63  descriptions.add("ecalSimHitDump", desc);
64 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ g4Label_

const std::string EcalSimHitDump::g4Label_
private

Definition at line 31 of file EcalSimHitDump.cc.

Referenced by EcalSimHitDump().

◆ hitLab_

const std::vector<std::string> EcalSimHitDump::hitLab_
private

Definition at line 32 of file EcalSimHitDump.cc.

Referenced by EcalSimHitDump().

◆ kount_

int EcalSimHitDump::kount_
private

Definition at line 36 of file EcalSimHitDump.cc.

Referenced by analyze().

◆ maxEvent_

const int EcalSimHitDump::maxEvent_
private

Definition at line 35 of file EcalSimHitDump.cc.

Referenced by analyze().

◆ toksCalo_

const std::vector<edm::EDGetTokenT<edm::PCaloHitContainer> > EcalSimHitDump::toksCalo_
private

Definition at line 33 of file EcalSimHitDump.cc.

Referenced by analyze().

◆ types_

const std::vector<int> EcalSimHitDump::types_
private

Definition at line 34 of file EcalSimHitDump.cc.

Referenced by analyze().

mps_fire.i
i
Definition: mps_fire.py:428
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
EBDetId
Definition: EBDetId.h:17
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EcalSimHitDump::hitLab_
const std::vector< std::string > hitLab_
Definition: EcalSimHitDump.cc:32
ESDetId
Definition: ESDetId.h:15
edm::Handle
Definition: AssociativeIterator.h:50
EcalSimHitDump::types_
const std::vector< int > types_
Definition: EcalSimHitDump.cc:34
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EcalSimHitDump::toksCalo_
const std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > toksCalo_
Definition: EcalSimHitDump.cc:33
dqmdumpme.k
k
Definition: dqmdumpme.py:60
EcalSimHitDump::g4Label_
const std::string g4Label_
Definition: EcalSimHitDump.cc:31
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
EcalSimHitDump::maxEvent_
const int maxEvent_
Definition: EcalSimHitDump.cc:35
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalSimHitDump::kount_
int kount_
Definition: EcalSimHitDump.cc:36
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
ntuplemaker.time
time
Definition: ntuplemaker.py:310
edm::Log
Definition: MessageLogger.h:70
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37