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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

DetId::Detector det_
 
bool dropZSmarkedPassed_
 
const HcalTimeSlewhcalTimeSlew_delay_
 
HcalLongRecoParamsmyobject
 
ZdcSimpleRecAlgo reco_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
edm::EDGetTokenT< ZDCDigiCollectiontok_input_castor
 
edm::EDGetTokenT< ZDCDigiCollectiontok_input_hcal
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< T >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 23 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 }

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

◆ ~ZdcSimpleReconstructor()

ZdcSimpleReconstructor::~ZdcSimpleReconstructor ( )
override

Definition at line 41 of file ZdcSimpleReconstructor.cc.

41 {}

Member Function Documentation

◆ beginRun()

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

◆ endRun()

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

Definition at line 52 of file ZdcSimpleReconstructor.cc.

52  {
53  delete myobject;
54  myobject = nullptr;
55 }

References myobject.

◆ produce()

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

Definition at line 56 of file ZdcSimpleReconstructor.cc.

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

References edm::SortedCollection< T, SORT >::begin(), AlignmentProducer_cff::calibrations, DetId::Calo, det_, dropZSmarkedPassed_, MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::EventSetup::get(), get, HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalCondObjectContainer< Item >::getValues(), hcalTimeSlew_delay_, mps_fire::i, ZdcSimpleRecAlgo::initPulseCorr(), eostools::move(), myobject, 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

◆ det_

DetId::Detector ZdcSimpleReconstructor::det_
private

Definition at line 33 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

◆ dropZSmarkedPassed_

bool ZdcSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 39 of file ZdcSimpleReconstructor.h.

Referenced by produce().

◆ hcalTimeSlew_delay_

const HcalTimeSlew* ZdcSimpleReconstructor::hcalTimeSlew_delay_
private

Definition at line 43 of file ZdcSimpleReconstructor.h.

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

◆ myobject

HcalLongRecoParams* ZdcSimpleReconstructor::myobject
private

Definition at line 41 of file ZdcSimpleReconstructor.h.

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

◆ reco_

ZdcSimpleRecAlgo ZdcSimpleReconstructor::reco_
private

Definition at line 32 of file ZdcSimpleReconstructor.h.

Referenced by produce().

◆ subdet_

int ZdcSimpleReconstructor::subdet_
private

Definition at line 34 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

◆ subdetOther_

HcalOtherSubdetector ZdcSimpleReconstructor::subdetOther_
private

Definition at line 35 of file ZdcSimpleReconstructor.h.

Referenced by ZdcSimpleReconstructor().

◆ tok_input_castor

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

Definition at line 37 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

◆ tok_input_hcal

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

Definition at line 36 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

HcalOther
Definition: HcalAssistant.h:38
mps_fire.i
i
Definition: mps_fire.py:355
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
HcalLongRecoParamsRcd
Definition: HcalLongRecoParamsRcd.h:6
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:36
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DetId::Hcal
Definition: DetId.h:28
edm::LogInfo
Definition: MessageLogger.h:254
ZdcSimpleReconstructor::myobject
HcalLongRecoParams * myobject
Definition: ZdcSimpleReconstructor.h:41
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
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
HcalDbService::getHcalShape
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:326
HcalDbService::getHcalCalibrations
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:65
HcalDbService::getHcalCoder
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:319
DetId
Definition: DetId.h:17
HcalZDCDetId
Definition: HcalZDCDetId.h:16
ZdcSimpleReconstructor::det_
DetId::Detector det_
Definition: ZdcSimpleReconstructor.h:33
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
edm::ESHandle
Definition: DTSurvey.h:22
HcalTimeSlewRecord
Definition: HcalTimeSlewRecord.h:4
ZdcSimpleReconstructor::hcalTimeSlew_delay_
const HcalTimeSlew * hcalTimeSlew_delay_
Definition: ZdcSimpleReconstructor.h:43
HcalCalibration
Definition: HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
HcalCalibrations
Definition: HcalCalibrations.h:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:34
HcalLongRecoParam
Definition: HcalLongRecoParam.h:15
get
#define get
HcalLongRecoParam::signalTS
std::vector< unsigned int > signalTS() const
Definition: HcalLongRecoParam.h:26
HcalQIECoder
Definition: HcalQIECoder.h:20
eostools.move
def move(src, dest)
Definition: eostools.py:511
ZdcSimpleReconstructor::dropZSmarkedPassed_
bool dropZSmarkedPassed_
Definition: ZdcSimpleReconstructor.h:39
ZdcSimpleReconstructor::subdetOther_
HcalOtherSubdetector subdetOther_
Definition: ZdcSimpleReconstructor.h:35
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
phase2TrackerDigitizer_cfi.delay
delay
Definition: phase2TrackerDigitizer_cfi.py:67
ZdcSimpleReconstructor::reco_
ZdcSimpleRecAlgo reco_
Definition: ZdcSimpleReconstructor.h:32
HcalLongRecoParams
Definition: HcalLongRecoParams.h:9
ZdcSimpleReconstructor::tok_input_castor
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
Definition: ZdcSimpleReconstructor.h:37
HcalDbRecord
Definition: HcalDbRecord.h:30
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::InputTag
Definition: InputTag.h:15
edm::SortedCollection::empty
bool empty() const
Definition: SortedCollection.h:210
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37