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
HcalSimHitDump Class Reference
Inheritance diagram for HcalSimHitDump:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HcalSimHitDump (const edm::ParameterSet &ps)
 
 ~HcalSimHitDump () override=default
 
- 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 (const edm::Event &e, const edm::EventSetup &c) override
 
void analyzeHits (std::vector< PCaloHit > &)
 
void beginJob () override
 
void endJob () 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< 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)
 

Private Attributes

const std::string g4Label_
 
const std::string hitLab_
 
const int maxEvent_
 
int nevt_
 
const bool testNumber_
 
const edm::EDGetTokenT
< edm::PCaloHitContainer
toks_calo_
 

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 31 of file HcalSimHitDump.cc.

Constructor & Destructor Documentation

HcalSimHitDump::HcalSimHitDump ( const edm::ParameterSet ps)

Definition at line 52 of file HcalSimHitDump.cc.

References g4Label_, hitLab_, maxEvent_, and testNumber_.

53  : g4Label_(ps.getParameter<std::string>("ModuleLabel")),
54  hitLab_(ps.getParameter<std::string>("HCCollection")),
55  maxEvent_(ps.getParameter<int>("MaxEvent")),
56  testNumber_(ps.getParameter<bool>("TestNumber")),
57  toks_calo_(consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_, hitLab_))),
58  nevt_(0) {
59  edm::LogVerbatim("HitStudy") << "HcalSimHitDump::Module Label: " << g4Label_ << " Hits: " << hitLab_ << " MaxEvent "
60  << maxEvent_ << " TestNumbering " << testNumber_;
61 }
Log< level::Info, true > LogVerbatim
const std::string g4Label_
const bool testNumber_
const std::string hitLab_
const int maxEvent_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< edm::PCaloHitContainer > toks_calo_
HcalSimHitDump::~HcalSimHitDump ( )
overridedefault

Member Function Documentation

void HcalSimHitDump::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 72 of file HcalSimHitDump.cc.

References analyzeHits(), edm::EventID::event(), edm::Event::getHandle(), edm::EventBase::id(), edm::HandleBase::isValid(), maxEvent_, nevt_, edm::EventID::run(), and toks_calo_.

72  {
73  ++nevt_;
74  edm::LogVerbatim("HitStudy") << "HcalSimHitDump::Serial # " << nevt_ << " Run # " << e.id().run() << " Event # "
75  << e.id().event();
76 
77  if (nevt_ <= maxEvent_) {
78  std::vector<PCaloHit> hcHits;
80  if (hitsCalo.isValid()) {
81  edm::LogVerbatim("HitStudy") << "HcalValidation: get valid hist for Hcal";
82  std::vector<PCaloHit> caloHits;
83  caloHits.insert(caloHits.end(), hitsCalo->begin(), hitsCalo->end());
84  edm::LogVerbatim("HitStudy") << "HcalValidation: Hit buffer " << caloHits.size();
85  analyzeHits(caloHits);
86  }
87  }
88 }
RunNumber_t run() const
Definition: EventID.h:38
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
Definition: EventID.h:40
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
void analyzeHits(std::vector< PCaloHit > &)
bool isValid() const
Definition: HandleBase.h:70
const int maxEvent_
edm::EventID id() const
Definition: EventBase.h:59
const edm::EDGetTokenT< edm::PCaloHitContainer > toks_calo_
void HcalSimHitDump::analyzeHits ( std::vector< PCaloHit > &  hits)
protected

Definition at line 90 of file HcalSimHitDump.cc.

References HLT_FULL_cff::depth, PVValHelper::eta, mps_fire::i, phi, AlCaHLTBitMon_QueryRunRegistry::string, testNumber_, HcalTestNumbering::unpackHcalIndex(), and z.

Referenced by analyze().

90  {
91  //Now the dump
92  for (unsigned int i = 0; i < hits.size(); i++) {
93  double edep = hits[i].energy();
94  double time = hits[i].time();
95  unsigned int id_ = hits[i].id();
96  if (testNumber_) {
97  int det, z, depth, eta, phi, lay;
98  HcalTestNumbering::unpackHcalIndex(id_, det, z, depth, eta, phi, lay);
99  std::string sub("HX");
100  if (det == 1)
101  sub = "HB";
102  else if (det == 2)
103  sub = "HE";
104  else if (det == 3)
105  sub = "HO";
106  else if (det == 4)
107  sub = "HF";
108  else if (det == 5)
109  sub = "HT";
110  int side = (z == 0) ? (-1) : (1);
111  edm::LogVerbatim("HitStudy") << "[" << i << "] (" << sub << " " << side * eta << "," << phi << "," << depth << ","
112  << lay << ") E " << edep << " T " << time;
113  } else {
114  edm::LogVerbatim("HitStudy") << "[" << i << "] " << HcalDetId(id_) << " E " << edep << " T " << time;
115  }
116  }
117 }
Log< level::Info, true > LogVerbatim
const bool testNumber_
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
void HcalSimHitDump::beginJob ( void  )
inlineoverrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 38 of file HcalSimHitDump.cc.

38 {}
void HcalSimHitDump::endJob ( void  )
inlineoverrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 39 of file HcalSimHitDump.cc.

39 {}
void HcalSimHitDump::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 63 of file HcalSimHitDump.cc.

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

63  {
65  desc.add<std::string>("ModuleLabel", "g4SimHits");
66  desc.add<std::string>("HCCollection", "HcalHits");
67  desc.add<int>("MaxEvent", 10);
68  desc.add<bool>("TestNumber", true);
69  descriptions.add("hcalSimHitDump", desc);
70 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const std::string HcalSimHitDump::g4Label_
private

Definition at line 45 of file HcalSimHitDump.cc.

Referenced by HcalSimHitDump().

const std::string HcalSimHitDump::hitLab_
private

Definition at line 45 of file HcalSimHitDump.cc.

Referenced by HcalSimHitDump().

const int HcalSimHitDump::maxEvent_
private

Definition at line 46 of file HcalSimHitDump.cc.

Referenced by analyze(), and HcalSimHitDump().

int HcalSimHitDump::nevt_
private

Definition at line 49 of file HcalSimHitDump.cc.

Referenced by analyze().

const bool HcalSimHitDump::testNumber_
private

Definition at line 47 of file HcalSimHitDump.cc.

Referenced by analyzeHits(), and HcalSimHitDump().

const edm::EDGetTokenT<edm::PCaloHitContainer> HcalSimHitDump::toks_calo_
private

Definition at line 48 of file HcalSimHitDump.cc.

Referenced by analyze().