|
|
|
| HGCalTimingAnalyzer (edm::ParameterSet const &) |
|
| ~HGCalTimingAnalyzer () override |
|
| EDAnalyzer ()=default |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () final |
|
SerialTaskQueue * | globalRunsQueue () final |
|
bool | wantsGlobalLuminosityBlocks () const final |
|
bool | wantsGlobalRuns () const final |
|
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
|
| EDAnalyzerBase () |
|
ModuleDescription const & | moduleDescription () const |
|
bool | wantsStreamLuminosityBlocks () const |
|
bool | wantsStreamRuns () const |
|
| ~EDAnalyzerBase () override |
|
std::vector< ConsumesInfo > | consumesInfo () 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 |
|
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 |
|
EDConsumerBase & | operator= (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) |
|
|
typedef EDAnalyzerBase | ModuleType |
|
typedef ProductLabels | Labels |
|
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> |
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) |
|
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) |
|
Definition at line 45 of file HGCalTimingAnalyzer.cc.
◆ HGCalTimingAnalyzer()
Definition at line 78 of file HGCalTimingAnalyzer.cc.
79 usesResource(
"TFileService");
85 groupHits_ = iConfig.getParameter<
bool>(
"GroupHits");
86 timeUnit_ = iConfig.getParameter<
double>(
"TimeUnit");
88 idBeams_ = iConfig.getParameter<std::vector<int>>(
"IDBeams");
89 doTree_ = iConfig.getUntrackedParameter<
bool>(
"DoTree",
false);
103 tok_hepMC_ = consumes<edm::HepMCProduct>(tmp0);
105 std::cout <<
"HGCalTimingAnalyzer:: GeneratorSource = " << tmp0 << std::endl;
112 std::cout <<
"HGCalTimingAnalyzer:: Detector " <<
detectorEE_ <<
" with tags " << tmp1 << std::endl;
114 tmp1 = iConfig.getParameter<
std::string>(
"CaloHitSrcBeam");
References gather_cfg::cout, detectorBeam_, detectorEE_, doTree_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), groupHits_, triggerObjects_cff::id, idBeams_, AlCaHLTBitMon_QueryRunRegistry::string, timeUnit_, tok_hepMC_, tok_hitsBeam_, tok_hitsEE_, tok_simTk_, and tok_simVtx_.
◆ ~HGCalTimingAnalyzer()
HGCalTimingAnalyzer::~HGCalTimingAnalyzer |
( |
| ) |
|
|
override |
◆ analyze()
Implements edm::one::EDAnalyzerBase.
Definition at line 166 of file HGCalTimingAnalyzer.cc.
176 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
178 std::cout <<
"Particle[" <<
k <<
"] with p " << (*p)->momentum().rho() <<
" theta " << (*p)->momentum().theta()
179 <<
" phi " << (*p)->momentum().phi() << std::endl;
199 std::vector<PCaloHit> caloHits;
201 if (theCaloHitContainers.
isValid()) {
203 std::cout <<
"PcalohitContainer for " <<
detectorEE_ <<
" has " << theCaloHitContainers->size() <<
" hits"
207 caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
216 if (theCaloHitContainers.
isValid()) {
218 std::cout <<
"PcalohitContainer for " <<
detectorBeam_ <<
" has " << theCaloHitContainers->size() <<
" hits"
222 caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
References analyzeSimHits(), analyzeSimTracks(), edm::HandleBase::clear(), gather_cfg::cout, detectorBeam_, detectorEE_, doTree_, edm::HepMCProduct::GetEvent(), iEvent, edm::HandleBase::isValid(), dqmdumpme::k, AlCaHLTBitMon_ParallelJobs::p, simHitCellEnBeam_, simHitCellEnEE_, simHitCellIdBeam_, simHitCellIdEE_, simHitCellTmBeam_, simHitCellTmEE_, tok_hepMC_, tok_hitsBeam_, tok_hitsEE_, tok_simTk_, tok_simVtx_, and tree_.
◆ analyzeSimHits()
void HGCalTimingAnalyzer::analyzeSimHits |
( |
int |
type, |
|
|
std::vector< PCaloHit > const & |
hits |
|
) |
| |
|
private |
Definition at line 233 of file HGCalTimingAnalyzer.cc.
237 std::map<std::pair<uint32_t, uint64_t>, std::pair<double, double>> map_hits;
241 uint32_t
id =
hit.
id();
243 int subdet,
zside, layer, sector, subsector, cell;
245 std::pair<int, int> recoLayerCell =
hgcons_->
simToReco(cell, layer, sector,
true);
249 std::cout <<
"SimHit:Hit[" <<
i <<
"] Id " << subdet <<
":" <<
zside <<
":" << layer <<
":" << sector <<
":"
250 << subsector <<
":" << recoLayerCell.first <<
":" << recoLayerCell.second <<
" Energy " <<
energy
251 <<
" Time " <<
time << std::endl;
255 int subdet, layer,
x,
y;
257 std::cout <<
"SimHit:Hit[" <<
i <<
"] Beam Subdet " << subdet <<
" Layer " << layer <<
" x|y " <<
x <<
":" <<
y
258 <<
" Energy " <<
energy <<
" Time " <<
time << std::endl;
262 std::pair<uint32_t, uint64_t>
key(
id, tid);
263 auto itr = map_hits.find(
key);
264 if (
itr == map_hits.end()) {
265 map_hits[
key] = std::pair<double, double>(
time, 0.0);
269 map_hits[
key] = std::pair<double, double>((
itr->second).first,
energy);
276 std::cout <<
"analyzeSimHits: Finds " << map_hits.size() <<
" hits "
277 <<
" from the Hit Vector of size " <<
hits.size() <<
" for type " <<
type << std::endl;
279 for (
const auto&
itr : map_hits) {
References gather_cfg::cout, TauDecayModes::dec, HCALHighEnergyHPDFilter_cfi::energy, dqmdumpme::first, hgcons_, hfClusterShapes_cfi::hits, mps_fire::i, hit::id, crabWrapper::key, DetId::rawId(), edm::second(), simHitCellEnBeam_, simHitCellEnEE_, simHitCellIdBeam_, simHitCellIdEE_, simHitCellTmBeam_, simHitCellTmEE_, HGCalDDDConstants::simToReco(), ntuplemaker::time, timeUnit_, HGCalTestNumbering::unpackHexagonIndex(), HcalTestBeamNumbering::unpackIndex(), x, y, and ecaldqm::zside().
Referenced by analyze().
◆ analyzeSimTracks()
Definition at line 298 of file HGCalTimingAnalyzer.cc.
302 for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
304 std::cout <<
"Track " << simTrkItr->trackId() <<
" Vertex " << simTrkItr->vertIndex() <<
" Type "
305 << simTrkItr->type() <<
" Charge " << simTrkItr->charge() <<
" momentum " << simTrkItr->momentum() <<
" "
306 << simTrkItr->momentum().P() << std::endl;
308 if (vertIndex == -1) {
309 vertIndex = simTrkItr->vertIndex();
310 pBeam_ = simTrkItr->momentum().P();
313 if (vertIndex != -1 && vertIndex < (
int)SimVtx->size()) {
314 edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
315 for (
int iv = 0; iv < vertIndex; iv++)
318 std::cout <<
"Vertex " << vertIndex <<
" position " << simVtxItr->position() << std::endl;
320 xBeam_ = simVtxItr->position().X();
321 yBeam_ = simVtxItr->position().Y();
322 zBeam_ = simVtxItr->position().Z();
References gather_cfg::cout, pBeam_, xBeam_, yBeam_, and zBeam_.
Referenced by analyze().
◆ beginJob()
void HGCalTimingAnalyzer::beginJob |
( |
void |
| ) |
|
|
overrideprivatevirtual |
Reimplemented from edm::one::EDAnalyzerBase.
Definition at line 138 of file HGCalTimingAnalyzer.cc.
References detectorEE_, doTree_, fs_, TFileService::make(), pBeam_, simHitCellEnBeam_, simHitCellEnEE_, simHitCellIdBeam_, simHitCellIdEE_, simHitCellTmBeam_, simHitCellTmEE_, AlCaHLTBitMon_QueryRunRegistry::string, tree_, xBeam_, yBeam_, and zBeam_.
◆ beginRun()
◆ endRun()
◆ fillDescriptions()
Definition at line 123 of file HGCalTimingAnalyzer.cc.
127 desc.
add<
bool>(
"GroupHits",
false);
128 desc.
add<
double>(
"TimeUnit", 0.001);
129 std::vector<int> ids = {1001, 1002, 1003, 1004, 1005};
130 desc.add<std::vector<int>>(
"IDBeams", ids);
131 desc.addUntracked<
bool>(
"DoTree",
true);
133 desc.add<
std::string>(
"CaloHitSrcEE",
"HGCHitsEE");
134 desc.add<
std::string>(
"CaloHitSrcBeam",
"HcalTB06BeamHits");
135 descriptions.
add(
"HGCalTimingAnalyzer", desc);
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ detectorBeam_
std::string HGCalTimingAnalyzer::detectorBeam_ |
|
private |
◆ detectorEE_
std::string HGCalTimingAnalyzer::detectorEE_ |
|
private |
◆ doTree_
bool HGCalTimingAnalyzer::doTree_ |
|
private |
◆ fs_
◆ groupHits_
bool HGCalTimingAnalyzer::groupHits_ |
|
private |
◆ hgcons_
◆ idBeams_
std::vector<int> HGCalTimingAnalyzer::idBeams_ |
|
private |
◆ pBeam_
double HGCalTimingAnalyzer::pBeam_ |
|
private |
◆ simHitCellEnBeam_
std::vector<float> HGCalTimingAnalyzer::simHitCellEnBeam_ |
|
private |
◆ simHitCellEnEE_
std::vector<float> HGCalTimingAnalyzer::simHitCellEnEE_ |
|
private |
◆ simHitCellIdBeam_
std::vector<uint32_t> HGCalTimingAnalyzer::simHitCellIdBeam_ |
|
private |
◆ simHitCellIdEE_
std::vector<uint32_t> HGCalTimingAnalyzer::simHitCellIdEE_ |
|
private |
◆ simHitCellTmBeam_
std::vector<float> HGCalTimingAnalyzer::simHitCellTmBeam_ |
|
private |
◆ simHitCellTmEE_
std::vector<float> HGCalTimingAnalyzer::simHitCellTmEE_ |
|
private |
◆ timeUnit_
double HGCalTimingAnalyzer::timeUnit_ |
|
private |
◆ tok_hepMC_
◆ tok_hitsBeam_
◆ tok_hitsEE_
◆ tok_simTk_
◆ tok_simVtx_
◆ tree_
TTree* HGCalTimingAnalyzer::tree_ |
|
private |
◆ xBeam_
double HGCalTimingAnalyzer::xBeam_ |
|
private |
◆ yBeam_
double HGCalTimingAnalyzer::yBeam_ |
|
private |
◆ zBeam_
double HGCalTimingAnalyzer::zBeam_ |
|
private |
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< int > idBeams_
edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
std::vector< uint32_t > simHitCellIdBeam_
std::vector< uint32_t > simHitCellIdEE_
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
std::string detectorBeam_
U second(std::pair< T, U > const &p)
std::vector< float > simHitCellTmBeam_
void analyzeSimTracks(edm::Handle< edm::SimTrackContainer > const &SimTk, edm::Handle< edm::SimVertexContainer > const &SimVtx)
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsBeam_
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::Service< TFileService > fs_
void analyzeSimHits(int type, std::vector< PCaloHit > const &hits)
static void unpackIndex(const uint32_t &idx, int &det, int &lay, int &x, int &y)
unsigned int layers(bool reco) const
const HGCalDDDConstants * hgcons_
const HepMC::GenEvent * GetEvent() const
std::vector< std::pair< float, float > >::iterator itr
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsEE_
constexpr uint32_t rawId() const
get the raw id
unsigned long long uint64_t
std::vector< float > simHitCellEnBeam_
std::vector< float > simHitCellTmEE_
std::vector< float > simHitCellEnEE_
T * make(const Args &... args) const
make new ROOT object
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_