CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 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)
 

Protected Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
- 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< B > consumes (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 () noexcept
 
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...
 
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)
 

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 ( const edm::ParameterSet ps)

Definition at line 39 of file EcalSimHitDump.cc.

References g4Label_, edm::ParameterSet::getParameter(), hitLab_, maxEvent_, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, types_, and edm::vector_transform().

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  })},
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
const std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > toksCalo_
const std::string g4Label_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const std::vector< std::string > hitLab_

Member Function Documentation

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

Implements edm::one::EDAnalyzerBase.

Definition at line 66 of file EcalSimHitDump.cc.

References edm::EventID::event(), edm::Event::getByToken(), mps_fire::i, edm::EventBase::id(), hit::id, edm::HandleBase::isValid(), isotrackApplyRegressor::k, kount_, maxEvent_, edm::EventID::run(), toksCalo_, and types_.

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 }
Log< level::Info, true > LogVerbatim
const std::vector< int > types_
const int maxEvent_
const std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > toksCalo_
bool isValid() const
Definition: HandleBase.h:70
unsigned int id
void EcalSimHitDump::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 55 of file EcalSimHitDump.cc.

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

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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const std::string EcalSimHitDump::g4Label_
private

Definition at line 31 of file EcalSimHitDump.cc.

Referenced by EcalSimHitDump(), and kount_().

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

Definition at line 32 of file EcalSimHitDump.cc.

Referenced by EcalSimHitDump(), and kount_().

int EcalSimHitDump::kount_
private

Definition at line 36 of file EcalSimHitDump.cc.

Referenced by analyze().

const int EcalSimHitDump::maxEvent_
private

Definition at line 35 of file EcalSimHitDump.cc.

Referenced by analyze(), EcalSimHitDump(), and kount_().

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

Definition at line 33 of file EcalSimHitDump.cc.

Referenced by analyze().

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

Definition at line 34 of file EcalSimHitDump.cc.

Referenced by analyze(), EcalSimHitDump(), and kount_().