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 ( const edm::ParameterSet ps)
explicit

Definition at line 13 of file ZdcSimpleReconstructor.cc.

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.

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 }
HcalOtherSubdetector subdetOther_
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
const HcalTimeSlew * hcalTimeSlew_delay_
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
ZdcSimpleReconstructor::~ZdcSimpleReconstructor ( )
override

Definition at line 41 of file ZdcSimpleReconstructor.cc.

41 {}

Member Function Documentation

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

Definition at line 52 of file ZdcSimpleReconstructor.cc.

References myobject.

52  {
53  delete myobject;
54  myobject = nullptr;
55 }
HcalLongRecoParams * myobject
void ZdcSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 56 of file ZdcSimpleReconstructor.cc.

References edm::SortedCollection< T, SORT >::begin(), AlignmentProducer_cff::calibrations, DetId::Calo, det_, dropZSmarkedPassed_, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::EventSetup::get(), edm::Event::getByToken(), HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalCondObjectContainer< Item >::getValues(), hcalTimeSlew_delay_, mps_fire::i, ZdcSimpleRecAlgo::initPulseCorr(), eostools::move(), myobject, HcalLongRecoParam::noiseTS(), edm::Event::put(), reco_, ZdcSimpleRecAlgo::reconstruct(), HcalLongRecoParam::signalTS(), edm::SortedCollection< T, SORT >::size(), subdet_, HcalZDCDetId::SubdetectorId, tok_input_castor, and tok_input_hcal.

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()) {
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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::vector< unsigned int > signalTS() const
HcalLongRecoParams * myobject
void initPulseCorr(int toadd, const HcalTimeSlew *hcalTimeSlew_delay)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
std::vector< T >::const_iterator const_iterator
const HcalTimeSlew * hcalTimeSlew_delay_
const Item * getValues(DetId fId, bool throwOnFail=true) const
ZDCRecHit reconstruct(const ZDCDataFrame &digi, const std::vector< unsigned int > &myNoiseTS, const std::vector< unsigned int > &mySignalTS, const HcalCoder &coder, const HcalCalibrations &calibs) const
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
const_iterator end() const
Definition: DetId.h:17
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
size_type size() const
std::vector< unsigned int > noiseTS() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
def move(src, dest)
Definition: eostools.py:511
const_iterator begin() const

Member Data Documentation

DetId::Detector ZdcSimpleReconstructor::det_
private

Definition at line 33 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

bool ZdcSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 39 of file ZdcSimpleReconstructor.h.

Referenced by produce().

const HcalTimeSlew* ZdcSimpleReconstructor::hcalTimeSlew_delay_
private

Definition at line 43 of file ZdcSimpleReconstructor.h.

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

HcalLongRecoParams* ZdcSimpleReconstructor::myobject
private

Definition at line 41 of file ZdcSimpleReconstructor.h.

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

ZdcSimpleRecAlgo ZdcSimpleReconstructor::reco_
private

Definition at line 32 of file ZdcSimpleReconstructor.h.

Referenced by produce().

int ZdcSimpleReconstructor::subdet_
private

Definition at line 34 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

HcalOtherSubdetector ZdcSimpleReconstructor::subdetOther_
private

Definition at line 35 of file ZdcSimpleReconstructor.h.

Referenced by ZdcSimpleReconstructor().

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

Definition at line 37 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

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

Definition at line 36 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().