CMS 3D CMS Logo

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

Public Member Functions

 HGCalTimingAnalyzer (edm::ParameterSet const &)
 
 ~HGCalTimingAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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
 
void analyzeSimHits (int type, std::vector< PCaloHit > const &hits)
 
void analyzeSimTracks (edm::Handle< edm::SimTrackContainer > const &SimTk, edm::Handle< edm::SimVertexContainer > const &SimVtx)
 
void beginJob () override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

const std::string detectorBeam_
 
const std::string detectorEE_
 
const bool doTree_
 
edm::Service< TFileServicefs_
 
const bool groupHits_
 
const HGCalTBDDDConstantshgcons_
 
const std::vector< int > idBeamDef_ = {1001}
 
const std::vector< int > idBeams_
 
const edm::InputTag labelGen_
 
const std::string labelHitBeam_
 
const std::string labelHitEE_
 
double pBeam_
 
std::vector< float > simHitCellEnBeam_
 
std::vector< float > simHitCellEnEE_
 
std::vector< uint32_t > simHitCellIdBeam_
 
std::vector< uint32_t > simHitCellIdEE_
 
std::vector< float > simHitCellTmBeam_
 
std::vector< float > simHitCellTmEE_
 
const double timeUnit_
 
const edm::EDGetTokenT< edm::HepMCProducttok_hepMC_
 
const edm::EDGetTokenT< edm::PCaloHitContainertok_hitsBeam_
 
const edm::EDGetTokenT< edm::PCaloHitContainertok_hitsEE_
 
const edm::EDGetTokenT< edm::SimTrackContainertok_simTk_
 
const edm::EDGetTokenT< edm::SimVertexContainertok_simVtx_
 
const edm::ESGetToken< HGCalTBDDDConstants, IdealGeometryRecordtokDDD_
 
TTree * tree_
 
double xBeam_
 
double yBeam_
 
double zBeam_
 

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 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 44 of file HGCalTimingAnalyzer.cc.

Constructor & Destructor Documentation

◆ HGCalTimingAnalyzer()

HGCalTimingAnalyzer::HGCalTimingAnalyzer ( edm::ParameterSet const &  iConfig)
explicit

Definition at line 82 of file HGCalTimingAnalyzer.cc.

References detectorBeam_, detectorEE_, groupHits_, l1ctLayer2EG_cff::id, idBeams_, labelGen_, labelHitBeam_, labelHitEE_, and timeUnit_.

83  : detectorEE_(iConfig.getParameter<std::string>("DetectorEE")),
84  detectorBeam_(iConfig.getParameter<std::string>("DetectorBeam")),
85  groupHits_(iConfig.getParameter<bool>("GroupHits")),
86  timeUnit_((!groupHits_) ? 0.000001 : (iConfig.getParameter<double>("TimeUnit"))),
87  doTree_(iConfig.getUntrackedParameter<bool>("DoTree", false)),
88  idBeams_((iConfig.getParameter<std::vector<int>>("IDBeams")).empty()
89  ? idBeamDef_
90  : (iConfig.getParameter<std::vector<int>>("IDBeams"))),
91  tokDDD_(esConsumes<HGCalTBDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(
93  labelGen_(iConfig.getParameter<edm::InputTag>("GeneratorSrc")),
94  labelHitEE_(iConfig.getParameter<std::string>("CaloHitSrcEE")),
95  labelHitBeam_(iConfig.getParameter<std::string>("CaloHitSrcBeam")),
96  tok_hepMC_(consumes<edm::HepMCProduct>(labelGen_)),
97  tok_simTk_(consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"))),
98  tok_simVtx_(consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"))),
99  tok_hitsEE_(consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", labelHitEE_))),
100  tok_hitsBeam_(consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", labelHitBeam_))) {
101  usesResource("TFileService");
102 
103  // now do whatever initialization is needed
104  // Group hits (if groupHits_ = true) if hits come within timeUnit_
105  // Only look into the beam counters with ID's as in idBeams_
106 #ifdef EDM_ML_DEBUG
107  std::ostringstream st1;
108  st1 << "HGCalTimingAnalyzer:: Group Hits " << groupHits_ << " in " << timeUnit_ << " IdBeam " << idBeams_.size()
109  << ":";
110  for (const auto& id : idBeams_)
111  st1 << " " << id;
112  edm::LogVerbatim("HGCSim") << st1.str();
113 
114  edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer:: GeneratorSource = " << labelGen_;
115  edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer:: Detector " << detectorEE_ << " with tags " << labelHitEE_;
116  edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer:: Detector " << detectorBeam_ << " with tags " << labelHitBeam_;
117 #endif
118 }
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsBeam_
const edm::ESGetToken< HGCalTBDDDConstants, IdealGeometryRecord > tokDDD_
const std::vector< int > idBeamDef_
const edm::InputTag labelGen_
const std::vector< int > idBeams_
const std::string labelHitBeam_
const edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
const std::string labelHitEE_
const std::string detectorBeam_
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsEE_
const edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
const edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
const std::string detectorEE_

◆ ~HGCalTimingAnalyzer()

HGCalTimingAnalyzer::~HGCalTimingAnalyzer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 161 of file HGCalTimingAnalyzer.cc.

References analyzeSimHits(), analyzeSimTracks(), edm::HandleBase::clear(), 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_.

161  {
162 #ifdef EDM_ML_DEBUG
163  // Generator input
164  const edm::Handle<edm::HepMCProduct>& evtMC = iEvent.getHandle(tok_hepMC_);
165  if (!evtMC.isValid()) {
166  edm::LogWarning("HGCal") << "no HepMCProduct found";
167  } else {
168  const HepMC::GenEvent* myGenEvent = evtMC->GetEvent();
169  unsigned int k(0);
170  for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
171  ++p, ++k) {
172  edm::LogVerbatim("HGCSim") << "Particle[" << k << "] with p " << (*p)->momentum().rho() << " theta "
173  << (*p)->momentum().theta() << " phi " << (*p)->momentum().phi();
174  }
175  }
176 #endif
177 
178  // Now the Simhits
179  const edm::Handle<edm::SimTrackContainer>& SimTk = iEvent.getHandle(tok_simTk_);
180  const edm::Handle<edm::SimVertexContainer>& SimVtx = iEvent.getHandle(tok_simVtx_);
181  analyzeSimTracks(SimTk, SimVtx);
182 
183  simHitCellIdEE_.clear();
184  simHitCellIdBeam_.clear();
185  simHitCellEnEE_.clear();
186  simHitCellEnBeam_.clear();
187  simHitCellTmEE_.clear();
188  simHitCellTmBeam_.clear();
189 
190  std::vector<PCaloHit> caloHits;
191  const edm::Handle<edm::PCaloHitContainer>& theCaloHitContainers = iEvent.getHandle(tok_hitsEE_);
192  if (theCaloHitContainers.isValid()) {
193 #ifdef EDM_ML_DEBUG
194  edm::LogVerbatim("HGCSim") << "PcalohitContainer for " << detectorEE_ << " has " << theCaloHitContainers->size()
195  << " hits";
196 #endif
197  caloHits.clear();
198  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
199  analyzeSimHits(0, caloHits);
200  } else {
201 #ifdef EDM_ML_DEBUG
202  edm::LogVerbatim("HGCSim") << "PCaloHitContainer does not exist for " << detectorEE_ << " !!!";
203 #endif
204  }
205 
206  const edm::Handle<edm::PCaloHitContainer>& caloHitContainerBeam = iEvent.getHandle(tok_hitsBeam_);
207  if (caloHitContainerBeam.isValid()) {
208 #ifdef EDM_ML_DEBUG
209  edm::LogVerbatim("HGCSim") << "PcalohitContainer for " << detectorBeam_ << " has " << caloHitContainerBeam->size()
210  << " hits";
211 #endif
212  caloHits.clear();
213  caloHits.insert(caloHits.end(), caloHitContainerBeam->begin(), caloHitContainerBeam->end());
214  analyzeSimHits(1, caloHits);
215  } else {
216 #ifdef EDM_ML_DEBUG
217  edm::LogVerbatim("HGCSim") << "PCaloHitContainer does not exist for " << detectorBeam_ << " !!!";
218 #endif
219  }
220  if (doTree_)
221  tree_->Fill();
222 }
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsBeam_
int iEvent
Definition: GenABIO.cc:224
std::vector< float > simHitCellEnEE_
const edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
std::vector< float > simHitCellTmBeam_
const std::string detectorBeam_
std::vector< float > simHitCellEnBeam_
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsEE_
std::vector< uint32_t > simHitCellIdBeam_
std::vector< float > simHitCellTmEE_
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
std::vector< uint32_t > simHitCellIdEE_
const edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
const edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
bool isValid() const
Definition: HandleBase.h:70
const std::string detectorEE_
Log< level::Warning, false > LogWarning
void analyzeSimHits(int type, std::vector< PCaloHit > const &hits)
void analyzeSimTracks(edm::Handle< edm::SimTrackContainer > const &SimTk, edm::Handle< edm::SimVertexContainer > const &SimVtx)

◆ analyzeSimHits()

void HGCalTimingAnalyzer::analyzeSimHits ( int  type,
std::vector< PCaloHit > const &  hits 
)
private

Definition at line 224 of file HGCalTimingAnalyzer.cc.

References TauDecayModes::dec, hcalRecHitTable_cff::energy, dqmdumpme::first, hgcons_, hfClusterShapes_cfi::hits, mps_fire::i, hit::id, submitPVResolutionJobs::key, nano_mu_digi_cff::layer, DetId::rawId(), edm::second(), nano_mu_digi_cff::sector, simHitCellEnBeam_, simHitCellEnEE_, simHitCellIdBeam_, simHitCellIdEE_, simHitCellTmBeam_, simHitCellTmEE_, HGCalTBDDDConstants::simToReco(), nano_mu_digi_cff::subsector, hcalRecHitTable_cff::time, timeUnit_, HGCalTestNumbering::unpackHexagonIndex(), HcalTestBeamNumbering::unpackIndex(), x, y, and ecaldqm::zside().

Referenced by analyze().

224  {
225 #ifdef EDM_ML_DEBUG
226  unsigned int i(0);
227 #endif
228  std::map<std::pair<uint32_t, uint64_t>, std::pair<double, double>> map_hits;
229  for (const auto& hit : hits) {
230  double energy = hit.energy();
231  double time = hit.time();
232  uint32_t id = hit.id();
233  if (type == 0) {
234  int subdet, zside, layer, sector, subsector, cell;
236  std::pair<int, int> recoLayerCell = hgcons_->simToReco(cell, layer, sector, true);
237  id = HGCalDetId((ForwardSubdetector)(subdet), zside, recoLayerCell.second, subsector, sector, recoLayerCell.first)
238  .rawId();
239 #ifdef EDM_ML_DEBUG
240  edm::LogVerbatim("HGCSim") << "SimHit:Hit[" << i << "] Id " << subdet << ":" << zside << ":" << layer << ":"
241  << sector << ":" << subsector << ":" << recoLayerCell.first << ":"
242  << recoLayerCell.second << " Energy " << energy << " Time " << time;
243 #endif
244  } else {
245 #ifdef EDM_ML_DEBUG
246  int subdet, layer, x, y;
248  edm::LogVerbatim("HGCSim") << "SimHit:Hit[" << i << "] Beam Subdet " << subdet << " Layer " << layer << " x|y "
249  << x << ":" << y << " Energy " << energy << " Time " << time;
250 #endif
251  }
252  uint64_t tid = (uint64_t)((time + 50.0) / timeUnit_);
253  std::pair<uint32_t, uint64_t> key(id, tid);
254  auto itr = map_hits.find(key);
255  if (itr == map_hits.end()) {
256  map_hits[key] = std::pair<double, double>(time, 0.0);
257  itr = map_hits.find(key);
258  }
259  energy += (itr->second).second;
260  map_hits[key] = std::pair<double, double>((itr->second).first, energy);
261 #ifdef EDM_ML_DEBUG
262  ++i;
263 #endif
264  }
265 
266 #ifdef EDM_ML_DEBUG
267  edm::LogVerbatim("HGCSim") << "analyzeSimHits: Finds " << map_hits.size() << " hits "
268  << " from the Hit Vector of size " << hits.size() << " for type " << type;
269 #endif
270  for (const auto& itr : map_hits) {
271  uint32_t id = (itr.first).first;
272  double time = (itr.second).first;
273  double energy = (itr.second).second;
274  if (type == 0) {
275  simHitCellIdEE_.push_back(id);
276  simHitCellEnEE_.push_back(energy);
277  simHitCellTmEE_.push_back(time);
278  } else {
279  simHitCellIdBeam_.push_back(id);
280  simHitCellEnBeam_.push_back(energy);
281  simHitCellTmBeam_.push_back(time);
282  }
283 #ifdef EDM_ML_DEBUG
284  edm::LogVerbatim("HGCSim") << "SimHit::ID: " << std::hex << id << std::dec << " T: " << time << " E: " << energy;
285 #endif
286  }
287 }
Log< level::Info, true > LogVerbatim
const HGCalTBDDDConstants * hgcons_
int zside(DetId const &)
ForwardSubdetector
U second(std::pair< T, U > const &p)
std::vector< float > simHitCellEnEE_
key
prepare the HTCondor submission files and eventually submit them
std::vector< float > simHitCellTmBeam_
std::vector< float > simHitCellEnBeam_
std::vector< uint32_t > simHitCellIdBeam_
std::vector< float > simHitCellTmEE_
std::vector< uint32_t > simHitCellIdEE_
unsigned int id
unsigned long long uint64_t
Definition: Time.h:13
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static void unpackIndex(const uint32_t &idx, int &det, int &lay, int &x, int &y)
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const

◆ analyzeSimTracks()

void HGCalTimingAnalyzer::analyzeSimTracks ( edm::Handle< edm::SimTrackContainer > const &  SimTk,
edm::Handle< edm::SimVertexContainer > const &  SimVtx 
)
private

Definition at line 289 of file HGCalTimingAnalyzer.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, pBeam_, xBeam_, yBeam_, and zBeam_.

Referenced by analyze().

290  {
291  xBeam_ = yBeam_ = zBeam_ = pBeam_ = -1000000;
292  int vertIndex(-1);
293  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
294 #ifdef EDM_ML_DEBUG
295  edm::LogVerbatim("HGCSim") << "Track " << simTrkItr->trackId() << " Vertex " << simTrkItr->vertIndex() << " Type "
296  << simTrkItr->type() << " Charge " << simTrkItr->charge() << " momentum "
297  << simTrkItr->momentum() << " " << simTrkItr->momentum().P();
298 #endif
299  if (vertIndex == -1) {
300  vertIndex = simTrkItr->vertIndex();
301  pBeam_ = simTrkItr->momentum().P();
302  }
303  }
304  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
305  edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
306  for (int iv = 0; iv < vertIndex; iv++)
307  simVtxItr++;
308 #ifdef EDM_ML_DEBUG
309  edm::LogVerbatim("HGCSim") << "Vertex " << vertIndex << " position " << simVtxItr->position();
310 #endif
311  xBeam_ = simVtxItr->position().X();
312  yBeam_ = simVtxItr->position().Y();
313  zBeam_ = simVtxItr->position().Z();
314  }
315 }
Log< level::Info, true > LogVerbatim

◆ beginJob()

void HGCalTimingAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 135 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_.

135  {
137  if (doTree_) {
138  tree_ = fs_->make<TTree>("HGCTB", "SimHitEnergy");
139  tree_->Branch("xBeam", &xBeam_, "xBeam/D");
140  tree_->Branch("yBeam", &yBeam_, "yBeam/D");
141  tree_->Branch("zBeam", &zBeam_, "zBeam/D");
142  tree_->Branch("pBeam", &pBeam_, "pBeam/D");
143  tree_->Branch("simHitCellIdEE_", &simHitCellIdEE_);
144  tree_->Branch("simHitCellEnEE_", &simHitCellEnEE_);
145  tree_->Branch("simHitCellTmEE_", &simHitCellTmEE_);
146  tree_->Branch("simHitCellIdBeam_", &simHitCellIdBeam_);
147  tree_->Branch("simHitCellEnBeam_", &simHitCellEnBeam_);
148  tree_->Branch("simHitCellTmBeam_", &simHitCellTmBeam_);
149  }
150 }
std::vector< float > simHitCellEnEE_
std::vector< float > simHitCellTmBeam_
std::vector< float > simHitCellEnBeam_
std::vector< uint32_t > simHitCellIdBeam_
std::vector< float > simHitCellTmEE_
std::vector< uint32_t > simHitCellIdEE_
edm::Service< TFileService > fs_
const std::string detectorEE_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64

◆ beginRun()

void HGCalTimingAnalyzer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 152 of file HGCalTimingAnalyzer.cc.

References detectorEE_, edm::EventSetup::getData(), hgcons_, HGCalTBDDDConstants::layers(), and tokDDD_.

152  {
153  hgcons_ = &iSetup.getData(tokDDD_);
154 
155 #ifdef EDM_ML_DEBUG
156  edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer::" << detectorEE_ << " defined with " << hgcons_->layers(false)
157  << " layers";
158 #endif
159 }
Log< level::Info, true > LogVerbatim
const HGCalTBDDDConstants * hgcons_
const edm::ESGetToken< HGCalTBDDDConstants, IdealGeometryRecord > tokDDD_
const std::string detectorEE_
unsigned int layers(bool reco) const

◆ endRun()

void HGCalTimingAnalyzer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprivate

Definition at line 54 of file HGCalTimingAnalyzer.cc.

54 {}

◆ fillDescriptions()

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

Definition at line 120 of file HGCalTimingAnalyzer.cc.

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

120  {
122  desc.add<std::string>("DetectorEE", "HGCalEESensitive");
123  desc.add<std::string>("DetectorBeam", "HcalTB06BeamDetector");
124  desc.add<bool>("GroupHits", false);
125  desc.add<double>("TimeUnit", 0.001);
126  std::vector<int> ids = {1001, 1002, 1003, 1004, 1005};
127  desc.add<std::vector<int>>("IDBeams", ids);
128  desc.addUntracked<bool>("DoTree", true);
129  desc.add<edm::InputTag>("GeneratorSrc", edm::InputTag("generatorSmeared"));
130  desc.add<std::string>("CaloHitSrcEE", "HGCHitsEE");
131  desc.add<std::string>("CaloHitSrcBeam", "HcalTB06BeamHits");
132  descriptions.add("HGCalTimingAnalyzer", desc);
133 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ detectorBeam_

const std::string HGCalTimingAnalyzer::detectorBeam_
private

Definition at line 62 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), and HGCalTimingAnalyzer().

◆ detectorEE_

const std::string HGCalTimingAnalyzer::detectorEE_
private

Definition at line 62 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTimingAnalyzer().

◆ doTree_

const bool HGCalTimingAnalyzer::doTree_
private

Definition at line 65 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ fs_

edm::Service<TFileService> HGCalTimingAnalyzer::fs_
private

Definition at line 60 of file HGCalTimingAnalyzer.cc.

Referenced by beginJob().

◆ groupHits_

const bool HGCalTimingAnalyzer::groupHits_
private

Definition at line 63 of file HGCalTimingAnalyzer.cc.

Referenced by HGCalTimingAnalyzer().

◆ hgcons_

const HGCalTBDDDConstants* HGCalTimingAnalyzer::hgcons_
private

Definition at line 68 of file HGCalTimingAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

◆ idBeamDef_

const std::vector<int> HGCalTimingAnalyzer::idBeamDef_ = {1001}
private

Definition at line 61 of file HGCalTimingAnalyzer.cc.

◆ idBeams_

const std::vector<int> HGCalTimingAnalyzer::idBeams_
private

Definition at line 66 of file HGCalTimingAnalyzer.cc.

Referenced by HGCalTimingAnalyzer().

◆ labelGen_

const edm::InputTag HGCalTimingAnalyzer::labelGen_
private

Definition at line 69 of file HGCalTimingAnalyzer.cc.

Referenced by HGCalTimingAnalyzer().

◆ labelHitBeam_

const std::string HGCalTimingAnalyzer::labelHitBeam_
private

Definition at line 70 of file HGCalTimingAnalyzer.cc.

Referenced by HGCalTimingAnalyzer().

◆ labelHitEE_

const std::string HGCalTimingAnalyzer::labelHitEE_
private

Definition at line 70 of file HGCalTimingAnalyzer.cc.

Referenced by HGCalTimingAnalyzer().

◆ pBeam_

double HGCalTimingAnalyzer::pBeam_
private

Definition at line 79 of file HGCalTimingAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

◆ simHitCellEnBeam_

std::vector<float> HGCalTimingAnalyzer::simHitCellEnBeam_
private

Definition at line 77 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), analyzeSimHits(), and beginJob().

◆ simHitCellEnEE_

std::vector<float> HGCalTimingAnalyzer::simHitCellEnEE_
private

Definition at line 77 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), analyzeSimHits(), and beginJob().

◆ simHitCellIdBeam_

std::vector<uint32_t> HGCalTimingAnalyzer::simHitCellIdBeam_
private

Definition at line 76 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), analyzeSimHits(), and beginJob().

◆ simHitCellIdEE_

std::vector<uint32_t> HGCalTimingAnalyzer::simHitCellIdEE_
private

Definition at line 76 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), analyzeSimHits(), and beginJob().

◆ simHitCellTmBeam_

std::vector<float> HGCalTimingAnalyzer::simHitCellTmBeam_
private

Definition at line 78 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), analyzeSimHits(), and beginJob().

◆ simHitCellTmEE_

std::vector<float> HGCalTimingAnalyzer::simHitCellTmEE_
private

Definition at line 78 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), analyzeSimHits(), and beginJob().

◆ timeUnit_

const double HGCalTimingAnalyzer::timeUnit_
private

Definition at line 64 of file HGCalTimingAnalyzer.cc.

Referenced by analyzeSimHits(), and HGCalTimingAnalyzer().

◆ tok_hepMC_

const edm::EDGetTokenT<edm::HepMCProduct> HGCalTimingAnalyzer::tok_hepMC_
private

Definition at line 71 of file HGCalTimingAnalyzer.cc.

Referenced by analyze().

◆ tok_hitsBeam_

const edm::EDGetTokenT<edm::PCaloHitContainer> HGCalTimingAnalyzer::tok_hitsBeam_
private

Definition at line 74 of file HGCalTimingAnalyzer.cc.

Referenced by analyze().

◆ tok_hitsEE_

const edm::EDGetTokenT<edm::PCaloHitContainer> HGCalTimingAnalyzer::tok_hitsEE_
private

Definition at line 74 of file HGCalTimingAnalyzer.cc.

Referenced by analyze().

◆ tok_simTk_

const edm::EDGetTokenT<edm::SimTrackContainer> HGCalTimingAnalyzer::tok_simTk_
private

Definition at line 72 of file HGCalTimingAnalyzer.cc.

Referenced by analyze().

◆ tok_simVtx_

const edm::EDGetTokenT<edm::SimVertexContainer> HGCalTimingAnalyzer::tok_simVtx_
private

Definition at line 73 of file HGCalTimingAnalyzer.cc.

Referenced by analyze().

◆ tokDDD_

const edm::ESGetToken<HGCalTBDDDConstants, IdealGeometryRecord> HGCalTimingAnalyzer::tokDDD_
private

Definition at line 67 of file HGCalTimingAnalyzer.cc.

Referenced by beginRun().

◆ tree_

TTree* HGCalTimingAnalyzer::tree_
private

Definition at line 75 of file HGCalTimingAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ xBeam_

double HGCalTimingAnalyzer::xBeam_
private

Definition at line 79 of file HGCalTimingAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

◆ yBeam_

double HGCalTimingAnalyzer::yBeam_
private

Definition at line 79 of file HGCalTimingAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

◆ zBeam_

double HGCalTimingAnalyzer::zBeam_
private

Definition at line 79 of file HGCalTimingAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().