CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ZdcSimpleReconstructor Class Reference

#include <ZdcSimpleReconstructor.h>

Inheritance diagram for ZdcSimpleReconstructor:
edm::stream::EDProducer< T >

Public Member Functions

void beginRun (edm::Run const &r, edm::EventSetup const &es) final
 
void endRun (edm::Run const &r, edm::EventSetup const &es) final
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ZdcSimpleReconstructor (const edm::ParameterSet &ps)
 
 ~ZdcSimpleReconstructor () override
 
- Public Member Functions inherited from edm::stream::EDProducer< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::ESGetToken< HcalDbService, HcalDbRecordconditionsToken_
 
DetId::Detector det_
 
bool dropZSmarkedPassed_
 
const HcalTimeSlewhcalTimeSlew_delay_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhtopoToken_
 
std::unique_ptr< HcalLongRecoParamslongRecoParams_
 
edm::ESGetToken< HcalLongRecoParams, HcalLongRecoParamsRcdparamsToken_
 
ZdcSimpleRecAlgo reco_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecordtimeSlewToken_
 
edm::EDGetTokenT< ZDCDigiCollectiontok_input_castor
 
edm::EDGetTokenT< ZDCDigiCollectiontok_input_hcal
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< T >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 34 of file ZdcSimpleReconstructor.h.

Constructor & Destructor Documentation

◆ ZdcSimpleReconstructor()

ZdcSimpleReconstructor::ZdcSimpleReconstructor ( const edm::ParameterSet ps)
explicit

Definition at line 13 of file ZdcSimpleReconstructor.cc.

14  : reco_(conf.getParameter<bool>("correctForTimeslew"),
15  conf.getParameter<bool>("correctForPhaseContainment"),
16  conf.getParameter<double>("correctionPhaseNS"),
17  conf.getParameter<int>("recoMethod"),
18  conf.getParameter<int>("lowGainOffset"),
19  conf.getParameter<double>("lowGainFrac")),
21  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")) {
22  tok_input_castor = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelcastor"));
23  tok_input_hcal = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelhcal"));
24 
25  std::string subd = conf.getParameter<std::string>("Subdetector");
26  if (!strcasecmp(subd.c_str(), "ZDC")) {
27  det_ = DetId::Calo;
29  produces<ZDCRecHitCollection>();
30  } else if (!strcasecmp(subd.c_str(), "CALIB")) {
33  produces<HcalCalibRecHitCollection>();
34  } else {
35  std::cout << "ZdcSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
36  }
37 
38  hcalTimeSlew_delay_ = nullptr;
39 
40  // ES tokens
41  htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>();
42  paramsToken_ = esConsumes<HcalLongRecoParams, HcalLongRecoParamsRcd, edm::Transition::BeginRun>();
43  conditionsToken_ = esConsumes<HcalDbService, HcalDbRecord>();
44  timeSlewToken_ = esConsumes<HcalTimeSlew, HcalTimeSlewRecord>(edm::ESInputTag("", "HBHE"));
45 }

References DetId::Calo, conditionsToken_, gather_cfg::cout, det_, edm::ParameterSet::getParameter(), HcalCalibration, HcalOther, hcalTimeSlew_delay_, htopoToken_, paramsToken_, AlCaHLTBitMon_QueryRunRegistry::string, subdet_, HcalZDCDetId::SubdetectorId, subdetOther_, timeSlewToken_, tok_input_castor, and tok_input_hcal.

◆ ~ZdcSimpleReconstructor()

ZdcSimpleReconstructor::~ZdcSimpleReconstructor ( )
override

Definition at line 47 of file ZdcSimpleReconstructor.cc.

47 {}

Member Function Documentation

◆ beginRun()

void ZdcSimpleReconstructor::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
final

Definition at line 49 of file ZdcSimpleReconstructor.cc.

49  {
50  const HcalTopology& htopo = es.getData(htopoToken_);
51  const HcalLongRecoParams& p = es.getData(paramsToken_);
52  longRecoParams_ = std::make_unique<HcalLongRecoParams>(p);
53  longRecoParams_->setTopo(&htopo);
54 
55  hcalTimeSlew_delay_ = &es.getData(timeSlewToken_);
56 }

References edm::EventSetup::getData(), hcalTimeSlew_delay_, htopoToken_, longRecoParams_, AlCaHLTBitMon_ParallelJobs::p, paramsToken_, and timeSlewToken_.

◆ endRun()

void ZdcSimpleReconstructor::endRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
final

Definition at line 58 of file ZdcSimpleReconstructor.cc.

58 {}

◆ produce()

void ZdcSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 60 of file ZdcSimpleReconstructor.cc.

60  {
61  // get conditions
62  const HcalDbService* conditions = &eventSetup.getData(conditionsToken_);
63 
64  // define vectors to pass noiseTS and signalTS
65  std::vector<unsigned int> mySignalTS;
66  std::vector<unsigned int> myNoiseTS;
67 
70  e.getByToken(tok_input_hcal, digi);
71 
72  if (digi->empty()) {
73  e.getByToken(tok_input_castor, digi);
74  if (digi->empty())
75  edm::LogInfo("ZdcHitReconstructor") << "No ZDC info found in either castorDigis or hcalDigis." << std::endl;
76  }
77 
78  // create empty output
79  auto rec = std::make_unique<ZDCRecHitCollection>();
80  rec->reserve(digi->size());
81  // run the algorithm
82  unsigned int toaddMem = 0;
83 
85  for (i = digi->begin(); i != digi->end(); i++) {
86  HcalZDCDetId cell = i->id();
87  DetId detcell = (DetId)cell;
88  // rof 27.03.09: drop ZS marked and passed digis:
90  if (i->zsMarkAndPass())
91  continue;
92 
93  // get db values for signalTSs and noiseTSs
94  const HcalLongRecoParam* myParams = longRecoParams_->getValues(detcell);
95  mySignalTS.clear();
96  myNoiseTS.clear();
97  mySignalTS = myParams->signalTS();
98  myNoiseTS = myParams->noiseTS();
99  // warning: the PulseCorrection is not used by ZDC. If it gets a non-contingious set of
100  // signal TS, it may not work properly. Assume contiguous here....
101  unsigned int toadd = mySignalTS.size();
102  if (toaddMem != toadd) {
104  toaddMem = toadd;
105  }
106  const HcalCalibrations& calibrations = conditions->getHcalCalibrations(cell);
107  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
108  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
109  HcalCoderDb coder(*channelCoder, *shape);
110  rec->push_back(reco_.reconstruct(*i, myNoiseTS, mySignalTS, coder, calibrations));
111  }
112  // return result
113  e.put(std::move(rec));
114  }
115 }

References edm::SortedCollection< T, SORT >::begin(), AlignmentProducer_cff::calibrations, DetId::Calo, submitPVValidationJobs::conditions, conditionsToken_, det_, dropZSmarkedPassed_, MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::EventSetup::getData(), hcalTimeSlew_delay_, mps_fire::i, ZdcSimpleRecAlgo::initPulseCorr(), longRecoParams_, eostools::move(), HcalLongRecoParam::noiseTS(), reco_, ZdcSimpleRecAlgo::reconstruct(), HcalLongRecoParam::signalTS(), edm::SortedCollection< T, SORT >::size(), subdet_, HcalZDCDetId::SubdetectorId, tok_input_castor, and tok_input_hcal.

Member Data Documentation

◆ conditionsToken_

edm::ESGetToken<HcalDbService, HcalDbRecord> ZdcSimpleReconstructor::conditionsToken_
private

Definition at line 59 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

◆ det_

DetId::Detector ZdcSimpleReconstructor::det_
private

Definition at line 44 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

◆ dropZSmarkedPassed_

bool ZdcSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 50 of file ZdcSimpleReconstructor.h.

Referenced by produce().

◆ hcalTimeSlew_delay_

const HcalTimeSlew* ZdcSimpleReconstructor::hcalTimeSlew_delay_
private

Definition at line 54 of file ZdcSimpleReconstructor.h.

Referenced by beginRun(), produce(), and ZdcSimpleReconstructor().

◆ htopoToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> ZdcSimpleReconstructor::htopoToken_
private

Definition at line 57 of file ZdcSimpleReconstructor.h.

Referenced by beginRun(), and ZdcSimpleReconstructor().

◆ longRecoParams_

std::unique_ptr<HcalLongRecoParams> ZdcSimpleReconstructor::longRecoParams_
private

Definition at line 52 of file ZdcSimpleReconstructor.h.

Referenced by beginRun(), and produce().

◆ paramsToken_

edm::ESGetToken<HcalLongRecoParams, HcalLongRecoParamsRcd> ZdcSimpleReconstructor::paramsToken_
private

Definition at line 58 of file ZdcSimpleReconstructor.h.

Referenced by beginRun(), and ZdcSimpleReconstructor().

◆ reco_

ZdcSimpleRecAlgo ZdcSimpleReconstructor::reco_
private

Definition at line 43 of file ZdcSimpleReconstructor.h.

Referenced by produce().

◆ subdet_

int ZdcSimpleReconstructor::subdet_
private

Definition at line 45 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

◆ subdetOther_

HcalOtherSubdetector ZdcSimpleReconstructor::subdetOther_
private

Definition at line 46 of file ZdcSimpleReconstructor.h.

Referenced by ZdcSimpleReconstructor().

◆ timeSlewToken_

edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> ZdcSimpleReconstructor::timeSlewToken_
private

Definition at line 60 of file ZdcSimpleReconstructor.h.

Referenced by beginRun(), and ZdcSimpleReconstructor().

◆ tok_input_castor

edm::EDGetTokenT<ZDCDigiCollection> ZdcSimpleReconstructor::tok_input_castor
private

Definition at line 48 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

◆ tok_input_hcal

edm::EDGetTokenT<ZDCDigiCollection> ZdcSimpleReconstructor::tok_input_hcal
private

Definition at line 47 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

HcalOther
Definition: HcalAssistant.h:38
mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
ZdcSimpleReconstructor::htopoToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > htopoToken_
Definition: ZdcSimpleReconstructor.h:57
HcalLongRecoParam::noiseTS
std::vector< unsigned int > noiseTS() const
Definition: HcalLongRecoParam.h:27
ZdcSimpleReconstructor::tok_input_hcal
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
Definition: ZdcSimpleReconstructor.h:47
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HcalTopology
Definition: HcalTopology.h:26
DetId::Hcal
Definition: DetId.h:28
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
AlignmentProducer_cff.calibrations
calibrations
Definition: AlignmentProducer_cff.py:59
edm::Handle
Definition: AssociativeIterator.h:50
DetId::Calo
Definition: DetId.h:29
DetId
Definition: DetId.h:17
HcalZDCDetId
Definition: HcalZDCDetId.h:16
ZdcSimpleReconstructor::det_
DetId::Detector det_
Definition: ZdcSimpleReconstructor.h:44
ZdcSimpleReconstructor::longRecoParams_
std::unique_ptr< HcalLongRecoParams > longRecoParams_
Definition: ZdcSimpleReconstructor.h:52
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
ZdcSimpleReconstructor::hcalTimeSlew_delay_
const HcalTimeSlew * hcalTimeSlew_delay_
Definition: ZdcSimpleReconstructor.h:54
HcalCalibration
Definition: HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
HcalCalibrations
Definition: HcalCalibrations.h:9
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ZdcSimpleRecAlgo::initPulseCorr
void initPulseCorr(int toadd, const HcalTimeSlew *hcalTimeSlew_delay)
Definition: ZdcSimpleRecAlgo.cc:21
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ZdcSimpleReconstructor::subdet_
int subdet_
Definition: ZdcSimpleReconstructor.h:45
HcalLongRecoParam
Definition: HcalLongRecoParam.h:15
HcalLongRecoParam::signalTS
std::vector< unsigned int > signalTS() const
Definition: HcalLongRecoParam.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalQIECoder
Definition: HcalQIECoder.h:20
ZdcSimpleReconstructor::timeSlewToken_
edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > timeSlewToken_
Definition: ZdcSimpleReconstructor.h:60
HcalDbService
Definition: HcalDbService.h:23
submitPVValidationJobs.conditions
list conditions
Definition: submitPVValidationJobs.py:674
eostools.move
def move(src, dest)
Definition: eostools.py:511
ZdcSimpleReconstructor::dropZSmarkedPassed_
bool dropZSmarkedPassed_
Definition: ZdcSimpleReconstructor.h:50
ZdcSimpleReconstructor::subdetOther_
HcalOtherSubdetector subdetOther_
Definition: ZdcSimpleReconstructor.h:46
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
ZdcSimpleReconstructor::paramsToken_
edm::ESGetToken< HcalLongRecoParams, HcalLongRecoParamsRcd > paramsToken_
Definition: ZdcSimpleReconstructor.h:58
ZdcSimpleReconstructor::reco_
ZdcSimpleRecAlgo reco_
Definition: ZdcSimpleReconstructor.h:43
HcalLongRecoParams
Definition: HcalLongRecoParams.h:9
ZdcSimpleReconstructor::tok_input_castor
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
Definition: ZdcSimpleReconstructor.h:48
ZdcSimpleReconstructor::conditionsToken_
edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
Definition: ZdcSimpleReconstructor.h:59
ZdcSimpleRecAlgo::reconstruct
ZDCRecHit reconstruct(const ZDCDataFrame &digi, const std::vector< unsigned int > &myNoiseTS, const std::vector< unsigned int > &mySignalTS, const HcalCoder &coder, const HcalCalibrations &calibs) const
Definition: ZdcSimpleRecAlgo.cc:265
edm::Log
Definition: MessageLogger.h:70
edm::InputTag
Definition: InputTag.h:15
edm::SortedCollection::empty
bool empty() const
Definition: SortedCollection.h:210
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37