CMS 3D CMS Logo

ZdcSimpleReconstructor.cc
Go to the documentation of this file.
10 
11 #include <iostream>
12 
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")),
20  det_(DetId::Hcal),
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 
45  myobject = new HcalLongRecoParams(*p.product());
46 
48  es.get<HcalTimeSlewRecord>().get("HBHE", delay);
50 }
51 
53  delete myobject;
54  myobject = nullptr;
55 }
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 }
HcalOther
Definition: HcalAssistant.h:38
ZdcSimpleReconstructor::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: ZdcSimpleReconstructor.cc:56
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:372
HcalCalibrations.h
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
ESHandle.h
HcalLongRecoParam::noiseTS
std::vector< unsigned int > noiseTS() const
Definition: HcalLongRecoParam.h:27
edm::Run
Definition: Run.h:45
ZdcSimpleReconstructor::tok_input_hcal
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
Definition: ZdcSimpleReconstructor.h:36
ZdcSimpleReconstructor::ZdcSimpleReconstructor
ZdcSimpleReconstructor(const edm::ParameterSet &ps)
Definition: ZdcSimpleReconstructor.cc:13
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
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
ZdcSimpleReconstructor.h
HcalDbService::getHcalShape
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:326
HcalCoderDb.h
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::~ZdcSimpleReconstructor
~ZdcSimpleReconstructor() override
Definition: ZdcSimpleReconstructor.cc:41
ZdcSimpleReconstructor::det_
DetId::Detector det_
Definition: ZdcSimpleReconstructor.h:33
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
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
HcalDbRecord.h
HcalCalibrations
Definition: HcalCalibrations.h:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
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
createfilelist.int
int
Definition: createfilelist.py:10
HcalLongRecoParam
Definition: HcalLongRecoParam.h:15
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
HcalLongRecoParam::signalTS
std::vector< unsigned int > signalTS() const
Definition: HcalLongRecoParam.h:26
HcalQIECoder
Definition: HcalQIECoder.h:20
ZdcSimpleReconstructor::endRun
void endRun(edm::Run const &r, edm::EventSetup const &es) final
Definition: ZdcSimpleReconstructor.cc:52
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
ZdcSimpleReconstructor::dropZSmarkedPassed_
bool dropZSmarkedPassed_
Definition: ZdcSimpleReconstructor.h:39
ZdcSimpleReconstructor::beginRun
void beginRun(edm::Run const &r, edm::EventSetup const &es) final
Definition: ZdcSimpleReconstructor.cc:42
ZdcSimpleReconstructor::subdetOther_
HcalOtherSubdetector subdetOther_
Definition: ZdcSimpleReconstructor.h:35
EventSetup.h
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
HcalDbService.h
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
edm::Event
Definition: Event.h:73
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
EDCollection.h
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